diff --git a/assets/AppCoreExtensions-legacy-ByBl5Y8-.js b/assets/AppCoreExtensions-legacy-ByBl5Y8-.js deleted file mode 100644 index ae9741c..0000000 --- a/assets/AppCoreExtensions-legacy-ByBl5Y8-.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(){function t(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t=function(){return e};var r,e={},n=Object.prototype,o=n.hasOwnProperty,i=Object.defineProperty||function(t,r,e){t[r]=e.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",f=a.toStringTag||"@@toStringTag";function l(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{l({},"")}catch(r){l=function(t,r,e){return t[r]=e}}function s(t,r,e,n){var o=r&&r.prototype instanceof m?r:m,a=Object.create(o.prototype),c=new T(n||[]);return i(a,"_invoke",{value:P(t,e,c)}),a}function h(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",v="executing",d="completed",g={};function m(){}function w(){}function b(){}var x={};l(x,c,(function(){return this}));var E=Object.getPrototypeOf,O=E&&E(E(F([])));O&&O!==n&&o.call(O,c)&&(x=O);var j=b.prototype=m.prototype=Object.create(x);function L(t){["next","throw","return"].forEach((function(r){l(t,r,(function(t){return this._invoke(r,t)}))}))}function _(t,r){function e(n,i,a,c){var u=h(t[n],t,i);if("throw"!==u.type){var f=u.arg,l=f.value;return l&&"object"==typeof l&&o.call(l,"__await")?r.resolve(l.__await).then((function(t){e("next",t,a,c)}),(function(t){e("throw",t,a,c)})):r.resolve(l).then((function(t){f.value=t,a(f)}),(function(t){return e("throw",t,a,c)}))}c(u.arg)}var n;i(this,"_invoke",{value:function(t,o){function i(){return new r((function(r,n){e(t,o,r,n)}))}return n=n?n.then(i,i):i()}})}function P(t,e,n){var o=p;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:r,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=S(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var f=h(t,e,n);if("normal"===f.type){if(o=n.done?d:y,f.arg===g)continue;return{value:f.arg,done:n.done}}"throw"===f.type&&(o=d,n.method="throw",n.arg=f.arg)}}}function S(t,e){var n=e.method,o=t.iterator[n];if(o===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=r,S(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=h(o,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,g;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,g):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,g)}function k(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function N(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function F(t){if(t||""===t){var e=t[c];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),f=o.call(a,"finallyLoc");if(u&&f){if(this.prev=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),N(e),g}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;N(e)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:F(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),g}},e}function r(t,r,e,n,o,i,a){try{var c=t[i](a),u=c.value}catch(f){return void e(f)}c.done?r(u):Promise.resolve(u).then(n,o)}function e(t,r){for(var e=0;e=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),f=o.call(a,"finallyLoc");if(u&&f){if(this.prev=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),F(e),g}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;F(e)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:G(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),g}},e}function r(t,r,e,n,o,i,a){try{var c=t[i](a),u=c.value}catch(f){return void e(f)}c.done?r(u):Promise.resolve(u).then(n,o)}System.register(["./CoreExtension-legacy-Djp23FNT.js"],(function(e,n){"use strict";var o,i,a;return{setters:[t=>{o=t.C,i=t.W,a=t.S}],execute:function(){var n="/solid-demo-app/";e("default",class extends o{run(e){return(o=t().mark((function r(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.fontManager.addFontFace(new i("NotoSans",{},n+"fonts/NotoSans-Regular.ttf")),e.fontManager.addFontFace(new a("Ubuntu",{},"msdf",e,n+"fonts/Ubuntu-Bold.msdf.png",n+"fonts/Ubuntu-Bold.msdf.json"));case 2:case"end":return t.stop()}}),r)})),function(){var t=this,e=arguments;return new Promise((function(n,i){var a=o.apply(t,e);function c(t){r(a,n,i,c,u,"next",t)}function u(t){r(a,n,i,c,u,"throw",t)}c(void 0)}))})();var o}})}}}))}(); +//# sourceMappingURL=AppCoreExtensions-legacy-CjL-s2b8.js.map diff --git a/assets/AppCoreExtensions-legacy-CjL-s2b8.js.map b/assets/AppCoreExtensions-legacy-CjL-s2b8.js.map new file mode 100644 index 0000000..8791fdb --- /dev/null +++ b/assets/AppCoreExtensions-legacy-CjL-s2b8.js.map @@ -0,0 +1 @@ +{"version":3,"file":"AppCoreExtensions-legacy-CjL-s2b8.js","sources":["../../src/AppCoreExtensions.ts"],"sourcesContent":["/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n CoreExtension,\n WebTrFontFace,\n SdfTrFontFace,\n type Stage,\n} from \"@lightningjs/renderer/core\";\n\nconst basePath = import.meta.env.BASE_URL;\n\nexport default class AppCoreExtension extends CoreExtension {\n async run(stage: Stage) {\n stage.fontManager.addFontFace(\n new WebTrFontFace(\n \"NotoSans\",\n {},\n basePath + \"fonts/NotoSans-Regular.ttf\",\n ),\n );\n stage.fontManager.addFontFace(\n new SdfTrFontFace(\n \"Ubuntu\",\n {},\n \"msdf\",\n stage,\n basePath + \"fonts/Ubuntu-Bold.msdf.png\",\n basePath + \"fonts/Ubuntu-Bold.msdf.json\",\n ),\n );\n }\n}\n"],"names":["basePath","exports","CoreExtension","run","stage","_asyncToGenerator","_regeneratorRuntime","mark","_callee","wrap","_callee$","_context","prev","next","fontManager","addFontFace","WebTrFontFace","SdfTrFontFace","stop"],"mappings":"oyNA0BA,IAAMA,EAAW,mBAsBjBC,EAAA,UApBA,cAA8CC,EACtCC,GAAAA,CAAIC,GAAcC,SAAAC,IAAAC,MAAAC,SAAAA,IAAAF,OAAAA,IAAAG,MAAAC,SAAAC,GAAA,cAAAA,EAAAC,KAAAD,EAAAE,MAAA,KAAA,EACtBT,EAAMU,YAAYC,YAChB,IAAIC,EACF,WACA,CAAC,EACDhB,EAAW,+BAGfI,EAAMU,YAAYC,YAChB,IAAIE,EACF,SACA,CAAC,EACD,OACAb,EACAJ,EAAW,6BACXA,EAAW,gCAEf,KAAAW,EAAAA,IAAAA,MAAAA,OAAAA,EAAAO,OAAAV,GAAAA,EACF,0LAAA"} \ No newline at end of file diff --git a/assets/AppCoreExtensions-tiD9qKNE.js.map b/assets/AppCoreExtensions-tiD9qKNE.js.map index 51105e5..d046c1d 100644 --- a/assets/AppCoreExtensions-tiD9qKNE.js.map +++ b/assets/AppCoreExtensions-tiD9qKNE.js.map @@ -1 +1 @@ -{"version":3,"file":"AppCoreExtensions-tiD9qKNE.js","sources":["../../src/AppCoreExtensions.ts"],"sourcesContent":["/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n CoreExtension,\n WebTrFontFace,\n SdfTrFontFace,\n type Stage,\n} from '@lightningjs/renderer/core';\n\nconst basePath = import.meta.env.BASE_URL;\n\nexport default class AppCoreExtension extends CoreExtension {\n async run(stage: Stage) {\n stage.fontManager.addFontFace(\n new WebTrFontFace('NotoSans', {}, basePath + 'fonts/NotoSans-Regular.ttf'),\n );\n stage.fontManager.addFontFace(\n new SdfTrFontFace(\n 'Ubuntu',\n {},\n 'msdf',\n stage,\n basePath + 'fonts/Ubuntu-Bold.msdf.png',\n basePath + 'fonts/Ubuntu-Bold.msdf.json',\n ),\n );\n }\n}\n"],"names":["basePath","AppCoreExtension","CoreExtension","stage","WebTrFontFace","SdfTrFontFace"],"mappings":"iJA0BA,MAAMA,EAAW,mBAEjB,MAAqBC,UAAyBC,CAAc,CAC1D,MAAM,IAAIC,EAAc,CACtBA,EAAM,YAAY,YAChB,IAAIC,EAAc,WAAY,GAAIJ,EAAW,4BAA4B,CAAA,EAE3EG,EAAM,YAAY,YAChB,IAAIE,EACF,SACA,CAAC,EACD,OACAF,EACAH,EAAW,6BACXA,EAAW,6BACb,CAAA,CAEJ,CACF"} \ No newline at end of file +{"version":3,"file":"AppCoreExtensions-tiD9qKNE.js","sources":["../../src/AppCoreExtensions.ts"],"sourcesContent":["/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n CoreExtension,\n WebTrFontFace,\n SdfTrFontFace,\n type Stage,\n} from \"@lightningjs/renderer/core\";\n\nconst basePath = import.meta.env.BASE_URL;\n\nexport default class AppCoreExtension extends CoreExtension {\n async run(stage: Stage) {\n stage.fontManager.addFontFace(\n new WebTrFontFace(\n \"NotoSans\",\n {},\n basePath + \"fonts/NotoSans-Regular.ttf\",\n ),\n );\n stage.fontManager.addFontFace(\n new SdfTrFontFace(\n \"Ubuntu\",\n {},\n \"msdf\",\n stage,\n basePath + \"fonts/Ubuntu-Bold.msdf.png\",\n basePath + \"fonts/Ubuntu-Bold.msdf.json\",\n ),\n );\n }\n}\n"],"names":["basePath","AppCoreExtension","CoreExtension","stage","WebTrFontFace","SdfTrFontFace"],"mappings":"iJA0BA,MAAMA,EAAW,mBAEjB,MAAqBC,UAAyBC,CAAc,CAC1D,MAAM,IAAIC,EAAc,CACtBA,EAAM,YAAY,YAChB,IAAIC,EACF,WACA,CAAC,EACDJ,EAAW,4BACb,CAAA,EAEFG,EAAM,YAAY,YAChB,IAAIE,EACF,SACA,CAAC,EACD,OACAF,EACAH,EAAW,6BACXA,EAAW,6BACb,CAAA,CAEJ,CACF"} \ No newline at end of file diff --git a/assets/CoreExtension-BSpcUIDc.js.map b/assets/CoreExtension-BSpcUIDc.js.map index 2acbf5f..742ca86 100644 --- a/assets/CoreExtension-BSpcUIDc.js.map +++ b/assets/CoreExtension-BSpcUIDc.js.map @@ -1 +1 @@ -{"version":3,"file":"CoreExtension-BSpcUIDc.js","sources":["../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/utils.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/common/EventEmitter.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/CoreShader.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/internal/ShaderUtils.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/internal/WebGlUtils.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/WebGlCoreShader.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/textures/Texture.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/lib/utils.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/font-face-types/TrFontFace.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/font-face-types/WebTrFontFace.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/CoreContextTexture.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/CoreRenderer.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/CoreRenderOp.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/WebGlCoreRenderOp.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/internal/RendererUtils.js","../../../../node_modules/.pnpm/memize@2.1.0/node_modules/memize/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/utils.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/WebGlCoreCtxTexture.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/textures/ColorTexture.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/textures/SubTexture.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/WebGlCoreCtxSubTexture.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/internal/BufferCollection.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/lib/WebGlContextWrapper.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/WebGlCoreRenderer.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/SpecialCodepoints.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/font-face-types/SdfTrFontFace/internal/FontShaper.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/font-face-types/SdfTrFontFace/internal/SdfFontShaper.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/font-face-types/SdfTrFontFace/SdfTrFontFace.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/CoreExtension.js"],"sourcesContent":["/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport function createWebGLContext(canvas, contextSpy) {\n const config = {\n alpha: true,\n antialias: false,\n depth: false,\n stencil: true,\n desynchronized: false,\n // Disabled because it prevents Visual Regression Tests from working\n // failIfMajorPerformanceCaveat: true,\n powerPreference: 'high-performance',\n premultipliedAlpha: true,\n preserveDrawingBuffer: false,\n };\n const gl = \n // TODO: Remove this assertion once this issue is fixed in TypeScript\n // https://github.com/microsoft/TypeScript/issues/53614\n (canvas.getContext('webgl', config) ||\n canvas.getContext('experimental-webgl', config));\n if (!gl) {\n throw new Error('Unable to create WebGL context');\n }\n if (contextSpy) {\n // Proxy the GL context to log all GL calls\n return new Proxy(gl, {\n get(target, prop) {\n const value = target[prop];\n if (typeof value === 'function') {\n contextSpy.increment(String(prop));\n return value.bind(target);\n }\n return value;\n },\n });\n }\n return gl;\n}\n/**\n * Asserts a condition is truthy, otherwise throws an error\n *\n * @remarks\n * Useful at the top of functions to ensure certain conditions, arguments and\n * properties are set/met before continuing. When using this function,\n * TypeScript will narrow away falsy types from the condition.\n *\n * @param condition\n * @param message\n * @returns\n */\nexport function assertTruthy(condition, message) {\n if (isProductionEnvironment())\n return;\n if (!condition) {\n throw new Error(message || 'Assertion failed');\n }\n}\n/**\n * Merges two colors based on a given progress value.\n *\n * This function takes two colors (c1 and c2) represented as 32-bit integers\n * in RGBA format and blends them based on the provided progress value (p).\n * The result is a new color that is a weighted combination of the input colors,\n * where the weight is determined by the progress value.\n *\n * @param {number} c1 - The first color in RGBA format (32-bit integer).\n * @param {number} c2 - The second color in RGBA format (32-bit integer).\n * @param {number} p - The progress value between 0 and 1.\n * @returns {number} The merged color as a 32-bit integer in RGBA format.\n */\nexport function mergeColorProgress(rgba1, rgba2, p) {\n const r1 = Math.trunc(rgba1 >>> 24);\n const g1 = Math.trunc((rgba1 >>> 16) & 0xff);\n const b1 = Math.trunc((rgba1 >>> 8) & 0xff);\n const a1 = Math.trunc(rgba1 & 0xff);\n const r2 = Math.trunc(rgba2 >>> 24);\n const g2 = Math.trunc((rgba2 >>> 16) & 0xff);\n const b2 = Math.trunc((rgba2 >>> 8) & 0xff);\n const a2 = Math.trunc(rgba2 & 0xff);\n const r = Math.round(r2 * p + r1 * (1 - p));\n const g = Math.round(g2 * p + g1 * (1 - p));\n const b = Math.round(b2 * p + b1 * (1 - p));\n const a = Math.round(a2 * p + a1 * (1 - p));\n return ((r << 24) | (g << 16) | (b << 8) | a) >>> 0;\n}\n/**\n * Given an RGBA encoded number, returns back the RGBA number with it's alpha\n * component multiplied by the passed `alpha` parameter.\n *\n * @internalRemarks\n * This method does NOT premultiply the alpha into the color channels. If that\n * is required (for internal use only) use {@link mergeColorAlphaPremultiplied}\n * instead.\n *\n * @param rgba RGBA encoded number\n * @param alpha Normalized alpha value (Range: 0.0 - 1.0)\n * @returns\n */\nexport function mergeColorAlpha(rgba, alpha) {\n const r = rgba >>> 24;\n const g = (rgba >>> 16) & 0xff;\n const b = (rgba >>> 8) & 0xff;\n const a = Math.trunc((rgba & 0xff) * alpha);\n return ((r << 24) | (g << 16) | (b << 8) | a) >>> 0;\n}\n/**\n * Given an RGBA encoded number, returns back the RGBA number with it's alpha\n * component multiplied by the passed `alpha` parameter. Before returning, the\n * final alpha value is multiplied into the color channels.\n *\n * @remarks\n * If `flipEndianess` is set to true, the function will returned an ABGR encoded number\n * which is useful when the color value needs to be passed into a shader attribute.\n *\n * NOTE: This method returns a PREMULTIPLIED alpha color which is generally only useful\n * in the context of the internal rendering process. Use {@link mergeColorAlpha} if you\n * need to blend an alpha value into a color in the context of the Renderer's\n * main API.\n *\n * @internalRemarks\n * Do not expose this method in the main API because Renderer users should instead use\n * {@link mergeColorAlpha} to manipulate the alpha value of a color.\n *\n * @internal\n * @param rgba RGBA encoded number\n * @param alpha Normalized alpha value (Range: 0.0 - 1.0)\n * @param flipEndianess Flip the endianess. RGBA becomes encoded as ABGR (for inserting colors into shader attributes)\n * @returns\n */\nexport function mergeColorAlphaPremultiplied(rgba, alpha, flipEndianess = false) {\n const newAlpha = ((rgba & 0xff) / 255) * alpha;\n const r = Math.trunc((rgba >>> 24) * newAlpha);\n const g = Math.trunc(((rgba >>> 16) & 0xff) * newAlpha);\n const b = Math.trunc(((rgba >>> 8) & 0xff) * newAlpha);\n const a = Math.trunc(newAlpha * 255);\n if (flipEndianess) {\n return ((a << 24) | (b << 16) | (g << 8) | r) >>> 0;\n }\n return ((r << 24) | (g << 16) | (b << 8) | a) >>> 0;\n}\n/**\n * Returns true if the given object has the given \"own\" property.\n *\n * @param obj\n * @param prop\n * @returns\n */\nexport function hasOwn(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n/**\n * Converts degrees to radians\n *\n * @param degrees\n * @returns\n */\nexport function deg2Rad(degrees) {\n return (degrees * Math.PI) / 180;\n}\n/**\n * Checks import.meta if env is production\n *\n * @returns\n */\nexport function isProductionEnvironment() {\n return import.meta.env && import.meta.env.PROD;\n}\n//# sourceMappingURL=utils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * EventEmitter base class\n */\nexport class EventEmitter {\n eventListeners = {};\n on(event, listener) {\n let listeners = this.eventListeners[event];\n if (!listeners) {\n listeners = [];\n }\n listeners.push(listener);\n this.eventListeners[event] = listeners;\n }\n off(event, listener) {\n const listeners = this.eventListeners[event];\n if (!listeners) {\n return;\n }\n if (!listener) {\n delete this.eventListeners[event];\n return;\n }\n const index = listeners.indexOf(listener);\n if (index >= 0) {\n listeners.splice(index, 1);\n }\n }\n once(event, listener) {\n const onceListener = (target, data) => {\n this.off(event, onceListener);\n listener(target, data);\n };\n this.on(event, onceListener);\n }\n emit(event, data) {\n const listeners = this.eventListeners[event];\n if (!listeners) {\n return;\n }\n [...listeners].forEach((listener) => {\n listener(this, data);\n });\n }\n removeAllListeners() {\n this.eventListeners = {};\n }\n}\n//# sourceMappingURL=EventEmitter.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class CoreShader {\n // abstract draw(): void;\n static makeCacheKey(props) {\n return false;\n }\n static resolveDefaults(props) {\n return {};\n }\n}\n//# sourceMappingURL=CoreShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion Types\nexport function createShader(glw, type, source) {\n const shader = glw.createShader(type);\n if (!shader) {\n throw new Error();\n }\n glw.shaderSource(shader, source);\n glw.compileShader(shader);\n const success = glw.getShaderParameter(shader, glw.COMPILE_STATUS);\n if (success) {\n return shader;\n }\n console.log(glw.getShaderInfoLog(shader));\n glw.deleteShader(shader);\n}\nexport function createProgram(glw, vertexShader, fragmentShader) {\n const program = glw.createProgram();\n if (!program) {\n throw new Error();\n }\n glw.attachShader(program, vertexShader);\n glw.attachShader(program, fragmentShader);\n glw.linkProgram(program);\n const success = glw.getProgramParameter(program, glw.LINK_STATUS);\n if (success) {\n return program;\n }\n console.log(glw.getProgramInfoLog(program));\n glw.deleteProgram(program);\n return undefined;\n}\n//# sourceMappingURL=ShaderUtils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Generic WebGL Utility Functions\n *\n * @remarks\n * Nothing here should be coupled to Renderer logic / types.\n *\n * @param gl\n * @returns\n */\nexport function isWebGl2(gl) {\n return (self.WebGL2RenderingContext && gl instanceof self.WebGL2RenderingContext);\n}\n//# sourceMappingURL=WebGlUtils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy, hasOwn } from '../../../utils.js';\nimport { CoreShader } from '../CoreShader.js';\nimport { createProgram, createShader, } from './internal/ShaderUtils.js';\nimport { isWebGl2 } from './internal/WebGlUtils.js';\nexport class WebGlCoreShader extends CoreShader {\n boundBufferCollection = null;\n buffersBound = false;\n program;\n /**\n * Vertex Array Object\n *\n * @remarks\n * Used by WebGL2 Only\n */\n vao;\n renderer;\n glw;\n attributeBuffers;\n attributeLocations;\n attributeNames;\n uniformLocations;\n uniformTypes;\n supportsIndexedTextures;\n constructor(options) {\n super();\n const renderer = (this.renderer = options.renderer);\n const glw = (this.glw = this.renderer.glw);\n this.supportsIndexedTextures = options.supportsIndexedTextures || false;\n // Check that extensions are supported\n const webGl2 = glw.isWebGl2();\n const requiredExtensions = (webGl2 && options.webgl2Extensions) ||\n (!webGl2 && options.webgl1Extensions) ||\n [];\n const glVersion = webGl2 ? '2.0' : '1.0';\n requiredExtensions.forEach((extensionName) => {\n if (!glw.getExtension(extensionName)) {\n throw new Error(`Shader \"${this.constructor.name}\" requires extension \"${extensionName}\" for WebGL ${glVersion} but wasn't found`);\n }\n });\n // Gather shader sources\n // - If WebGL 2 and special WebGL 2 sources are provided, we copy those sources and delete\n // the extra copy of them to save memory.\n // TODO: This could be further made optimal by just caching the compiled shaders and completely deleting\n // the source code\n const shaderSources = options.shaderSources ||\n this.constructor.shaderSources;\n if (!shaderSources) {\n throw new Error(`Shader \"${this.constructor.name}\" is missing shaderSources.`);\n }\n else if (webGl2 && shaderSources?.webGl2) {\n shaderSources.fragment = shaderSources.webGl2.fragment;\n shaderSources.vertex = shaderSources.webGl2.vertex;\n delete shaderSources.webGl2;\n }\n const textureUnits = renderer.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS;\n const vertexSource = shaderSources.vertex instanceof Function\n ? shaderSources.vertex(textureUnits)\n : shaderSources.vertex;\n const fragmentSource = shaderSources.fragment instanceof Function\n ? shaderSources.fragment(textureUnits)\n : shaderSources.fragment;\n const vertexShader = createShader(glw, glw.VERTEX_SHADER, vertexSource);\n const fragmentShader = createShader(glw, glw.FRAGMENT_SHADER, fragmentSource);\n if (!vertexShader || !fragmentShader) {\n throw new Error();\n }\n const program = createProgram(glw, vertexShader, fragmentShader);\n if (!program) {\n throw new Error();\n }\n this.program = program;\n if (webGl2) {\n const vao = glw.createVertexArray();\n if (!vao) {\n throw new Error();\n }\n this.vao = vao;\n glw.bindVertexArray(this.vao);\n }\n this.attributeLocations = {};\n this.attributeBuffers = {};\n this.attributeNames = [];\n [...options.attributes].forEach((attributeName) => {\n const location = glw.getAttribLocation(this.program, attributeName);\n if (location < 0) {\n throw new Error(`${this.constructor.name}: Vertex shader must have an attribute \"${attributeName}\"!`);\n }\n const buffer = glw.createBuffer();\n if (!buffer) {\n throw new Error(`${this.constructor.name}: Could not create buffer for attribute \"${attributeName}\"`);\n }\n this.attributeLocations[attributeName] = location;\n this.attributeBuffers[attributeName] = buffer;\n this.attributeNames.push(attributeName);\n });\n this.uniformLocations = {};\n this.uniformTypes = {};\n options.uniforms.forEach((uniform) => {\n const location = glw.getUniformLocation(this.program, uniform.name);\n this.uniformTypes[uniform.name] = uniform.uniform;\n if (!location) {\n console.warn(`Shader \"${this.constructor.name}\" could not get uniform location for \"${uniform.name}\"`);\n return;\n }\n this.uniformLocations[uniform.name] = location;\n });\n }\n bindBufferAttribute(location, buffer, attribute) {\n const { glw } = this;\n glw.enableVertexAttribArray(location);\n glw.vertexAttribPointer(buffer, location, attribute.size, attribute.type, attribute.normalized, attribute.stride, attribute.offset);\n }\n disableAttribute(location) {\n this.glw.disableVertexAttribArray(location);\n }\n disableAttributes() {\n for (const loc in this.attributeLocations) {\n this.disableAttribute(this.attributeLocations[loc]);\n }\n this.boundBufferCollection = null;\n }\n /**\n * Given two sets of Shader props destined for this Shader, determine if they can be batched together\n * to reduce the number of draw calls.\n *\n * @remarks\n * This is used by the {@link WebGlCoreRenderer} to determine if it can batch multiple consecutive draw\n * calls into a single draw call.\n *\n * By default, this returns false (meaning no batching is allowed), but can be\n * overridden by child classes to provide more efficient batching.\n *\n * @param propsA\n * @param propsB\n * @returns\n */\n canBatchShaderProps(propsA, propsB) {\n return false;\n }\n bindRenderOp(renderOp, props) {\n this.bindBufferCollection(renderOp.buffers);\n if (renderOp.textures.length > 0) {\n this.bindTextures(renderOp.textures);\n }\n const { glw } = renderOp;\n // Bind standard automatic uniforms\n this.setUniform('u_resolution', [glw.canvas.width, glw.canvas.height]);\n this.setUniform('u_pixelRatio', renderOp.options.pixelRatio);\n if (props) {\n // Bind optional automatic uniforms\n // These are only bound if their keys are present in the props.\n if (hasOwn(props, '$dimensions')) {\n let dimensions = props.$dimensions;\n if (!dimensions) {\n dimensions = renderOp.dimensions;\n }\n this.setUniform('u_dimensions', [dimensions.width, dimensions.height]);\n }\n if (hasOwn(props, '$alpha')) {\n let alpha = props.$alpha;\n if (!alpha) {\n alpha = renderOp.alpha;\n }\n this.setUniform('u_alpha', alpha);\n }\n this.bindProps(props);\n }\n }\n setUniform(name, ...value) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-unsafe-argument\n this.glw.setUniform(this.uniformTypes[name], this.uniformLocations[name], ...value);\n }\n bindBufferCollection(buffer) {\n if (this.boundBufferCollection === buffer) {\n return;\n }\n for (const attributeName in this.attributeLocations) {\n const resolvedBuffer = buffer.getBuffer(attributeName);\n const resolvedInfo = buffer.getAttributeInfo(attributeName);\n assertTruthy(resolvedBuffer, `Buffer for \"${attributeName}\" not found`);\n assertTruthy(resolvedInfo);\n this.bindBufferAttribute(this.attributeLocations[attributeName], resolvedBuffer, resolvedInfo);\n }\n this.boundBufferCollection = buffer;\n }\n bindProps(props) {\n // Implement in child class\n }\n bindTextures(textures) {\n // no defaults\n }\n attach() {\n this.glw.useProgram(this.program);\n this.glw.useProgram(this.program);\n if (this.glw.isWebGl2() && this.vao) {\n this.glw.bindVertexArray(this.vao);\n }\n }\n detach() {\n this.disableAttributes();\n }\n static shaderSources;\n}\n//# sourceMappingURL=WebGlCoreShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EventEmitter } from '../../common/EventEmitter.js';\n/**\n * Represents a source of texture data for a CoreContextTexture.\n *\n * @remarks\n * Texture sources are used to populate a CoreContextTexture when that texture\n * is loaded. Texture data retrieved by the CoreContextTexture by the\n * `getTextureData` method. It's the responsibility of the concerete `Texture`\n * subclass to implement this method appropriately.\n */\nexport class Texture extends EventEmitter {\n txManager;\n /**\n * The dimensions of the texture\n *\n * @remarks\n * Until the texture data is loaded for the first time the value will be\n * `null`.\n */\n dimensions = null;\n error = null;\n state = 'freed';\n renderableOwners = new Set();\n constructor(txManager) {\n super();\n this.txManager = txManager;\n }\n /**\n * Add/remove an owner to/from the Texture based on its renderability.\n *\n * @remarks\n * Any object can own a texture, be it a CoreNode or even the state object\n * from a Text Renderer.\n *\n * When the reference to the texture that an owner object holds is replaced\n * or cleared it must call this with `renderable=false` to release the owner\n * association.\n *\n * @param owner\n * @param renderable\n */\n setRenderableOwner(owner, renderable) {\n if (renderable) {\n this.renderableOwners.add(owner);\n }\n else {\n this.renderableOwners.delete(owner);\n }\n }\n /**\n * Returns true if the texture is assigned to any Nodes that are renderable.\n */\n get renderable() {\n return this.renderableOwners.size > 0;\n }\n /**\n * Set the state of the texture\n *\n * @remark\n * Intended for internal-use only but declared public so that it can be set\n * by it's associated {@link CoreContextTexture}\n *\n * @param state\n * @param args\n */\n setState(state, ...args) {\n if (this.state !== state) {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.state = state;\n if (state === 'loaded') {\n const loadedArgs = args;\n this.dimensions = loadedArgs[0];\n }\n else if (state === 'failed') {\n const failedArgs = args;\n this.error = failedArgs[0];\n }\n this.emit(state, ...args);\n }\n }\n /**\n * Make a cache key for this texture.\n *\n * @remarks\n * Each concrete `Texture` subclass must implement this method to provide an\n * appropriate cache key for the texture type including the texture's\n * properties that uniquely identify a copy of the texture. If the texture\n * type does not support caching, then this method should return `false`.\n *\n * @param props\n * @returns\n * A cache key for this texture or `false` if the texture type does not\n * support caching.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static makeCacheKey(props) {\n return false;\n }\n /**\n * Resolve the default values for the texture's properties.\n *\n * @remarks\n * Each concrete `Texture` subclass must implement this method to provide\n * default values for the texture's optional properties.\n *\n * @param props\n * @returns\n * The default values for the texture's properties.\n */\n static resolveDefaults(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n props) {\n return {};\n }\n}\n//# sourceMappingURL=Texture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport const getNormalizedRgbaComponents = (rgba) => {\n const r = rgba >>> 24;\n const g = (rgba >>> 16) & 0xff;\n const b = (rgba >>> 8) & 0xff;\n const a = rgba & 0xff;\n return [r / 255, g / 255, b / 255, a / 255];\n};\nexport const getRgbaComponents = (rgba) => {\n const r = rgba >>> 24;\n const g = (rgba >>> 16) & 0xff;\n const b = (rgba >>> 8) & 0xff;\n const a = rgba & 0xff;\n return [r, g, b, a];\n};\nexport const norm = (rgba) => {\n const r = rgba >>> 24;\n const g = (rgba >>> 16) & 0xff;\n const b = (rgba >>> 8) & 0xff;\n const a = rgba & 0xff;\n const rgbaArr = [r / 255, g / 255, b / 255, a / 255];\n rgbaArr[0] = Math.max(0, Math.min(255, rgbaArr[0]));\n rgbaArr[1] = Math.max(0, Math.min(255, rgbaArr[1]));\n rgbaArr[2] = Math.max(0, Math.min(255, rgbaArr[2]));\n rgbaArr[3] = Math.max(0, Math.min(255, rgbaArr[3]));\n let v = ((rgbaArr[3] | 0) << 24) +\n ((rgbaArr[0] | 0) << 16) +\n ((rgbaArr[1] | 0) << 8) +\n (rgbaArr[2] | 0);\n if (v < 0) {\n v = 0xffffffff + v + 1;\n }\n return v;\n};\nexport function getNormalizedAlphaComponent(rgba) {\n return (rgba & 0xff) / 255.0;\n}\n/**\n * Get a CSS color string from a RGBA color\n *\n * @param color\n * @returns\n */\nexport function getRgbaString(color) {\n const r = Math.floor(color[0] * 255.0);\n const g = Math.floor(color[1] * 255.0);\n const b = Math.floor(color[2] * 255.0);\n const a = Math.floor(color[3] * 255.0);\n return `rgba(${r},${g},${b},${a.toFixed(4)})`;\n}\nexport function createBound(x1, y1, x2, y2, out) {\n if (out) {\n out.x1 = x1;\n out.y1 = y1;\n out.x2 = x2;\n out.y2 = y2;\n return out;\n }\n return {\n x1,\n y1,\n x2,\n y2,\n };\n}\nexport function intersectBound(a, b, out) {\n const intersection = createBound(Math.max(a.x1, b.x1), Math.max(a.y1, b.y1), Math.min(a.x2, b.x2), Math.min(a.y2, b.y2), out);\n if (intersection.x1 < intersection.x2 && intersection.y1 < intersection.y2) {\n return intersection;\n }\n return createBound(0, 0, 0, 0, intersection);\n}\nexport function boundsOverlap(a, b) {\n return a.x1 < b.x2 && a.x2 > b.x1 && a.y1 < b.y2 && a.y2 > b.y1;\n}\nexport function convertBoundToRect(bound, out) {\n if (out) {\n out.x = bound.x1;\n out.y = bound.y1;\n out.width = bound.x2 - bound.x1;\n out.height = bound.y2 - bound.y1;\n return out;\n }\n return {\n x: bound.x1,\n y: bound.y1,\n width: bound.x2 - bound.x1,\n height: bound.y2 - bound.y1,\n };\n}\nexport function intersectRect(a, b, out) {\n const x = Math.max(a.x, b.x);\n const y = Math.max(a.y, b.y);\n const width = Math.min(a.x + a.width, b.x + b.width) - x;\n const height = Math.min(a.y + a.height, b.y + b.height) - y;\n if (width > 0 && height > 0) {\n if (out) {\n out.x = x;\n out.y = y;\n out.width = width;\n out.height = height;\n return out;\n }\n return {\n x,\n y,\n width,\n height,\n };\n }\n if (out) {\n out.x = 0;\n out.y = 0;\n out.width = 0;\n out.height = 0;\n return out;\n }\n return {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n };\n}\nexport function copyRect(a, out) {\n if (out) {\n out.x = a.x;\n out.y = a.y;\n out.width = a.width;\n out.height = a.height;\n return out;\n }\n return {\n x: a.x,\n y: a.y,\n width: a.width,\n height: a.height,\n };\n}\nexport function compareRect(a, b) {\n if (a === b) {\n return true;\n }\n if (a === null || b === null) {\n return false;\n }\n return (a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height);\n}\nexport function boundInsideBound(bound1, bound2) {\n return (bound1.x1 <= bound2.x2 &&\n bound1.y1 <= bound2.y2 &&\n bound1.x2 >= bound2.x1 &&\n bound1.y2 >= bound2.y1);\n}\nexport function isBoundPositive(bound) {\n return bound.x1 < bound.x2 && bound.y1 < bound.y2;\n}\nexport function isRectPositive(rect) {\n return rect.width > 0 && rect.height > 0;\n}\n//# sourceMappingURL=utils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EventEmitter } from '../../../common/EventEmitter.js';\nexport class TrFontFace extends EventEmitter {\n fontFamily;\n descriptors;\n loaded = false;\n constructor(fontFamily, descriptors) {\n super();\n this.fontFamily = fontFamily;\n this.descriptors = {\n style: 'normal',\n weight: 'normal',\n stretch: 'normal',\n ...descriptors,\n };\n }\n /**\n * Convert a TrFontFaceDescriptors to a FontFaceDescriptors which differ slightly\n *\n * @param descriptors\n * @returns\n */\n static convertToCssFontFaceDescriptors(descriptors) {\n return {\n style: descriptors.style,\n weight: typeof descriptors.weight === 'number'\n ? `${descriptors.weight}`\n : descriptors.weight,\n stretch: descriptors.stretch,\n unicodeRange: descriptors.unicodeRange,\n variant: descriptors.variant,\n featureSettings: descriptors.featureSettings,\n display: descriptors.display,\n };\n }\n}\n//# sourceMappingURL=TrFontFace.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { TrFontFace } from './TrFontFace.js';\nexport class WebTrFontFace extends TrFontFace {\n fontFace;\n fontUrl;\n constructor(fontFamily, descriptors, fontUrl) {\n super(fontFamily, descriptors);\n // Filter out parentheses from fontUrl\n const fontUrlWithoutParentheses = fontUrl.replace(/\\(|\\)/g, '');\n // Defaults for descriptors resolved in the super constructor\n const determinedDescriptors = this.descriptors;\n // Convert TrFontFaceDescriptors to CSS FontFaceDescriptors\n const cssDescriptors = {\n style: determinedDescriptors.style,\n weight: typeof determinedDescriptors.weight === 'number'\n ? `${determinedDescriptors.weight}`\n : determinedDescriptors.weight,\n stretch: determinedDescriptors.stretch,\n unicodeRange: determinedDescriptors.unicodeRange,\n variant: determinedDescriptors.variant,\n featureSettings: determinedDescriptors.featureSettings,\n display: determinedDescriptors.display,\n };\n const fontFace = new FontFace(fontFamily, `url(${fontUrlWithoutParentheses})`, cssDescriptors);\n fontFace\n .load()\n .then(() => {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.loaded = true;\n this.emit('loaded');\n })\n .catch(console.error);\n this.fontFace = fontFace;\n this.fontUrl = fontUrl;\n }\n}\n//# sourceMappingURL=WebTrFontFace.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class CoreContextTexture {\n memManager;\n textureSource;\n constructor(memManager, textureSource) {\n this.memManager = memManager;\n this.textureSource = textureSource;\n }\n}\n//# sourceMappingURL=CoreContextTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreContextTexture } from './CoreContextTexture.js';\nexport class CoreRenderer {\n stage;\n constructor(stage) {\n this.stage = stage;\n }\n}\n//# sourceMappingURL=CoreRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class CoreRenderOp {\n}\n//# sourceMappingURL=CoreRenderOp.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreRenderOp } from '../CoreRenderOp.js';\nimport { WebGlCoreShader } from './WebGlCoreShader.js';\nconst MAX_TEXTURES = 8; // TODO: get from gl\n/**\n * Can render multiple quads with multiple textures (up to vertex shader texture limit)\n *\n */\nexport class WebGlCoreRenderOp extends CoreRenderOp {\n glw;\n options;\n buffers;\n shader;\n shaderProps;\n alpha;\n clippingRect;\n dimensions;\n bufferIdx;\n zIndex;\n length = 0;\n numQuads = 0;\n textures = [];\n maxTextures;\n constructor(glw, options, buffers, shader, shaderProps, alpha, clippingRect, dimensions, bufferIdx, zIndex) {\n super();\n this.glw = glw;\n this.options = options;\n this.buffers = buffers;\n this.shader = shader;\n this.shaderProps = shaderProps;\n this.alpha = alpha;\n this.clippingRect = clippingRect;\n this.dimensions = dimensions;\n this.bufferIdx = bufferIdx;\n this.zIndex = zIndex;\n this.maxTextures = shader.supportsIndexedTextures\n ? glw.getParameter(glw.MAX_VERTEX_TEXTURE_IMAGE_UNITS)\n : 1;\n }\n addTexture(texture) {\n const { textures, maxTextures } = this;\n const existingIdx = textures.findIndex((t) => t === texture);\n if (existingIdx !== -1) {\n return existingIdx;\n }\n const newIdx = textures.length;\n if (newIdx >= maxTextures) {\n return 0xffffffff;\n }\n this.textures.push(texture);\n return newIdx;\n }\n draw() {\n const { glw, shader, shaderProps, options } = this;\n // shaderOp.draw(this);\n const { shManager } = options;\n shManager.useShader(shader);\n shader.bindRenderOp(this, shaderProps);\n // TODO: Reduce calculations required\n const quadIdx = (this.bufferIdx / 24) * 6 * 2;\n // Clipping\n if (this.clippingRect.valid) {\n const { x, y, width, height } = this.clippingRect;\n const pixelRatio = options.pixelRatio;\n const canvasHeight = options.canvas.height;\n const clipX = Math.round(x * pixelRatio);\n const clipWidth = Math.round(width * pixelRatio);\n const clipHeight = Math.round(height * pixelRatio);\n const clipY = Math.round(canvasHeight - clipHeight - y * pixelRatio);\n glw.setScissorTest(true);\n glw.scissor(clipX, clipY, clipWidth, clipHeight);\n }\n else {\n glw.setScissorTest(false);\n }\n glw.drawElements(glw.TRIANGLES, 6 * this.numQuads, glw.UNSIGNED_SHORT, quadIdx);\n }\n}\n//# sourceMappingURL=WebGlCoreRenderOp.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Get device specific webgl parameters\n * @param glw\n */\nexport function getWebGlParameters(glw) {\n const params = {\n MAX_RENDERBUFFER_SIZE: 0,\n MAX_TEXTURE_SIZE: 0,\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any\n MAX_VIEWPORT_DIMS: 0,\n MAX_VERTEX_TEXTURE_IMAGE_UNITS: 0,\n MAX_TEXTURE_IMAGE_UNITS: 0,\n MAX_COMBINED_TEXTURE_IMAGE_UNITS: 0,\n MAX_VERTEX_ATTRIBS: 0,\n MAX_VARYING_VECTORS: 0,\n MAX_VERTEX_UNIFORM_VECTORS: 0,\n MAX_FRAGMENT_UNIFORM_VECTORS: 0,\n };\n // Map over all parameters and get them\n const keys = Object.keys(params);\n keys.forEach((key) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n params[key] = glw.getParameter(glw[key]);\n });\n return params;\n}\n/**\n * Get device webgl extensions\n * @param glw\n */\nexport function getWebGlExtensions(glw) {\n const extensions = {\n ANGLE_instanced_arrays: null,\n WEBGL_compressed_texture_s3tc: null,\n WEBGL_compressed_texture_astc: null,\n WEBGL_compressed_texture_etc: null,\n WEBGL_compressed_texture_etc1: null,\n WEBGL_compressed_texture_pvrtc: null,\n WEBKIT_WEBGL_compressed_texture_pvrtc: null,\n WEBGL_compressed_texture_s3tc_srgb: null,\n OES_vertex_array_object: null,\n };\n // Map over all extensions and get them\n const keys = Object.keys(extensions);\n keys.forEach((key) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n extensions[key] = glw.getExtension(key);\n });\n return extensions;\n}\n/**\n * Allocate big memory chunk that we\n * can re-use to draw quads\n *\n * @param glw\n * @param size\n */\nexport function createIndexBuffer(glw, size) {\n const maxQuads = ~~(size / 80);\n const indices = new Uint16Array(maxQuads * 6);\n for (let i = 0, j = 0; i < maxQuads; i += 6, j += 4) {\n indices[i] = j;\n indices[i + 1] = j + 1;\n indices[i + 2] = j + 2;\n indices[i + 3] = j + 2;\n indices[i + 4] = j + 1;\n indices[i + 5] = j + 3;\n }\n const buffer = glw.createBuffer();\n glw.elementArrayBufferData(buffer, indices, glw.STATIC_DRAW);\n}\n/**\n * Checks if an object is of type HTMLImageElement.\n * This is used because we cant check for HTMLImageElement directly when the\n * renderer is running in a seperate web worker context.\n *\n * @param obj\n * @returns\n */\nexport function isHTMLImageElement(obj) {\n return (obj !== null &&\n typeof obj === 'object' &&\n obj.constructor &&\n obj.constructor.name === 'HTMLImageElement');\n}\n//# sourceMappingURL=RendererUtils.js.map","/**\n * Memize options object.\n *\n * @typedef MemizeOptions\n *\n * @property {number} [maxSize] Maximum size of the cache.\n */\n\n/**\n * Internal cache entry.\n *\n * @typedef MemizeCacheNode\n *\n * @property {?MemizeCacheNode|undefined} [prev] Previous node.\n * @property {?MemizeCacheNode|undefined} [next] Next node.\n * @property {Array<*>} args Function arguments for cache\n * entry.\n * @property {*} val Function result.\n */\n\n/**\n * Properties of the enhanced function for controlling cache.\n *\n * @typedef MemizeMemoizedFunction\n *\n * @property {()=>void} clear Clear the cache.\n */\n\n/**\n * Accepts a function to be memoized, and returns a new memoized function, with\n * optional options.\n *\n * @template {(...args: any[]) => any} F\n *\n * @param {F} fn Function to memoize.\n * @param {MemizeOptions} [options] Options object.\n *\n * @return {((...args: Parameters) => ReturnType) & MemizeMemoizedFunction} Memoized function.\n */\nfunction memize(fn, options) {\n\tvar size = 0;\n\n\t/** @type {?MemizeCacheNode|undefined} */\n\tvar head;\n\n\t/** @type {?MemizeCacheNode|undefined} */\n\tvar tail;\n\n\toptions = options || {};\n\n\tfunction memoized(/* ...args */) {\n\t\tvar node = head,\n\t\t\tlen = arguments.length,\n\t\t\targs,\n\t\t\ti;\n\n\t\tsearchCache: while (node) {\n\t\t\t// Perform a shallow equality test to confirm that whether the node\n\t\t\t// under test is a candidate for the arguments passed. Two arrays\n\t\t\t// are shallowly equal if their length matches and each entry is\n\t\t\t// strictly equal between the two sets. Avoid abstracting to a\n\t\t\t// function which could incur an arguments leaking deoptimization.\n\n\t\t\t// Check whether node arguments match arguments length\n\t\t\tif (node.args.length !== arguments.length) {\n\t\t\t\tnode = node.next;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Check whether node arguments match arguments values\n\t\t\tfor (i = 0; i < len; i++) {\n\t\t\t\tif (node.args[i] !== arguments[i]) {\n\t\t\t\t\tnode = node.next;\n\t\t\t\t\tcontinue searchCache;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// At this point we can assume we've found a match\n\n\t\t\t// Surface matched node to head if not already\n\t\t\tif (node !== head) {\n\t\t\t\t// As tail, shift to previous. Must only shift if not also\n\t\t\t\t// head, since if both head and tail, there is no previous.\n\t\t\t\tif (node === tail) {\n\t\t\t\t\ttail = node.prev;\n\t\t\t\t}\n\n\t\t\t\t// Adjust siblings to point to each other. If node was tail,\n\t\t\t\t// this also handles new tail's empty `next` assignment.\n\t\t\t\t/** @type {MemizeCacheNode} */ (node.prev).next = node.next;\n\t\t\t\tif (node.next) {\n\t\t\t\t\tnode.next.prev = node.prev;\n\t\t\t\t}\n\n\t\t\t\tnode.next = head;\n\t\t\t\tnode.prev = null;\n\t\t\t\t/** @type {MemizeCacheNode} */ (head).prev = node;\n\t\t\t\thead = node;\n\t\t\t}\n\n\t\t\t// Return immediately\n\t\t\treturn node.val;\n\t\t}\n\n\t\t// No cached value found. Continue to insertion phase:\n\n\t\t// Create a copy of arguments (avoid leaking deoptimization)\n\t\targs = new Array(len);\n\t\tfor (i = 0; i < len; i++) {\n\t\t\targs[i] = arguments[i];\n\t\t}\n\n\t\tnode = {\n\t\t\targs: args,\n\n\t\t\t// Generate the result from original function\n\t\t\tval: fn.apply(null, args),\n\t\t};\n\n\t\t// Don't need to check whether node is already head, since it would\n\t\t// have been returned above already if it was\n\n\t\t// Shift existing head down list\n\t\tif (head) {\n\t\t\thead.prev = node;\n\t\t\tnode.next = head;\n\t\t} else {\n\t\t\t// If no head, follows that there's no tail (at initial or reset)\n\t\t\ttail = node;\n\t\t}\n\n\t\t// Trim tail if we're reached max size and are pending cache insertion\n\t\tif (size === /** @type {MemizeOptions} */ (options).maxSize) {\n\t\t\ttail = /** @type {MemizeCacheNode} */ (tail).prev;\n\t\t\t/** @type {MemizeCacheNode} */ (tail).next = null;\n\t\t} else {\n\t\t\tsize++;\n\t\t}\n\n\t\thead = node;\n\n\t\treturn node.val;\n\t}\n\n\tmemoized.clear = function () {\n\t\thead = null;\n\t\ttail = null;\n\t\tsize = 0;\n\t};\n\n\t// Ignore reason: There's not a clear solution to create an intersection of\n\t// the function with additional properties, where the goal is to retain the\n\t// function signature of the incoming argument and add control properties\n\t// on the return value.\n\n\t// @ts-ignore\n\treturn memoized;\n}\n\nexport { memize as default };\n","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Core Utility Functions\n *\n * @module\n */\nimport memo from 'memize';\nexport const EPSILON = 0.000001;\nexport let ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array;\nexport const RANDOM = Math.random;\nexport const ANGLE_ORDER = 'zyx';\nconst degree = Math.PI / 180;\nexport const setMatrixArrayType = (type) => {\n ARRAY_TYPE = type;\n};\nexport const toRadian = (a) => {\n return a * degree;\n};\nexport const equals = (a, b) => {\n return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b));\n};\nexport const rand = (min, max) => {\n return Math.floor(Math.random() * (max - min + 1) + min);\n};\nexport const isPowerOfTwo = (value) => {\n return value && !(value & (value - 1));\n};\nconst getTimingBezier = (a, b, c, d) => {\n const xc = 3.0 * a;\n const xb = 3.0 * (c - a) - xc;\n const xa = 1.0 - xc - xb;\n const yc = 3.0 * b;\n const yb = 3.0 * (d - b) - yc;\n const ya = 1.0 - yc - yb;\n return function (time) {\n if (time >= 1.0) {\n return 1;\n }\n if (time <= 0) {\n return 0;\n }\n let t = 0.5, cbx, cbxd, dx;\n for (let it = 0; it < 20; it++) {\n cbx = t * (t * (t * xa + xb) + xc);\n dx = time - cbx;\n if (dx > -1e-8 && dx < 1e-8) {\n return t * (t * (t * ya + yb) + yc);\n }\n // Cubic bezier derivative.\n cbxd = t * (t * (3 * xa) + 2 * xb) + xc;\n if (cbxd > 1e-10 && cbxd < 1e-10) {\n // Problematic. Fall back to binary search method.\n break;\n }\n t += dx / cbxd;\n }\n // Fallback: binary search method. This is more reliable when there are near-0 slopes.\n let minT = 0;\n let maxT = 1;\n for (let it = 0; it < 20; it++) {\n t = 0.5 * (minT + maxT);\n cbx = t * (t * (t * xa + xb) + xc);\n dx = time - cbx;\n if (dx > -1e-8 && dx < 1e-8) {\n // Solution found!\n return t * (t * (t * ya + yb) + yc);\n }\n if (dx < 0) {\n maxT = t;\n }\n else {\n minT = t;\n }\n }\n };\n};\nexport const getTimingFunction = memo((str) => {\n switch (str) {\n case 'linear':\n return function (time) {\n return time;\n };\n case 'ease':\n return getTimingBezier(0.25, 0.1, 0.25, 1.0);\n case 'ease-in':\n return getTimingBezier(0.42, 0, 1.0, 1.0);\n case 'ease-out':\n return getTimingBezier(0, 0, 0.58, 1.0);\n case 'ease-in-out':\n return getTimingBezier(0.42, 0, 0.58, 1.0);\n case 'ease-in-sine':\n return getTimingBezier(0.12, 0, 0.39, 0);\n case 'ease-out-sine':\n return getTimingBezier(0.12, 0, 0.39, 0);\n case 'ease-in-out-sine':\n return getTimingBezier(0.37, 0, 0.63, 1);\n case 'ease-in-cubic':\n return getTimingBezier(0.32, 0, 0.67, 0);\n case 'ease-out-cubic':\n return getTimingBezier(0.33, 1, 0.68, 1);\n case 'ease-in-out-cubic':\n return getTimingBezier(0.65, 0, 0.35, 1);\n case 'ease-in-circ':\n return getTimingBezier(0.55, 0, 1, 0.45);\n case 'ease-out-circ':\n return getTimingBezier(0, 0.55, 0.45, 1);\n case 'ease-in-out-circ':\n return getTimingBezier(0.85, 0, 0.15, 1);\n case 'ease-in-back':\n return getTimingBezier(0.36, 0, 0.66, -0.56);\n case 'ease-out-back':\n return getTimingBezier(0.34, 1.56, 0.64, 1);\n case 'ease-in-out-back':\n return getTimingBezier(0.68, -0.6, 0.32, 1.6);\n case 'step-start':\n return function () {\n return 1;\n };\n case 'step-end':\n return function (time) {\n return time === 1 ? 1 : 0;\n };\n default:\n // eslint-disable-next-line no-case-declarations\n const s = 'cubic-bezier(';\n if (str && str.indexOf(s) === 0) {\n const parts = str\n .substr(s.length, str.length - s.length - 1)\n .split(',');\n if (parts.length !== 4) {\n console.warn('Unknown timing function: ' + str);\n // Fallback: use linear.\n return function (time) {\n return time;\n };\n }\n const a = parseFloat(parts[0] || '0.42');\n const b = parseFloat(parts[1] || '0');\n const c = parseFloat(parts[2] || '1');\n const d = parseFloat(parts[3] || '1');\n if (isNaN(a) || isNaN(b) || isNaN(c) || isNaN(d)) {\n console.warn(' Unknown timing function: ' + str);\n // Fallback: use linear.\n return function (time) {\n return time;\n };\n }\n return getTimingBezier(a, b, c, d);\n }\n else {\n console.warn('Unknown timing function: ' + str);\n // Fallback: use linear.\n return function (time) {\n return time;\n };\n }\n }\n});\nif (!Math.hypot)\n Math.hypot = (...args) => {\n let y = 0, i = args.length;\n while (i--) {\n y += args[i] * args[i];\n }\n return Math.sqrt(y);\n };\n//# sourceMappingURL=utils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../../utils.js';\nimport { isPowerOfTwo } from '../../utils.js';\nimport { CoreContextTexture } from '../CoreContextTexture.js';\nimport { isHTMLImageElement } from './internal/RendererUtils.js';\nconst TRANSPARENT_TEXTURE_DATA = new Uint8Array([0, 0, 0, 0]);\n/**\n * A wrapper around a WebGLTexture that handles loading the texture data\n * from a Texture source and uploading it to the GPU as well as freeing\n * the uploaded texture.\n *\n * @remarks\n * When accessing the ctxTexture property, the texture will be loaded if\n * it hasn't been already. ctxTexture will always return a valid WebGLTexture\n * and trigger the loading/uploading of the texture's data if it hasn't been\n * loaded yet.\n */\nexport class WebGlCoreCtxTexture extends CoreContextTexture {\n glw;\n _nativeCtxTexture = null;\n _state = 'freed';\n _w = 0;\n _h = 0;\n constructor(glw, memManager, textureSource) {\n super(memManager, textureSource);\n this.glw = glw;\n }\n get ctxTexture() {\n if (this._state === 'freed') {\n this.load();\n }\n assertTruthy(this._nativeCtxTexture);\n return this._nativeCtxTexture;\n }\n get renderable() {\n return this.textureSource.renderable;\n }\n get w() {\n return this._w;\n }\n get h() {\n return this._h;\n }\n /**\n * Load the texture data from the Texture source and upload it to the GPU\n *\n * @remarks\n * This method is called automatically when accessing the ctxTexture property\n * if the texture hasn't been loaded yet. But it can also be called manually\n * to force the texture to be pre-loaded prior to accessing the ctxTexture\n * property.\n */\n load() {\n // If the texture is already loading or loaded, don't load it again.\n if (this._state === 'loading' || this._state === 'loaded') {\n return;\n }\n this._state = 'loading';\n this.textureSource.setState('loading');\n this._nativeCtxTexture = this.createNativeCtxTexture();\n this.onLoadRequest()\n .then(({ width, height }) => {\n if (this._state === 'freed') {\n return;\n }\n this._state = 'loaded';\n this._w = width;\n this._h = height;\n // Update the texture source's width and height so that it can be used\n // for rendering.\n this.textureSource.setState('loaded', { width, height });\n })\n .catch((err) => {\n this._state = 'failed';\n this.textureSource.setState('failed', err);\n console.error(err);\n });\n }\n /**\n * Called when the texture data needs to be loaded and uploaded to a texture\n */\n async onLoadRequest() {\n const { glw, memManager } = this;\n // On initial load request, create a 1x1 transparent texture to use until\n // the texture data is finally loaded.\n glw.activeTexture(0);\n glw.bindTexture(this._nativeCtxTexture);\n // linear texture filtering\n glw.texParameteri(glw.TEXTURE_MAG_FILTER, glw.LINEAR);\n glw.texParameteri(glw.TEXTURE_MIN_FILTER, glw.LINEAR);\n // texture wrapping method\n glw.texParameteri(glw.TEXTURE_WRAP_S, glw.CLAMP_TO_EDGE);\n glw.texParameteri(glw.TEXTURE_WRAP_T, glw.CLAMP_TO_EDGE);\n glw.texImage2D(0, glw.RGBA, 1, 1, 0, glw.RGBA, glw.UNSIGNED_BYTE, TRANSPARENT_TEXTURE_DATA);\n memManager.setTextureMemUse(this, TRANSPARENT_TEXTURE_DATA.byteLength);\n const textureData = await this.textureSource?.getTextureData();\n // If the texture has been freed while loading, return early.\n if (!this._nativeCtxTexture) {\n assertTruthy(this._state === 'freed');\n return { width: 0, height: 0 };\n }\n let width = 0;\n let height = 0;\n assertTruthy(this._nativeCtxTexture);\n glw.activeTexture(0);\n // If textureData is null, the texture is empty (0, 0) and we don't need to\n // upload any data to the GPU.\n if (textureData.data instanceof ImageBitmap ||\n textureData.data instanceof ImageData ||\n // not using typeof HTMLImageElement due to web worker\n isHTMLImageElement(textureData.data)) {\n const data = textureData.data;\n width = data.width;\n height = data.height;\n glw.bindTexture(this._nativeCtxTexture);\n glw.pixelStorei(glw.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !!textureData.premultiplyAlpha);\n glw.texImage2D(0, glw.RGBA, glw.RGBA, glw.UNSIGNED_BYTE, data);\n memManager.setTextureMemUse(this, width * height * 4);\n // generate mipmaps for power-of-2 textures or in WebGL2RenderingContext\n if (glw.isWebGl2() || (isPowerOfTwo(width) && isPowerOfTwo(height))) {\n glw.generateMipmap();\n }\n }\n else if (textureData.data === null) {\n width = 0;\n height = 0;\n // Reset to a 1x1 transparent texture\n glw.bindTexture(this._nativeCtxTexture);\n glw.texImage2D(0, glw.RGBA, 1, 1, 0, glw.RGBA, glw.UNSIGNED_BYTE, TRANSPARENT_TEXTURE_DATA);\n memManager.setTextureMemUse(this, TRANSPARENT_TEXTURE_DATA.byteLength);\n }\n else if ('mipmaps' in textureData.data && textureData.data.mipmaps) {\n const { mipmaps, width = 0, height = 0, type, glInternalFormat, } = textureData.data;\n const view = type === 'ktx'\n ? new DataView(mipmaps[0] ?? new ArrayBuffer(0))\n : mipmaps[0];\n glw.bindTexture(this._nativeCtxTexture);\n glw.compressedTexImage2D(0, glInternalFormat, width, height, 0, view);\n glw.texParameteri(glw.TEXTURE_WRAP_S, glw.CLAMP_TO_EDGE);\n glw.texParameteri(glw.TEXTURE_WRAP_T, glw.CLAMP_TO_EDGE);\n glw.texParameteri(glw.TEXTURE_MAG_FILTER, glw.LINEAR);\n glw.texParameteri(glw.TEXTURE_MIN_FILTER, glw.LINEAR);\n memManager.setTextureMemUse(this, view.byteLength);\n }\n else {\n console.error(`WebGlCoreCtxTexture.onLoadRequest: Unexpected textureData returned`, textureData);\n }\n return {\n width,\n height,\n };\n }\n /**\n * Free the WebGLTexture from the GPU\n *\n * @returns\n */\n free() {\n if (this._state === 'freed') {\n return;\n }\n this._state = 'freed';\n this.textureSource.setState('freed');\n this._w = 0;\n this._h = 0;\n if (!this._nativeCtxTexture) {\n return;\n }\n const { glw, memManager } = this;\n glw.deleteTexture(this._nativeCtxTexture);\n memManager.setTextureMemUse(this, 0);\n this._nativeCtxTexture = null;\n }\n createNativeCtxTexture() {\n const { glw } = this;\n const nativeTexture = glw.createTexture();\n if (!nativeTexture) {\n throw new Error('Could not create WebGL Texture');\n }\n return nativeTexture;\n }\n}\n//# sourceMappingURL=WebGlCoreCtxTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\n/**\n * Texture consisting of only a 1x1 color pixel\n *\n * @remarks\n * The pixel color is set with the {@link ColorTextureProps.color} prop.\n *\n * This is the default texture used for a Node if it's\n * {@link INodeWritableProps.texture} prop is set to `null` (the default)\n *\n * Generally the 1x1 color pixel is stretched to whatever the set dimensions of\n * a Node are.\n */\nexport class ColorTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = ColorTexture.resolveDefaults(props || {});\n }\n get color() {\n return this.props.color;\n }\n set color(color) {\n this.props.color = color;\n }\n async getTextureData() {\n const pixelData32 = new Uint32Array([this.color]);\n const pixelData8 = new Uint8ClampedArray(pixelData32.buffer);\n return {\n data: new ImageData(pixelData8, 1, 1),\n premultiplyAlpha: true,\n };\n }\n static makeCacheKey(props) {\n const resolvedProps = ColorTexture.resolveDefaults(props);\n return `ColorTexture,${resolvedProps.color}`;\n }\n static resolveDefaults(props) {\n return {\n color: props.color || 0xffffffff,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=ColorTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture, } from './Texture.js';\n/**\n * A Texture that is a sub-region of another Texture.\n *\n * @remarks\n * The parent texture can be a Sprite Sheet/Texture Atlas and set using the\n * {@link SubTextureProps.texture} prop. The sub-region relative to the parent\n * texture is defined with the {@link SubTextureProps.x},\n * {@link SubTextureProps.y}, {@link SubTextureProps.width}, and\n * {@link SubTextureProps.height} pixel values.\n */\nexport class SubTexture extends Texture {\n props;\n parentTexture;\n constructor(txManager, props) {\n super(txManager);\n this.parentTexture = this.txManager.loadTexture(props.texture.txType, props.texture.props, props.texture.options);\n this.props = SubTexture.resolveDefaults(props || {});\n // If parent texture is already loaded / failed, trigger loaded event manually\n // so that users get a consistent event experience.\n // We do this in a microtask to allow listeners to be attached in the same\n // synchronous task after calling loadTexture()\n queueMicrotask(() => {\n const parentTx = this.parentTexture;\n if (parentTx.state === 'loaded') {\n this.onParentTxLoaded(parentTx, parentTx.dimensions);\n }\n else if (parentTx.state === 'failed') {\n this.onParentTxFailed(parentTx, parentTx.error);\n }\n parentTx.on('loaded', this.onParentTxLoaded);\n parentTx.on('failed', this.onParentTxFailed);\n });\n }\n onParentTxLoaded = () => {\n // We ignore the parent's passed dimensions, and simply use the SubTexture's\n // configured dimensions (because that's all that matters here)\n this.setState('loaded', {\n width: this.props.width,\n height: this.props.height,\n });\n };\n onParentTxFailed = (target, error) => {\n this.setState('failed', error);\n };\n async getTextureData() {\n return {\n data: this.props,\n };\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static makeCacheKey(props) {\n return false;\n }\n static resolveDefaults(props) {\n return {\n texture: props.texture,\n x: props.x || 0,\n y: props.y || 0,\n width: props.width || 0,\n height: props.height || 0,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=SubTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreCtxTexture } from './WebGlCoreCtxTexture.js';\nexport class WebGlCoreCtxSubTexture extends WebGlCoreCtxTexture {\n constructor(glw, memManager, textureSource) {\n super(glw, memManager, textureSource);\n }\n async onLoadRequest() {\n const props = await this.textureSource.getTextureData();\n return {\n width: props.data?.width || 0,\n height: props.data?.height || 0,\n };\n }\n}\n//# sourceMappingURL=WebGlCoreCtxSubTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Represents a collection of WebGL Buffers along with their associated\n * vertex attribute formats.\n */\nexport class BufferCollection {\n config;\n constructor(config) {\n this.config = config;\n }\n /**\n * Get the WebGLBuffer associated with the given attribute name if it exists.\n *\n * @param attributeName\n * @returns\n */\n getBuffer(attributeName) {\n return this.config.find((item) => item.attributes[attributeName])?.buffer;\n }\n /**\n * Get the AttributeInfo associated with the given attribute name if it exists.\n *\n * @param attributeName\n * @returns\n */\n getAttributeInfo(attributeName) {\n return this.config.find((item) => item.attributes[attributeName])\n ?.attributes[attributeName];\n }\n}\n//# sourceMappingURL=BufferCollection.js.map","/* eslint-disable @typescript-eslint/no-unsafe-return */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-unsafe-argument */\nimport { assertTruthy } from '../../utils.js';\nimport { isWebGl2 } from '../renderers/webgl/internal/WebGlUtils.js';\n/**\n * Optimized WebGL Context Wrapper\n *\n * @remarks\n * This class contains the subset of the WebGLRenderingContext & WebGL2RenderingContext\n * API that is used by the renderer. Select high volume WebGL methods include\n * caching optimizations to avoid making WebGL calls if the state is already set\n * to the desired value.\n *\n * While most methods contained are direct passthroughs to the WebGL context,\n * some methods combine multiple WebGL calls into one for convenience, modify\n * arguments to be more convenient, or are replaced by more specific methods.\n *\n * Not all methods are optimized. Only methods that are called frequently\n * and/or have a high cost are optimized.\n *\n * A subset of GLenum constants are also exposed as properties on this class\n * for convenience.\n */\nexport class WebGlContextWrapper {\n gl;\n //#region Cached WebGL State\n activeTextureUnit = 0;\n texture2dUnits;\n texture2dParams = new WeakMap();\n scissorEnabled;\n scissorX;\n scissorY;\n scissorWidth;\n scissorHeight;\n blendEnabled;\n blendSrcRgb;\n blendDstRgb;\n blendSrcAlpha;\n blendDstAlpha;\n boundArrayBuffer;\n boundElementArrayBuffer;\n curProgram;\n programUniforms = new WeakMap();\n //#endregion Cached WebGL State\n //#region Canvas\n canvas;\n //#endregion Canvas\n //#region WebGL Enums\n MAX_RENDERBUFFER_SIZE;\n MAX_TEXTURE_SIZE;\n MAX_VIEWPORT_DIMS;\n MAX_VERTEX_TEXTURE_IMAGE_UNITS;\n MAX_TEXTURE_IMAGE_UNITS;\n MAX_COMBINED_TEXTURE_IMAGE_UNITS;\n MAX_VERTEX_ATTRIBS;\n MAX_VARYING_VECTORS;\n MAX_VERTEX_UNIFORM_VECTORS;\n MAX_FRAGMENT_UNIFORM_VECTORS;\n TEXTURE_MAG_FILTER;\n TEXTURE_MIN_FILTER;\n TEXTURE_WRAP_S;\n TEXTURE_WRAP_T;\n LINEAR;\n CLAMP_TO_EDGE;\n RGBA;\n UNSIGNED_BYTE;\n UNPACK_PREMULTIPLY_ALPHA_WEBGL;\n FLOAT;\n TRIANGLES;\n UNSIGNED_SHORT;\n ONE;\n ONE_MINUS_SRC_ALPHA;\n VERTEX_SHADER;\n FRAGMENT_SHADER;\n STATIC_DRAW;\n COMPILE_STATUS;\n LINK_STATUS;\n DYNAMIC_DRAW;\n //#endregion WebGL Enums\n constructor(gl) {\n this.gl = gl;\n // The following code extracts the current state of the WebGL context\n // to our local JavaScript cached version of it. This is so we can\n // avoid making WebGL calls if we don't need to.\n // We could assume that the WebGL context is in a default state, but\n // in the future we may want to support restoring a broken WebGL context\n // and this will help with that.\n this.activeTextureUnit =\n gl.getParameter(gl.ACTIVE_TEXTURE) - gl.TEXTURE0;\n const maxTextureUnits = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);\n // save current texture units\n this.texture2dUnits = new Array(maxTextureUnits)\n .fill(undefined)\n .map((_, i) => {\n this.activeTexture(i);\n return gl.getParameter(gl.TEXTURE_BINDING_2D);\n });\n // restore active texture unit\n this.activeTexture(this.activeTextureUnit);\n this.scissorEnabled = gl.isEnabled(gl.SCISSOR_TEST);\n const scissorBox = gl.getParameter(gl.SCISSOR_BOX);\n this.scissorX = scissorBox[0];\n this.scissorY = scissorBox[1];\n this.scissorWidth = scissorBox[2];\n this.scissorHeight = scissorBox[3];\n this.blendEnabled = gl.isEnabled(gl.BLEND);\n this.blendSrcRgb = gl.getParameter(gl.BLEND_SRC_RGB);\n this.blendDstRgb = gl.getParameter(gl.BLEND_DST_RGB);\n this.blendSrcAlpha = gl.getParameter(gl.BLEND_SRC_ALPHA);\n this.blendDstAlpha = gl.getParameter(gl.BLEND_DST_ALPHA);\n this.boundArrayBuffer = gl.getParameter(gl.ARRAY_BUFFER_BINDING);\n this.boundElementArrayBuffer = gl.getParameter(gl.ELEMENT_ARRAY_BUFFER_BINDING);\n this.curProgram = gl.getParameter(gl.CURRENT_PROGRAM);\n this.canvas = gl.canvas;\n // Extract GLenums\n this.MAX_RENDERBUFFER_SIZE = gl.MAX_RENDERBUFFER_SIZE;\n this.MAX_TEXTURE_SIZE = gl.MAX_TEXTURE_SIZE;\n this.MAX_VIEWPORT_DIMS = gl.MAX_VIEWPORT_DIMS;\n this.MAX_VERTEX_TEXTURE_IMAGE_UNITS = gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS;\n this.MAX_TEXTURE_IMAGE_UNITS = gl.MAX_TEXTURE_IMAGE_UNITS;\n this.MAX_COMBINED_TEXTURE_IMAGE_UNITS = gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS;\n this.MAX_VERTEX_ATTRIBS = gl.MAX_VERTEX_ATTRIBS;\n this.MAX_VARYING_VECTORS = gl.MAX_VARYING_VECTORS;\n this.MAX_VERTEX_UNIFORM_VECTORS = gl.MAX_VERTEX_UNIFORM_VECTORS;\n this.MAX_FRAGMENT_UNIFORM_VECTORS = gl.MAX_FRAGMENT_UNIFORM_VECTORS;\n this.TEXTURE_MAG_FILTER = gl.TEXTURE_MAG_FILTER;\n this.TEXTURE_MIN_FILTER = gl.TEXTURE_MIN_FILTER;\n this.TEXTURE_WRAP_S = gl.TEXTURE_WRAP_S;\n this.TEXTURE_WRAP_T = gl.TEXTURE_WRAP_T;\n this.LINEAR = gl.LINEAR;\n this.CLAMP_TO_EDGE = gl.CLAMP_TO_EDGE;\n this.RGBA = gl.RGBA;\n this.UNSIGNED_BYTE = gl.UNSIGNED_BYTE;\n this.UNPACK_PREMULTIPLY_ALPHA_WEBGL = gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL;\n this.FLOAT = gl.FLOAT;\n this.TRIANGLES = gl.TRIANGLES;\n this.UNSIGNED_SHORT = gl.UNSIGNED_SHORT;\n this.ONE = gl.ONE;\n this.ONE_MINUS_SRC_ALPHA = gl.ONE_MINUS_SRC_ALPHA;\n this.MAX_VERTEX_TEXTURE_IMAGE_UNITS = gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS;\n this.TRIANGLES = gl.TRIANGLES;\n this.UNSIGNED_SHORT = gl.UNSIGNED_SHORT;\n this.VERTEX_SHADER = gl.VERTEX_SHADER;\n this.FRAGMENT_SHADER = gl.FRAGMENT_SHADER;\n this.STATIC_DRAW = gl.STATIC_DRAW;\n this.COMPILE_STATUS = gl.COMPILE_STATUS;\n this.LINK_STATUS = gl.LINK_STATUS;\n this.DYNAMIC_DRAW = gl.DYNAMIC_DRAW;\n }\n /**\n * Returns true if the WebGL context is WebGL2\n *\n * @returns\n */\n isWebGl2() {\n return isWebGl2(this.gl);\n }\n /**\n * ```\n * gl.activeTexture(textureUnit + gl.TEXTURE0);\n * ```\n *\n * @remarks\n * **WebGL Difference**: `textureUnit` is based from 0, not `gl.TEXTURE0`.\n *\n * @param textureUnit\n */\n activeTexture(textureUnit) {\n const { gl } = this;\n if (this.activeTextureUnit !== textureUnit) {\n gl.activeTexture(textureUnit + gl.TEXTURE0);\n this.activeTextureUnit = textureUnit;\n }\n }\n /**\n * ```\n * gl.bindTexture(gl.TEXTURE_2D, texture);\n * ```\n * @remarks\n * **WebGL Difference**: Bind target is always `gl.TEXTURE_2D`\n *\n * @param texture\n */\n bindTexture(texture) {\n const { gl, activeTextureUnit, texture2dUnits } = this;\n if (texture2dUnits[activeTextureUnit] === texture) {\n return;\n }\n texture2dUnits[activeTextureUnit] = texture;\n gl.bindTexture(this.gl.TEXTURE_2D, texture);\n }\n _getActiveTexture() {\n const { activeTextureUnit, texture2dUnits } = this;\n return texture2dUnits[activeTextureUnit];\n }\n /**\n * ```\n * gl.texParameteri(gl.TEXTURE_2D, pname, param);\n * ```\n * @remarks\n * **WebGL Difference**: Bind target is always `gl.TEXTURE_2D`\n *\n * @param pname\n * @param param\n * @returns\n */\n texParameteri(pname, param) {\n const { gl, texture2dParams } = this;\n const activeTexture = this._getActiveTexture();\n if (!activeTexture) {\n throw new Error('No active texture');\n }\n let textureParams = texture2dParams.get(activeTexture);\n if (!textureParams) {\n textureParams = {};\n texture2dParams.set(activeTexture, textureParams);\n }\n if (textureParams[pname] === param) {\n return;\n }\n textureParams[pname] = param;\n gl.texParameteri(gl.TEXTURE_2D, pname, param);\n }\n texImage2D(level, internalFormat, widthOrFormat, heightOrType, borderOrSource, format, type, pixels) {\n const { gl } = this;\n if (format) {\n gl.texImage2D(gl.TEXTURE_2D, level, internalFormat, widthOrFormat, heightOrType, borderOrSource, format, type, pixels);\n }\n else {\n gl.texImage2D(gl.TEXTURE_2D, level, internalFormat, widthOrFormat, heightOrType, borderOrSource);\n }\n }\n /**\n * ```\n * gl.compressedTexImage2D(gl.TEXTURE_2D, level, internalFormat, width, height, border, data);\n * ```\n *\n * @remarks\n * **WebGL Difference**: Bind target is always `gl.TEXTURE_2D`\n */\n compressedTexImage2D(level, internalformat, width, height, border, data) {\n const { gl } = this;\n gl.compressedTexImage2D(gl.TEXTURE_2D, level, internalformat, width, height, border, data);\n }\n /**\n * ```\n * gl.pixelStorei(pname, param);\n * ```\n *\n * @param pname\n * @param param\n */\n pixelStorei(pname, param) {\n const { gl } = this;\n gl.pixelStorei(pname, param);\n }\n /**\n * ```\n * gl.generateMipmap(gl.TEXTURE_2D);\n * ```\n *\n * @remarks\n * **WebGL Difference**: Bind target is always `gl.TEXTURE_2D`\n */\n generateMipmap() {\n const { gl } = this;\n gl.generateMipmap(gl.TEXTURE_2D);\n }\n /**\n * ```\n * gl.createTexture();\n * ```\n *\n * @returns\n */\n createTexture() {\n const { gl } = this;\n return gl.createTexture();\n }\n /**\n * ```\n * gl.deleteTexture(texture);\n * ```\n *\n * @param texture\n */\n deleteTexture(texture) {\n const { gl } = this;\n if (texture) {\n this.texture2dParams.delete(texture);\n }\n gl.deleteTexture(texture);\n }\n /**\n * ```\n * gl.viewport(x, y, width, height);\n * ```\n */\n viewport(x, y, width, height) {\n const { gl } = this;\n gl.viewport(x, y, width, height);\n }\n /**\n * ```\n * gl.clearColor(red, green, blue, alpha);\n * ```\n *\n * @param red\n * @param green\n * @param blue\n * @param alpha\n */\n clearColor(red, green, blue, alpha) {\n const { gl } = this;\n gl.clearColor(red, green, blue, alpha);\n }\n /**\n * ```\n * gl[\"enable\"|\"disable\"](gl.SCISSOR_TEST);\n * ```\n * @param enable\n */\n setScissorTest(enable) {\n const { gl, scissorEnabled } = this;\n if (enable === scissorEnabled) {\n return;\n }\n if (enable) {\n gl.enable(gl.SCISSOR_TEST);\n }\n else {\n gl.disable(gl.SCISSOR_TEST);\n }\n this.scissorEnabled = enable;\n }\n /**\n * ```\n * gl.scissor(x, y, width, height);\n * ```\n *\n * @param x\n * @param y\n * @param width\n * @param height\n */\n scissor(x, y, width, height) {\n const { gl, scissorX, scissorY, scissorWidth, scissorHeight } = this;\n if (x !== scissorX ||\n y !== scissorY ||\n width !== scissorWidth ||\n height !== scissorHeight) {\n gl.scissor(x, y, width, height);\n this.scissorX = x;\n this.scissorY = y;\n this.scissorWidth = width;\n this.scissorHeight = height;\n }\n }\n /**\n * ```\n * gl[\"enable\"|\"disable\"](gl.BLEND);\n * ```\n *\n * @param blend\n * @returns\n */\n setBlend(blend) {\n const { gl, blendEnabled } = this;\n if (blend === blendEnabled) {\n return;\n }\n if (blend) {\n gl.enable(gl.BLEND);\n }\n else {\n gl.disable(gl.BLEND);\n }\n this.blendEnabled = blend;\n }\n /**\n * ```\n * gl.blendFunc(src, dst);\n * ```\n *\n * @param src\n * @param dst\n */\n blendFunc(src, dst) {\n const { gl, blendSrcRgb, blendDstRgb, blendSrcAlpha, blendDstAlpha } = this;\n if (src !== blendSrcRgb ||\n dst !== blendDstRgb ||\n src !== blendSrcAlpha ||\n dst !== blendDstAlpha) {\n gl.blendFunc(src, dst);\n this.blendSrcRgb = src;\n this.blendDstRgb = dst;\n this.blendSrcAlpha = src;\n this.blendDstAlpha = dst;\n }\n }\n /**\n * ```\n * createBuffer();\n * ```\n *\n * @returns\n */\n createBuffer() {\n const { gl } = this;\n return gl.createBuffer();\n }\n /**\n * ```\n * gl.clear(gl.COLOR_BUFFER_BIT);\n * ```\n *\n * @remarks\n * **WebGL Difference**: Clear mask is always `gl.COLOR_BUFFER_BIT`\n */\n clear() {\n const { gl } = this;\n gl.clear(gl.COLOR_BUFFER_BIT);\n }\n /**\n * ```\n * gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n * gl.bufferData(gl.ARRAY_BUFFER, data, usage);\n * ```\n *\n * @remarks\n * **WebGL Combo**: `gl.bindBuffer` and `gl.bufferData` are combined into one function.\n *\n * @param buffer\n * @param data\n * @param usage\n */\n arrayBufferData(buffer, data, usage) {\n const { gl, boundArrayBuffer } = this;\n if (boundArrayBuffer !== buffer) {\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n this.boundArrayBuffer = buffer;\n }\n gl.bufferData(gl.ARRAY_BUFFER, data, usage);\n }\n /**\n * ```\n * gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffer);\n * gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, data, usage);\n * ```\n * @remarks\n * **WebGL Combo**: `gl.bindBuffer` and `gl.bufferData` are combined into one function.\n *\n * @param buffer\n * @param data\n * @param usage\n */\n elementArrayBufferData(buffer, data, usage) {\n const { gl, boundElementArrayBuffer } = this;\n if (boundElementArrayBuffer !== buffer) {\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffer);\n this.boundElementArrayBuffer = buffer;\n }\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, data, usage);\n }\n /**\n * ```\n * gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n * gl.vertexAttribPointer(index, size, type, normalized, stride, offset);\n * ```\n *\n * @remarks\n * **WebGL Combo**: `gl.bindBuffer` and `gl.vertexAttribPointer` are combined into one function.\n *\n * @param buffer\n * @param index\n * @param size\n * @param type\n * @param normalized\n * @param stride\n * @param offset\n */\n vertexAttribPointer(buffer, index, size, type, normalized, stride, offset) {\n const { gl, boundArrayBuffer } = this;\n if (boundArrayBuffer !== buffer) {\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n this.boundArrayBuffer = buffer;\n }\n gl.vertexAttribPointer(index, size, type, normalized, stride, offset);\n }\n /**\n * ```\n * gl.useProgram(program);\n * ```\n *\n * @param program\n * @returns\n */\n useProgram(program) {\n const { gl, curProgram } = this;\n if (curProgram === program) {\n return;\n }\n gl.useProgram(program);\n this.curProgram = program;\n }\n setUniform(type, location, ...args) {\n const { gl, programUniforms } = this;\n let uniforms = programUniforms.get(this.curProgram);\n if (!uniforms) {\n uniforms = new Map();\n programUniforms.set(this.curProgram, uniforms);\n }\n const uniformArgs = uniforms.get(location);\n if (!uniformArgs || !compareArrays(uniformArgs, args)) {\n uniforms.set(location, args);\n gl[type](location, ...args);\n }\n }\n /**\n * ```\n * gl.getParameter(pname);\n * ```\n *\n * @param pname\n * @returns\n */\n getParameter(pname) {\n const { gl } = this;\n return gl.getParameter(pname);\n }\n /**\n * ```\n * gl.drawElements(mode, count, type, offset);\n * ```\n *\n * @param mode\n * @param count\n * @param type\n * @param offset\n */\n drawElements(mode, count, type, offset) {\n const { gl } = this;\n gl.drawElements(mode, count, type, offset);\n }\n /**\n * ```\n * gl.drawArrays(mode, first, count);\n * ```\n *\n * @param name\n * @returns\n */\n getExtension(name) {\n const { gl } = this;\n return gl.getExtension(name);\n }\n /**\n * ```\n * gl.createVertexArray();\n * ```\n *\n * @returns\n */\n createVertexArray() {\n const { gl } = this;\n assertTruthy(gl instanceof WebGL2RenderingContext);\n return gl.createVertexArray();\n }\n /**\n * ```\n * gl.bindVertexArray(vertexArray);\n * ```\n *\n * @param vertexArray\n */\n bindVertexArray(vertexArray) {\n const { gl } = this;\n assertTruthy(gl instanceof WebGL2RenderingContext);\n gl.bindVertexArray(vertexArray);\n }\n /**\n * ```\n * gl.getAttribLocation(program, name);\n * ```\n *\n * @param program\n * @param name\n * @returns\n */\n getAttribLocation(program, name) {\n const { gl } = this;\n return gl.getAttribLocation(program, name);\n }\n /**\n * ```\n * gl.getUniformLocation(program, name);\n * ```\n *\n * @param program\n * @param name\n * @returns\n */\n getUniformLocation(program, name) {\n const { gl } = this;\n return gl.getUniformLocation(program, name);\n }\n /**\n * ```\n * gl.enableVertexAttribArray(index);\n * ```\n *\n * @param index\n */\n enableVertexAttribArray(index) {\n const { gl } = this;\n gl.enableVertexAttribArray(index);\n }\n /**\n * ```\n * gl.disableVertexAttribArray(index);\n * ```\n *\n * @param index\n */\n disableVertexAttribArray(index) {\n const { gl } = this;\n gl.disableVertexAttribArray(index);\n }\n /**\n * ```\n * gl.createShader(type);\n * ```\n *\n * @param type\n * @returns\n */\n createShader(type) {\n const { gl } = this;\n return gl.createShader(type);\n }\n /**\n * ```\n * gl.compileShader(shader);\n * ```\n *\n * @param shader\n * @returns\n */\n compileShader(shader) {\n const { gl } = this;\n gl.compileShader(shader);\n }\n /**\n * ```\n * gl.attachShader(program, shader);\n * ```\n *\n * @param program\n * @param shader\n */\n attachShader(program, shader) {\n const { gl } = this;\n gl.attachShader(program, shader);\n }\n /**\n * ```\n * gl.linkProgram(program);\n * ```\n *\n * @param program\n */\n linkProgram(program) {\n const { gl } = this;\n gl.linkProgram(program);\n }\n /**\n * ```\n * gl.deleteProgram(shader);\n * ```\n *\n * @param shader\n */\n deleteProgram(shader) {\n const { gl } = this;\n gl.deleteProgram(shader);\n }\n /**\n * ```\n * gl.getShaderParameter(shader, pname);\n * ```\n *\n * @param shader\n * @param pname\n */\n getShaderParameter(shader, pname) {\n const { gl } = this;\n return gl.getShaderParameter(shader, pname);\n }\n /**\n * ```\n * gl.getShaderInfoLog(shader);\n * ```\n *\n * @param shader\n */\n getShaderInfoLog(shader) {\n const { gl } = this;\n return gl.getShaderInfoLog(shader);\n }\n /**\n * ```\n * gl.createProgram();\n * ```\n *\n * @returns\n */\n createProgram() {\n const { gl } = this;\n return gl.createProgram();\n }\n /**\n * ```\n * gl.getProgramParameter(program, pname);\n * ```\n *\n * @param program\n * @param pname\n * @returns\n */\n getProgramParameter(program, pname) {\n const { gl } = this;\n return gl.getProgramParameter(program, pname);\n }\n /**\n * ```\n * gl.getProgramInfoLog(program);\n * ```\n *\n * @param program\n * @returns\n */\n getProgramInfoLog(program) {\n const { gl } = this;\n return gl.getProgramInfoLog(program);\n }\n /**\n * ```\n * gl.shaderSource(shader, source);\n * ```\n *\n * @param shader\n * @param source\n */\n shaderSource(shader, source) {\n const { gl } = this;\n gl.shaderSource(shader, source);\n }\n /**\n * ```\n * gl.deleteShader(shader);\n * ```\n *\n * @param shader\n */\n deleteShader(shader) {\n const { gl } = this;\n gl.deleteShader(shader);\n }\n}\n/**\n * Compare two arrays for equality.\n *\n * @remarks\n * This function will not try to compare nested arrays or Float32Arrays and\n * instead will always return false when they are encountered.\n *\n * @param a\n * @param b\n * @returns\n */\nexport function compareArrays(a, b) {\n if (a.length !== b.length) {\n return false;\n }\n return a.every((v, i) => {\n // Don't bother to compare nested arrays or Float32Arrays\n if (Array.isArray(v) || v instanceof Float32Array) {\n return false;\n }\n else {\n return v === b[i];\n }\n });\n}\n//# sourceMappingURL=WebGlContextWrapper.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy, createWebGLContext, hasOwn, mergeColorAlphaPremultiplied, } from '../../../utils.js';\nimport { CoreRenderer } from '../CoreRenderer.js';\nimport { WebGlCoreRenderOp } from './WebGlCoreRenderOp.js';\nimport { createIndexBuffer, getWebGlParameters, getWebGlExtensions, } from './internal/RendererUtils.js';\nimport { WebGlCoreCtxTexture } from './WebGlCoreCtxTexture.js';\nimport { Texture } from '../../textures/Texture.js';\nimport { ColorTexture } from '../../textures/ColorTexture.js';\nimport { SubTexture } from '../../textures/SubTexture.js';\nimport { WebGlCoreCtxSubTexture } from './WebGlCoreCtxSubTexture.js';\nimport { CoreShaderManager } from '../../CoreShaderManager.js';\nimport { BufferCollection } from './internal/BufferCollection.js';\nimport { compareRect, getNormalizedRgbaComponents, } from '../../lib/utils.js';\nimport { WebGlCoreShader } from './WebGlCoreShader.js';\nimport { RoundedRectangle } from './shaders/RoundedRectangle.js';\nimport { ContextSpy } from '../../lib/ContextSpy.js';\nimport { WebGlContextWrapper } from '../../lib/WebGlContextWrapper.js';\nconst WORDS_PER_QUAD = 24;\nconst BYTES_PER_QUAD = WORDS_PER_QUAD * 4;\nexport class WebGlCoreRenderer extends CoreRenderer {\n //// WebGL Native Context and Data\n glw;\n system;\n //// Core Managers\n txManager;\n txMemManager;\n shManager;\n //// Options\n options;\n //// Persistent data\n quadBuffer = new ArrayBuffer(1024 * 1024 * 4);\n fQuadBuffer = new Float32Array(this.quadBuffer);\n uiQuadBuffer = new Uint32Array(this.quadBuffer);\n renderOps = [];\n //// Render Op / Buffer Filling State\n curBufferIdx = 0;\n curRenderOp = null;\n renderables = [];\n //// Default Shader\n defaultShader;\n quadBufferCollection;\n /**\n * White pixel texture used by default when no texture is specified.\n */\n defaultTexture;\n constructor(options) {\n super(options.stage);\n const { canvas, clearColor, bufferMemory } = options;\n this.options = options;\n this.txManager = options.txManager;\n this.txMemManager = options.txMemManager;\n this.shManager = options.shManager;\n this.defaultTexture = new ColorTexture(this.txManager);\n // When the default texture is loaded, request a render in case the\n // RAF is paused. Fixes: https://github.com/lightning-js/renderer/issues/123\n this.defaultTexture.once('loaded', () => {\n this.stage.requestRender();\n });\n const gl = createWebGLContext(canvas, options.contextSpy);\n const glw = (this.glw = new WebGlContextWrapper(gl));\n const color = getNormalizedRgbaComponents(clearColor);\n glw.viewport(0, 0, canvas.width, canvas.height);\n glw.clearColor(color[0], color[1], color[2], color[3]);\n glw.setBlend(true);\n glw.blendFunc(glw.ONE, glw.ONE_MINUS_SRC_ALPHA);\n createIndexBuffer(glw, bufferMemory);\n this.system = {\n parameters: getWebGlParameters(this.glw),\n extensions: getWebGlExtensions(this.glw),\n };\n this.shManager.renderer = this;\n this.defaultShader = this.shManager.loadShader('DefaultShader').shader;\n const quadBuffer = glw.createBuffer();\n assertTruthy(quadBuffer);\n const stride = 6 * Float32Array.BYTES_PER_ELEMENT;\n this.quadBufferCollection = new BufferCollection([\n {\n buffer: quadBuffer,\n attributes: {\n a_position: {\n name: 'a_position',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 0, // start at the beginning of the buffer\n },\n a_textureCoordinate: {\n name: 'a_textureCoordinate',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 2 * Float32Array.BYTES_PER_ELEMENT,\n },\n a_color: {\n name: 'a_color',\n size: 4,\n type: glw.UNSIGNED_BYTE,\n normalized: true,\n stride,\n offset: 4 * Float32Array.BYTES_PER_ELEMENT,\n },\n a_textureIndex: {\n name: 'a_textureIndex',\n size: 1,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 5 * Float32Array.BYTES_PER_ELEMENT,\n },\n },\n },\n ]);\n }\n reset() {\n const { glw } = this;\n this.curBufferIdx = 0;\n this.curRenderOp = null;\n this.renderOps.length = 0;\n glw.setScissorTest(false);\n glw.clear();\n }\n getShaderManager() {\n return this.shManager;\n }\n createCtxTexture(textureSource) {\n if (textureSource instanceof SubTexture) {\n return new WebGlCoreCtxSubTexture(this.glw, this.txMemManager, textureSource);\n }\n return new WebGlCoreCtxTexture(this.glw, this.txMemManager, textureSource);\n }\n /**\n * This function adds a quad (a rectangle composed of two triangles) to the WebGL rendering pipeline.\n *\n * It takes a set of options that define the quad's properties, such as its dimensions, colors, texture, shader, and transformation matrix.\n * The function first updates the shader properties with the current dimensions if necessary, then sets the default texture if none is provided.\n * It then checks if a new render operation is needed, based on the current shader and clipping rectangle.\n * If a new render operation is needed, it creates one and updates the current render operation.\n * The function then adjusts the texture coordinates based on the texture options and adds the texture to the texture manager.\n *\n * Finally, it calculates the vertices for the quad, taking into account any transformations, and adds them to the quad buffer.\n * The function updates the length and number of quads in the current render operation, and updates the current buffer index.\n */\n addQuad(params) {\n const { fQuadBuffer, uiQuadBuffer } = this;\n const { width, height, colorTl, colorTr, colorBl, colorBr, textureOptions, shader, shaderProps, alpha, clippingRect, tx, ty, ta, tb, tc, td, } = params;\n let { texture } = params;\n /**\n * If the shader props contain any automatic properties, update it with the\n * current dimensions that will be used to render the quad.\n */\n if (shaderProps && hasOwn(shaderProps, '$dimensions')) {\n const dimensions = shaderProps.$dimensions;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n dimensions.width = width;\n dimensions.height = height;\n }\n texture = texture ?? this.defaultTexture;\n assertTruthy(texture instanceof Texture, 'Invalid texture type');\n let { curBufferIdx: bufferIdx, curRenderOp } = this;\n const targetDims = {\n width,\n height,\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n };\n const targetShader = shader || this.defaultShader;\n assertTruthy(targetShader instanceof WebGlCoreShader);\n if (curRenderOp) {\n // If the current render op is not the same shader, create a new one\n // If the current render op's shader props are not compatible with the\n // the new shader props, create a new one render op.\n if (curRenderOp.shader !== targetShader ||\n !compareRect(curRenderOp.clippingRect, clippingRect) ||\n (curRenderOp.shader !== this.defaultShader &&\n (!shaderProps ||\n !curRenderOp.shader.canBatchShaderProps(curRenderOp.shaderProps, shaderProps)))) {\n curRenderOp = null;\n }\n }\n assertTruthy(targetShader instanceof WebGlCoreShader);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any\n if (!curRenderOp) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n this.newRenderOp(targetShader, shaderProps, alpha, targetDims, clippingRect, bufferIdx);\n curRenderOp = this.curRenderOp;\n assertTruthy(curRenderOp);\n }\n const flipX = textureOptions?.flipX ?? false;\n const flipY = textureOptions?.flipY ?? false;\n let texCoordX1 = 0;\n let texCoordY1 = 0;\n let texCoordX2 = 1;\n let texCoordY2 = 1;\n if (texture instanceof SubTexture) {\n const { x: tx, y: ty, width: tw, height: th } = texture.props;\n const { width: parentW = 0, height: parentH = 0 } = texture.parentTexture\n .dimensions || { width: 0, height: 0 };\n texCoordX1 = tx / parentW;\n texCoordX2 = texCoordX1 + tw / parentW;\n texCoordY1 = ty / parentH;\n texCoordY2 = texCoordY1 + th / parentH;\n texture = texture.parentTexture;\n }\n // Flip texture coordinates if dictated by texture options\n if (flipX) {\n [texCoordX1, texCoordX2] = [texCoordX2, texCoordX1];\n }\n if (flipY) {\n [texCoordY1, texCoordY2] = [texCoordY2, texCoordY1];\n }\n const { txManager } = this.stage;\n const ctxTexture = txManager.getCtxTexture(texture);\n assertTruthy(ctxTexture instanceof WebGlCoreCtxTexture);\n const textureIdx = this.addTexture(ctxTexture, bufferIdx);\n curRenderOp = this.curRenderOp;\n assertTruthy(curRenderOp);\n // render quad advanced\n if (tb !== 0 || tc !== 0) {\n // Upper-Left\n fQuadBuffer[bufferIdx++] = tx; // vertexX\n fQuadBuffer[bufferIdx++] = ty; // vertexY\n fQuadBuffer[bufferIdx++] = texCoordX1; // texCoordX\n fQuadBuffer[bufferIdx++] = texCoordY1; // texCoordY\n uiQuadBuffer[bufferIdx++] = colorTl; // color\n fQuadBuffer[bufferIdx++] = textureIdx; // texIndex\n // Upper-Right\n fQuadBuffer[bufferIdx++] = tx + width * ta;\n fQuadBuffer[bufferIdx++] = ty + width * tc;\n fQuadBuffer[bufferIdx++] = texCoordX2;\n fQuadBuffer[bufferIdx++] = texCoordY1;\n uiQuadBuffer[bufferIdx++] = colorTr;\n fQuadBuffer[bufferIdx++] = textureIdx;\n // Lower-Left\n fQuadBuffer[bufferIdx++] = tx + height * tb;\n fQuadBuffer[bufferIdx++] = ty + height * td;\n fQuadBuffer[bufferIdx++] = texCoordX1;\n fQuadBuffer[bufferIdx++] = texCoordY2;\n uiQuadBuffer[bufferIdx++] = colorBl;\n fQuadBuffer[bufferIdx++] = textureIdx;\n // Lower-Right\n fQuadBuffer[bufferIdx++] = tx + width * ta + height * tb;\n fQuadBuffer[bufferIdx++] = ty + width * tc + height * td;\n fQuadBuffer[bufferIdx++] = texCoordX2;\n fQuadBuffer[bufferIdx++] = texCoordY2;\n uiQuadBuffer[bufferIdx++] = colorBr;\n fQuadBuffer[bufferIdx++] = textureIdx;\n }\n else {\n // Calculate the right corner of the quad\n // multiplied by the scale\n const rightCornerX = tx + width * ta;\n const rightCornerY = ty + height * td;\n // Upper-Left\n fQuadBuffer[bufferIdx++] = tx; // vertexX\n fQuadBuffer[bufferIdx++] = ty; // vertexY\n fQuadBuffer[bufferIdx++] = texCoordX1; // texCoordX\n fQuadBuffer[bufferIdx++] = texCoordY1; // texCoordY\n uiQuadBuffer[bufferIdx++] = colorTl; // color\n fQuadBuffer[bufferIdx++] = textureIdx; // texIndex\n // Upper-Right\n fQuadBuffer[bufferIdx++] = rightCornerX;\n fQuadBuffer[bufferIdx++] = ty;\n fQuadBuffer[bufferIdx++] = texCoordX2;\n fQuadBuffer[bufferIdx++] = texCoordY1;\n uiQuadBuffer[bufferIdx++] = colorTr;\n fQuadBuffer[bufferIdx++] = textureIdx;\n // Lower-Left\n fQuadBuffer[bufferIdx++] = tx;\n fQuadBuffer[bufferIdx++] = rightCornerY;\n fQuadBuffer[bufferIdx++] = texCoordX1;\n fQuadBuffer[bufferIdx++] = texCoordY2;\n uiQuadBuffer[bufferIdx++] = colorBl;\n fQuadBuffer[bufferIdx++] = textureIdx;\n // Lower-Right\n fQuadBuffer[bufferIdx++] = rightCornerX;\n fQuadBuffer[bufferIdx++] = rightCornerY;\n fQuadBuffer[bufferIdx++] = texCoordX2;\n fQuadBuffer[bufferIdx++] = texCoordY2;\n uiQuadBuffer[bufferIdx++] = colorBr;\n fQuadBuffer[bufferIdx++] = textureIdx;\n }\n // Update the length of the current render op\n curRenderOp.length += WORDS_PER_QUAD;\n curRenderOp.numQuads++;\n this.curBufferIdx = bufferIdx;\n }\n /**\n * Replace the existing RenderOp with a new one that uses the specified Shader\n * and starts at the specified buffer index.\n *\n * @param shader\n * @param bufferIdx\n */\n newRenderOp(shader, shaderProps, alpha, dimensions, clippingRect, bufferIdx) {\n const curRenderOp = new WebGlCoreRenderOp(this.glw, this.options, this.quadBufferCollection, shader, shaderProps, alpha, clippingRect, dimensions, bufferIdx, 0);\n this.curRenderOp = curRenderOp;\n this.renderOps.push(curRenderOp);\n }\n /**\n * Add a texture to the current RenderOp. If the texture cannot be added to the\n * current RenderOp, a new RenderOp will be created and the texture will be added\n * to that one.\n *\n * If the texture cannot be added to the new RenderOp, an error will be thrown.\n *\n * @param texture\n * @param bufferIdx\n * @param recursive\n * @returns Assigned Texture Index of the texture in the render op\n */\n addTexture(texture, bufferIdx, recursive) {\n const { curRenderOp } = this;\n assertTruthy(curRenderOp);\n const textureIdx = curRenderOp.addTexture(texture);\n // TODO: Refactor to be more DRY\n if (textureIdx === 0xffffffff) {\n if (recursive) {\n throw new Error('Unable to add texture to render op');\n }\n const { shader, shaderProps, dimensions, clippingRect, alpha } = curRenderOp;\n this.newRenderOp(shader, shaderProps, alpha, dimensions, clippingRect, bufferIdx);\n return this.addTexture(texture, bufferIdx, true);\n }\n return textureIdx;\n }\n /**\n * add RenderOp to the render pipeline\n */\n addRenderOp(renderable) {\n this.renderOps.push(renderable);\n this.curRenderOp = null;\n }\n /**\n * Render the current set of RenderOps to render to the specified surface.\n *\n * TODO: 'screen' is the only supported surface at the moment.\n *\n * @param surface\n */\n render(surface = 'screen') {\n const { glw, quadBuffer } = this;\n const arr = new Float32Array(quadBuffer, 0, this.curBufferIdx);\n const buffer = this.quadBufferCollection.getBuffer('a_position') ?? null;\n glw.arrayBufferData(buffer, arr, glw.STATIC_DRAW);\n const doLog = false; // idx++ % 100 === 0;\n if (doLog) {\n console.log('renderOps', this.renderOps.length);\n }\n this.renderOps.forEach((renderOp, i) => {\n if (doLog) {\n console.log('renderOp', i, renderOp.numQuads);\n }\n renderOp.draw();\n });\n // clean up\n this.renderables = [];\n }\n}\nconst idx = 0;\n//# sourceMappingURL=WebGlCoreRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport const SpecialCodepoints = {\n LINE_FEED: 0x0a,\n CARRIAGE_RETURN: 0x0d,\n SPACE: 0x20,\n TAB: 0x09,\n ZERO_WIDTH_SPACE: 0x200b,\n ZERO_WIDTH_NON_JOINER: 0x200c,\n ZERO_WIDTH_JOINER: 0x200d,\n LEFT_TO_RIGHT_MARK: 0x200e,\n RIGHT_TO_LEFT_MARK: 0x200f,\n LEFT_TO_RIGHT_EMBEDDING: 0x202a,\n RIGHT_TO_LEFT_EMBEDDING: 0x202b,\n POP_DIRECTIONAL_FORMATTING: 0x202c,\n LEFT_TO_RIGHT_OVERRIDE: 0x202d,\n RIGHT_TO_LEFT_OVERRIDE: 0x202e,\n LINE_SEPARATOR: 0x2028,\n PARAGRAPH_SEPARATOR: 0x2029,\n OBJECT_REPLACEMENT_CHARACTER: 0xfffc,\n REPLACEMENT_CHARACTER: 0xfffd,\n ZERO_WIDTH_NO_BREAK_SPACE: 0xfeff,\n LEFT_TO_RIGHT_ISOLATE: 0x2066,\n RIGHT_TO_LEFT_ISOLATE: 0x2067,\n FIRST_STRONG_ISOLATE: 0x2068,\n POP_DIRECTIONAL_ISOLATE: 0x2069,\n INHIBIT_SYMMETRIC_SWAPPING: 0x206a,\n ACTIVATE_SYMMETRIC_SWAPPING: 0x206b,\n INHIBIT_ARABIC_FORM_SHAPING: 0x206c,\n ACTIVATE_ARABIC_FORM_SHAPING: 0x206d,\n NATIONAL_DIGIT_SHAPES: 0x206e,\n NOMINAL_DIGIT_SHAPES: 0x206f,\n LEFT_TO_RIGHT_BOUNDARY: 0x200e,\n RIGHT_TO_LEFT_BOUNDARY: 0x200f,\n};\n//# sourceMappingURL=SpecialCodepoints.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class FontShaper {\n}\n//# sourceMappingURL=FontShaper.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { SpecialCodepoints } from '../../../renderers/SdfTextRenderer/internal/SpecialCodepoints.js';\nimport { FontShaper, } from './FontShaper.js';\nexport class SdfFontShaper extends FontShaper {\n data;\n glyphMap;\n kernings;\n constructor(data, glyphMap) {\n super();\n this.data = data;\n this.glyphMap = glyphMap;\n const kernings = (this.kernings = {});\n data.kernings.forEach((kerning) => {\n const second = kerning.second;\n const firsts = (kernings[second] = kernings[second] || {});\n firsts[kerning.first] = kerning.amount;\n });\n this.kernings = kernings;\n }\n *shapeText(props, codepoints) {\n let codepointResult;\n let lastGlyphId = undefined;\n while ((codepointResult = codepoints.peek()) && !codepointResult.done) {\n const codepoint = codepointResult.value;\n const glyph = this.glyphMap.get(codepoint);\n codepoints.next();\n if (glyph !== undefined) {\n // We found a glyph for this codepoint\n // Yield the mapped glyph info\n /**\n * Kerning includes any possible additional letter spacing\n */\n const kerning = lastGlyphId !== undefined\n ? (this.kernings[glyph.id]?.[lastGlyphId] || 0) +\n props.letterSpacing\n : 0;\n lastGlyphId = glyph.id;\n yield {\n mapped: true,\n glyphId: glyph.id,\n codepoint,\n cluster: codepoints.lastIndex,\n xAdvance: glyph.xadvance + kerning,\n yAdvance: 0,\n xOffset: glyph.xoffset + kerning,\n yOffset: glyph.yoffset,\n xBearing: 0,\n yBearing: 0,\n width: glyph.width,\n height: glyph.height,\n };\n }\n else {\n // We didn't find a glyph for this codepoint\n // Yield the unmapped codepoint info\n // If this codepoint is a linebreak, we should reset the last glyph id\n // so that the next glyph will not be kerned with the last glyph of the\n // previous line.\n if (codepoint === SpecialCodepoints.LINE_FEED) {\n lastGlyphId = undefined;\n }\n yield {\n mapped: false,\n codepoint,\n cluster: codepoints.lastIndex,\n };\n }\n }\n }\n}\n//# sourceMappingURL=SdfFontShaper.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// import type { Renderer } from '../../../Renderer';\nimport { assertTruthy } from '../../../../utils.js';\nimport { WebGlCoreRenderer } from '../../../renderers/webgl/WebGlCoreRenderer.js';\nimport { ImageTexture } from '../../../textures/ImageTexture.js';\nimport { TrFontFace } from '../TrFontFace.js';\nimport { SdfFontShaper } from './internal/SdfFontShaper.js';\nexport class SdfTrFontFace extends TrFontFace {\n type;\n texture;\n /**\n * Height of the tallest character in the font including the whitespace above it\n */\n maxCharHeight = 0;\n data;\n shaper;\n glyphMap = new Map();\n constructor(fontFamily, descriptors, type, stage, atlasUrl, atlasDataUrl) {\n super(fontFamily, descriptors);\n this.type = type;\n const renderer = stage.renderer;\n assertTruthy(renderer instanceof WebGlCoreRenderer, 'SDF Font Faces can only be used with the WebGL Renderer');\n this.texture = stage.txManager.loadTexture('ImageTexture', {\n src: atlasUrl,\n // IMPORTANT: The SDF shader requires the alpha channel to NOT be\n // premultiplied on the atlas texture. If it is premultiplied, the\n // rendering of SDF glyphs (especially single-channel SDF fonts) will\n // be very jagged.\n premultiplyAlpha: false,\n }, {\n preload: true,\n });\n this.texture.on('loaded', () => {\n this.checkLoaded();\n });\n // Set this.data to the fetched data from dataUrl\n fetch(atlasDataUrl)\n .then(async (response) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n this.data = await response.json();\n // Add all the glyphs to the glyph map\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n let maxCharHeight = 0;\n this.data.chars.forEach((glyph) => {\n this.glyphMap.set(glyph.id, glyph);\n const charHeight = glyph.yoffset + glyph.height;\n if (charHeight > maxCharHeight) {\n maxCharHeight = charHeight;\n }\n });\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.maxCharHeight = maxCharHeight;\n // We know `data` is defined here, because we just set it\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.shaper = new SdfFontShaper(this.data, this.glyphMap);\n this.checkLoaded();\n })\n .catch(console.error);\n }\n getAtlasEntry(glyphId) {\n const glyph = this.glyphMap.get(glyphId);\n if (glyph === undefined) {\n throw new Error(`Glyph ${glyphId} not found in font ${this.fontFamily}`);\n }\n return {\n x: glyph.x,\n y: glyph.y,\n width: glyph.width,\n height: glyph.height,\n };\n }\n checkLoaded() {\n if (this.loaded)\n return;\n if (this.texture.state === 'loaded' && this.data) {\n this.loaded = true;\n this.emit('loaded');\n }\n }\n}\n//# sourceMappingURL=SdfTrFontFace.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Base class for Core extensions.\n *\n * @remarks\n * Core extensions are used to extend the Core Renderer with custom code such as\n * custom fonts, custom shaders, custom textures, custom animation functions,\n * and more.\n */\nexport class CoreExtension {\n}\n//# sourceMappingURL=CoreExtension.js.map"],"names":["createWebGLContext","canvas","contextSpy","config","gl","target","prop","value","assertTruthy","condition","message","isProductionEnvironment","mergeColorProgress","rgba1","rgba2","p","r1","g1","b1","a1","r2","g2","b2","a2","r","g","b","a","mergeColorAlpha","rgba","alpha","mergeColorAlphaPremultiplied","flipEndianess","newAlpha","hasOwn","obj","EventEmitter","__publicField","event","listener","listeners","index","onceListener","data","CoreShader","props","createShader","glw","type","source","shader","createProgram","vertexShader","fragmentShader","program","isWebGl2","WebGlCoreShader","options","renderer","webGl2","requiredExtensions","glVersion","extensionName","shaderSources","textureUnits","vertexSource","fragmentSource","vao","attributeName","location","buffer","uniform","attribute","loc","propsA","propsB","renderOp","dimensions","name","resolvedBuffer","resolvedInfo","textures","Texture","txManager","owner","renderable","state","args","loadedArgs","failedArgs","getNormalizedRgbaComponents","getNormalizedAlphaComponent","getRgbaString","color","createBound","x1","y1","x2","y2","out","intersectBound","intersection","boundsOverlap","convertBoundToRect","bound","intersectRect","x","y","width","height","copyRect","compareRect","boundInsideBound","bound1","bound2","isBoundPositive","TrFontFace","fontFamily","descriptors","WebTrFontFace","fontUrl","fontUrlWithoutParentheses","determinedDescriptors","cssDescriptors","fontFace","CoreContextTexture","memManager","textureSource","CoreRenderer","stage","CoreRenderOp","WebGlCoreRenderOp","buffers","shaderProps","clippingRect","bufferIdx","zIndex","texture","maxTextures","existingIdx","t","newIdx","shManager","quadIdx","pixelRatio","canvasHeight","clipX","clipWidth","clipHeight","clipY","getWebGlParameters","params","key","getWebGlExtensions","extensions","createIndexBuffer","size","maxQuads","indices","j","isHTMLImageElement","memize","fn","head","tail","memoized","node","len","i","searchCache","isPowerOfTwo","getTimingBezier","c","d","xc","xb","xa","yc","yb","ya","time","cbx","cbxd","dx","it","minT","maxT","getTimingFunction","memo","str","s","parts","TRANSPARENT_TEXTURE_DATA","WebGlCoreCtxTexture","err","_a","_b","textureData","mipmaps","glInternalFormat","view","nativeTexture","_ColorTexture","pixelData32","pixelData8","resolvedProps","ColorTexture","_SubTexture","error","parentTx","SubTexture","WebGlCoreCtxSubTexture","BufferCollection","item","WebGlContextWrapper","maxTextureUnits","_","scissorBox","textureUnit","activeTextureUnit","texture2dUnits","pname","param","texture2dParams","activeTexture","textureParams","level","internalFormat","widthOrFormat","heightOrType","borderOrSource","format","pixels","internalformat","border","red","green","blue","enable","scissorEnabled","scissorX","scissorY","scissorWidth","scissorHeight","blend","blendEnabled","src","dst","blendSrcRgb","blendDstRgb","blendSrcAlpha","blendDstAlpha","usage","boundArrayBuffer","boundElementArrayBuffer","normalized","stride","offset","curProgram","programUniforms","uniforms","uniformArgs","compareArrays","mode","count","vertexArray","v","WORDS_PER_QUAD","WebGlCoreRenderer","clearColor","bufferMemory","quadBuffer","fQuadBuffer","uiQuadBuffer","colorTl","colorTr","colorBl","colorBr","textureOptions","tx","ty","ta","tb","tc","td","curRenderOp","targetDims","targetShader","flipX","flipY","texCoordX1","texCoordY1","texCoordX2","texCoordY2","tw","th","parentW","parentH","ctxTexture","textureIdx","rightCornerX","rightCornerY","recursive","surface","arr","SpecialCodepoints","FontShaper","SdfFontShaper","glyphMap","kernings","kerning","second","firsts","codepoints","codepointResult","lastGlyphId","codepoint","glyph","SdfTrFontFace","atlasUrl","atlasDataUrl","response","maxCharHeight","charHeight","glyphId","CoreExtension"],"mappings":"4KAkBgB,SAAAA,GAAmBC,EAAQC,EAAY,CACnD,MAAMC,EAAS,CACX,MAAO,GACP,UAAW,GACX,MAAO,GACP,QAAS,GACT,eAAgB,GAGhB,gBAAiB,mBACjB,mBAAoB,GACpB,sBAAuB,EAAA,EAErBC,EAGLH,EAAO,WAAW,QAASE,CAAM,GAC9BF,EAAO,WAAW,qBAAsBE,CAAM,EAClD,GAAI,CAACC,EACK,MAAA,IAAI,MAAM,gCAAgC,EAEpD,OAAIF,EAEO,IAAI,MAAME,EAAI,CACjB,IAAIC,EAAQC,EAAM,CACR,MAAAC,EAAQF,EAAOC,CAAI,EACrB,OAAA,OAAOC,GAAU,YACNL,EAAA,UAAU,OAAOI,CAAI,CAAC,EAC1BC,EAAM,KAAKF,CAAM,GAErBE,CACX,CAAA,CACH,EAEEH,CACX,CAagB,SAAAI,EAAaC,EAAWC,EAAS,CAC7C,GAAI,CAAAC,GAAwB,GAExB,CAACF,EACK,MAAA,IAAI,MAAMC,GAAW,kBAAkB,CAErD,CAcgB,SAAAE,GAAmBC,EAAOC,EAAOC,EAAG,CAChD,MAAMC,EAAK,KAAK,MAAMH,IAAU,EAAE,EAC5BI,EAAK,KAAK,MAAOJ,IAAU,GAAM,GAAI,EACrCK,EAAK,KAAK,MAAOL,IAAU,EAAK,GAAI,EACpCM,EAAK,KAAK,MAAMN,EAAQ,GAAI,EAC5BO,EAAK,KAAK,MAAMN,IAAU,EAAE,EAC5BO,EAAK,KAAK,MAAOP,IAAU,GAAM,GAAI,EACrCQ,EAAK,KAAK,MAAOR,IAAU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Aa,CAE1B,KAAK,KAAO,MAAMA,EAAS,KAAI,EAG/B,IAAIC,EAAgB,EACpB,KAAK,KAAK,MAAM,QAASL,GAAU,CAC/B,KAAK,SAAS,IAAIA,EAAM,GAAIA,CAAK,EACjC,MAAMM,EAAaN,EAAM,QAAUA,EAAM,OACrCM,EAAaD,IACbA,EAAgBC,EAEpC,CAAa,EAED,KAAK,cAAgBD,EAGrB,KAAK,OAAS,IAAIf,GAAc,KAAK,KAAM,KAAK,QAAQ,EACxD,KAAK,YAAW,CAC5B,CAAS,EACI,MAAM,QAAQ,KAAK,CAC3B,CACD,cAAciB,EAAS,CACnB,MAAMP,EAAQ,KAAK,SAAS,IAAIO,CAAO,EACvC,GAAIP,IAAU,OACV,MAAM,IAAI,MAAM,SAAS,OAAAO,EAAO,uBAAsB,YAAK,WAAY,EAE3E,MAAO,CACH,EAAGP,EAAM,EACT,EAAGA,EAAM,EACT,MAAOA,EAAM,MACb,OAAQA,EAAM,MAC1B,CACK,CACD,aAAc,CACN,KAAK,QAEL,KAAK,QAAQ,QAAU,UAAY,KAAK,OACxC,KAAK,OAAS,GACd,KAAK,KAAK,QAAQ,EAEzB,CACL,CCtEO,MAAMQ,EAAc,CAC3B","x_google_ignoreList":[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]} \ No newline at end of file +{"version":3,"file":"CoreExtension-BSpcUIDc.js","sources":["../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/utils.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/common/EventEmitter.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/CoreShader.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/internal/ShaderUtils.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/internal/WebGlUtils.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/WebGlCoreShader.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/textures/Texture.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/lib/utils.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/font-face-types/TrFontFace.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/font-face-types/WebTrFontFace.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/CoreContextTexture.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/CoreRenderer.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/CoreRenderOp.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/WebGlCoreRenderOp.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/internal/RendererUtils.js","../../../../node_modules/.pnpm/memize@2.1.0/node_modules/memize/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/utils.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/WebGlCoreCtxTexture.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/textures/ColorTexture.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/textures/SubTexture.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/WebGlCoreCtxSubTexture.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/internal/BufferCollection.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/lib/WebGlContextWrapper.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/WebGlCoreRenderer.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/SpecialCodepoints.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/font-face-types/SdfTrFontFace/internal/FontShaper.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/font-face-types/SdfTrFontFace/internal/SdfFontShaper.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/font-face-types/SdfTrFontFace/SdfTrFontFace.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/CoreExtension.js"],"sourcesContent":["/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport function createWebGLContext(canvas, contextSpy) {\n const config = {\n alpha: true,\n antialias: false,\n depth: false,\n stencil: true,\n desynchronized: false,\n // Disabled because it prevents Visual Regression Tests from working\n // failIfMajorPerformanceCaveat: true,\n powerPreference: 'high-performance',\n premultipliedAlpha: true,\n preserveDrawingBuffer: false,\n };\n const gl = \n // TODO: Remove this assertion once this issue is fixed in TypeScript\n // https://github.com/microsoft/TypeScript/issues/53614\n (canvas.getContext('webgl', config) ||\n canvas.getContext('experimental-webgl', config));\n if (!gl) {\n throw new Error('Unable to create WebGL context');\n }\n if (contextSpy) {\n // Proxy the GL context to log all GL calls\n return new Proxy(gl, {\n get(target, prop) {\n const value = target[prop];\n if (typeof value === 'function') {\n contextSpy.increment(String(prop));\n return value.bind(target);\n }\n return value;\n },\n });\n }\n return gl;\n}\n/**\n * Asserts a condition is truthy, otherwise throws an error\n *\n * @remarks\n * Useful at the top of functions to ensure certain conditions, arguments and\n * properties are set/met before continuing. When using this function,\n * TypeScript will narrow away falsy types from the condition.\n *\n * @param condition\n * @param message\n * @returns\n */\nexport function assertTruthy(condition, message) {\n if (isProductionEnvironment())\n return;\n if (!condition) {\n throw new Error(message || 'Assertion failed');\n }\n}\n/**\n * Merges two colors based on a given progress value.\n *\n * This function takes two colors (c1 and c2) represented as 32-bit integers\n * in RGBA format and blends them based on the provided progress value (p).\n * The result is a new color that is a weighted combination of the input colors,\n * where the weight is determined by the progress value.\n *\n * @param {number} c1 - The first color in RGBA format (32-bit integer).\n * @param {number} c2 - The second color in RGBA format (32-bit integer).\n * @param {number} p - The progress value between 0 and 1.\n * @returns {number} The merged color as a 32-bit integer in RGBA format.\n */\nexport function mergeColorProgress(rgba1, rgba2, p) {\n const r1 = Math.trunc(rgba1 >>> 24);\n const g1 = Math.trunc((rgba1 >>> 16) & 0xff);\n const b1 = Math.trunc((rgba1 >>> 8) & 0xff);\n const a1 = Math.trunc(rgba1 & 0xff);\n const r2 = Math.trunc(rgba2 >>> 24);\n const g2 = Math.trunc((rgba2 >>> 16) & 0xff);\n const b2 = Math.trunc((rgba2 >>> 8) & 0xff);\n const a2 = Math.trunc(rgba2 & 0xff);\n const r = Math.round(r2 * p + r1 * (1 - p));\n const g = Math.round(g2 * p + g1 * (1 - p));\n const b = Math.round(b2 * p + b1 * (1 - p));\n const a = Math.round(a2 * p + a1 * (1 - p));\n return ((r << 24) | (g << 16) | (b << 8) | a) >>> 0;\n}\n/**\n * Given an RGBA encoded number, returns back the RGBA number with it's alpha\n * component multiplied by the passed `alpha` parameter.\n *\n * @internalRemarks\n * This method does NOT premultiply the alpha into the color channels. If that\n * is required (for internal use only) use {@link mergeColorAlphaPremultiplied}\n * instead.\n *\n * @param rgba RGBA encoded number\n * @param alpha Normalized alpha value (Range: 0.0 - 1.0)\n * @returns\n */\nexport function mergeColorAlpha(rgba, alpha) {\n const r = rgba >>> 24;\n const g = (rgba >>> 16) & 0xff;\n const b = (rgba >>> 8) & 0xff;\n const a = Math.trunc((rgba & 0xff) * alpha);\n return ((r << 24) | (g << 16) | (b << 8) | a) >>> 0;\n}\n/**\n * Given an RGBA encoded number, returns back the RGBA number with it's alpha\n * component multiplied by the passed `alpha` parameter. Before returning, the\n * final alpha value is multiplied into the color channels.\n *\n * @remarks\n * If `flipEndianess` is set to true, the function will returned an ABGR encoded number\n * which is useful when the color value needs to be passed into a shader attribute.\n *\n * NOTE: This method returns a PREMULTIPLIED alpha color which is generally only useful\n * in the context of the internal rendering process. Use {@link mergeColorAlpha} if you\n * need to blend an alpha value into a color in the context of the Renderer's\n * main API.\n *\n * @internalRemarks\n * Do not expose this method in the main API because Renderer users should instead use\n * {@link mergeColorAlpha} to manipulate the alpha value of a color.\n *\n * @internal\n * @param rgba RGBA encoded number\n * @param alpha Normalized alpha value (Range: 0.0 - 1.0)\n * @param flipEndianess Flip the endianess. RGBA becomes encoded as ABGR (for inserting colors into shader attributes)\n * @returns\n */\nexport function mergeColorAlphaPremultiplied(rgba, alpha, flipEndianess = false) {\n const newAlpha = ((rgba & 0xff) / 255) * alpha;\n const r = Math.trunc((rgba >>> 24) * newAlpha);\n const g = Math.trunc(((rgba >>> 16) & 0xff) * newAlpha);\n const b = Math.trunc(((rgba >>> 8) & 0xff) * newAlpha);\n const a = Math.trunc(newAlpha * 255);\n if (flipEndianess) {\n return ((a << 24) | (b << 16) | (g << 8) | r) >>> 0;\n }\n return ((r << 24) | (g << 16) | (b << 8) | a) >>> 0;\n}\n/**\n * Returns true if the given object has the given \"own\" property.\n *\n * @param obj\n * @param prop\n * @returns\n */\nexport function hasOwn(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n/**\n * Converts degrees to radians\n *\n * @param degrees\n * @returns\n */\nexport function deg2Rad(degrees) {\n return (degrees * Math.PI) / 180;\n}\n/**\n * Returns image aspect ratio\n *\n * @param width\n * @param height\n * @returns\n */\nexport function getImageAspectRatio(width, height) {\n return width / height;\n}\n/**\n * Checks import.meta if env is production\n *\n * @returns\n */\nexport function isProductionEnvironment() {\n return import.meta.env && import.meta.env.PROD;\n}\n//# sourceMappingURL=utils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * EventEmitter base class\n */\nexport class EventEmitter {\n eventListeners = {};\n on(event, listener) {\n let listeners = this.eventListeners[event];\n if (!listeners) {\n listeners = [];\n }\n listeners.push(listener);\n this.eventListeners[event] = listeners;\n }\n off(event, listener) {\n const listeners = this.eventListeners[event];\n if (!listeners) {\n return;\n }\n if (!listener) {\n delete this.eventListeners[event];\n return;\n }\n const index = listeners.indexOf(listener);\n if (index >= 0) {\n listeners.splice(index, 1);\n }\n }\n once(event, listener) {\n const onceListener = (target, data) => {\n this.off(event, onceListener);\n listener(target, data);\n };\n this.on(event, onceListener);\n }\n emit(event, data) {\n const listeners = this.eventListeners[event];\n if (!listeners) {\n return;\n }\n [...listeners].forEach((listener) => {\n listener(this, data);\n });\n }\n removeAllListeners() {\n this.eventListeners = {};\n }\n}\n//# sourceMappingURL=EventEmitter.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class CoreShader {\n // abstract draw(): void;\n static makeCacheKey(props) {\n return false;\n }\n static resolveDefaults(props) {\n return {};\n }\n}\n//# sourceMappingURL=CoreShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion Types\nexport function createShader(glw, type, source) {\n const shader = glw.createShader(type);\n if (!shader) {\n throw new Error();\n }\n glw.shaderSource(shader, source);\n glw.compileShader(shader);\n const success = glw.getShaderParameter(shader, glw.COMPILE_STATUS);\n if (success) {\n return shader;\n }\n console.log(glw.getShaderInfoLog(shader));\n glw.deleteShader(shader);\n}\nexport function createProgram(glw, vertexShader, fragmentShader) {\n const program = glw.createProgram();\n if (!program) {\n throw new Error();\n }\n glw.attachShader(program, vertexShader);\n glw.attachShader(program, fragmentShader);\n glw.linkProgram(program);\n const success = glw.getProgramParameter(program, glw.LINK_STATUS);\n if (success) {\n return program;\n }\n console.log(glw.getProgramInfoLog(program));\n glw.deleteProgram(program);\n return undefined;\n}\n//# sourceMappingURL=ShaderUtils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Generic WebGL Utility Functions\n *\n * @remarks\n * Nothing here should be coupled to Renderer logic / types.\n *\n * @param gl\n * @returns\n */\nexport function isWebGl2(gl) {\n return (self.WebGL2RenderingContext && gl instanceof self.WebGL2RenderingContext);\n}\n//# sourceMappingURL=WebGlUtils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy, hasOwn } from '../../../utils.js';\nimport { CoreShader } from '../CoreShader.js';\nimport { createProgram, createShader, } from './internal/ShaderUtils.js';\nimport { isWebGl2 } from './internal/WebGlUtils.js';\nexport class WebGlCoreShader extends CoreShader {\n boundBufferCollection = null;\n buffersBound = false;\n program;\n /**\n * Vertex Array Object\n *\n * @remarks\n * Used by WebGL2 Only\n */\n vao;\n renderer;\n glw;\n attributeBuffers;\n attributeLocations;\n attributeNames;\n uniformLocations;\n uniformTypes;\n supportsIndexedTextures;\n constructor(options) {\n super();\n const renderer = (this.renderer = options.renderer);\n const glw = (this.glw = this.renderer.glw);\n this.supportsIndexedTextures = options.supportsIndexedTextures || false;\n // Check that extensions are supported\n const webGl2 = glw.isWebGl2();\n const requiredExtensions = (webGl2 && options.webgl2Extensions) ||\n (!webGl2 && options.webgl1Extensions) ||\n [];\n const glVersion = webGl2 ? '2.0' : '1.0';\n requiredExtensions.forEach((extensionName) => {\n if (!glw.getExtension(extensionName)) {\n throw new Error(`Shader \"${this.constructor.name}\" requires extension \"${extensionName}\" for WebGL ${glVersion} but wasn't found`);\n }\n });\n // Gather shader sources\n // - If WebGL 2 and special WebGL 2 sources are provided, we copy those sources and delete\n // the extra copy of them to save memory.\n // TODO: This could be further made optimal by just caching the compiled shaders and completely deleting\n // the source code\n const shaderSources = options.shaderSources ||\n this.constructor.shaderSources;\n if (!shaderSources) {\n throw new Error(`Shader \"${this.constructor.name}\" is missing shaderSources.`);\n }\n else if (webGl2 && shaderSources?.webGl2) {\n shaderSources.fragment = shaderSources.webGl2.fragment;\n shaderSources.vertex = shaderSources.webGl2.vertex;\n delete shaderSources.webGl2;\n }\n const textureUnits = renderer.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS;\n const vertexSource = shaderSources.vertex instanceof Function\n ? shaderSources.vertex(textureUnits)\n : shaderSources.vertex;\n const fragmentSource = shaderSources.fragment instanceof Function\n ? shaderSources.fragment(textureUnits)\n : shaderSources.fragment;\n const vertexShader = createShader(glw, glw.VERTEX_SHADER, vertexSource);\n const fragmentShader = createShader(glw, glw.FRAGMENT_SHADER, fragmentSource);\n if (!vertexShader || !fragmentShader) {\n throw new Error();\n }\n const program = createProgram(glw, vertexShader, fragmentShader);\n if (!program) {\n throw new Error();\n }\n this.program = program;\n if (webGl2) {\n const vao = glw.createVertexArray();\n if (!vao) {\n throw new Error();\n }\n this.vao = vao;\n glw.bindVertexArray(this.vao);\n }\n this.attributeLocations = {};\n this.attributeBuffers = {};\n this.attributeNames = [];\n [...options.attributes].forEach((attributeName) => {\n const location = glw.getAttribLocation(this.program, attributeName);\n if (location < 0) {\n throw new Error(`${this.constructor.name}: Vertex shader must have an attribute \"${attributeName}\"!`);\n }\n const buffer = glw.createBuffer();\n if (!buffer) {\n throw new Error(`${this.constructor.name}: Could not create buffer for attribute \"${attributeName}\"`);\n }\n this.attributeLocations[attributeName] = location;\n this.attributeBuffers[attributeName] = buffer;\n this.attributeNames.push(attributeName);\n });\n this.uniformLocations = {};\n this.uniformTypes = {};\n options.uniforms.forEach((uniform) => {\n const location = glw.getUniformLocation(this.program, uniform.name);\n this.uniformTypes[uniform.name] = uniform.uniform;\n if (!location) {\n console.warn(`Shader \"${this.constructor.name}\" could not get uniform location for \"${uniform.name}\"`);\n return;\n }\n this.uniformLocations[uniform.name] = location;\n });\n }\n bindBufferAttribute(location, buffer, attribute) {\n const { glw } = this;\n glw.enableVertexAttribArray(location);\n glw.vertexAttribPointer(buffer, location, attribute.size, attribute.type, attribute.normalized, attribute.stride, attribute.offset);\n }\n disableAttribute(location) {\n this.glw.disableVertexAttribArray(location);\n }\n disableAttributes() {\n for (const loc in this.attributeLocations) {\n this.disableAttribute(this.attributeLocations[loc]);\n }\n this.boundBufferCollection = null;\n }\n /**\n * Given two sets of Shader props destined for this Shader, determine if they can be batched together\n * to reduce the number of draw calls.\n *\n * @remarks\n * This is used by the {@link WebGlCoreRenderer} to determine if it can batch multiple consecutive draw\n * calls into a single draw call.\n *\n * By default, this returns false (meaning no batching is allowed), but can be\n * overridden by child classes to provide more efficient batching.\n *\n * @param propsA\n * @param propsB\n * @returns\n */\n canBatchShaderProps(propsA, propsB) {\n return false;\n }\n bindRenderOp(renderOp, props) {\n this.bindBufferCollection(renderOp.buffers);\n if (renderOp.textures.length > 0) {\n this.bindTextures(renderOp.textures);\n }\n const { glw } = renderOp;\n // Bind standard automatic uniforms\n this.setUniform('u_resolution', [glw.canvas.width, glw.canvas.height]);\n this.setUniform('u_pixelRatio', renderOp.options.pixelRatio);\n if (props) {\n // Bind optional automatic uniforms\n // These are only bound if their keys are present in the props.\n if (hasOwn(props, '$dimensions')) {\n let dimensions = props.$dimensions;\n if (!dimensions) {\n dimensions = renderOp.dimensions;\n }\n this.setUniform('u_dimensions', [dimensions.width, dimensions.height]);\n }\n if (hasOwn(props, '$alpha')) {\n let alpha = props.$alpha;\n if (!alpha) {\n alpha = renderOp.alpha;\n }\n this.setUniform('u_alpha', alpha);\n }\n this.bindProps(props);\n }\n }\n setUniform(name, ...value) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-unsafe-argument\n this.glw.setUniform(this.uniformTypes[name], this.uniformLocations[name], ...value);\n }\n bindBufferCollection(buffer) {\n if (this.boundBufferCollection === buffer) {\n return;\n }\n for (const attributeName in this.attributeLocations) {\n const resolvedBuffer = buffer.getBuffer(attributeName);\n const resolvedInfo = buffer.getAttributeInfo(attributeName);\n assertTruthy(resolvedBuffer, `Buffer for \"${attributeName}\" not found`);\n assertTruthy(resolvedInfo);\n this.bindBufferAttribute(this.attributeLocations[attributeName], resolvedBuffer, resolvedInfo);\n }\n this.boundBufferCollection = buffer;\n }\n bindProps(props) {\n // Implement in child class\n }\n bindTextures(textures) {\n // no defaults\n }\n attach() {\n this.glw.useProgram(this.program);\n this.glw.useProgram(this.program);\n if (this.glw.isWebGl2() && this.vao) {\n this.glw.bindVertexArray(this.vao);\n }\n }\n detach() {\n this.disableAttributes();\n }\n static shaderSources;\n}\n//# sourceMappingURL=WebGlCoreShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EventEmitter } from '../../common/EventEmitter.js';\n/**\n * Represents a source of texture data for a CoreContextTexture.\n *\n * @remarks\n * Texture sources are used to populate a CoreContextTexture when that texture\n * is loaded. Texture data retrieved by the CoreContextTexture by the\n * `getTextureData` method. It's the responsibility of the concerete `Texture`\n * subclass to implement this method appropriately.\n */\nexport class Texture extends EventEmitter {\n txManager;\n /**\n * The dimensions of the texture\n *\n * @remarks\n * Until the texture data is loaded for the first time the value will be\n * `null`.\n */\n dimensions = null;\n error = null;\n state = 'freed';\n renderableOwners = new Set();\n constructor(txManager) {\n super();\n this.txManager = txManager;\n }\n /**\n * Add/remove an owner to/from the Texture based on its renderability.\n *\n * @remarks\n * Any object can own a texture, be it a CoreNode or even the state object\n * from a Text Renderer.\n *\n * When the reference to the texture that an owner object holds is replaced\n * or cleared it must call this with `renderable=false` to release the owner\n * association.\n *\n * @param owner\n * @param renderable\n */\n setRenderableOwner(owner, renderable) {\n if (renderable) {\n this.renderableOwners.add(owner);\n }\n else {\n this.renderableOwners.delete(owner);\n }\n }\n /**\n * Returns true if the texture is assigned to any Nodes that are renderable.\n */\n get renderable() {\n return this.renderableOwners.size > 0;\n }\n /**\n * Set the state of the texture\n *\n * @remark\n * Intended for internal-use only but declared public so that it can be set\n * by it's associated {@link CoreContextTexture}\n *\n * @param state\n * @param args\n */\n setState(state, ...args) {\n if (this.state !== state) {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.state = state;\n if (state === 'loaded') {\n const loadedArgs = args;\n this.dimensions = loadedArgs[0];\n }\n else if (state === 'failed') {\n const failedArgs = args;\n this.error = failedArgs[0];\n }\n this.emit(state, ...args);\n }\n }\n /**\n * Make a cache key for this texture.\n *\n * @remarks\n * Each concrete `Texture` subclass must implement this method to provide an\n * appropriate cache key for the texture type including the texture's\n * properties that uniquely identify a copy of the texture. If the texture\n * type does not support caching, then this method should return `false`.\n *\n * @param props\n * @returns\n * A cache key for this texture or `false` if the texture type does not\n * support caching.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static makeCacheKey(props) {\n return false;\n }\n /**\n * Resolve the default values for the texture's properties.\n *\n * @remarks\n * Each concrete `Texture` subclass must implement this method to provide\n * default values for the texture's optional properties.\n *\n * @param props\n * @returns\n * The default values for the texture's properties.\n */\n static resolveDefaults(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n props) {\n return {};\n }\n}\n//# sourceMappingURL=Texture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport const getNormalizedRgbaComponents = (rgba) => {\n const r = rgba >>> 24;\n const g = (rgba >>> 16) & 0xff;\n const b = (rgba >>> 8) & 0xff;\n const a = rgba & 0xff;\n return [r / 255, g / 255, b / 255, a / 255];\n};\nexport const getRgbaComponents = (rgba) => {\n const r = rgba >>> 24;\n const g = (rgba >>> 16) & 0xff;\n const b = (rgba >>> 8) & 0xff;\n const a = rgba & 0xff;\n return [r, g, b, a];\n};\nexport const norm = (rgba) => {\n const r = rgba >>> 24;\n const g = (rgba >>> 16) & 0xff;\n const b = (rgba >>> 8) & 0xff;\n const a = rgba & 0xff;\n const rgbaArr = [r / 255, g / 255, b / 255, a / 255];\n rgbaArr[0] = Math.max(0, Math.min(255, rgbaArr[0]));\n rgbaArr[1] = Math.max(0, Math.min(255, rgbaArr[1]));\n rgbaArr[2] = Math.max(0, Math.min(255, rgbaArr[2]));\n rgbaArr[3] = Math.max(0, Math.min(255, rgbaArr[3]));\n let v = ((rgbaArr[3] | 0) << 24) +\n ((rgbaArr[0] | 0) << 16) +\n ((rgbaArr[1] | 0) << 8) +\n (rgbaArr[2] | 0);\n if (v < 0) {\n v = 0xffffffff + v + 1;\n }\n return v;\n};\nexport function getNormalizedAlphaComponent(rgba) {\n return (rgba & 0xff) / 255.0;\n}\n/**\n * Get a CSS color string from a RGBA color\n *\n * @param color\n * @returns\n */\nexport function getRgbaString(color) {\n const r = Math.floor(color[0] * 255.0);\n const g = Math.floor(color[1] * 255.0);\n const b = Math.floor(color[2] * 255.0);\n const a = Math.floor(color[3] * 255.0);\n return `rgba(${r},${g},${b},${a.toFixed(4)})`;\n}\nexport function createBound(x1, y1, x2, y2, out) {\n if (out) {\n out.x1 = x1;\n out.y1 = y1;\n out.x2 = x2;\n out.y2 = y2;\n return out;\n }\n return {\n x1,\n y1,\n x2,\n y2,\n };\n}\nexport function intersectBound(a, b, out) {\n const intersection = createBound(Math.max(a.x1, b.x1), Math.max(a.y1, b.y1), Math.min(a.x2, b.x2), Math.min(a.y2, b.y2), out);\n if (intersection.x1 < intersection.x2 && intersection.y1 < intersection.y2) {\n return intersection;\n }\n return createBound(0, 0, 0, 0, intersection);\n}\nexport function boundsOverlap(a, b) {\n return a.x1 < b.x2 && a.x2 > b.x1 && a.y1 < b.y2 && a.y2 > b.y1;\n}\nexport function convertBoundToRect(bound, out) {\n if (out) {\n out.x = bound.x1;\n out.y = bound.y1;\n out.width = bound.x2 - bound.x1;\n out.height = bound.y2 - bound.y1;\n return out;\n }\n return {\n x: bound.x1,\n y: bound.y1,\n width: bound.x2 - bound.x1,\n height: bound.y2 - bound.y1,\n };\n}\nexport function intersectRect(a, b, out) {\n const x = Math.max(a.x, b.x);\n const y = Math.max(a.y, b.y);\n const width = Math.min(a.x + a.width, b.x + b.width) - x;\n const height = Math.min(a.y + a.height, b.y + b.height) - y;\n if (width > 0 && height > 0) {\n if (out) {\n out.x = x;\n out.y = y;\n out.width = width;\n out.height = height;\n return out;\n }\n return {\n x,\n y,\n width,\n height,\n };\n }\n if (out) {\n out.x = 0;\n out.y = 0;\n out.width = 0;\n out.height = 0;\n return out;\n }\n return {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n };\n}\nexport function copyRect(a, out) {\n if (out) {\n out.x = a.x;\n out.y = a.y;\n out.width = a.width;\n out.height = a.height;\n return out;\n }\n return {\n x: a.x,\n y: a.y,\n width: a.width,\n height: a.height,\n };\n}\nexport function compareRect(a, b) {\n if (a === b) {\n return true;\n }\n if (a === null || b === null) {\n return false;\n }\n return (a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height);\n}\nexport function boundInsideBound(bound1, bound2) {\n return (bound1.x1 <= bound2.x2 &&\n bound1.y1 <= bound2.y2 &&\n bound1.x2 >= bound2.x1 &&\n bound1.y2 >= bound2.y1);\n}\nexport function isBoundPositive(bound) {\n return bound.x1 < bound.x2 && bound.y1 < bound.y2;\n}\nexport function isRectPositive(rect) {\n return rect.width > 0 && rect.height > 0;\n}\n//# sourceMappingURL=utils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EventEmitter } from '../../../common/EventEmitter.js';\nexport class TrFontFace extends EventEmitter {\n fontFamily;\n descriptors;\n loaded = false;\n constructor(fontFamily, descriptors) {\n super();\n this.fontFamily = fontFamily;\n this.descriptors = {\n style: 'normal',\n weight: 'normal',\n stretch: 'normal',\n ...descriptors,\n };\n }\n /**\n * Convert a TrFontFaceDescriptors to a FontFaceDescriptors which differ slightly\n *\n * @param descriptors\n * @returns\n */\n static convertToCssFontFaceDescriptors(descriptors) {\n return {\n style: descriptors.style,\n weight: typeof descriptors.weight === 'number'\n ? `${descriptors.weight}`\n : descriptors.weight,\n stretch: descriptors.stretch,\n unicodeRange: descriptors.unicodeRange,\n variant: descriptors.variant,\n featureSettings: descriptors.featureSettings,\n display: descriptors.display,\n };\n }\n}\n//# sourceMappingURL=TrFontFace.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { TrFontFace } from './TrFontFace.js';\nexport class WebTrFontFace extends TrFontFace {\n fontFace;\n fontUrl;\n constructor(fontFamily, descriptors, fontUrl) {\n super(fontFamily, descriptors);\n // Filter out parentheses from fontUrl\n const fontUrlWithoutParentheses = fontUrl.replace(/\\(|\\)/g, '');\n // Defaults for descriptors resolved in the super constructor\n const determinedDescriptors = this.descriptors;\n // Convert TrFontFaceDescriptors to CSS FontFaceDescriptors\n const cssDescriptors = {\n style: determinedDescriptors.style,\n weight: typeof determinedDescriptors.weight === 'number'\n ? `${determinedDescriptors.weight}`\n : determinedDescriptors.weight,\n stretch: determinedDescriptors.stretch,\n unicodeRange: determinedDescriptors.unicodeRange,\n variant: determinedDescriptors.variant,\n featureSettings: determinedDescriptors.featureSettings,\n display: determinedDescriptors.display,\n };\n const fontFace = new FontFace(fontFamily, `url(${fontUrlWithoutParentheses})`, cssDescriptors);\n fontFace\n .load()\n .then(() => {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.loaded = true;\n this.emit('loaded');\n })\n .catch(console.error);\n this.fontFace = fontFace;\n this.fontUrl = fontUrl;\n }\n}\n//# sourceMappingURL=WebTrFontFace.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class CoreContextTexture {\n memManager;\n textureSource;\n constructor(memManager, textureSource) {\n this.memManager = memManager;\n this.textureSource = textureSource;\n }\n}\n//# sourceMappingURL=CoreContextTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreContextTexture } from './CoreContextTexture.js';\nexport class CoreRenderer {\n stage;\n constructor(stage) {\n this.stage = stage;\n }\n}\n//# sourceMappingURL=CoreRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class CoreRenderOp {\n}\n//# sourceMappingURL=CoreRenderOp.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreRenderOp } from '../CoreRenderOp.js';\nimport { WebGlCoreShader } from './WebGlCoreShader.js';\nconst MAX_TEXTURES = 8; // TODO: get from gl\n/**\n * Can render multiple quads with multiple textures (up to vertex shader texture limit)\n *\n */\nexport class WebGlCoreRenderOp extends CoreRenderOp {\n glw;\n options;\n buffers;\n shader;\n shaderProps;\n alpha;\n clippingRect;\n dimensions;\n bufferIdx;\n zIndex;\n length = 0;\n numQuads = 0;\n textures = [];\n maxTextures;\n constructor(glw, options, buffers, shader, shaderProps, alpha, clippingRect, dimensions, bufferIdx, zIndex) {\n super();\n this.glw = glw;\n this.options = options;\n this.buffers = buffers;\n this.shader = shader;\n this.shaderProps = shaderProps;\n this.alpha = alpha;\n this.clippingRect = clippingRect;\n this.dimensions = dimensions;\n this.bufferIdx = bufferIdx;\n this.zIndex = zIndex;\n this.maxTextures = shader.supportsIndexedTextures\n ? glw.getParameter(glw.MAX_VERTEX_TEXTURE_IMAGE_UNITS)\n : 1;\n }\n addTexture(texture) {\n const { textures, maxTextures } = this;\n const existingIdx = textures.findIndex((t) => t === texture);\n if (existingIdx !== -1) {\n return existingIdx;\n }\n const newIdx = textures.length;\n if (newIdx >= maxTextures) {\n return 0xffffffff;\n }\n this.textures.push(texture);\n return newIdx;\n }\n draw() {\n const { glw, shader, shaderProps, options } = this;\n // shaderOp.draw(this);\n const { shManager } = options;\n shManager.useShader(shader);\n shader.bindRenderOp(this, shaderProps);\n // TODO: Reduce calculations required\n const quadIdx = (this.bufferIdx / 24) * 6 * 2;\n // Clipping\n if (this.clippingRect.valid) {\n const { x, y, width, height } = this.clippingRect;\n const pixelRatio = options.pixelRatio;\n const canvasHeight = options.canvas.height;\n const clipX = Math.round(x * pixelRatio);\n const clipWidth = Math.round(width * pixelRatio);\n const clipHeight = Math.round(height * pixelRatio);\n const clipY = Math.round(canvasHeight - clipHeight - y * pixelRatio);\n glw.setScissorTest(true);\n glw.scissor(clipX, clipY, clipWidth, clipHeight);\n }\n else {\n glw.setScissorTest(false);\n }\n glw.drawElements(glw.TRIANGLES, 6 * this.numQuads, glw.UNSIGNED_SHORT, quadIdx);\n }\n}\n//# sourceMappingURL=WebGlCoreRenderOp.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Get device specific webgl parameters\n * @param glw\n */\nexport function getWebGlParameters(glw) {\n const params = {\n MAX_RENDERBUFFER_SIZE: 0,\n MAX_TEXTURE_SIZE: 0,\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any\n MAX_VIEWPORT_DIMS: 0,\n MAX_VERTEX_TEXTURE_IMAGE_UNITS: 0,\n MAX_TEXTURE_IMAGE_UNITS: 0,\n MAX_COMBINED_TEXTURE_IMAGE_UNITS: 0,\n MAX_VERTEX_ATTRIBS: 0,\n MAX_VARYING_VECTORS: 0,\n MAX_VERTEX_UNIFORM_VECTORS: 0,\n MAX_FRAGMENT_UNIFORM_VECTORS: 0,\n };\n // Map over all parameters and get them\n const keys = Object.keys(params);\n keys.forEach((key) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n params[key] = glw.getParameter(glw[key]);\n });\n return params;\n}\n/**\n * Get device webgl extensions\n * @param glw\n */\nexport function getWebGlExtensions(glw) {\n const extensions = {\n ANGLE_instanced_arrays: null,\n WEBGL_compressed_texture_s3tc: null,\n WEBGL_compressed_texture_astc: null,\n WEBGL_compressed_texture_etc: null,\n WEBGL_compressed_texture_etc1: null,\n WEBGL_compressed_texture_pvrtc: null,\n WEBKIT_WEBGL_compressed_texture_pvrtc: null,\n WEBGL_compressed_texture_s3tc_srgb: null,\n OES_vertex_array_object: null,\n };\n // Map over all extensions and get them\n const keys = Object.keys(extensions);\n keys.forEach((key) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n extensions[key] = glw.getExtension(key);\n });\n return extensions;\n}\n/**\n * Allocate big memory chunk that we\n * can re-use to draw quads\n *\n * @param glw\n * @param size\n */\nexport function createIndexBuffer(glw, size) {\n const maxQuads = ~~(size / 80);\n const indices = new Uint16Array(maxQuads * 6);\n for (let i = 0, j = 0; i < maxQuads; i += 6, j += 4) {\n indices[i] = j;\n indices[i + 1] = j + 1;\n indices[i + 2] = j + 2;\n indices[i + 3] = j + 2;\n indices[i + 4] = j + 1;\n indices[i + 5] = j + 3;\n }\n const buffer = glw.createBuffer();\n glw.elementArrayBufferData(buffer, indices, glw.STATIC_DRAW);\n}\n/**\n * Checks if an object is of type HTMLImageElement.\n * This is used because we cant check for HTMLImageElement directly when the\n * renderer is running in a seperate web worker context.\n *\n * @param obj\n * @returns\n */\nexport function isHTMLImageElement(obj) {\n return (obj !== null &&\n typeof obj === 'object' &&\n obj.constructor &&\n obj.constructor.name === 'HTMLImageElement');\n}\n//# sourceMappingURL=RendererUtils.js.map","/**\n * Memize options object.\n *\n * @typedef MemizeOptions\n *\n * @property {number} [maxSize] Maximum size of the cache.\n */\n\n/**\n * Internal cache entry.\n *\n * @typedef MemizeCacheNode\n *\n * @property {?MemizeCacheNode|undefined} [prev] Previous node.\n * @property {?MemizeCacheNode|undefined} [next] Next node.\n * @property {Array<*>} args Function arguments for cache\n * entry.\n * @property {*} val Function result.\n */\n\n/**\n * Properties of the enhanced function for controlling cache.\n *\n * @typedef MemizeMemoizedFunction\n *\n * @property {()=>void} clear Clear the cache.\n */\n\n/**\n * Accepts a function to be memoized, and returns a new memoized function, with\n * optional options.\n *\n * @template {(...args: any[]) => any} F\n *\n * @param {F} fn Function to memoize.\n * @param {MemizeOptions} [options] Options object.\n *\n * @return {((...args: Parameters) => ReturnType) & MemizeMemoizedFunction} Memoized function.\n */\nfunction memize(fn, options) {\n\tvar size = 0;\n\n\t/** @type {?MemizeCacheNode|undefined} */\n\tvar head;\n\n\t/** @type {?MemizeCacheNode|undefined} */\n\tvar tail;\n\n\toptions = options || {};\n\n\tfunction memoized(/* ...args */) {\n\t\tvar node = head,\n\t\t\tlen = arguments.length,\n\t\t\targs,\n\t\t\ti;\n\n\t\tsearchCache: while (node) {\n\t\t\t// Perform a shallow equality test to confirm that whether the node\n\t\t\t// under test is a candidate for the arguments passed. Two arrays\n\t\t\t// are shallowly equal if their length matches and each entry is\n\t\t\t// strictly equal between the two sets. Avoid abstracting to a\n\t\t\t// function which could incur an arguments leaking deoptimization.\n\n\t\t\t// Check whether node arguments match arguments length\n\t\t\tif (node.args.length !== arguments.length) {\n\t\t\t\tnode = node.next;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Check whether node arguments match arguments values\n\t\t\tfor (i = 0; i < len; i++) {\n\t\t\t\tif (node.args[i] !== arguments[i]) {\n\t\t\t\t\tnode = node.next;\n\t\t\t\t\tcontinue searchCache;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// At this point we can assume we've found a match\n\n\t\t\t// Surface matched node to head if not already\n\t\t\tif (node !== head) {\n\t\t\t\t// As tail, shift to previous. Must only shift if not also\n\t\t\t\t// head, since if both head and tail, there is no previous.\n\t\t\t\tif (node === tail) {\n\t\t\t\t\ttail = node.prev;\n\t\t\t\t}\n\n\t\t\t\t// Adjust siblings to point to each other. If node was tail,\n\t\t\t\t// this also handles new tail's empty `next` assignment.\n\t\t\t\t/** @type {MemizeCacheNode} */ (node.prev).next = node.next;\n\t\t\t\tif (node.next) {\n\t\t\t\t\tnode.next.prev = node.prev;\n\t\t\t\t}\n\n\t\t\t\tnode.next = head;\n\t\t\t\tnode.prev = null;\n\t\t\t\t/** @type {MemizeCacheNode} */ (head).prev = node;\n\t\t\t\thead = node;\n\t\t\t}\n\n\t\t\t// Return immediately\n\t\t\treturn node.val;\n\t\t}\n\n\t\t// No cached value found. Continue to insertion phase:\n\n\t\t// Create a copy of arguments (avoid leaking deoptimization)\n\t\targs = new Array(len);\n\t\tfor (i = 0; i < len; i++) {\n\t\t\targs[i] = arguments[i];\n\t\t}\n\n\t\tnode = {\n\t\t\targs: args,\n\n\t\t\t// Generate the result from original function\n\t\t\tval: fn.apply(null, args),\n\t\t};\n\n\t\t// Don't need to check whether node is already head, since it would\n\t\t// have been returned above already if it was\n\n\t\t// Shift existing head down list\n\t\tif (head) {\n\t\t\thead.prev = node;\n\t\t\tnode.next = head;\n\t\t} else {\n\t\t\t// If no head, follows that there's no tail (at initial or reset)\n\t\t\ttail = node;\n\t\t}\n\n\t\t// Trim tail if we're reached max size and are pending cache insertion\n\t\tif (size === /** @type {MemizeOptions} */ (options).maxSize) {\n\t\t\ttail = /** @type {MemizeCacheNode} */ (tail).prev;\n\t\t\t/** @type {MemizeCacheNode} */ (tail).next = null;\n\t\t} else {\n\t\t\tsize++;\n\t\t}\n\n\t\thead = node;\n\n\t\treturn node.val;\n\t}\n\n\tmemoized.clear = function () {\n\t\thead = null;\n\t\ttail = null;\n\t\tsize = 0;\n\t};\n\n\t// Ignore reason: There's not a clear solution to create an intersection of\n\t// the function with additional properties, where the goal is to retain the\n\t// function signature of the incoming argument and add control properties\n\t// on the return value.\n\n\t// @ts-ignore\n\treturn memoized;\n}\n\nexport { memize as default };\n","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Core Utility Functions\n *\n * @module\n */\nimport memo from 'memize';\nexport const EPSILON = 0.000001;\nexport let ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array;\nexport const RANDOM = Math.random;\nexport const ANGLE_ORDER = 'zyx';\nconst degree = Math.PI / 180;\nexport const setMatrixArrayType = (type) => {\n ARRAY_TYPE = type;\n};\nexport const toRadian = (a) => {\n return a * degree;\n};\nexport const equals = (a, b) => {\n return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b));\n};\nexport const rand = (min, max) => {\n return Math.floor(Math.random() * (max - min + 1) + min);\n};\nexport const isPowerOfTwo = (value) => {\n return value && !(value & (value - 1));\n};\nconst getTimingBezier = (a, b, c, d) => {\n const xc = 3.0 * a;\n const xb = 3.0 * (c - a) - xc;\n const xa = 1.0 - xc - xb;\n const yc = 3.0 * b;\n const yb = 3.0 * (d - b) - yc;\n const ya = 1.0 - yc - yb;\n return function (time) {\n if (time >= 1.0) {\n return 1;\n }\n if (time <= 0) {\n return 0;\n }\n let t = 0.5, cbx, cbxd, dx;\n for (let it = 0; it < 20; it++) {\n cbx = t * (t * (t * xa + xb) + xc);\n dx = time - cbx;\n if (dx > -1e-8 && dx < 1e-8) {\n return t * (t * (t * ya + yb) + yc);\n }\n // Cubic bezier derivative.\n cbxd = t * (t * (3 * xa) + 2 * xb) + xc;\n if (cbxd > 1e-10 && cbxd < 1e-10) {\n // Problematic. Fall back to binary search method.\n break;\n }\n t += dx / cbxd;\n }\n // Fallback: binary search method. This is more reliable when there are near-0 slopes.\n let minT = 0;\n let maxT = 1;\n for (let it = 0; it < 20; it++) {\n t = 0.5 * (minT + maxT);\n cbx = t * (t * (t * xa + xb) + xc);\n dx = time - cbx;\n if (dx > -1e-8 && dx < 1e-8) {\n // Solution found!\n return t * (t * (t * ya + yb) + yc);\n }\n if (dx < 0) {\n maxT = t;\n }\n else {\n minT = t;\n }\n }\n };\n};\nexport const getTimingFunction = memo((str) => {\n switch (str) {\n case 'linear':\n return function (time) {\n return time;\n };\n case 'ease':\n return getTimingBezier(0.25, 0.1, 0.25, 1.0);\n case 'ease-in':\n return getTimingBezier(0.42, 0, 1.0, 1.0);\n case 'ease-out':\n return getTimingBezier(0, 0, 0.58, 1.0);\n case 'ease-in-out':\n return getTimingBezier(0.42, 0, 0.58, 1.0);\n case 'ease-in-sine':\n return getTimingBezier(0.12, 0, 0.39, 0);\n case 'ease-out-sine':\n return getTimingBezier(0.12, 0, 0.39, 0);\n case 'ease-in-out-sine':\n return getTimingBezier(0.37, 0, 0.63, 1);\n case 'ease-in-cubic':\n return getTimingBezier(0.32, 0, 0.67, 0);\n case 'ease-out-cubic':\n return getTimingBezier(0.33, 1, 0.68, 1);\n case 'ease-in-out-cubic':\n return getTimingBezier(0.65, 0, 0.35, 1);\n case 'ease-in-circ':\n return getTimingBezier(0.55, 0, 1, 0.45);\n case 'ease-out-circ':\n return getTimingBezier(0, 0.55, 0.45, 1);\n case 'ease-in-out-circ':\n return getTimingBezier(0.85, 0, 0.15, 1);\n case 'ease-in-back':\n return getTimingBezier(0.36, 0, 0.66, -0.56);\n case 'ease-out-back':\n return getTimingBezier(0.34, 1.56, 0.64, 1);\n case 'ease-in-out-back':\n return getTimingBezier(0.68, -0.6, 0.32, 1.6);\n case 'step-start':\n return function () {\n return 1;\n };\n case 'step-end':\n return function (time) {\n return time === 1 ? 1 : 0;\n };\n default:\n // eslint-disable-next-line no-case-declarations\n const s = 'cubic-bezier(';\n if (str && str.indexOf(s) === 0) {\n const parts = str\n .substr(s.length, str.length - s.length - 1)\n .split(',');\n if (parts.length !== 4) {\n console.warn('Unknown timing function: ' + str);\n // Fallback: use linear.\n return function (time) {\n return time;\n };\n }\n const a = parseFloat(parts[0] || '0.42');\n const b = parseFloat(parts[1] || '0');\n const c = parseFloat(parts[2] || '1');\n const d = parseFloat(parts[3] || '1');\n if (isNaN(a) || isNaN(b) || isNaN(c) || isNaN(d)) {\n console.warn(' Unknown timing function: ' + str);\n // Fallback: use linear.\n return function (time) {\n return time;\n };\n }\n return getTimingBezier(a, b, c, d);\n }\n else {\n console.warn('Unknown timing function: ' + str);\n // Fallback: use linear.\n return function (time) {\n return time;\n };\n }\n }\n});\nif (!Math.hypot)\n Math.hypot = (...args) => {\n let y = 0, i = args.length;\n while (i--) {\n y += args[i] * args[i];\n }\n return Math.sqrt(y);\n };\n//# sourceMappingURL=utils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../../utils.js';\nimport { isPowerOfTwo } from '../../utils.js';\nimport { CoreContextTexture } from '../CoreContextTexture.js';\nimport { isHTMLImageElement } from './internal/RendererUtils.js';\nconst TRANSPARENT_TEXTURE_DATA = new Uint8Array([0, 0, 0, 0]);\n/**\n * A wrapper around a WebGLTexture that handles loading the texture data\n * from a Texture source and uploading it to the GPU as well as freeing\n * the uploaded texture.\n *\n * @remarks\n * When accessing the ctxTexture property, the texture will be loaded if\n * it hasn't been already. ctxTexture will always return a valid WebGLTexture\n * and trigger the loading/uploading of the texture's data if it hasn't been\n * loaded yet.\n */\nexport class WebGlCoreCtxTexture extends CoreContextTexture {\n glw;\n _nativeCtxTexture = null;\n _state = 'freed';\n _w = 0;\n _h = 0;\n constructor(glw, memManager, textureSource) {\n super(memManager, textureSource);\n this.glw = glw;\n }\n get ctxTexture() {\n if (this._state === 'freed') {\n this.load();\n }\n assertTruthy(this._nativeCtxTexture);\n return this._nativeCtxTexture;\n }\n get renderable() {\n return this.textureSource.renderable;\n }\n get w() {\n return this._w;\n }\n get h() {\n return this._h;\n }\n /**\n * Load the texture data from the Texture source and upload it to the GPU\n *\n * @remarks\n * This method is called automatically when accessing the ctxTexture property\n * if the texture hasn't been loaded yet. But it can also be called manually\n * to force the texture to be pre-loaded prior to accessing the ctxTexture\n * property.\n */\n load() {\n // If the texture is already loading or loaded, don't load it again.\n if (this._state === 'loading' || this._state === 'loaded') {\n return;\n }\n this._state = 'loading';\n this.textureSource.setState('loading');\n this._nativeCtxTexture = this.createNativeCtxTexture();\n this.onLoadRequest()\n .then(({ width, height }) => {\n if (this._state === 'freed') {\n return;\n }\n this._state = 'loaded';\n this._w = width;\n this._h = height;\n // Update the texture source's width and height so that it can be used\n // for rendering.\n this.textureSource.setState('loaded', { width, height });\n })\n .catch((err) => {\n this._state = 'failed';\n this.textureSource.setState('failed', err);\n console.error(err);\n });\n }\n /**\n * Called when the texture data needs to be loaded and uploaded to a texture\n */\n async onLoadRequest() {\n const { glw, memManager } = this;\n // On initial load request, create a 1x1 transparent texture to use until\n // the texture data is finally loaded.\n glw.activeTexture(0);\n glw.bindTexture(this._nativeCtxTexture);\n // linear texture filtering\n glw.texParameteri(glw.TEXTURE_MAG_FILTER, glw.LINEAR);\n glw.texParameteri(glw.TEXTURE_MIN_FILTER, glw.LINEAR);\n // texture wrapping method\n glw.texParameteri(glw.TEXTURE_WRAP_S, glw.CLAMP_TO_EDGE);\n glw.texParameteri(glw.TEXTURE_WRAP_T, glw.CLAMP_TO_EDGE);\n glw.texImage2D(0, glw.RGBA, 1, 1, 0, glw.RGBA, glw.UNSIGNED_BYTE, TRANSPARENT_TEXTURE_DATA);\n memManager.setTextureMemUse(this, TRANSPARENT_TEXTURE_DATA.byteLength);\n const textureData = await this.textureSource?.getTextureData();\n // If the texture has been freed while loading, return early.\n if (!this._nativeCtxTexture) {\n assertTruthy(this._state === 'freed');\n return { width: 0, height: 0 };\n }\n let width = 0;\n let height = 0;\n assertTruthy(this._nativeCtxTexture);\n glw.activeTexture(0);\n // If textureData is null, the texture is empty (0, 0) and we don't need to\n // upload any data to the GPU.\n if (textureData.data instanceof ImageBitmap ||\n textureData.data instanceof ImageData ||\n // not using typeof HTMLImageElement due to web worker\n isHTMLImageElement(textureData.data)) {\n const data = textureData.data;\n width = data.width;\n height = data.height;\n glw.bindTexture(this._nativeCtxTexture);\n glw.pixelStorei(glw.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !!textureData.premultiplyAlpha);\n glw.texImage2D(0, glw.RGBA, glw.RGBA, glw.UNSIGNED_BYTE, data);\n memManager.setTextureMemUse(this, width * height * 4);\n // generate mipmaps for power-of-2 textures or in WebGL2RenderingContext\n if (glw.isWebGl2() || (isPowerOfTwo(width) && isPowerOfTwo(height))) {\n glw.generateMipmap();\n }\n }\n else if (textureData.data === null) {\n width = 0;\n height = 0;\n // Reset to a 1x1 transparent texture\n glw.bindTexture(this._nativeCtxTexture);\n glw.texImage2D(0, glw.RGBA, 1, 1, 0, glw.RGBA, glw.UNSIGNED_BYTE, TRANSPARENT_TEXTURE_DATA);\n memManager.setTextureMemUse(this, TRANSPARENT_TEXTURE_DATA.byteLength);\n }\n else if ('mipmaps' in textureData.data && textureData.data.mipmaps) {\n const { mipmaps, width = 0, height = 0, type, glInternalFormat, } = textureData.data;\n const view = type === 'ktx'\n ? new DataView(mipmaps[0] ?? new ArrayBuffer(0))\n : mipmaps[0];\n glw.bindTexture(this._nativeCtxTexture);\n glw.compressedTexImage2D(0, glInternalFormat, width, height, 0, view);\n glw.texParameteri(glw.TEXTURE_WRAP_S, glw.CLAMP_TO_EDGE);\n glw.texParameteri(glw.TEXTURE_WRAP_T, glw.CLAMP_TO_EDGE);\n glw.texParameteri(glw.TEXTURE_MAG_FILTER, glw.LINEAR);\n glw.texParameteri(glw.TEXTURE_MIN_FILTER, glw.LINEAR);\n memManager.setTextureMemUse(this, view.byteLength);\n }\n else {\n console.error(`WebGlCoreCtxTexture.onLoadRequest: Unexpected textureData returned`, textureData);\n }\n return {\n width,\n height,\n };\n }\n /**\n * Free the WebGLTexture from the GPU\n *\n * @returns\n */\n free() {\n if (this._state === 'freed') {\n return;\n }\n this._state = 'freed';\n this.textureSource.setState('freed');\n this._w = 0;\n this._h = 0;\n if (!this._nativeCtxTexture) {\n return;\n }\n const { glw, memManager } = this;\n glw.deleteTexture(this._nativeCtxTexture);\n memManager.setTextureMemUse(this, 0);\n this._nativeCtxTexture = null;\n }\n createNativeCtxTexture() {\n const { glw } = this;\n const nativeTexture = glw.createTexture();\n if (!nativeTexture) {\n throw new Error('Could not create WebGL Texture');\n }\n return nativeTexture;\n }\n}\n//# sourceMappingURL=WebGlCoreCtxTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\n/**\n * Texture consisting of only a 1x1 color pixel\n *\n * @remarks\n * The pixel color is set with the {@link ColorTextureProps.color} prop.\n *\n * This is the default texture used for a Node if it's\n * {@link INodeWritableProps.texture} prop is set to `null` (the default)\n *\n * Generally the 1x1 color pixel is stretched to whatever the set dimensions of\n * a Node are.\n */\nexport class ColorTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = ColorTexture.resolveDefaults(props || {});\n }\n get color() {\n return this.props.color;\n }\n set color(color) {\n this.props.color = color;\n }\n async getTextureData() {\n const pixelData32 = new Uint32Array([this.color]);\n const pixelData8 = new Uint8ClampedArray(pixelData32.buffer);\n return {\n data: new ImageData(pixelData8, 1, 1),\n premultiplyAlpha: true,\n };\n }\n static makeCacheKey(props) {\n const resolvedProps = ColorTexture.resolveDefaults(props);\n return `ColorTexture,${resolvedProps.color}`;\n }\n static resolveDefaults(props) {\n return {\n color: props.color || 0xffffffff,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=ColorTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture, } from './Texture.js';\n/**\n * A Texture that is a sub-region of another Texture.\n *\n * @remarks\n * The parent texture can be a Sprite Sheet/Texture Atlas and set using the\n * {@link SubTextureProps.texture} prop. The sub-region relative to the parent\n * texture is defined with the {@link SubTextureProps.x},\n * {@link SubTextureProps.y}, {@link SubTextureProps.width}, and\n * {@link SubTextureProps.height} pixel values.\n */\nexport class SubTexture extends Texture {\n props;\n parentTexture;\n constructor(txManager, props) {\n super(txManager);\n this.parentTexture = this.txManager.loadTexture(props.texture.txType, props.texture.props, props.texture.options);\n this.props = SubTexture.resolveDefaults(props || {});\n // If parent texture is already loaded / failed, trigger loaded event manually\n // so that users get a consistent event experience.\n // We do this in a microtask to allow listeners to be attached in the same\n // synchronous task after calling loadTexture()\n queueMicrotask(() => {\n const parentTx = this.parentTexture;\n if (parentTx.state === 'loaded') {\n this.onParentTxLoaded(parentTx, parentTx.dimensions);\n }\n else if (parentTx.state === 'failed') {\n this.onParentTxFailed(parentTx, parentTx.error);\n }\n parentTx.on('loaded', this.onParentTxLoaded);\n parentTx.on('failed', this.onParentTxFailed);\n });\n }\n onParentTxLoaded = () => {\n // We ignore the parent's passed dimensions, and simply use the SubTexture's\n // configured dimensions (because that's all that matters here)\n this.setState('loaded', {\n width: this.props.width,\n height: this.props.height,\n });\n };\n onParentTxFailed = (target, error) => {\n this.setState('failed', error);\n };\n async getTextureData() {\n return {\n data: this.props,\n };\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static makeCacheKey(props) {\n return false;\n }\n static resolveDefaults(props) {\n return {\n texture: props.texture,\n x: props.x || 0,\n y: props.y || 0,\n width: props.width || 0,\n height: props.height || 0,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=SubTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreCtxTexture } from './WebGlCoreCtxTexture.js';\nexport class WebGlCoreCtxSubTexture extends WebGlCoreCtxTexture {\n constructor(glw, memManager, textureSource) {\n super(glw, memManager, textureSource);\n }\n async onLoadRequest() {\n const props = await this.textureSource.getTextureData();\n return {\n width: props.data?.width || 0,\n height: props.data?.height || 0,\n };\n }\n}\n//# sourceMappingURL=WebGlCoreCtxSubTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Represents a collection of WebGL Buffers along with their associated\n * vertex attribute formats.\n */\nexport class BufferCollection {\n config;\n constructor(config) {\n this.config = config;\n }\n /**\n * Get the WebGLBuffer associated with the given attribute name if it exists.\n *\n * @param attributeName\n * @returns\n */\n getBuffer(attributeName) {\n return this.config.find((item) => item.attributes[attributeName])?.buffer;\n }\n /**\n * Get the AttributeInfo associated with the given attribute name if it exists.\n *\n * @param attributeName\n * @returns\n */\n getAttributeInfo(attributeName) {\n return this.config.find((item) => item.attributes[attributeName])\n ?.attributes[attributeName];\n }\n}\n//# sourceMappingURL=BufferCollection.js.map","/* eslint-disable @typescript-eslint/no-unsafe-return */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-unsafe-argument */\nimport { assertTruthy } from '../../utils.js';\nimport { isWebGl2 } from '../renderers/webgl/internal/WebGlUtils.js';\n/**\n * Optimized WebGL Context Wrapper\n *\n * @remarks\n * This class contains the subset of the WebGLRenderingContext & WebGL2RenderingContext\n * API that is used by the renderer. Select high volume WebGL methods include\n * caching optimizations to avoid making WebGL calls if the state is already set\n * to the desired value.\n *\n * While most methods contained are direct passthroughs to the WebGL context,\n * some methods combine multiple WebGL calls into one for convenience, modify\n * arguments to be more convenient, or are replaced by more specific methods.\n *\n * Not all methods are optimized. Only methods that are called frequently\n * and/or have a high cost are optimized.\n *\n * A subset of GLenum constants are also exposed as properties on this class\n * for convenience.\n */\nexport class WebGlContextWrapper {\n gl;\n //#region Cached WebGL State\n activeTextureUnit = 0;\n texture2dUnits;\n texture2dParams = new WeakMap();\n scissorEnabled;\n scissorX;\n scissorY;\n scissorWidth;\n scissorHeight;\n blendEnabled;\n blendSrcRgb;\n blendDstRgb;\n blendSrcAlpha;\n blendDstAlpha;\n boundArrayBuffer;\n boundElementArrayBuffer;\n curProgram;\n programUniforms = new WeakMap();\n //#endregion Cached WebGL State\n //#region Canvas\n canvas;\n //#endregion Canvas\n //#region WebGL Enums\n MAX_RENDERBUFFER_SIZE;\n MAX_TEXTURE_SIZE;\n MAX_VIEWPORT_DIMS;\n MAX_VERTEX_TEXTURE_IMAGE_UNITS;\n MAX_TEXTURE_IMAGE_UNITS;\n MAX_COMBINED_TEXTURE_IMAGE_UNITS;\n MAX_VERTEX_ATTRIBS;\n MAX_VARYING_VECTORS;\n MAX_VERTEX_UNIFORM_VECTORS;\n MAX_FRAGMENT_UNIFORM_VECTORS;\n TEXTURE_MAG_FILTER;\n TEXTURE_MIN_FILTER;\n TEXTURE_WRAP_S;\n TEXTURE_WRAP_T;\n LINEAR;\n CLAMP_TO_EDGE;\n RGBA;\n UNSIGNED_BYTE;\n UNPACK_PREMULTIPLY_ALPHA_WEBGL;\n FLOAT;\n TRIANGLES;\n UNSIGNED_SHORT;\n ONE;\n ONE_MINUS_SRC_ALPHA;\n VERTEX_SHADER;\n FRAGMENT_SHADER;\n STATIC_DRAW;\n COMPILE_STATUS;\n LINK_STATUS;\n DYNAMIC_DRAW;\n //#endregion WebGL Enums\n constructor(gl) {\n this.gl = gl;\n // The following code extracts the current state of the WebGL context\n // to our local JavaScript cached version of it. This is so we can\n // avoid making WebGL calls if we don't need to.\n // We could assume that the WebGL context is in a default state, but\n // in the future we may want to support restoring a broken WebGL context\n // and this will help with that.\n this.activeTextureUnit =\n gl.getParameter(gl.ACTIVE_TEXTURE) - gl.TEXTURE0;\n const maxTextureUnits = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);\n // save current texture units\n this.texture2dUnits = new Array(maxTextureUnits)\n .fill(undefined)\n .map((_, i) => {\n this.activeTexture(i);\n return gl.getParameter(gl.TEXTURE_BINDING_2D);\n });\n // restore active texture unit\n this.activeTexture(this.activeTextureUnit);\n this.scissorEnabled = gl.isEnabled(gl.SCISSOR_TEST);\n const scissorBox = gl.getParameter(gl.SCISSOR_BOX);\n this.scissorX = scissorBox[0];\n this.scissorY = scissorBox[1];\n this.scissorWidth = scissorBox[2];\n this.scissorHeight = scissorBox[3];\n this.blendEnabled = gl.isEnabled(gl.BLEND);\n this.blendSrcRgb = gl.getParameter(gl.BLEND_SRC_RGB);\n this.blendDstRgb = gl.getParameter(gl.BLEND_DST_RGB);\n this.blendSrcAlpha = gl.getParameter(gl.BLEND_SRC_ALPHA);\n this.blendDstAlpha = gl.getParameter(gl.BLEND_DST_ALPHA);\n this.boundArrayBuffer = gl.getParameter(gl.ARRAY_BUFFER_BINDING);\n this.boundElementArrayBuffer = gl.getParameter(gl.ELEMENT_ARRAY_BUFFER_BINDING);\n this.curProgram = gl.getParameter(gl.CURRENT_PROGRAM);\n this.canvas = gl.canvas;\n // Extract GLenums\n this.MAX_RENDERBUFFER_SIZE = gl.MAX_RENDERBUFFER_SIZE;\n this.MAX_TEXTURE_SIZE = gl.MAX_TEXTURE_SIZE;\n this.MAX_VIEWPORT_DIMS = gl.MAX_VIEWPORT_DIMS;\n this.MAX_VERTEX_TEXTURE_IMAGE_UNITS = gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS;\n this.MAX_TEXTURE_IMAGE_UNITS = gl.MAX_TEXTURE_IMAGE_UNITS;\n this.MAX_COMBINED_TEXTURE_IMAGE_UNITS = gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS;\n this.MAX_VERTEX_ATTRIBS = gl.MAX_VERTEX_ATTRIBS;\n this.MAX_VARYING_VECTORS = gl.MAX_VARYING_VECTORS;\n this.MAX_VERTEX_UNIFORM_VECTORS = gl.MAX_VERTEX_UNIFORM_VECTORS;\n this.MAX_FRAGMENT_UNIFORM_VECTORS = gl.MAX_FRAGMENT_UNIFORM_VECTORS;\n this.TEXTURE_MAG_FILTER = gl.TEXTURE_MAG_FILTER;\n this.TEXTURE_MIN_FILTER = gl.TEXTURE_MIN_FILTER;\n this.TEXTURE_WRAP_S = gl.TEXTURE_WRAP_S;\n this.TEXTURE_WRAP_T = gl.TEXTURE_WRAP_T;\n this.LINEAR = gl.LINEAR;\n this.CLAMP_TO_EDGE = gl.CLAMP_TO_EDGE;\n this.RGBA = gl.RGBA;\n this.UNSIGNED_BYTE = gl.UNSIGNED_BYTE;\n this.UNPACK_PREMULTIPLY_ALPHA_WEBGL = gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL;\n this.FLOAT = gl.FLOAT;\n this.TRIANGLES = gl.TRIANGLES;\n this.UNSIGNED_SHORT = gl.UNSIGNED_SHORT;\n this.ONE = gl.ONE;\n this.ONE_MINUS_SRC_ALPHA = gl.ONE_MINUS_SRC_ALPHA;\n this.MAX_VERTEX_TEXTURE_IMAGE_UNITS = gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS;\n this.TRIANGLES = gl.TRIANGLES;\n this.UNSIGNED_SHORT = gl.UNSIGNED_SHORT;\n this.VERTEX_SHADER = gl.VERTEX_SHADER;\n this.FRAGMENT_SHADER = gl.FRAGMENT_SHADER;\n this.STATIC_DRAW = gl.STATIC_DRAW;\n this.COMPILE_STATUS = gl.COMPILE_STATUS;\n this.LINK_STATUS = gl.LINK_STATUS;\n this.DYNAMIC_DRAW = gl.DYNAMIC_DRAW;\n }\n /**\n * Returns true if the WebGL context is WebGL2\n *\n * @returns\n */\n isWebGl2() {\n return isWebGl2(this.gl);\n }\n /**\n * ```\n * gl.activeTexture(textureUnit + gl.TEXTURE0);\n * ```\n *\n * @remarks\n * **WebGL Difference**: `textureUnit` is based from 0, not `gl.TEXTURE0`.\n *\n * @param textureUnit\n */\n activeTexture(textureUnit) {\n const { gl } = this;\n if (this.activeTextureUnit !== textureUnit) {\n gl.activeTexture(textureUnit + gl.TEXTURE0);\n this.activeTextureUnit = textureUnit;\n }\n }\n /**\n * ```\n * gl.bindTexture(gl.TEXTURE_2D, texture);\n * ```\n * @remarks\n * **WebGL Difference**: Bind target is always `gl.TEXTURE_2D`\n *\n * @param texture\n */\n bindTexture(texture) {\n const { gl, activeTextureUnit, texture2dUnits } = this;\n if (texture2dUnits[activeTextureUnit] === texture) {\n return;\n }\n texture2dUnits[activeTextureUnit] = texture;\n gl.bindTexture(this.gl.TEXTURE_2D, texture);\n }\n _getActiveTexture() {\n const { activeTextureUnit, texture2dUnits } = this;\n return texture2dUnits[activeTextureUnit];\n }\n /**\n * ```\n * gl.texParameteri(gl.TEXTURE_2D, pname, param);\n * ```\n * @remarks\n * **WebGL Difference**: Bind target is always `gl.TEXTURE_2D`\n *\n * @param pname\n * @param param\n * @returns\n */\n texParameteri(pname, param) {\n const { gl, texture2dParams } = this;\n const activeTexture = this._getActiveTexture();\n if (!activeTexture) {\n throw new Error('No active texture');\n }\n let textureParams = texture2dParams.get(activeTexture);\n if (!textureParams) {\n textureParams = {};\n texture2dParams.set(activeTexture, textureParams);\n }\n if (textureParams[pname] === param) {\n return;\n }\n textureParams[pname] = param;\n gl.texParameteri(gl.TEXTURE_2D, pname, param);\n }\n texImage2D(level, internalFormat, widthOrFormat, heightOrType, borderOrSource, format, type, pixels) {\n const { gl } = this;\n if (format) {\n gl.texImage2D(gl.TEXTURE_2D, level, internalFormat, widthOrFormat, heightOrType, borderOrSource, format, type, pixels);\n }\n else {\n gl.texImage2D(gl.TEXTURE_2D, level, internalFormat, widthOrFormat, heightOrType, borderOrSource);\n }\n }\n /**\n * ```\n * gl.compressedTexImage2D(gl.TEXTURE_2D, level, internalFormat, width, height, border, data);\n * ```\n *\n * @remarks\n * **WebGL Difference**: Bind target is always `gl.TEXTURE_2D`\n */\n compressedTexImage2D(level, internalformat, width, height, border, data) {\n const { gl } = this;\n gl.compressedTexImage2D(gl.TEXTURE_2D, level, internalformat, width, height, border, data);\n }\n /**\n * ```\n * gl.pixelStorei(pname, param);\n * ```\n *\n * @param pname\n * @param param\n */\n pixelStorei(pname, param) {\n const { gl } = this;\n gl.pixelStorei(pname, param);\n }\n /**\n * ```\n * gl.generateMipmap(gl.TEXTURE_2D);\n * ```\n *\n * @remarks\n * **WebGL Difference**: Bind target is always `gl.TEXTURE_2D`\n */\n generateMipmap() {\n const { gl } = this;\n gl.generateMipmap(gl.TEXTURE_2D);\n }\n /**\n * ```\n * gl.createTexture();\n * ```\n *\n * @returns\n */\n createTexture() {\n const { gl } = this;\n return gl.createTexture();\n }\n /**\n * ```\n * gl.deleteTexture(texture);\n * ```\n *\n * @param texture\n */\n deleteTexture(texture) {\n const { gl } = this;\n if (texture) {\n this.texture2dParams.delete(texture);\n }\n gl.deleteTexture(texture);\n }\n /**\n * ```\n * gl.viewport(x, y, width, height);\n * ```\n */\n viewport(x, y, width, height) {\n const { gl } = this;\n gl.viewport(x, y, width, height);\n }\n /**\n * ```\n * gl.clearColor(red, green, blue, alpha);\n * ```\n *\n * @param red\n * @param green\n * @param blue\n * @param alpha\n */\n clearColor(red, green, blue, alpha) {\n const { gl } = this;\n gl.clearColor(red, green, blue, alpha);\n }\n /**\n * ```\n * gl[\"enable\"|\"disable\"](gl.SCISSOR_TEST);\n * ```\n * @param enable\n */\n setScissorTest(enable) {\n const { gl, scissorEnabled } = this;\n if (enable === scissorEnabled) {\n return;\n }\n if (enable) {\n gl.enable(gl.SCISSOR_TEST);\n }\n else {\n gl.disable(gl.SCISSOR_TEST);\n }\n this.scissorEnabled = enable;\n }\n /**\n * ```\n * gl.scissor(x, y, width, height);\n * ```\n *\n * @param x\n * @param y\n * @param width\n * @param height\n */\n scissor(x, y, width, height) {\n const { gl, scissorX, scissorY, scissorWidth, scissorHeight } = this;\n if (x !== scissorX ||\n y !== scissorY ||\n width !== scissorWidth ||\n height !== scissorHeight) {\n gl.scissor(x, y, width, height);\n this.scissorX = x;\n this.scissorY = y;\n this.scissorWidth = width;\n this.scissorHeight = height;\n }\n }\n /**\n * ```\n * gl[\"enable\"|\"disable\"](gl.BLEND);\n * ```\n *\n * @param blend\n * @returns\n */\n setBlend(blend) {\n const { gl, blendEnabled } = this;\n if (blend === blendEnabled) {\n return;\n }\n if (blend) {\n gl.enable(gl.BLEND);\n }\n else {\n gl.disable(gl.BLEND);\n }\n this.blendEnabled = blend;\n }\n /**\n * ```\n * gl.blendFunc(src, dst);\n * ```\n *\n * @param src\n * @param dst\n */\n blendFunc(src, dst) {\n const { gl, blendSrcRgb, blendDstRgb, blendSrcAlpha, blendDstAlpha } = this;\n if (src !== blendSrcRgb ||\n dst !== blendDstRgb ||\n src !== blendSrcAlpha ||\n dst !== blendDstAlpha) {\n gl.blendFunc(src, dst);\n this.blendSrcRgb = src;\n this.blendDstRgb = dst;\n this.blendSrcAlpha = src;\n this.blendDstAlpha = dst;\n }\n }\n /**\n * ```\n * createBuffer();\n * ```\n *\n * @returns\n */\n createBuffer() {\n const { gl } = this;\n return gl.createBuffer();\n }\n /**\n * ```\n * gl.clear(gl.COLOR_BUFFER_BIT);\n * ```\n *\n * @remarks\n * **WebGL Difference**: Clear mask is always `gl.COLOR_BUFFER_BIT`\n */\n clear() {\n const { gl } = this;\n gl.clear(gl.COLOR_BUFFER_BIT);\n }\n /**\n * ```\n * gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n * gl.bufferData(gl.ARRAY_BUFFER, data, usage);\n * ```\n *\n * @remarks\n * **WebGL Combo**: `gl.bindBuffer` and `gl.bufferData` are combined into one function.\n *\n * @param buffer\n * @param data\n * @param usage\n */\n arrayBufferData(buffer, data, usage) {\n const { gl, boundArrayBuffer } = this;\n if (boundArrayBuffer !== buffer) {\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n this.boundArrayBuffer = buffer;\n }\n gl.bufferData(gl.ARRAY_BUFFER, data, usage);\n }\n /**\n * ```\n * gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffer);\n * gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, data, usage);\n * ```\n * @remarks\n * **WebGL Combo**: `gl.bindBuffer` and `gl.bufferData` are combined into one function.\n *\n * @param buffer\n * @param data\n * @param usage\n */\n elementArrayBufferData(buffer, data, usage) {\n const { gl, boundElementArrayBuffer } = this;\n if (boundElementArrayBuffer !== buffer) {\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffer);\n this.boundElementArrayBuffer = buffer;\n }\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, data, usage);\n }\n /**\n * ```\n * gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n * gl.vertexAttribPointer(index, size, type, normalized, stride, offset);\n * ```\n *\n * @remarks\n * **WebGL Combo**: `gl.bindBuffer` and `gl.vertexAttribPointer` are combined into one function.\n *\n * @param buffer\n * @param index\n * @param size\n * @param type\n * @param normalized\n * @param stride\n * @param offset\n */\n vertexAttribPointer(buffer, index, size, type, normalized, stride, offset) {\n const { gl, boundArrayBuffer } = this;\n if (boundArrayBuffer !== buffer) {\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n this.boundArrayBuffer = buffer;\n }\n gl.vertexAttribPointer(index, size, type, normalized, stride, offset);\n }\n /**\n * ```\n * gl.useProgram(program);\n * ```\n *\n * @param program\n * @returns\n */\n useProgram(program) {\n const { gl, curProgram } = this;\n if (curProgram === program) {\n return;\n }\n gl.useProgram(program);\n this.curProgram = program;\n }\n setUniform(type, location, ...args) {\n const { gl, programUniforms } = this;\n let uniforms = programUniforms.get(this.curProgram);\n if (!uniforms) {\n uniforms = new Map();\n programUniforms.set(this.curProgram, uniforms);\n }\n const uniformArgs = uniforms.get(location);\n if (!uniformArgs || !compareArrays(uniformArgs, args)) {\n uniforms.set(location, args);\n gl[type](location, ...args);\n }\n }\n /**\n * ```\n * gl.getParameter(pname);\n * ```\n *\n * @param pname\n * @returns\n */\n getParameter(pname) {\n const { gl } = this;\n return gl.getParameter(pname);\n }\n /**\n * ```\n * gl.drawElements(mode, count, type, offset);\n * ```\n *\n * @param mode\n * @param count\n * @param type\n * @param offset\n */\n drawElements(mode, count, type, offset) {\n const { gl } = this;\n gl.drawElements(mode, count, type, offset);\n }\n /**\n * ```\n * gl.drawArrays(mode, first, count);\n * ```\n *\n * @param name\n * @returns\n */\n getExtension(name) {\n const { gl } = this;\n return gl.getExtension(name);\n }\n /**\n * ```\n * gl.createVertexArray();\n * ```\n *\n * @returns\n */\n createVertexArray() {\n const { gl } = this;\n assertTruthy(gl instanceof WebGL2RenderingContext);\n return gl.createVertexArray();\n }\n /**\n * ```\n * gl.bindVertexArray(vertexArray);\n * ```\n *\n * @param vertexArray\n */\n bindVertexArray(vertexArray) {\n const { gl } = this;\n assertTruthy(gl instanceof WebGL2RenderingContext);\n gl.bindVertexArray(vertexArray);\n }\n /**\n * ```\n * gl.getAttribLocation(program, name);\n * ```\n *\n * @param program\n * @param name\n * @returns\n */\n getAttribLocation(program, name) {\n const { gl } = this;\n return gl.getAttribLocation(program, name);\n }\n /**\n * ```\n * gl.getUniformLocation(program, name);\n * ```\n *\n * @param program\n * @param name\n * @returns\n */\n getUniformLocation(program, name) {\n const { gl } = this;\n return gl.getUniformLocation(program, name);\n }\n /**\n * ```\n * gl.enableVertexAttribArray(index);\n * ```\n *\n * @param index\n */\n enableVertexAttribArray(index) {\n const { gl } = this;\n gl.enableVertexAttribArray(index);\n }\n /**\n * ```\n * gl.disableVertexAttribArray(index);\n * ```\n *\n * @param index\n */\n disableVertexAttribArray(index) {\n const { gl } = this;\n gl.disableVertexAttribArray(index);\n }\n /**\n * ```\n * gl.createShader(type);\n * ```\n *\n * @param type\n * @returns\n */\n createShader(type) {\n const { gl } = this;\n return gl.createShader(type);\n }\n /**\n * ```\n * gl.compileShader(shader);\n * ```\n *\n * @param shader\n * @returns\n */\n compileShader(shader) {\n const { gl } = this;\n gl.compileShader(shader);\n }\n /**\n * ```\n * gl.attachShader(program, shader);\n * ```\n *\n * @param program\n * @param shader\n */\n attachShader(program, shader) {\n const { gl } = this;\n gl.attachShader(program, shader);\n }\n /**\n * ```\n * gl.linkProgram(program);\n * ```\n *\n * @param program\n */\n linkProgram(program) {\n const { gl } = this;\n gl.linkProgram(program);\n }\n /**\n * ```\n * gl.deleteProgram(shader);\n * ```\n *\n * @param shader\n */\n deleteProgram(shader) {\n const { gl } = this;\n gl.deleteProgram(shader);\n }\n /**\n * ```\n * gl.getShaderParameter(shader, pname);\n * ```\n *\n * @param shader\n * @param pname\n */\n getShaderParameter(shader, pname) {\n const { gl } = this;\n return gl.getShaderParameter(shader, pname);\n }\n /**\n * ```\n * gl.getShaderInfoLog(shader);\n * ```\n *\n * @param shader\n */\n getShaderInfoLog(shader) {\n const { gl } = this;\n return gl.getShaderInfoLog(shader);\n }\n /**\n * ```\n * gl.createProgram();\n * ```\n *\n * @returns\n */\n createProgram() {\n const { gl } = this;\n return gl.createProgram();\n }\n /**\n * ```\n * gl.getProgramParameter(program, pname);\n * ```\n *\n * @param program\n * @param pname\n * @returns\n */\n getProgramParameter(program, pname) {\n const { gl } = this;\n return gl.getProgramParameter(program, pname);\n }\n /**\n * ```\n * gl.getProgramInfoLog(program);\n * ```\n *\n * @param program\n * @returns\n */\n getProgramInfoLog(program) {\n const { gl } = this;\n return gl.getProgramInfoLog(program);\n }\n /**\n * ```\n * gl.shaderSource(shader, source);\n * ```\n *\n * @param shader\n * @param source\n */\n shaderSource(shader, source) {\n const { gl } = this;\n gl.shaderSource(shader, source);\n }\n /**\n * ```\n * gl.deleteShader(shader);\n * ```\n *\n * @param shader\n */\n deleteShader(shader) {\n const { gl } = this;\n gl.deleteShader(shader);\n }\n}\n/**\n * Compare two arrays for equality.\n *\n * @remarks\n * This function will not try to compare nested arrays or Float32Arrays and\n * instead will always return false when they are encountered.\n *\n * @param a\n * @param b\n * @returns\n */\nexport function compareArrays(a, b) {\n if (a.length !== b.length) {\n return false;\n }\n return a.every((v, i) => {\n // Don't bother to compare nested arrays or Float32Arrays\n if (Array.isArray(v) || v instanceof Float32Array) {\n return false;\n }\n else {\n return v === b[i];\n }\n });\n}\n//# sourceMappingURL=WebGlContextWrapper.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy, createWebGLContext, hasOwn, mergeColorAlphaPremultiplied, } from '../../../utils.js';\nimport { CoreRenderer } from '../CoreRenderer.js';\nimport { WebGlCoreRenderOp } from './WebGlCoreRenderOp.js';\nimport { createIndexBuffer, getWebGlParameters, getWebGlExtensions, } from './internal/RendererUtils.js';\nimport { WebGlCoreCtxTexture } from './WebGlCoreCtxTexture.js';\nimport { Texture } from '../../textures/Texture.js';\nimport { ColorTexture } from '../../textures/ColorTexture.js';\nimport { SubTexture } from '../../textures/SubTexture.js';\nimport { WebGlCoreCtxSubTexture } from './WebGlCoreCtxSubTexture.js';\nimport { CoreShaderManager } from '../../CoreShaderManager.js';\nimport { BufferCollection } from './internal/BufferCollection.js';\nimport { compareRect, getNormalizedRgbaComponents, } from '../../lib/utils.js';\nimport { WebGlCoreShader } from './WebGlCoreShader.js';\nimport { RoundedRectangle } from './shaders/RoundedRectangle.js';\nimport { ContextSpy } from '../../lib/ContextSpy.js';\nimport { WebGlContextWrapper } from '../../lib/WebGlContextWrapper.js';\nconst WORDS_PER_QUAD = 24;\nconst BYTES_PER_QUAD = WORDS_PER_QUAD * 4;\nexport class WebGlCoreRenderer extends CoreRenderer {\n //// WebGL Native Context and Data\n glw;\n system;\n //// Core Managers\n txManager;\n txMemManager;\n shManager;\n //// Options\n options;\n //// Persistent data\n quadBuffer = new ArrayBuffer(1024 * 1024 * 4);\n fQuadBuffer = new Float32Array(this.quadBuffer);\n uiQuadBuffer = new Uint32Array(this.quadBuffer);\n renderOps = [];\n //// Render Op / Buffer Filling State\n curBufferIdx = 0;\n curRenderOp = null;\n renderables = [];\n //// Default Shader\n defaultShader;\n quadBufferCollection;\n /**\n * White pixel texture used by default when no texture is specified.\n */\n defaultTexture;\n constructor(options) {\n super(options.stage);\n const { canvas, clearColor, bufferMemory } = options;\n this.options = options;\n this.txManager = options.txManager;\n this.txMemManager = options.txMemManager;\n this.shManager = options.shManager;\n this.defaultTexture = new ColorTexture(this.txManager);\n // When the default texture is loaded, request a render in case the\n // RAF is paused. Fixes: https://github.com/lightning-js/renderer/issues/123\n this.defaultTexture.once('loaded', () => {\n this.stage.requestRender();\n });\n const gl = createWebGLContext(canvas, options.contextSpy);\n const glw = (this.glw = new WebGlContextWrapper(gl));\n const color = getNormalizedRgbaComponents(clearColor);\n glw.viewport(0, 0, canvas.width, canvas.height);\n glw.clearColor(color[0], color[1], color[2], color[3]);\n glw.setBlend(true);\n glw.blendFunc(glw.ONE, glw.ONE_MINUS_SRC_ALPHA);\n createIndexBuffer(glw, bufferMemory);\n this.system = {\n parameters: getWebGlParameters(this.glw),\n extensions: getWebGlExtensions(this.glw),\n };\n this.shManager.renderer = this;\n this.defaultShader = this.shManager.loadShader('DefaultShader').shader;\n const quadBuffer = glw.createBuffer();\n assertTruthy(quadBuffer);\n const stride = 6 * Float32Array.BYTES_PER_ELEMENT;\n this.quadBufferCollection = new BufferCollection([\n {\n buffer: quadBuffer,\n attributes: {\n a_position: {\n name: 'a_position',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 0, // start at the beginning of the buffer\n },\n a_textureCoordinate: {\n name: 'a_textureCoordinate',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 2 * Float32Array.BYTES_PER_ELEMENT,\n },\n a_color: {\n name: 'a_color',\n size: 4,\n type: glw.UNSIGNED_BYTE,\n normalized: true,\n stride,\n offset: 4 * Float32Array.BYTES_PER_ELEMENT,\n },\n a_textureIndex: {\n name: 'a_textureIndex',\n size: 1,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 5 * Float32Array.BYTES_PER_ELEMENT,\n },\n },\n },\n ]);\n }\n reset() {\n const { glw } = this;\n this.curBufferIdx = 0;\n this.curRenderOp = null;\n this.renderOps.length = 0;\n glw.setScissorTest(false);\n glw.clear();\n }\n getShaderManager() {\n return this.shManager;\n }\n createCtxTexture(textureSource) {\n if (textureSource instanceof SubTexture) {\n return new WebGlCoreCtxSubTexture(this.glw, this.txMemManager, textureSource);\n }\n return new WebGlCoreCtxTexture(this.glw, this.txMemManager, textureSource);\n }\n /**\n * This function adds a quad (a rectangle composed of two triangles) to the WebGL rendering pipeline.\n *\n * It takes a set of options that define the quad's properties, such as its dimensions, colors, texture, shader, and transformation matrix.\n * The function first updates the shader properties with the current dimensions if necessary, then sets the default texture if none is provided.\n * It then checks if a new render operation is needed, based on the current shader and clipping rectangle.\n * If a new render operation is needed, it creates one and updates the current render operation.\n * The function then adjusts the texture coordinates based on the texture options and adds the texture to the texture manager.\n *\n * Finally, it calculates the vertices for the quad, taking into account any transformations, and adds them to the quad buffer.\n * The function updates the length and number of quads in the current render operation, and updates the current buffer index.\n */\n addQuad(params) {\n const { fQuadBuffer, uiQuadBuffer } = this;\n const { width, height, colorTl, colorTr, colorBl, colorBr, textureOptions, shader, shaderProps, alpha, clippingRect, tx, ty, ta, tb, tc, td, } = params;\n let { texture } = params;\n /**\n * If the shader props contain any automatic properties, update it with the\n * current dimensions that will be used to render the quad.\n */\n if (shaderProps && hasOwn(shaderProps, '$dimensions')) {\n const dimensions = shaderProps.$dimensions;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n dimensions.width = width;\n dimensions.height = height;\n }\n texture = texture ?? this.defaultTexture;\n assertTruthy(texture instanceof Texture, 'Invalid texture type');\n let { curBufferIdx: bufferIdx, curRenderOp } = this;\n const targetDims = {\n width,\n height,\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n };\n const targetShader = shader || this.defaultShader;\n assertTruthy(targetShader instanceof WebGlCoreShader);\n if (curRenderOp) {\n // If the current render op is not the same shader, create a new one\n // If the current render op's shader props are not compatible with the\n // the new shader props, create a new one render op.\n if (curRenderOp.shader !== targetShader ||\n !compareRect(curRenderOp.clippingRect, clippingRect) ||\n (curRenderOp.shader !== this.defaultShader &&\n (!shaderProps ||\n !curRenderOp.shader.canBatchShaderProps(curRenderOp.shaderProps, shaderProps)))) {\n curRenderOp = null;\n }\n }\n assertTruthy(targetShader instanceof WebGlCoreShader);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any\n if (!curRenderOp) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n this.newRenderOp(targetShader, shaderProps, alpha, targetDims, clippingRect, bufferIdx);\n curRenderOp = this.curRenderOp;\n assertTruthy(curRenderOp);\n }\n const flipX = textureOptions?.flipX ?? false;\n const flipY = textureOptions?.flipY ?? false;\n let texCoordX1 = 0;\n let texCoordY1 = 0;\n let texCoordX2 = 1;\n let texCoordY2 = 1;\n if (texture instanceof SubTexture) {\n const { x: tx, y: ty, width: tw, height: th } = texture.props;\n const { width: parentW = 0, height: parentH = 0 } = texture.parentTexture\n .dimensions || { width: 0, height: 0 };\n texCoordX1 = tx / parentW;\n texCoordX2 = texCoordX1 + tw / parentW;\n texCoordY1 = ty / parentH;\n texCoordY2 = texCoordY1 + th / parentH;\n texture = texture.parentTexture;\n }\n // Flip texture coordinates if dictated by texture options\n if (flipX) {\n [texCoordX1, texCoordX2] = [texCoordX2, texCoordX1];\n }\n if (flipY) {\n [texCoordY1, texCoordY2] = [texCoordY2, texCoordY1];\n }\n const { txManager } = this.stage;\n const ctxTexture = txManager.getCtxTexture(texture);\n assertTruthy(ctxTexture instanceof WebGlCoreCtxTexture);\n const textureIdx = this.addTexture(ctxTexture, bufferIdx);\n curRenderOp = this.curRenderOp;\n assertTruthy(curRenderOp);\n // render quad advanced\n if (tb !== 0 || tc !== 0) {\n // Upper-Left\n fQuadBuffer[bufferIdx++] = tx; // vertexX\n fQuadBuffer[bufferIdx++] = ty; // vertexY\n fQuadBuffer[bufferIdx++] = texCoordX1; // texCoordX\n fQuadBuffer[bufferIdx++] = texCoordY1; // texCoordY\n uiQuadBuffer[bufferIdx++] = colorTl; // color\n fQuadBuffer[bufferIdx++] = textureIdx; // texIndex\n // Upper-Right\n fQuadBuffer[bufferIdx++] = tx + width * ta;\n fQuadBuffer[bufferIdx++] = ty + width * tc;\n fQuadBuffer[bufferIdx++] = texCoordX2;\n fQuadBuffer[bufferIdx++] = texCoordY1;\n uiQuadBuffer[bufferIdx++] = colorTr;\n fQuadBuffer[bufferIdx++] = textureIdx;\n // Lower-Left\n fQuadBuffer[bufferIdx++] = tx + height * tb;\n fQuadBuffer[bufferIdx++] = ty + height * td;\n fQuadBuffer[bufferIdx++] = texCoordX1;\n fQuadBuffer[bufferIdx++] = texCoordY2;\n uiQuadBuffer[bufferIdx++] = colorBl;\n fQuadBuffer[bufferIdx++] = textureIdx;\n // Lower-Right\n fQuadBuffer[bufferIdx++] = tx + width * ta + height * tb;\n fQuadBuffer[bufferIdx++] = ty + width * tc + height * td;\n fQuadBuffer[bufferIdx++] = texCoordX2;\n fQuadBuffer[bufferIdx++] = texCoordY2;\n uiQuadBuffer[bufferIdx++] = colorBr;\n fQuadBuffer[bufferIdx++] = textureIdx;\n }\n else {\n // Calculate the right corner of the quad\n // multiplied by the scale\n const rightCornerX = tx + width * ta;\n const rightCornerY = ty + height * td;\n // Upper-Left\n fQuadBuffer[bufferIdx++] = tx; // vertexX\n fQuadBuffer[bufferIdx++] = ty; // vertexY\n fQuadBuffer[bufferIdx++] = texCoordX1; // texCoordX\n fQuadBuffer[bufferIdx++] = texCoordY1; // texCoordY\n uiQuadBuffer[bufferIdx++] = colorTl; // color\n fQuadBuffer[bufferIdx++] = textureIdx; // texIndex\n // Upper-Right\n fQuadBuffer[bufferIdx++] = rightCornerX;\n fQuadBuffer[bufferIdx++] = ty;\n fQuadBuffer[bufferIdx++] = texCoordX2;\n fQuadBuffer[bufferIdx++] = texCoordY1;\n uiQuadBuffer[bufferIdx++] = colorTr;\n fQuadBuffer[bufferIdx++] = textureIdx;\n // Lower-Left\n fQuadBuffer[bufferIdx++] = tx;\n fQuadBuffer[bufferIdx++] = rightCornerY;\n fQuadBuffer[bufferIdx++] = texCoordX1;\n fQuadBuffer[bufferIdx++] = texCoordY2;\n uiQuadBuffer[bufferIdx++] = colorBl;\n fQuadBuffer[bufferIdx++] = textureIdx;\n // Lower-Right\n fQuadBuffer[bufferIdx++] = rightCornerX;\n fQuadBuffer[bufferIdx++] = rightCornerY;\n fQuadBuffer[bufferIdx++] = texCoordX2;\n fQuadBuffer[bufferIdx++] = texCoordY2;\n uiQuadBuffer[bufferIdx++] = colorBr;\n fQuadBuffer[bufferIdx++] = textureIdx;\n }\n // Update the length of the current render op\n curRenderOp.length += WORDS_PER_QUAD;\n curRenderOp.numQuads++;\n this.curBufferIdx = bufferIdx;\n }\n /**\n * Replace the existing RenderOp with a new one that uses the specified Shader\n * and starts at the specified buffer index.\n *\n * @param shader\n * @param bufferIdx\n */\n newRenderOp(shader, shaderProps, alpha, dimensions, clippingRect, bufferIdx) {\n const curRenderOp = new WebGlCoreRenderOp(this.glw, this.options, this.quadBufferCollection, shader, shaderProps, alpha, clippingRect, dimensions, bufferIdx, 0);\n this.curRenderOp = curRenderOp;\n this.renderOps.push(curRenderOp);\n }\n /**\n * Add a texture to the current RenderOp. If the texture cannot be added to the\n * current RenderOp, a new RenderOp will be created and the texture will be added\n * to that one.\n *\n * If the texture cannot be added to the new RenderOp, an error will be thrown.\n *\n * @param texture\n * @param bufferIdx\n * @param recursive\n * @returns Assigned Texture Index of the texture in the render op\n */\n addTexture(texture, bufferIdx, recursive) {\n const { curRenderOp } = this;\n assertTruthy(curRenderOp);\n const textureIdx = curRenderOp.addTexture(texture);\n // TODO: Refactor to be more DRY\n if (textureIdx === 0xffffffff) {\n if (recursive) {\n throw new Error('Unable to add texture to render op');\n }\n const { shader, shaderProps, dimensions, clippingRect, alpha } = curRenderOp;\n this.newRenderOp(shader, shaderProps, alpha, dimensions, clippingRect, bufferIdx);\n return this.addTexture(texture, bufferIdx, true);\n }\n return textureIdx;\n }\n /**\n * add RenderOp to the render pipeline\n */\n addRenderOp(renderable) {\n this.renderOps.push(renderable);\n this.curRenderOp = null;\n }\n /**\n * Render the current set of RenderOps to render to the specified surface.\n *\n * TODO: 'screen' is the only supported surface at the moment.\n *\n * @param surface\n */\n render(surface = 'screen') {\n const { glw, quadBuffer } = this;\n const arr = new Float32Array(quadBuffer, 0, this.curBufferIdx);\n const buffer = this.quadBufferCollection.getBuffer('a_position') ?? null;\n glw.arrayBufferData(buffer, arr, glw.STATIC_DRAW);\n const doLog = false; // idx++ % 100 === 0;\n if (doLog) {\n console.log('renderOps', this.renderOps.length);\n }\n this.renderOps.forEach((renderOp, i) => {\n if (doLog) {\n console.log('renderOp', i, renderOp.numQuads);\n }\n renderOp.draw();\n });\n // clean up\n this.renderables = [];\n }\n}\nconst idx = 0;\n//# sourceMappingURL=WebGlCoreRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport const SpecialCodepoints = {\n LINE_FEED: 0x0a,\n CARRIAGE_RETURN: 0x0d,\n SPACE: 0x20,\n TAB: 0x09,\n ZERO_WIDTH_SPACE: 0x200b,\n ZERO_WIDTH_NON_JOINER: 0x200c,\n ZERO_WIDTH_JOINER: 0x200d,\n LEFT_TO_RIGHT_MARK: 0x200e,\n RIGHT_TO_LEFT_MARK: 0x200f,\n LEFT_TO_RIGHT_EMBEDDING: 0x202a,\n RIGHT_TO_LEFT_EMBEDDING: 0x202b,\n POP_DIRECTIONAL_FORMATTING: 0x202c,\n LEFT_TO_RIGHT_OVERRIDE: 0x202d,\n RIGHT_TO_LEFT_OVERRIDE: 0x202e,\n LINE_SEPARATOR: 0x2028,\n PARAGRAPH_SEPARATOR: 0x2029,\n OBJECT_REPLACEMENT_CHARACTER: 0xfffc,\n REPLACEMENT_CHARACTER: 0xfffd,\n ZERO_WIDTH_NO_BREAK_SPACE: 0xfeff,\n LEFT_TO_RIGHT_ISOLATE: 0x2066,\n RIGHT_TO_LEFT_ISOLATE: 0x2067,\n FIRST_STRONG_ISOLATE: 0x2068,\n POP_DIRECTIONAL_ISOLATE: 0x2069,\n INHIBIT_SYMMETRIC_SWAPPING: 0x206a,\n ACTIVATE_SYMMETRIC_SWAPPING: 0x206b,\n INHIBIT_ARABIC_FORM_SHAPING: 0x206c,\n ACTIVATE_ARABIC_FORM_SHAPING: 0x206d,\n NATIONAL_DIGIT_SHAPES: 0x206e,\n NOMINAL_DIGIT_SHAPES: 0x206f,\n LEFT_TO_RIGHT_BOUNDARY: 0x200e,\n RIGHT_TO_LEFT_BOUNDARY: 0x200f,\n};\n//# sourceMappingURL=SpecialCodepoints.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class FontShaper {\n}\n//# sourceMappingURL=FontShaper.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { SpecialCodepoints } from '../../../renderers/SdfTextRenderer/internal/SpecialCodepoints.js';\nimport { FontShaper, } from './FontShaper.js';\nexport class SdfFontShaper extends FontShaper {\n data;\n glyphMap;\n kernings;\n constructor(data, glyphMap) {\n super();\n this.data = data;\n this.glyphMap = glyphMap;\n const kernings = (this.kernings = {});\n data.kernings.forEach((kerning) => {\n const second = kerning.second;\n const firsts = (kernings[second] = kernings[second] || {});\n firsts[kerning.first] = kerning.amount;\n });\n this.kernings = kernings;\n }\n *shapeText(props, codepoints) {\n let codepointResult;\n let lastGlyphId = undefined;\n while ((codepointResult = codepoints.peek()) && !codepointResult.done) {\n const codepoint = codepointResult.value;\n const glyph = this.glyphMap.get(codepoint);\n codepoints.next();\n if (glyph !== undefined) {\n // We found a glyph for this codepoint\n // Yield the mapped glyph info\n /**\n * Kerning includes any possible additional letter spacing\n */\n const kerning = lastGlyphId !== undefined\n ? (this.kernings[glyph.id]?.[lastGlyphId] || 0) +\n props.letterSpacing\n : 0;\n lastGlyphId = glyph.id;\n yield {\n mapped: true,\n glyphId: glyph.id,\n codepoint,\n cluster: codepoints.lastIndex,\n xAdvance: glyph.xadvance + kerning,\n yAdvance: 0,\n xOffset: glyph.xoffset + kerning,\n yOffset: glyph.yoffset,\n xBearing: 0,\n yBearing: 0,\n width: glyph.width,\n height: glyph.height,\n };\n }\n else {\n // We didn't find a glyph for this codepoint\n // Yield the unmapped codepoint info\n // If this codepoint is a linebreak, we should reset the last glyph id\n // so that the next glyph will not be kerned with the last glyph of the\n // previous line.\n if (codepoint === SpecialCodepoints.LINE_FEED) {\n lastGlyphId = undefined;\n }\n yield {\n mapped: false,\n codepoint,\n cluster: codepoints.lastIndex,\n };\n }\n }\n }\n}\n//# sourceMappingURL=SdfFontShaper.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// import type { Renderer } from '../../../Renderer';\nimport { assertTruthy } from '../../../../utils.js';\nimport { WebGlCoreRenderer } from '../../../renderers/webgl/WebGlCoreRenderer.js';\nimport { ImageTexture } from '../../../textures/ImageTexture.js';\nimport { TrFontFace } from '../TrFontFace.js';\nimport { SdfFontShaper } from './internal/SdfFontShaper.js';\nexport class SdfTrFontFace extends TrFontFace {\n type;\n texture;\n /**\n * Height of the tallest character in the font including the whitespace above it\n */\n maxCharHeight = 0;\n data;\n shaper;\n glyphMap = new Map();\n constructor(fontFamily, descriptors, type, stage, atlasUrl, atlasDataUrl) {\n super(fontFamily, descriptors);\n this.type = type;\n const renderer = stage.renderer;\n assertTruthy(renderer instanceof WebGlCoreRenderer, 'SDF Font Faces can only be used with the WebGL Renderer');\n this.texture = stage.txManager.loadTexture('ImageTexture', {\n src: atlasUrl,\n // IMPORTANT: The SDF shader requires the alpha channel to NOT be\n // premultiplied on the atlas texture. If it is premultiplied, the\n // rendering of SDF glyphs (especially single-channel SDF fonts) will\n // be very jagged.\n premultiplyAlpha: false,\n }, {\n preload: true,\n });\n this.texture.on('loaded', () => {\n this.checkLoaded();\n });\n // Set this.data to the fetched data from dataUrl\n fetch(atlasDataUrl)\n .then(async (response) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n this.data = await response.json();\n // Add all the glyphs to the glyph map\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n let maxCharHeight = 0;\n this.data.chars.forEach((glyph) => {\n this.glyphMap.set(glyph.id, glyph);\n const charHeight = glyph.yoffset + glyph.height;\n if (charHeight > maxCharHeight) {\n maxCharHeight = charHeight;\n }\n });\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.maxCharHeight = maxCharHeight;\n // We know `data` is defined here, because we just set it\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.shaper = new SdfFontShaper(this.data, this.glyphMap);\n this.checkLoaded();\n })\n .catch(console.error);\n }\n getAtlasEntry(glyphId) {\n const glyph = this.glyphMap.get(glyphId);\n if (glyph === undefined) {\n throw new Error(`Glyph ${glyphId} not found in font ${this.fontFamily}`);\n }\n return {\n x: glyph.x,\n y: glyph.y,\n width: glyph.width,\n height: glyph.height,\n };\n }\n checkLoaded() {\n if (this.loaded)\n return;\n if (this.texture.state === 'loaded' && this.data) {\n this.loaded = true;\n this.emit('loaded');\n }\n }\n}\n//# sourceMappingURL=SdfTrFontFace.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Base class for Core extensions.\n *\n * @remarks\n * Core extensions are used to extend the Core Renderer with custom code such as\n * custom fonts, custom shaders, custom textures, custom animation functions,\n * and more.\n */\nexport class CoreExtension {\n}\n//# sourceMappingURL=CoreExtension.js.map"],"names":["createWebGLContext","canvas","contextSpy","config","gl","target","prop","value","assertTruthy","condition","message","isProductionEnvironment","mergeColorProgress","rgba1","rgba2","p","r1","g1","b1","a1","r2","g2","b2","a2","r","g","b","a","mergeColorAlpha","rgba","alpha","mergeColorAlphaPremultiplied","flipEndianess","newAlpha","hasOwn","obj","EventEmitter","__publicField","event","listener","listeners","index","onceListener","data","CoreShader","props","createShader","glw","type","source","shader","createProgram","vertexShader","fragmentShader","program","isWebGl2","WebGlCoreShader","options","renderer","webGl2","requiredExtensions","glVersion","extensionName","shaderSources","textureUnits","vertexSource","fragmentSource","vao","attributeName","location","buffer","uniform","attribute","loc","propsA","propsB","renderOp","dimensions","name","resolvedBuffer","resolvedInfo","textures","Texture","txManager","owner","renderable","state","args","loadedArgs","failedArgs","getNormalizedRgbaComponents","getNormalizedAlphaComponent","getRgbaString","color","createBound","x1","y1","x2","y2","out","intersectBound","intersection","boundsOverlap","convertBoundToRect","bound","intersectRect","x","y","width","height","copyRect","compareRect","boundInsideBound","bound1","bound2","isBoundPositive","TrFontFace","fontFamily","descriptors","WebTrFontFace","fontUrl","fontUrlWithoutParentheses","determinedDescriptors","cssDescriptors","fontFace","CoreContextTexture","memManager","textureSource","CoreRenderer","stage","CoreRenderOp","WebGlCoreRenderOp","buffers","shaderProps","clippingRect","bufferIdx","zIndex","texture","maxTextures","existingIdx","t","newIdx","shManager","quadIdx","pixelRatio","canvasHeight","clipX","clipWidth","clipHeight","clipY","getWebGlParameters","params","key","getWebGlExtensions","extensions","createIndexBuffer","size","maxQuads","indices","j","isHTMLImageElement","memize","fn","head","tail","memoized","node","len","i","searchCache","isPowerOfTwo","getTimingBezier","c","d","xc","xb","xa","yc","yb","ya","time","cbx","cbxd","dx","it","minT","maxT","getTimingFunction","memo","str","s","parts","TRANSPARENT_TEXTURE_DATA","WebGlCoreCtxTexture","err","_a","_b","textureData","mipmaps","glInternalFormat","view","nativeTexture","_ColorTexture","pixelData32","pixelData8","resolvedProps","ColorTexture","_SubTexture","error","parentTx","SubTexture","WebGlCoreCtxSubTexture","BufferCollection","item","WebGlContextWrapper","maxTextureUnits","_","scissorBox","textureUnit","activeTextureUnit","texture2dUnits","pname","param","texture2dParams","activeTexture","textureParams","level","internalFormat","widthOrFormat","heightOrType","borderOrSource","format","pixels","internalformat","border","red","green","blue","enable","scissorEnabled","scissorX","scissorY","scissorWidth","scissorHeight","blend","blendEnabled","src","dst","blendSrcRgb","blendDstRgb","blendSrcAlpha","blendDstAlpha","usage","boundArrayBuffer","boundElementArrayBuffer","normalized","stride","offset","curProgram","programUniforms","uniforms","uniformArgs","compareArrays","mode","count","vertexArray","v","WORDS_PER_QUAD","WebGlCoreRenderer","clearColor","bufferMemory","quadBuffer","fQuadBuffer","uiQuadBuffer","colorTl","colorTr","colorBl","colorBr","textureOptions","tx","ty","ta","tb","tc","td","curRenderOp","targetDims","targetShader","flipX","flipY","texCoordX1","texCoordY1","texCoordX2","texCoordY2","tw","th","parentW","parentH","ctxTexture","textureIdx","rightCornerX","rightCornerY","recursive","surface","arr","SpecialCodepoints","FontShaper","SdfFontShaper","glyphMap","kernings","kerning","second","firsts","codepoints","codepointResult","lastGlyphId","codepoint","glyph","SdfTrFontFace","atlasUrl","atlasDataUrl","response","maxCharHeight","charHeight","glyphId","CoreExtension"],"mappings":"4KAkBgB,SAAAA,GAAmBC,EAAQC,EAAY,CACnD,MAAMC,EAAS,CACX,MAAO,GACP,UAAW,GACX,MAAO,GACP,QAAS,GACT,eAAgB,GAGhB,gBAAiB,mBACjB,mBAAoB,GACpB,sBAAuB,EAAA,EAErBC,EAGLH,EAAO,WAAW,QAASE,CAAM,GAC9BF,EAAO,WAAW,qBAAsBE,CAAM,EAClD,GAAI,CAACC,EACK,MAAA,IAAI,MAAM,gCAAgC,EAEpD,OAAIF,EAEO,IAAI,MAAME,EAAI,CACjB,IAAIC,EAAQC,EAAM,CACR,MAAAC,EAAQF,EAAOC,CAAI,EACrB,OAAA,OAAOC,GAAU,YACNL,EAAA,UAAU,OAAOI,CAAI,CAAC,EAC1BC,EAAM,KAAKF,CAAM,GAErBE,CACX,CAAA,CACH,EAEEH,CACX,CAagB,SAAAI,EAAaC,EAAWC,EAAS,CAC7C,GAAI,CAAAC,GAAwB,GAExB,CAACF,EACK,MAAA,IAAI,MAAMC,GAAW,kBAAkB,CAErD,CAcgB,SAAAE,GAAmBC,EAAOC,EAAOC,EAAG,CAChD,MAAMC,EAAK,KAAK,MAAMH,IAAU,EAAE,EAC5BI,EAAK,KAAK,MAAOJ,IA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EAC7G,KAAK,QAAU3I,EAAM,UAAU,YAAY,eAAgB,CACvD,IAAK8L,EAKL,iBAAkB,EAC9B,EAAW,CACC,QAAS,EACrB,CAAS,EACD,KAAK,QAAQ,GAAG,SAAU,IAAM,CAC5B,KAAK,YAAW,CAC5B,CAAS,EAED,MAAMC,CAAY,EACb,KAAK,MAAOC,GAAa,CAE1B,KAAK,KAAO,MAAMA,EAAS,KAAI,EAG/B,IAAIC,EAAgB,EACpB,KAAK,KAAK,MAAM,QAASL,GAAU,CAC/B,KAAK,SAAS,IAAIA,EAAM,GAAIA,CAAK,EACjC,MAAMM,EAAaN,EAAM,QAAUA,EAAM,OACrCM,EAAaD,IACbA,EAAgBC,EAEpC,CAAa,EAED,KAAK,cAAgBD,EAGrB,KAAK,OAAS,IAAIf,GAAc,KAAK,KAAM,KAAK,QAAQ,EACxD,KAAK,YAAW,CAC5B,CAAS,EACI,MAAM,QAAQ,KAAK,CAC3B,CACD,cAAciB,EAAS,CACnB,MAAMP,EAAQ,KAAK,SAAS,IAAIO,CAAO,EACvC,GAAIP,IAAU,OACV,MAAM,IAAI,MAAM,SAAS,OAAAO,EAAO,uBAAsB,YAAK,WAAY,EAE3E,MAAO,CACH,EAAGP,EAAM,EACT,EAAGA,EAAM,EACT,MAAOA,EAAM,MACb,OAAQA,EAAM,MAC1B,CACK,CACD,aAAc,CACN,KAAK,QAEL,KAAK,QAAQ,QAAU,UAAY,KAAK,OACxC,KAAK,OAAS,GACd,KAAK,KAAK,QAAQ,EAEzB,CACL,CCtEO,MAAMQ,EAAc,CAC3B","x_google_ignoreList":[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]} \ No newline at end of file diff --git a/assets/CoreExtension-legacy-DR6C_7R9.js b/assets/CoreExtension-legacy-DR6C_7R9.js deleted file mode 100644 index 4e43672..0000000 --- a/assets/CoreExtension-legacy-DR6C_7R9.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(){function e(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */e=function(){return r};var t,r={},n=Object.prototype,i=n.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},u=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function h(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{h({},"")}catch(t){h=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var i=t&&t.prototype instanceof y?t:y,o=Object.create(i.prototype),u=new U(n||[]);return a(o,"_invoke",{value:S(e,r,u)}),o}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}r.wrap=l;var d="suspendedStart",v="suspendedYield",p="executing",g="completed",E={};function y(){}function _(){}function T(){}var x={};h(x,u,(function(){return this}));var m=Object.getPrototypeOf,A=m&&m(m(P([])));A&&A!==n&&i.call(A,u)&&(x=A);var b=T.prototype=y.prototype=Object.create(x);function R(e){["next","throw","return"].forEach((function(t){h(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function r(n,a,o,u){var s=f(e[n],e,a);if("throw"!==s.type){var c=s.arg,h=c.value;return h&&"object"==typeof h&&i.call(h,"__await")?t.resolve(h.__await).then((function(e){r("next",e,o,u)}),(function(e){r("throw",e,o,u)})):t.resolve(h).then((function(e){c.value=e,o(c)}),(function(e){return r("throw",e,o,u)}))}u(s.arg)}var n;a(this,"_invoke",{value:function(e,i){function a(){return new t((function(t,n){r(e,i,t,n)}))}return n=n?n.then(a,a):a()}})}function S(e,r,n){var i=d;return function(a,o){if(i===p)throw Error("Generator is already running");if(i===g){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var u=n.delegate;if(u){var s=M(u,n);if(s){if(s===E)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===d)throw i=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var c=f(e,r,n);if("normal"===c.type){if(i=n.done?g:v,c.arg===E)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=g,n.method="throw",n.arg=c.arg)}}}function M(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,M(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),E;var a=f(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,E;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,E):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,E)}function I(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function U(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(I,this),this.reset(!0)}function P(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function r(){for(;++n=0;--a){var o=this.tryEntries[a],u=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=i.call(o,"catchLoc"),c=i.call(o,"finallyLoc");if(s&&c){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),L(r),E}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;L(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:P(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),E}},r}function t(e,t,r,n,i,a,o){try{var u=e[a](o),s=u.value}catch(c){return void r(c)}u.done?t(s):Promise.resolve(s).then(n,i)}function r(e){return function(){var r=this,n=arguments;return new Promise((function(i,a){var o=e.apply(r,n);function u(e){t(o,i,a,u,s,"next",e)}function s(e){t(o,i,a,u,s,"throw",e)}u(void 0)}))}}function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e,t,r){return t=o(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,a()?Reflect.construct(t,r||[],o(e).constructor):t.apply(e,r))}function a(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(a=function(){return!!e})()}function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&s(e,t)}function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}function c(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return h(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return h(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&o>0)return r?(r.x=n,r.y=i,r.width=a,r.height=o,r):{x:n,y:i,width:a,height:o};if(r)return r.x=0,r.y=0,r.width=0,r.height=0,r;return{x:0,y:0,width:0,height:0}},f:function(e){return(255&e)/255},g:function(e){var t=Math.floor(255*e[0]),r=Math.floor(255*e[1]),n=Math.floor(255*e[2]),i=Math.floor(255*e[3]);return"rgba(".concat(t,",").concat(r,",").concat(n,",").concat(i.toFixed(4),")")},i:s,j:R,k:function(e){return e.x1t.x1&&e.y1t.y1},m:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=(255&e)/255*t,i=Math.trunc((e>>>24)*n),a=Math.trunc((e>>>16&255)*n),o=Math.trunc((e>>>8&255)*n),u=Math.trunc(255*n);if(r)return(u<<24|o<<16|a<<8|i)>>>0;return(i<<24|a<<16|o<<8|u)>>>0},n:function(e,t){if(t)return t.x=e.x1,t.y=e.y1,t.width=e.x2-e.x1,t.height=e.y2-e.y1,t;return{x:e.x1,y:e.y1,width:e.x2-e.x1,height:e.y2-e.y1}},o:function(e,t){if(t)return t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t;return{x:e.x,y:e.y,width:e.width,height:e.height}},q:function(e,t){var r=e>>>24,n=e>>>16&255,i=e>>>8&255,a=Math.trunc((255&e)*t);return(r<<24|n<<16|i<<8|a)>>>0},s:function(e,t,r){var n=Math.trunc(e>>>24),i=Math.trunc(e>>>16&255),a=Math.trunc(e>>>8&255),o=Math.trunc(255&e),u=Math.trunc(t>>>24),s=Math.trunc(t>>>16&255),c=Math.trunc(t>>>8&255),h=Math.trunc(255&t),l=Math.round(u*r+n*(1-r)),f=Math.round(s*r+i*(1-r)),d=Math.round(c*r+a*(1-r)),v=Math.round(h*r+o*(1-r));return(l<<24|f<<16|d<<8|v)>>>0},t:function(e,t){return e.x1<=t.x2&&e.y1<=t.y2&&e.x2>=t.x1&&e.y2>=t.y1}});var h=function(){return d((function e(){l(this,e),v(this,"eventListeners",{})}),[{key:"on",value:function(e,t){var r=this.eventListeners[e];r||(r=[]),r.push(t),this.eventListeners[e]=r}},{key:"off",value:function(e,t){var r=this.eventListeners[e];if(r)if(t){var n=r.indexOf(t);n>=0&&r.splice(n,1)}else delete this.eventListeners[e]}},{key:"once",value:function(e,t){var r=this;this.on(e,(function n(i,a){r.off(e,n),t(i,a)}))}},{key:"emit",value:function(e,t){var r=this,n=this.eventListeners[e];n&&c(n).forEach((function(e){e(r,t)}))}},{key:"removeAllListeners",value:function(){this.eventListeners={}}}])}();function f(e,t,r){var n=e.createShader(t);if(!n)throw new Error;if(e.shaderSource(n,r),e.compileShader(n),e.getShaderParameter(n,e.COMPILE_STATUS))return n;console.log(e.getShaderInfoLog(n)),e.deleteShader(n)}t("E",h);var p=function(e){function t(e){var r;l(this,t),v(r=i(this,t),"boundBufferCollection",null),v(r,"buffersBound",!1),v(r,"program",void 0),v(r,"vao",void 0),v(r,"renderer",void 0),v(r,"glw",void 0),v(r,"attributeBuffers",void 0),v(r,"attributeLocations",void 0),v(r,"attributeNames",void 0),v(r,"uniformLocations",void 0),v(r,"uniformTypes",void 0),v(r,"supportsIndexedTextures",void 0);var n=r.renderer=e.renderer,a=r.glw=r.renderer.glw;r.supportsIndexedTextures=e.supportsIndexedTextures||!1;var o=a.isWebGl2(),u=o&&e.webgl2Extensions||!o&&e.webgl1Extensions||[],s=o?"2.0":"1.0";u.forEach((function(e){if(!a.getExtension(e))throw new Error('Shader "'.concat(r.constructor.name,'" requires extension "').concat(e,'" for WebGL ').concat(s," but wasn't found"))}));var h=e.shaderSources||r.constructor.shaderSources;if(!h)throw new Error('Shader "'.concat(r.constructor.name,'" is missing shaderSources.'));o&&null!=h&&h.webGl2&&(h.fragment=h.webGl2.fragment,h.vertex=h.webGl2.vertex,delete h.webGl2);var d=n.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS,p=h.vertex instanceof Function?h.vertex(d):h.vertex,g=h.fragment instanceof Function?h.fragment(d):h.fragment,E=f(a,a.VERTEX_SHADER,p),y=f(a,a.FRAGMENT_SHADER,g);if(!E||!y)throw new Error;var _=function(e,t,r){var n=e.createProgram();if(!n)throw new Error;if(e.attachShader(n,t),e.attachShader(n,r),e.linkProgram(n),e.getProgramParameter(n,e.LINK_STATUS))return n;console.log(e.getProgramInfoLog(n)),e.deleteProgram(n)}(a,E,y);if(!_)throw new Error;if(r.program=_,o){var T=a.createVertexArray();if(!T)throw new Error;r.vao=T,a.bindVertexArray(r.vao)}return r.attributeLocations={},r.attributeBuffers={},r.attributeNames=[],c(e.attributes).forEach((function(e){var t=a.getAttribLocation(r.program,e);if(t<0)throw new Error("".concat(r.constructor.name,': Vertex shader must have an attribute "').concat(e,'"!'));var n=a.createBuffer();if(!n)throw new Error("".concat(r.constructor.name,': Could not create buffer for attribute "').concat(e,'"'));r.attributeLocations[e]=t,r.attributeBuffers[e]=n,r.attributeNames.push(e)})),r.uniformLocations={},r.uniformTypes={},e.uniforms.forEach((function(e){var t=a.getUniformLocation(r.program,e.name);r.uniformTypes[e.name]=e.uniform,t?r.uniformLocations[e.name]=t:console.warn('Shader "'.concat(r.constructor.name,'" could not get uniform location for "').concat(e.name,'"'))})),r}return u(t,e),d(t,[{key:"bindBufferAttribute",value:function(e,t,r){var n=this.glw;n.enableVertexAttribArray(e),n.vertexAttribPointer(t,e,r.size,r.type,r.normalized,r.stride,r.offset)}},{key:"disableAttribute",value:function(e){this.glw.disableVertexAttribArray(e)}},{key:"disableAttributes",value:function(){for(var e in this.attributeLocations)this.disableAttribute(this.attributeLocations[e]);this.boundBufferCollection=null}},{key:"canBatchShaderProps",value:function(e,t){return!1}},{key:"bindRenderOp",value:function(e,t){this.bindBufferCollection(e.buffers),e.textures.length>0&&this.bindTextures(e.textures);var r=e.glw;if(this.setUniform("u_resolution",[r.canvas.width,r.canvas.height]),this.setUniform("u_pixelRatio",e.options.pixelRatio),t){if(o(t,"$dimensions")){var n=t.$dimensions;n||(n=e.dimensions),this.setUniform("u_dimensions",[n.width,n.height])}if(o(t,"$alpha")){var i=t.$alpha;i||(i=e.alpha),this.setUniform("u_alpha",i)}this.bindProps(t)}}},{key:"setUniform",value:function(e){for(var t,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i0}},{key:"setState",value:function(e){if(this.state!==e){this.state=e;for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n>>24)/255,(e>>>16&255)/255,(e>>>8&255)/255,(255&e)/255]}));function y(e,t,r,n,i){return i?(i.x1=e,i.y1=t,i.x2=r,i.y2=n,i):{x1:e,y1:t,x2:r,y2:n}}var _=function(e){function t(e,r){var a;return l(this,t),v(a=i(this,t),"fontFamily",void 0),v(a,"descriptors",void 0),v(a,"loaded",!1),a.fontFamily=e,a.descriptors=function(e){for(var t=1;t=r?4294967295:(this.textures.push(e),i)}},{key:"draw",value:function(){var e=this.glw,t=this.shader,r=this.shaderProps,n=this.options;n.shManager.useShader(t),t.bindRenderOp(this,r);var i=this.bufferIdx/24*6*2;if(this.clippingRect.valid){var a=this.clippingRect,o=a.x,u=a.y,s=a.width,c=a.height,h=n.pixelRatio,l=n.canvas.height,f=Math.round(o*h),d=Math.round(s*h),v=Math.round(c*h),p=Math.round(l-v-u*h);e.setScissorTest(!0),e.scissor(f,p,d,v)}else e.setScissorTest(!1);e.drawElements(e.TRIANGLES,6*this.numQuads,e.UNSIGNED_SHORT,i)}}])}(d((function e(){l(this,e)})));function A(e){var t={MAX_RENDERBUFFER_SIZE:0,MAX_TEXTURE_SIZE:0,MAX_VIEWPORT_DIMS:0,MAX_VERTEX_TEXTURE_IMAGE_UNITS:0,MAX_TEXTURE_IMAGE_UNITS:0,MAX_COMBINED_TEXTURE_IMAGE_UNITS:0,MAX_VERTEX_ATTRIBS:0,MAX_VARYING_VECTORS:0,MAX_VERTEX_UNIFORM_VECTORS:0,MAX_FRAGMENT_UNIFORM_VECTORS:0};return Object.keys(t).forEach((function(r){t[r]=e.getParameter(e[r])})),t}function b(e){var t={ANGLE_instanced_arrays:null,WEBGL_compressed_texture_s3tc:null,WEBGL_compressed_texture_astc:null,WEBGL_compressed_texture_etc:null,WEBGL_compressed_texture_etc1:null,WEBGL_compressed_texture_pvrtc:null,WEBKIT_WEBGL_compressed_texture_pvrtc:null,WEBGL_compressed_texture_s3tc_srgb:null,OES_vertex_array_object:null};return Object.keys(t).forEach((function(r){t[r]=e.getExtension(r)})),t}function R(e,t){var r,n,i=0;function a(){var a,o,u=r,s=arguments.length;e:for(;u;){if(u.args.length===arguments.length){for(o=0;o=1)return 1;if(e<=0)return 0;for(var t,r,n=.5,h=0;h<20;h++){if((r=e-n*(n*(n*o+a)+i))>-1e-8&&r<1e-8)return n*(n*(n*c+s)+u);if((t=n*(n*(3*o)+2*a)+i)>1e-10&&t<1e-10)break;n+=r/t}for(var l=0,f=1,d=0;d<20;d++){if((r=e-(n=.5*(l+f))*(n*(n*o+a)+i))>-1e-8&&r<1e-8)return n*(n*(n*c+s)+u);r<0?f=n:l=n}}};t("r",R((function(e){switch(e){case"linear":return function(e){return e};case"ease":return S(.25,.1,.25,1);case"ease-in":return S(.42,0,1,1);case"ease-out":return S(0,0,.58,1);case"ease-in-out":return S(.42,0,.58,1);case"ease-in-sine":case"ease-out-sine":return S(.12,0,.39,0);case"ease-in-out-sine":return S(.37,0,.63,1);case"ease-in-cubic":return S(.32,0,.67,0);case"ease-out-cubic":return S(.33,1,.68,1);case"ease-in-out-cubic":return S(.65,0,.35,1);case"ease-in-circ":return S(.55,0,1,.45);case"ease-out-circ":return S(0,.55,.45,1);case"ease-in-out-circ":return S(.85,0,.15,1);case"ease-in-back":return S(.36,0,.66,-.56);case"ease-out-back":return S(.34,1.56,.64,1);case"ease-in-out-back":return S(.68,-.6,.32,1.6);case"step-start":return function(){return 1};case"step-end":return function(e){return 1===e?1:0};default:var t="cubic-bezier(";if(e&&0===e.indexOf(t)){var r=e.substr(13,e.length-13-1).split(",");if(4!==r.length)return console.warn("Unknown timing function: "+e),function(e){return e};var n=parseFloat(r[0]||"0.42"),i=parseFloat(r[1]||"0"),a=parseFloat(r[2]||"1"),o=parseFloat(r[3]||"1");return isNaN(n)||isNaN(i)||isNaN(a)||isNaN(o)?(console.warn(" Unknown timing function: "+e),function(e){return e}):S(n,i,a,o)}return console.warn("Unknown timing function: "+e),function(e){return e}}})));Math.hypot||(Math.hypot=function(){for(var e=arguments.length,t=new Array(e),r=0;r2?o-2:0),s=2;sn&&(n=t)})),h.maxCharHeight=n,h.shaper=new X(h.data,h.glyphMap),h.checkLoaded();case 8:case"end":return e.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch(console.error),h}return u(n,t),d(n,[{key:"getAtlasEntry",value:function(e){var t=this.glyphMap.get(e);if(void 0===t)throw new Error("Glyph ".concat(e," not found in font ").concat(this.fontFamily));return{x:t.x,y:t.y,width:t.width,height:t.height}}},{key:"checkLoaded",value:function(){this.loaded||"loaded"===this.texture.state&&this.data&&(this.loaded=!0,this.emit("loaded"))}}])}(_);t("S",D),t("C",d((function e(){l(this,e)})))}}}))}(); -//# sourceMappingURL=CoreExtension-legacy-DR6C_7R9.js.map diff --git a/assets/CoreExtension-legacy-DR6C_7R9.js.map b/assets/CoreExtension-legacy-DR6C_7R9.js.map deleted file mode 100644 index 9b40070..0000000 --- a/assets/CoreExtension-legacy-DR6C_7R9.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"CoreExtension-legacy-DR6C_7R9.js","sources":["../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/utils.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/lib/utils.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/common/EventEmitter.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/internal/ShaderUtils.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/WebGlCoreShader.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/CoreShader.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/textures/Texture.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/font-face-types/TrFontFace.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/font-face-types/WebTrFontFace.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/CoreContextTexture.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/CoreRenderer.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/WebGlCoreRenderOp.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/CoreRenderOp.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/internal/RendererUtils.js","../../../../node_modules/.pnpm/memize@2.1.0/node_modules/memize/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/utils.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/WebGlCoreCtxTexture.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/textures/ColorTexture.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/textures/SubTexture.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/WebGlCoreCtxSubTexture.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/internal/BufferCollection.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/lib/WebGlContextWrapper.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/internal/WebGlUtils.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/WebGlCoreRenderer.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/SpecialCodepoints.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/font-face-types/SdfTrFontFace/internal/SdfFontShaper.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/font-face-types/SdfTrFontFace/internal/FontShaper.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/font-face-types/SdfTrFontFace/SdfTrFontFace.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/CoreExtension.js"],"sourcesContent":["/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport function createWebGLContext(canvas, contextSpy) {\n const config = {\n alpha: true,\n antialias: false,\n depth: false,\n stencil: true,\n desynchronized: false,\n // Disabled because it prevents Visual Regression Tests from working\n // failIfMajorPerformanceCaveat: true,\n powerPreference: 'high-performance',\n premultipliedAlpha: true,\n preserveDrawingBuffer: false,\n };\n const gl = \n // TODO: Remove this assertion once this issue is fixed in TypeScript\n // https://github.com/microsoft/TypeScript/issues/53614\n (canvas.getContext('webgl', config) ||\n canvas.getContext('experimental-webgl', config));\n if (!gl) {\n throw new Error('Unable to create WebGL context');\n }\n if (contextSpy) {\n // Proxy the GL context to log all GL calls\n return new Proxy(gl, {\n get(target, prop) {\n const value = target[prop];\n if (typeof value === 'function') {\n contextSpy.increment(String(prop));\n return value.bind(target);\n }\n return value;\n },\n });\n }\n return gl;\n}\n/**\n * Asserts a condition is truthy, otherwise throws an error\n *\n * @remarks\n * Useful at the top of functions to ensure certain conditions, arguments and\n * properties are set/met before continuing. When using this function,\n * TypeScript will narrow away falsy types from the condition.\n *\n * @param condition\n * @param message\n * @returns\n */\nexport function assertTruthy(condition, message) {\n if (isProductionEnvironment())\n return;\n if (!condition) {\n throw new Error(message || 'Assertion failed');\n }\n}\n/**\n * Merges two colors based on a given progress value.\n *\n * This function takes two colors (c1 and c2) represented as 32-bit integers\n * in RGBA format and blends them based on the provided progress value (p).\n * The result is a new color that is a weighted combination of the input colors,\n * where the weight is determined by the progress value.\n *\n * @param {number} c1 - The first color in RGBA format (32-bit integer).\n * @param {number} c2 - The second color in RGBA format (32-bit integer).\n * @param {number} p - The progress value between 0 and 1.\n * @returns {number} The merged color as a 32-bit integer in RGBA format.\n */\nexport function mergeColorProgress(rgba1, rgba2, p) {\n const r1 = Math.trunc(rgba1 >>> 24);\n const g1 = Math.trunc((rgba1 >>> 16) & 0xff);\n const b1 = Math.trunc((rgba1 >>> 8) & 0xff);\n const a1 = Math.trunc(rgba1 & 0xff);\n const r2 = Math.trunc(rgba2 >>> 24);\n const g2 = Math.trunc((rgba2 >>> 16) & 0xff);\n const b2 = Math.trunc((rgba2 >>> 8) & 0xff);\n const a2 = Math.trunc(rgba2 & 0xff);\n const r = Math.round(r2 * p + r1 * (1 - p));\n const g = Math.round(g2 * p + g1 * (1 - p));\n const b = Math.round(b2 * p + b1 * (1 - p));\n const a = Math.round(a2 * p + a1 * (1 - p));\n return ((r << 24) | (g << 16) | (b << 8) | a) >>> 0;\n}\n/**\n * Given an RGBA encoded number, returns back the RGBA number with it's alpha\n * component multiplied by the passed `alpha` parameter.\n *\n * @internalRemarks\n * This method does NOT premultiply the alpha into the color channels. If that\n * is required (for internal use only) use {@link mergeColorAlphaPremultiplied}\n * instead.\n *\n * @param rgba RGBA encoded number\n * @param alpha Normalized alpha value (Range: 0.0 - 1.0)\n * @returns\n */\nexport function mergeColorAlpha(rgba, alpha) {\n const r = rgba >>> 24;\n const g = (rgba >>> 16) & 0xff;\n const b = (rgba >>> 8) & 0xff;\n const a = Math.trunc((rgba & 0xff) * alpha);\n return ((r << 24) | (g << 16) | (b << 8) | a) >>> 0;\n}\n/**\n * Given an RGBA encoded number, returns back the RGBA number with it's alpha\n * component multiplied by the passed `alpha` parameter. Before returning, the\n * final alpha value is multiplied into the color channels.\n *\n * @remarks\n * If `flipEndianess` is set to true, the function will returned an ABGR encoded number\n * which is useful when the color value needs to be passed into a shader attribute.\n *\n * NOTE: This method returns a PREMULTIPLIED alpha color which is generally only useful\n * in the context of the internal rendering process. Use {@link mergeColorAlpha} if you\n * need to blend an alpha value into a color in the context of the Renderer's\n * main API.\n *\n * @internalRemarks\n * Do not expose this method in the main API because Renderer users should instead use\n * {@link mergeColorAlpha} to manipulate the alpha value of a color.\n *\n * @internal\n * @param rgba RGBA encoded number\n * @param alpha Normalized alpha value (Range: 0.0 - 1.0)\n * @param flipEndianess Flip the endianess. RGBA becomes encoded as ABGR (for inserting colors into shader attributes)\n * @returns\n */\nexport function mergeColorAlphaPremultiplied(rgba, alpha, flipEndianess = false) {\n const newAlpha = ((rgba & 0xff) / 255) * alpha;\n const r = Math.trunc((rgba >>> 24) * newAlpha);\n const g = Math.trunc(((rgba >>> 16) & 0xff) * newAlpha);\n const b = Math.trunc(((rgba >>> 8) & 0xff) * newAlpha);\n const a = Math.trunc(newAlpha * 255);\n if (flipEndianess) {\n return ((a << 24) | (b << 16) | (g << 8) | r) >>> 0;\n }\n return ((r << 24) | (g << 16) | (b << 8) | a) >>> 0;\n}\n/**\n * Returns true if the given object has the given \"own\" property.\n *\n * @param obj\n * @param prop\n * @returns\n */\nexport function hasOwn(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n/**\n * Converts degrees to radians\n *\n * @param degrees\n * @returns\n */\nexport function deg2Rad(degrees) {\n return (degrees * Math.PI) / 180;\n}\n/**\n * Checks import.meta if env is production\n *\n * @returns\n */\nexport function isProductionEnvironment() {\n return import.meta.env && import.meta.env.PROD;\n}\n//# sourceMappingURL=utils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport const getNormalizedRgbaComponents = (rgba) => {\n const r = rgba >>> 24;\n const g = (rgba >>> 16) & 0xff;\n const b = (rgba >>> 8) & 0xff;\n const a = rgba & 0xff;\n return [r / 255, g / 255, b / 255, a / 255];\n};\nexport const getRgbaComponents = (rgba) => {\n const r = rgba >>> 24;\n const g = (rgba >>> 16) & 0xff;\n const b = (rgba >>> 8) & 0xff;\n const a = rgba & 0xff;\n return [r, g, b, a];\n};\nexport const norm = (rgba) => {\n const r = rgba >>> 24;\n const g = (rgba >>> 16) & 0xff;\n const b = (rgba >>> 8) & 0xff;\n const a = rgba & 0xff;\n const rgbaArr = [r / 255, g / 255, b / 255, a / 255];\n rgbaArr[0] = Math.max(0, Math.min(255, rgbaArr[0]));\n rgbaArr[1] = Math.max(0, Math.min(255, rgbaArr[1]));\n rgbaArr[2] = Math.max(0, Math.min(255, rgbaArr[2]));\n rgbaArr[3] = Math.max(0, Math.min(255, rgbaArr[3]));\n let v = ((rgbaArr[3] | 0) << 24) +\n ((rgbaArr[0] | 0) << 16) +\n ((rgbaArr[1] | 0) << 8) +\n (rgbaArr[2] | 0);\n if (v < 0) {\n v = 0xffffffff + v + 1;\n }\n return v;\n};\nexport function getNormalizedAlphaComponent(rgba) {\n return (rgba & 0xff) / 255.0;\n}\n/**\n * Get a CSS color string from a RGBA color\n *\n * @param color\n * @returns\n */\nexport function getRgbaString(color) {\n const r = Math.floor(color[0] * 255.0);\n const g = Math.floor(color[1] * 255.0);\n const b = Math.floor(color[2] * 255.0);\n const a = Math.floor(color[3] * 255.0);\n return `rgba(${r},${g},${b},${a.toFixed(4)})`;\n}\nexport function createBound(x1, y1, x2, y2, out) {\n if (out) {\n out.x1 = x1;\n out.y1 = y1;\n out.x2 = x2;\n out.y2 = y2;\n return out;\n }\n return {\n x1,\n y1,\n x2,\n y2,\n };\n}\nexport function intersectBound(a, b, out) {\n const intersection = createBound(Math.max(a.x1, b.x1), Math.max(a.y1, b.y1), Math.min(a.x2, b.x2), Math.min(a.y2, b.y2), out);\n if (intersection.x1 < intersection.x2 && intersection.y1 < intersection.y2) {\n return intersection;\n }\n return createBound(0, 0, 0, 0, intersection);\n}\nexport function boundsOverlap(a, b) {\n return a.x1 < b.x2 && a.x2 > b.x1 && a.y1 < b.y2 && a.y2 > b.y1;\n}\nexport function convertBoundToRect(bound, out) {\n if (out) {\n out.x = bound.x1;\n out.y = bound.y1;\n out.width = bound.x2 - bound.x1;\n out.height = bound.y2 - bound.y1;\n return out;\n }\n return {\n x: bound.x1,\n y: bound.y1,\n width: bound.x2 - bound.x1,\n height: bound.y2 - bound.y1,\n };\n}\nexport function intersectRect(a, b, out) {\n const x = Math.max(a.x, b.x);\n const y = Math.max(a.y, b.y);\n const width = Math.min(a.x + a.width, b.x + b.width) - x;\n const height = Math.min(a.y + a.height, b.y + b.height) - y;\n if (width > 0 && height > 0) {\n if (out) {\n out.x = x;\n out.y = y;\n out.width = width;\n out.height = height;\n return out;\n }\n return {\n x,\n y,\n width,\n height,\n };\n }\n if (out) {\n out.x = 0;\n out.y = 0;\n out.width = 0;\n out.height = 0;\n return out;\n }\n return {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n };\n}\nexport function copyRect(a, out) {\n if (out) {\n out.x = a.x;\n out.y = a.y;\n out.width = a.width;\n out.height = a.height;\n return out;\n }\n return {\n x: a.x,\n y: a.y,\n width: a.width,\n height: a.height,\n };\n}\nexport function compareRect(a, b) {\n if (a === b) {\n return true;\n }\n if (a === null || b === null) {\n return false;\n }\n return (a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height);\n}\nexport function boundInsideBound(bound1, bound2) {\n return (bound1.x1 <= bound2.x2 &&\n bound1.y1 <= bound2.y2 &&\n bound1.x2 >= bound2.x1 &&\n bound1.y2 >= bound2.y1);\n}\nexport function isBoundPositive(bound) {\n return bound.x1 < bound.x2 && bound.y1 < bound.y2;\n}\nexport function isRectPositive(rect) {\n return rect.width > 0 && rect.height > 0;\n}\n//# sourceMappingURL=utils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * EventEmitter base class\n */\nexport class EventEmitter {\n eventListeners = {};\n on(event, listener) {\n let listeners = this.eventListeners[event];\n if (!listeners) {\n listeners = [];\n }\n listeners.push(listener);\n this.eventListeners[event] = listeners;\n }\n off(event, listener) {\n const listeners = this.eventListeners[event];\n if (!listeners) {\n return;\n }\n if (!listener) {\n delete this.eventListeners[event];\n return;\n }\n const index = listeners.indexOf(listener);\n if (index >= 0) {\n listeners.splice(index, 1);\n }\n }\n once(event, listener) {\n const onceListener = (target, data) => {\n this.off(event, onceListener);\n listener(target, data);\n };\n this.on(event, onceListener);\n }\n emit(event, data) {\n const listeners = this.eventListeners[event];\n if (!listeners) {\n return;\n }\n [...listeners].forEach((listener) => {\n listener(this, data);\n });\n }\n removeAllListeners() {\n this.eventListeners = {};\n }\n}\n//# sourceMappingURL=EventEmitter.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion Types\nexport function createShader(glw, type, source) {\n const shader = glw.createShader(type);\n if (!shader) {\n throw new Error();\n }\n glw.shaderSource(shader, source);\n glw.compileShader(shader);\n const success = glw.getShaderParameter(shader, glw.COMPILE_STATUS);\n if (success) {\n return shader;\n }\n console.log(glw.getShaderInfoLog(shader));\n glw.deleteShader(shader);\n}\nexport function createProgram(glw, vertexShader, fragmentShader) {\n const program = glw.createProgram();\n if (!program) {\n throw new Error();\n }\n glw.attachShader(program, vertexShader);\n glw.attachShader(program, fragmentShader);\n glw.linkProgram(program);\n const success = glw.getProgramParameter(program, glw.LINK_STATUS);\n if (success) {\n return program;\n }\n console.log(glw.getProgramInfoLog(program));\n glw.deleteProgram(program);\n return undefined;\n}\n//# sourceMappingURL=ShaderUtils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy, hasOwn } from '../../../utils.js';\nimport { CoreShader } from '../CoreShader.js';\nimport { createProgram, createShader, } from './internal/ShaderUtils.js';\nimport { isWebGl2 } from './internal/WebGlUtils.js';\nexport class WebGlCoreShader extends CoreShader {\n boundBufferCollection = null;\n buffersBound = false;\n program;\n /**\n * Vertex Array Object\n *\n * @remarks\n * Used by WebGL2 Only\n */\n vao;\n renderer;\n glw;\n attributeBuffers;\n attributeLocations;\n attributeNames;\n uniformLocations;\n uniformTypes;\n supportsIndexedTextures;\n constructor(options) {\n super();\n const renderer = (this.renderer = options.renderer);\n const glw = (this.glw = this.renderer.glw);\n this.supportsIndexedTextures = options.supportsIndexedTextures || false;\n // Check that extensions are supported\n const webGl2 = glw.isWebGl2();\n const requiredExtensions = (webGl2 && options.webgl2Extensions) ||\n (!webGl2 && options.webgl1Extensions) ||\n [];\n const glVersion = webGl2 ? '2.0' : '1.0';\n requiredExtensions.forEach((extensionName) => {\n if (!glw.getExtension(extensionName)) {\n throw new Error(`Shader \"${this.constructor.name}\" requires extension \"${extensionName}\" for WebGL ${glVersion} but wasn't found`);\n }\n });\n // Gather shader sources\n // - If WebGL 2 and special WebGL 2 sources are provided, we copy those sources and delete\n // the extra copy of them to save memory.\n // TODO: This could be further made optimal by just caching the compiled shaders and completely deleting\n // the source code\n const shaderSources = options.shaderSources ||\n this.constructor.shaderSources;\n if (!shaderSources) {\n throw new Error(`Shader \"${this.constructor.name}\" is missing shaderSources.`);\n }\n else if (webGl2 && shaderSources?.webGl2) {\n shaderSources.fragment = shaderSources.webGl2.fragment;\n shaderSources.vertex = shaderSources.webGl2.vertex;\n delete shaderSources.webGl2;\n }\n const textureUnits = renderer.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS;\n const vertexSource = shaderSources.vertex instanceof Function\n ? shaderSources.vertex(textureUnits)\n : shaderSources.vertex;\n const fragmentSource = shaderSources.fragment instanceof Function\n ? shaderSources.fragment(textureUnits)\n : shaderSources.fragment;\n const vertexShader = createShader(glw, glw.VERTEX_SHADER, vertexSource);\n const fragmentShader = createShader(glw, glw.FRAGMENT_SHADER, fragmentSource);\n if (!vertexShader || !fragmentShader) {\n throw new Error();\n }\n const program = createProgram(glw, vertexShader, fragmentShader);\n if (!program) {\n throw new Error();\n }\n this.program = program;\n if (webGl2) {\n const vao = glw.createVertexArray();\n if (!vao) {\n throw new Error();\n }\n this.vao = vao;\n glw.bindVertexArray(this.vao);\n }\n this.attributeLocations = {};\n this.attributeBuffers = {};\n this.attributeNames = [];\n [...options.attributes].forEach((attributeName) => {\n const location = glw.getAttribLocation(this.program, attributeName);\n if (location < 0) {\n throw new Error(`${this.constructor.name}: Vertex shader must have an attribute \"${attributeName}\"!`);\n }\n const buffer = glw.createBuffer();\n if (!buffer) {\n throw new Error(`${this.constructor.name}: Could not create buffer for attribute \"${attributeName}\"`);\n }\n this.attributeLocations[attributeName] = location;\n this.attributeBuffers[attributeName] = buffer;\n this.attributeNames.push(attributeName);\n });\n this.uniformLocations = {};\n this.uniformTypes = {};\n options.uniforms.forEach((uniform) => {\n const location = glw.getUniformLocation(this.program, uniform.name);\n this.uniformTypes[uniform.name] = uniform.uniform;\n if (!location) {\n console.warn(`Shader \"${this.constructor.name}\" could not get uniform location for \"${uniform.name}\"`);\n return;\n }\n this.uniformLocations[uniform.name] = location;\n });\n }\n bindBufferAttribute(location, buffer, attribute) {\n const { glw } = this;\n glw.enableVertexAttribArray(location);\n glw.vertexAttribPointer(buffer, location, attribute.size, attribute.type, attribute.normalized, attribute.stride, attribute.offset);\n }\n disableAttribute(location) {\n this.glw.disableVertexAttribArray(location);\n }\n disableAttributes() {\n for (const loc in this.attributeLocations) {\n this.disableAttribute(this.attributeLocations[loc]);\n }\n this.boundBufferCollection = null;\n }\n /**\n * Given two sets of Shader props destined for this Shader, determine if they can be batched together\n * to reduce the number of draw calls.\n *\n * @remarks\n * This is used by the {@link WebGlCoreRenderer} to determine if it can batch multiple consecutive draw\n * calls into a single draw call.\n *\n * By default, this returns false (meaning no batching is allowed), but can be\n * overridden by child classes to provide more efficient batching.\n *\n * @param propsA\n * @param propsB\n * @returns\n */\n canBatchShaderProps(propsA, propsB) {\n return false;\n }\n bindRenderOp(renderOp, props) {\n this.bindBufferCollection(renderOp.buffers);\n if (renderOp.textures.length > 0) {\n this.bindTextures(renderOp.textures);\n }\n const { glw } = renderOp;\n // Bind standard automatic uniforms\n this.setUniform('u_resolution', [glw.canvas.width, glw.canvas.height]);\n this.setUniform('u_pixelRatio', renderOp.options.pixelRatio);\n if (props) {\n // Bind optional automatic uniforms\n // These are only bound if their keys are present in the props.\n if (hasOwn(props, '$dimensions')) {\n let dimensions = props.$dimensions;\n if (!dimensions) {\n dimensions = renderOp.dimensions;\n }\n this.setUniform('u_dimensions', [dimensions.width, dimensions.height]);\n }\n if (hasOwn(props, '$alpha')) {\n let alpha = props.$alpha;\n if (!alpha) {\n alpha = renderOp.alpha;\n }\n this.setUniform('u_alpha', alpha);\n }\n this.bindProps(props);\n }\n }\n setUniform(name, ...value) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-unsafe-argument\n this.glw.setUniform(this.uniformTypes[name], this.uniformLocations[name], ...value);\n }\n bindBufferCollection(buffer) {\n if (this.boundBufferCollection === buffer) {\n return;\n }\n for (const attributeName in this.attributeLocations) {\n const resolvedBuffer = buffer.getBuffer(attributeName);\n const resolvedInfo = buffer.getAttributeInfo(attributeName);\n assertTruthy(resolvedBuffer, `Buffer for \"${attributeName}\" not found`);\n assertTruthy(resolvedInfo);\n this.bindBufferAttribute(this.attributeLocations[attributeName], resolvedBuffer, resolvedInfo);\n }\n this.boundBufferCollection = buffer;\n }\n bindProps(props) {\n // Implement in child class\n }\n bindTextures(textures) {\n // no defaults\n }\n attach() {\n this.glw.useProgram(this.program);\n this.glw.useProgram(this.program);\n if (this.glw.isWebGl2() && this.vao) {\n this.glw.bindVertexArray(this.vao);\n }\n }\n detach() {\n this.disableAttributes();\n }\n static shaderSources;\n}\n//# sourceMappingURL=WebGlCoreShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class CoreShader {\n // abstract draw(): void;\n static makeCacheKey(props) {\n return false;\n }\n static resolveDefaults(props) {\n return {};\n }\n}\n//# sourceMappingURL=CoreShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EventEmitter } from '../../common/EventEmitter.js';\n/**\n * Represents a source of texture data for a CoreContextTexture.\n *\n * @remarks\n * Texture sources are used to populate a CoreContextTexture when that texture\n * is loaded. Texture data retrieved by the CoreContextTexture by the\n * `getTextureData` method. It's the responsibility of the concerete `Texture`\n * subclass to implement this method appropriately.\n */\nexport class Texture extends EventEmitter {\n txManager;\n /**\n * The dimensions of the texture\n *\n * @remarks\n * Until the texture data is loaded for the first time the value will be\n * `null`.\n */\n dimensions = null;\n error = null;\n state = 'freed';\n renderableOwners = new Set();\n constructor(txManager) {\n super();\n this.txManager = txManager;\n }\n /**\n * Add/remove an owner to/from the Texture based on its renderability.\n *\n * @remarks\n * Any object can own a texture, be it a CoreNode or even the state object\n * from a Text Renderer.\n *\n * When the reference to the texture that an owner object holds is replaced\n * or cleared it must call this with `renderable=false` to release the owner\n * association.\n *\n * @param owner\n * @param renderable\n */\n setRenderableOwner(owner, renderable) {\n if (renderable) {\n this.renderableOwners.add(owner);\n }\n else {\n this.renderableOwners.delete(owner);\n }\n }\n /**\n * Returns true if the texture is assigned to any Nodes that are renderable.\n */\n get renderable() {\n return this.renderableOwners.size > 0;\n }\n /**\n * Set the state of the texture\n *\n * @remark\n * Intended for internal-use only but declared public so that it can be set\n * by it's associated {@link CoreContextTexture}\n *\n * @param state\n * @param args\n */\n setState(state, ...args) {\n if (this.state !== state) {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.state = state;\n if (state === 'loaded') {\n const loadedArgs = args;\n this.dimensions = loadedArgs[0];\n }\n else if (state === 'failed') {\n const failedArgs = args;\n this.error = failedArgs[0];\n }\n this.emit(state, ...args);\n }\n }\n /**\n * Make a cache key for this texture.\n *\n * @remarks\n * Each concrete `Texture` subclass must implement this method to provide an\n * appropriate cache key for the texture type including the texture's\n * properties that uniquely identify a copy of the texture. If the texture\n * type does not support caching, then this method should return `false`.\n *\n * @param props\n * @returns\n * A cache key for this texture or `false` if the texture type does not\n * support caching.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static makeCacheKey(props) {\n return false;\n }\n /**\n * Resolve the default values for the texture's properties.\n *\n * @remarks\n * Each concrete `Texture` subclass must implement this method to provide\n * default values for the texture's optional properties.\n *\n * @param props\n * @returns\n * The default values for the texture's properties.\n */\n static resolveDefaults(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n props) {\n return {};\n }\n}\n//# sourceMappingURL=Texture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EventEmitter } from '../../../common/EventEmitter.js';\nexport class TrFontFace extends EventEmitter {\n fontFamily;\n descriptors;\n loaded = false;\n constructor(fontFamily, descriptors) {\n super();\n this.fontFamily = fontFamily;\n this.descriptors = {\n style: 'normal',\n weight: 'normal',\n stretch: 'normal',\n ...descriptors,\n };\n }\n /**\n * Convert a TrFontFaceDescriptors to a FontFaceDescriptors which differ slightly\n *\n * @param descriptors\n * @returns\n */\n static convertToCssFontFaceDescriptors(descriptors) {\n return {\n style: descriptors.style,\n weight: typeof descriptors.weight === 'number'\n ? `${descriptors.weight}`\n : descriptors.weight,\n stretch: descriptors.stretch,\n unicodeRange: descriptors.unicodeRange,\n variant: descriptors.variant,\n featureSettings: descriptors.featureSettings,\n display: descriptors.display,\n };\n }\n}\n//# sourceMappingURL=TrFontFace.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { TrFontFace } from './TrFontFace.js';\nexport class WebTrFontFace extends TrFontFace {\n fontFace;\n fontUrl;\n constructor(fontFamily, descriptors, fontUrl) {\n super(fontFamily, descriptors);\n // Filter out parentheses from fontUrl\n const fontUrlWithoutParentheses = fontUrl.replace(/\\(|\\)/g, '');\n // Defaults for descriptors resolved in the super constructor\n const determinedDescriptors = this.descriptors;\n // Convert TrFontFaceDescriptors to CSS FontFaceDescriptors\n const cssDescriptors = {\n style: determinedDescriptors.style,\n weight: typeof determinedDescriptors.weight === 'number'\n ? `${determinedDescriptors.weight}`\n : determinedDescriptors.weight,\n stretch: determinedDescriptors.stretch,\n unicodeRange: determinedDescriptors.unicodeRange,\n variant: determinedDescriptors.variant,\n featureSettings: determinedDescriptors.featureSettings,\n display: determinedDescriptors.display,\n };\n const fontFace = new FontFace(fontFamily, `url(${fontUrlWithoutParentheses})`, cssDescriptors);\n fontFace\n .load()\n .then(() => {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.loaded = true;\n this.emit('loaded');\n })\n .catch(console.error);\n this.fontFace = fontFace;\n this.fontUrl = fontUrl;\n }\n}\n//# sourceMappingURL=WebTrFontFace.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class CoreContextTexture {\n memManager;\n textureSource;\n constructor(memManager, textureSource) {\n this.memManager = memManager;\n this.textureSource = textureSource;\n }\n}\n//# sourceMappingURL=CoreContextTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreContextTexture } from './CoreContextTexture.js';\nexport class CoreRenderer {\n stage;\n constructor(stage) {\n this.stage = stage;\n }\n}\n//# sourceMappingURL=CoreRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreRenderOp } from '../CoreRenderOp.js';\nimport { WebGlCoreShader } from './WebGlCoreShader.js';\nconst MAX_TEXTURES = 8; // TODO: get from gl\n/**\n * Can render multiple quads with multiple textures (up to vertex shader texture limit)\n *\n */\nexport class WebGlCoreRenderOp extends CoreRenderOp {\n glw;\n options;\n buffers;\n shader;\n shaderProps;\n alpha;\n clippingRect;\n dimensions;\n bufferIdx;\n zIndex;\n length = 0;\n numQuads = 0;\n textures = [];\n maxTextures;\n constructor(glw, options, buffers, shader, shaderProps, alpha, clippingRect, dimensions, bufferIdx, zIndex) {\n super();\n this.glw = glw;\n this.options = options;\n this.buffers = buffers;\n this.shader = shader;\n this.shaderProps = shaderProps;\n this.alpha = alpha;\n this.clippingRect = clippingRect;\n this.dimensions = dimensions;\n this.bufferIdx = bufferIdx;\n this.zIndex = zIndex;\n this.maxTextures = shader.supportsIndexedTextures\n ? glw.getParameter(glw.MAX_VERTEX_TEXTURE_IMAGE_UNITS)\n : 1;\n }\n addTexture(texture) {\n const { textures, maxTextures } = this;\n const existingIdx = textures.findIndex((t) => t === texture);\n if (existingIdx !== -1) {\n return existingIdx;\n }\n const newIdx = textures.length;\n if (newIdx >= maxTextures) {\n return 0xffffffff;\n }\n this.textures.push(texture);\n return newIdx;\n }\n draw() {\n const { glw, shader, shaderProps, options } = this;\n // shaderOp.draw(this);\n const { shManager } = options;\n shManager.useShader(shader);\n shader.bindRenderOp(this, shaderProps);\n // TODO: Reduce calculations required\n const quadIdx = (this.bufferIdx / 24) * 6 * 2;\n // Clipping\n if (this.clippingRect.valid) {\n const { x, y, width, height } = this.clippingRect;\n const pixelRatio = options.pixelRatio;\n const canvasHeight = options.canvas.height;\n const clipX = Math.round(x * pixelRatio);\n const clipWidth = Math.round(width * pixelRatio);\n const clipHeight = Math.round(height * pixelRatio);\n const clipY = Math.round(canvasHeight - clipHeight - y * pixelRatio);\n glw.setScissorTest(true);\n glw.scissor(clipX, clipY, clipWidth, clipHeight);\n }\n else {\n glw.setScissorTest(false);\n }\n glw.drawElements(glw.TRIANGLES, 6 * this.numQuads, glw.UNSIGNED_SHORT, quadIdx);\n }\n}\n//# sourceMappingURL=WebGlCoreRenderOp.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class CoreRenderOp {\n}\n//# sourceMappingURL=CoreRenderOp.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Get device specific webgl parameters\n * @param glw\n */\nexport function getWebGlParameters(glw) {\n const params = {\n MAX_RENDERBUFFER_SIZE: 0,\n MAX_TEXTURE_SIZE: 0,\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any\n MAX_VIEWPORT_DIMS: 0,\n MAX_VERTEX_TEXTURE_IMAGE_UNITS: 0,\n MAX_TEXTURE_IMAGE_UNITS: 0,\n MAX_COMBINED_TEXTURE_IMAGE_UNITS: 0,\n MAX_VERTEX_ATTRIBS: 0,\n MAX_VARYING_VECTORS: 0,\n MAX_VERTEX_UNIFORM_VECTORS: 0,\n MAX_FRAGMENT_UNIFORM_VECTORS: 0,\n };\n // Map over all parameters and get them\n const keys = Object.keys(params);\n keys.forEach((key) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n params[key] = glw.getParameter(glw[key]);\n });\n return params;\n}\n/**\n * Get device webgl extensions\n * @param glw\n */\nexport function getWebGlExtensions(glw) {\n const extensions = {\n ANGLE_instanced_arrays: null,\n WEBGL_compressed_texture_s3tc: null,\n WEBGL_compressed_texture_astc: null,\n WEBGL_compressed_texture_etc: null,\n WEBGL_compressed_texture_etc1: null,\n WEBGL_compressed_texture_pvrtc: null,\n WEBKIT_WEBGL_compressed_texture_pvrtc: null,\n WEBGL_compressed_texture_s3tc_srgb: null,\n OES_vertex_array_object: null,\n };\n // Map over all extensions and get them\n const keys = Object.keys(extensions);\n keys.forEach((key) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n extensions[key] = glw.getExtension(key);\n });\n return extensions;\n}\n/**\n * Allocate big memory chunk that we\n * can re-use to draw quads\n *\n * @param glw\n * @param size\n */\nexport function createIndexBuffer(glw, size) {\n const maxQuads = ~~(size / 80);\n const indices = new Uint16Array(maxQuads * 6);\n for (let i = 0, j = 0; i < maxQuads; i += 6, j += 4) {\n indices[i] = j;\n indices[i + 1] = j + 1;\n indices[i + 2] = j + 2;\n indices[i + 3] = j + 2;\n indices[i + 4] = j + 1;\n indices[i + 5] = j + 3;\n }\n const buffer = glw.createBuffer();\n glw.elementArrayBufferData(buffer, indices, glw.STATIC_DRAW);\n}\n/**\n * Checks if an object is of type HTMLImageElement.\n * This is used because we cant check for HTMLImageElement directly when the\n * renderer is running in a seperate web worker context.\n *\n * @param obj\n * @returns\n */\nexport function isHTMLImageElement(obj) {\n return (obj !== null &&\n typeof obj === 'object' &&\n obj.constructor &&\n obj.constructor.name === 'HTMLImageElement');\n}\n//# sourceMappingURL=RendererUtils.js.map","/**\n * Memize options object.\n *\n * @typedef MemizeOptions\n *\n * @property {number} [maxSize] Maximum size of the cache.\n */\n\n/**\n * Internal cache entry.\n *\n * @typedef MemizeCacheNode\n *\n * @property {?MemizeCacheNode|undefined} [prev] Previous node.\n * @property {?MemizeCacheNode|undefined} [next] Next node.\n * @property {Array<*>} args Function arguments for cache\n * entry.\n * @property {*} val Function result.\n */\n\n/**\n * Properties of the enhanced function for controlling cache.\n *\n * @typedef MemizeMemoizedFunction\n *\n * @property {()=>void} clear Clear the cache.\n */\n\n/**\n * Accepts a function to be memoized, and returns a new memoized function, with\n * optional options.\n *\n * @template {(...args: any[]) => any} F\n *\n * @param {F} fn Function to memoize.\n * @param {MemizeOptions} [options] Options object.\n *\n * @return {((...args: Parameters) => ReturnType) & MemizeMemoizedFunction} Memoized function.\n */\nfunction memize(fn, options) {\n\tvar size = 0;\n\n\t/** @type {?MemizeCacheNode|undefined} */\n\tvar head;\n\n\t/** @type {?MemizeCacheNode|undefined} */\n\tvar tail;\n\n\toptions = options || {};\n\n\tfunction memoized(/* ...args */) {\n\t\tvar node = head,\n\t\t\tlen = arguments.length,\n\t\t\targs,\n\t\t\ti;\n\n\t\tsearchCache: while (node) {\n\t\t\t// Perform a shallow equality test to confirm that whether the node\n\t\t\t// under test is a candidate for the arguments passed. Two arrays\n\t\t\t// are shallowly equal if their length matches and each entry is\n\t\t\t// strictly equal between the two sets. Avoid abstracting to a\n\t\t\t// function which could incur an arguments leaking deoptimization.\n\n\t\t\t// Check whether node arguments match arguments length\n\t\t\tif (node.args.length !== arguments.length) {\n\t\t\t\tnode = node.next;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Check whether node arguments match arguments values\n\t\t\tfor (i = 0; i < len; i++) {\n\t\t\t\tif (node.args[i] !== arguments[i]) {\n\t\t\t\t\tnode = node.next;\n\t\t\t\t\tcontinue searchCache;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// At this point we can assume we've found a match\n\n\t\t\t// Surface matched node to head if not already\n\t\t\tif (node !== head) {\n\t\t\t\t// As tail, shift to previous. Must only shift if not also\n\t\t\t\t// head, since if both head and tail, there is no previous.\n\t\t\t\tif (node === tail) {\n\t\t\t\t\ttail = node.prev;\n\t\t\t\t}\n\n\t\t\t\t// Adjust siblings to point to each other. If node was tail,\n\t\t\t\t// this also handles new tail's empty `next` assignment.\n\t\t\t\t/** @type {MemizeCacheNode} */ (node.prev).next = node.next;\n\t\t\t\tif (node.next) {\n\t\t\t\t\tnode.next.prev = node.prev;\n\t\t\t\t}\n\n\t\t\t\tnode.next = head;\n\t\t\t\tnode.prev = null;\n\t\t\t\t/** @type {MemizeCacheNode} */ (head).prev = node;\n\t\t\t\thead = node;\n\t\t\t}\n\n\t\t\t// Return immediately\n\t\t\treturn node.val;\n\t\t}\n\n\t\t// No cached value found. Continue to insertion phase:\n\n\t\t// Create a copy of arguments (avoid leaking deoptimization)\n\t\targs = new Array(len);\n\t\tfor (i = 0; i < len; i++) {\n\t\t\targs[i] = arguments[i];\n\t\t}\n\n\t\tnode = {\n\t\t\targs: args,\n\n\t\t\t// Generate the result from original function\n\t\t\tval: fn.apply(null, args),\n\t\t};\n\n\t\t// Don't need to check whether node is already head, since it would\n\t\t// have been returned above already if it was\n\n\t\t// Shift existing head down list\n\t\tif (head) {\n\t\t\thead.prev = node;\n\t\t\tnode.next = head;\n\t\t} else {\n\t\t\t// If no head, follows that there's no tail (at initial or reset)\n\t\t\ttail = node;\n\t\t}\n\n\t\t// Trim tail if we're reached max size and are pending cache insertion\n\t\tif (size === /** @type {MemizeOptions} */ (options).maxSize) {\n\t\t\ttail = /** @type {MemizeCacheNode} */ (tail).prev;\n\t\t\t/** @type {MemizeCacheNode} */ (tail).next = null;\n\t\t} else {\n\t\t\tsize++;\n\t\t}\n\n\t\thead = node;\n\n\t\treturn node.val;\n\t}\n\n\tmemoized.clear = function () {\n\t\thead = null;\n\t\ttail = null;\n\t\tsize = 0;\n\t};\n\n\t// Ignore reason: There's not a clear solution to create an intersection of\n\t// the function with additional properties, where the goal is to retain the\n\t// function signature of the incoming argument and add control properties\n\t// on the return value.\n\n\t// @ts-ignore\n\treturn memoized;\n}\n\nexport { memize as default };\n","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Core Utility Functions\n *\n * @module\n */\nimport memo from 'memize';\nexport const EPSILON = 0.000001;\nexport let ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array;\nexport const RANDOM = Math.random;\nexport const ANGLE_ORDER = 'zyx';\nconst degree = Math.PI / 180;\nexport const setMatrixArrayType = (type) => {\n ARRAY_TYPE = type;\n};\nexport const toRadian = (a) => {\n return a * degree;\n};\nexport const equals = (a, b) => {\n return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b));\n};\nexport const rand = (min, max) => {\n return Math.floor(Math.random() * (max - min + 1) + min);\n};\nexport const isPowerOfTwo = (value) => {\n return value && !(value & (value - 1));\n};\nconst getTimingBezier = (a, b, c, d) => {\n const xc = 3.0 * a;\n const xb = 3.0 * (c - a) - xc;\n const xa = 1.0 - xc - xb;\n const yc = 3.0 * b;\n const yb = 3.0 * (d - b) - yc;\n const ya = 1.0 - yc - yb;\n return function (time) {\n if (time >= 1.0) {\n return 1;\n }\n if (time <= 0) {\n return 0;\n }\n let t = 0.5, cbx, cbxd, dx;\n for (let it = 0; it < 20; it++) {\n cbx = t * (t * (t * xa + xb) + xc);\n dx = time - cbx;\n if (dx > -1e-8 && dx < 1e-8) {\n return t * (t * (t * ya + yb) + yc);\n }\n // Cubic bezier derivative.\n cbxd = t * (t * (3 * xa) + 2 * xb) + xc;\n if (cbxd > 1e-10 && cbxd < 1e-10) {\n // Problematic. Fall back to binary search method.\n break;\n }\n t += dx / cbxd;\n }\n // Fallback: binary search method. This is more reliable when there are near-0 slopes.\n let minT = 0;\n let maxT = 1;\n for (let it = 0; it < 20; it++) {\n t = 0.5 * (minT + maxT);\n cbx = t * (t * (t * xa + xb) + xc);\n dx = time - cbx;\n if (dx > -1e-8 && dx < 1e-8) {\n // Solution found!\n return t * (t * (t * ya + yb) + yc);\n }\n if (dx < 0) {\n maxT = t;\n }\n else {\n minT = t;\n }\n }\n };\n};\nexport const getTimingFunction = memo((str) => {\n switch (str) {\n case 'linear':\n return function (time) {\n return time;\n };\n case 'ease':\n return getTimingBezier(0.25, 0.1, 0.25, 1.0);\n case 'ease-in':\n return getTimingBezier(0.42, 0, 1.0, 1.0);\n case 'ease-out':\n return getTimingBezier(0, 0, 0.58, 1.0);\n case 'ease-in-out':\n return getTimingBezier(0.42, 0, 0.58, 1.0);\n case 'ease-in-sine':\n return getTimingBezier(0.12, 0, 0.39, 0);\n case 'ease-out-sine':\n return getTimingBezier(0.12, 0, 0.39, 0);\n case 'ease-in-out-sine':\n return getTimingBezier(0.37, 0, 0.63, 1);\n case 'ease-in-cubic':\n return getTimingBezier(0.32, 0, 0.67, 0);\n case 'ease-out-cubic':\n return getTimingBezier(0.33, 1, 0.68, 1);\n case 'ease-in-out-cubic':\n return getTimingBezier(0.65, 0, 0.35, 1);\n case 'ease-in-circ':\n return getTimingBezier(0.55, 0, 1, 0.45);\n case 'ease-out-circ':\n return getTimingBezier(0, 0.55, 0.45, 1);\n case 'ease-in-out-circ':\n return getTimingBezier(0.85, 0, 0.15, 1);\n case 'ease-in-back':\n return getTimingBezier(0.36, 0, 0.66, -0.56);\n case 'ease-out-back':\n return getTimingBezier(0.34, 1.56, 0.64, 1);\n case 'ease-in-out-back':\n return getTimingBezier(0.68, -0.6, 0.32, 1.6);\n case 'step-start':\n return function () {\n return 1;\n };\n case 'step-end':\n return function (time) {\n return time === 1 ? 1 : 0;\n };\n default:\n // eslint-disable-next-line no-case-declarations\n const s = 'cubic-bezier(';\n if (str && str.indexOf(s) === 0) {\n const parts = str\n .substr(s.length, str.length - s.length - 1)\n .split(',');\n if (parts.length !== 4) {\n console.warn('Unknown timing function: ' + str);\n // Fallback: use linear.\n return function (time) {\n return time;\n };\n }\n const a = parseFloat(parts[0] || '0.42');\n const b = parseFloat(parts[1] || '0');\n const c = parseFloat(parts[2] || '1');\n const d = parseFloat(parts[3] || '1');\n if (isNaN(a) || isNaN(b) || isNaN(c) || isNaN(d)) {\n console.warn(' Unknown timing function: ' + str);\n // Fallback: use linear.\n return function (time) {\n return time;\n };\n }\n return getTimingBezier(a, b, c, d);\n }\n else {\n console.warn('Unknown timing function: ' + str);\n // Fallback: use linear.\n return function (time) {\n return time;\n };\n }\n }\n});\nif (!Math.hypot)\n Math.hypot = (...args) => {\n let y = 0, i = args.length;\n while (i--) {\n y += args[i] * args[i];\n }\n return Math.sqrt(y);\n };\n//# sourceMappingURL=utils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../../utils.js';\nimport { isPowerOfTwo } from '../../utils.js';\nimport { CoreContextTexture } from '../CoreContextTexture.js';\nimport { isHTMLImageElement } from './internal/RendererUtils.js';\nconst TRANSPARENT_TEXTURE_DATA = new Uint8Array([0, 0, 0, 0]);\n/**\n * A wrapper around a WebGLTexture that handles loading the texture data\n * from a Texture source and uploading it to the GPU as well as freeing\n * the uploaded texture.\n *\n * @remarks\n * When accessing the ctxTexture property, the texture will be loaded if\n * it hasn't been already. ctxTexture will always return a valid WebGLTexture\n * and trigger the loading/uploading of the texture's data if it hasn't been\n * loaded yet.\n */\nexport class WebGlCoreCtxTexture extends CoreContextTexture {\n glw;\n _nativeCtxTexture = null;\n _state = 'freed';\n _w = 0;\n _h = 0;\n constructor(glw, memManager, textureSource) {\n super(memManager, textureSource);\n this.glw = glw;\n }\n get ctxTexture() {\n if (this._state === 'freed') {\n this.load();\n }\n assertTruthy(this._nativeCtxTexture);\n return this._nativeCtxTexture;\n }\n get renderable() {\n return this.textureSource.renderable;\n }\n get w() {\n return this._w;\n }\n get h() {\n return this._h;\n }\n /**\n * Load the texture data from the Texture source and upload it to the GPU\n *\n * @remarks\n * This method is called automatically when accessing the ctxTexture property\n * if the texture hasn't been loaded yet. But it can also be called manually\n * to force the texture to be pre-loaded prior to accessing the ctxTexture\n * property.\n */\n load() {\n // If the texture is already loading or loaded, don't load it again.\n if (this._state === 'loading' || this._state === 'loaded') {\n return;\n }\n this._state = 'loading';\n this.textureSource.setState('loading');\n this._nativeCtxTexture = this.createNativeCtxTexture();\n this.onLoadRequest()\n .then(({ width, height }) => {\n if (this._state === 'freed') {\n return;\n }\n this._state = 'loaded';\n this._w = width;\n this._h = height;\n // Update the texture source's width and height so that it can be used\n // for rendering.\n this.textureSource.setState('loaded', { width, height });\n })\n .catch((err) => {\n this._state = 'failed';\n this.textureSource.setState('failed', err);\n console.error(err);\n });\n }\n /**\n * Called when the texture data needs to be loaded and uploaded to a texture\n */\n async onLoadRequest() {\n const { glw, memManager } = this;\n // On initial load request, create a 1x1 transparent texture to use until\n // the texture data is finally loaded.\n glw.activeTexture(0);\n glw.bindTexture(this._nativeCtxTexture);\n // linear texture filtering\n glw.texParameteri(glw.TEXTURE_MAG_FILTER, glw.LINEAR);\n glw.texParameteri(glw.TEXTURE_MIN_FILTER, glw.LINEAR);\n // texture wrapping method\n glw.texParameteri(glw.TEXTURE_WRAP_S, glw.CLAMP_TO_EDGE);\n glw.texParameteri(glw.TEXTURE_WRAP_T, glw.CLAMP_TO_EDGE);\n glw.texImage2D(0, glw.RGBA, 1, 1, 0, glw.RGBA, glw.UNSIGNED_BYTE, TRANSPARENT_TEXTURE_DATA);\n memManager.setTextureMemUse(this, TRANSPARENT_TEXTURE_DATA.byteLength);\n const textureData = await this.textureSource?.getTextureData();\n // If the texture has been freed while loading, return early.\n if (!this._nativeCtxTexture) {\n assertTruthy(this._state === 'freed');\n return { width: 0, height: 0 };\n }\n let width = 0;\n let height = 0;\n assertTruthy(this._nativeCtxTexture);\n glw.activeTexture(0);\n // If textureData is null, the texture is empty (0, 0) and we don't need to\n // upload any data to the GPU.\n if (textureData.data instanceof ImageBitmap ||\n textureData.data instanceof ImageData ||\n // not using typeof HTMLImageElement due to web worker\n isHTMLImageElement(textureData.data)) {\n const data = textureData.data;\n width = data.width;\n height = data.height;\n glw.bindTexture(this._nativeCtxTexture);\n glw.pixelStorei(glw.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !!textureData.premultiplyAlpha);\n glw.texImage2D(0, glw.RGBA, glw.RGBA, glw.UNSIGNED_BYTE, data);\n memManager.setTextureMemUse(this, width * height * 4);\n // generate mipmaps for power-of-2 textures or in WebGL2RenderingContext\n if (glw.isWebGl2() || (isPowerOfTwo(width) && isPowerOfTwo(height))) {\n glw.generateMipmap();\n }\n }\n else if (textureData.data === null) {\n width = 0;\n height = 0;\n // Reset to a 1x1 transparent texture\n glw.bindTexture(this._nativeCtxTexture);\n glw.texImage2D(0, glw.RGBA, 1, 1, 0, glw.RGBA, glw.UNSIGNED_BYTE, TRANSPARENT_TEXTURE_DATA);\n memManager.setTextureMemUse(this, TRANSPARENT_TEXTURE_DATA.byteLength);\n }\n else if ('mipmaps' in textureData.data && textureData.data.mipmaps) {\n const { mipmaps, width = 0, height = 0, type, glInternalFormat, } = textureData.data;\n const view = type === 'ktx'\n ? new DataView(mipmaps[0] ?? new ArrayBuffer(0))\n : mipmaps[0];\n glw.bindTexture(this._nativeCtxTexture);\n glw.compressedTexImage2D(0, glInternalFormat, width, height, 0, view);\n glw.texParameteri(glw.TEXTURE_WRAP_S, glw.CLAMP_TO_EDGE);\n glw.texParameteri(glw.TEXTURE_WRAP_T, glw.CLAMP_TO_EDGE);\n glw.texParameteri(glw.TEXTURE_MAG_FILTER, glw.LINEAR);\n glw.texParameteri(glw.TEXTURE_MIN_FILTER, glw.LINEAR);\n memManager.setTextureMemUse(this, view.byteLength);\n }\n else {\n console.error(`WebGlCoreCtxTexture.onLoadRequest: Unexpected textureData returned`, textureData);\n }\n return {\n width,\n height,\n };\n }\n /**\n * Free the WebGLTexture from the GPU\n *\n * @returns\n */\n free() {\n if (this._state === 'freed') {\n return;\n }\n this._state = 'freed';\n this.textureSource.setState('freed');\n this._w = 0;\n this._h = 0;\n if (!this._nativeCtxTexture) {\n return;\n }\n const { glw, memManager } = this;\n glw.deleteTexture(this._nativeCtxTexture);\n memManager.setTextureMemUse(this, 0);\n this._nativeCtxTexture = null;\n }\n createNativeCtxTexture() {\n const { glw } = this;\n const nativeTexture = glw.createTexture();\n if (!nativeTexture) {\n throw new Error('Could not create WebGL Texture');\n }\n return nativeTexture;\n }\n}\n//# sourceMappingURL=WebGlCoreCtxTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\n/**\n * Texture consisting of only a 1x1 color pixel\n *\n * @remarks\n * The pixel color is set with the {@link ColorTextureProps.color} prop.\n *\n * This is the default texture used for a Node if it's\n * {@link INodeWritableProps.texture} prop is set to `null` (the default)\n *\n * Generally the 1x1 color pixel is stretched to whatever the set dimensions of\n * a Node are.\n */\nexport class ColorTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = ColorTexture.resolveDefaults(props || {});\n }\n get color() {\n return this.props.color;\n }\n set color(color) {\n this.props.color = color;\n }\n async getTextureData() {\n const pixelData32 = new Uint32Array([this.color]);\n const pixelData8 = new Uint8ClampedArray(pixelData32.buffer);\n return {\n data: new ImageData(pixelData8, 1, 1),\n premultiplyAlpha: true,\n };\n }\n static makeCacheKey(props) {\n const resolvedProps = ColorTexture.resolveDefaults(props);\n return `ColorTexture,${resolvedProps.color}`;\n }\n static resolveDefaults(props) {\n return {\n color: props.color || 0xffffffff,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=ColorTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture, } from './Texture.js';\n/**\n * A Texture that is a sub-region of another Texture.\n *\n * @remarks\n * The parent texture can be a Sprite Sheet/Texture Atlas and set using the\n * {@link SubTextureProps.texture} prop. The sub-region relative to the parent\n * texture is defined with the {@link SubTextureProps.x},\n * {@link SubTextureProps.y}, {@link SubTextureProps.width}, and\n * {@link SubTextureProps.height} pixel values.\n */\nexport class SubTexture extends Texture {\n props;\n parentTexture;\n constructor(txManager, props) {\n super(txManager);\n this.parentTexture = this.txManager.loadTexture(props.texture.txType, props.texture.props, props.texture.options);\n this.props = SubTexture.resolveDefaults(props || {});\n // If parent texture is already loaded / failed, trigger loaded event manually\n // so that users get a consistent event experience.\n // We do this in a microtask to allow listeners to be attached in the same\n // synchronous task after calling loadTexture()\n queueMicrotask(() => {\n const parentTx = this.parentTexture;\n if (parentTx.state === 'loaded') {\n this.onParentTxLoaded(parentTx, parentTx.dimensions);\n }\n else if (parentTx.state === 'failed') {\n this.onParentTxFailed(parentTx, parentTx.error);\n }\n parentTx.on('loaded', this.onParentTxLoaded);\n parentTx.on('failed', this.onParentTxFailed);\n });\n }\n onParentTxLoaded = () => {\n // We ignore the parent's passed dimensions, and simply use the SubTexture's\n // configured dimensions (because that's all that matters here)\n this.setState('loaded', {\n width: this.props.width,\n height: this.props.height,\n });\n };\n onParentTxFailed = (target, error) => {\n this.setState('failed', error);\n };\n async getTextureData() {\n return {\n data: this.props,\n };\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static makeCacheKey(props) {\n return false;\n }\n static resolveDefaults(props) {\n return {\n texture: props.texture,\n x: props.x || 0,\n y: props.y || 0,\n width: props.width || 0,\n height: props.height || 0,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=SubTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreCtxTexture } from './WebGlCoreCtxTexture.js';\nexport class WebGlCoreCtxSubTexture extends WebGlCoreCtxTexture {\n constructor(glw, memManager, textureSource) {\n super(glw, memManager, textureSource);\n }\n async onLoadRequest() {\n const props = await this.textureSource.getTextureData();\n return {\n width: props.data?.width || 0,\n height: props.data?.height || 0,\n };\n }\n}\n//# sourceMappingURL=WebGlCoreCtxSubTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Represents a collection of WebGL Buffers along with their associated\n * vertex attribute formats.\n */\nexport class BufferCollection {\n config;\n constructor(config) {\n this.config = config;\n }\n /**\n * Get the WebGLBuffer associated with the given attribute name if it exists.\n *\n * @param attributeName\n * @returns\n */\n getBuffer(attributeName) {\n return this.config.find((item) => item.attributes[attributeName])?.buffer;\n }\n /**\n * Get the AttributeInfo associated with the given attribute name if it exists.\n *\n * @param attributeName\n * @returns\n */\n getAttributeInfo(attributeName) {\n return this.config.find((item) => item.attributes[attributeName])\n ?.attributes[attributeName];\n }\n}\n//# sourceMappingURL=BufferCollection.js.map","/* eslint-disable @typescript-eslint/no-unsafe-return */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-unsafe-argument */\nimport { assertTruthy } from '../../utils.js';\nimport { isWebGl2 } from '../renderers/webgl/internal/WebGlUtils.js';\n/**\n * Optimized WebGL Context Wrapper\n *\n * @remarks\n * This class contains the subset of the WebGLRenderingContext & WebGL2RenderingContext\n * API that is used by the renderer. Select high volume WebGL methods include\n * caching optimizations to avoid making WebGL calls if the state is already set\n * to the desired value.\n *\n * While most methods contained are direct passthroughs to the WebGL context,\n * some methods combine multiple WebGL calls into one for convenience, modify\n * arguments to be more convenient, or are replaced by more specific methods.\n *\n * Not all methods are optimized. Only methods that are called frequently\n * and/or have a high cost are optimized.\n *\n * A subset of GLenum constants are also exposed as properties on this class\n * for convenience.\n */\nexport class WebGlContextWrapper {\n gl;\n //#region Cached WebGL State\n activeTextureUnit = 0;\n texture2dUnits;\n texture2dParams = new WeakMap();\n scissorEnabled;\n scissorX;\n scissorY;\n scissorWidth;\n scissorHeight;\n blendEnabled;\n blendSrcRgb;\n blendDstRgb;\n blendSrcAlpha;\n blendDstAlpha;\n boundArrayBuffer;\n boundElementArrayBuffer;\n curProgram;\n programUniforms = new WeakMap();\n //#endregion Cached WebGL State\n //#region Canvas\n canvas;\n //#endregion Canvas\n //#region WebGL Enums\n MAX_RENDERBUFFER_SIZE;\n MAX_TEXTURE_SIZE;\n MAX_VIEWPORT_DIMS;\n MAX_VERTEX_TEXTURE_IMAGE_UNITS;\n MAX_TEXTURE_IMAGE_UNITS;\n MAX_COMBINED_TEXTURE_IMAGE_UNITS;\n MAX_VERTEX_ATTRIBS;\n MAX_VARYING_VECTORS;\n MAX_VERTEX_UNIFORM_VECTORS;\n MAX_FRAGMENT_UNIFORM_VECTORS;\n TEXTURE_MAG_FILTER;\n TEXTURE_MIN_FILTER;\n TEXTURE_WRAP_S;\n TEXTURE_WRAP_T;\n LINEAR;\n CLAMP_TO_EDGE;\n RGBA;\n UNSIGNED_BYTE;\n UNPACK_PREMULTIPLY_ALPHA_WEBGL;\n FLOAT;\n TRIANGLES;\n UNSIGNED_SHORT;\n ONE;\n ONE_MINUS_SRC_ALPHA;\n VERTEX_SHADER;\n FRAGMENT_SHADER;\n STATIC_DRAW;\n COMPILE_STATUS;\n LINK_STATUS;\n DYNAMIC_DRAW;\n //#endregion WebGL Enums\n constructor(gl) {\n this.gl = gl;\n // The following code extracts the current state of the WebGL context\n // to our local JavaScript cached version of it. This is so we can\n // avoid making WebGL calls if we don't need to.\n // We could assume that the WebGL context is in a default state, but\n // in the future we may want to support restoring a broken WebGL context\n // and this will help with that.\n this.activeTextureUnit =\n gl.getParameter(gl.ACTIVE_TEXTURE) - gl.TEXTURE0;\n const maxTextureUnits = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);\n // save current texture units\n this.texture2dUnits = new Array(maxTextureUnits)\n .fill(undefined)\n .map((_, i) => {\n this.activeTexture(i);\n return gl.getParameter(gl.TEXTURE_BINDING_2D);\n });\n // restore active texture unit\n this.activeTexture(this.activeTextureUnit);\n this.scissorEnabled = gl.isEnabled(gl.SCISSOR_TEST);\n const scissorBox = gl.getParameter(gl.SCISSOR_BOX);\n this.scissorX = scissorBox[0];\n this.scissorY = scissorBox[1];\n this.scissorWidth = scissorBox[2];\n this.scissorHeight = scissorBox[3];\n this.blendEnabled = gl.isEnabled(gl.BLEND);\n this.blendSrcRgb = gl.getParameter(gl.BLEND_SRC_RGB);\n this.blendDstRgb = gl.getParameter(gl.BLEND_DST_RGB);\n this.blendSrcAlpha = gl.getParameter(gl.BLEND_SRC_ALPHA);\n this.blendDstAlpha = gl.getParameter(gl.BLEND_DST_ALPHA);\n this.boundArrayBuffer = gl.getParameter(gl.ARRAY_BUFFER_BINDING);\n this.boundElementArrayBuffer = gl.getParameter(gl.ELEMENT_ARRAY_BUFFER_BINDING);\n this.curProgram = gl.getParameter(gl.CURRENT_PROGRAM);\n this.canvas = gl.canvas;\n // Extract GLenums\n this.MAX_RENDERBUFFER_SIZE = gl.MAX_RENDERBUFFER_SIZE;\n this.MAX_TEXTURE_SIZE = gl.MAX_TEXTURE_SIZE;\n this.MAX_VIEWPORT_DIMS = gl.MAX_VIEWPORT_DIMS;\n this.MAX_VERTEX_TEXTURE_IMAGE_UNITS = gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS;\n this.MAX_TEXTURE_IMAGE_UNITS = gl.MAX_TEXTURE_IMAGE_UNITS;\n this.MAX_COMBINED_TEXTURE_IMAGE_UNITS = gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS;\n this.MAX_VERTEX_ATTRIBS = gl.MAX_VERTEX_ATTRIBS;\n this.MAX_VARYING_VECTORS = gl.MAX_VARYING_VECTORS;\n this.MAX_VERTEX_UNIFORM_VECTORS = gl.MAX_VERTEX_UNIFORM_VECTORS;\n this.MAX_FRAGMENT_UNIFORM_VECTORS = gl.MAX_FRAGMENT_UNIFORM_VECTORS;\n this.TEXTURE_MAG_FILTER = gl.TEXTURE_MAG_FILTER;\n this.TEXTURE_MIN_FILTER = gl.TEXTURE_MIN_FILTER;\n this.TEXTURE_WRAP_S = gl.TEXTURE_WRAP_S;\n this.TEXTURE_WRAP_T = gl.TEXTURE_WRAP_T;\n this.LINEAR = gl.LINEAR;\n this.CLAMP_TO_EDGE = gl.CLAMP_TO_EDGE;\n this.RGBA = gl.RGBA;\n this.UNSIGNED_BYTE = gl.UNSIGNED_BYTE;\n this.UNPACK_PREMULTIPLY_ALPHA_WEBGL = gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL;\n this.FLOAT = gl.FLOAT;\n this.TRIANGLES = gl.TRIANGLES;\n this.UNSIGNED_SHORT = gl.UNSIGNED_SHORT;\n this.ONE = gl.ONE;\n this.ONE_MINUS_SRC_ALPHA = gl.ONE_MINUS_SRC_ALPHA;\n this.MAX_VERTEX_TEXTURE_IMAGE_UNITS = gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS;\n this.TRIANGLES = gl.TRIANGLES;\n this.UNSIGNED_SHORT = gl.UNSIGNED_SHORT;\n this.VERTEX_SHADER = gl.VERTEX_SHADER;\n this.FRAGMENT_SHADER = gl.FRAGMENT_SHADER;\n this.STATIC_DRAW = gl.STATIC_DRAW;\n this.COMPILE_STATUS = gl.COMPILE_STATUS;\n this.LINK_STATUS = gl.LINK_STATUS;\n this.DYNAMIC_DRAW = gl.DYNAMIC_DRAW;\n }\n /**\n * Returns true if the WebGL context is WebGL2\n *\n * @returns\n */\n isWebGl2() {\n return isWebGl2(this.gl);\n }\n /**\n * ```\n * gl.activeTexture(textureUnit + gl.TEXTURE0);\n * ```\n *\n * @remarks\n * **WebGL Difference**: `textureUnit` is based from 0, not `gl.TEXTURE0`.\n *\n * @param textureUnit\n */\n activeTexture(textureUnit) {\n const { gl } = this;\n if (this.activeTextureUnit !== textureUnit) {\n gl.activeTexture(textureUnit + gl.TEXTURE0);\n this.activeTextureUnit = textureUnit;\n }\n }\n /**\n * ```\n * gl.bindTexture(gl.TEXTURE_2D, texture);\n * ```\n * @remarks\n * **WebGL Difference**: Bind target is always `gl.TEXTURE_2D`\n *\n * @param texture\n */\n bindTexture(texture) {\n const { gl, activeTextureUnit, texture2dUnits } = this;\n if (texture2dUnits[activeTextureUnit] === texture) {\n return;\n }\n texture2dUnits[activeTextureUnit] = texture;\n gl.bindTexture(this.gl.TEXTURE_2D, texture);\n }\n _getActiveTexture() {\n const { activeTextureUnit, texture2dUnits } = this;\n return texture2dUnits[activeTextureUnit];\n }\n /**\n * ```\n * gl.texParameteri(gl.TEXTURE_2D, pname, param);\n * ```\n * @remarks\n * **WebGL Difference**: Bind target is always `gl.TEXTURE_2D`\n *\n * @param pname\n * @param param\n * @returns\n */\n texParameteri(pname, param) {\n const { gl, texture2dParams } = this;\n const activeTexture = this._getActiveTexture();\n if (!activeTexture) {\n throw new Error('No active texture');\n }\n let textureParams = texture2dParams.get(activeTexture);\n if (!textureParams) {\n textureParams = {};\n texture2dParams.set(activeTexture, textureParams);\n }\n if (textureParams[pname] === param) {\n return;\n }\n textureParams[pname] = param;\n gl.texParameteri(gl.TEXTURE_2D, pname, param);\n }\n texImage2D(level, internalFormat, widthOrFormat, heightOrType, borderOrSource, format, type, pixels) {\n const { gl } = this;\n if (format) {\n gl.texImage2D(gl.TEXTURE_2D, level, internalFormat, widthOrFormat, heightOrType, borderOrSource, format, type, pixels);\n }\n else {\n gl.texImage2D(gl.TEXTURE_2D, level, internalFormat, widthOrFormat, heightOrType, borderOrSource);\n }\n }\n /**\n * ```\n * gl.compressedTexImage2D(gl.TEXTURE_2D, level, internalFormat, width, height, border, data);\n * ```\n *\n * @remarks\n * **WebGL Difference**: Bind target is always `gl.TEXTURE_2D`\n */\n compressedTexImage2D(level, internalformat, width, height, border, data) {\n const { gl } = this;\n gl.compressedTexImage2D(gl.TEXTURE_2D, level, internalformat, width, height, border, data);\n }\n /**\n * ```\n * gl.pixelStorei(pname, param);\n * ```\n *\n * @param pname\n * @param param\n */\n pixelStorei(pname, param) {\n const { gl } = this;\n gl.pixelStorei(pname, param);\n }\n /**\n * ```\n * gl.generateMipmap(gl.TEXTURE_2D);\n * ```\n *\n * @remarks\n * **WebGL Difference**: Bind target is always `gl.TEXTURE_2D`\n */\n generateMipmap() {\n const { gl } = this;\n gl.generateMipmap(gl.TEXTURE_2D);\n }\n /**\n * ```\n * gl.createTexture();\n * ```\n *\n * @returns\n */\n createTexture() {\n const { gl } = this;\n return gl.createTexture();\n }\n /**\n * ```\n * gl.deleteTexture(texture);\n * ```\n *\n * @param texture\n */\n deleteTexture(texture) {\n const { gl } = this;\n if (texture) {\n this.texture2dParams.delete(texture);\n }\n gl.deleteTexture(texture);\n }\n /**\n * ```\n * gl.viewport(x, y, width, height);\n * ```\n */\n viewport(x, y, width, height) {\n const { gl } = this;\n gl.viewport(x, y, width, height);\n }\n /**\n * ```\n * gl.clearColor(red, green, blue, alpha);\n * ```\n *\n * @param red\n * @param green\n * @param blue\n * @param alpha\n */\n clearColor(red, green, blue, alpha) {\n const { gl } = this;\n gl.clearColor(red, green, blue, alpha);\n }\n /**\n * ```\n * gl[\"enable\"|\"disable\"](gl.SCISSOR_TEST);\n * ```\n * @param enable\n */\n setScissorTest(enable) {\n const { gl, scissorEnabled } = this;\n if (enable === scissorEnabled) {\n return;\n }\n if (enable) {\n gl.enable(gl.SCISSOR_TEST);\n }\n else {\n gl.disable(gl.SCISSOR_TEST);\n }\n this.scissorEnabled = enable;\n }\n /**\n * ```\n * gl.scissor(x, y, width, height);\n * ```\n *\n * @param x\n * @param y\n * @param width\n * @param height\n */\n scissor(x, y, width, height) {\n const { gl, scissorX, scissorY, scissorWidth, scissorHeight } = this;\n if (x !== scissorX ||\n y !== scissorY ||\n width !== scissorWidth ||\n height !== scissorHeight) {\n gl.scissor(x, y, width, height);\n this.scissorX = x;\n this.scissorY = y;\n this.scissorWidth = width;\n this.scissorHeight = height;\n }\n }\n /**\n * ```\n * gl[\"enable\"|\"disable\"](gl.BLEND);\n * ```\n *\n * @param blend\n * @returns\n */\n setBlend(blend) {\n const { gl, blendEnabled } = this;\n if (blend === blendEnabled) {\n return;\n }\n if (blend) {\n gl.enable(gl.BLEND);\n }\n else {\n gl.disable(gl.BLEND);\n }\n this.blendEnabled = blend;\n }\n /**\n * ```\n * gl.blendFunc(src, dst);\n * ```\n *\n * @param src\n * @param dst\n */\n blendFunc(src, dst) {\n const { gl, blendSrcRgb, blendDstRgb, blendSrcAlpha, blendDstAlpha } = this;\n if (src !== blendSrcRgb ||\n dst !== blendDstRgb ||\n src !== blendSrcAlpha ||\n dst !== blendDstAlpha) {\n gl.blendFunc(src, dst);\n this.blendSrcRgb = src;\n this.blendDstRgb = dst;\n this.blendSrcAlpha = src;\n this.blendDstAlpha = dst;\n }\n }\n /**\n * ```\n * createBuffer();\n * ```\n *\n * @returns\n */\n createBuffer() {\n const { gl } = this;\n return gl.createBuffer();\n }\n /**\n * ```\n * gl.clear(gl.COLOR_BUFFER_BIT);\n * ```\n *\n * @remarks\n * **WebGL Difference**: Clear mask is always `gl.COLOR_BUFFER_BIT`\n */\n clear() {\n const { gl } = this;\n gl.clear(gl.COLOR_BUFFER_BIT);\n }\n /**\n * ```\n * gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n * gl.bufferData(gl.ARRAY_BUFFER, data, usage);\n * ```\n *\n * @remarks\n * **WebGL Combo**: `gl.bindBuffer` and `gl.bufferData` are combined into one function.\n *\n * @param buffer\n * @param data\n * @param usage\n */\n arrayBufferData(buffer, data, usage) {\n const { gl, boundArrayBuffer } = this;\n if (boundArrayBuffer !== buffer) {\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n this.boundArrayBuffer = buffer;\n }\n gl.bufferData(gl.ARRAY_BUFFER, data, usage);\n }\n /**\n * ```\n * gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffer);\n * gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, data, usage);\n * ```\n * @remarks\n * **WebGL Combo**: `gl.bindBuffer` and `gl.bufferData` are combined into one function.\n *\n * @param buffer\n * @param data\n * @param usage\n */\n elementArrayBufferData(buffer, data, usage) {\n const { gl, boundElementArrayBuffer } = this;\n if (boundElementArrayBuffer !== buffer) {\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffer);\n this.boundElementArrayBuffer = buffer;\n }\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, data, usage);\n }\n /**\n * ```\n * gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n * gl.vertexAttribPointer(index, size, type, normalized, stride, offset);\n * ```\n *\n * @remarks\n * **WebGL Combo**: `gl.bindBuffer` and `gl.vertexAttribPointer` are combined into one function.\n *\n * @param buffer\n * @param index\n * @param size\n * @param type\n * @param normalized\n * @param stride\n * @param offset\n */\n vertexAttribPointer(buffer, index, size, type, normalized, stride, offset) {\n const { gl, boundArrayBuffer } = this;\n if (boundArrayBuffer !== buffer) {\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n this.boundArrayBuffer = buffer;\n }\n gl.vertexAttribPointer(index, size, type, normalized, stride, offset);\n }\n /**\n * ```\n * gl.useProgram(program);\n * ```\n *\n * @param program\n * @returns\n */\n useProgram(program) {\n const { gl, curProgram } = this;\n if (curProgram === program) {\n return;\n }\n gl.useProgram(program);\n this.curProgram = program;\n }\n setUniform(type, location, ...args) {\n const { gl, programUniforms } = this;\n let uniforms = programUniforms.get(this.curProgram);\n if (!uniforms) {\n uniforms = new Map();\n programUniforms.set(this.curProgram, uniforms);\n }\n const uniformArgs = uniforms.get(location);\n if (!uniformArgs || !compareArrays(uniformArgs, args)) {\n uniforms.set(location, args);\n gl[type](location, ...args);\n }\n }\n /**\n * ```\n * gl.getParameter(pname);\n * ```\n *\n * @param pname\n * @returns\n */\n getParameter(pname) {\n const { gl } = this;\n return gl.getParameter(pname);\n }\n /**\n * ```\n * gl.drawElements(mode, count, type, offset);\n * ```\n *\n * @param mode\n * @param count\n * @param type\n * @param offset\n */\n drawElements(mode, count, type, offset) {\n const { gl } = this;\n gl.drawElements(mode, count, type, offset);\n }\n /**\n * ```\n * gl.drawArrays(mode, first, count);\n * ```\n *\n * @param name\n * @returns\n */\n getExtension(name) {\n const { gl } = this;\n return gl.getExtension(name);\n }\n /**\n * ```\n * gl.createVertexArray();\n * ```\n *\n * @returns\n */\n createVertexArray() {\n const { gl } = this;\n assertTruthy(gl instanceof WebGL2RenderingContext);\n return gl.createVertexArray();\n }\n /**\n * ```\n * gl.bindVertexArray(vertexArray);\n * ```\n *\n * @param vertexArray\n */\n bindVertexArray(vertexArray) {\n const { gl } = this;\n assertTruthy(gl instanceof WebGL2RenderingContext);\n gl.bindVertexArray(vertexArray);\n }\n /**\n * ```\n * gl.getAttribLocation(program, name);\n * ```\n *\n * @param program\n * @param name\n * @returns\n */\n getAttribLocation(program, name) {\n const { gl } = this;\n return gl.getAttribLocation(program, name);\n }\n /**\n * ```\n * gl.getUniformLocation(program, name);\n * ```\n *\n * @param program\n * @param name\n * @returns\n */\n getUniformLocation(program, name) {\n const { gl } = this;\n return gl.getUniformLocation(program, name);\n }\n /**\n * ```\n * gl.enableVertexAttribArray(index);\n * ```\n *\n * @param index\n */\n enableVertexAttribArray(index) {\n const { gl } = this;\n gl.enableVertexAttribArray(index);\n }\n /**\n * ```\n * gl.disableVertexAttribArray(index);\n * ```\n *\n * @param index\n */\n disableVertexAttribArray(index) {\n const { gl } = this;\n gl.disableVertexAttribArray(index);\n }\n /**\n * ```\n * gl.createShader(type);\n * ```\n *\n * @param type\n * @returns\n */\n createShader(type) {\n const { gl } = this;\n return gl.createShader(type);\n }\n /**\n * ```\n * gl.compileShader(shader);\n * ```\n *\n * @param shader\n * @returns\n */\n compileShader(shader) {\n const { gl } = this;\n gl.compileShader(shader);\n }\n /**\n * ```\n * gl.attachShader(program, shader);\n * ```\n *\n * @param program\n * @param shader\n */\n attachShader(program, shader) {\n const { gl } = this;\n gl.attachShader(program, shader);\n }\n /**\n * ```\n * gl.linkProgram(program);\n * ```\n *\n * @param program\n */\n linkProgram(program) {\n const { gl } = this;\n gl.linkProgram(program);\n }\n /**\n * ```\n * gl.deleteProgram(shader);\n * ```\n *\n * @param shader\n */\n deleteProgram(shader) {\n const { gl } = this;\n gl.deleteProgram(shader);\n }\n /**\n * ```\n * gl.getShaderParameter(shader, pname);\n * ```\n *\n * @param shader\n * @param pname\n */\n getShaderParameter(shader, pname) {\n const { gl } = this;\n return gl.getShaderParameter(shader, pname);\n }\n /**\n * ```\n * gl.getShaderInfoLog(shader);\n * ```\n *\n * @param shader\n */\n getShaderInfoLog(shader) {\n const { gl } = this;\n return gl.getShaderInfoLog(shader);\n }\n /**\n * ```\n * gl.createProgram();\n * ```\n *\n * @returns\n */\n createProgram() {\n const { gl } = this;\n return gl.createProgram();\n }\n /**\n * ```\n * gl.getProgramParameter(program, pname);\n * ```\n *\n * @param program\n * @param pname\n * @returns\n */\n getProgramParameter(program, pname) {\n const { gl } = this;\n return gl.getProgramParameter(program, pname);\n }\n /**\n * ```\n * gl.getProgramInfoLog(program);\n * ```\n *\n * @param program\n * @returns\n */\n getProgramInfoLog(program) {\n const { gl } = this;\n return gl.getProgramInfoLog(program);\n }\n /**\n * ```\n * gl.shaderSource(shader, source);\n * ```\n *\n * @param shader\n * @param source\n */\n shaderSource(shader, source) {\n const { gl } = this;\n gl.shaderSource(shader, source);\n }\n /**\n * ```\n * gl.deleteShader(shader);\n * ```\n *\n * @param shader\n */\n deleteShader(shader) {\n const { gl } = this;\n gl.deleteShader(shader);\n }\n}\n/**\n * Compare two arrays for equality.\n *\n * @remarks\n * This function will not try to compare nested arrays or Float32Arrays and\n * instead will always return false when they are encountered.\n *\n * @param a\n * @param b\n * @returns\n */\nexport function compareArrays(a, b) {\n if (a.length !== b.length) {\n return false;\n }\n return a.every((v, i) => {\n // Don't bother to compare nested arrays or Float32Arrays\n if (Array.isArray(v) || v instanceof Float32Array) {\n return false;\n }\n else {\n return v === b[i];\n }\n });\n}\n//# sourceMappingURL=WebGlContextWrapper.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Generic WebGL Utility Functions\n *\n * @remarks\n * Nothing here should be coupled to Renderer logic / types.\n *\n * @param gl\n * @returns\n */\nexport function isWebGl2(gl) {\n return (self.WebGL2RenderingContext && gl instanceof self.WebGL2RenderingContext);\n}\n//# sourceMappingURL=WebGlUtils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy, createWebGLContext, hasOwn, mergeColorAlphaPremultiplied, } from '../../../utils.js';\nimport { CoreRenderer } from '../CoreRenderer.js';\nimport { WebGlCoreRenderOp } from './WebGlCoreRenderOp.js';\nimport { createIndexBuffer, getWebGlParameters, getWebGlExtensions, } from './internal/RendererUtils.js';\nimport { WebGlCoreCtxTexture } from './WebGlCoreCtxTexture.js';\nimport { Texture } from '../../textures/Texture.js';\nimport { ColorTexture } from '../../textures/ColorTexture.js';\nimport { SubTexture } from '../../textures/SubTexture.js';\nimport { WebGlCoreCtxSubTexture } from './WebGlCoreCtxSubTexture.js';\nimport { CoreShaderManager } from '../../CoreShaderManager.js';\nimport { BufferCollection } from './internal/BufferCollection.js';\nimport { compareRect, getNormalizedRgbaComponents, } from '../../lib/utils.js';\nimport { WebGlCoreShader } from './WebGlCoreShader.js';\nimport { RoundedRectangle } from './shaders/RoundedRectangle.js';\nimport { ContextSpy } from '../../lib/ContextSpy.js';\nimport { WebGlContextWrapper } from '../../lib/WebGlContextWrapper.js';\nconst WORDS_PER_QUAD = 24;\nconst BYTES_PER_QUAD = WORDS_PER_QUAD * 4;\nexport class WebGlCoreRenderer extends CoreRenderer {\n //// WebGL Native Context and Data\n glw;\n system;\n //// Core Managers\n txManager;\n txMemManager;\n shManager;\n //// Options\n options;\n //// Persistent data\n quadBuffer = new ArrayBuffer(1024 * 1024 * 4);\n fQuadBuffer = new Float32Array(this.quadBuffer);\n uiQuadBuffer = new Uint32Array(this.quadBuffer);\n renderOps = [];\n //// Render Op / Buffer Filling State\n curBufferIdx = 0;\n curRenderOp = null;\n renderables = [];\n //// Default Shader\n defaultShader;\n quadBufferCollection;\n /**\n * White pixel texture used by default when no texture is specified.\n */\n defaultTexture;\n constructor(options) {\n super(options.stage);\n const { canvas, clearColor, bufferMemory } = options;\n this.options = options;\n this.txManager = options.txManager;\n this.txMemManager = options.txMemManager;\n this.shManager = options.shManager;\n this.defaultTexture = new ColorTexture(this.txManager);\n // When the default texture is loaded, request a render in case the\n // RAF is paused. Fixes: https://github.com/lightning-js/renderer/issues/123\n this.defaultTexture.once('loaded', () => {\n this.stage.requestRender();\n });\n const gl = createWebGLContext(canvas, options.contextSpy);\n const glw = (this.glw = new WebGlContextWrapper(gl));\n const color = getNormalizedRgbaComponents(clearColor);\n glw.viewport(0, 0, canvas.width, canvas.height);\n glw.clearColor(color[0], color[1], color[2], color[3]);\n glw.setBlend(true);\n glw.blendFunc(glw.ONE, glw.ONE_MINUS_SRC_ALPHA);\n createIndexBuffer(glw, bufferMemory);\n this.system = {\n parameters: getWebGlParameters(this.glw),\n extensions: getWebGlExtensions(this.glw),\n };\n this.shManager.renderer = this;\n this.defaultShader = this.shManager.loadShader('DefaultShader').shader;\n const quadBuffer = glw.createBuffer();\n assertTruthy(quadBuffer);\n const stride = 6 * Float32Array.BYTES_PER_ELEMENT;\n this.quadBufferCollection = new BufferCollection([\n {\n buffer: quadBuffer,\n attributes: {\n a_position: {\n name: 'a_position',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 0, // start at the beginning of the buffer\n },\n a_textureCoordinate: {\n name: 'a_textureCoordinate',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 2 * Float32Array.BYTES_PER_ELEMENT,\n },\n a_color: {\n name: 'a_color',\n size: 4,\n type: glw.UNSIGNED_BYTE,\n normalized: true,\n stride,\n offset: 4 * Float32Array.BYTES_PER_ELEMENT,\n },\n a_textureIndex: {\n name: 'a_textureIndex',\n size: 1,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 5 * Float32Array.BYTES_PER_ELEMENT,\n },\n },\n },\n ]);\n }\n reset() {\n const { glw } = this;\n this.curBufferIdx = 0;\n this.curRenderOp = null;\n this.renderOps.length = 0;\n glw.setScissorTest(false);\n glw.clear();\n }\n getShaderManager() {\n return this.shManager;\n }\n createCtxTexture(textureSource) {\n if (textureSource instanceof SubTexture) {\n return new WebGlCoreCtxSubTexture(this.glw, this.txMemManager, textureSource);\n }\n return new WebGlCoreCtxTexture(this.glw, this.txMemManager, textureSource);\n }\n /**\n * This function adds a quad (a rectangle composed of two triangles) to the WebGL rendering pipeline.\n *\n * It takes a set of options that define the quad's properties, such as its dimensions, colors, texture, shader, and transformation matrix.\n * The function first updates the shader properties with the current dimensions if necessary, then sets the default texture if none is provided.\n * It then checks if a new render operation is needed, based on the current shader and clipping rectangle.\n * If a new render operation is needed, it creates one and updates the current render operation.\n * The function then adjusts the texture coordinates based on the texture options and adds the texture to the texture manager.\n *\n * Finally, it calculates the vertices for the quad, taking into account any transformations, and adds them to the quad buffer.\n * The function updates the length and number of quads in the current render operation, and updates the current buffer index.\n */\n addQuad(params) {\n const { fQuadBuffer, uiQuadBuffer } = this;\n const { width, height, colorTl, colorTr, colorBl, colorBr, textureOptions, shader, shaderProps, alpha, clippingRect, tx, ty, ta, tb, tc, td, } = params;\n let { texture } = params;\n /**\n * If the shader props contain any automatic properties, update it with the\n * current dimensions that will be used to render the quad.\n */\n if (shaderProps && hasOwn(shaderProps, '$dimensions')) {\n const dimensions = shaderProps.$dimensions;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n dimensions.width = width;\n dimensions.height = height;\n }\n texture = texture ?? this.defaultTexture;\n assertTruthy(texture instanceof Texture, 'Invalid texture type');\n let { curBufferIdx: bufferIdx, curRenderOp } = this;\n const targetDims = {\n width,\n height,\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n };\n const targetShader = shader || this.defaultShader;\n assertTruthy(targetShader instanceof WebGlCoreShader);\n if (curRenderOp) {\n // If the current render op is not the same shader, create a new one\n // If the current render op's shader props are not compatible with the\n // the new shader props, create a new one render op.\n if (curRenderOp.shader !== targetShader ||\n !compareRect(curRenderOp.clippingRect, clippingRect) ||\n (curRenderOp.shader !== this.defaultShader &&\n (!shaderProps ||\n !curRenderOp.shader.canBatchShaderProps(curRenderOp.shaderProps, shaderProps)))) {\n curRenderOp = null;\n }\n }\n assertTruthy(targetShader instanceof WebGlCoreShader);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any\n if (!curRenderOp) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n this.newRenderOp(targetShader, shaderProps, alpha, targetDims, clippingRect, bufferIdx);\n curRenderOp = this.curRenderOp;\n assertTruthy(curRenderOp);\n }\n const flipX = textureOptions?.flipX ?? false;\n const flipY = textureOptions?.flipY ?? false;\n let texCoordX1 = 0;\n let texCoordY1 = 0;\n let texCoordX2 = 1;\n let texCoordY2 = 1;\n if (texture instanceof SubTexture) {\n const { x: tx, y: ty, width: tw, height: th } = texture.props;\n const { width: parentW = 0, height: parentH = 0 } = texture.parentTexture\n .dimensions || { width: 0, height: 0 };\n texCoordX1 = tx / parentW;\n texCoordX2 = texCoordX1 + tw / parentW;\n texCoordY1 = ty / parentH;\n texCoordY2 = texCoordY1 + th / parentH;\n texture = texture.parentTexture;\n }\n // Flip texture coordinates if dictated by texture options\n if (flipX) {\n [texCoordX1, texCoordX2] = [texCoordX2, texCoordX1];\n }\n if (flipY) {\n [texCoordY1, texCoordY2] = [texCoordY2, texCoordY1];\n }\n const { txManager } = this.stage;\n const ctxTexture = txManager.getCtxTexture(texture);\n assertTruthy(ctxTexture instanceof WebGlCoreCtxTexture);\n const textureIdx = this.addTexture(ctxTexture, bufferIdx);\n curRenderOp = this.curRenderOp;\n assertTruthy(curRenderOp);\n // render quad advanced\n if (tb !== 0 || tc !== 0) {\n // Upper-Left\n fQuadBuffer[bufferIdx++] = tx; // vertexX\n fQuadBuffer[bufferIdx++] = ty; // vertexY\n fQuadBuffer[bufferIdx++] = texCoordX1; // texCoordX\n fQuadBuffer[bufferIdx++] = texCoordY1; // texCoordY\n uiQuadBuffer[bufferIdx++] = colorTl; // color\n fQuadBuffer[bufferIdx++] = textureIdx; // texIndex\n // Upper-Right\n fQuadBuffer[bufferIdx++] = tx + width * ta;\n fQuadBuffer[bufferIdx++] = ty + width * tc;\n fQuadBuffer[bufferIdx++] = texCoordX2;\n fQuadBuffer[bufferIdx++] = texCoordY1;\n uiQuadBuffer[bufferIdx++] = colorTr;\n fQuadBuffer[bufferIdx++] = textureIdx;\n // Lower-Left\n fQuadBuffer[bufferIdx++] = tx + height * tb;\n fQuadBuffer[bufferIdx++] = ty + height * td;\n fQuadBuffer[bufferIdx++] = texCoordX1;\n fQuadBuffer[bufferIdx++] = texCoordY2;\n uiQuadBuffer[bufferIdx++] = colorBl;\n fQuadBuffer[bufferIdx++] = textureIdx;\n // Lower-Right\n fQuadBuffer[bufferIdx++] = tx + width * ta + height * tb;\n fQuadBuffer[bufferIdx++] = ty + width * tc + height * td;\n fQuadBuffer[bufferIdx++] = texCoordX2;\n fQuadBuffer[bufferIdx++] = texCoordY2;\n uiQuadBuffer[bufferIdx++] = colorBr;\n fQuadBuffer[bufferIdx++] = textureIdx;\n }\n else {\n // Calculate the right corner of the quad\n // multiplied by the scale\n const rightCornerX = tx + width * ta;\n const rightCornerY = ty + height * td;\n // Upper-Left\n fQuadBuffer[bufferIdx++] = tx; // vertexX\n fQuadBuffer[bufferIdx++] = ty; // vertexY\n fQuadBuffer[bufferIdx++] = texCoordX1; // texCoordX\n fQuadBuffer[bufferIdx++] = texCoordY1; // texCoordY\n uiQuadBuffer[bufferIdx++] = colorTl; // color\n fQuadBuffer[bufferIdx++] = textureIdx; // texIndex\n // Upper-Right\n fQuadBuffer[bufferIdx++] = rightCornerX;\n fQuadBuffer[bufferIdx++] = ty;\n fQuadBuffer[bufferIdx++] = texCoordX2;\n fQuadBuffer[bufferIdx++] = texCoordY1;\n uiQuadBuffer[bufferIdx++] = colorTr;\n fQuadBuffer[bufferIdx++] = textureIdx;\n // Lower-Left\n fQuadBuffer[bufferIdx++] = tx;\n fQuadBuffer[bufferIdx++] = rightCornerY;\n fQuadBuffer[bufferIdx++] = texCoordX1;\n fQuadBuffer[bufferIdx++] = texCoordY2;\n uiQuadBuffer[bufferIdx++] = colorBl;\n fQuadBuffer[bufferIdx++] = textureIdx;\n // Lower-Right\n fQuadBuffer[bufferIdx++] = rightCornerX;\n fQuadBuffer[bufferIdx++] = rightCornerY;\n fQuadBuffer[bufferIdx++] = texCoordX2;\n fQuadBuffer[bufferIdx++] = texCoordY2;\n uiQuadBuffer[bufferIdx++] = colorBr;\n fQuadBuffer[bufferIdx++] = textureIdx;\n }\n // Update the length of the current render op\n curRenderOp.length += WORDS_PER_QUAD;\n curRenderOp.numQuads++;\n this.curBufferIdx = bufferIdx;\n }\n /**\n * Replace the existing RenderOp with a new one that uses the specified Shader\n * and starts at the specified buffer index.\n *\n * @param shader\n * @param bufferIdx\n */\n newRenderOp(shader, shaderProps, alpha, dimensions, clippingRect, bufferIdx) {\n const curRenderOp = new WebGlCoreRenderOp(this.glw, this.options, this.quadBufferCollection, shader, shaderProps, alpha, clippingRect, dimensions, bufferIdx, 0);\n this.curRenderOp = curRenderOp;\n this.renderOps.push(curRenderOp);\n }\n /**\n * Add a texture to the current RenderOp. If the texture cannot be added to the\n * current RenderOp, a new RenderOp will be created and the texture will be added\n * to that one.\n *\n * If the texture cannot be added to the new RenderOp, an error will be thrown.\n *\n * @param texture\n * @param bufferIdx\n * @param recursive\n * @returns Assigned Texture Index of the texture in the render op\n */\n addTexture(texture, bufferIdx, recursive) {\n const { curRenderOp } = this;\n assertTruthy(curRenderOp);\n const textureIdx = curRenderOp.addTexture(texture);\n // TODO: Refactor to be more DRY\n if (textureIdx === 0xffffffff) {\n if (recursive) {\n throw new Error('Unable to add texture to render op');\n }\n const { shader, shaderProps, dimensions, clippingRect, alpha } = curRenderOp;\n this.newRenderOp(shader, shaderProps, alpha, dimensions, clippingRect, bufferIdx);\n return this.addTexture(texture, bufferIdx, true);\n }\n return textureIdx;\n }\n /**\n * add RenderOp to the render pipeline\n */\n addRenderOp(renderable) {\n this.renderOps.push(renderable);\n this.curRenderOp = null;\n }\n /**\n * Render the current set of RenderOps to render to the specified surface.\n *\n * TODO: 'screen' is the only supported surface at the moment.\n *\n * @param surface\n */\n render(surface = 'screen') {\n const { glw, quadBuffer } = this;\n const arr = new Float32Array(quadBuffer, 0, this.curBufferIdx);\n const buffer = this.quadBufferCollection.getBuffer('a_position') ?? null;\n glw.arrayBufferData(buffer, arr, glw.STATIC_DRAW);\n const doLog = false; // idx++ % 100 === 0;\n if (doLog) {\n console.log('renderOps', this.renderOps.length);\n }\n this.renderOps.forEach((renderOp, i) => {\n if (doLog) {\n console.log('renderOp', i, renderOp.numQuads);\n }\n renderOp.draw();\n });\n // clean up\n this.renderables = [];\n }\n}\nconst idx = 0;\n//# sourceMappingURL=WebGlCoreRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport const SpecialCodepoints = {\n LINE_FEED: 0x0a,\n CARRIAGE_RETURN: 0x0d,\n SPACE: 0x20,\n TAB: 0x09,\n ZERO_WIDTH_SPACE: 0x200b,\n ZERO_WIDTH_NON_JOINER: 0x200c,\n ZERO_WIDTH_JOINER: 0x200d,\n LEFT_TO_RIGHT_MARK: 0x200e,\n RIGHT_TO_LEFT_MARK: 0x200f,\n LEFT_TO_RIGHT_EMBEDDING: 0x202a,\n RIGHT_TO_LEFT_EMBEDDING: 0x202b,\n POP_DIRECTIONAL_FORMATTING: 0x202c,\n LEFT_TO_RIGHT_OVERRIDE: 0x202d,\n RIGHT_TO_LEFT_OVERRIDE: 0x202e,\n LINE_SEPARATOR: 0x2028,\n PARAGRAPH_SEPARATOR: 0x2029,\n OBJECT_REPLACEMENT_CHARACTER: 0xfffc,\n REPLACEMENT_CHARACTER: 0xfffd,\n ZERO_WIDTH_NO_BREAK_SPACE: 0xfeff,\n LEFT_TO_RIGHT_ISOLATE: 0x2066,\n RIGHT_TO_LEFT_ISOLATE: 0x2067,\n FIRST_STRONG_ISOLATE: 0x2068,\n POP_DIRECTIONAL_ISOLATE: 0x2069,\n INHIBIT_SYMMETRIC_SWAPPING: 0x206a,\n ACTIVATE_SYMMETRIC_SWAPPING: 0x206b,\n INHIBIT_ARABIC_FORM_SHAPING: 0x206c,\n ACTIVATE_ARABIC_FORM_SHAPING: 0x206d,\n NATIONAL_DIGIT_SHAPES: 0x206e,\n NOMINAL_DIGIT_SHAPES: 0x206f,\n LEFT_TO_RIGHT_BOUNDARY: 0x200e,\n RIGHT_TO_LEFT_BOUNDARY: 0x200f,\n};\n//# sourceMappingURL=SpecialCodepoints.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { SpecialCodepoints } from '../../../renderers/SdfTextRenderer/internal/SpecialCodepoints.js';\nimport { FontShaper, } from './FontShaper.js';\nexport class SdfFontShaper extends FontShaper {\n data;\n glyphMap;\n kernings;\n constructor(data, glyphMap) {\n super();\n this.data = data;\n this.glyphMap = glyphMap;\n const kernings = (this.kernings = {});\n data.kernings.forEach((kerning) => {\n const second = kerning.second;\n const firsts = (kernings[second] = kernings[second] || {});\n firsts[kerning.first] = kerning.amount;\n });\n this.kernings = kernings;\n }\n *shapeText(props, codepoints) {\n let codepointResult;\n let lastGlyphId = undefined;\n while ((codepointResult = codepoints.peek()) && !codepointResult.done) {\n const codepoint = codepointResult.value;\n const glyph = this.glyphMap.get(codepoint);\n codepoints.next();\n if (glyph !== undefined) {\n // We found a glyph for this codepoint\n // Yield the mapped glyph info\n /**\n * Kerning includes any possible additional letter spacing\n */\n const kerning = lastGlyphId !== undefined\n ? (this.kernings[glyph.id]?.[lastGlyphId] || 0) +\n props.letterSpacing\n : 0;\n lastGlyphId = glyph.id;\n yield {\n mapped: true,\n glyphId: glyph.id,\n codepoint,\n cluster: codepoints.lastIndex,\n xAdvance: glyph.xadvance + kerning,\n yAdvance: 0,\n xOffset: glyph.xoffset + kerning,\n yOffset: glyph.yoffset,\n xBearing: 0,\n yBearing: 0,\n width: glyph.width,\n height: glyph.height,\n };\n }\n else {\n // We didn't find a glyph for this codepoint\n // Yield the unmapped codepoint info\n // If this codepoint is a linebreak, we should reset the last glyph id\n // so that the next glyph will not be kerned with the last glyph of the\n // previous line.\n if (codepoint === SpecialCodepoints.LINE_FEED) {\n lastGlyphId = undefined;\n }\n yield {\n mapped: false,\n codepoint,\n cluster: codepoints.lastIndex,\n };\n }\n }\n }\n}\n//# sourceMappingURL=SdfFontShaper.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class FontShaper {\n}\n//# sourceMappingURL=FontShaper.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// import type { Renderer } from '../../../Renderer';\nimport { assertTruthy } from '../../../../utils.js';\nimport { WebGlCoreRenderer } from '../../../renderers/webgl/WebGlCoreRenderer.js';\nimport { ImageTexture } from '../../../textures/ImageTexture.js';\nimport { TrFontFace } from '../TrFontFace.js';\nimport { SdfFontShaper } from './internal/SdfFontShaper.js';\nexport class SdfTrFontFace extends TrFontFace {\n type;\n texture;\n /**\n * Height of the tallest character in the font including the whitespace above it\n */\n maxCharHeight = 0;\n data;\n shaper;\n glyphMap = new Map();\n constructor(fontFamily, descriptors, type, stage, atlasUrl, atlasDataUrl) {\n super(fontFamily, descriptors);\n this.type = type;\n const renderer = stage.renderer;\n assertTruthy(renderer instanceof WebGlCoreRenderer, 'SDF Font Faces can only be used with the WebGL Renderer');\n this.texture = stage.txManager.loadTexture('ImageTexture', {\n src: atlasUrl,\n // IMPORTANT: The SDF shader requires the alpha channel to NOT be\n // premultiplied on the atlas texture. If it is premultiplied, the\n // rendering of SDF glyphs (especially single-channel SDF fonts) will\n // be very jagged.\n premultiplyAlpha: false,\n }, {\n preload: true,\n });\n this.texture.on('loaded', () => {\n this.checkLoaded();\n });\n // Set this.data to the fetched data from dataUrl\n fetch(atlasDataUrl)\n .then(async (response) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n this.data = await response.json();\n // Add all the glyphs to the glyph map\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n let maxCharHeight = 0;\n this.data.chars.forEach((glyph) => {\n this.glyphMap.set(glyph.id, glyph);\n const charHeight = glyph.yoffset + glyph.height;\n if (charHeight > maxCharHeight) {\n maxCharHeight = charHeight;\n }\n });\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.maxCharHeight = maxCharHeight;\n // We know `data` is defined here, because we just set it\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.shaper = new SdfFontShaper(this.data, this.glyphMap);\n this.checkLoaded();\n })\n .catch(console.error);\n }\n getAtlasEntry(glyphId) {\n const glyph = this.glyphMap.get(glyphId);\n if (glyph === undefined) {\n throw new Error(`Glyph ${glyphId} not found in font ${this.fontFamily}`);\n }\n return {\n x: glyph.x,\n y: glyph.y,\n width: glyph.width,\n height: glyph.height,\n };\n }\n checkLoaded() {\n if (this.loaded)\n return;\n if (this.texture.state === 'loaded' && this.data) {\n this.loaded = true;\n this.emit('loaded');\n }\n }\n}\n//# sourceMappingURL=SdfTrFontFace.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Base class for Core extensions.\n *\n * @remarks\n * Core extensions are used to extend the Core Renderer with custom code such as\n * custom fonts, custom shaders, custom textures, custom animation functions,\n * and more.\n */\nexport class CoreExtension {\n}\n//# sourceMappingURL=CoreExtension.js.map"],"names":["assertTruthy","condition","message","hasOwn","obj","prop","Object","prototype","hasOwnProperty","call","isProductionEnvironment","BASE_URL","MODE","DEV","PROD","SSR","LEGACY","a","b","out","intersection","createBound","Math","max","x1","y1","min","x2","y2","x","y","width","height","rgba","color","r","floor","g","concat","toFixed","bound","alpha","flipEndianess","arguments","length","undefined","newAlpha","trunc","rgba1","rgba2","p","r1","g1","b1","a1","r2","g2","b2","a2","round","bound1","bound2","EventEmitter","_createClass","_classCallCheck","this","_defineProperty","key","value","event","listener","listeners","eventListeners","push","index","indexOf","splice","_this","on","onceListener","target","data","off","_this2","_toConsumableArray","forEach","exports","createShader","glw","type","source","shader","Error","shaderSource","compileShader","getShaderParameter","COMPILE_STATUS","console","log","getShaderInfoLog","deleteShader","WebGlCoreShader","_CoreShader","options","_this3","_callSuper","renderer","supportsIndexedTextures","webGl2","isWebGl2","requiredExtensions","webgl2Extensions","webgl1Extensions","glVersion","extensionName","getExtension","constructor","name","shaderSources","fragment","vertex","textureUnits","system","parameters","MAX_VERTEX_TEXTURE_IMAGE_UNITS","vertexSource","Function","fragmentSource","vertexShader","VERTEX_SHADER","fragmentShader","FRAGMENT_SHADER","program","createProgram","attachShader","linkProgram","getProgramParameter","LINK_STATUS","getProgramInfoLog","deleteProgram","vao","createVertexArray","bindVertexArray","attributeLocations","attributeBuffers","attributeNames","attributes","attributeName","location","getAttribLocation","buffer","createBuffer","uniformLocations","uniformTypes","uniforms","uniform","getUniformLocation","warn","_inherits","attribute","enableVertexAttribArray","vertexAttribPointer","size","normalized","stride","offset","disableVertexAttribArray","loc","disableAttribute","boundBufferCollection","propsA","propsB","renderOp","props","bindBufferCollection","buffers","textures","bindTextures","setUniform","canvas","pixelRatio","dimensions","$dimensions","$alpha","bindProps","_this$glw","_len","Array","_key","apply","resolvedBuffer","getBuffer","resolvedInfo","getAttributeInfo","bindBufferAttribute","useProgram","disableAttributes","CoreShader","Texture","_EventEmitter2","txManager","_this4","Set","owner","renderable","renderableOwners","add","delete","get","state","_len2","args","_key2","loadedArgs","failedArgs","error","emit","getNormalizedRgbaComponents","TrFontFace","_EventEmitter3","fontFamily","descriptors","_this5","_objectSpread","style","weight","stretch","unicodeRange","variant","featureSettings","display","_TrFontFace2","WebTrFontFace","fontUrl","_this6","fontUrlWithoutParentheses","replace","determinedDescriptors","cssDescriptors","fontFace","FontFace","load","then","loaded","catch","CoreContextTexture","memManager","textureSource","CoreRenderer","stage","WebGlCoreRenderOp","_CoreRenderOp","shaderProps","clippingRect","bufferIdx","zIndex","_this7","maxTextures","getParameter","texture","existingIdx","findIndex","t","newIdx","shManager","useShader","bindRenderOp","quadIdx","valid","_this$clippingRect","canvasHeight","clipX","clipWidth","clipHeight","clipY","setScissorTest","scissor","drawElements","TRIANGLES","numQuads","UNSIGNED_SHORT","CoreRenderOp","getWebGlParameters","params","MAX_RENDERBUFFER_SIZE","MAX_TEXTURE_SIZE","MAX_VIEWPORT_DIMS","MAX_TEXTURE_IMAGE_UNITS","MAX_COMBINED_TEXTURE_IMAGE_UNITS","MAX_VERTEX_ATTRIBS","MAX_VARYING_VECTORS","MAX_VERTEX_UNIFORM_VECTORS","MAX_FRAGMENT_UNIFORM_VECTORS","keys","getWebGlExtensions","extensions","ANGLE_instanced_arrays","WEBGL_compressed_texture_s3tc","WEBGL_compressed_texture_astc","WEBGL_compressed_texture_etc","WEBGL_compressed_texture_etc1","WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc","WEBGL_compressed_texture_s3tc_srgb","OES_vertex_array_object","memize","fn","head","tail","memoized","i","node","len","searchCache","next","prev","val","maxSize","clear","isPowerOfTwo","getTimingBezier","c","d","xc","xb","xa","yc","yb","ya","time","cbxd","dx","it","minT","maxT","memo","str","s","parts","substr","split","parseFloat","isNaN","hypot","_len3","_key3","sqrt","TRANSPARENT_TEXTURE_DATA","Uint8Array","WebGlCoreCtxTexture","_CoreContextTexture2","_this8","_state","_nativeCtxTexture","_w","_h","_this9","setState","createNativeCtxTexture","onLoadRequest","_ref","err","_onLoadRequest","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_this$textureSource","textureData","_mipmaps$","_textureData$data","mipmaps","_textureData$data$wid","_width","_textureData$data$hei","_height","glInternalFormat","view","wrap","_callee$","_context","activeTexture","bindTexture","texParameteri","TEXTURE_MAG_FILTER","LINEAR","TEXTURE_MIN_FILTER","TEXTURE_WRAP_S","CLAMP_TO_EDGE","TEXTURE_WRAP_T","texImage2D","RGBA","UNSIGNED_BYTE","setTextureMemUse","byteLength","getTextureData","sent","abrupt","ImageBitmap","ImageData","pixelStorei","UNPACK_PREMULTIPLY_ALPHA_WEBGL","premultiplyAlpha","generateMipmap","DataView","ArrayBuffer","compressedTexImage2D","stop","deleteTexture","nativeTexture","createTexture","ColorTexture","_Texture2","_this10","resolveDefaults","set","_getTextureData","_callee2","pixelData32","pixelData8","_context2","Uint32Array","Uint8ClampedArray","resolvedProps","SubTexture","_Texture3","_this11","parentTexture","loadTexture","txType","queueMicrotask","parentTx","onParentTxLoaded","onParentTxFailed","_getTextureData2","_callee3","_context3","WebGlCoreCtxSubTexture","_WebGlCoreCtxTexture2","_onLoadRequest2","_callee4","_props$data","_props$data2","_callee4$","_context4","BufferCollection","config","_this$config$find","find","item","_this$config$find2","WebGlContextWrapper","gl","_this12","WeakMap","activeTextureUnit","ACTIVE_TEXTURE","TEXTURE0","maxTextureUnits","texture2dUnits","fill","map","_","TEXTURE_BINDING_2D","scissorEnabled","isEnabled","SCISSOR_TEST","scissorBox","SCISSOR_BOX","scissorX","scissorY","scissorWidth","scissorHeight","blendEnabled","BLEND","blendSrcRgb","BLEND_SRC_RGB","blendDstRgb","BLEND_DST_RGB","blendSrcAlpha","BLEND_SRC_ALPHA","blendDstAlpha","BLEND_DST_ALPHA","boundArrayBuffer","ARRAY_BUFFER_BINDING","boundElementArrayBuffer","ELEMENT_ARRAY_BUFFER_BINDING","curProgram","CURRENT_PROGRAM","FLOAT","ONE","ONE_MINUS_SRC_ALPHA","STATIC_DRAW","DYNAMIC_DRAW","self","WebGL2RenderingContext","textureUnit","TEXTURE_2D","pname","param","texture2dParams","_getActiveTexture","textureParams","level","internalFormat","widthOrFormat","heightOrType","borderOrSource","format","pixels","internalformat","border","viewport","red","green","blue","clearColor","enable","disable","blend","src","dst","blendFunc","COLOR_BUFFER_BIT","usage","bindBuffer","ARRAY_BUFFER","bufferData","ELEMENT_ARRAY_BUFFER","programUniforms","Map","uniformArgs","_len4","_key4","every","v","isArray","Float32Array","compareArrays","mode","count","vertexArray","WebGlCoreRenderer","_CoreRenderer2","_this13","quadBuffer","bufferMemory","txMemManager","defaultTexture","once","requestRender","contextSpy","antialias","depth","stencil","desynchronized","powerPreference","premultipliedAlpha","preserveDrawingBuffer","getContext","Proxy","increment","String","bind","createWebGLContext","setBlend","maxQuads","indices","Uint16Array","j","elementArrayBufferData","createIndexBuffer","defaultShader","loadShader","BYTES_PER_ELEMENT","quadBufferCollection","a_position","a_textureCoordinate","a_color","a_textureIndex","curBufferIdx","curRenderOp","renderOps","_texture","_textureOptions$flipX","_textureOptions$flipY","fQuadBuffer","uiQuadBuffer","colorTl","colorTr","colorBl","colorBr","textureOptions","tx","ty","ta","tb","tc","td","targetDims","targetShader","canBatchShaderProps","newRenderOp","flipX","flipY","texCoordX1","texCoordY1","texCoordX2","texCoordY2","_texture$props","tw","th","_ref2","_ref2$width","parentW","_ref2$height","parentH","_ref3","_ref4","ctxTexture","getCtxTexture","textureIdx","addTexture","rightCornerX","rightCornerY","recursive","_this$quadBufferColle","arr","arrayBufferData","draw","renderables","SpecialCodepoints","SdfFontShaper","_FontShaper","glyphMap","_this14","kernings","kerning","second","first","amount","shapeText","codepoints","codepointResult","lastGlyphId","codepoint","glyph","_this$kernings$glyph$","shapeText$","_context5","peek","done","id","letterSpacing","mapped","glyphId","cluster","lastIndex","xAdvance","xadvance","yAdvance","xOffset","xoffset","yOffset","yoffset","xBearing","yBearing","FontShaper","SdfTrFontFace","_TrFontFace3","atlasUrl","atlasDataUrl","_this15","preload","checkLoaded","fetch","_ref5","_callee5","response","maxCharHeight","_context6","json","chars","charHeight","shaper","_x","CoreExtension"],"mappings":"2tTAkEgB,SAAAA,EAAaC,EAAWC,GAMxC,CA2FgB,SAAAC,EAAOC,EAAKC,GACxB,OAAOC,OAAOC,UAAUC,eAAeC,KAA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mB,MACbC,OAAQsmB,EAAMtmB,OAErB,GAAA,CAAAmC,IAAAC,cAAAA,MACD,WACQH,KAAKkL,QAEkB,WAAvBlL,KAAKkM,QAAQlD,OAAsBhJ,KAAKgB,OACxChB,KAAKkL,QAAS,EACdlL,KAAKuJ,KAAK,UAEjB,IAvE8BE,CAAT,CAASA,GAwEnCpI,EAAA,IAAAskB,GCrEAtkB,EAAA,IAD0BvB,YAAA+mB,IAAA9mB,EAAAC,KAAA6mB,EAAA","x_google_ignoreList":[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]} \ No newline at end of file diff --git a/assets/CoreExtension-legacy-Djp23FNT.js b/assets/CoreExtension-legacy-Djp23FNT.js new file mode 100644 index 0000000..e69f1aa --- /dev/null +++ b/assets/CoreExtension-legacy-Djp23FNT.js @@ -0,0 +1,2 @@ +!function(){function t(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t=function(){return r};var e,r={},i=Object.prototype,n=i.hasOwnProperty,s=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",h=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(e){c=function(t,e,r){return t[e]=r}}function d(t,e,r,i){var n=e&&e.prototype instanceof x?e:x,a=Object.create(n.prototype),o=new U(i||[]);return s(a,"_invoke",{value:S(t,r,o)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}r.wrap=d;var f="suspendedStart",g="suspendedYield",v="executing",E="completed",p={};function x(){}function T(){}function _(){}var m={};c(m,o,(function(){return this}));var A=Object.getPrototypeOf,R=A&&A(A(N([])));R&&R!==i&&n.call(R,o)&&(m=R);var y=_.prototype=x.prototype=Object.create(m);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function r(i,s,a,o){var h=l(t[i],t,s);if("throw"!==h.type){var u=h.arg,c=u.value;return c&&"object"==typeof c&&n.call(c,"__await")?e.resolve(c.__await).then((function(t){r("next",t,a,o)}),(function(t){r("throw",t,a,o)})):e.resolve(c).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,o)}))}o(h.arg)}var i;s(this,"_invoke",{value:function(t,n){function s(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(s,s):s()}})}function S(t,r,i){var n=f;return function(s,a){if(n===v)throw Error("Generator is already running");if(n===E){if("throw"===s)throw a;return{value:e,done:!0}}for(i.method=s,i.arg=a;;){var o=i.delegate;if(o){var h=M(o,i);if(h){if(h===p)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(n===f)throw n=E,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);n=v;var u=l(t,r,i);if("normal"===u.type){if(n=i.done?E:g,u.arg===p)continue;return{value:u.arg,done:i.done}}"throw"===u.type&&(n=E,i.method="throw",i.arg=u.arg)}}}function M(t,r){var i=r.method,n=t.iterator[i];if(n===e)return r.delegate=null,"throw"===i&&t.iterator.return&&(r.method="return",r.arg=e,M(t,r),"throw"===r.method)||"return"!==i&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+i+"' method")),p;var s=l(n,t.iterator,r.arg);if("throw"===s.type)return r.method="throw",r.arg=s.arg,r.delegate=null,p;var a=s.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,p):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,p)}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function U(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,s=function r(){for(;++i=0;--s){var a=this.tryEntries[s],o=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var h=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(h&&u){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var i=r.completion;if("throw"===i.type){var n=i.arg;L(r)}return n}}throw Error("illegal catch attempt")},delegateYield:function(t,r,i){return this.delegate={iterator:N(t),resultName:r,nextLoc:i},"next"===this.method&&(this.arg=e),p}},r}function e(t,e,r,i,n,s,a){try{var o=t[s](a),h=o.value}catch(u){return void r(u)}o.done?e(h):Promise.resolve(h).then(i,n)}function r(t){return function(){var r=this,i=arguments;return new Promise((function(n,s){var a=t.apply(r,i);function o(t){e(a,n,s,o,h,"next",t)}function h(t){e(a,n,s,o,h,"throw",t)}o(void 0)}))}}function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function n(t,e,r){var i;return(e="symbol"==typeof(i=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(e,"string"))?i:i+"")in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}System.register([],(function(e,s){"use strict";return{execute:function(){function s(t,e){}function a(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function o(){return{BASE_URL:"/solid-demo-app/",MODE:"production",DEV:!1,PROD:!0,SSR:!1,LEGACY:!0}&&!0}e({a:s,c:g,d:function(t,e,r){var i=g(Math.max(t.x1,e.x1),Math.max(t.y1,e.y1),Math.min(t.x2,e.x2),Math.min(t.y2,e.y2),r);if(i.x10&&a>0)return r?(r.x=i,r.y=n,r.width=s,r.height=a,r):{x:i,y:n,width:s,height:a};if(r)return r.x=0,r.y=0,r.width=0,r.height=0,r;return{x:0,y:0,width:0,height:0}},f:function(t){return(255&t)/255},g:function(t){var e=Math.floor(255*t[0]),r=Math.floor(255*t[1]),i=Math.floor(255*t[2]),n=Math.floor(255*t[3]);return`rgba(${e},${r},${i},${n.toFixed(4)})`},i:o,j:A,k:function(t){return t.x1e.x1&&t.y1e.y1},m:function(t,e,r=!1){var i=(255&t)/255*e,n=Math.trunc((t>>>24)*i),s=Math.trunc((t>>>16&255)*i),a=Math.trunc((t>>>8&255)*i),o=Math.trunc(255*i);if(r)return(o<<24|a<<16|s<<8|n)>>>0;return(n<<24|s<<16|a<<8|o)>>>0},n:function(t,e){if(e)return e.x=t.x1,e.y=t.y1,e.width=t.x2-t.x1,e.height=t.y2-t.y1,e;return{x:t.x1,y:t.y1,width:t.x2-t.x1,height:t.y2-t.y1}},o:function(t,e){if(e)return e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height,e;return{x:t.x,y:t.y,width:t.width,height:t.height}},q:function(t,e){var r=t>>>24,i=t>>>16&255,n=t>>>8&255,s=Math.trunc((255&t)*e);return(r<<24|i<<16|n<<8|s)>>>0},s:function(t,e,r){var i=Math.trunc(t>>>24),n=Math.trunc(t>>>16&255),s=Math.trunc(t>>>8&255),a=Math.trunc(255&t),o=Math.trunc(e>>>24),h=Math.trunc(e>>>16&255),u=Math.trunc(e>>>8&255),c=Math.trunc(255&e),d=Math.round(o*r+i*(1-r)),l=Math.round(h*r+n*(1-r)),f=Math.round(u*r+s*(1-r)),g=Math.round(c*r+a*(1-r));return(d<<24|l<<16|f<<8|g)>>>0},t:function(t,e){return t.x1<=e.x2&&t.y1<=e.y2&&t.x2>=e.x1&&t.y2>=e.y1}});class h{constructor(){n(this,"eventListeners",{})}on(t,e){var r=this.eventListeners[t];r||(r=[]),r.push(e),this.eventListeners[t]=r}off(t,e){var r=this.eventListeners[t];if(r)if(e){var i=r.indexOf(e);i>=0&&r.splice(i,1)}else delete this.eventListeners[t]}once(t,e){var r=(i,n)=>{this.off(t,r),e(i,n)};this.on(t,r)}emit(t,e){var r=this.eventListeners[t];r&&[...r].forEach((t=>{t(this,e)}))}removeAllListeners(){this.eventListeners={}}}e("E",h);class u{static makeCacheKey(t){return!1}static resolveDefaults(t){return{}}}function c(t,e,r){var i=t.createShader(e);if(!i)throw new Error;if(t.shaderSource(i,r),t.compileShader(i),t.getShaderParameter(i,t.COMPILE_STATUS))return i;console.log(t.getShaderInfoLog(i)),t.deleteShader(i)}class d extends u{constructor(t){super(),n(this,"boundBufferCollection",null),n(this,"buffersBound",!1),n(this,"program",void 0),n(this,"vao",void 0),n(this,"renderer",void 0),n(this,"glw",void 0),n(this,"attributeBuffers",void 0),n(this,"attributeLocations",void 0),n(this,"attributeNames",void 0),n(this,"uniformLocations",void 0),n(this,"uniformTypes",void 0),n(this,"supportsIndexedTextures",void 0);var e=this.renderer=t.renderer,r=this.glw=this.renderer.glw;this.supportsIndexedTextures=t.supportsIndexedTextures||!1;var i=r.isWebGl2(),s=i&&t.webgl2Extensions||!i&&t.webgl1Extensions||[],a=i?"2.0":"1.0";s.forEach((t=>{if(!r.getExtension(t))throw new Error(`Shader "${this.constructor.name}" requires extension "${t}" for WebGL ${a} but wasn't found`)}));var o=t.shaderSources||this.constructor.shaderSources;if(!o)throw new Error(`Shader "${this.constructor.name}" is missing shaderSources.`);i&&null!=o&&o.webGl2&&(o.fragment=o.webGl2.fragment,o.vertex=o.webGl2.vertex,delete o.webGl2);var h=e.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS,u=o.vertex instanceof Function?o.vertex(h):o.vertex,d=o.fragment instanceof Function?o.fragment(h):o.fragment,l=c(r,r.VERTEX_SHADER,u),f=c(r,r.FRAGMENT_SHADER,d);if(!l||!f)throw new Error;var g=function(t,e,r){var i=t.createProgram();if(!i)throw new Error;if(t.attachShader(i,e),t.attachShader(i,r),t.linkProgram(i),t.getProgramParameter(i,t.LINK_STATUS))return i;console.log(t.getProgramInfoLog(i)),t.deleteProgram(i)}(r,l,f);if(!g)throw new Error;if(this.program=g,i){var v=r.createVertexArray();if(!v)throw new Error;this.vao=v,r.bindVertexArray(this.vao)}this.attributeLocations={},this.attributeBuffers={},this.attributeNames=[],[...t.attributes].forEach((t=>{var e=r.getAttribLocation(this.program,t);if(e<0)throw new Error(`${this.constructor.name}: Vertex shader must have an attribute "${t}"!`);var i=r.createBuffer();if(!i)throw new Error(`${this.constructor.name}: Could not create buffer for attribute "${t}"`);this.attributeLocations[t]=e,this.attributeBuffers[t]=i,this.attributeNames.push(t)})),this.uniformLocations={},this.uniformTypes={},t.uniforms.forEach((t=>{var e=r.getUniformLocation(this.program,t.name);this.uniformTypes[t.name]=t.uniform,e?this.uniformLocations[t.name]=e:console.warn(`Shader "${this.constructor.name}" could not get uniform location for "${t.name}"`)}))}bindBufferAttribute(t,e,r){var i=this.glw;i.enableVertexAttribArray(t),i.vertexAttribPointer(e,t,r.size,r.type,r.normalized,r.stride,r.offset)}disableAttribute(t){this.glw.disableVertexAttribArray(t)}disableAttributes(){for(var t in this.attributeLocations)this.disableAttribute(this.attributeLocations[t]);this.boundBufferCollection=null}canBatchShaderProps(t,e){return!1}bindRenderOp(t,e){this.bindBufferCollection(t.buffers),t.textures.length>0&&this.bindTextures(t.textures);var r=t.glw;if(this.setUniform("u_resolution",[r.canvas.width,r.canvas.height]),this.setUniform("u_pixelRatio",t.options.pixelRatio),e){if(a(e,"$dimensions")){var i=e.$dimensions;i||(i=t.dimensions),this.setUniform("u_dimensions",[i.width,i.height])}if(a(e,"$alpha")){var n=e.$alpha;n||(n=t.alpha),this.setUniform("u_alpha",n)}this.bindProps(e)}}setUniform(t,...e){this.glw.setUniform(this.uniformTypes[t],this.uniformLocations[t],...e)}bindBufferCollection(t){if(this.boundBufferCollection!==t){for(var e in this.attributeLocations){var r=t.getBuffer(e),i=t.getAttributeInfo(e);this.bindBufferAttribute(this.attributeLocations[e],r,i)}this.boundBufferCollection=t}}bindProps(t){}bindTextures(t){}attach(){this.glw.useProgram(this.program),this.glw.useProgram(this.program),this.glw.isWebGl2()&&this.vao&&this.glw.bindVertexArray(this.vao)}detach(){this.disableAttributes()}}n(d,"shaderSources",void 0),e("h",d);class l extends h{constructor(t){super(),n(this,"txManager",void 0),n(this,"dimensions",null),n(this,"error",null),n(this,"state","freed"),n(this,"renderableOwners",new Set),this.txManager=t}setRenderableOwner(t,e){e?this.renderableOwners.add(t):this.renderableOwners.delete(t)}get renderable(){return this.renderableOwners.size>0}setState(t,...e){if(this.state!==t){if(this.state=t,"loaded"===t){var r=e;this.dimensions=r[0]}else if("failed"===t){var i=e;this.error=i[0]}this.emit(t,...e)}}static makeCacheKey(t){return!1}static resolveDefaults(t){return{}}}e("T",l);var f=e("b",(t=>[(t>>>24)/255,(t>>>16&255)/255,(t>>>8&255)/255,(255&t)/255]));function g(t,e,r,i,n){return n?(n.x1=t,n.y1=e,n.x2=r,n.y2=i,n):{x1:t,y1:e,x2:r,y2:i}}class v extends h{constructor(t,e){super(),n(this,"fontFamily",void 0),n(this,"descriptors",void 0),n(this,"loaded",!1),this.fontFamily=t,this.descriptors=function(t){for(var e=1;e{this.loaded=!0,this.emit("loaded")})).catch(console.error),this.fontFace=o,this.fontUrl=r}});class E{constructor(t,e){n(this,"memManager",void 0),n(this,"textureSource",void 0),this.memManager=t,this.textureSource=e}}class p{constructor(t){n(this,"stage",void 0),this.stage=t}}class x{}class T extends x{constructor(t,e,r,i,s,a,o,h,u,c){super(),n(this,"glw",void 0),n(this,"options",void 0),n(this,"buffers",void 0),n(this,"shader",void 0),n(this,"shaderProps",void 0),n(this,"alpha",void 0),n(this,"clippingRect",void 0),n(this,"dimensions",void 0),n(this,"bufferIdx",void 0),n(this,"zIndex",void 0),n(this,"length",0),n(this,"numQuads",0),n(this,"textures",[]),n(this,"maxTextures",void 0),this.glw=t,this.options=e,this.buffers=r,this.shader=i,this.shaderProps=s,this.alpha=a,this.clippingRect=o,this.dimensions=h,this.bufferIdx=u,this.zIndex=c,this.maxTextures=i.supportsIndexedTextures?t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS):1}addTexture(t){var e=this.textures,r=this.maxTextures,i=e.findIndex((e=>e===t));if(-1!==i)return i;var n=e.length;return n>=r?4294967295:(this.textures.push(t),n)}draw(){var t=this.glw,e=this.shader,r=this.shaderProps,i=this.options;i.shManager.useShader(e),e.bindRenderOp(this,r);var n=this.bufferIdx/24*6*2;if(this.clippingRect.valid){var s=this.clippingRect,a=s.x,o=s.y,h=s.width,u=s.height,c=i.pixelRatio,d=i.canvas.height,l=Math.round(a*c),f=Math.round(h*c),g=Math.round(u*c),v=Math.round(d-g-o*c);t.setScissorTest(!0),t.scissor(l,v,f,g)}else t.setScissorTest(!1);t.drawElements(t.TRIANGLES,6*this.numQuads,t.UNSIGNED_SHORT,n)}}function _(t){var e={MAX_RENDERBUFFER_SIZE:0,MAX_TEXTURE_SIZE:0,MAX_VIEWPORT_DIMS:0,MAX_VERTEX_TEXTURE_IMAGE_UNITS:0,MAX_TEXTURE_IMAGE_UNITS:0,MAX_COMBINED_TEXTURE_IMAGE_UNITS:0,MAX_VERTEX_ATTRIBS:0,MAX_VARYING_VECTORS:0,MAX_VERTEX_UNIFORM_VECTORS:0,MAX_FRAGMENT_UNIFORM_VECTORS:0};return Object.keys(e).forEach((r=>{e[r]=t.getParameter(t[r])})),e}function m(t){var e={ANGLE_instanced_arrays:null,WEBGL_compressed_texture_s3tc:null,WEBGL_compressed_texture_astc:null,WEBGL_compressed_texture_etc:null,WEBGL_compressed_texture_etc1:null,WEBGL_compressed_texture_pvrtc:null,WEBKIT_WEBGL_compressed_texture_pvrtc:null,WEBGL_compressed_texture_s3tc_srgb:null,OES_vertex_array_object:null};return Object.keys(e).forEach((r=>{e[r]=t.getExtension(r)})),e}function A(t,e){var r,i,n=0;function s(){var s,a,o=r,h=arguments.length;t:for(;o;){if(o.args.length===arguments.length){for(a=0;at&&!(t&t-1),y=(t,e,r,i)=>{var n=3*t,s=3*(r-t)-n,a=1-n-s,o=3*e,h=3*(i-e)-o,u=1-o-h;return function(t){if(t>=1)return 1;if(t<=0)return 0;for(var e,r,i=.5,c=0;c<20;c++){if((r=t-i*(i*(i*a+s)+n))>-1e-8&&r<1e-8)return i*(i*(i*u+h)+o);if((e=i*(i*(3*a)+2*s)+n)>1e-10&&e<1e-10)break;i+=r/e}for(var d=0,l=1,f=0;f<20;f++){if((r=t-(i=.5*(d+l))*(i*(i*a+s)+n))>-1e-8&&r<1e-8)return i*(i*(i*u+h)+o);r<0?l=i:d=i}}};e("r",A((t=>{switch(t){case"linear":return function(t){return t};case"ease":return y(.25,.1,.25,1);case"ease-in":return y(.42,0,1,1);case"ease-out":return y(0,0,.58,1);case"ease-in-out":return y(.42,0,.58,1);case"ease-in-sine":case"ease-out-sine":return y(.12,0,.39,0);case"ease-in-out-sine":return y(.37,0,.63,1);case"ease-in-cubic":return y(.32,0,.67,0);case"ease-out-cubic":return y(.33,1,.68,1);case"ease-in-out-cubic":return y(.65,0,.35,1);case"ease-in-circ":return y(.55,0,1,.45);case"ease-out-circ":return y(0,.55,.45,1);case"ease-in-out-circ":return y(.85,0,.15,1);case"ease-in-back":return y(.36,0,.66,-.56);case"ease-out-back":return y(.34,1.56,.64,1);case"ease-in-out-back":return y(.68,-.6,.32,1.6);case"step-start":return function(){return 1};case"step-end":return function(t){return 1===t?1:0};default:var e="cubic-bezier(";if(t&&0===t.indexOf(e)){var r=t.substr(13,t.length-13-1).split(",");if(4!==r.length)return console.warn("Unknown timing function: "+t),function(t){return t};var i=parseFloat(r[0]||"0.42"),n=parseFloat(r[1]||"0"),s=parseFloat(r[2]||"1"),a=parseFloat(r[3]||"1");return isNaN(i)||isNaN(n)||isNaN(s)||isNaN(a)?(console.warn(" Unknown timing function: "+t),function(t){return t}):y(i,n,s,a)}return console.warn("Unknown timing function: "+t),function(t){return t}}})));Math.hypot||(Math.hypot=(...t)=>{for(var e=0,r=t.length;r--;)e+=t[r]*t[r];return Math.sqrt(e)});var b=new Uint8Array([0,0,0,0]);class w extends E{constructor(t,e,r){super(e,r),n(this,"glw",void 0),n(this,"_nativeCtxTexture",null),n(this,"_state","freed"),n(this,"_w",0),n(this,"_h",0),this.glw=t}get ctxTexture(){return"freed"===this._state&&this.load(),this._nativeCtxTexture,this._nativeCtxTexture}get renderable(){return this.textureSource.renderable}get w(){return this._w}get h(){return this._h}load(){"loading"!==this._state&&"loaded"!==this._state&&(this._state="loading",this.textureSource.setState("loading"),this._nativeCtxTexture=this.createNativeCtxTexture(),this.onLoadRequest().then((({width:t,height:e})=>{"freed"!==this._state&&(this._state="loaded",this._w=t,this._h=e,this.textureSource.setState("loaded",{width:t,height:e}))})).catch((t=>{this._state="failed",this.textureSource.setState("failed",t),console.error(t)})))}onLoadRequest(){var e=this;return r(t().mark((function r(){var i,n,s,a,o,h,u,c,d,l,f,g,v,E,p,x,T;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.glw,s=e.memManager,n.activeTexture(0),n.bindTexture(e._nativeCtxTexture),n.texParameteri(n.TEXTURE_MAG_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texImage2D(0,n.RGBA,1,1,0,n.RGBA,n.UNSIGNED_BYTE,b),s.setTextureMemUse(e,b.byteLength),t.next=11,null===(i=e.textureSource)||void 0===i?void 0:i.getTextureData();case 11:if(a=t.sent,e._nativeCtxTexture){t.next=15;break}return e._state,t.abrupt("return",{width:0,height:0});case 15:return o=0,h=0,e._nativeCtxTexture,n.activeTexture(0),a.data instanceof ImageBitmap||a.data instanceof ImageData||null!==(r=a.data)&&"object"==typeof r&&r.constructor&&"HTMLImageElement"===r.constructor.name?(u=a.data,o=u.width,h=u.height,n.bindTexture(e._nativeCtxTexture),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!!a.premultiplyAlpha),n.texImage2D(0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,u),s.setTextureMemUse(e,o*h*4),(n.isWebGl2()||R(o)&&R(h))&&n.generateMipmap()):null===a.data?(o=0,h=0,n.bindTexture(e._nativeCtxTexture),n.texImage2D(0,n.RGBA,1,1,0,n.RGBA,n.UNSIGNED_BYTE,b),s.setTextureMemUse(e,b.byteLength)):"mipmaps"in a.data&&a.data.mipmaps?(d=a.data,l=d.mipmaps,f=d.width,g=void 0===f?0:f,v=d.height,E=void 0===v?0:v,p=d.type,x=d.glInternalFormat,T="ktx"===p?new DataView(null!==(c=l[0])&&void 0!==c?c:new ArrayBuffer(0)):l[0],n.bindTexture(e._nativeCtxTexture),n.compressedTexImage2D(0,x,g,E,0,T),n.texParameteri(n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_MAG_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_MIN_FILTER,n.LINEAR),s.setTextureMemUse(e,T.byteLength)):console.error("WebGlCoreCtxTexture.onLoadRequest: Unexpected textureData returned",a),t.abrupt("return",{width:o,height:h});case 21:case"end":return t.stop()}var r}),r)})))()}free(){if("freed"!==this._state&&(this._state="freed",this.textureSource.setState("freed"),this._w=0,this._h=0,this._nativeCtxTexture)){var t=this.glw,e=this.memManager;t.deleteTexture(this._nativeCtxTexture),e.setTextureMemUse(this,0),this._nativeCtxTexture=null}}createNativeCtxTexture(){var t=this.glw.createTexture();if(!t)throw new Error("Could not create WebGL Texture");return t}}class S extends l{constructor(t,e){super(t),n(this,"props",void 0),this.props=S.resolveDefaults(e||{})}get color(){return this.props.color}set color(t){this.props.color=t}getTextureData(){var e=this;return r(t().mark((function r(){var i,n;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=new Uint32Array([e.color]),n=new Uint8ClampedArray(i.buffer),t.abrupt("return",{data:new ImageData(n,1,1),premultiplyAlpha:!0});case 3:case"end":return t.stop()}}),r)})))()}static makeCacheKey(t){return`ColorTexture,${S.resolveDefaults(t).color}`}static resolveDefaults(t){return{color:t.color||4294967295}}}n(S,"z$__type__Props",void 0),e("u",S);class M extends l{constructor(t,e){super(t),n(this,"props",void 0),n(this,"parentTexture",void 0),n(this,"onParentTxLoaded",(()=>{this.setState("loaded",{width:this.props.width,height:this.props.height})})),n(this,"onParentTxFailed",((t,e)=>{this.setState("failed",e)})),this.parentTexture=this.txManager.loadTexture(e.texture.txType,e.texture.props,e.texture.options),this.props=M.resolveDefaults(e||{}),queueMicrotask((()=>{var t=this.parentTexture;"loaded"===t.state?this.onParentTxLoaded(t,t.dimensions):"failed"===t.state&&this.onParentTxFailed(t,t.error),t.on("loaded",this.onParentTxLoaded),t.on("failed",this.onParentTxFailed)}))}getTextureData(){var e=this;return r(t().mark((function r(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",{data:e.props});case 1:case"end":return t.stop()}}),r)})))()}static makeCacheKey(t){return!1}static resolveDefaults(t){return{texture:t.texture,x:t.x||0,y:t.y||0,width:t.width||0,height:t.height||0}}}n(M,"z$__type__Props",void 0),e("v",M);class I extends w{constructor(t,e,r){super(t,e,r)}onLoadRequest(){var e=this;return r(t().mark((function r(){var i,n,s;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.textureSource.getTextureData();case 2:return s=t.sent,t.abrupt("return",{width:(null===(i=s.data)||void 0===i?void 0:i.width)||0,height:(null===(n=s.data)||void 0===n?void 0:n.height)||0});case 4:case"end":return t.stop()}}),r)})))()}}class L{constructor(t){n(this,"config",void 0),this.config=t}getBuffer(t){var e;return null===(e=this.config.find((e=>e.attributes[t])))||void 0===e?void 0:e.buffer}getAttributeInfo(t){var e;return null===(e=this.config.find((e=>e.attributes[t])))||void 0===e?void 0:e.attributes[t]}}e("B",L);class U{constructor(t){n(this,"gl",void 0),n(this,"activeTextureUnit",0),n(this,"texture2dUnits",void 0),n(this,"texture2dParams",new WeakMap),n(this,"scissorEnabled",void 0),n(this,"scissorX",void 0),n(this,"scissorY",void 0),n(this,"scissorWidth",void 0),n(this,"scissorHeight",void 0),n(this,"blendEnabled",void 0),n(this,"blendSrcRgb",void 0),n(this,"blendDstRgb",void 0),n(this,"blendSrcAlpha",void 0),n(this,"blendDstAlpha",void 0),n(this,"boundArrayBuffer",void 0),n(this,"boundElementArrayBuffer",void 0),n(this,"curProgram",void 0),n(this,"programUniforms",new WeakMap),n(this,"canvas",void 0),n(this,"MAX_RENDERBUFFER_SIZE",void 0),n(this,"MAX_TEXTURE_SIZE",void 0),n(this,"MAX_VIEWPORT_DIMS",void 0),n(this,"MAX_VERTEX_TEXTURE_IMAGE_UNITS",void 0),n(this,"MAX_TEXTURE_IMAGE_UNITS",void 0),n(this,"MAX_COMBINED_TEXTURE_IMAGE_UNITS",void 0),n(this,"MAX_VERTEX_ATTRIBS",void 0),n(this,"MAX_VARYING_VECTORS",void 0),n(this,"MAX_VERTEX_UNIFORM_VECTORS",void 0),n(this,"MAX_FRAGMENT_UNIFORM_VECTORS",void 0),n(this,"TEXTURE_MAG_FILTER",void 0),n(this,"TEXTURE_MIN_FILTER",void 0),n(this,"TEXTURE_WRAP_S",void 0),n(this,"TEXTURE_WRAP_T",void 0),n(this,"LINEAR",void 0),n(this,"CLAMP_TO_EDGE",void 0),n(this,"RGBA",void 0),n(this,"UNSIGNED_BYTE",void 0),n(this,"UNPACK_PREMULTIPLY_ALPHA_WEBGL",void 0),n(this,"FLOAT",void 0),n(this,"TRIANGLES",void 0),n(this,"UNSIGNED_SHORT",void 0),n(this,"ONE",void 0),n(this,"ONE_MINUS_SRC_ALPHA",void 0),n(this,"VERTEX_SHADER",void 0),n(this,"FRAGMENT_SHADER",void 0),n(this,"STATIC_DRAW",void 0),n(this,"COMPILE_STATUS",void 0),n(this,"LINK_STATUS",void 0),n(this,"DYNAMIC_DRAW",void 0),this.gl=t,this.activeTextureUnit=t.getParameter(t.ACTIVE_TEXTURE)-t.TEXTURE0;var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.texture2dUnits=new Array(e).fill(void 0).map(((e,r)=>(this.activeTexture(r),t.getParameter(t.TEXTURE_BINDING_2D)))),this.activeTexture(this.activeTextureUnit),this.scissorEnabled=t.isEnabled(t.SCISSOR_TEST);var r=t.getParameter(t.SCISSOR_BOX);this.scissorX=r[0],this.scissorY=r[1],this.scissorWidth=r[2],this.scissorHeight=r[3],this.blendEnabled=t.isEnabled(t.BLEND),this.blendSrcRgb=t.getParameter(t.BLEND_SRC_RGB),this.blendDstRgb=t.getParameter(t.BLEND_DST_RGB),this.blendSrcAlpha=t.getParameter(t.BLEND_SRC_ALPHA),this.blendDstAlpha=t.getParameter(t.BLEND_DST_ALPHA),this.boundArrayBuffer=t.getParameter(t.ARRAY_BUFFER_BINDING),this.boundElementArrayBuffer=t.getParameter(t.ELEMENT_ARRAY_BUFFER_BINDING),this.curProgram=t.getParameter(t.CURRENT_PROGRAM),this.canvas=t.canvas,this.MAX_RENDERBUFFER_SIZE=t.MAX_RENDERBUFFER_SIZE,this.MAX_TEXTURE_SIZE=t.MAX_TEXTURE_SIZE,this.MAX_VIEWPORT_DIMS=t.MAX_VIEWPORT_DIMS,this.MAX_VERTEX_TEXTURE_IMAGE_UNITS=t.MAX_VERTEX_TEXTURE_IMAGE_UNITS,this.MAX_TEXTURE_IMAGE_UNITS=t.MAX_TEXTURE_IMAGE_UNITS,this.MAX_COMBINED_TEXTURE_IMAGE_UNITS=t.MAX_COMBINED_TEXTURE_IMAGE_UNITS,this.MAX_VERTEX_ATTRIBS=t.MAX_VERTEX_ATTRIBS,this.MAX_VARYING_VECTORS=t.MAX_VARYING_VECTORS,this.MAX_VERTEX_UNIFORM_VECTORS=t.MAX_VERTEX_UNIFORM_VECTORS,this.MAX_FRAGMENT_UNIFORM_VECTORS=t.MAX_FRAGMENT_UNIFORM_VECTORS,this.TEXTURE_MAG_FILTER=t.TEXTURE_MAG_FILTER,this.TEXTURE_MIN_FILTER=t.TEXTURE_MIN_FILTER,this.TEXTURE_WRAP_S=t.TEXTURE_WRAP_S,this.TEXTURE_WRAP_T=t.TEXTURE_WRAP_T,this.LINEAR=t.LINEAR,this.CLAMP_TO_EDGE=t.CLAMP_TO_EDGE,this.RGBA=t.RGBA,this.UNSIGNED_BYTE=t.UNSIGNED_BYTE,this.UNPACK_PREMULTIPLY_ALPHA_WEBGL=t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.FLOAT=t.FLOAT,this.TRIANGLES=t.TRIANGLES,this.UNSIGNED_SHORT=t.UNSIGNED_SHORT,this.ONE=t.ONE,this.ONE_MINUS_SRC_ALPHA=t.ONE_MINUS_SRC_ALPHA,this.MAX_VERTEX_TEXTURE_IMAGE_UNITS=t.MAX_VERTEX_TEXTURE_IMAGE_UNITS,this.TRIANGLES=t.TRIANGLES,this.UNSIGNED_SHORT=t.UNSIGNED_SHORT,this.VERTEX_SHADER=t.VERTEX_SHADER,this.FRAGMENT_SHADER=t.FRAGMENT_SHADER,this.STATIC_DRAW=t.STATIC_DRAW,this.COMPILE_STATUS=t.COMPILE_STATUS,this.LINK_STATUS=t.LINK_STATUS,this.DYNAMIC_DRAW=t.DYNAMIC_DRAW}isWebGl2(){return t=this.gl,self.WebGL2RenderingContext&&t instanceof self.WebGL2RenderingContext;var t}activeTexture(t){var e=this.gl;this.activeTextureUnit!==t&&(e.activeTexture(t+e.TEXTURE0),this.activeTextureUnit=t)}bindTexture(t){var e=this.gl,r=this.activeTextureUnit,i=this.texture2dUnits;i[r]!==t&&(i[r]=t,e.bindTexture(this.gl.TEXTURE_2D,t))}_getActiveTexture(){var t=this.activeTextureUnit;return this.texture2dUnits[t]}texParameteri(t,e){var r=this.gl,i=this.texture2dParams,n=this._getActiveTexture();if(!n)throw new Error("No active texture");var s=i.get(n);s||(s={},i.set(n,s)),s[t]!==e&&(s[t]=e,r.texParameteri(r.TEXTURE_2D,t,e))}texImage2D(t,e,r,i,n,s,a,o){var h=this.gl;s?h.texImage2D(h.TEXTURE_2D,t,e,r,i,n,s,a,o):h.texImage2D(h.TEXTURE_2D,t,e,r,i,n)}compressedTexImage2D(t,e,r,i,n,s){var a=this.gl;a.compressedTexImage2D(a.TEXTURE_2D,t,e,r,i,n,s)}pixelStorei(t,e){this.gl.pixelStorei(t,e)}generateMipmap(){var t=this.gl;t.generateMipmap(t.TEXTURE_2D)}createTexture(){return this.gl.createTexture()}deleteTexture(t){var e=this.gl;t&&this.texture2dParams.delete(t),e.deleteTexture(t)}viewport(t,e,r,i){this.gl.viewport(t,e,r,i)}clearColor(t,e,r,i){this.gl.clearColor(t,e,r,i)}setScissorTest(t){var e=this.gl;t!==this.scissorEnabled&&(t?e.enable(e.SCISSOR_TEST):e.disable(e.SCISSOR_TEST),this.scissorEnabled=t)}scissor(t,e,r,i){var n=this.gl,s=this.scissorX,a=this.scissorY,o=this.scissorWidth,h=this.scissorHeight;t===s&&e===a&&r===o&&i===h||(n.scissor(t,e,r,i),this.scissorX=t,this.scissorY=e,this.scissorWidth=r,this.scissorHeight=i)}setBlend(t){var e=this.gl;t!==this.blendEnabled&&(t?e.enable(e.BLEND):e.disable(e.BLEND),this.blendEnabled=t)}blendFunc(t,e){var r=this.gl,i=this.blendSrcRgb,n=this.blendDstRgb,s=this.blendSrcAlpha,a=this.blendDstAlpha;t===i&&e===n&&t===s&&e===a||(r.blendFunc(t,e),this.blendSrcRgb=t,this.blendDstRgb=e,this.blendSrcAlpha=t,this.blendDstAlpha=e)}createBuffer(){return this.gl.createBuffer()}clear(){var t=this.gl;t.clear(t.COLOR_BUFFER_BIT)}arrayBufferData(t,e,r){var i=this.gl;this.boundArrayBuffer!==t&&(i.bindBuffer(i.ARRAY_BUFFER,t),this.boundArrayBuffer=t),i.bufferData(i.ARRAY_BUFFER,e,r)}elementArrayBufferData(t,e,r){var i=this.gl;this.boundElementArrayBuffer!==t&&(i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t),this.boundElementArrayBuffer=t),i.bufferData(i.ELEMENT_ARRAY_BUFFER,e,r)}vertexAttribPointer(t,e,r,i,n,s,a){var o=this.gl;this.boundArrayBuffer!==t&&(o.bindBuffer(o.ARRAY_BUFFER,t),this.boundArrayBuffer=t),o.vertexAttribPointer(e,r,i,n,s,a)}useProgram(t){var e=this.gl;this.curProgram!==t&&(e.useProgram(t),this.curProgram=t)}setUniform(t,e,...r){var i=this.gl,n=this.programUniforms,s=n.get(this.curProgram);s||(s=new Map,n.set(this.curProgram,s));var a=s.get(e);a&&function(t,e){if(t.length!==e.length)return!1;return t.every(((t,r)=>!(Array.isArray(t)||t instanceof Float32Array)&&t===e[r]))}(a,r)||(s.set(e,r),i[t](e,...r))}getParameter(t){return this.gl.getParameter(t)}drawElements(t,e,r,i){this.gl.drawElements(t,e,r,i)}getExtension(t){return this.gl.getExtension(t)}createVertexArray(){var t=this.gl;return WebGL2RenderingContext,t.createVertexArray()}bindVertexArray(t){var e=this.gl;WebGL2RenderingContext,e.bindVertexArray(t)}getAttribLocation(t,e){return this.gl.getAttribLocation(t,e)}getUniformLocation(t,e){return this.gl.getUniformLocation(t,e)}enableVertexAttribArray(t){this.gl.enableVertexAttribArray(t)}disableVertexAttribArray(t){this.gl.disableVertexAttribArray(t)}createShader(t){return this.gl.createShader(t)}compileShader(t){this.gl.compileShader(t)}attachShader(t,e){this.gl.attachShader(t,e)}linkProgram(t){this.gl.linkProgram(t)}deleteProgram(t){this.gl.deleteProgram(t)}getShaderParameter(t,e){return this.gl.getShaderParameter(t,e)}getShaderInfoLog(t){return this.gl.getShaderInfoLog(t)}createProgram(){return this.gl.createProgram()}getProgramParameter(t,e){return this.gl.getProgramParameter(t,e)}getProgramInfoLog(t){return this.gl.getProgramInfoLog(t)}shaderSource(t,e){this.gl.shaderSource(t,e)}deleteShader(t){this.gl.deleteShader(t)}}class N extends p{constructor(t){super(t.stage),n(this,"glw",void 0),n(this,"system",void 0),n(this,"txManager",void 0),n(this,"txMemManager",void 0),n(this,"shManager",void 0),n(this,"options",void 0),n(this,"quadBuffer",new ArrayBuffer(4194304)),n(this,"fQuadBuffer",new Float32Array(this.quadBuffer)),n(this,"uiQuadBuffer",new Uint32Array(this.quadBuffer)),n(this,"renderOps",[]),n(this,"curBufferIdx",0),n(this,"curRenderOp",null),n(this,"renderables",[]),n(this,"defaultShader",void 0),n(this,"quadBufferCollection",void 0),n(this,"defaultTexture",void 0);var e=t.canvas,r=t.clearColor,i=t.bufferMemory;this.options=t,this.txManager=t.txManager,this.txMemManager=t.txMemManager,this.shManager=t.shManager,this.defaultTexture=new S(this.txManager),this.defaultTexture.once("loaded",(()=>{this.stage.requestRender()}));var s=function(t,e){var r={alpha:!0,antialias:!1,depth:!1,stencil:!0,desynchronized:!1,powerPreference:"high-performance",premultipliedAlpha:!0,preserveDrawingBuffer:!1},i=t.getContext("webgl",r)||t.getContext("experimental-webgl",r);if(!i)throw new Error("Unable to create WebGL context");return e?new Proxy(i,{get(t,r){var i=t[r];return"function"==typeof i?(e.increment(String(r)),i.bind(t)):i}}):i}(e,t.contextSpy),a=this.glw=new U(s),o=f(r);a.viewport(0,0,e.width,e.height),a.clearColor(o[0],o[1],o[2],o[3]),a.setBlend(!0),a.blendFunc(a.ONE,a.ONE_MINUS_SRC_ALPHA),function(t,e){for(var r=~~(e/80),i=new Uint16Array(6*r),n=0,s=0;n{t.draw()})),this.renderables=[]}}e("w",N);var P=10;class O{}class B extends O{constructor(t,e){super(),n(this,"data",void 0),n(this,"glyphMap",void 0),n(this,"kernings",void 0),this.data=t,this.glyphMap=e;var r=this.kernings={};t.kernings.forEach((t=>{var e=t.second;(r[e]=r[e]||{})[t.first]=t.amount})),this.kernings=r}shapeText(e,r){var i=this;return t().mark((function n(){var s,a,o,h,u,c;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a=void 0;case 1:if(!(s=r.peek())||s.done){t.next=17;break}if(o=s.value,h=i.glyphMap.get(o),r.next(),void 0===h){t.next=12;break}return c=void 0!==a?((null===(u=i.kernings[h.id])||void 0===u?void 0:u[a])||0)+e.letterSpacing:0,a=h.id,t.next=10,{mapped:!0,glyphId:h.id,codepoint:o,cluster:r.lastIndex,xAdvance:h.xadvance+c,yAdvance:0,xOffset:h.xoffset+c,yOffset:h.yoffset,xBearing:0,yBearing:0,width:h.width,height:h.height};case 10:t.next=15;break;case 12:return o===P&&(a=void 0),t.next=15,{mapped:!1,codepoint:o,cluster:r.lastIndex};case 15:t.next=1;break;case 17:case"end":return t.stop()}}),n)}))()}}e("S",class extends v{constructor(e,i,s,a,o,h){var u;super(e,i),u=this,n(this,"type",void 0),n(this,"texture",void 0),n(this,"maxCharHeight",0),n(this,"data",void 0),n(this,"shaper",void 0),n(this,"glyphMap",new Map),this.type=s;a.renderer;this.texture=a.txManager.loadTexture("ImageTexture",{src:o,premultiplyAlpha:!1},{preload:!0}),this.texture.on("loaded",(()=>{this.checkLoaded()})),fetch(h).then(function(){var e=r(t().mark((function e(r){var i;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r.json();case 2:u.data=t.sent,i=0,u.data.chars.forEach((t=>{u.glyphMap.set(t.id,t);var e=t.yoffset+t.height;e>i&&(i=e)})),u.maxCharHeight=i,u.shaper=new B(u.data,u.glyphMap),u.checkLoaded();case 8:case"end":return t.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch(console.error)}getAtlasEntry(t){var e=this.glyphMap.get(t);if(void 0===e)throw new Error(`Glyph ${t} not found in font ${this.fontFamily}`);return{x:e.x,y:e.y,width:e.width,height:e.height}}checkLoaded(){this.loaded||"loaded"===this.texture.state&&this.data&&(this.loaded=!0,this.emit("loaded"))}});e("C",class{})}}}))}(); +//# sourceMappingURL=CoreExtension-legacy-Djp23FNT.js.map diff --git a/assets/CoreExtension-legacy-Djp23FNT.js.map b/assets/CoreExtension-legacy-Djp23FNT.js.map new file mode 100644 index 0000000..f0524e0 --- /dev/null +++ b/assets/CoreExtension-legacy-Djp23FNT.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CoreExtension-legacy-Djp23FNT.js","sources":["../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/utils.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/lib/utils.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/common/EventEmitter.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/CoreShader.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/internal/ShaderUtils.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/WebGlCoreShader.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/textures/Texture.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/font-face-types/TrFontFace.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/font-face-types/WebTrFontFace.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/CoreContextTexture.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/CoreRenderer.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/CoreRenderOp.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/WebGlCoreRenderOp.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/internal/RendererUtils.js","../../../../node_modules/.pnpm/memize@2.1.0/node_modules/memize/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/utils.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/WebGlCoreCtxTexture.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/textures/ColorTexture.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/textures/SubTexture.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/WebGlCoreCtxSubTexture.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/internal/BufferCollection.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/lib/WebGlContextWrapper.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/internal/WebGlUtils.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/WebGlCoreRenderer.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/SpecialCodepoints.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/font-face-types/SdfTrFontFace/internal/FontShaper.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/font-face-types/SdfTrFontFace/internal/SdfFontShaper.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/font-face-types/SdfTrFontFace/SdfTrFontFace.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/CoreExtension.js"],"sourcesContent":["/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport function createWebGLContext(canvas, contextSpy) {\n const config = {\n alpha: true,\n antialias: false,\n depth: false,\n stencil: true,\n desynchronized: false,\n // Disabled because it prevents Visual Regression Tests from working\n // failIfMajorPerformanceCaveat: true,\n powerPreference: 'high-performance',\n premultipliedAlpha: true,\n preserveDrawingBuffer: false,\n };\n const gl = \n // TODO: Remove this assertion once this issue is fixed in TypeScript\n // https://github.com/microsoft/TypeScript/issues/53614\n (canvas.getContext('webgl', config) ||\n canvas.getContext('experimental-webgl', config));\n if (!gl) {\n throw new Error('Unable to create WebGL context');\n }\n if (contextSpy) {\n // Proxy the GL context to log all GL calls\n return new Proxy(gl, {\n get(target, prop) {\n const value = target[prop];\n if (typeof value === 'function') {\n contextSpy.increment(String(prop));\n return value.bind(target);\n }\n return value;\n },\n });\n }\n return gl;\n}\n/**\n * Asserts a condition is truthy, otherwise throws an error\n *\n * @remarks\n * Useful at the top of functions to ensure certain conditions, arguments and\n * properties are set/met before continuing. When using this function,\n * TypeScript will narrow away falsy types from the condition.\n *\n * @param condition\n * @param message\n * @returns\n */\nexport function assertTruthy(condition, message) {\n if (isProductionEnvironment())\n return;\n if (!condition) {\n throw new Error(message || 'Assertion failed');\n }\n}\n/**\n * Merges two colors based on a given progress value.\n *\n * This function takes two colors (c1 and c2) represented as 32-bit integers\n * in RGBA format and blends them based on the provided progress value (p).\n * The result is a new color that is a weighted combination of the input colors,\n * where the weight is determined by the progress value.\n *\n * @param {number} c1 - The first color in RGBA format (32-bit integer).\n * @param {number} c2 - The second color in RGBA format (32-bit integer).\n * @param {number} p - The progress value between 0 and 1.\n * @returns {number} The merged color as a 32-bit integer in RGBA format.\n */\nexport function mergeColorProgress(rgba1, rgba2, p) {\n const r1 = Math.trunc(rgba1 >>> 24);\n const g1 = Math.trunc((rgba1 >>> 16) & 0xff);\n const b1 = Math.trunc((rgba1 >>> 8) & 0xff);\n const a1 = Math.trunc(rgba1 & 0xff);\n const r2 = Math.trunc(rgba2 >>> 24);\n const g2 = Math.trunc((rgba2 >>> 16) & 0xff);\n const b2 = Math.trunc((rgba2 >>> 8) & 0xff);\n const a2 = Math.trunc(rgba2 & 0xff);\n const r = Math.round(r2 * p + r1 * (1 - p));\n const g = Math.round(g2 * p + g1 * (1 - p));\n const b = Math.round(b2 * p + b1 * (1 - p));\n const a = Math.round(a2 * p + a1 * (1 - p));\n return ((r << 24) | (g << 16) | (b << 8) | a) >>> 0;\n}\n/**\n * Given an RGBA encoded number, returns back the RGBA number with it's alpha\n * component multiplied by the passed `alpha` parameter.\n *\n * @internalRemarks\n * This method does NOT premultiply the alpha into the color channels. If that\n * is required (for internal use only) use {@link mergeColorAlphaPremultiplied}\n * instead.\n *\n * @param rgba RGBA encoded number\n * @param alpha Normalized alpha value (Range: 0.0 - 1.0)\n * @returns\n */\nexport function mergeColorAlpha(rgba, alpha) {\n const r = rgba >>> 24;\n const g = (rgba >>> 16) & 0xff;\n const b = (rgba >>> 8) & 0xff;\n const a = Math.trunc((rgba & 0xff) * alpha);\n return ((r << 24) | (g << 16) | (b << 8) | a) >>> 0;\n}\n/**\n * Given an RGBA encoded number, returns back the RGBA number with it's alpha\n * component multiplied by the passed `alpha` parameter. Before returning, the\n * final alpha value is multiplied into the color channels.\n *\n * @remarks\n * If `flipEndianess` is set to true, the function will returned an ABGR encoded number\n * which is useful when the color value needs to be passed into a shader attribute.\n *\n * NOTE: This method returns a PREMULTIPLIED alpha color which is generally only useful\n * in the context of the internal rendering process. Use {@link mergeColorAlpha} if you\n * need to blend an alpha value into a color in the context of the Renderer's\n * main API.\n *\n * @internalRemarks\n * Do not expose this method in the main API because Renderer users should instead use\n * {@link mergeColorAlpha} to manipulate the alpha value of a color.\n *\n * @internal\n * @param rgba RGBA encoded number\n * @param alpha Normalized alpha value (Range: 0.0 - 1.0)\n * @param flipEndianess Flip the endianess. RGBA becomes encoded as ABGR (for inserting colors into shader attributes)\n * @returns\n */\nexport function mergeColorAlphaPremultiplied(rgba, alpha, flipEndianess = false) {\n const newAlpha = ((rgba & 0xff) / 255) * alpha;\n const r = Math.trunc((rgba >>> 24) * newAlpha);\n const g = Math.trunc(((rgba >>> 16) & 0xff) * newAlpha);\n const b = Math.trunc(((rgba >>> 8) & 0xff) * newAlpha);\n const a = Math.trunc(newAlpha * 255);\n if (flipEndianess) {\n return ((a << 24) | (b << 16) | (g << 8) | r) >>> 0;\n }\n return ((r << 24) | (g << 16) | (b << 8) | a) >>> 0;\n}\n/**\n * Returns true if the given object has the given \"own\" property.\n *\n * @param obj\n * @param prop\n * @returns\n */\nexport function hasOwn(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n/**\n * Converts degrees to radians\n *\n * @param degrees\n * @returns\n */\nexport function deg2Rad(degrees) {\n return (degrees * Math.PI) / 180;\n}\n/**\n * Returns image aspect ratio\n *\n * @param width\n * @param height\n * @returns\n */\nexport function getImageAspectRatio(width, height) {\n return width / height;\n}\n/**\n * Checks import.meta if env is production\n *\n * @returns\n */\nexport function isProductionEnvironment() {\n return import.meta.env && import.meta.env.PROD;\n}\n//# sourceMappingURL=utils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport const getNormalizedRgbaComponents = (rgba) => {\n const r = rgba >>> 24;\n const g = (rgba >>> 16) & 0xff;\n const b = (rgba >>> 8) & 0xff;\n const a = rgba & 0xff;\n return [r / 255, g / 255, b / 255, a / 255];\n};\nexport const getRgbaComponents = (rgba) => {\n const r = rgba >>> 24;\n const g = (rgba >>> 16) & 0xff;\n const b = (rgba >>> 8) & 0xff;\n const a = rgba & 0xff;\n return [r, g, b, a];\n};\nexport const norm = (rgba) => {\n const r = rgba >>> 24;\n const g = (rgba >>> 16) & 0xff;\n const b = (rgba >>> 8) & 0xff;\n const a = rgba & 0xff;\n const rgbaArr = [r / 255, g / 255, b / 255, a / 255];\n rgbaArr[0] = Math.max(0, Math.min(255, rgbaArr[0]));\n rgbaArr[1] = Math.max(0, Math.min(255, rgbaArr[1]));\n rgbaArr[2] = Math.max(0, Math.min(255, rgbaArr[2]));\n rgbaArr[3] = Math.max(0, Math.min(255, rgbaArr[3]));\n let v = ((rgbaArr[3] | 0) << 24) +\n ((rgbaArr[0] | 0) << 16) +\n ((rgbaArr[1] | 0) << 8) +\n (rgbaArr[2] | 0);\n if (v < 0) {\n v = 0xffffffff + v + 1;\n }\n return v;\n};\nexport function getNormalizedAlphaComponent(rgba) {\n return (rgba & 0xff) / 255.0;\n}\n/**\n * Get a CSS color string from a RGBA color\n *\n * @param color\n * @returns\n */\nexport function getRgbaString(color) {\n const r = Math.floor(color[0] * 255.0);\n const g = Math.floor(color[1] * 255.0);\n const b = Math.floor(color[2] * 255.0);\n const a = Math.floor(color[3] * 255.0);\n return `rgba(${r},${g},${b},${a.toFixed(4)})`;\n}\nexport function createBound(x1, y1, x2, y2, out) {\n if (out) {\n out.x1 = x1;\n out.y1 = y1;\n out.x2 = x2;\n out.y2 = y2;\n return out;\n }\n return {\n x1,\n y1,\n x2,\n y2,\n };\n}\nexport function intersectBound(a, b, out) {\n const intersection = createBound(Math.max(a.x1, b.x1), Math.max(a.y1, b.y1), Math.min(a.x2, b.x2), Math.min(a.y2, b.y2), out);\n if (intersection.x1 < intersection.x2 && intersection.y1 < intersection.y2) {\n return intersection;\n }\n return createBound(0, 0, 0, 0, intersection);\n}\nexport function boundsOverlap(a, b) {\n return a.x1 < b.x2 && a.x2 > b.x1 && a.y1 < b.y2 && a.y2 > b.y1;\n}\nexport function convertBoundToRect(bound, out) {\n if (out) {\n out.x = bound.x1;\n out.y = bound.y1;\n out.width = bound.x2 - bound.x1;\n out.height = bound.y2 - bound.y1;\n return out;\n }\n return {\n x: bound.x1,\n y: bound.y1,\n width: bound.x2 - bound.x1,\n height: bound.y2 - bound.y1,\n };\n}\nexport function intersectRect(a, b, out) {\n const x = Math.max(a.x, b.x);\n const y = Math.max(a.y, b.y);\n const width = Math.min(a.x + a.width, b.x + b.width) - x;\n const height = Math.min(a.y + a.height, b.y + b.height) - y;\n if (width > 0 && height > 0) {\n if (out) {\n out.x = x;\n out.y = y;\n out.width = width;\n out.height = height;\n return out;\n }\n return {\n x,\n y,\n width,\n height,\n };\n }\n if (out) {\n out.x = 0;\n out.y = 0;\n out.width = 0;\n out.height = 0;\n return out;\n }\n return {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n };\n}\nexport function copyRect(a, out) {\n if (out) {\n out.x = a.x;\n out.y = a.y;\n out.width = a.width;\n out.height = a.height;\n return out;\n }\n return {\n x: a.x,\n y: a.y,\n width: a.width,\n height: a.height,\n };\n}\nexport function compareRect(a, b) {\n if (a === b) {\n return true;\n }\n if (a === null || b === null) {\n return false;\n }\n return (a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height);\n}\nexport function boundInsideBound(bound1, bound2) {\n return (bound1.x1 <= bound2.x2 &&\n bound1.y1 <= bound2.y2 &&\n bound1.x2 >= bound2.x1 &&\n bound1.y2 >= bound2.y1);\n}\nexport function isBoundPositive(bound) {\n return bound.x1 < bound.x2 && bound.y1 < bound.y2;\n}\nexport function isRectPositive(rect) {\n return rect.width > 0 && rect.height > 0;\n}\n//# sourceMappingURL=utils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * EventEmitter base class\n */\nexport class EventEmitter {\n eventListeners = {};\n on(event, listener) {\n let listeners = this.eventListeners[event];\n if (!listeners) {\n listeners = [];\n }\n listeners.push(listener);\n this.eventListeners[event] = listeners;\n }\n off(event, listener) {\n const listeners = this.eventListeners[event];\n if (!listeners) {\n return;\n }\n if (!listener) {\n delete this.eventListeners[event];\n return;\n }\n const index = listeners.indexOf(listener);\n if (index >= 0) {\n listeners.splice(index, 1);\n }\n }\n once(event, listener) {\n const onceListener = (target, data) => {\n this.off(event, onceListener);\n listener(target, data);\n };\n this.on(event, onceListener);\n }\n emit(event, data) {\n const listeners = this.eventListeners[event];\n if (!listeners) {\n return;\n }\n [...listeners].forEach((listener) => {\n listener(this, data);\n });\n }\n removeAllListeners() {\n this.eventListeners = {};\n }\n}\n//# sourceMappingURL=EventEmitter.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class CoreShader {\n // abstract draw(): void;\n static makeCacheKey(props) {\n return false;\n }\n static resolveDefaults(props) {\n return {};\n }\n}\n//# sourceMappingURL=CoreShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion Types\nexport function createShader(glw, type, source) {\n const shader = glw.createShader(type);\n if (!shader) {\n throw new Error();\n }\n glw.shaderSource(shader, source);\n glw.compileShader(shader);\n const success = glw.getShaderParameter(shader, glw.COMPILE_STATUS);\n if (success) {\n return shader;\n }\n console.log(glw.getShaderInfoLog(shader));\n glw.deleteShader(shader);\n}\nexport function createProgram(glw, vertexShader, fragmentShader) {\n const program = glw.createProgram();\n if (!program) {\n throw new Error();\n }\n glw.attachShader(program, vertexShader);\n glw.attachShader(program, fragmentShader);\n glw.linkProgram(program);\n const success = glw.getProgramParameter(program, glw.LINK_STATUS);\n if (success) {\n return program;\n }\n console.log(glw.getProgramInfoLog(program));\n glw.deleteProgram(program);\n return undefined;\n}\n//# sourceMappingURL=ShaderUtils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy, hasOwn } from '../../../utils.js';\nimport { CoreShader } from '../CoreShader.js';\nimport { createProgram, createShader, } from './internal/ShaderUtils.js';\nimport { isWebGl2 } from './internal/WebGlUtils.js';\nexport class WebGlCoreShader extends CoreShader {\n boundBufferCollection = null;\n buffersBound = false;\n program;\n /**\n * Vertex Array Object\n *\n * @remarks\n * Used by WebGL2 Only\n */\n vao;\n renderer;\n glw;\n attributeBuffers;\n attributeLocations;\n attributeNames;\n uniformLocations;\n uniformTypes;\n supportsIndexedTextures;\n constructor(options) {\n super();\n const renderer = (this.renderer = options.renderer);\n const glw = (this.glw = this.renderer.glw);\n this.supportsIndexedTextures = options.supportsIndexedTextures || false;\n // Check that extensions are supported\n const webGl2 = glw.isWebGl2();\n const requiredExtensions = (webGl2 && options.webgl2Extensions) ||\n (!webGl2 && options.webgl1Extensions) ||\n [];\n const glVersion = webGl2 ? '2.0' : '1.0';\n requiredExtensions.forEach((extensionName) => {\n if (!glw.getExtension(extensionName)) {\n throw new Error(`Shader \"${this.constructor.name}\" requires extension \"${extensionName}\" for WebGL ${glVersion} but wasn't found`);\n }\n });\n // Gather shader sources\n // - If WebGL 2 and special WebGL 2 sources are provided, we copy those sources and delete\n // the extra copy of them to save memory.\n // TODO: This could be further made optimal by just caching the compiled shaders and completely deleting\n // the source code\n const shaderSources = options.shaderSources ||\n this.constructor.shaderSources;\n if (!shaderSources) {\n throw new Error(`Shader \"${this.constructor.name}\" is missing shaderSources.`);\n }\n else if (webGl2 && shaderSources?.webGl2) {\n shaderSources.fragment = shaderSources.webGl2.fragment;\n shaderSources.vertex = shaderSources.webGl2.vertex;\n delete shaderSources.webGl2;\n }\n const textureUnits = renderer.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS;\n const vertexSource = shaderSources.vertex instanceof Function\n ? shaderSources.vertex(textureUnits)\n : shaderSources.vertex;\n const fragmentSource = shaderSources.fragment instanceof Function\n ? shaderSources.fragment(textureUnits)\n : shaderSources.fragment;\n const vertexShader = createShader(glw, glw.VERTEX_SHADER, vertexSource);\n const fragmentShader = createShader(glw, glw.FRAGMENT_SHADER, fragmentSource);\n if (!vertexShader || !fragmentShader) {\n throw new Error();\n }\n const program = createProgram(glw, vertexShader, fragmentShader);\n if (!program) {\n throw new Error();\n }\n this.program = program;\n if (webGl2) {\n const vao = glw.createVertexArray();\n if (!vao) {\n throw new Error();\n }\n this.vao = vao;\n glw.bindVertexArray(this.vao);\n }\n this.attributeLocations = {};\n this.attributeBuffers = {};\n this.attributeNames = [];\n [...options.attributes].forEach((attributeName) => {\n const location = glw.getAttribLocation(this.program, attributeName);\n if (location < 0) {\n throw new Error(`${this.constructor.name}: Vertex shader must have an attribute \"${attributeName}\"!`);\n }\n const buffer = glw.createBuffer();\n if (!buffer) {\n throw new Error(`${this.constructor.name}: Could not create buffer for attribute \"${attributeName}\"`);\n }\n this.attributeLocations[attributeName] = location;\n this.attributeBuffers[attributeName] = buffer;\n this.attributeNames.push(attributeName);\n });\n this.uniformLocations = {};\n this.uniformTypes = {};\n options.uniforms.forEach((uniform) => {\n const location = glw.getUniformLocation(this.program, uniform.name);\n this.uniformTypes[uniform.name] = uniform.uniform;\n if (!location) {\n console.warn(`Shader \"${this.constructor.name}\" could not get uniform location for \"${uniform.name}\"`);\n return;\n }\n this.uniformLocations[uniform.name] = location;\n });\n }\n bindBufferAttribute(location, buffer, attribute) {\n const { glw } = this;\n glw.enableVertexAttribArray(location);\n glw.vertexAttribPointer(buffer, location, attribute.size, attribute.type, attribute.normalized, attribute.stride, attribute.offset);\n }\n disableAttribute(location) {\n this.glw.disableVertexAttribArray(location);\n }\n disableAttributes() {\n for (const loc in this.attributeLocations) {\n this.disableAttribute(this.attributeLocations[loc]);\n }\n this.boundBufferCollection = null;\n }\n /**\n * Given two sets of Shader props destined for this Shader, determine if they can be batched together\n * to reduce the number of draw calls.\n *\n * @remarks\n * This is used by the {@link WebGlCoreRenderer} to determine if it can batch multiple consecutive draw\n * calls into a single draw call.\n *\n * By default, this returns false (meaning no batching is allowed), but can be\n * overridden by child classes to provide more efficient batching.\n *\n * @param propsA\n * @param propsB\n * @returns\n */\n canBatchShaderProps(propsA, propsB) {\n return false;\n }\n bindRenderOp(renderOp, props) {\n this.bindBufferCollection(renderOp.buffers);\n if (renderOp.textures.length > 0) {\n this.bindTextures(renderOp.textures);\n }\n const { glw } = renderOp;\n // Bind standard automatic uniforms\n this.setUniform('u_resolution', [glw.canvas.width, glw.canvas.height]);\n this.setUniform('u_pixelRatio', renderOp.options.pixelRatio);\n if (props) {\n // Bind optional automatic uniforms\n // These are only bound if their keys are present in the props.\n if (hasOwn(props, '$dimensions')) {\n let dimensions = props.$dimensions;\n if (!dimensions) {\n dimensions = renderOp.dimensions;\n }\n this.setUniform('u_dimensions', [dimensions.width, dimensions.height]);\n }\n if (hasOwn(props, '$alpha')) {\n let alpha = props.$alpha;\n if (!alpha) {\n alpha = renderOp.alpha;\n }\n this.setUniform('u_alpha', alpha);\n }\n this.bindProps(props);\n }\n }\n setUniform(name, ...value) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-unsafe-argument\n this.glw.setUniform(this.uniformTypes[name], this.uniformLocations[name], ...value);\n }\n bindBufferCollection(buffer) {\n if (this.boundBufferCollection === buffer) {\n return;\n }\n for (const attributeName in this.attributeLocations) {\n const resolvedBuffer = buffer.getBuffer(attributeName);\n const resolvedInfo = buffer.getAttributeInfo(attributeName);\n assertTruthy(resolvedBuffer, `Buffer for \"${attributeName}\" not found`);\n assertTruthy(resolvedInfo);\n this.bindBufferAttribute(this.attributeLocations[attributeName], resolvedBuffer, resolvedInfo);\n }\n this.boundBufferCollection = buffer;\n }\n bindProps(props) {\n // Implement in child class\n }\n bindTextures(textures) {\n // no defaults\n }\n attach() {\n this.glw.useProgram(this.program);\n this.glw.useProgram(this.program);\n if (this.glw.isWebGl2() && this.vao) {\n this.glw.bindVertexArray(this.vao);\n }\n }\n detach() {\n this.disableAttributes();\n }\n static shaderSources;\n}\n//# sourceMappingURL=WebGlCoreShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EventEmitter } from '../../common/EventEmitter.js';\n/**\n * Represents a source of texture data for a CoreContextTexture.\n *\n * @remarks\n * Texture sources are used to populate a CoreContextTexture when that texture\n * is loaded. Texture data retrieved by the CoreContextTexture by the\n * `getTextureData` method. It's the responsibility of the concerete `Texture`\n * subclass to implement this method appropriately.\n */\nexport class Texture extends EventEmitter {\n txManager;\n /**\n * The dimensions of the texture\n *\n * @remarks\n * Until the texture data is loaded for the first time the value will be\n * `null`.\n */\n dimensions = null;\n error = null;\n state = 'freed';\n renderableOwners = new Set();\n constructor(txManager) {\n super();\n this.txManager = txManager;\n }\n /**\n * Add/remove an owner to/from the Texture based on its renderability.\n *\n * @remarks\n * Any object can own a texture, be it a CoreNode or even the state object\n * from a Text Renderer.\n *\n * When the reference to the texture that an owner object holds is replaced\n * or cleared it must call this with `renderable=false` to release the owner\n * association.\n *\n * @param owner\n * @param renderable\n */\n setRenderableOwner(owner, renderable) {\n if (renderable) {\n this.renderableOwners.add(owner);\n }\n else {\n this.renderableOwners.delete(owner);\n }\n }\n /**\n * Returns true if the texture is assigned to any Nodes that are renderable.\n */\n get renderable() {\n return this.renderableOwners.size > 0;\n }\n /**\n * Set the state of the texture\n *\n * @remark\n * Intended for internal-use only but declared public so that it can be set\n * by it's associated {@link CoreContextTexture}\n *\n * @param state\n * @param args\n */\n setState(state, ...args) {\n if (this.state !== state) {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.state = state;\n if (state === 'loaded') {\n const loadedArgs = args;\n this.dimensions = loadedArgs[0];\n }\n else if (state === 'failed') {\n const failedArgs = args;\n this.error = failedArgs[0];\n }\n this.emit(state, ...args);\n }\n }\n /**\n * Make a cache key for this texture.\n *\n * @remarks\n * Each concrete `Texture` subclass must implement this method to provide an\n * appropriate cache key for the texture type including the texture's\n * properties that uniquely identify a copy of the texture. If the texture\n * type does not support caching, then this method should return `false`.\n *\n * @param props\n * @returns\n * A cache key for this texture or `false` if the texture type does not\n * support caching.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static makeCacheKey(props) {\n return false;\n }\n /**\n * Resolve the default values for the texture's properties.\n *\n * @remarks\n * Each concrete `Texture` subclass must implement this method to provide\n * default values for the texture's optional properties.\n *\n * @param props\n * @returns\n * The default values for the texture's properties.\n */\n static resolveDefaults(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n props) {\n return {};\n }\n}\n//# sourceMappingURL=Texture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EventEmitter } from '../../../common/EventEmitter.js';\nexport class TrFontFace extends EventEmitter {\n fontFamily;\n descriptors;\n loaded = false;\n constructor(fontFamily, descriptors) {\n super();\n this.fontFamily = fontFamily;\n this.descriptors = {\n style: 'normal',\n weight: 'normal',\n stretch: 'normal',\n ...descriptors,\n };\n }\n /**\n * Convert a TrFontFaceDescriptors to a FontFaceDescriptors which differ slightly\n *\n * @param descriptors\n * @returns\n */\n static convertToCssFontFaceDescriptors(descriptors) {\n return {\n style: descriptors.style,\n weight: typeof descriptors.weight === 'number'\n ? `${descriptors.weight}`\n : descriptors.weight,\n stretch: descriptors.stretch,\n unicodeRange: descriptors.unicodeRange,\n variant: descriptors.variant,\n featureSettings: descriptors.featureSettings,\n display: descriptors.display,\n };\n }\n}\n//# sourceMappingURL=TrFontFace.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { TrFontFace } from './TrFontFace.js';\nexport class WebTrFontFace extends TrFontFace {\n fontFace;\n fontUrl;\n constructor(fontFamily, descriptors, fontUrl) {\n super(fontFamily, descriptors);\n // Filter out parentheses from fontUrl\n const fontUrlWithoutParentheses = fontUrl.replace(/\\(|\\)/g, '');\n // Defaults for descriptors resolved in the super constructor\n const determinedDescriptors = this.descriptors;\n // Convert TrFontFaceDescriptors to CSS FontFaceDescriptors\n const cssDescriptors = {\n style: determinedDescriptors.style,\n weight: typeof determinedDescriptors.weight === 'number'\n ? `${determinedDescriptors.weight}`\n : determinedDescriptors.weight,\n stretch: determinedDescriptors.stretch,\n unicodeRange: determinedDescriptors.unicodeRange,\n variant: determinedDescriptors.variant,\n featureSettings: determinedDescriptors.featureSettings,\n display: determinedDescriptors.display,\n };\n const fontFace = new FontFace(fontFamily, `url(${fontUrlWithoutParentheses})`, cssDescriptors);\n fontFace\n .load()\n .then(() => {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.loaded = true;\n this.emit('loaded');\n })\n .catch(console.error);\n this.fontFace = fontFace;\n this.fontUrl = fontUrl;\n }\n}\n//# sourceMappingURL=WebTrFontFace.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class CoreContextTexture {\n memManager;\n textureSource;\n constructor(memManager, textureSource) {\n this.memManager = memManager;\n this.textureSource = textureSource;\n }\n}\n//# sourceMappingURL=CoreContextTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreContextTexture } from './CoreContextTexture.js';\nexport class CoreRenderer {\n stage;\n constructor(stage) {\n this.stage = stage;\n }\n}\n//# sourceMappingURL=CoreRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class CoreRenderOp {\n}\n//# sourceMappingURL=CoreRenderOp.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreRenderOp } from '../CoreRenderOp.js';\nimport { WebGlCoreShader } from './WebGlCoreShader.js';\nconst MAX_TEXTURES = 8; // TODO: get from gl\n/**\n * Can render multiple quads with multiple textures (up to vertex shader texture limit)\n *\n */\nexport class WebGlCoreRenderOp extends CoreRenderOp {\n glw;\n options;\n buffers;\n shader;\n shaderProps;\n alpha;\n clippingRect;\n dimensions;\n bufferIdx;\n zIndex;\n length = 0;\n numQuads = 0;\n textures = [];\n maxTextures;\n constructor(glw, options, buffers, shader, shaderProps, alpha, clippingRect, dimensions, bufferIdx, zIndex) {\n super();\n this.glw = glw;\n this.options = options;\n this.buffers = buffers;\n this.shader = shader;\n this.shaderProps = shaderProps;\n this.alpha = alpha;\n this.clippingRect = clippingRect;\n this.dimensions = dimensions;\n this.bufferIdx = bufferIdx;\n this.zIndex = zIndex;\n this.maxTextures = shader.supportsIndexedTextures\n ? glw.getParameter(glw.MAX_VERTEX_TEXTURE_IMAGE_UNITS)\n : 1;\n }\n addTexture(texture) {\n const { textures, maxTextures } = this;\n const existingIdx = textures.findIndex((t) => t === texture);\n if (existingIdx !== -1) {\n return existingIdx;\n }\n const newIdx = textures.length;\n if (newIdx >= maxTextures) {\n return 0xffffffff;\n }\n this.textures.push(texture);\n return newIdx;\n }\n draw() {\n const { glw, shader, shaderProps, options } = this;\n // shaderOp.draw(this);\n const { shManager } = options;\n shManager.useShader(shader);\n shader.bindRenderOp(this, shaderProps);\n // TODO: Reduce calculations required\n const quadIdx = (this.bufferIdx / 24) * 6 * 2;\n // Clipping\n if (this.clippingRect.valid) {\n const { x, y, width, height } = this.clippingRect;\n const pixelRatio = options.pixelRatio;\n const canvasHeight = options.canvas.height;\n const clipX = Math.round(x * pixelRatio);\n const clipWidth = Math.round(width * pixelRatio);\n const clipHeight = Math.round(height * pixelRatio);\n const clipY = Math.round(canvasHeight - clipHeight - y * pixelRatio);\n glw.setScissorTest(true);\n glw.scissor(clipX, clipY, clipWidth, clipHeight);\n }\n else {\n glw.setScissorTest(false);\n }\n glw.drawElements(glw.TRIANGLES, 6 * this.numQuads, glw.UNSIGNED_SHORT, quadIdx);\n }\n}\n//# sourceMappingURL=WebGlCoreRenderOp.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Get device specific webgl parameters\n * @param glw\n */\nexport function getWebGlParameters(glw) {\n const params = {\n MAX_RENDERBUFFER_SIZE: 0,\n MAX_TEXTURE_SIZE: 0,\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any\n MAX_VIEWPORT_DIMS: 0,\n MAX_VERTEX_TEXTURE_IMAGE_UNITS: 0,\n MAX_TEXTURE_IMAGE_UNITS: 0,\n MAX_COMBINED_TEXTURE_IMAGE_UNITS: 0,\n MAX_VERTEX_ATTRIBS: 0,\n MAX_VARYING_VECTORS: 0,\n MAX_VERTEX_UNIFORM_VECTORS: 0,\n MAX_FRAGMENT_UNIFORM_VECTORS: 0,\n };\n // Map over all parameters and get them\n const keys = Object.keys(params);\n keys.forEach((key) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n params[key] = glw.getParameter(glw[key]);\n });\n return params;\n}\n/**\n * Get device webgl extensions\n * @param glw\n */\nexport function getWebGlExtensions(glw) {\n const extensions = {\n ANGLE_instanced_arrays: null,\n WEBGL_compressed_texture_s3tc: null,\n WEBGL_compressed_texture_astc: null,\n WEBGL_compressed_texture_etc: null,\n WEBGL_compressed_texture_etc1: null,\n WEBGL_compressed_texture_pvrtc: null,\n WEBKIT_WEBGL_compressed_texture_pvrtc: null,\n WEBGL_compressed_texture_s3tc_srgb: null,\n OES_vertex_array_object: null,\n };\n // Map over all extensions and get them\n const keys = Object.keys(extensions);\n keys.forEach((key) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n extensions[key] = glw.getExtension(key);\n });\n return extensions;\n}\n/**\n * Allocate big memory chunk that we\n * can re-use to draw quads\n *\n * @param glw\n * @param size\n */\nexport function createIndexBuffer(glw, size) {\n const maxQuads = ~~(size / 80);\n const indices = new Uint16Array(maxQuads * 6);\n for (let i = 0, j = 0; i < maxQuads; i += 6, j += 4) {\n indices[i] = j;\n indices[i + 1] = j + 1;\n indices[i + 2] = j + 2;\n indices[i + 3] = j + 2;\n indices[i + 4] = j + 1;\n indices[i + 5] = j + 3;\n }\n const buffer = glw.createBuffer();\n glw.elementArrayBufferData(buffer, indices, glw.STATIC_DRAW);\n}\n/**\n * Checks if an object is of type HTMLImageElement.\n * This is used because we cant check for HTMLImageElement directly when the\n * renderer is running in a seperate web worker context.\n *\n * @param obj\n * @returns\n */\nexport function isHTMLImageElement(obj) {\n return (obj !== null &&\n typeof obj === 'object' &&\n obj.constructor &&\n obj.constructor.name === 'HTMLImageElement');\n}\n//# sourceMappingURL=RendererUtils.js.map","/**\n * Memize options object.\n *\n * @typedef MemizeOptions\n *\n * @property {number} [maxSize] Maximum size of the cache.\n */\n\n/**\n * Internal cache entry.\n *\n * @typedef MemizeCacheNode\n *\n * @property {?MemizeCacheNode|undefined} [prev] Previous node.\n * @property {?MemizeCacheNode|undefined} [next] Next node.\n * @property {Array<*>} args Function arguments for cache\n * entry.\n * @property {*} val Function result.\n */\n\n/**\n * Properties of the enhanced function for controlling cache.\n *\n * @typedef MemizeMemoizedFunction\n *\n * @property {()=>void} clear Clear the cache.\n */\n\n/**\n * Accepts a function to be memoized, and returns a new memoized function, with\n * optional options.\n *\n * @template {(...args: any[]) => any} F\n *\n * @param {F} fn Function to memoize.\n * @param {MemizeOptions} [options] Options object.\n *\n * @return {((...args: Parameters) => ReturnType) & MemizeMemoizedFunction} Memoized function.\n */\nfunction memize(fn, options) {\n\tvar size = 0;\n\n\t/** @type {?MemizeCacheNode|undefined} */\n\tvar head;\n\n\t/** @type {?MemizeCacheNode|undefined} */\n\tvar tail;\n\n\toptions = options || {};\n\n\tfunction memoized(/* ...args */) {\n\t\tvar node = head,\n\t\t\tlen = arguments.length,\n\t\t\targs,\n\t\t\ti;\n\n\t\tsearchCache: while (node) {\n\t\t\t// Perform a shallow equality test to confirm that whether the node\n\t\t\t// under test is a candidate for the arguments passed. Two arrays\n\t\t\t// are shallowly equal if their length matches and each entry is\n\t\t\t// strictly equal between the two sets. Avoid abstracting to a\n\t\t\t// function which could incur an arguments leaking deoptimization.\n\n\t\t\t// Check whether node arguments match arguments length\n\t\t\tif (node.args.length !== arguments.length) {\n\t\t\t\tnode = node.next;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Check whether node arguments match arguments values\n\t\t\tfor (i = 0; i < len; i++) {\n\t\t\t\tif (node.args[i] !== arguments[i]) {\n\t\t\t\t\tnode = node.next;\n\t\t\t\t\tcontinue searchCache;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// At this point we can assume we've found a match\n\n\t\t\t// Surface matched node to head if not already\n\t\t\tif (node !== head) {\n\t\t\t\t// As tail, shift to previous. Must only shift if not also\n\t\t\t\t// head, since if both head and tail, there is no previous.\n\t\t\t\tif (node === tail) {\n\t\t\t\t\ttail = node.prev;\n\t\t\t\t}\n\n\t\t\t\t// Adjust siblings to point to each other. If node was tail,\n\t\t\t\t// this also handles new tail's empty `next` assignment.\n\t\t\t\t/** @type {MemizeCacheNode} */ (node.prev).next = node.next;\n\t\t\t\tif (node.next) {\n\t\t\t\t\tnode.next.prev = node.prev;\n\t\t\t\t}\n\n\t\t\t\tnode.next = head;\n\t\t\t\tnode.prev = null;\n\t\t\t\t/** @type {MemizeCacheNode} */ (head).prev = node;\n\t\t\t\thead = node;\n\t\t\t}\n\n\t\t\t// Return immediately\n\t\t\treturn node.val;\n\t\t}\n\n\t\t// No cached value found. Continue to insertion phase:\n\n\t\t// Create a copy of arguments (avoid leaking deoptimization)\n\t\targs = new Array(len);\n\t\tfor (i = 0; i < len; i++) {\n\t\t\targs[i] = arguments[i];\n\t\t}\n\n\t\tnode = {\n\t\t\targs: args,\n\n\t\t\t// Generate the result from original function\n\t\t\tval: fn.apply(null, args),\n\t\t};\n\n\t\t// Don't need to check whether node is already head, since it would\n\t\t// have been returned above already if it was\n\n\t\t// Shift existing head down list\n\t\tif (head) {\n\t\t\thead.prev = node;\n\t\t\tnode.next = head;\n\t\t} else {\n\t\t\t// If no head, follows that there's no tail (at initial or reset)\n\t\t\ttail = node;\n\t\t}\n\n\t\t// Trim tail if we're reached max size and are pending cache insertion\n\t\tif (size === /** @type {MemizeOptions} */ (options).maxSize) {\n\t\t\ttail = /** @type {MemizeCacheNode} */ (tail).prev;\n\t\t\t/** @type {MemizeCacheNode} */ (tail).next = null;\n\t\t} else {\n\t\t\tsize++;\n\t\t}\n\n\t\thead = node;\n\n\t\treturn node.val;\n\t}\n\n\tmemoized.clear = function () {\n\t\thead = null;\n\t\ttail = null;\n\t\tsize = 0;\n\t};\n\n\t// Ignore reason: There's not a clear solution to create an intersection of\n\t// the function with additional properties, where the goal is to retain the\n\t// function signature of the incoming argument and add control properties\n\t// on the return value.\n\n\t// @ts-ignore\n\treturn memoized;\n}\n\nexport { memize as default };\n","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Core Utility Functions\n *\n * @module\n */\nimport memo from 'memize';\nexport const EPSILON = 0.000001;\nexport let ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array;\nexport const RANDOM = Math.random;\nexport const ANGLE_ORDER = 'zyx';\nconst degree = Math.PI / 180;\nexport const setMatrixArrayType = (type) => {\n ARRAY_TYPE = type;\n};\nexport const toRadian = (a) => {\n return a * degree;\n};\nexport const equals = (a, b) => {\n return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b));\n};\nexport const rand = (min, max) => {\n return Math.floor(Math.random() * (max - min + 1) + min);\n};\nexport const isPowerOfTwo = (value) => {\n return value && !(value & (value - 1));\n};\nconst getTimingBezier = (a, b, c, d) => {\n const xc = 3.0 * a;\n const xb = 3.0 * (c - a) - xc;\n const xa = 1.0 - xc - xb;\n const yc = 3.0 * b;\n const yb = 3.0 * (d - b) - yc;\n const ya = 1.0 - yc - yb;\n return function (time) {\n if (time >= 1.0) {\n return 1;\n }\n if (time <= 0) {\n return 0;\n }\n let t = 0.5, cbx, cbxd, dx;\n for (let it = 0; it < 20; it++) {\n cbx = t * (t * (t * xa + xb) + xc);\n dx = time - cbx;\n if (dx > -1e-8 && dx < 1e-8) {\n return t * (t * (t * ya + yb) + yc);\n }\n // Cubic bezier derivative.\n cbxd = t * (t * (3 * xa) + 2 * xb) + xc;\n if (cbxd > 1e-10 && cbxd < 1e-10) {\n // Problematic. Fall back to binary search method.\n break;\n }\n t += dx / cbxd;\n }\n // Fallback: binary search method. This is more reliable when there are near-0 slopes.\n let minT = 0;\n let maxT = 1;\n for (let it = 0; it < 20; it++) {\n t = 0.5 * (minT + maxT);\n cbx = t * (t * (t * xa + xb) + xc);\n dx = time - cbx;\n if (dx > -1e-8 && dx < 1e-8) {\n // Solution found!\n return t * (t * (t * ya + yb) + yc);\n }\n if (dx < 0) {\n maxT = t;\n }\n else {\n minT = t;\n }\n }\n };\n};\nexport const getTimingFunction = memo((str) => {\n switch (str) {\n case 'linear':\n return function (time) {\n return time;\n };\n case 'ease':\n return getTimingBezier(0.25, 0.1, 0.25, 1.0);\n case 'ease-in':\n return getTimingBezier(0.42, 0, 1.0, 1.0);\n case 'ease-out':\n return getTimingBezier(0, 0, 0.58, 1.0);\n case 'ease-in-out':\n return getTimingBezier(0.42, 0, 0.58, 1.0);\n case 'ease-in-sine':\n return getTimingBezier(0.12, 0, 0.39, 0);\n case 'ease-out-sine':\n return getTimingBezier(0.12, 0, 0.39, 0);\n case 'ease-in-out-sine':\n return getTimingBezier(0.37, 0, 0.63, 1);\n case 'ease-in-cubic':\n return getTimingBezier(0.32, 0, 0.67, 0);\n case 'ease-out-cubic':\n return getTimingBezier(0.33, 1, 0.68, 1);\n case 'ease-in-out-cubic':\n return getTimingBezier(0.65, 0, 0.35, 1);\n case 'ease-in-circ':\n return getTimingBezier(0.55, 0, 1, 0.45);\n case 'ease-out-circ':\n return getTimingBezier(0, 0.55, 0.45, 1);\n case 'ease-in-out-circ':\n return getTimingBezier(0.85, 0, 0.15, 1);\n case 'ease-in-back':\n return getTimingBezier(0.36, 0, 0.66, -0.56);\n case 'ease-out-back':\n return getTimingBezier(0.34, 1.56, 0.64, 1);\n case 'ease-in-out-back':\n return getTimingBezier(0.68, -0.6, 0.32, 1.6);\n case 'step-start':\n return function () {\n return 1;\n };\n case 'step-end':\n return function (time) {\n return time === 1 ? 1 : 0;\n };\n default:\n // eslint-disable-next-line no-case-declarations\n const s = 'cubic-bezier(';\n if (str && str.indexOf(s) === 0) {\n const parts = str\n .substr(s.length, str.length - s.length - 1)\n .split(',');\n if (parts.length !== 4) {\n console.warn('Unknown timing function: ' + str);\n // Fallback: use linear.\n return function (time) {\n return time;\n };\n }\n const a = parseFloat(parts[0] || '0.42');\n const b = parseFloat(parts[1] || '0');\n const c = parseFloat(parts[2] || '1');\n const d = parseFloat(parts[3] || '1');\n if (isNaN(a) || isNaN(b) || isNaN(c) || isNaN(d)) {\n console.warn(' Unknown timing function: ' + str);\n // Fallback: use linear.\n return function (time) {\n return time;\n };\n }\n return getTimingBezier(a, b, c, d);\n }\n else {\n console.warn('Unknown timing function: ' + str);\n // Fallback: use linear.\n return function (time) {\n return time;\n };\n }\n }\n});\nif (!Math.hypot)\n Math.hypot = (...args) => {\n let y = 0, i = args.length;\n while (i--) {\n y += args[i] * args[i];\n }\n return Math.sqrt(y);\n };\n//# sourceMappingURL=utils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../../utils.js';\nimport { isPowerOfTwo } from '../../utils.js';\nimport { CoreContextTexture } from '../CoreContextTexture.js';\nimport { isHTMLImageElement } from './internal/RendererUtils.js';\nconst TRANSPARENT_TEXTURE_DATA = new Uint8Array([0, 0, 0, 0]);\n/**\n * A wrapper around a WebGLTexture that handles loading the texture data\n * from a Texture source and uploading it to the GPU as well as freeing\n * the uploaded texture.\n *\n * @remarks\n * When accessing the ctxTexture property, the texture will be loaded if\n * it hasn't been already. ctxTexture will always return a valid WebGLTexture\n * and trigger the loading/uploading of the texture's data if it hasn't been\n * loaded yet.\n */\nexport class WebGlCoreCtxTexture extends CoreContextTexture {\n glw;\n _nativeCtxTexture = null;\n _state = 'freed';\n _w = 0;\n _h = 0;\n constructor(glw, memManager, textureSource) {\n super(memManager, textureSource);\n this.glw = glw;\n }\n get ctxTexture() {\n if (this._state === 'freed') {\n this.load();\n }\n assertTruthy(this._nativeCtxTexture);\n return this._nativeCtxTexture;\n }\n get renderable() {\n return this.textureSource.renderable;\n }\n get w() {\n return this._w;\n }\n get h() {\n return this._h;\n }\n /**\n * Load the texture data from the Texture source and upload it to the GPU\n *\n * @remarks\n * This method is called automatically when accessing the ctxTexture property\n * if the texture hasn't been loaded yet. But it can also be called manually\n * to force the texture to be pre-loaded prior to accessing the ctxTexture\n * property.\n */\n load() {\n // If the texture is already loading or loaded, don't load it again.\n if (this._state === 'loading' || this._state === 'loaded') {\n return;\n }\n this._state = 'loading';\n this.textureSource.setState('loading');\n this._nativeCtxTexture = this.createNativeCtxTexture();\n this.onLoadRequest()\n .then(({ width, height }) => {\n if (this._state === 'freed') {\n return;\n }\n this._state = 'loaded';\n this._w = width;\n this._h = height;\n // Update the texture source's width and height so that it can be used\n // for rendering.\n this.textureSource.setState('loaded', { width, height });\n })\n .catch((err) => {\n this._state = 'failed';\n this.textureSource.setState('failed', err);\n console.error(err);\n });\n }\n /**\n * Called when the texture data needs to be loaded and uploaded to a texture\n */\n async onLoadRequest() {\n const { glw, memManager } = this;\n // On initial load request, create a 1x1 transparent texture to use until\n // the texture data is finally loaded.\n glw.activeTexture(0);\n glw.bindTexture(this._nativeCtxTexture);\n // linear texture filtering\n glw.texParameteri(glw.TEXTURE_MAG_FILTER, glw.LINEAR);\n glw.texParameteri(glw.TEXTURE_MIN_FILTER, glw.LINEAR);\n // texture wrapping method\n glw.texParameteri(glw.TEXTURE_WRAP_S, glw.CLAMP_TO_EDGE);\n glw.texParameteri(glw.TEXTURE_WRAP_T, glw.CLAMP_TO_EDGE);\n glw.texImage2D(0, glw.RGBA, 1, 1, 0, glw.RGBA, glw.UNSIGNED_BYTE, TRANSPARENT_TEXTURE_DATA);\n memManager.setTextureMemUse(this, TRANSPARENT_TEXTURE_DATA.byteLength);\n const textureData = await this.textureSource?.getTextureData();\n // If the texture has been freed while loading, return early.\n if (!this._nativeCtxTexture) {\n assertTruthy(this._state === 'freed');\n return { width: 0, height: 0 };\n }\n let width = 0;\n let height = 0;\n assertTruthy(this._nativeCtxTexture);\n glw.activeTexture(0);\n // If textureData is null, the texture is empty (0, 0) and we don't need to\n // upload any data to the GPU.\n if (textureData.data instanceof ImageBitmap ||\n textureData.data instanceof ImageData ||\n // not using typeof HTMLImageElement due to web worker\n isHTMLImageElement(textureData.data)) {\n const data = textureData.data;\n width = data.width;\n height = data.height;\n glw.bindTexture(this._nativeCtxTexture);\n glw.pixelStorei(glw.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !!textureData.premultiplyAlpha);\n glw.texImage2D(0, glw.RGBA, glw.RGBA, glw.UNSIGNED_BYTE, data);\n memManager.setTextureMemUse(this, width * height * 4);\n // generate mipmaps for power-of-2 textures or in WebGL2RenderingContext\n if (glw.isWebGl2() || (isPowerOfTwo(width) && isPowerOfTwo(height))) {\n glw.generateMipmap();\n }\n }\n else if (textureData.data === null) {\n width = 0;\n height = 0;\n // Reset to a 1x1 transparent texture\n glw.bindTexture(this._nativeCtxTexture);\n glw.texImage2D(0, glw.RGBA, 1, 1, 0, glw.RGBA, glw.UNSIGNED_BYTE, TRANSPARENT_TEXTURE_DATA);\n memManager.setTextureMemUse(this, TRANSPARENT_TEXTURE_DATA.byteLength);\n }\n else if ('mipmaps' in textureData.data && textureData.data.mipmaps) {\n const { mipmaps, width = 0, height = 0, type, glInternalFormat, } = textureData.data;\n const view = type === 'ktx'\n ? new DataView(mipmaps[0] ?? new ArrayBuffer(0))\n : mipmaps[0];\n glw.bindTexture(this._nativeCtxTexture);\n glw.compressedTexImage2D(0, glInternalFormat, width, height, 0, view);\n glw.texParameteri(glw.TEXTURE_WRAP_S, glw.CLAMP_TO_EDGE);\n glw.texParameteri(glw.TEXTURE_WRAP_T, glw.CLAMP_TO_EDGE);\n glw.texParameteri(glw.TEXTURE_MAG_FILTER, glw.LINEAR);\n glw.texParameteri(glw.TEXTURE_MIN_FILTER, glw.LINEAR);\n memManager.setTextureMemUse(this, view.byteLength);\n }\n else {\n console.error(`WebGlCoreCtxTexture.onLoadRequest: Unexpected textureData returned`, textureData);\n }\n return {\n width,\n height,\n };\n }\n /**\n * Free the WebGLTexture from the GPU\n *\n * @returns\n */\n free() {\n if (this._state === 'freed') {\n return;\n }\n this._state = 'freed';\n this.textureSource.setState('freed');\n this._w = 0;\n this._h = 0;\n if (!this._nativeCtxTexture) {\n return;\n }\n const { glw, memManager } = this;\n glw.deleteTexture(this._nativeCtxTexture);\n memManager.setTextureMemUse(this, 0);\n this._nativeCtxTexture = null;\n }\n createNativeCtxTexture() {\n const { glw } = this;\n const nativeTexture = glw.createTexture();\n if (!nativeTexture) {\n throw new Error('Could not create WebGL Texture');\n }\n return nativeTexture;\n }\n}\n//# sourceMappingURL=WebGlCoreCtxTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\n/**\n * Texture consisting of only a 1x1 color pixel\n *\n * @remarks\n * The pixel color is set with the {@link ColorTextureProps.color} prop.\n *\n * This is the default texture used for a Node if it's\n * {@link INodeWritableProps.texture} prop is set to `null` (the default)\n *\n * Generally the 1x1 color pixel is stretched to whatever the set dimensions of\n * a Node are.\n */\nexport class ColorTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = ColorTexture.resolveDefaults(props || {});\n }\n get color() {\n return this.props.color;\n }\n set color(color) {\n this.props.color = color;\n }\n async getTextureData() {\n const pixelData32 = new Uint32Array([this.color]);\n const pixelData8 = new Uint8ClampedArray(pixelData32.buffer);\n return {\n data: new ImageData(pixelData8, 1, 1),\n premultiplyAlpha: true,\n };\n }\n static makeCacheKey(props) {\n const resolvedProps = ColorTexture.resolveDefaults(props);\n return `ColorTexture,${resolvedProps.color}`;\n }\n static resolveDefaults(props) {\n return {\n color: props.color || 0xffffffff,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=ColorTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture, } from './Texture.js';\n/**\n * A Texture that is a sub-region of another Texture.\n *\n * @remarks\n * The parent texture can be a Sprite Sheet/Texture Atlas and set using the\n * {@link SubTextureProps.texture} prop. The sub-region relative to the parent\n * texture is defined with the {@link SubTextureProps.x},\n * {@link SubTextureProps.y}, {@link SubTextureProps.width}, and\n * {@link SubTextureProps.height} pixel values.\n */\nexport class SubTexture extends Texture {\n props;\n parentTexture;\n constructor(txManager, props) {\n super(txManager);\n this.parentTexture = this.txManager.loadTexture(props.texture.txType, props.texture.props, props.texture.options);\n this.props = SubTexture.resolveDefaults(props || {});\n // If parent texture is already loaded / failed, trigger loaded event manually\n // so that users get a consistent event experience.\n // We do this in a microtask to allow listeners to be attached in the same\n // synchronous task after calling loadTexture()\n queueMicrotask(() => {\n const parentTx = this.parentTexture;\n if (parentTx.state === 'loaded') {\n this.onParentTxLoaded(parentTx, parentTx.dimensions);\n }\n else if (parentTx.state === 'failed') {\n this.onParentTxFailed(parentTx, parentTx.error);\n }\n parentTx.on('loaded', this.onParentTxLoaded);\n parentTx.on('failed', this.onParentTxFailed);\n });\n }\n onParentTxLoaded = () => {\n // We ignore the parent's passed dimensions, and simply use the SubTexture's\n // configured dimensions (because that's all that matters here)\n this.setState('loaded', {\n width: this.props.width,\n height: this.props.height,\n });\n };\n onParentTxFailed = (target, error) => {\n this.setState('failed', error);\n };\n async getTextureData() {\n return {\n data: this.props,\n };\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static makeCacheKey(props) {\n return false;\n }\n static resolveDefaults(props) {\n return {\n texture: props.texture,\n x: props.x || 0,\n y: props.y || 0,\n width: props.width || 0,\n height: props.height || 0,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=SubTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreCtxTexture } from './WebGlCoreCtxTexture.js';\nexport class WebGlCoreCtxSubTexture extends WebGlCoreCtxTexture {\n constructor(glw, memManager, textureSource) {\n super(glw, memManager, textureSource);\n }\n async onLoadRequest() {\n const props = await this.textureSource.getTextureData();\n return {\n width: props.data?.width || 0,\n height: props.data?.height || 0,\n };\n }\n}\n//# sourceMappingURL=WebGlCoreCtxSubTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Represents a collection of WebGL Buffers along with their associated\n * vertex attribute formats.\n */\nexport class BufferCollection {\n config;\n constructor(config) {\n this.config = config;\n }\n /**\n * Get the WebGLBuffer associated with the given attribute name if it exists.\n *\n * @param attributeName\n * @returns\n */\n getBuffer(attributeName) {\n return this.config.find((item) => item.attributes[attributeName])?.buffer;\n }\n /**\n * Get the AttributeInfo associated with the given attribute name if it exists.\n *\n * @param attributeName\n * @returns\n */\n getAttributeInfo(attributeName) {\n return this.config.find((item) => item.attributes[attributeName])\n ?.attributes[attributeName];\n }\n}\n//# sourceMappingURL=BufferCollection.js.map","/* eslint-disable @typescript-eslint/no-unsafe-return */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-unsafe-argument */\nimport { assertTruthy } from '../../utils.js';\nimport { isWebGl2 } from '../renderers/webgl/internal/WebGlUtils.js';\n/**\n * Optimized WebGL Context Wrapper\n *\n * @remarks\n * This class contains the subset of the WebGLRenderingContext & WebGL2RenderingContext\n * API that is used by the renderer. Select high volume WebGL methods include\n * caching optimizations to avoid making WebGL calls if the state is already set\n * to the desired value.\n *\n * While most methods contained are direct passthroughs to the WebGL context,\n * some methods combine multiple WebGL calls into one for convenience, modify\n * arguments to be more convenient, or are replaced by more specific methods.\n *\n * Not all methods are optimized. Only methods that are called frequently\n * and/or have a high cost are optimized.\n *\n * A subset of GLenum constants are also exposed as properties on this class\n * for convenience.\n */\nexport class WebGlContextWrapper {\n gl;\n //#region Cached WebGL State\n activeTextureUnit = 0;\n texture2dUnits;\n texture2dParams = new WeakMap();\n scissorEnabled;\n scissorX;\n scissorY;\n scissorWidth;\n scissorHeight;\n blendEnabled;\n blendSrcRgb;\n blendDstRgb;\n blendSrcAlpha;\n blendDstAlpha;\n boundArrayBuffer;\n boundElementArrayBuffer;\n curProgram;\n programUniforms = new WeakMap();\n //#endregion Cached WebGL State\n //#region Canvas\n canvas;\n //#endregion Canvas\n //#region WebGL Enums\n MAX_RENDERBUFFER_SIZE;\n MAX_TEXTURE_SIZE;\n MAX_VIEWPORT_DIMS;\n MAX_VERTEX_TEXTURE_IMAGE_UNITS;\n MAX_TEXTURE_IMAGE_UNITS;\n MAX_COMBINED_TEXTURE_IMAGE_UNITS;\n MAX_VERTEX_ATTRIBS;\n MAX_VARYING_VECTORS;\n MAX_VERTEX_UNIFORM_VECTORS;\n MAX_FRAGMENT_UNIFORM_VECTORS;\n TEXTURE_MAG_FILTER;\n TEXTURE_MIN_FILTER;\n TEXTURE_WRAP_S;\n TEXTURE_WRAP_T;\n LINEAR;\n CLAMP_TO_EDGE;\n RGBA;\n UNSIGNED_BYTE;\n UNPACK_PREMULTIPLY_ALPHA_WEBGL;\n FLOAT;\n TRIANGLES;\n UNSIGNED_SHORT;\n ONE;\n ONE_MINUS_SRC_ALPHA;\n VERTEX_SHADER;\n FRAGMENT_SHADER;\n STATIC_DRAW;\n COMPILE_STATUS;\n LINK_STATUS;\n DYNAMIC_DRAW;\n //#endregion WebGL Enums\n constructor(gl) {\n this.gl = gl;\n // The following code extracts the current state of the WebGL context\n // to our local JavaScript cached version of it. This is so we can\n // avoid making WebGL calls if we don't need to.\n // We could assume that the WebGL context is in a default state, but\n // in the future we may want to support restoring a broken WebGL context\n // and this will help with that.\n this.activeTextureUnit =\n gl.getParameter(gl.ACTIVE_TEXTURE) - gl.TEXTURE0;\n const maxTextureUnits = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);\n // save current texture units\n this.texture2dUnits = new Array(maxTextureUnits)\n .fill(undefined)\n .map((_, i) => {\n this.activeTexture(i);\n return gl.getParameter(gl.TEXTURE_BINDING_2D);\n });\n // restore active texture unit\n this.activeTexture(this.activeTextureUnit);\n this.scissorEnabled = gl.isEnabled(gl.SCISSOR_TEST);\n const scissorBox = gl.getParameter(gl.SCISSOR_BOX);\n this.scissorX = scissorBox[0];\n this.scissorY = scissorBox[1];\n this.scissorWidth = scissorBox[2];\n this.scissorHeight = scissorBox[3];\n this.blendEnabled = gl.isEnabled(gl.BLEND);\n this.blendSrcRgb = gl.getParameter(gl.BLEND_SRC_RGB);\n this.blendDstRgb = gl.getParameter(gl.BLEND_DST_RGB);\n this.blendSrcAlpha = gl.getParameter(gl.BLEND_SRC_ALPHA);\n this.blendDstAlpha = gl.getParameter(gl.BLEND_DST_ALPHA);\n this.boundArrayBuffer = gl.getParameter(gl.ARRAY_BUFFER_BINDING);\n this.boundElementArrayBuffer = gl.getParameter(gl.ELEMENT_ARRAY_BUFFER_BINDING);\n this.curProgram = gl.getParameter(gl.CURRENT_PROGRAM);\n this.canvas = gl.canvas;\n // Extract GLenums\n this.MAX_RENDERBUFFER_SIZE = gl.MAX_RENDERBUFFER_SIZE;\n this.MAX_TEXTURE_SIZE = gl.MAX_TEXTURE_SIZE;\n this.MAX_VIEWPORT_DIMS = gl.MAX_VIEWPORT_DIMS;\n this.MAX_VERTEX_TEXTURE_IMAGE_UNITS = gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS;\n this.MAX_TEXTURE_IMAGE_UNITS = gl.MAX_TEXTURE_IMAGE_UNITS;\n this.MAX_COMBINED_TEXTURE_IMAGE_UNITS = gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS;\n this.MAX_VERTEX_ATTRIBS = gl.MAX_VERTEX_ATTRIBS;\n this.MAX_VARYING_VECTORS = gl.MAX_VARYING_VECTORS;\n this.MAX_VERTEX_UNIFORM_VECTORS = gl.MAX_VERTEX_UNIFORM_VECTORS;\n this.MAX_FRAGMENT_UNIFORM_VECTORS = gl.MAX_FRAGMENT_UNIFORM_VECTORS;\n this.TEXTURE_MAG_FILTER = gl.TEXTURE_MAG_FILTER;\n this.TEXTURE_MIN_FILTER = gl.TEXTURE_MIN_FILTER;\n this.TEXTURE_WRAP_S = gl.TEXTURE_WRAP_S;\n this.TEXTURE_WRAP_T = gl.TEXTURE_WRAP_T;\n this.LINEAR = gl.LINEAR;\n this.CLAMP_TO_EDGE = gl.CLAMP_TO_EDGE;\n this.RGBA = gl.RGBA;\n this.UNSIGNED_BYTE = gl.UNSIGNED_BYTE;\n this.UNPACK_PREMULTIPLY_ALPHA_WEBGL = gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL;\n this.FLOAT = gl.FLOAT;\n this.TRIANGLES = gl.TRIANGLES;\n this.UNSIGNED_SHORT = gl.UNSIGNED_SHORT;\n this.ONE = gl.ONE;\n this.ONE_MINUS_SRC_ALPHA = gl.ONE_MINUS_SRC_ALPHA;\n this.MAX_VERTEX_TEXTURE_IMAGE_UNITS = gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS;\n this.TRIANGLES = gl.TRIANGLES;\n this.UNSIGNED_SHORT = gl.UNSIGNED_SHORT;\n this.VERTEX_SHADER = gl.VERTEX_SHADER;\n this.FRAGMENT_SHADER = gl.FRAGMENT_SHADER;\n this.STATIC_DRAW = gl.STATIC_DRAW;\n this.COMPILE_STATUS = gl.COMPILE_STATUS;\n this.LINK_STATUS = gl.LINK_STATUS;\n this.DYNAMIC_DRAW = gl.DYNAMIC_DRAW;\n }\n /**\n * Returns true if the WebGL context is WebGL2\n *\n * @returns\n */\n isWebGl2() {\n return isWebGl2(this.gl);\n }\n /**\n * ```\n * gl.activeTexture(textureUnit + gl.TEXTURE0);\n * ```\n *\n * @remarks\n * **WebGL Difference**: `textureUnit` is based from 0, not `gl.TEXTURE0`.\n *\n * @param textureUnit\n */\n activeTexture(textureUnit) {\n const { gl } = this;\n if (this.activeTextureUnit !== textureUnit) {\n gl.activeTexture(textureUnit + gl.TEXTURE0);\n this.activeTextureUnit = textureUnit;\n }\n }\n /**\n * ```\n * gl.bindTexture(gl.TEXTURE_2D, texture);\n * ```\n * @remarks\n * **WebGL Difference**: Bind target is always `gl.TEXTURE_2D`\n *\n * @param texture\n */\n bindTexture(texture) {\n const { gl, activeTextureUnit, texture2dUnits } = this;\n if (texture2dUnits[activeTextureUnit] === texture) {\n return;\n }\n texture2dUnits[activeTextureUnit] = texture;\n gl.bindTexture(this.gl.TEXTURE_2D, texture);\n }\n _getActiveTexture() {\n const { activeTextureUnit, texture2dUnits } = this;\n return texture2dUnits[activeTextureUnit];\n }\n /**\n * ```\n * gl.texParameteri(gl.TEXTURE_2D, pname, param);\n * ```\n * @remarks\n * **WebGL Difference**: Bind target is always `gl.TEXTURE_2D`\n *\n * @param pname\n * @param param\n * @returns\n */\n texParameteri(pname, param) {\n const { gl, texture2dParams } = this;\n const activeTexture = this._getActiveTexture();\n if (!activeTexture) {\n throw new Error('No active texture');\n }\n let textureParams = texture2dParams.get(activeTexture);\n if (!textureParams) {\n textureParams = {};\n texture2dParams.set(activeTexture, textureParams);\n }\n if (textureParams[pname] === param) {\n return;\n }\n textureParams[pname] = param;\n gl.texParameteri(gl.TEXTURE_2D, pname, param);\n }\n texImage2D(level, internalFormat, widthOrFormat, heightOrType, borderOrSource, format, type, pixels) {\n const { gl } = this;\n if (format) {\n gl.texImage2D(gl.TEXTURE_2D, level, internalFormat, widthOrFormat, heightOrType, borderOrSource, format, type, pixels);\n }\n else {\n gl.texImage2D(gl.TEXTURE_2D, level, internalFormat, widthOrFormat, heightOrType, borderOrSource);\n }\n }\n /**\n * ```\n * gl.compressedTexImage2D(gl.TEXTURE_2D, level, internalFormat, width, height, border, data);\n * ```\n *\n * @remarks\n * **WebGL Difference**: Bind target is always `gl.TEXTURE_2D`\n */\n compressedTexImage2D(level, internalformat, width, height, border, data) {\n const { gl } = this;\n gl.compressedTexImage2D(gl.TEXTURE_2D, level, internalformat, width, height, border, data);\n }\n /**\n * ```\n * gl.pixelStorei(pname, param);\n * ```\n *\n * @param pname\n * @param param\n */\n pixelStorei(pname, param) {\n const { gl } = this;\n gl.pixelStorei(pname, param);\n }\n /**\n * ```\n * gl.generateMipmap(gl.TEXTURE_2D);\n * ```\n *\n * @remarks\n * **WebGL Difference**: Bind target is always `gl.TEXTURE_2D`\n */\n generateMipmap() {\n const { gl } = this;\n gl.generateMipmap(gl.TEXTURE_2D);\n }\n /**\n * ```\n * gl.createTexture();\n * ```\n *\n * @returns\n */\n createTexture() {\n const { gl } = this;\n return gl.createTexture();\n }\n /**\n * ```\n * gl.deleteTexture(texture);\n * ```\n *\n * @param texture\n */\n deleteTexture(texture) {\n const { gl } = this;\n if (texture) {\n this.texture2dParams.delete(texture);\n }\n gl.deleteTexture(texture);\n }\n /**\n * ```\n * gl.viewport(x, y, width, height);\n * ```\n */\n viewport(x, y, width, height) {\n const { gl } = this;\n gl.viewport(x, y, width, height);\n }\n /**\n * ```\n * gl.clearColor(red, green, blue, alpha);\n * ```\n *\n * @param red\n * @param green\n * @param blue\n * @param alpha\n */\n clearColor(red, green, blue, alpha) {\n const { gl } = this;\n gl.clearColor(red, green, blue, alpha);\n }\n /**\n * ```\n * gl[\"enable\"|\"disable\"](gl.SCISSOR_TEST);\n * ```\n * @param enable\n */\n setScissorTest(enable) {\n const { gl, scissorEnabled } = this;\n if (enable === scissorEnabled) {\n return;\n }\n if (enable) {\n gl.enable(gl.SCISSOR_TEST);\n }\n else {\n gl.disable(gl.SCISSOR_TEST);\n }\n this.scissorEnabled = enable;\n }\n /**\n * ```\n * gl.scissor(x, y, width, height);\n * ```\n *\n * @param x\n * @param y\n * @param width\n * @param height\n */\n scissor(x, y, width, height) {\n const { gl, scissorX, scissorY, scissorWidth, scissorHeight } = this;\n if (x !== scissorX ||\n y !== scissorY ||\n width !== scissorWidth ||\n height !== scissorHeight) {\n gl.scissor(x, y, width, height);\n this.scissorX = x;\n this.scissorY = y;\n this.scissorWidth = width;\n this.scissorHeight = height;\n }\n }\n /**\n * ```\n * gl[\"enable\"|\"disable\"](gl.BLEND);\n * ```\n *\n * @param blend\n * @returns\n */\n setBlend(blend) {\n const { gl, blendEnabled } = this;\n if (blend === blendEnabled) {\n return;\n }\n if (blend) {\n gl.enable(gl.BLEND);\n }\n else {\n gl.disable(gl.BLEND);\n }\n this.blendEnabled = blend;\n }\n /**\n * ```\n * gl.blendFunc(src, dst);\n * ```\n *\n * @param src\n * @param dst\n */\n blendFunc(src, dst) {\n const { gl, blendSrcRgb, blendDstRgb, blendSrcAlpha, blendDstAlpha } = this;\n if (src !== blendSrcRgb ||\n dst !== blendDstRgb ||\n src !== blendSrcAlpha ||\n dst !== blendDstAlpha) {\n gl.blendFunc(src, dst);\n this.blendSrcRgb = src;\n this.blendDstRgb = dst;\n this.blendSrcAlpha = src;\n this.blendDstAlpha = dst;\n }\n }\n /**\n * ```\n * createBuffer();\n * ```\n *\n * @returns\n */\n createBuffer() {\n const { gl } = this;\n return gl.createBuffer();\n }\n /**\n * ```\n * gl.clear(gl.COLOR_BUFFER_BIT);\n * ```\n *\n * @remarks\n * **WebGL Difference**: Clear mask is always `gl.COLOR_BUFFER_BIT`\n */\n clear() {\n const { gl } = this;\n gl.clear(gl.COLOR_BUFFER_BIT);\n }\n /**\n * ```\n * gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n * gl.bufferData(gl.ARRAY_BUFFER, data, usage);\n * ```\n *\n * @remarks\n * **WebGL Combo**: `gl.bindBuffer` and `gl.bufferData` are combined into one function.\n *\n * @param buffer\n * @param data\n * @param usage\n */\n arrayBufferData(buffer, data, usage) {\n const { gl, boundArrayBuffer } = this;\n if (boundArrayBuffer !== buffer) {\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n this.boundArrayBuffer = buffer;\n }\n gl.bufferData(gl.ARRAY_BUFFER, data, usage);\n }\n /**\n * ```\n * gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffer);\n * gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, data, usage);\n * ```\n * @remarks\n * **WebGL Combo**: `gl.bindBuffer` and `gl.bufferData` are combined into one function.\n *\n * @param buffer\n * @param data\n * @param usage\n */\n elementArrayBufferData(buffer, data, usage) {\n const { gl, boundElementArrayBuffer } = this;\n if (boundElementArrayBuffer !== buffer) {\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffer);\n this.boundElementArrayBuffer = buffer;\n }\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, data, usage);\n }\n /**\n * ```\n * gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n * gl.vertexAttribPointer(index, size, type, normalized, stride, offset);\n * ```\n *\n * @remarks\n * **WebGL Combo**: `gl.bindBuffer` and `gl.vertexAttribPointer` are combined into one function.\n *\n * @param buffer\n * @param index\n * @param size\n * @param type\n * @param normalized\n * @param stride\n * @param offset\n */\n vertexAttribPointer(buffer, index, size, type, normalized, stride, offset) {\n const { gl, boundArrayBuffer } = this;\n if (boundArrayBuffer !== buffer) {\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n this.boundArrayBuffer = buffer;\n }\n gl.vertexAttribPointer(index, size, type, normalized, stride, offset);\n }\n /**\n * ```\n * gl.useProgram(program);\n * ```\n *\n * @param program\n * @returns\n */\n useProgram(program) {\n const { gl, curProgram } = this;\n if (curProgram === program) {\n return;\n }\n gl.useProgram(program);\n this.curProgram = program;\n }\n setUniform(type, location, ...args) {\n const { gl, programUniforms } = this;\n let uniforms = programUniforms.get(this.curProgram);\n if (!uniforms) {\n uniforms = new Map();\n programUniforms.set(this.curProgram, uniforms);\n }\n const uniformArgs = uniforms.get(location);\n if (!uniformArgs || !compareArrays(uniformArgs, args)) {\n uniforms.set(location, args);\n gl[type](location, ...args);\n }\n }\n /**\n * ```\n * gl.getParameter(pname);\n * ```\n *\n * @param pname\n * @returns\n */\n getParameter(pname) {\n const { gl } = this;\n return gl.getParameter(pname);\n }\n /**\n * ```\n * gl.drawElements(mode, count, type, offset);\n * ```\n *\n * @param mode\n * @param count\n * @param type\n * @param offset\n */\n drawElements(mode, count, type, offset) {\n const { gl } = this;\n gl.drawElements(mode, count, type, offset);\n }\n /**\n * ```\n * gl.drawArrays(mode, first, count);\n * ```\n *\n * @param name\n * @returns\n */\n getExtension(name) {\n const { gl } = this;\n return gl.getExtension(name);\n }\n /**\n * ```\n * gl.createVertexArray();\n * ```\n *\n * @returns\n */\n createVertexArray() {\n const { gl } = this;\n assertTruthy(gl instanceof WebGL2RenderingContext);\n return gl.createVertexArray();\n }\n /**\n * ```\n * gl.bindVertexArray(vertexArray);\n * ```\n *\n * @param vertexArray\n */\n bindVertexArray(vertexArray) {\n const { gl } = this;\n assertTruthy(gl instanceof WebGL2RenderingContext);\n gl.bindVertexArray(vertexArray);\n }\n /**\n * ```\n * gl.getAttribLocation(program, name);\n * ```\n *\n * @param program\n * @param name\n * @returns\n */\n getAttribLocation(program, name) {\n const { gl } = this;\n return gl.getAttribLocation(program, name);\n }\n /**\n * ```\n * gl.getUniformLocation(program, name);\n * ```\n *\n * @param program\n * @param name\n * @returns\n */\n getUniformLocation(program, name) {\n const { gl } = this;\n return gl.getUniformLocation(program, name);\n }\n /**\n * ```\n * gl.enableVertexAttribArray(index);\n * ```\n *\n * @param index\n */\n enableVertexAttribArray(index) {\n const { gl } = this;\n gl.enableVertexAttribArray(index);\n }\n /**\n * ```\n * gl.disableVertexAttribArray(index);\n * ```\n *\n * @param index\n */\n disableVertexAttribArray(index) {\n const { gl } = this;\n gl.disableVertexAttribArray(index);\n }\n /**\n * ```\n * gl.createShader(type);\n * ```\n *\n * @param type\n * @returns\n */\n createShader(type) {\n const { gl } = this;\n return gl.createShader(type);\n }\n /**\n * ```\n * gl.compileShader(shader);\n * ```\n *\n * @param shader\n * @returns\n */\n compileShader(shader) {\n const { gl } = this;\n gl.compileShader(shader);\n }\n /**\n * ```\n * gl.attachShader(program, shader);\n * ```\n *\n * @param program\n * @param shader\n */\n attachShader(program, shader) {\n const { gl } = this;\n gl.attachShader(program, shader);\n }\n /**\n * ```\n * gl.linkProgram(program);\n * ```\n *\n * @param program\n */\n linkProgram(program) {\n const { gl } = this;\n gl.linkProgram(program);\n }\n /**\n * ```\n * gl.deleteProgram(shader);\n * ```\n *\n * @param shader\n */\n deleteProgram(shader) {\n const { gl } = this;\n gl.deleteProgram(shader);\n }\n /**\n * ```\n * gl.getShaderParameter(shader, pname);\n * ```\n *\n * @param shader\n * @param pname\n */\n getShaderParameter(shader, pname) {\n const { gl } = this;\n return gl.getShaderParameter(shader, pname);\n }\n /**\n * ```\n * gl.getShaderInfoLog(shader);\n * ```\n *\n * @param shader\n */\n getShaderInfoLog(shader) {\n const { gl } = this;\n return gl.getShaderInfoLog(shader);\n }\n /**\n * ```\n * gl.createProgram();\n * ```\n *\n * @returns\n */\n createProgram() {\n const { gl } = this;\n return gl.createProgram();\n }\n /**\n * ```\n * gl.getProgramParameter(program, pname);\n * ```\n *\n * @param program\n * @param pname\n * @returns\n */\n getProgramParameter(program, pname) {\n const { gl } = this;\n return gl.getProgramParameter(program, pname);\n }\n /**\n * ```\n * gl.getProgramInfoLog(program);\n * ```\n *\n * @param program\n * @returns\n */\n getProgramInfoLog(program) {\n const { gl } = this;\n return gl.getProgramInfoLog(program);\n }\n /**\n * ```\n * gl.shaderSource(shader, source);\n * ```\n *\n * @param shader\n * @param source\n */\n shaderSource(shader, source) {\n const { gl } = this;\n gl.shaderSource(shader, source);\n }\n /**\n * ```\n * gl.deleteShader(shader);\n * ```\n *\n * @param shader\n */\n deleteShader(shader) {\n const { gl } = this;\n gl.deleteShader(shader);\n }\n}\n/**\n * Compare two arrays for equality.\n *\n * @remarks\n * This function will not try to compare nested arrays or Float32Arrays and\n * instead will always return false when they are encountered.\n *\n * @param a\n * @param b\n * @returns\n */\nexport function compareArrays(a, b) {\n if (a.length !== b.length) {\n return false;\n }\n return a.every((v, i) => {\n // Don't bother to compare nested arrays or Float32Arrays\n if (Array.isArray(v) || v instanceof Float32Array) {\n return false;\n }\n else {\n return v === b[i];\n }\n });\n}\n//# sourceMappingURL=WebGlContextWrapper.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Generic WebGL Utility Functions\n *\n * @remarks\n * Nothing here should be coupled to Renderer logic / types.\n *\n * @param gl\n * @returns\n */\nexport function isWebGl2(gl) {\n return (self.WebGL2RenderingContext && gl instanceof self.WebGL2RenderingContext);\n}\n//# sourceMappingURL=WebGlUtils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy, createWebGLContext, hasOwn, mergeColorAlphaPremultiplied, } from '../../../utils.js';\nimport { CoreRenderer } from '../CoreRenderer.js';\nimport { WebGlCoreRenderOp } from './WebGlCoreRenderOp.js';\nimport { createIndexBuffer, getWebGlParameters, getWebGlExtensions, } from './internal/RendererUtils.js';\nimport { WebGlCoreCtxTexture } from './WebGlCoreCtxTexture.js';\nimport { Texture } from '../../textures/Texture.js';\nimport { ColorTexture } from '../../textures/ColorTexture.js';\nimport { SubTexture } from '../../textures/SubTexture.js';\nimport { WebGlCoreCtxSubTexture } from './WebGlCoreCtxSubTexture.js';\nimport { CoreShaderManager } from '../../CoreShaderManager.js';\nimport { BufferCollection } from './internal/BufferCollection.js';\nimport { compareRect, getNormalizedRgbaComponents, } from '../../lib/utils.js';\nimport { WebGlCoreShader } from './WebGlCoreShader.js';\nimport { RoundedRectangle } from './shaders/RoundedRectangle.js';\nimport { ContextSpy } from '../../lib/ContextSpy.js';\nimport { WebGlContextWrapper } from '../../lib/WebGlContextWrapper.js';\nconst WORDS_PER_QUAD = 24;\nconst BYTES_PER_QUAD = WORDS_PER_QUAD * 4;\nexport class WebGlCoreRenderer extends CoreRenderer {\n //// WebGL Native Context and Data\n glw;\n system;\n //// Core Managers\n txManager;\n txMemManager;\n shManager;\n //// Options\n options;\n //// Persistent data\n quadBuffer = new ArrayBuffer(1024 * 1024 * 4);\n fQuadBuffer = new Float32Array(this.quadBuffer);\n uiQuadBuffer = new Uint32Array(this.quadBuffer);\n renderOps = [];\n //// Render Op / Buffer Filling State\n curBufferIdx = 0;\n curRenderOp = null;\n renderables = [];\n //// Default Shader\n defaultShader;\n quadBufferCollection;\n /**\n * White pixel texture used by default when no texture is specified.\n */\n defaultTexture;\n constructor(options) {\n super(options.stage);\n const { canvas, clearColor, bufferMemory } = options;\n this.options = options;\n this.txManager = options.txManager;\n this.txMemManager = options.txMemManager;\n this.shManager = options.shManager;\n this.defaultTexture = new ColorTexture(this.txManager);\n // When the default texture is loaded, request a render in case the\n // RAF is paused. Fixes: https://github.com/lightning-js/renderer/issues/123\n this.defaultTexture.once('loaded', () => {\n this.stage.requestRender();\n });\n const gl = createWebGLContext(canvas, options.contextSpy);\n const glw = (this.glw = new WebGlContextWrapper(gl));\n const color = getNormalizedRgbaComponents(clearColor);\n glw.viewport(0, 0, canvas.width, canvas.height);\n glw.clearColor(color[0], color[1], color[2], color[3]);\n glw.setBlend(true);\n glw.blendFunc(glw.ONE, glw.ONE_MINUS_SRC_ALPHA);\n createIndexBuffer(glw, bufferMemory);\n this.system = {\n parameters: getWebGlParameters(this.glw),\n extensions: getWebGlExtensions(this.glw),\n };\n this.shManager.renderer = this;\n this.defaultShader = this.shManager.loadShader('DefaultShader').shader;\n const quadBuffer = glw.createBuffer();\n assertTruthy(quadBuffer);\n const stride = 6 * Float32Array.BYTES_PER_ELEMENT;\n this.quadBufferCollection = new BufferCollection([\n {\n buffer: quadBuffer,\n attributes: {\n a_position: {\n name: 'a_position',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 0, // start at the beginning of the buffer\n },\n a_textureCoordinate: {\n name: 'a_textureCoordinate',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 2 * Float32Array.BYTES_PER_ELEMENT,\n },\n a_color: {\n name: 'a_color',\n size: 4,\n type: glw.UNSIGNED_BYTE,\n normalized: true,\n stride,\n offset: 4 * Float32Array.BYTES_PER_ELEMENT,\n },\n a_textureIndex: {\n name: 'a_textureIndex',\n size: 1,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 5 * Float32Array.BYTES_PER_ELEMENT,\n },\n },\n },\n ]);\n }\n reset() {\n const { glw } = this;\n this.curBufferIdx = 0;\n this.curRenderOp = null;\n this.renderOps.length = 0;\n glw.setScissorTest(false);\n glw.clear();\n }\n getShaderManager() {\n return this.shManager;\n }\n createCtxTexture(textureSource) {\n if (textureSource instanceof SubTexture) {\n return new WebGlCoreCtxSubTexture(this.glw, this.txMemManager, textureSource);\n }\n return new WebGlCoreCtxTexture(this.glw, this.txMemManager, textureSource);\n }\n /**\n * This function adds a quad (a rectangle composed of two triangles) to the WebGL rendering pipeline.\n *\n * It takes a set of options that define the quad's properties, such as its dimensions, colors, texture, shader, and transformation matrix.\n * The function first updates the shader properties with the current dimensions if necessary, then sets the default texture if none is provided.\n * It then checks if a new render operation is needed, based on the current shader and clipping rectangle.\n * If a new render operation is needed, it creates one and updates the current render operation.\n * The function then adjusts the texture coordinates based on the texture options and adds the texture to the texture manager.\n *\n * Finally, it calculates the vertices for the quad, taking into account any transformations, and adds them to the quad buffer.\n * The function updates the length and number of quads in the current render operation, and updates the current buffer index.\n */\n addQuad(params) {\n const { fQuadBuffer, uiQuadBuffer } = this;\n const { width, height, colorTl, colorTr, colorBl, colorBr, textureOptions, shader, shaderProps, alpha, clippingRect, tx, ty, ta, tb, tc, td, } = params;\n let { texture } = params;\n /**\n * If the shader props contain any automatic properties, update it with the\n * current dimensions that will be used to render the quad.\n */\n if (shaderProps && hasOwn(shaderProps, '$dimensions')) {\n const dimensions = shaderProps.$dimensions;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n dimensions.width = width;\n dimensions.height = height;\n }\n texture = texture ?? this.defaultTexture;\n assertTruthy(texture instanceof Texture, 'Invalid texture type');\n let { curBufferIdx: bufferIdx, curRenderOp } = this;\n const targetDims = {\n width,\n height,\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n };\n const targetShader = shader || this.defaultShader;\n assertTruthy(targetShader instanceof WebGlCoreShader);\n if (curRenderOp) {\n // If the current render op is not the same shader, create a new one\n // If the current render op's shader props are not compatible with the\n // the new shader props, create a new one render op.\n if (curRenderOp.shader !== targetShader ||\n !compareRect(curRenderOp.clippingRect, clippingRect) ||\n (curRenderOp.shader !== this.defaultShader &&\n (!shaderProps ||\n !curRenderOp.shader.canBatchShaderProps(curRenderOp.shaderProps, shaderProps)))) {\n curRenderOp = null;\n }\n }\n assertTruthy(targetShader instanceof WebGlCoreShader);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any\n if (!curRenderOp) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n this.newRenderOp(targetShader, shaderProps, alpha, targetDims, clippingRect, bufferIdx);\n curRenderOp = this.curRenderOp;\n assertTruthy(curRenderOp);\n }\n const flipX = textureOptions?.flipX ?? false;\n const flipY = textureOptions?.flipY ?? false;\n let texCoordX1 = 0;\n let texCoordY1 = 0;\n let texCoordX2 = 1;\n let texCoordY2 = 1;\n if (texture instanceof SubTexture) {\n const { x: tx, y: ty, width: tw, height: th } = texture.props;\n const { width: parentW = 0, height: parentH = 0 } = texture.parentTexture\n .dimensions || { width: 0, height: 0 };\n texCoordX1 = tx / parentW;\n texCoordX2 = texCoordX1 + tw / parentW;\n texCoordY1 = ty / parentH;\n texCoordY2 = texCoordY1 + th / parentH;\n texture = texture.parentTexture;\n }\n // Flip texture coordinates if dictated by texture options\n if (flipX) {\n [texCoordX1, texCoordX2] = [texCoordX2, texCoordX1];\n }\n if (flipY) {\n [texCoordY1, texCoordY2] = [texCoordY2, texCoordY1];\n }\n const { txManager } = this.stage;\n const ctxTexture = txManager.getCtxTexture(texture);\n assertTruthy(ctxTexture instanceof WebGlCoreCtxTexture);\n const textureIdx = this.addTexture(ctxTexture, bufferIdx);\n curRenderOp = this.curRenderOp;\n assertTruthy(curRenderOp);\n // render quad advanced\n if (tb !== 0 || tc !== 0) {\n // Upper-Left\n fQuadBuffer[bufferIdx++] = tx; // vertexX\n fQuadBuffer[bufferIdx++] = ty; // vertexY\n fQuadBuffer[bufferIdx++] = texCoordX1; // texCoordX\n fQuadBuffer[bufferIdx++] = texCoordY1; // texCoordY\n uiQuadBuffer[bufferIdx++] = colorTl; // color\n fQuadBuffer[bufferIdx++] = textureIdx; // texIndex\n // Upper-Right\n fQuadBuffer[bufferIdx++] = tx + width * ta;\n fQuadBuffer[bufferIdx++] = ty + width * tc;\n fQuadBuffer[bufferIdx++] = texCoordX2;\n fQuadBuffer[bufferIdx++] = texCoordY1;\n uiQuadBuffer[bufferIdx++] = colorTr;\n fQuadBuffer[bufferIdx++] = textureIdx;\n // Lower-Left\n fQuadBuffer[bufferIdx++] = tx + height * tb;\n fQuadBuffer[bufferIdx++] = ty + height * td;\n fQuadBuffer[bufferIdx++] = texCoordX1;\n fQuadBuffer[bufferIdx++] = texCoordY2;\n uiQuadBuffer[bufferIdx++] = colorBl;\n fQuadBuffer[bufferIdx++] = textureIdx;\n // Lower-Right\n fQuadBuffer[bufferIdx++] = tx + width * ta + height * tb;\n fQuadBuffer[bufferIdx++] = ty + width * tc + height * td;\n fQuadBuffer[bufferIdx++] = texCoordX2;\n fQuadBuffer[bufferIdx++] = texCoordY2;\n uiQuadBuffer[bufferIdx++] = colorBr;\n fQuadBuffer[bufferIdx++] = textureIdx;\n }\n else {\n // Calculate the right corner of the quad\n // multiplied by the scale\n const rightCornerX = tx + width * ta;\n const rightCornerY = ty + height * td;\n // Upper-Left\n fQuadBuffer[bufferIdx++] = tx; // vertexX\n fQuadBuffer[bufferIdx++] = ty; // vertexY\n fQuadBuffer[bufferIdx++] = texCoordX1; // texCoordX\n fQuadBuffer[bufferIdx++] = texCoordY1; // texCoordY\n uiQuadBuffer[bufferIdx++] = colorTl; // color\n fQuadBuffer[bufferIdx++] = textureIdx; // texIndex\n // Upper-Right\n fQuadBuffer[bufferIdx++] = rightCornerX;\n fQuadBuffer[bufferIdx++] = ty;\n fQuadBuffer[bufferIdx++] = texCoordX2;\n fQuadBuffer[bufferIdx++] = texCoordY1;\n uiQuadBuffer[bufferIdx++] = colorTr;\n fQuadBuffer[bufferIdx++] = textureIdx;\n // Lower-Left\n fQuadBuffer[bufferIdx++] = tx;\n fQuadBuffer[bufferIdx++] = rightCornerY;\n fQuadBuffer[bufferIdx++] = texCoordX1;\n fQuadBuffer[bufferIdx++] = texCoordY2;\n uiQuadBuffer[bufferIdx++] = colorBl;\n fQuadBuffer[bufferIdx++] = textureIdx;\n // Lower-Right\n fQuadBuffer[bufferIdx++] = rightCornerX;\n fQuadBuffer[bufferIdx++] = rightCornerY;\n fQuadBuffer[bufferIdx++] = texCoordX2;\n fQuadBuffer[bufferIdx++] = texCoordY2;\n uiQuadBuffer[bufferIdx++] = colorBr;\n fQuadBuffer[bufferIdx++] = textureIdx;\n }\n // Update the length of the current render op\n curRenderOp.length += WORDS_PER_QUAD;\n curRenderOp.numQuads++;\n this.curBufferIdx = bufferIdx;\n }\n /**\n * Replace the existing RenderOp with a new one that uses the specified Shader\n * and starts at the specified buffer index.\n *\n * @param shader\n * @param bufferIdx\n */\n newRenderOp(shader, shaderProps, alpha, dimensions, clippingRect, bufferIdx) {\n const curRenderOp = new WebGlCoreRenderOp(this.glw, this.options, this.quadBufferCollection, shader, shaderProps, alpha, clippingRect, dimensions, bufferIdx, 0);\n this.curRenderOp = curRenderOp;\n this.renderOps.push(curRenderOp);\n }\n /**\n * Add a texture to the current RenderOp. If the texture cannot be added to the\n * current RenderOp, a new RenderOp will be created and the texture will be added\n * to that one.\n *\n * If the texture cannot be added to the new RenderOp, an error will be thrown.\n *\n * @param texture\n * @param bufferIdx\n * @param recursive\n * @returns Assigned Texture Index of the texture in the render op\n */\n addTexture(texture, bufferIdx, recursive) {\n const { curRenderOp } = this;\n assertTruthy(curRenderOp);\n const textureIdx = curRenderOp.addTexture(texture);\n // TODO: Refactor to be more DRY\n if (textureIdx === 0xffffffff) {\n if (recursive) {\n throw new Error('Unable to add texture to render op');\n }\n const { shader, shaderProps, dimensions, clippingRect, alpha } = curRenderOp;\n this.newRenderOp(shader, shaderProps, alpha, dimensions, clippingRect, bufferIdx);\n return this.addTexture(texture, bufferIdx, true);\n }\n return textureIdx;\n }\n /**\n * add RenderOp to the render pipeline\n */\n addRenderOp(renderable) {\n this.renderOps.push(renderable);\n this.curRenderOp = null;\n }\n /**\n * Render the current set of RenderOps to render to the specified surface.\n *\n * TODO: 'screen' is the only supported surface at the moment.\n *\n * @param surface\n */\n render(surface = 'screen') {\n const { glw, quadBuffer } = this;\n const arr = new Float32Array(quadBuffer, 0, this.curBufferIdx);\n const buffer = this.quadBufferCollection.getBuffer('a_position') ?? null;\n glw.arrayBufferData(buffer, arr, glw.STATIC_DRAW);\n const doLog = false; // idx++ % 100 === 0;\n if (doLog) {\n console.log('renderOps', this.renderOps.length);\n }\n this.renderOps.forEach((renderOp, i) => {\n if (doLog) {\n console.log('renderOp', i, renderOp.numQuads);\n }\n renderOp.draw();\n });\n // clean up\n this.renderables = [];\n }\n}\nconst idx = 0;\n//# sourceMappingURL=WebGlCoreRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport const SpecialCodepoints = {\n LINE_FEED: 0x0a,\n CARRIAGE_RETURN: 0x0d,\n SPACE: 0x20,\n TAB: 0x09,\n ZERO_WIDTH_SPACE: 0x200b,\n ZERO_WIDTH_NON_JOINER: 0x200c,\n ZERO_WIDTH_JOINER: 0x200d,\n LEFT_TO_RIGHT_MARK: 0x200e,\n RIGHT_TO_LEFT_MARK: 0x200f,\n LEFT_TO_RIGHT_EMBEDDING: 0x202a,\n RIGHT_TO_LEFT_EMBEDDING: 0x202b,\n POP_DIRECTIONAL_FORMATTING: 0x202c,\n LEFT_TO_RIGHT_OVERRIDE: 0x202d,\n RIGHT_TO_LEFT_OVERRIDE: 0x202e,\n LINE_SEPARATOR: 0x2028,\n PARAGRAPH_SEPARATOR: 0x2029,\n OBJECT_REPLACEMENT_CHARACTER: 0xfffc,\n REPLACEMENT_CHARACTER: 0xfffd,\n ZERO_WIDTH_NO_BREAK_SPACE: 0xfeff,\n LEFT_TO_RIGHT_ISOLATE: 0x2066,\n RIGHT_TO_LEFT_ISOLATE: 0x2067,\n FIRST_STRONG_ISOLATE: 0x2068,\n POP_DIRECTIONAL_ISOLATE: 0x2069,\n INHIBIT_SYMMETRIC_SWAPPING: 0x206a,\n ACTIVATE_SYMMETRIC_SWAPPING: 0x206b,\n INHIBIT_ARABIC_FORM_SHAPING: 0x206c,\n ACTIVATE_ARABIC_FORM_SHAPING: 0x206d,\n NATIONAL_DIGIT_SHAPES: 0x206e,\n NOMINAL_DIGIT_SHAPES: 0x206f,\n LEFT_TO_RIGHT_BOUNDARY: 0x200e,\n RIGHT_TO_LEFT_BOUNDARY: 0x200f,\n};\n//# sourceMappingURL=SpecialCodepoints.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport class FontShaper {\n}\n//# sourceMappingURL=FontShaper.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { SpecialCodepoints } from '../../../renderers/SdfTextRenderer/internal/SpecialCodepoints.js';\nimport { FontShaper, } from './FontShaper.js';\nexport class SdfFontShaper extends FontShaper {\n data;\n glyphMap;\n kernings;\n constructor(data, glyphMap) {\n super();\n this.data = data;\n this.glyphMap = glyphMap;\n const kernings = (this.kernings = {});\n data.kernings.forEach((kerning) => {\n const second = kerning.second;\n const firsts = (kernings[second] = kernings[second] || {});\n firsts[kerning.first] = kerning.amount;\n });\n this.kernings = kernings;\n }\n *shapeText(props, codepoints) {\n let codepointResult;\n let lastGlyphId = undefined;\n while ((codepointResult = codepoints.peek()) && !codepointResult.done) {\n const codepoint = codepointResult.value;\n const glyph = this.glyphMap.get(codepoint);\n codepoints.next();\n if (glyph !== undefined) {\n // We found a glyph for this codepoint\n // Yield the mapped glyph info\n /**\n * Kerning includes any possible additional letter spacing\n */\n const kerning = lastGlyphId !== undefined\n ? (this.kernings[glyph.id]?.[lastGlyphId] || 0) +\n props.letterSpacing\n : 0;\n lastGlyphId = glyph.id;\n yield {\n mapped: true,\n glyphId: glyph.id,\n codepoint,\n cluster: codepoints.lastIndex,\n xAdvance: glyph.xadvance + kerning,\n yAdvance: 0,\n xOffset: glyph.xoffset + kerning,\n yOffset: glyph.yoffset,\n xBearing: 0,\n yBearing: 0,\n width: glyph.width,\n height: glyph.height,\n };\n }\n else {\n // We didn't find a glyph for this codepoint\n // Yield the unmapped codepoint info\n // If this codepoint is a linebreak, we should reset the last glyph id\n // so that the next glyph will not be kerned with the last glyph of the\n // previous line.\n if (codepoint === SpecialCodepoints.LINE_FEED) {\n lastGlyphId = undefined;\n }\n yield {\n mapped: false,\n codepoint,\n cluster: codepoints.lastIndex,\n };\n }\n }\n }\n}\n//# sourceMappingURL=SdfFontShaper.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// import type { Renderer } from '../../../Renderer';\nimport { assertTruthy } from '../../../../utils.js';\nimport { WebGlCoreRenderer } from '../../../renderers/webgl/WebGlCoreRenderer.js';\nimport { ImageTexture } from '../../../textures/ImageTexture.js';\nimport { TrFontFace } from '../TrFontFace.js';\nimport { SdfFontShaper } from './internal/SdfFontShaper.js';\nexport class SdfTrFontFace extends TrFontFace {\n type;\n texture;\n /**\n * Height of the tallest character in the font including the whitespace above it\n */\n maxCharHeight = 0;\n data;\n shaper;\n glyphMap = new Map();\n constructor(fontFamily, descriptors, type, stage, atlasUrl, atlasDataUrl) {\n super(fontFamily, descriptors);\n this.type = type;\n const renderer = stage.renderer;\n assertTruthy(renderer instanceof WebGlCoreRenderer, 'SDF Font Faces can only be used with the WebGL Renderer');\n this.texture = stage.txManager.loadTexture('ImageTexture', {\n src: atlasUrl,\n // IMPORTANT: The SDF shader requires the alpha channel to NOT be\n // premultiplied on the atlas texture. If it is premultiplied, the\n // rendering of SDF glyphs (especially single-channel SDF fonts) will\n // be very jagged.\n premultiplyAlpha: false,\n }, {\n preload: true,\n });\n this.texture.on('loaded', () => {\n this.checkLoaded();\n });\n // Set this.data to the fetched data from dataUrl\n fetch(atlasDataUrl)\n .then(async (response) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n this.data = await response.json();\n // Add all the glyphs to the glyph map\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n let maxCharHeight = 0;\n this.data.chars.forEach((glyph) => {\n this.glyphMap.set(glyph.id, glyph);\n const charHeight = glyph.yoffset + glyph.height;\n if (charHeight > maxCharHeight) {\n maxCharHeight = charHeight;\n }\n });\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.maxCharHeight = maxCharHeight;\n // We know `data` is defined here, because we just set it\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.shaper = new SdfFontShaper(this.data, this.glyphMap);\n this.checkLoaded();\n })\n .catch(console.error);\n }\n getAtlasEntry(glyphId) {\n const glyph = this.glyphMap.get(glyphId);\n if (glyph === undefined) {\n throw new Error(`Glyph ${glyphId} not found in font ${this.fontFamily}`);\n }\n return {\n x: glyph.x,\n y: glyph.y,\n width: glyph.width,\n height: glyph.height,\n };\n }\n checkLoaded() {\n if (this.loaded)\n return;\n if (this.texture.state === 'loaded' && this.data) {\n this.loaded = true;\n this.emit('loaded');\n }\n }\n}\n//# sourceMappingURL=SdfTrFontFace.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Base class for Core extensions.\n *\n * @remarks\n * Core extensions are used to extend the Core Renderer with custom code such as\n * custom fonts, custom shaders, custom textures, custom animation functions,\n * and more.\n */\nexport class CoreExtension {\n}\n//# sourceMappingURL=CoreExtension.js.map"],"names":["assertTruthy","condition","message","hasOwn","obj","prop","Object","prototype","hasOwnProperty","call","isProductionEnvironment","BASE_URL","MODE","DEV","PROD","SSR","LEGACY","a","b","out","intersection","createBound","Math","max","x1","y1","min","x2","y2","x","y","width","height","rgba","color","r","floor","g","toFixed","bound","alpha","flipEndianess","newAlpha","trunc","rgba1","rgba2","p","r1","g1","b1","a1","r2","g2","b2","a2","round","bound1","bound2","EventEmitter","constructor","_defineProperty","this","on","event","listener","listeners","eventListeners","push","off","index","indexOf","splice","once","onceListener","target","data","emit","forEach","removeAllListeners","exports","CoreShader","makeCacheKey","props","resolveDefaults","createShader","glw","type","source","shader","Error","shaderSource","compileShader","getShaderParameter","COMPILE_STATUS","console","log","getShaderInfoLog","deleteShader","WebGlCoreShader","options","super","renderer","supportsIndexedTextures","webGl2","isWebGl2","requiredExtensions","webgl2Extensions","webgl1Extensions","glVersion","extensionName","getExtension","name","shaderSources","fragment","vertex","textureUnits","system","parameters","MAX_VERTEX_TEXTURE_IMAGE_UNITS","vertexSource","Function","fragmentSource","vertexShader","VERTEX_SHADER","fragmentShader","FRAGMENT_SHADER","program","createProgram","attachShader","linkProgram","getProgramParameter","LINK_STATUS","getProgramInfoLog","deleteProgram","vao","createVertexArray","bindVertexArray","attributeLocations","attributeBuffers","attributeNames","attributes","attributeName","location","getAttribLocation","buffer","createBuffer","uniformLocations","uniformTypes","uniforms","uniform","getUniformLocation","warn","bindBufferAttribute","attribute","enableVertexAttribArray","vertexAttribPointer","size","normalized","stride","offset","disableAttribute","disableVertexAttribArray","disableAttributes","loc","boundBufferCollection","canBatchShaderProps","propsA","propsB","bindRenderOp","renderOp","bindBufferCollection","buffers","textures","length","bindTextures","setUniform","canvas","pixelRatio","dimensions","$dimensions","$alpha","bindProps","value","resolvedBuffer","getBuffer","resolvedInfo","getAttributeInfo","attach","useProgram","detach","Texture","txManager","Set","setRenderableOwner","owner","renderable","renderableOwners","add","delete","setState","state","args","loadedArgs","failedArgs","error","getNormalizedRgbaComponents","TrFontFace","fontFamily","descriptors","_objectSpread","style","weight","stretch","convertToCssFontFaceDescriptors","unicodeRange","variant","featureSettings","display","fontUrl","fontUrlWithoutParentheses","replace","determinedDescriptors","cssDescriptors","fontFace","FontFace","load","then","loaded","catch","CoreContextTexture","memManager","textureSource","CoreRenderer","stage","CoreRenderOp","WebGlCoreRenderOp","shaderProps","clippingRect","bufferIdx","zIndex","maxTextures","getParameter","addTexture","texture","existingIdx","findIndex","t","newIdx","draw","shManager","useShader","quadIdx","valid","_this$clippingRect","canvasHeight","clipX","clipWidth","clipHeight","clipY","setScissorTest","scissor","drawElements","TRIANGLES","numQuads","UNSIGNED_SHORT","getWebGlParameters","params","MAX_RENDERBUFFER_SIZE","MAX_TEXTURE_SIZE","MAX_VIEWPORT_DIMS","MAX_TEXTURE_IMAGE_UNITS","MAX_COMBINED_TEXTURE_IMAGE_UNITS","MAX_VERTEX_ATTRIBS","MAX_VARYING_VECTORS","MAX_VERTEX_UNIFORM_VECTORS","MAX_FRAGMENT_UNIFORM_VECTORS","keys","key","getWebGlExtensions","extensions","ANGLE_instanced_arrays","WEBGL_compressed_texture_s3tc","WEBGL_compressed_texture_astc","WEBGL_compressed_texture_etc","WEBGL_compressed_texture_etc1","WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc","WEBGL_compressed_texture_s3tc_srgb","OES_vertex_array_object","memize","fn","head","tail","memoized","i","node","len","arguments","searchCache","next","prev","val","Array","apply","maxSize","clear","isPowerOfTwo","getTimingBezier","c","d","xc","xb","xa","yc","yb","ya","time","cbxd","dx","it","minT","maxT","memo","str","s","parts","substr","split","parseFloat","isNaN","hypot","sqrt","TRANSPARENT_TEXTURE_DATA","Uint8Array","WebGlCoreCtxTexture","ctxTexture","_state","_nativeCtxTexture","w","_w","h","_h","createNativeCtxTexture","onLoadRequest","err","_this","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_this$textureSource","textureData","_mipmaps$","_textureData$data","mipmaps","_textureData$data$wid","_width","_textureData$data$hei","_height","glInternalFormat","view","wrap","_callee$","_context","activeTexture","bindTexture","texParameteri","TEXTURE_MAG_FILTER","LINEAR","TEXTURE_MIN_FILTER","TEXTURE_WRAP_S","CLAMP_TO_EDGE","TEXTURE_WRAP_T","texImage2D","RGBA","UNSIGNED_BYTE","setTextureMemUse","byteLength","getTextureData","sent","abrupt","ImageBitmap","ImageData","pixelStorei","UNPACK_PREMULTIPLY_ALPHA_WEBGL","premultiplyAlpha","generateMipmap","DataView","ArrayBuffer","compressedTexImage2D","stop","free","deleteTexture","nativeTexture","createTexture","ColorTexture","_this2","_callee2","pixelData32","pixelData8","_context2","Uint32Array","Uint8ClampedArray","SubTexture","parentTexture","loadTexture","txType","queueMicrotask","parentTx","onParentTxLoaded","onParentTxFailed","_this3","_callee3","_context3","WebGlCoreCtxSubTexture","_this4","_callee4","_props$data","_props$data2","_context4","BufferCollection","config","_this$config$find","find","item","_this$config$find2","WebGlContextWrapper","gl","WeakMap","activeTextureUnit","ACTIVE_TEXTURE","TEXTURE0","maxTextureUnits","texture2dUnits","fill","undefined","map","_","TEXTURE_BINDING_2D","scissorEnabled","isEnabled","SCISSOR_TEST","scissorBox","SCISSOR_BOX","scissorX","scissorY","scissorWidth","scissorHeight","blendEnabled","BLEND","blendSrcRgb","BLEND_SRC_RGB","blendDstRgb","BLEND_DST_RGB","blendSrcAlpha","BLEND_SRC_ALPHA","blendDstAlpha","BLEND_DST_ALPHA","boundArrayBuffer","ARRAY_BUFFER_BINDING","boundElementArrayBuffer","ELEMENT_ARRAY_BUFFER_BINDING","curProgram","CURRENT_PROGRAM","FLOAT","ONE","ONE_MINUS_SRC_ALPHA","STATIC_DRAW","DYNAMIC_DRAW","self","WebGL2RenderingContext","textureUnit","TEXTURE_2D","_getActiveTexture","pname","param","texture2dParams","textureParams","get","set","level","internalFormat","widthOrFormat","heightOrType","borderOrSource","format","pixels","internalformat","border","viewport","clearColor","red","green","blue","enable","disable","setBlend","blend","blendFunc","src","dst","COLOR_BUFFER_BIT","arrayBufferData","usage","bindBuffer","ARRAY_BUFFER","bufferData","elementArrayBufferData","ELEMENT_ARRAY_BUFFER","programUniforms","Map","uniformArgs","every","v","isArray","Float32Array","compareArrays","mode","count","vertexArray","WebGlCoreRenderer","quadBuffer","bufferMemory","txMemManager","defaultTexture","requestRender","contextSpy","antialias","depth","stencil","desynchronized","powerPreference","premultipliedAlpha","preserveDrawingBuffer","getContext","Proxy","increment","String","bind","createWebGLContext","maxQuads","indices","Uint16Array","j","createIndexBuffer","defaultShader","loadShader","BYTES_PER_ELEMENT","quadBufferCollection","a_position","a_textureCoordinate","a_color","a_textureIndex","reset","curBufferIdx","curRenderOp","renderOps","getShaderManager","createCtxTexture","addQuad","_texture","_textureOptions$flipX","_textureOptions$flipY","fQuadBuffer","uiQuadBuffer","colorTl","colorTr","colorBl","colorBr","textureOptions","tx","ty","ta","tb","tc","td","targetDims","targetShader","newRenderOp","flipX","flipY","texCoordX1","texCoordY1","texCoordX2","texCoordY2","_texture$props","tw","th","_ref","_ref$width","parentW","_ref$height","parentH","_ref2","_ref3","getCtxTexture","textureIdx","rightCornerX","rightCornerY","recursive","addRenderOp","render","surface","_this$quadBufferColle","arr","renderables","SpecialCodepoints","FontShaper","SdfFontShaper","glyphMap","kernings","kerning","second","first","amount","shapeText","codepoints","_this5","_callee5","codepointResult","lastGlyphId","codepoint","glyph","_this5$kernings$glyph","_context5","peek","done","id","letterSpacing","mapped","glyphId","cluster","lastIndex","xAdvance","xadvance","yAdvance","xOffset","xoffset","yOffset","yoffset","xBearing","yBearing","atlasUrl","atlasDataUrl","_this6","preload","checkLoaded","fetch","_ref4","_callee6","response","maxCharHeight","_context6","json","chars","charHeight","shaper","_x","getAtlasEntry"],"mappings":"8hPAkEgB,SAAAA,EAAaC,EAAWC,GAMxC,CA2FgB,SAAAC,EAAOC,EAAKC,GACxB,OAAOC,OAAOC,UAAUC,eAAeC,KAAKL,EAAKC,EACrD,CAyBO,SAASK,IACZ,MAAO,CAAmBC,SAAA,mBAAAC,KAAA,aAAAC,KAAA,EAAAC,MAAA,EAAAC,KAAA,EAAAC,QAAA,KAAA,CAC9B,cC9GO,SAAwBC,EAAGC,EAAGC,GACjC,IAAMC,EAAeC,EAAYC,KAAKC,IAAIN,EAAEO,GAAIN,EAAEM,IAAKF,KAAKC,IAAIN,EAAEQ,GAAIP,EAAEO,IAAKH,KAAKI,IAAIT,EAAEU,GAAIT,EAAES,IAAKL,KAAKI,IAAIT,EAAEW,GAAIV,EAAEU,IAAKT,GACzH,GAAIC,EAAaI,GAAKJ,EAAaO,IAAMP,EAAaK,GAAKL,EAAaQ,GACpE,OAAOR,EAEX,OAAOC,EAAY,EAAG,EAAG,EAAG,EAAGD,EACnC,IAmBO,SAAuBH,EAAGC,EAAGC,GAChC,IAAMU,EAAIP,KAAKC,IAAIN,EAAEY,EAAGX,EAAEW,GACpBC,EAAIR,KAAKC,IAAIN,EAAEa,EAAGZ,EAAEY,GACpBC,EAAQT,KAAKI,IAAIT,EAAEY,EAAIZ,EAAEc,MAAOb,EAAEW,EAAIX,EAAEa,OAASF,EACjDG,EAASV,KAAKI,IAAIT,EAAEa,EAAIb,EAAEe,OAAQd,EAAEY,EAAIZ,EAAEc,QAAUF,EAC1D,GAAIC,EAAQ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Z75HCSO.js b/assets/index-BZ75HCSO.js deleted file mode 100644 index 0989a62..0000000 --- a/assets/index-BZ75HCSO.js +++ /dev/null @@ -1,8 +0,0 @@ -function __vite__mapDeps(indexes) { - if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = [] - } - return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) -} -var ni=Object.defineProperty;var oi=(n,r,e)=>r in n?ni(n,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[r]=e;var u=(n,r,e)=>(oi(n,typeof r!="symbol"?r+"":r,e),e);import{a as F,i as no,g as Cr,c as dt,W as yn,E as et,b as Be,d as ii,e as en,f as si,m as bt,h as Ft,j as oo,T as io,k as ai,l as Tr,S as vn,B as li,n as ci,o as so,p as di,q as hi,C as ui,r as fi,s as wn,t as bn,u as gi,v as pi,w as mi}from"./CoreExtension-BSpcUIDc.js";function Wc(){import.meta.url,import("_").catch(()=>1),async function*(){}().next()}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))t(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&t(s)}).observe(document,{childList:!0,subtree:!0});function e(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function t(o){if(o.ep)return;o.ep=!0;const i=e(o);fetch(o.href,i)}})();const ao=(n,r)=>n===r,or=Symbol("solid-proxy"),xi=Symbol("solid-track"),ir={equals:ao};let lo=xo;const be=1,sr=2,co={owned:null,cleanups:null,context:null,owner:null},_r={};var $=null;let Rr=null,yi=null,H=null,se=null,_e=null,xr=0;function ut(n,r){const e=H,t=$,o=n.length===0,i=r===void 0?t:r,s=o?co:{owned:null,cleanups:null,context:i?i.context:null,owner:i},l=o?n:()=>n(()=>ae(()=>vr(s)));$=s,H=null;try{return Re(l,!0)}finally{H=e,$=t}}function W(n,r){r=r?Object.assign({},ir,r):ir;const e={value:n,observers:null,observerSlots:null,comparator:r.equals||void 0},t=o=>(typeof o=="function"&&(o=o(e.value)),mo(e,o));return[po.bind(e),t]}function Nr(n,r,e){const t=Lt(n,r,!0,be);rt(t)}function Te(n,r,e){const t=Lt(n,r,!1,be);rt(t)}function Ye(n,r,e){lo=Ti;const t=Lt(n,r,!1,be);(!e||!e.render)&&(t.user=!0),_e?_e.push(t):rt(t)}function te(n,r,e){e=e?Object.assign({},ir,e):ir;const t=Lt(n,r,!0,0);return t.observers=null,t.observerSlots=null,t.comparator=e.equals||void 0,rt(t),po.bind(t)}function vi(n){return n&&typeof n=="object"&&"then"in n}function Ze(n,r,e){let t,o,i;arguments.length===2&&typeof r=="object"||arguments.length===1?(t=!0,o=n,i=r||{}):(t=n,o=r,i=e||{});let s=null,l=_r,c=!1,d="initialValue"in i,h=typeof t=="function"&&te(t);const g=new Set,[y,b]=(i.storage||W)(i.initialValue),[m,w]=W(void 0),[S,A]=W(void 0,{equals:!1}),[p,x]=W(d?"ready":"unresolved");function v(C,_,E,P){return s===C&&(s=null,P!==void 0&&(d=!0),(C===l||_===l)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(P,{value:_})),l=_r,T(_,E)),_}function T(C,_){Re(()=>{_===void 0&&b(()=>C),x(_!==void 0?"errored":d?"ready":"unresolved"),w(_);for(const E of g.keys())E.decrement();g.clear()},!1)}function I(){const C=Si,_=y(),E=m();if(E!==void 0&&!s)throw E;return H&&!H.user&&C&&Nr(()=>{S(),s&&(C.resolved||g.has(C)||(C.increment(),g.add(C)))}),_}function R(C=!0){if(C!==!1&&c)return;c=!1;const _=h?h():t;if(_==null||_===!1){v(s,ae(y));return}const E=l!==_r?l:ae(()=>o(_,{value:y(),refetching:C}));return vi(E)?(s=E,"value"in E?(E.status==="success"?v(s,E.value,void 0,_):v(s,void 0,void 0,_),E):(c=!0,queueMicrotask(()=>c=!1),Re(()=>{x(d?"refreshing":"pending"),A()},!1),E.then(P=>v(E,P,void 0,_),P=>v(E,void 0,vo(P),_)))):(v(s,E,void 0,_),E)}return Object.defineProperties(I,{state:{get:()=>p()},error:{get:()=>m()},loading:{get(){const C=p();return C==="pending"||C==="refreshing"}},latest:{get(){if(!d)return I();const C=m();if(C&&!s)throw C;return y()}}}),h?Nr(()=>R(!1)):R(!1),[I,{refetch:R,mutate:b}]}function ho(n,r=ao,e){const t=new Map,o=Lt(i=>{const s=n();for(const[l,c]of t.entries())if(r(l,s)!==r(l,i))for(const d of c.values())d.state=be,d.pure?se.push(d):_e.push(d);return s},void 0,!0,be);return rt(o),i=>{const s=H;if(s){let l;(l=t.get(i))?l.add(s):t.set(i,l=new Set([s])),$e(()=>{l.delete(s),!l.size&&t.delete(i)})}return r(i,o.value)}}function wi(n){return Re(n,!1)}function ae(n){if(H===null)return n();const r=H;H=null;try{return n()}finally{H=r}}function He(n,r,e){const t=Array.isArray(n);let o,i=e&&e.defer;return s=>{let l;if(t){l=Array(n.length);for(let d=0;dr(l,o,s));return o=l,c}}function tt(n){Ye(()=>ae(n))}function $e(n){return $===null||($.cleanups===null?$.cleanups=[n]:$.cleanups.push(n)),n}function Nt(){return $}function uo(n,r){const e=$,t=H;$=n,H=null;try{return Re(r,!0)}catch(o){tn(o)}finally{$=e,H=t}}function bi(n){const r=H,e=$;return Promise.resolve().then(()=>{H=r,$=e;let t;return Re(n,!1),H=$=null,t?t.done:void 0})}function fo(n,r){const e=Symbol("context");return{id:e,Provider:_i(e),defaultValue:n}}function go(n){return $&&$.context&&$.context[n.id]!==void 0?$.context[n.id]:n.defaultValue}function yr(n){const r=te(n),e=te(()=>Lr(r()));return e.toArray=()=>{const t=e();return Array.isArray(t)?t:t!=null?[t]:[]},e}let Si;function po(){if(this.sources&&this.state)if(this.state===be)rt(this);else{const n=se;se=null,Re(()=>lr(this),!1),se=n}if(H){const n=this.observers?this.observers.length:0;H.sources?(H.sources.push(this),H.sourceSlots.push(n)):(H.sources=[this],H.sourceSlots=[n]),this.observers?(this.observers.push(H),this.observerSlots.push(H.sources.length-1)):(this.observers=[H],this.observerSlots=[H.sources.length-1])}return this.value}function mo(n,r,e){let t=n.value;return(!n.comparator||!n.comparator(t,r))&&(n.value=r,n.observers&&n.observers.length&&Re(()=>{for(let o=0;o1e6)throw se=[],new Error},!1)),r}function rt(n){if(!n.fn)return;vr(n);const r=xr;Ai(n,n.value,r)}function Ai(n,r,e){let t;const o=$,i=H;H=$=n;try{t=n.fn(r)}catch(s){return n.pure&&(n.state=be,n.owned&&n.owned.forEach(vr),n.owned=null),n.updatedAt=e+1,tn(s)}finally{H=i,$=o}(!n.updatedAt||n.updatedAt<=e)&&(n.updatedAt!=null&&"observers"in n?mo(n,t):n.value=t,n.updatedAt=e)}function Lt(n,r,e,t=be,o){const i={fn:n,state:t,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:r,owner:$,context:$?$.context:null,pure:e};return $===null||$!==co&&($.owned?$.owned.push(i):$.owned=[i]),i}function ar(n){if(n.state===0)return;if(n.state===sr)return lr(n);if(n.suspense&&ae(n.suspense.inFallback))return n.suspense.effects.push(n);const r=[n];for(;(n=n.owner)&&(!n.updatedAt||n.updatedAt=0;e--)if(n=r[e],n.state===be)rt(n);else if(n.state===sr){const t=se;se=null,Re(()=>lr(n,r[0]),!1),se=t}}function Re(n,r){if(se)return n();let e=!1;r||(se=[]),_e?e=!0:_e=[],xr++;try{const t=n();return Ci(e),t}catch(t){e||(_e=null),se=null,tn(t)}}function Ci(n){if(se&&(xo(se),se=null),n)return;const r=_e;_e=null,r.length&&Re(()=>lo(r),!1)}function xo(n){for(let r=0;r=0;r--)vr(n.owned[r]);n.owned=null}if(n.cleanups){for(r=n.cleanups.length-1;r>=0;r--)n.cleanups[r]();n.cleanups=null}n.state=0}function vo(n){return n instanceof Error?n:new Error(typeof n=="string"?n:"Unknown error",{cause:n})}function tn(n,r=$){throw vo(n)}function Lr(n){if(typeof n=="function"&&!n.length)return Lr(n());if(Array.isArray(n)){const r=[];for(let e=0;eo=ae(()=>($.context={...$.context,[n]:t.value},yr(()=>t.children))),void 0),o}}const Ri=Symbol("fallback");function Sn(n){for(let r=0;r1?[]:null;return $e(()=>Sn(i)),()=>{let c=n()||[],d,h;return c[xi],ae(()=>{let y=c.length,b,m,w,S,A,p,x,v,T;if(y===0)s!==0&&(Sn(i),i=[],t=[],o=[],s=0,l&&(l=[])),e.fallback&&(t=[Ri],o[0]=ut(I=>(i[0]=I,e.fallback())),s=1);else if(s===0){for(o=new Array(y),h=0;h=p&&v>=p&&t[x]===c[v];x--,v--)w[v]=o[x],S[v]=i[x],l&&(A[v]=l[x]);for(b=new Map,m=new Array(v+1),h=v;h>=p;h--)T=c[h],d=b.get(T),m[h]=d===void 0?-1:d,b.set(T,h);for(d=p;d<=x;d++)T=t[d],h=b.get(T),h!==void 0&&h!==-1?(w[h]=o[d],S[h]=i[d],l&&(A[h]=l[d]),h=m[h],b.set(T,h)):i[d]();for(h=p;hn(r||{}))}function Ut(){return!0}const Mr={get(n,r,e){return r===or?e:n.get(r)},has(n,r){return r===or?!0:n.has(r)},set:Ut,deleteProperty:Ut,getOwnPropertyDescriptor(n,r){return{configurable:!0,enumerable:!0,get(){return n.get(r)},set:Ut,deleteProperty:Ut}},ownKeys(n){return n.keys()}};function Ir(n){return(n=typeof n=="function"?n():n)?n:{}}function Bi(){for(let n=0,r=this.length;n=0;l--){const c=Ir(n[l])[s];if(c!==void 0)return c}},has(s){for(let l=n.length-1;l>=0;l--)if(s in Ir(n[l]))return!0;return!1},keys(){const s=[];for(let l=0;l=0;s--){const l=n[s];if(!l)continue;const c=Object.getOwnPropertyNames(l);for(let d=c.length-1;d>=0;d--){const h=c[d];if(h==="__proto__"||h==="constructor")continue;const g=Object.getOwnPropertyDescriptor(l,h);if(!t[h])t[h]=g.get?{enumerable:!0,configurable:!0,get:Bi.bind(e[h]=[g.get.bind(l)])}:g.value!==void 0?g:void 0;else{const y=e[h];y&&(g.get?y.push(g.get.bind(l)):g.value!==void 0&&y.push(()=>g.value))}}}const o={},i=Object.keys(t);for(let s=i.length-1;s>=0;s--){const l=i[s],c=t[l];c&&c.get?Object.defineProperty(o,l,c):o[l]=c?c.value:void 0}return o}function ki(n,...r){if(or in n){const o=new Set(r.length>1?r.flat():r[0]),i=r.map(s=>new Proxy({get(l){return s.includes(l)?n[l]:void 0},has(l){return s.includes(l)&&l in n},keys(){return s.filter(l=>l in n)}},Mr));return i.push(new Proxy({get(s){return o.has(s)?void 0:n[s]},has(s){return o.has(s)?!1:s in n},keys(){return Object.keys(n).filter(s=>!o.has(s))}},Mr)),i}const e={},t=r.map(()=>({}));for(const o of Object.getOwnPropertyNames(n)){const i=Object.getOwnPropertyDescriptor(n,o),s=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable;let l=!1,c=0;for(const d of r)d.includes(o)&&(l=!0,s?t[c][o]=i.value:Object.defineProperty(t[c],o,i)),++c;l||(s?e[o]=i.value:Object.defineProperty(e,o,i))}return[...t,e]}const Ei=n=>"Stale read from <".concat(n,">.");function wr(n){const r="fallback"in n&&{fallback:()=>n.fallback};return te(Ii(()=>n.each,n.children,r||void 0))}function Ie(n){const r=n.keyed,e=te(()=>n.when,void 0,{equals:(t,o)=>r?t===o:!t==!o});return te(()=>{const t=e();if(t){const o=n.children;return typeof o=="function"&&o.length>0?ae(()=>o(r?t:()=>{if(!ae(e))throw Ei("Show");return n.when})):o}return n.fallback},void 0,void 0)}const Fi=void 0,[nn,zr]=W(void 0);class bo{constructor(r){u(this,"releaseCallback");this.releaseCallback=r}}class Ni extends bo{constructor(e,t){var o,i;super(e);u(this,"textureMap",new Map);u(this,"zeroReferenceTextureSet",new Set);u(this,"options");this.options={textureCleanupIntervalMs:(o=t.textureCleanupIntervalMs)!=null?o:1e4,textureCleanupAgeThreadholdMs:(i=t.textureCleanupAgeThreadholdMs)!=null?i:6e4},setInterval(()=>{const s=Date.now(),l=this.options.textureCleanupAgeThreadholdMs;for(const c of this.zeroReferenceTextureSet)s-c.lastUpdate>l&&(this.releaseCallback(c.id),this.textureMap.delete(c.id),this.zeroReferenceTextureSet.delete(c))},this.options.textureCleanupIntervalMs)}registerTexture(e){var o;const t=(o=e.options)==null?void 0:o.id;if(F(t,"Texture must have an id to be registered"),!this.textureMap.has(t)){const i={id:t,nodeRefCount:0,lastUpdate:Date.now()};this.textureMap.set(t,i),this.zeroReferenceTextureSet.add(i)}}incrementTextureRefCount(e){var i;const t=(i=e.options)==null?void 0:i.id;F(t,"Texture must have an id to be registered");let o=this.textureMap.get(t);o||(this.registerTexture(e),o=this.textureMap.get(t)),F(o,"Texture must have been registered"),e.txType==="SubTexture"&&this.incrementTextureRefCount(e.props.texture),o.nodeRefCount++,o.lastUpdate=Date.now(),this.zeroReferenceTextureSet.has(o)&&this.zeroReferenceTextureSet.delete(o)}decrementTextureRefCount(e){var i;const t=(i=e.options)==null?void 0:i.id;F(t,"Texture must have an id to be registered");const o=this.textureMap.get(t);F(o,"Texture must have been registered"),o.nodeRefCount--,o.lastUpdate=Date.now(),o.nodeRefCount===0&&this.zeroReferenceTextureSet.add(o),e.txType==="SubTexture"&&this.decrementTextureRefCount(e.props.texture)}}class Li extends bo{constructor(e){super(e);u(this,"registry");this.registry=new FinalizationRegistry(e)}registerTexture(e){var t,o;F((t=e.options)==null?void 0:t.id,"Texture must have an ID to be registered"),this.registry.register(e,(o=e.options)==null?void 0:o.id)}incrementTextureRefCount(){}decrementTextureRefCount(){}}const mt={alpha:n=>n===1?null:{prop:"opacity",value:"".concat(n)},x:n=>({prop:"left",value:"".concat(n,"px")}),y:n=>({prop:"top",value:"".concat(n,"px")}),width:n=>n===0?null:{prop:"width",value:"".concat(n,"px")},height:n=>n===0?null:{prop:"height",value:"".concat(n,"px")},zIndex:()=>"zIndex",fontFamily:()=>"font-family",fontSize:()=>"font-size",fontStyle:()=>"font-style",fontWeight:()=>"font-weight",fontStretch:()=>"font-stretch",lineHeight:()=>"line-height",letterSpacing:()=>"letter-spacing",textAlign:()=>"text-align",overflowSuffix:()=>"overflow-suffix",maxLines:()=>"max-lines",contain:()=>"contain",verticalAlign:()=>"vertical-align",clipping:n=>n===!1?null:{prop:"overflow",value:n?"hidden":"visible"},rotation:n=>n===0?null:{prop:"transform",value:"rotate(".concat(n,"rad)")},scale:n=>n===1?null:{prop:"transform",value:"scale(".concat(n,")")},scaleX:n=>n===1?null:{prop:"transform",value:"scaleX(".concat(n,")")},scaleY:n=>n===1?null:{prop:"transform",value:"scaleY(".concat(n,")")},color:n=>n===0?null:{prop:"color",value:So(n)}},So=n=>{const r=(n&255)/255,e=n>>8&255,t=n>>16&255,o=n>>24&255;return"rgba(".concat(o,",").concat(t,",").concat(e,",").concat(r,")")},Mi={id:"id"};class zi{constructor(r,e){u(this,"root",null);u(this,"canvas",null);u(this,"height",1080);u(this,"width",1920);u(this,"scaleX",1);u(this,"scaleY",1);var i,s,l,c,d,h;if(no())return;if(!e)throw new Error("settings is required");this.height=Math.ceil((s=e.appHeight)!=null?s:1080/((i=e.deviceLogicalPixelRatio)!=null?i:1)),this.width=Math.ceil((c=e.appWidth)!=null?c:1900/((l=e.deviceLogicalPixelRatio)!=null?l:1)),this.scaleX=(d=e.deviceLogicalPixelRatio)!=null?d:1,this.scaleY=(h=e.deviceLogicalPixelRatio)!=null?h:1,this.canvas=r,this.root=document.createElement("div"),this.setRootPosition(),document.body.appendChild(this.root),new MutationObserver(this.setRootPosition.bind(this)).observe(r,{attributes:!0,childList:!1,subtree:!1}),new ResizeObserver(this.setRootPosition.bind(this)).observe(r),window.addEventListener("resize",this.setRootPosition.bind(this)),console.warn("Inspector is enabled, this will impact performance")}setRootPosition(){if(this.root===null||this.canvas===null)return;const r=this.canvas.getBoundingClientRect(),e=document.documentElement.scrollTop+r.top,t=document.documentElement.scrollLeft+r.left;this.root.id="root",this.root.style.left="".concat(t,"px"),this.root.style.top="".concat(e,"px"),this.root.style.width="".concat(this.width,"px"),this.root.style.height="".concat(this.height,"px"),this.root.style.position="absolute",this.root.style.transformOrigin="0 0 0",this.root.style.transform="scale(".concat(this.scaleX,", ").concat(this.scaleY,")"),this.root.style.overflow="hidden",this.root.style.zIndex="65534"}createDiv(r,e){const t=document.createElement("div");t.style.position="absolute",t.id=r.id.toString();for(const o in e)this.updateNodeProperty(t,o,e[o]);return t}createNode(r,e){const t=r.createNode(e),o=this.createDiv(t,e);return o.node=t,t.div=o,this.createProxy(t,o)}createTextNode(r,e){const t=r.createTextNode(e),o=this.createDiv(t,e);return this.createProxy(t,o)}createProxy(r,e){return new Proxy(r,{set:(t,o,i)=>(this.updateNodeProperty(e,o,i),Reflect.set(t,o,i)),get:(t,o,i)=>(o==="destroy"&&this.destroyNode(t),o==="animate"?(s,l)=>{const c=t.animate(s,l);return new Proxy(c,{get:(d,h,g)=>(h==="start"&&this.animateNode(e,r,s,l),Reflect.get(d,h,g))})}:Reflect.get(t,o,i))})}destroyNode(r){const e=document.getElementById(r.id.toString());e==null||e.remove()}updateNodeProperty(r,e,t){var o;if(!(this.root===null||t===void 0||t===null)){if(e==="parent"){const i=t.id;if(i===1){this.root.appendChild(r);return}const s=document.getElementById(i.toString());s==null||s.appendChild(r);return}if(e==="text"){r.innerHTML=String(t),r.style.visibility="hidden";return}if(e==="src"&&t){r.setAttribute("data-src",String(t));return}if(mt[e]){const i=(o=mt[e])==null?void 0:o.call(mt,t);if(i===null)return;if(typeof i=="string"){r.style.setProperty(i,String(t));return}typeof i=="object"&&r.style.setProperty(i.prop,i.value);return}if(Mi[e]){r.setAttribute(String(mt[e]),String(t));return}if(e==="data"){for(const i in t)r.setAttribute("data-".concat(i),String(t[i]));return}}}animateNode(r,e,t,o){const{duration:i=1e3,delay:s=0}=o,{x:l,y:c,width:d,height:h,alpha:g=1,rotation:y=0,scale:b=1,color:m}=t;function w(){setTimeout(()=>{r.style.top="".concat(c,"px"),r.style.left="".concat(l,"px"),r.style.width="".concat(d,"px"),r.style.height="".concat(h,"px"),r.style.opacity="".concat(g),r.style.rotate="".concat(y,"rad"),r.style.scale="".concat(b),r.style.color=So(m)},i)}setTimeout(w,s)}}const Pi="modulepreload",Di=function(n){return"/solid-demo-app/"+n},An={},Oi=function(r,e,t){let o=Promise.resolve();if(e&&e.length>0){const i=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),l=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));o=Promise.all(e.map(c=>{if(c=Di(c),c in An)return;An[c]=!0;const d=c.endsWith(".css"),h=d?'[rel="stylesheet"]':"";if(!!t)for(let b=i.length-1;b>=0;b--){const m=i[b];if(m.href===c&&(!d||m.rel==="stylesheet"))return}else if(document.querySelector('link[href="'.concat(c,'"]').concat(h)))return;const y=document.createElement("link");if(y.rel=d?"stylesheet":Pi,d||(y.as="script",y.crossOrigin=""),y.href=c,l&&y.setAttribute("nonce",l),document.head.appendChild(y),d)return new Promise((b,m)=>{y.addEventListener("load",b),y.addEventListener("error",()=>m(new Error("Unable to preload CSS for ".concat(c))))})}))}return o.then(()=>r()).catch(i=>{const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=i,window.dispatchEvent(s),!s.defaultPrevented)throw i})};class oe{constructor(r){u(this,"priority",1);u(this,"name","");u(this,"ref");u(this,"target");u(this,"passParameters","");u(this,"declaredUniforms","");u(this,"uniformInfo",{});const{ref:e,target:t,props:o={}}=r;this.ref=e,this.target=t;const i={},s=[];let l="";const c=this.constructor.uniforms||{};for(const d in c){const h=c[d],g=h.type,y="".concat(e,"_").concat(d);let b="";h.size&&(b="[".concat(h.size(o),"]")),s.push(y),l+="uniform ".concat(g," ").concat(y).concat(b,";"),i[d]={name:y,uniform:c[d].method}}this.passParameters=s.join(","),this.declaredUniforms=l,this.uniformInfo=i}static getEffectKey(r){return""}static getMethodParameters(r,e){const t=[];for(const o in r){const i=r[o];let s="";i.size&&(s="[".concat(i.size(e),"]")),t.push("".concat(i.type," ").concat(o).concat(s))}return t.join(",")}static resolveDefaults(r){return{}}static makeEffectKey(r){return!1}}u(oe,"uniforms",{}),u(oe,"methods"),u(oe,"onShaderMask"),u(oe,"onColorize"),u(oe,"onEffectMask");const Ui={x:(n,r)=>{n.props.x=r},y:(n,r)=>{n.props.y=r},width:(n,r)=>{n.props.width=r},height:(n,r)=>{n.props.height=r},color:(n,r)=>{n.props.color=r},zIndex:(n,r)=>{n.props.zIndex=r},fontFamily:(n,r)=>{n.props.fontFamily=r},fontWeight:(n,r)=>{n.props.fontWeight=r},fontStyle:(n,r)=>{n.props.fontStyle=r},fontStretch:(n,r)=>{n.props.fontStretch=r},fontSize:(n,r)=>{n.props.fontSize=r},text:(n,r)=>{n.props.text=r},textAlign:(n,r)=>{n.props.textAlign=r},contain:(n,r)=>{n.props.contain=r},offsetY:(n,r)=>{n.props.offsetY=r},scrollable:(n,r)=>{n.props.scrollable=r},scrollY:(n,r)=>{n.props.scrollY=r},letterSpacing:(n,r)=>{n.props.letterSpacing=r},lineHeight:(n,r)=>{n.props.lineHeight=r},maxLines:(n,r)=>{n.props.maxLines=r},textBaseline:(n,r)=>{n.props.textBaseline=r},verticalAlign:(n,r)=>{n.props.verticalAlign=r},overflowSuffix:(n,r)=>{n.props.overflowSuffix=r},debug:(n,r)=>{n.props.debug=r}};class Ao{constructor(r){u(this,"stage");u(this,"set");this.stage=r;const e={...Ui,...this.getPropertySetters()};this.set=Object.freeze(Object.fromEntries(Object.entries(e).map(([t,o])=>[t,(i,s)=>{i.props[t]!==s&&(o(i,s),this.stage.requestRender())}])))}setStatus(r,e,t){r.status!==e&&(r.status=e,r.emitter.emit(e,t))}setIsRenderable(r,e){r.isRenderable=e}destroyState(r){["loading","loaded","failed"].forEach(t=>{r.emitter.off(t)})}scheduleUpdateState(r){r.updateScheduled||(r.updateScheduled=!0,queueMicrotask(()=>{r.updateScheduled=!1,this.updateState(r)}))}}const Cn=2048;function Tn(n,r,e,t,o){const i=n!=="bottom"?.5*r:0;return e*(t-1)+i+Math.max(e,r)+(o||0)}class Wi{constructor(r,e){u(this,"_canvas");u(this,"_context");u(this,"_settings");u(this,"renderInfo");this._canvas=r,this._context=e,this._settings=this.mergeDefaults({})}set settings(r){this._settings=this.mergeDefaults(r)}get settings(){return this._settings}getPrecision(){return this._settings.precision}setFontProperties(){this._context.font=this._getFontSetting(),this._context.textBaseline=this._settings.textBaseline}_getFontSetting(){const r=[this._settings.fontFace],e=[];for(let t=0,o=r.length;t{console.warn("[Lightning] Font load error",e,r)}).then(()=>{document.fonts.check(r,this._settings.text)||console.warn("[Lightning] Font not found",r)})}catch(e){console.warn("[Lightning] Can't check font loading for "+r)}}}calculateRenderInfo(){const r={},e=this.getPrecision(),t=this._settings.paddingLeft*e,o=this._settings.paddingRight*e,i=this._settings.fontSize*e;let s=this._settings.offsetY===null?null:this._settings.offsetY*e,l=(this._settings.lineHeight||i)*e;const c=this._settings.w*e,d=this._settings.h*e;let h=this._settings.wordWrapWidth*e;const g=this._settings.cutSx*e,y=this._settings.cutEx*e,b=this._settings.cutSy*e,m=this._settings.cutEy*e,w=(this._settings.letterSpacing||0)*e,S=this._settings.textIndent*e;this.setFontProperties();let A=c||2048/this.getPrecision(),p=A-t;if(p<10&&(A+=10-p,p=10),h||(h=p),this._settings.textOverflow&&!this._settings.wordWrap){let C;switch(this._settings.textOverflow){case"clip":C="";break;case"ellipsis":C=this._settings.overflowSuffix;break;default:C=this._settings.textOverflow}this._settings.text=this.wrapWord(this._settings.text,h-S,C)}let x;if(this._settings.wordWrap)x=this.wrapText(this._settings.text,h,w,S);else{x={l:this._settings.text.split(/(?:\r\n|\r|\n)/),n:[]};const C=x.l.length;for(let _=0;_this._settings.maxLines){const C=v.slice(0,this._settings.maxLines);let _=null;if(this._settings.overflowSuffix){const O=this._settings.overflowSuffix?this.measureText(this._settings.overflowSuffix):0,D=this.wrapText(C[C.length-1],h-O,w,S);C[C.length-1]="".concat(D.l[0]).concat(this._settings.overflowSuffix),_=[D.l.length>1?D.l[1]:""]}else _=[""];let E;const P=v.length;let k=0;const L=x.n.length;for(E=this._settings.maxLines;E=128&&(this._context.globalAlpha=.01,this._context.fillRect(0,0,.01,.01),this._context.globalAlpha=1),(r.cutSx||r.cutSy)&&this._context.translate(-r.cutSx,-r.cutSy);let l,c;const d=[];for(let g=0,y=o.length;ge)for(;l>0&&(c=this._context.measureText(r.substring(0,l)).width+o,c>e);)l-=1;else for(;l=o?t:"")}wrapText(r,e,t,o=0){const i=r.split(/\r?\n/g);let s=[];const l=[];for(let c=0;cg?(b>0&&(d.push(h),h=""),h+=y[b],g=e-m-(b===0?o:0)):(g-=w,h+=" ".concat(y[b]))}d.push(h),h="",s=s.concat(d),ct+this._context.measureText(o).width+e,0):this._context.measureText(r).width}mergeDefaults(r){return{text:"",w:0,h:0,fontStyle:"normal",fontSize:40,fontFace:null,wordWrap:!0,wordWrapWidth:0,wordBreak:!1,textOverflow:"",lineHeight:null,textBaseline:"alphabetic",textAlign:"left",verticalAlign:"top",offsetY:null,maxLines:0,overflowSuffix:"...",textColor:[1,1,1,1],paddingLeft:0,paddingRight:0,shadow:!1,shadowColor:[0,0,0,1],shadowOffsetX:0,shadowOffsetY:0,shadowBlur:5,highlight:!1,highlightHeight:0,highlightColor:[0,0,0,1],highlightOffset:0,highlightPaddingLeft:0,highlightPaddingRight:0,letterSpacing:0,textIndent:0,cutSx:0,cutEx:0,cutSy:0,cutEy:0,advancedRenderer:!1,fontBaselineRatio:0,precision:1,textRenderIssueMargin:0,...r}}}const _n=typeof self>"u"?globalThis:self;var ro;const Rn=((ro=_n.document)==null?void 0:ro.fonts)||_n.fonts;function Yi(n){const{fontFamily:r,fontStyle:e,fontWeight:t,fontStretch:o,fontSize:i}=n;return[e,t,o,"".concat(i,"px"),r].join(" ")}const $i=dt(0,0,0,0);class Hi extends Ao{constructor(e){super(e);u(this,"canvas");u(this,"context");u(this,"rendererBounds");typeof OffscreenCanvas<"u"?this.canvas=new OffscreenCanvas(0,0):this.canvas=document.createElement("canvas");let t=this.canvas.getContext("2d");t||(this.canvas=document.createElement("canvas"),t=this.canvas.getContext("2d")),F(t),this.context=t,this.rendererBounds={x1:0,y1:0,x2:this.stage.options.appWidth,y2:this.stage.options.appHeight}}getPropertySetters(){return{fontFamily:(e,t)=>{e.props.fontFamily=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontWeight:(e,t)=>{e.props.fontWeight=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontStyle:(e,t)=>{e.props.fontStyle=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontStretch:(e,t)=>{e.props.fontStretch=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontSize:(e,t)=>{e.props.fontSize=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},text:(e,t)=>{e.props.text=t,this.invalidateLayoutCache(e)},textAlign:(e,t)=>{e.props.textAlign=t,this.invalidateLayoutCache(e)},color:(e,t)=>{e.props.color=t,this.invalidateLayoutCache(e)},x:(e,t)=>{e.props.x=t,this.invalidateVisibleWindowCache(e)},y:(e,t)=>{e.props.y=t,this.invalidateVisibleWindowCache(e)},contain:(e,t)=>{e.props.contain=t,this.invalidateLayoutCache(e)},width:(e,t)=>{e.props.width=t,e.props.contain!=="none"&&this.invalidateLayoutCache(e)},height:(e,t)=>{e.props.height=t,e.props.contain==="both"&&this.invalidateLayoutCache(e)},offsetY:(e,t)=>{e.props.offsetY=t,this.invalidateLayoutCache(e)},scrollY:(e,t)=>{e.props.scrollY=t},letterSpacing:(e,t)=>{e.props.letterSpacing=t,this.invalidateLayoutCache(e)},lineHeight:(e,t)=>{e.props.lineHeight=t,this.invalidateLayoutCache(e)},maxLines:(e,t)=>{e.props.maxLines=t,this.invalidateLayoutCache(e)},textBaseline:(e,t)=>{e.props.textBaseline=t,this.invalidateLayoutCache(e)},verticalAlign:(e,t)=>{e.props.verticalAlign=t,this.invalidateLayoutCache(e)},overflowSuffix:(e,t)=>{e.props.overflowSuffix=t,this.invalidateLayoutCache(e)}}}canRenderFont(e){return!0}isFontFaceSupported(e){return e instanceof yn}addFontFace(e){F(e instanceof yn),Rn.add(e.fontFace)}createState(e){return{props:e,status:"initialState",updateScheduled:!1,emitter:new et,canvasPages:void 0,lightning2TextRenderer:new Wi(this.canvas,this.context),renderWindow:void 0,visibleWindow:{x1:0,y1:0,x2:0,y2:0,valid:!1},renderInfo:void 0,forceFullLayoutCalc:!1,textW:0,textH:0,fontInfo:void 0,fontFaceLoadedHandler:void 0,isRenderable:!1,debugData:{updateCount:0,layoutCount:0,drawCount:0,lastLayoutNumCharacters:0,layoutSum:0,drawSum:0,bufferSize:0}}}updateState(e){var m,w;if(e.status==="initialState"&&this.setStatus(e,"loading"),!e.fontInfo){const S=Yi(e.props);if(e.fontInfo={cssString:S,loaded:!1},!e.fontInfo.loaded){Rn.load(S).then(this.onFontLoaded.bind(this,e,S)).catch(this.onFontLoadError.bind(this,e,S));return}}if(!e.fontInfo.loaded)return;if(!e.renderInfo){const S=e.props.maxLines,A=e.props.contain==="both"?Math.floor((e.props.height-e.props.offsetY)/e.props.lineHeight):0,p=A>0&&S>0?Math.min(A,S):Math.max(A,S);e.lightning2TextRenderer.settings={text:e.props.text,textAlign:e.props.textAlign,fontFace:e.props.fontFamily,fontSize:e.props.fontSize,fontStyle:[e.props.fontStretch,e.props.fontStyle,e.props.fontWeight].join(" "),textColor:Be(e.props.color),offsetY:e.props.fontSize+e.props.offsetY,wordWrap:e.props.contain!=="none",wordWrapWidth:e.props.contain==="none"?void 0:e.props.width,letterSpacing:e.props.letterSpacing,lineHeight:e.props.lineHeight,maxLines:p,textBaseline:e.props.textBaseline,verticalAlign:e.props.verticalAlign,overflowSuffix:e.props.overflowSuffix},e.renderInfo=e.lightning2TextRenderer.calculateRenderInfo(),e.textH=e.renderInfo.lineHeight*e.renderInfo.lines.length,e.textW=e.renderInfo.width,e.renderWindow=void 0}const{x:t,y:o,width:i,height:s,scrollY:l,contain:c}=e.props,{visibleWindow:d}=e;let{renderWindow:h,canvasPages:g}=e;if(!d.valid){const S=dt(t,o,c!=="none"?t+i:1/0,c==="both"?o+s:1/0,$i);ii(this.rendererBounds,S,d),d.valid=!0}const y=d.y2-d.y1,b=Math.ceil(y/e.renderInfo.lineHeight);if(y===0){g=void 0,h=void 0,this.setStatus(e,"loaded");return}else if(h&&g){const S=t+h.x1,A=o-l+h.y1,p=t+h.x2,x=o-l+h.y2;if(S<=d.x1&&p>=d.x2&&A<=d.y1&&x>=d.y2){this.setStatus(e,"loaded");return}xd.y1&&(h.y1-=b*e.renderInfo.lineHeight,h.y2-=b*e.renderInfo.lineHeight,g.unshift(g.pop()),g[0].lineNumStart=g[1].lineNumStart-b,g[0].lineNumEnd=g[0].lineNumStart+b,g[0].valid=!1)}else{const S=e.renderInfo.lineHeight*b,A=Math.ceil(l/S),p=A*b,x=p-b,v=p+b;g=[{texture:g==null?void 0:g[0].texture,lineNumStart:x,lineNumEnd:x+b,valid:!1},{texture:g==null?void 0:g[1].texture,lineNumStart:p,lineNumEnd:p+b,valid:!1},{texture:g==null?void 0:g[2].texture,lineNumStart:v,lineNumEnd:v+b,valid:!1}],e.canvasPages=g;const T=A*S;h={x1:0,y1:T-S,x2:i,y2:T+S*2}}e.renderWindow=h,performance.now();for(const S of g)if(!S.valid){if(S.lineNumStart<0){(m=S.texture)==null||m.setRenderableOwner(e,!1),S.texture=this.stage.txManager.loadTexture("ImageTexture",{src:""}),S.texture.setRenderableOwner(e,e.isRenderable),S.valid=!0;continue}e.lightning2TextRenderer.draw(e.renderInfo,{lines:e.renderInfo.lines.slice(S.lineNumStart,S.lineNumEnd),lineWidths:e.renderInfo.lineWidths.slice(S.lineNumStart,S.lineNumEnd)}),this.canvas.width===0||this.canvas.height===0||((w=S.texture)==null||w.setRenderableOwner(e,!1),S.texture=this.stage.txManager.loadTexture("ImageTexture",{src:this.context.getImageData(0,0,this.canvas.width,this.canvas.height)},{preload:!0}),S.texture.setRenderableOwner(e,e.isRenderable)),S.valid=!0}this.setStatus(e,"loaded")}renderQuads(e,t,o,i){var C,_,E,P,k,L,O,D,U,j,ie,ee;const{stage:s}=this,{canvasPages:l,textW:c=0,textH:d=0,renderWindow:h}=e;if(!l||!h)return;const{x:g,y,scrollY:b,contain:m,width:w,height:S}=e.props,A={x:g,y,width:m!=="none"?w:c,height:m==="both"?S:d};en({x:0,y:0,width:s.options.appWidth,height:s.options.appHeight},A),F(l,"canvasPages is not defined"),F(h,"renderWindow is not defined");const x=(h.y2-h.y1)/3,{zIndex:v,color:T}=e.props,I=i*si(T),R=bt(4294967295,I);l[0].valid&&this.stage.renderer.addQuad({alpha:I,clippingRect:o,colorBl:R,colorBr:R,colorTl:R,colorTr:R,width:((_=(C=l[0].texture)==null?void 0:C.dimensions)==null?void 0:_.width)||0,height:((P=(E=l[0].texture)==null?void 0:E.dimensions)==null?void 0:P.height)||0,texture:l[0].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:v,tx:t.tx,ty:t.ty-b+h.y1,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td}),l[1].valid&&this.stage.renderer.addQuad({alpha:I,clippingRect:o,colorBl:R,colorBr:R,colorTl:R,colorTr:R,width:((L=(k=l[1].texture)==null?void 0:k.dimensions)==null?void 0:L.width)||0,height:((D=(O=l[1].texture)==null?void 0:O.dimensions)==null?void 0:D.height)||0,texture:l[1].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:v,tx:t.tx,ty:t.ty-b+h.y1+x,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td}),l[2].valid&&this.stage.renderer.addQuad({alpha:I,clippingRect:o,colorBl:R,colorBr:R,colorTl:R,colorTr:R,width:((j=(U=l[2].texture)==null?void 0:U.dimensions)==null?void 0:j.width)||0,height:((ee=(ie=l[2].texture)==null?void 0:ie.dimensions)==null?void 0:ee.height)||0,texture:l[2].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:v,tx:t.tx,ty:t.ty-b+h.y1+x+x,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td})}setIsRenderable(e,t){var o;super.setIsRenderable(e,t),(o=e.canvasPages)==null||o.forEach(i=>{var s;(s=i.texture)==null||s.setRenderableOwner(e,t)})}destroyState(e){var t;(t=e.canvasPages)==null||t.forEach(o=>{var i;(i=o.texture)==null||i.setRenderableOwner(e,!1)})}invalidateVisibleWindowCache(e){e.visibleWindow.valid=!1,this.setStatus(e,"loading"),this.scheduleUpdateState(e)}invalidateLayoutCache(e){e.renderInfo=void 0,e.visibleWindow.valid=!1,this.setStatus(e,"loading"),this.scheduleUpdateState(e)}onFontLoaded(e,t){var o;t!==((o=e.fontInfo)==null?void 0:o.cssString)||!e.fontInfo||(e.fontInfo.loaded=!0,this.scheduleUpdateState(e))}onFontLoadError(e,t,o){var i;t!==((i=e.fontInfo)==null?void 0:i.cssString)||!e.fontInfo||(e.fontInfo.loaded=!0,console.error("CanvasTextRenderer: Error loading font '".concat(e.fontInfo.cssString,"'"),o),this.scheduleUpdateState(e))}}class Co extends Ft{constructor(r){super({renderer:r,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2fv"}]})}bindTextures(r){const{glw:e}=this;e.activeTexture(0),e.bindTexture(r[0].ctxTexture)}}u(Co,"shaderSources",{vertex:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n ",fragment:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate);\n gl_FragColor = vec4(v_color) * texture2D(u_texture, v_textureCoordinate);\n }\n "});class To extends Ft{constructor(e){super({renderer:e,attributes:["a_position","a_textureCoordinate","a_color","a_textureIndex"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_textures[0]",uniform:"uniform1iv"}]});u(this,"supportsIndexedTextures",!0)}bindTextures(e){const{renderer:t,glw:o}=this;if(e.length>t.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS)throw new Error("DefaultShaderBatched: Cannot bind more than ".concat(t.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS," textures"));e.forEach((s,l)=>{o.activeTexture(l),o.bindTexture(s.ctxTexture)});const i=Array.from(Array(e.length).keys());this.setUniform("u_textures[0]",i)}}u(To,"shaderSources",{vertex:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n ",fragment:e=>"\n #define txUnits ".concat(e,"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_image;\n uniform sampler2D u_textures[txUnits];\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n vec4 sampleFromTexture(sampler2D textures[").concat(e,"], int idx, vec2 uv) {\n ").concat(Array.from(Array(e).keys()).map(t=>"\n ".concat(t!==0?"else ":"","if (idx == ").concat(t,") {\n return texture2D(textures[").concat(t,"], uv);\n }\n ")).join(""),"\n return texture2D(textures[0], uv);\n }\n\n void main(){\n gl_FragColor = vec4(v_color) * sampleFromTexture(u_textures, int(v_textureIndex), v_textureCoordinate);\n }\n ")});const Br=new Map,ji=(n,r)=>{const e=JSON.stringify(n);if(Br.has(e))return Br.get(e);const t=(n!=null?n:[]).map(o=>({type:o.type,props:r[o.type].resolveDefaults(o.props||{})}));return Br.set(e,t),t},Ee=class Ee extends Ft{constructor(e,t,o){const i=Ee.createShader(t,o);super({renderer:e,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2fv"},{name:"u_dimensions",uniform:"uniform2fv"},{name:"u_alpha",uniform:"uniform1f"},...i.uniforms],shaderSources:{vertex:i.vertex,fragment:i.fragment}});u(this,"effects",[]);this.effects=i.effects,this.calculateProps=oo(this.calculateProps.bind(this))}bindTextures(e){const{glw:t}=this;t.activeTexture(0),t.bindTexture(e[0].ctxTexture)}calculateProps(e){const t=this.renderer.shManager.getRegisteredEffects(),o=[];return e==null||e.forEach((i,s)=>{var g;const l=this.effects[s],c=t[l.name],d=(g=i.props)!=null?g:{},h=l.uniformInfo;Object.keys(d).forEach(y=>{const b=c.uniforms[y],m=h[y];let w=b.validator?b.validator(d[y],d):d[y];Array.isArray(w)&&(w=new Float32Array(w)),o.push({name:m.name,value:w})})}),o}bindProps(e){this.calculateProps(e.effects).forEach(o=>{this.setUniform(o.name,o.value)})}static createShader(e,t){const o={},i={};let s="";const l=[],c=[],d=e.effects.map(m=>{const w=t[m.type],S=w.getEffectKey(m.props||{});o[S]=o[S]?++o[S]:1;const A=o[S];A===1&&c.push({key:S,type:m.type,props:m.props});const p=new w({ref:"".concat(S).concat(A===1?"":A),target:S,props:m.props});return s+=p.declaredUniforms,l.push(...Object.values(p.uniformInfo)),p});let h="";c==null||c.forEach(m=>{var R;const w=t[m.type],S=w.resolveDefaults((R=m.props)!=null?R:{}),A=[];for(const C in w.methods){let _=C;const E=w.methods[C];i[C]&&i[C]!==E&&(_=Ee.resolveMethodDuplicate(C,E,i)),i[_]=E.replace("function",_),A.push({m:C,cm:_})}let p=w.onShaderMask instanceof Function?w.onShaderMask(S):w.onShaderMask,x=w.onColorize instanceof Function?w.onColorize(S):w.onColorize,v=w.onEffectMask instanceof Function?w.onEffectMask(S):w.onEffectMask;A.forEach(C=>{const{m:_,cm:E}=C,P=new RegExp("\\$".concat(_),"g");p&&(p=p.replace(P,E)),x&&(x=x.replace(P,E)),v&&(v=v.replace(P,E))});const T=w.getMethodParameters(w.uniforms,S),I=T.length>0?", ".concat(T):"";p&&(h+="\n float fx_".concat(m.key,"_onShaderMask(float shaderMask ").concat(I,") {\n ").concat(p,"\n }\n ")),x&&(h+="\n vec4 fx_".concat(m.key,"_onColorize(float shaderMask, vec4 maskColor, vec4 shaderColor").concat(I,") {\n ").concat(x,"\n }\n ")),v&&(h+="\n vec4 fx_".concat(m.key,"_onEffectMask(float shaderMask, vec4 maskColor, vec4 shaderColor").concat(I,") {\n ").concat(v,"\n }\n "))});let g="";for(const m in i)g+=i[m];let y="mix(shaderColor, maskColor, clamp(-(lng_DefaultMask), 0.0, 1.0))",b="\n\n ";for(let m=0;m0?", ".concat(w.passParameters):"",A=t[w.name];A.onShaderMask&&(b+="\n shaderMask = fx_".concat(w.target,"_onShaderMask(shaderMask ").concat(S,");\n ")),A.onColorize&&(b+="\n maskColor = fx_".concat(w.target,"_onColorize(shaderMask, maskColor, shaderColor").concat(S,");\n ")),A.onEffectMask&&(y="fx_".concat(w.target,"_onEffectMask(shaderMask, maskColor, shaderColor").concat(S,")"));const p=d[m+1];(p===void 0||t[p.name].onEffectMask)&&(b+="\n shaderColor = ".concat(y,";\n "))}return{effects:d,uniforms:l,fragment:Ee.fragment(s,g,h,b),vertex:Ee.vertex()}}static resolveMethodDuplicate(e,t,o,i=0){const s=e+(i>0?i:"");return o[s]&&o[s]!==t?this.resolveMethodDuplicate(e,t,o,++i):s}static resolveDefaults(e,t){return{effects:ji(e.effects,t),$dimensions:{width:0,height:0},$alpha:0}}static makeCacheKey(e,t){var i;let o="";return(i=e.effects)==null||i.forEach(s=>{const c=t[s.type].getEffectKey(s.props||{});o+=",".concat(c)}),"DynamicShader".concat(o)}};u(Ee,"z$__type__Props"),u(Ee,"vertex",()=>"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n "),u(Ee,"fragment",(e,t,o,i)=>"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n #define PI 3.14159265359\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_alpha;\n uniform float u_radius;\n uniform sampler2D u_texture;\n uniform float u_pixelRatio;\n\n ".concat(e,"\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n ").concat(t,"\n\n ").concat(o,"\n\n void main() {\n vec2 p = v_textureCoordinate.xy * u_dimensions - u_dimensions * 0.5;\n vec2 d = abs(p) - (u_dimensions) * 0.5;\n float lng_DefaultMask = min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n\n vec4 shaderColor = vec4(0.0);\n float shaderMask = lng_DefaultMask;\n\n vec4 maskColor = texture2D(u_texture, v_textureCoordinate) * v_color;\n\n shaderColor = mix(shaderColor, maskColor, clamp(-(lng_DefaultMask + 0.5), 0.0, 1.0));\n\n ").concat(i,"\n\n gl_FragColor = shaderColor * u_alpha;\n }\n "));let ht=Ee;class Pr extends Ft{constructor(r){super({renderer:r,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2f"},{name:"u_dimensions",uniform:"uniform2fv"},{name:"u_radius",uniform:"uniform1f"}]})}static resolveDefaults(r){return{radius:r.radius||10,$dimensions:{width:0,height:0}}}bindTextures(r){const{glw:e}=this;e.activeTexture(0),e.bindTexture(r[0].ctxTexture)}bindProps(r){this.setUniform("u_radius",r.radius)}canBatchShaderProps(r,e){return r.radius===e.radius&&r.$dimensions.width===e.$dimensions.width&&r.$dimensions.height===e.$dimensions.height}}u(Pr,"z$__type__Props"),u(Pr,"shaderSources",{vertex:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n ",fragment:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_radius;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n float boxDist(vec2 p, vec2 size, float radius){\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n\n float fillMask(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate) * v_color;\n vec2 halfDimensions = u_dimensions * 0.5;\n\n float d = boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions + 0.5, u_radius);\n gl_FragColor = mix(vec4(0.0), color, fillMask(d));\n }\n "});const Qi=new Float32Array([1,0,0,0,1,0,0,0,1]),mr=class mr extends Ft{constructor(r){super({renderer:r,attributes:["a_position","a_textureCoordinate"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_transform",uniform:"uniformMatrix3fv"},{name:"u_scrollY",uniform:"uniform1f"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2f"},{name:"u_color",uniform:"uniform4fv"},{name:"u_size",uniform:"uniform1f"},{name:"u_distanceRange",uniform:"uniform1f"},{name:"u_debug",uniform:"uniform1i"}]})}bindTextures(r){const{glw:e}=this;e.activeTexture(0),e.bindTexture(r[0].ctxTexture)}bindProps(r){const e=mr.resolveDefaults(r);for(const t in e)if(t==="transform")this.setUniform("u_transform",!1,e[t]);else if(t==="scrollY")this.setUniform("u_scrollY",e[t]);else if(t==="color"){const o=Be(e.color);this.setUniform("u_color",o)}else t==="size"?this.setUniform("u_size",e[t]):t==="distanceRange"?this.setUniform("u_distanceRange",e[t]):t==="debug"&&this.setUniform("u_debug",e[t]?1:0)}static resolveDefaults(r={}){var e,t,o,i,s,l;return{transform:(e=r.transform)!=null?e:Qi,scrollY:(t=r.scrollY)!=null?t:0,color:(o=r.color)!=null?o:4294967295,size:(i=r.size)!=null?i:16,distanceRange:(s=r.distanceRange)!=null?s:1,debug:(l=r.debug)!=null?l:!1}}};u(mr,"shaderSources",{vertex:"\n // an attribute is an input (in) to a vertex shader.\n // It will receive data from a buffer\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n\n uniform vec2 u_resolution;\n uniform mat3 u_transform;\n uniform float u_scrollY;\n uniform float u_pixelRatio;\n uniform float u_size;\n\n varying vec2 v_texcoord;\n\n void main() {\n vec2 scrolledPosition = a_position * u_size - vec2(0, u_scrollY);\n vec2 transformedPosition = (u_transform * vec3(scrolledPosition, 1)).xy;\n gl_Position = vec4((transformedPosition * u_pixelRatio / u_resolution * 2.0 - 1.0) * vec2(1, -1), 0, 1);\n v_texcoord = a_textureCoordinate;\n }\n ",fragment:"\n precision highp float;\n\n uniform vec4 u_color;\n uniform sampler2D u_texture;\n uniform float u_distanceRange;\n uniform float u_pixelRatio;\n uniform int u_debug;\n\n varying vec2 v_texcoord;\n\n float median(float r, float g, float b) {\n return max(min(r, g), min(max(r, g), b));\n }\n\n void main() {\n vec3 sample = texture2D(u_texture, v_texcoord).rgb;\n if (u_debug == 1) {\n gl_FragColor = vec4(sample.r, sample.g, sample.b, 1.0);\n return;\n }\n float scaledDistRange = u_distanceRange * u_pixelRatio;\n float sigDist = scaledDistRange * (median(sample.r, sample.g, sample.b) - 0.5);\n float opacity = clamp(sigDist + 0.5, 0.0, 1.0) * u_color.a;\n\n // Build the final color.\n // IMPORTANT: We must premultiply the color by the alpha value before returning it.\n gl_FragColor = vec4(u_color.r * opacity, u_color.g * opacity, u_color.b * opacity, opacity);\n }\n "});let Dr=mr;class nt extends oe{constructor(){super(...arguments);u(this,"name","radius")}static getEffectKey(){return"radius"}static resolveDefaults(e){var t;return{radius:(t=e.radius)!=null?t:10}}}u(nt,"z$__type__Props"),u(nt,"uniforms",{radius:{value:0,method:"uniform4fv",type:"vec4",validator:e=>{let t=e;return Array.isArray(t)?t.length===2?t=[t[0],t[1],t[0],t[1]]:t.length===3?t=[t[0],t[1],t[2],t[0]]:t.length!==4&&(t=[t[0],t[0],t[0],t[0]]):typeof t=="number"&&(t=[t,t,t,t]),t}}}),u(nt,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",boxDist:"\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n "}),u(nt,"onShaderMask","\n vec2 halfDimensions = u_dimensions * 0.5;\n float r = radius[0] * step(v_textureCoordinate.x, 0.5) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[1] * step(0.5, v_textureCoordinate.x) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[2] * step(0.5, v_textureCoordinate.x) * step(0.5, v_textureCoordinate.y);\n r = r + radius[3] * step(v_textureCoordinate.x, 0.5) * step(0.5, v_textureCoordinate.y);\n return $boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions, r);\n "),u(nt,"onEffectMask","\n return mix(vec4(0.0), maskColor, $fillMask(shaderMask));\n ");class St extends oe{constructor(){super(...arguments);u(this,"name","border")}static getEffectKey(){return"border"}static resolveDefaults(e){var t,o;return{width:(t=e.width)!=null?t:10,color:(o=e.color)!=null?o:4294967295}}}u(St,"z$__type__Props"),u(St,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>Be(e),method:"uniform4fv",type:"vec4"}}),u(St,"onEffectMask","\n float mask = clamp(shaderMask + width, 0.0, 1.0) - clamp(shaderMask, 0.0, 1.0);\n return mix(shaderColor, mix(shaderColor, maskColor, maskColor.a), mask);\n "),u(St,"onColorize","\n return color;\n ");const Ue=class Ue extends oe{constructor(){super(...arguments);u(this,"name","linearGradient")}static getEffectKey(e){return"linearGradient".concat(e.colors.length)}static resolveDefaults(e){var i,s;const t=(i=e.colors)!=null?i:[4278190080,4294967295];let o=e.stops||[];if(o.length===0||o.length!==t.length){const l=t.length;let c=0;const d=o;for(;ce.map(o=>Be(o)).reduce((o,i)=>o.concat(i),[]),size:e=>e.colors.length,method:"uniform4fv",type:"vec4"},stops:{value:[],size:e=>e.colors.length,method:"uniform1fv",type:"float"}}),u(Ue,"methods",{fromLinear:"\n vec4 function(vec4 linearRGB) {\n vec4 higher = vec4(1.055)*pow(linearRGB, vec4(1.0/2.4)) - vec4(0.055);\n vec4 lower = linearRGB * vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n ",toLinear:"\n vec4 function(vec4 sRGB) {\n vec4 higher = pow((sRGB + vec4(0.055))/vec4(1.055), vec4(2.4));\n vec4 lower = sRGB/vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n ",calcPoint:"\n vec2 function(float d, float angle) {\n return d * vec2(cos(angle), sin(angle)) + (u_dimensions * 0.5);\n }\n "}),u(Ue,"ColorLoop",e=>{let t="";for(let o=2;o{const t=e.colors.length||1;return"\n float a = angle - (PI / 180.0 * 90.0);\n float lineDist = abs(u_dimensions.x * cos(a)) + abs(u_dimensions.y * sin(a));\n vec2 f = $calcPoint(lineDist * 0.5, a);\n vec2 t = $calcPoint(lineDist * 0.5, a + PI);\n vec2 gradVec = t - f;\n float dist = dot(v_textureCoordinate.xy * u_dimensions - f, gradVec) / dot(gradVec, gradVec);\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = $fromLinear(mix($toLinear(colors[0]), $toLinear(colors[1]), stopCalc));\n ".concat(Ue.ColorLoop(t),"\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n ")});let Or=Ue;class Ur extends oe{constructor(){super(...arguments);u(this,"name","grayscale")}static getEffectKey(){return"grayscale"}static resolveDefaults(e){var t;return{amount:(t=e.amount)!=null?t:1}}}u(Ur,"uniforms",{amount:{value:1,method:"uniform1f",type:"float"}}),u(Ur,"onColorize","\n float grayness = 0.2 * maskColor.r + 0.6 * maskColor.g + 0.2 * maskColor.b;\n return vec4(amount * vec3(grayness) + (1.0 - amount) * maskColor.rgb, maskColor.a);\n ");class ot extends oe{constructor(){super(...arguments);u(this,"name","borderRight")}static getEffectKey(){return"borderRight"}static resolveDefaults(e){var t,o;return{width:(t=e.width)!=null?t:10,color:(o=e.color)!=null?o:4294967295}}}u(ot,"z$__type__Props"),u(ot,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>Be(e),method:"uniform4fv",type:"vec4"}}),u(ot,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),u(ot,"onEffectMask","\n vec2 pos = vec2(u_dimensions.x - width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),u(ot,"onColorize","\n return color;\n ");class it extends oe{constructor(){super(...arguments);u(this,"name","borderTop")}static getEffectKey(){return"borderTop"}static resolveDefaults(e){var t,o;return{width:(t=e.width)!=null?t:10,color:(o=e.color)!=null?o:4294967295}}}u(it,"z$__type__Props"),u(it,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>Be(e),method:"uniform4fv",type:"vec4"}}),u(it,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),u(it,"onEffectMask","\n vec2 pos = vec2(0.0, width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),u(it,"onColorize","\n return color;\n ");class st extends oe{constructor(){super(...arguments);u(this,"name","borderBottom")}static getEffectKey(){return"borderBottom"}static resolveDefaults(e){var t,o;return{width:(t=e.width)!=null?t:10,color:(o=e.color)!=null?o:4294967295}}}u(st,"z$__type__Props"),u(st,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>Be(e),method:"uniform4fv",type:"vec4"}}),u(st,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),u(st,"onEffectMask","\n vec2 pos = vec2(0.0, u_dimensions.y - width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),u(st,"onColorize","\n return color;\n ");class at extends oe{constructor(){super(...arguments);u(this,"name","borderLeft")}static getEffectKey(){return"borderLeft"}static resolveDefaults(e){var t,o;return{width:(t=e.width)!=null?t:10,color:(o=e.color)!=null?o:4294967295}}}u(at,"z$__type__Props"),u(at,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>Be(e),method:"uniform4fv",type:"vec4"}}),u(at,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),u(at,"onEffectMask","\n vec2 pos = vec2(width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),u(at,"onColorize","\n return color;\n ");class At extends oe{constructor(){super(...arguments);u(this,"name","glitch")}static getEffectKey(e){return"glitch"}static resolveDefaults(e){var t,o,i,s,l;return{amplitude:(t=e.amplitude)!=null?t:.2,narrowness:(o=e.narrowness)!=null?o:4,blockiness:(i=e.blockiness)!=null?i:2,minimizer:(s=e.minimizer)!=null?s:8,time:(l=e.time)!=null?l:Date.now()}}}u(At,"z$__type__Props"),u(At,"uniforms",{amplitude:{value:0,method:"uniform1f",type:"float"},narrowness:{value:0,method:"uniform1f",type:"float"},blockiness:{value:0,method:"uniform1f",type:"float"},minimizer:{value:0,method:"uniform1f",type:"float"},time:{value:0,method:"uniform1f",validator:e=>(Date.now()-e)%1e3,type:"float"}}),u(At,"methods",{rand:"\n float function(vec2 p, float time) {\n float t = floor(time * 20.) / 10.;\n return fract(sin(dot(p, vec2(t * 12.9898, t * 78.233))) * 43758.5453);\n }\n ",noise:"\n float function(vec2 uv, float blockiness, float time) {\n vec2 lv = fract(uv);\n vec2 id = floor(uv);\n\n float n1 = rand(id, time);\n float n2 = rand(id+vec2(1,0), time);\n float n3 = rand(id+vec2(0,1), time);\n float n4 = rand(id+vec2(1,1), time);\n vec2 u = smoothstep(0.0, 1.0 + blockiness, lv);\n return mix(mix(n1, n2, u.x), mix(n3, n4, u.x), u.y);\n }\n ",fbm:"\n float function(vec2 uv, int count, float blockiness, float complexity, float time) {\n float val = 0.0;\n float amp = 0.5;\n const int MAX_ITERATIONS = 10;\n\n for(int i = 0; i < MAX_ITERATIONS; i++) {\n if(i >= count) {break;}\n val += amp * noise(uv, blockiness, time);\n amp *= 0.5;\n uv *= complexity;\n }\n return val;\n }\n "}),u(At,"onColorize","\n vec2 uv = v_textureCoordinate.xy;\n float aspect = u_dimensions.x / u_dimensions.y;\n vec2 a = vec2(uv.x * aspect , uv.y);\n vec2 uv2 = vec2(a.x / u_dimensions.x, exp(a.y));\n\n float shift = amplitude * pow($fbm(uv2, 4, blockiness, narrowness, time), minimizer);\n float colR = texture2D(u_texture, vec2(uv.x + shift, uv.y)).r * (1. - shift);\n float colG = texture2D(u_texture, vec2(uv.x - shift, uv.y)).g * (1. - shift);\n float colB = texture2D(u_texture, vec2(uv.x - shift, uv.y)).b * (1. - shift);\n\n vec3 f = vec3(colR, colG, colB);\n return vec4(f, texture2D(u_texture, vec2(uv.x - shift, uv.y)).a);\n ");class rr extends oe{constructor(){super(...arguments);u(this,"name","fadeOut")}static getEffectKey(){return"fadeOut"}static resolveDefaults(e){var t;return{fade:(t=e.fade)!=null?t:10}}}u(rr,"z$__type__Props"),u(rr,"uniforms",{fade:{value:0,method:"uniform4fv",type:"vec4",validator:e=>{let t=e;return Array.isArray(t)?t.length===2?t=[t[0],t[1],t[0],t[1]]:t.length===3?t=[t[0],t[1],t[2],t[0]]:t.length!==4&&(t=[t[0],t[0],t[0],t[0]]):typeof t=="number"&&(t=[t,t,t,t]),t}}}),u(rr,"onColorize","\n vec2 point = v_textureCoordinate.xy * u_dimensions.xy;\n vec2 pos1;\n vec2 pos2;\n vec2 d;\n float c;\n vec4 result = maskColor;\n\n\n if(fade[0] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x, point.y + fade[0]);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[1] > 0.0) {\n pos1 = vec2(point.x - u_dimensions.x - fade[1], v_textureCoordinate.y);\n pos2 = vec2(point.x - u_dimensions.x, v_textureCoordinate.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[2] > 0.0) {\n pos1 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y - fade[2]);\n pos2 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[3] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x + fade[3], point.y);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n return result;\n ");const Ge=class Ge extends oe{constructor(){super(...arguments);u(this,"name","radialGradient")}static getEffectKey(e){return"radialGradient".concat(e.colors.length)}static resolveDefaults(e){var i,s,l,c,d;const t=(i=e.colors)!=null?i:[4278190080,4294967295];let o=e.stops||[];if(o.length===0||o.length!==t.length){const h=t.length;let g=0;const y=o;for(;ge.map(o=>Be(o)).reduce((o,i)=>o.concat(i),[]),size:e=>e.colors.length,method:"uniform4fv",type:"vec4"},stops:{value:[],size:e=>e.colors.length,method:"uniform1fv",type:"float"}}),u(Ge,"ColorLoop",e=>{let t="";for(let o=2;o{const t=e.colors.length||1;return"\n vec2 point = v_textureCoordinate.xy * u_dimensions;\n vec2 projection = vec2(pivot.x * u_dimensions.x, pivot.y * u_dimensions.y);\n\n float dist = length((point - projection) / vec2(width, height));\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = mix(colors[0], colors[1], stopCalc);\n ".concat(Ge.ColorLoop(t),"\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n ")});let Wr=Ge;class lt extends oe{constructor(){super(...arguments);u(this,"name","radialProgress")}static getEffectKey(){return"radialProgress"}static resolveDefaults(e){var t,o,i,s,l,c,d;return{width:(t=e.width)!=null?t:10,progress:(o=e.progress)!=null?o:.5,offset:(i=e.offset)!=null?i:0,range:(s=e.range)!=null?s:Math.PI*2,rounded:(l=e.rounded)!=null?l:!1,radius:(c=e.radius)!=null?c:1,color:(d=e.color)!=null?d:4294967295}}}u(lt,"z$__type__Props"),u(lt,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},progress:{value:.5,method:"uniform1f",type:"float"},offset:{value:0,method:"uniform1f",type:"float"},range:{value:0,method:"uniform1f",type:"float"},rounded:{value:0,method:"uniform1f",type:"float",validator:e=>e?1:0},radius:{value:1,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>Be(e),method:"uniform4fv",type:"vec4"}}),u(lt,"methods",{rotateUV:"\n vec2 function(vec2 uv, float d) {\n float s = sin(d);\n float c = cos(d);\n mat2 rotMatrix = mat2(c, -s, s, c);\n return uv * rotMatrix;\n }\n ",drawDot:"\n float function(vec2 uv, vec2 p, float r) {\n uv += p;\n float circle = length(uv) - r;\n return clamp(-circle, 0.0, 1.0);\n }\n "}),u(lt,"onEffectMask","\n float outerRadius = radius * u_dimensions.y * 0.5;\n\n float endAngle = range * progress - 0.0005;\n\n vec2 uv = v_textureCoordinate.xy * u_dimensions.xy - u_dimensions * 0.5;\n\n uv = $rotateUV(uv, -(offset));\n float linewidth = width * u_pixelRatio;\n float circle = length(uv) - (outerRadius - linewidth) ;\n circle = abs(circle) - linewidth;\n circle = clamp(-circle, 0.0, 1.0);\n\n float angle = (atan(uv.x, -uv.y) / 3.14159265359 * 0.5);\n float p = endAngle / (PI * 2.);\n\n circle *= step(fract(angle), fract(p));\n\n circle = rounded < 1. ? circle : max(circle, $drawDot(uv, vec2(0, outerRadius - linewidth), linewidth));\n circle = rounded < 1. ? circle : max(circle, $drawDot($rotateUV(uv, -(endAngle)), vec2(0, outerRadius - linewidth), linewidth));\n\n return mix(shaderColor, maskColor, circle);\n "),u(lt,"onColorize","\n return color;\n ");class ct extends oe{constructor(){super(...arguments);u(this,"name","holePunch")}static getEffectKey(){return"holePunch"}static resolveDefaults(e){var t;return{x:e.x||0,y:e.y||0,width:e.width||50,height:e.height||50,radius:(t=e.radius)!=null?t:0}}}u(ct,"z$__type__Props"),u(ct,"uniforms",{x:{value:0,method:"uniform1f",type:"float"},y:{value:0,method:"uniform1f",type:"float"},width:{value:0,method:"uniform1f",type:"float"},height:{value:0,method:"uniform1f",type:"float"},radius:{value:0,method:"uniform4fv",type:"vec4",validator:e=>{let t=e;return Array.isArray(t)?t.length===2?t=[t[0],t[1],t[0],t[1]]:t.length===3?t=[t[0],t[1],t[2],t[0]]:t.length!==4&&(t=[t[0],t[0],t[0],t[0]]):typeof t=="number"&&(t=[t,t,t,t]),t}}}),u(ct,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",boxDist:"\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n "}),u(ct,"onShaderMask","\n vec2 halfDimensions = u_dimensions * 0.5;\n vec2 size = vec2(width, height) * 0.5;\n vec2 basePos = v_textureCoordinate.xy * u_dimensions.xy - vec2(x, y);\n vec2 pos = basePos - size;\n float r = radius[0] * step(pos.x, 0.5) * step(pos.y, 0.5);\n r = r + radius[1] * step(0.5, pos.x) * step(pos.y, 0.5);\n r = r + radius[2] * step(0.5, pos.x) * step(0.5, pos.y);\n r = r + radius[3] * step(pos.x, 0.5) * step(0.5, pos.y);\n return $boxDist(pos, size, r);\n "),u(ct,"onEffectMask","\n return mix(maskColor, vec4(0.0), $fillMask(shaderMask));\n ");class Ki{constructor(){u(this,"shCache",new Map);u(this,"shConstructors",{});u(this,"attachedShader",null);u(this,"effectConstructors",{});u(this,"renderer");this.registerShaderType("DefaultShader",Co),this.registerShaderType("DefaultShaderBatched",To),this.registerShaderType("RoundedRectangle",Pr),this.registerShaderType("DynamicShader",ht),this.registerShaderType("SdfShader",Dr),this.registerEffectType("border",St),this.registerEffectType("borderBottom",st),this.registerEffectType("borderLeft",at),this.registerEffectType("borderRight",ot),this.registerEffectType("borderTop",it),this.registerEffectType("fadeOut",rr),this.registerEffectType("linearGradient",Or),this.registerEffectType("radialGradient",Wr),this.registerEffectType("grayscale",Ur),this.registerEffectType("glitch",At),this.registerEffectType("radius",nt),this.registerEffectType("radialProgress",lt),this.registerEffectType("holePunch",ct)}registerShaderType(r,e){this.shConstructors[r]=e}registerEffectType(r,e){this.effectConstructors[r]=e}getRegisteredEffects(){return this.effectConstructors}getRegisteredShaders(){return this.shConstructors}loadShader(r,e){if(!this.renderer)throw new Error("Renderer is not been defined");const t=this.shConstructors[r];if(!t)throw new Error('Shader type "'.concat(r,'" is not registered'));if(r==="DynamicShader")return this.loadDynamicShader(e);const o=t.resolveDefaults(e),i=t.makeCacheKey(o)||t.name;if(i&&this.shCache.has(i))return{shader:this.shCache.get(i),props:o};const s=new t(this.renderer,e);return i&&this.shCache.set(i,s),{shader:s,props:o}}loadDynamicShader(r){if(!this.renderer)throw new Error("Renderer is not been defined");const e=ht.resolveDefaults(r,this.effectConstructors),t=ht.makeCacheKey(e,this.effectConstructors);if(t&&this.shCache.has(t))return{shader:this.shCache.get(t),props:e};const o=new ht(this.renderer,r,this.effectConstructors);return t&&this.shCache.set(t,o),{shader:o,props:e}}useShader(r){this.attachedShader!==r&&(this.attachedShader&&this.attachedShader.detach(),r.attach(),this.attachedShader=r)}}class Xi{constructor(){u(this,"data",{})}reset(){this.data={}}increment(r){this.data[r]||(this.data[r]=0),this.data[r]++}getData(){return{...this.data}}}function Vi(n){return/\.(ktx|pvr)$/.test(n)}const Gi=async n=>{const e=await(await fetch(n)).arrayBuffer();return n.indexOf(".ktx")!==-1?qi(e):Zi(e)},qi=async n=>{const r=new DataView(n),e=r.getUint32(12)===16909060,t=[],o={glInternalFormat:r.getUint32(28,e),pixelWidth:r.getUint32(36,e),pixelHeight:r.getUint32(40,e),numberOfMipmapLevels:r.getUint32(56,e),bytesOfKeyValueData:r.getUint32(60,e)};let i=64;i+=o.bytesOfKeyValueData;for(let s=0;s{const l=n,c=new Int32Array(l,0,13),d=c[12]+52,h=new Uint8Array(l,d),g=[],y={pixelWidth:c[7],pixelHeight:c[6],numberOfMipmapLevels:c[11]||0};let b=0,m=y.pixelWidth||0,w=y.pixelHeight||0;for(let S=0;S>2)*(w+3>>2)*8,p=new Uint8Array(l,h.byteOffset+b,A);g.push(p),b+=A,m=m>>1,w=w>>1}return{data:{glInternalFormat:36196,mipmaps:g,width:y.pixelWidth||0,height:y.pixelHeight||0,type:"pvr"},premultiplyAlpha:!1}},Bt=class Bt extends io{constructor(e,t){super(e);u(this,"props");this.props=Bt.resolveDefaults(t)}hasAlphaChannel(e){return e.indexOf("image/png")!==-1}async getTextureData(){const{src:e,premultiplyAlpha:t}=this.props;if(!e)return{data:null};if(e instanceof ImageData)return{data:e,premultiplyAlpha:t};if(Vi(e))return Gi(e);if(this.txManager.imageWorkerManager)return await this.txManager.imageWorkerManager.getImage(e,t);if(this.txManager.hasCreateImageBitmap){const i=await(await fetch(e)).blob(),s=t!=null?t:this.hasAlphaChannel(i.type);return{data:await createImageBitmap(i,{premultiplyAlpha:s?"premultiply":"none",colorSpaceConversion:"none",imageOrientation:"none"}),premultiplyAlpha:s}}else{const o=new Image;return o.src=e,await new Promise((i,s)=>{o.onload=()=>i(),o.onerror=()=>s(new Error("Failed to load image"))}).catch(i=>{console.error(i)}),{data:o,premultiplyAlpha:t!=null?t:!0}}}static makeCacheKey(e){const t=Bt.resolveDefaults(e);return t.src instanceof ImageData?!1:"ImageTexture,".concat(t.src,",").concat(t.premultiplyAlpha)}static resolveDefaults(e){var t,o;return{src:(t=e.src)!=null?t:"",premultiplyAlpha:(o=e.premultiplyAlpha)!=null?o:!0}}};u(Bt,"z$__type__Props");let Yr=Bt;const Ji=24;function es(n,r,e,t,o,i,s,l,c){const d=Math.min(Math.max(s.firstLineIdx,0),l.length),h=0;let g=0;t==="middle"?g=(r-n)/2:t==="bottom"&&(g=r-n);const b=o/i+d*r+g;if(!(c&&b>=c/i))return{sdfX:h,sdfY:b,lineIndex:d}}class Ct{constructor(r,e=0){u(this,"iterator");u(this,"peekBuffer",[]);u(this,"_lastIndex");this.iterator=r,this.iterator=r,this._lastIndex=e-1,this.peekBuffer=[]}next(){const r=this.peekBuffer.length>0?this.peekBuffer.pop():this.iterator.next();return r.done?this._lastIndex=-1:this._lastIndex++,r}peek(){if(this.peekBuffer.length>0)return this.peekBuffer[0];const r=this.iterator.next();return this.peekBuffer.push(r),r}get lastIndex(){return this._lastIndex}}function*Tt(n,r=0){let e=r;for(;e=b.y1,ze=O<=b.y2,pe=Me&&ze;for(;(ce=ee.next())&&!ce.done;){const K=ce.value;if(n===y.length)y.push({codepointIndex:K.cluster,maxY:k,maxX:P});else if(n>y.length)throw new Error("Unexpected lineCache length");if(K.codepoint===32||K.codepoint===10?U.codepointIndex!==-1&&(U.codepointIndex=-1,re=L):U.codepointIndex===-1&&(U.codepointIndex=K.cluster,U.bufferOffset=D,U.xStart=re),K.mapped){const Ot=L+K.xOffset+K.width;if(g!=="none"&&Ot>=ge&&U.codepointIndex!==-1&&U.xStart>0)if(we){ee=j.shapeText(ie,new Ct(Tt(t,U.codepointIndex),U.codepointIndex)),D=U.bufferOffset;break}else ee=j.shapeText(ie,new Ct(Tt(A,0),0)),L=U.xStart,D=U.bufferOffset,g="none";else{const Pe=L+K.xOffset,De=O+K.yOffset;if(pe){Ae===-1&&(Ae=D);const Qe=m.getAtlasEntry(K.glyphId),Ke=Qe.x/m.data.common.scaleW,Xe=Qe.y/m.data.common.scaleH,mn=Qe.width/m.data.common.scaleW,xn=Qe.height/m.data.common.scaleH;h[D++]=Pe,h[D++]=De,h[D++]=Ke,h[D++]=Xe,h[D++]=Pe+K.width,h[D++]=De,h[D++]=Ke+mn,h[D++]=Xe,h[D++]=Pe,h[D++]=De+K.height,h[D++]=Ke,h[D++]=Xe+xn,h[D++]=Pe+K.width,h[D++]=De+K.height,h[D++]=Ke+mn,h[D++]=Xe+xn}k=Math.max(k,De+K.height),P=Math.max(P,Pe+K.width),L+=K.xAdvance}}else if(K.codepoint===10){if(we)break;ee=j.shapeText(ie,new Ct(Tt(A,0),0)),g="none"}}Ae!==-1&&(Le.push({bufferStart:Ae,bufferEnd:D}),Ae=-1),L=0,O+=v,n++,U.codepointIndex=-1,re=0,!w&&g==="both"&&O>b.y2||ce&&ce.done?je=!1:we||(je=!1)}if(o==="center"){const we=g==="none"?P:T;for(let ge=0;getypeof n=="number"?n:ss[n]||400;function as(n,r,e,t,o){let i=In(e);for(const s of n){const l=s[r];if(!l)continue;if(l.size===1)return console.warn("TrFontManager: Only one font face found for family: '".concat(r,"' - will be used for all weights and styles")),l.values().next().value;const c=new Map;for(const h of l){const g=In(h.descriptors.weight);if(g===i&&h.descriptors.style===t&&h.descriptors.stretch===o)return h;c.set(g,h)}const d="TrFontManager: No exact match: '".concat(r," Weight: ").concat(i," Style: ").concat(t," Stretch: ").concat(o,"'");if(console.error(d),i===400&&c.has(500))return c.get(500);if(i===500&&c.has(400))return c.get(400);if(i<400){for(;i>0;){if(c.has(i))return c.get(i);i-=100}i=600}for(;i<1e3;){if(c.has(i))return c.get(i);i+=100}for(i=500;i>0;){if(c.has(i))return c.get(i);i-=100}}}const ls=oo(as);class _o{constructor(r){u(this,"textRenderers");this.textRenderers=r}addFontFace(r){for(const e in this.textRenderers){const t=this.textRenderers[e];t&&t.isFontFaceSupported(r)&&t.addFontFace(r)}}static resolveFontFace(r,e){const{fontFamily:t,fontWeight:o,fontStyle:i,fontStretch:s}=e;return ls(r,t,o,i,s)}}const cs={x:0,y:0,width:0,height:0};class ds extends Ao{constructor(e){super(e);u(this,"ssdfFontFamilies",{});u(this,"msdfFontFamilies",{});u(this,"fontFamilyArray",[this.ssdfFontFamilies,this.msdfFontFamilies]);u(this,"sdfShader");u(this,"rendererBounds");this.sdfShader=this.stage.shManager.loadShader("SdfShader").shader,this.rendererBounds={x1:0,y1:0,x2:this.stage.options.appWidth,y2:this.stage.options.appHeight}}getPropertySetters(){return{fontFamily:(e,t)=>{e.props.fontFamily=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontWeight:(e,t)=>{e.props.fontWeight=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontStyle:(e,t)=>{e.props.fontStyle=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontStretch:(e,t)=>{e.props.fontStretch=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontSize:(e,t)=>{e.props.fontSize=t,this.invalidateLayoutCache(e)},text:(e,t)=>{e.props.text=t,this.invalidateLayoutCache(e)},textAlign:(e,t)=>{e.props.textAlign=t,this.invalidateLayoutCache(e)},color:(e,t)=>{e.props.color=t},x:(e,t)=>{e.props.x=t,e.elementBounds.valid&&(this.setElementBoundsX(e),!e.renderWindow.valid&&Tr(e.elementBounds,this.rendererBounds)&&this.scheduleUpdateState(e))},y:(e,t)=>{e.props.y=t,e.elementBounds.valid&&(this.setElementBoundsY(e),!e.renderWindow.valid&&Tr(e.elementBounds,this.rendererBounds)&&this.scheduleUpdateState(e))},contain:(e,t)=>{e.props.contain=t,this.invalidateLayoutCache(e)},width:(e,t)=>{e.props.width=t,e.props.contain!=="none"&&this.invalidateLayoutCache(e)},height:(e,t)=>{e.props.height=t,e.props.contain==="both"&&this.invalidateLayoutCache(e)},offsetY:(e,t)=>{e.props.offsetY=t,this.invalidateLayoutCache(e)},scrollable:(e,t)=>{e.props.scrollable=t,this.invalidateLayoutCache(e)},scrollY:(e,t)=>{e.props.scrollY=t,this.scheduleUpdateState(e)},letterSpacing:(e,t)=>{e.props.letterSpacing=t,this.invalidateLayoutCache(e)},lineHeight:(e,t)=>{e.props.lineHeight=t,this.invalidateLayoutCache(e)},maxLines:(e,t)=>{e.props.maxLines=t,this.invalidateLayoutCache(e)},textBaseline:(e,t)=>{e.props.textBaseline=t,this.invalidateLayoutCache(e)},verticalAlign:(e,t)=>{e.props.verticalAlign=t,this.invalidateLayoutCache(e)},overflowSuffix:(e,t)=>{e.props.overflowSuffix=t,this.invalidateLayoutCache(e)},debug:(e,t)=>{e.props.debug=t}}}canRenderFont(e){const{fontFamily:t}=e;return t in this.ssdfFontFamilies||t in this.msdfFontFamilies||t==="$$SDF_FAILURE_TEST$$"}isFontFaceSupported(e){return e instanceof vn}addFontFace(e){F(e instanceof vn);const t=e.fontFamily,o=e.type==="ssdf"?this.ssdfFontFamilies:e.type==="msdf"?this.msdfFontFamilies:void 0;if(!o){console.warn("Invalid font face type: ".concat(e.type));return}let i=o[t];i||(i=new Set,o[t]=i),i.add(e)}createState(e){return{props:e,status:"initialState",updateScheduled:!1,emitter:new et,lineCache:[],forceFullLayoutCalc:!1,renderWindow:{screen:{x1:0,y1:0,x2:0,y2:0},sdf:{x1:0,y1:0,x2:0,y2:0},firstLineIdx:0,numLines:0,valid:!1},elementBounds:{x1:0,y1:0,x2:0,y2:0,valid:!1},clippingRect:{x:0,y:0,width:0,height:0,valid:!1},bufferNumFloats:0,bufferNumQuads:0,vertexBuffer:void 0,webGlBuffers:null,bufferUploaded:!1,textH:void 0,textW:void 0,distanceRange:0,trFontFace:void 0,isRenderable:!1,debugData:{updateCount:0,layoutCount:0,lastLayoutNumCharacters:0,layoutSum:0,drawSum:0,drawCount:0,bufferSize:0}}}updateState(e){let{trFontFace:t}=e;const{textH:o,lineCache:i,debugData:s,forceFullLayoutCalc:l}=e;if(s.updateCount++,e.status==="initialState"&&this.setStatus(e,"loading"),!t){if(t=this.resolveFontFace(e.props),e.trFontFace=t,!t){const j="SdfTextRenderer: Could not resolve font face for family: '".concat(e.props.fontFamily,"'");console.error(j),this.setStatus(e,"failed",new Error(j));return}t.texture.setRenderableOwner(e,e.isRenderable)}if(!t.loaded){t.once("loaded",()=>{this.scheduleUpdateState(e)});return}F(t.data,"Font face data should be loaded");const{text:c,fontSize:d,x:h,y:g,contain:y,width:b,height:m,lineHeight:w,verticalAlign:S,scrollable:A,overflowSuffix:p,maxLines:x}=e.props,v=y==="both"&&A?e.props.scrollY:0,{renderWindow:T}=e,I=t.data.info.size,R=d/I,C=w/R;e.distanceRange=R*t.data.distanceField.distanceRange;const _=c.length*Ji;let E=e.vertexBuffer;(!E||E.length<_)&&(E=new Float32Array(_*2));const P=e.elementBounds;if(P.valid||(this.setElementBoundsX(e),this.setElementBoundsY(e),P.valid=!0),!l&&T.valid){const j=T.screen;if(h+j.x1<=P.x1&&h+j.x2>=P.x2&&g-v+j.y1<=P.y1&&g-v+j.y2>=P.y2){this.setStatus(e,"loaded");return}T.valid=!1,this.setStatus(e,"loading")}const{offsetY:k,textAlign:L}=e.props;if(!T.valid){if(!Tr(P,this.rendererBounds))return;is(T,h,g,v,w,y==="both"?P.y2-P.y1:0,P,R)}const O=es(I,C,w,S,k,R,T,i,o);if(!O){this.setStatus(e,"loaded");return}const{letterSpacing:D}=e.props,U=rs(O.lineIndex,O.sdfX,O.sdfY,c,L,b,m,d,w,D,E,y,i,T.sdf,t,l,A,p,x);e.bufferUploaded=!1,e.bufferNumFloats=U.bufferNumFloats,e.bufferNumQuads=U.bufferNumQuads,e.vertexBuffer=E,e.renderWindow=T,s.lastLayoutNumCharacters=U.layoutNumCharacters,s.bufferSize=E.byteLength,U.fullyProcessed&&(e.textW=U.maxX*R,e.textH=U.maxY*R),this.setStatus(e,"loaded")}renderQuads(e,t,o,i){var _,E,P;if(!e.vertexBuffer)return;const{renderer:s}=this.stage,{fontSize:l,color:c,contain:d,scrollable:h,zIndex:g,debug:y}=e.props,b=d==="both"&&h?e.props.scrollY:0,{textW:m=0,textH:w=0,distanceRange:S,vertexBuffer:A,bufferUploaded:p,trFontFace:x,elementBounds:v}=e;let{webGlBuffers:T}=e;if(!T){const k=s.glw,L=4*Float32Array.BYTES_PER_ELEMENT,O=k.createBuffer();F(O),e.webGlBuffers=new li([{buffer:O,attributes:{a_position:{name:"a_position",size:2,type:k.FLOAT,normalized:!1,stride:L,offset:0},a_textureCoordinate:{name:"a_textureCoordinate",size:2,type:k.FLOAT,normalized:!1,stride:L,offset:2*Float32Array.BYTES_PER_ELEMENT}}}]),e.bufferUploaded=!1,F(e.webGlBuffers),T=e.webGlBuffers}if(!p){const k=s.glw,L=(_=T==null?void 0:T.getBuffer("a_textureCoordinate"))!=null?_:null;k.arrayBufferData(L,A,k.STATIC_DRAW),e.bufferUploaded=!0}if(F(x),h&&d==="both"){F(v.valid);const k=ci(v,cs);o.valid?(e.clippingRect.valid=!0,o=en(o,k,e.clippingRect)):(e.clippingRect.valid=!0,o=so(k,e.clippingRect))}const I=new di(s.glw,s.options,T,this.sdfShader,{transform:t.data,color:hi(c,i),size:l/(((E=x.data)==null?void 0:E.info.size)||0),scrollY:b,distanceRange:S,debug:y.sdfShaderDebug},i,o,{height:w,width:m},0,g),R=(P=e.trFontFace)==null?void 0:P.texture;F(R);const C=this.stage.txManager.getCtxTexture(R);I.addTexture(C),I.length=e.bufferNumFloats,I.numQuads=e.bufferNumQuads,s.addRenderOp(I)}setIsRenderable(e,t){var o;super.setIsRenderable(e,t),(o=e.trFontFace)==null||o.texture.setRenderableOwner(e,t)}destroyState(e){var t;super.destroyState(e),(t=e.trFontFace)==null||t.texture.setRenderableOwner(e,!1)}resolveFontFace(e){return _o.resolveFontFace(this.fontFamilyArray,e)}releaseFontFace(e){e.trFontFace&&(e.trFontFace.texture.setRenderableOwner(e,!1),e.trFontFace=void 0)}invalidateLayoutCache(e){e.renderWindow.valid=!1,e.elementBounds.valid=!1,e.textH=void 0,e.textW=void 0,e.lineCache=[],this.setStatus(e,"loading"),this.scheduleUpdateState(e)}setElementBoundsX(e){const{x:t,contain:o,width:i}=e.props,{elementBounds:s}=e;s.x1=t,s.x2=o!=="none"?t+i:1/0}setElementBoundsY(e){const{y:t,contain:o,height:i}=e.props,{elementBounds:s}=e;s.y1=t,s.y2=o==="both"?t+i:1/0}}function hs(n){return n.prototype instanceof ui}async function us(n,r){let e;try{console.log("Loading core extension",n),e=await Oi(()=>import(n),__vite__mapDeps([]))}catch(o){console.error("The core extension module at '".concat(n,"' could not be loaded.")),console.error(o);return}if(!e.default){console.error("The core extension module at '".concat(n,"' does not have a default export."));return}const t=e.default;if(hs(t)){const o=new t;try{await o.run(r)}catch(i){console.error("The core extension at '".concat(n,"' threw an error.")),console.error(i)}}else console.error("The core extension at '".concat(n,"' does not extend CoreExtension."))}function Ro(n){const r={boolean:!0,string:!0,number:!0},e=Object.keys(n);for(let t=0;t2048&&(console.warn("Custom Data value for ".concat(o," is too long, it will be truncated to 2048 characters")),n[o]=i.substring(0,2048)),r[s]||(console.warn("Custom Data value for ".concat(o," is not a boolean, string, or number, it will be ignored")),delete n[o])}return n}class fs extends et{constructor(e,t,o){var A,p,x,v;super();u(this,"root",null);u(this,"driver");u(this,"canvas");u(this,"settings");u(this,"inspector",null);u(this,"nodes",new Map);u(this,"nextTextureId",1);u(this,"textureTracker");const i={appWidth:e.appWidth||1920,appHeight:e.appHeight||1080,txMemByteThreshold:e.txMemByteThreshold||124e6,boundsMargin:e.boundsMargin||0,deviceLogicalPixelRatio:e.deviceLogicalPixelRatio||1,devicePhysicalPixelRatio:e.devicePhysicalPixelRatio||window.devicePixelRatio,clearColor:(A=e.clearColor)!=null?A:0,coreExtensionModule:e.coreExtensionModule||null,experimental_FinalizationRegistryTextureUsageTracker:(p=e.experimental_FinalizationRegistryTextureUsageTracker)!=null?p:!1,textureCleanupOptions:e.textureCleanupOptions||{},fpsUpdateInterval:e.fpsUpdateInterval||0,numImageWorkers:e.numImageWorkers!==void 0?e.numImageWorkers:2,enableContextSpy:(x=e.enableContextSpy)!=null?x:!1,enableInspector:(v=e.enableInspector)!=null?v:!1};this.settings=i;const{appWidth:s,appHeight:l,deviceLogicalPixelRatio:c,devicePhysicalPixelRatio:d,enableInspector:h}=i,g=T=>{this.driver.releaseTexture(T)},y=i.experimental_FinalizationRegistryTextureUsageTracker&&typeof FinalizationRegistry=="function";this.textureTracker=y?new Li(g):new Ni(g,this.settings.textureCleanupOptions);const b=s*c,m=l*c;this.driver=o;const w=document.createElement("canvas");this.canvas=w,w.width=b*d,w.height=m*d,w.style.width="".concat(b,"px"),w.style.height="".concat(m,"px");let S;if(typeof t=="string"?S=document.getElementById(t):S=t,!S)throw new Error("Could not find target element");o.onCreateNode=T=>{this.nodes.set(T.id,T)},o.onBeforeDestroyNode=T=>{this.nodes.delete(T.id)},o.onFpsUpdate=T=>{this.emit("fpsUpdate",T)},o.onFrameTick=T=>{this.emit("frameTick",T)},o.onIdle=()=>{this.emit("idle")},S.appendChild(w),h&&!no()&&(this.inspector=new zi(w,i))}async init(){await this.driver.init(this,this.settings,this.canvas),this.root=this.driver.getRootNode()}createNode(e){return this.inspector?this.inspector.createNode(this.driver,this.resolveNodeDefaults(e)):this.driver.createNode(this.resolveNodeDefaults(e))}createTextNode(e){var i,s,l,c,d,h,g,y,b,m,w,S,A,p,x,v,T,I,R;const t=(i=e.fontSize)!=null?i:16,o={...this.resolveNodeDefaults(e),text:(s=e.text)!=null?s:"",textRendererOverride:(l=e.textRendererOverride)!=null?l:null,fontSize:t,fontFamily:(c=e.fontFamily)!=null?c:"sans-serif",fontStyle:(d=e.fontStyle)!=null?d:"normal",fontWeight:(h=e.fontWeight)!=null?h:"normal",fontStretch:(g=e.fontStretch)!=null?g:"normal",textAlign:(y=e.textAlign)!=null?y:"left",contain:(b=e.contain)!=null?b:"none",scrollable:(m=e.scrollable)!=null?m:!1,scrollY:(w=e.scrollY)!=null?w:0,offsetY:(S=e.offsetY)!=null?S:0,letterSpacing:(A=e.letterSpacing)!=null?A:0,lineHeight:(p=e.lineHeight)!=null?p:t,maxLines:(x=e.maxLines)!=null?x:0,textBaseline:(v=e.textBaseline)!=null?v:"alphabetic",verticalAlign:(T=e.verticalAlign)!=null?T:"top",overflowSuffix:(I=e.overflowSuffix)!=null?I:"...",debug:(R=e.debug)!=null?R:{}};return this.inspector?this.inspector.createTextNode(this.driver,o):this.driver.createTextNode(o)}resolveNodeDefaults(e){var d,h,g,y,b,m,w,S,A,p,x,v,T,I,R,C,_,E,P,k,L,O,D,U,j,ie,ee,ce,Ae,Le,Pt,Dt,je,we,ge,re,Me,ze,pe,K,Ot,Pe,De,Qe,Ke,Xe;const t=(d=e.color)!=null?d:4294967295,o=(y=(g=(h=e.colorTl)!=null?h:e.colorTop)!=null?g:e.colorLeft)!=null?y:t,i=(w=(m=(b=e.colorTr)!=null?b:e.colorTop)!=null?m:e.colorRight)!=null?w:t,s=(p=(A=(S=e.colorBl)!=null?S:e.colorBottom)!=null?A:e.colorLeft)!=null?p:t,l=(T=(v=(x=e.colorBr)!=null?x:e.colorBottom)!=null?v:e.colorRight)!=null?T:t,c=Ro((I=e.data)!=null?I:{});return{x:(R=e.x)!=null?R:0,y:(C=e.y)!=null?C:0,width:(_=e.width)!=null?_:0,height:(E=e.height)!=null?E:0,alpha:(P=e.alpha)!=null?P:1,clipping:(k=e.clipping)!=null?k:!1,color:t,colorTop:(L=e.colorTop)!=null?L:t,colorBottom:(O=e.colorBottom)!=null?O:t,colorLeft:(D=e.colorLeft)!=null?D:t,colorRight:(U=e.colorRight)!=null?U:t,colorBl:s,colorBr:l,colorTl:o,colorTr:i,zIndex:(j=e.zIndex)!=null?j:0,zIndexLocked:(ie=e.zIndexLocked)!=null?ie:0,parent:(ee=e.parent)!=null?ee:null,texture:(ce=e.texture)!=null?ce:null,shader:(Ae=e.shader)!=null?Ae:null,src:(Le=e.src)!=null?Le:"",scale:(Pt=e.scale)!=null?Pt:null,scaleX:(je=(Dt=e.scaleX)!=null?Dt:e.scale)!=null?je:1,scaleY:(ge=(we=e.scaleY)!=null?we:e.scale)!=null?ge:1,mount:(re=e.mount)!=null?re:0,mountX:(ze=(Me=e.mountX)!=null?Me:e.mount)!=null?ze:0,mountY:(K=(pe=e.mountY)!=null?pe:e.mount)!=null?K:0,pivot:(Ot=e.pivot)!=null?Ot:.5,pivotX:(De=(Pe=e.pivotX)!=null?Pe:e.pivot)!=null?De:.5,pivotY:(Ke=(Qe=e.pivotY)!=null?Qe:e.pivot)!=null?Ke:.5,rotation:(Xe=e.rotation)!=null?Xe:0,data:c}}destroyNode(e){return this.inspector&&this.inspector.destroyNode(e),this.driver.destroyNode(e)}createTexture(e,t,o){const i=this.nextTextureId++,s={descType:"texture",txType:e,props:t,options:{...o,id:i}};return this.textureTracker.registerTexture(s),s}createShader(e,t){return{descType:"shader",shType:e,props:t}}getNodeById(e){return this.nodes.get(e)||null}toggleFreeze(){throw new Error("Not implemented")}advanceFrame(){throw new Error("Not implemented")}rerender(){throw new Error("Not implemented")}}class gs extends et{constructor(e,t,o){super();u(this,"node");u(this,"props");u(this,"settings");u(this,"propStartValues",{});u(this,"restoreValues",{});u(this,"progress",0);u(this,"delayFor",0);u(this,"timingFunction");u(this,"propsList");this.node=e,this.props=t,this.settings=o,this.propStartValues={},this.propsList=Object.keys(t),this.propsList.forEach(i=>{this.propStartValues[i]=e[i]}),this.timingFunction=i=>i,o.easing&&typeof o.easing=="string"&&(this.timingFunction=fi(o.easing)),this.delayFor=o.delay||0}reset(){this.progress=0,this.delayFor=this.settings.delay||0,this.update(0)}restore(){this.reset(),Object.keys(this.props).forEach(e=>{this.node[e]=this.propStartValues[e]})}reverse(){this.progress=0,Object.keys(this.props).forEach(e=>{const t=this.props[e],o=this.propStartValues[e];this.props[e]=o,this.propStartValues[e]=t}),this.settings.loop||(this.settings.stopMethod=!1)}applyEasing(e,t,o){return(this.timingFunction(e)||e)*(o-t)+t}update(e){const{duration:t,loop:o,easing:i,stopMethod:s}=this.settings;if(!t){this.emit("finished",{});return}if(this.delayFor>0){this.delayFor-=e;return}if(this.delayFor<=0&&this.progress===0&&this.emit("start",{}),this.progress+=e/t,this.progress>1&&(this.progress=o?0:1,s)){this.emit("finished",{});return}for(let l=0;l{this.startedResolve=r}))}makeStoppedPromise(){this.stoppedResolve===null&&(this.stoppedPromise=new Promise(r=>{this.stoppedResolve=r}))}started(){F(this.startedResolve),this.startedResolve(this),this.startedResolve=null}finished(){F(this.stoppedResolve);const{loop:r,stopMethod:e}=this.animation.settings;if(e==="reverse"){this.animation.reverse(),this.start();return}this.stoppedResolve(),this.stoppedResolve=null,!r&&this.manager.unregisterAnimation(this.animation)}}const G=0,q=3,le=6,X=1,Z=4,de=7,me=2,xe=5,ye=8;class ve{constructor(r){u(this,"data");r?(this.data=new Float32Array(9),this.data[G]=r[0],this.data[q]=r[3],this.data[le]=r[6],this.data[X]=r[1],this.data[Z]=r[4],this.data[de]=r[7],this.data[me]=r[2],this.data[xe]=r[5],this.data[ye]=r[8]):this.data=new Float32Array(9)}static get temp(){return ms}static multiply(r,e,t){const o=r.data[G]*e.data[G]+r.data[q]*e.data[X]+r.data[le]*e.data[me],i=r.data[G]*e.data[q]+r.data[q]*e.data[Z]+r.data[le]*e.data[xe],s=r.data[G]*e.data[le]+r.data[q]*e.data[de]+r.data[le]*e.data[ye],l=r.data[X]*e.data[G]+r.data[Z]*e.data[X]+r.data[de]*e.data[me],c=r.data[X]*e.data[q]+r.data[Z]*e.data[Z]+r.data[de]*e.data[xe],d=r.data[X]*e.data[le]+r.data[Z]*e.data[de]+r.data[de]*e.data[ye],h=r.data[me]*e.data[G]+r.data[xe]*e.data[X]+r.data[ye]*e.data[me],g=r.data[me]*e.data[q]+r.data[xe]*e.data[Z]+r.data[ye]*e.data[xe],y=r.data[me]*e.data[le]+r.data[xe]*e.data[de]+r.data[ye]*e.data[ye];return t||(t=new ve),t.data[G]=o,t.data[q]=i,t.data[le]=s,t.data[X]=l,t.data[Z]=c,t.data[de]=d,t.data[me]=h,t.data[xe]=g,t.data[ye]=y,t}static identity(r){return r||(r=new ve),r.data[G]=1,r.data[q]=0,r.data[le]=0,r.data[X]=0,r.data[Z]=1,r.data[de]=0,r.data[me]=0,r.data[xe]=0,r.data[ye]=1,r}static translate(r,e,t){return t||(t=new ve),t.data[G]=1,t.data[q]=0,t.data[le]=r,t.data[X]=0,t.data[Z]=1,t.data[de]=e,t.data[me]=0,t.data[xe]=0,t.data[ye]=1,t}static scale(r,e,t){return t||(t=new ve),t.data[G]=r,t.data[q]=0,t.data[le]=0,t.data[X]=0,t.data[Z]=e,t.data[de]=0,t.data[me]=0,t.data[xe]=0,t.data[ye]=1,t}static rotate(r,e){const t=Math.cos(r),o=Math.sin(r);return e||(e=new ve),e.data[G]=t,e.data[q]=-o,e.data[le]=0,e.data[X]=o,e.data[Z]=t,e.data[de]=0,e.data[me]=0,e.data[xe]=0,e.data[ye]=1,e}static copy(r,e,t){return e||(e=new ve),e.data[0]=r.data[0],e.data[1]=r.data[1],e.data[2]=r.data[2],e.data[3]=r.data[3],e.data[4]=r.data[4],e.data[5]=r.data[5],e.data[6]=r.data[6],e.data[7]=r.data[7],e.data[8]=r.data[8],e}translate(r,e){return this.data[le]=this.data[G]*r+this.data[q]*e+this.data[le],this.data[de]=this.data[X]*r+this.data[Z]*e+this.data[de],this}scale(r,e){return this.data[G]=this.data[G]*r,this.data[q]=this.data[q]*e,this.data[X]=this.data[X]*r,this.data[Z]=this.data[Z]*e,this}rotate(r){if(r===0||!(r%Math.PI*2))return this;const e=Math.cos(r),t=Math.sin(r),o=this.data[G]*e+this.data[q]*t,i=this.data[q]*e-this.data[G]*t,s=this.data[X]*e+this.data[Z]*t,l=this.data[Z]*e-this.data[X]*t;return this.data[G]=o,this.data[q]=i,this.data[X]=s,this.data[Z]=l,this}multiply(r){return ve.multiply(this,r,this)}get tx(){return this.data[le]}get ty(){return this.data[de]}get ta(){return this.data[G]}get tb(){return this.data[q]}get tc(){return this.data[X]}get td(){return this.data[Z]}transformPoint(r,e){return[this.data[G]*r+this.data[q]*e+this.data[le],this.data[X]*r+this.data[Z]*e+this.data[X]]}}const ms=new ve,Wt=0,Yt=2,$t=4,Ht=6,jt=1,Qt=3,Kt=5,Xt=7;class cr{constructor(r){u(this,"data");this.data=new Float32Array(8),r&&(this.data[Wt]=r[Wt],this.data[Yt]=r[Yt],this.data[$t]=r[$t],this.data[Ht]=r[Ht],this.data[jt]=r[jt],this.data[Qt]=r[Qt],this.data[Kt]=r[Kt],this.data[Xt]=r[Xt])}static translate(r,e,t,o,i,s,l,c,d){return d||(d=new cr),d.data[Wt]=r,d.data[Yt]=t,d.data[$t]=i,d.data[Ht]=l,d.data[jt]=e,d.data[Qt]=o,d.data[Kt]=s,d.data[Xt]=c,d}get x1(){return this.data[Wt]}get x2(){return this.data[Yt]}get x3(){return this.data[$t]}get x4(){return this.data[Ht]}get y1(){return this.data[jt]}get y2(){return this.data[Qt]}get y3(){return this.data[Kt]}get y4(){return this.data[Xt]}}var fe;(function(n){n[n.Init=0]="Init",n[n.OutOfBounds=2]="OutOfBounds",n[n.InBounds=4]="InBounds",n[n.InViewport=8]="InViewport"})(fe||(fe={}));const Mt=new Map;Mt.set(fe.Init,"init");Mt.set(fe.OutOfBounds,"outOfBounds");Mt.set(fe.InBounds,"inBounds");Mt.set(fe.InViewport,"inViewport");var B;(function(n){n[n.Children=1]="Children",n[n.ScaleRotate=2]="ScaleRotate",n[n.Local=4]="Local",n[n.Global=8]="Global",n[n.Clipping=16]="Clipping",n[n.CalculatedZIndex=32]="CalculatedZIndex",n[n.ZIndexSortedChildren=64]="ZIndexSortedChildren",n[n.PremultipliedColors=128]="PremultipliedColors",n[n.WorldAlpha=256]="WorldAlpha",n[n.RenderState=512]="RenderState",n[n.IsRenderable=1024]="IsRenderable",n[n.None=0]="None",n[n.All=2047]="All"})(B||(B={}));class on extends et{constructor(e,t){super();u(this,"stage");u(this,"children",[]);u(this,"props");u(this,"updateType",B.All);u(this,"globalTransform");u(this,"scaleRotateTransform");u(this,"localTransform");u(this,"renderCoords");u(this,"renderBound");u(this,"strictBound");u(this,"preloadBound");u(this,"clippingRect",{x:0,y:0,width:0,height:0,valid:!1});u(this,"isRenderable",!1);u(this,"renderState",fe.Init);u(this,"worldAlpha",1);u(this,"premultipliedColorTl",0);u(this,"premultipliedColorTr",0);u(this,"premultipliedColorBl",0);u(this,"premultipliedColorBr",0);u(this,"calcZIndex",0);u(this,"onTextureLoaded",(e,t)=>{this.stage.requestRender(),this.emit("loaded",{type:"texture",dimensions:t})});u(this,"onTextureFailed",(e,t)=>{this.emit("failed",{type:"texture",error:t})});u(this,"onTextureFreed",e=>{this.emit("freed",{type:"texture"})});this.stage=e,this.props={...t,parent:null},this.parent=t.parent,this.updateScaleRotateTransform()}loadTexture(e,t,o=null){this.props.texture&&this.unloadTexture();const{txManager:i}=this.stage,s=i.loadTexture(e,t,o);this.props.texture=s,this.props.textureOptions=o,this.setUpdateType(B.IsRenderable),queueMicrotask(()=>{s.state==="loaded"?this.onTextureLoaded(s,s.dimensions):s.state==="failed"?this.onTextureFailed(s,s.error):s.state==="freed"&&this.onTextureFreed(s),s.on("loaded",this.onTextureLoaded),s.on("failed",this.onTextureFailed),s.on("freed",this.onTextureFreed)})}unloadTexture(){if(this.props.texture){const{texture:e}=this.props;e.off("loaded",this.onTextureLoaded),e.off("failed",this.onTextureFailed),e.off("freed",this.onTextureFreed),e.setRenderableOwner(this,!1)}this.props.texture=null,this.props.textureOptions=null,this.setUpdateType(B.IsRenderable)}loadShader(e,t){const o=this.stage.renderer.getShaderManager();F(o);const{shader:i,props:s}=o.loadShader(e,t);this.props.shader=i,this.props.shaderProps=s,this.setUpdateType(B.IsRenderable)}setUpdateType(e){this.updateType|=e;const t=this.props.parent;t&&!(t.updateType&B.Children)&&t.setUpdateType(B.Children)}sortChildren(){this.children.sort((e,t)=>e.calcZIndex-t.calcZIndex)}updateScaleRotateTransform(){this.scaleRotateTransform=ve.rotate(this.props.rotation,this.scaleRotateTransform).scale(this.props.scaleX,this.props.scaleY)}updateLocalTransform(){F(this.scaleRotateTransform);const e=this.props.pivotX*this.props.width,t=this.props.pivotY*this.props.height,o=this.props.mountX*this.props.width,i=this.props.mountY*this.props.height;this.localTransform=ve.translate(e-o+this.props.x,t-i+this.props.y,this.localTransform).multiply(this.scaleRotateTransform).translate(-e,-t),this.setUpdateType(B.Global)}update(e,t){this.updateType&B.ScaleRotate&&(this.updateScaleRotateTransform(),this.setUpdateType(B.Local)),this.updateType&B.Local&&(this.updateLocalTransform(),this.setUpdateType(B.Global));const o=this.props.parent;let i=B.None;this.updateType&B.Global&&(F(this.localTransform),this.globalTransform=ve.copy((o==null?void 0:o.globalTransform)||this.localTransform,this.globalTransform),o&&this.globalTransform.multiply(this.localTransform),this.calculateRenderCoords(),this.updateBoundingRect(),this.setUpdateType(B.Clipping|B.RenderState|B.Children),i|=B.Global),this.updateType&B.Clipping&&(this.calculateClippingRect(t),this.setUpdateType(B.Children),i|=B.Clipping),this.updateType&B.WorldAlpha&&(o?this.worldAlpha=o.worldAlpha*this.props.alpha:this.worldAlpha=this.props.alpha,this.setUpdateType(B.Children|B.PremultipliedColors),i|=B.WorldAlpha),this.updateType&B.PremultipliedColors&&(this.premultipliedColorTl=bt(this.props.colorTl,this.worldAlpha,!0),this.props.colorTl===this.props.colorTr&&this.props.colorBl===this.props.colorBr&&this.props.colorTl===this.props.colorBl?this.premultipliedColorTr=this.premultipliedColorBl=this.premultipliedColorBr=this.premultipliedColorTl:(this.premultipliedColorTr=bt(this.props.colorTr,this.worldAlpha,!0),this.premultipliedColorBl=bt(this.props.colorBl,this.worldAlpha,!0),this.premultipliedColorBr=bt(this.props.colorBr,this.worldAlpha,!0))),this.updateType&B.RenderState&&(this.updateRenderState(t),this.setUpdateType(B.IsRenderable)),this.updateType&B.IsRenderable&&this.updateIsRenderable(),o&&this.updateType&B.CalculatedZIndex&&(this.calculateZIndex(),o.setUpdateType(B.ZIndexSortedChildren)),this.updateType&B.Children&&this.children.length&&this.children.forEach(s=>{s.setUpdateType(i),s.updateType!==0&&s.update(e,this.clippingRect)}),this.updateType&B.ZIndexSortedChildren&&this.sortChildren(),this.updateType=0}checkRenderProps(){return this.props.texture?!0:!this.props.width||!this.props.height?!1:!!(this.props.shader||this.props.clipping||this.props.color!==0||this.props.colorTop!==0||this.props.colorBottom!==0||this.props.colorLeft!==0||this.props.colorRight!==0||this.props.colorTl!==0||this.props.colorTr!==0||this.props.colorBl!==0||this.props.colorBr!==0)}checkRenderBounds(e){F(this.renderBound);const t=e.width||this.stage.root.width,o=e.height||this.stage.root.height;this.strictBound=dt(e.x,e.y,e.x+t,e.y+o,this.strictBound);const i=this.stage.boundsMargin;return this.preloadBound=dt(e.x-i[3],e.y-i[0],e.x+t+i[1],e.y+o+i[2],this.preloadBound),bn(this.renderBound,this.strictBound)?fe.InViewport:bn(this.renderBound,this.preloadBound)?fe.InBounds:fe.OutOfBounds}updateRenderState(e){const t=this.checkRenderBounds(e);if(t!==this.renderState){const o=this.renderState;this.renderState=t,o===fe.InViewport&&this.emit("outOfViewport",{previous:o,current:t});const i=Mt.get(t);F(i),this.emit(i,{previous:o,current:t})}}setRenderState(e){e!==this.renderState&&(this.renderState=e,this.emit(fe[e]))}updateIsRenderable(){let e;this.checkRenderProps()?e=this.renderState>fe.OutOfBounds:e=!1,this.isRenderable!==e&&(this.isRenderable=e,this.onChangeIsRenderable(e))}onChangeIsRenderable(e){var t;(t=this.props.texture)==null||t.setRenderableOwner(this,e)}calculateRenderCoords(){const{width:e,height:t,globalTransform:o}=this;F(o);const{tx:i,ty:s,ta:l,tb:c,tc:d,td:h}=o;if(c===0&&d===0){const g=i,y=i+e*l,b=s,m=s+t*h;this.renderCoords=cr.translate(g,b,y,b,y,m,g,m,this.renderCoords)}else this.renderCoords=cr.translate(i,s,i+e*l,s+e*d,i+e*l+t*c,s+e*d+t*h,i+t*c,s+t*h,this.renderCoords)}updateBoundingRect(){const{renderCoords:e,globalTransform:t}=this;F(t),F(e);const{tb:o,tc:i}=t,{x1:s,y1:l,x3:c,y3:d}=e;if(o===0||i===0)this.renderBound=dt(s,l,c,d,this.renderBound);else{const{x2:h,x4:g,y2:y,y4:b}=e;this.renderBound=dt(Math.min(s,h,c,g),Math.min(l,y,d,b),Math.max(s,h,c,g),Math.max(l,y,d,b),this.renderBound)}}calculateClippingRect(e){F(this.globalTransform);const{clippingRect:t,props:o,globalTransform:i}=this,{clipping:s}=o,l=i.tb!==0||i.tc!==0;s&&!l?(t.x=i.tx,t.y=i.ty,t.width=this.width*i.ta,t.height=this.height*i.td,t.valid=!0):t.valid=!1,e.valid&&t.valid?en(e,t,t):e.valid&&(so(e,t),t.valid=!0)}calculateZIndex(){var s,l;const e=this.props,t=e.zIndex||0,o=((s=e.parent)==null?void 0:s.zIndex)||0;let i=t;(l=e.parent)!=null&&l.zIndexLocked&&(i=t{t.setUpdateType(B.CalculatedZIndex)})}get zIndex(){return this.props.zIndex}set zIndex(e){this.props.zIndex=e,this.setUpdateType(B.CalculatedZIndex|B.Children),this.children.forEach(t=>{t.setUpdateType(B.CalculatedZIndex)})}get parent(){return this.props.parent}set parent(e){const t=this.props.parent;if(t!==e){if(this.props.parent=e,t){const o=t.children.indexOf(this);F(o!==-1,"CoreNode.parent: Node not found in old parent's children!"),t.children.splice(o,1),t.setUpdateType(B.Children|B.ZIndexSortedChildren)}e&&(e.children.push(this),this.setUpdateType(B.All),e.setUpdateType(B.Children|B.ZIndexSortedChildren)),this.updateScaleRotateTransform()}}}let xs=1;function sn(){return xs++}class $r extends et{constructor(e,t,o,i){var s;super();u(this,"rendererMain");u(this,"stage");u(this,"id");u(this,"coreNode");u(this,"_children",[]);u(this,"_src","");u(this,"_parent",null);u(this,"_texture",null);u(this,"_shader",null);u(this,"_data",{});u(this,"onTextureLoaded",(e,t)=>{this.emit("loaded",t)});u(this,"onTextureFailed",(e,t)=>{this.emit("failed",t)});u(this,"onTextureFreed",(e,t)=>{this.emit("freed",t)});u(this,"onOutOfBounds",(e,t)=>{this.emit("outOfBounds",t)});u(this,"onInBounds",(e,t)=>{this.emit("inBounds",t)});u(this,"onOutOfViewport",(e,t)=>{this.emit("outOfViewport",t)});u(this,"onInViewport",(e,t)=>{this.emit("inViewport",t)});this.rendererMain=t,this.stage=o,this.id=(s=i==null?void 0:i.id)!=null?s:sn(),this.coreNode=i||new on(this.stage,{id:this.id,x:e.x,y:e.y,width:e.width,height:e.height,alpha:e.alpha,clipping:e.clipping,color:e.color,colorTop:e.colorTop,colorBottom:e.colorBottom,colorLeft:e.colorLeft,colorRight:e.colorRight,colorTl:e.colorTl,colorTr:e.colorTr,colorBl:e.colorBl,colorBr:e.colorBr,zIndex:e.zIndex,zIndexLocked:e.zIndexLocked,scaleX:e.scaleX,scaleY:e.scaleY,mountX:e.mountX,mountY:e.mountY,mount:e.mount,pivot:e.pivot,pivotX:e.pivotX,pivotY:e.pivotY,rotation:e.rotation,parent:null,shader:null,shaderProps:null,texture:null,textureOptions:null}),this.coreNode.on("loaded",this.onTextureLoaded),this.coreNode.on("failed",this.onTextureFailed),this.coreNode.on("freed",this.onTextureFreed),this.coreNode.on("outOfBounds",this.onOutOfBounds),this.coreNode.on("inBounds",this.onInBounds),this.coreNode.on("outOfViewport",this.onOutOfViewport),this.coreNode.on("inViewport",this.onInViewport),this.parent=e.parent,this.shader=e.shader,this.texture=e.texture,this.src=e.src,this._data=e.data}get x(){return this.coreNode.x}set x(e){this.coreNode.x=e}get y(){return this.coreNode.y}set y(e){this.coreNode.y=e}get width(){return this.coreNode.width}set width(e){this.coreNode.width=e}get height(){return this.coreNode.height}set height(e){this.coreNode.height=e}get alpha(){return this.coreNode.alpha}set alpha(e){this.coreNode.alpha=e}get clipping(){return this.coreNode.clipping}set clipping(e){this.coreNode.clipping=e}get color(){return this.coreNode.color}set color(e){this.coreNode.color=e}get colorTop(){return this.coreNode.colorTop}set colorTop(e){this.coreNode.colorTop=e}get colorBottom(){return this.coreNode.colorBottom}set colorBottom(e){this.coreNode.colorBottom=e}get colorLeft(){return this.coreNode.colorLeft}set colorLeft(e){this.coreNode.colorLeft=e}get colorRight(){return this.coreNode.colorRight}set colorRight(e){this.coreNode.colorRight=e}get colorTl(){return this.coreNode.colorTl}set colorTl(e){this.coreNode.colorTl=e}get colorTr(){return this.coreNode.colorTr}set colorTr(e){this.coreNode.colorTr=e}get colorBl(){return this.coreNode.colorBl}set colorBl(e){this.coreNode.colorBl=e}get colorBr(){return this.coreNode.colorBr}set colorBr(e){this.coreNode.colorBr=e}get scale(){return this.scaleX!==this.scaleY?null:this.coreNode.scaleX}set scale(e){e!==null&&(this.coreNode.scaleX=e,this.coreNode.scaleY=e)}get scaleX(){return this.coreNode.scaleX}set scaleX(e){this.coreNode.scaleX=e}get scaleY(){return this.coreNode.scaleY}set scaleY(e){this.coreNode.scaleY=e}get mount(){return this.coreNode.mount}set mount(e){this.coreNode.mount=e}get mountX(){return this.coreNode.mountX}set mountX(e){this.coreNode.mountX=e}get mountY(){return this.coreNode.mountY}set mountY(e){this.coreNode.mountY=e}get pivot(){return this.coreNode.pivot}set pivot(e){this.coreNode.pivot=e}get pivotX(){return this.coreNode.pivotX}set pivotX(e){this.coreNode.pivotX=e}get pivotY(){return this.coreNode.pivotY}set pivotY(e){this.coreNode.pivotY=e}get rotation(){return this.coreNode.rotation}set rotation(e){this.coreNode.rotation=e}get parent(){return this._parent}set parent(e){var o;const t=this._parent;if(this._parent=e,this.coreNode.parent=(o=e==null?void 0:e.coreNode)!=null?o:null,t){const i=t.children.indexOf(this);F(i!==-1,"MainOnlyNode.parent: Node not found in old parent's children!"),t.children.splice(i,1)}e&&e.children.push(this)}get children(){return this._children}get zIndex(){return this.coreNode.zIndex}set zIndex(e){this.coreNode.zIndex=e}get zIndexLocked(){return this.coreNode.zIndexLocked}set zIndexLocked(e){this.coreNode.zIndexLocked=e}get src(){return this._src}set src(e){if(this._src!==e){if(this._src=e,!e){this.texture=null;return}this.texture=this.rendererMain.createTexture("ImageTexture",{src:e})}}get texture(){return this._texture}set texture(e){this._texture!==e&&(this._texture&&this.rendererMain.textureTracker.decrementTextureRefCount(this._texture),e&&this.rendererMain.textureTracker.incrementTextureRefCount(e),this._texture=e,e?this.coreNode.loadTexture(e.txType,e.props,e.options):this.coreNode.unloadTexture())}get shader(){return this._shader}set shader(e){this._shader!==e&&(this._shader=e,e&&this.coreNode.loadShader(e.shType,e.props))}get data(){return this._data}set data(e){this._data=Ro(e)}destroy(){this.emit("beforeDestroy",{});let e=this.children[0];for(;e;)e.destroy(),e=this.children[0];this.coreNode.destroy(),this.parent=null,this.texture=null,this.emit("afterDestroy",{}),this.removeAllListeners()}flush(){}animate(e,t){const o=new gs(this.coreNode,e,t);return new ps(this.stage.animationManager,o)}}const ys=n=>{let r=!1;const e=()=>{if(n.updateAnimations(),!n.hasSceneUpdates()){n.calculateFps(),setTimeout(e,16.666666666666668),r||(n.emit("idle"),r=!0);return}r=!1,n.drawFrame(),requestAnimationFrame(e)};requestAnimationFrame(e)},vs=()=>performance?performance.now():Date.now();class ws{constructor(){u(this,"activeAnimations",new Set)}registerAnimation(r){this.activeAnimations.add(r)}unregisterAnimation(r){this.activeAnimations.delete(r)}update(r){this.activeAnimations.forEach(e=>{e.update(r)})}}class bs{constructor(r){u(this,"imageWorkersEnabled",!0);u(this,"messageManager",{});u(this,"workers",[]);u(this,"workerIndex",0);this.workers=this.createWorkers(r),this.workers.forEach(e=>{e.onmessage=this.handleMessage.bind(this)})}handleMessage(r){const{src:e,data:t,error:o}=r.data,i=this.messageManager[e];if(i){const[s,l]=i;delete this.messageManager[e],o?l(new Error(o)):s(t)}}createWorkers(r=1){const e="\n function hasAlphaChannel(mimeType) {\n return (mimeType.indexOf(\"image/png\") !== -1);\n }\n\n async function getImage(src, premultiplyAlpha) {\n return new Promise(function(resolve, reject) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', src, true);\n xhr.responseType = 'blob';\n\n xhr.onload = function() {\n if (xhr.status === 200) {\n var blob = xhr.response;\n var hasAlphaChannel = premultiplyAlpha !== undefined ? premultiplyAlpha : hasAlphaChannel(blob.type);\n\n createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none'\n }).then(function(data) {\n resolve({ data: data, premultiplyAlpha: premultiplyAlpha });\n }).catch(function(error) {\n reject(error);\n });\n } else {\n reject(new Error('Failed to load image: ' + xhr.statusText));\n }\n };\n\n xhr.onerror = function() {\n reject(new Error('Network error occurred while trying to fetch the image.'));\n };\n\n xhr.send();\n });\n }\n\n self.onmessage = async (event) => {\n var src = event.data.src;\n var premultiplyAlpha = event.data.premultiplyAlpha;\n\n getImage(src, premultiplyAlpha)\n .then(function(data) {\n self.postMessage({ src: src, data: data }, [data.data]);\n })\n .catch(function(error) {\n self.postMessage({ src: src, error: error.message });\n });\n };\n ",t=new Blob([e.replace('"use strict";',"")],{type:"application/javascript"}),o=(self.URL?URL:webkitURL).createObjectURL(t),i=[];for(let s=0;s{try{if(this.workers){const i=this.convertUrlToAbsolute(r);this.messageManager[i]=[t,o],this.getNextWorker().postMessage({src:i,premultiplyAlpha:e})}}catch(i){o(i)}})}}const kt=class kt extends io{constructor(e,t){super(e);u(this,"props");this.props=kt.resolveDefaults(t)}async getTextureData(){const{width:e,height:t}=this.props,o=e*t*4,i=new Uint8ClampedArray(o);for(let s=0;s{})}setTextureMemUse(r,e){if(this.textures.has(r)&&(this.memUsed-=this.textures.get(r)),e===0){this.textures.delete(r);return}else this.memUsed+=e,this.textures.set(r,e);this.memUsed>this.threshold&&this.gc()}gc(){this.textures.forEach((r,e)=>{e.renderable||e.free()})}}const Cs=2e6;class Ts extends et{constructor(e){super();u(this,"options");u(this,"animationManager");u(this,"txManager");u(this,"txMemManager");u(this,"fontManager");u(this,"textRenderers");u(this,"shManager");u(this,"renderer");u(this,"root");u(this,"boundsMargin");u(this,"deltaTime",0);u(this,"lastFrameTime",0);u(this,"currentFrameTime",0);u(this,"fpsNumFrames",0);u(this,"fpsElapsedTime",0);u(this,"renderRequested",!1);u(this,"contextSpy",null);this.options=e;const{canvas:t,clearColor:o,rootId:i,debug:s,appWidth:l,appHeight:c,boundsMargin:d,enableContextSpy:h,numImageWorkers:g,txMemByteThreshold:y}=e;this.txManager=new Ss(g),this.txMemManager=new As(y),this.shManager=new Ki,this.animationManager=new ws,this.contextSpy=h?new Xi:null;let b=[0,0,0,0];d&&(b=Array.isArray(d)?d:[d,d,d,d]),this.boundsMargin=b,s!=null&&s.monitorTextureCache&&setInterval(()=>{F(this.txManager);const w=this.txManager.getDebugInfo();console.log("Texture ID Cache Size: ",w.idCacheSize),console.log("Texture Key Cache Size: ",w.keyCacheSize)},1e3),this.renderer=new mi({stage:this,canvas:t,pixelRatio:e.devicePhysicalPixelRatio*e.deviceLogicalPixelRatio,clearColor:o!=null?o:4278190080,bufferMemory:Cs,txManager:this.txManager,txMemManager:this.txMemManager,shManager:this.shManager,contextSpy:this.contextSpy}),this.txManager.renderer=this.renderer,this.textRenderers={canvas:new Hi(this),sdf:new ds(this)},this.fontManager=new _o(this.textRenderers);const m=new on(this,{id:i,x:0,y:0,width:l,height:c,alpha:1,clipping:!1,color:0,colorTop:0,colorBottom:0,colorLeft:0,colorRight:0,colorTl:0,colorTr:0,colorBl:0,colorBr:0,zIndex:0,zIndexLocked:0,scaleX:1,scaleY:1,mountX:0,mountY:0,mount:0,pivot:.5,pivotX:.5,pivotY:.5,rotation:0,parent:null,texture:null,textureOptions:null,shader:null,shaderProps:null});this.root=m,ys(this)}updateAnimations(){const{animationManager:e}=this;this.root&&(this.lastFrameTime=this.currentFrameTime,this.currentFrameTime=vs(),this.deltaTime=this.lastFrameTime?this.currentFrameTime-this.lastFrameTime:100/6,this.emit("frameTick",{time:this.currentFrameTime,delta:this.deltaTime}),e.update(this.deltaTime))}hasSceneUpdates(){return!!this.root.updateType||this.renderRequested}drawFrame(){const{renderer:e,renderRequested:t}=this;this.root.updateType!==0&&this.root.update(this.deltaTime,this.root.clippingRect),e==null||e.reset(),this.addQuads(this.root),e==null||e.render(),this.calculateFps(),t&&(this.renderRequested=!1)}calculateFps(){var t,o,i;const{fpsUpdateInterval:e}=this.options;if(e&&(this.fpsNumFrames++,this.fpsElapsedTime+=this.deltaTime,this.fpsElapsedTime>=e)){const s=Math.round(this.fpsNumFrames*1e3/this.fpsElapsedTime);this.fpsNumFrames=0,this.fpsElapsedTime=0,this.emit("fpsUpdate",{fps:s,contextSpyData:(o=(t=this.contextSpy)==null?void 0:t.getData())!=null?o:null}),(i=this.contextSpy)==null||i.reset()}}addQuads(e){F(this.renderer&&e.globalTransform),e.isRenderable&&e.renderQuads(this.renderer);for(let t=0;t{const{contain:e}=this,t=this.trState.props.width,o=this.trState.props.height,i=this.trState.textW||0,s=this.trState.textH||0;e==="both"?(this.props.width=t,this.props.height=o):e==="width"?(this.props.width=t,this.props.height=s):e==="none"&&(this.props.width=i,this.props.height=s),this.updateLocalTransform(),this.stage.requestRender(),this.emit("loaded",{type:"text",dimensions:{width:this.trState.textW||0,height:this.trState.textH||0}})});u(this,"onTextFailed",(e,t)=>{this.emit("failed",{type:"text",error:t})});this._textRendererOverride=t.textRendererOverride;const{resolvedTextRenderer:o,textRendererState:i}=this.resolveTextRendererAndState({x:this.absX,y:this.absY,width:t.width,height:t.height,textAlign:t.textAlign,color:t.color,zIndex:t.zIndex,contain:t.contain,scrollable:t.scrollable,scrollY:t.scrollY,offsetY:t.offsetY,letterSpacing:t.letterSpacing,debug:t.debug,fontFamily:t.fontFamily,fontSize:t.fontSize,fontStretch:t.fontStretch,fontStyle:t.fontStyle,fontWeight:t.fontWeight,text:t.text,lineHeight:t.lineHeight,maxLines:t.maxLines,textBaseline:t.textBaseline,verticalAlign:t.verticalAlign,overflowSuffix:t.overflowSuffix});this.textRenderer=o,this.trState=i}get width(){return this.props.width}set width(e){this.props.width=e,this.textRenderer.set.width(this.trState,e),this.contain==="none"&&this.setUpdateType(B.Local)}get height(){return this.props.height}set height(e){this.props.height=e,this.textRenderer.set.height(this.trState,e),this.contain!=="both"&&this.setUpdateType(B.Local)}get color(){return this.trState.props.color}set color(e){this.textRenderer.set.color(this.trState,e)}get text(){return this.trState.props.text}set text(e){this.textRenderer.set.text(this.trState,e)}get textRendererOverride(){return this._textRendererOverride}set textRendererOverride(e){this._textRendererOverride=e,this.textRenderer.destroyState(this.trState);const{resolvedTextRenderer:t,textRendererState:o}=this.resolveTextRendererAndState(this.trState.props);this.textRenderer=t,this.trState=o}get fontSize(){return this.trState.props.fontSize}set fontSize(e){this.textRenderer.set.fontSize(this.trState,e)}get fontFamily(){return this.trState.props.fontFamily}set fontFamily(e){this.textRenderer.set.fontFamily(this.trState,e)}get fontStretch(){return this.trState.props.fontStretch}set fontStretch(e){this.textRenderer.set.fontStretch(this.trState,e)}get fontStyle(){return this.trState.props.fontStyle}set fontStyle(e){this.textRenderer.set.fontStyle(this.trState,e)}get fontWeight(){return this.trState.props.fontWeight}set fontWeight(e){this.textRenderer.set.fontWeight(this.trState,e)}get textAlign(){return this.trState.props.textAlign}set textAlign(e){this.textRenderer.set.textAlign(this.trState,e)}get contain(){return this.trState.props.contain}set contain(e){this.textRenderer.set.contain(this.trState,e)}get scrollable(){return this.trState.props.scrollable}set scrollable(e){this.textRenderer.set.scrollable(this.trState,e)}get scrollY(){return this.trState.props.scrollY}set scrollY(e){this.textRenderer.set.scrollY(this.trState,e)}get offsetY(){return this.trState.props.offsetY}set offsetY(e){this.textRenderer.set.offsetY(this.trState,e)}get letterSpacing(){return this.trState.props.letterSpacing}set letterSpacing(e){this.textRenderer.set.letterSpacing(this.trState,e)}get lineHeight(){return this.trState.props.lineHeight}set lineHeight(e){this.textRenderer.set.lineHeight&&this.textRenderer.set.lineHeight(this.trState,e)}get maxLines(){return this.trState.props.maxLines}set maxLines(e){this.textRenderer.set.maxLines&&this.textRenderer.set.maxLines(this.trState,e)}get textBaseline(){return this.trState.props.textBaseline}set textBaseline(e){this.textRenderer.set.textBaseline&&this.textRenderer.set.textBaseline(this.trState,e)}get verticalAlign(){return this.trState.props.verticalAlign}set verticalAlign(e){this.textRenderer.set.verticalAlign&&this.textRenderer.set.verticalAlign(this.trState,e)}get overflowSuffix(){return this.trState.props.overflowSuffix}set overflowSuffix(e){this.textRenderer.set.overflowSuffix&&this.textRenderer.set.overflowSuffix(this.trState,e)}get debug(){return this.trState.props.debug}set debug(e){this.textRenderer.set.debug(this.trState,e)}update(e,t){super.update(e,t),F(this.globalTransform),this.textRenderer.set.x(this.trState,this.globalTransform.tx),this.textRenderer.set.y(this.trState,this.globalTransform.ty)}checkRenderProps(){return this.trState.props.text!==""?!0:super.checkRenderProps()}onChangeIsRenderable(e){super.onChangeIsRenderable(e),this.textRenderer.setIsRenderable(this.trState,e)}renderQuads(e){F(this.globalTransform),this.textRenderer.renderQuads(this.trState,this.globalTransform,this.clippingRect,this.worldAlpha)}destroy(){super.destroy(),this.textRenderer.destroyState(this.trState)}resolveTextRendererAndState(e){const t=this.stage.resolveTextRenderer(e,this._textRendererOverride),o=t.createState(e);return o.emitter.on("loaded",this.onTextLoaded),o.emitter.on("failed",this.onTextFailed),t.scheduleUpdateState(o),{resolvedTextRenderer:t,textRendererState:o}}}class Rs extends $r{constructor(r,e,t){super(r,e,t,new _s(t,{id:sn(),x:r.x,y:r.y,width:r.width,height:r.height,alpha:r.alpha,clipping:r.clipping,color:r.color,colorTop:r.colorTop,colorBottom:r.colorBottom,colorLeft:r.colorLeft,colorRight:r.colorRight,colorTl:r.colorTl,colorTr:r.colorTr,colorBl:r.colorBl,colorBr:r.colorBr,zIndex:r.zIndex,zIndexLocked:r.zIndexLocked,scaleX:r.scaleX,scaleY:r.scaleY,mountX:r.mountX,mountY:r.mountY,mount:r.mount,pivot:r.pivot,pivotX:r.pivotX,pivotY:r.pivotY,rotation:r.rotation,text:r.text,fontSize:r.fontSize,fontFamily:r.fontFamily,fontWeight:r.fontWeight,fontStretch:r.fontStretch,fontStyle:r.fontStyle,contain:r.contain,scrollable:r.scrollable,letterSpacing:r.letterSpacing,textAlign:r.textAlign,scrollY:r.scrollY,offsetY:r.offsetY,textRendererOverride:r.textRendererOverride,lineHeight:r.lineHeight,maxLines:r.maxLines,textBaseline:r.textBaseline,verticalAlign:r.verticalAlign,overflowSuffix:r.overflowSuffix,debug:r.debug,parent:null,texture:null,textureOptions:null,shader:null,shaderProps:null}))}get text(){return this.coreNode.text}set text(r){this.coreNode.text=r}get textRendererOverride(){return this.coreNode.textRendererOverride}set textRendererOverride(r){this.coreNode.textRendererOverride=r}get fontSize(){return this.coreNode.fontSize}set fontSize(r){this.coreNode.fontSize=r}get fontFamily(){return this.coreNode.fontFamily}set fontFamily(r){this.coreNode.fontFamily=r}get fontWeight(){return this.coreNode.fontWeight}set fontWeight(r){this.coreNode.fontWeight=r}get fontStretch(){return this.coreNode.fontStretch}set fontStretch(r){this.coreNode.fontStretch=r}get fontStyle(){return this.coreNode.fontStyle}set fontStyle(r){this.coreNode.fontStyle=r}get textAlign(){return this.coreNode.textAlign}set textAlign(r){this.coreNode.textAlign=r}get contain(){return this.coreNode.contain}set contain(r){this.coreNode.contain=r}get scrollable(){return this.coreNode.scrollable}set scrollable(r){this.coreNode.scrollable=r}get scrollY(){return this.coreNode.scrollY}set scrollY(r){this.coreNode.scrollY=r}get offsetY(){return this.coreNode.offsetY}set offsetY(r){this.coreNode.offsetY=r}get letterSpacing(){return this.coreNode.letterSpacing}set letterSpacing(r){this.coreNode.letterSpacing=r}get lineHeight(){return this.coreNode.lineHeight}set lineHeight(r){r&&(this.coreNode.lineHeight=r)}get maxLines(){return this.coreNode.maxLines}set maxLines(r){r&&(this.coreNode.maxLines=r)}get textBaseline(){return this.coreNode.textBaseline}set textBaseline(r){r&&(this.coreNode.textBaseline=r)}get verticalAlign(){return this.coreNode.verticalAlign}set verticalAlign(r){r&&(this.coreNode.verticalAlign=r)}get overflowSuffix(){return this.coreNode.overflowSuffix}set overflowSuffix(r){r&&(this.coreNode.overflowSuffix=r)}get debug(){return this.coreNode.debug}set debug(r){this.coreNode.debug=r}}class Is{constructor(){u(this,"root",null);u(this,"stage",null);u(this,"rendererMain",null)}async init(r,e,t){this.stage=new Ts({rootId:sn(),appWidth:e.appWidth,appHeight:e.appHeight,txMemByteThreshold:e.txMemByteThreshold,boundsMargin:e.boundsMargin,deviceLogicalPixelRatio:e.deviceLogicalPixelRatio,devicePhysicalPixelRatio:e.devicePhysicalPixelRatio,clearColor:e.clearColor,canvas:t,fpsUpdateInterval:e.fpsUpdateInterval,enableContextSpy:e.enableContextSpy,numImageWorkers:e.numImageWorkers,debug:{monitorTextureCache:!1}}),this.rendererMain=r,F(this.stage.root);const o=new $r(r.resolveNodeDefaults({}),this.rendererMain,this.stage,this.stage.root);this.root=o,o.once("beforeDestroy",this.onBeforeDestroyNode.bind(this,o)),this.onCreateNode(o),e.coreExtensionModule&&await us(e.coreExtensionModule,this.stage),this.stage.on("fpsUpdate",(i,s)=>{this.onFpsUpdate(s)}),this.stage.on("frameTick",(i,s)=>{this.onFrameTick(s)}),this.stage.on("idle",()=>{this.onIdle()})}createNode(r){F(this.rendererMain),F(this.stage);const e=new $r(r,this.rendererMain,this.stage);return e.once("beforeDestroy",this.onBeforeDestroyNode.bind(this,e)),this.onCreateNode(e),e}createTextNode(r){F(this.rendererMain),F(this.stage);const e=new Rs(r,this.rendererMain,this.stage);return e.once("beforeDestroy",this.onBeforeDestroyNode.bind(this,e)),this.onCreateNode(e),e}destroyNode(r){r.destroy()}releaseTexture(r){const{stage:e}=this;F(e),e.txManager.removeTextureIdFromCache(r)}getRootNode(){return F(this.root),this.root}onCreateNode(r){throw new Error("Method not implemented.")}onBeforeDestroyNode(r){throw new Error("Method not implemented.")}onFpsUpdate(r){throw new Error("Method not implemented.")}onFrameTick(r){throw new Error("Method not implemented.")}onIdle(){throw new Error("Method not implemented.")}}let Fe,an;function Bs(n={},r="app"){const e=new Is;return Fe=new fs(n,r,e),an=Fe.createShader.bind(Fe),Fe}class ks extends Array{constructor(r){super(),this._parent=r}get selected(){return this[this._parent.selected||0]}get firstChild(){return this[0]}insert(r,e){if(e){const t=this.indexOf(e);this.splice(t,0,r)}else this.push(r);r.parent=this._parent,this._parent._isDirty=!0}remove(r){const e=this.indexOf(r);e>=0&&this.splice(e,1)}}function Es(){return{BASE_URL:"/solid-demo-app/",MODE:"production",DEV:!1,PROD:!0,SSR:!1,LEGACY:!1}&&!1}const Fs=Es()||!1,Se={debug:!1,animationsEnabled:!0,animationSettings:{duration:250,easing:"ease-in-out"},fontSettings:{fontFamily:"Ubuntu",fontSize:100}};function Bn(n){return Ns(n)&&n.debug}function qe(n,r,...e){Fs&&(Se.debug||Bn(r)||Bn(e[0]))&&console.log(n,r,...e)}function xt(n){return typeof n=="function"}function Ns(n){return typeof n=="object"}function dr(n){return Array.isArray(n)}function Ls(n){return typeof n=="string"}function Ms(n){return typeof n=="number"}function zs(n){return Number.isInteger(n)}function Ps(n,r){for(const e of r)if(e in n)return!0;return!1}function Io(n,r={}){if(dr(n))n.forEach(e=>{Io(e,r)});else if(n)for(const e in n)r[e]===void 0&&(r[e]=n[e]);return r}class kn extends Array{constructor(r,e={}){return dr(e)?super(...e):Ls(e)?super(e):super(...Object.entries(e).filter(([t,o])=>o).map(([t])=>t)),this.onChange=r,this}has(r){return this.indexOf(r)>=0}is(r){return this.indexOf(r)>=0}add(r){this.push(r),this.onChange()}toggle(r){this.has(r)?this.remove(r):this.add(r)}remove(r){const e=this.indexOf(r);e>=0&&(this.splice(e,1),this.onChange())}}function Ds(n){const r=[];for(let p=0;pp+(x[i]||0),0));const A=y&&w?p=>{w==="flexStart"?p[h]=0:w==="center"?p[h]=(y-(p[s]||0))/2:w==="flexEnd"&&(p[h]=y-(p[s]||0))}:p=>p;if(m==="flexStart"){let p=0;if(r.forEach(x=>{x[d]=p+(x[l]||0),p+=(x[i]||0)+b+(x[l]||0)+(x[c]||0),A(x)}),n._autosized){const x=p-b;if(x!==n[i])return n[i]=x,!0}}else if(m==="flexEnd"){let p=g;for(let x=e-1;x>=0;x--){const v=r[x];F(v),v[d]=p-(v[i]||0)-(v[c]||0),p-=(v[i]||0)+b+(v[l]||0)+(v[c]||0),A(v)}}else if(m==="center"){let p=(g-(S+b*(e-1)))/2;r.forEach(x=>{x[d]=p,p+=(x[i]||0)+b,A(x)})}else if(m==="spaceBetween"){const p=(g-S)/(e-1);let x=0;r.forEach(v=>{v[d]=x,x+=(v[i]||0)+p,A(v)})}else if(m==="spaceEvenly"){const p=(g-S)/(e+1);let x=p;r.forEach(v=>{v[d]=x,x+=(v[i]||0)+p,A(v)})}return!1}const{animationSettings:Os}=Se;function En(n){const r=[];for(const[e,t]of Object.entries(n))r.push({type:e,props:t});return an("DynamicShader",{effects:r})}function yt(n=""){return{set(r){Ms(r)&&(r={width:r,color:255}),this.effects={...this.effects||{},["border".concat(n)]:r},this["_border".concat(n)]=r},get(){return this["_border".concat(n)]}}}const Us=["alpha","color","colorTop","colorRight","colorLeft","colorBottom","colorTl","colorTr","colorBl","colorBr","height","fontSize","lineHeight","mount","mountX","mountY","pivot","pivotX","pivotY","rotation","scale","width","worldX","worldY","x","y","zIndex","zIndexLocked"],Ws=["clipping","contain","fontFamily","fontStretch","fontStyle","fontWeight","letterSpacing","maxLines","offsetY","overflowSuffix","rtt","scrollable","scrollY","src","text","textAlign","textBaseline","textOverflow","texture","verticalAlign","wordWrap"];class We extends Object{constructor(r){super(),this._animationQueue=[],this._animationRunning=!1,this.name=r,this.rendered=!1,this.autofocus=!1,this._renderProps={x:0,y:0},this.children=new ks(this);for(const e of Us)Object.defineProperty(this,e,{get(){return this.lng&&this.lng[e]||this["_".concat(e)]},set(t){this["_".concat(e)]=t,this._sendToLightningAnimatable(e,t)}});for(const e of Ws)Object.defineProperty(this,e,{get(){return this.lng&&this.lng[e]||this["_".concat(e)]},set(t){this["_".concat(e)]=t,this._sendToLightning(e,t)}});Object.defineProperties(this,{borderRadius:{set(e){this._borderRadius=e,this.effects={...this.effects||{},radius:{radius:e}}},get(){return this._borderRadius}},border:yt(),borderLeft:yt("Left"),borderRight:yt("Right"),borderTop:yt("Top"),borderBottom:yt("Bottom")}),Object.defineProperties(this,{linearGradient:{set(e={}){this._linearGradient=e,this.effects={...this.effects||{},linearGradient:e}},get(){return this._linearGradient}}})}get effects(){return this._effects}set effects(r){this._effects=r,this.rendered&&(this.shader=En(r))}get parent(){return this._parent}set parent(r){var e;this._parent=r,this.rendered&&this.lng&&(this.lng.parent=(e=r==null?void 0:r.lng)!=null?e:null)}get shader(){return this._shader}set shader(r){dr(r)?this._shader=an(...r):this._shader=r,this._sendToLightning("shader",this._shader)}_sendToLightningAnimatable(r,e){if(this.lng){if(Se.animationsEnabled&&this.transition&&(this.transition===!0||this.transition[r])){const t=this.transition===!0||this.transition[r]===!0?void 0:this.transition[r];return this.animate({[r]:e},t).start()}this.lng[r]=e}else this._renderProps[r]=e}_sendToLightning(r,e){this.rendered&&this.lng?this.lng[r]=e:this._renderProps[r]=e}animate(r,e){return F(this.lng,"Node must be rendered before animating"),this.lng.animate(r,e||this.animationSettings)}chain(r,e){return this._animationRunning&&(this._animationQueue=[],this._animationRunning=!1),e?this._animationQueueSettings=e:this._animationQueueSettings||(this._animationQueueSettings=e||this.animationSettings),e=e||this._animationQueueSettings,this._animationQueue.push({props:r,animationSettings:e}),this}async start(){let r=this._animationQueue.shift();for(;r;)this._animationRunning=!0,await this.animate(r.props,r.animationSettings).start().waitUntilStopped(),r=this._animationQueue.shift();this._animationRunning=!1,this._animationQueueSettings=void 0}setFocus(){if(this.rendered){if(this.forwardFocus!==void 0)if(xt(this.forwardFocus)){if(this.forwardFocus.call(this,this)!==!1)return}else{const r=typeof this.forwardFocus=="number"?this.forwardFocus:null;if(r!==null&&rzr(this))}else this.autofocus=!0}isTextNode(){return this.name==="text"}_resizeOnTextLoad(){this.lng.on("loaded",(r,e)=>{if(e.type==="text"){const{dimensions:t}=e;this.parent.updateLayout(this,t)}})}getText(){return this.children.map(r=>r.text).join("")}destroy(){var r;this._queueDelete&&((r=this.lng)==null||r.destroy())}set style(r){dr(r)?this._style=Io(r):this._style=r;for(const e in this._style)this[e]===void 0&&(this[e]=this._style[e])}get style(){return this._style}get hasChildren(){return this.children.length>0}getChildById(r){return this.children.find(e=>e.id===r)}searchChildrenById(r){for(const e of this.children){if(e.id===r)return e;if(e instanceof We){const t=e.searchChildrenById(r);if(t)return t}}}set states(r){this._states=new kn(this._stateChanged.bind(this),r),this.rendered&&this._stateChanged()}get states(){return this._states=this._states||new kn(this._stateChanged.bind(this)),this._states}get animationSettings(){return this._animationSettings||Os}set animationSettings(r){this._animationSettings=r}updateLayout(r,e){var t;this.hasChildren&&(qe("Layout: ",this),xt(this.onBeforeLayout)&&this.onBeforeLayout.call(this,r,e),this.display==="flex"&&Ds(this)&&((t=this.parent)==null||t.updateLayout()),xt(this.onLayout)&&this.onLayout.call(this,r,e))}_stateChanged(){if(qe("State Changed: ",this,this.states),this.forwardStates){const e=this.states.slice();this.children.forEach(t=>t.states=e)}const r=this.states;if(this._undoStyles||this.style&&Ps(this.style,r)){this._undoStyles=this._undoStyles||[];const e={};this._undoStyles.forEach(o=>{e[o]=this.style[o]});const t=r.reduce((o,i)=>{const s=this.style[i];return s&&(o={...o,...s}),o},{});this._undoStyles=Object.keys(t),t.transition!==void 0&&(this.transition=t.transition),Object.assign(this,{...e,...t})}}render(){const r=this,e=this.parent;if(!e){console.warn("Parent not set - no node created for: ",this);return}if(!e.rendered){console.warn("Parent not rendered yet: ",this);return}if(this.rendered){console.warn("Node already rendered: ",this);return}e._isDirty&&(e.updateLayout(),e._isDirty=!1),r.updateLayout(),this.states.length&&this._stateChanged();let t=r._renderProps;e.lng&&(t.parent=e.lng),r._effects&&(this.shader=En(r._effects)),r.isTextNode()?(t={...Se.fontSettings,...t,text:r.getText()},t.contain&&(t.width||(t.width=(e.width||0)-(t.x||0)-(t.marginRight||0),r._width=t.width,r._autosized=!0),t.contain==="both"&&!t.height&&!t.maxLines&&(t.height=(e.height||0)-(t.y||0)-(t.marginBottom||0),r._height=t.height,r._autosized=!0)),qe("Rendering: ",this,t),r.lng=Fe.createTextNode(t),xt(r.onLoad)&&r.lng.on("loaded",r.onLoad),(!r.width||!r.height)&&(r._autosized=!0,r._resizeOnTextLoad())):(t.texture||(isNaN(t.width)&&(t.width=(e.width||0)-(t.x||0),r._width=t.width,r._autosized=!0),isNaN(t.height)&&(t.height=(e.height||0)-(t.y||0),r._height=t.height,r._autosized=!0),!t.color&&!t.src&&(r._color=t.color=0)),qe("Rendering: ",this,t),r.lng=Fe.createNode(t),r.onFail&&r.lng.on("failed",r.onFail),r.onLoad&&r.lng.on("loaded",r.onLoad)),r.rendered=!0,xt(this.onCreate)&&this.onCreate.call(this,r),r.lng.div&&(r.lng.div.solid=r),delete this._renderProps,r.name!=="text"&&r.children.forEach(o=>{o.render?o.render():o.text!==""&&console.warn("TextNode outside of : ",o)}),r.autofocus&&r.setFocus()}}const N=n=>(()=>{var r=zt("text");return br(r,n,!1),r})(),z=n=>(()=>{var r=zt("node");return br(r,n,!1),r})();function Ys({createElement:n,createTextNode:r,isTextNode:e,replaceText:t,insertNode:o,removeNode:i,setProperty:s,getParentNode:l,getFirstChild:c,getNextSibling:d}){function h(p,x,v,T){if(v!==void 0&&!T&&(T=[]),typeof x!="function")return g(p,x,T,v);Te(I=>g(p,x(),I,v),T)}function g(p,x,v,T,I){for(;typeof v=="function";)v=v();if(x===v)return v;const R=typeof x,C=T!==void 0;if(R==="string"||R==="number")if(R==="number"&&(x=x.toString()),C){let _=v[0];_&&e(_)?t(_,x):_=r(x),v=m(p,v,T,_)}else v!==""&&typeof v=="string"?t(c(p),v=x):(m(p,v,T,r(x)),v=x);else if(x==null||R==="boolean")v=m(p,v,T);else{if(R==="function")return Te(()=>{let _=x();for(;typeof _=="function";)_=_();v=g(p,_,v,T)}),()=>v;if(Array.isArray(x)){const _=[];if(y(_,x,I))return Te(()=>v=g(p,_,v,T,!0)),()=>v;if(_.length===0){const E=m(p,v,T);if(C)return v=E}else Array.isArray(v)?v.length===0?w(p,_,T):b(p,v,_):v==null||v===""?w(p,_):b(p,C&&v||[c(p)],_);v=_}else{if(Array.isArray(v)){if(C)return v=m(p,v,T,x);m(p,v,null,x)}else v==null||v===""||!c(p)?o(p,x):S(p,x,c(p));v=x}}return v}function y(p,x,v){let T=!1;for(let I=0,R=x.length;Ik-_){const U=x[C];for(;_=0;C--){const _=x[C];if(I!==_){const E=l(_)===p;!R&&!C?E?S(p,I,_):o(p,I,v):E&&i(p,_)}else R=!0}}else o(p,I,v);return[I]}function w(p,x,v){for(let T=0,I=x.length;Tv.children=g(p,x.children,v.children)),Te(()=>x.ref&&x.ref(p)),Te(()=>{for(const I in x){if(I==="children"||I==="ref")continue;const R=x[I];R!==v[I]&&(s(p,I,R,v[I]),v[I]=R)}}),v}return{render(p,x){let v;return ut(T=>{v=T,h(x,p())}),v},insert:h,spread(p,x,v){typeof x=="function"?Te(T=>A(p,x(),T,v)):A(p,x,void 0,v)},createElement:n,createTextNode:r,insertNode:o,setProp(p,x,v,T){return s(p,x,v,T),v},mergeProps:rn,effect:Te,memo:te,createComponent:wo,use(p,x,v){return ae(()=>p(x,v))}}}function $s(n){const r=Ys(n);return r.mergeProps=rn,r}const Hs={createElement(n){return new We(n)},createTextNode(n){return{name:"TextNode",text:n,parent:void 0}},replaceText(n,r){qe("Replace Text: ",n,r),n.text=r;const e=n.parent;F(e),e.text=e.getText()},setProperty(n,r,e=!0){n[r]=e},insertNode(n,r,e){qe("INSERT: ",n,r,e),n.children.insert(r,e),r._queueDelete=!1,r instanceof We?n.rendered&&r.render():n.isTextNode()&&(n.text=n.getText())},isTextNode(n){return n.isTextNode()},removeNode(n,r){qe("REMOVE: ",n,r),n.children.remove(r),r._queueDelete=!0,r instanceof We&&queueMicrotask(()=>r.destroy())},getParentNode(n){return n.parent},getFirstChild(n){return n.children[0]},getNextSibling(n){const r=n.parent.children||[],e=r.indexOf(n)+1;if(en.delete(o)}let e=!1;function t(o,i){if(e)return!(e=!1);const s={to:o,options:i,defaultPrevented:!1,preventDefault:()=>s.defaultPrevented=!0};for(const l of n)l.listener({...s,from:l.location,retry:c=>{c&&(e=!0),l.navigate(o,{...i,resolve:!1})}});return!s.defaultPrevented}return{subscribe:r,confirm:t}}let jr;function ln(){(!window.history.state||window.history.state._depth==null)&&window.history.replaceState({...window.history.state,_depth:window.history.length-1},""),jr=window.history.state._depth}ln();function Gs(n){return{...n,_depth:window.history.state&&window.history.state._depth}}function qs(n,r){let e=!1;return()=>{const t=jr;ln();const o=t==null?null:jr-t;if(e){e=!1;return}o&&r(o)?(e=!0,window.history.go(-o)):n()}}const Zs=/^(?:[a-z0-9]+:)?\/\//i,Js=/^\/+|(\/)\/+$/g,No="http://sr";function _t(n,r=!1){const e=n.replace(Js,"$1");return e?r||/^[?#]/.test(e)?e:"/"+e:""}function nr(n,r,e){if(Zs.test(r))return;const t=_t(n),o=e&&_t(e);let i="";return!o||r.startsWith("/")?i=t:o.toLowerCase().indexOf(t.toLowerCase())!==0?i=t+o:i=o,(i||"/")+_t(r,!i)}function ea(n,r){if(n==null)throw new Error(r);return n}function ta(n,r){return _t(n).replace(/\/*(\*.*)?$/g,"")+_t(r)}function Lo(n){const r={};return n.searchParams.forEach((e,t)=>{r[t]=e}),r}function ra(n,r,e){const[t,o]=n.split("/*",2),i=t.split("/").filter(Boolean),s=i.length;return l=>{const c=l.split("/").filter(Boolean),d=c.length-s;if(d<0||d>0&&o===void 0&&!r)return null;const h={path:s?"":"/",params:{}},g=y=>e===void 0?void 0:e[y];for(let y=0;yt.localeCompare(n,void 0,{sensitivity:"base"})===0;return r===void 0?!0:typeof r=="string"?e(r):typeof r=="function"?r(n):Array.isArray(r)?r.some(e):r instanceof RegExp?r.test(n):!1}function na(n){const[r,e]=n.pattern.split("/*",2),t=r.split("/").filter(Boolean);return t.reduce((o,i)=>o+(i.startsWith(":")?2:3),t.length-(e===void 0?0:1))}function Mo(n){const r=new Map,e=Nt();return new Proxy({},{get(t,o){return r.has(o)||uo(e,()=>r.set(o,te(()=>n()[o]))),r.get(o)()},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}},ownKeys(){return Reflect.ownKeys(n())}})}function zo(n){let r=/(\/?\:[^\/]+)\?/.exec(n);if(!r)return[n];let e=n.slice(0,r.index),t=n.slice(r.index+r[0].length);const o=[e,e+=r[1]];for(;r=/^(\/\:[^\/]+)\?/.exec(t);)o.push(e+=r[1]),t=t.slice(r[0].length);return zo(t).reduce((i,s)=>[...i,...o.map(l=>l+s)],[])}const oa=100,Po=fo(),Do=fo(),Oo=()=>ea(go(Po)," and 'use' router primitives can be only used inside a Route."),pt=()=>Oo().navigatorFactory(),cn=()=>Oo().params;function ia(n,r=""){const{component:e,load:t,children:o,info:i}=n,s=!o||Array.isArray(o)&&!o.length,l={key:n,component:e,load:t,info:i};return Uo(n.path).reduce((c,d)=>{for(const h of zo(d)){const g=ta(r,h);let y=s?g:g.split("/*",1)[0];y=y.split("/").map(b=>b.startsWith(":")||b.startsWith("*")?b:encodeURIComponent(b)).join("/"),c.push({...l,originalPath:h,pattern:y,matcher:ra(y,!s,n.matchFilters)})}return c},[])}function sa(n,r=0){return{routes:n,score:na(n[n.length-1])*1e4-r,matcher(e){const t=[];for(let o=n.length-1;o>=0;o--){const i=n[o],s=i.matcher(e);if(!s)return null;t.unshift({...s,route:i})}return t}}}function Uo(n){return Array.isArray(n)?n:[n]}function Wo(n,r="",e=[],t=[]){const o=Uo(n);for(let i=0,s=o.length;is.score-i.score)}function Nn(n,r){for(let e=0,t=n.length;e{const d=n();try{return new URL(d,e)}catch(h){return console.error("Invalid path ".concat(d)),c}},e,{equals:(c,d)=>c.href===d.href}),o=te(()=>t().pathname),i=te(()=>t().search,!0),s=te(()=>t().hash),l=()=>"";return{get pathname(){return o()},get search(){return i()},get hash(){return s()},get state(){return r()},get key(){return l()},query:Mo(He(i,()=>Lo(t())))}}let Oe;function la(n,r,e,t={}){const{signal:[o,i],utils:s={}}=n,l=s.parsePath||(k=>k),c=s.renderPath||(k=>k),d=s.beforeLeave||Fo(),h=nr("",t.base||"");if(h===void 0)throw new Error("".concat(h," is not a valid base path"));h&&!o().value&&i({value:h,replace:!0,scroll:!1});const[g,y]=W(!1),b=async k=>{y(!0);try{await bi(k)}finally{y(!1)}},[m,w]=W(o().value),[S,A]=W(o().state),p=aa(m,S),x=[],v=W([]),T=te(()=>Nn(r(),p.pathname)),I=Mo(()=>{const k=T(),L={};for(let O=0;Oh,outlet:()=>null,resolvePath(k){return nr(h,k)}};return Te(()=>{const{value:k,state:L}=o();ae(()=>{k!==m()&&b(()=>{Oe="native",w(k),A(L),v[1]([])}).then(()=>{Oe=void 0})})}),{base:R,location:p,params:I,isRouting:g,renderPath:c,parsePath:l,navigatorFactory:_,matches:T,beforeLeave:d,preloadRoute:P,singleFlight:t.singleFlight===void 0?!0:t.singleFlight,submissions:v};function C(k,L,O){ae(()=>{if(typeof L=="number"){L&&(s.go?s.go(L):console.warn("Router integration does not support relative routing"));return}const{replace:D,resolve:U,scroll:j,state:ie}={replace:!1,resolve:!0,scroll:!0,...O},ee=U?k.resolvePath(L):nr("",L);if(ee===void 0)throw new Error("Path '".concat(L,"' is not a routable path"));if(x.length>=oa)throw new Error("Too many redirects");const ce=m();if((ee!==ce||ie!==S())&&!Vs){if(d.confirm(ee,O)){const Ae=x.push({value:ce,replace:D,scroll:j,state:S()});b(()=>{Oe="navigate",w(ee),A(ie),v[1]([])}).then(()=>{x.length===Ae&&(Oe=void 0,E({value:ee,state:ie}))})}}})}function _(k){return k=k||go(Do)||R,(L,O)=>C(k,L,O)}function E(k){const L=x[0];L&&((k.value!==L.value||k.state!==L.state)&&i({...k,replace:L.replace,scroll:L.scroll}),x.length=0)}function P(k,L){const O=Nn(r(),k.pathname),D=Oe;Oe="preload";for(let U in O){const{route:j,params:ie}=O[U];j.component&&j.component.preload&&j.component.preload();const{load:ee}=j;L&&ee&&uo(e(),()=>ee({params:ie,location:{pathname:k.pathname,search:k.search,hash:k.hash,query:Lo(k),state:null,key:""},intent:"preload"}))}Oe=D}}function ca(n,r,e,t){const{base:o,location:i,params:s}=n,{pattern:l,component:c,load:d}=t().route,h=te(()=>t().path);c&&c.preload&&c.preload();const g=d?d({params:s,location:i,intent:Oe||"initial"}):void 0;return{parent:r,pattern:l,path:h,outlet:()=>c?wo(c,{params:s,location:i,data:g,get children(){return e()}}):e(),resolvePath(b){return nr(o.path(),b,h())}}}const da=n=>r=>{const{base:e}=r,t=yr(()=>r.children),o=te(()=>Wo(t(),r.base||""));let i;const s=la(n,o,()=>i,{base:e,singleFlight:r.singleFlight});return n.create&&n.create(s),a(Po.Provider,{value:s,get children(){return a(ha,{routerState:s,get root(){return r.root},get load(){return r.rootLoad},get children(){return[gt(()=>(i=Nt())&&null),a(ua,{routerState:s,get branches(){return o()}})]}})}})};function ha(n){const r=n.routerState.location,e=n.routerState.params,t=te(()=>n.load&&ae(()=>n.load({params:e,location:r,intent:"preload"})));return a(Ie,{get when(){return n.root},keyed:!0,get fallback(){return n.children},children:o=>a(o,{params:e,location:r,get data(){return t()},get children(){return n.children}})})}function ua(n){const r=[];let e;const t=te(He(n.routerState.matches,(o,i,s)=>{let l=i&&o.length===i.length;const c=[];for(let d=0,h=o.length;d{r[d]=b,c[d]=ca(n.routerState,c[d-1]||n.routerState.base,Ln(()=>t()[d+1]),()=>n.routerState.matches()[d])}))}return r.splice(o.length).forEach(d=>d()),s&&l?s:(e=c[0],c)}));return Ln(()=>t()&&e)()}const Ln=n=>()=>a(Ie,{get when(){return n()},keyed:!0,children:r=>a(Do.Provider,{value:r,get children(){return r.outlet()}})}),he=n=>{const r=yr(()=>n.children);return rn(n,{get children(){return r()}})};function fa([n,r],e,t){return[e?()=>e(n()):n,t?o=>r(t(o)):r]}function ga(n){if(n==="#")return null;try{return document.querySelector(n)}catch(r){return null}}function pa(n){let r=!1;const e=o=>typeof o=="string"?{value:o}:o,t=fa(W(e(n.get()),{equals:(o,i)=>o.value===i.value}),void 0,o=>(!r&&n.set(o),o));return n.init&&$e(n.init((o=n.get())=>{r=!0,t[1](e(o)),r=!1})),da({signal:t,create:n.create,utils:n.utils})}function ma(n,r,e){return n.addEventListener(r,e),()=>n.removeEventListener(r,e)}function xa(n,r){const e=ga("#".concat(n));e?e.scrollIntoView():r&&window.scrollTo(0,0)}const ya=new Map;function va(n=!0,r=!1,e="/_server"){return t=>{const o=t.base.path(),i=t.navigatorFactory(t.base);let s={};function l(m){return m.namespaceURI==="http://www.w3.org/2000/svg"}function c(m){if(m.defaultPrevented||m.button!==0||m.metaKey||m.altKey||m.ctrlKey||m.shiftKey)return;const w=m.composedPath().find(T=>T instanceof Node&&T.nodeName.toUpperCase()==="A");if(!w||r&&!w.hasAttribute("link"))return;const S=l(w),A=S?w.href.baseVal:w.href;if((S?w.target.baseVal:w.target)||!A&&!w.hasAttribute("state"))return;const x=(w.getAttribute("rel")||"").split(/\s+/);if(w.hasAttribute("download")||x&&x.includes("external"))return;const v=S?new URL(A,document.baseURI):new URL(A);if(!(v.origin!==window.location.origin||o&&v.pathname&&!v.pathname.toLowerCase().startsWith(o.toLowerCase())))return[w,v]}function d(m){const w=c(m);if(!w)return;const[S,A]=w,p=t.parsePath(A.pathname+A.search+A.hash),x=S.getAttribute("state");m.preventDefault(),i(p,{resolve:!1,replace:S.hasAttribute("replace"),scroll:!S.hasAttribute("noscroll"),state:x&&JSON.parse(x)})}function h(m){const w=c(m);if(!w)return;const[S,A]=w;s[A.pathname]||t.preloadRoute(A,S.getAttribute("preload")!=="false")}function g(m){const w=c(m);if(!w)return;const[S,A]=w;s[A.pathname]||(s[A.pathname]=setTimeout(()=>{t.preloadRoute(A,S.getAttribute("preload")!=="false"),delete s[A.pathname]},200))}function y(m){const w=c(m);if(!w)return;const[,S]=w;s[S.pathname]&&(clearTimeout(s[S.pathname]),delete s[S.pathname])}function b(m){let w=m.submitter&&m.submitter.hasAttribute("formaction")?m.submitter.getAttribute("formaction"):m.target.getAttribute("action");if(!w)return;if(!w.startsWith("https://action/")){const A=new URL(w,No);if(w=t.parsePath(A.pathname+A.search),!w.startsWith(e))return}if(m.target.method.toUpperCase()!=="POST")throw new Error("Only POST forms are supported for Actions");const S=ya.get(w);if(S){m.preventDefault();const A=new FormData(m.target);m.submitter&&m.submitter.name&&A.append(m.submitter.name,m.submitter.value),S.call({r:t,f:m.target},A)}}Ks(["click","submit"]),document.addEventListener("click",d),n&&(document.addEventListener("mouseover",g),document.addEventListener("mouseout",y),document.addEventListener("focusin",h),document.addEventListener("touchstart",h)),document.addEventListener("submit",b),$e(()=>{document.removeEventListener("click",d),n&&(document.removeEventListener("mouseover",g),document.removeEventListener("mouseout",y),document.removeEventListener("focusin",h),document.removeEventListener("touchstart",h)),document.removeEventListener("submit",b)})}}function wa(n){const r=n.replace(/^.*?#/,"");if(!r.startsWith("/")){const[,e="/"]=window.location.hash.split("#",2);return"".concat(e,"#").concat(r)}return r}function ba(n){const r=()=>window.location.hash.slice(1),e=Fo();return pa({get:r,set({value:t,replace:o,scroll:i,state:s}){o?window.history.replaceState(Gs(s),"","#"+t):window.location.hash=t;const l=t.indexOf("#"),c=l>=0?t.slice(l+1):"";xa(c,i),ln()},init:t=>ma(window,"hashchange",qs(t,o=>!e.confirm(o&&o<0?o:r()))),create:va(n.preload,n.explicitLinks,n.actionBase),utils:{go:t=>window.history.go(t),renderPath:t=>"#".concat(t),parsePath:wa,beforeLeave:e}})(n)}var Sa=!!Fi,Aa=Sa?n=>Nt()?$e(n):n:$e;function Ca(n,r,e,t){return n.addEventListener(r,e,t),Aa(n.removeEventListener.bind(n,r,e,t))}function Ta(n,r=Nt()){let e=0,t,o;return()=>(e++,$e(()=>{e--,queueMicrotask(()=>{!e&&o&&(o(),o=t=void 0)})}),o||ut(i=>t=n(o=i),r),t)}var _a=Ta(()=>{const[n,r]=W(null);return Ca(window,"keydown",e=>{r(e),setTimeout(()=>r(null))}),n});function Vt(n){return typeof n=="function"}function Ra(n){return Array.isArray(n)}const Gt={ArrowLeft:"Left",ArrowRight:"Right",ArrowUp:"Up",ArrowDown:"Down",Enter:"Enter",l:"Last"," ":"Space",Backspace:"Back",Escape:"Escape"},[hr,Ia]=W([]),Ba=n=>{const r=_a();if(n)for(const[e,t]of Object.entries(n))Ra(t)?t.forEach(o=>{Gt[o]=e}):Gt[t]=e;return Ye(He(nn,(e,t,o=[])=>{let i=e;const s=[];for(;i;)i.states.has("focus")||(i.states.add("focus"),Vt(i.onFocus)&&i.onFocus.call(i,e,t)),s.push(i),i=i.parent;return o.forEach(l=>{s.includes(l)||(l.states.remove("focus"),Vt(l.onBlur)&&l.onBlur.call(l,e,t))}),Ia(s),s},{defer:!0})),Ye(()=>{const e=r();if(e){const t=Gt[e.key]||Gt[e.keyCode];ae(()=>{const o=hr();let i;for(const s of o){if(i=i||s,t){const l=s["on".concat(t)];if(Vt(l)&&l.call(s,e,s,i)===!0)break}else console.log("Unhandled key event: ".concat(e.key));if(Vt(s.onKeyPress)&&s.onKeyPress.call(s,e,t,s,i)===!0)break}return!1})}}),hr};function Yo(n,r){const e=r();let t,o,i,s;Array.isArray(e)?e.length===2?(t=s=e[0],o=i=e[1]):e.length===3?(t=e[0],o=i=e[1],s=e[2]):[t,i,s,o]=e:t=i=s=o=e,n.onBeforeLayout=(l,c)=>{if(c){n.width=n.children.reduce((g,y)=>g+(y.width||0),0)+o+i;const d=n.children[0];d&&(d.x=o,d.marginLeft=o);let h=0;n.children.forEach(g=>{g.y=t,g.marginTop=t,h=Math.max(h,g.height||0)}),n.height=h+t+s}}}function ka(n=[]){const r=[];let e;for(e=0;e{setTimeout(r,n)})}function Ea(n,r,e="en-US"){const t=window.speechSynthesis;return new Promise((o,i)=>{const s=new SpeechSynthesisUtterance(n);s.lang=e,s.onend=()=>{o()},s.onerror=l=>{i(l)},r.push(s),t.speak(s)})}function Qr(n,r,e=!0){const t=window.speechSynthesis,o=ka(Array.isArray(n)?n:[n]),i=[],s=[];let l=!0;return{series:(async()=>{try{for(;l&&o.length;){const d=await Promise.resolve(o.shift());if(l){if(typeof d=="string"&&d.includes("PAUSE-")){let h=Number(d.split("PAUSE-")[1])*1e3;isNaN(h)&&(h=0),await Mn(h)}else if(typeof d=="string"&&d.length){let g=3;for(;l&&g>0;)try{await Ea(d,s,r),g=0}catch(y){if(y instanceof SpeechSynthesisErrorEvent)if(y.error==="network")g--,console.warn("Speech synthesis network error. Retries left: ".concat(g)),await Mn(500*(3-g));else if(y.error==="canceled"||y.error==="interrupted")g=0;else throw new Error("SpeechSynthesisErrorEvent: ".concat(y.error));else throw y}}else if(typeof d=="function"){const h=Qr(d(),r,!1);i.push(h),await h.series}else if(Array.isArray(d)){const h=Qr(d,r,!1);i.push(h),await h.series}}else break}}finally{l=!1}})(),get active(){return l},append:d=>{o.push(d)},cancel:()=>{l&&(e&&t.cancel(),i.forEach(d=>{d.cancel()}),l=!1)}}}let qt;function Fa(n,r="en-US"){return qt&&qt.cancel(),qt=Qr(n,r),qt}var dn=(n,r)=>{let e;const t=()=>clearTimeout(e);return Nt()&&$e(t),Object.assign((...i)=>{e!==void 0&&t(),e=setTimeout(()=>n(...i),r)},{clear:t})};let Kr,Rt=[],Ce,Xr=!1;const Na=3e5;function zn(n,r){const e=dn(n,r);let t;const o=i=>{t=i,e(i)};return o.flush=()=>{e.clear(),n(t)},o.clear=e.clear,o}function vt(n){return n.id||n.name}function La(n=[]){if(!ne.onFocusChange||!ne.enabled)return;const r=n.every(i=>!i.loading),e=n.filter(i=>!Rt.includes(i));if(Kr(),!r&&ne.onFocusChange){ne.onFocusChange([]);return}Rt=n.slice(0);const t=[],o=e.reduce((i,s)=>(s.announce?(i.push([vt(s),"Announce",s.announce]),t.push(s.announce)):s.title?(i.push([vt(s),"Title",s.title]),t.push(s.title)):i.push([vt(s),"No Announce",""]),i),[]);if(e.reverse().reduce((i,s)=>(s.announceContext?(i.push([vt(s),"Context",s.announceContext]),t.push(s.announceContext)):i.push([vt(s),"No Context",""]),i),o),ne.debug&&console.table(o),t.length)return ne.speak(t.reduce((i,s)=>i.concat(s),[]))}function Ma(n){if(!Xr)return Ce=Fa(n)}const ne={debug:!1,enabled:!0,cancel:function(){Ce&&Ce.cancel()},clearPrevFocus:function(n=0){Rt=Rt.slice(0,n),Kr()},speak:function(n,{append:r=!1,notification:e=!1}={}){return ne.onFocusChange&&ne.enabled&&(ne.onFocusChange.flush(),r&&Ce&&Ce.active?Ce.append(n):(ne.cancel(),Ma(n)),e&&(Xr=!0,Ce==null||Ce.series.finally(()=>{Xr=!1,ne.refresh()}).catch(console.error))),Ce},refresh:function(n=0){ne.clearPrevFocus(n),ne.onFocusChange&&ne.onFocusChange(ae(()=>hr()))},setupTimers:function({focusDebounce:n=400,focusChangeTimeout:r=Na}={}){ne.onFocusChange=zn(La,n),Kr=zn(()=>{Rt=[]},r)}},za=()=>(ne.setupTimers(),Ye(He(hr,ne.onFocusChange,{defer:!0})),ne);function Pa(n,r){const e=Fe.createTexture("ImageTexture",{src:n});return r.reduce((t,o)=>{const{x:i,y:s,width:l,height:c}=o;return t[o.name]=Fe.createTexture("SubTexture",{texture:e,x:i,y:s,width:l,height:c}),t},{})}const[Da,Ne]=W(""),f={name:"Base Lightning TV",alpha:{primary:1,secondary:.7,tertiary:.1,inactive:.5,full:1,none:0,alpha1:.1,alpha2:.3,alpha3:.5,alpha4:.7,alpha5:.9},animation:{duration:{none:0,xfast:.1,fast:.25,normal:.5,slow:.75,xslow:.9},delay:{none:0,xfast:.01,fast:.025,normal:.05,slow:.075,xslow:.09},expressive:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},expressiveEntrance:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},expressiveExit:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},standard:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},standardEntrance:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},standardExit:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},utility:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},utilityEntrance:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},utilityExit:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25}},asset:{arrowLeft:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAi0lEQVRIDWNgGAWjIfD//38JID5Fk5AAGqwKxPeA+D/VLQCaaQLEr0CGgwBVLQCa5wbEn0EGwwDVLAAaGA3Ev2AGw2iqWAA0rBiI/8EMRaYptgBoWDeygehsci1gIlcjWfqArqZdEMFcBLSEdpGMZAntkimSJbTLaEiW0K6oQLKEdoUdzJJRemiHAAD4n+yzPWCs7QAAAABJRU5ErkJggg==",arrowRight:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAg0lEQVRIDWNgGAWjIYArBP7//38KiCVwyVMsDjQcBO4BsSrFhmEzAGw8hHgFpEywqaFIDMkCEPMzELtRZCC6ZjQLQNxfQByNro5sPhYLQEL/gLiYbEORNeKwACbcDVPLBGMMOhrmVDSapkFE00imaTKlaUajaVFB28Ju0CXrUQfhDAEAEgHss6NhpLQAAAAASUVORK5CYII=",backspaceOutline:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGohMqUBAAQZ80zUVQAKUEIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypfPsAJJ0NYC92XRHKPB3AAfLv18BuBLAFSR/NKZWswJI0vkA3jCmILsw75sAvIfkR8eo22wAknQSgMvGEGFD8vwxgFeQvGrI+s4CIEnHAPgugHsMWfkNzevDAM4i+Z8h6t88QJLuXOB5yBAVzjxuVeBaAM8ieXNUjzkAdAmA50Yrmv5HKPATACeQ/GNEm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j6IYQwwVSEiJ2MKVUBWuzLSLl2HL+uxmNCGFO8yaL7RHxve6qRZoAuS4hxac8735elWVx7jrtMKL1o0Gcat9jhExHSukN/kUIFZ7MpDRtzE1isDRkAUtDvrA8ZI597FUf8gWH9P0b4gko9wAAAABJRU5ErkJggg=="},color:{palette:{"blue-20":"0xbecffeff","blue-40":"0x93a9fdff","blue-90":"0x000033ff","grey-05":"0xf8f7faff","grey-40":"0x929096ff","grey-70":"0x48474bff","grey-90":"0x181819ff"},white:"0xffffffff",black:"0x000000ff",grey:"0x929096ff",red:"0xe74c3cff",orange:"0xdc7633ff",yellow:"0xf7dc6fff",green:"0x2ecc71ff",blue:"0x93a9fdff",purple:"0x663399ff",material:"0x181819ff",materialBrand:"0x000033ff",overlay:"0x181819b3",textNeutral:"0xf8f7faff",textNeutralSecondary:"0xf8f7fab3",textNeutralTertiary:"0xf8f7fa1a",textNeutralDisabled:"0xf8f7fa80",textInverse:"0x181819ff",textInverseSecondary:"0x181819b3",textInverseTertiary:"0x1818191a",textInverseDisabled:"0x18181980",textBrand:"0x93a9fdff",textBrandSecondary:"0x93a9fdb3",textBrandTertiary:"0x93a9fd1a",textBrandDisabled:"0x93a9fd80",textPositive:"0x2ecc71ff",textNegative:"0xe74c3cff",textInfo:"0x93a9fdff",textCaution:"0xdc7633ff",fillTransparent:"0xffffff0",fillNeutral:"0xf8f7faff",fillNeutralSecondary:"0xf8f7fab3",fillNeutralTertiary:"0xf8f7fa1a",fillNeutralDisabled:"0xf8f7fa80",fillInverse:"0x181819ff",fillInverseSecondary:"0x181819b3",fillInverseTertiary:"0x1818191a",fillInverseDisabled:"0x18181980",fillBrand:"0x93a9fdff",fillBrandSecondary:"0x93a9fdb3",fillBrandTertiary:"0x93a9fd1a",fillBrandDisabled:"0x93a9fd80",fillPositive:"0x2ecc71ff",fillNegative:"0xe74c3cff",fillInfo:"0x93a9fdff",fillCaution:"0xdc7633ff",strokeNeutral:"0xf8f7faff",strokeNeutralSecondary:"0xf8f7fab3",strokeNeutralTertiary:"0xf8f7fa1a",strokeNeutralDisabled:"0xf8f7fa80",strokeInverse:"0x181819ff",strokeInverseSecondary:"0x181819b3",strokeInverseTertiary:"0x1818191a",strokeInverseDisabled:"0x18181980",strokeBrand:"0x93a9fdff",strokeBrandSecondary:"0x93a9fdb3",strokeBrandTertiary:"0x93a9fd1a",strokeBrandDisabled:"0x93a9fd80",strokePositive:"0x2ecc71ff",strokeNegative:"0xe74c3cff",strokeInfo:"0x93a9fdff",strokeCaution:"0xdc7633ff",interactiveNeutral:"0xffffff1a",interactiveNeutralFocus:"0xffffffff",interactiveNeutralFocusSoft:"0xffffff1a",interactiveInverse:"0x48474b1a",interactiveInverseFocus:"0x48474bff",interactiveInverseFocusSoft:"0x48474b1a",interactiveBrand:"0xbecffe1a",interactiveBrandFocus:"0xbecffeff",interactiveBrandFocusSoft:"0xbecffe1a",shadowNeutral:"0x000000b3",shadowNeutralFocus:"0x000000b3",shadowNeutralFocusSoft:"0x000000b3",shadowNeutralText:"0x000000ff",shadowInverse:"0x000000b3",shadowInverseFocus:"0x000000b3",shadowInverseFocusSoft:"0x000000b3",shadowInverseText:"0x000000ff",shadowBrand:"0x000000b3",shadowBrandFocus:"0x000000b3",shadowBrandFocusSoft:"0x000000b3",shadowBrandText:"0x000000ff"},font:[],layout:{columnCount:10,focusScale:1.2,gutterX:20,gutterY:20,marginX:150,marginY:150,safe:50,screenW:1920,screenH:1080},radius:{none:0,xs:2,sm:4,md:8,lg:16,xl:24},spacer:{none:0,xxs:2,xs:4,sm:8,md:10,lg:20,xl:30,xxl:40,xxxl:50},stroke:{none:0,sm:2,md:4,lg:6,xl:8},typography:{display1:{fontFamily:"Arial",fontSize:75,lineHeight:85,fontWeight:500,verticalAlign:"middle",textBaseline:"bottom"},display2:{fontFamily:"Arial",fontSize:50,lineHeight:60,fontWeight:500,verticalAlign:"middle",textBaseline:"bottom"},headline1:{fontFamily:"Arial",fontSize:35,fontWeight:500,lineHeight:48,verticalAlign:"middle",textBaseline:"bottom"},headline2:{fontFamily:"Arial",fontSize:30,fontWeight:500,lineHeight:40,verticalAlign:"middle",textBaseline:"bottom"},headline3:{fontFamily:"Arial",fontSize:25,fontWeight:500,lineHeight:36,verticalAlign:"middle",textBaseline:"bottom"},body1:{fontFamily:"Arial",fontSize:25,fontWeight:300,lineHeight:40,verticalAlign:"middle",textBaseline:"bottom"},body2:{fontFamily:"Arial",fontSize:22,fontWeight:300,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},body3:{fontFamily:"Arial",fontSize:20,fontWeight:300,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},button1:{fontFamily:"Arial",fontSize:25,fontWeight:500,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},button2:{fontFamily:"Arial",fontSize:20,fontWeight:500,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},callout1:{fontFamily:"Arial",fontSize:20,fontWeight:500,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},caption1:{fontFamily:"Arial",fontSize:15,fontWeight:500,lineHeight:24,verticalAlign:"middle",textBaseline:"bottom"},tag1:{fontFamily:"Arial",fontSize:20,fontWeight:500,lineHeight:24,verticalAlign:"middle",textBaseline:"bottom"},footnote1:{fontFamily:"Arial",fontSize:22,fontWeight:300,lineHeight:30,verticalAlign:"middle",textBaseline:"bottom"}},componentConfig:{Keyboard:{base:{keyProps:{delete:{title:null,icon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGohMqUBAAQZ80zUVQAKUEIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypX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L50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC"}}}}}};function Oa(){let n,r,e=0;const t=1,o={duration:750,easing:"ease-in-out"},i={alpha:t,color:4294967295};function s(c){if(c.startsWith("#")){n.color=c,n.src="",n.alpha=1,e=1,r.alpha=0;return}else n.color=4294967295;if(e===0){n.src=c,e=1;return}if(e===1){r.src=c,e=2,r.alpha=0,r.animate({alpha:t},o).start(),n.animate({alpha:0},o).start();return}e===2&&(n.src=c,e=1,n.alpha=0,n.animate({alpha:t},o).start(),r.animate({alpha:0},o).start())}const l=dn(s,400);return Ye(He(Da,c=>{l(c)},{defer:!0})),a(z,{width:1920,height:1080,zIndex:-5,get children(){return[a(z,{ref(c){var d=n;typeof d=="function"?d(c):n=c},style:i}),a(z,{ref(c){var d=r;typeof d=="function"?d(c):r=c},style:i,alpha:0}),a(z,{src:"./assets/hero-mask-inverted.png",get color(){return M(f.color.materialBrand)},width:1920,height:1080})]}})}var Pn,Dn,On,Un,Wn,Yn,$n,Hn,jn,Qn,Kn,Xn,Vn,Gn,qn,Zn;const Ua=["focus","disabled"],Wa=["brand","inverse","neutral"];function Y({themeKeys:n,base:r,modes:e,tones:t,themeStyles:o,modeKeys:i=Ua,toneKeys:s=Wa},l=!1){const c=(m,w,S)=>{const A=s.map(p=>{var T,I;const x={};return new Set([].concat.apply([],[(T=m==null?void 0:m[p])!=null?T:{},(I=w==null?void 0:w[p])!=null?I:{}].map(Object.keys))).forEach(R=>{var E;var C,_;i.includes(R)||(x[R]=(E=(C=w==null?void 0:w[p])==null?void 0:C[R])!=null?E:(_=m==null?void 0:m[p])==null?void 0:_[R])}),i.forEach(R=>{var C,_;x[R]={...S[R],...(C=m==null?void 0:m[p])==null?void 0:C[R],...(_=w==null?void 0:w[p])==null?void 0:_[R]}}),[p,x]});return Object.fromEntries(A)},d=(m,w)=>{const S=i.map(p=>[p,{...m==null?void 0:m[p],...w==null?void 0:w[p]}]);return Object.fromEntries(S)},h=(m,w)=>({...m,...w.base}),g=m=>Object.fromEntries(Object.entries(n).filter(([w,S])=>m[S]).map(([w,S])=>[w,m[S]])),y=m=>Object.fromEntries(Object.entries(m).map(([S,A])=>{const p=g(A);return Object.entries(A).filter(([x,v])=>i.includes(x)).forEach(([x,v])=>{p[x]=g(v)}),[S,p]}));return((m,w,S)=>{const A=y(o);l&&console.log(A);const p=h(m,A);l&&console.log(p);const x=d(w,A);l&&console.log(x);const v=c(S,A,x);return l&&console.log(v),{base:{...p,...x},tones:v}})(r,e,t)}function $o(n=0){return(r,e,t,o)=>{if(r.children.length===0)return;const i=r.gap||0,s=r.scroll||"auto",[l,c]=Ya(r),d=r.flexDirection==="row"?r.x:r.y,h=r.flexDirection==="row"?e.x:e.y,g=r.flexDirection==="row"?e.width:e.height,y=t>o?"positive":"negative";let b=d;s==="auto"?r.scrollIndex!=null&&r.scrollIndex>=0?r.selected>=r.scrollIndex&&(y==="positive"?b=d-g-i:b=d+g+i):(Math.abs(d)+ch?b=-h+n:s==="edge"&&y==="positive"&&Math.abs(d)+c{const r=n.filter(e=>typeof e=="function");if(r.length!==0)return function(...e){for(const t of r)if(t.apply(this,e)===!0)return!0}};function Ho(){if(!this||this.selected===void 0||this.children.length===0)return!1;let n=this.children[this.selected];for(;n!=null&&n.skipFocus;)this.selected++,n=this.children[this.selected];if(!(n instanceof We))return!1;n.setFocus()}function ur(n){return function(){var r,e;const t=this.children.length,o=this.wrap,i=this.selected||0;if(t===0)return!1;if(n==="right"||n==="down")do if(this.selected=(this.selected||0)%t+1,this.selected>=t){if(!o){this.selected=void 0;break}this.selected=0}while((r=this.children[this.selected])!=null&&r.skipFocus);else if(n==="left"||n==="up")do if(this.selected=(this.selected||0)%t-1,this.selected<0){if(!o){this.selected=void 0;break}this.selected=t-1}while((e=this.children[this.selected])!=null&&e.skipFocus);if(this.selected===void 0&&(this.selected=i,this.children[this.selected].states.has("focus")))return!1;const s=this.children[this.selected];if(this.onSelectedChanged&&this.onSelectedChanged.call(this,this,s,this.selected,i),this.plinko&&i!==void 0){const c=this.children[i].selected||0;s.selected=c{const r=ur("up"),e=ur("down");return a(z,Q(n,{get onUp(){return ft(n.onUp,r)},get onDown(){return ft(n.onDown,e)},get selected(){return n.selected||0},forwardFocus:Ho,get onSelectedChanged(){return ft(n.onSelectedChanged,n.scroll!=="none"?$o(n.y):void 0)},get style(){var t;return[...[n.style].flat(),Er.Container.tones[(t=n.tone)!=null?t:Er.tone],Er.Container.base]}}))},{Label:{defaultTone:qc,...Qo}={styles:{}}}=($n=f)==null?void 0:$n.componentConfig,il={themeKeys:{color:"backgroundColor",borderRadius:"radius"},base:{display:"flex",justifyContent:"center",color:f.color.textNeutral,padding:[f.spacer.md,f.spacer.lg],borderRadius:[f.radius.md,f.radius.md,f.radius.md,f.radius.none],height:f.typography.caption1.lineHeight+f.spacer.md,neutral:{backgroundColor:f.color.fillNeutral}},tones:{inverse:{color:f.color.fillInverse},brand:{color:f.color.fillBrand,focus:{color:f.color.orange}}},themeStyles:Qo},sl={themeKeys:{color:"textColor"},base:{...f.typography.caption1,color:f.color.textInverse},tones:{inverse:{color:f.color.textNeutral},brand:{color:f.color.textNeutral}},themeStyles:Qo};Y(il);Y(sl);const{Rating:{styles:fn,defaultTone:Zc}={styles:{},defaultTone:"neutral"}}=(Hn=f)==null?void 0:Hn.componentConfig,al={themeKeys:{justifyContent:"justifyContent",itemSpacing:"itemSpacing"},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",itemSpacing:f.spacer.sm},toneModes:{},themeStyles:fn},ll={themeKeys:{color:"textColor"},base:{color:f.color.textNeutral,...f.typography.body2},toneModes:{},themeStyles:fn},cl={themeKeys:{color:"color"},base:{height:f.typography.body2.lineHeight,width:f.typography.body2.lineHeight,color:f.color.fillNeutral,marginRight:f.spacer.sm},toneModes:{},themeStyles:fn};Y(al);Y(cl);Y(ll);const{Details:{defaultTone:Jc,...Ko}={styles:{}}}=(jn=f)==null?void 0:jn.componentConfig,dl={themeKeys:{alignItems:"alignItems",contentSpacing:"contentSpacing",badgeContentSpacing:"badgeContentSpacing",ratingContentSpacing:"ratingContentSpacing"},base:{display:"flex",flexDirection:"row",alignItems:"center",contentSpacing:f.spacer.lg,badgeContentSpacing:f.spacer.sm,ratingContentSpacing:f.spacer.lg},themeStyles:Ko},hl={themeKeys:{color:"textColor"},base:{...f.typography.body2,marginRight:f.spacer.lg,color:f.color.textNeutral},tones:{neutral:{disabled:{color:f.color.textNeutralDisabled}},inverse:{color:f.color.textInverse,disabled:{color:f.color.textNeutralDisabled}},brand:{color:f.color.textNeutral,disabled:{color:f.color.textNeutralDisabled}}},themeStyles:Ko};Y(dl);Y(hl);const{Metadata:{defaultTone:ed,...gn}={styles:{}}}=(Qn=f)==null?void 0:Qn.componentConfig,ul={themeKeys:{justifyContent:"justifyContent",alpha:"alpha"},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",alpha:f.alpha.primary},modes:{disabled:{alpha:f.alpha.inactive}},themeStyles:gn},fl={themeKeys:{color:"textColor"},base:{maxLines:1,contain:"width",...f.typography.headline3,color:f.color.textNeutral},tones:{neutral:{disabled:{color:f.color.textNeutralDisabled}},inverse:{color:f.color.textInverse,disabled:{color:f.color.textNeutralDisabled}},brand:{color:f.color.textNeutral,disabled:{color:f.color.textNeutralDisabled}}},themeStyles:gn},gl={themeKeys:{color:"textColor"},base:{contain:"width",maxLines:2,...f.typography.body2,color:f.color.textNeutralSecondary},tones:{neutral:{disabled:{color:f.color.textNeutralDisabled}},inverse:{color:f.color.textInverseSecondary,disabled:{color:f.color.textNeutralDisabled}},brand:{color:f.color.textNeutralSecondary,disabled:{color:f.color.textNeutralDisabled}}},themeStyles:gn};Y(ul);Y(gl);Y(fl);const{ProgressBar:{defaultTone:td,...Xo}={styles:{}}}=(Kn=f)==null?void 0:Kn.componentConfig,pl={themeKeys:{color:"barColor",borderRadius:"borderRadius"},base:{height:f.spacer.md,color:f.color.fillNeutralTertiary,borderRadius:f.radius.xs},tones:{inverse:{color:f.color.fillInverseTertiary}},themeStyles:Xo},ml={themeKeys:{color:"progressColor",borderRadius:"borderRadius"},base:{borderRadius:f.radius.xs,color:f.color.fillNeutral},tones:{inverse:{color:f.color.fillInverse},brand:{color:f.color.fillBrand}},themeStyles:Xo};Y(pl);Y(ml);const{Row:{defaultTone:xl,...yl}={styles:{}}}=(Xn=f)==null?void 0:Xn.componentConfig,vl={themeKeys:{gap:"itemSpacing",scrollIndex:"scrollIndex",itemTransition:"itemTransition"},base:{display:"flex",justifyContent:"flexStart",flexDirection:"row",gap:f.layout.gutterX,width:f.layout.screenW,itemTransition:{...f.animation.standardEntrance,duration:f.animation.duration.fast}},themeStyles:yl},wl=Y(vl),wt={tone:xl,Container:wl},V=n=>{const r=ur("left"),e=ur("right");return a(z,Q(n,{get selected(){return n.selected||0},get onLeft(){return ft(n.onLeft,r)},get onRight(){return ft(n.onRight,e)},forwardFocus:Ho,get onSelectedChanged(){return ft(n.onSelectedChanged,n.scroll!=="none"?$o(n.x):void 0)},get tone(){var t;return(t=n.tone)!=null?t:wt.tone},get style(){return[...[n.style].flat(),wt.Container.tones[n.tone||wt.tone],wt.Container.base]},get states(){var t;return(t=n.tone)!=null?t:wt.tone}}))},{Keyboard:{defaultTone:rd,...pn}={styles:{}}}=(Vn=f)==null?void 0:Vn.componentConfig,bl={themeKeys:{keySpacing:"keySpacing",screenW:"screenW",marginX:"marginX"},base:{keySpacing:f.spacer.md,screenW:f.layout.screenW,marginX:f.layout.marginX,height:100},themeStyles:pn},Sl={themeKeys:{keySpacing:"keySpacing",textAlign:"textAlign",borderRadius:"borderRadius",color:"backgroundColor",justifyContent:"justifyContent",baseWidth:"baseWidth",sizes:"sizes",contentColor:"contentColor"},base:{keySpacing:f.spacer.md,height:f.spacer.md*9,paddingX:f.spacer.md,sizes:{sm:1,md:2,lg:3,xl:4,xxl:5},contentColor:f.color.fillNeutral,padding:[f.spacer.xxxl,f.spacer.xl],baseWidth:f.spacer.md*7,color:f.color.interactiveNeutral,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:f.radius.sm},modes:{focus:{color:f.color.interactiveNeutralFocus,contentColor:f.color.fillInverse},disabled:{color:f.color.fillNeutralDisabled,contentColor:f.color.fillNeutralDisabled}},tones:{inverse:{color:f.color.interactiveInverse,focus:{color:f.color.interactiveInverseFocus,contentColor:f.color.fillNeutral}},brand:{focus:{contentColor:f.color.fillNeutral}}},themeStyles:pn},Al={themeKeys:{color:"textColor"},base:{textAlign:"left",color:f.color.textNeutral,...f.typography.headline2},modes:{focus:{color:f.color.textInverse},disabled:{color:f.color.textNeutralDisabled}},tones:{inverse:{focus:{color:f.color.textNeutral}}},themeStyles:pn};Y(bl);Y(Sl);Y(Al);const{Key:{defaultTone:nd,...Vo}={styles:{}}}=(Gn=f)==null?void 0:Gn.componentConfig,Cl={themeKeys:{keySpacing:"keySpacing",textAlign:"textAlign",borderRadius:"borderRadius",color:"backgroundColor",justifyContent:"justifyContent",baseWidth:"baseWidth",sizes:"sizes",contentColor:"contentColor"},base:{keySpacing:f.spacer.md,height:f.spacer.md*9,paddingX:f.spacer.md,contentColor:f.color.fillNeutral,sizes:{sm:1,md:2,lg:3,xl:4,xxl:5},padding:[f.spacer.xxxl,f.spacer.xl],baseWidth:f.spacer.md*7,color:f.color.interactiveNeutral,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:f.radius.sm},modes:{focus:{color:f.color.interactiveNeutralFocus,contentColor:f.color.fillInverse},disabled:{color:f.color.fillNeutralDisabled,contentColor:f.color.fillNeutralDisabled}},tones:{inverse:{color:f.color.interactiveInverse,focus:{color:f.color.interactiveInverseFocus,contentColor:f.color.fillNeutral}},brand:{focus:{contentColor:f.color.fillNeutral}}},themeStyles:Vo},Tl={themeKeys:{color:"textColor"},base:{textAlign:"left",color:f.color.textNeutral,...f.typography.headline2},modes:{focus:{color:f.color.textInverse},disabled:{color:f.color.textNeutralDisabled}},tones:{inverse:{focus:{color:f.color.textNeutral}}},themeStyles:Vo};Y(Cl);Y(Tl);const{Tile:{defaultTone:od,...Sr}={styles:{}}}=(qn=f)==null?void 0:qn.componentConfig,{Surface:{defaultSurfaceTone:id,..._l}={styles:{}}}=(Zn=f)==null?void 0:Zn.componentConfig,Rl={themeKeys:{alpha:"alpha",paddingYProgress:"paddingYProgress"},base:{width:400,height:240,padding:[40,10],paddingYProgress:f.spacer.xl,paddingYBetweenContent:f.spacer.md,borderRadius:f.radius.md,alpha:f.alpha.primary},modes:{disabled:{alpha:f.alpha.inactive}},themeStyles:{..._l,...Sr}},Il={themeKeys:{},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",mountY:1},themeStyles:Sr},Bl={themeKeys:{},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart"},themeStyles:Sr},kl={themeKeys:{},base:{width:f.spacer.lg*5,height:f.spacer.xxl+f.spacer.md},themeStyles:Sr};Y(Rl);Y(Il);Y(Bl);Y(kl);const Vr={Column:{flexDirection:"column",display:"flex",width:320,height:600,y:360,gap:20,zIndex:101,transition:{x:{duration:250,easing:"ease-in-out"}},x:8,focus:{x:f.layout.marginX}},Gradient:{zIndex:99,color:M("#000000"),src:"./assets/sidenav.png",alpha:0,width:1200,height:1080,focus:{alpha:1},transition:{alpha:!0}},NavButton:{zIndex:102,height:70,width:100,borderRadius:8,focus:{color:M(f.color.material)},active:{width:328,height:70}}},El="/solid-demo-app/",Fl=[{name:"experiment",width:81,height:100,x:0,y:0},{name:"trending",width:100,height:56,x:81,y:0},{name:"tv",width:100,height:68,x:181,y:0},{name:"movie",width:94,height:100,x:282,y:0}];function Nl(n){const r=Pa(El+"assets/icons_white.png",Fl);return a(z,Q(n,{get texture(){return r[n.name]},get width(){return r[n.name].props.width},get height(){return r[n.name].props.height},get x(){return(100-(r[n.name].props.width||0))/2},get y(){return(100-(r[n.name].props.height||0))/2}}))}function Zt(n){return a(z,Q(n,{forwardStates:!0,get style(){return Vr.NavButton},get children(){return[a(z,{y:-16,get children(){return a(Nl,{scale:.5,get name(){return n.icon}})}}),a(N,{get style(){return{...f.typography.button1,fontSize:38,x:116,y:16,height:50,alpha:0,active:{alpha:1}}},get children(){return n.children}})]}}))}function Ll(n){let r;const e=pt();function t(){r.states.add("focus"),this.children.forEach(i=>i.states.add("active")),this.children.selected.setFocus()}function o(){r.states.remove("focus"),this.selected=0,this.children.forEach(i=>i.states.remove("active"))}return[a(J,Q(n,{onFocus:t,onBlur:o,get style(){return Vr.Column},scroll:"none",get children(){return[a(Zt,{onEnter:()=>e("/browse/all"),icon:"trending",children:"Trending"}),a(Zt,{icon:"movie",onEnter:()=>e("/browse/movie"),children:"Movies"}),a(Zt,{icon:"tv",onEnter:()=>e("/browse/tv"),children:"TV"}),a(Zt,{icon:"experiment",onEnter:()=>e("/examples"),children:"Examples"})]}})),a(z,{ref(i){var s=r;typeof s=="function"?s(i):r=i},get style(){return Vr.Gradient}})]}const Ml={color:255,height:90,width:330,x:1500,y:20,alpha:.8,zIndex:100},Jt={x:10,fontSize:36,textColor:M("#ffffff")},er={fontSize:36,textColor:M("#ffffff")},[zl,Pl]=W(0),[Dl,Ol]=W(0),[Ul,Go]=W(99),[Wl,Yl]=W(0);let Gr=0,qr=0;const $l=dn(()=>{qr=0,Gr=0,Go(99)},1e4),Hl=n=>{n&&(Pl(n),Go(r=>Math.min(n,r)),Yl(r=>Math.max(n,r)),qr+=n,Gr++,Ol(Math.round(qr/Gr)),$l())};function jl(n){n.renderer.on("fpsUpdate",(r,e)=>{const t=typeof e=="number"?e:e.fps;t>5&&Hl(t)})}const Ql=n=>a(z,Q(n,{style:Ml,get children(){return[a(z,{get children(){return[a(N,{style:Jt,children:"FPS:"}),a(N,{style:er,x:94,get children(){return zl().toString()}})]}}),a(z,{x:160,get children(){return[a(N,{style:Jt,children:"AVG:"}),a(N,{style:er,x:104,get children(){return Dl().toString()}})]}}),a(z,{x:0,y:40,get children(){return[a(N,{style:Jt,children:"MIN:"}),a(N,{style:er,x:94,get children(){return Ul().toString()}})]}}),a(z,{x:160,y:40,get children(){return[a(N,{style:Jt,children:"MAX:"}),a(N,{style:er,x:104,get children(){return Wl().toString()}})]}})]}})),Kl=n=>{Ba({Announcer:"a",Menu:"m",Escape:"Escape"});const r=za();r.enabled=!1;const e=pt();let t,o;return tt(()=>{jl({renderer:Fe})}),a(z,{onAnnouncer:()=>r.enabled=!r.enabled,onLast:()=>history.back(),onMenu:()=>e("/"),style:{width:1920,height:1080},onLeft:()=>{if(t.states.has("focus"))return!1;o=nn(),t.setFocus()},onRight:()=>t.states.has("focus")&&o.setFocus(),get children(){return[a(Oa,{}),a(Ql,{}),gt(()=>n.children),a(Ll,{ref(i){var s=t;typeof s=="function"?s(i):t=i}})]}})},ue={Page:{width:1920,height:1080},headlineText:{width:1200,height:240,x:360,y:455,contain:"both",fontSize:66,textAlign:"center"},headlineSubText:{width:960,height:170,x:530,y:655,contain:"both",fontSize:48,textAlign:"center"},itemsContainer:{width:f.layout.screenW,height:600,y:560,x:0,zIndex:2},Thumbnail:{borderRadius:16,width:185,height:278,scale:1,zIndex:2,transition:{scale:{duration:250,easing:"ease-in-out"}},border:{width:0,color:0},focus:{scale:1.1,border:{color:4294967142,width:8}}},FocusRing:{borderRadius:16,width:194,height:286,y:-5,x:-5,zIndex:-1},FPS:{color:255,height:42,width:140,x:20,y:20,zIndex:100},FPSLabel:{x:10,y:0,fontSize:36,textColor:M("#ffffff")},FPSValue:{x:90,y:0,fontSize:36,textColor:M("#ffffff")},showHeadline:{x:70,y:20},headlineBlur:{width:1920,height:150,x:0,y:0,zIndex:14,alpha:.9,color:M("#000000")},RowTitle:{height:60,width:300,marginTop:20,fontSize:36,color:M("#f0f0f0"),zIndex:2},Row:{display:"flex",justifyContent:"spaceBetween",height:300},Column:{display:"flex",flexDirection:"column",justifyContent:"flexStart",gap:20,width:f.layout.screenW-2*f.layout.marginX,x:f.layout.marginX+f.layout.gutterX,y:48,transition:{y:{duration:250,easing:"ease-in-out"}},zIndex:2},Rect:{width:250,height:100,y:10,x:300,color:M("#0000ff")},peopleBio:{...f.typography.body1,contain:"both",width:1500,height:400}},fr={width:120,height:40,color:M("#000000"),borderRadius:8,border:{width:2,color:M("#3333ff")},scale:1,focus:{scale:1.1,border:{width:5,color:M("#333333")}},transition:{scale:!0,color:!0}},Xl={color:M("#00A699"),height:8,y:2,x:-4,width:fr.width+8},Vl={fontSize:12,y:12,contain:"width",textAlign:"center",color:M("#F6F6F9"),height:fr.height,width:fr.width},gr={container:fr,topBar:Xl,text:Vl},Jn={width:386,height:136,color:M("#715cab"),focus:{color:M("#5a39a2")},disabled:{color:M("#291d43")}},Gl={fontSize:32,contain:"width",textAlign:"center",mountY:-.35,color:M("#FFFFFF"),height:Jn.height,width:Jn.width,focus:{fontSize:40},disabled:{color:M("#909090")}};function ql(n){return a(z,Q(n,{get style(){return ue.Thumbnail}}))}function pr(n){const[r,e]=ki(n,["items"]);return a(V,Q(e,{get style(){return ue.Row},get children(){return a(wr,{get each(){return r.items},children:t=>a(ql,t)})}}))}function Zl(n){return a(z,Q(n,{forwardStates:!0,get style(){return gr.container},get children(){return a(N,{get style(){return gr.text},get children(){return n.children}})}}))}const Jl="eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyZDE4YjEwMTA0YjdiZTlkNjFiMWYwYjVlMGEwNzM2OCIsInN1YiI6IjYwZTVjMTdlNGNhNjc2MDA3NTA4Njc3MSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.D_nqH9kd-bhhWzeVsTDPYhHnsUaNAuyAa6YATmKHqsA",ec="https://api.themoviedb.org/3";let qo,Zo;const tc="w185",rc={headers:{"Content-Type":"application/json",Authorization:"Bearer "+Jl}};function It(n,r=tc){return Zo+r+n}function nc(n,r={}){return qo?Zr(n,r):Jo().then(()=>Zr(n,r))}function Zr(n,r={}){return fetch(ec+n,{...rc,...r}).then(e=>e.json())}function Jo(){return Zr("/configuration").then(n=>{var r;return qo=n,Zo=(r=n.images)==null?void 0:r.secure_base_url,n})}const Je={get:nc,loadConfig:Jo};function oc(n,r){return n.length>r?n.substring(0,r-3)+"...":n}function ic(n,r=7){let e=[];for(let t=0,o=n.length;t({src:It(r.poster_path||r.profile_path),tileSrc:It(r.backdrop_path||r.profile_path,"w300"),backdrop:It(r.backdrop_path,"w1280"),href:"/entity/".concat(r.media_type||"people","/").concat(r.id),shortTitle:oc(r.title||r.name,30),title:r.title||r.name,data:r,entityInfo:{type:r.media_type||"people",id:r.id},heroContent:{title:r.title||r.name,description:r.overview}}))}let Fr=new Map;const tr=new Map;function sc(n){return r=>{const e="/trending/".concat(n,"/week?page=").concat(r);if(Fr.has(e))return Fr.get(e);let t=Je.get(e).then(o=>{let i=o.results.filter(c=>!c.adult),s=(tr.has(n)?tr.get(n):[]).concat(Et(i)),l=ic(s);return l[l.length-1].length<7?tr.set(n,l.pop()):tr.delete(n),l});return Fr.set(e,t),t}}function ac(n){const[r,e]=W([]),[t,o]=W(1),[i,s]=W(!1),[l]=Ze(t,n);return Nr(()=>{const c=l();c&&wi(()=>{c.length===0&&s(!0),e(d=>[...d,...c])})}),{pages:r,page:t,setPage:o,setPages:e,end:i,setEnd:s}}const Ar=1100,lc={...f.typography.display2,width:Ar,height:58,contain:"both"},cc=n=>a(N,Q(n,{style:lc,get children(){return n.children}})),dc={...f.typography.body1,width:Ar,height:72,contain:"both"},hc={fontSize:20,lineHeight:20},uc=n=>a(N,Q(n,{style:dc,get children(){return n.children}}));function fc(n){return[a(Ie,{get when(){return(n==null?void 0:n.rtCrit)&&(n==null?void 0:n.rtCrit)!=="0"},get children(){return[a(z,{src:"https://upload.wikimedia.org/wikipedia/commons/b/b6/Tomato-Torrent-Icon.png",title:"Rotten Tomatoes Rating",style:{width:30,height:30,marginRight:-6}}),a(N,{style:Jr,get children(){return n.rtCrit+"%"}})]}}),a(Ie,{get when(){return(n==null?void 0:n.rtFan)&&(n==null?void 0:n.rtFan)!=="0"},get children(){return[a(z,{src:"https://upload.wikimedia.org/wikipedia/commons/thumb/d/da/Rotten_Tomatoes_positive_audience.svg/80px-Rotten_Tomatoes_positive_audience.svg.png",title:"Rotten Tomatoes Rating",style:{width:24,height:30,marginRight:-6}}),a(N,{style:Jr,get children(){return n.rtFan+"%"}})]}})]}const gc=n=>(()=>{var r=zt("node");return Eo(Yo,r,()=>[8,15,13,15]),br(r,Q(n,{style:{color:"0x00000099",borderRadius:8,border:{width:3,color:"0xffffffff"}}}),!0),ko(r,a(N,{style:hc,get children(){return n.children}})),r})(),Jr=f.typography.body2,pc=n=>a(z,{style:{display:"flex",flexDirection:"row",gap:12,width:Ar,height:48},get children(){return[a(N,{style:Jr,get children(){return n.metaText}}),a(wr,{get each(){return n.badges},children:r=>a(gc,{y:-5,children:r})}),gt(()=>fc(n.reviews))]}}),ei=n=>a(z,Q(n,{style:{display:"flex",flexDirection:"column",width:Ar,height:160,gap:16},get children(){return[a(cc,{get children(){return n.title}}),a(uc,{get children(){return n.description}}),a(pc,{get metaText(){return n.metaText},get badges(){return n.badges},get reviews(){return n.reviews}})]}}));function mc(n){const r=Math.floor(n/60),e=n%60;return r+"h "+(e<10?"0":"")+e+"m"}function eo(n){return n.split("-")[0]}function xc({type:n,id:r}){return Je.get("/".concat(n,"/").concat(r,"/recommendations")).then(({results:e})=>e.length?Et(e.slice(0,7)):Je.get("/trending/".concat(n,"/week?page=1")).then(({results:t})=>Et(t.slice(0,7))))}function yc({type:n,id:r}){return Je.get("/".concat(n,"/").concat(r,"/credits")).then(({cast:e})=>Et(e.slice(0,7)))}function ti({type:n,id:r}){let e=n==="movie"?{rtCrit:86,rtFan:92}:{};return Je.get("/".concat(n,"/").concat(r)).then(t=>({backgroundImage:It(t.backdrop_path,"original"),heroContent:{title:t.title||t.name,description:t.overview,badges:["HD"],metaText:n==="movie"?mc(t.runtime)+" - "+t.release_date:"".concat(eo(t.first_air_date)," - ").concat(eo(t.last_air_date)),reviews:e},...t}))}const to=()=>{const n=cn(),[r,e]=W(0),[t,o]=W();Ze(t,ti);const[i,s]=W({}),l=pt(),c=ho(()=>0),d=te(()=>ac(sc(n.filter||"all")));Ye(He(nn,y=>{y.backdrop&&Ne(y.backdrop),y.heroContent&&s(y.heroContent)},{defer:!0}));function h(){var b;(b=this.children.selected)==null||b.setFocus(),e((this.y||0)*-1+24);let y=d().pages().length;(y===0||this.parent.selected&&this.parent.selected>=y-2)&&d().setPage(m=>m+1)}function g(){let y=this.children.selected;F(y&&y.href),l(y.href)}return a(Ie,{get when(){return d().pages().length},get children(){return[a(ei,Q({y:360,x:150},i)),a(z,{clipping:!0,get style(){return ue.itemsContainer},get children(){return a(J,{plinko:!0,announce:"All Trending - Week",get y(){return r()},get style(){return ue.Column},get children(){return a(wr,{get each(){return d().pages()},children:(y,b)=>a(pr,{get autofocus(){return c(b())},items:y,onFocus:h,onEnter:g})})}})}})]}})},vc=()=>{const n=pt(),r=ho(()=>0);function e(){let c=this.children.selected;F(c&&c.id),n("/"+c.id)}const t=[{title:"Flex Row",id:"flex",description:"Flex Row Implementation"},{title:"Flex Column",id:"flexcolumn",description:"Flex Column Implementation"},{title:"Flex Row Vertical Align",id:"flexsize",description:"Flex Row Vertical Align Implementation"},{title:"Flex Column Vertical Align",id:"flexcolumnsize",description:"Flex Column Vertical Align Implementation"},{title:"Buttons",id:"buttons",description:"Demo a few buttons"},{title:"Text",id:"text",description:"Text layout with flexbox"},{title:"Create Elements",id:"create",description:"Testing Show + children + inserting text"}];function o(c){const d={width:370,height:320,borderRadius:6,scale:1,color:405488895,transition:{color:!0,scale:!0},focus:{scale:1.1,color:4294967295}},[h,g]=W(4294967295);return a(z,Q(c,{onFocus:()=>g(255),onBlur:()=>g(4294967295),style:d,get children(){return a(z,{x:30,get children(){return[a(N,{y:30,fontSize:84,get color(){return h()},get children(){return c.index}}),a(N,{y:140,fontSize:42,width:340,height:42,contain:"both",get color(){return h()},get children(){return c.title}}),a(N,{y:200,fontSize:28,width:330,contain:"width",get color(){return h()},get children(){return c.description}})]}})}}))}const[i,s]=W(140);function l(c){s(c.selected*-400+140)}return a(z,{colorTop:1147903743,colorBottom:743406847,get children(){return[a(z,{x:120,get children(){return[a(z,{src:"/assets/solidjs.png",width:101,height:90,y:40}),a(N,{fontSize:90,x:110,y:40,children:"Examples"}),a(z,{y:140,height:1,width:1800,color:3906468351})]}}),a(V,{onSelectedChanged:l,onEnter:e,transition:{x:{delay:20,duration:300}},get x(){return i()},y:300,width:4400,get style(){return ue.Row},justifyContent:"flexStart",gap:40,get children(){return a(wr,{each:t,children:(c,d)=>a(o,Q({get autofocus(){return r(d())},get index(){return d()}},c))})}})]}})},wc=()=>{const n={width:900,height:500,y:350,x:150,gap:25,display:"flex",flexDirection:"column",justifyContent:"flexStart",color:M("00000000")},r={width:900,height:36,gap:6,display:"flex",flexDirection:"row",justifyContent:"flexStart",color:M("00000000")},e={fontSize:42},t={width:n.width,fontSize:26,contain:"width"},o={fontSize:26};return tt(()=>{Ne("#000000")}),a(z,{autofocus:!0,style:n,get children(){return[a(N,{style:e,children:"Title of the Page"}),a(N,{style:t,children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer vel tempor tellus. Sed eu leo purus. Vestibulum sollicitudin eget tellus a varius. Phasellus est turpis, volutpat sed blandit sit amet, rutrum sit amet mauris. In dignissim elit orci, a sollicitudin ipsum faucibus et. Quisque vel quam rutrum, faucibus augue sed, scelerisque nunc."}),a(z,{style:r,get children(){return[a(N,{style:o,children:"Subline Text"}),a(z,{width:28,height:28,src:"/assets/rt-popcorn.png"}),a(N,{style:o,children:"More Text"})]}})]}})},bc=()=>{const n={width:900,height:500,y:50,x:150,gap:25,display:"flex",flexDirection:"column",justifyContent:"flexStart",color:M("00000000")},r={width:900,height:36,gap:6,display:"flex",flexDirection:"row",justifyContent:"flexStart",color:M("00000000")},e={fontSize:42},t={fontSize:26};let o,i;tt(()=>{Ne("#000000"),o.animate({x:100},{duration:2e3}).start()});const[s,l]=W(),[c,d]=W();setTimeout(()=>{var A;l("- Inserted -"),(A=i.getChildById("child1"))==null||A.animate({x:600},{duration:2e3}).start()},2e3);const h={width:400,height:300,color:M("#0000ff")},g={color:M("#f54242"),focus:{color:M("#4287f5")}};function y(A){const p=yr(()=>A.children);return a(z,Q(A,{get style(){return[g,A.style,[h]]},get children(){return[a(z,{id:"child1",width:100,height:100,get color(){return M("#ff0000")},y:25,get children(){return[gt(()=>p()),a(z,{id:"subChild",x:150,width:100,height:100,get color(){return M("#00ff00")}}),a(N,{get children(){return A.title}})]}}),a(z,{width:100,height:100,get color(){return M("#ffff00")},y:175,get children(){return p()}})]}}))}const b={borderLeft:{width:8,color:95598118},borderTop:{width:8,color:631422246},borderRight:{width:8,color:95598118},borderBottom:{width:8,color:3316790822}},m={color:M("#cccccc"),focus:{color:M("#000000")}},w={color:M("#ffffff"),focus:{color:M("#f6f6cc")}};function S(A){return console.log("Ref is available: ",A),!0}return a(z,{style:n,get children(){return[a(N,{style:e,children:"Title of the Page"}),a(z,{style:r,get children(){return[a(N,{get children(){return c()}}),a(N,{style:t,get children(){return["Sub ",gt(()=>s())," Text"]}}),a(Ie,{get when(){return s()},get children(){return a(z,{width:28,height:28,src:"/assets/rt-popcorn.png"})}}),a(N,{style:t,children:"More Text"})]}}),a(y,{autofocus:!0,ref(A){var p=i;typeof p=="function"?p(A):i=A},style:[w,m],get children(){return a(N,{children:"Child Test"})}}),a(z,{ref(A){var p=o;typeof p=="function"?p(A):o=A},style:b,width:100,height:100,get color(){return M("#00ff00")},x:900,y:400,get alpha(){return S(o)?1:.5}})]}})},Sc=()=>{function n(o,i){this.states.toggle("disabled")}const r={display:"flex",justifyContent:"flexStart",width:1500,height:300,color:M("00000000"),gap:26,y:400};function e(o){return a(z,Q(o,{forwardStates:!0,get style(){return gr.container},get children(){return a(N,{get style(){return gr.text},get children(){return o.children}})}}))}const t=o=>(()=>{var i=zt("node");return Eo(Yo,i,()=>[10,15]),br(i,Q(o,{get style(){return{color:M("#000000be"),borderRadius:8,border:{width:2,color:M("#ffffff")}}}}),!0),ko(i,a(N,{style:{fontSize:20},get children(){return o.children}})),i})();return[a(V,{x:100,y:200,gap:5,style:r,get children(){return[a(t,{children:"HD"}),a(t,{children:"PG13"}),a(t,{children:"NC17"}),a(N,{fontSize:30,children:"I like bananas"}),a(t,{children:"DOLBY"})]}}),a(V,{x:100,gap:40,style:r,get children(){return[a(e,{autofocus:!0,onEnter:n,children:"TV Shows"}),a(e,{states:{active:!0,disabled:!1},children:"Movies"}),a(e,{states:"active",children:"Sports"}),a(e,{states:"disabled",children:"News"})]}})]},Ac=()=>{const n={display:"flex",justifyContent:"flexStart",width:1600,height:110,color:M("#4dabf5")},r={fontSize:44,marginTop:25,marginBottom:-20,skipFocus:!0};function e(l){return a(z,Q(l,{style:{width:200,height:100,y:5,color:392801023}}))}const[t,o]=W(50);function i(){var l;(l=this.children.selected)==null||l.setFocus(),o(150+(this.y||0)*-1)}tt(()=>{Ne("#333333")});const s=50;return a(J,{x:160,get y(){return t()},gap:30,height:850,get width(){return n.width},get style(){return ue.Column},get children(){return[a(N,{style:r,children:"Flex Start"}),a(V,{gap:s,style:n,onFocus:i,get children(){return[a(e,{autofocus:!0}),a(e,{}),a(e,{}),a(e,{}),a(e,{})]}}),a(N,{style:r,children:"Flex Start - Margin Left"}),a(V,{gap:s,style:n,onFocus:i,get children(){return[a(e,{marginLeft:100}),a(e,{}),a(e,{marginLeft:100}),a(e,{}),a(e,{})]}}),a(N,{style:r,children:"Flex End"}),a(V,{gap:s,justifyContent:"flexEnd",style:n,onFocus:i,get children(){return[a(e,{}),a(e,{}),a(e,{}),a(e,{}),a(e,{})]}}),a(N,{style:r,children:"Flex End - Margin Right"}),a(V,{gap:s,justifyContent:"flexEnd",style:n,onFocus:i,get children(){return[a(e,{}),a(e,{marginRight:100}),a(e,{}),a(e,{}),a(e,{marginRight:100})]}}),a(N,{style:r,children:"Center - No Margin Support"}),a(V,{gap:s,justifyContent:"center",style:n,onFocus:i,get children(){return[a(e,{}),a(e,{}),a(e,{}),a(e,{}),a(e,{})]}}),a(N,{style:r,children:"Space Between - No Margin Support"}),a(V,{gap:s,justifyContent:"spaceBetween",style:n,onFocus:i,get children(){return[a(e,{}),a(e,{}),a(e,{}),a(e,{}),a(e,{})]}}),a(N,{style:r,children:"Space Evenly - No Margin Support"}),a(V,{gap:s,justifyContent:"spaceEvenly",style:n,onFocus:i,get children(){return[a(e,{}),a(e,{}),a(e,{}),a(e,{}),a(e,{})]}})]}})},Cc=()=>{const n={display:"flex",justifyContent:"flexStart",width:1600,height:110,color:M("#4dabf5")},r={fontSize:44,marginTop:25,marginBottom:-20,skipFocus:!0};function e(c){return a(z,Q(c,{style:{width:200,height:100,y:5,color:392801023}}))}function t(){return Math.floor(Math.random()*91)+10}const[o,i]=W(50);function s(){var c;(c=this.children.selected)==null||c.setFocus(),i(150+(this.y||0)*-1)}tt(()=>{Ne("#333333")});const l=50;return a(J,{x:160,get y(){return o()},gap:30,height:850,get width(){return n.width},get style(){return ue.Column},get children(){return[a(N,{style:r,children:"Flex Start - AlignItems: center"}),a(V,{alignItems:"center",gap:l,style:n,onFocus:s,get children(){return[a(e,{autofocus:!0,get height(){return t()}}),a(e,{get height(){return t()}}),a(e,{get height(){return t()}}),a(e,{get height(){return t()}}),a(e,{get height(){return t()}})]}}),a(N,{style:r,children:"Flex Start - Margin Left - AlignItems: flexStart"}),a(V,{gap:l,alignItems:"flexStart",style:n,onFocus:s,get children(){return[a(e,{marginLeft:100,get height(){return t()}}),a(e,{get height(){return t()}}),a(e,{marginLeft:100,get height(){return t()}}),a(e,{get height(){return t()}}),a(e,{get height(){return t()}})]}}),a(N,{style:r,children:"Flex End - AlignItems: flexEnd"}),a(V,{gap:l,justifyContent:"flexEnd",alignItems:"flexEnd",style:n,onFocus:s,get children(){return[a(e,{get height(){return t()}}),a(e,{get height(){return t()}}),a(e,{get height(){return t()}}),a(e,{get height(){return t()}}),a(e,{get height(){return t()}})]}}),a(N,{style:r,children:"Flex End - Margin Right"}),a(V,{gap:l,justifyContent:"flexEnd",style:n,onFocus:s,get children(){return[a(e,{get height(){return t()}}),a(e,{marginRight:100,get height(){return t()}}),a(e,{get height(){return t()}}),a(e,{get height(){return t()}}),a(e,{marginRight:100,get height(){return t()}})]}}),a(N,{style:r,children:"Center - No Margin Support"}),a(V,{gap:l,justifyContent:"center",style:n,onFocus:s,get children(){return[a(e,{get height(){return t()}}),a(e,{get height(){return t()}}),a(e,{get height(){return t()}}),a(e,{get height(){return t()}}),a(e,{get height(){return t()}})]}}),a(N,{style:r,children:"Space Between - No Margin Support"}),a(V,{gap:l,justifyContent:"spaceBetween",style:n,onFocus:s,get children(){return[a(e,{get height(){return t()}}),a(e,{get height(){return t()}}),a(e,{get height(){return t()}}),a(e,{get height(){return t()}}),a(e,{get height(){return t()}})]}}),a(N,{style:r,children:"Space Evenly - No Margin Support"}),a(V,{gap:l,justifyContent:"spaceEvenly",style:n,onFocus:s,get children(){return[a(e,{get height(){return t()}}),a(e,{get height(){return t()}}),a(e,{get height(){return t()}}),a(e,{get height(){return t()}}),a(e,{get height(){return t()}})]}})]}})},Tc=()=>{const n={display:"flex",justifyContent:"spaceEvenly",width:1920,y:100,height:880,color:M("00000000")},r={display:"flex",flexDirection:"column",justifyContent:"flexStart",color:M("#4dabf5"),height:850,width:80},e={fontSize:44,y:20,x:150};function t(d){const h={width:o(),height:80,x:5,color:M("#1769aa")};return a(z,Q(d,{style:h}))}function o(){return Math.floor(Math.random()*61)+10}const[i,s]=W(50);function l(){var d;(d=this.children.selected)==null||d.setFocus(),s(150+(this.y||0)*-1)}tt(()=>{Ne("#333333")});const c=50;return[a(N,{style:e,children:"Start, MarginTop, End, MarginBottom, Center, Between, Evenly"}),a(V,{gap:c,style:n,onFocus:l,get children(){return[a(J,{gap:30,style:r,alignItems:"center",get children(){return[a(t,{autofocus:!0}),a(t,{}),a(t,{}),a(t,{}),a(t,{})]}}),a(J,{gap:c,style:r,onFocus:l,alignItems:"flexStart",get children(){return[a(t,{marginTop:100}),a(t,{}),a(t,{marginTop:100}),a(t,{}),a(t,{})]}}),a(J,{gap:c,alignItems:"flexEnd",justifyContent:"flexEnd",style:r,onFocus:l,get children(){return[a(t,{}),a(t,{}),a(t,{}),a(t,{}),a(t,{})]}}),a(J,{gap:c,justifyContent:"flexEnd",style:r,onFocus:l,get children(){return[a(t,{}),a(t,{marginBottom:100}),a(t,{}),a(t,{}),a(t,{marginBottom:100})]}}),a(J,{gap:c,justifyContent:"center",style:r,onFocus:l,get children(){return[a(t,{}),a(t,{}),a(t,{}),a(t,{}),a(t,{})]}}),a(J,{gap:c,justifyContent:"spaceBetween",style:r,onFocus:l,get children(){return[a(t,{}),a(t,{}),a(t,{}),a(t,{}),a(t,{})]}}),a(J,{gap:c,justifyContent:"spaceEvenly",style:r,onFocus:l,get children(){return[a(t,{}),a(t,{}),a(t,{}),a(t,{}),a(t,{})]}})]}})]},_c=()=>{const n={display:"flex",justifyContent:"spaceEvenly",width:1920,y:100,height:880,color:M("00000000")},r={display:"flex",flexDirection:"column",justifyContent:"flexStart",color:M("#4dabf5"),height:850,width:60},e={fontSize:44,y:20,x:150};function t(c){const d={width:50,height:80,x:5,color:M("#1769aa")};return a(z,Q(c,{style:d}))}const[o,i]=W(50);function s(){var c;(c=this.children.selected)==null||c.setFocus(),i(150+(this.y||0)*-1)}tt(()=>{Ne("#333333")});const l=50;return[a(N,{style:e,children:"Start, MarginTop, End, MarginBottom, Center, Between, Evenly"}),a(V,{gap:l,style:n,onFocus:s,get children(){return[a(J,{gap:30,style:r,get children(){return[a(t,{autofocus:!0}),a(t,{}),a(t,{}),a(t,{}),a(t,{})]}}),a(J,{gap:l,style:r,onFocus:s,get children(){return[a(t,{marginTop:100}),a(t,{}),a(t,{marginTop:100}),a(t,{}),a(t,{})]}}),a(J,{gap:l,justifyContent:"flexEnd",style:r,onFocus:s,get children(){return[a(t,{}),a(t,{}),a(t,{}),a(t,{}),a(t,{})]}}),a(J,{gap:l,justifyContent:"flexEnd",style:r,onFocus:s,get children(){return[a(t,{}),a(t,{marginBottom:100}),a(t,{}),a(t,{}),a(t,{marginBottom:100})]}}),a(J,{gap:l,justifyContent:"center",style:r,onFocus:s,get children(){return[a(t,{}),a(t,{}),a(t,{}),a(t,{}),a(t,{})]}}),a(J,{gap:l,justifyContent:"spaceBetween",style:r,onFocus:s,get children(){return[a(t,{}),a(t,{}),a(t,{}),a(t,{}),a(t,{})]}}),a(J,{gap:l,justifyContent:"spaceEvenly",style:r,onFocus:s,get children(){return[a(t,{}),a(t,{}),a(t,{}),a(t,{}),a(t,{})]}})]}})]},Rc=()=>{function n(i,s){this.states.toggle("disabled")}const r={display:"flex",justifyContent:"flexStart",width:1500,height:300,color:M("00000000"),gap:26,y:400,x:100},e={width:386,height:136,color:"0x715cabff",focus:{color:"0x5a39a2ff"},disabled:{color:"0x291d43ff"}},t=["RoundedRectangle",{radius:65}];function o(i){return a(z,Q(i,{forwardStates:!0,style:e,shader:t,get children(){return a(N,{style:Gl,get children(){return i.children}})}}))}return a(V,{style:r,get children(){return[a(o,{autofocus:!0,onEnter:n,children:"Focused"}),a(o,{states:{active:!0,disabled:!1},children:"Normal"}),a(o,{states:"disabled",children:"Disabled"})]}})},Ic="https://storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd";function Bc(){shaka.polyfill.installAll(),shaka.Player.isBrowserSupported()?kc():console.error("Browser not supported!")}async function kc(){const n=document.getElementById("video"),r=new shaka.Player;await r.attach(n),window.player=r,r.addEventListener("error",Ec);try{await r.load(Ic),console.log("The video has now been loaded!")}catch(e){ri(e)}}function Ec(n){ri(n.detail)}function ri(n){console.error("Error code",n.code,"object",n)}function Fc(){const n=document.getElementById("video");return n.hidden=!1,setTimeout(()=>n.play(),50),n.focus(),n}function Nc(){const n=document.getElementById("video");return n.hidden=!0,n.pause(),n}document.addEventListener("DOMContentLoaded",Bc);const Lc=()=>{const n=cn(),r=pt(),[e]=Ze(()=>({...n}),ti),[t]=Ze(()=>({...n}),yc),[o]=Ze(()=>({...n}),xc),[i,s]=W(0);Ye(He(e,A=>{Ne(A.backgroundImage)},{defer:!0}));const l=600,c={color:M("#000000"),alpha:0,width:1900,height:890,x:10,y:l,borderRadius:30};function d(){var A;(A=this.children.selected)==null||A.setFocus(),m.y=l,w.y=l,w.alpha=0}function h(){var A;(A=this.children.selected)==null||A.setFocus(),m.y=200,w.y=160,w.alpha=.9}function g(){let A=this.children.selected;F(A&&A.href),r(A.href)}function y(){Nc(),document.getElementsByTagName("canvas")[0].focus(),zr(S),s(0)}function b(){const A=Fc();zr(A),s(.9)}let m,w,S;return a(Ie,{get when(){return e()},keyed:!0,get children(){return[a(z,{onUp:()=>S.setFocus(),onEscape:y,get children(){return[a(ei,Q({y:360,x:150},()=>e().heroContent)),a(Zl,{autofocus:!0,ref(A){var p=S;typeof p=="function"?p(A):S=A},y:560,x:150,onDown:()=>m.setFocus(),onEnter:b,children:"Watch Trailer"}),a(J,{ref(A){var p=m;typeof p=="function"?p(A):m=A},y:l,x:140,get style(){return ue.Column},zIndex:5,get children(){return a(Ie,{get when(){return gt(()=>!!o())()&&t()},get children(){return[a(N,{skipFocus:!0,get style(){return ue.RowTitle},children:"Recommendations"}),a(pr,{onFocus:d,onEnter:g,get items(){return o()}}),a(N,{skipFocus:!0,get style(){return ue.RowTitle},children:"Cast and Crew"}),a(pr,{onFocus:h,onEnter:g,get items(){return t()}})]}})}}),a(z,{ref(A){var p=w;typeof p=="function"?p(A):w=A},style:c,transition:{alpha:!0,y:!0}})]}}),a(z,{get alpha(){return i()},get color(){return M("#000000")},zIndex:200,transition:{alpha:!0}})]}})};function Mc({id:n}){return Je.get("/person/".concat(n,"/combined_credits")).then(({cast:r})=>Et(r.slice(0,7)))}function zc({id:n}){return Je.get("/person/".concat(n)).then(r=>({backgroundImage:It(r.profile_path,"original"),heroContent:{title:r.title||r.name,description:r.biography},...r}))}const Pc=()=>{const n=cn(),r=pt(),[e]=Ze(()=>({...n}),zc),[t]=Ze(()=>({...n}),Mc);Ye(He(e,s=>{Ne(s.backgroundImage)},{defer:!0}));const o={color:M("#000000"),alpha:.8,width:1540,height:440,x:130,y:180,borderRadius:30};function i(){let s=this.children.selected;F(s&&s.href),r(s.href)}return a(Ie,{get when(){return e()},keyed:!0,get children(){return[a(z,{x:150,y:200,get style(){return ue.Column},zIndex:3,get children(){return[a(N,{get style(){return f.typography.display2},get children(){return e().name}}),a(N,{get style(){return ue.peopleBio},get children(){return e().biography}})]}}),a(z,{style:o}),a(J,{y:670,x:140,get style(){return ue.Column},get children(){return a(Ie,{get when(){return t()},get children(){return[a(N,{skipFocus:!0,get style(){return ue.RowTitle},children:"Credits"}),a(pr,{autofocus:!0,onEnter:i,get items(){return t()}})]}})}})]}})},Dc=()=>(()=>{var n=zt("node");return Qs(n,"style",{width:1920,height:1080,color:868483072}),n})(),Oc=new URL("AppCoreExtensions-tiD9qKNE.js",import.meta.url).href;Se.debug=!1;Se.animationsEnabled=!0;Se.fontSettings.fontFamily="Ubuntu";Se.fontSettings.color=M("#ffffff");Se.fontSettings.fontSize=100;Se.rendererOptions={coreExtensionModule:Oc,fpsUpdateInterval:1e3,enableInspector:!0};js(()=>a(ba,{root:n=>a(Kl,n),get children(){return[a(he,{path:"",component:to}),a(he,{path:"examples",component:vc}),a(he,{path:"browse/:filter",component:to}),a(he,{path:"text",component:wc}),a(he,{path:"buttons",component:Sc}),a(he,{path:"flex",component:Ac}),a(he,{path:"create",component:bc}),a(he,{path:"flexsize",component:Cc}),a(he,{path:"flexcolumnsize",component:Tc}),a(he,{path:"flexcolumn",component:_c}),a(he,{path:"buttonsmaterial",component:Rc}),a(he,{path:"entity/people/:id",component:Pc}),a(he,{path:"entity/:type/:id",component:Lc}),a(he,{path:"*all",component:Dc})]}}));export{Wc as __vite_legacy_guard}; -//# sourceMappingURL=index-BZ75HCSO.js.map diff --git a/assets/index-BZ75HCSO.js.map b/assets/index-BZ75HCSO.js.map deleted file mode 100644 index 993017b..0000000 --- a/assets/index-BZ75HCSO.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3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,GACR,OAAQ,GACR,OAAQ,EACT,EACD,UAAW,CACT,SAAU,CACR,KAAM,EACN,MAAO,GACP,KAAM,IACN,OAAQ,GACR,KAAM,IACN,MAAO,EACR,EACD,MAAO,CACL,KAAM,EACN,MAAO,IACP,KAAM,KACN,OAAQ,IACR,KAAM,KACN,MAAO,GACR,EACD,WAAY,CACV,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,mBAAoB,CAClB,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,eAAgB,CACd,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,SAAU,CACR,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,iBAAkB,CAChB,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,aAAc,CACZ,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,QAAS,CACP,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,gBAAiB,CACf,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,YAAa,CACX,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,CACF,EACD,MAAO,CACL,UACE,6ZACF,WACE,iZACF,iBACE,ylHACF,MACE,gZACH,EACD,MAAO,CACL,QAAS,CACP,UAAW,aACX,UAAW,aACX,UAAW,aACX,UAAW,aACX,UAAW,aACX,UAAW,aACX,UAAW,YACZ,EACD,MAAO,aACP,MAAO,aACP,KAAM,aACN,IAAK,aACL,OAAQ,aACR,OAAQ,aACR,MAAO,aACP,KAAM,aACN,OAAQ,aACR,SAAU,aACV,cAAe,aACf,QAAS,aACT,YAAa,aACb,qBAAsB,aACtB,oBAAqB,aACrB,oBAAqB,aACrB,YAAa,aACb,qBAAsB,aACtB,oBAAqB,aACrB,oBAAqB,aACrB,UAAW,aACX,mBAAoB,aACpB,kBAAmB,aACnB,kBAAmB,aACnB,aAAc,aACd,aAAc,aACd,SAAU,aACV,YAAa,aACb,gBAAiB,YACjB,YAAa,aACb,qBAAsB,a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AAWogB,GAAW3c,IAC3CgB,GAAK,CAACtH,KAAI,OAAQ6C,UAAWygB,GAAQhd,IACrCgB,GAAK,CAACtH,KAAI,SAAU6C,UAAWgf,GAAUvb,IACzCgB,GAAK,CAACtH,KAAI,WAAY6C,UAAWihB,GAAYxd,IAC7CgB,GAAK,CAACtH,KAAI,iBAAkB6C,UAAW4jB,GAAkBngB,IACzDgB,GAAK,CAACtH,KAAI,aAAc6C,UAAWshB,GAAc7d,IACjDgB,GAAK,CAACtH,KAAI,kBAAmB6C,UAAW6jB,GAAmBpgB,IAC3DgB,GAAK,CAACtH,KAAI,oBAAqB6C,UAAWkjB,GAAMzf,IAChDgB,GAAK,CAACtH,KAAI,mBAAoB6C,UAAWkiB,GAAMze,IAC/CgB,GAAK,CAACtH,KAAI,OAAQ6C,UAAWqjB,EAAQ,MAEzC","names":["equalFn","a","b","$PROXY","$TRACK","signalOptions","runEffects","runQueue","STALE","PENDING","UNOWNED","NO_INIT","Owner","Transition","ExternalSourceConfig","Listener","Updates","Effects","ExecCount","createRoot","fn","detachedOwner","listener","owner","unowned","current","root","updateFn","untrack","cleanNode","runUpdates","createSignal","value","options","s","setter","writeSignal","readSignal","createComputed","c","createComputation","updateComputation","createRenderEffect","createEffect","runUserEffects","createMemo","isPromise","v","createResource","pSource","pFetcher","pOptions","source","fetcher","pr","initP","scheduled","resolved","dynamic","contexts","setValue","error","setError","track","trigger","state","setState","loadEnd","p","key","completeLoad","err","read","SuspenseContext","load","refetching","lookup","e","castError","createSelector","subs","node","val","onCleanup","batch","on","deps","isArray","prevInput","defer","prevValue","input","i","result","onMount","getOwner","runWithOwner","o","prev","prevListener","handleError","startTransition","l","createContext","defaultValue","id","createProvider","useContext","context","children","memo","resolveChildren","updates","lookUpstream","sSlot","isComp","TransitionRunning","markDownstream","time","runComputation","nextValue","init","pure","runTop","ancestors","wait","res","completeUpdates","queue","userLength","ignore","index","obs","n","results","props","FALLBACK","dispose","d","mapArray","list","mapFn","items","mapped","disposers","len","indexes","newItems","j","newLen","newIndices","newIndicesNext","temp","tempdisposers","tempIndexes","start","end","newEnd","item","disposer","mapper","set","createComponent","Comp","trueFn","propTraps","_","property","receiver","resolveSource","resolveSources","length","mergeProps","sources","proxy","keys","sourcesMap","defined","sourceKeys","desc","target","definedKeys","splitProps","blocked","k","otherObject","objects","propName","isDefaultDesc","objectIndex","narrowedError","name","For","fallback","Show","keyed","condition","child","DEV","activeElement","setActiveElement","TextureUsageTracker","releaseCallback","__publicField","ManualCountTextureUsageTracker","_a","_b","now","thresholdMs","textureRefInfo","texture","textureId","assertTruthy","FinalizationRegistryTextureUsageTracker","stylePropertyMap","x","y","w","h","convertColorToRgba","color","g","r","domPropertyMap","Inspector","canvas","settings","isProductionEnvironment","_d","_c","_e","_f","rect","top","left","properties","div","driver","anim","parentId","parent","mappedStyleResponse","duration","delay","width","height","alpha","rotation","scale","animate","ShaderEffect","ref","uniformInfo","passParameters","declaredUniforms","uniforms","u","unif","uniType","uniformName","define","uni","trPropSetterDefaults","TextRenderer","stage","propSetters","status","renderable","eventName","MAX_TEXTURE_DIMENSION","calcHeight","textBaseline","fontSize","lineHeight","numLines","offsetY","baselineOffset","LightningTextTextureRenderer","ff","ffs","fontSetting","renderInfo","precision","paddingLeft","paddingRight","wordWrapWidth","cutSx","cutEx","cutSy","cutEy","letterSpacing","textIndent","innerWidth","suffix","linesInfo","lines","usedLines","otherLines","al","m","maxLineWidth","lineWidths","lineWidth","linesOverride","linePositionX","linePositionY","drawLines","hlHeight","offset","hlPaddingLeft","hlPaddingRight","getRgbaString","drawLine","prevShadowSettings","textSplit","word","suffixWidth","wordLen","wordWidth","cutoffIndex","truncWordWidth","text","indent","allLines","realNewlines","resultLines","spaceLeft","words","wordWidthWithSpace","space","acc","char","resolvedGlobal","globalFontSet","getFontCssString","fontFamily","fontStyle","fontWeight","fontStretch","tmpElementBounds","createBound","CanvasTextRenderer","fontFace","WebTrFontFace","EventEmitter","cssString","maxLines","containedMaxLines","calcMaxLines","getNormalizedRgbaComponents","scrollY","contain","visibleWindow","renderWindow","canvasPages","elementBounds","intersectBound","visibleWindowHeight","maxLinesPerCanvasPage","renderWindowScreenX1","renderWindowScreenY1","renderWindowScreenX2","renderWindowScreenY2","pageHeight","page1Block","page1LineStart","page0LineStart","page2LineStart","scrollYNearestPage","pageInfo","transform","clippingRect","textW","textH","elementRect","intersectRect","pageSize","zIndex","combinedAlpha","getNormalizedAlphaComponent","quadColor","mergeColorAlphaPremultiplied","_h","_g","_j","_i","_l","_k","DefaultShader","WebGlCoreShader","renderer","textures","glw","DefaultShaderBatched","t","samplers","textureUnits","idx","effectCache","getResolvedEffect","effects","effectContructors","effect","_DynamicShader","shader","memize","regEffects","eff","fxClass","uniInfo","fxProp","propInfo","effectNameCount","methods","declareUniforms","uFx","baseClass","nr","effectMethods","fx","fxProps","remap","cm","fxMethod","onShaderMask","onColorize","onEffectMask","reg","methodParameters","pm","sharedMethods","currentMask","drawEffects","currentClass","next","effectMethod","methodCollection","increment","DynamicShader","RoundedRectangle","propsA","propsB","IDENTITY_MATRIX_3x3","_SdfShader","resolvedProps","components","SdfShader","RadiusEffect","BorderEffect","rgba","_LinearGradientEffect","colors","stops","colorsL","tmp","rgbas","amount","loop","LinearGradientEffect","GrayscaleEffect","BorderRightEffect","BorderTopEffect","BorderBottomEffect","BorderLeftEffect","GlitchEffect","FadeOutEffect","_RadialGradientEffect","RadialGradientEffect","RadialProgressEffect","HolePunchEffect","CoreShaderManager","shType","shClass","effectType","effectClass","ShaderClass","cacheKey","ContextSpy","isCompressedTextureContainer","url","loadCompressedTexture","arrayBuffer","loadKTXData","loadPVRData","buffer","view","littleEndian","mipmaps","data","imageSize","header","dataOffset","pvrtcData","level","_ImageTexture","Texture","txManager","mimeType","src","premultiplyAlpha","blob","hasAlphaChannel","img","resolve","reject","ImageTexture","FLOATS_PER_GLYPH","getStartConditions","sdfFontSize","sdfLineHeight","verticalAlign","fontSizeRatio","lineCache","startLineIndex","sdfStartX","sdfVerticalAlignYOffset","sdfStartY","PeekableIterator","iterator","indexBase","nextResult","getUnicodeCodepoints","codePoint","measureText","shaperProps","shaper","glyphs","glyph","layoutText","curLineIndex","startX","startY","textAlign","vertexBuffer","rwSdf","trFontFace","forceFullLayoutCalc","scrollable","overflowSuffix","vertexLineHeight","vertexW","vertexLSpacing","startingLineCacheEntry","startingCodepointIndex","startingMaxX","startingMaxY","maxX","maxY","curX","curY","bufferOffset","lastWord","glyphResult","curLineBufferStart","bufferLineInfos","vertexTruncateHeight","overflowSuffVertexWidth","moreLines","nextLineWillFit","lineVertexW","xStartLastWordBoundary","lineIsBelowWindowTop","lineIsAboveWindowBottom","lineIsWithinWindow","charEndX","quadX","quadY","atlasEntry","uvWidth","uvHeight","vertexTextW","line","xOffset","roundUpToMultiple","multiple","roundDownToMultiple","setRenderWindow","outRenderWindow","bufferMargin","screen","sdf","isBoundPositive","x1","x2","y1Base","y1","y2","weightConversions","fontWeightToNumber","weight","rawResolveFontToUse","familyMapsByPriority","family","weightIn","style","stretch","fontFamiles","fontFaces","weightMap","fontFamilyWeight","msg","resolveFontToUse","TrFontManager","textRenderers","font","trId","tr","tmpRect","SdfTextRenderer","boundsOverlap","SdfTrFontFace","familyName","faceSet","debugData","neededLength","rwScreen","out2","debug","distanceRange","bufferUploaded","webGlBuffers","stride","webGlBuffer","BufferCollection","convertBoundToRect","copyRect","renderOp","WebGlCoreRenderOp","mergeColorAlpha","ctxTexture","classExtendsCoreExtension","Class","CoreExtension","loadCoreExtension","coreExtensionModule","module","__vitePreload","ExtensionClass","coreExtension","santizeCustomDataMap","validTypes","valueType","RendererMain","resolvedSettings","appWidth","appHeight","deviceLogicalPixelRatio","devicePhysicalPixelRatio","enableInspector","useFinalizationRegistryTracker","deviceLogicalWidth","deviceLogicalHeight","targetEl","fpsData","frameTickData","_m","_n","_o","_p","_q","_r","_s","colorTl","colorTr","colorBl","colorBr","_t","_u","_v","_w","_x","_y","_z","_A","_B","_C","_D","_E","_G","_F","_I","_H","_J","_L","_K","_N","_M","_O","_Q","_P","_S","_R","_T","textureType","shaderType","CoreAnimation","getTimingFunction","startValue","endValue","dt","easing","stopMethod","propValue","easingProgressValue","easingColorValue","mergeColorProgress","CoreAnimationController","manager","animation","promise","m0","m1","m2","m3","m4","m5","m6","m7","m8","Matrix3d","entries","tempMatrix","out","e0","e1","e2","e3","e4","e5","e6","e7","e8","sx","sy","angle","cos","sin","dst","transpose","other","rx1","rx2","rx3","rx4","ry1","ry2","ry3","ry4","RenderCoords","x3","y3","x4","y4","CoreNodeRenderState","CoreNodeRenderStateMap","UpdateType","CoreNode","dimensions","shManager","type","pivotTranslateX","pivotTranslateY","mountTranslateX","mountTranslateY","delta","parentClippingRect","childUpdateType","rectW","rectH","renderM","boundInsideBound","renderState","previous","event","newIsRenderable","isRenderable","tx","ty","ta","tb","tc","td","minX","minY","renderCoords","gt","clipping","isRotated","z","textureOptions","shaderProps","premultipliedColorTl","premultipliedColorTr","premultipliedColorBl","premultipliedColorBr","worldAlpha","newParent","oldParent","nextId","getNewId","MainOnlyNode","rendererMain","coreNode","payload","imageUrl","startLoop","isIdle","runLoop","getTimeStamp","AnimationManager","ImageWorkerManager","numImageWorkers","worker","numWorkers","workerCode","blobURL","workers","absoluteSrcUrl","_NoiseTexture","size","pixelData8","NoiseTexture","CoreTextureManager","ColorTexture","SubTexture","textureClass","TextureClass","descId","textureDescId","textureIdCache","textureRefCountMap","refCountObj","textureSource","TextureMemoryManager","byteThreshold","byteSize","bufferMemory","Stage","clearColor","rootId","boundsMargin","enableContextSpy","txMemByteThreshold","bm","debugInfo","WebGlCoreRenderer","rootNode","animationManager","renderRequested","fpsUpdateInterval","fps","trProps","textRendererOverride","rendererId","overrideFallback","possibleRenderer","resolvedTextRenderer","CoreTextNode","setWidth","setHeight","calcWidth","textRendererState","MainOnlyTextNode","MainCoreDriver","rendererSettings","createShader","startLightningRenderer","Children","beforeNode","nodeIndexToRemove","isDevEnv","isDev","config","hasDebug","isObject","log","args","isFunc","isString","isNumber","isInteger","keyExists","obj","flattenStyles","States","callback","initialState","_key","stateIndexToRemove","calculateFlex","numChildren","isRow","dimension","crossDimension","marginOne","marginTwo","prop","crossProp","containerSize","containerCrossSize","gap","justify","align","itemSize","crossAlignChild","calculatedSize","toPad","defaultAnimationSettings","convertEffectsToShader","styleEffects","borderAccessor","direction","LightningRendererNumberProps","LightningRendererNonAnimatingProps","ElementNode","radius","animationSettings","focusedIndex","_node","loadedPayload","values","found","states","stylesToUndo","styleKey","newStyles","styles","Text","_el$","_$createElement","View","createRenderer$1","createElement","createTextNode","isTextNode","replaceText","insertNode","removeNode","setProperty","getParentNode","getFirstChild","getNextSibling","insert","accessor","marker","initial","insertExpression","unwrapArray","multi","cleanChildren","array","normalizeIncomingArray","replacement","appendNodes","reconcileArrays","replaceNode","normalized","unwrap","parentNode","bLength","aEnd","bEnd","aStart","bStart","after","map","sequence","removed","inserted","el","isParent","newNode","oldNode","spreadExpression","prevProps","skipChildren","code","element","arg","createRenderer","universalLightning","anchor","solidRenderer","render","spread","setProp","use","hexColor","$$EVENTS","delegateEvents","eventNames","document","eventHandler","handler","isServer","createBeforeLeave","listeners","subscribe","confirm","to","force","depth","saveCurrentDepth","keepDepth","notifyIfNotBlocked","notify","block","prevDepth","hasSchemeRegex","trimPathRegex","mockBase","normalizePath","path","omitSlash","resolvePath","base","from","basePath","fromPath","invariant","message","joinPaths","extractSearchParams","params","createMatcher","partial","matchFilters","pattern","splat","segments","location","locSegments","lenDiff","match","matchFilter","segment","locSegment","matchSegment","remainder","filter","isEqual","scoreRoute","route","score","createMemoObject","expandOptionals","prefix","prefixes","expansion","MAX_REDIRECTS","RouterContextObj","RouteContextObj","useRouter","useNavigate","useParams","createRoutes","routeDef","component","info","isLeaf","shared","asArray","originalPath","createBranch","routes","matches","createBranches","stack","branches","routeDefs","def","isEmptyArray","branch","getRouteMatches","createLocation","origin","path_","pathname","search","hash","intent","createRouterContext","integration","getContext","setSource","utils","parsePath","renderPath","beforeLeave","isRouting","setIsRouting","reference","setReference","referrers","submissions","baseRoute","navigatorFactory","preloadRoute","navigateFromRoute","replace","scroll","nextState","resolvedTo","navigateEnd","first","preloadData","prevIntent","createRouteContext","router","outlet","createRouterComponent","routerState","singleFlight","create","_$createComponent","Provider","Root","rootLoad","_$memo","Routes","when","routeStates","nextMatches","prevMatches","equal","prevMatch","nextMatch","createOutlet","splice","forEach","Route","childRoutes","intercept","get","querySelector","selector","createRouter","wrap","signal","bindEvent","scrollToHash","fallbackTop","actions","setupNativeEvents","preload","explicitLinks","actionBase","preloadTimeout","isSvg","handleAnchor","evt","svg","href","rel","handleAnchorClick","handleAnchorPreload","handleAnchorIn","handleAnchorOut","handleFormSubmit","actionRef","hashParser","str","HashRouter","getSource","hashIndex","tryOnCleanup","makeEventListener","createSingletonRoot","factory","disposeRoot","useKeyDownEvent","setEvent","keyMapEntries","focusPath","setFocusPath","useFocusManager","userKeyMap","keypressEvent","currentFocusedElm","prevFocusedElm","prevFocusPath","fp","elm","mappedKeyEvent","finalFocusElm","onKeyHandler","withPadding","padding","pad","right","bottom","firstChild","maxHeight","flattenStrings","series","flattenedSeries","pause","speak","phrase","utterances","lang","synth","utterance","speakSeries","remainingPhrases","nestedSeriesResults","active","retriesLeft","seriesResult","toSpeak","currentSeries","SpeechEngine","debounce","timeoutId","clear","resetFocusPathTimer","currentlySpeaking","voiceOutDisabled","fiveMinutes","debounceWithFlush","scopedValue","debounced","newValue","getElmName","onFocusChangeCore","Announcer","loaded","focusDiff","toAnnounceText","toAnnounce","textToSpeech","append","notification","focusDebounce","focusChangeTimeout","useAnnouncer","createSpriteMap","subTextures","spriteMapTexture","globalBackground","setGlobalBackground","theme","Background","bg1","bg2","bgStyles","changeBackgrounds","startsWith","delayedBackgrounds","r$","_ref$","_ref$2","materialBrand","defaultModeKeys","defaultToneKeys","makeComponentStyles","themeKeys","modes","tones","themeStyles2","modeKeys","toneKeys","makeToneStyles","tones2","themeComponentStyles","modeStyles","toneStyles","tone","styles2","_a2","_b2","mode","makeModeStyles","modes2","makeBaseStyles","base2","mapThemeKeysToSolid","stylesToMap","themeKey","solidKey","convertComponentConfig","themeStyles3","variantName","convertedStyles","styleName","modeName","baseStyles","withScrolling","adjustment","componentRef","selectedElement","selected","lastSelected","lastItem","windowVal","updateLastIndex","currentVal","newVal","size2","direct","chainFunctions","onlyFunctions","func","innerArgs","onGridFocus","handleNavigation","num","defaultTone$e","themeStyles$d","container$e","defaultTone$d","themeStyles$c","container$d","defaultTone$c","themeStyles$b","container$c","text$6","icon$2","defaultTone$b","themeStyles$a","container$b","content","text$5","defaultTone$a","themeStyles$9","strokeWidth","container$a","icon$1","defaultTone$9","themeStyles$8","container$9","Container$9","styles$9","Column","onUp","onDown","defaultTone$8","themeStyles$7","container$8","text$4","themeStyles$6","defaultTone$7","container$7","text$3","icon","defaultTone$6","themeStyles$5","container$6","text$2","defaultTone$5","themeStyles$4","container$5","titleText","descriptionText","defaultTone$4","themeStyles$3","container$4","progress","defaultTone$3","themeStyles$2","container$3","Container$3","styles$3","Row","onLeft","onRight","defaultTone$2","themeStyles$1","container$2","text$1","defaultTone$1","themeStyles","container$1","defaultTone","tileThemeStyles","defaultSurfaceTone","surfaceThemeStyles","container","insetBottom","standardBottom","logoContainer","styles$1","import","icons","Icon","sprite","_$mergeProps","NavButton","forwardStates","typography","button1","NavDrawer","backdrop","navigate","onFocus","add","setFocus","onBlur","remove","onEnter","Gradient","fpsStyle","fpsLabel","textColor","fpsValue","setFps","avgFps","setAvgFps","minFps","setMinFps","maxFps","setMaxFps","count","totalFps","resetCounter","calcFps","Math","min","max","round","setupFPS","FPSCounter","toString","App","Menu","Escape","announcer","enabled","focusRingRef","navDrawer","lastFocused","onAnnouncer","onLast","history","back","onMenu","has","Button","TopBar","ButtonText","buttonStyles","MaterialButton","MaterialButtonText","Thumbnail","TileRow","local","others","each","API_KEY_V4","API_BASE","tmdbConfig","baseImageUrl","basePosterSize","defaultFetchParams","getImageUrl","posterSize","_get","loadConfig","api","truncateString","maxLength","chunkArray","convertItemsToTiles","cache","leftoverTiles","browseProvider","pageIndex","trending","tiles","chunks","createInfiniteScroll","pages","setPages","page","setPage","setEnd","contents","blockWidth","HeadlineStyles","display2","Headline","DescriptionStyles","body1","BadgeStyle","Description","getReviews","reviews","rtCrit","title","marginRight","MetaTextStyle","rtFan","Badge","borderRadius","border","body2","Metadata","display","flexDirection","metaText","badges","ContentBlock","description","minutesToHMM","minutes","hours","remainingMinutes","justYear","dateString","getRecommendations","getCredits","cast","getInfo","rt","Browse","columnY","setcolumnY","entityInfo","setEntityInfo","entityProvider","heroContent","setHeroContent","isFirst","provider","onRowFocus","numPages","entity","itemsContainer","plinko","announce","autofocus","Portal","demos","DemoTile","Container","transition","focus","setColor","rowX","setRowX","moveRow","row","colorTop","colorBottom","onSelectedChanged","justifyContent","demo","TextPage","OverviewContainer","SublineContainer","Title","Overview","Subline","CreatePage","myBox","childRef","insertTest","setInsertTest","emptyTest","setEmptyTest","setTimeout","getChildById","styleChild","someOtherStyle","ChildTest","borderStyles","borderLeft","borderTop","borderRight","borderBottom","childTestPassedStyles","childTestPassedStyles2","hasFocus","ButtonsPage","toggle","RowStyles","_$use","disabled","FlexPage","rowTitle","marginTop","marginBottom","skipFocus","Block","setColumnY","marginLeft","FlexSizePage","randSize","floor","random","alignItems","FlexColumnPage","ColumnStyles","MaterialButtonsPage","manifestUri","initApp","initPlayer","video","player","onErrorEvent","onError","playVideo","closeVideo","Entity","credits","recommendations","backdropAlpha","setBackdropAlpha","backgroundImage","Backdrop","columnRef","backdropRef","onRowFocusAnimate","onEscape","getElementsByTagName","trailerButton","onEnterTrailer","RowTitle","_ref$3","People","peopleBio","biography","NotFound","_$setProp","coreExtensionModuleUrl","Config","animationsEnabled","fontSettings","rendererOptions","FlexColumnSizePage","ButtonsMaterialPage"],"ignoreList":[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,95,97],"sources":["../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/dist/solid.js","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.0_@babel+core@7.24.3_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.3_vite@5.2.6/node_modules/@lightningjs/solid/src/core/activeElement.ts","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/main-api/texture-usage-trackers/TextureUsageTracker.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/main-api/texture-usage-trackers/ManualCountTextureUsageTracker.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/main-api/texture-usage-trackers/FinalizationRegistryTextureUsageTracker.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/main-api/Inspector.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/ShaderEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/TextRenderer.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/LightningTextTextureRenderer.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/CanvasTextRenderer.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/DefaultShader.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/DefaultShaderBatched.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/DynamicShader.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/RoundedRectangle.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/SdfShader.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/RadiusEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/BorderEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/LinearGradientEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/GrayscaleEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/BorderRightEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/BorderTopEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/BorderBottomEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/BorderLeftEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/GlitchEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/FadeOutEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/RadialGradientEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/RadialProgressEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/HolePunchEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/CoreShaderManager.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/lib/ContextSpy.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/lib/textureCompression.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/textures/ImageTexture.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/constants.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/getStartConditions.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/PeekableGenerator.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/getUnicodeCodepoints.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/measureText.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/layoutText.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/util.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/setRenderWindow.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/TrFontManager.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/SdfTextRenderer.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/render-drivers/utils.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/main-api/RendererMain.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/animations/CoreAnimation.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/animations/CoreAnimationController.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/lib/Matrix3d.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/lib/RenderCoords.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/CoreNode.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/render-drivers/main/MainOnlyNode.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/platform.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/animations/AnimationManager.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/lib/ImageWorker.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/textures/NoiseTexture.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/CoreTextureManager.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/TextureMemoryManager.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/Stage.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/CoreTextNode.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/render-drivers/main/MainOnlyTextNode.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/render-drivers/main/MainCoreDriver.js","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.0_@babel+core@7.24.3_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.3_vite@5.2.6/node_modules/@lightningjs/solid/src/core/lightningInit.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.0_@babel+core@7.24.3_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.3_vite@5.2.6/node_modules/@lightningjs/solid/src/core/node/children.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.0_@babel+core@7.24.3_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.3_vite@5.2.6/node_modules/@lightningjs/solid/src/config.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.0_@babel+core@7.24.3_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.3_vite@5.2.6/node_modules/@lightningjs/solid/src/core/utils.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.0_@babel+core@7.24.3_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.3_vite@5.2.6/node_modules/@lightningjs/solid/src/core/node/states.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.0_@babel+core@7.24.3_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.3_vite@5.2.6/node_modules/@lightningjs/solid/src/core/flex.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.0_@babel+core@7.24.3_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.3_vite@5.2.6/node_modules/@lightningjs/solid/src/core/node/index.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.0_@babel+core@7.24.3_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.3_vite@5.2.6/node_modules/@lightningjs/solid/src/components/Text.tsx","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.0_@babel+core@7.24.3_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.3_vite@5.2.6/node_modules/@lightningjs/solid/src/components/View.tsx","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/universal/dist/universal.js","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.0_@babel+core@7.24.3_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.3_vite@5.2.6/node_modules/@lightningjs/solid/src/core/solidUniversal.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.0_@babel+core@7.24.3_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.3_vite@5.2.6/node_modules/@lightningjs/solid/src/core/render.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.0_@babel+core@7.24.3_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.3_vite@5.2.6/node_modules/@lightningjs/solid/src/utils.ts","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/web/dist/web.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/lifecycle.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/utils.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routing.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/components.jsx","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/createRouter.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/data/action.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/data/events.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/HashRouter.js","../../../../node_modules/.pnpm/@solid-primitives+utils@6.2.3_solid-js@1.8.16/node_modules/@solid-primitives/utils/dist/chunk/R5675YMU.js","../../../../node_modules/.pnpm/@solid-primitives+event-listener@2.3.3_solid-js@1.8.16/node_modules/@solid-primitives/event-listener/dist/index.js","../../../../node_modules/.pnpm/@solid-primitives+rootless@1.4.5_solid-js@1.8.16/node_modules/@solid-primitives/rootless/dist/index.js","../../../../node_modules/.pnpm/@solid-primitives+keyboard@1.2.8_solid-js@1.8.16/node_modules/@solid-primitives/keyboard/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.1_@lightningjs+solid@0.15.0_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/utils.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.1_@lightningjs+solid@0.15.0_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/useFocusManager.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.1_@lightningjs+solid@0.15.0_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/withPadding.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.1_@lightningjs+solid@0.15.0_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/speech.js","../../../../node_modules/.pnpm/@solid-primitives+scheduled@1.4.3_solid-js@1.8.16/node_modules/@solid-primitives/scheduled/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.1_@lightningjs+solid@0.15.0_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/announcer.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.1_@lightningjs+solid@0.15.0_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.1_@lightningjs+solid@0.15.0_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/createSpriteMap.js","../../src/state.ts","../../../../node_modules/.pnpm/@lightningjs+l3-ui-theme-base@0.3.1/node_modules/@lightningjs/l3-ui-theme-base/theme.js","../../src/components/Background.tsx","../../../../node_modules/.pnpm/@lightningjs+solid-ui@0.6.0_@babel+core@7.24.3_@lightningjs+renderer@0.8.1_@lightningjs+solid_luusdtwj6vhbqnm2jlt3u2tuhm/node_modules/@lightningjs/solid-ui/dist/index.js","../../src/components/NavDrawer/NavDrawer.styles.ts","../../src/components/Icon.tsx","../../src/components/NavDrawer/NavDrawer.tsx","../../src/components/FPSCounter.tsx","../../src/pages/App.tsx","../../src/styles.ts","../../src/components/index.tsx","../../src/api/key.ts","../../src/api/index.ts","../../src/api/formatters/ItemFormatter.ts","../../src/api/providers/browse.ts","../../src/components/pagination.ts","../../src/components/ContentBlock.tsx","../../src/api/providers/entity.js","../../src/pages/Browse.tsx","../../src/pages/Portal.tsx","../../src/pages/Text.tsx","../../src/pages/Create.tsx","../../src/pages/Buttons.tsx","../../src/pages/Flex.tsx","../../src/pages/FlexSize.tsx","../../src/pages/FlexColumnSize.tsx","../../src/pages/FlexColumn.tsx","../../src/pages/ButtonsMaterial.tsx","../../src/video.js","../../src/pages/Entity.tsx","../../src/api/providers/people.js","../../src/pages/People.tsx","../../src/pages/NotFound.tsx","../../AppCoreExtensions.js?importChunkUrl","../../src/index.tsx"],"sourcesContent":["let taskIdCounter = 1,\n isCallbackScheduled = false,\n isPerformingWork = false,\n taskQueue = [],\n currentTask = null,\n shouldYieldToHost = null,\n yieldInterval = 5,\n deadline = 0,\n maxYieldInterval = 300,\n scheduleCallback = null,\n scheduledCallback = null;\nconst maxSigned31BitInt = 1073741823;\nfunction setupScheduler() {\n const channel = new MessageChannel(),\n port = channel.port2;\n scheduleCallback = () => port.postMessage(null);\n channel.port1.onmessage = () => {\n if (scheduledCallback !== null) {\n const currentTime = performance.now();\n deadline = currentTime + yieldInterval;\n const hasTimeRemaining = true;\n try {\n const hasMoreWork = scheduledCallback(hasTimeRemaining, currentTime);\n if (!hasMoreWork) {\n scheduledCallback = null;\n } else port.postMessage(null);\n } catch (error) {\n port.postMessage(null);\n throw error;\n }\n }\n };\n if (navigator && navigator.scheduling && navigator.scheduling.isInputPending) {\n const scheduling = navigator.scheduling;\n shouldYieldToHost = () => {\n const currentTime = performance.now();\n if (currentTime >= deadline) {\n if (scheduling.isInputPending()) {\n return true;\n }\n return currentTime >= maxYieldInterval;\n } else {\n return false;\n }\n };\n } else {\n shouldYieldToHost = () => performance.now() >= deadline;\n }\n}\nfunction enqueue(taskQueue, task) {\n function findIndex() {\n let m = 0;\n let n = taskQueue.length - 1;\n while (m <= n) {\n const k = (n + m) >> 1;\n const cmp = task.expirationTime - taskQueue[k].expirationTime;\n if (cmp > 0) m = k + 1;\n else if (cmp < 0) n = k - 1;\n else return k;\n }\n return m;\n }\n taskQueue.splice(findIndex(), 0, task);\n}\nfunction requestCallback(fn, options) {\n if (!scheduleCallback) setupScheduler();\n let startTime = performance.now(),\n timeout = maxSigned31BitInt;\n if (options && options.timeout) timeout = options.timeout;\n const newTask = {\n id: taskIdCounter++,\n fn,\n startTime,\n expirationTime: startTime + timeout\n };\n enqueue(taskQueue, newTask);\n if (!isCallbackScheduled && !isPerformingWork) {\n isCallbackScheduled = true;\n scheduledCallback = flushWork;\n scheduleCallback();\n }\n return newTask;\n}\nfunction cancelCallback(task) {\n task.fn = null;\n}\nfunction flushWork(hasTimeRemaining, initialTime) {\n isCallbackScheduled = false;\n isPerformingWork = true;\n try {\n return workLoop(hasTimeRemaining, initialTime);\n } finally {\n currentTask = null;\n isPerformingWork = false;\n }\n}\nfunction workLoop(hasTimeRemaining, initialTime) {\n let currentTime = initialTime;\n currentTask = taskQueue[0] || null;\n while (currentTask !== null) {\n if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {\n break;\n }\n const callback = currentTask.fn;\n if (callback !== null) {\n currentTask.fn = null;\n const didUserCallbackTimeout = currentTask.expirationTime <= currentTime;\n callback(didUserCallbackTimeout);\n currentTime = performance.now();\n if (currentTask === taskQueue[0]) {\n taskQueue.shift();\n }\n } else taskQueue.shift();\n currentTask = taskQueue[0] || null;\n }\n return currentTask !== null;\n}\n\nconst sharedConfig = {\n context: undefined,\n registry: undefined\n};\nfunction setHydrateContext(context) {\n sharedConfig.context = context;\n}\nfunction nextHydrateContext() {\n return {\n ...sharedConfig.context,\n id: `${sharedConfig.context.id}${sharedConfig.context.count++}-`,\n count: 0\n };\n}\n\nconst equalFn = (a, b) => a === b;\nconst $PROXY = Symbol(\"solid-proxy\");\nconst $TRACK = Symbol(\"solid-track\");\nconst $DEVCOMP = Symbol(\"solid-dev-component\");\nconst signalOptions = {\n equals: equalFn\n};\nlet ERROR = null;\nlet runEffects = runQueue;\nconst STALE = 1;\nconst PENDING = 2;\nconst UNOWNED = {\n owned: null,\n cleanups: null,\n context: null,\n owner: null\n};\nconst NO_INIT = {};\nvar Owner = null;\nlet Transition = null;\nlet Scheduler = null;\nlet ExternalSourceConfig = null;\nlet Listener = null;\nlet Updates = null;\nlet Effects = null;\nlet ExecCount = 0;\nfunction createRoot(fn, detachedOwner) {\n const listener = Listener,\n owner = Owner,\n unowned = fn.length === 0,\n current = detachedOwner === undefined ? owner : detachedOwner,\n root = unowned\n ? UNOWNED\n : {\n owned: null,\n cleanups: null,\n context: current ? current.context : null,\n owner: current\n },\n updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root)));\n Owner = root;\n Listener = null;\n try {\n return runUpdates(updateFn, true);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n}\nfunction createSignal(value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const s = {\n value,\n observers: null,\n observerSlots: null,\n comparator: options.equals || undefined\n };\n const setter = value => {\n if (typeof value === \"function\") {\n if (Transition && Transition.running && Transition.sources.has(s)) value = value(s.tValue);\n else value = value(s.value);\n }\n return writeSignal(s, value);\n };\n return [readSignal.bind(s), setter];\n}\nfunction createComputed(fn, value, options) {\n const c = createComputation(fn, value, true, STALE);\n if (Scheduler && Transition && Transition.running) Updates.push(c);\n else updateComputation(c);\n}\nfunction createRenderEffect(fn, value, options) {\n const c = createComputation(fn, value, false, STALE);\n if (Scheduler && Transition && Transition.running) Updates.push(c);\n else updateComputation(c);\n}\nfunction createEffect(fn, value, options) {\n runEffects = runUserEffects;\n const c = createComputation(fn, value, false, STALE),\n s = SuspenseContext && useContext(SuspenseContext);\n if (s) c.suspense = s;\n if (!options || !options.render) c.user = true;\n Effects ? Effects.push(c) : updateComputation(c);\n}\nfunction createReaction(onInvalidate, options) {\n let fn;\n const c = createComputation(\n () => {\n fn ? fn() : untrack(onInvalidate);\n fn = undefined;\n },\n undefined,\n false,\n 0\n ),\n s = SuspenseContext && useContext(SuspenseContext);\n if (s) c.suspense = s;\n c.user = true;\n return tracking => {\n fn = tracking;\n updateComputation(c);\n };\n}\nfunction createMemo(fn, value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const c = createComputation(fn, value, true, 0);\n c.observers = null;\n c.observerSlots = null;\n c.comparator = options.equals || undefined;\n if (Scheduler && Transition && Transition.running) {\n c.tState = STALE;\n Updates.push(c);\n } else updateComputation(c);\n return readSignal.bind(c);\n}\nfunction isPromise(v) {\n return v && typeof v === \"object\" && \"then\" in v;\n}\nfunction createResource(pSource, pFetcher, pOptions) {\n let source;\n let fetcher;\n let options;\n if ((arguments.length === 2 && typeof pFetcher === \"object\") || arguments.length === 1) {\n source = true;\n fetcher = pSource;\n options = pFetcher || {};\n } else {\n source = pSource;\n fetcher = pFetcher;\n options = pOptions || {};\n }\n let pr = null,\n initP = NO_INIT,\n id = null,\n loadedUnderTransition = false,\n scheduled = false,\n resolved = \"initialValue\" in options,\n dynamic = typeof source === \"function\" && createMemo(source);\n const contexts = new Set(),\n [value, setValue] = (options.storage || createSignal)(options.initialValue),\n [error, setError] = createSignal(undefined),\n [track, trigger] = createSignal(undefined, {\n equals: false\n }),\n [state, setState] = createSignal(resolved ? \"ready\" : \"unresolved\");\n if (sharedConfig.context) {\n id = `${sharedConfig.context.id}${sharedConfig.context.count++}`;\n let v;\n if (options.ssrLoadFrom === \"initial\") initP = options.initialValue;\n else if (sharedConfig.load && (v = sharedConfig.load(id))) initP = v;\n }\n function loadEnd(p, v, error, key) {\n if (pr === p) {\n pr = null;\n key !== undefined && (resolved = true);\n if ((p === initP || v === initP) && options.onHydrated)\n queueMicrotask(() =>\n options.onHydrated(key, {\n value: v\n })\n );\n initP = NO_INIT;\n if (Transition && p && loadedUnderTransition) {\n Transition.promises.delete(p);\n loadedUnderTransition = false;\n runUpdates(() => {\n Transition.running = true;\n completeLoad(v, error);\n }, false);\n } else completeLoad(v, error);\n }\n return v;\n }\n function completeLoad(v, err) {\n runUpdates(() => {\n if (err === undefined) setValue(() => v);\n setState(err !== undefined ? \"errored\" : resolved ? \"ready\" : \"unresolved\");\n setError(err);\n for (const c of contexts.keys()) c.decrement();\n contexts.clear();\n }, false);\n }\n function read() {\n const c = SuspenseContext && useContext(SuspenseContext),\n v = value(),\n err = error();\n if (err !== undefined && !pr) throw err;\n if (Listener && !Listener.user && c) {\n createComputed(() => {\n track();\n if (pr) {\n if (c.resolved && Transition && loadedUnderTransition) Transition.promises.add(pr);\n else if (!contexts.has(c)) {\n c.increment();\n contexts.add(c);\n }\n }\n });\n }\n return v;\n }\n function load(refetching = true) {\n if (refetching !== false && scheduled) return;\n scheduled = false;\n const lookup = dynamic ? dynamic() : source;\n loadedUnderTransition = Transition && Transition.running;\n if (lookup == null || lookup === false) {\n loadEnd(pr, untrack(value));\n return;\n }\n if (Transition && pr) Transition.promises.delete(pr);\n const p =\n initP !== NO_INIT\n ? initP\n : untrack(() =>\n fetcher(lookup, {\n value: value(),\n refetching\n })\n );\n if (!isPromise(p)) {\n loadEnd(pr, p, undefined, lookup);\n return p;\n }\n pr = p;\n if (\"value\" in p) {\n if (p.status === \"success\") loadEnd(pr, p.value, undefined, lookup);\n else loadEnd(pr, undefined, undefined, lookup);\n return p;\n }\n scheduled = true;\n queueMicrotask(() => (scheduled = false));\n runUpdates(() => {\n setState(resolved ? \"refreshing\" : \"pending\");\n trigger();\n }, false);\n return p.then(\n v => loadEnd(p, v, undefined, lookup),\n e => loadEnd(p, undefined, castError(e), lookup)\n );\n }\n Object.defineProperties(read, {\n state: {\n get: () => state()\n },\n error: {\n get: () => error()\n },\n loading: {\n get() {\n const s = state();\n return s === \"pending\" || s === \"refreshing\";\n }\n },\n latest: {\n get() {\n if (!resolved) return read();\n const err = error();\n if (err && !pr) throw err;\n return value();\n }\n }\n });\n if (dynamic) createComputed(() => load(false));\n else load(false);\n return [\n read,\n {\n refetch: load,\n mutate: setValue\n }\n ];\n}\nfunction createDeferred(source, options) {\n let t,\n timeout = options ? options.timeoutMs : undefined;\n const node = createComputation(\n () => {\n if (!t || !t.fn)\n t = requestCallback(\n () => setDeferred(() => node.value),\n timeout !== undefined\n ? {\n timeout\n }\n : undefined\n );\n return source();\n },\n undefined,\n true\n );\n const [deferred, setDeferred] = createSignal(\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,\n options\n );\n updateComputation(node);\n setDeferred(() =>\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value\n );\n return deferred;\n}\nfunction createSelector(source, fn = equalFn, options) {\n const subs = new Map();\n const node = createComputation(\n p => {\n const v = source();\n for (const [key, val] of subs.entries())\n if (fn(key, v) !== fn(key, p)) {\n for (const c of val.values()) {\n c.state = STALE;\n if (c.pure) Updates.push(c);\n else Effects.push(c);\n }\n }\n return v;\n },\n undefined,\n true,\n STALE\n );\n updateComputation(node);\n return key => {\n const listener = Listener;\n if (listener) {\n let l;\n if ((l = subs.get(key))) l.add(listener);\n else subs.set(key, (l = new Set([listener])));\n onCleanup(() => {\n l.delete(listener);\n !l.size && subs.delete(key);\n });\n }\n return fn(\n key,\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value\n );\n };\n}\nfunction batch(fn) {\n return runUpdates(fn, false);\n}\nfunction untrack(fn) {\n if (!ExternalSourceConfig && Listener === null) return fn();\n const listener = Listener;\n Listener = null;\n try {\n if (ExternalSourceConfig) return ExternalSourceConfig.untrack(fn);\n return fn();\n } finally {\n Listener = listener;\n }\n}\nfunction on(deps, fn, options) {\n const isArray = Array.isArray(deps);\n let prevInput;\n let defer = options && options.defer;\n return prevValue => {\n let input;\n if (isArray) {\n input = Array(deps.length);\n for (let i = 0; i < deps.length; i++) input[i] = deps[i]();\n } else input = deps();\n if (defer) {\n defer = false;\n return prevValue;\n }\n const result = untrack(() => fn(input, prevInput, prevValue));\n prevInput = input;\n return result;\n };\n}\nfunction onMount(fn) {\n createEffect(() => untrack(fn));\n}\nfunction onCleanup(fn) {\n if (Owner === null);\n else if (Owner.cleanups === null) Owner.cleanups = [fn];\n else Owner.cleanups.push(fn);\n return fn;\n}\nfunction catchError(fn, handler) {\n ERROR || (ERROR = Symbol(\"error\"));\n Owner = createComputation(undefined, undefined, true);\n Owner.context = {\n ...Owner.context,\n [ERROR]: [handler]\n };\n if (Transition && Transition.running) Transition.sources.add(Owner);\n try {\n return fn();\n } catch (err) {\n handleError(err);\n } finally {\n Owner = Owner.owner;\n }\n}\nfunction getListener() {\n return Listener;\n}\nfunction getOwner() {\n return Owner;\n}\nfunction runWithOwner(o, fn) {\n const prev = Owner;\n const prevListener = Listener;\n Owner = o;\n Listener = null;\n try {\n return runUpdates(fn, true);\n } catch (err) {\n handleError(err);\n } finally {\n Owner = prev;\n Listener = prevListener;\n }\n}\nfunction enableScheduling(scheduler = requestCallback) {\n Scheduler = scheduler;\n}\nfunction startTransition(fn) {\n if (Transition && Transition.running) {\n fn();\n return Transition.done;\n }\n const l = Listener;\n const o = Owner;\n return Promise.resolve().then(() => {\n Listener = l;\n Owner = o;\n let t;\n if (Scheduler || SuspenseContext) {\n t =\n Transition ||\n (Transition = {\n sources: new Set(),\n effects: [],\n promises: new Set(),\n disposed: new Set(),\n queue: new Set(),\n running: true\n });\n t.done || (t.done = new Promise(res => (t.resolve = res)));\n t.running = true;\n }\n runUpdates(fn, false);\n Listener = Owner = null;\n return t ? t.done : undefined;\n });\n}\nconst [transPending, setTransPending] = /*@__PURE__*/ createSignal(false);\nfunction useTransition() {\n return [transPending, startTransition];\n}\nfunction resumeEffects(e) {\n Effects.push.apply(Effects, e);\n e.length = 0;\n}\nfunction createContext(defaultValue, options) {\n const id = Symbol(\"context\");\n return {\n id,\n Provider: createProvider(id),\n defaultValue\n };\n}\nfunction useContext(context) {\n return Owner && Owner.context && Owner.context[context.id] !== undefined\n ? Owner.context[context.id]\n : context.defaultValue;\n}\nfunction children(fn) {\n const children = createMemo(fn);\n const memo = createMemo(() => resolveChildren(children()));\n memo.toArray = () => {\n const c = memo();\n return Array.isArray(c) ? c : c != null ? [c] : [];\n };\n return memo;\n}\nlet SuspenseContext;\nfunction getSuspenseContext() {\n return SuspenseContext || (SuspenseContext = createContext());\n}\nfunction enableExternalSource(factory, untrack = fn => fn()) {\n if (ExternalSourceConfig) {\n const { factory: oldFactory, untrack: oldUntrack } = ExternalSourceConfig;\n ExternalSourceConfig = {\n factory: (fn, trigger) => {\n const oldSource = oldFactory(fn, trigger);\n const source = factory(x => oldSource.track(x), trigger);\n return {\n track: x => source.track(x),\n dispose() {\n source.dispose();\n oldSource.dispose();\n }\n };\n },\n untrack: fn => oldUntrack(() => untrack(fn))\n };\n } else {\n ExternalSourceConfig = {\n factory,\n untrack\n };\n }\n}\nfunction readSignal() {\n const runningTransition = Transition && Transition.running;\n if (this.sources && (runningTransition ? this.tState : this.state)) {\n if ((runningTransition ? this.tState : this.state) === STALE) updateComputation(this);\n else {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(this), false);\n Updates = updates;\n }\n }\n if (Listener) {\n const sSlot = this.observers ? this.observers.length : 0;\n if (!Listener.sources) {\n Listener.sources = [this];\n Listener.sourceSlots = [sSlot];\n } else {\n Listener.sources.push(this);\n Listener.sourceSlots.push(sSlot);\n }\n if (!this.observers) {\n this.observers = [Listener];\n this.observerSlots = [Listener.sources.length - 1];\n } else {\n this.observers.push(Listener);\n this.observerSlots.push(Listener.sources.length - 1);\n }\n }\n if (runningTransition && Transition.sources.has(this)) return this.tValue;\n return this.value;\n}\nfunction writeSignal(node, value, isComp) {\n let current =\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value;\n if (!node.comparator || !node.comparator(current, value)) {\n if (Transition) {\n const TransitionRunning = Transition.running;\n if (TransitionRunning || (!isComp && Transition.sources.has(node))) {\n Transition.sources.add(node);\n node.tValue = value;\n }\n if (!TransitionRunning) node.value = value;\n } else node.value = value;\n if (node.observers && node.observers.length) {\n runUpdates(() => {\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n const TransitionRunning = Transition && Transition.running;\n if (TransitionRunning && Transition.disposed.has(o)) continue;\n if (TransitionRunning ? !o.tState : !o.state) {\n if (o.pure) Updates.push(o);\n else Effects.push(o);\n if (o.observers) markDownstream(o);\n }\n if (!TransitionRunning) o.state = STALE;\n else o.tState = STALE;\n }\n if (Updates.length > 10e5) {\n Updates = [];\n if (false);\n throw new Error();\n }\n }, false);\n }\n }\n return value;\n}\nfunction updateComputation(node) {\n if (!node.fn) return;\n cleanNode(node);\n const time = ExecCount;\n runComputation(\n node,\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,\n time\n );\n if (Transition && !Transition.running && Transition.sources.has(node)) {\n queueMicrotask(() => {\n runUpdates(() => {\n Transition && (Transition.running = true);\n Listener = Owner = node;\n runComputation(node, node.tValue, time);\n Listener = Owner = null;\n }, false);\n });\n }\n}\nfunction runComputation(node, value, time) {\n let nextValue;\n const owner = Owner,\n listener = Listener;\n Listener = Owner = node;\n try {\n nextValue = node.fn(value);\n } catch (err) {\n if (node.pure) {\n if (Transition && Transition.running) {\n node.tState = STALE;\n node.tOwned && node.tOwned.forEach(cleanNode);\n node.tOwned = undefined;\n } else {\n node.state = STALE;\n node.owned && node.owned.forEach(cleanNode);\n node.owned = null;\n }\n }\n node.updatedAt = time + 1;\n return handleError(err);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n if (!node.updatedAt || node.updatedAt <= time) {\n if (node.updatedAt != null && \"observers\" in node) {\n writeSignal(node, nextValue, true);\n } else if (Transition && Transition.running && node.pure) {\n Transition.sources.add(node);\n node.tValue = nextValue;\n } else node.value = nextValue;\n node.updatedAt = time;\n }\n}\nfunction createComputation(fn, init, pure, state = STALE, options) {\n const c = {\n fn,\n state: state,\n updatedAt: null,\n owned: null,\n sources: null,\n sourceSlots: null,\n cleanups: null,\n value: init,\n owner: Owner,\n context: Owner ? Owner.context : null,\n pure\n };\n if (Transition && Transition.running) {\n c.state = 0;\n c.tState = state;\n }\n if (Owner === null);\n else if (Owner !== UNOWNED) {\n if (Transition && Transition.running && Owner.pure) {\n if (!Owner.tOwned) Owner.tOwned = [c];\n else Owner.tOwned.push(c);\n } else {\n if (!Owner.owned) Owner.owned = [c];\n else Owner.owned.push(c);\n }\n }\n if (ExternalSourceConfig && c.fn) {\n const [track, trigger] = createSignal(undefined, {\n equals: false\n });\n const ordinary = ExternalSourceConfig.factory(c.fn, trigger);\n onCleanup(() => ordinary.dispose());\n const triggerInTransition = () => startTransition(trigger).then(() => inTransition.dispose());\n const inTransition = ExternalSourceConfig.factory(c.fn, triggerInTransition);\n c.fn = x => {\n track();\n return Transition && Transition.running ? inTransition.track(x) : ordinary.track(x);\n };\n }\n return c;\n}\nfunction runTop(node) {\n const runningTransition = Transition && Transition.running;\n if ((runningTransition ? node.tState : node.state) === 0) return;\n if ((runningTransition ? node.tState : node.state) === PENDING) return lookUpstream(node);\n if (node.suspense && untrack(node.suspense.inFallback)) return node.suspense.effects.push(node);\n const ancestors = [node];\n while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {\n if (runningTransition && Transition.disposed.has(node)) return;\n if (runningTransition ? node.tState : node.state) ancestors.push(node);\n }\n for (let i = ancestors.length - 1; i >= 0; i--) {\n node = ancestors[i];\n if (runningTransition) {\n let top = node,\n prev = ancestors[i + 1];\n while ((top = top.owner) && top !== prev) {\n if (Transition.disposed.has(top)) return;\n }\n }\n if ((runningTransition ? node.tState : node.state) === STALE) {\n updateComputation(node);\n } else if ((runningTransition ? node.tState : node.state) === PENDING) {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(node, ancestors[0]), false);\n Updates = updates;\n }\n }\n}\nfunction runUpdates(fn, init) {\n if (Updates) return fn();\n let wait = false;\n if (!init) Updates = [];\n if (Effects) wait = true;\n else Effects = [];\n ExecCount++;\n try {\n const res = fn();\n completeUpdates(wait);\n return res;\n } catch (err) {\n if (!wait) Effects = null;\n Updates = null;\n handleError(err);\n }\n}\nfunction completeUpdates(wait) {\n if (Updates) {\n if (Scheduler && Transition && Transition.running) scheduleQueue(Updates);\n else runQueue(Updates);\n Updates = null;\n }\n if (wait) return;\n let res;\n if (Transition) {\n if (!Transition.promises.size && !Transition.queue.size) {\n const sources = Transition.sources;\n const disposed = Transition.disposed;\n Effects.push.apply(Effects, Transition.effects);\n res = Transition.resolve;\n for (const e of Effects) {\n \"tState\" in e && (e.state = e.tState);\n delete e.tState;\n }\n Transition = null;\n runUpdates(() => {\n for (const d of disposed) cleanNode(d);\n for (const v of sources) {\n v.value = v.tValue;\n if (v.owned) {\n for (let i = 0, len = v.owned.length; i < len; i++) cleanNode(v.owned[i]);\n }\n if (v.tOwned) v.owned = v.tOwned;\n delete v.tValue;\n delete v.tOwned;\n v.tState = 0;\n }\n setTransPending(false);\n }, false);\n } else if (Transition.running) {\n Transition.running = false;\n Transition.effects.push.apply(Transition.effects, Effects);\n Effects = null;\n setTransPending(true);\n return;\n }\n }\n const e = Effects;\n Effects = null;\n if (e.length) runUpdates(() => runEffects(e), false);\n if (res) res();\n}\nfunction runQueue(queue) {\n for (let i = 0; i < queue.length; i++) runTop(queue[i]);\n}\nfunction scheduleQueue(queue) {\n for (let i = 0; i < queue.length; i++) {\n const item = queue[i];\n const tasks = Transition.queue;\n if (!tasks.has(item)) {\n tasks.add(item);\n Scheduler(() => {\n tasks.delete(item);\n runUpdates(() => {\n Transition.running = true;\n runTop(item);\n }, false);\n Transition && (Transition.running = false);\n });\n }\n }\n}\nfunction runUserEffects(queue) {\n let i,\n userLength = 0;\n for (i = 0; i < queue.length; i++) {\n const e = queue[i];\n if (!e.user) runTop(e);\n else queue[userLength++] = e;\n }\n if (sharedConfig.context) {\n if (sharedConfig.count) {\n sharedConfig.effects || (sharedConfig.effects = []);\n sharedConfig.effects.push(...queue.slice(0, userLength));\n return;\n } else if (sharedConfig.effects) {\n queue = [...sharedConfig.effects, ...queue];\n userLength += sharedConfig.effects.length;\n delete sharedConfig.effects;\n }\n setHydrateContext();\n }\n for (i = 0; i < userLength; i++) runTop(queue[i]);\n}\nfunction lookUpstream(node, ignore) {\n const runningTransition = Transition && Transition.running;\n if (runningTransition) node.tState = 0;\n else node.state = 0;\n for (let i = 0; i < node.sources.length; i += 1) {\n const source = node.sources[i];\n if (source.sources) {\n const state = runningTransition ? source.tState : source.state;\n if (state === STALE) {\n if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))\n runTop(source);\n } else if (state === PENDING) lookUpstream(source, ignore);\n }\n }\n}\nfunction markDownstream(node) {\n const runningTransition = Transition && Transition.running;\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n if (runningTransition ? !o.tState : !o.state) {\n if (runningTransition) o.tState = PENDING;\n else o.state = PENDING;\n if (o.pure) Updates.push(o);\n else Effects.push(o);\n o.observers && markDownstream(o);\n }\n }\n}\nfunction cleanNode(node) {\n let i;\n if (node.sources) {\n while (node.sources.length) {\n const source = node.sources.pop(),\n index = node.sourceSlots.pop(),\n obs = source.observers;\n if (obs && obs.length) {\n const n = obs.pop(),\n s = source.observerSlots.pop();\n if (index < obs.length) {\n n.sourceSlots[s] = index;\n obs[index] = n;\n source.observerSlots[index] = s;\n }\n }\n }\n }\n if (Transition && Transition.running && node.pure) {\n if (node.tOwned) {\n for (i = node.tOwned.length - 1; i >= 0; i--) cleanNode(node.tOwned[i]);\n delete node.tOwned;\n }\n reset(node, true);\n } else if (node.owned) {\n for (i = node.owned.length - 1; i >= 0; i--) cleanNode(node.owned[i]);\n node.owned = null;\n }\n if (node.cleanups) {\n for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i]();\n node.cleanups = null;\n }\n if (Transition && Transition.running) node.tState = 0;\n else node.state = 0;\n}\nfunction reset(node, top) {\n if (!top) {\n node.tState = 0;\n Transition.disposed.add(node);\n }\n if (node.owned) {\n for (let i = 0; i < node.owned.length; i++) reset(node.owned[i]);\n }\n}\nfunction castError(err) {\n if (err instanceof Error) return err;\n return new Error(typeof err === \"string\" ? err : \"Unknown error\", {\n cause: err\n });\n}\nfunction runErrors(err, fns, owner) {\n try {\n for (const f of fns) f(err);\n } catch (e) {\n handleError(e, (owner && owner.owner) || null);\n }\n}\nfunction handleError(err, owner = Owner) {\n const fns = ERROR && owner && owner.context && owner.context[ERROR];\n const error = castError(err);\n if (!fns) throw error;\n if (Effects)\n Effects.push({\n fn() {\n runErrors(error, fns, owner);\n },\n state: STALE\n });\n else runErrors(error, fns, owner);\n}\nfunction resolveChildren(children) {\n if (typeof children === \"function\" && !children.length) return resolveChildren(children());\n if (Array.isArray(children)) {\n const results = [];\n for (let i = 0; i < children.length; i++) {\n const result = resolveChildren(children[i]);\n Array.isArray(result) ? results.push.apply(results, result) : results.push(result);\n }\n return results;\n }\n return children;\n}\nfunction createProvider(id, options) {\n return function provider(props) {\n let res;\n createRenderEffect(\n () =>\n (res = untrack(() => {\n Owner.context = {\n ...Owner.context,\n [id]: props.value\n };\n return children(() => props.children);\n })),\n undefined\n );\n return res;\n };\n}\nfunction onError(fn) {\n ERROR || (ERROR = Symbol(\"error\"));\n if (Owner === null);\n else if (Owner.context === null || !Owner.context[ERROR]) {\n Owner.context = {\n ...Owner.context,\n [ERROR]: [fn]\n };\n mutateContext(Owner, ERROR, [fn]);\n } else Owner.context[ERROR].push(fn);\n}\nfunction mutateContext(o, key, value) {\n if (o.owned) {\n for (let i = 0; i < o.owned.length; i++) {\n if (o.owned[i].context === o.context) mutateContext(o.owned[i], key, value);\n if (!o.owned[i].context) {\n o.owned[i].context = o.context;\n mutateContext(o.owned[i], key, value);\n } else if (!o.owned[i].context[key]) {\n o.owned[i].context[key] = value;\n mutateContext(o.owned[i], key, value);\n }\n }\n }\n}\n\nfunction observable(input) {\n return {\n subscribe(observer) {\n if (!(observer instanceof Object) || observer == null) {\n throw new TypeError(\"Expected the observer to be an object.\");\n }\n const handler =\n typeof observer === \"function\" ? observer : observer.next && observer.next.bind(observer);\n if (!handler) {\n return {\n unsubscribe() {}\n };\n }\n const dispose = createRoot(disposer => {\n createEffect(() => {\n const v = input();\n untrack(() => handler(v));\n });\n return disposer;\n });\n if (getOwner()) onCleanup(dispose);\n return {\n unsubscribe() {\n dispose();\n }\n };\n },\n [Symbol.observable || \"@@observable\"]() {\n return this;\n }\n };\n}\nfunction from(producer) {\n const [s, set] = createSignal(undefined, {\n equals: false\n });\n if (\"subscribe\" in producer) {\n const unsub = producer.subscribe(v => set(() => v));\n onCleanup(() => (\"unsubscribe\" in unsub ? unsub.unsubscribe() : unsub()));\n } else {\n const clean = producer(set);\n onCleanup(clean);\n }\n return s;\n}\n\nconst FALLBACK = Symbol(\"fallback\");\nfunction dispose(d) {\n for (let i = 0; i < d.length; i++) d[i]();\n}\nfunction mapArray(list, mapFn, options = {}) {\n let items = [],\n mapped = [],\n disposers = [],\n len = 0,\n indexes = mapFn.length > 1 ? [] : null;\n onCleanup(() => dispose(disposers));\n return () => {\n let newItems = list() || [],\n i,\n j;\n newItems[$TRACK];\n return untrack(() => {\n let newLen = newItems.length,\n newIndices,\n newIndicesNext,\n temp,\n tempdisposers,\n tempIndexes,\n start,\n end,\n newEnd,\n item;\n if (newLen === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n indexes && (indexes = []);\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot(disposer => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n } else if (len === 0) {\n mapped = new Array(newLen);\n for (j = 0; j < newLen; j++) {\n items[j] = newItems[j];\n mapped[j] = createRoot(mapper);\n }\n len = newLen;\n } else {\n temp = new Array(newLen);\n tempdisposers = new Array(newLen);\n indexes && (tempIndexes = new Array(newLen));\n for (\n start = 0, end = Math.min(len, newLen);\n start < end && items[start] === newItems[start];\n start++\n );\n for (\n end = len - 1, newEnd = newLen - 1;\n end >= start && newEnd >= start && items[end] === newItems[newEnd];\n end--, newEnd--\n ) {\n temp[newEnd] = mapped[end];\n tempdisposers[newEnd] = disposers[end];\n indexes && (tempIndexes[newEnd] = indexes[end]);\n }\n newIndices = new Map();\n newIndicesNext = new Array(newEnd + 1);\n for (j = newEnd; j >= start; j--) {\n item = newItems[j];\n i = newIndices.get(item);\n newIndicesNext[j] = i === undefined ? -1 : i;\n newIndices.set(item, j);\n }\n for (i = start; i <= end; i++) {\n item = items[i];\n j = newIndices.get(item);\n if (j !== undefined && j !== -1) {\n temp[j] = mapped[i];\n tempdisposers[j] = disposers[i];\n indexes && (tempIndexes[j] = indexes[i]);\n j = newIndicesNext[j];\n newIndices.set(item, j);\n } else disposers[i]();\n }\n for (j = start; j < newLen; j++) {\n if (j in temp) {\n mapped[j] = temp[j];\n disposers[j] = tempdisposers[j];\n if (indexes) {\n indexes[j] = tempIndexes[j];\n indexes[j](j);\n }\n } else mapped[j] = createRoot(mapper);\n }\n mapped = mapped.slice(0, (len = newLen));\n items = newItems.slice(0);\n }\n return mapped;\n });\n function mapper(disposer) {\n disposers[j] = disposer;\n if (indexes) {\n const [s, set] = createSignal(j);\n indexes[j] = set;\n return mapFn(newItems[j], s);\n }\n return mapFn(newItems[j]);\n }\n };\n}\nfunction indexArray(list, mapFn, options = {}) {\n let items = [],\n mapped = [],\n disposers = [],\n signals = [],\n len = 0,\n i;\n onCleanup(() => dispose(disposers));\n return () => {\n const newItems = list() || [];\n newItems[$TRACK];\n return untrack(() => {\n if (newItems.length === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n signals = [];\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot(disposer => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n return mapped;\n }\n if (items[0] === FALLBACK) {\n disposers[0]();\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n }\n for (i = 0; i < newItems.length; i++) {\n if (i < items.length && items[i] !== newItems[i]) {\n signals[i](() => newItems[i]);\n } else if (i >= items.length) {\n mapped[i] = createRoot(mapper);\n }\n }\n for (; i < items.length; i++) {\n disposers[i]();\n }\n len = signals.length = disposers.length = newItems.length;\n items = newItems.slice(0);\n return (mapped = mapped.slice(0, len));\n });\n function mapper(disposer) {\n disposers[i] = disposer;\n const [s, set] = createSignal(newItems[i]);\n signals[i] = set;\n return mapFn(s, i);\n }\n };\n}\n\nlet hydrationEnabled = false;\nfunction enableHydration() {\n hydrationEnabled = true;\n}\nfunction createComponent(Comp, props) {\n if (hydrationEnabled) {\n if (sharedConfig.context) {\n const c = sharedConfig.context;\n setHydrateContext(nextHydrateContext());\n const r = untrack(() => Comp(props || {}));\n setHydrateContext(c);\n return r;\n }\n }\n return untrack(() => Comp(props || {}));\n}\nfunction trueFn() {\n return true;\n}\nconst propTraps = {\n get(_, property, receiver) {\n if (property === $PROXY) return receiver;\n return _.get(property);\n },\n has(_, property) {\n if (property === $PROXY) return true;\n return _.has(property);\n },\n set: trueFn,\n deleteProperty: trueFn,\n getOwnPropertyDescriptor(_, property) {\n return {\n configurable: true,\n enumerable: true,\n get() {\n return _.get(property);\n },\n set: trueFn,\n deleteProperty: trueFn\n };\n },\n ownKeys(_) {\n return _.keys();\n }\n};\nfunction resolveSource(s) {\n return !(s = typeof s === \"function\" ? s() : s) ? {} : s;\n}\nfunction resolveSources() {\n for (let i = 0, length = this.length; i < length; ++i) {\n const v = this[i]();\n if (v !== undefined) return v;\n }\n}\nfunction mergeProps(...sources) {\n let proxy = false;\n for (let i = 0; i < sources.length; i++) {\n const s = sources[i];\n proxy = proxy || (!!s && $PROXY in s);\n sources[i] = typeof s === \"function\" ? ((proxy = true), createMemo(s)) : s;\n }\n if (proxy) {\n return new Proxy(\n {\n get(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n const v = resolveSource(sources[i])[property];\n if (v !== undefined) return v;\n }\n },\n has(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n if (property in resolveSource(sources[i])) return true;\n }\n return false;\n },\n keys() {\n const keys = [];\n for (let i = 0; i < sources.length; i++)\n keys.push(...Object.keys(resolveSource(sources[i])));\n return [...new Set(keys)];\n }\n },\n propTraps\n );\n }\n const sourcesMap = {};\n const defined = Object.create(null);\n for (let i = sources.length - 1; i >= 0; i--) {\n const source = sources[i];\n if (!source) continue;\n const sourceKeys = Object.getOwnPropertyNames(source);\n for (let i = sourceKeys.length - 1; i >= 0; i--) {\n const key = sourceKeys[i];\n if (key === \"__proto__\" || key === \"constructor\") continue;\n const desc = Object.getOwnPropertyDescriptor(source, key);\n if (!defined[key]) {\n defined[key] = desc.get\n ? {\n enumerable: true,\n configurable: true,\n get: resolveSources.bind((sourcesMap[key] = [desc.get.bind(source)]))\n }\n : desc.value !== undefined\n ? desc\n : undefined;\n } else {\n const sources = sourcesMap[key];\n if (sources) {\n if (desc.get) sources.push(desc.get.bind(source));\n else if (desc.value !== undefined) sources.push(() => desc.value);\n }\n }\n }\n }\n const target = {};\n const definedKeys = Object.keys(defined);\n for (let i = definedKeys.length - 1; i >= 0; i--) {\n const key = definedKeys[i],\n desc = defined[key];\n if (desc && desc.get) Object.defineProperty(target, key, desc);\n else target[key] = desc ? desc.value : undefined;\n }\n return target;\n}\nfunction splitProps(props, ...keys) {\n if ($PROXY in props) {\n const blocked = new Set(keys.length > 1 ? keys.flat() : keys[0]);\n const res = keys.map(k => {\n return new Proxy(\n {\n get(property) {\n return k.includes(property) ? props[property] : undefined;\n },\n has(property) {\n return k.includes(property) && property in props;\n },\n keys() {\n return k.filter(property => property in props);\n }\n },\n propTraps\n );\n });\n res.push(\n new Proxy(\n {\n get(property) {\n return blocked.has(property) ? undefined : props[property];\n },\n has(property) {\n return blocked.has(property) ? false : property in props;\n },\n keys() {\n return Object.keys(props).filter(k => !blocked.has(k));\n }\n },\n propTraps\n )\n );\n return res;\n }\n const otherObject = {};\n const objects = keys.map(() => ({}));\n for (const propName of Object.getOwnPropertyNames(props)) {\n const desc = Object.getOwnPropertyDescriptor(props, propName);\n const isDefaultDesc =\n !desc.get && !desc.set && desc.enumerable && desc.writable && desc.configurable;\n let blocked = false;\n let objectIndex = 0;\n for (const k of keys) {\n if (k.includes(propName)) {\n blocked = true;\n isDefaultDesc\n ? (objects[objectIndex][propName] = desc.value)\n : Object.defineProperty(objects[objectIndex], propName, desc);\n }\n ++objectIndex;\n }\n if (!blocked) {\n isDefaultDesc\n ? (otherObject[propName] = desc.value)\n : Object.defineProperty(otherObject, propName, desc);\n }\n }\n return [...objects, otherObject];\n}\nfunction lazy(fn) {\n let comp;\n let p;\n const wrap = props => {\n const ctx = sharedConfig.context;\n if (ctx) {\n const [s, set] = createSignal();\n sharedConfig.count || (sharedConfig.count = 0);\n sharedConfig.count++;\n (p || (p = fn())).then(mod => {\n setHydrateContext(ctx);\n sharedConfig.count--;\n set(() => mod.default);\n setHydrateContext();\n });\n comp = s;\n } else if (!comp) {\n const [s] = createResource(() => (p || (p = fn())).then(mod => mod.default));\n comp = s;\n }\n let Comp;\n return createMemo(\n () =>\n (Comp = comp()) &&\n untrack(() => {\n if (false);\n if (!ctx) return Comp(props);\n const c = sharedConfig.context;\n setHydrateContext(ctx);\n const r = Comp(props);\n setHydrateContext(c);\n return r;\n })\n );\n };\n wrap.preload = () => p || ((p = fn()).then(mod => (comp = () => mod.default)), p);\n return wrap;\n}\nlet counter = 0;\nfunction createUniqueId() {\n const ctx = sharedConfig.context;\n return ctx ? `${ctx.id}${ctx.count++}` : `cl-${counter++}`;\n}\n\nconst narrowedError = name => `Stale read from <${name}>.`;\nfunction For(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(mapArray(() => props.each, props.children, fallback || undefined));\n}\nfunction Index(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(indexArray(() => props.each, props.children, fallback || undefined));\n}\nfunction Show(props) {\n const keyed = props.keyed;\n const condition = createMemo(() => props.when, undefined, {\n equals: (a, b) => (keyed ? a === b : !a === !b)\n });\n return createMemo(\n () => {\n const c = condition();\n if (c) {\n const child = props.children;\n const fn = typeof child === \"function\" && child.length > 0;\n return fn\n ? untrack(() =>\n child(\n keyed\n ? c\n : () => {\n if (!untrack(condition)) throw narrowedError(\"Show\");\n return props.when;\n }\n )\n )\n : child;\n }\n return props.fallback;\n },\n undefined,\n undefined\n );\n}\nfunction Switch(props) {\n let keyed = false;\n const equals = (a, b) => (keyed ? a[1] === b[1] : !a[1] === !b[1]) && a[2] === b[2];\n const conditions = children(() => props.children),\n evalConditions = createMemo(\n () => {\n let conds = conditions();\n if (!Array.isArray(conds)) conds = [conds];\n for (let i = 0; i < conds.length; i++) {\n const c = conds[i].when;\n if (c) {\n keyed = !!conds[i].keyed;\n return [i, c, conds[i]];\n }\n }\n return [-1];\n },\n undefined,\n {\n equals\n }\n );\n return createMemo(\n () => {\n const [index, when, cond] = evalConditions();\n if (index < 0) return props.fallback;\n const c = cond.children;\n const fn = typeof c === \"function\" && c.length > 0;\n return fn\n ? untrack(() =>\n c(\n keyed\n ? when\n : () => {\n if (untrack(evalConditions)[0] !== index) throw narrowedError(\"Match\");\n return cond.when;\n }\n )\n )\n : c;\n },\n undefined,\n undefined\n );\n}\nfunction Match(props) {\n return props;\n}\nlet Errors;\nfunction resetErrorBoundaries() {\n Errors && [...Errors].forEach(fn => fn());\n}\nfunction ErrorBoundary(props) {\n let err;\n if (sharedConfig.context && sharedConfig.load)\n err = sharedConfig.load(sharedConfig.context.id + sharedConfig.context.count);\n const [errored, setErrored] = createSignal(err, undefined);\n Errors || (Errors = new Set());\n Errors.add(setErrored);\n onCleanup(() => Errors.delete(setErrored));\n return createMemo(\n () => {\n let e;\n if ((e = errored())) {\n const f = props.fallback;\n return typeof f === \"function\" && f.length ? untrack(() => f(e, () => setErrored())) : f;\n }\n return catchError(() => props.children, setErrored);\n },\n undefined,\n undefined\n );\n}\n\nconst suspenseListEquals = (a, b) =>\n a.showContent === b.showContent && a.showFallback === b.showFallback;\nconst SuspenseListContext = createContext();\nfunction SuspenseList(props) {\n let [wrapper, setWrapper] = createSignal(() => ({\n inFallback: false\n })),\n show;\n const listContext = useContext(SuspenseListContext);\n const [registry, setRegistry] = createSignal([]);\n if (listContext) {\n show = listContext.register(createMemo(() => wrapper()().inFallback));\n }\n const resolved = createMemo(\n prev => {\n const reveal = props.revealOrder,\n tail = props.tail,\n { showContent = true, showFallback = true } = show ? show() : {},\n reg = registry(),\n reverse = reveal === \"backwards\";\n if (reveal === \"together\") {\n const all = reg.every(inFallback => !inFallback());\n const res = reg.map(() => ({\n showContent: all && showContent,\n showFallback\n }));\n res.inFallback = !all;\n return res;\n }\n let stop = false;\n let inFallback = prev.inFallback;\n const res = [];\n for (let i = 0, len = reg.length; i < len; i++) {\n const n = reverse ? len - i - 1 : i,\n s = reg[n]();\n if (!stop && !s) {\n res[n] = {\n showContent,\n showFallback\n };\n } else {\n const next = !stop;\n if (next) inFallback = true;\n res[n] = {\n showContent: next,\n showFallback: !tail || (next && tail === \"collapsed\") ? showFallback : false\n };\n stop = true;\n }\n }\n if (!stop) inFallback = false;\n res.inFallback = inFallback;\n return res;\n },\n {\n inFallback: false\n }\n );\n setWrapper(() => resolved);\n return createComponent(SuspenseListContext.Provider, {\n value: {\n register: inFallback => {\n let index;\n setRegistry(registry => {\n index = registry.length;\n return [...registry, inFallback];\n });\n return createMemo(() => resolved()[index], undefined, {\n equals: suspenseListEquals\n });\n }\n },\n get children() {\n return props.children;\n }\n });\n}\nfunction Suspense(props) {\n let counter = 0,\n show,\n ctx,\n p,\n flicker,\n error;\n const [inFallback, setFallback] = createSignal(false),\n SuspenseContext = getSuspenseContext(),\n store = {\n increment: () => {\n if (++counter === 1) setFallback(true);\n },\n decrement: () => {\n if (--counter === 0) setFallback(false);\n },\n inFallback,\n effects: [],\n resolved: false\n },\n owner = getOwner();\n if (sharedConfig.context && sharedConfig.load) {\n const key = sharedConfig.context.id + sharedConfig.context.count;\n let ref = sharedConfig.load(key);\n if (ref) {\n if (typeof ref !== \"object\" || ref.status !== \"success\") p = ref;\n else sharedConfig.gather(key);\n }\n if (p && p !== \"$$f\") {\n const [s, set] = createSignal(undefined, {\n equals: false\n });\n flicker = s;\n p.then(\n () => {\n if (sharedConfig.done) return set();\n sharedConfig.gather(key);\n setHydrateContext(ctx);\n set();\n setHydrateContext();\n },\n err => {\n error = err;\n set();\n }\n );\n }\n }\n const listContext = useContext(SuspenseListContext);\n if (listContext) show = listContext.register(store.inFallback);\n let dispose;\n onCleanup(() => dispose && dispose());\n return createComponent(SuspenseContext.Provider, {\n value: store,\n get children() {\n return createMemo(() => {\n if (error) throw error;\n ctx = sharedConfig.context;\n if (flicker) {\n flicker();\n return (flicker = undefined);\n }\n if (ctx && p === \"$$f\") setHydrateContext();\n const rendered = createMemo(() => props.children);\n return createMemo(prev => {\n const inFallback = store.inFallback(),\n { showContent = true, showFallback = true } = show ? show() : {};\n if ((!inFallback || (p && p !== \"$$f\")) && showContent) {\n store.resolved = true;\n dispose && dispose();\n dispose = ctx = p = undefined;\n resumeEffects(store.effects);\n return rendered();\n }\n if (!showFallback) return;\n if (dispose) return prev;\n return createRoot(disposer => {\n dispose = disposer;\n if (ctx) {\n setHydrateContext({\n id: ctx.id + \"f\",\n count: 0\n });\n ctx = undefined;\n }\n return props.fallback;\n }, owner);\n });\n });\n }\n });\n}\n\nconst DEV = undefined;\n\nexport {\n $DEVCOMP,\n $PROXY,\n $TRACK,\n DEV,\n ErrorBoundary,\n For,\n Index,\n Match,\n Show,\n Suspense,\n SuspenseList,\n Switch,\n batch,\n cancelCallback,\n catchError,\n children,\n createComponent,\n createComputed,\n createContext,\n createDeferred,\n createEffect,\n createMemo,\n createReaction,\n createRenderEffect,\n createResource,\n createRoot,\n createSelector,\n createSignal,\n createUniqueId,\n enableExternalSource,\n enableHydration,\n enableScheduling,\n equalFn,\n from,\n getListener,\n getOwner,\n indexArray,\n lazy,\n mapArray,\n mergeProps,\n observable,\n on,\n onCleanup,\n onError,\n onMount,\n requestCallback,\n resetErrorBoundaries,\n runWithOwner,\n sharedConfig,\n splitProps,\n startTransition,\n untrack,\n useContext,\n useTransition\n};\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { createSignal } from 'solid-js';\nimport type { ElementNode } from './node/index.js';\nexport const [activeElement, setActiveElement] = createSignal<\n ElementNode | undefined\n>(undefined);\n","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Texture Usage Tracker for Usage Based Texture Garbage Collection\n */\nexport class TextureUsageTracker {\n releaseCallback;\n constructor(releaseCallback) {\n this.releaseCallback = releaseCallback;\n }\n}\n//# sourceMappingURL=TextureUsageTracker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { TextureUsageTracker } from './TextureUsageTracker.js';\n/**\n * Usage-based Texture Garbage Collection Registry\n */\nexport class ManualCountTextureUsageTracker extends TextureUsageTracker {\n textureMap = new Map();\n zeroReferenceTextureSet = new Set();\n options;\n constructor(releaseCallback, options) {\n super(releaseCallback);\n this.options = {\n textureCleanupIntervalMs: options.textureCleanupIntervalMs ?? 10000,\n textureCleanupAgeThreadholdMs: options.textureCleanupAgeThreadholdMs ?? 60000,\n };\n // Periodically check for textures that are no longer referenced by any\n // Nodes and notify RendererMain to release them.\n setInterval(() => {\n const now = Date.now();\n const thresholdMs = this.options.textureCleanupAgeThreadholdMs;\n for (const textureRefInfo of this.zeroReferenceTextureSet) {\n if (now - textureRefInfo.lastUpdate > thresholdMs) {\n this.releaseCallback(textureRefInfo.id);\n this.textureMap.delete(textureRefInfo.id);\n this.zeroReferenceTextureSet.delete(textureRefInfo);\n }\n }\n }, this.options.textureCleanupIntervalMs);\n }\n registerTexture(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n if (!this.textureMap.has(textureId)) {\n const textureRefInfo = {\n id: textureId,\n nodeRefCount: 0,\n lastUpdate: Date.now(),\n };\n this.textureMap.set(textureId, textureRefInfo);\n this.zeroReferenceTextureSet.add(textureRefInfo);\n }\n }\n incrementTextureRefCount(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n let textureRefInfo = this.textureMap.get(textureId);\n if (!textureRefInfo) {\n // Texture has not been registered yet, so register it now.\n // This may happen if the TextureRef was cleaned up from the registry\n // but was still alive in memory and eventually re-used.\n this.registerTexture(texture);\n textureRefInfo = this.textureMap.get(textureId);\n }\n assertTruthy(textureRefInfo, 'Texture must have been registered');\n if (texture.txType === 'SubTexture') {\n // If this is a SubTexture, then increment the reference count of the\n // parent texture as well.\n this.incrementTextureRefCount(texture.props.texture);\n }\n textureRefInfo.nodeRefCount++;\n textureRefInfo.lastUpdate = Date.now();\n if (this.zeroReferenceTextureSet.has(textureRefInfo)) {\n this.zeroReferenceTextureSet.delete(textureRefInfo);\n }\n }\n decrementTextureRefCount(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n const textureRefInfo = this.textureMap.get(textureId);\n assertTruthy(textureRefInfo, 'Texture must have been registered');\n textureRefInfo.nodeRefCount--;\n textureRefInfo.lastUpdate = Date.now();\n if (textureRefInfo.nodeRefCount === 0) {\n this.zeroReferenceTextureSet.add(textureRefInfo);\n }\n if (texture.txType === 'SubTexture') {\n // If this is a SubTexture, then decrement the reference count of the\n // parent texture as well.\n this.decrementTextureRefCount(texture.props.texture);\n }\n }\n}\n//# sourceMappingURL=ManualCountTextureUsageTracker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { TextureUsageTracker } from './TextureUsageTracker.js';\nexport class FinalizationRegistryTextureUsageTracker extends TextureUsageTracker {\n registry;\n constructor(releaseCallback) {\n super(releaseCallback);\n this.registry = new FinalizationRegistry(releaseCallback);\n }\n registerTexture(texture) {\n assertTruthy(texture.options?.id, 'Texture must have an ID to be registered');\n this.registry.register(texture, texture.options?.id);\n }\n incrementTextureRefCount() {\n // No-op for FinalizationRegistry\n }\n decrementTextureRefCount() {\n // No-op for FinalizationRegistry\n }\n}\n//# sourceMappingURL=FinalizationRegistryTextureUsageTracker.js.map","import {} from './RendererMain.js';\nimport { isProductionEnvironment } from '../utils.js';\nconst stylePropertyMap = {\n alpha: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'opacity', value: `${v}` };\n },\n x: (x) => {\n return { prop: 'left', value: `${x}px` };\n },\n y: (y) => {\n return { prop: 'top', value: `${y}px` };\n },\n width: (w) => {\n if (w === 0) {\n return null;\n }\n return { prop: 'width', value: `${w}px` };\n },\n height: (h) => {\n if (h === 0) {\n return null;\n }\n return { prop: 'height', value: `${h}px` };\n },\n zIndex: () => 'zIndex',\n fontFamily: () => 'font-family',\n fontSize: () => 'font-size',\n fontStyle: () => 'font-style',\n fontWeight: () => 'font-weight',\n fontStretch: () => 'font-stretch',\n lineHeight: () => 'line-height',\n letterSpacing: () => 'letter-spacing',\n textAlign: () => 'text-align',\n overflowSuffix: () => 'overflow-suffix',\n maxLines: () => 'max-lines',\n contain: () => 'contain',\n verticalAlign: () => 'vertical-align',\n clipping: (v) => {\n if (v === false) {\n return null;\n }\n return { prop: 'overflow', value: v ? 'hidden' : 'visible' };\n },\n rotation: (v) => {\n if (v === 0) {\n return null;\n }\n return { prop: 'transform', value: `rotate(${v}rad)` };\n },\n scale: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scale(${v})` };\n },\n scaleX: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scaleX(${v})` };\n },\n scaleY: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scaleY(${v})` };\n },\n color: (v) => {\n if (v === 0) {\n return null;\n }\n return { prop: 'color', value: convertColorToRgba(v) };\n },\n};\nconst convertColorToRgba = (color) => {\n const a = (color & 0xff) / 255;\n const b = (color >> 8) & 0xff;\n const g = (color >> 16) & 0xff;\n const r = (color >> 24) & 0xff;\n return `rgba(${r},${g},${b},${a})`;\n};\nconst domPropertyMap = {\n id: 'id',\n};\nconst gradientColorPropertyMap = [\n 'colorTop',\n 'colorBottom',\n 'colorLeft',\n 'colorRight',\n 'colorTl',\n 'colorTr',\n 'colorBl',\n 'colorBr',\n];\nexport class Inspector {\n root = null;\n canvas = null;\n height = 1080;\n width = 1920;\n scaleX = 1;\n scaleY = 1;\n constructor(canvas, settings) {\n if (isProductionEnvironment())\n return;\n if (!settings) {\n throw new Error('settings is required');\n }\n // calc dimensions based on the devicePixelRatio\n this.height = Math.ceil(settings.appHeight ?? 1080 / (settings.deviceLogicalPixelRatio ?? 1));\n this.width = Math.ceil(settings.appWidth ?? 1900 / (settings.deviceLogicalPixelRatio ?? 1));\n this.scaleX = settings.deviceLogicalPixelRatio ?? 1;\n this.scaleY = settings.deviceLogicalPixelRatio ?? 1;\n this.canvas = canvas;\n this.root = document.createElement('div');\n this.setRootPosition();\n document.body.appendChild(this.root);\n //listen for changes on canvas\n const mutationObserver = new MutationObserver(this.setRootPosition.bind(this));\n mutationObserver.observe(canvas, {\n attributes: true,\n childList: false,\n subtree: false,\n });\n // Create a ResizeObserver to watch for changes in the element's size\n const resizeObserver = new ResizeObserver(this.setRootPosition.bind(this));\n resizeObserver.observe(canvas);\n //listen for changes on window\n window.addEventListener('resize', this.setRootPosition.bind(this));\n console.warn('Inspector is enabled, this will impact performance');\n }\n setRootPosition() {\n if (this.root === null || this.canvas === null) {\n return;\n }\n // get the world position of the canvas object, so we can match the inspector to it\n const rect = this.canvas.getBoundingClientRect();\n const top = document.documentElement.scrollTop + rect.top;\n const left = document.documentElement.scrollLeft + rect.left;\n this.root.id = 'root';\n this.root.style.left = `${left}px`;\n this.root.style.top = `${top}px`;\n this.root.style.width = `${this.width}px`;\n this.root.style.height = `${this.height}px`;\n this.root.style.position = 'absolute';\n this.root.style.transformOrigin = '0 0 0';\n this.root.style.transform = `scale(${this.scaleX}, ${this.scaleY})`;\n this.root.style.overflow = 'hidden';\n this.root.style.zIndex = '65534';\n }\n createDiv(node, properties) {\n const div = document.createElement('div');\n div.style.position = 'absolute';\n div.id = node.id.toString();\n // set initial properties\n for (const key in properties) {\n this.updateNodeProperty(div, \n // really typescript? really?\n key, properties[key]);\n }\n return div;\n }\n createNode(driver, properties) {\n const node = driver.createNode(properties);\n const div = this.createDiv(node, properties);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n div.node = node;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n node.div = div;\n return this.createProxy(node, div);\n }\n createTextNode(driver, properties) {\n const node = driver.createTextNode(properties);\n const div = this.createDiv(node, properties);\n return this.createProxy(node, div);\n }\n createProxy(node, div) {\n return new Proxy(node, {\n set: (target, property, value) => {\n this.updateNodeProperty(div, property, value);\n return Reflect.set(target, property, value);\n },\n get: (target, property, receiver) => {\n if (property === 'destroy') {\n this.destroyNode(target);\n }\n if (property === 'animate') {\n return (props, settings) => {\n const anim = target.animate(props, settings);\n // Trap the animate start function so we can update the inspector accordingly\n return new Proxy(anim, {\n get: (target, property, receiver) => {\n if (property === 'start') {\n this.animateNode(div, node, props, settings);\n }\n return Reflect.get(target, property, receiver);\n },\n });\n };\n }\n return Reflect.get(target, property, receiver);\n },\n });\n }\n destroyNode(node) {\n const div = document.getElementById(node.id.toString());\n div?.remove();\n }\n updateNodeProperty(div, property, \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value) {\n if (this.root === null || value === undefined || value === null) {\n return;\n }\n /**\n * Special case for parent property\n */\n if (property === 'parent') {\n const parentId = value.id;\n // only way to detect if the parent is the root node\n // if you are reading this and have a better way, please let me know\n if (parentId === 1) {\n this.root.appendChild(div);\n return;\n }\n const parent = document.getElementById(parentId.toString());\n parent?.appendChild(div);\n return;\n }\n // special case for text\n if (property === 'text') {\n div.innerHTML = String(value);\n // hide text because we can't render SDF fonts\n // it would look weird and obstruct the WebGL rendering\n div.style.visibility = 'hidden';\n return;\n }\n // special case for images\n // we're not setting any CSS properties to avoid images getting loaded twice\n // as the renderer will handle the loading of the image. Setting it to `data-src`\n if (property === 'src' && value) {\n div.setAttribute(`data-src`, String(value));\n return;\n }\n // special case for color gradients (normal colors are handled by the stylePropertyMap)\n // FIXME the renderer seems to return the same number for all colors\n // if (gradientColorPropertyMap.includes(property as string)) {\n // const color = convertColorToRgba(value as number);\n // div.setAttribute(`data-${property}`, color);\n // return;\n // }\n // CSS mappable attribute\n if (stylePropertyMap[property]) {\n const mappedStyleResponse = stylePropertyMap[property]?.(value);\n if (mappedStyleResponse === null) {\n return;\n }\n if (typeof mappedStyleResponse === 'string') {\n div.style.setProperty(mappedStyleResponse, String(value));\n return;\n }\n if (typeof mappedStyleResponse === 'object') {\n div.style.setProperty(mappedStyleResponse.prop, mappedStyleResponse.value);\n }\n return;\n }\n // DOM properties\n if (domPropertyMap[property]) {\n div.setAttribute(String(stylePropertyMap[property]), String(value));\n return;\n }\n // custom data properties\n if (property === 'data') {\n for (const key in value) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n div.setAttribute(`data-${key}`, String(value[key]));\n }\n return;\n }\n }\n // simple animation handler\n animateNode(div, node, props, settings) {\n const { duration = 1000, delay = 0,\n // easing = 'linear',\n // repeat = 0,\n // loop = false,\n // stopMethod = false,\n } = settings;\n const { x, y, width, height, alpha = 1, rotation = 0, scale = 1, color, } = props;\n // ignoring loops and repeats for now, as that might be a bit too much for the inspector\n function animate() {\n setTimeout(() => {\n div.style.top = `${y}px`;\n div.style.left = `${x}px`;\n div.style.width = `${width}px`;\n div.style.height = `${height}px`;\n div.style.opacity = `${alpha}`;\n div.style.rotate = `${rotation}rad`;\n div.style.scale = `${scale}`;\n div.style.color = convertColorToRgba(color);\n }, duration);\n }\n setTimeout(animate, delay);\n }\n}\n//# sourceMappingURL=Inspector.js.map","export class ShaderEffect {\n priority = 1;\n name = '';\n ref;\n target;\n passParameters = '';\n declaredUniforms = '';\n uniformInfo = {};\n static uniforms = {};\n static methods;\n static onShaderMask;\n static onColorize;\n static onEffectMask;\n static getEffectKey(props) {\n return '';\n }\n static getMethodParameters(uniforms, props) {\n const res = [];\n for (const u in uniforms) {\n const uni = uniforms[u];\n let define = '';\n if (uni.size) {\n define = `[${uni.size(props)}]`;\n }\n res.push(`${uni.type} ${u}${define}`);\n }\n return res.join(',');\n }\n constructor(options) {\n const { ref, target, props = {} } = options;\n this.ref = ref;\n this.target = target;\n const uniformInfo = {};\n const passParameters = [];\n let declaredUniforms = '';\n const uniforms = this.constructor.uniforms || {};\n for (const u in uniforms) {\n const unif = uniforms[u];\n const uniType = unif.type;\n //make unique uniform name\n const uniformName = `${ref}_${u}`;\n let define = '';\n if (unif.size) {\n define = `[${unif.size(props)}]`;\n }\n passParameters.push(uniformName);\n declaredUniforms += `uniform ${uniType} ${uniformName}${define};`;\n uniformInfo[u] = { name: uniformName, uniform: uniforms[u].method };\n }\n this.passParameters = passParameters.join(',');\n this.declaredUniforms = declaredUniforms;\n this.uniformInfo = uniformInfo;\n }\n static resolveDefaults(props) {\n return {};\n }\n static makeEffectKey(props) {\n return false;\n }\n}\n//# sourceMappingURL=ShaderEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst trPropSetterDefaults = {\n x: (state, value) => {\n state.props.x = value;\n },\n y: (state, value) => {\n state.props.y = value;\n },\n width: (state, value) => {\n state.props.width = value;\n },\n height: (state, value) => {\n state.props.height = value;\n },\n color: (state, value) => {\n state.props.color = value;\n },\n zIndex: (state, value) => {\n state.props.zIndex = value;\n },\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n },\n text: (state, value) => {\n state.props.text = value;\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n },\n contain: (state, value) => {\n state.props.contain = value;\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n },\n scrollable: (state, value) => {\n state.props.scrollable = value;\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n },\n debug: (state, value) => {\n state.props.debug = value;\n },\n};\nexport class TextRenderer {\n stage;\n set;\n constructor(stage) {\n this.stage = stage;\n const propSetters = {\n ...trPropSetterDefaults,\n ...this.getPropertySetters(),\n };\n // For each prop setter add a wrapper method that checks if the prop is\n // different before calling the setter\n this.set = Object.freeze(Object.fromEntries(Object.entries(propSetters).map(([key, setter]) => {\n return [\n key,\n (state, value) => {\n if (state.props[key] !== value) {\n setter(state, value);\n // Assume any prop change will require a render\n // This is required because otherwise a paused RAF will result\n // in renders when text props are changed.\n this.stage.requestRender();\n }\n },\n ];\n })));\n }\n setStatus(state, status, error) {\n // Don't emit the same status twice\n if (state.status === status) {\n return;\n }\n state.status = status;\n state.emitter.emit(status, error);\n }\n /**\n * Allows the CoreTextNode to communicate changes to the isRenderable state of\n * the itself.\n *\n * @param state\n * @param renderable\n */\n setIsRenderable(state, renderable) {\n state.isRenderable = renderable;\n }\n /**\n * Destroy/Clean up the state object\n *\n * @remarks\n * Opposite of createState(). Frees any event listeners / resources held by\n * the state that may not reliably get garbage collected.\n *\n * @param state\n */\n destroyState(state) {\n const stateEvents = ['loading', 'loaded', 'failed'];\n // Remove the old event listeners from previous state obj there was one\n stateEvents.forEach((eventName) => {\n state.emitter.off(eventName);\n });\n }\n /**\n * Schedule a state update via queueMicrotask\n *\n * @remarks\n * This method is used to schedule a state update via queueMicrotask. This\n * method should be called whenever a state update is needed, and it will\n * ensure that the state is only updated once per microtask.\n * @param state\n * @returns\n */\n scheduleUpdateState(state) {\n if (state.updateScheduled) {\n return;\n }\n state.updateScheduled = true;\n queueMicrotask(() => {\n state.updateScheduled = false;\n this.updateState(state);\n });\n }\n}\n//# sourceMappingURL=TextRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* eslint-disable @typescript-eslint/no-non-null-assertion */\nimport { getRgbaString } from '../../lib/utils.js';\nconst MAX_TEXTURE_DIMENSION = 2048;\n/**\n * Calculate height for the canvas\n *\n * @param textBaseline\n * @param fontSize\n * @param lineHeight\n * @param numLines\n * @param offsetY\n * @returns\n */\nfunction calcHeight(textBaseline, fontSize, lineHeight, numLines, offsetY) {\n const baselineOffset = textBaseline !== 'bottom' ? 0.5 * fontSize : 0;\n return (lineHeight * (numLines - 1) +\n baselineOffset +\n Math.max(lineHeight, fontSize) +\n (offsetY || 0));\n}\nexport class LightningTextTextureRenderer {\n _canvas;\n _context;\n _settings;\n renderInfo;\n constructor(canvas, context) {\n this._canvas = canvas;\n this._context = context;\n this._settings = this.mergeDefaults({});\n }\n set settings(v) {\n this._settings = this.mergeDefaults(v);\n }\n get settings() {\n return this._settings;\n }\n getPrecision() {\n return this._settings.precision;\n }\n setFontProperties() {\n this._context.font = this._getFontSetting();\n this._context.textBaseline = this._settings.textBaseline;\n }\n _getFontSetting() {\n const ff = [this._settings.fontFace];\n const ffs = [];\n for (let i = 0, n = ff.length; i < n; i++) {\n if (ff[i] === 'serif' || ff[i] === 'sans-serif') {\n ffs.push(ff[i]);\n }\n else {\n ffs.push(`\"${ff[i]}\"`);\n }\n }\n return `${this._settings.fontStyle} ${this._settings.fontSize * this.getPrecision()}px ${ffs.join(',')}`;\n }\n _load() {\n if (true && document.fonts) {\n const fontSetting = this._getFontSetting();\n try {\n if (!document.fonts.check(fontSetting, this._settings.text)) {\n // Use a promise that waits for loading.\n return document.fonts\n .load(fontSetting, this._settings.text)\n .catch((err) => {\n // Just load the fallback font.\n console.warn('[Lightning] Font load error', err, fontSetting);\n })\n .then(() => {\n if (!document.fonts.check(fontSetting, this._settings.text)) {\n console.warn('[Lightning] Font not found', fontSetting);\n }\n });\n }\n }\n catch (e) {\n console.warn(\"[Lightning] Can't check font loading for \" + fontSetting);\n }\n }\n }\n calculateRenderInfo() {\n const renderInfo = {};\n const precision = this.getPrecision();\n const paddingLeft = this._settings.paddingLeft * precision;\n const paddingRight = this._settings.paddingRight * precision;\n const fontSize = this._settings.fontSize * precision;\n let offsetY = this._settings.offsetY === null\n ? null\n : this._settings.offsetY * precision;\n let lineHeight = (this._settings.lineHeight || fontSize) * precision;\n const w = this._settings.w * precision;\n const h = this._settings.h * precision;\n let wordWrapWidth = this._settings.wordWrapWidth * precision;\n const cutSx = this._settings.cutSx * precision;\n const cutEx = this._settings.cutEx * precision;\n const cutSy = this._settings.cutSy * precision;\n const cutEy = this._settings.cutEy * precision;\n const letterSpacing = (this._settings.letterSpacing || 0) * precision;\n const textIndent = this._settings.textIndent * precision;\n // Set font properties.\n this.setFontProperties();\n // Total width.\n let width = w || 2048 / this.getPrecision();\n // Inner width.\n let innerWidth = width - paddingLeft;\n if (innerWidth < 10) {\n width += 10 - innerWidth;\n innerWidth = 10;\n }\n if (!wordWrapWidth) {\n wordWrapWidth = innerWidth;\n }\n // Text overflow\n if (this._settings.textOverflow && !this._settings.wordWrap) {\n let suffix;\n switch (this._settings.textOverflow) {\n case 'clip':\n suffix = '';\n break;\n case 'ellipsis':\n suffix = this._settings.overflowSuffix;\n break;\n default:\n suffix = this._settings.textOverflow;\n }\n this._settings.text = this.wrapWord(this._settings.text, wordWrapWidth - textIndent, suffix);\n }\n // word wrap\n // preserve original text\n let linesInfo;\n if (this._settings.wordWrap) {\n linesInfo = this.wrapText(this._settings.text, wordWrapWidth, letterSpacing, textIndent);\n }\n else {\n linesInfo = { l: this._settings.text.split(/(?:\\r\\n|\\r|\\n)/), n: [] };\n const n = linesInfo.l.length;\n for (let i = 0; i < n - 1; i++) {\n linesInfo.n.push(i);\n }\n }\n let lines = linesInfo.l;\n if (this._settings.maxLines && lines.length > this._settings.maxLines) {\n const usedLines = lines.slice(0, this._settings.maxLines);\n let otherLines = null;\n if (this._settings.overflowSuffix) {\n // Wrap again with max lines suffix enabled.\n const w = this._settings.overflowSuffix\n ? this.measureText(this._settings.overflowSuffix)\n : 0;\n const al = this.wrapText(usedLines[usedLines.length - 1], wordWrapWidth - w, letterSpacing, textIndent);\n usedLines[usedLines.length - 1] = `${al.l[0]}${this._settings.overflowSuffix}`;\n otherLines = [al.l.length > 1 ? al.l[1] : ''];\n }\n else {\n otherLines = [''];\n }\n // Re-assemble the remaining text.\n let i;\n const n = lines.length;\n let j = 0;\n const m = linesInfo.n.length;\n for (i = this._settings.maxLines; i < n; i++) {\n otherLines[j] += `${otherLines[j] ? ' ' : ''}${lines[i]}`;\n if (i + 1 < m && linesInfo.n[i + 1]) {\n j++;\n }\n }\n renderInfo.remainingText = otherLines.join('\\n');\n renderInfo.moreTextLines = true;\n lines = usedLines;\n }\n else {\n renderInfo.moreTextLines = false;\n renderInfo.remainingText = '';\n }\n // calculate text width\n let maxLineWidth = 0;\n const lineWidths = [];\n for (let i = 0; i < lines.length; i++) {\n const lineWidth = this.measureText(lines[i], letterSpacing) + (i === 0 ? textIndent : 0);\n lineWidths.push(lineWidth);\n maxLineWidth = Math.max(maxLineWidth, lineWidth);\n }\n renderInfo.lineWidths = lineWidths;\n if (!w) {\n // Auto-set width to max text length.\n width = maxLineWidth + paddingLeft + paddingRight;\n innerWidth = maxLineWidth;\n }\n // calculate text height\n lineHeight = lineHeight || fontSize;\n let height;\n if (h) {\n height = h;\n }\n else {\n height = calcHeight(this._settings.textBaseline, fontSize, lineHeight, lines.length, offsetY);\n }\n if (offsetY === null) {\n offsetY = fontSize;\n }\n renderInfo.w = width;\n renderInfo.h = height;\n renderInfo.lines = lines;\n renderInfo.precision = precision;\n if (!width) {\n // To prevent canvas errors.\n width = 1;\n }\n if (!height) {\n // To prevent canvas errors.\n height = 1;\n }\n if (cutSx || cutEx) {\n width = Math.min(width, cutEx - cutSx);\n }\n if (cutSy || cutEy) {\n height = Math.min(height, cutEy - cutSy);\n }\n renderInfo.width = width;\n renderInfo.innerWidth = innerWidth;\n renderInfo.height = height;\n renderInfo.fontSize = fontSize;\n renderInfo.cutSx = cutSx;\n renderInfo.cutSy = cutSy;\n renderInfo.cutEx = cutEx;\n renderInfo.cutEy = cutEy;\n renderInfo.lineHeight = lineHeight;\n renderInfo.lineWidths = lineWidths;\n renderInfo.offsetY = offsetY;\n renderInfo.paddingLeft = paddingLeft;\n renderInfo.paddingRight = paddingRight;\n renderInfo.letterSpacing = letterSpacing;\n renderInfo.textIndent = textIndent;\n return renderInfo;\n }\n draw(renderInfo, linesOverride) {\n const precision = this.getPrecision();\n // Allow lines to be overriden for partial rendering.\n const lines = linesOverride?.lines || renderInfo.lines;\n const lineWidths = linesOverride?.lineWidths || renderInfo.lineWidths;\n const height = linesOverride\n ? calcHeight(this._settings.textBaseline, renderInfo.fontSize, renderInfo.lineHeight, linesOverride.lines.length, this._settings.offsetY === null\n ? null\n : this._settings.offsetY * precision)\n : renderInfo.height;\n // Add extra margin to prevent issue with clipped text when scaling.\n this._canvas.width = Math.min(Math.ceil(renderInfo.width + this._settings.textRenderIssueMargin), MAX_TEXTURE_DIMENSION);\n this._canvas.height = Math.min(Math.ceil(height), MAX_TEXTURE_DIMENSION);\n // Canvas context has been reset.\n this.setFontProperties();\n if (renderInfo.fontSize >= 128) {\n // WpeWebKit bug: must force compositing because cairo-traps-compositor will not work with text first.\n this._context.globalAlpha = 0.01;\n this._context.fillRect(0, 0, 0.01, 0.01);\n this._context.globalAlpha = 1.0;\n }\n if (renderInfo.cutSx || renderInfo.cutSy) {\n this._context.translate(-renderInfo.cutSx, -renderInfo.cutSy);\n }\n let linePositionX;\n let linePositionY;\n const drawLines = [];\n // Draw lines line by line.\n for (let i = 0, n = lines.length; i < n; i++) {\n linePositionX = i === 0 ? renderInfo.textIndent : 0;\n // By default, text is aligned to top\n linePositionY = i * renderInfo.lineHeight + renderInfo.offsetY;\n if (this._settings.verticalAlign == 'middle') {\n linePositionY += (renderInfo.lineHeight - renderInfo.fontSize) / 2;\n }\n else if (this._settings.verticalAlign == 'bottom') {\n linePositionY += renderInfo.lineHeight - renderInfo.fontSize;\n }\n if (this._settings.textAlign === 'right') {\n linePositionX += renderInfo.innerWidth - lineWidths[i];\n }\n else if (this._settings.textAlign === 'center') {\n linePositionX += (renderInfo.innerWidth - lineWidths[i]) / 2;\n }\n linePositionX += renderInfo.paddingLeft;\n drawLines.push({\n text: lines[i],\n x: linePositionX,\n y: linePositionY,\n w: lineWidths[i],\n });\n }\n // Highlight.\n if (this._settings.highlight) {\n const color = this._settings.highlightColor;\n const hlHeight = this._settings.highlightHeight * precision || renderInfo.fontSize * 1.5;\n const offset = this._settings.highlightOffset * precision;\n const hlPaddingLeft = this._settings.highlightPaddingLeft !== null\n ? this._settings.highlightPaddingLeft * precision\n : renderInfo.paddingLeft;\n const hlPaddingRight = this._settings.highlightPaddingRight !== null\n ? this._settings.highlightPaddingRight * precision\n : renderInfo.paddingRight;\n this._context.fillStyle = getRgbaString(color);\n for (let i = 0; i < drawLines.length; i++) {\n const drawLine = drawLines[i];\n this._context.fillRect(drawLine.x - hlPaddingLeft, drawLine.y - renderInfo.offsetY + offset, drawLine.w + hlPaddingRight + hlPaddingLeft, hlHeight);\n }\n }\n // Text shadow.\n let prevShadowSettings = null;\n if (this._settings.shadow) {\n prevShadowSettings = [\n this._context.shadowColor,\n this._context.shadowOffsetX,\n this._context.shadowOffsetY,\n this._context.shadowBlur,\n ];\n this._context.shadowColor = getRgbaString(this._settings.shadowColor);\n this._context.shadowOffsetX = this._settings.shadowOffsetX * precision;\n this._context.shadowOffsetY = this._settings.shadowOffsetY * precision;\n this._context.shadowBlur = this._settings.shadowBlur * precision;\n }\n this._context.fillStyle = getRgbaString(this._settings.textColor);\n for (let i = 0, n = drawLines.length; i < n; i++) {\n const drawLine = drawLines[i];\n if (renderInfo.letterSpacing === 0) {\n this._context.fillText(drawLine.text, drawLine.x, drawLine.y);\n }\n else {\n const textSplit = drawLine.text.split('');\n let x = drawLine.x;\n for (let i = 0, j = textSplit.length; i < j; i++) {\n this._context.fillText(textSplit[i], x, drawLine.y);\n x += this.measureText(textSplit[i], renderInfo.letterSpacing);\n }\n }\n }\n if (prevShadowSettings) {\n this._context.shadowColor = prevShadowSettings[0];\n this._context.shadowOffsetX = prevShadowSettings[1];\n this._context.shadowOffsetY = prevShadowSettings[2];\n this._context.shadowBlur = prevShadowSettings[3];\n }\n if (renderInfo.cutSx || renderInfo.cutSy) {\n this._context.translate(renderInfo.cutSx, renderInfo.cutSy);\n }\n this.renderInfo = renderInfo;\n }\n wrapWord(word, wordWrapWidth, suffix) {\n const suffixWidth = this._context.measureText(suffix).width;\n const wordLen = word.length;\n const wordWidth = this._context.measureText(word).width;\n /* If word fits wrapWidth, do nothing */\n if (wordWidth <= wordWrapWidth) {\n return word;\n }\n /* Make initial guess for text cuttoff */\n let cutoffIndex = Math.floor((wordWrapWidth * wordLen) / wordWidth);\n let truncWordWidth = this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n /* In case guess was overestimated, shrink it letter by letter. */\n if (truncWordWidth > wordWrapWidth) {\n while (cutoffIndex > 0) {\n truncWordWidth =\n this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n if (truncWordWidth > wordWrapWidth) {\n cutoffIndex -= 1;\n }\n else {\n break;\n }\n }\n /* In case guess was underestimated, extend it letter by letter. */\n }\n else {\n while (cutoffIndex < wordLen) {\n truncWordWidth =\n this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n if (truncWordWidth < wordWrapWidth) {\n cutoffIndex += 1;\n }\n else {\n // Finally, when bound is crossed, retract last letter.\n cutoffIndex -= 1;\n break;\n }\n }\n }\n /* If wrapWidth is too short to even contain suffix alone, return empty string */\n return (word.substring(0, cutoffIndex) +\n (wordWrapWidth >= suffixWidth ? suffix : ''));\n }\n /**\n * Applies newlines to a string to have it optimally fit into the horizontal\n * bounds set by the Text object's wordWrapWidth property.\n */\n wrapText(text, wordWrapWidth, letterSpacing, indent = 0) {\n // Greedy wrapping algorithm that will wrap words as the line grows longer.\n // than its horizontal bounds.\n const lines = text.split(/\\r?\\n/g);\n let allLines = [];\n const realNewlines = [];\n for (let i = 0; i < lines.length; i++) {\n const resultLines = [];\n let result = '';\n let spaceLeft = wordWrapWidth - indent;\n const words = lines[i].split(' ');\n for (let j = 0; j < words.length; j++) {\n const wordWidth = this.measureText(words[j], letterSpacing);\n const wordWidthWithSpace = wordWidth + this.measureText(' ', letterSpacing);\n if (j === 0 || wordWidthWithSpace > spaceLeft) {\n // Skip printing the newline if it's the first word of the line that is.\n // greater than the word wrap width.\n if (j > 0) {\n resultLines.push(result);\n result = '';\n }\n result += words[j];\n spaceLeft = wordWrapWidth - wordWidth - (j === 0 ? indent : 0);\n }\n else {\n spaceLeft -= wordWidthWithSpace;\n result += ` ${words[j]}`;\n }\n }\n resultLines.push(result);\n result = '';\n allLines = allLines.concat(resultLines);\n if (i < lines.length - 1) {\n realNewlines.push(allLines.length);\n }\n }\n return { l: allLines, n: realNewlines };\n }\n measureText(word, space = 0) {\n if (!space) {\n return this._context.measureText(word).width;\n }\n return word.split('').reduce((acc, char) => {\n return acc + this._context.measureText(char).width + space;\n }, 0);\n }\n mergeDefaults(settings) {\n return {\n text: '',\n w: 0,\n h: 0,\n fontStyle: 'normal',\n fontSize: 40,\n fontFace: null,\n wordWrap: true,\n wordWrapWidth: 0,\n wordBreak: false,\n textOverflow: '',\n lineHeight: null,\n textBaseline: 'alphabetic',\n textAlign: 'left',\n verticalAlign: 'top',\n offsetY: null,\n maxLines: 0,\n overflowSuffix: '...',\n textColor: [1.0, 1.0, 1.0, 1.0],\n paddingLeft: 0,\n paddingRight: 0,\n shadow: false,\n shadowColor: [0.0, 0.0, 0.0, 1.0],\n shadowOffsetX: 0,\n shadowOffsetY: 0,\n shadowBlur: 5,\n highlight: false,\n highlightHeight: 0,\n highlightColor: [0.0, 0.0, 0.0, 1.0],\n highlightOffset: 0,\n highlightPaddingLeft: 0,\n highlightPaddingRight: 0,\n letterSpacing: 0,\n textIndent: 0,\n cutSx: 0,\n cutEx: 0,\n cutSy: 0,\n cutEy: 0,\n advancedRenderer: false,\n fontBaselineRatio: 0,\n precision: 1,\n textRenderIssueMargin: 0,\n ...settings,\n };\n }\n}\n//# sourceMappingURL=LightningTextTextureRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EventEmitter } from '../../../common/EventEmitter.js';\nimport { assertTruthy, mergeColorAlphaPremultiplied } from '../../../utils.js';\nimport { intersectRect, intersectBound, getNormalizedRgbaComponents, getNormalizedAlphaComponent, createBound, } from '../../lib/utils.js';\nimport { WebTrFontFace } from '../font-face-types/WebTrFontFace.js';\nimport { LightningTextTextureRenderer, } from './LightningTextTextureRenderer.js';\nimport { TextRenderer, } from './TextRenderer.js';\nconst resolvedGlobal = typeof self === 'undefined' ? globalThis : self;\n/**\n * Global font set regardless of if run in the main thread or a web worker\n */\nconst globalFontSet = (resolvedGlobal.document?.fonts ||\n resolvedGlobal.fonts);\nfunction getFontCssString(props) {\n const { fontFamily, fontStyle, fontWeight, fontStretch, fontSize } = props;\n return [fontStyle, fontWeight, fontStretch, `${fontSize}px`, fontFamily].join(' ');\n}\n/**\n * Ephemeral bounds object used for intersection calculations\n *\n * @remarks\n * Used to avoid creating a new object every time we need to intersect\n * element bounds.\n */\nconst tmpElementBounds = createBound(0, 0, 0, 0);\nexport class CanvasTextRenderer extends TextRenderer {\n canvas;\n context;\n rendererBounds;\n constructor(stage) {\n super(stage);\n if (typeof OffscreenCanvas !== 'undefined') {\n this.canvas = new OffscreenCanvas(0, 0);\n }\n else {\n this.canvas = document.createElement('canvas');\n }\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n let context = this.canvas.getContext('2d');\n if (!context) {\n // A browser may appear to support OffscreenCanvas but not actually support the Canvas '2d' context\n // Here we try getting the context again after falling back to an HTMLCanvasElement.\n // See: https://github.com/lightning-js/renderer/issues/26#issuecomment-1750438486\n this.canvas = document.createElement('canvas');\n context = this.canvas.getContext('2d');\n }\n assertTruthy(context);\n this.context = context;\n this.rendererBounds = {\n x1: 0,\n y1: 0,\n x2: this.stage.options.appWidth,\n y2: this.stage.options.appHeight,\n };\n }\n //#region Overrides\n getPropertySetters() {\n return {\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n text: (state, value) => {\n state.props.text = value;\n this.invalidateLayoutCache(state);\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n this.invalidateLayoutCache(state);\n },\n color: (state, value) => {\n state.props.color = value;\n this.invalidateLayoutCache(state);\n },\n x: (state, value) => {\n state.props.x = value;\n this.invalidateVisibleWindowCache(state);\n },\n y: (state, value) => {\n state.props.y = value;\n this.invalidateVisibleWindowCache(state);\n },\n contain: (state, value) => {\n state.props.contain = value;\n this.invalidateLayoutCache(state);\n },\n width: (state, value) => {\n state.props.width = value;\n // Only invalidate layout cache if we're containing in the horizontal direction\n if (state.props.contain !== 'none') {\n this.invalidateLayoutCache(state);\n }\n },\n height: (state, value) => {\n state.props.height = value;\n // Only invalidate layout cache if we're containing in the vertical direction\n if (state.props.contain === 'both') {\n this.invalidateLayoutCache(state);\n }\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n this.invalidateLayoutCache(state);\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n this.invalidateLayoutCache(state);\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n this.invalidateLayoutCache(state);\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n this.invalidateLayoutCache(state);\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n this.invalidateLayoutCache(state);\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n this.invalidateLayoutCache(state);\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n this.invalidateLayoutCache(state);\n },\n // debug: (state, value) => {\n // state.props.debug = value;\n // },\n };\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n canRenderFont(props) {\n // The canvas renderer can render any font because it automatically\n // falls back to system fonts. The CanvasTextRenderer should be\n // checked last if other renderers are preferred.\n return true;\n }\n isFontFaceSupported(fontFace) {\n return fontFace instanceof WebTrFontFace;\n }\n addFontFace(fontFace) {\n // Make sure the font face is an Canvas font face (it should have already passed\n // the `isFontFaceSupported` check)\n assertTruthy(fontFace instanceof WebTrFontFace);\n // We simply add the font face to the document\n // @ts-expect-error `add()` method should be available from a FontFaceSet\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n globalFontSet.add(fontFace.fontFace);\n }\n createState(props) {\n return {\n props,\n status: 'initialState',\n updateScheduled: false,\n emitter: new EventEmitter(),\n canvasPages: undefined,\n lightning2TextRenderer: new LightningTextTextureRenderer(this.canvas, this.context),\n renderWindow: undefined,\n visibleWindow: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n valid: false,\n },\n renderInfo: undefined,\n forceFullLayoutCalc: false,\n textW: 0,\n textH: 0,\n fontInfo: undefined,\n fontFaceLoadedHandler: undefined,\n isRenderable: false,\n debugData: {\n updateCount: 0,\n layoutCount: 0,\n drawCount: 0,\n lastLayoutNumCharacters: 0,\n layoutSum: 0,\n drawSum: 0,\n bufferSize: 0,\n },\n };\n }\n updateState(state) {\n // On the first update call we need to set the status to loading\n if (state.status === 'initialState') {\n this.setStatus(state, 'loading');\n }\n // If fontInfo is invalid, we need to establish it\n if (!state.fontInfo) {\n const cssString = getFontCssString(state.props);\n state.fontInfo = {\n cssString: cssString,\n // TODO: For efficiency we would use this here but it's not reliable on WPE -> document.fonts.check(cssString),\n loaded: false,\n };\n // If font is not loaded, set up a handler to update the font info when the font loads\n if (!state.fontInfo.loaded) {\n globalFontSet\n .load(cssString)\n .then(this.onFontLoaded.bind(this, state, cssString))\n .catch(this.onFontLoadError.bind(this, state, cssString));\n return;\n }\n }\n // If we're waiting for a font face to load, don't render anything\n if (!state.fontInfo.loaded) {\n return;\n }\n if (!state.renderInfo) {\n const maxLines = state.props.maxLines;\n const containedMaxLines = state.props.contain === 'both'\n ? Math.floor((state.props.height - state.props.offsetY) /\n state.props.lineHeight)\n : 0;\n const calcMaxLines = containedMaxLines > 0 && maxLines > 0\n ? Math.min(containedMaxLines, maxLines)\n : Math.max(containedMaxLines, maxLines);\n state.lightning2TextRenderer.settings = {\n text: state.props.text,\n textAlign: state.props.textAlign,\n fontFace: state.props.fontFamily,\n fontSize: state.props.fontSize,\n fontStyle: [\n state.props.fontStretch,\n state.props.fontStyle,\n state.props.fontWeight,\n ].join(' '),\n textColor: getNormalizedRgbaComponents(state.props.color),\n offsetY: state.props.fontSize + state.props.offsetY,\n wordWrap: state.props.contain !== 'none',\n wordWrapWidth: state.props.contain === 'none' ? undefined : state.props.width,\n letterSpacing: state.props.letterSpacing,\n lineHeight: state.props.lineHeight,\n maxLines: calcMaxLines,\n textBaseline: state.props.textBaseline,\n verticalAlign: state.props.verticalAlign,\n overflowSuffix: state.props.overflowSuffix,\n };\n // const renderInfoCalculateTime = performance.now();\n state.renderInfo = state.lightning2TextRenderer.calculateRenderInfo();\n // console.log(\n // 'Render info calculated in',\n // performance.now() - renderInfoCalculateTime,\n // 'ms',\n // );\n state.textH = state.renderInfo.lineHeight * state.renderInfo.lines.length;\n state.textW = state.renderInfo.width;\n // Invalidate renderWindow because the renderInfo changed\n state.renderWindow = undefined;\n }\n const { x, y, width, height, scrollY, contain } = state.props;\n const { visibleWindow } = state;\n let { renderWindow, canvasPages } = state;\n if (!visibleWindow.valid) {\n // Figure out whats actually in the bounds of the renderer/canvas (visibleWindow)\n const elementBounds = createBound(x, y, contain !== 'none' ? x + width : Infinity, contain === 'both' ? y + height : Infinity, tmpElementBounds);\n /**\n * Area that is visible on the screen.\n */\n intersectBound(this.rendererBounds, elementBounds, visibleWindow);\n visibleWindow.valid = true;\n }\n const visibleWindowHeight = visibleWindow.y2 - visibleWindow.y1;\n const maxLinesPerCanvasPage = Math.ceil(visibleWindowHeight / state.renderInfo.lineHeight);\n if (visibleWindowHeight === 0) {\n // Nothing to render. Clear any canvasPages and existing renderWindow\n // Return early.\n canvasPages = undefined;\n renderWindow = undefined;\n this.setStatus(state, 'loaded');\n return;\n }\n else if (renderWindow && canvasPages) {\n // Return early if we're still viewing inside the established render window\n // No need to re-render what we've already rendered\n const renderWindowScreenX1 = x + renderWindow.x1;\n const renderWindowScreenY1 = y - scrollY + renderWindow.y1;\n const renderWindowScreenX2 = x + renderWindow.x2;\n const renderWindowScreenY2 = y - scrollY + renderWindow.y2;\n if (renderWindowScreenX1 <= visibleWindow.x1 &&\n renderWindowScreenX2 >= visibleWindow.x2 &&\n renderWindowScreenY1 <= visibleWindow.y1 &&\n renderWindowScreenY2 >= visibleWindow.y2) {\n this.setStatus(state, 'loaded');\n return;\n }\n if (renderWindowScreenY2 < visibleWindow.y2) {\n // We've scrolled up, so we need to render the next page\n renderWindow.y1 += maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n renderWindow.y2 += maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n canvasPages.push(canvasPages.shift());\n canvasPages[2].lineNumStart =\n canvasPages[1].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[2].lineNumEnd =\n canvasPages[2].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[2].valid = false;\n }\n else if (renderWindowScreenY1 > visibleWindow.y1) {\n // We've scrolled down, so we need to render the previous page\n renderWindow.y1 -= maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n renderWindow.y2 -= maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n canvasPages.unshift(canvasPages.pop());\n canvasPages[0].lineNumStart =\n canvasPages[1].lineNumStart - maxLinesPerCanvasPage;\n canvasPages[0].lineNumEnd =\n canvasPages[0].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[0].valid = false;\n }\n }\n else {\n const pageHeight = state.renderInfo.lineHeight * maxLinesPerCanvasPage;\n const page1Block = Math.ceil(scrollY / pageHeight);\n const page1LineStart = page1Block * maxLinesPerCanvasPage;\n const page0LineStart = page1LineStart - maxLinesPerCanvasPage;\n const page2LineStart = page1LineStart + maxLinesPerCanvasPage;\n // We haven't rendered anything yet, so we need to render the first page\n // If canvasPages already exist, let's re-use the textures\n canvasPages = [\n {\n texture: canvasPages?.[0].texture,\n lineNumStart: page0LineStart,\n lineNumEnd: page0LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n {\n texture: canvasPages?.[1].texture,\n lineNumStart: page1LineStart,\n lineNumEnd: page1LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n {\n texture: canvasPages?.[2].texture,\n lineNumStart: page2LineStart,\n lineNumEnd: page2LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n ];\n state.canvasPages = canvasPages;\n const scrollYNearestPage = page1Block * pageHeight;\n renderWindow = {\n x1: 0,\n y1: scrollYNearestPage - pageHeight,\n x2: width,\n y2: scrollYNearestPage + pageHeight * 2,\n };\n }\n state.renderWindow = renderWindow;\n const pageDrawTime = performance.now();\n for (const pageInfo of canvasPages) {\n if (pageInfo.valid)\n continue;\n if (pageInfo.lineNumStart < 0) {\n pageInfo.texture?.setRenderableOwner(state, false);\n pageInfo.texture = this.stage.txManager.loadTexture('ImageTexture', {\n src: '',\n });\n pageInfo.texture.setRenderableOwner(state, state.isRenderable);\n pageInfo.valid = true;\n continue;\n }\n state.lightning2TextRenderer.draw(state.renderInfo, {\n lines: state.renderInfo.lines.slice(pageInfo.lineNumStart, pageInfo.lineNumEnd),\n lineWidths: state.renderInfo.lineWidths.slice(pageInfo.lineNumStart, pageInfo.lineNumEnd),\n });\n if (!(this.canvas.width === 0 || this.canvas.height === 0)) {\n pageInfo.texture?.setRenderableOwner(state, false);\n pageInfo.texture = this.stage.txManager.loadTexture('ImageTexture', {\n src: this.context.getImageData(0, 0, this.canvas.width, this.canvas.height),\n }, {\n preload: true,\n });\n pageInfo.texture.setRenderableOwner(state, state.isRenderable);\n }\n pageInfo.valid = true;\n }\n // console.log('pageDrawTime', performance.now() - pageDrawTime, 'ms');\n // Report final status\n this.setStatus(state, 'loaded');\n }\n renderQuads(state, transform, clippingRect, alpha) {\n const { stage } = this;\n const { canvasPages, textW = 0, textH = 0, renderWindow } = state;\n if (!canvasPages || !renderWindow)\n return;\n const { x, y, scrollY, contain, width, height /*, debug*/ } = state.props;\n const elementRect = {\n x: x,\n y: y,\n width: contain !== 'none' ? width : textW,\n height: contain === 'both' ? height : textH,\n };\n const visibleRect = intersectRect({\n x: 0,\n y: 0,\n width: stage.options.appWidth,\n height: stage.options.appHeight,\n }, elementRect);\n // if (!debug.disableScissor) {\n // renderer.enableScissor(\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n assertTruthy(canvasPages, 'canvasPages is not defined');\n assertTruthy(renderWindow, 'renderWindow is not defined');\n const renderWindowHeight = renderWindow.y2 - renderWindow.y1;\n const pageSize = renderWindowHeight / 3.0;\n const { zIndex, color } = state.props;\n // Color alpha of text is not properly rendered to the Canvas texture, so we\n // need to apply it here.\n const combinedAlpha = alpha * getNormalizedAlphaComponent(color);\n const quadColor = mergeColorAlphaPremultiplied(0xffffffff, combinedAlpha);\n if (canvasPages[0].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[0].texture?.dimensions?.width || 0,\n height: canvasPages[0].texture?.dimensions?.height || 0,\n texture: canvasPages[0].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n if (canvasPages[1].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[1].texture?.dimensions?.width || 0,\n height: canvasPages[1].texture?.dimensions?.height || 0,\n texture: canvasPages[1].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1 + pageSize,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n if (canvasPages[2].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[2].texture?.dimensions?.width || 0,\n height: canvasPages[2].texture?.dimensions?.height || 0,\n texture: canvasPages[2].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1 + pageSize + pageSize,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n // renderer.disableScissor();\n // if (debug.showElementRect) {\n // this.renderer.drawBorder(\n // Colors.Blue,\n // elementRect.x,\n // elementRect.y,\n // elementRect.w,\n // elementRect.h,\n // );\n // }\n // if (debug.showVisibleRect) {\n // this.renderer.drawBorder(\n // Colors.Green,\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // if (debug.showRenderWindow && renderWindow) {\n // this.renderer.drawBorder(\n // Colors.Red,\n // x + renderWindow.x1,\n // y + renderWindow.y1 - scrollY,\n // x + renderWindow.x2 - (x + renderWindow.x1),\n // y + renderWindow.y2 - scrollY - (y + renderWindow.y1 - scrollY),\n // );\n // }\n }\n setIsRenderable(state, renderable) {\n super.setIsRenderable(state, renderable);\n // Set state object owner from any canvas page textures\n state.canvasPages?.forEach((pageInfo) => {\n pageInfo.texture?.setRenderableOwner(state, renderable);\n });\n }\n destroyState(state) {\n // Remove state object owner from any canvas page textures\n state.canvasPages?.forEach((pageInfo) => {\n pageInfo.texture?.setRenderableOwner(state, false);\n });\n }\n //#endregion Overrides\n /**\n * Invalidate the visible window stored in the state. This will cause a new\n * visible window to be calculated on the next update.\n *\n * @param state\n */\n invalidateVisibleWindowCache(state) {\n state.visibleWindow.valid = false;\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n /**\n * Invalidate the layout cache stored in the state. This will cause the text\n * to be re-layed out on the next update.\n *\n * @remarks\n * This also invalidates the visible window cache.\n *\n * @param state\n */\n invalidateLayoutCache(state) {\n state.renderInfo = undefined;\n state.visibleWindow.valid = false;\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n onFontLoaded(state, cssString) {\n if (cssString !== state.fontInfo?.cssString || !state.fontInfo) {\n return;\n }\n state.fontInfo.loaded = true;\n this.scheduleUpdateState(state);\n }\n onFontLoadError(state, cssString, error) {\n if (cssString !== state.fontInfo?.cssString || !state.fontInfo) {\n return;\n }\n // Font didn't actually load, but we'll log the error and mark it as loaded\n // because the browser can still render with a fallback font.\n state.fontInfo.loaded = true;\n console.error(`CanvasTextRenderer: Error loading font '${state.fontInfo.cssString}'`, error);\n this.scheduleUpdateState(state);\n }\n}\n//# sourceMappingURL=CanvasTextRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\nexport class DefaultShader extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2fv' },\n ],\n });\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `,\n fragment: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate);\n gl_FragColor = vec4(v_color) * texture2D(u_texture, v_textureCoordinate);\n }\n `,\n };\n}\n//# sourceMappingURL=DefaultShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\n// import type { Texture } from '../textures/Texture';\nexport class DefaultShaderBatched extends WebGlCoreShader {\n supportsIndexedTextures = true;\n constructor(renderer) {\n super({\n renderer,\n attributes: [\n 'a_position',\n 'a_textureCoordinate',\n 'a_color',\n 'a_textureIndex',\n ],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_textures[0]', uniform: 'uniform1iv' },\n ],\n });\n }\n bindTextures(texture) {\n const { renderer, glw } = this;\n if (texture.length > renderer.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS) {\n throw new Error(`DefaultShaderBatched: Cannot bind more than ${renderer.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS} textures`);\n }\n texture.forEach((t, i) => {\n glw.activeTexture(i);\n glw.bindTexture(t.ctxTexture);\n });\n const samplers = Array.from(Array(texture.length).keys());\n this.setUniform('u_textures[0]', samplers);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `,\n fragment: (textureUnits) => `\n #define txUnits ${textureUnits}\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_image;\n uniform sampler2D u_textures[txUnits];\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n vec4 sampleFromTexture(sampler2D textures[${textureUnits}], int idx, vec2 uv) {\n ${Array.from(Array(textureUnits).keys())\n .map((idx) => `\n ${idx !== 0 ? 'else ' : ''}if (idx == ${idx}) {\n return texture2D(textures[${idx}], uv);\n }\n `)\n .join('')}\n return texture2D(textures[0], uv);\n }\n\n void main(){\n gl_FragColor = vec4(v_color) * sampleFromTexture(u_textures, int(v_textureIndex), v_textureCoordinate);\n }\n `,\n };\n}\n//# sourceMappingURL=DefaultShaderBatched.js.map","import { WebGlCoreShader, } from '../WebGlCoreShader.js';\nimport { ShaderEffect } from './effects/ShaderEffect.js';\nimport memize from 'memize';\nconst effectCache = new Map();\nconst getResolvedEffect = (effects, effectContructors) => {\n const key = JSON.stringify(effects);\n if (effectCache.has(key)) {\n return effectCache.get(key);\n }\n const value = (effects ?? []).map((effect) => ({\n type: effect.type,\n props: effectContructors[effect.type].resolveDefaults((effect.props || {})),\n }));\n effectCache.set(key, value);\n return value;\n};\nexport class DynamicShader extends WebGlCoreShader {\n effects = [];\n constructor(renderer, props, effectContructors) {\n const shader = DynamicShader.createShader(props, effectContructors);\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2fv' },\n { name: 'u_dimensions', uniform: 'uniform2fv' },\n { name: 'u_alpha', uniform: 'uniform1f' },\n ...shader.uniforms,\n ],\n shaderSources: {\n vertex: shader.vertex,\n fragment: shader.fragment,\n },\n });\n this.effects = shader.effects;\n this.calculateProps = memize(this.calculateProps.bind(this));\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n calculateProps(effects) {\n const regEffects = this.renderer.shManager.getRegisteredEffects();\n const results = [];\n effects?.forEach((eff, index) => {\n const effect = this.effects[index];\n const fxClass = regEffects[effect.name];\n const props = eff.props ?? {};\n const uniInfo = effect.uniformInfo;\n Object.keys(props).forEach((p) => {\n const fxProp = fxClass.uniforms[p];\n const propInfo = uniInfo[p];\n let value = fxProp.validator\n ? fxProp.validator(props[p], props)\n : props[p];\n if (Array.isArray(value)) {\n value = new Float32Array(value);\n }\n results.push({ name: propInfo.name, value });\n });\n });\n return results;\n }\n bindProps(props) {\n const results = this.calculateProps(props.effects);\n results.forEach((r) => {\n this.setUniform(r.name, r.value);\n });\n }\n static createShader(props, effectContructors) {\n //counts duplicate effects\n const effectNameCount = {};\n const methods = {};\n let declareUniforms = '';\n const uniforms = [];\n const uFx = [];\n const effects = props.effects.map((effect) => {\n const baseClass = effectContructors[effect.type];\n const key = baseClass.getEffectKey(effect.props || {});\n effectNameCount[key] = effectNameCount[key] ? ++effectNameCount[key] : 1;\n const nr = effectNameCount[key];\n if (nr === 1) {\n uFx.push({ key, type: effect.type, props: effect.props });\n }\n //initialize new effect class;\n const fxClass = new baseClass({\n ref: `${key}${nr === 1 ? '' : nr}`,\n target: key,\n props: effect.props,\n });\n declareUniforms += fxClass.declaredUniforms;\n uniforms.push(...Object.values(fxClass.uniformInfo));\n return fxClass;\n });\n //build source\n let effectMethods = '';\n uFx?.forEach((fx) => {\n const fxClass = effectContructors[fx.type];\n const fxProps = fxClass.resolveDefaults((fx.props ?? {}));\n const remap = [];\n for (const m in fxClass.methods) {\n let cm = m;\n const fxMethod = fxClass.methods[m];\n if (methods[m] && methods[m] !== fxMethod) {\n cm = DynamicShader.resolveMethodDuplicate(m, fxMethod, methods);\n }\n methods[cm] = fxMethod.replace('function', cm);\n remap.push({ m, cm });\n }\n let onShaderMask = fxClass.onShaderMask instanceof Function\n ? fxClass.onShaderMask(fxProps)\n : fxClass.onShaderMask;\n let onColorize = fxClass.onColorize instanceof Function\n ? fxClass.onColorize(fxProps)\n : fxClass.onColorize;\n let onEffectMask = fxClass.onEffectMask instanceof Function\n ? fxClass.onEffectMask(fxProps)\n : fxClass.onEffectMask;\n remap.forEach((r) => {\n const { m, cm } = r;\n const reg = new RegExp(`\\\\$${m}`, 'g');\n if (onShaderMask) {\n onShaderMask = onShaderMask.replace(reg, cm);\n }\n if (onColorize) {\n onColorize = onColorize.replace(reg, cm);\n }\n if (onEffectMask) {\n onEffectMask = onEffectMask.replace(reg, cm);\n }\n });\n const methodParameters = fxClass.getMethodParameters(fxClass.uniforms, fxProps);\n const pm = methodParameters.length > 0 ? `, ${methodParameters}` : '';\n if (onShaderMask) {\n effectMethods += `\n float fx_${fx.key}_onShaderMask(float shaderMask ${pm}) {\n ${onShaderMask}\n }\n `;\n }\n if (onColorize) {\n effectMethods += `\n vec4 fx_${fx.key}_onColorize(float shaderMask, vec4 maskColor, vec4 shaderColor${pm}) {\n ${onColorize}\n }\n `;\n }\n if (onEffectMask) {\n effectMethods += `\n vec4 fx_${fx.key}_onEffectMask(float shaderMask, vec4 maskColor, vec4 shaderColor${pm}) {\n ${onEffectMask}\n }\n `;\n }\n });\n let sharedMethods = '';\n for (const m in methods) {\n sharedMethods += methods[m];\n }\n //fill main functions\n let currentMask = `mix(shaderColor, maskColor, clamp(-(lng_DefaultMask), 0.0, 1.0))`;\n let drawEffects = `\n\n `;\n for (let i = 0; i < effects.length; i++) {\n const current = effects[i];\n const pm = current.passParameters.length > 0 ? `, ${current.passParameters}` : '';\n const currentClass = effectContructors[current.name];\n if (currentClass.onShaderMask) {\n drawEffects += `\n shaderMask = fx_${current.target}_onShaderMask(shaderMask ${pm});\n `;\n }\n if (currentClass.onColorize) {\n drawEffects += `\n maskColor = fx_${current.target}_onColorize(shaderMask, maskColor, shaderColor${pm});\n `;\n }\n if (currentClass.onEffectMask) {\n currentMask = `fx_${current.target}_onEffectMask(shaderMask, maskColor, shaderColor${pm})`;\n }\n const next = effects[i + 1];\n if (next === undefined ||\n effectContructors[next.name].onEffectMask) {\n drawEffects += `\n shaderColor = ${currentMask};\n `;\n }\n }\n return {\n effects,\n uniforms,\n fragment: DynamicShader.fragment(declareUniforms, sharedMethods, effectMethods, drawEffects),\n vertex: DynamicShader.vertex(),\n };\n }\n static resolveMethodDuplicate(key, effectMethod, methodCollection, increment = 0) {\n const m = key + (increment > 0 ? increment : '');\n if (methodCollection[m] && methodCollection[m] !== effectMethod) {\n return this.resolveMethodDuplicate(key, effectMethod, methodCollection, ++increment);\n }\n return m;\n }\n static resolveDefaults(props, effectContructors) {\n return {\n effects: getResolvedEffect(props.effects, effectContructors),\n $dimensions: {\n width: 0,\n height: 0,\n },\n $alpha: 0,\n };\n }\n static makeCacheKey(props, effectContructors) {\n let fx = '';\n props.effects?.forEach((effect) => {\n const baseClass = effectContructors[effect.type];\n const key = baseClass.getEffectKey(effect.props || {});\n fx += `,${key}`;\n });\n return `DynamicShader${fx}`;\n }\n static z$__type__Props;\n static vertex = () => `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `;\n static fragment = (uniforms, methods, effectMethods, drawEffects) => `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n #define PI 3.14159265359\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_alpha;\n uniform float u_radius;\n uniform sampler2D u_texture;\n uniform float u_pixelRatio;\n\n ${uniforms}\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n ${methods}\n\n ${effectMethods}\n\n void main() {\n vec2 p = v_textureCoordinate.xy * u_dimensions - u_dimensions * 0.5;\n vec2 d = abs(p) - (u_dimensions) * 0.5;\n float lng_DefaultMask = min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n\n vec4 shaderColor = vec4(0.0);\n float shaderMask = lng_DefaultMask;\n\n vec4 maskColor = texture2D(u_texture, v_textureCoordinate) * v_color;\n\n shaderColor = mix(shaderColor, maskColor, clamp(-(lng_DefaultMask + 0.5), 0.0, 1.0));\n\n ${drawEffects}\n\n gl_FragColor = shaderColor * u_alpha;\n }\n `;\n}\n//# sourceMappingURL=DynamicShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader, } from '../WebGlCoreShader.js';\n/**\n * Similar to the {@link DefaultShader} but cuts out 4 rounded rectangle corners\n * as defined by the specified corner {@link RoundedRectangleProps.radius}\n */\nexport class RoundedRectangle extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2f' },\n { name: 'u_dimensions', uniform: 'uniform2fv' },\n { name: 'u_radius', uniform: 'uniform1f' },\n ],\n });\n }\n static z$__type__Props;\n static resolveDefaults(props) {\n return {\n radius: props.radius || 10,\n $dimensions: {\n width: 0,\n height: 0,\n },\n };\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n bindProps(props) {\n this.setUniform('u_radius', props.radius);\n }\n canBatchShaderProps(propsA, propsB) {\n return (propsA.radius === propsB.radius &&\n propsA.$dimensions.width === propsB.$dimensions.width &&\n propsA.$dimensions.height === propsB.$dimensions.height);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `,\n fragment: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_radius;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n float boxDist(vec2 p, vec2 size, float radius){\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n\n float fillMask(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate) * v_color;\n vec2 halfDimensions = u_dimensions * 0.5;\n\n float d = boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions + 0.5, u_radius);\n gl_FragColor = mix(vec4(0.0), color, fillMask(d));\n }\n `,\n };\n}\n//# sourceMappingURL=RoundedRectangle.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../lib/utils.js';\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\nconst IDENTITY_MATRIX_3x3 = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]);\n/**\n * SdfShader supports multi-channel and single-channel signed distance field textures.\n *\n * @remarks\n * This Shader is used by the {@link SdfTextRenderer}. Do not use thie Shader\n * directly. Instead create a Text Node and assign a SDF font family to it.\n *\n * @internalRemarks\n * The only thing this shader does to support multi-channel SDFs is to\n * add a median function to the fragment shader. If this one function call\n * ends up being a performance bottleneck we can always look at ways to\n * remove it.\n */\nexport class SdfShader extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_transform', uniform: 'uniformMatrix3fv' },\n { name: 'u_scrollY', uniform: 'uniform1f' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2f' },\n { name: 'u_color', uniform: 'uniform4fv' },\n { name: 'u_size', uniform: 'uniform1f' },\n { name: 'u_distanceRange', uniform: 'uniform1f' },\n { name: 'u_debug', uniform: 'uniform1i' },\n ],\n });\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n bindProps(props) {\n const resolvedProps = SdfShader.resolveDefaults(props);\n for (const key in resolvedProps) {\n if (key === 'transform') {\n this.setUniform('u_transform', false, resolvedProps[key]);\n }\n else if (key === 'scrollY') {\n this.setUniform('u_scrollY', resolvedProps[key]);\n }\n else if (key === 'color') {\n const components = getNormalizedRgbaComponents(resolvedProps.color);\n this.setUniform('u_color', components);\n }\n else if (key === 'size') {\n this.setUniform('u_size', resolvedProps[key]);\n }\n else if (key === 'distanceRange') {\n this.setUniform('u_distanceRange', resolvedProps[key]);\n }\n else if (key === 'debug') {\n this.setUniform('u_debug', resolvedProps[key] ? 1.0 : 0.0);\n }\n }\n }\n static resolveDefaults(props = {}) {\n return {\n transform: props.transform ?? IDENTITY_MATRIX_3x3,\n scrollY: props.scrollY ?? 0,\n color: props.color ?? 0xffffffff,\n size: props.size ?? 16,\n distanceRange: props.distanceRange ?? 1.0,\n debug: props.debug ?? false,\n };\n }\n static shaderSources = {\n vertex: `\n // an attribute is an input (in) to a vertex shader.\n // It will receive data from a buffer\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n\n uniform vec2 u_resolution;\n uniform mat3 u_transform;\n uniform float u_scrollY;\n uniform float u_pixelRatio;\n uniform float u_size;\n\n varying vec2 v_texcoord;\n\n void main() {\n vec2 scrolledPosition = a_position * u_size - vec2(0, u_scrollY);\n vec2 transformedPosition = (u_transform * vec3(scrolledPosition, 1)).xy;\n gl_Position = vec4((transformedPosition * u_pixelRatio / u_resolution * 2.0 - 1.0) * vec2(1, -1), 0, 1);\n v_texcoord = a_textureCoordinate;\n }\n `,\n fragment: `\n precision highp float;\n\n uniform vec4 u_color;\n uniform sampler2D u_texture;\n uniform float u_distanceRange;\n uniform float u_pixelRatio;\n uniform int u_debug;\n\n varying vec2 v_texcoord;\n\n float median(float r, float g, float b) {\n return max(min(r, g), min(max(r, g), b));\n }\n\n void main() {\n vec3 sample = texture2D(u_texture, v_texcoord).rgb;\n if (u_debug == 1) {\n gl_FragColor = vec4(sample.r, sample.g, sample.b, 1.0);\n return;\n }\n float scaledDistRange = u_distanceRange * u_pixelRatio;\n float sigDist = scaledDistRange * (median(sample.r, sample.g, sample.b) - 0.5);\n float opacity = clamp(sigDist + 0.5, 0.0, 1.0) * u_color.a;\n\n // Build the final color.\n // IMPORTANT: We must premultiply the color by the alpha value before returning it.\n gl_FragColor = vec4(u_color.r * opacity, u_color.g * opacity, u_color.b * opacity, opacity);\n }\n `,\n };\n}\n//# sourceMappingURL=SdfShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Masks the current maskcolor with rounded corners similar to {@link RoundedRectangle}\n */\nexport class RadiusEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radius';\n static getEffectKey() {\n return `radius`;\n }\n static uniforms = {\n radius: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n boxDist: `\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n `,\n };\n static resolveDefaults(props) {\n return {\n radius: props.radius ?? 10,\n };\n }\n static onShaderMask = `\n vec2 halfDimensions = u_dimensions * 0.5;\n float r = radius[0] * step(v_textureCoordinate.x, 0.5) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[1] * step(0.5, v_textureCoordinate.x) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[2] * step(0.5, v_textureCoordinate.x) * step(0.5, v_textureCoordinate.y);\n r = r + radius[3] * step(v_textureCoordinate.x, 0.5) * step(0.5, v_textureCoordinate.y);\n return $boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions, r);\n `;\n static onEffectMask = `\n return mix(vec4(0.0), maskColor, $fillMask(shaderMask));\n `;\n}\n//# sourceMappingURL=RadiusEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderEffect renders a border along all edges of an element\n */\nexport class BorderEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'border';\n static getEffectKey() {\n return `border`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static onEffectMask = `\n float mask = clamp(shaderMask + width, 0.0, 1.0) - clamp(shaderMask, 0.0, 1.0);\n return mix(shaderColor, mix(shaderColor, maskColor, maskColor.a), mask);\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Linear Gradient effect over a effect mask\n */\nexport class LinearGradientEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'linearGradient';\n static getEffectKey(props) {\n return `linearGradient${props.colors.length}`;\n }\n static resolveDefaults(props) {\n const colors = props.colors ?? [0xff000000, 0xffffffff];\n let stops = props.stops || [];\n if (stops.length === 0 || stops.length !== colors.length) {\n const colorsL = colors.length;\n let i = 0;\n const tmp = stops;\n for (; i < colorsL; i++) {\n if (stops[i]) {\n tmp[i] = stops[i];\n if (stops[i - 1] === undefined && tmp[i - 2] !== undefined) {\n tmp[i - 1] = tmp[i - 2] + (stops[i] - tmp[i - 2]) / 2;\n }\n }\n else {\n tmp[i] = i * (1 / (colors.length - 1));\n }\n }\n stops = tmp;\n }\n return {\n colors,\n stops,\n angle: props.angle ?? 0,\n };\n }\n static uniforms = {\n angle: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n colors: {\n value: 0xffffffff,\n validator: (rgbas) => {\n const cols = rgbas.map((rgbas) => getNormalizedRgbaComponents(rgbas));\n return cols.reduce((acc, val) => acc.concat(val), []);\n },\n size: (props) => props.colors.length,\n method: 'uniform4fv',\n type: 'vec4',\n },\n stops: {\n value: [],\n size: (props) => props.colors.length,\n method: 'uniform1fv',\n type: 'float',\n },\n };\n static methods = {\n fromLinear: `\n vec4 function(vec4 linearRGB) {\n vec4 higher = vec4(1.055)*pow(linearRGB, vec4(1.0/2.4)) - vec4(0.055);\n vec4 lower = linearRGB * vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n `,\n toLinear: `\n vec4 function(vec4 sRGB) {\n vec4 higher = pow((sRGB + vec4(0.055))/vec4(1.055), vec4(2.4));\n vec4 lower = sRGB/vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n `,\n calcPoint: `\n vec2 function(float d, float angle) {\n return d * vec2(cos(angle), sin(angle)) + (u_dimensions * 0.5);\n }\n `,\n };\n static ColorLoop = (amount) => {\n let loop = '';\n for (let i = 2; i < amount; i++) {\n loop += `colorOut = mix(colorOut, colors[${i}], clamp((dist - stops[${i - 1}]) / (stops[${i}] - stops[${i - 1}]), 0.0, 1.0));`;\n }\n return loop;\n };\n static onColorize = (props) => {\n const colors = props.colors.length || 1;\n return `\n float a = angle - (PI / 180.0 * 90.0);\n float lineDist = abs(u_dimensions.x * cos(a)) + abs(u_dimensions.y * sin(a));\n vec2 f = $calcPoint(lineDist * 0.5, a);\n vec2 t = $calcPoint(lineDist * 0.5, a + PI);\n vec2 gradVec = t - f;\n float dist = dot(v_textureCoordinate.xy * u_dimensions - f, gradVec) / dot(gradVec, gradVec);\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = $fromLinear(mix($toLinear(colors[0]), $toLinear(colors[1]), stopCalc));\n ${this.ColorLoop(colors)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `;\n };\n}\n//# sourceMappingURL=LinearGradientEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Grayscale effect grayscales the color values of the current mask color\n */\nexport class GrayscaleEffect extends ShaderEffect {\n name = 'grayscale';\n static getEffectKey() {\n return `grayscale`;\n }\n static resolveDefaults(props) {\n return {\n amount: props.amount ?? 1,\n };\n }\n static uniforms = {\n amount: {\n value: 1,\n method: 'uniform1f',\n type: 'float',\n },\n };\n static onColorize = `\n float grayness = 0.2 * maskColor.r + 0.6 * maskColor.g + 0.2 * maskColor.b;\n return vec4(amount * vec3(grayness) + (1.0 - amount) * maskColor.rgb, maskColor.a);\n `;\n}\n//# sourceMappingURL=GrayscaleEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the right side of an element\n */\nexport class BorderRightEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderRight';\n static getEffectKey() {\n return `borderRight`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(u_dimensions.x - width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderRightEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the top side of an element\n */\nexport class BorderTopEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderTop';\n static getEffectKey() {\n return `borderTop`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(0.0, width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderTopEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the bottom side of an element\n */\nexport class BorderBottomEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderBottom';\n static getEffectKey() {\n return `borderBottom`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(0.0, u_dimensions.y - width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderBottomEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the left of an element\n */\nexport class BorderLeftEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderLeft';\n static getEffectKey() {\n return `borderLeft`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderLeftEffect.js.map","import { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Renders a Glitch effect using the incoming texture\n */\nexport class GlitchEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'glitch';\n static getEffectKey(props) {\n return `glitch`;\n }\n static resolveDefaults(props) {\n return {\n amplitude: props.amplitude ?? 0.2,\n narrowness: props.narrowness ?? 4.0,\n blockiness: props.blockiness ?? 2.0,\n minimizer: props.minimizer ?? 8.0,\n time: props.time ?? Date.now(),\n };\n }\n static uniforms = {\n amplitude: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n narrowness: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n blockiness: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n minimizer: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n time: {\n value: 0,\n method: 'uniform1f',\n validator: (value) => {\n return (Date.now() - value) % 1000;\n },\n type: 'float',\n },\n };\n static methods = {\n rand: `\n float function(vec2 p, float time) {\n float t = floor(time * 20.) / 10.;\n return fract(sin(dot(p, vec2(t * 12.9898, t * 78.233))) * 43758.5453);\n }\n `,\n noise: `\n float function(vec2 uv, float blockiness, float time) {\n vec2 lv = fract(uv);\n vec2 id = floor(uv);\n\n float n1 = rand(id, time);\n float n2 = rand(id+vec2(1,0), time);\n float n3 = rand(id+vec2(0,1), time);\n float n4 = rand(id+vec2(1,1), time);\n vec2 u = smoothstep(0.0, 1.0 + blockiness, lv);\n return mix(mix(n1, n2, u.x), mix(n3, n4, u.x), u.y);\n }\n `,\n fbm: `\n float function(vec2 uv, int count, float blockiness, float complexity, float time) {\n float val = 0.0;\n float amp = 0.5;\n const int MAX_ITERATIONS = 10;\n\n for(int i = 0; i < MAX_ITERATIONS; i++) {\n if(i >= count) {break;}\n val += amp * noise(uv, blockiness, time);\n amp *= 0.5;\n uv *= complexity;\n }\n return val;\n }\n `,\n };\n static onColorize = `\n vec2 uv = v_textureCoordinate.xy;\n float aspect = u_dimensions.x / u_dimensions.y;\n vec2 a = vec2(uv.x * aspect , uv.y);\n vec2 uv2 = vec2(a.x / u_dimensions.x, exp(a.y));\n\n float shift = amplitude * pow($fbm(uv2, 4, blockiness, narrowness, time), minimizer);\n float colR = texture2D(u_texture, vec2(uv.x + shift, uv.y)).r * (1. - shift);\n float colG = texture2D(u_texture, vec2(uv.x - shift, uv.y)).g * (1. - shift);\n float colB = texture2D(u_texture, vec2(uv.x - shift, uv.y)).b * (1. - shift);\n\n vec3 f = vec3(colR, colG, colB);\n return vec4(f, texture2D(u_texture, vec2(uv.x - shift, uv.y)).a);\n `;\n}\n//# sourceMappingURL=GlitchEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\nexport class FadeOutEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'fadeOut';\n static getEffectKey() {\n return `fadeOut`;\n }\n static uniforms = {\n fade: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static resolveDefaults(props) {\n return {\n fade: props.fade ?? 10,\n };\n }\n static onColorize = `\n vec2 point = v_textureCoordinate.xy * u_dimensions.xy;\n vec2 pos1;\n vec2 pos2;\n vec2 d;\n float c;\n vec4 result = maskColor;\n\n\n if(fade[0] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x, point.y + fade[0]);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[1] > 0.0) {\n pos1 = vec2(point.x - u_dimensions.x - fade[1], v_textureCoordinate.y);\n pos2 = vec2(point.x - u_dimensions.x, v_textureCoordinate.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[2] > 0.0) {\n pos1 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y - fade[2]);\n pos2 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[3] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x + fade[3], point.y);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n return result;\n `;\n}\n//# sourceMappingURL=FadeOutEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\nexport class RadialGradientEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radialGradient';\n static getEffectKey(props) {\n return `radialGradient${props.colors.length}`;\n }\n static resolveDefaults(props) {\n const colors = props.colors ?? [0xff000000, 0xffffffff];\n let stops = props.stops || [];\n if (stops.length === 0 || stops.length !== colors.length) {\n const colorsL = colors.length;\n let i = 0;\n const tmp = stops;\n for (; i < colorsL; i++) {\n if (stops[i]) {\n tmp[i] = stops[i];\n if (stops[i - 1] === undefined && tmp[i - 2] !== undefined) {\n tmp[i - 1] = tmp[i - 2] + (stops[i] - tmp[i - 2]) / 2;\n }\n }\n else {\n tmp[i] = i * (1 / (colors.length - 1));\n }\n }\n stops = tmp;\n }\n return {\n colors,\n stops,\n width: props.width ?? 0,\n height: props.height ?? props.width ?? 0,\n pivot: props.pivot ?? [0.5, 0.5],\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n height: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n pivot: {\n value: [0.5, 0.5],\n method: 'uniform2fv',\n type: 'vec2',\n },\n colors: {\n value: 0xffffffff,\n validator: (rgbas) => {\n const cols = rgbas.map((rgbas) => getNormalizedRgbaComponents(rgbas));\n return cols.reduce((acc, val) => acc.concat(val), []);\n },\n size: (props) => props.colors.length,\n method: 'uniform4fv',\n type: 'vec4',\n },\n stops: {\n value: [],\n size: (props) => props.colors.length,\n method: 'uniform1fv',\n type: 'float',\n },\n };\n static ColorLoop = (amount) => {\n let loop = '';\n for (let i = 2; i < amount; i++) {\n loop += `colorOut = mix(colorOut, colors[${i}], clamp((dist - stops[${i - 1}]) / (stops[${i}] - stops[${i - 1}]), 0.0, 1.0));`;\n }\n return loop;\n };\n static onColorize = (props) => {\n const colors = props.colors.length || 1;\n return `\n vec2 point = v_textureCoordinate.xy * u_dimensions;\n vec2 projection = vec2(pivot.x * u_dimensions.x, pivot.y * u_dimensions.y);\n\n float dist = length((point - projection) / vec2(width, height));\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = mix(colors[0], colors[1], stopCalc);\n ${this.ColorLoop(colors)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `;\n };\n}\n//# sourceMappingURL=RadialGradientEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The RadialProgressEffect renders a border along all edges of an element\n */\nexport class RadialProgressEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radialProgress';\n static getEffectKey() {\n return `radialProgress`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n progress: props.progress ?? 0.5,\n offset: props.offset ?? 0,\n range: props.range ?? Math.PI * 2,\n rounded: props.rounded ?? false,\n radius: props.radius ?? 1,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n progress: {\n value: 0.5,\n method: 'uniform1f',\n type: 'float',\n },\n offset: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n range: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n rounded: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n validator: (value) => {\n return value ? 1 : 0;\n },\n },\n radius: {\n value: 1,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n rotateUV: `\n vec2 function(vec2 uv, float d) {\n float s = sin(d);\n float c = cos(d);\n mat2 rotMatrix = mat2(c, -s, s, c);\n return uv * rotMatrix;\n }\n `,\n drawDot: `\n float function(vec2 uv, vec2 p, float r) {\n uv += p;\n float circle = length(uv) - r;\n return clamp(-circle, 0.0, 1.0);\n }\n `,\n };\n static onEffectMask = `\n float outerRadius = radius * u_dimensions.y * 0.5;\n\n float endAngle = range * progress - 0.0005;\n\n vec2 uv = v_textureCoordinate.xy * u_dimensions.xy - u_dimensions * 0.5;\n\n uv = $rotateUV(uv, -(offset));\n float linewidth = width * u_pixelRatio;\n float circle = length(uv) - (outerRadius - linewidth) ;\n circle = abs(circle) - linewidth;\n circle = clamp(-circle, 0.0, 1.0);\n\n float angle = (atan(uv.x, -uv.y) / 3.14159265359 * 0.5);\n float p = endAngle / (PI * 2.);\n\n circle *= step(fract(angle), fract(p));\n\n circle = rounded < 1. ? circle : max(circle, $drawDot(uv, vec2(0, outerRadius - linewidth), linewidth));\n circle = rounded < 1. ? circle : max(circle, $drawDot($rotateUV(uv, -(endAngle)), vec2(0, outerRadius - linewidth), linewidth));\n\n return mix(shaderColor, maskColor, circle);\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=RadialProgressEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Masks the current maskcolor a holepunch effect with rounded corners similar to {@link RoundedRectangle}\n */\nexport class HolePunchEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'holePunch';\n static getEffectKey() {\n return `holePunch`;\n }\n static uniforms = {\n x: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n y: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n height: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n radius: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static resolveDefaults(props) {\n return {\n x: props.x || 0,\n y: props.y || 0,\n width: props.width || 50,\n height: props.height || 50,\n radius: props.radius ?? 0,\n };\n }\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n boxDist: `\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n `,\n };\n static onShaderMask = `\n vec2 halfDimensions = u_dimensions * 0.5;\n vec2 size = vec2(width, height) * 0.5;\n vec2 basePos = v_textureCoordinate.xy * u_dimensions.xy - vec2(x, y);\n vec2 pos = basePos - size;\n float r = radius[0] * step(pos.x, 0.5) * step(pos.y, 0.5);\n r = r + radius[1] * step(0.5, pos.x) * step(pos.y, 0.5);\n r = r + radius[2] * step(0.5, pos.x) * step(0.5, pos.y);\n r = r + radius[3] * step(pos.x, 0.5) * step(0.5, pos.y);\n return $boxDist(pos, size, r);\n `;\n static onEffectMask = `\n return mix(maskColor, vec4(0.0), $fillMask(shaderMask));\n `;\n}\n//# sourceMappingURL=HolePunchEffect.js.map","import { DefaultShader } from './renderers/webgl/shaders/DefaultShader.js';\nimport { DefaultShaderBatched } from './renderers/webgl/shaders/DefaultShaderBatched.js';\nimport { DynamicShader, } from './renderers/webgl/shaders/DynamicShader.js';\nimport { RoundedRectangle } from './renderers/webgl/shaders/RoundedRectangle.js';\nimport { SdfShader } from './renderers/webgl/shaders/SdfShader.js';\nimport { RadiusEffect } from './renderers/webgl/shaders/effects/RadiusEffect.js';\nimport { BorderEffect } from './renderers/webgl/shaders/effects/BorderEffect.js';\nimport { LinearGradientEffect, } from './renderers/webgl/shaders/effects/LinearGradientEffect.js';\nimport { GrayscaleEffect, } from './renderers/webgl/shaders/effects/GrayscaleEffect.js';\nimport { BorderRightEffect } from './renderers/webgl/shaders/effects/BorderRightEffect.js';\nimport { BorderTopEffect } from './renderers/webgl/shaders/effects/BorderTopEffect.js';\nimport { BorderBottomEffect } from './renderers/webgl/shaders/effects/BorderBottomEffect.js';\nimport { BorderLeftEffect } from './renderers/webgl/shaders/effects/BorderLeftEffect.js';\nimport { GlitchEffect, } from './renderers/webgl/shaders/effects/GlitchEffect.js';\nimport { FadeOutEffect, } from './renderers/webgl/shaders/effects/FadeOutEffect.js';\nimport { RadialGradientEffect, } from './renderers/webgl/shaders/effects/RadialGradientEffect.js';\nimport { RadialProgressEffect, } from './renderers/webgl/shaders/effects/RadialProgressEffect.js';\nimport { HolePunchEffect } from './renderers/webgl/shaders/effects/HolePunchEffect.js';\nexport class CoreShaderManager {\n shCache = new Map();\n shConstructors = {};\n attachedShader = null;\n effectConstructors = {};\n renderer;\n constructor() {\n this.registerShaderType('DefaultShader', DefaultShader);\n this.registerShaderType('DefaultShaderBatched', DefaultShaderBatched);\n this.registerShaderType('RoundedRectangle', RoundedRectangle);\n this.registerShaderType('DynamicShader', DynamicShader);\n this.registerShaderType('SdfShader', SdfShader);\n this.registerEffectType('border', BorderEffect);\n this.registerEffectType('borderBottom', BorderBottomEffect);\n this.registerEffectType('borderLeft', BorderLeftEffect);\n this.registerEffectType('borderRight', BorderRightEffect);\n this.registerEffectType('borderTop', BorderTopEffect);\n this.registerEffectType('fadeOut', FadeOutEffect);\n this.registerEffectType('linearGradient', LinearGradientEffect);\n this.registerEffectType('radialGradient', RadialGradientEffect);\n this.registerEffectType('grayscale', GrayscaleEffect);\n this.registerEffectType('glitch', GlitchEffect);\n this.registerEffectType('radius', RadiusEffect);\n this.registerEffectType('radialProgress', RadialProgressEffect);\n this.registerEffectType('holePunch', HolePunchEffect);\n }\n registerShaderType(shType, shClass) {\n this.shConstructors[shType] = shClass;\n }\n registerEffectType(effectType, effectClass) {\n this.effectConstructors[effectType] = effectClass;\n }\n getRegisteredEffects() {\n return this.effectConstructors;\n }\n getRegisteredShaders() {\n return this.shConstructors;\n }\n loadShader(shType, props) {\n if (!this.renderer) {\n throw new Error(`Renderer is not been defined`);\n }\n const ShaderClass = this.shConstructors[shType];\n if (!ShaderClass) {\n throw new Error(`Shader type \"${shType}\" is not registered`);\n }\n if (shType === 'DynamicShader') {\n return this.loadDynamicShader(props);\n }\n const resolvedProps = ShaderClass.resolveDefaults(props);\n const cacheKey = ShaderClass.makeCacheKey(resolvedProps) || ShaderClass.name;\n if (cacheKey && this.shCache.has(cacheKey)) {\n return {\n shader: this.shCache.get(cacheKey),\n props: resolvedProps,\n };\n }\n // @ts-expect-error ShaderClass WILL accept a Renderer\n const shader = new ShaderClass(this.renderer, props);\n if (cacheKey) {\n this.shCache.set(cacheKey, shader);\n }\n return {\n shader,\n props: resolvedProps,\n };\n }\n loadDynamicShader(props) {\n if (!this.renderer) {\n throw new Error(`Renderer is not been defined`);\n }\n const resolvedProps = DynamicShader.resolveDefaults(props, this.effectConstructors);\n const cacheKey = DynamicShader.makeCacheKey(resolvedProps, this.effectConstructors);\n if (cacheKey && this.shCache.has(cacheKey)) {\n return {\n shader: this.shCache.get(cacheKey),\n props: resolvedProps,\n };\n }\n const shader = new DynamicShader(this.renderer, props, this.effectConstructors);\n if (cacheKey) {\n this.shCache.set(cacheKey, shader);\n }\n return {\n shader: shader,\n props: resolvedProps,\n };\n }\n useShader(shader) {\n if (this.attachedShader === shader) {\n return;\n }\n if (this.attachedShader) {\n this.attachedShader.detach();\n }\n shader.attach();\n this.attachedShader = shader;\n }\n}\n//# sourceMappingURL=CoreShaderManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Class that keeps track of the invocations of Context methods when\n * the `enableContextSpy` renderer option is enabled.\n */\nexport class ContextSpy {\n data = {};\n reset() {\n this.data = {};\n }\n increment(name) {\n if (!this.data[name]) {\n this.data[name] = 0;\n }\n this.data[name]++;\n }\n getData() {\n return { ...this.data };\n }\n}\n//# sourceMappingURL=ContextSpy.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {} from '../textures/Texture.js';\n/**\n * Tests if the given location is a compressed texture container\n * @param url\n * @remarks\n * This function is used to determine if the given image url is a compressed\n * and only supports the following extensions: .ktx and .pvr\n * @returns\n */\nexport function isCompressedTextureContainer(url) {\n return /\\.(ktx|pvr)$/.test(url);\n}\n/**\n * Loads a compressed texture container\n * @param url\n * @returns\n */\nexport const loadCompressedTexture = async (url) => {\n const response = await fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n if (url.indexOf('.ktx') !== -1) {\n return loadKTXData(arrayBuffer);\n }\n return loadPVRData(arrayBuffer);\n};\n/**\n * Loads a KTX texture container and returns the texture data\n * @param buffer\n * @returns\n */\nconst loadKTXData = async (buffer) => {\n const view = new DataView(buffer);\n const littleEndian = view.getUint32(12) === 16909060 ? true : false;\n const mipmaps = [];\n const data = {\n glInternalFormat: view.getUint32(28, littleEndian),\n pixelWidth: view.getUint32(36, littleEndian),\n pixelHeight: view.getUint32(40, littleEndian),\n numberOfMipmapLevels: view.getUint32(56, littleEndian),\n bytesOfKeyValueData: view.getUint32(60, littleEndian),\n };\n let offset = 64;\n // Key Value Pairs of data start at byte offset 64\n // But the only known kvp is the API version, so skipping parsing.\n offset += data.bytesOfKeyValueData;\n for (let i = 0; i < data.numberOfMipmapLevels; i++) {\n const imageSize = view.getUint32(offset);\n offset += 4;\n mipmaps.push(view.buffer.slice(offset, imageSize));\n offset += imageSize;\n }\n return {\n data: {\n glInternalFormat: data.glInternalFormat,\n mipmaps,\n width: data.pixelWidth || 0,\n height: data.pixelHeight || 0,\n type: 'ktx',\n },\n premultiplyAlpha: false,\n };\n};\n/**\n * Loads a PVR texture container and returns the texture data\n * @param buffer\n * @returns\n */\nconst loadPVRData = async (buffer) => {\n // pvr header length in 32 bits\n const pvrHeaderLength = 13;\n // for now only we only support: COMPRESSED_RGB_ETC1_WEBGL\n const pvrFormatEtc1 = 0x8d64;\n const pvrWidth = 7;\n const pvrHeight = 6;\n const pvrMipmapCount = 11;\n const pvrMetadata = 12;\n const arrayBuffer = buffer;\n const header = new Int32Array(arrayBuffer, 0, pvrHeaderLength);\n // @ts-expect-error Object possibly undefined\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n const dataOffset = header[pvrMetadata] + 52;\n const pvrtcData = new Uint8Array(arrayBuffer, dataOffset);\n const mipmaps = [];\n const data = {\n pixelWidth: header[pvrWidth],\n pixelHeight: header[pvrHeight],\n numberOfMipmapLevels: header[pvrMipmapCount] || 0,\n };\n let offset = 0;\n let width = data.pixelWidth || 0;\n let height = data.pixelHeight || 0;\n for (let i = 0; i < data.numberOfMipmapLevels; i++) {\n const level = ((width + 3) >> 2) * ((height + 3) >> 2) * 8;\n const view = new Uint8Array(arrayBuffer, pvrtcData.byteOffset + offset, level);\n mipmaps.push(view);\n offset += level;\n width = width >> 1;\n height = height >> 1;\n }\n return {\n data: {\n glInternalFormat: pvrFormatEtc1,\n mipmaps: mipmaps,\n width: data.pixelWidth || 0,\n height: data.pixelHeight || 0,\n type: 'pvr',\n },\n premultiplyAlpha: false,\n };\n};\n//# sourceMappingURL=textureCompression.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\nimport { isCompressedTextureContainer, loadCompressedTexture, } from '../lib/textureCompression.js';\n/**\n * Texture consisting of an image loaded from a URL\n *\n * @remarks\n * The ImageTexture's {@link ImageTextureProps.src} prop defines the image URL\n * to be downloaded.\n *\n * By default, the texture's alpha values will be premultiplied into its color\n * values which is generally the desired setting before they are sent to the\n * texture's associated {@link Shader}. However, in special cases you may want\n * the Shader to receive straight (non-premultiplied) values. In that case you\n * can disable the default behavior by setting the\n * {@link ImageTextureProps.premultiplyAlpha} prop to `false`.\n */\nexport class ImageTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = ImageTexture.resolveDefaults(props);\n }\n hasAlphaChannel(mimeType) {\n return mimeType.indexOf('image/png') !== -1;\n }\n async getTextureData() {\n const { src, premultiplyAlpha } = this.props;\n if (!src) {\n return {\n data: null,\n };\n }\n if (src instanceof ImageData) {\n return {\n data: src,\n premultiplyAlpha,\n };\n }\n // Handle compressed textures\n if (isCompressedTextureContainer(src)) {\n return loadCompressedTexture(src);\n }\n if (this.txManager.imageWorkerManager) {\n return await this.txManager.imageWorkerManager.getImage(src, premultiplyAlpha);\n }\n else if (this.txManager.hasCreateImageBitmap) {\n const response = await fetch(src);\n const blob = await response.blob();\n const hasAlphaChannel = premultiplyAlpha ?? this.hasAlphaChannel(blob.type);\n return {\n data: await createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none',\n }),\n premultiplyAlpha: hasAlphaChannel,\n };\n }\n else {\n const img = new Image();\n img.src = src;\n await new Promise((resolve, reject) => {\n img.onload = () => resolve();\n img.onerror = () => reject(new Error(`Failed to load image`));\n }).catch((e) => {\n console.error(e);\n });\n return {\n data: img,\n premultiplyAlpha: premultiplyAlpha ?? true,\n };\n }\n }\n static makeCacheKey(props) {\n const resolvedProps = ImageTexture.resolveDefaults(props);\n // ImageTextures sourced by ImageData are non-cacheable\n if (resolvedProps.src instanceof ImageData) {\n return false;\n }\n return `ImageTexture,${resolvedProps.src},${resolvedProps.premultiplyAlpha}`;\n }\n static resolveDefaults(props) {\n return {\n src: props.src ?? '',\n premultiplyAlpha: props.premultiplyAlpha ?? true, // null,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=ImageTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Number of floating point numbers that represent a single glyph in the SDF vertex buffer.\n *\n * @remarks\n * The vertex buffer contains:\n * - 6 vertex positions\n * - 6 texture coordinates\n * - = 12 positions/coordinates per glyph\n *\n * Each vertex position and texture coordinate consist of 2 floating point numbers (x/y).\n * So there are 12 * 2 = 24 floating point numbers that make up a single glyph.\n */\nexport const FLOATS_PER_GLYPH = 24;\n//# sourceMappingURL=constants.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Gets the start conditions for the layout loop.\n *\n * @remarks\n * Returns `undefined` if the layout loop should not be run.\n *\n * @param fontSize\n * @param fontSizeRatio\n * @param sdfLineHeight\n * @param renderWindow\n * @param lineCache\n * @param textH\n * @returns\n */\nexport function getStartConditions(sdfFontSize, sdfLineHeight, lineHeight, verticalAlign, offsetY, fontSizeRatio, renderWindow, lineCache, textH) {\n // State variables\n const startLineIndex = Math.min(Math.max(renderWindow.firstLineIdx, 0), lineCache.length);\n // TODO: (fontSize / 6.4286 / fontSizeRatio) Adding this to the startY helps the text line up better with Canvas rendered text\n const sdfStartX = 0;\n let sdfVerticalAlignYOffset = 0;\n if (verticalAlign === 'middle') {\n sdfVerticalAlignYOffset = (sdfLineHeight - sdfFontSize) / 2;\n }\n else if (verticalAlign === 'bottom') {\n sdfVerticalAlignYOffset = sdfLineHeight - sdfFontSize;\n }\n const sdfOffsetY = offsetY / fontSizeRatio;\n const sdfStartY = sdfOffsetY + startLineIndex * sdfLineHeight + sdfVerticalAlignYOffset; // TODO: Figure out what determines the initial y offset of text.\n // Don't attempt to render anything if we know we're starting past the established end of the text\n if (textH && sdfStartY >= textH / fontSizeRatio) {\n return;\n }\n return {\n sdfX: sdfStartX,\n sdfY: sdfStartY,\n lineIndex: startLineIndex,\n };\n}\n//# sourceMappingURL=getStartConditions.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A wrapper Generator class that makes a generator peekable.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class PeekableIterator {\n iterator;\n peekBuffer = [];\n _lastIndex;\n constructor(iterator, indexBase = 0) {\n this.iterator = iterator;\n this.iterator = iterator;\n this._lastIndex = indexBase - 1;\n this.peekBuffer = [];\n }\n next() {\n const nextResult = this.peekBuffer.length > 0\n ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.peekBuffer.pop()\n : this.iterator.next();\n if (nextResult.done) {\n this._lastIndex = -1;\n }\n else {\n this._lastIndex++;\n }\n return nextResult;\n }\n peek() {\n if (this.peekBuffer.length > 0) {\n // We know that the buffer is not empty, so we can safely use the\n // non-null assertion operator\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.peekBuffer[0];\n }\n const result = this.iterator.next();\n this.peekBuffer.push(result);\n return result;\n }\n get lastIndex() {\n return this._lastIndex;\n }\n}\n//# sourceMappingURL=PeekableGenerator.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// Reversible Generator Wrapper Class\n/**\n * Generator function that yields each Unicode code point in the given string.\n */\nexport function* getUnicodeCodepoints(text, start = 0) {\n let i = start;\n while (i < text.length) {\n const codePoint = text.codePointAt(i);\n if (codePoint === undefined) {\n throw new Error('Invalid Unicode code point');\n }\n yield codePoint;\n i += codePoint <= 0xffff ? 1 : 2;\n }\n}\n//# sourceMappingURL=getUnicodeCodepoints.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { PeekableIterator } from './PeekableGenerator.js';\nimport { getUnicodeCodepoints } from './getUnicodeCodepoints.js';\n/**\n * Measures a single-line of text width ignoring any unmapped glyphs including line breaks\n *\n * @param text\n * @param shaperProps\n * @param shaper\n * @returns\n */\nexport function measureText(text, shaperProps, shaper) {\n const glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, 0), 0));\n let width = 0;\n for (const glyph of glyphs) {\n if (glyph.mapped) {\n width += glyph.xAdvance;\n }\n }\n return width;\n}\n//# sourceMappingURL=measureText.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../../../../utils.js';\nimport { PeekableIterator } from './PeekableGenerator.js';\nimport { getUnicodeCodepoints } from './getUnicodeCodepoints.js';\nimport { measureText } from './measureText.js';\nexport function layoutText(curLineIndex, startX, startY, text, textAlign, width, height, fontSize, lineHeight, letterSpacing, \n/**\n * Mutated\n */\nvertexBuffer, contain, \n/**\n * Mutated\n */\nlineCache, rwSdf, trFontFace, forceFullLayoutCalc, scrollable, overflowSuffix, maxLines) {\n assertTruthy(trFontFace, 'Font face must be loaded');\n assertTruthy(trFontFace.loaded, 'Font face must be loaded');\n assertTruthy(trFontFace.data, 'Font face must be loaded');\n assertTruthy(trFontFace.shaper, 'Font face must be loaded');\n // Regardless of fontSize (or other scaling properties), we layout the vertices of each glyph\n // using the fixed coordinate space determined by font size used to produce the atlas.\n // Scaling for display is handled by shader uniforms inexpensively.\n // So we have:\n // - vertex space: the space in which the vertices of each glyph are laid out\n // - screen space: the screen pixel space\n // Input properties such as x, y, w, fontSize, letterSpacing, etc. are all expressed in screen space.\n // We convert these to the vertex space by dividing them the `fontSizeRatio` factor.\n /**\n * See above\n */\n const fontSizeRatio = fontSize / trFontFace.data.info.size;\n /**\n * `lineHeight` in vertex coordinates\n */\n const vertexLineHeight = lineHeight / fontSizeRatio;\n /**\n * `w` in vertex coordinates\n */\n const vertexW = width / fontSizeRatio;\n /**\n * `letterSpacing` in vertex coordinates\n */\n const vertexLSpacing = letterSpacing / fontSizeRatio;\n const startingLineCacheEntry = lineCache[curLineIndex];\n const startingCodepointIndex = startingLineCacheEntry?.codepointIndex || 0;\n const startingMaxX = startingLineCacheEntry?.maxX || 0;\n const startingMaxY = startingLineCacheEntry?.maxY || 0;\n let maxX = startingMaxX;\n let maxY = startingMaxY;\n let curX = startX;\n let curY = startY;\n let bufferOffset = 0;\n /**\n * Buffer offset to last word boundry. This is -1 when we aren't in a word boundry.\n */\n const lastWord = {\n codepointIndex: -1,\n bufferOffset: -1,\n xStart: -1,\n };\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const shaper = trFontFace.shaper;\n const shaperProps = {\n letterSpacing: vertexLSpacing,\n };\n // Get glyphs\n let glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, startingCodepointIndex), startingCodepointIndex));\n let glyphResult;\n let curLineBufferStart = -1;\n const bufferLineInfos = [];\n const vertexTruncateHeight = height / fontSizeRatio;\n const overflowSuffVertexWidth = measureText(overflowSuffix, shaperProps, shaper);\n // Line-by-line layout\n let moreLines = true;\n while (moreLines) {\n const nextLineWillFit = (maxLines === 0 || curLineIndex + 1 < maxLines) &&\n (contain !== 'both' ||\n scrollable ||\n curY + vertexLineHeight + trFontFace.maxCharHeight <=\n vertexTruncateHeight);\n const lineVertexW = nextLineWillFit\n ? vertexW\n : vertexW - overflowSuffVertexWidth;\n /**\n * Vertex X position to the beginning of the last word boundary. This becomes -1 when we start traversing a word.\n */\n let xStartLastWordBoundary = 0;\n const lineIsBelowWindowTop = curY + vertexLineHeight >= rwSdf.y1;\n const lineIsAboveWindowBottom = curY <= rwSdf.y2;\n const lineIsWithinWindow = lineIsBelowWindowTop && lineIsAboveWindowBottom;\n // Layout glyphs in this line\n // Any break statements in this while loop will trigger a line break\n while ((glyphResult = glyphs.next()) && !glyphResult.done) {\n const glyph = glyphResult.value;\n if (curLineIndex === lineCache.length) {\n lineCache.push({\n codepointIndex: glyph.cluster,\n maxY,\n maxX,\n });\n }\n else if (curLineIndex > lineCache.length) {\n throw new Error('Unexpected lineCache length');\n }\n // If we encounter a word boundary (white space or newline) we invalidate\n // the lastWord and set the xStartLastWordBoundary if we haven't already.\n if (glyph.codepoint === 32 || glyph.codepoint === 10) {\n if (lastWord.codepointIndex !== -1) {\n lastWord.codepointIndex = -1;\n xStartLastWordBoundary = curX;\n }\n }\n else if (lastWord.codepointIndex === -1) {\n lastWord.codepointIndex = glyph.cluster;\n lastWord.bufferOffset = bufferOffset;\n lastWord.xStart = xStartLastWordBoundary;\n }\n if (glyph.mapped) {\n // Mapped glyph\n const charEndX = curX + glyph.xOffset + glyph.width;\n // Word wrap check\n if (\n // We are containing the text\n contain !== 'none' &&\n // The current glyph reaches outside the contained width\n charEndX >= lineVertexW &&\n // There is a last word that we can break to the next line\n lastWord.codepointIndex !== -1 &&\n // Prevents infinite loop when a single word is longer than the width\n lastWord.xStart > 0) {\n // The current word is about to go off the edge of the container width\n // Reinitialize the iterator starting at the last word\n // and proceeding to the next line\n if (nextLineWillFit) {\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, lastWord.codepointIndex), lastWord.codepointIndex));\n bufferOffset = lastWord.bufferOffset;\n break;\n }\n else {\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(overflowSuffix, 0), 0));\n curX = lastWord.xStart;\n bufferOffset = lastWord.bufferOffset;\n // HACK: For the rest of the line when inserting the overflow suffix,\n // set contain = 'none' to prevent an infinite loop.\n contain = 'none';\n }\n }\n else {\n // This glyph fits, so we can add it to the buffer\n const quadX = curX + glyph.xOffset;\n const quadY = curY + glyph.yOffset;\n // Only add to buffer for rendering if the line is within the render window\n if (lineIsWithinWindow) {\n if (curLineBufferStart === -1) {\n curLineBufferStart = bufferOffset;\n }\n const atlasEntry = trFontFace.getAtlasEntry(glyph.glyphId);\n // Add texture coordinates\n const u = atlasEntry.x / trFontFace.data.common.scaleW;\n const v = atlasEntry.y / trFontFace.data.common.scaleH;\n const uvWidth = atlasEntry.width / trFontFace.data.common.scaleW;\n const uvHeight = atlasEntry.height / trFontFace.data.common.scaleH;\n // TODO: (Performance) We can optimize this by using ELEMENT_ARRAY_BUFFER\n // eliminating the need to duplicate vertices\n // Top-left\n vertexBuffer[bufferOffset++] = quadX;\n vertexBuffer[bufferOffset++] = quadY;\n vertexBuffer[bufferOffset++] = u;\n vertexBuffer[bufferOffset++] = v;\n // Top-right\n vertexBuffer[bufferOffset++] = quadX + glyph.width;\n vertexBuffer[bufferOffset++] = quadY;\n vertexBuffer[bufferOffset++] = u + uvWidth;\n vertexBuffer[bufferOffset++] = v;\n // Bottom-left\n vertexBuffer[bufferOffset++] = quadX;\n vertexBuffer[bufferOffset++] = quadY + glyph.height;\n vertexBuffer[bufferOffset++] = u;\n vertexBuffer[bufferOffset++] = v + uvHeight;\n // Bottom-right\n vertexBuffer[bufferOffset++] = quadX + glyph.width;\n vertexBuffer[bufferOffset++] = quadY + glyph.height;\n vertexBuffer[bufferOffset++] = u + uvWidth;\n vertexBuffer[bufferOffset++] = v + uvHeight;\n }\n maxY = Math.max(maxY, quadY + glyph.height);\n maxX = Math.max(maxX, quadX + glyph.width);\n curX += glyph.xAdvance;\n }\n }\n else {\n // Unmapped character\n // Handle newlines\n if (glyph.codepoint === 10) {\n if (nextLineWillFit) {\n // The whole line fit, so we can break to the next line\n break;\n }\n else {\n // The whole line won't fit, so we need to add the overflow suffix\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(overflowSuffix, 0), 0));\n // HACK: For the rest of the line when inserting the overflow suffix,\n // set contain = 'none' to prevent an infinite loop.\n contain = 'none';\n }\n }\n }\n }\n // Prepare for the next line...\n if (curLineBufferStart !== -1) {\n bufferLineInfos.push({\n bufferStart: curLineBufferStart,\n bufferEnd: bufferOffset,\n });\n curLineBufferStart = -1;\n }\n curX = 0;\n curY += vertexLineHeight;\n curLineIndex++;\n lastWord.codepointIndex = -1;\n xStartLastWordBoundary = 0;\n // Figure out if there are any more lines to render...\n if (!forceFullLayoutCalc && contain === 'both' && curY > rwSdf.y2) {\n // Stop layout calculation early (for performance purposes) if:\n // - We're not forcing a full layout calculation (for width/height calculation)\n // - ...and we're containing the text vertically+horizontally (contain === 'both')\n // - ...and we have a render window\n // - ...and the next line is below the bottom of the render window\n moreLines = false;\n }\n else if (glyphResult && glyphResult.done) {\n // If we've reached the end of the text, we know we're done\n moreLines = false;\n }\n else if (!nextLineWillFit) {\n // If we're contained vertically+horizontally (contain === 'both')\n // but not scrollable and the next line won't fit, we're done.\n moreLines = false;\n }\n }\n // Use textAlign to determine if we need to adjust the x position of the text\n // in the buffer line by line\n if (textAlign === 'center') {\n const vertexTextW = contain === 'none' ? maxX : vertexW;\n for (let i = 0; i < bufferLineInfos.length; i++) {\n const line = bufferLineInfos[i];\n // - 4 = the x position of a rightmost vertex\n const lineWidth = \n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n vertexBuffer[line.bufferEnd - 4] - vertexBuffer[line.bufferStart];\n const xOffset = (vertexTextW - lineWidth) / 2;\n for (let j = line.bufferStart; j < line.bufferEnd; j += 4) {\n vertexBuffer[j] += xOffset;\n }\n }\n }\n else if (textAlign === 'right') {\n const vertexTextW = contain === 'none' ? maxX : vertexW;\n for (let i = 0; i < bufferLineInfos.length; i++) {\n const line = bufferLineInfos[i];\n const lineWidth = line.bufferEnd === line.bufferStart\n ? 0\n : // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n vertexBuffer[line.bufferEnd - 4] - vertexBuffer[line.bufferStart];\n const xOffset = vertexTextW - lineWidth;\n for (let j = line.bufferStart; j < line.bufferEnd; j += 4) {\n vertexBuffer[j] += xOffset;\n }\n }\n }\n assertTruthy(glyphResult);\n return {\n bufferNumFloats: bufferOffset,\n bufferNumQuads: bufferOffset / 16,\n layoutNumCharacters: glyphResult.done\n ? text.length - startingCodepointIndex\n : glyphResult.value.cluster - startingCodepointIndex + 1,\n fullyProcessed: !!glyphResult.done,\n maxX,\n maxY,\n };\n}\n//# sourceMappingURL=layoutText.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Round up to the nearest multiple of the given number.\n *\n * @param value\n * @param multiple\n * @returns\n */\nexport function roundUpToMultiple(value, multiple) {\n return Math.ceil(value / multiple) * multiple;\n}\n/**\n * Round down to the nearest multiple of the given number.\n *\n * @param value\n * @param multiple\n * @returns\n */\nexport function roundDownToMultiple(value, multiple) {\n return Math.floor(value / multiple) * multiple;\n}\n//# sourceMappingURL=util.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { isBoundPositive } from '../../../../lib/utils.js';\nimport { roundDownToMultiple, roundUpToMultiple } from './util.js';\n/**\n * Create a render window from the given parameters.\n *\n * @remarks\n * The render window is a rectangle that defines the area of the text that\n * should be rendered. It is used to skip rendering parts of the text that\n * are outside of the render window. The render window is relative to the\n * text's top left corner of the overrall text.\n *\n * @param x The x coordinate of the text element's top left corner relative to the screen.\n * @param y The y coordinate of the text element's top left corner relative to the screen.\n * @param scrollY The amount of pixels to scroll the text vertically.\n * @param lineHeight The number of extra lines to render above and below the visible window.\n * @param visibleWindow The visible window of the text element relative to the screen\n * @returns\n */\nexport function setRenderWindow(outRenderWindow, x, y, scrollY, lineHeight, bufferMargin, visibleWindow, fontSizeRatio) {\n const { screen, sdf } = outRenderWindow;\n if (!isBoundPositive(visibleWindow)) {\n screen.x1 = 0;\n screen.y1 = 0;\n screen.x2 = 0;\n screen.y2 = 0;\n sdf.x1 = 0;\n sdf.y1 = 0;\n sdf.x2 = 0;\n sdf.y2 = 0;\n outRenderWindow.numLines = 0;\n outRenderWindow.firstLineIdx = 0;\n }\n else {\n const x1 = visibleWindow.x1 - x;\n const x2 = x1 + (visibleWindow.x2 - visibleWindow.x1);\n const y1Base = visibleWindow.y1 - y + scrollY;\n const y1 = roundDownToMultiple(y1Base - bufferMargin, lineHeight || 1);\n const y2 = roundUpToMultiple(y1Base + (visibleWindow.y2 - visibleWindow.y1) + bufferMargin, lineHeight || 1);\n screen.x1 = x1;\n screen.y1 = y1;\n screen.x2 = x2;\n screen.y2 = y2;\n sdf.x1 = x1 / fontSizeRatio;\n sdf.y1 = y1 / fontSizeRatio;\n sdf.x2 = x2 / fontSizeRatio;\n sdf.y2 = y2 / fontSizeRatio;\n outRenderWindow.numLines = Math.ceil((y2 - y1) / lineHeight);\n outRenderWindow.firstLineIdx = lineHeight ? Math.floor(y1 / lineHeight) : 0;\n }\n outRenderWindow.valid = true;\n}\n//# sourceMappingURL=setRenderWindow.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport memize from 'memize';\nconst weightConversions = {\n normal: 400,\n bold: 700,\n bolder: 900,\n lighter: 100,\n};\nconst fontWeightToNumber = (weight) => {\n if (typeof weight === 'number') {\n return weight;\n }\n return weightConversions[weight] || 400;\n};\nfunction rawResolveFontToUse(familyMapsByPriority, family, weightIn, style, stretch) {\n let weight = fontWeightToNumber(weightIn);\n for (const fontFamiles of familyMapsByPriority) {\n const fontFaces = fontFamiles[family];\n if (!fontFaces) {\n continue;\n }\n if (fontFaces.size === 1) {\n // No Exact match found, find nearest weight match\n console.warn(`TrFontManager: Only one font face found for family: '${family}' - will be used for all weights and styles`);\n return fontFaces.values().next().value;\n }\n const weightMap = new Map();\n for (const fontFace of fontFaces) {\n const fontFamilyWeight = fontWeightToNumber(fontFace.descriptors.weight);\n if (fontFamilyWeight === weight &&\n fontFace.descriptors.style === style &&\n fontFace.descriptors.stretch === stretch) {\n return fontFace;\n }\n weightMap.set(fontFamilyWeight, fontFace);\n }\n // No Exact match found, find nearest weight match\n const msg = `TrFontManager: No exact match: '${family} Weight: ${weight} Style: ${style} Stretch: ${stretch}'`;\n console.error(msg);\n // Follow the CSS font-weight algorithm to find the nearest weight match\n // https://www.w3.org/TR/2018/REC-css-fonts-3-20180920/#font-matching-algorithm\n if (weight === 400 && weightMap.has(500)) {\n return weightMap.get(500);\n }\n if (weight === 500 && weightMap.has(400)) {\n return weightMap.get(400);\n }\n if (weight < 400) {\n while (weight > 0) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight -= 100;\n }\n // reset back for the next loop\n weight = 600;\n }\n while (weight < 1000) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight += 100;\n }\n // finally check lower again\n weight = 500;\n while (weight > 0) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight -= 100;\n }\n }\n return;\n}\nconst resolveFontToUse = memize(rawResolveFontToUse);\nexport class TrFontManager {\n textRenderers;\n constructor(textRenderers) {\n this.textRenderers = textRenderers;\n // Intentionally left blank\n }\n addFontFace(font) {\n // All the font face to all of the text renderers that support it\n for (const trId in this.textRenderers) {\n const tr = this.textRenderers[trId];\n if (tr && tr.isFontFaceSupported(font)) {\n tr.addFontFace(font);\n }\n }\n }\n /**\n * Utility method to resolve a single font face from a list of prioritized family maps based on\n * a set of font properties.\n *\n * @remarks\n * These are to be used by a text renderer to resolve a font face if needed.\n *\n * @param familyMapsByPriority\n * @param props\n * @returns\n */\n static resolveFontFace(familyMapsByPriority, props) {\n const { fontFamily, fontWeight, fontStyle, fontStretch } = props;\n return resolveFontToUse(familyMapsByPriority, fontFamily, fontWeight, fontStyle, fontStretch);\n }\n}\n//# sourceMappingURL=TrFontManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createBound, intersectRect, copyRect, boundsOverlap, convertBoundToRect, } from '../../../lib/utils.js';\nimport { TextRenderer, } from '../TextRenderer.js';\nimport { SdfTrFontFace } from '../../font-face-types/SdfTrFontFace/SdfTrFontFace.js';\nimport { FLOATS_PER_GLYPH } from './internal/constants.js';\nimport { getStartConditions } from './internal/getStartConditions.js';\nimport { layoutText } from './internal/layoutText.js';\nimport { setRenderWindow, } from './internal/setRenderWindow.js';\nimport { TrFontManager } from '../../TrFontManager.js';\nimport { assertTruthy, mergeColorAlpha } from '../../../../utils.js';\nimport { WebGlCoreRenderOp } from '../../../renderers/webgl/WebGlCoreRenderOp.js';\nimport { BufferCollection } from '../../../renderers/webgl/internal/BufferCollection.js';\nimport { EventEmitter } from '../../../../common/EventEmitter.js';\n/**\n * Ephemeral rect object used for calculations\n */\nconst tmpRect = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n};\n/**\n * Singleton class for rendering text using signed distance fields.\n *\n * @remarks\n * SdfTextRenderer supports both single-channel and multi-channel signed distance fields.\n */\nexport class SdfTextRenderer extends TextRenderer {\n /**\n * Map of font family names to a set of font faces.\n */\n ssdfFontFamilies = {};\n msdfFontFamilies = {};\n fontFamilyArray = [\n this.ssdfFontFamilies,\n this.msdfFontFamilies,\n ];\n sdfShader;\n rendererBounds;\n constructor(stage) {\n super(stage);\n this.sdfShader = this.stage.shManager.loadShader('SdfShader').shader;\n this.rendererBounds = {\n x1: 0,\n y1: 0,\n x2: this.stage.options.appWidth,\n y2: this.stage.options.appHeight,\n };\n }\n //#region Overrides\n getPropertySetters() {\n return {\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n this.invalidateLayoutCache(state);\n },\n text: (state, value) => {\n state.props.text = value;\n this.invalidateLayoutCache(state);\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n this.invalidateLayoutCache(state);\n },\n color: (state, value) => {\n state.props.color = value;\n },\n x: (state, value) => {\n state.props.x = value;\n if (state.elementBounds.valid) {\n this.setElementBoundsX(state);\n // Only schedule an update if the text is not already rendered\n // (renderWindow is invalid) and the element possibly overlaps the screen\n // This is to avoid unnecessary updates when we know text is off-screen\n if (!state.renderWindow.valid &&\n boundsOverlap(state.elementBounds, this.rendererBounds)) {\n this.scheduleUpdateState(state);\n }\n }\n },\n y: (state, value) => {\n state.props.y = value;\n if (state.elementBounds.valid) {\n this.setElementBoundsY(state);\n // See x() for explanation\n if (!state.renderWindow.valid &&\n boundsOverlap(state.elementBounds, this.rendererBounds)) {\n this.scheduleUpdateState(state);\n }\n }\n },\n contain: (state, value) => {\n state.props.contain = value;\n this.invalidateLayoutCache(state);\n },\n width: (state, value) => {\n state.props.width = value;\n // Only invalidate layout cache if we're containing in the horizontal direction\n if (state.props.contain !== 'none') {\n this.invalidateLayoutCache(state);\n }\n },\n height: (state, value) => {\n state.props.height = value;\n // Only invalidate layout cache if we're containing in the vertical direction\n if (state.props.contain === 'both') {\n this.invalidateLayoutCache(state);\n }\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n this.invalidateLayoutCache(state);\n },\n scrollable: (state, value) => {\n state.props.scrollable = value;\n this.invalidateLayoutCache(state);\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n // Scrolling doesn't need to invalidate any caches, but it does need to\n // schedule an update\n this.scheduleUpdateState(state);\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n this.invalidateLayoutCache(state);\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n this.invalidateLayoutCache(state);\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n this.invalidateLayoutCache(state);\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n this.invalidateLayoutCache(state);\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n this.invalidateLayoutCache(state);\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n this.invalidateLayoutCache(state);\n },\n debug: (state, value) => {\n state.props.debug = value;\n },\n };\n }\n canRenderFont(props) {\n // TODO: Support matching on font stretch, weight and style (if/when needed)\n // For now we just match on the font family name\n // '$$SDF_FAILURE_TEST$$' is used to test the 'failure' event coming from text\n const { fontFamily } = props;\n return (fontFamily in this.ssdfFontFamilies ||\n fontFamily in this.msdfFontFamilies ||\n fontFamily === '$$SDF_FAILURE_TEST$$');\n }\n isFontFaceSupported(fontFace) {\n return fontFace instanceof SdfTrFontFace;\n }\n addFontFace(fontFace) {\n // Make sure the font face is an SDF font face (it should have already passed\n // the `isFontFaceSupported` check)\n assertTruthy(fontFace instanceof SdfTrFontFace);\n const familyName = fontFace.fontFamily;\n const fontFamiles = fontFace.type === 'ssdf'\n ? this.ssdfFontFamilies\n : fontFace.type === 'msdf'\n ? this.msdfFontFamilies\n : undefined;\n if (!fontFamiles) {\n console.warn(`Invalid font face type: ${fontFace.type}`);\n return;\n }\n let faceSet = fontFamiles[familyName];\n if (!faceSet) {\n faceSet = new Set();\n fontFamiles[familyName] = faceSet;\n }\n faceSet.add(fontFace);\n }\n createState(props) {\n return {\n props,\n status: 'initialState',\n updateScheduled: false,\n emitter: new EventEmitter(),\n lineCache: [],\n forceFullLayoutCalc: false,\n renderWindow: {\n screen: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n },\n sdf: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n },\n firstLineIdx: 0,\n numLines: 0,\n valid: false,\n },\n elementBounds: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n valid: false,\n },\n clippingRect: {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n valid: false,\n },\n bufferNumFloats: 0,\n bufferNumQuads: 0,\n vertexBuffer: undefined,\n webGlBuffers: null,\n bufferUploaded: false,\n textH: undefined,\n textW: undefined,\n distanceRange: 0,\n trFontFace: undefined,\n isRenderable: false,\n debugData: {\n updateCount: 0,\n layoutCount: 0,\n lastLayoutNumCharacters: 0,\n layoutSum: 0,\n drawSum: 0,\n drawCount: 0,\n bufferSize: 0,\n },\n };\n }\n updateState(state) {\n let { trFontFace } = state;\n const { textH, lineCache, debugData, forceFullLayoutCalc } = state;\n debugData.updateCount++;\n // On the first update call we need to set the status to loading\n if (state.status === 'initialState') {\n this.setStatus(state, 'loading');\n }\n // Resolve font face if we haven't yet\n if (!trFontFace) {\n trFontFace = this.resolveFontFace(state.props);\n state.trFontFace = trFontFace;\n if (!trFontFace) {\n const msg = `SdfTextRenderer: Could not resolve font face for family: '${state.props.fontFamily}'`;\n console.error(msg);\n this.setStatus(state, 'failed', new Error(msg));\n return;\n }\n trFontFace.texture.setRenderableOwner(state, state.isRenderable);\n }\n // If the font hasn't been loaded yet, stop here.\n // Listen for the 'loaded' event and forward fontLoaded event\n if (!trFontFace.loaded) {\n trFontFace.once('loaded', () => {\n this.scheduleUpdateState(state);\n });\n return;\n }\n // If the font is loaded then so should the data\n assertTruthy(trFontFace.data, 'Font face data should be loaded');\n const { text, fontSize, x, y, contain, width, height, lineHeight, verticalAlign, scrollable, overflowSuffix, maxLines, } = state.props;\n // scrollY only has an effect when contain === 'both' and scrollable === true\n const scrollY = contain === 'both' && scrollable ? state.props.scrollY : 0;\n const { renderWindow } = state;\n /**\n * The font size of the SDF font face (the basis for SDF space units)\n */\n const sdfFontSize = trFontFace.data.info.size;\n /**\n * Divide screen space units by this to get the SDF space units\n * Mulitple SDF space units by this to get screen space units\n */\n const fontSizeRatio = fontSize / sdfFontSize;\n // Needed in renderWindow calculation\n const sdfLineHeight = lineHeight / fontSizeRatio;\n state.distanceRange =\n fontSizeRatio * trFontFace.data.distanceField.distanceRange;\n // Allocate buffers if needed\n const neededLength = text.length * FLOATS_PER_GLYPH;\n let vertexBuffer = state.vertexBuffer;\n if (!vertexBuffer || vertexBuffer.length < neededLength) {\n vertexBuffer = new Float32Array(neededLength * 2);\n }\n const elementBounds = state.elementBounds;\n if (!elementBounds.valid) {\n this.setElementBoundsX(state);\n this.setElementBoundsY(state);\n elementBounds.valid = true;\n }\n // Return early if we're still viewing inside the established render window\n // No need to re-render what we've already rendered\n // (Only if there's an established renderWindow and we're not suppressing early exit)\n if (!forceFullLayoutCalc && renderWindow.valid) {\n const rwScreen = renderWindow.screen;\n if (x + rwScreen.x1 <= elementBounds.x1 &&\n x + rwScreen.x2 >= elementBounds.x2 &&\n y - scrollY + rwScreen.y1 <= elementBounds.y1 &&\n y - scrollY + rwScreen.y2 >= elementBounds.y2) {\n this.setStatus(state, 'loaded');\n return;\n }\n // Otherwise invalidate the renderWindow so it can be redone\n renderWindow.valid = false;\n this.setStatus(state, 'loading');\n }\n const { offsetY, textAlign } = state.props;\n // Create a new renderWindow if needed\n if (!renderWindow.valid) {\n const isPossiblyOnScreen = boundsOverlap(elementBounds, this.rendererBounds);\n if (!isPossiblyOnScreen) {\n // If the element is not possibly on screen, we can skip the layout and rendering completely\n return;\n }\n setRenderWindow(renderWindow, x, y, scrollY, lineHeight, contain === 'both' ? elementBounds.y2 - elementBounds.y1 : 0, elementBounds, fontSizeRatio);\n // console.log('newRenderWindow', renderWindow);\n }\n const start = getStartConditions(sdfFontSize, sdfLineHeight, lineHeight, verticalAlign, offsetY, fontSizeRatio, renderWindow, lineCache, textH);\n if (!start) {\n // Nothing to render, return early, but still mark as loaded (since the text is just scrolled\n // out of view)\n this.setStatus(state, 'loaded');\n return;\n }\n const { letterSpacing } = state.props;\n const out2 = layoutText(start.lineIndex, start.sdfX, start.sdfY, text, textAlign, width, height, fontSize, lineHeight, letterSpacing, vertexBuffer, contain, lineCache, renderWindow.sdf, trFontFace, forceFullLayoutCalc, scrollable, overflowSuffix, maxLines);\n state.bufferUploaded = false;\n state.bufferNumFloats = out2.bufferNumFloats;\n state.bufferNumQuads = out2.bufferNumQuads;\n state.vertexBuffer = vertexBuffer;\n state.renderWindow = renderWindow;\n debugData.lastLayoutNumCharacters = out2.layoutNumCharacters;\n debugData.bufferSize = vertexBuffer.byteLength;\n // If we didn't exit early, we know we have completely computed w/h\n if (out2.fullyProcessed) {\n state.textW = out2.maxX * fontSizeRatio;\n state.textH = out2.maxY * fontSizeRatio;\n }\n // if (state.props.debug.printLayoutTime) {\n // debugData.layoutSum += performance.now() - updateStartTime;\n // debugData.layoutCount++;\n // }\n this.setStatus(state, 'loaded');\n }\n renderQuads(state, transform, clippingRect, alpha) {\n if (!state.vertexBuffer) {\n // Nothing to draw\n return;\n }\n const { renderer } = this.stage;\n const { fontSize, color, contain, scrollable, zIndex, debug } = state.props;\n // scrollY only has an effect when contain === 'both' and scrollable === true\n const scrollY = contain === 'both' && scrollable ? state.props.scrollY : 0;\n const { textW = 0, textH = 0, distanceRange, vertexBuffer, bufferUploaded, trFontFace, elementBounds, } = state;\n let { webGlBuffers } = state;\n if (!webGlBuffers) {\n const glw = renderer.glw;\n const stride = 4 * Float32Array.BYTES_PER_ELEMENT;\n const webGlBuffer = glw.createBuffer();\n assertTruthy(webGlBuffer);\n state.webGlBuffers = new BufferCollection([\n {\n buffer: webGlBuffer,\n attributes: {\n a_position: {\n name: 'a_position',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 0, // start at the beginning of the buffer\n },\n a_textureCoordinate: {\n name: 'a_textureCoordinate',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 2 * Float32Array.BYTES_PER_ELEMENT,\n },\n },\n },\n ]);\n state.bufferUploaded = false;\n assertTruthy(state.webGlBuffers);\n webGlBuffers = state.webGlBuffers;\n }\n if (!bufferUploaded) {\n const glw = renderer.glw;\n const buffer = webGlBuffers?.getBuffer('a_textureCoordinate') ?? null;\n glw.arrayBufferData(buffer, vertexBuffer, glw.STATIC_DRAW);\n state.bufferUploaded = true;\n }\n assertTruthy(trFontFace);\n if (scrollable && contain === 'both') {\n assertTruthy(elementBounds.valid);\n const elementRect = convertBoundToRect(elementBounds, tmpRect);\n if (clippingRect.valid) {\n state.clippingRect.valid = true;\n clippingRect = intersectRect(clippingRect, elementRect, state.clippingRect);\n }\n else {\n state.clippingRect.valid = true;\n clippingRect = copyRect(elementRect, state.clippingRect);\n }\n }\n const renderOp = new WebGlCoreRenderOp(renderer.glw, renderer.options, webGlBuffers, this.sdfShader, {\n transform: transform.data,\n // IMPORTANT: The SDF Shader expects the color NOT to be premultiplied\n // for the best blending results. Which is why we use `mergeColorAlpha`\n // instead of `mergeColorAlphaPremultiplied` here.\n color: mergeColorAlpha(color, alpha),\n size: fontSize / (trFontFace.data?.info.size || 0),\n scrollY,\n distanceRange,\n debug: debug.sdfShaderDebug,\n }, alpha, clippingRect, { height: textH, width: textW }, 0, zIndex);\n const texture = state.trFontFace?.texture;\n assertTruthy(texture);\n const ctxTexture = this.stage.txManager.getCtxTexture(texture);\n renderOp.addTexture(ctxTexture);\n renderOp.length = state.bufferNumFloats;\n renderOp.numQuads = state.bufferNumQuads;\n renderer.addRenderOp(renderOp);\n // if (!debug.disableScissor) {\n // renderer.enableScissor(\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // Draw the arrays\n // gl.drawArrays(\n // gl.TRIANGLES, // Primitive type\n // 0,\n // bufferNumVertices, // Number of verticies\n // );\n // renderer.disableScissor();\n // if (debug.showElementRect) {\n // this.renderer.drawBorder(\n // Colors.Blue,\n // elementRect.x,\n // elementRect.y,\n // elementRect.w,\n // elementRect.h,\n // );\n // }\n // if (debug.showVisibleRect) {\n // this.renderer.drawBorder(\n // Colors.Green,\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // if (debug.showRenderWindow && renderWindow) {\n // this.renderer.drawBorder(\n // Colors.Red,\n // x + renderWindow.x1,\n // y + renderWindow.y1 - scrollY,\n // x + renderWindow.x2 - (x + renderWindow.x1),\n // y + renderWindow.y2 - scrollY - (y + renderWindow.y1 - scrollY),\n // );\n // }\n // if (debug.printLayoutTime) {\n // debugData.drawSum += performance.now() - drawStartTime;\n // debugData.drawCount++;\n // }\n }\n setIsRenderable(state, renderable) {\n super.setIsRenderable(state, renderable);\n state.trFontFace?.texture.setRenderableOwner(state, renderable);\n }\n destroyState(state) {\n super.destroyState(state);\n // If there's a Font Face assigned we must free the owner relation to its texture\n state.trFontFace?.texture.setRenderableOwner(state, false);\n }\n //#endregion Overrides\n resolveFontFace(props) {\n return TrFontManager.resolveFontFace(this.fontFamilyArray, props);\n }\n /**\n * Release the loaded SDF font face\n *\n * @param state\n */\n releaseFontFace(state) {\n if (state.trFontFace) {\n state.trFontFace.texture.setRenderableOwner(state, false);\n state.trFontFace = undefined;\n }\n }\n /**\n * Invalidate the layout cache stored in the state. This will cause the text\n * to be re-layed out on the next update.\n *\n * @remarks\n * This also invalidates the visible window cache.\n *\n * @param state\n */\n invalidateLayoutCache(state) {\n state.renderWindow.valid = false;\n state.elementBounds.valid = false;\n state.textH = undefined;\n state.textW = undefined;\n state.lineCache = [];\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n setElementBoundsX(state) {\n const { x, contain, width } = state.props;\n const { elementBounds } = state;\n elementBounds.x1 = x;\n elementBounds.x2 = contain !== 'none' ? x + width : Infinity;\n }\n setElementBoundsY(state) {\n const { y, contain, height } = state.props;\n const { elementBounds } = state;\n elementBounds.y1 = y;\n elementBounds.y2 = contain === 'both' ? y + height : Infinity;\n }\n}\n//# sourceMappingURL=SdfTextRenderer.js.map","import { CoreExtension } from '../../exports/core-api.js';\n/**\n * Type guard that checks if a Class extends CoreExtension.\n *\n * @param Class\n * @returns\n */\nexport function classExtendsCoreExtension(Class) {\n return Class.prototype instanceof CoreExtension;\n}\nexport async function loadCoreExtension(coreExtensionModule, stage) {\n let module;\n try {\n console.log('Loading core extension', coreExtensionModule);\n module = (await import(coreExtensionModule /* @vite-ignore */));\n }\n catch (e) {\n console.error(`The core extension module at '${coreExtensionModule}' could not be loaded.`);\n console.error(e);\n return;\n }\n if (!module.default) {\n console.error(`The core extension module at '${coreExtensionModule}' does not have a default export.`);\n return;\n }\n const ExtensionClass = module.default;\n if (classExtendsCoreExtension(ExtensionClass)) {\n const coreExtension = new ExtensionClass();\n try {\n await coreExtension.run(stage);\n }\n catch (e) {\n console.error(`The core extension at '${coreExtensionModule}' threw an error.`);\n console.error(e);\n }\n }\n else {\n console.error(`The core extension at '${coreExtensionModule}' does not extend CoreExtension.`);\n }\n}\nexport function santizeCustomDataMap(d) {\n const validTypes = { boolean: true, string: true, number: true };\n const keys = Object.keys(d);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n if (!key) {\n continue;\n }\n const value = d[key];\n const valueType = typeof value;\n // Typescript doesn't understand the above const valueType ¯\\_(ツ)_/¯\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore-next-line\n if (valueType === 'string' && value.length > 2048) {\n console.warn(`Custom Data value for ${key} is too long, it will be truncated to 2048 characters`);\n // same here, see above comment, this can only be a string at this point\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore-next-line\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call\n d[key] = value.substring(0, 2048);\n }\n if (!validTypes[valueType]) {\n console.warn(`Custom Data value for ${key} is not a boolean, string, or number, it will be ignored`);\n delete d[key];\n }\n }\n return d;\n}\n//# sourceMappingURL=utils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ManualCountTextureUsageTracker, } from './texture-usage-trackers/ManualCountTextureUsageTracker.js';\nimport { FinalizationRegistryTextureUsageTracker } from './texture-usage-trackers/FinalizationRegistryTextureUsageTracker.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { Inspector } from './Inspector.js';\nimport { santizeCustomDataMap } from '../render-drivers/utils.js';\nimport { isProductionEnvironment } from '../utils.js';\n/**\n * The Renderer Main API\n *\n * @remarks\n * This is the primary class used to configure and operate the Renderer.\n *\n * It is used to create and destroy Nodes, as well as Texture and Shader\n * references.\n *\n * Example:\n * ```ts\n * import { RendererMain, MainCoreDriver } from '@lightningjs/renderer';\n *\n * // Initialize the Renderer\n * const renderer = new RendererMain(\n * {\n * appWidth: 1920,\n * appHeight: 1080\n * },\n * 'app',\n * new MainCoreDriver(),\n * );\n * ```\n */\nexport class RendererMain extends EventEmitter {\n root = null;\n driver;\n canvas;\n settings;\n inspector = null;\n nodes = new Map();\n nextTextureId = 1;\n /**\n * Texture Usage Tracker for Usage Based Texture Garbage Collection\n *\n * @remarks\n * For internal use only. DO NOT ACCESS.\n */\n textureTracker;\n /**\n * Constructs a new Renderer instance\n *\n * @param settings Renderer settings\n * @param target Element ID or HTMLElement to insert the canvas into\n * @param driver Core Driver to use\n */\n constructor(settings, target, driver) {\n super();\n const resolvedSettings = {\n appWidth: settings.appWidth || 1920,\n appHeight: settings.appHeight || 1080,\n txMemByteThreshold: settings.txMemByteThreshold || 124e6,\n boundsMargin: settings.boundsMargin || 0,\n deviceLogicalPixelRatio: settings.deviceLogicalPixelRatio || 1,\n devicePhysicalPixelRatio: settings.devicePhysicalPixelRatio || window.devicePixelRatio,\n clearColor: settings.clearColor ?? 0x00000000,\n coreExtensionModule: settings.coreExtensionModule || null,\n experimental_FinalizationRegistryTextureUsageTracker: settings.experimental_FinalizationRegistryTextureUsageTracker ?? false,\n textureCleanupOptions: settings.textureCleanupOptions || {},\n fpsUpdateInterval: settings.fpsUpdateInterval || 0,\n numImageWorkers: settings.numImageWorkers !== undefined ? settings.numImageWorkers : 2,\n enableContextSpy: settings.enableContextSpy ?? false,\n enableInspector: settings.enableInspector ?? false,\n };\n this.settings = resolvedSettings;\n const { appWidth, appHeight, deviceLogicalPixelRatio, devicePhysicalPixelRatio, enableInspector, } = resolvedSettings;\n const releaseCallback = (textureId) => {\n this.driver.releaseTexture(textureId);\n };\n const useFinalizationRegistryTracker = resolvedSettings.experimental_FinalizationRegistryTextureUsageTracker &&\n typeof FinalizationRegistry === 'function';\n this.textureTracker = useFinalizationRegistryTracker\n ? new FinalizationRegistryTextureUsageTracker(releaseCallback)\n : new ManualCountTextureUsageTracker(releaseCallback, this.settings.textureCleanupOptions);\n const deviceLogicalWidth = appWidth * deviceLogicalPixelRatio;\n const deviceLogicalHeight = appHeight * deviceLogicalPixelRatio;\n this.driver = driver;\n const canvas = document.createElement('canvas');\n this.canvas = canvas;\n canvas.width = deviceLogicalWidth * devicePhysicalPixelRatio;\n canvas.height = deviceLogicalHeight * devicePhysicalPixelRatio;\n canvas.style.width = `${deviceLogicalWidth}px`;\n canvas.style.height = `${deviceLogicalHeight}px`;\n let targetEl;\n if (typeof target === 'string') {\n targetEl = document.getElementById(target);\n }\n else {\n targetEl = target;\n }\n if (!targetEl) {\n throw new Error('Could not find target element');\n }\n // Hook up the driver's callbacks\n driver.onCreateNode = (node) => {\n this.nodes.set(node.id, node);\n };\n driver.onBeforeDestroyNode = (node) => {\n this.nodes.delete(node.id);\n };\n driver.onFpsUpdate = (fpsData) => {\n this.emit('fpsUpdate', fpsData);\n };\n driver.onFrameTick = (frameTickData) => {\n this.emit('frameTick', frameTickData);\n };\n driver.onIdle = () => {\n this.emit('idle');\n };\n targetEl.appendChild(canvas);\n if (enableInspector && !isProductionEnvironment()) {\n this.inspector = new Inspector(canvas, resolvedSettings);\n }\n }\n /**\n * Initialize the renderer\n *\n * @remarks\n * This method must be called and resolved asyncronously before any other\n * methods are called.\n */\n async init() {\n await this.driver.init(this, this.settings, this.canvas);\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.root = this.driver.getRootNode();\n }\n /**\n * Create a new scene graph node\n *\n * @remarks\n * A node is the main graphical building block of the Renderer scene graph. It\n * can be a container for other nodes, or it can be a leaf node that renders a\n * solid color, gradient, image, or specific texture, using a specific shader.\n *\n * To create a text node, see {@link createTextNode}.\n *\n * See {@link INode} for more details.\n *\n * @param props\n * @returns\n */\n createNode(props) {\n if (this.inspector) {\n return this.inspector.createNode(this.driver, this.resolveNodeDefaults(props));\n }\n return this.driver.createNode(this.resolveNodeDefaults(props));\n }\n /**\n * Create a new scene graph text node\n *\n * @remarks\n * A text node is the second graphical building block of the Renderer scene\n * graph. It renders text using a specific text renderer that is automatically\n * chosen based on the font requested and what type of fonts are installed\n * into an app via a CoreExtension.\n *\n * See {@link ITextNode} for more details.\n *\n * @param props\n * @returns\n */\n createTextNode(props) {\n const fontSize = props.fontSize ?? 16;\n const data = {\n ...this.resolveNodeDefaults(props),\n text: props.text ?? '',\n textRendererOverride: props.textRendererOverride ?? null,\n fontSize,\n fontFamily: props.fontFamily ?? 'sans-serif',\n fontStyle: props.fontStyle ?? 'normal',\n fontWeight: props.fontWeight ?? 'normal',\n fontStretch: props.fontStretch ?? 'normal',\n textAlign: props.textAlign ?? 'left',\n contain: props.contain ?? 'none',\n scrollable: props.scrollable ?? false,\n scrollY: props.scrollY ?? 0,\n offsetY: props.offsetY ?? 0,\n letterSpacing: props.letterSpacing ?? 0,\n lineHeight: props.lineHeight ?? fontSize,\n maxLines: props.maxLines ?? 0,\n textBaseline: props.textBaseline ?? 'alphabetic',\n verticalAlign: props.verticalAlign ?? 'top',\n overflowSuffix: props.overflowSuffix ?? '...',\n debug: props.debug ?? {},\n };\n if (this.inspector) {\n return this.inspector.createTextNode(this.driver, data);\n }\n return this.driver.createTextNode(data);\n }\n /**\n * Resolves the default property values for a Node\n *\n * @remarks\n * This method is used internally by the RendererMain to resolve the default\n * property values for a Node. It is exposed publicly so that it can be used\n * by Core Driver implementations.\n *\n * @param props\n * @returns\n */\n resolveNodeDefaults(props) {\n const color = props.color ?? 0xffffffff;\n const colorTl = props.colorTl ?? props.colorTop ?? props.colorLeft ?? color;\n const colorTr = props.colorTr ?? props.colorTop ?? props.colorRight ?? color;\n const colorBl = props.colorBl ?? props.colorBottom ?? props.colorLeft ?? color;\n const colorBr = props.colorBr ?? props.colorBottom ?? props.colorRight ?? color;\n const data = santizeCustomDataMap(props.data ?? {});\n return {\n x: props.x ?? 0,\n y: props.y ?? 0,\n width: props.width ?? 0,\n height: props.height ?? 0,\n alpha: props.alpha ?? 1,\n clipping: props.clipping ?? false,\n color,\n colorTop: props.colorTop ?? color,\n colorBottom: props.colorBottom ?? color,\n colorLeft: props.colorLeft ?? color,\n colorRight: props.colorRight ?? color,\n colorBl,\n colorBr,\n colorTl,\n colorTr,\n zIndex: props.zIndex ?? 0,\n zIndexLocked: props.zIndexLocked ?? 0,\n parent: props.parent ?? null,\n texture: props.texture ?? null,\n shader: props.shader ?? null,\n // Since setting the `src` will trigger a texture load, we need to set it after\n // we set the texture. Otherwise, problems happen.\n src: props.src ?? '',\n scale: props.scale ?? null,\n scaleX: props.scaleX ?? props.scale ?? 1,\n scaleY: props.scaleY ?? props.scale ?? 1,\n mount: props.mount ?? 0,\n mountX: props.mountX ?? props.mount ?? 0,\n mountY: props.mountY ?? props.mount ?? 0,\n pivot: props.pivot ?? 0.5,\n pivotX: props.pivotX ?? props.pivot ?? 0.5,\n pivotY: props.pivotY ?? props.pivot ?? 0.5,\n rotation: props.rotation ?? 0,\n data: data,\n };\n }\n /**\n * Destroy a node\n *\n * @remarks\n * This method destroys a node but does not destroy its children.\n *\n * @param node\n * @returns\n */\n destroyNode(node) {\n if (this.inspector) {\n this.inspector.destroyNode(node);\n }\n return this.driver.destroyNode(node);\n }\n /**\n * Create a new texture reference\n *\n * @remarks\n * This method creates a new reference to a texture. The texture is not\n * loaded until it is used on a node.\n *\n * It can be assigned to a node's `texture` property, or it can be used\n * when creating a SubTexture.\n *\n * @param textureType\n * @param props\n * @param options\n * @returns\n */\n createTexture(textureType, props, options) {\n const id = this.nextTextureId++;\n const desc = {\n descType: 'texture',\n txType: textureType,\n props,\n options: {\n ...options,\n // This ID is used to identify the texture in the CoreTextureManager's\n // ID Texture Map cache.\n id,\n },\n };\n this.textureTracker.registerTexture(desc);\n return desc;\n }\n /**\n * Create a new shader reference\n *\n * @remarks\n * This method creates a new reference to a shader. The shader is not\n * loaded until it is used on a Node.\n *\n * It can be assigned to a Node's `shader` property.\n *\n * @param shaderType\n * @param props\n * @returns\n */\n createShader(shaderType, props) {\n return {\n descType: 'shader',\n shType: shaderType,\n props: props,\n };\n }\n /**\n * Get a Node by its ID\n *\n * @param id\n * @returns\n */\n getNodeById(id) {\n return this.nodes.get(id) || null;\n }\n toggleFreeze() {\n throw new Error('Not implemented');\n }\n advanceFrame() {\n throw new Error('Not implemented');\n }\n /**\n * Re-render the current frame without advancing any running animations.\n *\n * @remarks\n * Any state changes will be reflected in the re-rendered frame. Useful for\n * debugging.\n *\n * May not do anything if the render loop is running on a separate worker.\n */\n rerender() {\n throw new Error('Not implemented');\n }\n}\n//# sourceMappingURL=RendererMain.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getTimingFunction } from '../utils.js';\nimport { mergeColorProgress } from '../../utils.js';\nimport { EventEmitter } from '../../common/EventEmitter.js';\nexport class CoreAnimation extends EventEmitter {\n node;\n props;\n settings;\n propStartValues = {};\n restoreValues = {};\n progress = 0;\n delayFor = 0;\n timingFunction;\n propsList; //fixme - aint got not time for this\n constructor(node, props, settings) {\n super();\n this.node = node;\n this.props = props;\n this.settings = settings;\n this.propStartValues = {};\n this.propsList = Object.keys(props);\n this.propsList.forEach((propName) => {\n this.propStartValues[propName] = node[propName];\n });\n this.timingFunction = (t) => t;\n if (settings.easing && typeof settings.easing === 'string') {\n this.timingFunction = getTimingFunction(settings.easing);\n }\n this.delayFor = settings.delay || 0;\n }\n reset() {\n this.progress = 0;\n this.delayFor = this.settings.delay || 0;\n this.update(0);\n }\n restore() {\n this.reset();\n Object.keys(this.props).forEach((propName) => {\n this.node[propName] = this.propStartValues[propName];\n });\n }\n reverse() {\n this.progress = 0;\n Object.keys(this.props).forEach((propName) => {\n // set the start value to the current value\n const startValue = this.props[propName];\n const endValue = this.propStartValues[propName];\n // swap the start and end values\n this.props[propName] = endValue;\n this.propStartValues[propName] = startValue;\n });\n // restore stop method if we are not looping\n if (!this.settings.loop) {\n this.settings.stopMethod = false;\n }\n }\n applyEasing(p, s, e) {\n return (this.timingFunction(p) || p) * (e - s) + s;\n }\n update(dt) {\n const { duration, loop, easing, stopMethod } = this.settings;\n if (!duration) {\n this.emit('finished', {});\n return;\n }\n if (this.delayFor > 0) {\n this.delayFor -= dt;\n return;\n }\n if (this.delayFor <= 0 && this.progress === 0) {\n this.emit('start', {});\n }\n this.progress += dt / duration;\n if (this.progress > 1) {\n this.progress = loop ? 0 : 1;\n if (stopMethod) {\n // If there's a stop method emit finished so the stop method can be applied.\n // TODO: We should probably reevaluate how stopMethod is implemented as currently\n // stop method 'reset' does not work when looping.\n this.emit('finished', {});\n return;\n }\n }\n for (let i = 0; i < this.propsList.length; i++) {\n const propName = this.propsList[i];\n const propValue = this.props[propName];\n const startValue = this.propStartValues[propName];\n const endValue = propValue;\n if (propName.indexOf('color') !== -1) {\n // check if we have to change the color to begin with\n if (startValue === endValue) {\n this.node[propName] = startValue;\n continue;\n }\n if (easing) {\n const easingProgressValue = this.timingFunction(this.progress) || this.progress;\n const easingColorValue = mergeColorProgress(startValue, endValue, easingProgressValue);\n this.node[propName] = easingColorValue;\n continue;\n }\n this.node[propName] = mergeColorProgress(startValue, endValue, this.progress);\n continue;\n }\n if (easing) {\n this.node[propName] = this.applyEasing(this.progress, startValue, endValue);\n continue;\n }\n this.node[propName] =\n startValue + (endValue - startValue) * this.progress;\n }\n if (this.progress === 1) {\n this.emit('finished', {});\n }\n }\n}\n//# sourceMappingURL=CoreAnimation.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nexport class CoreAnimationController {\n manager;\n animation;\n startedPromise = null;\n /**\n * If this is null, then the animation hasn't started yet.\n */\n startedResolve = null;\n stoppedPromise = null;\n /**\n * If this is null, then the animation is in a finished / stopped state.\n */\n stoppedResolve = null;\n constructor(manager, animation) {\n this.manager = manager;\n this.animation = animation;\n this.state = 'stopped';\n }\n state;\n start() {\n this.makeStartedPromise();\n this.animation.once('start', this.started.bind(this));\n this.makeStoppedPromise();\n this.animation.once('finished', this.finished.bind(this));\n // prevent registering the same animation twice\n if (!this.manager.activeAnimations.has(this.animation)) {\n this.manager.registerAnimation(this.animation);\n }\n this.state = 'running';\n return this;\n }\n stop() {\n this.manager.unregisterAnimation(this.animation);\n if (this.stoppedResolve !== null) {\n this.stoppedResolve();\n this.stoppedResolve = null;\n }\n this.animation.reset();\n this.state = 'stopped';\n return this;\n }\n pause() {\n this.manager.unregisterAnimation(this.animation);\n this.state = 'paused';\n return this;\n }\n restore() {\n this.stoppedResolve = null;\n this.animation.restore();\n return this;\n }\n waitUntilStarted() {\n this.makeStartedPromise();\n const promise = this.startedPromise;\n assertTruthy(promise);\n return promise;\n }\n waitUntilStopped() {\n this.makeStoppedPromise();\n const promise = this.stoppedPromise;\n assertTruthy(promise);\n return promise;\n }\n makeStartedPromise() {\n if (this.startedResolve === null) {\n this.startedPromise = new Promise((resolve) => {\n this.startedResolve = resolve;\n });\n }\n }\n makeStoppedPromise() {\n if (this.stoppedResolve === null) {\n this.stoppedPromise = new Promise((resolve) => {\n this.stoppedResolve = resolve;\n });\n }\n }\n started() {\n assertTruthy(this.startedResolve);\n // resolve promise (and pass current this to continue to the chain)\n this.startedResolve(this);\n this.startedResolve = null;\n }\n finished() {\n assertTruthy(this.stoppedResolve);\n // If the animation is looping, then we need to restart it.\n const { loop, stopMethod } = this.animation.settings;\n if (stopMethod === 'reverse') {\n this.animation.reverse();\n this.start();\n return;\n }\n // resolve promise\n this.stoppedResolve();\n this.stoppedResolve = null;\n if (loop) {\n return;\n }\n // unregister animation\n this.manager.unregisterAnimation(this.animation);\n }\n}\n//# sourceMappingURL=CoreAnimationController.js.map","/* eslint-disable @typescript-eslint/no-non-null-assertion */\n// Matrix3d is a 3x3 matrix in column-major order because that's how WebGL likes it.\n// The matrix is stored in a Float32Array in the following order:\n// | 0 3 6 |\n// | 1 4 7 |\n// | 2 5 8 |\n// The following constants are used to index into the array in a row-major way.\nconst m0 = 0;\nconst m1 = 3;\nconst m2 = 6;\nconst m3 = 1;\nconst m4 = 4;\nconst m5 = 7;\nconst m6 = 2;\nconst m7 = 5;\nconst m8 = 8;\n/**\n * A 3x3 matrix representing a 2D transformation.\n *\n * @remarks\n * The matrix is stored in column-major order in the `data` property which can\n * be passed directly to a WebGL shader uniform.\n *\n * The matrix is stored in a Float32Array in the following index order:\n * | 0 3 6 |\n * | 1 4 7 |\n * | 2 5 8 |\n *\n * Only the first two rows are really used for the transformation. The last row is\n * generally always `[0, 0, 1]` if you only use the 2D transformation methods\n * provided by this class.\n *\n * For convenience, entries in the first two rows can be accessed by the following\n * getter properties:\n * | ta tb tx |\n * | tc td ty |\n * | 0 0 1 |\n */\nexport class Matrix3d {\n data;\n /**\n * Creates a new 3x3 matrix.\n *\n * @param entries Row-major 3x3 matrix\n */\n constructor(entries) {\n if (entries) {\n // Transpose the input matrix so that it's in column-major order.\n this.data = new Float32Array(9);\n this.data[m0] = entries[0];\n this.data[m1] = entries[3];\n this.data[m2] = entries[6];\n this.data[m3] = entries[1];\n this.data[m4] = entries[4];\n this.data[m5] = entries[7];\n this.data[m6] = entries[2];\n this.data[m7] = entries[5];\n this.data[m8] = entries[8];\n }\n else {\n this.data = new Float32Array(9);\n }\n }\n /**\n * Returns a temporary matrix that can be used for calculations.\n *\n * @remarks\n * This is useful for avoiding allocations in tight loops.\n *\n * The matrix is not guaranteed to be the same between calls.\n *\n * @returns\n */\n static get temp() {\n return tempMatrix;\n }\n static multiply(a, b, out) {\n const e0 = a.data[m0] * b.data[m0] +\n a.data[m1] * b.data[m3] +\n a.data[m2] * b.data[m6];\n const e1 = a.data[m0] * b.data[m1] +\n a.data[m1] * b.data[m4] +\n a.data[m2] * b.data[m7];\n const e2 = a.data[m0] * b.data[m2] +\n a.data[m1] * b.data[m5] +\n a.data[m2] * b.data[m8];\n const e3 = a.data[m3] * b.data[m0] +\n a.data[m4] * b.data[m3] +\n a.data[m5] * b.data[m6];\n const e4 = a.data[m3] * b.data[m1] +\n a.data[m4] * b.data[m4] +\n a.data[m5] * b.data[m7];\n const e5 = a.data[m3] * b.data[m2] +\n a.data[m4] * b.data[m5] +\n a.data[m5] * b.data[m8];\n const e6 = a.data[m6] * b.data[m0] +\n a.data[m7] * b.data[m3] +\n a.data[m8] * b.data[m6];\n const e7 = a.data[m6] * b.data[m1] +\n a.data[m7] * b.data[m4] +\n a.data[m8] * b.data[m7];\n const e8 = a.data[m6] * b.data[m2] +\n a.data[m7] * b.data[m5] +\n a.data[m8] * b.data[m8];\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = e0;\n out.data[m1] = e1;\n out.data[m2] = e2;\n out.data[m3] = e3;\n out.data[m4] = e4;\n out.data[m5] = e5;\n out.data[m6] = e6;\n out.data[m7] = e7;\n out.data[m8] = e8;\n return out;\n }\n static identity(out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = 1;\n out.data[m1] = 0;\n out.data[m2] = 0;\n out.data[m3] = 0;\n out.data[m4] = 1;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static translate(x, y, out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = 1;\n out.data[m1] = 0;\n out.data[m2] = x;\n out.data[m3] = 0;\n out.data[m4] = 1;\n out.data[m5] = y;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static scale(sx, sy, out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = sx;\n out.data[m1] = 0;\n out.data[m2] = 0;\n out.data[m3] = 0;\n out.data[m4] = sy;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static rotate(angle, out) {\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = cos;\n out.data[m1] = -sin;\n out.data[m2] = 0;\n out.data[m3] = sin;\n out.data[m4] = cos;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static copy(src, dst, transpose) {\n if (!dst) {\n dst = new Matrix3d();\n }\n dst.data[0] = src.data[0];\n dst.data[1] = src.data[1];\n dst.data[2] = src.data[2];\n dst.data[3] = src.data[3];\n dst.data[4] = src.data[4];\n dst.data[5] = src.data[5];\n dst.data[6] = src.data[6];\n dst.data[7] = src.data[7];\n dst.data[8] = src.data[8];\n return dst;\n }\n translate(x, y) {\n this.data[m2] = this.data[m0] * x + this.data[m1] * y + this.data[m2];\n this.data[m5] = this.data[m3] * x + this.data[m4] * y + this.data[m5];\n return this;\n }\n scale(sx, sy) {\n this.data[m0] = this.data[m0] * sx;\n this.data[m1] = this.data[m1] * sy;\n this.data[m3] = this.data[m3] * sx;\n this.data[m4] = this.data[m4] * sy;\n return this;\n }\n rotate(angle) {\n if (angle === 0 || !((angle % Math.PI) * 2)) {\n return this;\n }\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n const e0 = this.data[m0] * cos + this.data[m1] * sin;\n const e1 = this.data[m1] * cos - this.data[m0] * sin;\n const e3 = this.data[m3] * cos + this.data[m4] * sin;\n const e4 = this.data[m4] * cos - this.data[m3] * sin;\n this.data[m0] = e0;\n this.data[m1] = e1;\n this.data[m3] = e3;\n this.data[m4] = e4;\n return this;\n }\n multiply(other) {\n return Matrix3d.multiply(this, other, this);\n }\n get tx() {\n return this.data[m2];\n }\n get ty() {\n return this.data[m5];\n }\n get ta() {\n return this.data[m0];\n }\n get tb() {\n return this.data[m1];\n }\n get tc() {\n return this.data[m3];\n }\n get td() {\n return this.data[m4];\n }\n transformPoint(x, y) {\n return [\n this.data[m0] * x + this.data[m1] * y + this.data[m2],\n this.data[m3] * x + this.data[m4] * y + this.data[m3],\n ];\n }\n}\nconst tempMatrix = new Matrix3d();\n//# sourceMappingURL=Matrix3d.js.map","const rx1 = 0;\nconst rx2 = 2;\nconst rx3 = 4;\nconst rx4 = 6;\nconst ry1 = 1;\nconst ry2 = 3;\nconst ry3 = 5;\nconst ry4 = 7;\nexport class RenderCoords {\n data;\n constructor(entries) {\n this.data = new Float32Array(8);\n if (entries) {\n this.data[rx1] = entries[rx1];\n this.data[rx2] = entries[rx2];\n this.data[rx3] = entries[rx3];\n this.data[rx4] = entries[rx4];\n this.data[ry1] = entries[ry1];\n this.data[ry2] = entries[ry2];\n this.data[ry3] = entries[ry3];\n this.data[ry4] = entries[ry4];\n }\n }\n static translate(x1, y1, x2, y2, x3, y3, x4, y4, out) {\n if (!out) {\n out = new RenderCoords();\n }\n out.data[rx1] = x1;\n out.data[rx2] = x2;\n out.data[rx3] = x3;\n out.data[rx4] = x4;\n out.data[ry1] = y1;\n out.data[ry2] = y2;\n out.data[ry3] = y3;\n out.data[ry4] = y4;\n return out;\n }\n get x1() {\n return this.data[rx1];\n }\n get x2() {\n return this.data[rx2];\n }\n get x3() {\n return this.data[rx3];\n }\n get x4() {\n return this.data[rx4];\n }\n get y1() {\n return this.data[ry1];\n }\n get y2() {\n return this.data[ry2];\n }\n get y3() {\n return this.data[ry3];\n }\n get y4() {\n return this.data[ry4];\n }\n}\n//# sourceMappingURL=RenderCoords.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy, mergeColorAlphaPremultiplied } from '../utils.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { copyRect, intersectRect, createBound, boundInsideBound, } from './lib/utils.js';\nimport { Matrix3d } from './lib/Matrix3d.js';\nimport { RenderCoords } from './lib/RenderCoords.js';\nexport var CoreNodeRenderState;\n(function (CoreNodeRenderState) {\n CoreNodeRenderState[CoreNodeRenderState[\"Init\"] = 0] = \"Init\";\n CoreNodeRenderState[CoreNodeRenderState[\"OutOfBounds\"] = 2] = \"OutOfBounds\";\n CoreNodeRenderState[CoreNodeRenderState[\"InBounds\"] = 4] = \"InBounds\";\n CoreNodeRenderState[CoreNodeRenderState[\"InViewport\"] = 8] = \"InViewport\";\n})(CoreNodeRenderState || (CoreNodeRenderState = {}));\nconst CoreNodeRenderStateMap = new Map();\nCoreNodeRenderStateMap.set(CoreNodeRenderState.Init, 'init');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.OutOfBounds, 'outOfBounds');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.InBounds, 'inBounds');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.InViewport, 'inViewport');\nexport var UpdateType;\n(function (UpdateType) {\n /**\n * Child updates\n */\n UpdateType[UpdateType[\"Children\"] = 1] = \"Children\";\n /**\n * Scale/Rotate transform update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `scaleRotateTransform`\n */\n UpdateType[UpdateType[\"ScaleRotate\"] = 2] = \"ScaleRotate\";\n /**\n * Translate transform update (x/y/width/height/pivot/mount)\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `localTransform`\n */\n UpdateType[UpdateType[\"Local\"] = 4] = \"Local\";\n /**\n * Global Transform update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `globalTransform`\n * - `renderCoords`\n * - `renderBound`\n */\n UpdateType[UpdateType[\"Global\"] = 8] = \"Global\";\n /**\n * Clipping rect update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `clippingRect`\n */\n UpdateType[UpdateType[\"Clipping\"] = 16] = \"Clipping\";\n /**\n * Calculated ZIndex update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `calcZIndex`\n */\n UpdateType[UpdateType[\"CalculatedZIndex\"] = 32] = \"CalculatedZIndex\";\n /**\n * Z-Index Sorted Children update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `children` (sorts children by their `calcZIndex`)\n */\n UpdateType[UpdateType[\"ZIndexSortedChildren\"] = 64] = \"ZIndexSortedChildren\";\n /**\n * Premultiplied Colors update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `premultipliedColorTl`\n * - `premultipliedColorTr`\n * - `premultipliedColorBl`\n * - `premultipliedColorBr`\n */\n UpdateType[UpdateType[\"PremultipliedColors\"] = 128] = \"PremultipliedColors\";\n /**\n * World Alpha update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `worldAlpha` = `parent.worldAlpha` * `alpha`\n */\n UpdateType[UpdateType[\"WorldAlpha\"] = 256] = \"WorldAlpha\";\n /**\n * Render State update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `renderState`\n */\n UpdateType[UpdateType[\"RenderState\"] = 512] = \"RenderState\";\n /**\n * Is Renderable update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `isRenderable`\n */\n UpdateType[UpdateType[\"IsRenderable\"] = 1024] = \"IsRenderable\";\n /**\n * None\n */\n UpdateType[UpdateType[\"None\"] = 0] = \"None\";\n /**\n * All\n */\n UpdateType[UpdateType[\"All\"] = 2047] = \"All\";\n})(UpdateType || (UpdateType = {}));\nexport class CoreNode extends EventEmitter {\n stage;\n children = [];\n props;\n updateType = UpdateType.All;\n globalTransform;\n scaleRotateTransform;\n localTransform;\n renderCoords;\n renderBound;\n strictBound;\n preloadBound;\n clippingRect = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n valid: false,\n };\n isRenderable = false;\n renderState = CoreNodeRenderState.Init;\n worldAlpha = 1;\n premultipliedColorTl = 0;\n premultipliedColorTr = 0;\n premultipliedColorBl = 0;\n premultipliedColorBr = 0;\n calcZIndex = 0;\n constructor(stage, props) {\n super();\n this.stage = stage;\n this.props = {\n ...props,\n parent: null,\n };\n // Allow for parent to be processed appropriately\n this.parent = props.parent;\n this.updateScaleRotateTransform();\n }\n //#region Textures\n loadTexture(textureType, props, options = null) {\n // First unload any existing texture\n if (this.props.texture) {\n this.unloadTexture();\n }\n const { txManager } = this.stage;\n const texture = txManager.loadTexture(textureType, props, options);\n this.props.texture = texture;\n this.props.textureOptions = options;\n this.setUpdateType(UpdateType.IsRenderable);\n // If texture is already loaded / failed, trigger loaded event manually\n // so that users get a consistent event experience.\n // We do this in a microtask to allow listeners to be attached in the same\n // synchronous task after calling loadTexture()\n queueMicrotask(() => {\n if (texture.state === 'loaded') {\n this.onTextureLoaded(texture, texture.dimensions);\n }\n else if (texture.state === 'failed') {\n this.onTextureFailed(texture, texture.error);\n }\n else if (texture.state === 'freed') {\n this.onTextureFreed(texture);\n }\n texture.on('loaded', this.onTextureLoaded);\n texture.on('failed', this.onTextureFailed);\n texture.on('freed', this.onTextureFreed);\n });\n }\n unloadTexture() {\n if (this.props.texture) {\n const { texture } = this.props;\n texture.off('loaded', this.onTextureLoaded);\n texture.off('failed', this.onTextureFailed);\n texture.off('freed', this.onTextureFreed);\n texture.setRenderableOwner(this, false);\n }\n this.props.texture = null;\n this.props.textureOptions = null;\n this.setUpdateType(UpdateType.IsRenderable);\n }\n onTextureLoaded = (target, dimensions) => {\n // Texture was loaded. In case the RAF loop has already stopped, we request\n // a render to ensure the texture is rendered.\n this.stage.requestRender();\n this.emit('loaded', {\n type: 'texture',\n dimensions,\n });\n };\n onTextureFailed = (target, error) => {\n this.emit('failed', {\n type: 'texture',\n error,\n });\n };\n onTextureFreed = (target) => {\n this.emit('freed', {\n type: 'texture',\n });\n };\n //#endregion Textures\n loadShader(shaderType, props) {\n const shManager = this.stage.renderer.getShaderManager();\n assertTruthy(shManager);\n const { shader, props: p } = shManager.loadShader(shaderType, props);\n this.props.shader = shader;\n this.props.shaderProps = p;\n this.setUpdateType(UpdateType.IsRenderable);\n }\n /**\n * Change types types is used to determine the scope of the changes being applied\n *\n * @remarks\n * See {@link UpdateType} for more information on each type\n *\n * @param type\n */\n setUpdateType(type) {\n this.updateType |= type;\n // If we're updating this node at all, we need to inform the parent\n // (and all ancestors) that their children need updating as well\n const parent = this.props.parent;\n if (parent && !(parent.updateType & UpdateType.Children)) {\n parent.setUpdateType(UpdateType.Children);\n }\n }\n sortChildren() {\n this.children.sort((a, b) => a.calcZIndex - b.calcZIndex);\n }\n updateScaleRotateTransform() {\n this.scaleRotateTransform = Matrix3d.rotate(this.props.rotation, this.scaleRotateTransform).scale(this.props.scaleX, this.props.scaleY);\n }\n updateLocalTransform() {\n assertTruthy(this.scaleRotateTransform);\n const pivotTranslateX = this.props.pivotX * this.props.width;\n const pivotTranslateY = this.props.pivotY * this.props.height;\n const mountTranslateX = this.props.mountX * this.props.width;\n const mountTranslateY = this.props.mountY * this.props.height;\n this.localTransform = Matrix3d.translate(pivotTranslateX - mountTranslateX + this.props.x, pivotTranslateY - mountTranslateY + this.props.y, this.localTransform)\n .multiply(this.scaleRotateTransform)\n .translate(-pivotTranslateX, -pivotTranslateY);\n this.setUpdateType(UpdateType.Global);\n }\n /**\n * @todo: test for correct calculation flag\n * @param delta\n */\n update(delta, parentClippingRect) {\n if (this.updateType & UpdateType.ScaleRotate) {\n this.updateScaleRotateTransform();\n this.setUpdateType(UpdateType.Local);\n }\n if (this.updateType & UpdateType.Local) {\n this.updateLocalTransform();\n this.setUpdateType(UpdateType.Global);\n }\n const parent = this.props.parent;\n let childUpdateType = UpdateType.None;\n if (this.updateType & UpdateType.Global) {\n assertTruthy(this.localTransform);\n this.globalTransform = Matrix3d.copy(parent?.globalTransform || this.localTransform, this.globalTransform);\n if (parent) {\n this.globalTransform.multiply(this.localTransform);\n }\n this.calculateRenderCoords();\n this.updateBoundingRect();\n this.setUpdateType(UpdateType.Clipping | UpdateType.RenderState | UpdateType.Children);\n childUpdateType |= UpdateType.Global;\n }\n if (this.updateType & UpdateType.Clipping) {\n this.calculateClippingRect(parentClippingRect);\n this.setUpdateType(UpdateType.Children);\n childUpdateType |= UpdateType.Clipping;\n }\n if (this.updateType & UpdateType.WorldAlpha) {\n if (parent) {\n this.worldAlpha = parent.worldAlpha * this.props.alpha;\n }\n else {\n this.worldAlpha = this.props.alpha;\n }\n this.setUpdateType(UpdateType.Children | UpdateType.PremultipliedColors);\n childUpdateType |= UpdateType.WorldAlpha;\n }\n if (this.updateType & UpdateType.PremultipliedColors) {\n this.premultipliedColorTl = mergeColorAlphaPremultiplied(this.props.colorTl, this.worldAlpha, true);\n // If all the colors are the same just sent them all to the same value\n if (this.props.colorTl === this.props.colorTr &&\n this.props.colorBl === this.props.colorBr &&\n this.props.colorTl === this.props.colorBl) {\n this.premultipliedColorTr =\n this.premultipliedColorBl =\n this.premultipliedColorBr =\n this.premultipliedColorTl;\n }\n else {\n this.premultipliedColorTr = mergeColorAlphaPremultiplied(this.props.colorTr, this.worldAlpha, true);\n this.premultipliedColorBl = mergeColorAlphaPremultiplied(this.props.colorBl, this.worldAlpha, true);\n this.premultipliedColorBr = mergeColorAlphaPremultiplied(this.props.colorBr, this.worldAlpha, true);\n }\n }\n if (this.updateType & UpdateType.RenderState) {\n this.updateRenderState(parentClippingRect);\n this.setUpdateType(UpdateType.IsRenderable);\n }\n if (this.updateType & UpdateType.IsRenderable) {\n this.updateIsRenderable();\n }\n // No need to update zIndex if there is no parent\n if (parent && this.updateType & UpdateType.CalculatedZIndex) {\n this.calculateZIndex();\n // Tell parent to re-sort children\n parent.setUpdateType(UpdateType.ZIndexSortedChildren);\n }\n if (this.updateType & UpdateType.Children && this.children.length) {\n this.children.forEach((child) => {\n // Trigger the depenedent update types on the child\n child.setUpdateType(childUpdateType);\n // If child has no updates, skip\n if (child.updateType === 0) {\n return;\n }\n child.update(delta, this.clippingRect);\n });\n }\n // Sorting children MUST happen after children have been updated so\n // that they have the oppotunity to update their calculated zIndex.\n if (this.updateType & UpdateType.ZIndexSortedChildren) {\n // reorder z-index\n this.sortChildren();\n }\n // reset update type\n this.updateType = 0;\n }\n //check if CoreNode is renderable based on props\n checkRenderProps() {\n if (this.props.texture) {\n return true;\n }\n if (!this.props.width || !this.props.height) {\n return false;\n }\n if (this.props.shader) {\n return true;\n }\n if (this.props.clipping) {\n return true;\n }\n if (this.props.color !== 0) {\n return true;\n }\n // Consider removing these checks and just using the color property check above.\n // Maybe add a forceRender prop for nodes that should always render.\n if (this.props.colorTop !== 0) {\n return true;\n }\n if (this.props.colorBottom !== 0) {\n return true;\n }\n if (this.props.colorLeft !== 0) {\n return true;\n }\n if (this.props.colorRight !== 0) {\n return true;\n }\n if (this.props.colorTl !== 0) {\n return true;\n }\n if (this.props.colorTr !== 0) {\n return true;\n }\n if (this.props.colorBl !== 0) {\n return true;\n }\n if (this.props.colorBr !== 0) {\n return true;\n }\n return false;\n }\n checkRenderBounds(parentClippingRect) {\n assertTruthy(this.renderBound);\n const rectW = parentClippingRect.width || this.stage.root.width;\n const rectH = parentClippingRect.height || this.stage.root.height;\n this.strictBound = createBound(parentClippingRect.x, parentClippingRect.y, parentClippingRect.x + rectW, parentClippingRect.y + rectH, this.strictBound);\n const renderM = this.stage.boundsMargin;\n this.preloadBound = createBound(parentClippingRect.x - renderM[3], parentClippingRect.y - renderM[0], parentClippingRect.x + rectW + renderM[1], parentClippingRect.y + rectH + renderM[2], this.preloadBound);\n if (boundInsideBound(this.renderBound, this.strictBound)) {\n return CoreNodeRenderState.InViewport;\n }\n if (boundInsideBound(this.renderBound, this.preloadBound)) {\n return CoreNodeRenderState.InBounds;\n }\n return CoreNodeRenderState.OutOfBounds;\n }\n updateRenderState(parentClippingRect) {\n const renderState = this.checkRenderBounds(parentClippingRect);\n if (renderState !== this.renderState) {\n const previous = this.renderState;\n this.renderState = renderState;\n if (previous === CoreNodeRenderState.InViewport) {\n this.emit('outOfViewport', {\n previous,\n current: renderState,\n });\n }\n const event = CoreNodeRenderStateMap.get(renderState);\n assertTruthy(event);\n this.emit(event, {\n previous,\n current: renderState,\n });\n }\n }\n setRenderState(state) {\n if (state !== this.renderState) {\n this.renderState = state;\n this.emit(CoreNodeRenderState[state]);\n }\n }\n /**\n * This function updates the `isRenderable` property based on certain conditions.\n *\n * @returns\n */\n updateIsRenderable() {\n let newIsRenderable;\n if (!this.checkRenderProps()) {\n newIsRenderable = false;\n }\n else {\n newIsRenderable = this.renderState > CoreNodeRenderState.OutOfBounds;\n }\n if (this.isRenderable !== newIsRenderable) {\n this.isRenderable = newIsRenderable;\n this.onChangeIsRenderable(newIsRenderable);\n }\n }\n onChangeIsRenderable(isRenderable) {\n this.props.texture?.setRenderableOwner(this, isRenderable);\n }\n calculateRenderCoords() {\n const { width, height, globalTransform: transform } = this;\n assertTruthy(transform);\n const { tx, ty, ta, tb, tc, td } = transform;\n if (tb === 0 && tc === 0) {\n const minX = tx;\n const maxX = tx + width * ta;\n const minY = ty;\n const maxY = ty + height * td;\n this.renderCoords = RenderCoords.translate(\n //top-left\n minX, minY, \n //top-right\n maxX, minY, \n //bottom-right\n maxX, maxY, \n //bottom-left\n minX, maxY, this.renderCoords);\n }\n else {\n this.renderCoords = RenderCoords.translate(\n //top-left\n tx, ty, \n //top-right\n tx + width * ta, ty + width * tc, \n //bottom-right\n tx + width * ta + height * tb, ty + width * tc + height * td, \n //bottom-left\n tx + height * tb, ty + height * td, this.renderCoords);\n }\n }\n updateBoundingRect() {\n const { renderCoords, globalTransform: transform } = this;\n assertTruthy(transform);\n assertTruthy(renderCoords);\n const { tb, tc } = transform;\n const { x1, y1, x3, y3 } = renderCoords;\n if (tb === 0 || tc === 0) {\n this.renderBound = createBound(x1, y1, x3, y3, this.renderBound);\n }\n else {\n const { x2, x4, y2, y4 } = renderCoords;\n this.renderBound = createBound(Math.min(x1, x2, x3, x4), Math.min(y1, y2, y3, y4), Math.max(x1, x2, x3, x4), Math.max(y1, y2, y3, y4), this.renderBound);\n }\n }\n /**\n * This function calculates the clipping rectangle for a node.\n *\n * The function then checks if the node is rotated. If the node requires clipping and is not rotated, a new clipping rectangle is created based on the node's global transform and dimensions.\n * If a parent clipping rectangle exists, it is intersected with the node's clipping rectangle (if it exists), or replaces the node's clipping rectangle.\n *\n * Finally, the node's parentClippingRect and clippingRect properties are updated.\n */\n calculateClippingRect(parentClippingRect) {\n assertTruthy(this.globalTransform);\n const { clippingRect, props, globalTransform: gt } = this;\n const { clipping } = props;\n const isRotated = gt.tb !== 0 || gt.tc !== 0;\n if (clipping && !isRotated) {\n clippingRect.x = gt.tx;\n clippingRect.y = gt.ty;\n clippingRect.width = this.width * gt.ta;\n clippingRect.height = this.height * gt.td;\n clippingRect.valid = true;\n }\n else {\n clippingRect.valid = false;\n }\n if (parentClippingRect.valid && clippingRect.valid) {\n // Intersect parent clipping rect with node clipping rect\n intersectRect(parentClippingRect, clippingRect, clippingRect);\n }\n else if (parentClippingRect.valid) {\n // Copy parent clipping rect\n copyRect(parentClippingRect, clippingRect);\n clippingRect.valid = true;\n }\n }\n calculateZIndex() {\n const props = this.props;\n const z = props.zIndex || 0;\n const p = props.parent?.zIndex || 0;\n let zIndex = z;\n if (props.parent?.zIndexLocked) {\n zIndex = z < p ? z : p;\n }\n this.calcZIndex = zIndex;\n }\n /**\n * Destroy the node and cleanup all resources\n */\n destroy() {\n this.unloadTexture();\n this.clippingRect.valid = false;\n this.isRenderable = false;\n delete this.renderCoords;\n delete this.renderBound;\n delete this.strictBound;\n delete this.preloadBound;\n delete this.globalTransform;\n delete this.scaleRotateTransform;\n delete this.localTransform;\n this.props.texture = null;\n this.props.shader = null;\n this.removeAllListeners();\n this.parent = null;\n }\n renderQuads(renderer) {\n const { width, height, texture, textureOptions, shader, shaderProps } = this.props;\n const { premultipliedColorTl, premultipliedColorTr, premultipliedColorBl, premultipliedColorBr, } = this;\n const { zIndex, worldAlpha, globalTransform: gt, clippingRect } = this;\n assertTruthy(gt);\n // add to list of renderables to be sorted before rendering\n renderer.addQuad({\n width,\n height,\n colorTl: premultipliedColorTl,\n colorTr: premultipliedColorTr,\n colorBl: premultipliedColorBl,\n colorBr: premultipliedColorBr,\n texture,\n textureOptions,\n zIndex,\n shader,\n shaderProps,\n alpha: worldAlpha,\n clippingRect,\n tx: gt.tx,\n ty: gt.ty,\n ta: gt.ta,\n tb: gt.tb,\n tc: gt.tc,\n td: gt.td,\n });\n // Calculate absolute X and Y based on all ancestors\n // renderer.addQuad(absX, absY, w, h, color, texture, textureOptions, zIndex);\n }\n //#region Properties\n get id() {\n return this.props.id;\n }\n get x() {\n return this.props.x;\n }\n set x(value) {\n if (this.props.x !== value) {\n this.props.x = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get absX() {\n return (this.props.x +\n (this.props.parent?.absX || this.props.parent?.globalTransform?.tx || 0));\n }\n get absY() {\n return this.props.y + (this.props.parent?.absY ?? 0);\n }\n get y() {\n return this.props.y;\n }\n set y(value) {\n if (this.props.y !== value) {\n this.props.y = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get width() {\n return this.props.width;\n }\n set width(value) {\n if (this.props.width !== value) {\n this.props.width = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get height() {\n return this.props.height;\n }\n set height(value) {\n if (this.props.height !== value) {\n this.props.height = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get scale() {\n // The CoreNode `scale` property is only used by Animations.\n // Unlike INode, `null` should never be possibility for Animations.\n return this.scaleX;\n }\n set scale(value) {\n // The CoreNode `scale` property is only used by Animations.\n // Unlike INode, `null` should never be possibility for Animations.\n this.scaleX = value;\n this.scaleY = value;\n }\n get scaleX() {\n return this.props.scaleX;\n }\n set scaleX(value) {\n if (this.props.scaleX !== value) {\n this.props.scaleX = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get scaleY() {\n return this.props.scaleY;\n }\n set scaleY(value) {\n if (this.props.scaleY !== value) {\n this.props.scaleY = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get mount() {\n return this.props.mount;\n }\n set mount(value) {\n if (this.props.mountX !== value || this.props.mountY !== value) {\n this.props.mountX = value;\n this.props.mountY = value;\n this.props.mount = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get mountX() {\n return this.props.mountX;\n }\n set mountX(value) {\n if (this.props.mountX !== value) {\n this.props.mountX = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get mountY() {\n return this.props.mountY;\n }\n set mountY(value) {\n if (this.props.mountY !== value) {\n this.props.mountY = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivot() {\n return this.props.pivot;\n }\n set pivot(value) {\n if (this.props.pivotX !== value || this.props.pivotY !== value) {\n this.props.pivotX = value;\n this.props.pivotY = value;\n this.props.pivot = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivotX() {\n return this.props.pivotX;\n }\n set pivotX(value) {\n if (this.props.pivotX !== value) {\n this.props.pivotX = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivotY() {\n return this.props.pivotY;\n }\n set pivotY(value) {\n if (this.props.pivotY !== value) {\n this.props.pivotY = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get rotation() {\n return this.props.rotation;\n }\n set rotation(value) {\n if (this.props.rotation !== value) {\n this.props.rotation = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get alpha() {\n return this.props.alpha;\n }\n set alpha(value) {\n this.props.alpha = value;\n this.setUpdateType(UpdateType.PremultipliedColors | UpdateType.WorldAlpha);\n }\n get clipping() {\n return this.props.clipping;\n }\n set clipping(value) {\n this.props.clipping = value;\n this.setUpdateType(UpdateType.Clipping);\n }\n get color() {\n return this.props.color;\n }\n set color(value) {\n if (this.props.colorTl !== value ||\n this.props.colorTr !== value ||\n this.props.colorBl !== value ||\n this.props.colorBr !== value) {\n this.colorTl = value;\n this.colorTr = value;\n this.colorBl = value;\n this.colorBr = value;\n }\n this.props.color = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTop() {\n return this.props.colorTop;\n }\n set colorTop(value) {\n if (this.props.colorTl !== value || this.props.colorTr !== value) {\n this.colorTl = value;\n this.colorTr = value;\n }\n this.props.colorTop = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBottom() {\n return this.props.colorBottom;\n }\n set colorBottom(value) {\n if (this.props.colorBl !== value || this.props.colorBr !== value) {\n this.colorBl = value;\n this.colorBr = value;\n }\n this.props.colorBottom = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorLeft() {\n return this.props.colorLeft;\n }\n set colorLeft(value) {\n if (this.props.colorTl !== value || this.props.colorBl !== value) {\n this.colorTl = value;\n this.colorBl = value;\n }\n this.props.colorLeft = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorRight() {\n return this.props.colorRight;\n }\n set colorRight(value) {\n if (this.props.colorTr !== value || this.props.colorBr !== value) {\n this.colorTr = value;\n this.colorBr = value;\n }\n this.props.colorRight = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTl() {\n return this.props.colorTl;\n }\n set colorTl(value) {\n this.props.colorTl = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTr() {\n return this.props.colorTr;\n }\n set colorTr(value) {\n this.props.colorTr = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBl() {\n return this.props.colorBl;\n }\n set colorBl(value) {\n this.props.colorBl = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBr() {\n return this.props.colorBr;\n }\n set colorBr(value) {\n this.props.colorBr = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n // we're only interested in parent zIndex to test\n // if we should use node zIndex is higher then parent zIndex\n get zIndexLocked() {\n return this.props.zIndexLocked || 0;\n }\n set zIndexLocked(value) {\n this.props.zIndexLocked = value;\n this.setUpdateType(UpdateType.CalculatedZIndex | UpdateType.Children);\n this.children.forEach((child) => {\n child.setUpdateType(UpdateType.CalculatedZIndex);\n });\n }\n get zIndex() {\n return this.props.zIndex;\n }\n set zIndex(value) {\n this.props.zIndex = value;\n this.setUpdateType(UpdateType.CalculatedZIndex | UpdateType.Children);\n this.children.forEach((child) => {\n child.setUpdateType(UpdateType.CalculatedZIndex);\n });\n }\n get parent() {\n return this.props.parent;\n }\n set parent(newParent) {\n const oldParent = this.props.parent;\n if (oldParent === newParent) {\n return;\n }\n this.props.parent = newParent;\n if (oldParent) {\n const index = oldParent.children.indexOf(this);\n assertTruthy(index !== -1, \"CoreNode.parent: Node not found in old parent's children!\");\n oldParent.children.splice(index, 1);\n oldParent.setUpdateType(UpdateType.Children | UpdateType.ZIndexSortedChildren);\n }\n if (newParent) {\n newParent.children.push(this);\n // Since this node has a new parent, to be safe, have it do a full update.\n this.setUpdateType(UpdateType.All);\n // Tell parent that it's children need to be updated and sorted.\n newParent.setUpdateType(UpdateType.Children | UpdateType.ZIndexSortedChildren);\n }\n this.updateScaleRotateTransform();\n }\n}\n//# sourceMappingURL=CoreNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { CoreAnimation } from '../../core/animations/CoreAnimation.js';\nimport { CoreAnimationController } from '../../core/animations/CoreAnimationController.js';\nimport { CoreNode } from '../../core/CoreNode.js';\nimport { EventEmitter } from '../../common/EventEmitter.js';\nimport { santizeCustomDataMap } from '../utils.js';\nlet nextId = 1;\nexport function getNewId() {\n return nextId++;\n}\nexport class MainOnlyNode extends EventEmitter {\n rendererMain;\n stage;\n id;\n coreNode;\n // Prop stores\n _children = [];\n _src = '';\n _parent = null;\n _texture = null;\n _shader = null;\n _data = {};\n constructor(props, rendererMain, stage, coreNode) {\n super();\n this.rendererMain = rendererMain;\n this.stage = stage;\n this.id = coreNode?.id ?? getNewId();\n this.coreNode =\n coreNode ||\n new CoreNode(this.stage, {\n id: this.id,\n x: props.x,\n y: props.y,\n width: props.width,\n height: props.height,\n alpha: props.alpha,\n clipping: props.clipping,\n color: props.color,\n colorTop: props.colorTop,\n colorBottom: props.colorBottom,\n colorLeft: props.colorLeft,\n colorRight: props.colorRight,\n colorTl: props.colorTl,\n colorTr: props.colorTr,\n colorBl: props.colorBl,\n colorBr: props.colorBr,\n zIndex: props.zIndex,\n zIndexLocked: props.zIndexLocked,\n scaleX: props.scaleX,\n scaleY: props.scaleY,\n mountX: props.mountX,\n mountY: props.mountY,\n mount: props.mount,\n pivot: props.pivot,\n pivotX: props.pivotX,\n pivotY: props.pivotY,\n rotation: props.rotation,\n parent: null,\n shader: null,\n shaderProps: null,\n texture: null,\n textureOptions: null,\n });\n // Forward loaded/failed events\n this.coreNode.on('loaded', this.onTextureLoaded);\n this.coreNode.on('failed', this.onTextureFailed);\n this.coreNode.on('freed', this.onTextureFreed);\n this.coreNode.on('outOfBounds', this.onOutOfBounds);\n this.coreNode.on('inBounds', this.onInBounds);\n this.coreNode.on('outOfViewport', this.onOutOfViewport);\n this.coreNode.on('inViewport', this.onInViewport);\n // Assign properties to this object\n this.parent = props.parent;\n this.shader = props.shader;\n this.texture = props.texture;\n this.src = props.src;\n this._data = props.data;\n }\n get x() {\n return this.coreNode.x;\n }\n set x(value) {\n this.coreNode.x = value;\n }\n get y() {\n return this.coreNode.y;\n }\n set y(value) {\n this.coreNode.y = value;\n }\n get width() {\n return this.coreNode.width;\n }\n set width(value) {\n this.coreNode.width = value;\n }\n get height() {\n return this.coreNode.height;\n }\n set height(value) {\n this.coreNode.height = value;\n }\n get alpha() {\n return this.coreNode.alpha;\n }\n set alpha(value) {\n this.coreNode.alpha = value;\n }\n get clipping() {\n return this.coreNode.clipping;\n }\n set clipping(value) {\n this.coreNode.clipping = value;\n }\n get color() {\n return this.coreNode.color;\n }\n set color(value) {\n this.coreNode.color = value;\n }\n get colorTop() {\n return this.coreNode.colorTop;\n }\n set colorTop(value) {\n this.coreNode.colorTop = value;\n }\n get colorBottom() {\n return this.coreNode.colorBottom;\n }\n set colorBottom(value) {\n this.coreNode.colorBottom = value;\n }\n get colorLeft() {\n return this.coreNode.colorLeft;\n }\n set colorLeft(value) {\n this.coreNode.colorLeft = value;\n }\n get colorRight() {\n return this.coreNode.colorRight;\n }\n set colorRight(value) {\n this.coreNode.colorRight = value;\n }\n get colorTl() {\n return this.coreNode.colorTl;\n }\n set colorTl(value) {\n this.coreNode.colorTl = value;\n }\n get colorTr() {\n return this.coreNode.colorTr;\n }\n set colorTr(value) {\n this.coreNode.colorTr = value;\n }\n get colorBl() {\n return this.coreNode.colorBl;\n }\n set colorBl(value) {\n this.coreNode.colorBl = value;\n }\n get colorBr() {\n return this.coreNode.colorBr;\n }\n set colorBr(value) {\n this.coreNode.colorBr = value;\n }\n get scale() {\n if (this.scaleX !== this.scaleY) {\n return null;\n }\n return this.coreNode.scaleX;\n }\n set scale(value) {\n // We ignore `null` when it's set.\n if (value === null) {\n return;\n }\n this.coreNode.scaleX = value;\n this.coreNode.scaleY = value;\n }\n get scaleX() {\n return this.coreNode.scaleX;\n }\n set scaleX(value) {\n this.coreNode.scaleX = value;\n }\n get scaleY() {\n return this.coreNode.scaleY;\n }\n set scaleY(value) {\n this.coreNode.scaleY = value;\n }\n get mount() {\n return this.coreNode.mount;\n }\n set mount(value) {\n this.coreNode.mount = value;\n }\n get mountX() {\n return this.coreNode.mountX;\n }\n set mountX(value) {\n this.coreNode.mountX = value;\n }\n get mountY() {\n return this.coreNode.mountY;\n }\n set mountY(value) {\n this.coreNode.mountY = value;\n }\n get pivot() {\n return this.coreNode.pivot;\n }\n set pivot(value) {\n this.coreNode.pivot = value;\n }\n get pivotX() {\n return this.coreNode.pivotX;\n }\n set pivotX(value) {\n this.coreNode.pivotX = value;\n }\n get pivotY() {\n return this.coreNode.pivotY;\n }\n set pivotY(value) {\n this.coreNode.pivotY = value;\n }\n get rotation() {\n return this.coreNode.rotation;\n }\n set rotation(value) {\n this.coreNode.rotation = value;\n }\n get parent() {\n return this._parent;\n }\n set parent(newParent) {\n const oldParent = this._parent;\n this._parent = newParent;\n this.coreNode.parent = newParent?.coreNode ?? null;\n if (oldParent) {\n const index = oldParent.children.indexOf(this);\n assertTruthy(index !== -1, \"MainOnlyNode.parent: Node not found in old parent's children!\");\n oldParent.children.splice(index, 1);\n }\n if (newParent) {\n newParent.children.push(this);\n }\n }\n get children() {\n return this._children;\n }\n get zIndex() {\n return this.coreNode.zIndex;\n }\n set zIndex(value) {\n this.coreNode.zIndex = value;\n }\n get zIndexLocked() {\n return this.coreNode.zIndexLocked;\n }\n set zIndexLocked(value) {\n this.coreNode.zIndexLocked = value;\n }\n get src() {\n return this._src;\n }\n set src(imageUrl) {\n if (this._src === imageUrl) {\n return;\n }\n this._src = imageUrl;\n if (!imageUrl) {\n this.texture = null;\n return;\n }\n this.texture = this.rendererMain.createTexture('ImageTexture', {\n src: imageUrl,\n });\n }\n //#region Texture\n get texture() {\n return this._texture;\n }\n set texture(texture) {\n if (this._texture === texture) {\n return;\n }\n if (this._texture) {\n this.rendererMain.textureTracker.decrementTextureRefCount(this._texture);\n }\n if (texture) {\n this.rendererMain.textureTracker.incrementTextureRefCount(texture);\n }\n this._texture = texture;\n if (texture) {\n this.coreNode.loadTexture(texture.txType, texture.props, texture.options);\n }\n else {\n this.coreNode.unloadTexture();\n }\n }\n onTextureLoaded = (target, payload) => {\n this.emit('loaded', payload);\n };\n onTextureFailed = (target, payload) => {\n this.emit('failed', payload);\n };\n onTextureFreed = (target, payload) => {\n this.emit('freed', payload);\n };\n onOutOfBounds = (target, payload) => {\n this.emit('outOfBounds', payload);\n };\n onInBounds = (target, payload) => {\n this.emit('inBounds', payload);\n };\n onOutOfViewport = (target, payload) => {\n this.emit('outOfViewport', payload);\n };\n onInViewport = (target, payload) => {\n this.emit('inViewport', payload);\n };\n //#endregion Texture\n get shader() {\n return this._shader;\n }\n set shader(shader) {\n if (this._shader === shader) {\n return;\n }\n this._shader = shader;\n if (shader) {\n this.coreNode.loadShader(shader.shType, shader.props);\n }\n }\n get data() {\n return this._data;\n }\n set data(d) {\n this._data = santizeCustomDataMap(d);\n }\n destroy() {\n this.emit('beforeDestroy', {});\n //use while loop since setting parent to null removes it from array\n let child = this.children[0];\n while (child) {\n child.destroy();\n child = this.children[0];\n }\n this.coreNode.destroy();\n this.parent = null;\n this.texture = null;\n this.emit('afterDestroy', {});\n this.removeAllListeners();\n }\n flush() {\n // No-op\n }\n animate(props, settings) {\n const animation = new CoreAnimation(this.coreNode, props, settings);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call\n const controller = new CoreAnimationController(this.stage.animationManager, animation);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return controller;\n }\n}\n//# sourceMappingURL=MainOnlyNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Platform render loop initiator\n */\nexport const startLoop = (stage) => {\n let isIdle = false;\n const runLoop = () => {\n stage.updateAnimations();\n if (!stage.hasSceneUpdates()) {\n // We still need to calculate the fps else it looks like the app is frozen\n stage.calculateFps();\n setTimeout(runLoop, 16.666666666666668);\n if (!isIdle) {\n stage.emit('idle');\n isIdle = true;\n }\n return;\n }\n isIdle = false;\n stage.drawFrame();\n requestAnimationFrame(runLoop);\n };\n requestAnimationFrame(runLoop);\n};\n/**\n * Return unix timestamp\n * @return {number}\n */\nexport const getTimeStamp = () => {\n return performance ? performance.now() : Date.now();\n};\n//# sourceMappingURL=platform.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreAnimation } from './CoreAnimation.js';\nexport class AnimationManager {\n activeAnimations = new Set();\n registerAnimation(animation) {\n this.activeAnimations.add(animation);\n }\n unregisterAnimation(animation) {\n this.activeAnimations.delete(animation);\n }\n update(dt) {\n this.activeAnimations.forEach((animation) => {\n animation.update(dt);\n });\n }\n}\n//# sourceMappingURL=AnimationManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {} from '../textures/Texture.js';\nexport class ImageWorkerManager {\n imageWorkersEnabled = true;\n messageManager = {};\n workers = [];\n workerIndex = 0;\n constructor(numImageWorkers) {\n this.workers = this.createWorkers(numImageWorkers);\n this.workers.forEach((worker) => {\n worker.onmessage = this.handleMessage.bind(this);\n });\n }\n handleMessage(event) {\n const { src, data, error } = event.data;\n const msg = this.messageManager[src];\n if (msg) {\n const [resolve, reject] = msg;\n delete this.messageManager[src];\n if (error) {\n reject(new Error(error));\n }\n else {\n resolve(data);\n }\n }\n }\n createWorkers(numWorkers = 1) {\n const workerCode = `\n function hasAlphaChannel(mimeType) {\n return (mimeType.indexOf(\"image/png\") !== -1);\n }\n\n async function getImage(src, premultiplyAlpha) {\n return new Promise(function(resolve, reject) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', src, true);\n xhr.responseType = 'blob';\n\n xhr.onload = function() {\n if (xhr.status === 200) {\n var blob = xhr.response;\n var hasAlphaChannel = premultiplyAlpha !== undefined ? premultiplyAlpha : hasAlphaChannel(blob.type);\n\n createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none'\n }).then(function(data) {\n resolve({ data: data, premultiplyAlpha: premultiplyAlpha });\n }).catch(function(error) {\n reject(error);\n });\n } else {\n reject(new Error('Failed to load image: ' + xhr.statusText));\n }\n };\n\n xhr.onerror = function() {\n reject(new Error('Network error occurred while trying to fetch the image.'));\n };\n\n xhr.send();\n });\n }\n\n self.onmessage = async (event) => {\n var src = event.data.src;\n var premultiplyAlpha = event.data.premultiplyAlpha;\n\n getImage(src, premultiplyAlpha)\n .then(function(data) {\n self.postMessage({ src: src, data: data }, [data.data]);\n })\n .catch(function(error) {\n self.postMessage({ src: src, error: error.message });\n });\n };\n `;\n const blob = new Blob([workerCode.replace('\"use strict\";', '')], {\n type: 'application/javascript',\n });\n const blobURL = (self.URL ? URL : webkitURL).createObjectURL(blob);\n const workers = [];\n for (let i = 0; i < numWorkers; i++) {\n workers.push(new Worker(blobURL));\n }\n return workers;\n }\n getNextWorker() {\n const worker = this.workers[this.workerIndex];\n this.workerIndex = (this.workerIndex + 1) % this.workers.length;\n return worker;\n }\n convertUrlToAbsolute(url) {\n const absoluteUrl = new URL(url, self.location.href);\n return absoluteUrl.href;\n }\n getImage(src, premultiplyAlpha) {\n return new Promise((resolve, reject) => {\n try {\n if (this.workers) {\n const absoluteSrcUrl = this.convertUrlToAbsolute(src);\n this.messageManager[absoluteSrcUrl] = [resolve, reject];\n this.getNextWorker().postMessage({\n src: absoluteSrcUrl,\n premultiplyAlpha,\n });\n }\n }\n catch (error) {\n reject(error);\n }\n });\n }\n}\n//# sourceMappingURL=ImageWorker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\n/**\n * Texture consisting of a random grid of greyscale pixels\n *\n * @remarks\n * The width and height of the NoiseTexture are defined by it's\n * {@link NoiseTextureProps.width} and {@link NoiseTextureProps.height}\n * properties. The {@link NoiseTextureProps.cacheId} prop can be varied in order\n * to bypass cache and get newly randomized texture data.\n */\nexport class NoiseTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = NoiseTexture.resolveDefaults(props);\n }\n async getTextureData() {\n const { width, height } = this.props;\n const size = width * height * 4;\n const pixelData8 = new Uint8ClampedArray(size);\n for (let i = 0; i < size; i += 4) {\n const v = Math.floor(Math.random() * 256);\n pixelData8[i] = v;\n pixelData8[i + 1] = v;\n pixelData8[i + 2] = v;\n pixelData8[i + 3] = 255;\n }\n return {\n data: new ImageData(pixelData8, width, height),\n };\n }\n static makeCacheKey(props) {\n const resolvedProps = NoiseTexture.resolveDefaults(props);\n return `NoiseTexture,${resolvedProps.width},${resolvedProps.height},${resolvedProps.cacheId}`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 128,\n height: props.height ?? 128,\n cacheId: props.cacheId ?? 0,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=NoiseTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../utils.js';\nimport { ImageWorkerManager } from './lib/ImageWorker.js';\nimport { ColorTexture } from './textures/ColorTexture.js';\nimport { ImageTexture } from './textures/ImageTexture.js';\nimport { NoiseTexture } from './textures/NoiseTexture.js';\nimport { SubTexture } from './textures/SubTexture.js';\nexport class CoreTextureManager {\n /**\n * Amount of used memory defined in pixels\n */\n usedMemory = 0;\n txConstructors = {};\n textureKeyCache = new Map();\n textureIdCache = new Map();\n ctxTextureCache = new WeakMap();\n textureRefCountMap = new WeakMap();\n imageWorkerManager = null;\n hasCreateImageBitmap = !!self.createImageBitmap;\n hasWorker = !!self.Worker;\n /**\n * Renderer that this texture manager is associated with\n *\n * @remarks\n * This MUST be set before the texture manager is used. Otherwise errors\n * will occur when using the texture manager.\n */\n renderer;\n constructor(numImageWorkers) {\n // Register default known texture types\n if (this.hasCreateImageBitmap && this.hasWorker) {\n this.imageWorkerManager = new ImageWorkerManager(numImageWorkers);\n }\n if (!this.hasCreateImageBitmap) {\n console.warn('[Lightning] createImageBitmap is not supported on this browser. ImageTexture will be slower.');\n }\n this.registerTextureType('ImageTexture', ImageTexture);\n this.registerTextureType('ColorTexture', ColorTexture);\n this.registerTextureType('NoiseTexture', NoiseTexture);\n this.registerTextureType('SubTexture', SubTexture);\n }\n registerTextureType(textureType, textureClass) {\n this.txConstructors[textureType] = textureClass;\n }\n loadTexture(textureType, props, options = null) {\n const TextureClass = this.txConstructors[textureType];\n if (!TextureClass) {\n throw new Error(`Texture type \"${textureType}\" is not registered`);\n }\n let texture;\n // If an ID is specified, try to get the texture from the ID cache first\n if (options?.id !== undefined && this.textureIdCache.has(options.id)) {\n // console.log('Getting texture by texture desc ID', options.id);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n texture = this.textureIdCache.get(options.id);\n }\n // If the texture is not found in the ID cache, try to get it from the key cache\n if (!texture) {\n const descId = options?.id;\n const cacheKey = options?.cacheKey ?? TextureClass.makeCacheKey(props);\n if (cacheKey && this.textureKeyCache.has(cacheKey)) {\n // console.log('Getting texture by cache key', cacheKey);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n texture = this.textureKeyCache.get(cacheKey);\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any\n texture = new TextureClass(this, props);\n }\n if (descId) {\n this.addTextureIdToCache(descId, cacheKey, texture);\n }\n }\n if (options?.preload) {\n const ctxTx = this.getCtxTexture(texture);\n ctxTx.load();\n }\n return texture;\n }\n /**\n * Add a `Texture` to the texture cache by its texture desc ID and cache key\n *\n * @remarks\n * This is used internally by the `CoreTextureManager` to cache textures\n * when they are created.\n *\n * It handles updating the texture ID cache, texture key cache, and texture\n * reference count map.\n *\n * @param textureDescId\n * @param cacheKey\n * @param texture\n */\n addTextureIdToCache(textureDescId, cacheKey, texture) {\n const { textureIdCache, textureRefCountMap } = this;\n textureIdCache.set(textureDescId, texture);\n if (textureRefCountMap.has(texture)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n textureRefCountMap.get(texture).count++;\n }\n else {\n textureRefCountMap.set(texture, { cacheKey, count: 1 });\n if (cacheKey) {\n this.textureKeyCache.set(cacheKey, texture);\n }\n }\n }\n /**\n * Remove a `Texture` from the texture cache by its texture desc ID\n *\n * @remarks\n * This is called externally by when we know (at least reasonably well) that\n * the `TextureRef` in the Main API space has been is no longer used. This\n * allows us to remove the `Texture` from the Usage Cache so that it can be\n * garbage collected as well.\n *\n * @param textureDescId\n */\n removeTextureIdFromCache(textureDescId) {\n const { textureIdCache, textureRefCountMap } = this;\n const texture = textureIdCache.get(textureDescId);\n if (!texture) {\n // Sometimes a texture is removed from the cache before it ever gets\n // added to the cache. This is fine and not an error.\n return;\n }\n textureIdCache.delete(textureDescId);\n if (textureRefCountMap.has(texture)) {\n const refCountObj = textureRefCountMap.get(texture);\n assertTruthy(refCountObj);\n refCountObj.count--;\n if (refCountObj.count === 0) {\n textureRefCountMap.delete(texture);\n // If the texture is not referenced anywhere else, remove it from the key cache\n // as well.\n // This should allow the `Texture` instance to be garbage collected.\n if (refCountObj.cacheKey) {\n this.textureKeyCache.delete(refCountObj.cacheKey);\n }\n }\n }\n // Free the ctx texture if it exists.\n this.ctxTextureCache.get(texture)?.free();\n }\n /**\n * Get an object containing debug information about the texture manager.\n *\n * @returns\n */\n getDebugInfo() {\n // const textureSet = new Set();\n // for (const texture of this.textureIdCache.values()) {\n // textureSet.add(texture);\n // }\n // for (const texture of this.textureKeyCache.values()) {\n // textureSet.add(texture);\n // }\n // TODO: Output number of bytes used by textures\n return {\n keyCacheSize: this.textureKeyCache.size,\n idCacheSize: this.textureIdCache.size,\n };\n }\n /**\n * Get a CoreContextTexture for the given Texture source.\n *\n * @remarks\n * If the texture source already has an allocated CoreContextTexture, it will be\n * returned from the cache. Otherwise, a new CoreContextTexture will be created\n * and cached.\n *\n * ContextTextures are stored in a WeakMap, so they will be garbage collected\n * when the Texture source is no longer referenced.\n *\n * @param textureSource\n * @returns\n */\n getCtxTexture(textureSource) {\n if (this.ctxTextureCache.has(textureSource)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.ctxTextureCache.get(textureSource);\n }\n const texture = this.renderer.createCtxTexture(textureSource);\n this.ctxTextureCache.set(textureSource, texture);\n return texture;\n }\n}\n//# sourceMappingURL=CoreTextureManager.js.map","export class TextureMemoryManager {\n memUsed = 0;\n textures = new Map();\n threshold;\n /**\n * @param byteThreshold Number of texture bytes to trigger garbage collection\n */\n constructor(byteThreshold) {\n this.threshold = byteThreshold;\n // If the threshold is 0, we disable the memory manager by replacing the\n // setTextureMemUse method with a no-op function.\n if (byteThreshold === 0) {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n this.setTextureMemUse = () => { };\n }\n }\n setTextureMemUse(ctxTexture, byteSize) {\n if (this.textures.has(ctxTexture)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.memUsed -= this.textures.get(ctxTexture);\n }\n if (byteSize === 0) {\n this.textures.delete(ctxTexture);\n return;\n }\n else {\n this.memUsed += byteSize;\n this.textures.set(ctxTexture, byteSize);\n }\n if (this.memUsed > this.threshold) {\n this.gc();\n }\n }\n gc() {\n this.textures.forEach((byteSize, ctxTexture) => {\n if (!ctxTexture.renderable) {\n ctxTexture.free();\n }\n });\n }\n}\n//# sourceMappingURL=TextureMemoryManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { startLoop, getTimeStamp } from './platform.js';\nimport { WebGlCoreRenderer } from './renderers/webgl/WebGlCoreRenderer.js';\nimport { assertTruthy } from '../utils.js';\nimport { AnimationManager } from './animations/AnimationManager.js';\nimport { CoreNode } from './CoreNode.js';\nimport { CoreTextureManager } from './CoreTextureManager.js';\nimport { TrFontManager } from './text-rendering/TrFontManager.js';\nimport { CoreShaderManager } from './CoreShaderManager.js';\nimport { SdfTextRenderer } from './text-rendering/renderers/SdfTextRenderer/SdfTextRenderer.js';\nimport { CanvasTextRenderer } from './text-rendering/renderers/CanvasTextRenderer.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { ContextSpy } from './lib/ContextSpy.js';\nimport { TextureMemoryManager } from './TextureMemoryManager.js';\nconst bufferMemory = 2e6;\nconst autoStart = true;\nexport class Stage extends EventEmitter {\n options;\n /// Module Instances\n animationManager;\n txManager;\n txMemManager;\n fontManager;\n textRenderers;\n shManager;\n renderer;\n root;\n boundsMargin;\n /// State\n deltaTime = 0;\n lastFrameTime = 0;\n currentFrameTime = 0;\n fpsNumFrames = 0;\n fpsElapsedTime = 0;\n renderRequested = false;\n /// Debug data\n contextSpy = null;\n /**\n * Stage constructor\n */\n constructor(options) {\n super();\n this.options = options;\n const { canvas, clearColor, rootId, debug, appWidth, appHeight, boundsMargin, enableContextSpy, numImageWorkers, txMemByteThreshold, } = options;\n this.txManager = new CoreTextureManager(numImageWorkers);\n this.txMemManager = new TextureMemoryManager(txMemByteThreshold);\n this.shManager = new CoreShaderManager();\n this.animationManager = new AnimationManager();\n this.contextSpy = enableContextSpy ? new ContextSpy() : null;\n let bm = [0, 0, 0, 0];\n if (boundsMargin) {\n bm = Array.isArray(boundsMargin)\n ? boundsMargin\n : [boundsMargin, boundsMargin, boundsMargin, boundsMargin];\n }\n this.boundsMargin = bm;\n if (debug?.monitorTextureCache) {\n setInterval(() => {\n assertTruthy(this.txManager);\n const debugInfo = this.txManager.getDebugInfo();\n console.log('Texture ID Cache Size: ', debugInfo.idCacheSize);\n console.log('Texture Key Cache Size: ', debugInfo.keyCacheSize);\n }, 1000);\n }\n this.renderer = new WebGlCoreRenderer({\n stage: this,\n canvas,\n pixelRatio: options.devicePhysicalPixelRatio * options.deviceLogicalPixelRatio,\n clearColor: clearColor ?? 0xff000000,\n bufferMemory,\n txManager: this.txManager,\n txMemManager: this.txMemManager,\n shManager: this.shManager,\n contextSpy: this.contextSpy,\n });\n // Must do this after renderer is created\n this.txManager.renderer = this.renderer;\n this.textRenderers = {\n canvas: new CanvasTextRenderer(this),\n sdf: new SdfTextRenderer(this),\n };\n this.fontManager = new TrFontManager(this.textRenderers);\n // create root node\n const rootNode = new CoreNode(this, {\n id: rootId,\n x: 0,\n y: 0,\n width: appWidth,\n height: appHeight,\n alpha: 1,\n clipping: false,\n color: 0x00000000,\n colorTop: 0x00000000,\n colorBottom: 0x00000000,\n colorLeft: 0x00000000,\n colorRight: 0x00000000,\n colorTl: 0x00000000,\n colorTr: 0x00000000,\n colorBl: 0x00000000,\n colorBr: 0x00000000,\n zIndex: 0,\n zIndexLocked: 0,\n scaleX: 1,\n scaleY: 1,\n mountX: 0,\n mountY: 0,\n mount: 0,\n pivot: 0.5,\n pivotX: 0.5,\n pivotY: 0.5,\n rotation: 0,\n parent: null,\n texture: null,\n textureOptions: null,\n shader: null,\n shaderProps: null,\n });\n this.root = rootNode;\n // execute platform start loop\n if (autoStart) {\n startLoop(this);\n }\n }\n /**\n * Update animations\n */\n updateAnimations() {\n const { animationManager } = this;\n if (!this.root) {\n return;\n }\n this.lastFrameTime = this.currentFrameTime;\n this.currentFrameTime = getTimeStamp();\n this.deltaTime = !this.lastFrameTime\n ? 100 / 6\n : this.currentFrameTime - this.lastFrameTime;\n this.emit('frameTick', {\n time: this.currentFrameTime,\n delta: this.deltaTime,\n });\n // step animation\n animationManager.update(this.deltaTime);\n }\n /**\n * Check if the scene has updates\n */\n hasSceneUpdates() {\n return !!this.root.updateType || this.renderRequested;\n }\n /**\n * Start a new frame draw\n */\n drawFrame() {\n const { renderer, renderRequested } = this;\n // Update tree if needed\n if (this.root.updateType !== 0) {\n this.root.update(this.deltaTime, this.root.clippingRect);\n }\n // test if we need to update the scene\n renderer?.reset();\n this.addQuads(this.root);\n renderer?.render();\n this.calculateFps();\n // Reset renderRequested flag if it was set\n if (renderRequested) {\n this.renderRequested = false;\n }\n }\n calculateFps() {\n // If there's an FPS update interval, emit the FPS update event\n // when the specified interval has elapsed.\n const { fpsUpdateInterval } = this.options;\n if (fpsUpdateInterval) {\n this.fpsNumFrames++;\n this.fpsElapsedTime += this.deltaTime;\n if (this.fpsElapsedTime >= fpsUpdateInterval) {\n const fps = Math.round((this.fpsNumFrames * 1000) / this.fpsElapsedTime);\n this.fpsNumFrames = 0;\n this.fpsElapsedTime = 0;\n this.emit('fpsUpdate', {\n fps,\n contextSpyData: this.contextSpy?.getData() ?? null,\n });\n this.contextSpy?.reset();\n }\n }\n }\n addQuads(node) {\n assertTruthy(this.renderer && node.globalTransform);\n if (node.isRenderable) {\n node.renderQuads(this.renderer);\n }\n for (let i = 0; i < node.children.length; i++) {\n const child = node.children[i];\n if (!child) {\n continue;\n }\n if (child?.worldAlpha === 0) {\n continue;\n }\n this.addQuads(child);\n }\n }\n /**\n * Request a render pass without forcing an update\n */\n requestRender() {\n this.renderRequested = true;\n }\n /**\n * Given a font name, and possible renderer override, return the best compatible text renderer.\n *\n * @remarks\n * Will always return at least a canvas renderer if no other suitable renderer can be resolved.\n *\n * @param fontFamily\n * @param textRendererOverride\n * @returns\n */\n resolveTextRenderer(trProps, textRendererOverride = null) {\n let rendererId = textRendererOverride;\n let overrideFallback = false;\n // Check if the override is valid (if one is provided)\n if (rendererId) {\n const possibleRenderer = this.textRenderers[rendererId];\n if (!possibleRenderer) {\n console.warn(`Text renderer override '${rendererId}' not found.`);\n rendererId = null;\n overrideFallback = true;\n }\n else if (!possibleRenderer.canRenderFont(trProps)) {\n console.warn(`Cannot use override text renderer '${rendererId}' for font`, trProps);\n rendererId = null;\n overrideFallback = true;\n }\n }\n if (!rendererId) {\n // Iterate through the text renderers and find the first one that can render the font\n for (const [trId, tr] of Object.entries(this.textRenderers)) {\n if (trId === 'canvas') {\n // Canvas is always a fallback\n continue;\n }\n if (tr.canRenderFont(trProps)) {\n rendererId = trId;\n break;\n }\n }\n if (!rendererId) {\n // If no renderer can be found, use the canvas renderer\n rendererId = 'canvas';\n }\n }\n if (overrideFallback) {\n console.warn(`Falling back to text renderer ${String(rendererId)}`);\n }\n // By now we are guaranteed to have a valid rendererId (at least Canvas);\n const resolvedTextRenderer = this.textRenderers[rendererId];\n assertTruthy(resolvedTextRenderer, 'resolvedTextRenderer undefined');\n // Need to explicitly cast to TextRenderer because TS doesn't like\n // the covariant state argument in the setter method map\n return resolvedTextRenderer;\n }\n}\n//# sourceMappingURL=Stage.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreNode, UpdateType } from './CoreNode.js';\nimport { assertTruthy } from '../utils.js';\nexport class CoreTextNode extends CoreNode {\n textRenderer;\n trState;\n _textRendererOverride = null;\n constructor(stage, props) {\n super(stage, props);\n this._textRendererOverride = props.textRendererOverride;\n const { resolvedTextRenderer, textRendererState } = this.resolveTextRendererAndState({\n x: this.absX,\n y: this.absY,\n width: props.width,\n height: props.height,\n textAlign: props.textAlign,\n color: props.color,\n zIndex: props.zIndex,\n contain: props.contain,\n scrollable: props.scrollable,\n scrollY: props.scrollY,\n offsetY: props.offsetY,\n letterSpacing: props.letterSpacing,\n debug: props.debug,\n fontFamily: props.fontFamily,\n fontSize: props.fontSize,\n fontStretch: props.fontStretch,\n fontStyle: props.fontStyle,\n fontWeight: props.fontWeight,\n text: props.text,\n lineHeight: props.lineHeight,\n maxLines: props.maxLines,\n textBaseline: props.textBaseline,\n verticalAlign: props.verticalAlign,\n overflowSuffix: props.overflowSuffix,\n });\n this.textRenderer = resolvedTextRenderer;\n this.trState = textRendererState;\n }\n onTextLoaded = () => {\n const { contain } = this;\n const setWidth = this.trState.props.width;\n const setHeight = this.trState.props.height;\n const calcWidth = this.trState.textW || 0;\n const calcHeight = this.trState.textH || 0;\n if (contain === 'both') {\n this.props.width = setWidth;\n this.props.height = setHeight;\n }\n else if (contain === 'width') {\n this.props.width = setWidth;\n this.props.height = calcHeight;\n }\n else if (contain === 'none') {\n this.props.width = calcWidth;\n this.props.height = calcHeight;\n }\n this.updateLocalTransform();\n // Incase the RAF loop has been stopped already before text was loaded,\n // we request a render so it can be drawn.\n this.stage.requestRender();\n this.emit('loaded', {\n type: 'text',\n dimensions: {\n width: this.trState.textW || 0,\n height: this.trState.textH || 0,\n },\n });\n };\n onTextFailed = (target, error) => {\n this.emit('failed', {\n type: 'text',\n error,\n });\n };\n get width() {\n return this.props.width;\n }\n set width(value) {\n this.props.width = value;\n this.textRenderer.set.width(this.trState, value);\n // If not containing, we must update the local transform to account for the\n // new width\n if (this.contain === 'none') {\n this.setUpdateType(UpdateType.Local);\n }\n }\n get height() {\n return this.props.height;\n }\n set height(value) {\n this.props.height = value;\n this.textRenderer.set.height(this.trState, value);\n // If not containing in the horizontal direction, we must update the local\n // transform to account for the new height\n if (this.contain !== 'both') {\n this.setUpdateType(UpdateType.Local);\n }\n }\n get color() {\n return this.trState.props.color;\n }\n set color(value) {\n this.textRenderer.set.color(this.trState, value);\n }\n get text() {\n return this.trState.props.text;\n }\n set text(value) {\n this.textRenderer.set.text(this.trState, value);\n }\n get textRendererOverride() {\n return this._textRendererOverride;\n }\n set textRendererOverride(value) {\n this._textRendererOverride = value;\n this.textRenderer.destroyState(this.trState);\n const { resolvedTextRenderer, textRendererState } = this.resolveTextRendererAndState(this.trState.props);\n this.textRenderer = resolvedTextRenderer;\n this.trState = textRendererState;\n }\n get fontSize() {\n return this.trState.props.fontSize;\n }\n set fontSize(value) {\n this.textRenderer.set.fontSize(this.trState, value);\n }\n get fontFamily() {\n return this.trState.props.fontFamily;\n }\n set fontFamily(value) {\n this.textRenderer.set.fontFamily(this.trState, value);\n }\n get fontStretch() {\n return this.trState.props.fontStretch;\n }\n set fontStretch(value) {\n this.textRenderer.set.fontStretch(this.trState, value);\n }\n get fontStyle() {\n return this.trState.props.fontStyle;\n }\n set fontStyle(value) {\n this.textRenderer.set.fontStyle(this.trState, value);\n }\n get fontWeight() {\n return this.trState.props.fontWeight;\n }\n set fontWeight(value) {\n this.textRenderer.set.fontWeight(this.trState, value);\n }\n get textAlign() {\n return this.trState.props.textAlign;\n }\n set textAlign(value) {\n this.textRenderer.set.textAlign(this.trState, value);\n }\n get contain() {\n return this.trState.props.contain;\n }\n set contain(value) {\n this.textRenderer.set.contain(this.trState, value);\n }\n get scrollable() {\n return this.trState.props.scrollable;\n }\n set scrollable(value) {\n this.textRenderer.set.scrollable(this.trState, value);\n }\n get scrollY() {\n return this.trState.props.scrollY;\n }\n set scrollY(value) {\n this.textRenderer.set.scrollY(this.trState, value);\n }\n get offsetY() {\n return this.trState.props.offsetY;\n }\n set offsetY(value) {\n this.textRenderer.set.offsetY(this.trState, value);\n }\n get letterSpacing() {\n return this.trState.props.letterSpacing;\n }\n set letterSpacing(value) {\n this.textRenderer.set.letterSpacing(this.trState, value);\n }\n get lineHeight() {\n return this.trState.props.lineHeight;\n }\n set lineHeight(value) {\n if (this.textRenderer.set.lineHeight) {\n this.textRenderer.set.lineHeight(this.trState, value);\n }\n }\n get maxLines() {\n return this.trState.props.maxLines;\n }\n set maxLines(value) {\n if (this.textRenderer.set.maxLines) {\n this.textRenderer.set.maxLines(this.trState, value);\n }\n }\n get textBaseline() {\n return this.trState.props.textBaseline;\n }\n set textBaseline(value) {\n if (this.textRenderer.set.textBaseline) {\n this.textRenderer.set.textBaseline(this.trState, value);\n }\n }\n get verticalAlign() {\n return this.trState.props.verticalAlign;\n }\n set verticalAlign(value) {\n if (this.textRenderer.set.verticalAlign) {\n this.textRenderer.set.verticalAlign(this.trState, value);\n }\n }\n get overflowSuffix() {\n return this.trState.props.overflowSuffix;\n }\n set overflowSuffix(value) {\n if (this.textRenderer.set.overflowSuffix) {\n this.textRenderer.set.overflowSuffix(this.trState, value);\n }\n }\n get debug() {\n return this.trState.props.debug;\n }\n set debug(value) {\n this.textRenderer.set.debug(this.trState, value);\n }\n update(delta, parentClippingRect) {\n super.update(delta, parentClippingRect);\n assertTruthy(this.globalTransform);\n // globalTransform is updated in super.update(delta)\n this.textRenderer.set.x(this.trState, this.globalTransform.tx);\n this.textRenderer.set.y(this.trState, this.globalTransform.ty);\n }\n checkRenderProps() {\n if (this.trState.props.text !== '') {\n return true;\n }\n return super.checkRenderProps();\n }\n onChangeIsRenderable(isRenderable) {\n super.onChangeIsRenderable(isRenderable);\n this.textRenderer.setIsRenderable(this.trState, isRenderable);\n }\n renderQuads(renderer) {\n assertTruthy(this.globalTransform);\n this.textRenderer.renderQuads(this.trState, this.globalTransform, this.clippingRect, this.worldAlpha);\n }\n /**\n * Destroy the node and cleanup all resources\n */\n destroy() {\n super.destroy();\n this.textRenderer.destroyState(this.trState);\n }\n /**\n * Resolve a text renderer and a new state based on the current text renderer props provided\n * @param props\n * @returns\n */\n resolveTextRendererAndState(props) {\n const resolvedTextRenderer = this.stage.resolveTextRenderer(props, this._textRendererOverride);\n const textRendererState = resolvedTextRenderer.createState(props);\n textRendererState.emitter.on('loaded', this.onTextLoaded);\n textRendererState.emitter.on('failed', this.onTextFailed);\n resolvedTextRenderer.scheduleUpdateState(textRendererState);\n return {\n resolvedTextRenderer,\n textRendererState,\n };\n }\n}\n//# sourceMappingURL=CoreTextNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { MainOnlyNode, getNewId } from './MainOnlyNode.js';\nimport { CoreTextNode } from '../../core/CoreTextNode.js';\nexport class MainOnlyTextNode extends MainOnlyNode {\n constructor(props, rendererMain, stage) {\n super(props, rendererMain, stage, new CoreTextNode(stage, {\n id: getNewId(),\n x: props.x,\n y: props.y,\n width: props.width,\n height: props.height,\n alpha: props.alpha,\n clipping: props.clipping,\n color: props.color,\n colorTop: props.colorTop,\n colorBottom: props.colorBottom,\n colorLeft: props.colorLeft,\n colorRight: props.colorRight,\n colorTl: props.colorTl,\n colorTr: props.colorTr,\n colorBl: props.colorBl,\n colorBr: props.colorBr,\n zIndex: props.zIndex,\n zIndexLocked: props.zIndexLocked,\n scaleX: props.scaleX,\n scaleY: props.scaleY,\n mountX: props.mountX,\n mountY: props.mountY,\n mount: props.mount,\n pivot: props.pivot,\n pivotX: props.pivotX,\n pivotY: props.pivotY,\n rotation: props.rotation,\n // Text properties\n text: props.text,\n fontSize: props.fontSize,\n fontFamily: props.fontFamily,\n fontWeight: props.fontWeight,\n fontStretch: props.fontStretch,\n fontStyle: props.fontStyle,\n contain: props.contain,\n scrollable: props.scrollable,\n letterSpacing: props.letterSpacing,\n textAlign: props.textAlign,\n scrollY: props.scrollY,\n offsetY: props.offsetY,\n textRendererOverride: props.textRendererOverride,\n lineHeight: props.lineHeight,\n maxLines: props.maxLines,\n textBaseline: props.textBaseline,\n verticalAlign: props.verticalAlign,\n overflowSuffix: props.overflowSuffix,\n debug: props.debug,\n // These properties will get set appropriately in the base MainOnlyNode class\n parent: null,\n texture: null,\n textureOptions: null,\n shader: null,\n shaderProps: null,\n }));\n }\n get text() {\n return this.coreNode.text;\n }\n set text(value) {\n this.coreNode.text = value;\n }\n get textRendererOverride() {\n return this.coreNode.textRendererOverride;\n }\n set textRendererOverride(value) {\n this.coreNode.textRendererOverride = value;\n }\n get fontSize() {\n return this.coreNode.fontSize;\n }\n set fontSize(value) {\n this.coreNode.fontSize = value;\n }\n get fontFamily() {\n return this.coreNode.fontFamily;\n }\n set fontFamily(value) {\n this.coreNode.fontFamily = value;\n }\n get fontWeight() {\n return this.coreNode.fontWeight;\n }\n set fontWeight(value) {\n this.coreNode.fontWeight = value;\n }\n get fontStretch() {\n return this.coreNode.fontStretch;\n }\n set fontStretch(value) {\n this.coreNode.fontStretch = value;\n }\n get fontStyle() {\n return this.coreNode.fontStyle;\n }\n set fontStyle(value) {\n this.coreNode.fontStyle = value;\n }\n get textAlign() {\n return this.coreNode.textAlign;\n }\n set textAlign(value) {\n this.coreNode.textAlign = value;\n }\n get contain() {\n return this.coreNode.contain;\n }\n set contain(value) {\n this.coreNode.contain = value;\n }\n get scrollable() {\n return this.coreNode.scrollable;\n }\n set scrollable(value) {\n this.coreNode.scrollable = value;\n }\n get scrollY() {\n return this.coreNode.scrollY;\n }\n set scrollY(value) {\n this.coreNode.scrollY = value;\n }\n get offsetY() {\n return this.coreNode.offsetY;\n }\n set offsetY(value) {\n this.coreNode.offsetY = value;\n }\n get letterSpacing() {\n return this.coreNode.letterSpacing;\n }\n set letterSpacing(value) {\n this.coreNode.letterSpacing = value;\n }\n get lineHeight() {\n return this.coreNode.lineHeight;\n }\n set lineHeight(value) {\n if (value) {\n this.coreNode.lineHeight = value;\n }\n }\n get maxLines() {\n return this.coreNode.maxLines;\n }\n set maxLines(value) {\n if (value) {\n this.coreNode.maxLines = value;\n }\n }\n get textBaseline() {\n return this.coreNode.textBaseline;\n }\n set textBaseline(value) {\n if (value) {\n this.coreNode.textBaseline = value;\n }\n }\n get verticalAlign() {\n return this.coreNode.verticalAlign;\n }\n set verticalAlign(value) {\n if (value) {\n this.coreNode.verticalAlign = value;\n }\n }\n get overflowSuffix() {\n return this.coreNode.overflowSuffix;\n }\n set overflowSuffix(value) {\n if (value) {\n this.coreNode.overflowSuffix = value;\n }\n }\n get debug() {\n return this.coreNode.debug;\n }\n set debug(value) {\n this.coreNode.debug = value;\n }\n}\n//# sourceMappingURL=MainOnlyTextNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { MainOnlyNode, getNewId } from './MainOnlyNode.js';\nimport { Stage, } from '../../core/Stage.js';\nimport { MainOnlyTextNode } from './MainOnlyTextNode.js';\nimport { loadCoreExtension } from '../utils.js';\nexport class MainCoreDriver {\n root = null;\n stage = null;\n rendererMain = null;\n async init(rendererMain, rendererSettings, canvas) {\n this.stage = new Stage({\n rootId: getNewId(),\n appWidth: rendererSettings.appWidth,\n appHeight: rendererSettings.appHeight,\n txMemByteThreshold: rendererSettings.txMemByteThreshold,\n boundsMargin: rendererSettings.boundsMargin,\n deviceLogicalPixelRatio: rendererSettings.deviceLogicalPixelRatio,\n devicePhysicalPixelRatio: rendererSettings.devicePhysicalPixelRatio,\n clearColor: rendererSettings.clearColor,\n canvas,\n fpsUpdateInterval: rendererSettings.fpsUpdateInterval,\n enableContextSpy: rendererSettings.enableContextSpy,\n numImageWorkers: rendererSettings.numImageWorkers,\n debug: {\n monitorTextureCache: false,\n },\n });\n this.rendererMain = rendererMain;\n assertTruthy(this.stage.root);\n const node = new MainOnlyNode(rendererMain.resolveNodeDefaults({}), this.rendererMain, this.stage, this.stage.root);\n this.root = node;\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n // Load the Core Extension Module if one was specified.\n if (rendererSettings.coreExtensionModule) {\n await loadCoreExtension(rendererSettings.coreExtensionModule, this.stage);\n }\n // Forward fpsUpdate events from the stage to RendererMain\n this.stage.on('fpsUpdate', ((stage, fpsData) => {\n this.onFpsUpdate(fpsData);\n }));\n this.stage.on('frameTick', ((stage, frameTickData) => {\n this.onFrameTick(frameTickData);\n }));\n this.stage.on('idle', () => {\n this.onIdle();\n });\n }\n createNode(props) {\n assertTruthy(this.rendererMain);\n assertTruthy(this.stage);\n const node = new MainOnlyNode(props, this.rendererMain, this.stage);\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n return node;\n }\n createTextNode(props) {\n assertTruthy(this.rendererMain);\n assertTruthy(this.stage);\n const node = new MainOnlyTextNode(props, this.rendererMain, this.stage);\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n return node;\n }\n // TODO: Remove?\n destroyNode(node) {\n node.destroy();\n }\n releaseTexture(id) {\n const { stage } = this;\n assertTruthy(stage);\n stage.txManager.removeTextureIdFromCache(id);\n }\n getRootNode() {\n assertTruthy(this.root);\n return this.root;\n }\n //#region Event Methods\n // The implementations for these event methods are provided by RendererMain\n onCreateNode(node) {\n throw new Error('Method not implemented.');\n }\n onBeforeDestroyNode(node) {\n throw new Error('Method not implemented.');\n }\n onFpsUpdate(fpsData) {\n throw new Error('Method not implemented.');\n }\n onFrameTick(frameTickData) {\n throw new Error('Method not implemented.');\n }\n onIdle() {\n throw new Error('Method not implemented.');\n }\n}\n//# sourceMappingURL=MainCoreDriver.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n MainCoreDriver,\n RendererMain,\n type RendererMainSettings,\n} from '@lightningjs/renderer';\n\nexport let renderer: RendererMain;\nexport let createShader: RendererMain['createShader'];\n\nexport interface SolidRendererOptions extends RendererMainSettings {\n threadXCoreWorkerUrl?: string;\n rootId: string | HTMLElement;\n}\n\nexport function startLightningRenderer(\n options: Partial = {},\n rootId: string | HTMLElement = 'app',\n): RendererMain {\n const driver = new MainCoreDriver();\n renderer = new RendererMain(options, rootId, driver);\n createShader = renderer.createShader.bind(renderer);\n return renderer;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { ElementNode, SolidNode } from './index.js';\n\n/**\n * Children class\n */\nexport default class Children extends Array {\n _parent: ElementNode;\n\n constructor(node: ElementNode) {\n super();\n this._parent = node;\n }\n\n get selected(): ElementNode | undefined {\n // For selected Elements should always be an ElementNode\n return this[this._parent.selected || 0] as ElementNode | undefined;\n }\n\n get firstChild() {\n return this[0];\n }\n\n insert(node: SolidNode, beforeNode: SolidNode) {\n if (beforeNode) {\n const index = this.indexOf(beforeNode);\n this.splice(index, 0, node);\n } else {\n this.push(node);\n }\n\n node.parent = this._parent;\n this._parent._isDirty = true;\n }\n\n remove(node: SolidNode) {\n const nodeIndexToRemove = this.indexOf(node);\n if (nodeIndexToRemove >= 0) {\n this.splice(nodeIndexToRemove, 1);\n }\n }\n}\n","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n AnimationSettings,\n RendererMainSettings,\n} from '@lightningjs/renderer';\nimport type { IntrinsicTextNodeStyleProps } from './intrinsicTypes.js';\n\ninterface Config {\n debug: boolean;\n animationSettings: Partial;\n animationsEnabled: boolean;\n fontSettings: Partial;\n rendererOptions?: Partial;\n}\n\nfunction isDevEnv(): boolean {\n return import.meta.env && import.meta.env.DEV;\n}\nexport const isDev = isDevEnv() || false;\n\nexport const config: Config = {\n debug: false,\n animationsEnabled: true,\n animationSettings: {\n duration: 250,\n easing: 'ease-in-out',\n },\n fontSettings: {\n fontFamily: 'Ubuntu',\n fontSize: 100,\n },\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { config, isDev } from '../config.js';\nimport type { SolidNode, SolidStyles } from './node/index.js';\n\nfunction hasDebug(node: any) {\n return isObject(node) && node.debug;\n}\n\nexport function log(msg: string, node: SolidNode, ...args: any[]) {\n if (isDev) {\n if (config.debug || hasDebug(node) || hasDebug(args[0])) {\n console.log(msg, node, ...args);\n }\n }\n}\n\nexport function isFunc(item: unknown): item is (...args: unknown[]) => unknown {\n return typeof item === 'function';\n}\n\nexport function isObject(\n item: unknown,\n): item is Record {\n return typeof item === 'object';\n}\n\nexport function isArray(item: unknown): item is any[] {\n return Array.isArray(item);\n}\n\nexport function isString(item: unknown): item is string {\n return typeof item === 'string';\n}\n\nexport function isNumber(item: unknown): item is number {\n return typeof item === 'number';\n}\n\nexport function isInteger(item: unknown): item is number {\n return Number.isInteger(item);\n}\n\nexport function keyExists(\n obj: Record,\n keys: (string | number | symbol)[],\n) {\n for (const key of keys) {\n if (key in obj) {\n return true;\n }\n }\n return false;\n}\n\nexport function flattenStyles(\n obj: SolidStyles | undefined | (SolidStyles | undefined)[],\n result: Record = {},\n): SolidStyles {\n if (isArray(obj)) {\n obj.forEach((item) => {\n flattenStyles(item, result);\n });\n } else if (obj) {\n // handle the case where the object is not an array\n for (const key in obj) {\n // be careful of 0 values\n if (result[key as keyof SolidStyles] === undefined) {\n result[key as keyof SolidStyles] = obj[key as keyof SolidStyles];\n }\n }\n }\n\n return result;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { isArray, isString } from '../utils.js';\n\nexport type NodeStates =\n | string[]\n | string\n | Record;\n\nexport default class States extends Array {\n private onChange: () => void;\n\n constructor(callback: () => void, initialState: NodeStates = {}) {\n if (isArray(initialState)) {\n super(...initialState);\n } else if (isString(initialState)) {\n super(initialState);\n } else {\n super(\n ...Object.entries(initialState)\n .filter(([_key, value]) => value)\n .map(([key]) => key),\n );\n }\n\n this.onChange = callback;\n return this;\n }\n\n has(state: string) {\n return this.indexOf(state) >= 0;\n }\n\n is(state: string) {\n return this.indexOf(state) >= 0;\n }\n\n add(state: string) {\n this.push(state);\n this.onChange();\n }\n\n toggle(state: string) {\n if (this.has(state)) {\n this.remove(state);\n } else {\n this.add(state);\n }\n }\n\n remove(state: string) {\n const stateIndexToRemove = this.indexOf(state);\n if (stateIndexToRemove >= 0) {\n this.splice(stateIndexToRemove, 1);\n this.onChange();\n }\n }\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { assertTruthy } from '@lightningjs/renderer/utils';\nimport type { ElementNode, SolidNode } from './node/index.js';\n\nexport default function (node: ElementNode): boolean {\n const children = [];\n for (let i = 0; i < node.children.length; i++) {\n const c = node.children[i]!;\n // Filter empty text nodes which are place holders for and elements missing dimensions\n if (c.name === 'TextNode') {\n continue;\n }\n // text node hasnt loaded yet - skip layout\n if (c.name === 'text' && !(c.width || c.height)) {\n return false;\n }\n\n children.push(c);\n }\n\n const numChildren = children.length;\n const direction = node.flexDirection || 'row';\n const isRow = direction === 'row';\n const dimension = isRow ? 'width' : 'height';\n const crossDimension = isRow ? 'height' : 'width';\n const marginOne = isRow ? 'marginLeft' : 'marginTop';\n const marginTwo = isRow ? 'marginRight' : 'marginBottom';\n const prop = isRow ? 'x' : 'y';\n const crossProp = isRow ? 'y' : 'x';\n const containerSize = node[dimension] || 0;\n const containerCrossSize = node[crossDimension] || 0;\n const gap = node.gap || 0;\n const justify = node.justifyContent || 'flexStart';\n const align = node.alignItems;\n let itemSize = 0;\n if (['center', 'spaceBetween', 'spaceEvenly'].includes(justify)) {\n itemSize = children.reduce((prev, c) => prev + (c[dimension] || 0), 0);\n }\n\n // Only align children if container has a cross size\n const crossAlignChild =\n containerCrossSize && align\n ? (c: SolidNode) => {\n if (align === 'flexStart') {\n c[crossProp] = 0;\n } else if (align === 'center') {\n c[crossProp] = (containerCrossSize - (c[crossDimension] || 0)) / 2;\n } else if (align === 'flexEnd') {\n c[crossProp] = containerCrossSize - (c[crossDimension] || 0);\n }\n }\n : (c: SolidNode) => c;\n\n if (justify === 'flexStart') {\n let start = 0;\n children.forEach((c) => {\n c[prop] = start + (c[marginOne] || 0);\n start +=\n (c[dimension] || 0) + gap + (c[marginOne] || 0) + (c[marginTwo] || 0);\n crossAlignChild(c);\n });\n // Update container size\n if (node._autosized) {\n const calculatedSize = start - gap;\n if (calculatedSize !== node[dimension]) {\n node[dimension] = calculatedSize;\n return true;\n }\n }\n } else if (justify === 'flexEnd') {\n let start = containerSize;\n for (let i = numChildren - 1; i >= 0; i--) {\n const c = children[i];\n assertTruthy(c);\n c[prop] = start - (c[dimension] || 0) - (c[marginTwo] || 0);\n start -=\n (c[dimension] || 0) + gap + (c[marginOne] || 0) + (c[marginTwo] || 0);\n crossAlignChild(c);\n }\n } else if (justify === 'center') {\n let start = (containerSize - (itemSize + gap * (numChildren - 1))) / 2;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + gap;\n crossAlignChild(c);\n });\n } else if (justify === 'spaceBetween') {\n const toPad = (containerSize - itemSize) / (numChildren - 1);\n let start = 0;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + toPad;\n crossAlignChild(c);\n });\n } else if (justify === 'spaceEvenly') {\n const toPad = (containerSize - itemSize) / (numChildren + 1);\n let start = toPad;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + toPad;\n crossAlignChild(c);\n });\n }\n\n // Container was not updated\n return false;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { renderer, createShader } from '../lightningInit.js';\nimport {\n type BorderStyleObject,\n type IntrinsicCommonProps,\n type IntrinsicNodeProps,\n type IntrinsicTextProps,\n type NodeStyles,\n type TextStyles,\n} from '../../index.js';\nimport Children from './children.js';\nimport States, { type NodeStates } from './states.js';\nimport calculateFlex from '../flex.js';\nimport {\n log,\n isArray,\n isNumber,\n isFunc,\n keyExists,\n flattenStyles,\n} from '../utils.js';\nimport { config } from '../../config.js';\nimport { setActiveElement } from '../activeElement.js';\nimport type {\n RendererMain,\n INode,\n INodeAnimatableProps,\n INodeWritableProps,\n ShaderRef,\n Dimensions,\n AnimationSettings,\n NodeLoadedPayload,\n} from '@lightningjs/renderer';\nimport { assertTruthy } from '@lightningjs/renderer/utils';\n\nconst { animationSettings: defaultAnimationSettings } = config;\n\nfunction convertEffectsToShader(styleEffects: any) {\n const effects = [];\n\n for (const [type, props] of Object.entries>(\n styleEffects,\n )) {\n effects.push({ type, props });\n }\n return createShader('DynamicShader', { effects: effects as any });\n}\n\nfunction borderAccessor(\n direction: '' | 'Top' | 'Right' | 'Bottom' | 'Left' = '',\n) {\n return {\n set(this: ElementNode, value: number | { width: number; color: number }) {\n // Format: width || { width, color }\n if (isNumber(value)) {\n value = { width: value, color: 0x000000ff };\n }\n this.effects = {\n ...(this.effects || {}),\n ...{ [`border${direction}`]: value },\n };\n this[`_border${direction}`] = value;\n },\n get(this: ElementNode) {\n return this[`_border${direction}`];\n },\n };\n}\n\nconst LightningRendererNumberProps = [\n 'alpha',\n 'color',\n 'colorTop',\n 'colorRight',\n 'colorLeft',\n 'colorBottom',\n 'colorTl',\n 'colorTr',\n 'colorBl',\n 'colorBr',\n 'height',\n 'fontSize',\n 'lineHeight',\n 'mount',\n 'mountX',\n 'mountY',\n 'pivot',\n 'pivotX',\n 'pivotY',\n 'rotation',\n 'scale',\n 'width',\n 'worldX',\n 'worldY',\n 'x',\n 'y',\n 'zIndex',\n 'zIndexLocked',\n];\n\nconst LightningRendererNonAnimatingProps = [\n 'clipping',\n 'contain',\n 'fontFamily',\n 'fontStretch',\n 'fontStyle',\n 'fontWeight',\n 'letterSpacing',\n 'maxLines',\n 'offsetY',\n 'overflowSuffix',\n 'rtt',\n 'scrollable',\n 'scrollY',\n 'src',\n 'text',\n 'textAlign',\n 'textBaseline',\n 'textOverflow',\n 'texture',\n 'verticalAlign',\n 'wordWrap',\n];\n\nexport interface TextNode {\n id?: string;\n name: string;\n text: string;\n parent: ElementNode | undefined;\n zIndex?: number;\n states?: States;\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n marginLeft?: number;\n marginRight?: number;\n marginTop?: number;\n marginBottom?: number;\n _queueDelete?: boolean;\n}\n\nexport type SolidNode = ElementNode | TextNode;\nexport type SolidStyles = NodeStyles | TextStyles;\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\nexport interface ElementNode\n extends Partial>,\n IntrinsicCommonProps {\n [key: string]: unknown;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\nexport class ElementNode extends Object {\n id?: string;\n debug?: boolean;\n name: string;\n lng: INode | undefined;\n renderer?: RendererMain;\n selected?: number;\n rendered: boolean;\n autofocus: boolean;\n _queueDelete?: boolean;\n forwardFocus?:\n | number\n | ((this: ElementNode, elm: ElementNode) => boolean | void);\n\n private _undoStyles?: string[];\n private _renderProps?: IntrinsicNodeProps | IntrinsicTextProps;\n private _effects: any;\n private _parent: ElementNode | undefined;\n private _shader?: ShaderRef;\n private _style?: SolidStyles;\n private _states?: States;\n private _animationSettings?: Partial;\n private _width?: number;\n private _height?: number;\n private _color?: number;\n private _borderRadius?: number;\n private _border?: BorderStyleObject;\n private _borderLeft?: BorderStyleObject;\n private _borderRight?: BorderStyleObject;\n private _borderTop?: BorderStyleObject;\n private _borderBottom?: BorderStyleObject;\n public _autosized?: boolean; // Public but uses _ prefix\n public _isDirty?: boolean; // Public but uses _ prefix\n private _animationQueue: Array<{\n props: Partial;\n animationSettings?: Partial;\n }> = [];\n private _animationQueueSettings: Partial | undefined;\n private _animationRunning: boolean = false;\n children: Children;\n\n constructor(name: string) {\n super();\n this.name = name;\n this.rendered = false;\n this.autofocus = false;\n this._renderProps = { x: 0, y: 0 };\n this.children = new Children(this);\n\n for (const key of LightningRendererNumberProps) {\n Object.defineProperty(this, key, {\n get(): number {\n return (this.lng && this.lng[key]) || this[`_${key}`];\n },\n set(v: number) {\n this[`_${key}`] = v;\n this._sendToLightningAnimatable(key, v);\n },\n });\n }\n\n for (const key of LightningRendererNonAnimatingProps) {\n Object.defineProperty(this, key, {\n get() {\n return (this.lng && this.lng[key]) || this[`_${key}`];\n },\n set(v) {\n this[`_${key}`] = v;\n this._sendToLightning(key, v);\n },\n });\n }\n\n // Add Border Helpers\n Object.defineProperties(this, {\n borderRadius: {\n set(this: ElementNode, radius) {\n this._borderRadius = radius;\n this.effects = {\n ...(this.effects || {}),\n ...{ radius: { radius } },\n };\n },\n get(this: ElementNode) {\n return this._borderRadius;\n },\n },\n border: borderAccessor(),\n borderLeft: borderAccessor('Left'),\n borderRight: borderAccessor('Right'),\n borderTop: borderAccessor('Top'),\n borderBottom: borderAccessor('Bottom'),\n });\n\n Object.defineProperties(this, {\n linearGradient: {\n set(props = {}) {\n this._linearGradient = props;\n this.effects = {\n ...(this.effects || {}),\n ...{ linearGradient: props },\n };\n },\n get() {\n return this._linearGradient;\n },\n },\n });\n }\n\n get effects() {\n return this._effects;\n }\n\n set effects(v) {\n this._effects = v;\n if (this.rendered) {\n this.shader = convertEffectsToShader(v);\n }\n }\n\n get parent() {\n return this._parent;\n }\n\n set parent(p) {\n this._parent = p;\n if (this.rendered && this.lng) {\n this.lng.parent = p?.lng ?? null;\n }\n }\n\n get shader(): ShaderRef | undefined {\n return this._shader;\n }\n\n set shader(v: Parameters | ShaderRef | undefined) {\n if (isArray(v)) {\n this._shader = createShader(...v) as ShaderRef;\n } else {\n this._shader = v;\n }\n this._sendToLightning('shader', this._shader);\n }\n\n _sendToLightningAnimatable(name: string, value: number | string) {\n if (this.lng) {\n if (\n config.animationsEnabled &&\n this.transition &&\n (this.transition === true || this.transition[name])\n ) {\n const animationSettings =\n this.transition === true || this.transition[name] === true\n ? undefined\n : (this.transition[name] as undefined | AnimationSettings);\n\n return this.animate({ [name]: value }, animationSettings).start();\n }\n\n (this.lng[name as keyof INode] as number | string) = value;\n } else {\n this._renderProps![name] = value;\n }\n }\n\n _sendToLightning(name: string, value: unknown) {\n if (this.rendered && this.lng) {\n (this.lng[name as keyof INodeWritableProps] as unknown) = value;\n } else {\n this._renderProps![name] = value;\n }\n }\n\n animate(\n props: Partial,\n animationSettings?: Partial,\n ) {\n assertTruthy(this.lng, 'Node must be rendered before animating');\n return this.lng.animate(props, animationSettings || this.animationSettings);\n }\n\n chain(\n props: Partial,\n animationSettings?: Partial,\n ) {\n if (this._animationRunning) {\n this._animationQueue = [];\n this._animationRunning = false;\n }\n\n if (animationSettings) {\n this._animationQueueSettings = animationSettings;\n } else if (!this._animationQueueSettings) {\n this._animationQueueSettings =\n animationSettings || this.animationSettings;\n }\n animationSettings = animationSettings || this._animationQueueSettings;\n this._animationQueue.push({ props, animationSettings });\n return this;\n }\n\n async start() {\n let animation = this._animationQueue.shift();\n while (animation) {\n this._animationRunning = true;\n await this.animate(animation.props, animation.animationSettings)\n .start()\n .waitUntilStopped();\n animation = this._animationQueue.shift();\n }\n this._animationRunning = false;\n this._animationQueueSettings = undefined;\n }\n\n setFocus() {\n if (this.rendered) {\n // can be 0\n if (this.forwardFocus !== undefined) {\n if (isFunc(this.forwardFocus)) {\n if (this.forwardFocus.call(this, this) !== false) {\n return;\n }\n } else {\n const focusedIndex =\n typeof this.forwardFocus === 'number' ? this.forwardFocus : null;\n if (focusedIndex !== null && focusedIndex < this.children.length) {\n const child = this.children[focusedIndex];\n child instanceof ElementNode && child.setFocus();\n return;\n }\n }\n }\n // Delay setting focus so children can render (useful for Row + Column)\n queueMicrotask(() => setActiveElement(this));\n } else {\n this.autofocus = true;\n }\n }\n\n isTextNode() {\n return this.name === 'text';\n }\n\n _resizeOnTextLoad() {\n this.lng!.on('loaded', (_node: INode, loadedPayload: NodeLoadedPayload) => {\n if (loadedPayload.type === 'text') {\n const { dimensions } = loadedPayload;\n this.parent!.updateLayout(this, dimensions);\n }\n });\n }\n\n getText() {\n return this.children.map((c) => c.text).join('');\n }\n\n destroy() {\n if (this._queueDelete) {\n this.lng?.destroy();\n }\n }\n\n set style(values: SolidStyles | (SolidStyles | undefined)[]) {\n if (isArray(values)) {\n this._style = flattenStyles(values);\n } else {\n this._style = values;\n }\n // Keys set in JSX are more important\n for (const key in this._style) {\n // be careful of 0 values\n if (this[key as keyof SolidStyles] === undefined) {\n this[key as keyof SolidStyles] = this._style[key as keyof SolidStyles];\n }\n }\n }\n\n get style(): SolidStyles {\n return this._style!;\n }\n\n get hasChildren() {\n return this.children.length > 0;\n }\n\n getChildById(id: string) {\n return this.children.find((c) => c.id === id);\n }\n\n searchChildrenById(id: string): SolidNode | undefined {\n // traverse all the childrens children\n for (const child of this.children) {\n if (child.id === id) {\n return child;\n }\n if (child instanceof ElementNode) {\n const found = child.searchChildrenById(id);\n if (found) {\n return found;\n }\n }\n }\n }\n\n set states(states: NodeStates) {\n this._states = new States(this._stateChanged.bind(this), states);\n if (this.rendered) {\n this._stateChanged();\n }\n }\n\n get states(): States {\n this._states = this._states || new States(this._stateChanged.bind(this));\n return this._states;\n }\n\n get animationSettings(): Partial {\n return this._animationSettings || defaultAnimationSettings;\n }\n\n set animationSettings(animationSettings: Partial) {\n this._animationSettings = animationSettings;\n }\n\n updateLayout(child?: ElementNode, dimensions?: Dimensions) {\n if (this.hasChildren) {\n log('Layout: ', this);\n isFunc(this.onBeforeLayout) &&\n this.onBeforeLayout.call(this, child, dimensions);\n\n if (this.display === 'flex') {\n if (calculateFlex(this)) {\n this.parent?.updateLayout();\n }\n }\n\n isFunc(this.onLayout) && this.onLayout.call(this, child, dimensions);\n }\n }\n\n _stateChanged() {\n log('State Changed: ', this, this.states);\n\n if (this.forwardStates) {\n // apply states to children first\n const states = this.states.slice() as States;\n this.children.forEach((c) => (c.states = states));\n }\n\n const states = this.states;\n\n if (this._undoStyles || (this.style && keyExists(this.style, states))) {\n this._undoStyles = this._undoStyles || [];\n const stylesToUndo: { [key: string]: any } = {};\n\n this._undoStyles.forEach((styleKey) => {\n stylesToUndo[styleKey] = this.style[styleKey];\n });\n\n const newStyles = states.reduce((acc, state) => {\n const styles = this.style[state];\n if (styles) {\n acc = {\n ...acc,\n ...styles,\n };\n }\n return acc;\n }, {});\n\n this._undoStyles = Object.keys(newStyles);\n\n // Apply transition first\n if ((newStyles as any).transition !== undefined) {\n this.transition = (newStyles as any).transition;\n }\n\n // Apply the styles\n Object.assign(this, { ...stylesToUndo, ...newStyles });\n }\n }\n\n render() {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const node = this;\n const parent = this.parent;\n\n if (!parent) {\n console.warn('Parent not set - no node created for: ', this);\n return;\n }\n\n if (!parent.rendered) {\n console.warn('Parent not rendered yet: ', this);\n return;\n }\n\n if (this.rendered) {\n console.warn('Node already rendered: ', this);\n return;\n }\n\n // Parent is dirty whenever a node is inserted after initial render\n if (parent._isDirty) {\n parent.updateLayout();\n parent._isDirty = false;\n }\n\n node.updateLayout();\n\n if (this.states.length) {\n this._stateChanged();\n }\n\n let props = node._renderProps as IntrinsicNodeProps | IntrinsicTextProps;\n\n if (parent.lng) {\n props.parent = parent.lng;\n }\n\n if (node._effects) {\n this.shader = convertEffectsToShader(node._effects);\n }\n\n if (node.isTextNode()) {\n props = {\n ...config.fontSettings,\n ...props,\n text: node.getText(),\n };\n\n if (props.contain) {\n if (!props.width) {\n props.width =\n (parent.width || 0) - (props.x || 0) - (props.marginRight || 0);\n node._width = props.width;\n node._autosized = true;\n }\n\n if (props.contain === 'both' && !props.height && !props.maxLines) {\n props.height =\n (parent.height || 0) - (props.y || 0) - (props.marginBottom || 0);\n node._height = props.height;\n node._autosized = true;\n }\n }\n\n log('Rendering: ', this, props);\n node.lng = renderer.createTextNode(props);\n\n if (isFunc(node.onLoad)) {\n node.lng.on('loaded', node.onLoad);\n }\n\n if (!node.width || !node.height) {\n node._autosized = true;\n node._resizeOnTextLoad();\n }\n } else {\n // If its not an image or texture apply some defaults\n if (!props.texture) {\n // Set width and height to parent less offset\n if (isNaN(props.width as number)) {\n props.width = (parent.width || 0) - (props.x || 0);\n node._width = props.width;\n node._autosized = true;\n }\n\n if (isNaN(props.height as number)) {\n props.height = (parent.height || 0) - (props.y || 0);\n node._height = props.height;\n node._autosized = true;\n }\n\n if (!props.color && !props.src) {\n // Default color to transparent - If you later set a src, you'll need\n // to set color '#ffffffff'\n node._color = props.color = 0x00000000;\n }\n }\n\n log('Rendering: ', this, props);\n node.lng = renderer.createNode(props);\n\n if (node.onFail) {\n node.lng.on('failed', node.onFail);\n }\n\n if (node.onLoad) {\n node.lng.on('loaded', node.onLoad);\n }\n }\n\n node.rendered = true;\n isFunc(this.onCreate) && this.onCreate.call(this, node);\n\n // L3 Inspector adds div to the lng object\n //@ts-expect-error - div is not in the typings\n if (node.lng.div) {\n //@ts-expect-error - div is not in the typings\n node.lng.div.solid = node;\n }\n // clean up after first render;\n delete this._renderProps;\n\n if (node.name !== 'text') {\n node.children.forEach((c) => {\n if ((c as ElementNode).render) {\n (c as ElementNode).render();\n } else if (c.text !== '') {\n // Solid Show uses an empty text node as a placeholder\n console.warn('TextNode outside of : ', c);\n }\n });\n }\n\n node.autofocus && node.setFocus();\n }\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { type Component } from \"solid-js\";\nimport type { IntrinsicTextProps } from \"../intrinsicTypes.js\";\n\nexport const Text: Component = (props) => \n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { type Component } from \"solid-js\";\nimport { type IntrinsicNodeProps } from \"../intrinsicTypes.js\";\n\nexport const View: Component = (props) =>\n ;\n","import {\n createRoot,\n createRenderEffect,\n mergeProps,\n createMemo,\n createComponent,\n untrack\n} from \"solid-js\";\n\nfunction createRenderer$1({\n createElement,\n createTextNode,\n isTextNode,\n replaceText,\n insertNode,\n removeNode,\n setProperty,\n getParentNode,\n getFirstChild,\n getNextSibling\n}) {\n function insert(parent, accessor, marker, initial) {\n if (marker !== undefined && !initial) initial = [];\n if (typeof accessor !== \"function\") return insertExpression(parent, accessor, initial, marker);\n createRenderEffect(current => insertExpression(parent, accessor(), current, marker), initial);\n }\n function insertExpression(parent, value, current, marker, unwrapArray) {\n while (typeof current === \"function\") current = current();\n if (value === current) return current;\n const t = typeof value,\n multi = marker !== undefined;\n if (t === \"string\" || t === \"number\") {\n if (t === \"number\") value = value.toString();\n if (multi) {\n let node = current[0];\n if (node && isTextNode(node)) {\n replaceText(node, value);\n } else node = createTextNode(value);\n current = cleanChildren(parent, current, marker, node);\n } else {\n if (current !== \"\" && typeof current === \"string\") {\n replaceText(getFirstChild(parent), (current = value));\n } else {\n cleanChildren(parent, current, marker, createTextNode(value));\n current = value;\n }\n }\n } else if (value == null || t === \"boolean\") {\n current = cleanChildren(parent, current, marker);\n } else if (t === \"function\") {\n createRenderEffect(() => {\n let v = value();\n while (typeof v === \"function\") v = v();\n current = insertExpression(parent, v, current, marker);\n });\n return () => current;\n } else if (Array.isArray(value)) {\n const array = [];\n if (normalizeIncomingArray(array, value, unwrapArray)) {\n createRenderEffect(\n () => (current = insertExpression(parent, array, current, marker, true))\n );\n return () => current;\n }\n if (array.length === 0) {\n const replacement = cleanChildren(parent, current, marker);\n if (multi) return (current = replacement);\n } else {\n if (Array.isArray(current)) {\n if (current.length === 0) {\n appendNodes(parent, array, marker);\n } else reconcileArrays(parent, current, array);\n } else if (current == null || current === \"\") {\n appendNodes(parent, array);\n } else {\n reconcileArrays(parent, (multi && current) || [getFirstChild(parent)], array);\n }\n }\n current = array;\n } else {\n if (Array.isArray(current)) {\n if (multi) return (current = cleanChildren(parent, current, marker, value));\n cleanChildren(parent, current, null, value);\n } else if (current == null || current === \"\" || !getFirstChild(parent)) {\n insertNode(parent, value);\n } else replaceNode(parent, value, getFirstChild(parent));\n current = value;\n }\n return current;\n }\n function normalizeIncomingArray(normalized, array, unwrap) {\n let dynamic = false;\n for (let i = 0, len = array.length; i < len; i++) {\n let item = array[i],\n t;\n if (item == null || item === true || item === false);\n else if (Array.isArray(item)) {\n dynamic = normalizeIncomingArray(normalized, item) || dynamic;\n } else if ((t = typeof item) === \"string\" || t === \"number\") {\n normalized.push(createTextNode(item));\n } else if (t === \"function\") {\n if (unwrap) {\n while (typeof item === \"function\") item = item();\n dynamic =\n normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item]) || dynamic;\n } else {\n normalized.push(item);\n dynamic = true;\n }\n } else normalized.push(item);\n }\n return dynamic;\n }\n function reconcileArrays(parentNode, a, b) {\n let bLength = b.length,\n aEnd = a.length,\n bEnd = bLength,\n aStart = 0,\n bStart = 0,\n after = getNextSibling(a[aEnd - 1]),\n map = null;\n while (aStart < aEnd || bStart < bEnd) {\n if (a[aStart] === b[bStart]) {\n aStart++;\n bStart++;\n continue;\n }\n while (a[aEnd - 1] === b[bEnd - 1]) {\n aEnd--;\n bEnd--;\n }\n if (aEnd === aStart) {\n const node =\n bEnd < bLength ? (bStart ? getNextSibling(b[bStart - 1]) : b[bEnd - bStart]) : after;\n while (bStart < bEnd) insertNode(parentNode, b[bStart++], node);\n } else if (bEnd === bStart) {\n while (aStart < aEnd) {\n if (!map || !map.has(a[aStart])) removeNode(parentNode, a[aStart]);\n aStart++;\n }\n } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {\n const node = getNextSibling(a[--aEnd]);\n insertNode(parentNode, b[bStart++], getNextSibling(a[aStart++]));\n insertNode(parentNode, b[--bEnd], node);\n a[aEnd] = b[bEnd];\n } else {\n if (!map) {\n map = new Map();\n let i = bStart;\n while (i < bEnd) map.set(b[i], i++);\n }\n const index = map.get(a[aStart]);\n if (index != null) {\n if (bStart < index && index < bEnd) {\n let i = aStart,\n sequence = 1,\n t;\n while (++i < aEnd && i < bEnd) {\n if ((t = map.get(a[i])) == null || t !== index + sequence) break;\n sequence++;\n }\n if (sequence > index - bStart) {\n const node = a[aStart];\n while (bStart < index) insertNode(parentNode, b[bStart++], node);\n } else replaceNode(parentNode, b[bStart++], a[aStart++]);\n } else aStart++;\n } else removeNode(parentNode, a[aStart++]);\n }\n }\n }\n function cleanChildren(parent, current, marker, replacement) {\n if (marker === undefined) {\n let removed;\n while ((removed = getFirstChild(parent))) removeNode(parent, removed);\n replacement && insertNode(parent, replacement);\n return \"\";\n }\n const node = replacement || createTextNode(\"\");\n if (current.length) {\n let inserted = false;\n for (let i = current.length - 1; i >= 0; i--) {\n const el = current[i];\n if (node !== el) {\n const isParent = getParentNode(el) === parent;\n if (!inserted && !i)\n isParent ? replaceNode(parent, node, el) : insertNode(parent, node, marker);\n else isParent && removeNode(parent, el);\n } else inserted = true;\n }\n } else insertNode(parent, node, marker);\n return [node];\n }\n function appendNodes(parent, array, marker) {\n for (let i = 0, len = array.length; i < len; i++) insertNode(parent, array[i], marker);\n }\n function replaceNode(parent, newNode, oldNode) {\n insertNode(parent, newNode, oldNode);\n removeNode(parent, oldNode);\n }\n function spreadExpression(node, props, prevProps = {}, skipChildren) {\n props || (props = {});\n if (!skipChildren) {\n createRenderEffect(\n () => (prevProps.children = insertExpression(node, props.children, prevProps.children))\n );\n }\n createRenderEffect(() => props.ref && props.ref(node));\n createRenderEffect(() => {\n for (const prop in props) {\n if (prop === \"children\" || prop === \"ref\") continue;\n const value = props[prop];\n if (value === prevProps[prop]) continue;\n setProperty(node, prop, value, prevProps[prop]);\n prevProps[prop] = value;\n }\n });\n return prevProps;\n }\n return {\n render(code, element) {\n let disposer;\n createRoot(dispose => {\n disposer = dispose;\n insert(element, code());\n });\n return disposer;\n },\n insert,\n spread(node, accessor, skipChildren) {\n if (typeof accessor === \"function\") {\n createRenderEffect(current => spreadExpression(node, accessor(), current, skipChildren));\n } else spreadExpression(node, accessor, undefined, skipChildren);\n },\n createElement,\n createTextNode,\n insertNode,\n setProp(node, name, value, prev) {\n setProperty(node, name, value, prev);\n return value;\n },\n mergeProps,\n effect: createRenderEffect,\n memo: createMemo,\n createComponent,\n use(fn, element, arg) {\n return untrack(() => fn(element, arg));\n }\n };\n}\n\nfunction createRenderer(options) {\n const renderer = createRenderer$1(options);\n renderer.mergeProps = mergeProps;\n return renderer;\n}\n\nexport { createRenderer };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { assertTruthy } from '@lightningjs/renderer/utils';\nimport { log } from './utils.js';\nimport { ElementNode, type SolidNode, type TextNode } from './node/index.js';\nimport type { createRenderer } from 'solid-js/universal';\n\nexport type SolidRendererOptions = Parameters<\n typeof createRenderer\n>[0];\n\nexport default {\n createElement(name: string): ElementNode {\n return new ElementNode(name);\n },\n createTextNode(text: string): TextNode {\n // A text node is just a string - not the node\n return { name: 'TextNode', text, parent: undefined };\n },\n replaceText(node: TextNode, value: string): void {\n log('Replace Text: ', node, value);\n node.text = value;\n const parent = node.parent;\n assertTruthy(parent);\n parent.text = parent.getText();\n },\n setProperty(node: ElementNode, name: string, value: any = true): void {\n node[name] = value;\n },\n insertNode(parent: ElementNode, node: SolidNode, anchor: SolidNode): void {\n log('INSERT: ', parent, node, anchor);\n\n parent.children.insert(node, anchor);\n node._queueDelete = false;\n\n if (node instanceof ElementNode) {\n parent.rendered && node.render();\n } else if (parent.isTextNode()) {\n // TextNodes can be placed outside of nodes when is used as placeholder\n parent.text = parent.getText();\n }\n },\n isTextNode(node: ElementNode): boolean {\n return node.isTextNode();\n },\n removeNode(parent: ElementNode, node: SolidNode): void {\n log('REMOVE: ', parent, node);\n parent.children.remove(node);\n node._queueDelete = true;\n\n if (node instanceof ElementNode) {\n // Solid replacesNodes to move them (via insert and remove),\n // so we need to wait for the next microtask to destroy the node\n // in the event it gets a new parent.\n queueMicrotask(() => node.destroy());\n }\n },\n getParentNode(node: SolidNode): ElementNode | undefined {\n return node.parent;\n },\n getFirstChild(node: ElementNode): SolidNode | undefined {\n return node.children[0];\n },\n getNextSibling(node: SolidNode): SolidNode | undefined {\n const children = node.parent!.children || [];\n const index = children.indexOf(node) + 1;\n if (index < children.length) {\n return children[index];\n }\n return undefined;\n },\n} satisfies SolidRendererOptions;\n","/* eslint-disable @typescript-eslint/unbound-method */\n/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { createRenderer } from 'solid-js/universal';\nimport { config } from '../config.js';\nimport { startLightningRenderer } from './lightningInit.js';\nimport universalLightning from './solidUniversal.js';\nimport { ElementNode, type SolidNode } from './node/index.js';\nimport { splitProps, createMemo, untrack, type JSX } from 'solid-js';\n\nconst solidRenderer = createRenderer(universalLightning);\n\nexport const render = async function (\n code: () => JSX.Element,\n node?: string | HTMLElement | undefined,\n) {\n const renderer = startLightningRenderer(config.rendererOptions, node);\n await renderer.init();\n const rootNode = new ElementNode('App');\n rootNode.lng = renderer.root!;\n rootNode.rendered = true;\n // @ts-expect-error - code is jsx element and not SolidElement yet\n return solidRenderer.render(code, rootNode);\n};\n\nexport const {\n effect,\n memo,\n createComponent,\n createElement,\n createTextNode,\n insertNode,\n insert,\n spread,\n setProp,\n mergeProps,\n use,\n} = solidRenderer;\n\n/**\n * renders an arbitrary custom or native component and passes the other props\n * ```typescript\n * \n * ```\n * @description https://www.solidjs.com/docs/latest/api#dynamic\n */\nexport function Dynamic(\n props: T extends Record ? T : never,\n): SolidNode {\n const [p, others] = splitProps(props, ['component']);\n // eslint-disable-next-line @typescript-eslint/ban-types\n const cached = createMemo(() => p.component);\n return createMemo(() => {\n const component = cached();\n switch (typeof component) {\n case 'function':\n return untrack(() => component(others));\n\n case 'string':\n // eslint-disable-next-line no-case-declarations\n const el = createElement(component);\n spread(el, others);\n return el;\n\n default:\n break;\n }\n }) as unknown as SolidNode;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { isInteger } from './core/utils.js';\n\n/**\n * Converts a color string to a color number value.\n */\nexport function hexColor(color: string | number = ''): number {\n if (isInteger(color)) {\n return color;\n }\n\n if (typeof color === 'string') {\n // Renderer expects RGBA values\n if (color.startsWith('#')) {\n return Number(\n color.replace('#', '0x') + (color.length === 7 ? 'ff' : ''),\n );\n }\n\n if (color.startsWith('0x')) {\n return Number(color);\n }\n return Number('0x' + (color.length === 6 ? color + 'ff' : color));\n }\n\n return 0x00000000;\n}\n\n/**\n * Converts degrees to radians\n */\nexport function deg2rad(deg: number) {\n return (deg * Math.PI) / 180;\n}\n","import {\n createRoot,\n sharedConfig,\n createRenderEffect,\n untrack,\n enableHydration,\n getOwner,\n createEffect,\n runWithOwner,\n createMemo,\n createSignal,\n onCleanup,\n splitProps\n} from \"solid-js\";\nexport {\n ErrorBoundary,\n For,\n Index,\n Match,\n Show,\n Suspense,\n SuspenseList,\n Switch,\n createComponent,\n createRenderEffect as effect,\n getOwner,\n createMemo as memo,\n mergeProps,\n untrack\n} from \"solid-js\";\n\nconst booleans = [\n \"allowfullscreen\",\n \"async\",\n \"autofocus\",\n \"autoplay\",\n \"checked\",\n \"controls\",\n \"default\",\n \"disabled\",\n \"formnovalidate\",\n \"hidden\",\n \"indeterminate\",\n \"inert\",\n \"ismap\",\n \"loop\",\n \"multiple\",\n \"muted\",\n \"nomodule\",\n \"novalidate\",\n \"open\",\n \"playsinline\",\n \"readonly\",\n \"required\",\n \"reversed\",\n \"seamless\",\n \"selected\"\n];\nconst Properties = /*#__PURE__*/ new Set([\n \"className\",\n \"value\",\n \"readOnly\",\n \"formNoValidate\",\n \"isMap\",\n \"noModule\",\n \"playsInline\",\n ...booleans\n]);\nconst ChildProperties = /*#__PURE__*/ new Set([\n \"innerHTML\",\n \"textContent\",\n \"innerText\",\n \"children\"\n]);\nconst Aliases = /*#__PURE__*/ Object.assign(Object.create(null), {\n className: \"class\",\n htmlFor: \"for\"\n});\nconst PropAliases = /*#__PURE__*/ Object.assign(Object.create(null), {\n class: \"className\",\n formnovalidate: {\n $: \"formNoValidate\",\n BUTTON: 1,\n INPUT: 1\n },\n ismap: {\n $: \"isMap\",\n IMG: 1\n },\n nomodule: {\n $: \"noModule\",\n SCRIPT: 1\n },\n playsinline: {\n $: \"playsInline\",\n VIDEO: 1\n },\n readonly: {\n $: \"readOnly\",\n INPUT: 1,\n TEXTAREA: 1\n }\n});\nfunction getPropAlias(prop, tagName) {\n const a = PropAliases[prop];\n return typeof a === \"object\" ? (a[tagName] ? a[\"$\"] : undefined) : a;\n}\nconst DelegatedEvents = /*#__PURE__*/ new Set([\n \"beforeinput\",\n \"click\",\n \"dblclick\",\n \"contextmenu\",\n \"focusin\",\n \"focusout\",\n \"input\",\n \"keydown\",\n \"keyup\",\n \"mousedown\",\n \"mousemove\",\n \"mouseout\",\n \"mouseover\",\n \"mouseup\",\n \"pointerdown\",\n \"pointermove\",\n \"pointerout\",\n \"pointerover\",\n \"pointerup\",\n \"touchend\",\n \"touchmove\",\n \"touchstart\"\n]);\nconst SVGElements = /*#__PURE__*/ new Set([\n \"altGlyph\",\n \"altGlyphDef\",\n \"altGlyphItem\",\n \"animate\",\n \"animateColor\",\n \"animateMotion\",\n \"animateTransform\",\n \"circle\",\n \"clipPath\",\n \"color-profile\",\n \"cursor\",\n \"defs\",\n \"desc\",\n \"ellipse\",\n \"feBlend\",\n \"feColorMatrix\",\n \"feComponentTransfer\",\n \"feComposite\",\n \"feConvolveMatrix\",\n \"feDiffuseLighting\",\n \"feDisplacementMap\",\n \"feDistantLight\",\n \"feFlood\",\n \"feFuncA\",\n \"feFuncB\",\n \"feFuncG\",\n \"feFuncR\",\n \"feGaussianBlur\",\n \"feImage\",\n \"feMerge\",\n \"feMergeNode\",\n \"feMorphology\",\n \"feOffset\",\n \"fePointLight\",\n \"feSpecularLighting\",\n \"feSpotLight\",\n \"feTile\",\n \"feTurbulence\",\n \"filter\",\n \"font\",\n \"font-face\",\n \"font-face-format\",\n \"font-face-name\",\n \"font-face-src\",\n \"font-face-uri\",\n \"foreignObject\",\n \"g\",\n \"glyph\",\n \"glyphRef\",\n \"hkern\",\n \"image\",\n \"line\",\n \"linearGradient\",\n \"marker\",\n \"mask\",\n \"metadata\",\n \"missing-glyph\",\n \"mpath\",\n \"path\",\n \"pattern\",\n \"polygon\",\n \"polyline\",\n \"radialGradient\",\n \"rect\",\n \"set\",\n \"stop\",\n \"svg\",\n \"switch\",\n \"symbol\",\n \"text\",\n \"textPath\",\n \"tref\",\n \"tspan\",\n \"use\",\n \"view\",\n \"vkern\"\n]);\nconst SVGNamespace = {\n xlink: \"http://www.w3.org/1999/xlink\",\n xml: \"http://www.w3.org/XML/1998/namespace\"\n};\nconst DOMElements = /*#__PURE__*/ new Set([\n \"html\",\n \"base\",\n \"head\",\n \"link\",\n \"meta\",\n \"style\",\n \"title\",\n \"body\",\n \"address\",\n \"article\",\n \"aside\",\n \"footer\",\n \"header\",\n \"main\",\n \"nav\",\n \"section\",\n \"body\",\n \"blockquote\",\n \"dd\",\n \"div\",\n \"dl\",\n \"dt\",\n \"figcaption\",\n \"figure\",\n \"hr\",\n \"li\",\n \"ol\",\n \"p\",\n \"pre\",\n \"ul\",\n \"a\",\n \"abbr\",\n \"b\",\n \"bdi\",\n \"bdo\",\n \"br\",\n \"cite\",\n \"code\",\n \"data\",\n \"dfn\",\n \"em\",\n \"i\",\n \"kbd\",\n \"mark\",\n \"q\",\n \"rp\",\n \"rt\",\n \"ruby\",\n \"s\",\n \"samp\",\n \"small\",\n \"span\",\n \"strong\",\n \"sub\",\n \"sup\",\n \"time\",\n \"u\",\n \"var\",\n \"wbr\",\n \"area\",\n \"audio\",\n \"img\",\n \"map\",\n \"track\",\n \"video\",\n \"embed\",\n \"iframe\",\n \"object\",\n \"param\",\n \"picture\",\n \"portal\",\n \"source\",\n \"svg\",\n \"math\",\n \"canvas\",\n \"noscript\",\n \"script\",\n \"del\",\n \"ins\",\n \"caption\",\n \"col\",\n \"colgroup\",\n \"table\",\n \"tbody\",\n \"td\",\n \"tfoot\",\n \"th\",\n \"thead\",\n \"tr\",\n \"button\",\n \"datalist\",\n \"fieldset\",\n \"form\",\n \"input\",\n \"label\",\n \"legend\",\n \"meter\",\n \"optgroup\",\n \"option\",\n \"output\",\n \"progress\",\n \"select\",\n \"textarea\",\n \"details\",\n \"dialog\",\n \"menu\",\n \"summary\",\n \"details\",\n \"slot\",\n \"template\",\n \"acronym\",\n \"applet\",\n \"basefont\",\n \"bgsound\",\n \"big\",\n \"blink\",\n \"center\",\n \"content\",\n \"dir\",\n \"font\",\n \"frame\",\n \"frameset\",\n \"hgroup\",\n \"image\",\n \"keygen\",\n \"marquee\",\n \"menuitem\",\n \"nobr\",\n \"noembed\",\n \"noframes\",\n \"plaintext\",\n \"rb\",\n \"rtc\",\n \"shadow\",\n \"spacer\",\n \"strike\",\n \"tt\",\n \"xmp\",\n \"a\",\n \"abbr\",\n \"acronym\",\n \"address\",\n \"applet\",\n \"area\",\n \"article\",\n \"aside\",\n \"audio\",\n \"b\",\n \"base\",\n \"basefont\",\n \"bdi\",\n \"bdo\",\n \"bgsound\",\n \"big\",\n \"blink\",\n \"blockquote\",\n \"body\",\n \"br\",\n \"button\",\n \"canvas\",\n \"caption\",\n \"center\",\n \"cite\",\n \"code\",\n \"col\",\n \"colgroup\",\n \"content\",\n \"data\",\n \"datalist\",\n \"dd\",\n \"del\",\n \"details\",\n \"dfn\",\n \"dialog\",\n \"dir\",\n \"div\",\n \"dl\",\n \"dt\",\n \"em\",\n \"embed\",\n \"fieldset\",\n \"figcaption\",\n \"figure\",\n \"font\",\n \"footer\",\n \"form\",\n \"frame\",\n \"frameset\",\n \"head\",\n \"header\",\n \"hgroup\",\n \"hr\",\n \"html\",\n \"i\",\n \"iframe\",\n \"image\",\n \"img\",\n \"input\",\n \"ins\",\n \"kbd\",\n \"keygen\",\n \"label\",\n \"legend\",\n \"li\",\n \"link\",\n \"main\",\n \"map\",\n \"mark\",\n \"marquee\",\n \"menu\",\n \"menuitem\",\n \"meta\",\n \"meter\",\n \"nav\",\n \"nobr\",\n \"noembed\",\n \"noframes\",\n \"noscript\",\n \"object\",\n \"ol\",\n \"optgroup\",\n \"option\",\n \"output\",\n \"p\",\n \"param\",\n \"picture\",\n \"plaintext\",\n \"portal\",\n \"pre\",\n \"progress\",\n \"q\",\n \"rb\",\n \"rp\",\n \"rt\",\n \"rtc\",\n \"ruby\",\n \"s\",\n \"samp\",\n \"script\",\n \"section\",\n \"select\",\n \"shadow\",\n \"slot\",\n \"small\",\n \"source\",\n \"spacer\",\n \"span\",\n \"strike\",\n \"strong\",\n \"style\",\n \"sub\",\n \"summary\",\n \"sup\",\n \"table\",\n \"tbody\",\n \"td\",\n \"template\",\n \"textarea\",\n \"tfoot\",\n \"th\",\n \"thead\",\n \"time\",\n \"title\",\n \"tr\",\n \"track\",\n \"tt\",\n \"u\",\n \"ul\",\n \"var\",\n \"video\",\n \"wbr\",\n \"xmp\",\n \"input\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n \"h6\"\n]);\n\nfunction reconcileArrays(parentNode, a, b) {\n let bLength = b.length,\n aEnd = a.length,\n bEnd = bLength,\n aStart = 0,\n bStart = 0,\n after = a[aEnd - 1].nextSibling,\n map = null;\n while (aStart < aEnd || bStart < bEnd) {\n if (a[aStart] === b[bStart]) {\n aStart++;\n bStart++;\n continue;\n }\n while (a[aEnd - 1] === b[bEnd - 1]) {\n aEnd--;\n bEnd--;\n }\n if (aEnd === aStart) {\n const node = bEnd < bLength ? (bStart ? b[bStart - 1].nextSibling : b[bEnd - bStart]) : after;\n while (bStart < bEnd) parentNode.insertBefore(b[bStart++], node);\n } else if (bEnd === bStart) {\n while (aStart < aEnd) {\n if (!map || !map.has(a[aStart])) a[aStart].remove();\n aStart++;\n }\n } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {\n const node = a[--aEnd].nextSibling;\n parentNode.insertBefore(b[bStart++], a[aStart++].nextSibling);\n parentNode.insertBefore(b[--bEnd], node);\n a[aEnd] = b[bEnd];\n } else {\n if (!map) {\n map = new Map();\n let i = bStart;\n while (i < bEnd) map.set(b[i], i++);\n }\n const index = map.get(a[aStart]);\n if (index != null) {\n if (bStart < index && index < bEnd) {\n let i = aStart,\n sequence = 1,\n t;\n while (++i < aEnd && i < bEnd) {\n if ((t = map.get(a[i])) == null || t !== index + sequence) break;\n sequence++;\n }\n if (sequence > index - bStart) {\n const node = a[aStart];\n while (bStart < index) parentNode.insertBefore(b[bStart++], node);\n } else parentNode.replaceChild(b[bStart++], a[aStart++]);\n } else aStart++;\n } else a[aStart++].remove();\n }\n }\n}\n\nconst $$EVENTS = \"_$DX_DELEGATE\";\nfunction render(code, element, init, options = {}) {\n let disposer;\n createRoot(dispose => {\n disposer = dispose;\n element === document\n ? code()\n : insert(element, code(), element.firstChild ? null : undefined, init);\n }, options.owner);\n return () => {\n disposer();\n element.textContent = \"\";\n };\n}\nfunction template(html, isCE, isSVG) {\n let node;\n const create = () => {\n const t = document.createElement(\"template\");\n t.innerHTML = html;\n return isSVG ? t.content.firstChild.firstChild : t.content.firstChild;\n };\n const fn = isCE\n ? () => untrack(() => document.importNode(node || (node = create()), true))\n : () => (node || (node = create())).cloneNode(true);\n fn.cloneNode = fn;\n return fn;\n}\nfunction delegateEvents(eventNames, document = window.document) {\n const e = document[$$EVENTS] || (document[$$EVENTS] = new Set());\n for (let i = 0, l = eventNames.length; i < l; i++) {\n const name = eventNames[i];\n if (!e.has(name)) {\n e.add(name);\n document.addEventListener(name, eventHandler);\n }\n }\n}\nfunction clearDelegatedEvents(document = window.document) {\n if (document[$$EVENTS]) {\n for (let name of document[$$EVENTS].keys()) document.removeEventListener(name, eventHandler);\n delete document[$$EVENTS];\n }\n}\nfunction setProperty(node, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n node[name] = value;\n}\nfunction setAttribute(node, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttribute(name);\n else node.setAttribute(name, value);\n}\nfunction setAttributeNS(node, namespace, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttributeNS(namespace, name);\n else node.setAttributeNS(namespace, name, value);\n}\nfunction className(node, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttribute(\"class\");\n else node.className = value;\n}\nfunction addEventListener(node, name, handler, delegate) {\n if (delegate) {\n if (Array.isArray(handler)) {\n node[`$$${name}`] = handler[0];\n node[`$$${name}Data`] = handler[1];\n } else node[`$$${name}`] = handler;\n } else if (Array.isArray(handler)) {\n const handlerFn = handler[0];\n node.addEventListener(name, (handler[0] = e => handlerFn.call(node, handler[1], e)));\n } else node.addEventListener(name, handler);\n}\nfunction classList(node, value, prev = {}) {\n const classKeys = Object.keys(value || {}),\n prevKeys = Object.keys(prev);\n let i, len;\n for (i = 0, len = prevKeys.length; i < len; i++) {\n const key = prevKeys[i];\n if (!key || key === \"undefined\" || value[key]) continue;\n toggleClassKey(node, key, false);\n delete prev[key];\n }\n for (i = 0, len = classKeys.length; i < len; i++) {\n const key = classKeys[i],\n classValue = !!value[key];\n if (!key || key === \"undefined\" || prev[key] === classValue || !classValue) continue;\n toggleClassKey(node, key, true);\n prev[key] = classValue;\n }\n return prev;\n}\nfunction style(node, value, prev) {\n if (!value) return prev ? setAttribute(node, \"style\") : value;\n const nodeStyle = node.style;\n if (typeof value === \"string\") return (nodeStyle.cssText = value);\n typeof prev === \"string\" && (nodeStyle.cssText = prev = undefined);\n prev || (prev = {});\n value || (value = {});\n let v, s;\n for (s in prev) {\n value[s] == null && nodeStyle.removeProperty(s);\n delete prev[s];\n }\n for (s in value) {\n v = value[s];\n if (v !== prev[s]) {\n nodeStyle.setProperty(s, v);\n prev[s] = v;\n }\n }\n return prev;\n}\nfunction spread(node, props = {}, isSVG, skipChildren) {\n const prevProps = {};\n if (!skipChildren) {\n createRenderEffect(\n () => (prevProps.children = insertExpression(node, props.children, prevProps.children))\n );\n }\n createRenderEffect(() => props.ref && props.ref(node));\n createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));\n return prevProps;\n}\nfunction dynamicProperty(props, key) {\n const src = props[key];\n Object.defineProperty(props, key, {\n get() {\n return src();\n },\n enumerable: true\n });\n return props;\n}\nfunction use(fn, element, arg) {\n return untrack(() => fn(element, arg));\n}\nfunction insert(parent, accessor, marker, initial) {\n if (marker !== undefined && !initial) initial = [];\n if (typeof accessor !== \"function\") return insertExpression(parent, accessor, initial, marker);\n createRenderEffect(current => insertExpression(parent, accessor(), current, marker), initial);\n}\nfunction assign(node, props, isSVG, skipChildren, prevProps = {}, skipRef = false) {\n props || (props = {});\n for (const prop in prevProps) {\n if (!(prop in props)) {\n if (prop === \"children\") continue;\n prevProps[prop] = assignProp(node, prop, null, prevProps[prop], isSVG, skipRef);\n }\n }\n for (const prop in props) {\n if (prop === \"children\") {\n if (!skipChildren) insertExpression(node, props.children);\n continue;\n }\n const value = props[prop];\n prevProps[prop] = assignProp(node, prop, value, prevProps[prop], isSVG, skipRef);\n }\n}\nfunction hydrate$1(code, element, options = {}) {\n sharedConfig.completed = globalThis._$HY.completed;\n sharedConfig.events = globalThis._$HY.events;\n sharedConfig.load = id => globalThis._$HY.r[id];\n sharedConfig.has = id => id in globalThis._$HY.r;\n sharedConfig.gather = root => gatherHydratable(element, root);\n sharedConfig.registry = new Map();\n sharedConfig.context = {\n id: options.renderId || \"\",\n count: 0\n };\n gatherHydratable(element, options.renderId);\n const dispose = render(code, element, [...element.childNodes], options);\n sharedConfig.context = null;\n return dispose;\n}\nfunction getNextElement(template) {\n let node, key;\n if (!sharedConfig.context || !(node = sharedConfig.registry.get((key = getHydrationKey())))) {\n return template();\n }\n if (sharedConfig.completed) sharedConfig.completed.add(node);\n sharedConfig.registry.delete(key);\n return node;\n}\nfunction getNextMatch(el, nodeName) {\n while (el && el.localName !== nodeName) el = el.nextSibling;\n return el;\n}\nfunction getNextMarker(start) {\n let end = start,\n count = 0,\n current = [];\n if (sharedConfig.context) {\n while (end) {\n if (end.nodeType === 8) {\n const v = end.nodeValue;\n if (v === \"$\") count++;\n else if (v === \"/\") {\n if (count === 0) return [end, current];\n count--;\n }\n }\n current.push(end);\n end = end.nextSibling;\n }\n }\n return [end, current];\n}\nfunction runHydrationEvents() {\n if (sharedConfig.events && !sharedConfig.events.queued) {\n queueMicrotask(() => {\n const { completed, events } = sharedConfig;\n events.queued = false;\n while (events.length) {\n const [el, e] = events[0];\n if (!completed.has(el)) return;\n eventHandler(e);\n events.shift();\n }\n });\n sharedConfig.events.queued = true;\n }\n}\nfunction toPropertyName(name) {\n return name.toLowerCase().replace(/-([a-z])/g, (_, w) => w.toUpperCase());\n}\nfunction toggleClassKey(node, key, value) {\n const classNames = key.trim().split(/\\s+/);\n for (let i = 0, nameLen = classNames.length; i < nameLen; i++)\n node.classList.toggle(classNames[i], value);\n}\nfunction assignProp(node, prop, value, prev, isSVG, skipRef) {\n let isCE, isProp, isChildProp, propAlias, forceProp;\n if (prop === \"style\") return style(node, value, prev);\n if (prop === \"classList\") return classList(node, value, prev);\n if (value === prev) return prev;\n if (prop === \"ref\") {\n if (!skipRef) value(node);\n } else if (prop.slice(0, 3) === \"on:\") {\n const e = prop.slice(3);\n prev && node.removeEventListener(e, prev);\n value && node.addEventListener(e, value);\n } else if (prop.slice(0, 10) === \"oncapture:\") {\n const e = prop.slice(10);\n prev && node.removeEventListener(e, prev, true);\n value && node.addEventListener(e, value, true);\n } else if (prop.slice(0, 2) === \"on\") {\n const name = prop.slice(2).toLowerCase();\n const delegate = DelegatedEvents.has(name);\n if (!delegate && prev) {\n const h = Array.isArray(prev) ? prev[0] : prev;\n node.removeEventListener(name, h);\n }\n if (delegate || value) {\n addEventListener(node, name, value, delegate);\n delegate && delegateEvents([name]);\n }\n } else if (prop.slice(0, 5) === \"attr:\") {\n setAttribute(node, prop.slice(5), value);\n } else if (\n (forceProp = prop.slice(0, 5) === \"prop:\") ||\n (isChildProp = ChildProperties.has(prop)) ||\n (!isSVG &&\n ((propAlias = getPropAlias(prop, node.tagName)) || (isProp = Properties.has(prop)))) ||\n (isCE = node.nodeName.includes(\"-\"))\n ) {\n if (forceProp) {\n prop = prop.slice(5);\n isProp = true;\n } else if (!!sharedConfig.context && node.isConnected) return value;\n if (prop === \"class\" || prop === \"className\") className(node, value);\n else if (isCE && !isProp && !isChildProp) node[toPropertyName(prop)] = value;\n else node[propAlias || prop] = value;\n } else {\n const ns = isSVG && prop.indexOf(\":\") > -1 && SVGNamespace[prop.split(\":\")[0]];\n if (ns) setAttributeNS(node, ns, prop, value);\n else setAttribute(node, Aliases[prop] || prop, value);\n }\n return value;\n}\nfunction eventHandler(e) {\n const key = `$$${e.type}`;\n let node = (e.composedPath && e.composedPath()[0]) || e.target;\n if (e.target !== node) {\n Object.defineProperty(e, \"target\", {\n configurable: true,\n value: node\n });\n }\n Object.defineProperty(e, \"currentTarget\", {\n configurable: true,\n get() {\n return node || document;\n }\n });\n if (sharedConfig.registry && !sharedConfig.done) sharedConfig.done = _$HY.done = true;\n while (node) {\n const handler = node[key];\n if (handler && !node.disabled) {\n const data = node[`${key}Data`];\n data !== undefined ? handler.call(node, data, e) : handler.call(node, e);\n if (e.cancelBubble) return;\n }\n node = node._$host || node.parentNode || node.host;\n }\n}\nfunction insertExpression(parent, value, current, marker, unwrapArray) {\n const hydrating = !!sharedConfig.context && parent.isConnected;\n if (hydrating) {\n !current && (current = [...parent.childNodes]);\n let cleaned = [];\n for (let i = 0; i < current.length; i++) {\n const node = current[i];\n if (node.nodeType === 8 && node.data.slice(0, 2) === \"!$\") node.remove();\n else cleaned.push(node);\n }\n current = cleaned;\n }\n while (typeof current === \"function\") current = current();\n if (value === current) return current;\n const t = typeof value,\n multi = marker !== undefined;\n parent = (multi && current[0] && current[0].parentNode) || parent;\n if (t === \"string\" || t === \"number\") {\n if (hydrating) return current;\n if (t === \"number\") value = value.toString();\n if (multi) {\n let node = current[0];\n if (node && node.nodeType === 3) {\n node.data !== value && (node.data = value);\n } else node = document.createTextNode(value);\n current = cleanChildren(parent, current, marker, node);\n } else {\n if (current !== \"\" && typeof current === \"string\") {\n current = parent.firstChild.data = value;\n } else current = parent.textContent = value;\n }\n } else if (value == null || t === \"boolean\") {\n if (hydrating) return current;\n current = cleanChildren(parent, current, marker);\n } else if (t === \"function\") {\n createRenderEffect(() => {\n let v = value();\n while (typeof v === \"function\") v = v();\n current = insertExpression(parent, v, current, marker);\n });\n return () => current;\n } else if (Array.isArray(value)) {\n const array = [];\n const currentArray = current && Array.isArray(current);\n if (normalizeIncomingArray(array, value, current, unwrapArray)) {\n createRenderEffect(() => (current = insertExpression(parent, array, current, marker, true)));\n return () => current;\n }\n if (hydrating) {\n if (!array.length) return current;\n if (marker === undefined) return [...parent.childNodes];\n let node = array[0];\n let nodes = [node];\n while ((node = node.nextSibling) !== marker) nodes.push(node);\n return (current = nodes);\n }\n if (array.length === 0) {\n current = cleanChildren(parent, current, marker);\n if (multi) return current;\n } else if (currentArray) {\n if (current.length === 0) {\n appendNodes(parent, array, marker);\n } else reconcileArrays(parent, current, array);\n } else {\n current && cleanChildren(parent);\n appendNodes(parent, array);\n }\n current = array;\n } else if (value.nodeType) {\n if (hydrating && value.parentNode) return (current = multi ? [value] : value);\n if (Array.isArray(current)) {\n if (multi) return (current = cleanChildren(parent, current, marker, value));\n cleanChildren(parent, current, null, value);\n } else if (current == null || current === \"\" || !parent.firstChild) {\n parent.appendChild(value);\n } else parent.replaceChild(value, parent.firstChild);\n current = value;\n } else;\n return current;\n}\nfunction normalizeIncomingArray(normalized, array, current, unwrap) {\n let dynamic = false;\n for (let i = 0, len = array.length; i < len; i++) {\n let item = array[i],\n prev = current && current[normalized.length],\n t;\n if (item == null || item === true || item === false);\n else if ((t = typeof item) === \"object\" && item.nodeType) {\n normalized.push(item);\n } else if (Array.isArray(item)) {\n dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic;\n } else if (t === \"function\") {\n if (unwrap) {\n while (typeof item === \"function\") item = item();\n dynamic =\n normalizeIncomingArray(\n normalized,\n Array.isArray(item) ? item : [item],\n Array.isArray(prev) ? prev : [prev]\n ) || dynamic;\n } else {\n normalized.push(item);\n dynamic = true;\n }\n } else {\n const value = String(item);\n if (prev && prev.nodeType === 3 && prev.data === value) normalized.push(prev);\n else normalized.push(document.createTextNode(value));\n }\n }\n return dynamic;\n}\nfunction appendNodes(parent, array, marker = null) {\n for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker);\n}\nfunction cleanChildren(parent, current, marker, replacement) {\n if (marker === undefined) return (parent.textContent = \"\");\n const node = replacement || document.createTextNode(\"\");\n if (current.length) {\n let inserted = false;\n for (let i = current.length - 1; i >= 0; i--) {\n const el = current[i];\n if (node !== el) {\n const isParent = el.parentNode === parent;\n if (!inserted && !i)\n isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);\n else isParent && el.remove();\n } else inserted = true;\n }\n } else parent.insertBefore(node, marker);\n return [node];\n}\nfunction gatherHydratable(element, root) {\n const templates = element.querySelectorAll(`*[data-hk]`);\n for (let i = 0; i < templates.length; i++) {\n const node = templates[i];\n const key = node.getAttribute(\"data-hk\");\n if ((!root || key.startsWith(root)) && !sharedConfig.registry.has(key))\n sharedConfig.registry.set(key, node);\n }\n}\nfunction getHydrationKey() {\n const hydrate = sharedConfig.context;\n return `${hydrate.id}${hydrate.count++}`;\n}\nfunction NoHydration(props) {\n return sharedConfig.context ? undefined : props.children;\n}\nfunction Hydration(props) {\n return props.children;\n}\nconst voidFn = () => undefined;\nconst RequestContext = Symbol();\nfunction innerHTML(parent, content) {\n !sharedConfig.context && (parent.innerHTML = content);\n}\n\nfunction throwInBrowser(func) {\n const err = new Error(`${func.name} is not supported in the browser, returning undefined`);\n console.error(err);\n}\nfunction renderToString(fn, options) {\n throwInBrowser(renderToString);\n}\nfunction renderToStringAsync(fn, options) {\n throwInBrowser(renderToStringAsync);\n}\nfunction renderToStream(fn, options) {\n throwInBrowser(renderToStream);\n}\nfunction ssr(template, ...nodes) {}\nfunction ssrElement(name, props, children, needsId) {}\nfunction ssrClassList(value) {}\nfunction ssrStyle(value) {}\nfunction ssrAttribute(key, value) {}\nfunction ssrHydrationKey() {}\nfunction resolveSSRNode(node) {}\nfunction escape(html) {}\nfunction ssrSpread(props, isSVG, skipChildren) {}\n\nconst isServer = false;\nconst isDev = false;\nconst SVG_NAMESPACE = \"http://www.w3.org/2000/svg\";\nfunction createElement(tagName, isSVG = false) {\n return isSVG ? document.createElementNS(SVG_NAMESPACE, tagName) : document.createElement(tagName);\n}\nconst hydrate = (...args) => {\n enableHydration();\n return hydrate$1(...args);\n};\nfunction Portal(props) {\n const { useShadow } = props,\n marker = document.createTextNode(\"\"),\n mount = () => props.mount || document.body,\n owner = getOwner();\n let content;\n let hydrating = !!sharedConfig.context;\n createEffect(\n () => {\n if (hydrating) getOwner().user = hydrating = false;\n content || (content = runWithOwner(owner, () => createMemo(() => props.children)));\n const el = mount();\n if (el instanceof HTMLHeadElement) {\n const [clean, setClean] = createSignal(false);\n const cleanup = () => setClean(true);\n createRoot(dispose => insert(el, () => (!clean() ? content() : dispose()), null));\n onCleanup(cleanup);\n } else {\n const container = createElement(props.isSVG ? \"g\" : \"div\", props.isSVG),\n renderRoot =\n useShadow && container.attachShadow\n ? container.attachShadow({\n mode: \"open\"\n })\n : container;\n Object.defineProperty(container, \"_$host\", {\n get() {\n return marker.parentNode;\n },\n configurable: true\n });\n insert(renderRoot, content);\n el.appendChild(container);\n props.ref && props.ref(container);\n onCleanup(() => el.removeChild(container));\n }\n },\n undefined,\n {\n render: !hydrating\n }\n );\n return marker;\n}\nfunction Dynamic(props) {\n const [p, others] = splitProps(props, [\"component\"]);\n const cached = createMemo(() => p.component);\n return createMemo(() => {\n const component = cached();\n switch (typeof component) {\n case \"function\":\n return untrack(() => component(others));\n case \"string\":\n const isSvg = SVGElements.has(component);\n const el = sharedConfig.context ? getNextElement() : createElement(component, isSvg);\n spread(el, others, isSvg);\n return el;\n }\n });\n}\n\nexport {\n Aliases,\n voidFn as Assets,\n ChildProperties,\n DOMElements,\n DelegatedEvents,\n Dynamic,\n Hydration,\n voidFn as HydrationScript,\n NoHydration,\n Portal,\n Properties,\n RequestContext,\n SVGElements,\n SVGNamespace,\n addEventListener,\n assign,\n classList,\n className,\n clearDelegatedEvents,\n delegateEvents,\n dynamicProperty,\n escape,\n voidFn as generateHydrationScript,\n voidFn as getAssets,\n getHydrationKey,\n getNextElement,\n getNextMarker,\n getNextMatch,\n getPropAlias,\n voidFn as getRequestEvent,\n hydrate,\n innerHTML,\n insert,\n isDev,\n isServer,\n render,\n renderToStream,\n renderToString,\n renderToStringAsync,\n resolveSSRNode,\n runHydrationEvents,\n setAttribute,\n setAttributeNS,\n setProperty,\n spread,\n ssr,\n ssrAttribute,\n ssrClassList,\n ssrElement,\n ssrHydrationKey,\n ssrSpread,\n ssrStyle,\n style,\n template,\n use,\n voidFn as useAssets\n};\n","import { isServer } from \"solid-js/web\";\nexport function createBeforeLeave() {\n let listeners = new Set();\n function subscribe(listener) {\n listeners.add(listener);\n return () => listeners.delete(listener);\n }\n let ignore = false;\n function confirm(to, options) {\n if (ignore)\n return !(ignore = false);\n const e = {\n to,\n options,\n defaultPrevented: false,\n preventDefault: () => (e.defaultPrevented = true)\n };\n for (const l of listeners)\n l.listener({\n ...e,\n from: l.location,\n retry: (force) => {\n force && (ignore = true);\n l.navigate(to, { ...options, resolve: false });\n }\n });\n return !e.defaultPrevented;\n }\n return {\n subscribe,\n confirm\n };\n}\n// The following supports browser initiated blocking (eg back/forward)\nlet depth;\nexport function saveCurrentDepth() {\n if (!window.history.state || window.history.state._depth == null) {\n window.history.replaceState({ ...window.history.state, _depth: window.history.length - 1 }, \"\");\n }\n depth = window.history.state._depth;\n}\nif (!isServer) {\n saveCurrentDepth();\n}\nexport function keepDepth(state) {\n return {\n ...state,\n _depth: window.history.state && window.history.state._depth\n };\n}\nexport function notifyIfNotBlocked(notify, block) {\n let ignore = false;\n return () => {\n const prevDepth = depth;\n saveCurrentDepth();\n const delta = prevDepth == null ? null : depth - prevDepth;\n if (ignore) {\n ignore = false;\n return;\n }\n if (delta && block(delta)) {\n ignore = true;\n window.history.go(-delta);\n }\n else {\n notify();\n }\n };\n}\n","import { createMemo, getOwner, runWithOwner } from \"solid-js\";\nconst hasSchemeRegex = /^(?:[a-z0-9]+:)?\\/\\//i;\nconst trimPathRegex = /^\\/+|(\\/)\\/+$/g;\nexport const mockBase = \"http://sr\";\nexport function normalizePath(path, omitSlash = false) {\n const s = path.replace(trimPathRegex, \"$1\");\n return s ? (omitSlash || /^[?#]/.test(s) ? s : \"/\" + s) : \"\";\n}\nexport function resolvePath(base, path, from) {\n if (hasSchemeRegex.test(path)) {\n return undefined;\n }\n const basePath = normalizePath(base);\n const fromPath = from && normalizePath(from);\n let result = \"\";\n if (!fromPath || path.startsWith(\"/\")) {\n result = basePath;\n }\n else if (fromPath.toLowerCase().indexOf(basePath.toLowerCase()) !== 0) {\n result = basePath + fromPath;\n }\n else {\n result = fromPath;\n }\n return (result || \"/\") + normalizePath(path, !result);\n}\nexport function invariant(value, message) {\n if (value == null) {\n throw new Error(message);\n }\n return value;\n}\nexport function joinPaths(from, to) {\n return normalizePath(from).replace(/\\/*(\\*.*)?$/g, \"\") + normalizePath(to);\n}\nexport function extractSearchParams(url) {\n const params = {};\n url.searchParams.forEach((value, key) => {\n params[key] = value;\n });\n return params;\n}\nexport function createMatcher(path, partial, matchFilters) {\n const [pattern, splat] = path.split(\"/*\", 2);\n const segments = pattern.split(\"/\").filter(Boolean);\n const len = segments.length;\n return (location) => {\n const locSegments = location.split(\"/\").filter(Boolean);\n const lenDiff = locSegments.length - len;\n if (lenDiff < 0 || (lenDiff > 0 && splat === undefined && !partial)) {\n return null;\n }\n const match = {\n path: len ? \"\" : \"/\",\n params: {}\n };\n const matchFilter = (s) => matchFilters === undefined ? undefined : matchFilters[s];\n for (let i = 0; i < len; i++) {\n const segment = segments[i];\n const locSegment = locSegments[i];\n const dynamic = segment[0] === \":\";\n const key = dynamic ? segment.slice(1) : segment;\n if (dynamic && matchSegment(locSegment, matchFilter(key))) {\n match.params[key] = locSegment;\n }\n else if (dynamic || !matchSegment(locSegment, segment)) {\n return null;\n }\n match.path += `/${locSegment}`;\n }\n if (splat) {\n const remainder = lenDiff ? locSegments.slice(-lenDiff).join(\"/\") : \"\";\n if (matchSegment(remainder, matchFilter(splat))) {\n match.params[splat] = remainder;\n }\n else {\n return null;\n }\n }\n return match;\n };\n}\nfunction matchSegment(input, filter) {\n const isEqual = (s) => s.localeCompare(input, undefined, { sensitivity: \"base\" }) === 0;\n if (filter === undefined) {\n return true;\n }\n else if (typeof filter === \"string\") {\n return isEqual(filter);\n }\n else if (typeof filter === \"function\") {\n return filter(input);\n }\n else if (Array.isArray(filter)) {\n return filter.some(isEqual);\n }\n else if (filter instanceof RegExp) {\n return filter.test(input);\n }\n return false;\n}\nexport function scoreRoute(route) {\n const [pattern, splat] = route.pattern.split(\"/*\", 2);\n const segments = pattern.split(\"/\").filter(Boolean);\n return segments.reduce((score, segment) => score + (segment.startsWith(\":\") ? 2 : 3), segments.length - (splat === undefined ? 0 : 1));\n}\nexport function createMemoObject(fn) {\n const map = new Map();\n const owner = getOwner();\n return new Proxy({}, {\n get(_, property) {\n if (!map.has(property)) {\n runWithOwner(owner, () => map.set(property, createMemo(() => fn()[property])));\n }\n return map.get(property)();\n },\n getOwnPropertyDescriptor() {\n return {\n enumerable: true,\n configurable: true\n };\n },\n ownKeys() {\n return Reflect.ownKeys(fn());\n }\n });\n}\nexport function mergeSearchString(search, params) {\n const merged = new URLSearchParams(search);\n Object.entries(params).forEach(([key, value]) => {\n if (value == null || value === \"\") {\n merged.delete(key);\n }\n else {\n merged.set(key, String(value));\n }\n });\n const s = merged.toString();\n return s ? `?${s}` : \"\";\n}\nexport function expandOptionals(pattern) {\n let match = /(\\/?\\:[^\\/]+)\\?/.exec(pattern);\n if (!match)\n return [pattern];\n let prefix = pattern.slice(0, match.index);\n let suffix = pattern.slice(match.index + match[0].length);\n const prefixes = [prefix, (prefix += match[1])];\n // This section handles adjacent optional params. We don't actually want all permuations since\n // that will lead to equivalent routes which have the same number of params. For example\n // `/:a?/:b?/:c`? only has the unique expansion: `/`, `/:a`, `/:a/:b`, `/:a/:b/:c` and we can\n // discard `/:b`, `/:c`, `/:b/:c` by building them up in order and not recursing. This also helps\n // ensure predictability where earlier params have precidence.\n while ((match = /^(\\/\\:[^\\/]+)\\?/.exec(suffix))) {\n prefixes.push((prefix += match[1]));\n suffix = suffix.slice(match[0].length);\n }\n return expandOptionals(suffix).reduce((results, expansion) => [...results, ...prefixes.map(p => p + expansion)], []);\n}\n","import { runWithOwner } from \"solid-js\";\nimport { createComponent, createContext, createMemo, createRenderEffect, createSignal, on, onCleanup, untrack, useContext, startTransition, resetErrorBoundaries } from \"solid-js\";\nimport { isServer, getRequestEvent } from \"solid-js/web\";\nimport { createBeforeLeave } from \"./lifecycle.js\";\nimport { mockBase, createMemoObject, extractSearchParams, invariant, resolvePath, createMatcher, joinPaths, scoreRoute, mergeSearchString, expandOptionals } from \"./utils.js\";\nconst MAX_REDIRECTS = 100;\nexport const RouterContextObj = createContext();\nexport const RouteContextObj = createContext();\nexport const useRouter = () => invariant(useContext(RouterContextObj), \" and 'use' router primitives can be only used inside a Route.\");\nlet TempRoute;\nexport const useRoute = () => TempRoute || useContext(RouteContextObj) || useRouter().base;\nexport const useResolvedPath = (path) => {\n const route = useRoute();\n return createMemo(() => route.resolvePath(path()));\n};\nexport const useHref = (to) => {\n const router = useRouter();\n return createMemo(() => {\n const to_ = to();\n return to_ !== undefined ? router.renderPath(to_) : to_;\n });\n};\nexport const useNavigate = () => useRouter().navigatorFactory();\nexport const useLocation = () => useRouter().location;\nexport const useIsRouting = () => useRouter().isRouting;\nexport const useMatch = (path, matchFilters) => {\n const location = useLocation();\n const matchers = createMemo(() => expandOptionals(path()).map(path => createMatcher(path, undefined, matchFilters)));\n return createMemo(() => {\n for (const matcher of matchers()) {\n const match = matcher(location.pathname);\n if (match)\n return match;\n }\n });\n};\nexport const useParams = () => useRouter().params;\nexport const useSearchParams = () => {\n const location = useLocation();\n const navigate = useNavigate();\n const setSearchParams = (params, options) => {\n const searchString = untrack(() => location.pathname + mergeSearchString(location.search, params) + location.hash);\n navigate(searchString, {\n scroll: false,\n resolve: false,\n ...options\n });\n };\n return [location.query, setSearchParams];\n};\nexport const useBeforeLeave = (listener) => {\n const s = useRouter().beforeLeave.subscribe({\n listener,\n location: useLocation(),\n navigate: useNavigate()\n });\n onCleanup(s);\n};\nexport function createRoutes(routeDef, base = \"\") {\n const { component, load, children, info } = routeDef;\n const isLeaf = !children || (Array.isArray(children) && !children.length);\n const shared = {\n key: routeDef,\n component,\n load,\n info\n };\n return asArray(routeDef.path).reduce((acc, path) => {\n for (const originalPath of expandOptionals(path)) {\n const path = joinPaths(base, originalPath);\n let pattern = isLeaf ? path : path.split(\"/*\", 1)[0];\n pattern = pattern\n .split(\"/\")\n .map((s) => {\n return s.startsWith(\":\") || s.startsWith(\"*\") ? s : encodeURIComponent(s);\n })\n .join(\"/\");\n acc.push({\n ...shared,\n originalPath,\n pattern,\n matcher: createMatcher(pattern, !isLeaf, routeDef.matchFilters)\n });\n }\n return acc;\n }, []);\n}\nexport function createBranch(routes, index = 0) {\n return {\n routes,\n score: scoreRoute(routes[routes.length - 1]) * 10000 - index,\n matcher(location) {\n const matches = [];\n for (let i = routes.length - 1; i >= 0; i--) {\n const route = routes[i];\n const match = route.matcher(location);\n if (!match) {\n return null;\n }\n matches.unshift({\n ...match,\n route\n });\n }\n return matches;\n }\n };\n}\nfunction asArray(value) {\n return Array.isArray(value) ? value : [value];\n}\nexport function createBranches(routeDef, base = \"\", stack = [], branches = []) {\n const routeDefs = asArray(routeDef);\n for (let i = 0, len = routeDefs.length; i < len; i++) {\n const def = routeDefs[i];\n if (def && typeof def === \"object\") {\n if (!def.hasOwnProperty(\"path\"))\n def.path = \"\";\n const routes = createRoutes(def, base);\n for (const route of routes) {\n stack.push(route);\n const isEmptyArray = Array.isArray(def.children) && def.children.length === 0;\n if (def.children && !isEmptyArray) {\n createBranches(def.children, route.pattern, stack, branches);\n }\n else {\n const branch = createBranch([...stack], branches.length);\n branches.push(branch);\n }\n stack.pop();\n }\n }\n }\n // Stack will be empty on final return\n return stack.length ? branches : branches.sort((a, b) => b.score - a.score);\n}\nexport function getRouteMatches(branches, location) {\n for (let i = 0, len = branches.length; i < len; i++) {\n const match = branches[i].matcher(location);\n if (match) {\n return match;\n }\n }\n return [];\n}\nexport function createLocation(path, state) {\n const origin = new URL(mockBase);\n const url = createMemo(prev => {\n const path_ = path();\n try {\n return new URL(path_, origin);\n }\n catch (err) {\n console.error(`Invalid path ${path_}`);\n return prev;\n }\n }, origin, {\n equals: (a, b) => a.href === b.href\n });\n const pathname = createMemo(() => url().pathname);\n const search = createMemo(() => url().search, true);\n const hash = createMemo(() => url().hash);\n const key = () => \"\";\n return {\n get pathname() {\n return pathname();\n },\n get search() {\n return search();\n },\n get hash() {\n return hash();\n },\n get state() {\n return state();\n },\n get key() {\n return key();\n },\n query: createMemoObject(on(search, () => extractSearchParams(url())))\n };\n}\nlet intent;\nexport function getIntent() {\n return intent;\n}\nexport function createRouterContext(integration, branches, getContext, options = {}) {\n const { signal: [source, setSource], utils = {} } = integration;\n const parsePath = utils.parsePath || (p => p);\n const renderPath = utils.renderPath || (p => p);\n const beforeLeave = utils.beforeLeave || createBeforeLeave();\n const basePath = resolvePath(\"\", options.base || \"\");\n if (basePath === undefined) {\n throw new Error(`${basePath} is not a valid base path`);\n }\n else if (basePath && !source().value) {\n setSource({ value: basePath, replace: true, scroll: false });\n }\n const [isRouting, setIsRouting] = createSignal(false);\n const start = async (callback) => {\n setIsRouting(true);\n try {\n await startTransition(callback);\n }\n finally {\n setIsRouting(false);\n }\n };\n const [reference, setReference] = createSignal(source().value);\n const [state, setState] = createSignal(source().state);\n const location = createLocation(reference, state);\n const referrers = [];\n const submissions = createSignal(isServer ? initFromFlash() : []);\n const matches = createMemo(() => getRouteMatches(branches(), location.pathname));\n const params = createMemoObject(() => {\n const m = matches();\n const params = {};\n for (let i = 0; i < m.length; i++) {\n Object.assign(params, m[i].params);\n }\n return params;\n });\n const baseRoute = {\n pattern: basePath,\n path: () => basePath,\n outlet: () => null,\n resolvePath(to) {\n return resolvePath(basePath, to);\n }\n };\n createRenderEffect(() => {\n const { value, state } = source();\n // Untrack this whole block so `start` doesn't cause Solid's Listener to be preserved\n untrack(() => {\n if (value !== reference()) {\n start(() => {\n intent = \"native\";\n setReference(value);\n setState(state);\n resetErrorBoundaries();\n submissions[1]([]);\n }).then(() => {\n intent = undefined;\n });\n }\n });\n });\n return {\n base: baseRoute,\n location,\n params,\n isRouting,\n renderPath,\n parsePath,\n navigatorFactory,\n matches,\n beforeLeave,\n preloadRoute,\n singleFlight: options.singleFlight === undefined ? true : options.singleFlight,\n submissions\n };\n function navigateFromRoute(route, to, options) {\n // Untrack in case someone navigates in an effect - don't want to track `reference` or route paths\n untrack(() => {\n if (typeof to === \"number\") {\n if (!to) {\n // A delta of 0 means stay at the current location, so it is ignored\n }\n else if (utils.go) {\n utils.go(to);\n }\n else {\n console.warn(\"Router integration does not support relative routing\");\n }\n return;\n }\n const { replace, resolve, scroll, state: nextState } = {\n replace: false,\n resolve: true,\n scroll: true,\n ...options\n };\n const resolvedTo = resolve ? route.resolvePath(to) : resolvePath(\"\", to);\n if (resolvedTo === undefined) {\n throw new Error(`Path '${to}' is not a routable path`);\n }\n else if (referrers.length >= MAX_REDIRECTS) {\n throw new Error(\"Too many redirects\");\n }\n const current = reference();\n if (resolvedTo !== current || nextState !== state()) {\n if (isServer) {\n const e = getRequestEvent();\n e && (e.response = { status: 302, headers: new Headers({ Location: resolvedTo }) });\n setSource({ value: resolvedTo, replace, scroll, state: nextState });\n }\n else if (beforeLeave.confirm(resolvedTo, options)) {\n const len = referrers.push({ value: current, replace, scroll, state: state() });\n start(() => {\n intent = \"navigate\";\n setReference(resolvedTo);\n setState(nextState);\n resetErrorBoundaries();\n submissions[1]([]);\n }).then(() => {\n if (referrers.length === len) {\n intent = undefined;\n navigateEnd({\n value: resolvedTo,\n state: nextState\n });\n }\n });\n }\n }\n });\n }\n function navigatorFactory(route) {\n // Workaround for vite issue (https://github.com/vitejs/vite/issues/3803)\n route = route || useContext(RouteContextObj) || baseRoute;\n return (to, options) => navigateFromRoute(route, to, options);\n }\n function navigateEnd(next) {\n const first = referrers[0];\n if (first) {\n if (next.value !== first.value || next.state !== first.state) {\n setSource({\n ...next,\n replace: first.replace,\n scroll: first.scroll\n });\n }\n referrers.length = 0;\n }\n }\n function preloadRoute(url, preloadData) {\n const matches = getRouteMatches(branches(), url.pathname);\n const prevIntent = intent;\n intent = \"preload\";\n for (let match in matches) {\n const { route, params } = matches[match];\n route.component &&\n route.component.preload &&\n route.component.preload();\n const { load } = route;\n preloadData &&\n load &&\n runWithOwner(getContext(), () => load({\n params,\n location: {\n pathname: url.pathname,\n search: url.search,\n hash: url.hash,\n query: extractSearchParams(url),\n state: null,\n key: \"\"\n },\n intent: \"preload\"\n }));\n }\n intent = prevIntent;\n }\n function initFromFlash() {\n const e = getRequestEvent();\n return (e && e.router && e.router.submission\n ? [e.router.submission]\n : []);\n }\n}\nexport function createRouteContext(router, parent, outlet, match) {\n const { base, location, params } = router;\n const { pattern, component, load } = match().route;\n const path = createMemo(() => match().path);\n component &&\n component.preload &&\n component.preload();\n const data = load ? load({ params, location, intent: intent || \"initial\" }) : undefined;\n const route = {\n parent,\n pattern,\n path,\n outlet: () => component\n ? createComponent(component, {\n params,\n location,\n data,\n get children() {\n return outlet();\n }\n })\n : outlet(),\n resolvePath(to) {\n return resolvePath(base.path(), to, path());\n }\n };\n return route;\n}\n","/*@refresh skip*/\nimport { getRequestEvent, isServer } from \"solid-js/web\";\nimport { children, createMemo, createRoot, getOwner, mergeProps, on, Show, untrack } from \"solid-js\";\nimport { createBranches, createRouteContext, createRouterContext, getRouteMatches, RouteContextObj, RouterContextObj } from \"../routing.js\";\nexport const createRouterComponent = (router) => (props) => {\n const { base } = props;\n const routeDefs = children(() => props.children);\n const branches = createMemo(() => createBranches(routeDefs(), props.base || \"\"));\n let context;\n const routerState = createRouterContext(router, branches, () => context, {\n base,\n singleFlight: props.singleFlight\n });\n router.create && router.create(routerState);\n return (\n \n {(context = getOwner()) && null}\n \n \n );\n};\nfunction Root(props) {\n const location = props.routerState.location;\n const params = props.routerState.params;\n const data = createMemo(() => props.load && untrack(() => props.load({ params, location, intent: \"preload\" })));\n return (\n {Root => (\n {props.children}\n )}\n );\n}\nfunction Routes(props) {\n if (isServer) {\n const e = getRequestEvent();\n if (e && e.router && e.router.dataOnly) {\n dataOnly(e, props.routerState, props.branches);\n return;\n }\n e &&\n ((e.router || (e.router = {})).matches ||\n (e.router.matches = props.routerState.matches().map(({ route, path, params }) => ({\n path: route.originalPath,\n pattern: route.pattern,\n match: path,\n params,\n info: route.info\n }))));\n }\n const disposers = [];\n let root;\n const routeStates = createMemo(on(props.routerState.matches, (nextMatches, prevMatches, prev) => {\n let equal = prevMatches && nextMatches.length === prevMatches.length;\n const next = [];\n for (let i = 0, len = nextMatches.length; i < len; i++) {\n const prevMatch = prevMatches && prevMatches[i];\n const nextMatch = nextMatches[i];\n if (prev && prevMatch && nextMatch.route.key === prevMatch.route.key) {\n next[i] = prev[i];\n }\n else {\n equal = false;\n if (disposers[i]) {\n disposers[i]();\n }\n createRoot(dispose => {\n disposers[i] = dispose;\n next[i] = createRouteContext(props.routerState, next[i - 1] || props.routerState.base, createOutlet(() => routeStates()[i + 1]), () => props.routerState.matches()[i]);\n });\n }\n }\n disposers.splice(nextMatches.length).forEach(dispose => dispose());\n if (prev && equal) {\n return prev;\n }\n root = next[0];\n return next;\n }));\n return createOutlet(() => routeStates() && root)();\n}\nconst createOutlet = (child) => {\n return () => (\n {child => {child.outlet()}}\n );\n};\nexport const Route = (props) => {\n const childRoutes = children(() => props.children);\n return mergeProps(props, {\n get children() {\n return childRoutes();\n }\n });\n};\n// for data only mode with single flight mutations\nfunction dataOnly(event, routerState, branches) {\n const url = new URL(event.request.url);\n const prevMatches = getRouteMatches(branches, new URL(event.router.previousUrl || event.request.url).pathname);\n const matches = getRouteMatches(branches, url.pathname);\n for (let match = 0; match < matches.length; match++) {\n if (!prevMatches[match] || matches[match].route !== prevMatches[match].route)\n event.router.dataOnly = true;\n const { route, params } = matches[match];\n route.load &&\n route.load({\n params,\n location: routerState.location,\n intent: \"preload\"\n });\n }\n}\n","import { createSignal, onCleanup } from \"solid-js\";\nimport { createRouterComponent } from \"./components.jsx\";\nfunction intercept([value, setValue], get, set) {\n return [get ? () => get(value()) : value, set ? (v) => setValue(set(v)) : setValue];\n}\nfunction querySelector(selector) {\n if (selector === \"#\") {\n return null;\n }\n // Guard against selector being an invalid CSS selector\n try {\n return document.querySelector(selector);\n }\n catch (e) {\n return null;\n }\n}\nexport function createRouter(config) {\n let ignore = false;\n const wrap = (value) => (typeof value === \"string\" ? { value } : value);\n const signal = intercept(createSignal(wrap(config.get()), { equals: (a, b) => a.value === b.value }), undefined, next => {\n !ignore && config.set(next);\n return next;\n });\n config.init &&\n onCleanup(config.init((value = config.get()) => {\n ignore = true;\n signal[1](wrap(value));\n ignore = false;\n }));\n return createRouterComponent({\n signal,\n create: config.create,\n utils: config.utils\n });\n}\nexport function bindEvent(target, type, handler) {\n target.addEventListener(type, handler);\n return () => target.removeEventListener(type, handler);\n}\nexport function scrollToHash(hash, fallbackTop) {\n const el = querySelector(`#${hash}`);\n if (el) {\n el.scrollIntoView();\n }\n else if (fallbackTop) {\n window.scrollTo(0, 0);\n }\n}\n","import { $TRACK, createMemo, createSignal, onCleanup, getOwner } from \"solid-js\";\nimport { isServer } from \"solid-js/web\";\nimport { useRouter } from \"../routing.js\";\nimport { mockBase } from \"../utils.js\";\nimport { cacheKeyOp, hashKey, revalidate, cache } from \"./cache.js\";\nexport const actions = /* #__PURE__ */ new Map();\nexport function useSubmissions(fn, filter) {\n const router = useRouter();\n const subs = createMemo(() => router.submissions[0]().filter(s => s.url === fn.toString() && (!filter || filter(s.input))));\n return new Proxy([], {\n get(_, property) {\n if (property === $TRACK)\n return subs();\n if (property === \"pending\")\n return subs().some(sub => !sub.result);\n return subs()[property];\n }\n });\n}\nexport function useSubmission(fn, filter) {\n const submissions = useSubmissions(fn, filter);\n return new Proxy({}, {\n get(_, property) {\n return submissions[submissions.length - 1]?.[property];\n }\n });\n}\nexport function useAction(action) {\n const r = useRouter();\n return (...args) => action.apply({ r }, args);\n}\nexport function action(fn, name) {\n function mutate(...variables) {\n const router = this.r;\n const form = this.f;\n const p = (router.singleFlight && fn.withOptions\n ? fn.withOptions({ headers: { \"X-Single-Flight\": \"true\" } })\n : fn)(...variables);\n const [result, setResult] = createSignal();\n let submission;\n function handler(error) {\n return async (res) => {\n const result = await handleResponse(res, error, router.navigatorFactory());\n if (!result)\n return submission.clear();\n setResult(result);\n if (result.error && !form)\n throw result.error;\n return result.data;\n };\n }\n router.submissions[1](s => [\n ...s,\n (submission = {\n input: variables,\n url,\n get result() {\n return result()?.data;\n },\n get error() {\n return result()?.error;\n },\n get pending() {\n return !result();\n },\n clear() {\n router.submissions[1](v => v.filter(i => i.input !== variables));\n },\n retry() {\n setResult(undefined);\n const p = fn(...variables);\n return p.then(handler(), handler(true));\n }\n })\n ]);\n return p.then(handler(), handler(true));\n }\n const url = fn.url ||\n (name && `https://action/${name}`) ||\n (!isServer ? `https://action/${hashString(fn.toString())}` : \"\");\n return toAction(mutate, url);\n}\nfunction toAction(fn, url) {\n fn.toString = () => {\n if (!url)\n throw new Error(\"Client Actions need explicit names if server rendered\");\n return url;\n };\n fn.with = function (...args) {\n const newFn = function (...passedArgs) {\n return fn.call(this, ...args, ...passedArgs);\n };\n const uri = new URL(url, mockBase);\n uri.searchParams.set(\"args\", hashKey(args));\n return toAction(newFn, (uri.origin === \"https://action\" ? uri.origin : \"\") + uri.pathname + uri.search);\n };\n fn.url = url;\n if (!isServer) {\n actions.set(url, fn);\n getOwner() && onCleanup(() => actions.delete(url));\n }\n return fn;\n}\nconst hashString = (s) => s.split(\"\").reduce((a, b) => ((a << 5) - a + b.charCodeAt(0)) | 0, 0);\nasync function handleResponse(response, error, navigate) {\n let data;\n let keys;\n let invalidateKeys;\n if (response instanceof Response) {\n if (response.headers.has(\"X-Revalidate\"))\n keys = invalidateKeys = response.headers.get(\"X-Revalidate\").split(\",\");\n if (response.customBody) {\n data = await response.customBody();\n if (response.headers.has(\"X-Single-Flight\")) {\n keys || (keys = []);\n invalidateKeys || (invalidateKeys = []);\n Object.keys(data).forEach(key => {\n if (key === \"_$value\")\n return;\n keys.push(key);\n cache.set(key, data[key]);\n });\n data = data._$value;\n }\n }\n if (response.headers.has(\"Location\")) {\n const locationUrl = response.headers.get(\"Location\") || \"/\";\n if (locationUrl.startsWith(\"http\")) {\n window.location.href = locationUrl;\n }\n else {\n navigate(locationUrl);\n }\n }\n }\n else if (error)\n return { error: response };\n else\n data = response;\n // invalidate\n cacheKeyOp(invalidateKeys, entry => (entry[0] = 0));\n // trigger revalidation\n await revalidate(keys, false);\n return data != null ? { data } : undefined;\n}\n","import { delegateEvents } from \"solid-js/web\";\nimport { onCleanup } from \"solid-js\";\nimport { actions } from \"./action.js\";\nimport { mockBase } from \"../utils.js\";\nexport function setupNativeEvents(preload = true, explicitLinks = false, actionBase = \"/_server\") {\n return (router) => {\n const basePath = router.base.path();\n const navigateFromRoute = router.navigatorFactory(router.base);\n let preloadTimeout = {};\n function isSvg(el) {\n return el.namespaceURI === \"http://www.w3.org/2000/svg\";\n }\n function handleAnchor(evt) {\n if (evt.defaultPrevented ||\n evt.button !== 0 ||\n evt.metaKey ||\n evt.altKey ||\n evt.ctrlKey ||\n evt.shiftKey)\n return;\n const a = evt\n .composedPath()\n .find(el => el instanceof Node && el.nodeName.toUpperCase() === \"A\");\n if (!a || (explicitLinks && !a.hasAttribute(\"link\")))\n return;\n const svg = isSvg(a);\n const href = svg ? a.href.baseVal : a.href;\n const target = svg ? a.target.baseVal : a.target;\n if (target || (!href && !a.hasAttribute(\"state\")))\n return;\n const rel = (a.getAttribute(\"rel\") || \"\").split(/\\s+/);\n if (a.hasAttribute(\"download\") || (rel && rel.includes(\"external\")))\n return;\n const url = svg ? new URL(href, document.baseURI) : new URL(href);\n if (url.origin !== window.location.origin ||\n (basePath && url.pathname && !url.pathname.toLowerCase().startsWith(basePath.toLowerCase())))\n return;\n return [a, url];\n }\n function handleAnchorClick(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n const to = router.parsePath(url.pathname + url.search + url.hash);\n const state = a.getAttribute(\"state\");\n evt.preventDefault();\n navigateFromRoute(to, {\n resolve: false,\n replace: a.hasAttribute(\"replace\"),\n scroll: !a.hasAttribute(\"noscroll\"),\n state: state && JSON.parse(state)\n });\n }\n function handleAnchorPreload(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n if (!preloadTimeout[url.pathname])\n router.preloadRoute(url, a.getAttribute(\"preload\") !== \"false\");\n }\n function handleAnchorIn(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n if (preloadTimeout[url.pathname])\n return;\n preloadTimeout[url.pathname] = setTimeout(() => {\n router.preloadRoute(url, a.getAttribute(\"preload\") !== \"false\");\n delete preloadTimeout[url.pathname];\n }, 200);\n }\n function handleAnchorOut(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [, url] = res;\n if (preloadTimeout[url.pathname]) {\n clearTimeout(preloadTimeout[url.pathname]);\n delete preloadTimeout[url.pathname];\n }\n }\n function handleFormSubmit(evt) {\n let actionRef = evt.submitter && evt.submitter.hasAttribute(\"formaction\")\n ? evt.submitter.getAttribute(\"formaction\")\n : evt.target.getAttribute(\"action\");\n if (!actionRef)\n return;\n if (!actionRef.startsWith(\"https://action/\")) {\n // normalize server actions\n const url = new URL(actionRef, mockBase);\n actionRef = router.parsePath(url.pathname + url.search);\n if (!actionRef.startsWith(actionBase))\n return;\n }\n if (evt.target.method.toUpperCase() !== \"POST\")\n throw new Error(\"Only POST forms are supported for Actions\");\n const handler = actions.get(actionRef);\n if (handler) {\n evt.preventDefault();\n const data = new FormData(evt.target);\n if (evt.submitter && evt.submitter.name)\n data.append(evt.submitter.name, evt.submitter.value);\n handler.call({ r: router, f: evt.target }, data);\n }\n }\n // ensure delegated event run first\n delegateEvents([\"click\", \"submit\"]);\n document.addEventListener(\"click\", handleAnchorClick);\n if (preload) {\n document.addEventListener(\"mouseover\", handleAnchorIn);\n document.addEventListener(\"mouseout\", handleAnchorOut);\n document.addEventListener(\"focusin\", handleAnchorPreload);\n document.addEventListener(\"touchstart\", handleAnchorPreload);\n }\n document.addEventListener(\"submit\", handleFormSubmit);\n onCleanup(() => {\n document.removeEventListener(\"click\", handleAnchorClick);\n if (preload) {\n document.removeEventListener(\"mouseover\", handleAnchorIn);\n document.removeEventListener(\"mouseout\", handleAnchorOut);\n document.removeEventListener(\"focusin\", handleAnchorPreload);\n document.removeEventListener(\"touchstart\", handleAnchorPreload);\n }\n document.removeEventListener(\"submit\", handleFormSubmit);\n });\n };\n}\n","import { setupNativeEvents } from \"../data/events.js\";\nimport { createRouter, scrollToHash, bindEvent } from \"./createRouter.js\";\nimport { createBeforeLeave, keepDepth, notifyIfNotBlocked, saveCurrentDepth } from \"../lifecycle.js\";\nexport function hashParser(str) {\n const to = str.replace(/^.*?#/, \"\");\n // Hash-only hrefs like `#foo` from plain anchors will come in as `/#foo` whereas a link to\n // `/foo` will be `/#/foo`. Check if the to starts with a `/` and if not append it as a hash\n // to the current path so we can handle these in-page anchors correctly.\n if (!to.startsWith(\"/\")) {\n const [, path = \"/\"] = window.location.hash.split(\"#\", 2);\n return `${path}#${to}`;\n }\n return to;\n}\nexport function HashRouter(props) {\n const getSource = () => window.location.hash.slice(1);\n const beforeLeave = createBeforeLeave();\n return createRouter({\n get: getSource,\n set({ value, replace, scroll, state }) {\n if (replace) {\n window.history.replaceState(keepDepth(state), \"\", \"#\" + value);\n }\n else {\n window.location.hash = value;\n }\n const hashIndex = value.indexOf(\"#\");\n const hash = hashIndex >= 0 ? value.slice(hashIndex + 1) : \"\";\n scrollToHash(hash, scroll);\n saveCurrentDepth();\n },\n init: notify => bindEvent(window, \"hashchange\", notifyIfNotBlocked(notify, delta => !beforeLeave.confirm(delta && delta < 0 ? delta : getSource()))),\n create: setupNativeEvents(props.preload, props.explicitLinks, props.actionBase),\n utils: {\n go: delta => window.history.go(delta),\n renderPath: path => `#${path}`,\n parsePath: hashParser,\n beforeLeave\n }\n })(props);\n}\n","import { DEV, equalFn, untrack, getOwner, onCleanup, createSignal, sharedConfig, onMount } from 'solid-js';\nimport { isServer } from 'solid-js/web';\nexport { isServer } from 'solid-js/web';\n\n// src/index.ts\nvar isClient = !isServer;\nvar isDev = isClient && !!DEV;\nvar isProd = !isDev;\nvar noop = () => void 0;\nvar trueFn = () => true;\nvar falseFn = () => false;\nvar defaultEquals = equalFn;\nvar EQUALS_FALSE_OPTIONS = { equals: false };\nvar INTERNAL_OPTIONS = { internal: true };\nvar ofClass = (v, c) => v instanceof c || v && v.constructor === c;\nfunction isObject(value) {\n return value !== null && (typeof value === \"object\" || typeof value === \"function\");\n}\nvar isNonNullable = (i) => i != null;\nvar filterNonNullable = (arr) => arr.filter(isNonNullable);\nvar compare = (a, b) => a < b ? -1 : a > b ? 1 : 0;\nvar arrayEquals = (a, b) => a === b || a.length === b.length && a.every((e, i) => e === b[i]);\nfunction chain(callbacks) {\n return (...args) => {\n for (const callback of callbacks)\n callback && callback(...args);\n };\n}\nfunction reverseChain(callbacks) {\n return (...args) => {\n for (let i = callbacks.length - 1; i >= 0; i--) {\n const callback = callbacks[i];\n callback && callback(...args);\n }\n };\n}\nvar clamp = (n, min, max) => Math.min(Math.max(n, min), max);\nvar access = (v) => typeof v === \"function\" && !v.length ? v() : v;\nvar asArray = (value) => Array.isArray(value) ? value : value ? [value] : [];\nvar accessArray = (list) => list.map((v) => access(v));\nvar withAccess = (value, fn) => {\n const _value = access(value);\n typeof _value != null && fn(_value);\n};\nvar asAccessor = (v) => typeof v === \"function\" ? v : () => v;\nfunction accessWith(valueOrFn, ...args) {\n return typeof valueOrFn === \"function\" ? valueOrFn(...args) : valueOrFn;\n}\nfunction defer(deps, fn, initialValue) {\n const isArray = Array.isArray(deps);\n let prevInput;\n let shouldDefer = true;\n return (prevValue) => {\n let input;\n if (isArray) {\n input = Array(deps.length);\n for (let i = 0; i < deps.length; i++)\n input[i] = deps[i]();\n } else\n input = deps();\n if (shouldDefer) {\n shouldDefer = false;\n prevInput = input;\n return initialValue;\n }\n const result = untrack(() => fn(input, prevInput, prevValue));\n prevInput = input;\n return result;\n };\n}\nvar entries = Object.entries;\nvar keys = Object.keys;\nvar tryOnCleanup = isDev ? (fn) => getOwner() ? onCleanup(fn) : fn : onCleanup;\nvar createCallbackStack = () => {\n let stack = [];\n const clear = () => stack = [];\n return {\n push: (...callbacks) => stack.push(...callbacks),\n execute(arg0, arg1, arg2, arg3) {\n stack.forEach((cb) => cb(arg0, arg1, arg2, arg3));\n clear();\n },\n clear\n };\n};\nfunction createMicrotask(fn) {\n let calls = 0;\n let args;\n onCleanup(() => calls = 0);\n return (...a) => {\n args = a, calls++;\n queueMicrotask(() => --calls === 0 && fn(...args));\n };\n}\nfunction createHydratableSignal(serverValue, update, options) {\n if (isServer) {\n return createSignal(serverValue, options);\n }\n if (sharedConfig.context) {\n const [state, setState] = createSignal(serverValue, options);\n onMount(() => setState(() => update()));\n return [state, setState];\n }\n return createSignal(update(), options);\n}\nvar createHydrateSignal = createHydratableSignal;\nfunction handleDiffArray(current, prev, handleAdded, handleRemoved) {\n const currLength = current.length;\n const prevLength = prev.length;\n let i = 0;\n if (!prevLength) {\n for (; i < currLength; i++)\n handleAdded(current[i]);\n return;\n }\n if (!currLength) {\n for (; i < prevLength; i++)\n handleRemoved(prev[i]);\n return;\n }\n for (; i < prevLength; i++) {\n if (prev[i] !== current[i])\n break;\n }\n let prevEl;\n let currEl;\n prev = prev.slice(i);\n current = current.slice(i);\n for (prevEl of prev) {\n if (!current.includes(prevEl))\n handleRemoved(prevEl);\n }\n for (currEl of current) {\n if (!prev.includes(currEl))\n handleAdded(currEl);\n }\n}\n\nexport { EQUALS_FALSE_OPTIONS, INTERNAL_OPTIONS, access, accessArray, accessWith, arrayEquals, asAccessor, asArray, chain, clamp, compare, createCallbackStack, createHydratableSignal, createHydrateSignal, createMicrotask, defaultEquals, defer, entries, falseFn, filterNonNullable, handleDiffArray, isClient, isDev, isNonNullable, isObject, isProd, keys, noop, ofClass, reverseChain, trueFn, tryOnCleanup, withAccess };\n","import { tryOnCleanup, entries, createCallbackStack, asArray, access, keys } from '@solid-primitives/utils';\nimport { createEffect, createRenderEffect, createSignal, onCleanup } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/eventListener.ts\nfunction makeEventListener(target, type, handler, options) {\n target.addEventListener(type, handler, options);\n return tryOnCleanup(target.removeEventListener.bind(target, type, handler, options));\n}\nfunction createEventListener(targets, type, handler, options) {\n if (isServer)\n return;\n const attachListeners = () => {\n asArray(access(targets)).forEach((el) => {\n if (el)\n asArray(access(type)).forEach((type2) => makeEventListener(el, type2, handler, options));\n });\n };\n if (typeof targets === \"function\")\n createEffect(attachListeners);\n else\n createRenderEffect(attachListeners);\n}\nfunction createEventSignal(target, type, options) {\n if (isServer) {\n return () => void 0;\n }\n const [lastEvent, setLastEvent] = createSignal();\n createEventListener(target, type, setLastEvent, options);\n return lastEvent;\n}\nvar eventListener = (target, props) => {\n createEffect(() => {\n const [type, handler, options] = props();\n makeEventListener(target, type, handler, options);\n });\n};\nfunction createEventListenerMap(targets, handlersMap, options) {\n if (isServer) {\n return;\n }\n for (const [eventName, handler] of entries(handlersMap)) {\n if (handler)\n createEventListener(targets, eventName, handler, options);\n }\n}\nvar attachPropListeners = (target, props) => {\n keys(props).forEach((attr) => {\n if (attr.startsWith(\"on\") && typeof props[attr] === \"function\")\n makeEventListener(target, attr.substring(2).toLowerCase(), props[attr]);\n });\n};\nvar WindowEventListener = (props) => {\n if (isServer)\n return null;\n attachPropListeners(window, props);\n};\nvar DocumentEventListener = (props) => {\n if (isServer)\n return null;\n attachPropListeners(document, props);\n};\nfunction makeEventListenerStack(target, options) {\n if (isServer) {\n return [() => () => void 0, () => void 0];\n }\n const { push, execute } = createCallbackStack();\n return [\n (type, handler, overwriteOptions) => {\n const clear = makeEventListener(target, type, handler, overwriteOptions ?? options);\n push(clear);\n return clear;\n },\n onCleanup(execute)\n ];\n}\n\n// src/callbackWrappers.ts\nvar preventDefault = (callback) => (e) => {\n e.preventDefault();\n callback(e);\n};\nvar stopPropagation = (callback) => (e) => {\n e.stopPropagation();\n callback(e);\n};\nvar stopImmediatePropagation = (callback) => (e) => {\n e.stopImmediatePropagation();\n callback(e);\n};\n\nexport { DocumentEventListener, WindowEventListener, createEventListener, createEventListenerMap, createEventSignal, eventListener, makeEventListener, makeEventListenerStack, preventDefault, stopImmediatePropagation, stopPropagation };\n","import { getOwner, createRoot, runWithOwner, onCleanup, sharedConfig, createSignal, batch } from 'solid-js';\nimport { isServer } from 'solid-js/web';\nimport { asArray, access, trueFn, noop, createMicrotask } from '@solid-primitives/utils';\n\n// src/index.ts\nfunction createSubRoot(fn, ...owners) {\n if (owners.length === 0)\n owners = [getOwner()];\n return createRoot((dispose) => {\n asArray(access(owners)).forEach(\n (owner) => owner && runWithOwner(owner, onCleanup.bind(void 0, dispose))\n );\n return fn(dispose);\n }, owners[0]);\n}\nvar createBranch = createSubRoot;\nvar createCallback = (callback, owner = getOwner()) => owner ? (...args) => runWithOwner(owner, () => callback(...args)) : callback;\nfunction createDisposable(fn, ...owners) {\n return createSubRoot(\n (dispose) => {\n fn(dispose);\n return dispose;\n },\n ...owners\n );\n}\nfunction createSingletonRoot(factory, detachedOwner = getOwner()) {\n let listeners = 0, value, disposeRoot;\n return () => {\n listeners++;\n onCleanup(() => {\n listeners--;\n queueMicrotask(() => {\n if (!listeners && disposeRoot) {\n disposeRoot();\n disposeRoot = value = void 0;\n }\n });\n });\n if (!disposeRoot) {\n createRoot((dispose) => value = factory(disposeRoot = dispose), detachedOwner);\n }\n return value;\n };\n}\nvar createSharedRoot = createSingletonRoot;\nfunction createHydratableSingletonRoot(factory) {\n const owner = getOwner();\n const singleton = createSingletonRoot(factory, owner);\n return () => isServer || sharedConfig.context ? createRoot(factory, owner) : singleton();\n}\nfunction createRootPool(factory, options = {}) {\n if (isServer) {\n const owner2 = getOwner();\n return (args) => createRoot((dispose) => factory(() => args, trueFn, dispose), owner2);\n }\n let length = 0;\n const { limit = 100 } = options, pool = new Array(limit), owner = getOwner(), mapRoot = factory.length > 1 ? (dispose, [args, set]) => {\n const [active, setA] = createSignal(true);\n const root = {\n dispose,\n set,\n setA,\n active,\n v: factory(args, active, () => disposeRoot(root))\n };\n return root;\n } : (dispose, [args, set]) => ({\n dispose,\n set,\n setA: trueFn,\n active: trueFn,\n v: factory(args, trueFn, noop)\n }), limitPool = createMicrotask(() => {\n if (length > limit) {\n for (let i = limit; i < length; i++) {\n pool[i].dispose();\n pool[i] = void 0;\n }\n length = limit;\n }\n }), cleanupRoot = (root) => {\n if (root.dispose !== noop) {\n pool[length++] = root;\n root.setA(false);\n limitPool();\n }\n }, disposeRoot = (root) => {\n root.dispose();\n root.dispose = noop;\n if (root.active())\n root.setA(false);\n else {\n pool[pool.indexOf(root)] = pool[--length];\n pool[length] = void 0;\n }\n };\n onCleanup(() => {\n for (let i = 0; i < length; i++)\n pool[i].dispose();\n length = 0;\n });\n return (arg) => {\n let root;\n if (length) {\n root = pool[--length];\n pool[length] = void 0;\n batch(() => {\n root.set(() => arg);\n root.setA(true);\n });\n } else\n root = createRoot((dispose) => mapRoot(dispose, createSignal(arg)), owner);\n onCleanup(() => cleanupRoot(root));\n return root.v;\n };\n}\n\nexport { createBranch, createCallback, createDisposable, createHydratableSingletonRoot, createRootPool, createSharedRoot, createSingletonRoot, createSubRoot };\n","import { makeEventListener } from '@solid-primitives/event-listener';\nimport { createSingletonRoot } from '@solid-primitives/rootless';\nimport { arrayEquals } from '@solid-primitives/utils';\nimport { createSignal, untrack, createMemo, createEffect, on } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/index.ts\nfunction equalsKeyHoldSequence(sequence, model) {\n for (let i = sequence.length - 1; i >= 0; i--) {\n const _model = model.slice(0, i + 1);\n if (!arrayEquals(sequence[i], _model))\n return false;\n }\n return true;\n}\nvar useKeyDownEvent = /* @__PURE__ */ createSingletonRoot(\n () => {\n if (isServer) {\n return () => null;\n }\n const [event, setEvent] = createSignal(null);\n makeEventListener(window, \"keydown\", (e) => {\n setEvent(e);\n setTimeout(() => setEvent(null));\n });\n return event;\n }\n);\nvar useKeyDownList = /* @__PURE__ */ createSingletonRoot(() => {\n if (isServer) {\n const keys = () => [];\n keys[0] = keys;\n keys[1] = { event: () => null };\n keys[Symbol.iterator] = function* () {\n yield keys[0];\n yield keys[1];\n };\n return keys;\n }\n const [pressedKeys, setPressedKeys] = createSignal([]), reset = () => setPressedKeys([]), event = useKeyDownEvent();\n makeEventListener(window, \"keydown\", (e) => {\n if (e.repeat || typeof e.key !== \"string\")\n return;\n const key = e.key.toUpperCase(), currentKeys = pressedKeys();\n if (currentKeys.includes(key))\n return;\n const keys = [...currentKeys, key];\n if (currentKeys.length === 0 && key !== \"ALT\" && key !== \"CONTROL\" && key !== \"META\" && key !== \"SHIFT\") {\n if (e.shiftKey)\n keys.unshift(\"SHIFT\");\n if (e.altKey)\n keys.unshift(\"ALT\");\n if (e.ctrlKey)\n keys.unshift(\"CONTROL\");\n if (e.metaKey)\n keys.unshift(\"META\");\n }\n setPressedKeys(keys);\n });\n makeEventListener(window, \"keyup\", (e) => {\n if (typeof e.key !== \"string\")\n return;\n const key = e.key.toUpperCase();\n setPressedKeys((prev) => prev.filter((_key) => _key !== key));\n });\n makeEventListener(window, \"blur\", reset);\n makeEventListener(window, \"contextmenu\", (e) => {\n e.defaultPrevented || reset();\n });\n pressedKeys[0] = pressedKeys;\n pressedKeys[1] = { event };\n pressedKeys[Symbol.iterator] = function* () {\n yield pressedKeys[0];\n yield pressedKeys[1];\n };\n return pressedKeys;\n});\nvar useCurrentlyHeldKey = /* @__PURE__ */ createSingletonRoot(\n () => {\n if (isServer) {\n return () => null;\n }\n const keys = useKeyDownList();\n let prevKeys = untrack(keys);\n return createMemo(() => {\n const _keys = keys();\n const prev = prevKeys;\n prevKeys = _keys;\n if (prev.length === 0 && _keys.length === 1)\n return _keys[0];\n return null;\n });\n }\n);\nvar useKeyDownSequence = /* @__PURE__ */ createSingletonRoot(() => {\n if (isServer) {\n return () => [];\n }\n const keys = useKeyDownList();\n return createMemo((prev) => {\n if (keys().length === 0)\n return [];\n return [...prev, keys()];\n }, []);\n});\nfunction createKeyHold(key, options = {}) {\n if (isServer) {\n return () => false;\n }\n key = key.toUpperCase();\n const { preventDefault = true } = options, event = useKeyDownEvent(), heldKey = useCurrentlyHeldKey();\n return createMemo(() => heldKey() === key && (preventDefault && event()?.preventDefault(), true));\n}\nfunction createShortcut(keys, callback, options = {}) {\n if (isServer || !keys.length) {\n return;\n }\n keys = keys.map((key) => key.toUpperCase());\n const { preventDefault = true } = options, event = useKeyDownEvent(), sequence = useKeyDownSequence();\n let reset = false;\n const handleSequenceWithReset = (sequence2) => {\n if (!sequence2.length)\n return reset = false;\n if (reset)\n return;\n const e = event();\n if (sequence2.length < keys.length) {\n if (equalsKeyHoldSequence(sequence2, keys.slice(0, sequence2.length))) {\n preventDefault && e && e.preventDefault();\n } else {\n reset = true;\n }\n } else {\n reset = true;\n if (equalsKeyHoldSequence(sequence2, keys)) {\n preventDefault && e && e.preventDefault();\n callback(e);\n }\n }\n };\n const handleSequenceWithoutReset = (sequence2) => {\n const last = sequence2.at(-1);\n if (!last)\n return;\n const e = event();\n if (preventDefault && last.length < keys.length) {\n if (arrayEquals(last, keys.slice(0, keys.length - 1))) {\n e && e.preventDefault();\n }\n return;\n }\n if (arrayEquals(last, keys)) {\n const prev = sequence2.at(-2);\n if (!prev || arrayEquals(prev, keys.slice(0, keys.length - 1))) {\n preventDefault && e && e.preventDefault();\n callback(e);\n }\n }\n };\n createEffect(\n on(sequence, options.requireReset ? handleSequenceWithReset : handleSequenceWithoutReset)\n );\n}\n\nexport { createKeyHold, createShortcut, useCurrentlyHeldKey, useKeyDownEvent, useKeyDownList, useKeyDownSequence };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nexport function isFunc(item) {\n return typeof item === 'function';\n}\nexport function isObject(item) {\n return typeof item === 'object';\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function isArray(item) {\n return Array.isArray(item);\n}\nexport function isString(item) {\n return typeof item === 'string';\n}\nexport function isNumber(item) {\n return typeof item === 'number';\n}\nexport function isInteger(item) {\n return Number.isInteger(item);\n}\nexport function keyExists(obj, keys) {\n for (const key of keys) {\n if (key in obj) {\n return true;\n }\n }\n return false;\n}\n/**\n * Asserts a condition is truthy, otherwise throws an error\n *\n * @remarks\n * Useful at the top of functions to ensure certain conditions, arguments and\n * properties are set/met before continuing. When using this function,\n * TypeScript will narrow away falsy types from the condition.\n *\n * @param condition\n * @param message\n * @returns\n */\nexport function assertTruthy(condition, message) {\n if (!condition) {\n throw new Error(message || 'Assertion failed');\n }\n}\n//# sourceMappingURL=utils.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { createEffect, on, createSignal, untrack, } from 'solid-js';\nimport { useKeyDownEvent } from '@solid-primitives/keyboard';\nimport { activeElement, ElementNode } from '@lightningjs/solid';\nimport { isFunc, isArray } from './utils.js';\nconst keyMapEntries = {\n ArrowLeft: 'Left',\n ArrowRight: 'Right',\n ArrowUp: 'Up',\n ArrowDown: 'Down',\n Enter: 'Enter',\n l: 'Last',\n ' ': 'Space',\n Backspace: 'Back',\n Escape: 'Escape',\n};\nconst [focusPath, setFocusPath] = createSignal([]);\nexport { focusPath };\nexport const useFocusManager = (userKeyMap) => {\n const keypressEvent = useKeyDownEvent();\n if (userKeyMap) {\n // Flatten the userKeyMap to a hash\n for (const [key, value] of Object.entries(userKeyMap)) {\n if (isArray(value)) {\n value.forEach((v) => {\n keyMapEntries[v] = key;\n });\n }\n else {\n keyMapEntries[value] = key;\n }\n }\n }\n createEffect(on(activeElement, (currentFocusedElm, prevFocusedElm, prevFocusPath = []) => {\n const newFocusedElms = [];\n let current = currentFocusedElm;\n const fp = [];\n while (current) {\n if (!current.states.has('focus')) {\n current.states.add('focus');\n isFunc(current.onFocus) &&\n current.onFocus.call(current, currentFocusedElm, prevFocusedElm);\n newFocusedElms.push(current);\n }\n fp.push(current);\n current = current.parent;\n }\n prevFocusPath.forEach((elm) => {\n if (!fp.includes(elm)) {\n elm.states.remove('focus');\n isFunc(elm.onBlur) &&\n elm.onBlur.call(elm, currentFocusedElm, prevFocusedElm);\n }\n });\n setFocusPath(fp);\n return fp;\n }, { defer: true }));\n createEffect(() => {\n const e = keypressEvent();\n if (e) {\n // Search keyMap for the value of the pressed key or keyCode if value undefined\n const mappedKeyEvent = keyMapEntries[e.key] || keyMapEntries[e.keyCode];\n untrack(() => {\n const fp = focusPath();\n let finalFocusElm = undefined;\n for (const elm of fp) {\n finalFocusElm = finalFocusElm || elm;\n if (mappedKeyEvent) {\n const onKeyHandler = elm[`on${mappedKeyEvent}`];\n if (isFunc(onKeyHandler)) {\n if (onKeyHandler.call(elm, e, elm, finalFocusElm) === true) {\n break;\n }\n }\n }\n else {\n console.log(`Unhandled key event: ${e.key}`);\n }\n if (isFunc(elm.onKeyPress)) {\n if (elm.onKeyPress.call(elm, e, mappedKeyEvent, elm, finalFocusElm) === true) {\n break;\n }\n }\n }\n return false;\n });\n }\n });\n return focusPath;\n};\n//# sourceMappingURL=useFocusManager.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { ElementNode } from '@lightningjs/solid';\n// To use with TS import withPadding and then put withPadding; on the next line to prevent tree shaking\nexport function withPadding(el, padding) {\n const pad = padding();\n let top, left, right, bottom;\n if (Array.isArray(pad)) {\n // top right bottom left\n if (pad.length === 2) {\n top = bottom = pad[0];\n left = right = pad[1];\n }\n else if (pad.length === 3) {\n top = pad[0];\n left = right = pad[1];\n bottom = pad[2];\n }\n else {\n [top, right, bottom, left] = pad;\n }\n }\n else {\n top = right = bottom = left = pad;\n }\n el.onBeforeLayout = (node, size) => {\n if (size) {\n el.width =\n el.children.reduce((acc, c) => {\n return acc + (c.width || 0);\n }, 0) +\n left +\n right;\n const firstChild = el.children[0];\n if (firstChild) {\n // set padding or marginLeft for flex\n firstChild.x = left;\n firstChild.marginLeft = left;\n }\n let maxHeight = 0;\n el.children.forEach((c) => {\n c.y = top;\n c.marginTop = top;\n maxHeight = Math.max(maxHeight, c.height || 0);\n });\n el.height = maxHeight + top + bottom;\n }\n };\n}\n//# sourceMappingURL=withPadding.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n/* global SpeechSynthesisErrorEvent */\nfunction flattenStrings(series = []) {\n const flattenedSeries = [];\n let i;\n for (i = 0; i < series.length; i++) {\n const s = series[i];\n if (typeof s === 'string' && !s.includes('PAUSE-')) {\n flattenedSeries.push(series[i]);\n }\n else {\n break;\n }\n }\n // add a \"word boundary\" to ensure the Announcer doesn't automatically try to\n // interpret strings that look like dates but are not actually dates\n // for example, if \"Rising Sun\" and \"1993\" are meant to be two separate lines,\n // when read together, \"Sun 1993\" is interpretted as \"Sunday 1993\"\n return [flattenedSeries.join(',\\b ')].concat(series.slice(i));\n}\nfunction delay(pause) {\n return new Promise((resolve) => {\n setTimeout(resolve, pause);\n });\n}\n/**\n * Speak a string\n *\n * @param phrase Phrase to speak\n * @param utterances An array which the new SpeechSynthesisUtterance instance representing this utterance will be appended\n * @param lang Language to speak in\n * @return {Promise} Promise resolved when the utterance has finished speaking, and rejected if there's an error\n */\nfunction speak(phrase, utterances, lang = 'en-US') {\n const synth = window.speechSynthesis;\n return new Promise((resolve, reject) => {\n const utterance = new SpeechSynthesisUtterance(phrase);\n utterance.lang = lang;\n utterance.onend = () => {\n resolve();\n };\n utterance.onerror = (e) => {\n reject(e);\n };\n utterances.push(utterance);\n synth.speak(utterance);\n });\n}\nfunction speakSeries(series, lang, root = true) {\n const synth = window.speechSynthesis;\n const remainingPhrases = flattenStrings(Array.isArray(series) ? series : [series]);\n const nestedSeriesResults = [];\n /*\n We hold this array of SpeechSynthesisUtterances in order to prevent them from being\n garbage collected prematurely on STB hardware which can cause the 'onend' events of\n utterances to not fire consistently.\n */\n const utterances = [];\n let active = true;\n const seriesChain = (async () => {\n try {\n while (active && remainingPhrases.length) {\n const phrase = await Promise.resolve(remainingPhrases.shift());\n if (!active) {\n // Exit\n // Need to check this after the await in case it was cancelled in between\n break;\n }\n else if (typeof phrase === 'string' && phrase.includes('PAUSE-')) {\n // Pause it\n let pause = Number(phrase.split('PAUSE-')[1]) * 1000;\n if (isNaN(pause)) {\n pause = 0;\n }\n await delay(pause);\n }\n else if (typeof phrase === 'string' && phrase.length) {\n // Speak it\n const totalRetries = 3;\n let retriesLeft = totalRetries;\n while (active && retriesLeft > 0) {\n try {\n await speak(phrase, utterances, lang);\n retriesLeft = 0;\n }\n catch (e) {\n // eslint-disable-next-line no-undef\n if (e instanceof SpeechSynthesisErrorEvent) {\n if (e.error === 'network') {\n retriesLeft--;\n console.warn(`Speech synthesis network error. Retries left: ${retriesLeft}`);\n await delay(500 * (totalRetries - retriesLeft));\n }\n else if (e.error === 'canceled' ||\n e.error === 'interrupted') {\n // Cancel or interrupt error (ignore)\n retriesLeft = 0;\n }\n else {\n throw new Error(`SpeechSynthesisErrorEvent: ${e.error}`);\n }\n }\n else {\n throw e;\n }\n }\n }\n }\n else if (typeof phrase === 'function') {\n const seriesResult = speakSeries(phrase(), lang, false);\n nestedSeriesResults.push(seriesResult);\n await seriesResult.series;\n }\n else if (Array.isArray(phrase)) {\n // Speak it (recursively)\n const seriesResult = speakSeries(phrase, lang, false);\n nestedSeriesResults.push(seriesResult);\n await seriesResult.series;\n }\n }\n }\n finally {\n active = false;\n }\n })();\n return {\n series: seriesChain,\n get active() {\n return active;\n },\n append: (toSpeak) => {\n remainingPhrases.push(toSpeak);\n },\n cancel: () => {\n if (!active) {\n return;\n }\n if (root) {\n synth.cancel();\n }\n nestedSeriesResults.forEach((nestedSeriesResults) => {\n nestedSeriesResults.cancel();\n });\n active = false;\n },\n };\n}\nlet currentSeries;\nexport default function (toSpeak, lang = 'en-US') {\n currentSeries && currentSeries.cancel();\n currentSeries = speakSeries(toSpeak, lang);\n return currentSeries;\n}\n//# sourceMappingURL=speech.js.map","import { getOwner, onCleanup, createSignal, getListener } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/index.ts\nvar debounce = (callback, wait) => {\n if (isServer) {\n return Object.assign(() => void 0, { clear: () => void 0 });\n }\n let timeoutId;\n const clear = () => clearTimeout(timeoutId);\n if (getOwner())\n onCleanup(clear);\n const debounced = (...args) => {\n if (timeoutId !== void 0)\n clear();\n timeoutId = setTimeout(() => callback(...args), wait);\n };\n return Object.assign(debounced, { clear });\n};\nvar throttle = (callback, wait) => {\n if (isServer) {\n return Object.assign(() => void 0, { clear: () => void 0 });\n }\n let isThrottled = false, timeoutId, lastArgs;\n const throttled = (...args) => {\n lastArgs = args;\n if (isThrottled)\n return;\n isThrottled = true;\n timeoutId = setTimeout(() => {\n callback(...lastArgs);\n isThrottled = false;\n }, wait);\n };\n const clear = () => {\n clearTimeout(timeoutId);\n isThrottled = false;\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(throttled, { clear });\n};\nvar scheduleIdle = isServer ? () => Object.assign(() => void 0, { clear: () => void 0 }) : (\n // requestIdleCallback is not supported in Safari\n window.requestIdleCallback ? (callback, maxWait) => {\n let isDeferred = false, id, lastArgs;\n const deferred = (...args) => {\n lastArgs = args;\n if (isDeferred)\n return;\n isDeferred = true;\n id = requestIdleCallback(\n () => {\n callback(...lastArgs);\n isDeferred = false;\n },\n { timeout: maxWait }\n );\n };\n const clear = () => {\n cancelIdleCallback(id);\n isDeferred = false;\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(deferred, { clear });\n } : (\n // fallback to setTimeout (throttle)\n (callback) => throttle(callback)\n )\n);\nfunction leading(schedule, callback, wait) {\n if (isServer) {\n let called = false;\n const scheduled2 = (...args) => {\n if (called)\n return;\n called = true;\n callback(...args);\n };\n return Object.assign(scheduled2, { clear: () => void 0 });\n }\n let isScheduled = false;\n const scheduled = schedule(() => isScheduled = false, wait);\n const func = (...args) => {\n if (!isScheduled)\n callback(...args);\n isScheduled = true;\n scheduled();\n };\n const clear = () => {\n isScheduled = false;\n scheduled.clear();\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(func, { clear });\n}\nfunction leadingAndTrailing(schedule, callback, wait) {\n if (isServer) {\n let called = false;\n const scheduled2 = (...args) => {\n if (called)\n return;\n called = true;\n callback(...args);\n };\n return Object.assign(scheduled2, { clear: () => void 0 });\n }\n let State;\n ((State2) => {\n State2[State2[\"Ready\"] = 0] = \"Ready\";\n State2[State2[\"Leading\"] = 1] = \"Leading\";\n State2[State2[\"Trailing\"] = 2] = \"Trailing\";\n })(State || (State = {}));\n let state = 0 /* Ready */;\n const scheduled = schedule((args) => {\n state === 2 /* Trailing */ && callback(...args);\n state = 0 /* Ready */;\n }, wait);\n const fn = (...args) => {\n if (state !== 2 /* Trailing */) {\n if (state === 0 /* Ready */)\n callback(...args);\n state += 1;\n }\n scheduled(args);\n };\n const clear = () => {\n state = 0 /* Ready */;\n scheduled.clear();\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(fn, { clear });\n}\nfunction createScheduled(schedule) {\n let listeners = 0;\n let isDirty = false;\n const [track, dirty] = createSignal(void 0, { equals: false });\n const call = schedule(() => {\n isDirty = true;\n dirty();\n });\n return () => {\n if (!isDirty)\n call(), track();\n if (isDirty) {\n isDirty = !!listeners;\n return true;\n }\n if (getListener()) {\n listeners++;\n onCleanup(() => listeners--);\n }\n return false;\n };\n}\n\nexport { createScheduled, debounce, leading, leadingAndTrailing, scheduleIdle, throttle };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { untrack } from 'solid-js';\nimport SpeechEngine, {} from './speech.js';\nimport { debounce } from '@solid-primitives/scheduled';\nimport { focusPath } from '../useFocusManager.js';\nlet resetFocusPathTimer;\nlet prevFocusPath = [];\nlet currentlySpeaking;\nlet voiceOutDisabled = false;\nconst fiveMinutes = 300000;\nfunction debounceWithFlush(callback, time) {\n const trigger = debounce(callback, time);\n let scopedValue;\n const debounced = (newValue) => {\n scopedValue = newValue;\n trigger(newValue);\n };\n debounced.flush = () => {\n trigger.clear();\n callback(scopedValue);\n };\n debounced.clear = trigger.clear;\n return debounced;\n}\nfunction getElmName(elm) {\n return elm.id || elm.name;\n}\nfunction onFocusChangeCore(focusPath = []) {\n if (!Announcer.onFocusChange || !Announcer.enabled) {\n return;\n }\n const loaded = focusPath.every((elm) => !elm.loading);\n const focusDiff = focusPath.filter((elm) => !prevFocusPath.includes(elm));\n resetFocusPathTimer();\n if (!loaded && Announcer.onFocusChange) {\n Announcer.onFocusChange([]);\n return;\n }\n prevFocusPath = focusPath.slice(0);\n const toAnnounceText = [];\n const toAnnounce = focusDiff.reduce((acc, elm) => {\n if (elm.announce) {\n acc.push([getElmName(elm), 'Announce', elm.announce]);\n toAnnounceText.push(elm.announce);\n }\n else if (elm.title) {\n acc.push([getElmName(elm), 'Title', elm.title]);\n toAnnounceText.push(elm.title);\n }\n else {\n acc.push([getElmName(elm), 'No Announce', '']);\n }\n return acc;\n }, []);\n focusDiff.reverse().reduce((acc, elm) => {\n if (elm.announceContext) {\n acc.push([getElmName(elm), 'Context', elm.announceContext]);\n toAnnounceText.push(elm.announceContext);\n }\n else {\n acc.push([getElmName(elm), 'No Context', '']);\n }\n return acc;\n }, toAnnounce);\n if (Announcer.debug) {\n console.table(toAnnounce);\n }\n if (toAnnounceText.length) {\n return Announcer.speak(toAnnounceText.reduce((acc, val) => acc.concat(val), []));\n }\n}\nfunction textToSpeech(toSpeak) {\n if (voiceOutDisabled) {\n return;\n }\n return (currentlySpeaking = SpeechEngine(toSpeak));\n}\nexport const Announcer = {\n debug: false,\n enabled: true,\n cancel: function () {\n currentlySpeaking && currentlySpeaking.cancel();\n },\n clearPrevFocus: function (depth = 0) {\n prevFocusPath = prevFocusPath.slice(0, depth);\n resetFocusPathTimer();\n },\n speak: function (text, { append = false, notification = false } = {}) {\n if (Announcer.onFocusChange && Announcer.enabled) {\n Announcer.onFocusChange.flush();\n if (append && currentlySpeaking && currentlySpeaking.active) {\n currentlySpeaking.append(text);\n }\n else {\n Announcer.cancel();\n textToSpeech(text);\n }\n if (notification) {\n voiceOutDisabled = true;\n currentlySpeaking?.series\n .finally(() => {\n voiceOutDisabled = false;\n Announcer.refresh();\n })\n .catch(console.error);\n }\n }\n return currentlySpeaking;\n },\n refresh: function (depth = 0) {\n Announcer.clearPrevFocus(depth);\n Announcer.onFocusChange &&\n Announcer.onFocusChange(untrack(() => focusPath()));\n },\n setupTimers: function ({ focusDebounce = 400, focusChangeTimeout = fiveMinutes, } = {}) {\n Announcer.onFocusChange = debounceWithFlush(onFocusChangeCore, focusDebounce);\n resetFocusPathTimer = debounceWithFlush(() => {\n // Reset focus path for full announce\n prevFocusPath = [];\n }, focusChangeTimeout);\n },\n};\n//# sourceMappingURL=announcer.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { createEffect, on } from 'solid-js';\nimport { Announcer } from './announcer.js';\nimport { focusPath } from '../useFocusManager.js';\nexport const useAnnouncer = () => {\n Announcer.setupTimers();\n createEffect(on(focusPath, Announcer.onFocusChange, { defer: true }));\n return Announcer;\n};\n//# sourceMappingURL=index.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { renderer } from '@lightningjs/solid';\nimport {} from '@lightningjs/renderer';\nexport function createSpriteMap(src, subTextures) {\n const spriteMapTexture = renderer.createTexture('ImageTexture', {\n src,\n });\n return subTextures.reduce((acc, t) => {\n const { x, y, width, height } = t;\n acc[t.name] = renderer.createTexture('SubTexture', {\n texture: spriteMapTexture,\n x,\n y,\n width,\n height,\n });\n return acc;\n }, {});\n}\n//# sourceMappingURL=createSpriteMap.js.map","import { createSignal } from \"solid-js\";\nexport const [globalBackground, setGlobalBackground] = createSignal('');\n","export default {\n name: 'Base Lightning TV',\n alpha: {\n primary: 1,\n secondary: 0.7,\n tertiary: 0.1,\n inactive: 0.5,\n full: 1,\n none: 0,\n alpha1: 0.1,\n alpha2: 0.3,\n alpha3: 0.5,\n alpha4: 0.7,\n alpha5: 0.9\n },\n animation: {\n duration: {\n none: 0,\n xfast: 0.1,\n fast: 0.25,\n normal: 0.5,\n slow: 0.75,\n xslow: 0.9\n },\n delay: {\n none: 0,\n xfast: 0.01,\n fast: 0.025,\n normal: 0.05,\n slow: 0.075,\n xslow: 0.09\n },\n expressive: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n expressiveEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n expressiveExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standard: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standardEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standardExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utility: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utilityEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utilityExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n }\n },\n asset: {\n arrowLeft:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAi0lEQVRIDWNgGAWjIfD//38JID5Fk5AAGqwKxPeA+D/VLQCaaQLEr0CGgwBVLQCa5wbEn0EGwwDVLAAaGA3Ev2AGw2iqWAA0rBiI/8EMRaYptgBoWDeygehsci1gIlcjWfqArqZdEMFcBLSEdpGMZAntkimSJbTLaEiW0K6oQLKEdoUdzJJRemiHAAD4n+yzPWCs7QAAAABJRU5ErkJggg==',\n arrowRight:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAg0lEQVRIDWNgGAWjIYArBP7//38KiCVwyVMsDjQcBO4BsSrFhmEzAGw8hHgFpEywqaFIDMkCEPMzELtRZCC6ZjQLQNxfQByNro5sPhYLQEL/gLiYbEORNeKwACbcDVPLBGMMOhrmVDSapkFE00imaTKlaUajaVFB28Ju0CXrUQfhDAEAEgHss6NhpLQAAAAASUVORK5CYII=',\n backspaceOutline:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGohMqUBAAQZ80zUVQAKUEIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhB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GQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC',\n check:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAOCAYAAAAi2ky3AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACtSURBVHgBvdPdDcIgEAfwoy8Nb45QN3AGF2s36Ahu4gpuIDoBfSgfpdoTlCbEWEMh6T8hFzjyg5AAkBHOcQe5UWqspRx435sDpMYj6IYQwwVSEiJ2MKVUBWuzLSLl2HL+uxmNCGFO8yaL7RHxve6qRZoAuS4hxac8735elWVx7jrtMKL1o0Gcat9jhExHSukN/kUIFZ7MpDRtzE1isDRkAUtDvrA8ZI597FUf8gWH9P0b4gko9wAAAABJRU5ErkJggg=='\n },\n color: {\n palette: {\n 'blue-20': '0xbecffeff',\n 'blue-40': '0x93a9fdff',\n 'blue-90': '0x000033ff',\n 'grey-05': '0xf8f7faff',\n 'grey-40': '0x929096ff',\n 'grey-70': '0x48474bff',\n 'grey-90': '0x181819ff'\n },\n white: '0xffffffff',\n black: '0x000000ff',\n grey: '0x929096ff',\n red: '0xe74c3cff',\n orange: '0xdc7633ff',\n yellow: '0xf7dc6fff',\n green: '0x2ecc71ff',\n blue: '0x93a9fdff',\n purple: '0x663399ff',\n material: '0x181819ff',\n materialBrand: '0x000033ff',\n overlay: '0x181819b3',\n textNeutral: '0xf8f7faff',\n textNeutralSecondary: '0xf8f7fab3',\n textNeutralTertiary: '0xf8f7fa1a',\n textNeutralDisabled: '0xf8f7fa80',\n textInverse: '0x181819ff',\n textInverseSecondary: '0x181819b3',\n textInverseTertiary: '0x1818191a',\n textInverseDisabled: '0x18181980',\n textBrand: '0x93a9fdff',\n textBrandSecondary: '0x93a9fdb3',\n textBrandTertiary: '0x93a9fd1a',\n textBrandDisabled: '0x93a9fd80',\n textPositive: '0x2ecc71ff',\n textNegative: '0xe74c3cff',\n textInfo: '0x93a9fdff',\n textCaution: '0xdc7633ff',\n fillTransparent: '0xffffff0',\n fillNeutral: '0xf8f7faff',\n fillNeutralSecondary: '0xf8f7fab3',\n fillNeutralTertiary: '0xf8f7fa1a',\n fillNeutralDisabled: '0xf8f7fa80',\n fillInverse: '0x181819ff',\n fillInverseSecondary: '0x181819b3',\n fillInverseTertiary: '0x1818191a',\n fillInverseDisabled: '0x18181980',\n fillBrand: '0x93a9fdff',\n fillBrandSecondary: '0x93a9fdb3',\n fillBrandTertiary: '0x93a9fd1a',\n fillBrandDisabled: '0x93a9fd80',\n fillPositive: '0x2ecc71ff',\n fillNegative: '0xe74c3cff',\n fillInfo: '0x93a9fdff',\n fillCaution: '0xdc7633ff',\n strokeNeutral: '0xf8f7faff',\n strokeNeutralSecondary: '0xf8f7fab3',\n strokeNeutralTertiary: '0xf8f7fa1a',\n strokeNeutralDisabled: '0xf8f7fa80',\n strokeInverse: '0x181819ff',\n strokeInverseSecondary: '0x181819b3',\n strokeInverseTertiary: '0x1818191a',\n strokeInverseDisabled: '0x18181980',\n strokeBrand: '0x93a9fdff',\n strokeBrandSecondary: '0x93a9fdb3',\n strokeBrandTertiary: '0x93a9fd1a',\n strokeBrandDisabled: '0x93a9fd80',\n strokePositive: '0x2ecc71ff',\n strokeNegative: '0xe74c3cff',\n strokeInfo: '0x93a9fdff',\n strokeCaution: '0xdc7633ff',\n interactiveNeutral: '0xffffff1a',\n interactiveNeutralFocus: '0xffffffff',\n interactiveNeutralFocusSoft: '0xffffff1a',\n interactiveInverse: '0x48474b1a',\n interactiveInverseFocus: '0x48474bff',\n interactiveInverseFocusSoft: '0x48474b1a',\n interactiveBrand: '0xbecffe1a',\n interactiveBrandFocus: '0xbecffeff',\n interactiveBrandFocusSoft: '0xbecffe1a',\n shadowNeutral: '0x000000b3',\n shadowNeutralFocus: '0x000000b3',\n shadowNeutralFocusSoft: '0x000000b3',\n shadowNeutralText: '0x000000ff',\n shadowInverse: '0x000000b3',\n shadowInverseFocus: '0x000000b3',\n shadowInverseFocusSoft: '0x000000b3',\n shadowInverseText: '0x000000ff',\n shadowBrand: '0x000000b3',\n shadowBrandFocus: '0x000000b3',\n shadowBrandFocusSoft: '0x000000b3',\n shadowBrandText: '0x000000ff'\n },\n font: [],\n layout: {\n columnCount: 10,\n focusScale: 1.2,\n gutterX: 20,\n gutterY: 20,\n marginX: 150,\n marginY: 150,\n safe: 50,\n screenW: 1920,\n screenH: 1080\n },\n radius: { none: 0, xs: 2, sm: 4, md: 8, lg: 16, xl: 24 },\n spacer: {\n none: 0,\n xxs: 2,\n xs: 4,\n sm: 8,\n md: 10,\n lg: 20,\n xl: 30,\n xxl: 40,\n xxxl: 50\n },\n stroke: { none: 0, sm: 2, md: 4, lg: 6, xl: 8 },\n typography: {\n display1: {\n fontFamily: 'Arial',\n fontSize: 75,\n lineHeight: 85,\n fontWeight: 500,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n display2: {\n fontFamily: 'Arial',\n fontSize: 50,\n lineHeight: 60,\n fontWeight: 500,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline1: {\n fontFamily: 'Arial',\n fontSize: 35,\n fontWeight: 500,\n lineHeight: 48,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline2: {\n fontFamily: 'Arial',\n fontSize: 30,\n fontWeight: 500,\n lineHeight: 40,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline3: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 500,\n lineHeight: 36,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body1: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 300,\n lineHeight: 40,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body2: {\n fontFamily: 'Arial',\n fontSize: 22,\n fontWeight: 300,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body3: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 300,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n button1: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n button2: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n callout1: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n caption1: {\n fontFamily: 'Arial',\n fontSize: 15,\n fontWeight: 500,\n lineHeight: 24,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n tag1: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 24,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n footnote1: {\n fontFamily: 'Arial',\n fontSize: 22,\n fontWeight: 300,\n lineHeight: 30,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n }\n },\n componentConfig: {\n Keyboard: {\n base: {\n keyProps: {\n delete: {\n title: null,\n icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGohMqUBAAQZ80zUVQAKUEIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8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{ type AnimationSettings } from \"@lightningjs/renderer\";\nimport { globalBackground } from \"../state.js\";\nimport { type IntrinsicNodeStyleProps, View, hexColor } from \"@lightningjs/solid\";\nimport { createEffect, on } from \"solid-js\";\nimport { debounce } from '@solid-primitives/scheduled';\nimport theme from 'theme';\n\nexport default function Background() {\n let bg1, bg2;\n let active = 0;\n const alpha = 1;\n const animationSettings = { duration: 750, easing: 'ease-in-out' } satisfies Partial;\n const bgStyles = { alpha, color: 0xffffffff } satisfies IntrinsicNodeStyleProps;\n\n function changeBackgrounds(img: string) {\n if (img.startsWith('#')) {\n bg1.color = img;\n bg1.src = '';\n bg1.alpha = 1;\n active = 1;\n bg2.alpha = 0;\n return;\n } else {\n bg1.color = 0xffffffff;\n }\n\n if (active === 0) {\n bg1.src = img;\n active = 1;\n return;\n }\n\n if (active === 1) {\n bg2.src = img;\n active = 2;\n bg2.alpha = 0;\n bg2.animate({ alpha }, animationSettings).start();\n bg1.animate({ alpha: 0 }, animationSettings).start();\n return;\n }\n\n if (active === 2) {\n bg1.src = img;\n active = 1;\n bg1.alpha = 0;\n bg1.animate({ alpha }, animationSettings).start();\n bg2.animate({ alpha: 0 }, animationSettings).start();\n }\n }\n\n const delayedBackgrounds = debounce(changeBackgrounds, 400);\n\n createEffect(on(globalBackground, (img: string) => {\n delayedBackgrounds(img);\n }, { defer: true}))\n\n return (<>\n \n \n \n \n \n );\n}\n","var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;\nimport { ElementNode, createComponent, View, mergeProps, createElement, use, spread, insert, Show, Text as Text$7, memo, For as For$1 } from \"@lightningjs/solid\";\nimport theme from \"theme\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nconst equalFn = (a, b) => a === b;\nconst $TRACK = Symbol(\"solid-track\");\nconst signalOptions = {\n equals: equalFn\n};\nlet runEffects = runQueue;\nconst STALE = 1;\nconst PENDING = 2;\nconst UNOWNED = {\n owned: null,\n cleanups: null,\n context: null,\n owner: null\n};\nvar Owner = null;\nlet Transition = null;\nlet ExternalSourceConfig = null;\nlet Listener = null;\nlet Updates = null;\nlet Effects = null;\nlet ExecCount = 0;\nfunction createRoot(fn, detachedOwner) {\n const listener = Listener, owner = Owner, unowned = fn.length === 0, current = detachedOwner === void 0 ? owner : detachedOwner, root = unowned ? UNOWNED : {\n owned: null,\n cleanups: null,\n context: current ? current.context : null,\n owner: current\n }, updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root)));\n Owner = root;\n Listener = null;\n try {\n return runUpdates(updateFn, true);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n}\nfunction createSignal(value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const s = {\n value,\n observers: null,\n observerSlots: null,\n comparator: options.equals || void 0\n };\n const setter = (value2) => {\n if (typeof value2 === \"function\") {\n value2 = value2(s.value);\n }\n return writeSignal(s, value2);\n };\n return [readSignal.bind(s), setter];\n}\nfunction createMemo(fn, value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const c = createComputation(fn, value, true, 0);\n c.observers = null;\n c.observerSlots = null;\n c.comparator = options.equals || void 0;\n updateComputation(c);\n return readSignal.bind(c);\n}\nfunction untrack(fn) {\n if (Listener === null)\n return fn();\n const listener = Listener;\n Listener = null;\n try {\n if (ExternalSourceConfig)\n ;\n return fn();\n } finally {\n Listener = listener;\n }\n}\nfunction onCleanup(fn) {\n if (Owner === null)\n ;\n else if (Owner.cleanups === null)\n Owner.cleanups = [fn];\n else\n Owner.cleanups.push(fn);\n return fn;\n}\nfunction readSignal() {\n if (this.sources && this.state) {\n if (this.state === STALE)\n updateComputation(this);\n else {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(this), false);\n Updates = updates;\n }\n }\n if (Listener) {\n const sSlot = this.observers ? this.observers.length : 0;\n if (!Listener.sources) {\n Listener.sources = [this];\n Listener.sourceSlots = [sSlot];\n } else {\n Listener.sources.push(this);\n Listener.sourceSlots.push(sSlot);\n }\n if (!this.observers) {\n this.observers = [Listener];\n this.observerSlots = [Listener.sources.length - 1];\n } else {\n this.observers.push(Listener);\n this.observerSlots.push(Listener.sources.length - 1);\n }\n }\n return this.value;\n}\nfunction writeSignal(node, value, isComp) {\n let current = node.value;\n if (!node.comparator || !node.comparator(current, value)) {\n node.value = value;\n if (node.observers && node.observers.length) {\n runUpdates(() => {\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n const TransitionRunning = Transition && Transition.running;\n if (TransitionRunning && Transition.disposed.has(o))\n ;\n if (TransitionRunning ? !o.tState : !o.state) {\n if (o.pure)\n Updates.push(o);\n else\n Effects.push(o);\n if (o.observers)\n markDownstream(o);\n }\n if (!TransitionRunning)\n o.state = STALE;\n }\n if (Updates.length > 1e6) {\n Updates = [];\n if (false)\n ;\n throw new Error();\n }\n }, false);\n }\n }\n return value;\n}\nfunction updateComputation(node) {\n if (!node.fn)\n return;\n cleanNode(node);\n const time = ExecCount;\n runComputation(\n node,\n node.value,\n time\n );\n}\nfunction runComputation(node, value, time) {\n let nextValue;\n const owner = Owner, listener = Listener;\n Listener = Owner = node;\n try {\n nextValue = node.fn(value);\n } catch (err) {\n if (node.pure) {\n {\n node.state = STALE;\n node.owned && node.owned.forEach(cleanNode);\n node.owned = null;\n }\n }\n node.updatedAt = time + 1;\n return handleError(err);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n if (!node.updatedAt || node.updatedAt <= time) {\n if (node.updatedAt != null && \"observers\" in node) {\n writeSignal(node, nextValue);\n } else\n node.value = nextValue;\n node.updatedAt = time;\n }\n}\nfunction createComputation(fn, init, pure, state = STALE, options) {\n const c = {\n fn,\n state,\n updatedAt: null,\n owned: null,\n sources: null,\n sourceSlots: null,\n cleanups: null,\n value: init,\n owner: Owner,\n context: Owner ? Owner.context : null,\n pure\n };\n if (Owner === null)\n ;\n else if (Owner !== UNOWNED) {\n {\n if (!Owner.owned)\n Owner.owned = [c];\n else\n Owner.owned.push(c);\n }\n }\n return c;\n}\nfunction runTop(node) {\n if (node.state === 0)\n return;\n if (node.state === PENDING)\n return lookUpstream(node);\n if (node.suspense && untrack(node.suspense.inFallback))\n return node.suspense.effects.push(node);\n const ancestors = [node];\n while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {\n if (node.state)\n ancestors.push(node);\n }\n for (let i = ancestors.length - 1; i >= 0; i--) {\n node = ancestors[i];\n if (node.state === STALE) {\n updateComputation(node);\n } else if (node.state === PENDING) {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(node, ancestors[0]), false);\n Updates = updates;\n }\n }\n}\nfunction runUpdates(fn, init) {\n if (Updates)\n return fn();\n let wait = false;\n if (!init)\n Updates = [];\n if (Effects)\n wait = true;\n else\n Effects = [];\n ExecCount++;\n try {\n const res = fn();\n completeUpdates(wait);\n return res;\n } catch (err) {\n if (!wait)\n Effects = null;\n Updates = null;\n handleError(err);\n }\n}\nfunction completeUpdates(wait) {\n if (Updates) {\n runQueue(Updates);\n Updates = null;\n }\n if (wait)\n return;\n const e = Effects;\n Effects = null;\n if (e.length)\n runUpdates(() => runEffects(e), false);\n}\nfunction runQueue(queue) {\n for (let i = 0; i < queue.length; i++)\n runTop(queue[i]);\n}\nfunction lookUpstream(node, ignore) {\n node.state = 0;\n for (let i = 0; i < node.sources.length; i += 1) {\n const source = node.sources[i];\n if (source.sources) {\n const state = source.state;\n if (state === STALE) {\n if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))\n runTop(source);\n } else if (state === PENDING)\n lookUpstream(source, ignore);\n }\n }\n}\nfunction markDownstream(node) {\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n if (!o.state) {\n o.state = PENDING;\n if (o.pure)\n Updates.push(o);\n else\n Effects.push(o);\n o.observers && markDownstream(o);\n }\n }\n}\nfunction cleanNode(node) {\n let i;\n if (node.sources) {\n while (node.sources.length) {\n const source = node.sources.pop(), index = node.sourceSlots.pop(), obs = source.observers;\n if (obs && obs.length) {\n const n = obs.pop(), s = source.observerSlots.pop();\n if (index < obs.length) {\n n.sourceSlots[s] = index;\n obs[index] = n;\n source.observerSlots[index] = s;\n }\n }\n }\n }\n if (node.owned) {\n for (i = node.owned.length - 1; i >= 0; i--)\n cleanNode(node.owned[i]);\n node.owned = null;\n }\n if (node.cleanups) {\n for (i = node.cleanups.length - 1; i >= 0; i--)\n node.cleanups[i]();\n node.cleanups = null;\n }\n node.state = 0;\n}\nfunction castError(err) {\n if (err instanceof Error)\n return err;\n return new Error(typeof err === \"string\" ? err : \"Unknown error\", {\n cause: err\n });\n}\nfunction handleError(err, owner = Owner) {\n const error = castError(err);\n throw error;\n}\nconst FALLBACK = Symbol(\"fallback\");\nfunction dispose(d) {\n for (let i = 0; i < d.length; i++)\n d[i]();\n}\nfunction mapArray(list, mapFn, options = {}) {\n let items = [], mapped = [], disposers = [], len = 0, indexes = mapFn.length > 1 ? [] : null;\n onCleanup(() => dispose(disposers));\n return () => {\n let newItems = list() || [], i, j;\n newItems[$TRACK];\n return untrack(() => {\n let newLen = newItems.length, newIndices, newIndicesNext, temp, tempdisposers, tempIndexes, start, end, newEnd, item;\n if (newLen === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n indexes && (indexes = []);\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot((disposer) => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n } else if (len === 0) {\n mapped = new Array(newLen);\n for (j = 0; j < newLen; j++) {\n items[j] = newItems[j];\n mapped[j] = createRoot(mapper);\n }\n len = newLen;\n } else {\n temp = new Array(newLen);\n tempdisposers = new Array(newLen);\n indexes && (tempIndexes = new Array(newLen));\n for (start = 0, end = Math.min(len, newLen); start < end && items[start] === newItems[start]; start++)\n ;\n for (end = len - 1, newEnd = newLen - 1; end >= start && newEnd >= start && items[end] === newItems[newEnd]; end--, newEnd--) {\n temp[newEnd] = mapped[end];\n tempdisposers[newEnd] = disposers[end];\n indexes && (tempIndexes[newEnd] = indexes[end]);\n }\n newIndices = /* @__PURE__ */ new Map();\n newIndicesNext = new Array(newEnd + 1);\n for (j = newEnd; j >= start; j--) {\n item = newItems[j];\n i = newIndices.get(item);\n newIndicesNext[j] = i === void 0 ? -1 : i;\n newIndices.set(item, j);\n }\n for (i = start; i <= end; i++) {\n item = items[i];\n j = newIndices.get(item);\n if (j !== void 0 && j !== -1) {\n temp[j] = mapped[i];\n tempdisposers[j] = disposers[i];\n indexes && (tempIndexes[j] = indexes[i]);\n j = newIndicesNext[j];\n newIndices.set(item, j);\n } else\n disposers[i]();\n }\n for (j = start; j < newLen; j++) {\n if (j in temp) {\n mapped[j] = temp[j];\n disposers[j] = tempdisposers[j];\n if (indexes) {\n indexes[j] = tempIndexes[j];\n indexes[j](j);\n }\n } else\n mapped[j] = createRoot(mapper);\n }\n mapped = mapped.slice(0, len = newLen);\n items = newItems.slice(0);\n }\n return mapped;\n });\n function mapper(disposer) {\n disposers[j] = disposer;\n if (indexes) {\n const [s, set] = createSignal(j);\n indexes[j] = set;\n return mapFn(newItems[j], s);\n }\n return mapFn(newItems[j]);\n }\n };\n}\nfunction For(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(mapArray(() => props.each, props.children, fallback || void 0));\n}\nconst defaultModeKeys = [\"focus\", \"disabled\"];\nconst defaultToneKeys = [\"brand\", \"inverse\", \"neutral\"];\nfunction makeComponentStyles({ themeKeys, base, modes, tones, themeStyles: themeStyles2, modeKeys = defaultModeKeys, toneKeys = defaultToneKeys }, debug = false) {\n const makeToneStyles = (tones2, themeComponentStyles, modeStyles) => {\n const toneStyles = toneKeys.map((tone) => {\n const styles2 = {};\n const styleList = new Set(\n [].concat.apply([], [(tones2 == null ? void 0 : tones2[tone]) ?? {}, (themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) ?? {}].map(Object.keys))\n );\n styleList.forEach((styleKey) => {\n var _a2, _b2;\n if (!modeKeys.includes(styleKey)) {\n styles2[styleKey] = ((_a2 = themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) == null ? void 0 : _a2[styleKey]) ?? ((_b2 = tones2 == null ? void 0 : tones2[tone]) == null ? void 0 : _b2[styleKey]);\n }\n });\n modeKeys.forEach((mode) => {\n var _a2, _b2;\n styles2[mode] = {\n ...modeStyles[mode],\n // fallbacks from base.mode\n ...(_a2 = tones2 == null ? void 0 : tones2[tone]) == null ? void 0 : _a2[mode],\n // component configured tone.mode\n ...(_b2 = themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) == null ? void 0 : _b2[mode]\n // theme configure tone.mode\n };\n });\n return [tone, styles2];\n });\n return Object.fromEntries(toneStyles);\n };\n const makeModeStyles = (modes2, themeComponentStyles) => {\n const modeStyles = modeKeys.map((mode) => {\n return [mode, { ...modes2 == null ? void 0 : modes2[mode], ...themeComponentStyles == null ? void 0 : themeComponentStyles[mode] }];\n });\n const modeObject = Object.fromEntries(modeStyles);\n return modeObject;\n };\n const makeBaseStyles = (base2, themeComponentStyles) => {\n const baseStyles = {\n ...base2,\n ...themeComponentStyles.base\n };\n return baseStyles;\n };\n const mapThemeKeysToSolid = (stylesToMap) => Object.fromEntries(\n Object.entries(themeKeys).filter(([_, themeKey]) => stylesToMap[themeKey]).map(([solidKey, themeKey]) => [solidKey, stylesToMap[themeKey]])\n );\n const convertComponentConfig = (themeStyles3) => {\n const convertedThemeStyles = Object.fromEntries(\n // iterate through each variant\n Object.entries(themeStyles3).map(([variantName, styles2]) => {\n const convertedStyles = mapThemeKeysToSolid(styles2);\n Object.entries(styles2).filter(([styleName, _]) => modeKeys.includes(styleName)).forEach(([modeName, modeStyles]) => {\n convertedStyles[modeName] = mapThemeKeysToSolid(modeStyles);\n });\n return [variantName, convertedStyles];\n })\n );\n return convertedThemeStyles;\n };\n const generateSolidStylesFromLookupObject = (base2, modes2, tones2) => {\n const themeComponentStyles = convertComponentConfig(themeStyles2);\n debug && console.log(themeComponentStyles);\n const baseStyles = makeBaseStyles(base2, themeComponentStyles);\n debug && console.log(baseStyles);\n const modeStyles = makeModeStyles(modes2, themeComponentStyles);\n debug && console.log(modeStyles);\n const toneStyles = makeToneStyles(tones2, themeComponentStyles, modeStyles);\n debug && console.log(toneStyles);\n return {\n base: {\n ...baseStyles,\n ...modeStyles\n },\n tones: toneStyles\n };\n };\n return generateSolidStylesFromLookupObject(base, modes, tones);\n}\nfunction withScrolling(adjustment = 0) {\n return (componentRef, selectedElement, selected, lastSelected) => {\n if (componentRef.children.length === 0) {\n return;\n }\n const gap = componentRef.gap || 0;\n const scroll = componentRef.scroll || \"auto\";\n const [lastItem, windowVal] = updateLastIndex(componentRef);\n const currentVal = componentRef.flexDirection === \"row\" ? componentRef.x : componentRef.y;\n const newVal = componentRef.flexDirection === \"row\" ? selectedElement.x : selectedElement.y;\n const size2 = componentRef.flexDirection === \"row\" ? selectedElement.width : selectedElement.height;\n const direct = selected > lastSelected ? \"positive\" : \"negative\";\n let next = currentVal;\n if (scroll === \"auto\") {\n if (componentRef.scrollIndex != void 0 && componentRef.scrollIndex >= 0) {\n if (componentRef.selected >= componentRef.scrollIndex) {\n if (direct === \"positive\") {\n next = currentVal - size2 - gap;\n } else {\n next = currentVal + size2 + gap;\n }\n }\n } else if (Math.abs(currentVal) + windowVal < lastItem.position + lastItem.size || newVal < Math.abs(currentVal)) {\n next = -newVal + adjustment;\n }\n } else if (scroll === \"always\" || scroll === \"edge\" && direct === \"negative\" && Math.abs(currentVal) > newVal) {\n next = -newVal + adjustment;\n } else if (scroll === \"edge\" && direct === \"positive\" && Math.abs(currentVal) + windowVal < newVal + size2) {\n next = currentVal - size2 - gap;\n }\n if (componentRef.flexDirection === \"row\" && componentRef.x !== next) {\n componentRef.x = next;\n } else if (componentRef.flexDirection === \"column\" && componentRef.y !== next) {\n componentRef.y = next;\n }\n };\n}\nfunction updateLastIndex(items) {\n let lastItem, windowVal;\n if (items.flexDirection === \"row\") {\n lastItem = {\n position: items.children[items.children.length - 1].x,\n size: items.children[items.children.length - 1].width\n };\n windowVal = items.width;\n } else {\n lastItem = {\n position: items.children[items.children.length - 1].y,\n size: items.children[items.children.length - 1].height\n };\n windowVal = items.height;\n }\n return [lastItem, windowVal];\n}\nconst useItemLayout = (itemLayout) => {\n if (itemLayout) {\n const width = (theme.layout.screenW - theme.layout.marginX * 2) / itemLayout.upCount - theme.layout.gutterX;\n const height = width / itemLayout.ratioX * itemLayout.ratioY;\n return { width, height };\n }\n return {};\n};\nconst chainFunctions = (...args) => {\n const onlyFunctions = args.filter((func) => typeof func === \"function\");\n if (onlyFunctions.length === 0) {\n return void 0;\n }\n return function(...innerArgs) {\n for (const func of onlyFunctions) {\n if (func.apply(this, innerArgs) === true) {\n return true;\n }\n }\n };\n};\nfunction assertTruthy(condition, message) {\n return;\n}\nfunction onGridFocus() {\n if (!this || this.selected === void 0 || this.children.length === 0)\n return false;\n let child = this.children[this.selected];\n while (child == null ? void 0 : child.skipFocus) {\n this.selected++;\n child = this.children[this.selected];\n }\n if (!(child instanceof ElementNode))\n return false;\n child.setFocus();\n}\nfunction handleNavigation(direction) {\n return function() {\n var _a2, _b2;\n const numChildren = this.children.length;\n const wrap = this.wrap;\n const lastSelected = this.selected || 0;\n if (numChildren === 0) {\n return false;\n }\n if (direction === \"right\" || direction === \"down\") {\n do {\n this.selected = (this.selected || 0) % numChildren + 1;\n if (this.selected >= numChildren) {\n if (!wrap) {\n this.selected = void 0;\n break;\n }\n this.selected = 0;\n }\n } while ((_a2 = this.children[this.selected]) == null ? void 0 : _a2.skipFocus);\n } else if (direction === \"left\" || direction === \"up\") {\n do {\n this.selected = (this.selected || 0) % numChildren - 1;\n if (this.selected < 0) {\n if (!wrap) {\n this.selected = void 0;\n break;\n }\n this.selected = numChildren - 1;\n }\n } while ((_b2 = this.children[this.selected]) == null ? void 0 : _b2.skipFocus);\n }\n if (this.selected === void 0) {\n this.selected = lastSelected;\n if (this.children[this.selected].states.has(\"focus\")) {\n return false;\n }\n }\n const active = this.children[this.selected];\n this.onSelectedChanged && this.onSelectedChanged.call(this, this, active, this.selected, lastSelected);\n if (this.plinko && lastSelected !== void 0) {\n const lastSelectedChild = this.children[lastSelected];\n const num = lastSelectedChild.selected || 0;\n active.selected = num < active.children.length ? num : active.children.length - 1;\n }\n active.setFocus();\n return true;\n };\n}\nfunction scrollToIndex(componentRef, selectedIndex) {\n if (!componentRef || componentRef.selected === void 0 || componentRef.children.length === 0 || componentRef.children.length <= selectedIndex || componentRef.selected === selectedIndex) {\n return false;\n }\n componentRef.selected = selectedIndex;\n if (componentRef.flexDirection === \"row\") {\n componentRef.x = -componentRef.children[selectedIndex].x;\n } else if (componentRef.flexDirection === \"column\") {\n componentRef.y = -componentRef.children[selectedIndex].y;\n }\n}\nconst { Artwork: { defaultTone: defaultTone$e, ...themeStyles$d } = { styles: {} } } = (_a = theme) == null ? void 0 : _a.componentConfig;\nconst container$e = {\n themeKeys: {\n fillColor: \"fillColor\",\n borderRadius: \"borderRadius\",\n scale: \"imageScale\",\n pivotX: \"imageScalePivotX\",\n pivotY: \"imageScalePivotY\"\n },\n base: {\n borderRadius: theme.radius.md,\n fallbackSrc: void 0,\n fillColor: theme.color.overlay,\n gradientColor: theme.color.material,\n pivotX: 0.5,\n pivotY: 0.5,\n scale: void 0\n },\n themeStyles: themeStyles$d\n};\nconst Container$e = makeComponentStyles(container$e);\nconst styles$e = {\n tone: defaultTone$e || \"neutral\",\n Container: Container$e\n};\nconst formatArtwork = (props) => {\n let src = props.src ? props.src : props.fallbackSrc;\n if (src && props.srcCallback && typeof props.srcCallback === \"function\") {\n src = props.srcCallback({\n closestAspectRatio: void 0,\n aspectRatio: void 0,\n src,\n width: props.width,\n height: props.height\n });\n }\n return src;\n};\nconst Artwork = (props) => {\n const formattedArtwork = createMemo(() => formatArtwork(props));\n return createComponent(View, mergeProps(props, {\n get color() {\n var _a2;\n return Boolean(formattedArtwork()) ? void 0 : props.color ?? ((_a2 = styles$e.Container.tones[props.tone ?? styles$e.tone]) == null ? void 0 : _a2.fillColor) ?? styles$e.Container.base.fillColor;\n },\n get style() {\n return [...[props.style].flat(), styles$e.Container.tones[props.tone || styles$e.tone], styles$e.Container.base];\n },\n get src() {\n return formattedArtwork();\n }\n }));\n};\nconst { Icon: { defaultTone: defaultTone$d, ...themeStyles$c } = { styles: {} } } = (_b = theme) == null ? void 0 : _b.componentConfig;\nconst container$d = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n width: 100,\n height: 100,\n color: theme.color.fillInverse\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand\n }\n },\n themeStyles: themeStyles$c\n};\nconst Container$d = makeComponentStyles(container$d);\nconst styles$d = {\n tone: defaultTone$d || \"neutral\",\n Container: Container$d\n};\nconst Icon$3 = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$d.Container.tones) == null ? void 0 : _a2[props.tone || styles$d.tone],\n styles$d.Container.base\n ];\n },\n forwardStates: true\n }));\n};\nconst { Badge: { defaultTone: defaultTone$c, ...themeStyles$b } = { styles: {} } } = (_c = theme) == null ? void 0 : _c.componentConfig;\nconst container$c = {\n themeKeys: {\n color: \"backgroundColor\"\n },\n base: {\n color: theme.color.fillInverseSecondary,\n borderRadius: theme.radius.sm,\n // borderRadius must be applied _before_ border to prevent the node from breaking\n border: {\n color: theme.color.strokeInverse,\n width: theme.stroke.sm\n },\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n padding: [\n theme.spacer.md - theme.stroke.sm,\n theme.spacer.xs + theme.stroke.sm,\n theme.spacer.md + theme.stroke.sm,\n theme.spacer.md + theme.stroke.sm\n ]\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutralSecondary,\n borderRadius: theme.radius.sm,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: theme.stroke.sm\n }\n },\n brand: {\n color: theme.color.fillBrand,\n borderRadius: theme.radius.sm,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: theme.stroke.sm\n }\n }\n },\n themeStyles: themeStyles$b\n};\nconst text$6 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.tag1,\n color: theme.color.textNeutral\n },\n tones: {\n inverse: {\n color: theme.color.textInverse\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$b\n};\nconst icon$2 = {\n themeKeys: {\n color: \"iconColor\"\n },\n base: {\n color: theme.color.textNeutral\n },\n tones: {\n inverse: {\n color: theme.color.textInverse\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$b\n};\nconst Container$c = makeComponentStyles(container$c);\nconst Icon$2 = makeComponentStyles(icon$2);\nconst Text$6 = makeComponentStyles(text$6);\nconst styles$c = {\n tone: defaultTone$c || \"neutral\",\n Container: Container$c,\n Icon: Icon$2,\n Text: Text$6\n};\nconst Badge = (props) => {\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2, _b2;\n return props.padding ?? ((_b2 = (_a2 = styles$c.Container) == null ? void 0 : _a2.tones[props.tone ?? styles$c.tone]) == null ? void 0 : _b2.padding) ?? styles$c.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$c.Container.tones[props.tone || styles$c.tone],\n styles$c.Container.base\n ];\n },\n \"forwardStates\": true\n }), true);\n insert(_el$, createComponent(Show, {\n get when() {\n return Boolean(props.icon && props.iconAlign !== \"right\");\n },\n get children() {\n return createComponent(Icon$3, mergeProps(() => props.icon, {\n get style() {\n return [styles$c.Icon.tones[props.tone ?? styles$c.tone], styles$c.Icon.base];\n }\n }));\n }\n }), null);\n insert(_el$, createComponent(Text$7, {\n get style() {\n return [styles$c.Text.tones[props.tone ?? styles$c.tone], styles$c.Text.base];\n },\n get tone() {\n return props.tone || styles$c.tone;\n },\n get children() {\n return props.title;\n }\n }), null);\n insert(_el$, createComponent(Show, {\n get when() {\n return Boolean(props.icon && props.iconAlign === \"right\");\n },\n get children() {\n return createComponent(Icon$3, mergeProps(() => props.icon, {\n get style() {\n var _a2;\n return [\n (_a2 = styles$c.Icon.tones) == null ? void 0 : _a2[props.tone ?? styles$c.tone],\n //\n styles$c.Icon.base\n ];\n }\n }));\n }\n }), null);\n return _el$;\n })();\n};\nconst { Button: { defaultTone: defaultTone$b, ...themeStyles$a } = { styles: {} } } = (_d = theme) == null ? void 0 : _d.componentConfig;\nconst container$b = {\n themeKeys: {\n textAlign: \"textAlign\",\n borderRadius: \"radius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\"\n },\n base: {\n height: theme.typography.button1.lineHeight + theme.spacer.xl * 2,\n display: \"flex\",\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n color: theme.color.interactiveNeutral,\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm,\n contentColor: theme.color.fillNeutral\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse\n },\n brand: {\n color: theme.color.interactiveBrand,\n focus: {\n color: theme.color.fillNeutral\n }\n }\n },\n themeStyles: themeStyles$a\n};\nconst content = {\n themeKeys: {\n color: \"contentColor\"\n },\n base: {\n color: theme.color.textNeutral\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.fillBrand\n }\n }\n },\n themeStyles: themeStyles$a\n};\nconst text$5 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.button1\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.fillBrand\n }\n }\n },\n themeStyles: themeStyles$a\n};\nconst Container$b = makeComponentStyles(container$b);\nconst Content = makeComponentStyles(content);\nconst Text$5 = makeComponentStyles(text$5);\nconst styles$b = {\n tone: defaultTone$b || \"neutral\",\n Container: Container$b,\n Content,\n Text: Text$5\n};\nconst Button = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$b.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$b.tone],\n styles$b.Container.base\n ];\n },\n forwardStates: true,\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n ...[(_a2 = props.style) == null ? void 0 : _a2.Text].flat(),\n //\n styles$b.Text.tones[props.tone ?? styles$b.tone],\n styles$b.Text.base\n ];\n },\n get children() {\n return props.children;\n }\n });\n }\n }));\n};\nconst ButtonContainer = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$b.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$b.tone],\n styles$b.Container.base\n ];\n },\n forwardStates: true\n }));\n};\nconst { Checkbox: { defaultTone: defaultTone$a, ...themeStyles$9 } = { styles: {} } } = (_e = theme) == null ? void 0 : _e.componentConfig;\nconst strokeWidth = theme.stroke.sm;\nconst size = theme.spacer.xxl;\nconst container$a = {\n themeKeys: {\n color: \"color\",\n borderRadius: \"borderRadius\",\n border: \"border\",\n justifyContent: \"justifyContent\"\n },\n base: {\n width: size,\n height: size,\n display: \"flex\",\n justifyContent: \"center\",\n color: theme.color.fillNeutral,\n alignItems: \"center\",\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverse,\n width: strokeWidth\n }\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n tones: {\n brand: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutralSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillBrand\n }\n },\n neutral: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillInverseSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutral\n }\n },\n inverse: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutralSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: strokeWidth\n },\n color: theme.color.fillInverse\n }\n }\n },\n modeKeys: [\"focus\", \"disabled\", \"checked\"],\n themeStyles: themeStyles$9\n};\nconst icon$1 = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n width: theme.spacer.lg,\n height: theme.spacer.lg,\n src: theme.asset.check\n },\n tones: {\n neutral: {\n color: theme.color.fillInverse\n },\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillInverse\n }\n },\n themeStyles: themeStyles$9\n};\nconst Container$a = makeComponentStyles(container$a);\nconst Icon$1 = makeComponentStyles(icon$1);\nconst styles$a = {\n tone: defaultTone$a || \"neutral\",\n Container: Container$a,\n Icon: Icon$1\n};\nconst check = \"/assets/images/check-icon.png\";\nconst Checkbox = (props) => {\n return createComponent(View, mergeProps({\n forwardStates: true\n }, props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$a.Container.tones[props.tone ?? styles$a.tone],\n styles$a.Container.base\n ];\n },\n get states() {\n return {\n checked: props.checked\n };\n },\n get children() {\n return memo(() => !!props.checked)() ? props.children || createComponent(Icon$3, {\n src: check,\n get style() {\n var _a2;\n return [\n ...[(_a2 = props.style) == null ? void 0 : _a2.Icon].flat(),\n //\n styles$a.Icon.tones[props.tone || styles$a.tone],\n styles$a.Icon.base\n ];\n }\n }) : \"\";\n }\n }));\n};\nconst { Column: { defaultTone: defaultTone$9, ...themeStyles$8 } = { styles: {} } } = (_f = theme) == null ? void 0 : _f.componentConfig;\nconst container$9 = {\n themeKeys: {\n gap: \"itemSpacing\",\n scrollIndex: \"scrollIndex\",\n itemTransition: \"itemTransition\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"flexStart\",\n flexDirection: \"column\",\n gap: theme.layout.gutterY,\n itemTransition: {\n ...theme.animation.standardEntrance,\n duration: theme.animation.duration.fast\n }\n },\n themeStyles: themeStyles$8\n};\nconst Container$9 = makeComponentStyles(container$9);\nconst styles$9 = {\n tone: defaultTone$9 || \"neutral\",\n Container: Container$9\n};\nconst Column = (props) => {\n const onUp = handleNavigation(\"up\");\n const onDown = handleNavigation(\"down\");\n return createComponent(View, mergeProps(props, {\n get onUp() {\n return chainFunctions(props.onUp, onUp);\n },\n get onDown() {\n return chainFunctions(props.onDown, onDown);\n },\n get selected() {\n return props.selected || 0;\n },\n forwardFocus: onGridFocus,\n get onSelectedChanged() {\n return chainFunctions(props.onSelectedChanged, props.scroll !== \"none\" ? withScrolling(props.y) : void 0);\n },\n get style() {\n return [...[props.style].flat(), styles$9.Container.tones[props.tone ?? styles$9.tone], styles$9.Container.base];\n }\n }));\n};\nconst { Label: { defaultTone: defaultTone$8, ...themeStyles$7 } = { styles: {} } } = (_g = theme) == null ? void 0 : _g.componentConfig;\nconst container$8 = {\n themeKeys: {\n color: \"backgroundColor\",\n borderRadius: \"radius\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"center\",\n color: theme.color.textNeutral,\n padding: [theme.spacer.md, theme.spacer.lg],\n // TODO themed padding values\n borderRadius: [theme.radius.md, theme.radius.md, theme.radius.md, theme.radius.none],\n height: theme.typography.caption1.lineHeight + theme.spacer.md,\n neutral: {\n backgroundColor: theme.color.fillNeutral\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.orange\n }\n }\n },\n themeStyles: themeStyles$7\n};\nconst text$4 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.caption1,\n color: theme.color.textInverse\n },\n tones: {\n inverse: {\n color: theme.color.textNeutral\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$7\n};\nconst Container$8 = makeComponentStyles(container$8);\nconst Text$4 = makeComponentStyles(text$4);\nconst styles$8 = {\n tone: defaultTone$8 || \"neutral\",\n Container: Container$8,\n Text: Text$4\n};\nconst Label = (props) => {\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2;\n return props.padding ?? ((_a2 = styles$8.Container.tones[props.tone ?? styles$8.tone]) == null ? void 0 : _a2.padding) ?? styles$8.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$8.Container.tones[props.tone || styles$8.tone],\n styles$8.Container.base\n ];\n },\n \"forwardStates\": true\n }), true);\n insert(_el$, createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$8.Text.tones[props.tone || styles$8.tone],\n styles$8.Text.base\n ];\n },\n get children() {\n return props.title;\n }\n }));\n return _el$;\n })();\n};\nconst { Rating: { styles: themeStyles$6, defaultTone: defaultTone$7 } = { styles: {}, defaultTone: \"neutral\" } } = (_h = theme) == null ? void 0 : _h.componentConfig;\nconst container$7 = {\n themeKeys: {\n justifyContent: \"justifyContent\",\n itemSpacing: \"itemSpacing\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n itemSpacing: theme.spacer.sm\n },\n toneModes: {},\n themeStyles: themeStyles$6\n};\nconst text$3 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n color: theme.color.textNeutral,\n ...theme.typography.body2\n },\n toneModes: {},\n themeStyles: themeStyles$6\n};\nconst icon = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n height: theme.typography.body2.lineHeight,\n width: theme.typography.body2.lineHeight,\n color: theme.color.fillNeutral,\n marginRight: theme.spacer.sm\n },\n toneModes: {},\n themeStyles: themeStyles$6\n};\nconst Container$7 = makeComponentStyles(container$7);\nconst Icon = makeComponentStyles(icon);\nconst Text$3 = makeComponentStyles(text$3);\nconst styles$7 = {\n tone: defaultTone$7,\n Container: Container$7,\n Text: Text$3,\n Icon\n};\nconst Rating = (props) => {\n const formatTitle = (title) => {\n if (typeof title !== \"string\" && typeof title !== \"number\" || !String(title).trim().length) {\n return;\n }\n let formatted = title;\n if (!Number.isNaN(title) && Number(title) >= 0 && Number(title) <= 100) {\n formatted += \"%\";\n }\n return formatted;\n };\n const formattedTitle = createMemo(() => formatTitle(props.title));\n return createComponent(View, mergeProps(props, {\n forwardStates: true,\n get style() {\n return [...[props.style].flat(), styles$7.Container.tones[props.tone || styles$7.tone], styles$7.Container.base];\n },\n get children() {\n return [createComponent(Show, {\n get when() {\n return props.src;\n },\n get children() {\n return createComponent(Icon$3, {\n forwardStates: true,\n get src() {\n return props.src;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Icon,\n //\n styles$7.Icon.tones[props.tone || styles$7.tone],\n styles$7.Icon.base\n ];\n }\n });\n }\n }), createComponent(Show, {\n get when() {\n return formattedTitle();\n },\n get children() {\n return createComponent(Text$7, {\n get marginRight() {\n return props.marginRight;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$7.Text.tones[props.tone || styles$7.tone],\n styles$7.Text.base\n ];\n },\n get children() {\n return formattedTitle();\n }\n });\n }\n })];\n }\n }));\n};\nconst { Details: { defaultTone: defaultTone$6, ...themeStyles$5 } = { styles: {} } } = (_i = theme) == null ? void 0 : _i.componentConfig;\nconst container$6 = {\n themeKeys: {\n alignItems: \"alignItems\",\n contentSpacing: \"contentSpacing\",\n badgeContentSpacing: \"badgeContentSpacing\",\n ratingContentSpacing: \"ratingContentSpacing\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n contentSpacing: theme.spacer.lg,\n badgeContentSpacing: theme.spacer.sm,\n ratingContentSpacing: theme.spacer.lg\n },\n themeStyles: themeStyles$5\n};\nconst text$2 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.body2,\n marginRight: theme.spacer.lg,\n color: theme.color.textNeutral\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverse,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutral,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$5\n};\nconst Container$6 = makeComponentStyles(container$6);\nconst Text$2 = makeComponentStyles(text$2);\nconst styles$6 = {\n tone: defaultTone$6 || \"neutral\",\n Container: Container$6,\n Text: Text$2\n};\nconst Details = (props) => {\n return createComponent(View, mergeProps({\n get style() {\n return [...[props.style].flat(), styles$6.Container.tones[props.tone || styles$6.tone], styles$6.Container.base];\n },\n forwardStates: true,\n onBeforeLayout: (node, dimensions) => {\n var _a2;\n if ((dimensions == null ? void 0 : dimensions.height) && node.parent) {\n node.parent.height = dimensions.height;\n (_a2 = node.parent) == null ? void 0 : _a2.updateLayout();\n }\n }\n }, props, {\n get children() {\n return [createComponent(Show, {\n get when() {\n return props.title;\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$6.Text.tones[props.tone || styles$6.tone],\n styles$6.Text.base\n ];\n },\n get children() {\n return props.title;\n }\n });\n }\n }), createComponent(For$1, {\n get each() {\n return props.badges;\n },\n children: (badge, idx) => createComponent(Badge, mergeProps(badge, {\n get marginRight() {\n var _a2, _b2, _c2, _d2, _e2, _f2, _g2;\n return ((_a2 = props.badges) == null ? void 0 : _a2.length) && idx() === props.badges.length - 1 ? ((_c2 = (_b2 = props.style) == null ? void 0 : _b2.Container) == null ? void 0 : _c2.contentSpacing) ?? ((_d2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _d2.contentSpacing) ?? styles$6.Container.base.contentSpacing : ((_f2 = (_e2 = props.style) == null ? void 0 : _e2.Container) == null ? void 0 : _f2.badgeContentSpacing) ?? ((_g2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _g2.badgeContentSpacing) ?? styles$6.Container.base.badgeContentSpacing;\n }\n }))\n }), createComponent(For$1, {\n get each() {\n return props.ratings;\n },\n children: (rating, idx) => createComponent(Rating, mergeProps(rating, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$6.Text.tones[props.tone || styles$6.tone],\n styles$6.Text.base\n ];\n },\n forwardStates: true,\n get marginRight() {\n var _a2, _b2, _c2, _d2;\n return ((_a2 = props.ratings) == null ? void 0 : _a2.length) && idx() === props.ratings.length - 1 ? 0 : ((_c2 = (_b2 = props.style) == null ? void 0 : _b2.Container) == null ? void 0 : _c2.ratingContentSpacing) ?? ((_d2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _d2.ratingContentSpacing) ?? styles$6.Container.base.ratingContentSpacing;\n }\n }))\n })];\n }\n }));\n};\nconst { Metadata: { defaultTone: defaultTone$5, ...themeStyles$4 } = { styles: {} } } = (_j = theme) == null ? void 0 : _j.componentConfig;\nconst container$5 = {\n themeKeys: {\n justifyContent: \"justifyContent\",\n alpha: \"alpha\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n alpha: theme.alpha.primary\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n themeStyles: themeStyles$4\n};\nconst titleText = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n maxLines: 1,\n contain: \"width\",\n ...theme.typography.headline3,\n color: theme.color.textNeutral\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverse,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutral,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$4\n};\nconst descriptionText = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n contain: \"width\",\n maxLines: 2,\n ...theme.typography.body2,\n color: theme.color.textNeutralSecondary\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverseSecondary,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutralSecondary,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$4\n};\nconst Container$5 = makeComponentStyles(container$5);\nconst DescriptionText = makeComponentStyles(descriptionText);\nconst TitleText = makeComponentStyles(titleText);\nconst styles$5 = {\n tone: defaultTone$5 || \"neutral\",\n Container: Container$5,\n TitleText,\n DescriptionText\n};\nconst Metadata = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n return [...[props.style].flat(), styles$5.Container.tones[props.tone || styles$5.tone], styles$5.Container.base];\n },\n forwardStates: true,\n get children() {\n return [createComponent(Text$7, {\n get width() {\n return props.width;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.TitleText,\n //\n styles$5.TitleText.tones[props.tone || styles$5.tone],\n styles$5.TitleText.base\n ];\n },\n get children() {\n return props.title;\n }\n }), createComponent(Show, {\n get when() {\n return props.description;\n },\n get children() {\n return createComponent(Text$7, {\n get width() {\n return props.width;\n },\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.DescriptionText, styles$5.DescriptionText.tones[props.tone || styles$5.tone], styles$5.DescriptionText.base];\n },\n get children() {\n return props.description;\n }\n });\n }\n }), createComponent(Details, mergeProps({\n get width() {\n return props.width;\n }\n }, () => props.details, {\n get tone() {\n return props.tone ?? styles$5.tone;\n }\n }))];\n }\n }));\n};\nconst { ProgressBar: { defaultTone: defaultTone$4, ...themeStyles$3 } = { styles: {} } } = (_k = theme) == null ? void 0 : _k.componentConfig;\nconst container$4 = {\n themeKeys: {\n color: \"barColor\",\n borderRadius: \"borderRadius\"\n },\n base: {\n height: theme.spacer.md,\n color: theme.color.fillNeutralTertiary,\n borderRadius: theme.radius.xs\n },\n tones: {\n inverse: {\n color: theme.color.fillInverseTertiary\n }\n },\n themeStyles: themeStyles$3\n};\nconst progress = {\n themeKeys: {\n color: \"progressColor\",\n borderRadius: \"borderRadius\"\n },\n base: {\n borderRadius: theme.radius.xs,\n color: theme.color.fillNeutral\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand\n }\n },\n themeStyles: themeStyles$3\n};\nconst Container$4 = makeComponentStyles(container$4);\nconst ProgressBar$1 = makeComponentStyles(progress);\nconst styles$4 = {\n tone: defaultTone$4 || \"neutral\",\n Container: Container$4,\n ProgressBar: ProgressBar$1\n};\nconst ProgressBar = (props) => {\n return createComponent(View, mergeProps(props, {\n forwardStates: true,\n get style() {\n return [...[props.style].flat(), styles$4.Container.tones[props.tone || styles$4.tone], styles$4.Container.base];\n },\n get children() {\n return createComponent(View, {\n forwardStates: true,\n get animationSettings() {\n return props.animationSettings;\n },\n get width() {\n return props.width * props.progress;\n },\n get color() {\n return props.progressColor;\n },\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.ProgressBar, styles$4.ProgressBar.tones[props.tone || styles$4.tone], styles$4.ProgressBar.base];\n }\n });\n }\n }));\n};\nconst { Row: { defaultTone: defaultTone$3, ...themeStyles$2 } = { styles: {} } } = (_l = theme) == null ? void 0 : _l.componentConfig;\nconst container$3 = {\n themeKeys: {\n gap: \"itemSpacing\",\n scrollIndex: \"scrollIndex\",\n itemTransition: \"itemTransition\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"flexStart\",\n flexDirection: \"row\",\n gap: theme.layout.gutterX,\n width: theme.layout.screenW,\n itemTransition: {\n ...theme.animation.standardEntrance,\n duration: theme.animation.duration.fast\n }\n },\n themeStyles: themeStyles$2\n};\nconst Container$3 = makeComponentStyles(container$3);\nconst styles$3 = {\n tone: defaultTone$3,\n Container: Container$3\n};\nconst Row = (props) => {\n const onLeft = handleNavigation(\"left\");\n const onRight = handleNavigation(\"right\");\n return createComponent(View, mergeProps(props, {\n get selected() {\n return props.selected || 0;\n },\n get onLeft() {\n return chainFunctions(props.onLeft, onLeft);\n },\n get onRight() {\n return chainFunctions(props.onRight, onRight);\n },\n forwardFocus: onGridFocus,\n get onSelectedChanged() {\n return chainFunctions(props.onSelectedChanged, props.scroll !== \"none\" ? withScrolling(props.x) : void 0);\n },\n get tone() {\n return props.tone ?? styles$3.tone;\n },\n get style() {\n return [...[props.style].flat(), styles$3.Container.tones[props.tone || styles$3.tone], styles$3.Container.base];\n },\n get states() {\n return props.tone ?? styles$3.tone;\n }\n }));\n};\nconst { Keyboard: { defaultTone: defaultTone$2, ...themeStyles$1 } = { styles: {} } } = (_m = theme) == null ? void 0 : _m.componentConfig;\nconst container$2 = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n screenW: \"screenW\",\n marginX: \"marginX\"\n },\n base: {\n keySpacing: theme.spacer.md,\n screenW: theme.layout.screenW,\n marginX: theme.layout.marginX,\n height: 100\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$1\n};\nconst key = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n textAlign: \"textAlign\",\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\",\n baseWidth: \"baseWidth\",\n sizes: \"sizes\",\n contentColor: \"contentColor\"\n // what is this used for\n },\n base: {\n keySpacing: theme.spacer.md,\n height: theme.spacer.md * 9,\n paddingX: theme.spacer.md,\n sizes: {\n sm: 1,\n md: 2,\n lg: 3,\n xl: 4,\n xxl: 5\n },\n contentColor: theme.color.fillNeutral,\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n baseWidth: theme.spacer.md * 7,\n color: theme.color.interactiveNeutral,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled,\n contentColor: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse,\n focus: {\n color: theme.color.interactiveInverseFocus,\n contentColor: theme.color.fillNeutral\n }\n },\n brand: {\n focus: {\n contentColor: theme.color.fillNeutral\n }\n }\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$1\n};\nconst text$1 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.headline2\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n focus: {\n color: theme.color.textNeutral\n }\n }\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$1\n};\nconst Container$2 = makeComponentStyles(container$2);\nconst Key$1 = makeComponentStyles(key);\nconst Text$1 = makeComponentStyles(text$1);\nconst styles$2 = {\n tone: defaultTone$2,\n Container: Container$2,\n Key: Key$1,\n // TODO why was this wrapped in {}?\n Text: Text$1\n};\nconst { Key: { defaultTone: defaultTone$1, ...themeStyles } = { styles: {} } } = (_n = theme) == null ? void 0 : _n.componentConfig;\nconst container$1 = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n textAlign: \"textAlign\",\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\",\n baseWidth: \"baseWidth\",\n sizes: \"sizes\",\n contentColor: \"contentColor\"\n },\n base: {\n keySpacing: theme.spacer.md,\n height: theme.spacer.md * 9,\n paddingX: theme.spacer.md,\n contentColor: theme.color.fillNeutral,\n sizes: {\n sm: 1,\n md: 2,\n lg: 3,\n xl: 4,\n xxl: 5\n },\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n baseWidth: theme.spacer.md * 7,\n color: theme.color.interactiveNeutral,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled,\n contentColor: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse,\n focus: {\n color: theme.color.interactiveInverseFocus,\n contentColor: theme.color.fillNeutral\n }\n },\n brand: {\n focus: {\n contentColor: theme.color.fillNeutral\n }\n }\n },\n themeStyles\n};\nconst text = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.headline2\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n focus: {\n color: theme.color.textNeutral\n }\n }\n },\n themeStyles\n};\nconst Container$1 = makeComponentStyles(container$1);\nconst Text = makeComponentStyles(text);\nconst styles$1 = {\n tone: defaultTone$1 || \"neutral\",\n Container: Container$1,\n Text\n};\nconst Key = (props) => {\n const style1 = (props == null ? void 0 : props.style) ?? styles$1;\n return createComponent(ButtonContainer, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$1.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$1.tone],\n styles$1.Container.base\n ];\n },\n forwardStates: true,\n get width() {\n var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2;\n return (((_d2 = (_c2 = (_b2 = (_a2 = style1.Container) == null ? void 0 : _a2.tones) == null ? void 0 : _b2[props.tone ?? styles$1.tone]) == null ? void 0 : _c2.sizes) == null ? void 0 : _d2[props.size || \"sm\"]) ?? style1.Container.base.sizes[props.size || \"sm\"]) * (((_g2 = (_f2 = (_e2 = style1.Container) == null ? void 0 : _e2.tones) == null ? void 0 : _f2[props.tone ?? styles$1.tone]) == null ? void 0 : _g2.baseWidth) ?? style1.Container.base.baseWidth) + (((_i2 = (_h2 = style1.Container.tones) == null ? void 0 : _h2[props.tone ?? styles$1.tone]) == null ? void 0 : _i2.keySpacing) ?? style1.Container.base.keySpacing) * (((_l2 = (_k2 = (_j2 = style1.Container.tones) == null ? void 0 : _j2[props.tone ?? styles$1.tone]) == null ? void 0 : _k2.sizes) == null ? void 0 : _l2[props.size || \"sm\"]) ?? style1.Container.base.sizes[props.size || \"sm\"] - 1);\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$1.Text.tones[props.tone ?? styles$1.tone],\n styles$1.Text.base\n ];\n },\n get children() {\n return props.title ? props.title : \"\";\n }\n });\n }\n }));\n};\nconst KeyboardSimple = (props) => {\n return createComponent(Column, {\n get autofocus() {\n return props.autofocus;\n },\n plinko: true,\n get itemSpacing() {\n var _a2;\n return props.keySpacing ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.keySpacing) ?? styles$2.Container.base.keySpacing;\n },\n get justifyContent() {\n return props.centerKeyboard && props.centerKeyboard ? \"center\" : \"flexStart\";\n },\n get children() {\n return createComponent(For, {\n get each() {\n return props.formats;\n },\n children: (row) => createComponent(Row, {\n get justifyContent() {\n return props.centerKeys && props.centerKeys ? \"center\" : \"flexStart\";\n },\n get itemSpacing() {\n var _a2;\n return props.keySpacing ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.keySpacing) ?? styles$2.Container.base.keySpacing;\n },\n get height() {\n var _a2;\n return (props == null ? void 0 : props.height) ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.height) ?? styles$2.Container.base.height;\n },\n get wrap() {\n return props.rowWrap;\n },\n get children() {\n return createComponent(For, {\n each: row,\n children: (key2) => createComponent(Key, mergeProps({\n get style() {\n var _a2;\n return (_a2 = props.style) == null ? void 0 : _a2.Key;\n }\n }, typeof key2 === \"string\" ? {} : key2, {\n get title() {\n return key2.title || key2.icon ? key2.title : key2;\n }\n }))\n });\n }\n })\n });\n }\n });\n};\nconst Keyboard = (props) => {\n return createComponent(KeyboardSimple, mergeProps(props, {\n get style() {\n return [...[props.style].flat(), styles$2.Container.tones[props.tone ?? styles$2.tone], styles$2.Container.base];\n }\n }));\n};\nconst { Tile: { defaultTone, ...tileThemeStyles } = { styles: {} } } = (_o = theme) == null ? void 0 : _o.componentConfig;\nconst { Surface: { defaultSurfaceTone, ...surfaceThemeStyles } = { styles: {} } } = (_p = theme) == null ? void 0 : _p.componentConfig;\nconst container = {\n themeKeys: {\n alpha: \"alpha\",\n paddingYProgress: \"paddingYProgress\"\n },\n base: {\n width: 400,\n height: 240,\n padding: [40, 10],\n // TODO support separate paddingX and paddingY values from theme, possibly formatter\n paddingYProgress: theme.spacer.xl,\n paddingYBetweenContent: theme.spacer.md,\n borderRadius: theme.radius.md,\n alpha: theme.alpha.primary\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n themeStyles: {\n ...surfaceThemeStyles,\n ...tileThemeStyles\n }\n};\nconst insetBottom = {\n themeKeys: {},\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n mountY: 1\n },\n themeStyles: tileThemeStyles\n};\nconst standardBottom = {\n themeKeys: {},\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\"\n },\n themeStyles: tileThemeStyles\n};\nconst logoContainer = {\n themeKeys: {},\n base: {\n width: theme.spacer.lg * 5,\n height: theme.spacer.xxl + theme.spacer.md\n },\n themeStyles: tileThemeStyles\n};\nconst Container = makeComponentStyles(container);\nconst InsetBottom = makeComponentStyles(insetBottom);\nconst StandardBottom = makeComponentStyles(standardBottom);\nconst LogoContainer = makeComponentStyles(logoContainer);\nconst styles = {\n tone: defaultTone || defaultSurfaceTone || \"neutral\",\n Container,\n InsetBottom,\n StandardBottom,\n LogoContainer\n};\nconst Tile = (props) => {\n const [isFocused, setIsFocused] = createSignal(false);\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2;\n return props.padding ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.padding) ?? styles.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n \"onFocus\": () => setIsFocused(true),\n \"onBlur\": () => setIsFocused(false),\n get style() {\n return [...[props.style].flat(), styles.Container.tones[props.tone ?? styles.tone], styles.Container.base];\n }\n }), true);\n insert(_el$, createComponent(Artwork, mergeProps(() => props.artwork, {\n get tone() {\n return props.tone ?? styles.tone;\n },\n get width() {\n var _a2;\n return props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width;\n },\n get height() {\n var _a2;\n return props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height;\n }\n })), null);\n insert(_el$, createComponent(Show, {\n get when() {\n return props.persistentMetadata || isFocused();\n },\n get children() {\n return [createComponent(View, {\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[1]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[1]) ?? styles.Container.base.padding[1];\n },\n get children() {\n return props.topLeft;\n }\n }), createComponent(View, {\n get x() {\n var _a2, _b2, _c2;\n return ((props == null ? void 0 : props.width) ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[0]) ?? ((_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0]);\n },\n get y() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[1]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[1]) ?? styles.Container.base.padding[1];\n },\n mountX: 1,\n get children() {\n return props.topRight;\n }\n }), createComponent(View, {\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.InsetBottom, styles.InsetBottom.tones[props.tone ?? styles.tone], styles.InsetBottom.base];\n },\n get width() {\n var _a2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - styles.Container.base.padding[0] * 2;\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2, _d2, _e2, _f2;\n return (props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) - (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]) - (((_e2 = props.progressBar) == null ? void 0 : _e2.progress) > 0 ? props.paddingYProgress ?? ((_f2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _f2.paddingYProgress) ?? styles.Container.base.paddingYProgress : 0);\n },\n get children() {\n return props.inset;\n }\n }), createComponent(View, {\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.StandardBottom, styles.StandardBottom.tones[props.tone ?? styles.tone], styles.StandardBottom.base];\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2, _d2;\n return Number(props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) + (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]);\n },\n get width() {\n var _a2, _b2, _c2, _d2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]) * 2;\n },\n get children() {\n return props.bottom;\n }\n })];\n }\n }), null);\n insert(_el$, createComponent(Show, {\n get when() {\n var _a2;\n return ((_a2 = props.progressBar) == null ? void 0 : _a2.progress) ? props.progressBar.progress > 0 : 0;\n },\n get children() {\n return createComponent(ProgressBar, mergeProps(() => props.progressBar, {\n get width() {\n var _a2, _b2, _c2, _d2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[0]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[0]) ?? styles.Container.base.padding[0]) * 2;\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2;\n return (props.height ?? props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) - (props.paddingYProgress ?? ((_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.paddingYProgress) ?? styles.Container.base.paddingYProgress) - (((_c2 = props == null ? void 0 : props.progressBar) == null ? void 0 : _c2.height) || 0);\n }\n }));\n }\n }), null);\n return _el$;\n })();\n};\nexport {\n Artwork,\n Badge,\n Button,\n ButtonContainer,\n Checkbox,\n Column,\n Icon$3 as Icon,\n Keyboard,\n Label,\n Metadata,\n ProgressBar,\n Row,\n Tile,\n styles$e as artworkStyles,\n assertTruthy,\n styles$c as badgeStyles,\n styles$b as buttonStyles,\n chainFunctions,\n styles$a as checkboxStyles,\n styles$9 as columnStyles,\n handleNavigation,\n styles$d as iconStyles,\n styles$2 as keyboardStyles,\n styles$8 as labelStyles,\n makeComponentStyles,\n styles$5 as metadataStyles,\n onGridFocus,\n styles$4 as progressBarStyles,\n styles$3 as rowStyles,\n scrollToIndex,\n styles as tileStyles,\n useItemLayout,\n withScrolling\n};\n//# sourceMappingURL=index.js.map\n","import { IntrinsicNodeStyleProps, hexColor } from '@lightningjs/solid';\nimport theme from 'theme';\n\nexport default {\n Column: {\n flexDirection: 'column',\n display: 'flex',\n width: 320,\n height: 600,\n y: 360,\n gap: 20,\n zIndex: 101,\n transition: { x: {\n duration: 250,\n easing: 'ease-in-out'\n }},\n x: 8,\n focus: {\n x: theme.layout.marginX\n },\n } satisfies IntrinsicNodeStyleProps,\n Gradient: {\n zIndex: 99,\n color: hexColor('#000000'),\n src: './assets/sidenav.png',\n alpha: 0,\n width: 1200,\n height: 1080,\n focus: {\n alpha: 1\n },\n transition: { alpha: true }\n } satisfies IntrinsicNodeStyleProps,\n NavButton: {\n zIndex: 102,\n height: 70,\n width: 100,\n borderRadius: 8,\n focus: {\n color: hexColor(theme.color.material),\n },\n active: {\n width: 328,\n height: 70,\n },\n } satisfies IntrinsicNodeStyleProps,\n};\n","import { For, IntrinsicNodeProps, View } from '@lightningjs/solid';\nimport { createSpriteMap } from '@lightningjs/solid-primitives';\n// Icons from https://uxwing.com/\n\nconst basePath = import.meta.env.BASE_URL;\n\nconst icons = [\n { name: 'experiment', width: 81, height: 100, x: 0, y: 0 },\n { name: 'trending', width: 100, height: 56, x: 81, y: 0 },\n { name: 'tv', width: 100, height: 68, x: 181, y: 0 },\n { name: 'movie', width: 94, height: 100, x: 282, y: 0 },\n];\n\ninterface IconProps extends IntrinsicNodeProps {\n name: string;\n}\n\nfunction Icon(props: IconProps) {\n const sprite = createSpriteMap(basePath + 'assets/icons_white.png', icons);\n\n return (\n \n );\n}\n\nexport default Icon;\nexport function PreviewIcons() {\n return (\n <>\n \n \n {(icon, i) => }\n \n \n );\n}\n","import { useNavigate } from '@solidjs/router';\nimport { View, Text, IntrinsicNodeProps, ElementNode } from '@lightningjs/solid';\nimport { Column } from '@lightningjs/solid-ui';\nimport styles from './NavDrawer.styles';\nimport Icon from '../Icon';\nimport theme from 'theme';\n\ninterface NavButtonProps extends IntrinsicNodeProps {\n icon: string;\n children: string;\n}\n\nfunction NavButton(props: NavButtonProps) {\n return (\n \n \n \n \n \n {props.children}\n \n \n );\n}\n\nexport default function NavDrawer(props) {\n let backdrop;\n const navigate = useNavigate();\n\n function onFocus(this: ElementNode) {\n backdrop.states.add('focus');\n this.children.forEach((c) => c.states!.add('active'));\n this.children.selected!.setFocus();\n }\n\n function onBlur(this: ElementNode) {\n backdrop.states.remove('focus');\n this.selected = 0;\n this.children.forEach((c) => c.states!.remove('active'));\n }\n\n return (\n <>\n \n navigate('/browse/all')} icon='trending'>Trending\n navigate('/browse/movie')}>Movies\n navigate('/browse/tv')}>TV\n navigate('/examples')}>Examples\n \n \n \n );\n}\n","import { View, Text, hexColor } from '@lightningjs/solid';\nimport { createSignal } from 'solid-js';\nimport { debounce } from '@solid-primitives/scheduled';\n\nconst fpsStyle = {\n color: 0x000000ff,\n height: 90,\n width: 330,\n x: 1500,\n y: 20,\n alpha: 0.8,\n zIndex: 100,\n}\n\nconst fpsLabel = {\n x: 10,\n fontSize: 36,\n textColor: hexColor('#ffffff')\n}\n\nconst fpsValue = {\n fontSize: 36,\n textColor: hexColor('#ffffff')\n}\n\nconst [fps, setFps] = createSignal(0);\nconst [avgFps, setAvgFps] = createSignal(0);\nconst [minFps, setMinFps] = createSignal(99);\nconst [maxFps, setMaxFps] = createSignal(0);\n\nlet count = 0;\nlet totalFps = 0;\n\n\nconst resetCounter = debounce(() => {\n // clear fps\n totalFps = 0;\n count = 0;\n setMinFps(99);\n}, 10000);\n\n// Clear min fps after 10 seconds to avoid showing a low fps\n// setTimeout(() => setMinFps(99), 9999);\n\nconst calcFps = (fps: number) => {\n if (!fps) return;\n\n setFps(fps);\n setMinFps(prev => Math.min(fps, prev));\n setMaxFps(prev => Math.max(fps, prev));\n\n totalFps += fps\n count++;\n\n setAvgFps( Math.round(totalFps / count) );\n\n resetCounter();\n}\n\nexport function setupFPS(root) {\n root.renderer.on('fpsUpdate', (target, fpsData) => {\n const fps = typeof fpsData === 'number' ? fpsData : fpsData.fps;\n if (fps > 5) {\n calcFps(fps);\n }\n });\n}\n\nexport const FPSCounter = (props) => {\n return \n \n FPS:\n {fps().toString()}\n \n\n \n AVG:\n {avgFps().toString()}\n \n\n \n MIN:\n {minFps().toString()}\n \n \n \n MAX:\n {maxFps().toString()}\n \n \n}\n","import { useNavigate } from \"@solidjs/router\";\nimport { View, activeElement, hexColor, renderer } from \"@lightningjs/solid\";\nimport { useFocusManager, useAnnouncer } from \"@lightningjs/solid-primitives\";\nimport Background from \"../components/Background\";\nimport NavDrawer from \"../components/NavDrawer/NavDrawer\";\nimport { FocusRing } from \"../components\";\nimport { FPSCounter, setupFPS } from \"../components/FPSCounter\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\nimport { onMount } from \"solid-js\";\n\ndeclare module \"@lightningjs/solid-primitives\" {\n // Augment the FocusManager KeyMap interface with our custom keys\n interface KeyMap {\n Announcer: string;\n Menu: string;\n Escape: string;\n }\n}\n\ndeclare module \"@lightningjs/solid\" {\n interface ElementNode {\n heroContent?: boolean;\n backdrop?: any;\n entityInfo?: any;\n href?: string;\n }\n}\n\nconst App = (props) => {\n useFocusManager({\n Announcer: \"a\",\n Menu: \"m\",\n Escape: \"Escape\",\n });\n const announcer = useAnnouncer();\n announcer.enabled = false;\n const navigate = useNavigate();\n\n let focusRingRef, navDrawer, lastFocused, happy;\n\n onMount(() => {\n setupFPS({ renderer });\n });\n\n return (\n (announcer.enabled = !announcer.enabled)}\n onLast={() => history.back()}\n onMenu={() => navigate(\"/\")}\n style={{ width: 1920, height: 1080 }}\n onLeft={() => {\n if (navDrawer.states.has(\"focus\")) {\n return false;\n }\n lastFocused = activeElement();\n navDrawer.setFocus();\n }}\n onRight={() => navDrawer.states.has(\"focus\") && lastFocused.setFocus()}\n >\n \n \n\n {props.children}\n\n \n {/* */}\n \n );\n};\n\nexport default App;\n","import { IntrinsicNodeStyleProps, IntrinsicTextNodeStyleProps, hexColor } from '@lightningjs/solid';\nimport theme from 'theme';\n\n// Augment existing intrinsic style prop interfaces to include our own\n// app-specific states\ndeclare module '@lightningjs/solid' {\n interface IntrinsicNodeStyleProps {\n // TODO: Refactor states to use a $ prefix\n active?: IntrinsicNodeStyleProps;\n disabled?: IntrinsicNodeStyleProps;\n }\n\n interface IntrinsicTextNodeStyleProps {\n // TODO: Refactor states to use a $ prefix\n active?: IntrinsicTextNodeStyleProps;\n disabled?: IntrinsicTextNodeStyleProps;\n }\n}\n\nexport default {\n Page: {\n width: 1920, height: 1080\n } satisfies IntrinsicNodeStyleProps,\n headlineText: {\n width: 1200, height: 240,\n x: 360,\n // lineHeight: 170, // TODO: Add back when lineHeight is supported\n y: 455, contain: 'both',\n fontSize: 66,\n textAlign: 'center'\n } satisfies IntrinsicTextNodeStyleProps,\n headlineSubText: {\n width: 960,\n height: 170,\n // lineHeight: 170, // TODO: Add back when lineHeight is supported\n x: 530,\n y: 655, contain: 'both',\n fontSize: 48,\n textAlign: 'center'\n } satisfies IntrinsicTextNodeStyleProps,\n itemsContainer: {\n width: theme.layout.screenW,\n height: 600,\n y: 560,\n x: 0,\n zIndex: 2,\n } satisfies IntrinsicNodeStyleProps,\n Thumbnail: {\n borderRadius: 16,\n width: 185, height: 278, scale: 1, zIndex: 2,\n transition: { scale: { duration: 250, easing: 'ease-in-out' } },\n border: { width: 0, color: 0x00000000 },\n focus: { scale: 1.1, border: { color: 0xffffff66, width: 8 } }\n } satisfies IntrinsicNodeStyleProps,\n FocusRing: {\n borderRadius: 16,\n width: 194, height: 286, y: -5, x: -5, zIndex: -1,\n } satisfies IntrinsicNodeStyleProps,\n FPS: {\n color: 0x000000ff,\n height: 42,\n width: 140,\n x: 20,\n y: 20,\n zIndex: 100,\n } as const,\n FPSLabel: {\n x: 10,\n y: 0,\n fontSize: 36,\n textColor: hexColor('#ffffff')\n },\n FPSValue: {\n x: 90,\n y: 0,\n fontSize: 36,\n textColor: hexColor('#ffffff')\n },\n showHeadline: { x: 70, y: 20 } satisfies IntrinsicNodeStyleProps,\n headlineBlur: {\n width: 1920,\n height: 150,\n x: 0,\n y: 0,\n zIndex: 14,\n alpha: 0.9,\n color: hexColor('#000000')\n } satisfies IntrinsicNodeStyleProps,\n RowTitle: {\n height: 60,\n width: 300,\n marginTop: 20,\n fontSize: 36,\n color: hexColor('#f0f0f0'),\n zIndex: 2\n } satisfies IntrinsicTextNodeStyleProps,\n Row: {\n display: 'flex',\n justifyContent: 'spaceBetween',\n height: 300,\n } satisfies IntrinsicNodeStyleProps,\n Column: {\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'flexStart',\n gap: 20,\n width: theme.layout.screenW - (2 * theme.layout.marginX),\n x: theme.layout.marginX + theme.layout.gutterX,\n y: 48,\n transition: { y: { duration: 250, easing: 'ease-in-out' } },\n zIndex: 2\n } satisfies IntrinsicNodeStyleProps,\n Rect: {\n width: 250,\n height: 100,\n y: 10,\n x: 300,\n color: hexColor('#0000ff')\n } satisfies IntrinsicNodeStyleProps,\n peopleBio: {\n ...theme.typography.body1,\n contain: 'both',\n width: 1500,\n height: 400\n } satisfies IntrinsicTextNodeStyleProps,\n};\n\nconst Button = {\n width: 120,\n height: 40,\n color: hexColor('#000000'),\n borderRadius: 8,\n border: { width: 2, color: hexColor('#3333ff') },\n scale: 1,\n focus: {\n scale: 1.1,\n border: { width: 5, color: hexColor('#333333') },\n },\n transition: { scale: true, color: true },\n} satisfies IntrinsicNodeStyleProps;\n\nconst TopBar = {\n color: hexColor('#00A699'),\n height: 8,\n y: 2,\n x: -4,\n width: Button.width + 8\n} satisfies IntrinsicNodeStyleProps;\n\nconst ButtonText = {\n fontSize: 12,\n y: 12,\n // lineHeight: Button.height, // TODO: Add back when lineHeight is supported\n contain: 'width',\n textAlign: 'center',\n color: hexColor('#F6F6F9'),\n height: Button.height,\n width: Button.width\n} satisfies IntrinsicTextNodeStyleProps;\n\nexport const buttonStyles = {\n container: Button,\n topBar: TopBar,\n text: ButtonText\n} satisfies Record;\n\n\nexport const MaterialButton = {\n width: 386,\n height: 136,\n color: hexColor('#715cab'),\n focus: {\n color: hexColor('#5a39a2'),\n },\n disabled: {\n color: hexColor('#291d43'),\n }\n} satisfies IntrinsicNodeStyleProps;\n\nexport const MaterialButtonText = {\n fontSize: 32,\n contain: 'width',\n textAlign: 'center',\n mountY: -0.35,\n color: hexColor('#FFFFFF'),\n height: MaterialButton.height,\n width: MaterialButton.width,\n // lineHeight: MaterialButton.height, // TODO: Add back when lineHeight is supported\n focus: {\n fontSize: 40\n },\n disabled: {\n color: hexColor('#909090'),\n }\n} satisfies IntrinsicTextNodeStyleProps;\n","import { IntrinsicNodeProps, View, Text } from '@lightningjs/solid';\nimport { Row } from '@lightningjs/solid-ui';\nimport { For, splitProps } from 'solid-js';\nimport styles, { buttonStyles } from '../styles';\nimport { type Tile } from '../api/formatters/ItemFormatter';\n\nexport function Thumbnail(props: IntrinsicNodeProps) {\n return \n}\n\nexport function FocusRing(props: IntrinsicNodeProps) {\n return \n}\n\nexport interface TileRowProps extends IntrinsicNodeProps {\n items: Tile[];\n}\n\nexport function TileRow(props: TileRowProps) {\n const [local, others] = splitProps(props, [\"items\"]);\n\n return \n \n {(item) => }\n \n \n\n}\n\nexport function Button(props) {\n return (\n \n {props.children}\n \n );\n}","export default 'eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyZDE4YjEwMTA0YjdiZTlkNjFiMWYwYjVlMGEwNzM2OCIsInN1YiI6IjYwZTVjMTdlNGNhNjc2MDA3NTA4Njc3MSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.D_nqH9kd-bhhWzeVsTDPYhHnsUaNAuyAa6YATmKHqsA';\n","import API_KEY_V4 from './key';\nconst API_BASE = 'https://api.themoviedb.org/3';\nlet tmdbConfig;\nlet baseImageUrl;\nconst basePosterSize = 'w185';\n\nconst defaultFetchParams = {\n headers: {\n 'Content-Type': 'application/json',\n Authorization: 'Bearer ' + API_KEY_V4,\n },\n};\n\nexport function getImageUrl(path: string, posterSize: string = basePosterSize) {\n return baseImageUrl + posterSize + path;\n}\n\nfunction get(path: string, params: RequestInit = {}) {\n if (tmdbConfig) {\n return _get(path, params);\n } else {\n return loadConfig().then(() => _get(path, params))\n }\n}\n\nfunction _get(path: string, params: RequestInit = {}) {\n return fetch(API_BASE + path, {\n ...defaultFetchParams,\n ...params,\n }).then((r) => r.json());\n}\n\nfunction loadConfig() {\n return _get('/configuration').then((data) => {\n tmdbConfig = data;\n baseImageUrl = data.images?.secure_base_url;\n return data;\n });\n}\n\nexport default {\n get,\n loadConfig,\n};\n","import { getImageUrl } from '../index';\n\nfunction truncateString(str: string, maxLength: number): string {\n if (str.length > maxLength) {\n return str.substring(0, maxLength - 3) + '...';\n }\n return str;\n}\n\nexport function chunkArray(array: string[], size = 7) {\n let result: string[][] = [];\n for (let i = 0, j = array.length; i < j; i += size) {\n result.push(array.slice(i, i + size));\n }\n return result;\n}\n\nexport interface Tile {\n src: string;\n tileSrc: string;\n backdrop: string;\n href: string;\n shortTitle: string;\n title: string;\n data: unknown;\n entityInfo: {\n type: string;\n id: string;\n };\n heroContent: {\n title: string;\n description: string;\n };\n}\n\n// TODO: Remove `any` type\nexport function convertItemsToTiles(items: any[] = []): Tile[] {\n return items.map((item) => ({\n src: getImageUrl(item.poster_path || item.profile_path),\n tileSrc: getImageUrl(item.backdrop_path || item.profile_path, 'w300'),\n backdrop: getImageUrl(item.backdrop_path, 'w1280'),\n href: `/entity/${item.media_type || 'people'}/${item.id}`,\n shortTitle: truncateString(item.title || item.name, 30),\n title: item.title || item.name,\n data: item,\n entityInfo: {\n type: item.media_type || 'people',\n id: item.id\n },\n heroContent: {\n title: item.title || item.name,\n description: item.overview\n }\n }));\n}\n","import api from '..';\nimport { convertItemsToTiles, chunkArray } from '../formatters/ItemFormatter';\n\nlet cache = new Map();\nconst leftoverTiles = new Map();\n\nexport default function (filter: string) {\n return (pageIndex: number): Promise => {\n const url = `/trending/${filter}/week?page=${pageIndex}`;\n if (cache.has(url)) {\n return cache.get(url);\n }\n\n let result = api.get(url).then((trending) => {\n let results = trending.results.filter((r) => !r.adult);\n let tiles = (leftoverTiles.has(filter) ? leftoverTiles.get(filter) : []).concat(convertItemsToTiles(results));\n let chunks = chunkArray(tiles);\n if (chunks[chunks.length - 1].length < 7) {\n leftoverTiles.set(filter, chunks.pop());\n } else {\n leftoverTiles.delete(filter);\n }\n return chunks;\n });\n\n cache.set(url, result);\n return result;\n }\n}\n","import { createSignal, createComputed, batch, createResource } from \"solid-js\";\n\nexport function createInfiniteScroll(fetcher: (page: number) => Promise) {\n const [pages, setPages] = createSignal([]);\n const [page, setPage] = createSignal(1);\n const [end, setEnd] = createSignal(false);\n\n const [contents] = createResource(page, fetcher);\n\n createComputed(() => {\n const content = contents();\n if (!content)\n return;\n batch(() => {\n if (content.length === 0)\n setEnd(true);\n setPages((p) => [...p, ...content]);\n });\n });\n\n return {\n pages,\n page,\n setPage,\n setPages,\n end,\n setEnd\n };\n}\n","import { View, Text, Show, IntrinsicNodeStyleProps, For } from '@lightningjs/solid';\nimport { withPadding } from '@lightningjs/solid-primitives';\nimport theme from 'theme';\nwithPadding;\n\nconst blockWidth = 1100;\nconst HeadlineStyles = {\n ...theme.typography.display2,\n width: blockWidth,\n height: 58,\n contain: 'both',\n};\nconst Headline = (props) => (\n \n {props.children}\n \n);\n\nconst DescriptionStyles = {\n ...theme.typography.body1,\n width: blockWidth,\n height: 72,\n contain: 'both',\n};\n\nconst BadgeStyle = {\n fontSize: 20,\n lineHeight: 20,\n};\n\nconst Description = (props) => (\n \n {props.children}\n \n);\n\nfunction getReviews(reviews) {\n return (\n <>\n \n \n {reviews.rtCrit + '%'}\n \n \n \n {reviews.rtFan + '%'}\n \n \n );\n}\n\nconst Badge = (props) => {\n return (\n \n {props.children}\n \n );\n};\n\nconst MetaTextStyle = theme.typography.body2;\n\nconst Metadata = (props) => (\n \n {props.metaText}\n {(item) => {item}}\n {getReviews(props.reviews)}\n \n);\n\nconst ContentBlock = (props) => {\n const style = {\n display: 'flex',\n flexDirection: 'column',\n width: blockWidth,\n height: 160,\n gap: 16,\n };\n return \n {props.title}\n {props.description}\n \n ;\n};\n\nexport default ContentBlock;\n","import api, { getImageUrl } from '..';\nimport { convertItemsToTiles } from '../formatters/ItemFormatter';\n\nexport function minutesToHMM(minutes) {\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return hours + 'h ' + (remainingMinutes < 10 ? '0' : '') + remainingMinutes + 'm';\n}\n\nfunction justYear(dateString) {\n const parts = dateString.split(\"-\");\n return parts[0];\n}\n\nexport function getRecommendations({type, id}) {\n return api.get(`/${type}/${id}/recommendations`).then(\n ({ results }) => {\n if (results.length) {\n return convertItemsToTiles(results.slice(0, 7));\n }\n return api.get(`/trending/${type}/week?page=1`).then(\n ({ results }) => convertItemsToTiles(results.slice(0, 7)));\n }\n );\n}\n\nexport function getCredits({type, id}) {\n return api.get(`/${type}/${id}/credits`).then(\n ({ cast }) => convertItemsToTiles(cast.slice(0, 7))\n );\n}\n\nexport function getInfo({type, id}) {\n let rt = type === 'movie' ? {\n rtCrit: 86,\n rtFan: 92\n } : {};\n\n return api.get(`/${type}/${id}`).then(\n (data) => ({\n backgroundImage: getImageUrl(data.backdrop_path, 'original'),\n heroContent: {\n title: data.title || data.name,\n description: data.overview,\n badges: ['HD'],\n metaText: type === 'movie' ?\n minutesToHMM(data.runtime) + ' - ' + data.release_date : `${justYear(data.first_air_date)} - ${justYear(data.last_air_date)}`,\n reviews: rt,\n },\n ...data\n }));\n}\n","import { createEffect, createMemo, on, createSignal,\n Show, createResource, createSelector, For } from \"solid-js\";\nimport { ElementNode, View, activeElement } from '@lightningjs/solid';\nimport { Column } from '@lightningjs/solid-ui';\nimport { useNavigate, useParams } from \"@solidjs/router\";\nimport { TileRow } from '../components';\nimport styles from '../styles';\nimport { setGlobalBackground } from \"../state\";\nimport browseProvider from '../api/providers/browse';\nimport { createInfiniteScroll } from '../components/pagination';\nimport ContentBlock from \"../components/ContentBlock\";\nimport * as entityProvider from '../api/providers/entity';\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\n\nconst Browse = () => {\n const params = useParams();\n const [columnY, setcolumnY] = createSignal(0);\n const [entityInfo, setEntityInfo] = createSignal();\n const [entityData] = createResource(entityInfo, entityProvider.getInfo);\n const [heroContent, setHeroContent] = createSignal({});\n const navigate = useNavigate();\n const isFirst = createSelector(() => {\n return 0;\n });\n\n const provider = createMemo(() => {\n return createInfiniteScroll(browseProvider(params.filter || 'all'));\n });\n\n createEffect(on(activeElement, (elm) => {\n if (elm.backdrop) {\n setGlobalBackground(elm.backdrop);\n }\n // if (elm.entityInfo) {\n // setEntityInfo(elm.entityInfo);\n // }\n if (elm.heroContent) {\n setHeroContent(elm.heroContent);\n }\n }, { defer: true}))\n\n function onRowFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setcolumnY((this.y || 0) * -1 + 24);\n let numPages = provider().pages().length;\n\n if (numPages === 0 || this.parent.selected && this.parent.selected >= numPages - 2) {\n provider().setPage(p => p + 1);\n }\n }\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href)\n };\n\n return (\n \n \n \n \n \n {(items, i) =>\n \n }\n \n \n \n \n );\n};\n\nexport default Browse;\n","import { createSignal, createSelector, For } from \"solid-js\";\nimport { ElementNode, View, Text, activeElement } from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { useNavigate } from \"@solidjs/router\";\nimport styles from \"../styles\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\n\nconst Portal = () => {\n const navigate = useNavigate();\n const isFirst = createSelector(() => {\n return 0;\n });\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.id);\n navigate(\"/\" + entity.id);\n }\n\n const demos = [\n {\n title: \"Flex Row\",\n id: \"flex\",\n description: \"Flex Row Implementation\",\n },\n {\n title: \"Flex Column\",\n id: \"flexcolumn\",\n description: \"Flex Column Implementation\",\n },\n {\n title: \"Flex Row Vertical Align\",\n id: \"flexsize\",\n description: \"Flex Row Vertical Align Implementation\",\n },\n {\n title: \"Flex Column Vertical Align\",\n id: \"flexcolumnsize\",\n description: \"Flex Column Vertical Align Implementation\",\n },\n {\n title: \"Buttons\",\n id: \"buttons\",\n description: \"Demo a few buttons\",\n },\n {\n title: \"Text\",\n id: \"text\",\n description: \"Text layout with flexbox\",\n },\n {\n title: \"Create Elements\",\n id: \"create\",\n description: \"Testing Show + children + inserting text\",\n },\n ];\n\n function DemoTile(props) {\n const Container = {\n width: 370,\n height: 320,\n borderRadius: 6,\n scale: 1,\n color: 0x182b44ff,\n transition: { color: true, scale: true },\n focus: {\n scale: 1.1,\n color: 0xffffffff,\n },\n };\n const [color, setColor] = createSignal(0xffffffff);\n\n return (\n setColor(0x000000ff)}\n onBlur={() => setColor(0xffffffff)}\n style={Container}\n >\n \n \n {props.index}\n \n \n {props.title}\n \n \n {props.description}\n \n \n \n );\n }\n\n const [rowX, setRowX] = createSignal(140);\n\n function moveRow(row) {\n setRowX(row.selected * -400 + 140);\n }\n\n return (\n \n \n \n \n Examples\n \n \n \n \n \n {(demo, i) => (\n \n )}\n \n \n \n );\n};\n\nexport default Portal;\n","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst TextPage = () => {\n const OverviewContainer = {\n width: 900,\n height: 500,\n y: 350,\n x: 150,\n gap: 25,\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const SublineContainer = {\n width: 900,\n height: 36,\n gap: 6,\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const Title = {\n fontSize: 42,\n };\n\n const Overview = {\n width: OverviewContainer.width,\n fontSize: 26,\n contain: \"width\",\n } satisfies IntrinsicTextNodeStyleProps;\n\n const Subline = {\n fontSize: 26,\n };\n\n onMount(() => {\n setGlobalBackground(\"#000000\");\n });\n\n return (\n \n Title of the Page\n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer vel\n tempor tellus. Sed eu leo purus. Vestibulum sollicitudin eget tellus a\n varius. Phasellus est turpis, volutpat sed blandit sit amet, rutrum sit\n amet mauris. In dignissim elit orci, a sollicitudin ipsum faucibus et.\n Quisque vel quam rutrum, faucibus augue sed, scelerisque nunc.\n \n \n Subline Text\n \n More Text\n \n \n );\n};\n\nexport default TextPage;\n","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Show, children, createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst CreatePage = () => {\n const OverviewContainer = {\n width: 900,\n height: 500,\n y: 50,\n x: 150,\n gap: 25,\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const SublineContainer = {\n width: 900,\n height: 36,\n gap: 6,\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const Title = {\n fontSize: 42,\n };\n\n const Subline = {\n fontSize: 26,\n };\n\n let myBox, childRef;\n onMount(() => {\n setGlobalBackground(\"#000000\");\n myBox.animate({ x: 100 }, { duration: 2000 }).start();\n });\n\n const [insertTest, setInsertTest] = createSignal();\n const [emptyTest, setEmptyTest] = createSignal();\n\n setTimeout(() => {\n setInsertTest(\"- Inserted -\");\n childRef\n .getChildById(\"child1\")\n //.searchChildrenById('subChild') - more expensive version of getChildById\n ?.animate({ x: 600 }, { duration: 2000 })\n .start();\n }, 2000);\n\n const styleChild = {\n width: 400,\n height: 300,\n // Solid blue\n color: hexColor(\"#0000ff\"),\n } as const;\n\n const someOtherStyle = {\n // pretty red\n color: hexColor(\"#f54242\"),\n focus: {\n // pretty blue\n color: hexColor(\"#4287f5\"),\n },\n };\n\n function ChildTest(props) {\n // This causes a parent not rendered error since we're rendering it twice in the template\n const resolved = children(() => props.children);\n return (\n \n \n {resolved()}\n \n {props.title}\n \n \n {resolved()}\n \n \n );\n }\n\n const borderStyles = {\n borderLeft: {\n width: 8,\n color: 0x05b2b626,\n },\n borderTop: {\n width: 8,\n color: 0x25a2bd26,\n },\n borderRight: {\n width: 8,\n color: 0x05b2b626,\n },\n borderBottom: {\n width: 8,\n color: 0xc5b23626,\n },\n } as const;\n\n const childTestPassedStyles = {\n // grey color\n color: hexColor(\"#cccccc\"),\n focus: {\n // black\n color: hexColor(\"#000000\"),\n },\n };\n\n const childTestPassedStyles2 = {\n // white color\n color: hexColor(\"#ffffff\"),\n focus: {\n // white something...\n color: hexColor(\"#f6f6cc\"),\n },\n };\n\n function hasFocus(elm) {\n console.log(\"Ref is available: \", elm);\n return true;\n }\n\n return (\n \n Title of the Page\n \n {emptyTest()}\n Sub {insertTest()} Text\n \n \n \n More Text\n \n \n Child Test\n \n \n \n );\n};\n\nexport default CreatePage;\n","import { View, Text, ElementNode, IntrinsicNodeProps, hexColor, IntrinsicNodeStyleProps } from '@lightningjs/solid';\nimport { withPadding } from '@lightningjs/solid-primitives';\nimport { Row } from '@lightningjs/solid-ui';\nimport { buttonStyles } from '../styles';\nwithPadding;\n\nconst ButtonsPage = () => {\n function onEnter(this: ElementNode, event, elm) {\n this.states.toggle('disabled');\n }\n\n const RowStyles = {\n display: 'flex',\n justifyContent: 'flexStart',\n width: 1500,\n height: 300,\n color: hexColor('00000000'),\n gap: 26,\n y: 400\n } satisfies IntrinsicNodeStyleProps;\n\n function Button(props) {\n return (\n \n {props.children}\n \n );\n }\n\n const Badge = (props: IntrinsicNodeProps) => {\n return \n \n {props.children as string}\n \n ;\n };\n return (\n <>\n \n HD\n PG13\n NC17\n I like bananas\n DOLBY\n \n\n \n \n \n \n \n \n \n );\n};\n\nexport default ButtonsPage;\n","import { ElementNode, IntrinsicNodeStyleProps, Text, View, hexColor } from '@lightningjs/solid';\nimport { Column, Row } from '@lightningjs/solid-ui';\nimport { createSignal, onMount } from 'solid-js';\nimport styles from '../styles';\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexPage = () => {\n const RowStyles = {\n display: 'flex',\n justifyContent: 'flexStart',\n width: 1600,\n height: 110,\n color: hexColor('#4dabf5'),\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n marginTop: 25,\n marginBottom: -20,\n skipFocus: true,\n }\n\n function Block(props) {\n const styles = {\n width: 200,\n height: 100,\n y: 5,\n color: 0x1769aaff,\n }\n\n return ;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground('#333333');\n })\n\n const gap = 50;\n\n return (\n <>\n \n Flex Start\n \n \n \n \n \n \n \n Flex Start - Margin Left\n \n \n \n \n \n \n \n Flex End\n \n \n \n \n \n \n \n\n Flex End - Margin Right\n \n \n \n \n \n \n \n\n Center - No Margin Support\n \n \n \n \n \n \n \n\n Space Between - No Margin Support\n \n \n \n \n \n \n \n\n Space Evenly - No Margin Support\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexPage;\n","import { ElementNode, IntrinsicNodeStyleProps, Text, View, hexColor } from '@lightningjs/solid';\nimport { Column, Row } from '@lightningjs/solid-ui';\nimport { createSignal, onMount } from 'solid-js';\nimport styles from '../styles';\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexSizePage = () => {\n const RowStyles = {\n display: 'flex',\n justifyContent: 'flexStart',\n width: 1600,\n height: 110,\n color: hexColor('#4dabf5'),\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n marginTop: 25,\n marginBottom: -20,\n skipFocus: true,\n }\n\n function Block(props) {\n const styles = {\n width: 200,\n height: 100,\n y: 5,\n color: 0x1769aaff,\n }\n\n return ;\n }\n\n function randSize() {\n // size 21 to 100\n return Math.floor(Math.random() * 91) + 10;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground('#333333');\n })\n\n const gap = 50;\n\n return (\n <>\n \n Flex Start - AlignItems: center\n \n \n \n \n \n \n \n Flex Start - Margin Left - AlignItems: flexStart\n \n \n \n \n \n \n \n Flex End - AlignItems: flexEnd\n \n \n \n \n \n \n \n\n Flex End - Margin Right\n \n \n \n \n \n \n \n\n Center - No Margin Support\n \n \n \n \n \n \n \n\n Space Between - No Margin Support\n \n \n \n \n \n \n \n\n Space Evenly - No Margin Support\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexSizePage;\n","import { ElementNode, IntrinsicNodeStyleProps, Text, View, hexColor } from '@lightningjs/solid';\nimport { Column, Row } from '@lightningjs/solid-ui';\nimport { createSignal, onMount } from 'solid-js';\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexColumnPage = () => {\n const RowStyles = {\n display: 'flex',\n justifyContent: 'spaceEvenly',\n width: 1920,\n y: 100,\n height: 880,\n color: hexColor('00000000'),\n } satisfies IntrinsicNodeStyleProps;\n\n const ColumnStyles = {\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'flexStart',\n color: hexColor('#4dabf5'),\n height: 850,\n width: 80\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n y: 20,\n x: 150,\n }\n\n function Block(props) {\n const styles = {\n width: randSize(),\n height: 80,\n x: 5,\n color: hexColor('#1769aa'),\n }\n\n return ;\n }\n\n function randSize() {\n // size 10 to 70\n return Math.floor(Math.random() * 61) + 10;\n }\n\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground('#333333');\n })\n\n const gap = 50;\n\n return (\n <>\n Start, MarginTop, End, MarginBottom, Center, Between, Evenly\n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexColumnPage;\n","import { ElementNode, IntrinsicNodeStyleProps, Text, View, hexColor } from '@lightningjs/solid';\nimport { Column, Row } from '@lightningjs/solid-ui';\nimport { createSignal, onMount } from 'solid-js';\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexColumnPage = () => {\n const RowStyles = {\n display: 'flex',\n justifyContent: 'spaceEvenly',\n width: 1920,\n y: 100,\n height: 880,\n color: hexColor('00000000'),\n } satisfies IntrinsicNodeStyleProps;\n\n const ColumnStyles = {\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'flexStart',\n color: hexColor('#4dabf5'),\n height: 850,\n width: 60\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n y: 20,\n x: 150,\n }\n\n function Block(props) {\n const styles = {\n width: 50,\n height: 80,\n x: 5,\n color: hexColor('#1769aa'),\n }\n\n return ;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground('#333333');\n })\n\n const gap = 50;\n\n return (\n <>\n Start, MarginTop, End, MarginBottom, Center, Between, Evenly\n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexColumnPage;\n","import { ElementNode, IntrinsicNodeStyleProps, Text, View, hexColor } from '@lightningjs/solid';\nimport { Row } from '@lightningjs/solid-ui';\n\nimport { MaterialButtonText } from '../styles';\n\nconst MaterialButtonsPage = () => {\n function onEnter(this: ElementNode, event, elm) {\n this.states.toggle('disabled');\n }\n\n const RowStyles = {\n display: 'flex',\n justifyContent: 'flexStart',\n width: 1500,\n height: 300,\n color: hexColor('00000000'),\n gap: 26,\n y: 400,\n x: 100\n } satisfies IntrinsicNodeStyleProps;\n\n const MaterialButton = {\n width: 386,\n height: 136,\n color: '0x715cabff',\n focus: {\n color: '0x5a39a2ff',\n },\n disabled: {\n color: '0x291d43ff',\n }\n };\n const RoundedRectangle = ['RoundedRectangle', { radius: 65 }];\n function Button(props) {\n return (\n \n {props.children}\n \n );\n }\n\n return (\n \n \n \n \n \n );\n};\n\nexport default MaterialButtonsPage;\n","// Documentation from Shaka player:\n// https://shaka-player-demo.appspot.com/docs/api/tutorial-basic-usage.html\n\nconst manifestUri =\n 'https://storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd';\n\nfunction initApp() {\n // Install built-in polyfills to patch browser incompatibilities.\n shaka.polyfill.installAll();\n\n // Check to see if the browser supports the basic APIs Shaka needs.\n if (shaka.Player.isBrowserSupported()) {\n // Everything looks good!\n initPlayer();\n } else {\n // This browser does not have the minimum set of APIs we need.\n console.error('Browser not supported!');\n }\n}\n\nasync function initPlayer() {\n // Create a Player instance.\n const video = document.getElementById('video');\n const player = new shaka.Player();\n await player.attach(video);\n\n // Attach player to the window to make it easy to access in the JS console.\n window.player = player;\n\n // Listen for error events.\n player.addEventListener('error', onErrorEvent);\n\n // Try to load a manifest.\n // This is an asynchronous process.\n try {\n await player.load(manifestUri);\n // This runs if the asynchronous load is successful.\n console.log('The video has now been loaded!');\n } catch (e) {\n // onError is executed if the asynchronous load fails.\n onError(e);\n }\n}\n\nfunction onErrorEvent(event) {\n // Extract the shaka.util.Error object from the event.\n onError(event.detail);\n}\n\nfunction onError(error) {\n // Log the error.\n console.error('Error code', error.code, 'object', error);\n}\n\nexport function playVideo() {\n const video = document.getElementById('video');\n video.hidden = false;\n // Needs delay from hidden to play in Chrome\n setTimeout(() => video.play(), 50);\n video.focus();\n return video;\n}\n\nexport function closeVideo() {\n const video = document.getElementById('video');\n video.hidden = true;\n video.pause();\n return video;\n}\n\ndocument.addEventListener('DOMContentLoaded', initApp);","import { ElementNode, Text, View, Show, hexColor, setActiveElement } from '@lightningjs/solid';\nimport { Column } from '@lightningjs/solid-ui';\nimport { useParams } from \"@solidjs/router\";\nimport { createEffect, createResource, on, createSignal } from \"solid-js\";\nimport { TileRow, Button } from '../components';\nimport { setGlobalBackground } from \"../state\";\nimport ContentBlock from \"../components/ContentBlock\";\nimport { useNavigate } from \"@solidjs/router\";\nimport styles from '../styles';\nimport * as provider from '../api/providers/entity';\nimport { assertTruthy } from '@lightningjs/renderer/utils';\nimport type { Tile } from '../api/formatters/ItemFormatter';\nimport { playVideo, closeVideo } from '../video';\n\nconst Entity = () => {\n const params = useParams();\n const navigate = useNavigate();\n\n const [data] = createResource(() => ({...params}), provider.getInfo);\n const [credits] = createResource(() => ({...params}), provider.getCredits);\n const [recommendations] = createResource(() => ({...params}), provider.getRecommendations);\n const [backdropAlpha, setBackdropAlpha] = createSignal(0);\n\n createEffect(on(data, (data) => {\n setGlobalBackground(data.backgroundImage);\n }, { defer: true}))\n\n const columnY = 600;\n\n const Backdrop = {\n color: hexColor('#000000'),\n alpha: 0,\n width: 1900,\n height: 890,\n x: 10,\n y: columnY,\n borderRadius: 30,\n }\n\n function onRowFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n columnRef.y = columnY;\n backdropRef.y = columnY;\n backdropRef.alpha = 0;\n }\n\n function onRowFocusAnimate(this: ElementNode) {\n this.children.selected?.setFocus();\n columnRef.y = 200;\n backdropRef.y = 160;\n backdropRef.alpha = 0.9;\n }\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n };\n\n function onEscape() {\n closeVideo();\n // Set focus back to lightning app\n document.getElementsByTagName('canvas')[0].focus();\n setActiveElement(trailerButton);\n setBackdropAlpha(0);\n }\n\n function onEnterTrailer() {\n const video = playVideo();\n setActiveElement(video);\n setBackdropAlpha(0.9);\n }\n\n let columnRef, backdropRef, trailerButton;\n\n return (\n \n trailerButton.setFocus()} onEscape={onEscape}>\n \n \n \n \n Recommendations\n \n Cast and Crew\n \n \n \n \n \n \n \n );\n};\n\nexport default Entity;\n","import api, { getImageUrl } from '..';\nimport { convertItemsToTiles } from '../formatters/ItemFormatter';\n\nexport function minutesToHMM(minutes) {\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return hours + 'h ' + (remainingMinutes < 10 ? '0' : '') + remainingMinutes + 'm';\n}\n\nfunction justYear(dateString) {\n const parts = dateString.split(\"-\");\n return parts[0];\n}\n\nexport function getCredits({id}) {\n return api.get(`/person/${id}/combined_credits`).then(\n ({ cast }) => convertItemsToTiles(cast.slice(0, 7))\n );\n}\n\nexport function getInfo({id}) {\n return api.get(`/person/${id}`).then(\n (data) => ({\n backgroundImage: getImageUrl(data.profile_path, 'original'),\n heroContent: {\n title: data.title || data.name,\n description: data.biography,\n },\n ...data\n }));\n}\n","import { ElementNode, Text, View, Show, hexColor } from '@lightningjs/solid';\nimport { Column } from '@lightningjs/solid-ui';\nimport { useParams } from \"@solidjs/router\";\nimport { createEffect, createResource, on } from \"solid-js\";\nimport { TileRow } from '../components';\nimport { setGlobalBackground } from \"../state\";\nimport { useNavigate } from \"@solidjs/router\";\nimport theme from 'theme';\nimport styles from '../styles';\nimport * as provider from '../api/providers/people';\nimport { assertTruthy } from '@lightningjs/renderer/utils';\n\nconst People = () => {\n const params = useParams();\n const navigate = useNavigate();\n\n const [data] = createResource(() => ({...params}), provider.getInfo);\n const [credits] = createResource(() => ({...params}), provider.getCredits);\n\n createEffect(on(data, (data) => {\n setGlobalBackground(data.backgroundImage);\n }, { defer: true}))\n\n const Backdrop = {\n color: hexColor('#000000'),\n alpha: 0.8,\n width: 1540,\n height: 440,\n x: 130,\n y: 180,\n borderRadius: 30,\n }\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n };\n\n return (\n \n \n {data().name}\n {data().biography}\n \n \n \n \n Credits\n \n \n \n \n );\n};\n\nexport default People;\n","const NotFound = () => {\n return (\n \n );\n};\n\nexport default NotFound;\n","export default import.meta.ROLLUP_FILE_URL_DM04K3OB;","import {\n render,\n Config,\n SolidNode,\n SolidRendererOptions,\n hexColor,\n ElementNode,\n} from \"@lightningjs/solid\";\nimport { HashRouter, Route } from \"@solidjs/router\";\nimport { createSignal } from \"solid-js\";\nimport App from \"./pages/App\";\nimport Browse from \"./pages/Browse\";\nimport Portal from \"./pages/Portal\";\nimport TextPage from \"./pages/Text\";\nimport CreatePage from \"./pages/Create\";\nimport ButtonsPage from \"./pages/Buttons\";\nimport FlexPage from \"./pages/Flex\";\nimport FlexSizePage from \"./pages/FlexSize\";\nimport FlexColumnSizePage from \"./pages/FlexColumnSize\";\nimport FlexColumnPage from \"./pages/FlexColumn\";\nimport ButtonsMaterialPage from \"./pages/ButtonsMaterial\";\nimport Entity from \"./pages/Entity\";\nimport People from \"./pages/People\";\nimport NotFound from \"./pages/NotFound\";\nimport coreExtensionModuleUrl from \"./AppCoreExtensions.js?importChunkUrl\";\n\nconst logFps = true;\nConfig.debug = false;\nConfig.animationsEnabled = true;\nConfig.fontSettings.fontFamily = \"Ubuntu\";\nConfig.fontSettings.color = hexColor(\"#ffffff\");\nConfig.fontSettings.fontSize = 100;\nConfig.rendererOptions = {\n coreExtensionModule: coreExtensionModuleUrl,\n fpsUpdateInterval: logFps ? 1000 : 0,\n enableInspector: true,\n // deviceLogicalPixelRatio: 1\n};\n\nrender(() => (\n }>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n));\n"],"file":"assets/index-BZ75HCSO.js"} \ No newline at end of file diff --git a/assets/index-DyIws3MF.js b/assets/index-DyIws3MF.js new file mode 100644 index 0000000..075671a --- /dev/null +++ b/assets/index-DyIws3MF.js @@ -0,0 +1,8 @@ +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = [] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} +var ri=Object.defineProperty;var oi=(r,n,e)=>n in r?ri(r,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[n]=e;var h=(r,n,e)=>(oi(r,typeof n!="symbol"?n+"":n,e),e);import{a as F,i as ro,g as _n,c as ht,W as yr,E as nt,b as ke,d as ii,e as nr,f as si,m as At,h as Lt,j as oo,T as io,k as ai,l as In,S as vr,B as li,n as ci,o as so,p as di,q as hi,C as ui,r as fi,s as wr,t as br,u as gi,v as pi,w as mi}from"./CoreExtension-BSpcUIDc.js";function Yc(){import.meta.url,import("_").catch(()=>1),async function*(){}().next()}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))t(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&t(s)}).observe(document,{childList:!0,subtree:!0});function e(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function t(o){if(o.ep)return;o.ep=!0;const i=e(o);fetch(o.href,i)}})();class ao{constructor(n){h(this,"releaseCallback");this.releaseCallback=n}}class xi extends ao{constructor(e,t){var o,i;super(e);h(this,"textureMap",new Map);h(this,"zeroReferenceTextureSet",new Set);h(this,"options");this.options={textureCleanupIntervalMs:(o=t.textureCleanupIntervalMs)!=null?o:1e4,textureCleanupAgeThreadholdMs:(i=t.textureCleanupAgeThreadholdMs)!=null?i:6e4},setInterval(()=>{const s=Date.now(),a=this.options.textureCleanupAgeThreadholdMs;for(const c of this.zeroReferenceTextureSet)s-c.lastUpdate>a&&(this.releaseCallback(c.id),this.textureMap.delete(c.id),this.zeroReferenceTextureSet.delete(c))},this.options.textureCleanupIntervalMs)}registerTexture(e){var o;const t=(o=e.options)==null?void 0:o.id;if(F(t,"Texture must have an id to be registered"),!this.textureMap.has(t)){const i={id:t,nodeRefCount:0,lastUpdate:Date.now()};this.textureMap.set(t,i),this.zeroReferenceTextureSet.add(i)}}incrementTextureRefCount(e){var i;const t=(i=e.options)==null?void 0:i.id;F(t,"Texture must have an id to be registered");let o=this.textureMap.get(t);o||(this.registerTexture(e),o=this.textureMap.get(t)),F(o,"Texture must have been registered"),e.txType==="SubTexture"&&this.incrementTextureRefCount(e.props.texture),o.nodeRefCount++,o.lastUpdate=Date.now(),this.zeroReferenceTextureSet.has(o)&&this.zeroReferenceTextureSet.delete(o)}decrementTextureRefCount(e){var i;const t=(i=e.options)==null?void 0:i.id;F(t,"Texture must have an id to be registered");const o=this.textureMap.get(t);F(o,"Texture must have been registered"),o.nodeRefCount--,o.lastUpdate=Date.now(),o.nodeRefCount===0&&this.zeroReferenceTextureSet.add(o),e.txType==="SubTexture"&&this.decrementTextureRefCount(e.props.texture)}}class yi extends ao{constructor(e){super(e);h(this,"registry");this.registry=new FinalizationRegistry(e)}registerTexture(e){var t,o;F((t=e.options)==null?void 0:t.id,"Texture must have an ID to be registered"),this.registry.register(e,(o=e.options)==null?void 0:o.id)}incrementTextureRefCount(){}decrementTextureRefCount(){}}const yt={alpha:r=>r===1?null:{prop:"opacity",value:"".concat(r)},x:r=>({prop:"left",value:"".concat(r,"px")}),y:r=>({prop:"top",value:"".concat(r,"px")}),width:r=>r===0?null:{prop:"width",value:"".concat(r,"px")},height:r=>r===0?null:{prop:"height",value:"".concat(r,"px")},zIndex:()=>"zIndex",fontFamily:()=>"font-family",fontSize:()=>"font-size",fontStyle:()=>"font-style",fontWeight:()=>"font-weight",fontStretch:()=>"font-stretch",lineHeight:()=>"line-height",letterSpacing:()=>"letter-spacing",textAlign:()=>"text-align",overflowSuffix:()=>"overflow-suffix",maxLines:()=>"max-lines",contain:()=>"contain",verticalAlign:()=>"vertical-align",clipping:r=>r===!1?null:{prop:"overflow",value:r?"hidden":"visible"},rotation:r=>r===0?null:{prop:"transform",value:"rotate(".concat(r,"rad)")},scale:r=>r===1?null:{prop:"transform",value:"scale(".concat(r,")")},scaleX:r=>r===1?null:{prop:"transform",value:"scaleX(".concat(r,")")},scaleY:r=>r===1?null:{prop:"transform",value:"scaleY(".concat(r,")")},color:r=>r===0?null:{prop:"color",value:lo(r)}},lo=r=>{const n=(r&255)/255,e=r>>8&255,t=r>>16&255,o=r>>24&255;return"rgba(".concat(o,",").concat(t,",").concat(e,",").concat(n,")")},vi={id:"id"};class wi{constructor(n,e){h(this,"root",null);h(this,"canvas",null);h(this,"height",1080);h(this,"width",1920);h(this,"scaleX",1);h(this,"scaleY",1);var i,s,a,c,d,u;if(ro())return;if(!e)throw new Error("settings is required");this.height=Math.ceil((s=e.appHeight)!=null?s:1080/((i=e.deviceLogicalPixelRatio)!=null?i:1)),this.width=Math.ceil((c=e.appWidth)!=null?c:1900/((a=e.deviceLogicalPixelRatio)!=null?a:1)),this.scaleX=(d=e.deviceLogicalPixelRatio)!=null?d:1,this.scaleY=(u=e.deviceLogicalPixelRatio)!=null?u:1,this.canvas=n,this.root=document.createElement("div"),this.setRootPosition(),document.body.appendChild(this.root),new MutationObserver(this.setRootPosition.bind(this)).observe(n,{attributes:!0,childList:!1,subtree:!1}),new ResizeObserver(this.setRootPosition.bind(this)).observe(n),window.addEventListener("resize",this.setRootPosition.bind(this)),console.warn("Inspector is enabled, this will impact performance")}setRootPosition(){if(this.root===null||this.canvas===null)return;const n=this.canvas.getBoundingClientRect(),e=document.documentElement.scrollTop+n.top,t=document.documentElement.scrollLeft+n.left;this.root.id="root",this.root.style.left="".concat(t,"px"),this.root.style.top="".concat(e,"px"),this.root.style.width="".concat(this.width,"px"),this.root.style.height="".concat(this.height,"px"),this.root.style.position="absolute",this.root.style.transformOrigin="0 0 0",this.root.style.transform="scale(".concat(this.scaleX,", ").concat(this.scaleY,")"),this.root.style.overflow="hidden",this.root.style.zIndex="65534"}createDiv(n,e){const t=document.createElement("div");t.style.position="absolute",t.id=n.id.toString();for(const o in e)this.updateNodeProperty(t,o,e[o]);return t}createNode(n,e){const t=n.createNode(e),o=this.createDiv(t,e);return o.node=t,t.div=o,this.createProxy(t,o)}createTextNode(n,e){const t=n.createTextNode(e),o=this.createDiv(t,e);return o.node=t,t.div=o,this.createProxy(t,o)}createProxy(n,e){return new Proxy(n,{set:(t,o,i)=>(this.updateNodeProperty(e,o,i),Reflect.set(t,o,i)),get:(t,o,i)=>(o==="destroy"&&this.destroyNode(t),o==="animate"?(s,a)=>{const c=t.animate(s,a);return new Proxy(c,{get:(d,u,g)=>(u==="start"&&this.animateNode(e,n,s,a),Reflect.get(d,u,g))})}:Reflect.get(t,o,i))})}destroyNode(n){const e=document.getElementById(n.id.toString());e==null||e.remove()}updateNodeProperty(n,e,t){var o;if(!(this.root===null||t===void 0||t===null)){if(e==="parent"){const i=t.id;if(i===1){this.root.appendChild(n);return}const s=document.getElementById(i.toString());s==null||s.appendChild(n);return}if(e==="text"){n.innerHTML=String(t),n.style.visibility="hidden";return}if(e==="src"&&t){n.setAttribute("data-src",String(t));return}if(yt[e]){const i=(o=yt[e])==null?void 0:o.call(yt,t);if(i===null)return;if(typeof i=="string"){n.style.setProperty(i,String(t));return}typeof i=="object"&&n.style.setProperty(i.prop,i.value);return}if(vi[e]){n.setAttribute(String(yt[e]),String(t));return}if(e==="data"){for(const i in t)n.setAttribute("data-".concat(i),String(t[i]));return}}}animateNode(n,e,t,o){const{duration:i=1e3,delay:s=0}=o,{x:a,y:c,width:d,height:u,alpha:g=1,rotation:y=0,scale:b=1,color:x}=t;function w(){setTimeout(()=>{n.style.top="".concat(c,"px"),n.style.left="".concat(a,"px"),n.style.width="".concat(d,"px"),n.style.height="".concat(u,"px"),n.style.opacity="".concat(g),n.style.rotate="".concat(y,"rad"),n.style.scale="".concat(b),n.style.color=lo(x)},i)}setTimeout(w,s)}}const bi="modulepreload",Si=function(r){return"/solid-demo-app/"+r},Sr={},Ai=function(n,e,t){let o=Promise.resolve();if(e&&e.length>0){const i=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),a=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));o=Promise.all(e.map(c=>{if(c=Si(c),c in Sr)return;Sr[c]=!0;const d=c.endsWith(".css"),u=d?'[rel="stylesheet"]':"";if(!!t)for(let b=i.length-1;b>=0;b--){const x=i[b];if(x.href===c&&(!d||x.rel==="stylesheet"))return}else if(document.querySelector('link[href="'.concat(c,'"]').concat(u)))return;const y=document.createElement("link");if(y.rel=d?"stylesheet":bi,d||(y.as="script",y.crossOrigin=""),y.href=c,a&&y.setAttribute("nonce",a),document.head.appendChild(y),d)return new Promise((b,x)=>{y.addEventListener("load",b),y.addEventListener("error",()=>x(new Error("Unable to preload CSS for ".concat(c))))})}))}return o.then(()=>n()).catch(i=>{const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=i,window.dispatchEvent(s),!s.defaultPrevented)throw i})};class ie{constructor(n){h(this,"priority",1);h(this,"name","");h(this,"ref");h(this,"target");h(this,"passParameters","");h(this,"declaredUniforms","");h(this,"uniformInfo",{});const{ref:e,target:t,props:o={}}=n;this.ref=e,this.target=t;const i={},s=[];let a="";const c=this.constructor.uniforms||{};for(const d in c){const u=c[d],g=u.type,y="".concat(e,"_").concat(d);let b="";u.size&&(b="[".concat(u.size(o),"]")),s.push(y),a+="uniform ".concat(g," ").concat(y).concat(b,";"),i[d]={name:y,uniform:c[d].method}}this.passParameters=s.join(","),this.declaredUniforms=a,this.uniformInfo=i}static getEffectKey(n){return""}static getMethodParameters(n,e){const t=[];for(const o in n){const i=n[o];let s="";i.size&&(s="[".concat(i.size(e),"]")),t.push("".concat(i.type," ").concat(o).concat(s))}return t.join(",")}static resolveDefaults(n){return{}}static makeEffectKey(n){return!1}}h(ie,"uniforms",{}),h(ie,"methods"),h(ie,"onShaderMask"),h(ie,"onColorize"),h(ie,"onEffectMask");const Ci={x:(r,n)=>{r.props.x=n},y:(r,n)=>{r.props.y=n},width:(r,n)=>{r.props.width=n},height:(r,n)=>{r.props.height=n},color:(r,n)=>{r.props.color=n},zIndex:(r,n)=>{r.props.zIndex=n},fontFamily:(r,n)=>{r.props.fontFamily=n},fontWeight:(r,n)=>{r.props.fontWeight=n},fontStyle:(r,n)=>{r.props.fontStyle=n},fontStretch:(r,n)=>{r.props.fontStretch=n},fontSize:(r,n)=>{r.props.fontSize=n},text:(r,n)=>{r.props.text=n},textAlign:(r,n)=>{r.props.textAlign=n},contain:(r,n)=>{r.props.contain=n},offsetY:(r,n)=>{r.props.offsetY=n},scrollable:(r,n)=>{r.props.scrollable=n},scrollY:(r,n)=>{r.props.scrollY=n},letterSpacing:(r,n)=>{r.props.letterSpacing=n},lineHeight:(r,n)=>{r.props.lineHeight=n},maxLines:(r,n)=>{r.props.maxLines=n},textBaseline:(r,n)=>{r.props.textBaseline=n},verticalAlign:(r,n)=>{r.props.verticalAlign=n},overflowSuffix:(r,n)=>{r.props.overflowSuffix=n},debug:(r,n)=>{r.props.debug=n}};class co{constructor(n){h(this,"stage");h(this,"set");this.stage=n;const e={...Ci,...this.getPropertySetters()};this.set=Object.freeze(Object.fromEntries(Object.entries(e).map(([t,o])=>[t,(i,s)=>{i.props[t]!==s&&(o(i,s),this.stage.requestRender())}])))}setStatus(n,e,t){n.status!==e&&(n.status=e,n.emitter.emit(e,t))}setIsRenderable(n,e){n.isRenderable=e}destroyState(n){["loading","loaded","failed"].forEach(t=>{n.emitter.off(t)})}scheduleUpdateState(n){n.updateScheduled||(n.updateScheduled=!0,queueMicrotask(()=>{n.updateScheduled=!1,this.updateState(n)}))}}const Ar=2048;function Cr(r,n,e,t,o){const i=r!=="bottom"?.5*n:0;return e*(t-1)+i+Math.max(e,n)+(o||0)}class Ti{constructor(n,e){h(this,"_canvas");h(this,"_context");h(this,"_settings");h(this,"renderInfo");this._canvas=n,this._context=e,this._settings=this.mergeDefaults({})}set settings(n){this._settings=this.mergeDefaults(n)}get settings(){return this._settings}getPrecision(){return this._settings.precision}setFontProperties(){this._context.font=this._getFontSetting(),this._context.textBaseline=this._settings.textBaseline}_getFontSetting(){const n=[this._settings.fontFace],e=[];for(let t=0,o=n.length;t{console.warn("[Lightning] Font load error",e,n)}).then(()=>{document.fonts.check(n,this._settings.text)||console.warn("[Lightning] Font not found",n)})}catch(e){console.warn("[Lightning] Can't check font loading for "+n)}}}calculateRenderInfo(){const n={},e=this.getPrecision(),t=this._settings.paddingLeft*e,o=this._settings.paddingRight*e,i=this._settings.fontSize*e;let s=this._settings.offsetY===null?null:this._settings.offsetY*e,a=(this._settings.lineHeight||i)*e;const c=this._settings.w*e,d=this._settings.h*e;let u=this._settings.wordWrapWidth*e;const g=this._settings.cutSx*e,y=this._settings.cutEx*e,b=this._settings.cutSy*e,x=this._settings.cutEy*e,w=(this._settings.letterSpacing||0)*e,S=this._settings.textIndent*e;this.setFontProperties();let A=c||2048/this.getPrecision(),p=A-t;if(p<10&&(A+=10-p,p=10),u||(u=p),this._settings.textOverflow&&!this._settings.wordWrap){let C;switch(this._settings.textOverflow){case"clip":C="";break;case"ellipsis":C=this._settings.overflowSuffix;break;default:C=this._settings.textOverflow}this._settings.text=this.wrapWord(this._settings.text,u-S,C)}let m;if(this._settings.wordWrap)m=this.wrapText(this._settings.text,u,w,S);else{m={l:this._settings.text.split(/(?:\r\n|\r|\n)/),n:[]};const C=m.l.length;for(let _=0;_this._settings.maxLines){const C=v.slice(0,this._settings.maxLines);let _=null;if(this._settings.overflowSuffix){const O=this._settings.overflowSuffix?this.measureText(this._settings.overflowSuffix):0,D=this.wrapText(C[C.length-1],u-O,w,S);C[C.length-1]="".concat(D.l[0]).concat(this._settings.overflowSuffix),_=[D.l.length>1?D.l[1]:""]}else _=[""];let E;const P=v.length;let k=0;const z=m.n.length;for(E=this._settings.maxLines;E=128&&(this._context.globalAlpha=.01,this._context.fillRect(0,0,.01,.01),this._context.globalAlpha=1),(n.cutSx||n.cutSy)&&this._context.translate(-n.cutSx,-n.cutSy);let a,c;const d=[];for(let g=0,y=o.length;ge)for(;a>0&&(c=this._context.measureText(n.substring(0,a)).width+o,c>e);)a-=1;else for(;a=o?t:"")}wrapText(n,e,t,o=0){const i=n.split(/\r?\n/g);let s=[];const a=[];for(let c=0;cg?(b>0&&(d.push(u),u=""),u+=y[b],g=e-x-(b===0?o:0)):(g-=w,u+=" ".concat(y[b]))}d.push(u),u="",s=s.concat(d),ct+this._context.measureText(o).width+e,0):this._context.measureText(n).width}mergeDefaults(n){return{text:"",w:0,h:0,fontStyle:"normal",fontSize:40,fontFace:null,wordWrap:!0,wordWrapWidth:0,wordBreak:!1,textOverflow:"",lineHeight:null,textBaseline:"alphabetic",textAlign:"left",verticalAlign:"top",offsetY:null,maxLines:0,overflowSuffix:"...",textColor:[1,1,1,1],paddingLeft:0,paddingRight:0,shadow:!1,shadowColor:[0,0,0,1],shadowOffsetX:0,shadowOffsetY:0,shadowBlur:5,highlight:!1,highlightHeight:0,highlightColor:[0,0,0,1],highlightOffset:0,highlightPaddingLeft:0,highlightPaddingRight:0,letterSpacing:0,textIndent:0,cutSx:0,cutEx:0,cutSy:0,cutEy:0,advancedRenderer:!1,fontBaselineRatio:0,precision:1,textRenderIssueMargin:0,...n}}}const Tr=typeof self>"u"?globalThis:self;var no;const _r=((no=Tr.document)==null?void 0:no.fonts)||Tr.fonts;function _i(r){const{fontFamily:n,fontStyle:e,fontWeight:t,fontStretch:o,fontSize:i}=r;return[e,t,o,"".concat(i,"px"),n].join(" ")}const Ii=ht(0,0,0,0);class Ri extends co{constructor(e){super(e);h(this,"canvas");h(this,"context");h(this,"rendererBounds");typeof OffscreenCanvas<"u"?this.canvas=new OffscreenCanvas(0,0):this.canvas=document.createElement("canvas");let t=this.canvas.getContext("2d");t||(this.canvas=document.createElement("canvas"),t=this.canvas.getContext("2d")),F(t),this.context=t,this.rendererBounds={x1:0,y1:0,x2:this.stage.options.appWidth,y2:this.stage.options.appHeight}}getPropertySetters(){return{fontFamily:(e,t)=>{e.props.fontFamily=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontWeight:(e,t)=>{e.props.fontWeight=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontStyle:(e,t)=>{e.props.fontStyle=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontStretch:(e,t)=>{e.props.fontStretch=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontSize:(e,t)=>{e.props.fontSize=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},text:(e,t)=>{e.props.text=t,this.invalidateLayoutCache(e)},textAlign:(e,t)=>{e.props.textAlign=t,this.invalidateLayoutCache(e)},color:(e,t)=>{e.props.color=t,this.invalidateLayoutCache(e)},x:(e,t)=>{e.props.x=t,this.invalidateVisibleWindowCache(e)},y:(e,t)=>{e.props.y=t,this.invalidateVisibleWindowCache(e)},contain:(e,t)=>{e.props.contain=t,this.invalidateLayoutCache(e)},width:(e,t)=>{e.props.width=t,e.props.contain!=="none"&&this.invalidateLayoutCache(e)},height:(e,t)=>{e.props.height=t,e.props.contain==="both"&&this.invalidateLayoutCache(e)},offsetY:(e,t)=>{e.props.offsetY=t,this.invalidateLayoutCache(e)},scrollY:(e,t)=>{e.props.scrollY=t},letterSpacing:(e,t)=>{e.props.letterSpacing=t,this.invalidateLayoutCache(e)},lineHeight:(e,t)=>{e.props.lineHeight=t,this.invalidateLayoutCache(e)},maxLines:(e,t)=>{e.props.maxLines=t,this.invalidateLayoutCache(e)},textBaseline:(e,t)=>{e.props.textBaseline=t,this.invalidateLayoutCache(e)},verticalAlign:(e,t)=>{e.props.verticalAlign=t,this.invalidateLayoutCache(e)},overflowSuffix:(e,t)=>{e.props.overflowSuffix=t,this.invalidateLayoutCache(e)}}}canRenderFont(e){return!0}isFontFaceSupported(e){return e instanceof yr}addFontFace(e){F(e instanceof yr),_r.add(e.fontFace)}createState(e){return{props:e,status:"initialState",updateScheduled:!1,emitter:new nt,canvasPages:void 0,lightning2TextRenderer:new Ti(this.canvas,this.context),renderWindow:void 0,visibleWindow:{x1:0,y1:0,x2:0,y2:0,valid:!1},renderInfo:void 0,forceFullLayoutCalc:!1,textW:0,textH:0,fontInfo:void 0,fontFaceLoadedHandler:void 0,isRenderable:!1,debugData:{updateCount:0,layoutCount:0,drawCount:0,lastLayoutNumCharacters:0,layoutSum:0,drawSum:0,bufferSize:0}}}updateState(e){var x,w;if(e.status==="initialState"&&this.setStatus(e,"loading"),!e.fontInfo){const S=_i(e.props);if(e.fontInfo={cssString:S,loaded:!1},!e.fontInfo.loaded){_r.load(S).then(this.onFontLoaded.bind(this,e,S)).catch(this.onFontLoadError.bind(this,e,S));return}}if(!e.fontInfo.loaded)return;if(!e.renderInfo){const S=e.props.maxLines,A=e.props.contain==="both"?Math.floor((e.props.height-e.props.offsetY)/e.props.lineHeight):0,p=A>0&&S>0?Math.min(A,S):Math.max(A,S);e.lightning2TextRenderer.settings={text:e.props.text,textAlign:e.props.textAlign,fontFace:e.props.fontFamily,fontSize:e.props.fontSize,fontStyle:[e.props.fontStretch,e.props.fontStyle,e.props.fontWeight].join(" "),textColor:ke(e.props.color),offsetY:e.props.fontSize+e.props.offsetY,wordWrap:e.props.contain!=="none",wordWrapWidth:e.props.contain==="none"?void 0:e.props.width,letterSpacing:e.props.letterSpacing,lineHeight:e.props.lineHeight,maxLines:p,textBaseline:e.props.textBaseline,verticalAlign:e.props.verticalAlign,overflowSuffix:e.props.overflowSuffix},e.renderInfo=e.lightning2TextRenderer.calculateRenderInfo(),e.textH=e.renderInfo.lineHeight*e.renderInfo.lines.length,e.textW=e.renderInfo.width,e.renderWindow=void 0}const{x:t,y:o,width:i,height:s,scrollY:a,contain:c}=e.props,{visibleWindow:d}=e;let{renderWindow:u,canvasPages:g}=e;if(!d.valid){const S=ht(t,o,c!=="none"?t+i:1/0,c==="both"?o+s:1/0,Ii);ii(this.rendererBounds,S,d),d.valid=!0}const y=d.y2-d.y1,b=Math.ceil(y/e.renderInfo.lineHeight);if(y===0){g=void 0,u=void 0,this.setStatus(e,"loaded");return}else if(u&&g){const S=t+u.x1,A=o-a+u.y1,p=t+u.x2,m=o-a+u.y2;if(S<=d.x1&&p>=d.x2&&A<=d.y1&&m>=d.y2){this.setStatus(e,"loaded");return}md.y1&&(u.y1-=b*e.renderInfo.lineHeight,u.y2-=b*e.renderInfo.lineHeight,g.unshift(g.pop()),g[0].lineNumStart=g[1].lineNumStart-b,g[0].lineNumEnd=g[0].lineNumStart+b,g[0].valid=!1)}else{const S=e.renderInfo.lineHeight*b,A=Math.ceil(a/S),p=A*b,m=p-b,v=p+b;g=[{texture:g==null?void 0:g[0].texture,lineNumStart:m,lineNumEnd:m+b,valid:!1},{texture:g==null?void 0:g[1].texture,lineNumStart:p,lineNumEnd:p+b,valid:!1},{texture:g==null?void 0:g[2].texture,lineNumStart:v,lineNumEnd:v+b,valid:!1}],e.canvasPages=g;const T=A*S;u={x1:0,y1:T-S,x2:i,y2:T+S*2}}e.renderWindow=u,performance.now();for(const S of g)if(!S.valid){if(S.lineNumStart<0){(x=S.texture)==null||x.setRenderableOwner(e,!1),S.texture=this.stage.txManager.loadTexture("ImageTexture",{src:""}),S.texture.setRenderableOwner(e,e.isRenderable),S.valid=!0;continue}e.lightning2TextRenderer.draw(e.renderInfo,{lines:e.renderInfo.lines.slice(S.lineNumStart,S.lineNumEnd),lineWidths:e.renderInfo.lineWidths.slice(S.lineNumStart,S.lineNumEnd)}),this.canvas.width===0||this.canvas.height===0||((w=S.texture)==null||w.setRenderableOwner(e,!1),S.texture=this.stage.txManager.loadTexture("ImageTexture",{src:this.context.getImageData(0,0,this.canvas.width,this.canvas.height)},{preload:!0}),S.texture.setRenderableOwner(e,e.isRenderable)),S.valid=!0}this.setStatus(e,"loaded")}renderQuads(e,t,o,i){var C,_,E,P,k,z,O,D,W,j,se,te;const{stage:s}=this,{canvasPages:a,textW:c=0,textH:d=0,renderWindow:u}=e;if(!a||!u)return;const{x:g,y,scrollY:b,contain:x,width:w,height:S}=e.props,A={x:g,y,width:x!=="none"?w:c,height:x==="both"?S:d};nr({x:0,y:0,width:s.options.appWidth,height:s.options.appHeight},A),F(a,"canvasPages is not defined"),F(u,"renderWindow is not defined");const m=(u.y2-u.y1)/3,{zIndex:v,color:T}=e.props,R=i*si(T),I=At(4294967295,R);a[0].valid&&this.stage.renderer.addQuad({alpha:R,clippingRect:o,colorBl:I,colorBr:I,colorTl:I,colorTr:I,width:((_=(C=a[0].texture)==null?void 0:C.dimensions)==null?void 0:_.width)||0,height:((P=(E=a[0].texture)==null?void 0:E.dimensions)==null?void 0:P.height)||0,texture:a[0].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:v,tx:t.tx,ty:t.ty-b+u.y1,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td}),a[1].valid&&this.stage.renderer.addQuad({alpha:R,clippingRect:o,colorBl:I,colorBr:I,colorTl:I,colorTr:I,width:((z=(k=a[1].texture)==null?void 0:k.dimensions)==null?void 0:z.width)||0,height:((D=(O=a[1].texture)==null?void 0:O.dimensions)==null?void 0:D.height)||0,texture:a[1].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:v,tx:t.tx,ty:t.ty-b+u.y1+m,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td}),a[2].valid&&this.stage.renderer.addQuad({alpha:R,clippingRect:o,colorBl:I,colorBr:I,colorTl:I,colorTr:I,width:((j=(W=a[2].texture)==null?void 0:W.dimensions)==null?void 0:j.width)||0,height:((te=(se=a[2].texture)==null?void 0:se.dimensions)==null?void 0:te.height)||0,texture:a[2].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:v,tx:t.tx,ty:t.ty-b+u.y1+m+m,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td})}setIsRenderable(e,t){var o;super.setIsRenderable(e,t),(o=e.canvasPages)==null||o.forEach(i=>{var s;(s=i.texture)==null||s.setRenderableOwner(e,t)})}destroyState(e){var t;(t=e.canvasPages)==null||t.forEach(o=>{var i;(i=o.texture)==null||i.setRenderableOwner(e,!1)})}invalidateVisibleWindowCache(e){e.visibleWindow.valid=!1,this.setStatus(e,"loading"),this.scheduleUpdateState(e)}invalidateLayoutCache(e){e.renderInfo=void 0,e.visibleWindow.valid=!1,this.setStatus(e,"loading"),this.scheduleUpdateState(e)}onFontLoaded(e,t){var o;t!==((o=e.fontInfo)==null?void 0:o.cssString)||!e.fontInfo||(e.fontInfo.loaded=!0,this.scheduleUpdateState(e))}onFontLoadError(e,t,o){var i;t!==((i=e.fontInfo)==null?void 0:i.cssString)||!e.fontInfo||(e.fontInfo.loaded=!0,console.error("CanvasTextRenderer: Error loading font '".concat(e.fontInfo.cssString,"'"),o),this.scheduleUpdateState(e))}}class ho extends Lt{constructor(n){super({renderer:n,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2fv"}]})}bindTextures(n){const{glw:e}=this;e.activeTexture(0),e.bindTexture(n[0].ctxTexture)}}h(ho,"shaderSources",{vertex:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n ",fragment:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate);\n gl_FragColor = vec4(v_color) * texture2D(u_texture, v_textureCoordinate);\n }\n "});class uo extends Lt{constructor(e){super({renderer:e,attributes:["a_position","a_textureCoordinate","a_color","a_textureIndex"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_textures[0]",uniform:"uniform1iv"}]});h(this,"supportsIndexedTextures",!0)}bindTextures(e){const{renderer:t,glw:o}=this;if(e.length>t.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS)throw new Error("DefaultShaderBatched: Cannot bind more than ".concat(t.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS," textures"));e.forEach((s,a)=>{o.activeTexture(a),o.bindTexture(s.ctxTexture)});const i=Array.from(Array(e.length).keys());this.setUniform("u_textures[0]",i)}}h(uo,"shaderSources",{vertex:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n ",fragment:e=>"\n #define txUnits ".concat(e,"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_image;\n uniform sampler2D u_textures[txUnits];\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n vec4 sampleFromTexture(sampler2D textures[").concat(e,"], int idx, vec2 uv) {\n ").concat(Array.from(Array(e).keys()).map(t=>"\n ".concat(t!==0?"else ":"","if (idx == ").concat(t,") {\n return texture2D(textures[").concat(t,"], uv);\n }\n ")).join(""),"\n return texture2D(textures[0], uv);\n }\n\n void main(){\n gl_FragColor = vec4(v_color) * sampleFromTexture(u_textures, int(v_textureIndex), v_textureCoordinate);\n }\n ")});const Rn=new Map,Bi=(r,n)=>{const e=JSON.stringify(r);if(Rn.has(e))return Rn.get(e);const t=(r!=null?r:[]).map(o=>({type:o.type,props:n[o.type].resolveDefaults(o.props||{})}));return Rn.set(e,t),t},Ne=class Ne extends Lt{constructor(e,t,o){const i=Ne.createShader(t,o);super({renderer:e,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2fv"},{name:"u_dimensions",uniform:"uniform2fv"},{name:"u_alpha",uniform:"uniform1f"},...i.uniforms],shaderSources:{vertex:i.vertex,fragment:i.fragment}});h(this,"effects",[]);this.effects=i.effects,this.calculateProps=oo(this.calculateProps.bind(this))}bindTextures(e){const{glw:t}=this;t.activeTexture(0),t.bindTexture(e[0].ctxTexture)}calculateProps(e){const t=this.renderer.shManager.getRegisteredEffects(),o=[];return e==null||e.forEach((i,s)=>{var g;const a=this.effects[s],c=t[a.name],d=(g=i.props)!=null?g:{},u=a.uniformInfo;Object.keys(d).forEach(y=>{const b=c.uniforms[y],x=u[y];let w=b.validator?b.validator(d[y],d):d[y];Array.isArray(w)&&(w=new Float32Array(w)),o.push({name:x.name,value:w})})}),o}bindProps(e){this.calculateProps(e.effects).forEach(o=>{this.setUniform(o.name,o.value)})}canBatchShaderProps(e,t){if(e.$dimensions.width!==t.$dimensions.width||e.$dimensions.height!==t.$dimensions.height||e.effects.length!==t.effects.length)return!1;const o=e.effects.length;let i=0;for(;i{const w=t[x.type],S=w.getEffectKey(x.props||{});o[S]=o[S]?++o[S]:1;const A=o[S];A===1&&c.push({key:S,type:x.type,props:x.props});const p=new w({ref:"".concat(S).concat(A===1?"":A),target:S,props:x.props});return s+=p.declaredUniforms,a.push(...Object.values(p.uniformInfo)),p});let u="";c==null||c.forEach(x=>{var I;const w=t[x.type],S=w.resolveDefaults((I=x.props)!=null?I:{}),A=[];for(const C in w.methods){let _=C;const E=w.methods[C];i[C]&&i[C]!==E&&(_=Ne.resolveMethodDuplicate(C,E,i)),i[_]=E.replace("function",_),A.push({m:C,cm:_})}let p=w.onShaderMask instanceof Function?w.onShaderMask(S):w.onShaderMask,m=w.onColorize instanceof Function?w.onColorize(S):w.onColorize,v=w.onEffectMask instanceof Function?w.onEffectMask(S):w.onEffectMask;A.forEach(C=>{const{m:_,cm:E}=C,P=new RegExp("\\$".concat(_),"g");p&&(p=p.replace(P,E)),m&&(m=m.replace(P,E)),v&&(v=v.replace(P,E))});const T=w.getMethodParameters(w.uniforms,S),R=T.length>0?", ".concat(T):"";p&&(u+="\n float fx_".concat(x.key,"_onShaderMask(float shaderMask ").concat(R,") {\n ").concat(p,"\n }\n ")),m&&(u+="\n vec4 fx_".concat(x.key,"_onColorize(float shaderMask, vec4 maskColor, vec4 shaderColor").concat(R,") {\n ").concat(m,"\n }\n ")),v&&(u+="\n vec4 fx_".concat(x.key,"_onEffectMask(float shaderMask, vec4 maskColor, vec4 shaderColor").concat(R,") {\n ").concat(v,"\n }\n "))});let g="";for(const x in i)g+=i[x];let y="mix(shaderColor, maskColor, clamp(-(lng_DefaultMask), 0.0, 1.0))",b="\n\n ";for(let x=0;x0?", ".concat(w.passParameters):"",A=t[w.name];A.onShaderMask&&(b+="\n shaderMask = fx_".concat(w.target,"_onShaderMask(shaderMask ").concat(S,");\n ")),A.onColorize&&(b+="\n maskColor = fx_".concat(w.target,"_onColorize(shaderMask, maskColor, shaderColor").concat(S,");\n ")),A.onEffectMask&&(y="fx_".concat(w.target,"_onEffectMask(shaderMask, maskColor, shaderColor").concat(S,")"));const p=d[x+1];(p===void 0||t[p.name].onEffectMask)&&(b+="\n shaderColor = ".concat(y,";\n "))}return{effects:d,uniforms:a,fragment:Ne.fragment(s,g,u,b),vertex:Ne.vertex()}}static resolveMethodDuplicate(e,t,o,i=0){const s=e+(i>0?i:"");return o[s]&&o[s]!==t?this.resolveMethodDuplicate(e,t,o,++i):s}static resolveDefaults(e,t){return{effects:Bi(e.effects,t),$dimensions:{width:0,height:0},$alpha:0}}static makeCacheKey(e,t){var i;let o="";return(i=e.effects)==null||i.forEach(s=>{const c=t[s.type].getEffectKey(s.props||{});o+=",".concat(c)}),"DynamicShader".concat(o)}};h(Ne,"z$__type__Props"),h(Ne,"vertex",()=>"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n "),h(Ne,"fragment",(e,t,o,i)=>"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n #define PI 3.14159265359\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_alpha;\n uniform float u_radius;\n uniform sampler2D u_texture;\n uniform float u_pixelRatio;\n\n ".concat(e,"\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n ").concat(t,"\n\n ").concat(o,"\n\n void main() {\n vec2 p = v_textureCoordinate.xy * u_dimensions - u_dimensions * 0.5;\n vec2 d = abs(p) - (u_dimensions) * 0.5;\n float lng_DefaultMask = min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n\n vec4 shaderColor = vec4(0.0);\n float shaderMask = lng_DefaultMask;\n\n vec4 maskColor = texture2D(u_texture, v_textureCoordinate) * v_color;\n\n shaderColor = mix(shaderColor, maskColor, clamp(-(lng_DefaultMask + 0.5), 0.0, 1.0));\n\n ").concat(i,"\n\n gl_FragColor = shaderColor * u_alpha;\n }\n "));let ut=Ne;class Mn extends Lt{constructor(n){super({renderer:n,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2f"},{name:"u_dimensions",uniform:"uniform2fv"},{name:"u_radius",uniform:"uniform1f"}]})}static resolveDefaults(n){return{radius:n.radius||10,$dimensions:{width:0,height:0}}}bindTextures(n){const{glw:e}=this;e.activeTexture(0),e.bindTexture(n[0].ctxTexture)}bindProps(n){this.setUniform("u_radius",n.radius)}canBatchShaderProps(n,e){return n.radius===e.radius&&n.$dimensions.width===e.$dimensions.width&&n.$dimensions.height===e.$dimensions.height}}h(Mn,"z$__type__Props"),h(Mn,"shaderSources",{vertex:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n ",fragment:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_radius;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n float boxDist(vec2 p, vec2 size, float radius){\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n\n float fillMask(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate) * v_color;\n vec2 halfDimensions = u_dimensions * 0.5;\n\n float d = boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions + 0.5, u_radius);\n gl_FragColor = mix(vec4(0.0), color, fillMask(d));\n }\n "});const ki=new Float32Array([1,0,0,0,1,0,0,0,1]),yn=class yn extends Lt{constructor(n){super({renderer:n,attributes:["a_position","a_textureCoordinate"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_transform",uniform:"uniformMatrix3fv"},{name:"u_scrollY",uniform:"uniform1f"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2f"},{name:"u_color",uniform:"uniform4fv"},{name:"u_size",uniform:"uniform1f"},{name:"u_distanceRange",uniform:"uniform1f"},{name:"u_debug",uniform:"uniform1i"}]})}bindTextures(n){const{glw:e}=this;e.activeTexture(0),e.bindTexture(n[0].ctxTexture)}bindProps(n){const e=yn.resolveDefaults(n);for(const t in e)if(t==="transform")this.setUniform("u_transform",!1,e[t]);else if(t==="scrollY")this.setUniform("u_scrollY",e[t]);else if(t==="color"){const o=ke(e.color);this.setUniform("u_color",o)}else t==="size"?this.setUniform("u_size",e[t]):t==="distanceRange"?this.setUniform("u_distanceRange",e[t]):t==="debug"&&this.setUniform("u_debug",e[t]?1:0)}static resolveDefaults(n={}){var e,t,o,i,s,a;return{transform:(e=n.transform)!=null?e:ki,scrollY:(t=n.scrollY)!=null?t:0,color:(o=n.color)!=null?o:4294967295,size:(i=n.size)!=null?i:16,distanceRange:(s=n.distanceRange)!=null?s:1,debug:(a=n.debug)!=null?a:!1}}};h(yn,"shaderSources",{vertex:"\n // an attribute is an input (in) to a vertex shader.\n // It will receive data from a buffer\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n\n uniform vec2 u_resolution;\n uniform mat3 u_transform;\n uniform float u_scrollY;\n uniform float u_pixelRatio;\n uniform float u_size;\n\n varying vec2 v_texcoord;\n\n void main() {\n vec2 scrolledPosition = a_position * u_size - vec2(0, u_scrollY);\n vec2 transformedPosition = (u_transform * vec3(scrolledPosition, 1)).xy;\n gl_Position = vec4((transformedPosition * u_pixelRatio / u_resolution * 2.0 - 1.0) * vec2(1, -1), 0, 1);\n v_texcoord = a_textureCoordinate;\n }\n ",fragment:"\n precision highp float;\n\n uniform vec4 u_color;\n uniform sampler2D u_texture;\n uniform float u_distanceRange;\n uniform float u_pixelRatio;\n uniform int u_debug;\n\n varying vec2 v_texcoord;\n\n float median(float r, float g, float b) {\n return max(min(r, g), min(max(r, g), b));\n }\n\n void main() {\n vec3 sample = texture2D(u_texture, v_texcoord).rgb;\n if (u_debug == 1) {\n gl_FragColor = vec4(sample.r, sample.g, sample.b, 1.0);\n return;\n }\n float scaledDistRange = u_distanceRange * u_pixelRatio;\n float sigDist = scaledDistRange * (median(sample.r, sample.g, sample.b) - 0.5);\n float opacity = clamp(sigDist + 0.5, 0.0, 1.0) * u_color.a;\n\n // Build the final color.\n // IMPORTANT: We must premultiply the color by the alpha value before returning it.\n gl_FragColor = vec4(u_color.r * opacity, u_color.g * opacity, u_color.b * opacity, opacity);\n }\n "});let zn=yn;class ot extends ie{constructor(){super(...arguments);h(this,"name","radius")}static getEffectKey(){return"radius"}static resolveDefaults(e){var t;return{radius:(t=e.radius)!=null?t:10}}}h(ot,"z$__type__Props"),h(ot,"uniforms",{radius:{value:0,method:"uniform4fv",type:"vec4",validator:e=>{let t=e;return Array.isArray(t)?t.length===2?t=[t[0],t[1],t[0],t[1]]:t.length===3?t=[t[0],t[1],t[2],t[0]]:t.length!==4&&(t=[t[0],t[0],t[0],t[0]]):typeof t=="number"&&(t=[t,t,t,t]),t}}}),h(ot,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",boxDist:"\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n "}),h(ot,"onShaderMask","\n vec2 halfDimensions = u_dimensions * 0.5;\n float r = radius[0] * step(v_textureCoordinate.x, 0.5) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[1] * step(0.5, v_textureCoordinate.x) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[2] * step(0.5, v_textureCoordinate.x) * step(0.5, v_textureCoordinate.y);\n r = r + radius[3] * step(v_textureCoordinate.x, 0.5) * step(0.5, v_textureCoordinate.y);\n return $boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions, r);\n "),h(ot,"onEffectMask","\n return mix(vec4(0.0), maskColor, $fillMask(shaderMask));\n ");class Ct extends ie{constructor(){super(...arguments);h(this,"name","border")}static getEffectKey(){return"border"}static resolveDefaults(e){var t,o;return{width:(t=e.width)!=null?t:10,color:(o=e.color)!=null?o:4294967295}}}h(Ct,"z$__type__Props"),h(Ct,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>ke(e),method:"uniform4fv",type:"vec4"}}),h(Ct,"onEffectMask","\n float mask = clamp(shaderMask + width, 0.0, 1.0) - clamp(shaderMask, 0.0, 1.0);\n return mix(shaderColor, mix(shaderColor, maskColor, maskColor.a), mask);\n "),h(Ct,"onColorize","\n return color;\n ");const Ye=class Ye extends ie{constructor(){super(...arguments);h(this,"name","linearGradient")}static getEffectKey(e){return"linearGradient".concat(e.colors.length)}static resolveDefaults(e){var i,s;const t=(i=e.colors)!=null?i:[4278190080,4294967295];let o=e.stops||[];if(o.length===0||o.length!==t.length){const a=t.length;let c=0;const d=o;for(;ce.map(o=>ke(o)).reduce((o,i)=>o.concat(i),[]),size:e=>e.colors.length,method:"uniform4fv",type:"vec4"},stops:{value:[],size:e=>e.colors.length,method:"uniform1fv",type:"float"}}),h(Ye,"methods",{fromLinear:"\n vec4 function(vec4 linearRGB) {\n vec4 higher = vec4(1.055)*pow(linearRGB, vec4(1.0/2.4)) - vec4(0.055);\n vec4 lower = linearRGB * vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n ",toLinear:"\n vec4 function(vec4 sRGB) {\n vec4 higher = pow((sRGB + vec4(0.055))/vec4(1.055), vec4(2.4));\n vec4 lower = sRGB/vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n ",calcPoint:"\n vec2 function(float d, float angle) {\n return d * vec2(cos(angle), sin(angle)) + (u_dimensions * 0.5);\n }\n "}),h(Ye,"ColorLoop",e=>{let t="";for(let o=2;o{const t=e.colors.length||1;return"\n float a = angle - (PI / 180.0 * 90.0);\n float lineDist = abs(u_dimensions.x * cos(a)) + abs(u_dimensions.y * sin(a));\n vec2 f = $calcPoint(lineDist * 0.5, a);\n vec2 t = $calcPoint(lineDist * 0.5, a + PI);\n vec2 gradVec = t - f;\n float dist = dot(v_textureCoordinate.xy * u_dimensions - f, gradVec) / dot(gradVec, gradVec);\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = $fromLinear(mix($toLinear(colors[0]), $toLinear(colors[1]), stopCalc));\n ".concat(Ye.ColorLoop(t),"\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n ")});let Pn=Ye;class Dn extends ie{constructor(){super(...arguments);h(this,"name","grayscale")}static getEffectKey(){return"grayscale"}static resolveDefaults(e){var t;return{amount:(t=e.amount)!=null?t:1}}}h(Dn,"uniforms",{amount:{value:1,method:"uniform1f",type:"float"}}),h(Dn,"onColorize","\n float grayness = 0.2 * maskColor.r + 0.6 * maskColor.g + 0.2 * maskColor.b;\n return vec4(amount * vec3(grayness) + (1.0 - amount) * maskColor.rgb, maskColor.a);\n ");class it extends ie{constructor(){super(...arguments);h(this,"name","borderRight")}static getEffectKey(){return"borderRight"}static resolveDefaults(e){var t,o;return{width:(t=e.width)!=null?t:10,color:(o=e.color)!=null?o:4294967295}}}h(it,"z$__type__Props"),h(it,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>ke(e),method:"uniform4fv",type:"vec4"}}),h(it,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),h(it,"onEffectMask","\n vec2 pos = vec2(u_dimensions.x - width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),h(it,"onColorize","\n return color;\n ");class st extends ie{constructor(){super(...arguments);h(this,"name","borderTop")}static getEffectKey(){return"borderTop"}static resolveDefaults(e){var t,o;return{width:(t=e.width)!=null?t:10,color:(o=e.color)!=null?o:4294967295}}}h(st,"z$__type__Props"),h(st,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>ke(e),method:"uniform4fv",type:"vec4"}}),h(st,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),h(st,"onEffectMask","\n vec2 pos = vec2(0.0, width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),h(st,"onColorize","\n return color;\n ");class at extends ie{constructor(){super(...arguments);h(this,"name","borderBottom")}static getEffectKey(){return"borderBottom"}static resolveDefaults(e){var t,o;return{width:(t=e.width)!=null?t:10,color:(o=e.color)!=null?o:4294967295}}}h(at,"z$__type__Props"),h(at,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>ke(e),method:"uniform4fv",type:"vec4"}}),h(at,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),h(at,"onEffectMask","\n vec2 pos = vec2(0.0, u_dimensions.y - width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),h(at,"onColorize","\n return color;\n ");class lt extends ie{constructor(){super(...arguments);h(this,"name","borderLeft")}static getEffectKey(){return"borderLeft"}static resolveDefaults(e){var t,o;return{width:(t=e.width)!=null?t:10,color:(o=e.color)!=null?o:4294967295}}}h(lt,"z$__type__Props"),h(lt,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>ke(e),method:"uniform4fv",type:"vec4"}}),h(lt,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),h(lt,"onEffectMask","\n vec2 pos = vec2(width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),h(lt,"onColorize","\n return color;\n ");class Tt extends ie{constructor(){super(...arguments);h(this,"name","glitch")}static getEffectKey(e){return"glitch"}static resolveDefaults(e){var t,o,i,s,a;return{amplitude:(t=e.amplitude)!=null?t:.2,narrowness:(o=e.narrowness)!=null?o:4,blockiness:(i=e.blockiness)!=null?i:2,minimizer:(s=e.minimizer)!=null?s:8,time:(a=e.time)!=null?a:Date.now()}}}h(Tt,"z$__type__Props"),h(Tt,"uniforms",{amplitude:{value:0,method:"uniform1f",type:"float"},narrowness:{value:0,method:"uniform1f",type:"float"},blockiness:{value:0,method:"uniform1f",type:"float"},minimizer:{value:0,method:"uniform1f",type:"float"},time:{value:0,method:"uniform1f",validator:e=>(Date.now()-e)%1e3,type:"float"}}),h(Tt,"methods",{rand:"\n float function(vec2 p, float time) {\n float t = floor(time * 20.) / 10.;\n return fract(sin(dot(p, vec2(t * 12.9898, t * 78.233))) * 43758.5453);\n }\n ",noise:"\n float function(vec2 uv, float blockiness, float time) {\n vec2 lv = fract(uv);\n vec2 id = floor(uv);\n\n float n1 = rand(id, time);\n float n2 = rand(id+vec2(1,0), time);\n float n3 = rand(id+vec2(0,1), time);\n float n4 = rand(id+vec2(1,1), time);\n vec2 u = smoothstep(0.0, 1.0 + blockiness, lv);\n return mix(mix(n1, n2, u.x), mix(n3, n4, u.x), u.y);\n }\n ",fbm:"\n float function(vec2 uv, int count, float blockiness, float complexity, float time) {\n float val = 0.0;\n float amp = 0.5;\n const int MAX_ITERATIONS = 10;\n\n for(int i = 0; i < MAX_ITERATIONS; i++) {\n if(i >= count) {break;}\n val += amp * noise(uv, blockiness, time);\n amp *= 0.5;\n uv *= complexity;\n }\n return val;\n }\n "}),h(Tt,"onColorize","\n vec2 uv = v_textureCoordinate.xy;\n float aspect = u_dimensions.x / u_dimensions.y;\n vec2 a = vec2(uv.x * aspect , uv.y);\n vec2 uv2 = vec2(a.x / u_dimensions.x, exp(a.y));\n\n float shift = amplitude * pow($fbm(uv2, 4, blockiness, narrowness, time), minimizer);\n float colR = texture2D(u_texture, vec2(uv.x + shift, uv.y)).r * (1. - shift);\n float colG = texture2D(u_texture, vec2(uv.x - shift, uv.y)).g * (1. - shift);\n float colB = texture2D(u_texture, vec2(uv.x - shift, uv.y)).b * (1. - shift);\n\n vec3 f = vec3(colR, colG, colB);\n return vec4(f, texture2D(u_texture, vec2(uv.x - shift, uv.y)).a);\n ");class rn extends ie{constructor(){super(...arguments);h(this,"name","fadeOut")}static getEffectKey(){return"fadeOut"}static resolveDefaults(e){var t;return{fade:(t=e.fade)!=null?t:10}}}h(rn,"z$__type__Props"),h(rn,"uniforms",{fade:{value:0,method:"uniform4fv",type:"vec4",validator:e=>{let t=e;return Array.isArray(t)?t.length===2?t=[t[0],t[1],t[0],t[1]]:t.length===3?t=[t[0],t[1],t[2],t[0]]:t.length!==4&&(t=[t[0],t[0],t[0],t[0]]):typeof t=="number"&&(t=[t,t,t,t]),t}}}),h(rn,"onColorize","\n vec2 point = v_textureCoordinate.xy * u_dimensions.xy;\n vec2 pos1;\n vec2 pos2;\n vec2 d;\n float c;\n vec4 result = maskColor;\n\n\n if(fade[0] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x, point.y + fade[0]);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[1] > 0.0) {\n pos1 = vec2(point.x - u_dimensions.x - fade[1], v_textureCoordinate.y);\n pos2 = vec2(point.x - u_dimensions.x, v_textureCoordinate.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[2] > 0.0) {\n pos1 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y - fade[2]);\n pos2 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[3] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x + fade[3], point.y);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n return result;\n ");const qe=class qe extends ie{constructor(){super(...arguments);h(this,"name","radialGradient")}static getEffectKey(e){return"radialGradient".concat(e.colors.length)}static resolveDefaults(e){var i,s,a,c,d;const t=(i=e.colors)!=null?i:[4278190080,4294967295];let o=e.stops||[];if(o.length===0||o.length!==t.length){const u=t.length;let g=0;const y=o;for(;ge.map(o=>ke(o)).reduce((o,i)=>o.concat(i),[]),size:e=>e.colors.length,method:"uniform4fv",type:"vec4"},stops:{value:[],size:e=>e.colors.length,method:"uniform1fv",type:"float"}}),h(qe,"ColorLoop",e=>{let t="";for(let o=2;o{const t=e.colors.length||1;return"\n vec2 point = v_textureCoordinate.xy * u_dimensions;\n vec2 projection = vec2(pivot.x * u_dimensions.x, pivot.y * u_dimensions.y);\n\n float dist = length((point - projection) / vec2(width, height));\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = mix(colors[0], colors[1], stopCalc);\n ".concat(qe.ColorLoop(t),"\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n ")});let On=qe;class ct extends ie{constructor(){super(...arguments);h(this,"name","radialProgress")}static getEffectKey(){return"radialProgress"}static resolveDefaults(e){var t,o,i,s,a,c,d;return{width:(t=e.width)!=null?t:10,progress:(o=e.progress)!=null?o:.5,offset:(i=e.offset)!=null?i:0,range:(s=e.range)!=null?s:Math.PI*2,rounded:(a=e.rounded)!=null?a:!1,radius:(c=e.radius)!=null?c:1,color:(d=e.color)!=null?d:4294967295}}}h(ct,"z$__type__Props"),h(ct,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},progress:{value:.5,method:"uniform1f",type:"float"},offset:{value:0,method:"uniform1f",type:"float"},range:{value:0,method:"uniform1f",type:"float"},rounded:{value:0,method:"uniform1f",type:"float",validator:e=>e?1:0},radius:{value:1,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>ke(e),method:"uniform4fv",type:"vec4"}}),h(ct,"methods",{rotateUV:"\n vec2 function(vec2 uv, float d) {\n float s = sin(d);\n float c = cos(d);\n mat2 rotMatrix = mat2(c, -s, s, c);\n return uv * rotMatrix;\n }\n ",drawDot:"\n float function(vec2 uv, vec2 p, float r) {\n uv += p;\n float circle = length(uv) - r;\n return clamp(-circle, 0.0, 1.0);\n }\n "}),h(ct,"onEffectMask","\n float outerRadius = radius * u_dimensions.y * 0.5;\n\n float endAngle = range * progress - 0.0005;\n\n vec2 uv = v_textureCoordinate.xy * u_dimensions.xy - u_dimensions * 0.5;\n\n uv = $rotateUV(uv, -(offset));\n float linewidth = width * u_pixelRatio;\n float circle = length(uv) - (outerRadius - linewidth) ;\n circle = abs(circle) - linewidth;\n circle = clamp(-circle, 0.0, 1.0);\n\n float angle = (atan(uv.x, -uv.y) / 3.14159265359 * 0.5);\n float p = endAngle / (PI * 2.);\n\n circle *= step(fract(angle), fract(p));\n\n circle = rounded < 1. ? circle : max(circle, $drawDot(uv, vec2(0, outerRadius - linewidth), linewidth));\n circle = rounded < 1. ? circle : max(circle, $drawDot($rotateUV(uv, -(endAngle)), vec2(0, outerRadius - linewidth), linewidth));\n\n return mix(shaderColor, maskColor, circle);\n "),h(ct,"onColorize","\n return color;\n ");class dt extends ie{constructor(){super(...arguments);h(this,"name","holePunch")}static getEffectKey(){return"holePunch"}static resolveDefaults(e){var t;return{x:e.x||0,y:e.y||0,width:e.width||50,height:e.height||50,radius:(t=e.radius)!=null?t:0}}}h(dt,"z$__type__Props"),h(dt,"uniforms",{x:{value:0,method:"uniform1f",type:"float"},y:{value:0,method:"uniform1f",type:"float"},width:{value:0,method:"uniform1f",type:"float"},height:{value:0,method:"uniform1f",type:"float"},radius:{value:0,method:"uniform4fv",type:"vec4",validator:e=>{let t=e;return Array.isArray(t)?t.length===2?t=[t[0],t[1],t[0],t[1]]:t.length===3?t=[t[0],t[1],t[2],t[0]]:t.length!==4&&(t=[t[0],t[0],t[0],t[0]]):typeof t=="number"&&(t=[t,t,t,t]),t}}}),h(dt,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",boxDist:"\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n "}),h(dt,"onShaderMask","\n vec2 halfDimensions = u_dimensions * 0.5;\n vec2 size = vec2(width, height) * 0.5;\n vec2 basePos = v_textureCoordinate.xy * u_dimensions.xy - vec2(x, y);\n vec2 pos = basePos - size;\n float r = radius[0] * step(pos.x, 0.5) * step(pos.y, 0.5);\n r = r + radius[1] * step(0.5, pos.x) * step(pos.y, 0.5);\n r = r + radius[2] * step(0.5, pos.x) * step(0.5, pos.y);\n r = r + radius[3] * step(pos.x, 0.5) * step(0.5, pos.y);\n return $boxDist(pos, size, r);\n "),h(dt,"onEffectMask","\n return mix(maskColor, vec4(0.0), $fillMask(shaderMask));\n ");class Ei{constructor(){h(this,"shCache",new Map);h(this,"shConstructors",{});h(this,"attachedShader",null);h(this,"effectConstructors",{});h(this,"renderer");this.registerShaderType("DefaultShader",ho),this.registerShaderType("DefaultShaderBatched",uo),this.registerShaderType("RoundedRectangle",Mn),this.registerShaderType("DynamicShader",ut),this.registerShaderType("SdfShader",zn),this.registerEffectType("border",Ct),this.registerEffectType("borderBottom",at),this.registerEffectType("borderLeft",lt),this.registerEffectType("borderRight",it),this.registerEffectType("borderTop",st),this.registerEffectType("fadeOut",rn),this.registerEffectType("linearGradient",Pn),this.registerEffectType("radialGradient",On),this.registerEffectType("grayscale",Dn),this.registerEffectType("glitch",Tt),this.registerEffectType("radius",ot),this.registerEffectType("radialProgress",ct),this.registerEffectType("holePunch",dt)}registerShaderType(n,e){this.shConstructors[n]=e}registerEffectType(n,e){this.effectConstructors[n]=e}getRegisteredEffects(){return this.effectConstructors}getRegisteredShaders(){return this.shConstructors}loadShader(n,e){if(!this.renderer)throw new Error("Renderer is not been defined");const t=this.shConstructors[n];if(!t)throw new Error('Shader type "'.concat(n,'" is not registered'));if(n==="DynamicShader")return this.loadDynamicShader(e);const o=t.resolveDefaults(e),i=t.makeCacheKey(o)||t.name;if(i&&this.shCache.has(i))return{shader:this.shCache.get(i),props:o};const s=new t(this.renderer,e);return i&&this.shCache.set(i,s),{shader:s,props:o}}loadDynamicShader(n){if(!this.renderer)throw new Error("Renderer is not been defined");const e=ut.resolveDefaults(n,this.effectConstructors),t=ut.makeCacheKey(e,this.effectConstructors);if(t&&this.shCache.has(t))return{shader:this.shCache.get(t),props:e};const o=new ut(this.renderer,n,this.effectConstructors);return t&&this.shCache.set(t,o),{shader:o,props:e}}useShader(n){this.attachedShader!==n&&(this.attachedShader&&this.attachedShader.detach(),n.attach(),this.attachedShader=n)}}class Fi{constructor(){h(this,"data",{})}reset(){this.data={}}increment(n){this.data[n]||(this.data[n]=0),this.data[n]++}getData(){return{...this.data}}}function Ni(r){return/\.(ktx|pvr)$/.test(r)}const Li=async r=>{const e=await(await fetch(r)).arrayBuffer();return r.indexOf(".ktx")!==-1?Mi(e):zi(e)},Mi=async r=>{const n=new DataView(r),e=n.getUint32(12)===16909060,t=[],o={glInternalFormat:n.getUint32(28,e),pixelWidth:n.getUint32(36,e),pixelHeight:n.getUint32(40,e),numberOfMipmapLevels:n.getUint32(56,e),bytesOfKeyValueData:n.getUint32(60,e)};let i=64;i+=o.bytesOfKeyValueData;for(let s=0;s{const a=r,c=new Int32Array(a,0,13),d=c[12]+52,u=new Uint8Array(a,d),g=[],y={pixelWidth:c[7],pixelHeight:c[6],numberOfMipmapLevels:c[11]||0};let b=0,x=y.pixelWidth||0,w=y.pixelHeight||0;for(let S=0;S>2)*(w+3>>2)*8,p=new Uint8Array(a,u.byteOffset+b,A);g.push(p),b+=A,x=x>>1,w=w>>1}return{data:{glInternalFormat:36196,mipmaps:g,width:y.pixelWidth||0,height:y.pixelHeight||0,type:"pvr"},premultiplyAlpha:!1}},Et=class Et extends io{constructor(e,t){super(e);h(this,"props");this.props=Et.resolveDefaults(t)}hasAlphaChannel(e){return e.indexOf("image/png")!==-1}async getTextureData(){const{src:e,premultiplyAlpha:t}=this.props;if(!e)return{data:null};if(e instanceof ImageData)return{data:e,premultiplyAlpha:t};if(Ni(e))return Li(e);if(this.txManager.imageWorkerManager)return await this.txManager.imageWorkerManager.getImage(e,t);if(this.txManager.hasCreateImageBitmap){const i=await(await fetch(e)).blob(),s=t!=null?t:this.hasAlphaChannel(i.type);return{data:await createImageBitmap(i,{premultiplyAlpha:s?"premultiply":"none",colorSpaceConversion:"none",imageOrientation:"none"}),premultiplyAlpha:s}}else{const o=new Image;return o.src=e,await new Promise((i,s)=>{o.onload=()=>i(),o.onerror=()=>s(new Error("Failed to load image"))}).catch(i=>{console.error(i)}),{data:o,premultiplyAlpha:t!=null?t:!0}}}static makeCacheKey(e){const t=Et.resolveDefaults(e);return t.src instanceof ImageData?!1:"ImageTexture,".concat(t.src,",").concat(t.premultiplyAlpha)}static resolveDefaults(e){var t,o;return{src:(t=e.src)!=null?t:"",premultiplyAlpha:(o=e.premultiplyAlpha)!=null?o:!0}}};h(Et,"z$__type__Props");let Un=Et;const Pi=24;function Di(r,n,e,t,o,i,s,a,c){const d=Math.min(Math.max(s.firstLineIdx,0),a.length),u=0;let g=0;t==="middle"?g=(n-r)/2:t==="bottom"&&(g=n-r);const b=o/i+d*n+g;if(!(c&&b>=c/i))return{sdfX:u,sdfY:b,lineIndex:d}}class _t{constructor(n,e=0){h(this,"iterator");h(this,"peekBuffer",[]);h(this,"_lastIndex");this.iterator=n,this.iterator=n,this._lastIndex=e-1,this.peekBuffer=[]}next(){const n=this.peekBuffer.length>0?this.peekBuffer.pop():this.iterator.next();return n.done?this._lastIndex=-1:this._lastIndex++,n}peek(){if(this.peekBuffer.length>0)return this.peekBuffer[0];const n=this.iterator.next();return this.peekBuffer.push(n),n}get lastIndex(){return this._lastIndex}}function*It(r,n=0){let e=n;for(;e=b.y1,De=O<=b.y2,pe=Pe&&De;for(;(de=te.next())&&!de.done;){const K=de.value;if(r===y.length)y.push({codepointIndex:K.cluster,maxY:k,maxX:P});else if(r>y.length)throw new Error("Unexpected lineCache length");if(K.codepoint===32||K.codepoint===10?W.codepointIndex!==-1&&(W.codepointIndex=-1,re=z):W.codepointIndex===-1&&(W.codepointIndex=K.cluster,W.bufferOffset=D,W.xStart=re),K.mapped){const Ut=z+K.xOffset+K.width;if(g!=="none"&&Ut>=ge&&W.codepointIndex!==-1&&W.xStart>0)if(be){te=j.shapeText(se,new _t(It(t,W.codepointIndex),W.codepointIndex)),D=W.bufferOffset;break}else te=j.shapeText(se,new _t(It(A,0),0)),z=W.xStart,D=W.bufferOffset,g="none";else{const Oe=z+K.xOffset,Ue=O+K.yOffset;if(pe){Ce===-1&&(Ce=D);const Ke=x.getAtlasEntry(K.glyphId),Xe=Ke.x/x.data.common.scaleW,Ve=Ke.y/x.data.common.scaleH,xt=Ke.width/x.data.common.scaleW,xr=Ke.height/x.data.common.scaleH;u[D++]=Oe,u[D++]=Ue,u[D++]=Xe,u[D++]=Ve,u[D++]=Oe+K.width,u[D++]=Ue,u[D++]=Xe+xt,u[D++]=Ve,u[D++]=Oe,u[D++]=Ue+K.height,u[D++]=Xe,u[D++]=Ve+xr,u[D++]=Oe+K.width,u[D++]=Ue+K.height,u[D++]=Xe+xt,u[D++]=Ve+xr}k=Math.max(k,Ue+K.height),P=Math.max(P,Oe+K.width),z+=K.xAdvance}}else if(K.codepoint===10){if(be)break;te=j.shapeText(se,new _t(It(A,0),0)),g="none"}}Ce!==-1&&(ze.push({bufferStart:Ce,bufferEnd:D}),Ce=-1),z=0,O+=v,r++,W.codepointIndex=-1,re=0,!w&&g==="both"&&O>b.y2||de&&de.done?Qe=!1:be||(Qe=!1)}if(o==="center"){const be=g==="none"?P:T;for(let ge=0;getypeof r=="number"?r:Hi[r]||400;function ji(r,n,e,t,o){let i=Ir(e);for(const s of r){const a=s[n];if(!a)continue;if(a.size===1)return console.warn("TrFontManager: Only one font face found for family: '".concat(n,"' - will be used for all weights and styles")),a.values().next().value;const c=new Map;for(const u of a){const g=Ir(u.descriptors.weight);if(g===i&&u.descriptors.style===t&&u.descriptors.stretch===o)return u;c.set(g,u)}const d="TrFontManager: No exact match: '".concat(n," Weight: ").concat(i," Style: ").concat(t," Stretch: ").concat(o,"'");if(console.error(d),i===400&&c.has(500))return c.get(500);if(i===500&&c.has(400))return c.get(400);if(i<400){for(;i>0;){if(c.has(i))return c.get(i);i-=100}i=600}for(;i<1e3;){if(c.has(i))return c.get(i);i+=100}for(i=500;i>0;){if(c.has(i))return c.get(i);i-=100}}}const Qi=oo(ji);class fo{constructor(n){h(this,"textRenderers");this.textRenderers=n}addFontFace(n){for(const e in this.textRenderers){const t=this.textRenderers[e];t&&t.isFontFaceSupported(n)&&t.addFontFace(n)}}static resolveFontFace(n,e){const{fontFamily:t,fontWeight:o,fontStyle:i,fontStretch:s}=e;return Qi(n,t,o,i,s)}}const Ki={x:0,y:0,width:0,height:0};class Xi extends co{constructor(e){super(e);h(this,"ssdfFontFamilies",{});h(this,"msdfFontFamilies",{});h(this,"fontFamilyArray",[this.ssdfFontFamilies,this.msdfFontFamilies]);h(this,"sdfShader");h(this,"rendererBounds");this.sdfShader=this.stage.shManager.loadShader("SdfShader").shader,this.rendererBounds={x1:0,y1:0,x2:this.stage.options.appWidth,y2:this.stage.options.appHeight}}getPropertySetters(){return{fontFamily:(e,t)=>{e.props.fontFamily=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontWeight:(e,t)=>{e.props.fontWeight=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontStyle:(e,t)=>{e.props.fontStyle=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontStretch:(e,t)=>{e.props.fontStretch=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontSize:(e,t)=>{e.props.fontSize=t,this.invalidateLayoutCache(e)},text:(e,t)=>{e.props.text=t,this.invalidateLayoutCache(e)},textAlign:(e,t)=>{e.props.textAlign=t,this.invalidateLayoutCache(e)},color:(e,t)=>{e.props.color=t},x:(e,t)=>{e.props.x=t,e.elementBounds.valid&&(this.setElementBoundsX(e),!e.renderWindow.valid&&In(e.elementBounds,this.rendererBounds)&&this.scheduleUpdateState(e))},y:(e,t)=>{e.props.y=t,e.elementBounds.valid&&(this.setElementBoundsY(e),!e.renderWindow.valid&&In(e.elementBounds,this.rendererBounds)&&this.scheduleUpdateState(e))},contain:(e,t)=>{e.props.contain=t,this.invalidateLayoutCache(e)},width:(e,t)=>{e.props.width=t,e.props.contain!=="none"&&this.invalidateLayoutCache(e)},height:(e,t)=>{e.props.height=t,e.props.contain==="both"&&this.invalidateLayoutCache(e)},offsetY:(e,t)=>{e.props.offsetY=t,this.invalidateLayoutCache(e)},scrollable:(e,t)=>{e.props.scrollable=t,this.invalidateLayoutCache(e)},scrollY:(e,t)=>{e.props.scrollY=t,this.scheduleUpdateState(e)},letterSpacing:(e,t)=>{e.props.letterSpacing=t,this.invalidateLayoutCache(e)},lineHeight:(e,t)=>{e.props.lineHeight=t,this.invalidateLayoutCache(e)},maxLines:(e,t)=>{e.props.maxLines=t,this.invalidateLayoutCache(e)},textBaseline:(e,t)=>{e.props.textBaseline=t,this.invalidateLayoutCache(e)},verticalAlign:(e,t)=>{e.props.verticalAlign=t,this.invalidateLayoutCache(e)},overflowSuffix:(e,t)=>{e.props.overflowSuffix=t,this.invalidateLayoutCache(e)},debug:(e,t)=>{e.props.debug=t}}}canRenderFont(e){const{fontFamily:t}=e;return t in this.ssdfFontFamilies||t in this.msdfFontFamilies||t==="$$SDF_FAILURE_TEST$$"}isFontFaceSupported(e){return e instanceof vr}addFontFace(e){F(e instanceof vr);const t=e.fontFamily,o=e.type==="ssdf"?this.ssdfFontFamilies:e.type==="msdf"?this.msdfFontFamilies:void 0;if(!o){console.warn("Invalid font face type: ".concat(e.type));return}let i=o[t];i||(i=new Set,o[t]=i),i.add(e)}createState(e){return{props:e,status:"initialState",updateScheduled:!1,emitter:new nt,lineCache:[],forceFullLayoutCalc:!1,renderWindow:{screen:{x1:0,y1:0,x2:0,y2:0},sdf:{x1:0,y1:0,x2:0,y2:0},firstLineIdx:0,numLines:0,valid:!1},elementBounds:{x1:0,y1:0,x2:0,y2:0,valid:!1},clippingRect:{x:0,y:0,width:0,height:0,valid:!1},bufferNumFloats:0,bufferNumQuads:0,vertexBuffer:void 0,webGlBuffers:null,bufferUploaded:!1,textH:void 0,textW:void 0,distanceRange:0,trFontFace:void 0,isRenderable:!1,debugData:{updateCount:0,layoutCount:0,lastLayoutNumCharacters:0,layoutSum:0,drawSum:0,drawCount:0,bufferSize:0}}}updateState(e){let{trFontFace:t}=e;const{textH:o,lineCache:i,debugData:s,forceFullLayoutCalc:a}=e;if(s.updateCount++,e.status==="initialState"&&this.setStatus(e,"loading"),!t){if(t=this.resolveFontFace(e.props),e.trFontFace=t,!t){const j="SdfTextRenderer: Could not resolve font face for family: '".concat(e.props.fontFamily,"'");console.error(j),this.setStatus(e,"failed",new Error(j));return}t.texture.setRenderableOwner(e,e.isRenderable)}if(!t.loaded){t.once("loaded",()=>{this.scheduleUpdateState(e)});return}F(t.data,"Font face data should be loaded");const{text:c,fontSize:d,x:u,y:g,contain:y,width:b,height:x,lineHeight:w,verticalAlign:S,scrollable:A,overflowSuffix:p,maxLines:m}=e.props,v=y==="both"&&A?e.props.scrollY:0,{renderWindow:T}=e,R=t.data.info.size,I=d/R,C=w/I;e.distanceRange=I*t.data.distanceField.distanceRange;const _=c.length*Pi;let E=e.vertexBuffer;(!E||E.length<_)&&(E=new Float32Array(_*2));const P=e.elementBounds;if(P.valid||(this.setElementBoundsX(e),this.setElementBoundsY(e),P.valid=!0),!a&&T.valid){const j=T.screen;if(u+j.x1<=P.x1&&u+j.x2>=P.x2&&g-v+j.y1<=P.y1&&g-v+j.y2>=P.y2){this.setStatus(e,"loaded");return}T.valid=!1,this.setStatus(e,"loading")}const{offsetY:k,textAlign:z}=e.props;if(!T.valid){if(!In(P,this.rendererBounds))return;$i(T,u,g,v,w,y==="both"?P.y2-P.y1:0,P,I)}const O=Di(R,C,w,S,k,I,T,i,o);if(!O){this.setStatus(e,"loaded");return}const{letterSpacing:D}=e.props,W=Ui(O.lineIndex,O.sdfX,O.sdfY,c,z,b,x,d,w,D,E,y,i,T.sdf,t,a,A,p,m);e.bufferUploaded=!1,e.bufferNumFloats=W.bufferNumFloats,e.bufferNumQuads=W.bufferNumQuads,e.vertexBuffer=E,e.renderWindow=T,s.lastLayoutNumCharacters=W.layoutNumCharacters,s.bufferSize=E.byteLength,W.fullyProcessed&&(e.textW=W.maxX*I,e.textH=W.maxY*I),this.setStatus(e,"loaded")}renderQuads(e,t,o,i){var _,E,P;if(!e.vertexBuffer)return;const{renderer:s}=this.stage,{fontSize:a,color:c,contain:d,scrollable:u,zIndex:g,debug:y}=e.props,b=d==="both"&&u?e.props.scrollY:0,{textW:x=0,textH:w=0,distanceRange:S,vertexBuffer:A,bufferUploaded:p,trFontFace:m,elementBounds:v}=e;let{webGlBuffers:T}=e;if(!T){const k=s.glw,z=4*Float32Array.BYTES_PER_ELEMENT,O=k.createBuffer();F(O),e.webGlBuffers=new li([{buffer:O,attributes:{a_position:{name:"a_position",size:2,type:k.FLOAT,normalized:!1,stride:z,offset:0},a_textureCoordinate:{name:"a_textureCoordinate",size:2,type:k.FLOAT,normalized:!1,stride:z,offset:2*Float32Array.BYTES_PER_ELEMENT}}}]),e.bufferUploaded=!1,F(e.webGlBuffers),T=e.webGlBuffers}if(!p){const k=s.glw,z=(_=T==null?void 0:T.getBuffer("a_textureCoordinate"))!=null?_:null;k.arrayBufferData(z,A,k.STATIC_DRAW),e.bufferUploaded=!0}if(F(m),u&&d==="both"){F(v.valid);const k=ci(v,Ki);o.valid?(e.clippingRect.valid=!0,o=nr(o,k,e.clippingRect)):(e.clippingRect.valid=!0,o=so(k,e.clippingRect))}const R=new di(s.glw,s.options,T,this.sdfShader,{transform:t.data,color:hi(c,i),size:a/(((E=m.data)==null?void 0:E.info.size)||0),scrollY:b,distanceRange:S,debug:y.sdfShaderDebug},i,o,{height:w,width:x},0,g),I=(P=e.trFontFace)==null?void 0:P.texture;F(I);const C=this.stage.txManager.getCtxTexture(I);R.addTexture(C),R.length=e.bufferNumFloats,R.numQuads=e.bufferNumQuads,s.addRenderOp(R)}setIsRenderable(e,t){var o;super.setIsRenderable(e,t),(o=e.trFontFace)==null||o.texture.setRenderableOwner(e,t)}destroyState(e){var t;super.destroyState(e),(t=e.trFontFace)==null||t.texture.setRenderableOwner(e,!1)}resolveFontFace(e){return fo.resolveFontFace(this.fontFamilyArray,e)}releaseFontFace(e){e.trFontFace&&(e.trFontFace.texture.setRenderableOwner(e,!1),e.trFontFace=void 0)}invalidateLayoutCache(e){e.renderWindow.valid=!1,e.elementBounds.valid=!1,e.textH=void 0,e.textW=void 0,e.lineCache=[],this.setStatus(e,"loading"),this.scheduleUpdateState(e)}setElementBoundsX(e){const{x:t,contain:o,width:i}=e.props,{elementBounds:s}=e;s.x1=t,s.x2=o!=="none"?t+i:1/0}setElementBoundsY(e){const{y:t,contain:o,height:i}=e.props,{elementBounds:s}=e;s.y1=t,s.y2=o==="both"?t+i:1/0}}function Vi(r){return r.prototype instanceof ui}async function Gi(r,n){let e;try{console.log("Loading core extension",r),e=await Ai(()=>import(r),__vite__mapDeps([]))}catch(o){console.error("The core extension module at '".concat(r,"' could not be loaded.")),console.error(o);return}if(!e.default){console.error("The core extension module at '".concat(r,"' does not have a default export."));return}const t=e.default;if(Vi(t)){const o=new t;try{await o.run(n)}catch(i){console.error("The core extension at '".concat(r,"' threw an error.")),console.error(i)}}else console.error("The core extension at '".concat(r,"' does not extend CoreExtension."))}function go(r){const n={boolean:!0,string:!0,number:!0},e=Object.keys(r);for(let t=0;t2048&&(console.warn("Custom Data value for ".concat(o," is too long, it will be truncated to 2048 characters")),r[o]=i.substring(0,2048)),n[s]||(console.warn("Custom Data value for ".concat(o," is not a boolean, string, or number, it will be ignored")),delete r[o])}return r}class qi extends nt{constructor(e,t,o){var A,p,m,v;super();h(this,"root",null);h(this,"driver");h(this,"canvas");h(this,"settings");h(this,"inspector",null);h(this,"nodes",new Map);h(this,"nextTextureId",1);h(this,"textureTracker");const i={appWidth:e.appWidth||1920,appHeight:e.appHeight||1080,txMemByteThreshold:e.txMemByteThreshold||124e6,boundsMargin:e.boundsMargin||0,deviceLogicalPixelRatio:e.deviceLogicalPixelRatio||1,devicePhysicalPixelRatio:e.devicePhysicalPixelRatio||window.devicePixelRatio,clearColor:(A=e.clearColor)!=null?A:0,coreExtensionModule:e.coreExtensionModule||null,experimental_FinalizationRegistryTextureUsageTracker:(p=e.experimental_FinalizationRegistryTextureUsageTracker)!=null?p:!1,textureCleanupOptions:e.textureCleanupOptions||{},fpsUpdateInterval:e.fpsUpdateInterval||0,numImageWorkers:e.numImageWorkers!==void 0?e.numImageWorkers:2,enableContextSpy:(m=e.enableContextSpy)!=null?m:!1,enableInspector:(v=e.enableInspector)!=null?v:!1};this.settings=i;const{appWidth:s,appHeight:a,deviceLogicalPixelRatio:c,devicePhysicalPixelRatio:d,enableInspector:u}=i,g=T=>{this.driver.releaseTexture(T)},y=i.experimental_FinalizationRegistryTextureUsageTracker&&typeof FinalizationRegistry=="function";this.textureTracker=y?new yi(g):new xi(g,this.settings.textureCleanupOptions);const b=s*c,x=a*c;this.driver=o;const w=document.createElement("canvas");this.canvas=w,w.width=b*d,w.height=x*d,w.style.width="".concat(b,"px"),w.style.height="".concat(x,"px");let S;if(typeof t=="string"?S=document.getElementById(t):S=t,!S)throw new Error("Could not find target element");o.onCreateNode=T=>{this.nodes.set(T.id,T)},o.onBeforeDestroyNode=T=>{this.nodes.delete(T.id)},o.onFpsUpdate=T=>{this.emit("fpsUpdate",T)},o.onFrameTick=T=>{this.emit("frameTick",T)},o.onIdle=()=>{this.emit("idle")},S.appendChild(w),u&&!ro()&&(this.inspector=new wi(w,i))}async init(){await this.driver.init(this,this.settings,this.canvas),this.root=this.driver.getRootNode()}createNode(e){return this.inspector?this.inspector.createNode(this.driver,this.resolveNodeDefaults(e)):this.driver.createNode(this.resolveNodeDefaults(e))}createTextNode(e){var i,s,a,c,d,u,g,y,b,x,w,S,A,p,m,v,T,R,I;const t=(i=e.fontSize)!=null?i:16,o={...this.resolveNodeDefaults(e),text:(s=e.text)!=null?s:"",textRendererOverride:(a=e.textRendererOverride)!=null?a:null,fontSize:t,fontFamily:(c=e.fontFamily)!=null?c:"sans-serif",fontStyle:(d=e.fontStyle)!=null?d:"normal",fontWeight:(u=e.fontWeight)!=null?u:"normal",fontStretch:(g=e.fontStretch)!=null?g:"normal",textAlign:(y=e.textAlign)!=null?y:"left",contain:(b=e.contain)!=null?b:"none",scrollable:(x=e.scrollable)!=null?x:!1,scrollY:(w=e.scrollY)!=null?w:0,offsetY:(S=e.offsetY)!=null?S:0,letterSpacing:(A=e.letterSpacing)!=null?A:0,lineHeight:(p=e.lineHeight)!=null?p:t,maxLines:(m=e.maxLines)!=null?m:0,textBaseline:(v=e.textBaseline)!=null?v:"alphabetic",verticalAlign:(T=e.verticalAlign)!=null?T:"top",overflowSuffix:(R=e.overflowSuffix)!=null?R:"...",debug:(I=e.debug)!=null?I:{}};return this.inspector?this.inspector.createTextNode(this.driver,o):this.driver.createTextNode(o)}resolveNodeDefaults(e){var d,u,g,y,b,x,w,S,A,p,m,v,T,R,I,C,_,E,P,k,z,O,D,W,j,se,te,de,Ce,ze,Dt,Ot,Qe,be,ge,re,Pe,De,pe,K,Ut,Oe,Ue,Ke,Xe,Ve,xt;const t=(d=e.color)!=null?d:4294967295,o=(y=(g=(u=e.colorTl)!=null?u:e.colorTop)!=null?g:e.colorLeft)!=null?y:t,i=(w=(x=(b=e.colorTr)!=null?b:e.colorTop)!=null?x:e.colorRight)!=null?w:t,s=(p=(A=(S=e.colorBl)!=null?S:e.colorBottom)!=null?A:e.colorLeft)!=null?p:t,a=(T=(v=(m=e.colorBr)!=null?m:e.colorBottom)!=null?v:e.colorRight)!=null?T:t,c=go((R=e.data)!=null?R:{});return{x:(I=e.x)!=null?I:0,y:(C=e.y)!=null?C:0,width:(_=e.width)!=null?_:0,height:(E=e.height)!=null?E:0,alpha:(P=e.alpha)!=null?P:1,autosize:(k=e.autosize)!=null?k:!1,clipping:(z=e.clipping)!=null?z:!1,color:t,colorTop:(O=e.colorTop)!=null?O:t,colorBottom:(D=e.colorBottom)!=null?D:t,colorLeft:(W=e.colorLeft)!=null?W:t,colorRight:(j=e.colorRight)!=null?j:t,colorBl:s,colorBr:a,colorTl:o,colorTr:i,zIndex:(se=e.zIndex)!=null?se:0,zIndexLocked:(te=e.zIndexLocked)!=null?te:0,parent:(de=e.parent)!=null?de:null,texture:(Ce=e.texture)!=null?Ce:null,shader:(ze=e.shader)!=null?ze:null,src:(Dt=e.src)!=null?Dt:"",scale:(Ot=e.scale)!=null?Ot:null,scaleX:(be=(Qe=e.scaleX)!=null?Qe:e.scale)!=null?be:1,scaleY:(re=(ge=e.scaleY)!=null?ge:e.scale)!=null?re:1,mount:(Pe=e.mount)!=null?Pe:0,mountX:(pe=(De=e.mountX)!=null?De:e.mount)!=null?pe:0,mountY:(Ut=(K=e.mountY)!=null?K:e.mount)!=null?Ut:0,pivot:(Oe=e.pivot)!=null?Oe:.5,pivotX:(Ke=(Ue=e.pivotX)!=null?Ue:e.pivot)!=null?Ke:.5,pivotY:(Ve=(Xe=e.pivotY)!=null?Xe:e.pivot)!=null?Ve:.5,rotation:(xt=e.rotation)!=null?xt:0,data:c}}destroyNode(e){return this.inspector&&this.inspector.destroyNode(e),this.driver.destroyNode(e)}createTexture(e,t,o){const i=this.nextTextureId++,s={descType:"texture",txType:e,props:t,options:{...o,id:i}};return this.textureTracker.registerTexture(s),s}createShader(e,t){return{descType:"shader",shType:e,props:t}}getNodeById(e){return this.nodes.get(e)||null}toggleFreeze(){throw new Error("Not implemented")}advanceFrame(){throw new Error("Not implemented")}rerender(){throw new Error("Not implemented")}}class Zi extends nt{constructor(e,t,o){super();h(this,"node");h(this,"props");h(this,"settings");h(this,"propStartValues",{});h(this,"restoreValues",{});h(this,"progress",0);h(this,"delayFor",0);h(this,"timingFunction");h(this,"propsList");this.node=e,this.props=t,this.settings=o,this.propStartValues={},this.propsList=Object.keys(t),this.propsList.forEach(i=>{this.propStartValues[i]=e[i]}),this.timingFunction=i=>i,o.easing&&typeof o.easing=="string"&&(this.timingFunction=fi(o.easing)),this.delayFor=o.delay||0}reset(){this.progress=0,this.delayFor=this.settings.delay||0,this.update(0)}restore(){this.reset(),Object.keys(this.props).forEach(e=>{this.node[e]=this.propStartValues[e]})}reverse(){this.progress=0,Object.keys(this.props).forEach(e=>{const t=this.props[e],o=this.propStartValues[e];this.props[e]=o,this.propStartValues[e]=t}),this.settings.loop||(this.settings.stopMethod=!1)}applyEasing(e,t,o){return(this.timingFunction(e)||e)*(o-t)+t}update(e){const{duration:t,loop:o,easing:i,stopMethod:s}=this.settings;if(!t){this.emit("finished",{});return}if(this.delayFor>0){this.delayFor-=e;return}if(this.delayFor<=0&&this.progress===0&&this.emit("start",{}),this.progress+=e/t,this.progress>1&&(this.progress=o?0:1,s)){this.emit("finished",{});return}for(let a=0;a{this.startedResolve=n}))}makeStoppedPromise(){this.stoppedResolve===null&&(this.stoppedPromise=new Promise(n=>{this.stoppedResolve=n}))}started(){F(this.startedResolve),this.startedResolve(this),this.startedResolve=null}finished(){F(this.stoppedResolve);const{loop:n,stopMethod:e}=this.animation.settings;if(e==="reverse"){this.animation.reverse(),this.start();return}this.stoppedResolve(),this.stoppedResolve=null,!n&&this.manager.unregisterAnimation(this.animation)}}const q=0,Z=3,ce=6,X=1,J=4,he=7,me=2,xe=5,ye=8;class ve{constructor(n){h(this,"data");n?(this.data=new Float32Array(9),this.data[q]=n[0],this.data[Z]=n[3],this.data[ce]=n[6],this.data[X]=n[1],this.data[J]=n[4],this.data[he]=n[7],this.data[me]=n[2],this.data[xe]=n[5],this.data[ye]=n[8]):this.data=new Float32Array(9)}static get temp(){return es}static multiply(n,e,t){const o=n.data[q]*e.data[q]+n.data[Z]*e.data[X]+n.data[ce]*e.data[me],i=n.data[q]*e.data[Z]+n.data[Z]*e.data[J]+n.data[ce]*e.data[xe],s=n.data[q]*e.data[ce]+n.data[Z]*e.data[he]+n.data[ce]*e.data[ye],a=n.data[X]*e.data[q]+n.data[J]*e.data[X]+n.data[he]*e.data[me],c=n.data[X]*e.data[Z]+n.data[J]*e.data[J]+n.data[he]*e.data[xe],d=n.data[X]*e.data[ce]+n.data[J]*e.data[he]+n.data[he]*e.data[ye],u=n.data[me]*e.data[q]+n.data[xe]*e.data[X]+n.data[ye]*e.data[me],g=n.data[me]*e.data[Z]+n.data[xe]*e.data[J]+n.data[ye]*e.data[xe],y=n.data[me]*e.data[ce]+n.data[xe]*e.data[he]+n.data[ye]*e.data[ye];return t||(t=new ve),t.data[q]=o,t.data[Z]=i,t.data[ce]=s,t.data[X]=a,t.data[J]=c,t.data[he]=d,t.data[me]=u,t.data[xe]=g,t.data[ye]=y,t}static identity(n){return n||(n=new ve),n.data[q]=1,n.data[Z]=0,n.data[ce]=0,n.data[X]=0,n.data[J]=1,n.data[he]=0,n.data[me]=0,n.data[xe]=0,n.data[ye]=1,n}static translate(n,e,t){return t||(t=new ve),t.data[q]=1,t.data[Z]=0,t.data[ce]=n,t.data[X]=0,t.data[J]=1,t.data[he]=e,t.data[me]=0,t.data[xe]=0,t.data[ye]=1,t}static scale(n,e,t){return t||(t=new ve),t.data[q]=n,t.data[Z]=0,t.data[ce]=0,t.data[X]=0,t.data[J]=e,t.data[he]=0,t.data[me]=0,t.data[xe]=0,t.data[ye]=1,t}static rotate(n,e){const t=Math.cos(n),o=Math.sin(n);return e||(e=new ve),e.data[q]=t,e.data[Z]=-o,e.data[ce]=0,e.data[X]=o,e.data[J]=t,e.data[he]=0,e.data[me]=0,e.data[xe]=0,e.data[ye]=1,e}static copy(n,e,t){return e||(e=new ve),e.data[0]=n.data[0],e.data[1]=n.data[1],e.data[2]=n.data[2],e.data[3]=n.data[3],e.data[4]=n.data[4],e.data[5]=n.data[5],e.data[6]=n.data[6],e.data[7]=n.data[7],e.data[8]=n.data[8],e}translate(n,e){return this.data[ce]=this.data[q]*n+this.data[Z]*e+this.data[ce],this.data[he]=this.data[X]*n+this.data[J]*e+this.data[he],this}scale(n,e){return this.data[q]=this.data[q]*n,this.data[Z]=this.data[Z]*e,this.data[X]=this.data[X]*n,this.data[J]=this.data[J]*e,this}rotate(n){if(n===0||!(n%Math.PI*2))return this;const e=Math.cos(n),t=Math.sin(n),o=this.data[q]*e+this.data[Z]*t,i=this.data[Z]*e-this.data[q]*t,s=this.data[X]*e+this.data[J]*t,a=this.data[J]*e-this.data[X]*t;return this.data[q]=o,this.data[Z]=i,this.data[X]=s,this.data[J]=a,this}multiply(n){return ve.multiply(this,n,this)}get tx(){return this.data[ce]}get ty(){return this.data[he]}get ta(){return this.data[q]}get tb(){return this.data[Z]}get tc(){return this.data[X]}get td(){return this.data[J]}transformPoint(n,e){return[this.data[q]*n+this.data[Z]*e+this.data[ce],this.data[X]*n+this.data[J]*e+this.data[X]]}}const es=new ve,Wt=0,Yt=2,$t=4,Ht=6,jt=1,Qt=3,Kt=5,Xt=7;class sn{constructor(n){h(this,"data");this.data=new Float32Array(8),n&&(this.data[Wt]=n[Wt],this.data[Yt]=n[Yt],this.data[$t]=n[$t],this.data[Ht]=n[Ht],this.data[jt]=n[jt],this.data[Qt]=n[Qt],this.data[Kt]=n[Kt],this.data[Xt]=n[Xt])}static translate(n,e,t,o,i,s,a,c,d){return d||(d=new sn),d.data[Wt]=n,d.data[Yt]=t,d.data[$t]=i,d.data[Ht]=a,d.data[jt]=e,d.data[Qt]=o,d.data[Kt]=s,d.data[Xt]=c,d}get x1(){return this.data[Wt]}get x2(){return this.data[Yt]}get x3(){return this.data[$t]}get x4(){return this.data[Ht]}get y1(){return this.data[jt]}get y2(){return this.data[Qt]}get y3(){return this.data[Kt]}get y4(){return this.data[Xt]}}var V;(function(r){r[r.Init=0]="Init",r[r.OutOfBounds=2]="OutOfBounds",r[r.InBounds=4]="InBounds",r[r.InViewport=8]="InViewport"})(V||(V={}));const Je=new Map;Je.set(V.Init,"init");Je.set(V.OutOfBounds,"outOfBounds");Je.set(V.InBounds,"inBounds");Je.set(V.InViewport,"inViewport");var B;(function(r){r[r.Children=1]="Children",r[r.ScaleRotate=2]="ScaleRotate",r[r.Local=4]="Local",r[r.Global=8]="Global",r[r.Clipping=16]="Clipping",r[r.CalculatedZIndex=32]="CalculatedZIndex",r[r.ZIndexSortedChildren=64]="ZIndexSortedChildren",r[r.PremultipliedColors=128]="PremultipliedColors",r[r.WorldAlpha=256]="WorldAlpha",r[r.RenderState=512]="RenderState",r[r.IsRenderable=1024]="IsRenderable",r[r.None=0]="None",r[r.All=2047]="All"})(B||(B={}));class rr extends nt{constructor(e,t){super();h(this,"stage");h(this,"children",[]);h(this,"props");h(this,"updateType",B.All);h(this,"globalTransform");h(this,"scaleRotateTransform");h(this,"localTransform");h(this,"renderCoords");h(this,"renderBound");h(this,"strictBound");h(this,"preloadBound");h(this,"clippingRect",{x:0,y:0,width:0,height:0,valid:!1});h(this,"isRenderable",!1);h(this,"renderState",V.Init);h(this,"worldAlpha",1);h(this,"premultipliedColorTl",0);h(this,"premultipliedColorTr",0);h(this,"premultipliedColorBl",0);h(this,"premultipliedColorBr",0);h(this,"calcZIndex",0);h(this,"onTextureLoaded",(e,t)=>{this.autosizeNode(t),this.stage.requestRender(),this.emit("loaded",{type:"texture",dimensions:t})});h(this,"onTextureFailed",(e,t)=>{this.emit("failed",{type:"texture",error:t})});h(this,"onTextureFreed",e=>{this.emit("freed",{type:"texture"})});this.stage=e,this.props={...t,parent:null},this.parent=t.parent,this.updateScaleRotateTransform()}loadTexture(e,t,o=null){this.props.texture&&this.unloadTexture();const{txManager:i}=this.stage,s=i.loadTexture(e,t,o);this.props.texture=s,this.props.textureOptions=o,this.setUpdateType(B.IsRenderable),queueMicrotask(()=>{s.state==="loaded"?this.onTextureLoaded(s,s.dimensions):s.state==="failed"?this.onTextureFailed(s,s.error):s.state==="freed"&&this.onTextureFreed(s),s.on("loaded",this.onTextureLoaded),s.on("failed",this.onTextureFailed),s.on("freed",this.onTextureFreed)})}unloadTexture(){if(this.props.texture){const{texture:e}=this.props;e.off("loaded",this.onTextureLoaded),e.off("failed",this.onTextureFailed),e.off("freed",this.onTextureFreed),e.setRenderableOwner(this,!1)}this.props.texture=null,this.props.textureOptions=null,this.setUpdateType(B.IsRenderable)}autosizeNode(e){this.autosize&&(this.width=e.width,this.height=e.height)}loadShader(e,t){const o=this.stage.renderer.getShaderManager();F(o);const{shader:i,props:s}=o.loadShader(e,t);this.props.shader=i,this.props.shaderProps=s,this.setUpdateType(B.IsRenderable)}setUpdateType(e){this.updateType|=e;const t=this.props.parent;t&&!(t.updateType&B.Children)&&t.setUpdateType(B.Children)}sortChildren(){this.children.sort((e,t)=>e.calcZIndex-t.calcZIndex)}updateScaleRotateTransform(){this.scaleRotateTransform=ve.rotate(this.props.rotation,this.scaleRotateTransform).scale(this.props.scaleX,this.props.scaleY)}updateLocalTransform(){F(this.scaleRotateTransform);const e=this.props.pivotX*this.props.width,t=this.props.pivotY*this.props.height,o=this.props.mountX*this.props.width,i=this.props.mountY*this.props.height;this.localTransform=ve.translate(e-o+this.props.x,t-i+this.props.y,this.localTransform).multiply(this.scaleRotateTransform).translate(-e,-t),this.setUpdateType(B.Global)}update(e,t){this.updateType&B.ScaleRotate&&(this.updateScaleRotateTransform(),this.setUpdateType(B.Local)),this.updateType&B.Local&&(this.updateLocalTransform(),this.setUpdateType(B.Global));const o=this.props.parent;let i=B.None;this.updateType&B.Global&&(F(this.localTransform),this.globalTransform=ve.copy((o==null?void 0:o.globalTransform)||this.localTransform,this.globalTransform),o&&this.globalTransform.multiply(this.localTransform),this.calculateRenderCoords(),this.updateBoundingRect(),this.setUpdateType(B.Clipping|B.RenderState|B.Children),i|=B.Global),this.updateType&B.Clipping&&(this.calculateClippingRect(t),this.setUpdateType(B.Children),i|=B.Clipping),this.updateType&B.WorldAlpha&&(o?this.worldAlpha=o.worldAlpha*this.props.alpha:this.worldAlpha=this.props.alpha,this.setUpdateType(B.Children|B.PremultipliedColors|B.IsRenderable),i|=B.WorldAlpha),this.updateType&B.PremultipliedColors&&(this.premultipliedColorTl=At(this.props.colorTl,this.worldAlpha,!0),this.props.colorTl===this.props.colorTr&&this.props.colorBl===this.props.colorBr&&this.props.colorTl===this.props.colorBl?this.premultipliedColorTr=this.premultipliedColorBl=this.premultipliedColorBr=this.premultipliedColorTl:(this.premultipliedColorTr=At(this.props.colorTr,this.worldAlpha,!0),this.premultipliedColorBl=At(this.props.colorBl,this.worldAlpha,!0),this.premultipliedColorBr=At(this.props.colorBr,this.worldAlpha,!0))),this.updateType&B.RenderState&&(this.updateRenderState(t),this.setUpdateType(B.IsRenderable)),this.updateType&B.IsRenderable&&this.updateIsRenderable(),o&&this.updateType&B.CalculatedZIndex&&(this.calculateZIndex(),o.setUpdateType(B.ZIndexSortedChildren)),this.updateType&B.Children&&this.children.length&&this.children.forEach(s=>{s.setUpdateType(i),s.updateType!==0&&s.update(e,this.clippingRect)}),this.updateType&B.ZIndexSortedChildren&&this.sortChildren(),this.updateType=0}checkRenderProps(){return this.props.texture?!0:!this.props.width||!this.props.height?!1:!!(this.props.shader||this.props.clipping||this.props.color!==0||this.props.colorTop!==0||this.props.colorBottom!==0||this.props.colorLeft!==0||this.props.colorRight!==0||this.props.colorTl!==0||this.props.colorTr!==0||this.props.colorBl!==0||this.props.colorBr!==0)}checkRenderBounds(e){F(this.renderBound);const t=e.width||this.stage.root.width,o=e.height||this.stage.root.height;this.strictBound=ht(e.x,e.y,e.x+t,e.y+o,this.strictBound);const i=this.stage.boundsMargin;return this.preloadBound=ht(e.x-i[3],e.y-i[0],e.x+t+i[1],e.y+o+i[2],this.preloadBound),br(this.renderBound,this.strictBound)?V.InViewport:br(this.renderBound,this.preloadBound)?V.InBounds:V.OutOfBounds}updateRenderState(e){const t=this.checkRenderBounds(e);if(t!==this.renderState){let o=this.renderState;this.renderState=t,o===V.InViewport&&this.emit("outOfViewport",{previous:o,current:t}),oV.InBounds&&t===V.OutOfBounds&&(this.emit(Je.get(V.InBounds),{previous:o,current:t}),o=V.InBounds);const i=Je.get(t);F(i),this.emit(i,{previous:o,current:t})}}setRenderState(e){e!==this.renderState&&(this.renderState=e,this.emit(V[e]))}updateIsRenderable(){let e;this.worldAlpha===0||!this.checkRenderProps()?e=!1:e=this.renderState>V.OutOfBounds,this.isRenderable!==e&&(this.isRenderable=e,this.onChangeIsRenderable(e))}onChangeIsRenderable(e){var t;(t=this.props.texture)==null||t.setRenderableOwner(this,e)}calculateRenderCoords(){const{width:e,height:t,globalTransform:o}=this;F(o);const{tx:i,ty:s,ta:a,tb:c,tc:d,td:u}=o;if(c===0&&d===0){const g=i,y=i+e*a,b=s,x=s+t*u;this.renderCoords=sn.translate(g,b,y,b,y,x,g,x,this.renderCoords)}else this.renderCoords=sn.translate(i,s,i+e*a,s+e*d,i+e*a+t*c,s+e*d+t*u,i+t*c,s+t*u,this.renderCoords)}updateBoundingRect(){const{renderCoords:e,globalTransform:t}=this;F(t),F(e);const{tb:o,tc:i}=t,{x1:s,y1:a,x3:c,y3:d}=e;if(o===0||i===0)this.renderBound=ht(s,a,c,d,this.renderBound);else{const{x2:u,x4:g,y2:y,y4:b}=e;this.renderBound=ht(Math.min(s,u,c,g),Math.min(a,y,d,b),Math.max(s,u,c,g),Math.max(a,y,d,b),this.renderBound)}}calculateClippingRect(e){F(this.globalTransform);const{clippingRect:t,props:o,globalTransform:i}=this,{clipping:s}=o,a=i.tb!==0||i.tc!==0;s&&!a?(t.x=i.tx,t.y=i.ty,t.width=this.width*i.ta,t.height=this.height*i.td,t.valid=!0):t.valid=!1,e.valid&&t.valid?nr(e,t,t):e.valid&&(so(e,t),t.valid=!0)}calculateZIndex(){var s,a;const e=this.props,t=e.zIndex||0,o=((s=e.parent)==null?void 0:s.zIndex)||0;let i=t;(a=e.parent)!=null&&a.zIndexLocked&&(i=t{t.setUpdateType(B.CalculatedZIndex)})}get zIndex(){return this.props.zIndex}set zIndex(e){this.props.zIndex=e,this.setUpdateType(B.CalculatedZIndex|B.Children),this.children.forEach(t=>{t.setUpdateType(B.CalculatedZIndex)})}get parent(){return this.props.parent}set parent(e){const t=this.props.parent;if(t!==e){if(this.props.parent=e,t){const o=t.children.indexOf(this);F(o!==-1,"CoreNode.parent: Node not found in old parent's children!"),t.children.splice(o,1),t.setUpdateType(B.Children|B.ZIndexSortedChildren)}e&&(e.children.push(this),this.setUpdateType(B.All),e.setUpdateType(B.Children|B.ZIndexSortedChildren)),this.updateScaleRotateTransform()}}}let ts=1;function or(){return ts++}class Wn extends nt{constructor(e,t,o,i){var s;super();h(this,"rendererMain");h(this,"stage");h(this,"id");h(this,"coreNode");h(this,"_children",[]);h(this,"_src","");h(this,"_parent",null);h(this,"_texture",null);h(this,"_shader",null);h(this,"_data",{});h(this,"onTextureLoaded",(e,t)=>{this.emit("loaded",t)});h(this,"onTextureFailed",(e,t)=>{this.emit("failed",t)});h(this,"onTextureFreed",(e,t)=>{this.emit("freed",t)});h(this,"onOutOfBounds",(e,t)=>{this.emit("outOfBounds",t)});h(this,"onInBounds",(e,t)=>{this.emit("inBounds",t)});h(this,"onOutOfViewport",(e,t)=>{this.emit("outOfViewport",t)});h(this,"onInViewport",(e,t)=>{this.emit("inViewport",t)});this.rendererMain=t,this.stage=o,this.id=(s=i==null?void 0:i.id)!=null?s:or(),this.coreNode=i||new rr(this.stage,{id:this.id,x:e.x,y:e.y,width:e.width,height:e.height,alpha:e.alpha,autosize:e.autosize,clipping:e.clipping,color:e.color,colorTop:e.colorTop,colorBottom:e.colorBottom,colorLeft:e.colorLeft,colorRight:e.colorRight,colorTl:e.colorTl,colorTr:e.colorTr,colorBl:e.colorBl,colorBr:e.colorBr,zIndex:e.zIndex,zIndexLocked:e.zIndexLocked,scaleX:e.scaleX,scaleY:e.scaleY,mountX:e.mountX,mountY:e.mountY,mount:e.mount,pivot:e.pivot,pivotX:e.pivotX,pivotY:e.pivotY,rotation:e.rotation,parent:null,shader:null,shaderProps:null,texture:null,textureOptions:null}),this.coreNode.on("loaded",this.onTextureLoaded),this.coreNode.on("failed",this.onTextureFailed),this.coreNode.on("freed",this.onTextureFreed),this.coreNode.on("outOfBounds",this.onOutOfBounds),this.coreNode.on("inBounds",this.onInBounds),this.coreNode.on("outOfViewport",this.onOutOfViewport),this.coreNode.on("inViewport",this.onInViewport),this.parent=e.parent,this.shader=e.shader,this.texture=e.texture,this.src=e.src,this._data=e.data}get x(){return this.coreNode.x}set x(e){this.coreNode.x=e}get y(){return this.coreNode.y}set y(e){this.coreNode.y=e}get width(){return this.coreNode.width}set width(e){this.coreNode.width=e}get height(){return this.coreNode.height}set height(e){this.coreNode.height=e}get alpha(){return this.coreNode.alpha}set alpha(e){this.coreNode.alpha=e}get autosize(){return this.coreNode.autosize}set autosize(e){this.coreNode.autosize=e}get clipping(){return this.coreNode.clipping}set clipping(e){this.coreNode.clipping=e}get color(){return this.coreNode.color}set color(e){this.coreNode.color=e}get colorTop(){return this.coreNode.colorTop}set colorTop(e){this.coreNode.colorTop=e}get colorBottom(){return this.coreNode.colorBottom}set colorBottom(e){this.coreNode.colorBottom=e}get colorLeft(){return this.coreNode.colorLeft}set colorLeft(e){this.coreNode.colorLeft=e}get colorRight(){return this.coreNode.colorRight}set colorRight(e){this.coreNode.colorRight=e}get colorTl(){return this.coreNode.colorTl}set colorTl(e){this.coreNode.colorTl=e}get colorTr(){return this.coreNode.colorTr}set colorTr(e){this.coreNode.colorTr=e}get colorBl(){return this.coreNode.colorBl}set colorBl(e){this.coreNode.colorBl=e}get colorBr(){return this.coreNode.colorBr}set colorBr(e){this.coreNode.colorBr=e}get scale(){return this.scaleX!==this.scaleY?null:this.coreNode.scaleX}set scale(e){e!==null&&(this.coreNode.scaleX=e,this.coreNode.scaleY=e)}get scaleX(){return this.coreNode.scaleX}set scaleX(e){this.coreNode.scaleX=e}get scaleY(){return this.coreNode.scaleY}set scaleY(e){this.coreNode.scaleY=e}get mount(){return this.coreNode.mount}set mount(e){this.coreNode.mount=e}get mountX(){return this.coreNode.mountX}set mountX(e){this.coreNode.mountX=e}get mountY(){return this.coreNode.mountY}set mountY(e){this.coreNode.mountY=e}get pivot(){return this.coreNode.pivot}set pivot(e){this.coreNode.pivot=e}get pivotX(){return this.coreNode.pivotX}set pivotX(e){this.coreNode.pivotX=e}get pivotY(){return this.coreNode.pivotY}set pivotY(e){this.coreNode.pivotY=e}get rotation(){return this.coreNode.rotation}set rotation(e){this.coreNode.rotation=e}get parent(){return this._parent}set parent(e){var o;const t=this._parent;if(this._parent=e,this.coreNode.parent=(o=e==null?void 0:e.coreNode)!=null?o:null,t){const i=t.children.indexOf(this);F(i!==-1,"MainOnlyNode.parent: Node not found in old parent's children!"),t.children.splice(i,1)}e&&e.children.push(this)}get children(){return this._children}get zIndex(){return this.coreNode.zIndex}set zIndex(e){this.coreNode.zIndex=e}get zIndexLocked(){return this.coreNode.zIndexLocked}set zIndexLocked(e){this.coreNode.zIndexLocked=e}get src(){return this._src}set src(e){if(this._src!==e){if(this._src=e,!e){this.texture=null;return}this.texture=this.rendererMain.createTexture("ImageTexture",{src:e})}}get texture(){return this._texture}set texture(e){this._texture!==e&&(this._texture&&this.rendererMain.textureTracker.decrementTextureRefCount(this._texture),e&&this.rendererMain.textureTracker.incrementTextureRefCount(e),this._texture=e,e?this.coreNode.loadTexture(e.txType,e.props,e.options):this.coreNode.unloadTexture())}get shader(){return this._shader}set shader(e){this._shader!==e&&(this._shader=e,e&&this.coreNode.loadShader(e.shType,e.props))}get data(){return this._data}set data(e){this._data=go(e)}destroy(){this.emit("beforeDestroy",{});let e=this.children[0];for(;e;)e.destroy(),e=this.children[0];this.coreNode.destroy(),this.parent=null,this.texture=null,this.emit("afterDestroy",{}),this.removeAllListeners()}flush(){}animate(e,t){const o=new Zi(this.coreNode,e,t);return new Ji(this.stage.animationManager,o)}}const ns=r=>{let n=!1;const e=()=>{if(r.updateAnimations(),!r.hasSceneUpdates()){r.calculateFps(),setTimeout(e,16.666666666666668),n||(r.emit("idle"),n=!0);return}n=!1,r.drawFrame(),requestAnimationFrame(e)};requestAnimationFrame(e)},rs=()=>performance?performance.now():Date.now();class os{constructor(){h(this,"activeAnimations",new Set)}registerAnimation(n){this.activeAnimations.add(n)}unregisterAnimation(n){this.activeAnimations.delete(n)}update(n){this.activeAnimations.forEach(e=>{e.update(n)})}}class is{constructor(n){h(this,"imageWorkersEnabled",!0);h(this,"messageManager",{});h(this,"workers",[]);h(this,"workerIndex",0);this.workers=this.createWorkers(n),this.workers.forEach(e=>{e.onmessage=this.handleMessage.bind(this)})}handleMessage(n){const{src:e,data:t,error:o}=n.data,i=this.messageManager[e];if(i){const[s,a]=i;delete this.messageManager[e],o?a(new Error(o)):s(t)}}createWorkers(n=1){const e="\n function hasAlphaChannel(mimeType) {\n return (mimeType.indexOf(\"image/png\") !== -1);\n }\n\n function getImage(src, premultiplyAlpha) {\n return new Promise(function(resolve, reject) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', src, true);\n xhr.responseType = 'blob';\n\n xhr.onload = function() {\n if (xhr.status === 200) {\n var blob = xhr.response;\n var hasAlphaChannel = premultiplyAlpha !== undefined ? premultiplyAlpha : hasAlphaChannel(blob.type);\n\n createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none'\n }).then(function(data) {\n resolve({ data: data, premultiplyAlpha: premultiplyAlpha });\n }).catch(function(error) {\n reject(error);\n });\n } else {\n reject(new Error('Failed to load image: ' + xhr.statusText));\n }\n };\n\n xhr.onerror = function() {\n reject(new Error('Network error occurred while trying to fetch the image.'));\n };\n\n xhr.send();\n });\n }\n\n self.onmessage = async (event) => {\n var src = event.data.src;\n var premultiplyAlpha = event.data.premultiplyAlpha;\n\n getImage(src, premultiplyAlpha)\n .then(function(data) {\n self.postMessage({ src: src, data: data }, [data.data]);\n })\n .catch(function(error) {\n self.postMessage({ src: src, error: error.message });\n });\n };\n ",t=new Blob([e.replace('"use strict";',"")],{type:"application/javascript"}),o=(self.URL?URL:webkitURL).createObjectURL(t),i=[];for(let s=0;s{try{if(this.workers){const i=this.convertUrlToAbsolute(n);this.messageManager[i]=[t,o],this.getNextWorker().postMessage({src:i,premultiplyAlpha:e})}}catch(i){o(i)}})}}const Ft=class Ft extends io{constructor(e,t){super(e);h(this,"props");this.props=Ft.resolveDefaults(t)}async getTextureData(){const{width:e,height:t}=this.props,o=e*t*4,i=new Uint8ClampedArray(o);for(let s=0;s{})}setTextureMemUse(n,e){if(this.textures.has(n)&&(this.memUsed-=this.textures.get(n)),e===0){this.textures.delete(n);return}else this.memUsed+=e,this.textures.set(n,e);this.memUsed>this.threshold&&this.gc()}gc(){this.textures.forEach((n,e)=>{e.renderable||e.free()})}}const ls=2e6;class cs extends nt{constructor(e){super();h(this,"options");h(this,"animationManager");h(this,"txManager");h(this,"txMemManager");h(this,"fontManager");h(this,"textRenderers");h(this,"shManager");h(this,"renderer");h(this,"root");h(this,"boundsMargin");h(this,"deltaTime",0);h(this,"lastFrameTime",0);h(this,"currentFrameTime",0);h(this,"fpsNumFrames",0);h(this,"fpsElapsedTime",0);h(this,"renderRequested",!1);h(this,"contextSpy",null);this.options=e;const{canvas:t,clearColor:o,rootId:i,debug:s,appWidth:a,appHeight:c,boundsMargin:d,enableContextSpy:u,numImageWorkers:g,txMemByteThreshold:y}=e;this.txManager=new ss(g),this.txMemManager=new as(y),this.shManager=new Ei,this.animationManager=new os,this.contextSpy=u?new Fi:null;let b=[0,0,0,0];d&&(b=Array.isArray(d)?d:[d,d,d,d]),this.boundsMargin=b,s!=null&&s.monitorTextureCache&&setInterval(()=>{F(this.txManager);const w=this.txManager.getDebugInfo();console.log("Texture ID Cache Size: ",w.idCacheSize),console.log("Texture Key Cache Size: ",w.keyCacheSize)},1e3),this.renderer=new mi({stage:this,canvas:t,pixelRatio:e.devicePhysicalPixelRatio*e.deviceLogicalPixelRatio,clearColor:o!=null?o:4278190080,bufferMemory:ls,txManager:this.txManager,txMemManager:this.txMemManager,shManager:this.shManager,contextSpy:this.contextSpy}),this.txManager.renderer=this.renderer,this.textRenderers={canvas:new Ri(this),sdf:new Xi(this)},this.fontManager=new fo(this.textRenderers);const x=new rr(this,{id:i,x:0,y:0,width:a,height:c,alpha:1,autosize:!1,clipping:!1,color:0,colorTop:0,colorBottom:0,colorLeft:0,colorRight:0,colorTl:0,colorTr:0,colorBl:0,colorBr:0,zIndex:0,zIndexLocked:0,scaleX:1,scaleY:1,mountX:0,mountY:0,mount:0,pivot:.5,pivotX:.5,pivotY:.5,rotation:0,parent:null,texture:null,textureOptions:null,shader:null,shaderProps:null});this.root=x,ns(this)}updateAnimations(){const{animationManager:e}=this;this.root&&(this.lastFrameTime=this.currentFrameTime,this.currentFrameTime=rs(),this.deltaTime=this.lastFrameTime?this.currentFrameTime-this.lastFrameTime:100/6,this.emit("frameTick",{time:this.currentFrameTime,delta:this.deltaTime}),e.update(this.deltaTime))}hasSceneUpdates(){return!!this.root.updateType||this.renderRequested}drawFrame(){const{renderer:e,renderRequested:t}=this;this.root.updateType!==0&&this.root.update(this.deltaTime,this.root.clippingRect),e==null||e.reset(),this.addQuads(this.root),e==null||e.render(),this.calculateFps(),t&&(this.renderRequested=!1)}calculateFps(){var t,o,i;const{fpsUpdateInterval:e}=this.options;if(e&&(this.fpsNumFrames++,this.fpsElapsedTime+=this.deltaTime,this.fpsElapsedTime>=e)){const s=Math.round(this.fpsNumFrames*1e3/this.fpsElapsedTime);this.fpsNumFrames=0,this.fpsElapsedTime=0,this.emit("fpsUpdate",{fps:s,contextSpyData:(o=(t=this.contextSpy)==null?void 0:t.getData())!=null?o:null}),(i=this.contextSpy)==null||i.reset()}}addQuads(e){F(this.renderer&&e.globalTransform),e.isRenderable&&e.renderQuads(this.renderer);for(let t=0;t{const{contain:e}=this,t=this.trState.props.width,o=this.trState.props.height,i=this.trState.textW||0,s=this.trState.textH||0;e==="both"?(this.props.width=t,this.props.height=o):e==="width"?(this.props.width=t,this.props.height=s):e==="none"&&(this.props.width=i,this.props.height=s),this.updateLocalTransform(),this.stage.requestRender(),this.emit("loaded",{type:"text",dimensions:{width:this.trState.textW||0,height:this.trState.textH||0}})});h(this,"onTextFailed",(e,t)=>{this.emit("failed",{type:"text",error:t})});this._textRendererOverride=t.textRendererOverride;const{resolvedTextRenderer:o,textRendererState:i}=this.resolveTextRendererAndState({x:this.absX,y:this.absY,width:t.width,height:t.height,textAlign:t.textAlign,color:t.color,zIndex:t.zIndex,contain:t.contain,scrollable:t.scrollable,scrollY:t.scrollY,offsetY:t.offsetY,letterSpacing:t.letterSpacing,debug:t.debug,fontFamily:t.fontFamily,fontSize:t.fontSize,fontStretch:t.fontStretch,fontStyle:t.fontStyle,fontWeight:t.fontWeight,text:t.text,lineHeight:t.lineHeight,maxLines:t.maxLines,textBaseline:t.textBaseline,verticalAlign:t.verticalAlign,overflowSuffix:t.overflowSuffix});this.textRenderer=o,this.trState=i}get width(){return this.props.width}set width(e){this.props.width=e,this.textRenderer.set.width(this.trState,e),this.contain==="none"&&this.setUpdateType(B.Local)}get height(){return this.props.height}set height(e){this.props.height=e,this.textRenderer.set.height(this.trState,e),this.contain!=="both"&&this.setUpdateType(B.Local)}get color(){return this.trState.props.color}set color(e){this.textRenderer.set.color(this.trState,e)}get text(){return this.trState.props.text}set text(e){this.textRenderer.set.text(this.trState,e)}get textRendererOverride(){return this._textRendererOverride}set textRendererOverride(e){this._textRendererOverride=e,this.textRenderer.destroyState(this.trState);const{resolvedTextRenderer:t,textRendererState:o}=this.resolveTextRendererAndState(this.trState.props);this.textRenderer=t,this.trState=o}get fontSize(){return this.trState.props.fontSize}set fontSize(e){this.textRenderer.set.fontSize(this.trState,e)}get fontFamily(){return this.trState.props.fontFamily}set fontFamily(e){this.textRenderer.set.fontFamily(this.trState,e)}get fontStretch(){return this.trState.props.fontStretch}set fontStretch(e){this.textRenderer.set.fontStretch(this.trState,e)}get fontStyle(){return this.trState.props.fontStyle}set fontStyle(e){this.textRenderer.set.fontStyle(this.trState,e)}get fontWeight(){return this.trState.props.fontWeight}set fontWeight(e){this.textRenderer.set.fontWeight(this.trState,e)}get textAlign(){return this.trState.props.textAlign}set textAlign(e){this.textRenderer.set.textAlign(this.trState,e)}get contain(){return this.trState.props.contain}set contain(e){this.textRenderer.set.contain(this.trState,e)}get scrollable(){return this.trState.props.scrollable}set scrollable(e){this.textRenderer.set.scrollable(this.trState,e)}get scrollY(){return this.trState.props.scrollY}set scrollY(e){this.textRenderer.set.scrollY(this.trState,e)}get offsetY(){return this.trState.props.offsetY}set offsetY(e){this.textRenderer.set.offsetY(this.trState,e)}get letterSpacing(){return this.trState.props.letterSpacing}set letterSpacing(e){this.textRenderer.set.letterSpacing(this.trState,e)}get lineHeight(){return this.trState.props.lineHeight}set lineHeight(e){this.textRenderer.set.lineHeight&&this.textRenderer.set.lineHeight(this.trState,e)}get maxLines(){return this.trState.props.maxLines}set maxLines(e){this.textRenderer.set.maxLines&&this.textRenderer.set.maxLines(this.trState,e)}get textBaseline(){return this.trState.props.textBaseline}set textBaseline(e){this.textRenderer.set.textBaseline&&this.textRenderer.set.textBaseline(this.trState,e)}get verticalAlign(){return this.trState.props.verticalAlign}set verticalAlign(e){this.textRenderer.set.verticalAlign&&this.textRenderer.set.verticalAlign(this.trState,e)}get overflowSuffix(){return this.trState.props.overflowSuffix}set overflowSuffix(e){this.textRenderer.set.overflowSuffix&&this.textRenderer.set.overflowSuffix(this.trState,e)}get debug(){return this.trState.props.debug}set debug(e){this.textRenderer.set.debug(this.trState,e)}update(e,t){super.update(e,t),F(this.globalTransform),this.textRenderer.set.x(this.trState,this.globalTransform.tx),this.textRenderer.set.y(this.trState,this.globalTransform.ty)}checkRenderProps(){return this.trState.props.text!==""?!0:super.checkRenderProps()}onChangeIsRenderable(e){super.onChangeIsRenderable(e),this.textRenderer.setIsRenderable(this.trState,e)}renderQuads(e){F(this.globalTransform),this.textRenderer.renderQuads(this.trState,this.globalTransform,this.clippingRect,this.worldAlpha)}destroy(){super.destroy(),this.textRenderer.destroyState(this.trState)}resolveTextRendererAndState(e){const t=this.stage.resolveTextRenderer(e,this._textRendererOverride),o=t.createState(e);return o.emitter.on("loaded",this.onTextLoaded),o.emitter.on("failed",this.onTextFailed),t.scheduleUpdateState(o),{resolvedTextRenderer:t,textRendererState:o}}}class hs extends Wn{constructor(n,e,t){super(n,e,t,new ds(t,{id:or(),x:n.x,y:n.y,width:n.width,height:n.height,alpha:n.alpha,autosize:n.autosize,clipping:n.clipping,color:n.color,colorTop:n.colorTop,colorBottom:n.colorBottom,colorLeft:n.colorLeft,colorRight:n.colorRight,colorTl:n.colorTl,colorTr:n.colorTr,colorBl:n.colorBl,colorBr:n.colorBr,zIndex:n.zIndex,zIndexLocked:n.zIndexLocked,scaleX:n.scaleX,scaleY:n.scaleY,mountX:n.mountX,mountY:n.mountY,mount:n.mount,pivot:n.pivot,pivotX:n.pivotX,pivotY:n.pivotY,rotation:n.rotation,text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily,fontWeight:n.fontWeight,fontStretch:n.fontStretch,fontStyle:n.fontStyle,contain:n.contain,scrollable:n.scrollable,letterSpacing:n.letterSpacing,textAlign:n.textAlign,scrollY:n.scrollY,offsetY:n.offsetY,textRendererOverride:n.textRendererOverride,lineHeight:n.lineHeight,maxLines:n.maxLines,textBaseline:n.textBaseline,verticalAlign:n.verticalAlign,overflowSuffix:n.overflowSuffix,debug:n.debug,parent:null,texture:null,textureOptions:null,shader:null,shaderProps:null}))}get text(){return this.coreNode.text}set text(n){this.coreNode.text=n}get textRendererOverride(){return this.coreNode.textRendererOverride}set textRendererOverride(n){this.coreNode.textRendererOverride=n}get fontSize(){return this.coreNode.fontSize}set fontSize(n){this.coreNode.fontSize=n}get fontFamily(){return this.coreNode.fontFamily}set fontFamily(n){this.coreNode.fontFamily=n}get fontWeight(){return this.coreNode.fontWeight}set fontWeight(n){this.coreNode.fontWeight=n}get fontStretch(){return this.coreNode.fontStretch}set fontStretch(n){this.coreNode.fontStretch=n}get fontStyle(){return this.coreNode.fontStyle}set fontStyle(n){this.coreNode.fontStyle=n}get textAlign(){return this.coreNode.textAlign}set textAlign(n){this.coreNode.textAlign=n}get contain(){return this.coreNode.contain}set contain(n){this.coreNode.contain=n}get scrollable(){return this.coreNode.scrollable}set scrollable(n){this.coreNode.scrollable=n}get scrollY(){return this.coreNode.scrollY}set scrollY(n){this.coreNode.scrollY=n}get offsetY(){return this.coreNode.offsetY}set offsetY(n){this.coreNode.offsetY=n}get letterSpacing(){return this.coreNode.letterSpacing}set letterSpacing(n){this.coreNode.letterSpacing=n}get lineHeight(){return this.coreNode.lineHeight}set lineHeight(n){n&&(this.coreNode.lineHeight=n)}get maxLines(){return this.coreNode.maxLines}set maxLines(n){n&&(this.coreNode.maxLines=n)}get textBaseline(){return this.coreNode.textBaseline}set textBaseline(n){n&&(this.coreNode.textBaseline=n)}get verticalAlign(){return this.coreNode.verticalAlign}set verticalAlign(n){n&&(this.coreNode.verticalAlign=n)}get overflowSuffix(){return this.coreNode.overflowSuffix}set overflowSuffix(n){n&&(this.coreNode.overflowSuffix=n)}get debug(){return this.coreNode.debug}set debug(n){this.coreNode.debug=n}}class us{constructor(){h(this,"root",null);h(this,"stage",null);h(this,"rendererMain",null)}async init(n,e,t){this.stage=new cs({rootId:or(),appWidth:e.appWidth,appHeight:e.appHeight,txMemByteThreshold:e.txMemByteThreshold,boundsMargin:e.boundsMargin,deviceLogicalPixelRatio:e.deviceLogicalPixelRatio,devicePhysicalPixelRatio:e.devicePhysicalPixelRatio,clearColor:e.clearColor,canvas:t,fpsUpdateInterval:e.fpsUpdateInterval,enableContextSpy:e.enableContextSpy,numImageWorkers:e.numImageWorkers,debug:{monitorTextureCache:!1}}),this.rendererMain=n,F(this.stage.root);const o=new Wn(n.resolveNodeDefaults({}),this.rendererMain,this.stage,this.stage.root);this.root=o,o.once("beforeDestroy",this.onBeforeDestroyNode.bind(this,o)),this.onCreateNode(o),e.coreExtensionModule&&await Gi(e.coreExtensionModule,this.stage),this.stage.on("fpsUpdate",(i,s)=>{this.onFpsUpdate(s)}),this.stage.on("frameTick",(i,s)=>{this.onFrameTick(s)}),this.stage.on("idle",()=>{this.onIdle()})}createNode(n){F(this.rendererMain),F(this.stage);const e=new Wn(n,this.rendererMain,this.stage);return e.once("beforeDestroy",this.onBeforeDestroyNode.bind(this,e)),this.onCreateNode(e),e}createTextNode(n){F(this.rendererMain),F(this.stage);const e=new hs(n,this.rendererMain,this.stage);return e.once("beforeDestroy",this.onBeforeDestroyNode.bind(this,e)),this.onCreateNode(e),e}destroyNode(n){n.destroy()}releaseTexture(n){const{stage:e}=this;F(e),e.txManager.removeTextureIdFromCache(n)}getRootNode(){return F(this.root),this.root}onCreateNode(n){throw new Error("Method not implemented.")}onBeforeDestroyNode(n){throw new Error("Method not implemented.")}onFpsUpdate(n){throw new Error("Method not implemented.")}onFrameTick(n){throw new Error("Method not implemented.")}onIdle(){throw new Error("Method not implemented.")}}const po=(r,n)=>r===n,an=Symbol("solid-proxy"),fs=Symbol("solid-track"),ln={equals:po};let mo=Co;const Se=1,cn=2,xo={owned:null,cleanups:null,context:null,owner:null},Bn={};var $=null;let kn=null,gs=null,H=null,ae=null,Ie=null,vn=0;function ft(r,n){const e=H,t=$,o=r.length===0,i=n===void 0?t:n,s=o?xo:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?r:()=>r(()=>le(()=>bn(s)));$=s,H=null;try{return Re(a,!0)}finally{H=e,$=t}}function U(r,n){n=n?Object.assign({},ln,n):ln;const e={value:r,observers:null,observerSlots:null,comparator:n.equals||void 0},t=o=>(typeof o=="function"&&(o=o(e.value)),Ao(e,o));return[So.bind(e),t]}function $n(r,n,e){const t=zt(r,n,!0,Se);rt(t)}function _e(r,n,e){const t=zt(r,n,!1,Se);rt(t)}function $e(r,n,e){mo=bs;const t=zt(r,n,!1,Se);(!e||!e.render)&&(t.user=!0),Ie?Ie.push(t):rt(t)}function ne(r,n,e){e=e?Object.assign({},ln,e):ln;const t=zt(r,n,!0,0);return t.observers=null,t.observerSlots=null,t.comparator=e.equals||void 0,rt(t),So.bind(t)}function ps(r){return r&&typeof r=="object"&&"then"in r}function et(r,n,e){let t,o,i;arguments.length===2&&typeof n=="object"||arguments.length===1?(t=!0,o=r,i=n||{}):(t=r,o=n,i=e||{});let s=null,a=Bn,c=!1,d="initialValue"in i,u=typeof t=="function"&&ne(t);const g=new Set,[y,b]=(i.storage||U)(i.initialValue),[x,w]=U(void 0),[S,A]=U(void 0,{equals:!1}),[p,m]=U(d?"ready":"unresolved");function v(C,_,E,P){return s===C&&(s=null,P!==void 0&&(d=!0),(C===a||_===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(P,{value:_})),a=Bn,T(_,E)),_}function T(C,_){Re(()=>{_===void 0&&b(()=>C),m(_!==void 0?"errored":d?"ready":"unresolved"),w(_);for(const E of g.keys())E.decrement();g.clear()},!1)}function R(){const C=ys,_=y(),E=x();if(E!==void 0&&!s)throw E;return H&&!H.user&&C&&$n(()=>{S(),s&&(C.resolved||g.has(C)||(C.increment(),g.add(C)))}),_}function I(C=!0){if(C!==!1&&c)return;c=!1;const _=u?u():t;if(_==null||_===!1){v(s,le(y));return}const E=a!==Bn?a:le(()=>o(_,{value:y(),refetching:C}));return ps(E)?(s=E,"value"in E?(E.status==="success"?v(s,E.value,void 0,_):v(s,void 0,void 0,_),E):(c=!0,queueMicrotask(()=>c=!1),Re(()=>{m(d?"refreshing":"pending"),A()},!1),E.then(P=>v(E,P,void 0,_),P=>v(E,void 0,_o(P),_)))):(v(s,E,void 0,_),E)}return Object.defineProperties(R,{state:{get:()=>p()},error:{get:()=>x()},loading:{get(){const C=p();return C==="pending"||C==="refreshing"}},latest:{get(){if(!d)return R();const C=x();if(C&&!s)throw C;return y()}}}),u?$n(()=>I(!1)):I(!1),[R,{refetch:I,mutate:b}]}function yo(r,n=po,e){const t=new Map,o=zt(i=>{const s=r();for(const[a,c]of t.entries())if(n(a,s)!==n(a,i))for(const d of c.values())d.state=Se,d.pure?ae.push(d):Ie.push(d);return s},void 0,!0,Se);return rt(o),i=>{const s=H;if(s){let a;(a=t.get(i))?a.add(s):t.set(i,a=new Set([s])),Me(()=>{a.delete(s),!a.size&&t.delete(i)})}return n(i,o.value)}}function ms(r){return Re(r,!1)}function le(r){if(H===null)return r();const n=H;H=null;try{return r()}finally{H=n}}function He(r,n,e){const t=Array.isArray(r);let o,i=e&&e.defer;return s=>{let a;if(t){a=Array(r.length);for(let d=0;dn(a,o,s));return o=a,c}}function je(r){$e(()=>le(r))}function Me(r){return $===null||($.cleanups===null?$.cleanups=[r]:$.cleanups.push(r)),r}function Mt(){return $}function vo(r,n){const e=$,t=H;$=r,H=null;try{return Re(n,!0)}catch(o){ir(o)}finally{$=e,H=t}}function xs(r){const n=H,e=$;return Promise.resolve().then(()=>{H=n,$=e;let t;return Re(r,!1),H=$=null,t?t.done:void 0})}function wo(r,n){const e=Symbol("context");return{id:e,Provider:Ss(e),defaultValue:r}}function bo(r){return $&&$.context&&$.context[r.id]!==void 0?$.context[r.id]:r.defaultValue}function wn(r){const n=ne(r),e=ne(()=>Hn(n()));return e.toArray=()=>{const t=e();return Array.isArray(t)?t:t!=null?[t]:[]},e}let ys;function So(){if(this.sources&&this.state)if(this.state===Se)rt(this);else{const r=ae;ae=null,Re(()=>hn(this),!1),ae=r}if(H){const r=this.observers?this.observers.length:0;H.sources?(H.sources.push(this),H.sourceSlots.push(r)):(H.sources=[this],H.sourceSlots=[r]),this.observers?(this.observers.push(H),this.observerSlots.push(H.sources.length-1)):(this.observers=[H],this.observerSlots=[H.sources.length-1])}return this.value}function Ao(r,n,e){let t=r.value;return(!r.comparator||!r.comparator(t,n))&&(r.value=n,r.observers&&r.observers.length&&Re(()=>{for(let o=0;o1e6)throw ae=[],new Error},!1)),n}function rt(r){if(!r.fn)return;bn(r);const n=vn;vs(r,r.value,n)}function vs(r,n,e){let t;const o=$,i=H;H=$=r;try{t=r.fn(n)}catch(s){return r.pure&&(r.state=Se,r.owned&&r.owned.forEach(bn),r.owned=null),r.updatedAt=e+1,ir(s)}finally{H=i,$=o}(!r.updatedAt||r.updatedAt<=e)&&(r.updatedAt!=null&&"observers"in r?Ao(r,t):r.value=t,r.updatedAt=e)}function zt(r,n,e,t=Se,o){const i={fn:r,state:t,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:n,owner:$,context:$?$.context:null,pure:e};return $===null||$!==xo&&($.owned?$.owned.push(i):$.owned=[i]),i}function dn(r){if(r.state===0)return;if(r.state===cn)return hn(r);if(r.suspense&&le(r.suspense.inFallback))return r.suspense.effects.push(r);const n=[r];for(;(r=r.owner)&&(!r.updatedAt||r.updatedAt=0;e--)if(r=n[e],r.state===Se)rt(r);else if(r.state===cn){const t=ae;ae=null,Re(()=>hn(r,n[0]),!1),ae=t}}function Re(r,n){if(ae)return r();let e=!1;n||(ae=[]),Ie?e=!0:Ie=[],vn++;try{const t=r();return ws(e),t}catch(t){e||(Ie=null),ae=null,ir(t)}}function ws(r){if(ae&&(Co(ae),ae=null),r)return;const n=Ie;Ie=null,n.length&&Re(()=>mo(n),!1)}function Co(r){for(let n=0;n=0;n--)bn(r.owned[n]);r.owned=null}if(r.cleanups){for(n=r.cleanups.length-1;n>=0;n--)r.cleanups[n]();r.cleanups=null}r.state=0}function _o(r){return r instanceof Error?r:new Error(typeof r=="string"?r:"Unknown error",{cause:r})}function ir(r,n=$){throw _o(r)}function Hn(r){if(typeof r=="function"&&!r.length)return Hn(r());if(Array.isArray(r)){const n=[];for(let e=0;eo=le(()=>($.context={...$.context,[r]:t.value},wn(()=>t.children))),void 0),o}}const As=Symbol("fallback");function Rr(r){for(let n=0;n1?[]:null;return Me(()=>Rr(i)),()=>{let c=r()||[],d,u;return c[fs],le(()=>{let y=c.length,b,x,w,S,A,p,m,v,T;if(y===0)s!==0&&(Rr(i),i=[],t=[],o=[],s=0,a&&(a=[])),e.fallback&&(t=[As],o[0]=ft(R=>(i[0]=R,e.fallback())),s=1);else if(s===0){for(o=new Array(y),u=0;u=p&&v>=p&&t[m]===c[v];m--,v--)w[v]=o[m],S[v]=i[m],a&&(A[v]=a[m]);for(b=new Map,x=new Array(v+1),u=v;u>=p;u--)T=c[u],d=b.get(T),x[u]=d===void 0?-1:d,b.set(T,u);for(d=p;d<=m;d++)T=t[d],u=b.get(T),u!==void 0&&u!==-1?(w[u]=o[d],S[u]=i[d],a&&(A[u]=a[d]),u=x[u],b.set(T,u)):i[d]();for(u=p;ur(n||{}))}function Vt(){return!0}const jn={get(r,n,e){return n===an?e:r.get(n)},has(r,n){return n===an?!0:r.has(n)},set:Vt,deleteProperty:Vt,getOwnPropertyDescriptor(r,n){return{configurable:!0,enumerable:!0,get(){return r.get(n)},set:Vt,deleteProperty:Vt}},ownKeys(r){return r.keys()}};function En(r){return(r=typeof r=="function"?r():r)?r:{}}function Ts(){for(let r=0,n=this.length;r=0;a--){const c=En(r[a])[s];if(c!==void 0)return c}},has(s){for(let a=r.length-1;a>=0;a--)if(s in En(r[a]))return!0;return!1},keys(){const s=[];for(let a=0;a=0;s--){const a=r[s];if(!a)continue;const c=Object.getOwnPropertyNames(a);for(let d=c.length-1;d>=0;d--){const u=c[d];if(u==="__proto__"||u==="constructor")continue;const g=Object.getOwnPropertyDescriptor(a,u);if(!t[u])t[u]=g.get?{enumerable:!0,configurable:!0,get:Ts.bind(e[u]=[g.get.bind(a)])}:g.value!==void 0?g:void 0;else{const y=e[u];y&&(g.get?y.push(g.get.bind(a)):g.value!==void 0&&y.push(()=>g.value))}}}const o={},i=Object.keys(t);for(let s=i.length-1;s>=0;s--){const a=i[s],c=t[a];c&&c.get?Object.defineProperty(o,a,c):o[a]=c?c.value:void 0}return o}function _s(r,...n){if(an in r){const o=new Set(n.length>1?n.flat():n[0]),i=n.map(s=>new Proxy({get(a){return s.includes(a)?r[a]:void 0},has(a){return s.includes(a)&&a in r},keys(){return s.filter(a=>a in r)}},jn));return i.push(new Proxy({get(s){return o.has(s)?void 0:r[s]},has(s){return o.has(s)?!1:s in r},keys(){return Object.keys(r).filter(s=>!o.has(s))}},jn)),i}const e={},t=n.map(()=>({}));for(const o of Object.getOwnPropertyNames(r)){const i=Object.getOwnPropertyDescriptor(r,o),s=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable;let a=!1,c=0;for(const d of n)d.includes(o)&&(a=!0,s?t[c][o]=i.value:Object.defineProperty(t[c],o,i)),++c;a||(s?e[o]=i.value:Object.defineProperty(e,o,i))}return[...t,e]}const Is=r=>"Stale read from <".concat(r,">.");function Sn(r){const n="fallback"in r&&{fallback:()=>r.fallback};return ne(Cs(()=>r.each,r.children,n||void 0))}function Be(r){const n=r.keyed,e=ne(()=>r.when,void 0,{equals:(t,o)=>n?t===o:!t==!o});return ne(()=>{const t=e();if(t){const o=r.children;return typeof o=="function"&&o.length>0?le(()=>o(n?t:()=>{if(!le(e))throw Is("Show");return r.when})):o}return r.fallback},void 0,void 0)}const Rs=void 0;let Le,ar;function Bs(r={},n="app"){const e=new us;return Le=new qi(r,n,e),ar=Le.createShader.bind(Le),Le}class ks extends Array{constructor(e){super();h(this,"_parent");this._parent=e}get selected(){return this[this._parent.selected||0]}get firstChild(){return this[0]}insert(e,t){if(t){const o=this.indexOf(t);this.splice(o,0,e)}else this.push(e);e.parent=this._parent,this._parent._isDirty=!0}remove(e){const t=this.indexOf(e);t>=0&&this.splice(t,1)}}function Es(){return{BASE_URL:"/solid-demo-app/",MODE:"production",DEV:!1,PROD:!0,SSR:!1,LEGACY:!1}&&!1}const Fs=Es()||!1,Ae={debug:!1,animationsEnabled:!0,animationSettings:{duration:250,easing:"ease-in-out"},fontSettings:{fontFamily:"Ubuntu",fontSize:100}};function Br(r){return Ns(r)&&r.debug}function Ze(r,n,...e){Fs&&(Ae.debug||Br(n)||Br(e[0]))&&console.log(r,n,...e)}function vt(r){return typeof r=="function"}function Ns(r){return typeof r=="object"}function un(r){return Array.isArray(r)}function Ls(r){return typeof r=="string"}function Ms(r){return typeof r=="number"}function zs(r){return Number.isInteger(r)}function Ps(r,n){for(const e of n)if(e in r)return!0;return!1}function Ro(r,n={}){if(un(r))r.forEach(e=>{Ro(e,n)});else if(r)for(const e in r)n[e]===void 0&&(n[e]=r[e]);return n}class kr extends Array{constructor(e,t={}){var n=(...ld)=>(super(...ld),h(this,"onChange"),this);return un(t)?n(...t):Ls(t)?n(t):n(...Object.entries(t).filter(([o,i])=>i).map(([o])=>o)),this.onChange=e,this}has(e){return this.indexOf(e)>=0}is(e){return this.indexOf(e)>=0}add(e){this.push(e),this.onChange()}toggle(e){this.has(e)?this.remove(e):this.add(e)}remove(e){const t=this.indexOf(e);t>=0&&(this.splice(t,1),this.onChange())}}function Ds(r){const n=[];for(let p=0;pp+(m[i]||0),0));const A=y&&w?p=>{w==="flexStart"?p[u]=0:w==="center"?p[u]=(y-(p[s]||0))/2:w==="flexEnd"&&(p[u]=y-(p[s]||0))}:p=>p;if(x==="flexStart"){let p=0;if(n.forEach(m=>{m[d]=p+(m[a]||0),p+=(m[i]||0)+b+(m[a]||0)+(m[c]||0),A(m)}),r._autosized){const m=p-b;if(m!==r[i])return r[i]=m,!0}}else if(x==="flexEnd"){let p=g;for(let m=e-1;m>=0;m--){const v=n[m];F(v),v[d]=p-(v[i]||0)-(v[c]||0),p-=(v[i]||0)+b+(v[a]||0)+(v[c]||0),A(v)}}else if(x==="center"){let p=(g-(S+b*(e-1)))/2;n.forEach(m=>{m[d]=p,p+=(m[i]||0)+b,A(m)})}else if(x==="spaceBetween"){const p=(g-S)/(e-1);let m=0;n.forEach(v=>{v[d]=m,m+=(v[i]||0)+p,A(v)})}else if(x==="spaceEvenly"){const p=(g-S)/(e+1);let m=p;n.forEach(v=>{v[d]=m,m+=(v[i]||0)+p,A(v)})}return!1}const[lr,Qn]=U(void 0),{animationSettings:Os}=Ae;function Er(r){const n=[];for(const[e,t]of Object.entries(r))n.push({type:e,props:t});return ar("DynamicShader",{effects:n})}function wt(r=""){return{set(n){Ms(n)&&(n={width:n,color:255}),this.effects={...this.effects||{},["border".concat(r)]:n},this["_border".concat(r)]=n},get(){return this["_border".concat(r)]}}}const Us=["alpha","color","colorTop","colorRight","colorLeft","colorBottom","colorTl","colorTr","colorBl","colorBr","height","fontSize","lineHeight","mount","mountX","mountY","pivot","pivotX","pivotY","rotation","scale","width","worldX","worldY","x","y","zIndex","zIndexLocked"],Ws=["clipping","contain","fontFamily","fontStretch","fontStyle","fontWeight","letterSpacing","maxLines","offsetY","overflowSuffix","rtt","scrollable","scrollY","src","text","textAlign","textBaseline","textOverflow","texture","verticalAlign","wordWrap"];class we extends Object{constructor(e){super();h(this,"id");h(this,"debug");h(this,"name");h(this,"lng");h(this,"renderer");h(this,"selected");h(this,"rendered");h(this,"autofocus");h(this,"flexItem");h(this,"_queueDelete");h(this,"forwardFocus");h(this,"_undoStyles");h(this,"_renderProps");h(this,"_effects");h(this,"_parent");h(this,"_shader");h(this,"_style");h(this,"_states");h(this,"_events");h(this,"_animationSettings");h(this,"_width");h(this,"_height");h(this,"_color");h(this,"_borderRadius");h(this,"_border");h(this,"_borderLeft");h(this,"_borderRight");h(this,"_borderTop");h(this,"_borderBottom");h(this,"_autosized");h(this,"_isDirty");h(this,"_animationQueue",[]);h(this,"_animationQueueSettings");h(this,"_animationRunning",!1);h(this,"children");this.name=e,this.rendered=!1,this.autofocus=!1,this._renderProps={x:0,y:0},this.children=new ks(this)}get effects(){return this._effects}set effects(e){this._effects=e,this.rendered&&(this.shader=Er(e))}get parent(){return this._parent}set parent(e){var t;this._parent=e,this.rendered&&this.lng&&(this.lng.parent=(t=e==null?void 0:e.lng)!=null?t:null)}get shader(){return this._shader}set shader(e){un(e)?this._shader=ar(...e):this._shader=e,this._sendToLightning("shader",this._shader)}_sendToLightningAnimatable(e,t){if(this.lng){if(Ae.animationsEnabled&&this.transition&&(this.transition===!0||this.transition[e])){const o=this.transition===!0||this.transition[e]===!0?void 0:this.transition[e];return this.animate({[e]:t},o).start()}this.lng[e]=t}else this._renderProps[e]=t}_sendToLightning(e,t){this.rendered&&this.lng?this.lng[e]=t:this._renderProps[e]=t}animate(e,t){return F(this.lng,"Node must be rendered before animating"),this.lng.animate(e,t||this.animationSettings)}chain(e,t){return this._animationRunning&&(this._animationQueue=[],this._animationRunning=!1),t?this._animationQueueSettings=t:this._animationQueueSettings||(this._animationQueueSettings=t||this.animationSettings),t=t||this._animationQueueSettings,this._animationQueue.push({props:e,animationSettings:t}),this}async start(){let e=this._animationQueue.shift();for(;e;)this._animationRunning=!0,await this.animate(e.props,e.animationSettings).start().waitUntilStopped(),e=this._animationQueue.shift();this._animationRunning=!1,this._animationQueueSettings=void 0}setFocus(){if(this.rendered){if(this.forwardFocus!==void 0)if(vt(this.forwardFocus)){if(this.forwardFocus.call(this,this)!==!1)return}else{const e=typeof this.forwardFocus=="number"?this.forwardFocus:null;if(e!==null&&eQn(this))}else this.autofocus=!0}isTextNode(){return this.name==="text"}_resizeOnTextLoad(){this.lng.on("loaded",(e,t)=>{if(t.type==="text"){const{dimensions:o}=t;this.parent.updateLayout(this,o)}})}getText(){return this.children.map(e=>e.text).join("")}destroy(){var e;this._queueDelete&&((e=this.lng)==null||e.destroy())}set onEvents(e){this._events=e}get onEvents(){return this._events||[]}set style(e){un(e)?this._style=Ro(e):this._style=e;for(const t in this._style)this[t]===void 0&&(this[t]=this._style[t])}get style(){return this._style}get hasChildren(){return this.children.length>0}getChildById(e){return this.children.find(t=>t.id===e)}searchChildrenById(e){for(const t of this.children){if(t.id===e)return t;if(t instanceof we){const o=t.searchChildrenById(e);if(o)return o}}}set states(e){this._states=new kr(this._stateChanged.bind(this),e),this.rendered&&this._stateChanged()}get states(){return this._states=this._states||new kr(this._stateChanged.bind(this)),this._states}get animationSettings(){return this._animationSettings||Os}set animationSettings(e){this._animationSettings=e}updateLayout(e,t){var o;this.hasChildren&&(Ze("Layout: ",this),vt(this.onBeforeLayout)&&this.onBeforeLayout.call(this,e,t),this.display==="flex"&&Ds(this)&&((o=this.parent)==null||o.updateLayout()),vt(this.onLayout)&&this.onLayout.call(this,e,t))}_stateChanged(){if(Ze("State Changed: ",this,this.states),this.forwardStates){const t=this.states.slice();this.children.forEach(o=>o.states=t)}const e=this.states;if(this._undoStyles||this.style&&Ps(this.style,e)){this._undoStyles=this._undoStyles||[];const t={};this._undoStyles.forEach(i=>{t[i]=this.style[i]});const o=e.reduce((i,s)=>{const a=this.style[s];return a&&(i={...i,...a}),i},{});this._undoStyles=Object.keys(o),o.transition!==void 0&&(this.transition=o.transition),Object.assign(this,{...t,...o})}}render(){const e=this,t=this.parent;if(!t){console.warn("Parent not set - no node created for: ",this);return}if(!t.rendered){console.warn("Parent not rendered yet: ",this);return}if(this.rendered){console.warn("Node already rendered: ",this);return}t._isDirty&&(t.updateLayout(),t._isDirty=!1),e.updateLayout(),this.states.length&&this._stateChanged();let o=e._renderProps;t.lng&&(o.parent=t.lng),e._effects&&(this.shader=Er(e._effects)),e.isTextNode()?(o={...Ae.fontSettings,...o,text:e.getText()},o.contain&&(o.width||(o.width=(t.width||0)-(o.x||0)-(o.marginRight||0),e._width=o.width,e._autosized=!0),o.contain==="both"&&!o.height&&!o.maxLines&&(o.height=(t.height||0)-(o.y||0)-(o.marginBottom||0),e._height=o.height,e._autosized=!0)),Ze("Rendering: ",this,o),e.lng=Le.createTextNode(o),vt(e.onLoad)&&e.lng.on("loaded",e.onLoad),(!e.width||!e.height)&&(e._autosized=!0,e._resizeOnTextLoad())):(o.texture||(isNaN(o.width)&&(o.width=(t.width||0)-(o.x||0),e._width=o.width,e._autosized=!0),isNaN(o.height)&&(o.height=(t.height||0)-(o.y||0),e._height=o.height,e._autosized=!0),!o.color&&!o.src&&(e._color=o.color=0)),Ze("Rendering: ",this,o),e.lng=Le.createNode(o),e.onFail&&e.lng.on("failed",e.onFail),e.onLoad&&e.lng.on("loaded",e.onLoad)),e.rendered=!0,vt(this.onCreate)&&this.onCreate.call(this,e),e.onEvents.forEach(([i,s])=>{var a;(a=e.lng)==null||a.on(i,(c,d)=>s(e,d))}),e.lng.div&&(e.lng.div.solid=e),delete this._renderProps,e.name!=="text"&&e.children.forEach(i=>{i.render?i.render():i.text!==""&&console.warn("TextNode outside of : ",i)}),e.autofocus&&e.setFocus()}}for(const r of Us)Object.defineProperty(we.prototype,r,{get(){var n;return(n=this.lng&&this.lng[r])!=null?n:this["_".concat(r)]},set(n){this["_".concat(r)]=n,this._sendToLightningAnimatable(r,n)}});for(const r of Ws)Object.defineProperty(we.prototype,r,{get(){var n;return(n=this.lng&&this.lng[r])!=null?n:this["_".concat(r)]},set(n){this["_".concat(r)]=n,this._sendToLightning(r,n)}});Object.defineProperties(we.prototype,{borderRadius:{set(r){this._borderRadius=r,this.effects={...this.effects||{},radius:{radius:r}}},get(){return this._borderRadius}},border:wt(),borderLeft:wt("Left"),borderRight:wt("Right"),borderTop:wt("Top"),borderBottom:wt("Bottom")});Object.defineProperties(we.prototype,{linearGradient:{set(r={}){this._linearGradient=r,this.effects={...this.effects||{},linearGradient:r}},get(){return this._linearGradient}}});const N=r=>(()=>{var n=Pt("text");return An(n,r,!1),n})(),M=r=>(()=>{var n=Pt("node");return An(n,r,!1),n})();function Ys({createElement:r,createTextNode:n,isTextNode:e,replaceText:t,insertNode:o,removeNode:i,setProperty:s,getParentNode:a,getFirstChild:c,getNextSibling:d}){function u(p,m,v,T){if(v!==void 0&&!T&&(T=[]),typeof m!="function")return g(p,m,T,v);_e(R=>g(p,m(),R,v),T)}function g(p,m,v,T,R){for(;typeof v=="function";)v=v();if(m===v)return v;const I=typeof m,C=T!==void 0;if(I==="string"||I==="number")if(I==="number"&&(m=m.toString()),C){let _=v[0];_&&e(_)?t(_,m):_=n(m),v=x(p,v,T,_)}else v!==""&&typeof v=="string"?t(c(p),v=m):(x(p,v,T,n(m)),v=m);else if(m==null||I==="boolean")v=x(p,v,T);else{if(I==="function")return _e(()=>{let _=m();for(;typeof _=="function";)_=_();v=g(p,_,v,T)}),()=>v;if(Array.isArray(m)){const _=[];if(y(_,m,R))return _e(()=>v=g(p,_,v,T,!0)),()=>v;if(_.length===0){const E=x(p,v,T);if(C)return v=E}else Array.isArray(v)?v.length===0?w(p,_,T):b(p,v,_):v==null||v===""?w(p,_):b(p,C&&v||[c(p)],_);v=_}else{if(Array.isArray(v)){if(C)return v=x(p,v,T,m);x(p,v,null,m)}else v==null||v===""||!c(p)?o(p,m):S(p,m,c(p));v=m}}return v}function y(p,m,v){let T=!1;for(let R=0,I=m.length;Rk-_){const W=m[C];for(;_=0;C--){const _=m[C];if(R!==_){const E=a(_)===p;!I&&!C?E?S(p,R,_):o(p,R,v):E&&i(p,_)}else I=!0}}else o(p,R,v);return[R]}function w(p,m,v){for(let T=0,R=m.length;Tv.children=g(p,m.children,v.children)),_e(()=>m.ref&&m.ref(p)),_e(()=>{for(const R in m){if(R==="children"||R==="ref")continue;const I=m[R];I!==v[R]&&(s(p,R,I,v[R]),v[R]=I)}}),v}return{render(p,m){let v;return ft(T=>{v=T,u(m,p())}),v},insert:u,spread(p,m,v){typeof m=="function"?_e(T=>A(p,m(),T,v)):A(p,m,void 0,v)},createElement:r,createTextNode:n,insertNode:o,setProp(p,m,v,T){return s(p,m,v,T),v},mergeProps:sr,effect:_e,memo:ne,createComponent:Io,use(p,m,v){return le(()=>p(m,v))}}}function $s(r){const n=Ys(r);return n.mergeProps=sr,n}const Hs={createElement(r){return new we(r)},createTextNode(r){return{name:"TextNode",text:r,parent:void 0}},replaceText(r,n){Ze("Replace Text: ",r,n),r.text=n;const e=r.parent;F(e),e.text=e.getText()},setProperty(r,n,e=!0){r[n]=e},insertNode(r,n,e){Ze("INSERT: ",r,n,e),r.children.insert(n,e),n._queueDelete=!1,n instanceof we?r.rendered&&n.render():r.isTextNode()&&(r.text=r.getText())},isTextNode(r){return r.isTextNode()},removeNode(r,n){Ze("REMOVE: ",r,n),r.children.remove(n),n._queueDelete=!0,n instanceof we&&queueMicrotask(()=>n.destroy())},getParentNode(r){return r.parent},getFirstChild(r){return r.children[0]},getNextSibling(r){const n=r.parent.children||[],e=n.indexOf(r)+1;if(er.delete(o)}let e=!1;function t(o,i){if(e)return!(e=!1);const s={to:o,options:i,defaultPrevented:!1,preventDefault:()=>s.defaultPrevented=!0};for(const a of r)a.listener({...s,from:a.location,retry:c=>{c&&(e=!0),a.navigate(o,{...i,resolve:!1})}});return!s.defaultPrevented}return{subscribe:n,confirm:t}}let Kn;function cr(){(!window.history.state||window.history.state._depth==null)&&window.history.replaceState({...window.history.state,_depth:window.history.length-1},""),Kn=window.history.state._depth}cr();function Gs(r){return{...r,_depth:window.history.state&&window.history.state._depth}}function qs(r,n){let e=!1;return()=>{const t=Kn;cr();const o=t==null?null:Kn-t;if(e){e=!1;return}o&&n(o)?(e=!0,window.history.go(-o)):r()}}const Zs=/^(?:[a-z0-9]+:)?\/\//i,Js=/^\/+|(\/)\/+$/g,No="http://sr";function Rt(r,n=!1){const e=r.replace(Js,"$1");return e?n||/^[?#]/.test(e)?e:"/"+e:""}function on(r,n,e){if(Zs.test(n))return;const t=Rt(r),o=e&&Rt(e);let i="";return!o||n.startsWith("/")?i=t:o.toLowerCase().indexOf(t.toLowerCase())!==0?i=t+o:i=o,(i||"/")+Rt(n,!i)}function ea(r,n){if(r==null)throw new Error(n);return r}function ta(r,n){return Rt(r).replace(/\/*(\*.*)?$/g,"")+Rt(n)}function Lo(r){const n={};return r.searchParams.forEach((e,t)=>{n[t]=e}),n}function na(r,n,e){const[t,o]=r.split("/*",2),i=t.split("/").filter(Boolean),s=i.length;return a=>{const c=a.split("/").filter(Boolean),d=c.length-s;if(d<0||d>0&&o===void 0&&!n)return null;const u={path:s?"":"/",params:{}},g=y=>e===void 0?void 0:e[y];for(let y=0;yt.localeCompare(r,void 0,{sensitivity:"base"})===0;return n===void 0?!0:typeof n=="string"?e(n):typeof n=="function"?n(r):Array.isArray(n)?n.some(e):n instanceof RegExp?n.test(r):!1}function ra(r){const[n,e]=r.pattern.split("/*",2),t=n.split("/").filter(Boolean);return t.reduce((o,i)=>o+(i.startsWith(":")?2:3),t.length-(e===void 0?0:1))}function Mo(r){const n=new Map,e=Mt();return new Proxy({},{get(t,o){return n.has(o)||vo(e,()=>n.set(o,ne(()=>r()[o]))),n.get(o)()},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}},ownKeys(){return Reflect.ownKeys(r())}})}function zo(r){let n=/(\/?\:[^\/]+)\?/.exec(r);if(!n)return[r];let e=r.slice(0,n.index),t=r.slice(n.index+n[0].length);const o=[e,e+=n[1]];for(;n=/^(\/\:[^\/]+)\?/.exec(t);)o.push(e+=n[1]),t=t.slice(n[0].length);return zo(t).reduce((i,s)=>[...i,...o.map(a=>a+s)],[])}const oa=100,Po=wo(),Do=wo(),Oo=()=>ea(bo(Po)," and 'use' router primitives can be only used inside a Route."),mt=()=>Oo().navigatorFactory(),dr=()=>Oo().params;function ia(r,n=""){const{component:e,load:t,children:o,info:i}=r,s=!o||Array.isArray(o)&&!o.length,a={key:r,component:e,load:t,info:i};return Uo(r.path).reduce((c,d)=>{for(const u of zo(d)){const g=ta(n,u);let y=s?g:g.split("/*",1)[0];y=y.split("/").map(b=>b.startsWith(":")||b.startsWith("*")?b:encodeURIComponent(b)).join("/"),c.push({...a,originalPath:u,pattern:y,matcher:na(y,!s,r.matchFilters)})}return c},[])}function sa(r,n=0){return{routes:r,score:ra(r[r.length-1])*1e4-n,matcher(e){const t=[];for(let o=r.length-1;o>=0;o--){const i=r[o],s=i.matcher(e);if(!s)return null;t.unshift({...s,route:i})}return t}}}function Uo(r){return Array.isArray(r)?r:[r]}function Wo(r,n="",e=[],t=[]){const o=Uo(r);for(let i=0,s=o.length;is.score-i.score)}function Nr(r,n){for(let e=0,t=r.length;e{const d=r();try{return new URL(d,e)}catch(u){return console.error("Invalid path ".concat(d)),c}},e,{equals:(c,d)=>c.href===d.href}),o=ne(()=>t().pathname),i=ne(()=>t().search,!0),s=ne(()=>t().hash),a=()=>"";return{get pathname(){return o()},get search(){return i()},get hash(){return s()},get state(){return n()},get key(){return a()},query:Mo(He(i,()=>Lo(t())))}}let We;function la(r,n,e,t={}){const{signal:[o,i],utils:s={}}=r,a=s.parsePath||(k=>k),c=s.renderPath||(k=>k),d=s.beforeLeave||Fo(),u=on("",t.base||"");if(u===void 0)throw new Error("".concat(u," is not a valid base path"));u&&!o().value&&i({value:u,replace:!0,scroll:!1});const[g,y]=U(!1),b=async k=>{y(!0);try{await xs(k)}finally{y(!1)}},[x,w]=U(o().value),[S,A]=U(o().state),p=aa(x,S),m=[],v=U([]),T=ne(()=>Nr(n(),p.pathname)),R=Mo(()=>{const k=T(),z={};for(let O=0;Ou,outlet:()=>null,resolvePath(k){return on(u,k)}};return _e(()=>{const{value:k,state:z}=o();le(()=>{k!==x()&&b(()=>{We="native",w(k),A(z),v[1]([])}).then(()=>{We=void 0})})}),{base:I,location:p,params:R,isRouting:g,renderPath:c,parsePath:a,navigatorFactory:_,matches:T,beforeLeave:d,preloadRoute:P,singleFlight:t.singleFlight===void 0?!0:t.singleFlight,submissions:v};function C(k,z,O){le(()=>{if(typeof z=="number"){z&&(s.go?s.go(z):console.warn("Router integration does not support relative routing"));return}const{replace:D,resolve:W,scroll:j,state:se}={replace:!1,resolve:!0,scroll:!0,...O},te=W?k.resolvePath(z):on("",z);if(te===void 0)throw new Error("Path '".concat(z,"' is not a routable path"));if(m.length>=oa)throw new Error("Too many redirects");const de=x();if((te!==de||se!==S())&&!Vs){if(d.confirm(te,O)){const Ce=m.push({value:de,replace:D,scroll:j,state:S()});b(()=>{We="navigate",w(te),A(se),v[1]([])}).then(()=>{m.length===Ce&&(We=void 0,E({value:te,state:se}))})}}})}function _(k){return k=k||bo(Do)||I,(z,O)=>C(k,z,O)}function E(k){const z=m[0];z&&((k.value!==z.value||k.state!==z.state)&&i({...k,replace:z.replace,scroll:z.scroll}),m.length=0)}function P(k,z){const O=Nr(n(),k.pathname),D=We;We="preload";for(let W in O){const{route:j,params:se}=O[W];j.component&&j.component.preload&&j.component.preload();const{load:te}=j;z&&te&&vo(e(),()=>te({params:se,location:{pathname:k.pathname,search:k.search,hash:k.hash,query:Lo(k),state:null,key:""},intent:"preload"}))}We=D}}function ca(r,n,e,t){const{base:o,location:i,params:s}=r,{pattern:a,component:c,load:d}=t().route,u=ne(()=>t().path);c&&c.preload&&c.preload();const g=d?d({params:s,location:i,intent:We||"initial"}):void 0;return{parent:n,pattern:a,path:u,outlet:()=>c?Io(c,{params:s,location:i,data:g,get children(){return e()}}):e(),resolvePath(b){return on(o.path(),b,u())}}}const da=r=>n=>{const{base:e}=n,t=wn(()=>n.children),o=ne(()=>Wo(t(),n.base||""));let i;const s=la(r,o,()=>i,{base:e,singleFlight:n.singleFlight});return r.create&&r.create(s),l(Po.Provider,{value:s,get children(){return l(ha,{routerState:s,get root(){return n.root},get load(){return n.rootLoad},get children(){return[pt(()=>(i=Mt())&&null),l(ua,{routerState:s,get branches(){return o()}})]}})}})};function ha(r){const n=r.routerState.location,e=r.routerState.params,t=ne(()=>r.load&&le(()=>r.load({params:e,location:n,intent:"preload"})));return l(Be,{get when(){return r.root},keyed:!0,get fallback(){return r.children},children:o=>l(o,{params:e,location:n,get data(){return t()},get children(){return r.children}})})}function ua(r){const n=[];let e;const t=ne(He(r.routerState.matches,(o,i,s)=>{let a=i&&o.length===i.length;const c=[];for(let d=0,u=o.length;d{n[d]=b,c[d]=ca(r.routerState,c[d-1]||r.routerState.base,Lr(()=>t()[d+1]),()=>r.routerState.matches()[d])}))}return n.splice(o.length).forEach(d=>d()),s&&a?s:(e=c[0],c)}));return Lr(()=>t()&&e)()}const Lr=r=>()=>l(Be,{get when(){return r()},keyed:!0,children:n=>l(Do.Provider,{value:n,get children(){return n.outlet()}})}),ue=r=>{const n=wn(()=>r.children);return sr(r,{get children(){return n()}})};function fa([r,n],e,t){return[e?()=>e(r()):r,t?o=>n(t(o)):n]}function ga(r){if(r==="#")return null;try{return document.querySelector(r)}catch(n){return null}}function pa(r){let n=!1;const e=o=>typeof o=="string"?{value:o}:o,t=fa(U(e(r.get()),{equals:(o,i)=>o.value===i.value}),void 0,o=>(!n&&r.set(o),o));return r.init&&Me(r.init((o=r.get())=>{n=!0,t[1](e(o)),n=!1})),da({signal:t,create:r.create,utils:r.utils})}function ma(r,n,e){return r.addEventListener(n,e),()=>r.removeEventListener(n,e)}function xa(r,n){const e=ga("#".concat(r));e?e.scrollIntoView():n&&window.scrollTo(0,0)}const ya=new Map;function va(r=!0,n=!1,e="/_server"){return t=>{const o=t.base.path(),i=t.navigatorFactory(t.base);let s={};function a(x){return x.namespaceURI==="http://www.w3.org/2000/svg"}function c(x){if(x.defaultPrevented||x.button!==0||x.metaKey||x.altKey||x.ctrlKey||x.shiftKey)return;const w=x.composedPath().find(T=>T instanceof Node&&T.nodeName.toUpperCase()==="A");if(!w||n&&!w.hasAttribute("link"))return;const S=a(w),A=S?w.href.baseVal:w.href;if((S?w.target.baseVal:w.target)||!A&&!w.hasAttribute("state"))return;const m=(w.getAttribute("rel")||"").split(/\s+/);if(w.hasAttribute("download")||m&&m.includes("external"))return;const v=S?new URL(A,document.baseURI):new URL(A);if(!(v.origin!==window.location.origin||o&&v.pathname&&!v.pathname.toLowerCase().startsWith(o.toLowerCase())))return[w,v]}function d(x){const w=c(x);if(!w)return;const[S,A]=w,p=t.parsePath(A.pathname+A.search+A.hash),m=S.getAttribute("state");x.preventDefault(),i(p,{resolve:!1,replace:S.hasAttribute("replace"),scroll:!S.hasAttribute("noscroll"),state:m&&JSON.parse(m)})}function u(x){const w=c(x);if(!w)return;const[S,A]=w;s[A.pathname]||t.preloadRoute(A,S.getAttribute("preload")!=="false")}function g(x){const w=c(x);if(!w)return;const[S,A]=w;s[A.pathname]||(s[A.pathname]=setTimeout(()=>{t.preloadRoute(A,S.getAttribute("preload")!=="false"),delete s[A.pathname]},200))}function y(x){const w=c(x);if(!w)return;const[,S]=w;s[S.pathname]&&(clearTimeout(s[S.pathname]),delete s[S.pathname])}function b(x){let w=x.submitter&&x.submitter.hasAttribute("formaction")?x.submitter.getAttribute("formaction"):x.target.getAttribute("action");if(!w)return;if(!w.startsWith("https://action/")){const A=new URL(w,No);if(w=t.parsePath(A.pathname+A.search),!w.startsWith(e))return}if(x.target.method.toUpperCase()!=="POST")throw new Error("Only POST forms are supported for Actions");const S=ya.get(w);if(S){x.preventDefault();const A=new FormData(x.target);x.submitter&&x.submitter.name&&A.append(x.submitter.name,x.submitter.value),S.call({r:t,f:x.target},A)}}Ks(["click","submit"]),document.addEventListener("click",d),r&&(document.addEventListener("mouseover",g),document.addEventListener("mouseout",y),document.addEventListener("focusin",u),document.addEventListener("touchstart",u)),document.addEventListener("submit",b),Me(()=>{document.removeEventListener("click",d),r&&(document.removeEventListener("mouseover",g),document.removeEventListener("mouseout",y),document.removeEventListener("focusin",u),document.removeEventListener("touchstart",u)),document.removeEventListener("submit",b)})}}function wa(r){const n=r.replace(/^.*?#/,"");if(!n.startsWith("/")){const[,e="/"]=window.location.hash.split("#",2);return"".concat(e,"#").concat(n)}return n}function ba(r){const n=()=>window.location.hash.slice(1),e=Fo();return pa({get:n,set({value:t,replace:o,scroll:i,state:s}){o?window.history.replaceState(Gs(s),"","#"+t):window.location.hash=t;const a=t.indexOf("#"),c=a>=0?t.slice(a+1):"";xa(c,i),cr()},init:t=>ma(window,"hashchange",qs(t,o=>!e.confirm(o&&o<0?o:n()))),create:va(r.preload,r.explicitLinks,r.actionBase),utils:{go:t=>window.history.go(t),renderPath:t=>"#".concat(t),parsePath:wa,beforeLeave:e}})(r)}var Sa=!!Rs,Aa=Sa?r=>Mt()?Me(r):r:Me;function Ca(r,n,e,t){return r.addEventListener(n,e,t),Aa(r.removeEventListener.bind(r,n,e,t))}function Ta(r,n=Mt()){let e=0,t,o;return()=>(e++,Me(()=>{e--,queueMicrotask(()=>{!e&&o&&(o(),o=t=void 0)})}),o||ft(i=>t=r(o=i),n),t)}var _a=Ta(()=>{const[r,n]=U(null);return Ca(window,"keydown",e=>{n(e),setTimeout(()=>n(null))}),r});function Gt(r){return typeof r=="function"}function Ia(r){return Array.isArray(r)}const qt={ArrowLeft:"Left",ArrowRight:"Right",ArrowUp:"Up",ArrowDown:"Down",Enter:"Enter",l:"Last"," ":"Space",Backspace:"Back",Escape:"Escape"},[fn,Ra]=U([]),Ba=r=>{const n=_a();if(r)for(const[e,t]of Object.entries(r))Ia(t)?t.forEach(o=>{qt[o]=e}):qt[t]=e;return $e(He(lr,(e,t,o=[])=>{let i=e;const s=[];for(;i;)i.states.has("focus")||(i.states.add("focus"),Gt(i.onFocus)&&i.onFocus.call(i,e,t)),s.push(i),i=i.parent;return o.forEach(a=>{s.includes(a)||(a.states.remove("focus"),Gt(a.onBlur)&&a.onBlur.call(a,e,t))}),Ra(s),s},{defer:!0})),$e(()=>{const e=n();if(e){const t=qt[e.key]||qt[e.keyCode];le(()=>{const o=fn();let i;for(const s of o){if(i=i||s,t){const a=s["on".concat(t)];if(Gt(a)&&a.call(s,e,s,i)===!0)break}else console.log("Unhandled key event: ".concat(e.key));if(Gt(s.onKeyPress)&&s.onKeyPress.call(s,e,t,s,i)===!0)break}return!1})}}),fn};function Yo(r,n){const e=n();let t,o,i,s;Array.isArray(e)?e.length===2?(t=s=e[0],o=i=e[1]):e.length===3?(t=e[0],o=i=e[1],s=e[2]):[t,i,s,o]=e:t=i=s=o=e,r.onBeforeLayout=(a,c)=>{if(c){r.width=r.children.reduce((g,y)=>g+(y.width||0),0)+o+i;const d=r.children[0];d&&(d.x=o,d.marginLeft=o);let u=0;r.children.forEach(g=>{g.y=t,g.marginTop=t,u=Math.max(u,g.height||0)}),r.height=u+t+s}}}function ka(r=[]){const n=[];let e;for(e=0;e{setTimeout(n,r)})}function Ea(r,n,e="en-US"){const t=window.speechSynthesis;return new Promise((o,i)=>{const s=new SpeechSynthesisUtterance(r);s.lang=e,s.onend=()=>{o()},s.onerror=a=>{i(a)},n.push(s),t.speak(s)})}function Xn(r,n,e=!0){const t=window.speechSynthesis,o=ka(Array.isArray(r)?r:[r]),i=[],s=[];let a=!0;return{series:(async()=>{try{for(;a&&o.length;){const d=await Promise.resolve(o.shift());if(a){if(typeof d=="string"&&d.includes("PAUSE-")){let u=Number(d.split("PAUSE-")[1])*1e3;isNaN(u)&&(u=0),await Mr(u)}else if(typeof d=="string"&&d.length){let g=3;for(;a&&g>0;)try{await Ea(d,s,n),g=0}catch(y){if(y instanceof SpeechSynthesisErrorEvent)if(y.error==="network")g--,console.warn("Speech synthesis network error. Retries left: ".concat(g)),await Mr(500*(3-g));else if(y.error==="canceled"||y.error==="interrupted")g=0;else throw new Error("SpeechSynthesisErrorEvent: ".concat(y.error));else throw y}}else if(typeof d=="function"){const u=Xn(d(),n,!1);i.push(u),await u.series}else if(Array.isArray(d)){const u=Xn(d,n,!1);i.push(u),await u.series}}else break}}finally{a=!1}})(),get active(){return a},append:d=>{o.push(d)},cancel:()=>{a&&(e&&t.cancel(),i.forEach(d=>{d.cancel()}),a=!1)}}}let Zt;function Fa(r,n="en-US"){return Zt&&Zt.cancel(),Zt=Xn(r,n),Zt}var hr=(r,n)=>{let e;const t=()=>clearTimeout(e);return Mt()&&Me(t),Object.assign((...i)=>{e!==void 0&&t(),e=setTimeout(()=>r(...i),n)},{clear:t})};let Vn,Bt=[],Te,Gn=!1;const Na=3e5;function zr(r,n){const e=hr(r,n);let t;const o=i=>{t=i,e(i)};return o.flush=()=>{e.clear(),r(t)},o.clear=e.clear,o}function bt(r){return r.id||r.name}function La(r=[]){if(!oe.onFocusChange||!oe.enabled)return;const n=r.every(i=>!i.loading),e=r.filter(i=>!Bt.includes(i));if(Vn(),!n&&oe.onFocusChange){oe.onFocusChange([]);return}Bt=r.slice(0);const t=[],o=e.reduce((i,s)=>(s.announce?(i.push([bt(s),"Announce",s.announce]),t.push(s.announce)):s.title?(i.push([bt(s),"Title",s.title]),t.push(s.title)):i.push([bt(s),"No Announce",""]),i),[]);if(e.reverse().reduce((i,s)=>(s.announceContext?(i.push([bt(s),"Context",s.announceContext]),t.push(s.announceContext)):i.push([bt(s),"No Context",""]),i),o),oe.debug&&console.table(o),t.length)return oe.speak(t.reduce((i,s)=>i.concat(s),[]))}function Ma(r){if(!Gn)return Te=Fa(r)}const oe={debug:!1,enabled:!0,cancel:function(){Te&&Te.cancel()},clearPrevFocus:function(r=0){Bt=Bt.slice(0,r),Vn()},speak:function(r,{append:n=!1,notification:e=!1}={}){return oe.onFocusChange&&oe.enabled&&(oe.onFocusChange.flush(),n&&Te&&Te.active?Te.append(r):(oe.cancel(),Ma(r)),e&&(Gn=!0,Te==null||Te.series.finally(()=>{Gn=!1,oe.refresh()}).catch(console.error))),Te},refresh:function(r=0){oe.clearPrevFocus(r),oe.onFocusChange&&oe.onFocusChange(le(()=>fn()))},setupTimers:function({focusDebounce:r=400,focusChangeTimeout:n=Na}={}){oe.onFocusChange=zr(La,r),Vn=zr(()=>{Bt=[]},n)}},za=()=>(oe.setupTimers(),$e(He(fn,oe.onFocusChange,{defer:!0})),oe);function Pa(r,n){const e=Le.createTexture("ImageTexture",{src:r});return n.reduce((t,o)=>{const{x:i,y:s,width:a,height:c}=o;return t[o.name]=Le.createTexture("SubTexture",{texture:e,x:i,y:s,width:a,height:c}),t},{})}const[Da,Ee]=U(""),f={name:"Base Lightning TV",alpha:{primary:1,secondary:.7,tertiary:.1,inactive:.5,full:1,none:0,alpha1:.1,alpha2:.3,alpha3:.5,alpha4:.7,alpha5:.9},animation:{duration:{none:0,xfast:.1,fast:.25,normal:.5,slow:.75,xslow:.9},delay:{none:0,xfast:.01,fast:.025,normal:.05,slow:.075,xslow:.09},expressive:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},expressiveEntrance:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},expressiveExit:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},standard:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},standardEntrance:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},standardExit:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},utility:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},utilityEntrance:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},utilityExit:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25}},asset:{arrowLeft:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAi0lEQVRIDWNgGAWjIfD//38JID5Fk5AAGqwKxPeA+D/VLQCaaQLEr0CGgwBVLQCa5wbEn0EGwwDVLAAaGA3Ev2AGw2iqWAA0rBiI/8EMRaYptgBoWDeygehsci1gIlcjWfqArqZdEMFcBLSEdpGMZAntkimSJbTLaEiW0K6oQLKEdoUdzJJRemiHAAD4n+yzPWCs7QAAAABJRU5ErkJggg==",arrowRight:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAg0lEQVRIDWNgGAWjIYArBP7//38KiCVwyVMsDjQcBO4BsSrFhmEzAGw8hHgFpEywqaFIDMkCEPMzELtRZCC6ZjQLQNxfQByNro5sPhYLQEL/gLiYbEORNeKwACbcDVPLBGMMOhrmVDSapkFE00imaTKlaUajaVFB28Ju0CXrUQfhDAEAEgHss6NhpLQAAAAASUVORK5CYII=",backspaceOutline:"data:image/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4Xld2BNvJcaHUPEClF6oNMoZE2eXOtm3q1ZFha1mfWQBUINoL4Kqurbm7vPEj1bOAqx3udW0kk62+swGoQHQ2gPOGFGAD8roJgF0t+qkx6jorgApElwE4aQwxZp6n3YNxsPyzA7yst/4iSdvEMFqaHUCjKZEZ91IgAeolWzotFEiAkoWQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC",check:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAOCAYAAAAi2ky3AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACtSURBVHgBvdPdDcIgEAfwoy8Nb45QN3AGF2s36Ahu4gpuIDoBfSgfpdoTlCbEWEMh6T8hFzjyg5AAkBHOcQe5UWqspRx435sDpMYj6IYQwwVSEiJ2MKVUBWuzLSLl2HL+uxmNCGFO8yaL7RHxve6qRZoAuS4hxac8735elWVx7jrtMKL1o0Gcat9jhExHSukN/kUIFZ7MpDRtzE1isDRkAUtDvrA8ZI597FUf8gWH9P0b4gko9wAAAABJRU5ErkJggg=="},color:{palette:{"blue-20":"0xbecffeff","blue-40":"0x93a9fdff","blue-90":"0x000033ff","grey-05":"0xf8f7faff","grey-40":"0x929096ff","grey-70":"0x48474bff","grey-90":"0x181819ff"},white:"0xffffffff",black:"0x000000ff",grey:"0x929096ff",red:"0xe74c3cff",orange:"0xdc7633ff",yellow:"0xf7dc6fff",green:"0x2ecc71ff",blue:"0x93a9fdff",purple:"0x663399ff",material:"0x181819ff",materialBrand:"0x000033ff",overlay:"0x181819b3",textNeutral:"0xf8f7faff",textNeutralSecondary:"0xf8f7fab3",textNeutralTertiary:"0xf8f7fa1a",textNeutralDisabled:"0xf8f7fa80",textInverse:"0x181819ff",textInverseSecondary:"0x181819b3",textInverseTertiary:"0x1818191a",textInverseDisabled:"0x18181980",textBrand:"0x93a9fdff",textBrandSecondary:"0x93a9fdb3",textBrandTertiary:"0x93a9fd1a",textBrandDisabled:"0x93a9fd80",textPositive:"0x2ecc71ff",textNegative:"0xe74c3cff",textInfo:"0x93a9fdff",textCaution:"0xdc7633ff",fillTransparent:"0xffffff0",fillNeutral:"0xf8f7faff",fillNeutralSecondary:"0xf8f7fab3",fillNeutralTertiary:"0xf8f7fa1a",fillNeutralDisabled:"0xf8f7fa80",fillInverse:"0x181819ff",fillInverseSecondary:"0x181819b3",fillInverseTertiary:"0x1818191a",fillInverseDisabled:"0x18181980",fillBrand:"0x93a9fdff",fillBrandSecondary:"0x93a9fdb3",fillBrandTertiary:"0x93a9fd1a",fillBrandDisabled:"0x93a9fd80",fillPositive:"0x2ecc71ff",fillNegative:"0xe74c3cff",fillInfo:"0x93a9fdff",fillCaution:"0xdc7633ff",strokeNeutral:"0xf8f7faff",strokeNeutralSecondary:"0xf8f7fab3",strokeNeutralTertiary:"0xf8f7fa1a",strokeNeutralDisabled:"0xf8f7fa80",strokeInverse:"0x181819ff",strokeInverseSecondary:"0x181819b3",strokeInverseTertiary:"0x1818191a",strokeInverseDisabled:"0x18181980",strokeBrand:"0x93a9fdff",strokeBrandSecondary:"0x93a9fdb3",strokeBrandTertiary:"0x93a9fd1a",strokeBrandDisabled:"0x93a9fd80",strokePositive:"0x2ecc71ff",strokeNegative:"0xe74c3cff",strokeInfo:"0x93a9fdff",strokeCaution:"0xdc7633ff",interactiveNeutral:"0xffffff1a",interactiveNeutralFocus:"0xffffffff",interactiveNeutralFocusSoft:"0xffffff1a",interactiveInverse:"0x48474b1a",interactiveInverseFocus:"0x48474bff",interactiveInverseFocusSoft:"0x48474b1a",interactiveBrand:"0xbecffe1a",interactiveBrandFocus:"0xbecffeff",interactiveBrandFocusSoft:"0xbecffe1a",shadowNeutral:"0x000000b3",shadowNeutralFocus:"0x000000b3",shadowNeutralFocusSoft:"0x000000b3",shadowNeutralText:"0x000000ff",shadowInverse:"0x000000b3",shadowInverseFocus:"0x000000b3",shadowInverseFocusSoft:"0x000000b3",shadowInverseText:"0x000000ff",shadowBrand:"0x000000b3",shadowBrandFocus:"0x000000b3",shadowBrandFocusSoft:"0x000000b3",shadowBrandText:"0x000000ff"},font:[],layout:{columnCount:10,focusScale:1.2,gutterX:20,gutterY:20,marginX:150,marginY:150,safe:50,screenW:1920,screenH:1080},radius:{none:0,xs:2,sm:4,md:8,lg:16,xl:24},spacer:{none:0,xxs:2,xs:4,sm:8,md:10,lg:20,xl:30,xxl:40,xxxl:50},stroke:{none:0,sm:2,md:4,lg:6,xl:8},typography:{display1:{fontFamily:"Arial",fontSize:75,lineHeight:85,fontWeight:500,verticalAlign:"middle",textBaseline:"bottom"},display2:{fontFamily:"Arial",fontSize:50,lineHeight:60,fontWeight:500,verticalAlign:"middle",textBaseline:"bottom"},headline1:{fontFamily:"Arial",fontSize:35,fontWeight:500,lineHeight:48,verticalAlign:"middle",textBaseline:"bottom"},headline2:{fontFamily:"Arial",fontSize:30,fontWeight:500,lineHeight:40,verticalAlign:"middle",textBaseline:"bottom"},headline3:{fontFamily:"Arial",fontSize:25,fontWeight:500,lineHeight:36,verticalAlign:"middle",textBaseline:"bottom"},body1:{fontFamily:"Arial",fontSize:25,fontWeight:300,lineHeight:40,verticalAlign:"middle",textBaseline:"bottom"},body2:{fontFamily:"Arial",fontSize:22,fontWeight:300,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},body3:{fontFamily:"Arial",fontSize:20,fontWeight:300,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},button1:{fontFamily:"Arial",fontSize:25,fontWeight:500,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},button2:{fontFamily:"Arial",fontSize:20,fontWeight:500,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},callout1:{fontFamily:"Arial",fontSize:20,fontWeight:500,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},caption1:{fontFamily:"Arial",fontSize:15,fontWeight:500,lineHeight:24,verticalAlign:"middle",textBaseline:"bottom"},tag1:{fontFamily:"Arial",fontSize:20,fontWeight:500,lineHeight:24,verticalAlign:"middle",textBaseline:"bottom"},footnote1:{fontFamily:"Arial",fontSize:22,fontWeight:300,lineHeight:30,verticalAlign:"middle",textBaseline:"bottom"}},componentConfig:{Keyboard:{base:{keyProps:{delete:{title:null,icon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGohMqUBAAQZ80zUVQAKUEIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypfPsAJJ0NYC92XRHKPB3AAfLv18BuBLAFSR/NKZWswJI0vkA3jCmILsw75sAvIfkR8eo22wAknQSgMvGEGFD8vwxgFeQvGrI+s4CIEnHAPgugHsMWfkNzevDAM4i+Z8h6t88QJLuXOB5yBAVzjxuVeBaAM8ieXNUjzkAdAmA50Yrmv5HKPATACeQ/GNEm6YBkvRyANblZhpHAXsfekpkOGsWIEmPAHA9gDuOo13mWhS4gOSZfdVoEiBJ9wFwA4D7961Y+lUpsK/v7KxVgL4K4ElOCS4l+Uyn7a41k3Q0gMcC2ANgH4CHV1T2OyStx69OzQEk6TwAZztr8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kAUZLazvvTV4P8kDDlE22kTSQ4uuK9dCF5HuR/I3NYI1A1CBaB+AK50VsAMj7TJeixNl2kYBSccCsB/ZMQ6Brif5GIfdYSZNAVQg8rzsLSphl/Hapby2LDZTUaBcq/56ALb1fOVxLkuinULy4loRmwOoQGQX7T7DWZnPk3y203bXmkl6AIA91isDOBGADV3e1HsJbasA1QYZvUKl3fYKPI2knXFQnZoEqPRCNUHG6oqnwyEFLiJ5Wl89mgWoQFQTZOyrwSb7WUztcSRtu0+v1DRABaKPADijV+3SaZUCNgE5geTNEZnmAFBtkDGix6b4Xld2BNvJcaHUPEClF6oNMoZE2eXOtm3q1ZFha1mfWQBUINoL4Kqurbm7vPEj1bOAqx3udW0kk62+swGoQHQ2gPOGFGAD8roJgF0t+qkx6jorgApElwE4aQwxZp6n3YNxsPyzA7yst/4iSdvEMFqaHUCjKZEZ91IgAeolWzotFEiAkoWQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC"}}}}}};function Oa(){let r,n,e,t=0;const o=1,i={duration:750,easing:"ease-in-out"},s={alpha:o,color:4294967295};function a(d){if(d.startsWith("#")){r.color=L(d),r.src="",r.alpha=1,t=1,n.alpha=0,e.alpha=0;return}else r.color=4294967295,e.alpha=1;if(t===0){r.src=d,t=1;return}if(t===1){n.src=d,t=2,n.alpha=0,n.animate({alpha:o},i).start(),r.animate({alpha:0},i).start();return}t===2&&(r.src=d,t=1,r.alpha=0,r.animate({alpha:o},i).start(),n.animate({alpha:0},i).start())}const c=hr(a,400);return $e(He(Da,d=>{c(d)},{defer:!0})),l(M,{width:1920,height:1080,zIndex:-5,get children(){return[l(M,{ref(d){var u=r;typeof u=="function"?u(d):r=d},style:s}),l(M,{ref(d){var u=n;typeof u=="function"?u(d):n=d},style:s,alpha:0}),l(M,{ref(d){var u=e;typeof u=="function"?u(d):e=d},src:"./assets/hero-mask-inverted.png",get color(){return L(f.color.materialBrand)},width:1920,height:1080})]}})}var Pr,Dr,Or,Ur,Wr,Yr,$r,Hr,jr,Qr,Kr,Xr,Vr,Gr,qr,Zr;const Ua=["focus","disabled"],Wa=["brand","inverse","neutral"];function Y({themeKeys:r,base:n,modes:e,tones:t,themeStyles:o,modeKeys:i=Ua,toneKeys:s=Wa},a=!1){const c=(x,w,S)=>{const A=s.map(p=>{var T,R;const m={};return new Set([].concat.apply([],[(T=x==null?void 0:x[p])!=null?T:{},(R=w==null?void 0:w[p])!=null?R:{}].map(Object.keys))).forEach(I=>{var E;var C,_;i.includes(I)||(m[I]=(E=(C=w==null?void 0:w[p])==null?void 0:C[I])!=null?E:(_=x==null?void 0:x[p])==null?void 0:_[I])}),i.forEach(I=>{var C,_;m[I]={...S[I],...(C=x==null?void 0:x[p])==null?void 0:C[I],...(_=w==null?void 0:w[p])==null?void 0:_[I]}}),[p,m]});return Object.fromEntries(A)},d=(x,w)=>{const S=i.map(p=>[p,{...x==null?void 0:x[p],...w==null?void 0:w[p]}]);return Object.fromEntries(S)},u=(x,w)=>({...x,...w.base}),g=x=>Object.fromEntries(Object.entries(r).filter(([w,S])=>x[S]).map(([w,S])=>[w,x[S]])),y=x=>Object.fromEntries(Object.entries(x).map(([S,A])=>{const p=g(A);return Object.entries(A).filter(([m,v])=>i.includes(m)).forEach(([m,v])=>{p[m]=g(v)}),[S,p]}));return((x,w,S)=>{const A=y(o);a&&console.log(A);const p=u(x,A);a&&console.log(p);const m=d(w,A);a&&console.log(m);const v=c(S,A,m);return a&&console.log(v),{base:{...p,...m},tones:v}})(n,e,t)}function $o(r=0){return(n,e,t,o)=>{if(n.children.length===0)return;const i=n.gap||0,s=n.scroll||"auto",[a,c]=Ya(n),d=n.flexDirection==="row"?n.x:n.y,u=n.flexDirection==="row"?e.x:e.y,g=n.flexDirection==="row"?e.width:e.height,y=t>o?"positive":"negative";let b=d;s==="auto"?n.scrollIndex!=null&&n.scrollIndex>=0?n.selected>=n.scrollIndex&&(y==="positive"?b=d-g-i:b=d+g+i):(Math.abs(d)+cu?b=-u+r:s==="edge"&&y==="positive"&&Math.abs(d)+c{const n=r.filter(e=>typeof e=="function");if(n.length!==0)return function(...e){for(const t of n)if(t.apply(this,e)===!0)return!0}};function Ho(){if(!this||this.selected===void 0||this.children.length===0)return!1;let r=this.children[this.selected];for(;r!=null&&r.skipFocus;)this.selected++,r=this.children[this.selected];if(!(r instanceof we))return!1;r.setFocus()}function gn(r){return function(){var n,e;const t=this.children.length,o=this.wrap,i=this.selected||0;if(t===0)return!1;if(r==="right"||r==="down")do if(this.selected=(this.selected||0)%t+1,this.selected>=t){if(!o){this.selected=void 0;break}this.selected=0}while((n=this.children[this.selected])!=null&&n.skipFocus);else if(r==="left"||r==="up")do if(this.selected=(this.selected||0)%t-1,this.selected<0){if(!o){this.selected=void 0;break}this.selected=t-1}while((e=this.children[this.selected])!=null&&e.skipFocus);if(this.selected===void 0&&(this.selected=i,this.children[this.selected].states.has("focus")))return!1;const s=this.children[this.selected];if(this.onSelectedChanged&&this.onSelectedChanged.call(this,this,s,this.selected,i),this.plinko&&i!==void 0){const c=this.children[i].selected||0;s.selected=c{const n=gn("up"),e=gn("down");return l(M,Q(r,{get onUp(){return gt(r.onUp,n)},get onDown(){return gt(r.onDown,e)},get selected(){return r.selected||0},forwardFocus:Ho,get onSelectedChanged(){return gt(r.onSelectedChanged,r.scroll!=="none"?$o(r.y):void 0)},get style(){var t;return[...[r.style].flat(),Nn.Container.tones[(t=r.tone)!=null?t:Nn.tone],Nn.Container.base]}}))},{Label:{defaultTone:Zc,...Qo}={styles:{}}}=($r=f)==null?void 0:$r.componentConfig,il={themeKeys:{color:"backgroundColor",borderRadius:"radius"},base:{display:"flex",justifyContent:"center",color:f.color.textNeutral,padding:[f.spacer.md,f.spacer.lg],borderRadius:[f.radius.md,f.radius.md,f.radius.md,f.radius.none],height:f.typography.caption1.lineHeight+f.spacer.md,neutral:{backgroundColor:f.color.fillNeutral}},tones:{inverse:{color:f.color.fillInverse},brand:{color:f.color.fillBrand,focus:{color:f.color.orange}}},themeStyles:Qo},sl={themeKeys:{color:"textColor"},base:{...f.typography.caption1,color:f.color.textInverse},tones:{inverse:{color:f.color.textNeutral},brand:{color:f.color.textNeutral}},themeStyles:Qo};Y(il);Y(sl);const{Rating:{styles:gr,defaultTone:Jc}={styles:{},defaultTone:"neutral"}}=(Hr=f)==null?void 0:Hr.componentConfig,al={themeKeys:{justifyContent:"justifyContent",itemSpacing:"itemSpacing"},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",itemSpacing:f.spacer.sm},toneModes:{},themeStyles:gr},ll={themeKeys:{color:"textColor"},base:{color:f.color.textNeutral,...f.typography.body2},toneModes:{},themeStyles:gr},cl={themeKeys:{color:"color"},base:{height:f.typography.body2.lineHeight,width:f.typography.body2.lineHeight,color:f.color.fillNeutral,marginRight:f.spacer.sm},toneModes:{},themeStyles:gr};Y(al);Y(cl);Y(ll);const{Details:{defaultTone:ed,...Ko}={styles:{}}}=(jr=f)==null?void 0:jr.componentConfig,dl={themeKeys:{alignItems:"alignItems",contentSpacing:"contentSpacing",badgeContentSpacing:"badgeContentSpacing",ratingContentSpacing:"ratingContentSpacing"},base:{display:"flex",flexDirection:"row",alignItems:"center",contentSpacing:f.spacer.lg,badgeContentSpacing:f.spacer.sm,ratingContentSpacing:f.spacer.lg},themeStyles:Ko},hl={themeKeys:{color:"textColor"},base:{...f.typography.body2,marginRight:f.spacer.lg,color:f.color.textNeutral},tones:{neutral:{disabled:{color:f.color.textNeutralDisabled}},inverse:{color:f.color.textInverse,disabled:{color:f.color.textNeutralDisabled}},brand:{color:f.color.textNeutral,disabled:{color:f.color.textNeutralDisabled}}},themeStyles:Ko};Y(dl);Y(hl);const{Metadata:{defaultTone:td,...pr}={styles:{}}}=(Qr=f)==null?void 0:Qr.componentConfig,ul={themeKeys:{justifyContent:"justifyContent",alpha:"alpha"},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",alpha:f.alpha.primary},modes:{disabled:{alpha:f.alpha.inactive}},themeStyles:pr},fl={themeKeys:{color:"textColor"},base:{maxLines:1,contain:"width",...f.typography.headline3,color:f.color.textNeutral},tones:{neutral:{disabled:{color:f.color.textNeutralDisabled}},inverse:{color:f.color.textInverse,disabled:{color:f.color.textNeutralDisabled}},brand:{color:f.color.textNeutral,disabled:{color:f.color.textNeutralDisabled}}},themeStyles:pr},gl={themeKeys:{color:"textColor"},base:{contain:"width",maxLines:2,...f.typography.body2,color:f.color.textNeutralSecondary},tones:{neutral:{disabled:{color:f.color.textNeutralDisabled}},inverse:{color:f.color.textInverseSecondary,disabled:{color:f.color.textNeutralDisabled}},brand:{color:f.color.textNeutralSecondary,disabled:{color:f.color.textNeutralDisabled}}},themeStyles:pr};Y(ul);Y(gl);Y(fl);const{ProgressBar:{defaultTone:nd,...Xo}={styles:{}}}=(Kr=f)==null?void 0:Kr.componentConfig,pl={themeKeys:{color:"barColor",borderRadius:"borderRadius"},base:{height:f.spacer.md,color:f.color.fillNeutralTertiary,borderRadius:f.radius.xs},tones:{inverse:{color:f.color.fillInverseTertiary}},themeStyles:Xo},ml={themeKeys:{color:"progressColor",borderRadius:"borderRadius"},base:{borderRadius:f.radius.xs,color:f.color.fillNeutral},tones:{inverse:{color:f.color.fillInverse},brand:{color:f.color.fillBrand}},themeStyles:Xo};Y(pl);Y(ml);const{Row:{defaultTone:xl,...yl}={styles:{}}}=(Xr=f)==null?void 0:Xr.componentConfig,vl={themeKeys:{gap:"itemSpacing",scrollIndex:"scrollIndex",itemTransition:"itemTransition"},base:{display:"flex",justifyContent:"flexStart",flexDirection:"row",gap:f.layout.gutterX,width:f.layout.screenW,itemTransition:{...f.animation.standardEntrance,duration:f.animation.duration.fast}},themeStyles:yl},wl=Y(vl),St={tone:xl,Container:wl},G=r=>{const n=gn("left"),e=gn("right");return l(M,Q(r,{get selected(){return r.selected||0},get onLeft(){return gt(r.onLeft,n)},get onRight(){return gt(r.onRight,e)},forwardFocus:Ho,get onSelectedChanged(){return gt(r.onSelectedChanged,r.scroll!=="none"?$o(r.x):void 0)},get tone(){var t;return(t=r.tone)!=null?t:St.tone},get style(){return[...[r.style].flat(),St.Container.tones[r.tone||St.tone],St.Container.base]},get states(){var t;return(t=r.tone)!=null?t:St.tone}}))},{Keyboard:{defaultTone:rd,...mr}={styles:{}}}=(Vr=f)==null?void 0:Vr.componentConfig,bl={themeKeys:{keySpacing:"keySpacing",screenW:"screenW",marginX:"marginX"},base:{keySpacing:f.spacer.md,screenW:f.layout.screenW,marginX:f.layout.marginX,height:100},themeStyles:mr},Sl={themeKeys:{keySpacing:"keySpacing",textAlign:"textAlign",borderRadius:"borderRadius",color:"backgroundColor",justifyContent:"justifyContent",baseWidth:"baseWidth",sizes:"sizes",contentColor:"contentColor"},base:{keySpacing:f.spacer.md,height:f.spacer.md*9,paddingX:f.spacer.md,sizes:{sm:1,md:2,lg:3,xl:4,xxl:5},contentColor:f.color.fillNeutral,padding:[f.spacer.xxxl,f.spacer.xl],baseWidth:f.spacer.md*7,color:f.color.interactiveNeutral,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:f.radius.sm},modes:{focus:{color:f.color.interactiveNeutralFocus,contentColor:f.color.fillInverse},disabled:{color:f.color.fillNeutralDisabled,contentColor:f.color.fillNeutralDisabled}},tones:{inverse:{color:f.color.interactiveInverse,focus:{color:f.color.interactiveInverseFocus,contentColor:f.color.fillNeutral}},brand:{focus:{contentColor:f.color.fillNeutral}}},themeStyles:mr},Al={themeKeys:{color:"textColor"},base:{textAlign:"left",color:f.color.textNeutral,...f.typography.headline2},modes:{focus:{color:f.color.textInverse},disabled:{color:f.color.textNeutralDisabled}},tones:{inverse:{focus:{color:f.color.textNeutral}}},themeStyles:mr};Y(bl);Y(Sl);Y(Al);const{Key:{defaultTone:od,...Vo}={styles:{}}}=(Gr=f)==null?void 0:Gr.componentConfig,Cl={themeKeys:{keySpacing:"keySpacing",textAlign:"textAlign",borderRadius:"borderRadius",color:"backgroundColor",justifyContent:"justifyContent",baseWidth:"baseWidth",sizes:"sizes",contentColor:"contentColor"},base:{keySpacing:f.spacer.md,height:f.spacer.md*9,paddingX:f.spacer.md,contentColor:f.color.fillNeutral,sizes:{sm:1,md:2,lg:3,xl:4,xxl:5},padding:[f.spacer.xxxl,f.spacer.xl],baseWidth:f.spacer.md*7,color:f.color.interactiveNeutral,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:f.radius.sm},modes:{focus:{color:f.color.interactiveNeutralFocus,contentColor:f.color.fillInverse},disabled:{color:f.color.fillNeutralDisabled,contentColor:f.color.fillNeutralDisabled}},tones:{inverse:{color:f.color.interactiveInverse,focus:{color:f.color.interactiveInverseFocus,contentColor:f.color.fillNeutral}},brand:{focus:{contentColor:f.color.fillNeutral}}},themeStyles:Vo},Tl={themeKeys:{color:"textColor"},base:{textAlign:"left",color:f.color.textNeutral,...f.typography.headline2},modes:{focus:{color:f.color.textInverse},disabled:{color:f.color.textNeutralDisabled}},tones:{inverse:{focus:{color:f.color.textNeutral}}},themeStyles:Vo};Y(Cl);Y(Tl);const{Tile:{defaultTone:id,...Cn}={styles:{}}}=(qr=f)==null?void 0:qr.componentConfig,{Surface:{defaultSurfaceTone:sd,..._l}={styles:{}}}=(Zr=f)==null?void 0:Zr.componentConfig,Il={themeKeys:{alpha:"alpha",paddingYProgress:"paddingYProgress"},base:{width:400,height:240,padding:[40,10],paddingYProgress:f.spacer.xl,paddingYBetweenContent:f.spacer.md,borderRadius:f.radius.md,alpha:f.alpha.primary},modes:{disabled:{alpha:f.alpha.inactive}},themeStyles:{..._l,...Cn}},Rl={themeKeys:{},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",mountY:1},themeStyles:Cn},Bl={themeKeys:{},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart"},themeStyles:Cn},kl={themeKeys:{},base:{width:f.spacer.lg*5,height:f.spacer.xxl+f.spacer.md},themeStyles:Cn};Y(Il);Y(Rl);Y(Bl);Y(kl);const qn={Column:{flexDirection:"column",display:"flex",width:320,height:600,y:360,gap:20,zIndex:101,transition:{x:{duration:250,easing:"ease-in-out"}},x:8,focus:{x:f.layout.marginX}},Gradient:{zIndex:99,color:L("#000000"),src:"./assets/sidenav.png",alpha:0,width:1200,height:1080,focus:{alpha:1},transition:{alpha:!0}},NavButton:{zIndex:102,height:70,width:100,borderRadius:8,focus:{color:L("#424242")},active:{width:328,height:70}}},El="/solid-demo-app/",Fl=[{name:"experiment",width:81,height:100,x:0,y:0},{name:"trending",width:100,height:56,x:81,y:0},{name:"tv",width:100,height:68,x:181,y:0},{name:"movie",width:94,height:100,x:282,y:0}];function Nl(r){const n=Pa(El+"assets/icons_white.png",Fl);return l(M,Q(r,{get texture(){return n[r.name]},get width(){return n[r.name].props.width},get height(){return n[r.name].props.height},get x(){return(100-(n[r.name].props.width||0))/2},get y(){return(100-(n[r.name].props.height||0))/2}}))}function Jt(r){return l(M,Q(r,{forwardStates:!0,get style(){return qn.NavButton},get children(){return[l(M,{y:-16,get children(){return l(Nl,{scale:.5,get name(){return r.icon}})}}),l(N,{get style(){return{...f.typography.button1,fontSize:38,x:116,y:24,height:50,alpha:0,active:{alpha:1}}},get children(){return r.children}})]}}))}function Ll(r){let n;const e=mt();function t(){n.states.add("focus"),this.children.forEach(i=>i.states.add("active")),this.children.selected.setFocus()}function o(){n.states.remove("focus"),this.selected=0,this.children.forEach(i=>i.states.remove("active"))}return[l(ee,Q(r,{onFocus:t,onBlur:o,get style(){return qn.Column},scroll:"none",get children(){return[l(Jt,{onEnter:()=>e("/browse/all"),icon:"trending",children:"Trending"}),l(Jt,{icon:"movie",onEnter:()=>e("/browse/movie"),children:"Movies"}),l(Jt,{icon:"tv",onEnter:()=>e("/browse/tv"),children:"TV"}),l(Jt,{icon:"experiment",onEnter:()=>e("/examples"),children:"Examples"})]}})),l(M,{ref(i){var s=n;typeof s=="function"?s(i):n=i},get style(){return qn.Gradient}})]}const Ml={color:255,height:90,width:330,x:1500,y:20,alpha:.8,zIndex:100},en={x:10,fontSize:36,textColor:L("#ffffff")},tn={fontSize:36,textColor:L("#ffffff")},[zl,Pl]=U(0),[Dl,Ol]=U(0),[Ul,Go]=U(99),[Wl,Yl]=U(0);let Zn=0,Jn=0;const $l=hr(()=>{Jn=0,Zn=0,Go(99)},1e4),Hl=r=>{r&&(Pl(r),Go(n=>Math.min(r,n)),Yl(n=>Math.max(r,n)),Jn+=r,Zn++,Ol(Math.round(Jn/Zn)),$l())};function jl(r){r.renderer.on("fpsUpdate",(n,e)=>{const t=typeof e=="number"?e:e.fps;t>5&&Hl(t)})}const Ql=r=>l(M,Q(r,{style:Ml,get children(){return[l(M,{get children(){return[l(N,{style:en,children:"FPS:"}),l(N,{style:tn,x:94,get children(){return zl().toString()}})]}}),l(M,{x:160,get children(){return[l(N,{style:en,children:"AVG:"}),l(N,{style:tn,x:104,get children(){return Dl().toString()}})]}}),l(M,{x:0,y:40,get children(){return[l(N,{style:en,children:"MIN:"}),l(N,{style:tn,x:94,get children(){return Ul().toString()}})]}}),l(M,{x:160,y:40,get children(){return[l(N,{style:en,children:"MAX:"}),l(N,{style:tn,x:104,get children(){return Wl().toString()}})]}})]}})),Kl=r=>{Ba({Announcer:"a",Menu:"m",Escape:"Escape"});const n=za();n.enabled=!1;const e=mt();let t,o;return je(()=>{jl({renderer:Le})}),l(M,{onAnnouncer:()=>n.enabled=!n.enabled,onLast:()=>history.back(),onMenu:()=>e("/"),style:{width:1920,height:1080},onLeft:()=>{if(t.states.has("focus"))return!1;o=lr(),t.setFocus()},onRight:()=>t.states.has("focus")&&o.setFocus(),get children(){return[l(Oa,{}),l(Ql,{}),pt(()=>r.children),l(Ll,{ref(i){var s=t;typeof s=="function"?s(i):t=i}})]}})},fe={Page:{width:1920,height:1080},headlineText:{width:1200,height:240,x:360,y:455,contain:"both",fontSize:66,textAlign:"center"},headlineSubText:{width:960,height:170,x:530,y:655,contain:"both",fontSize:48,textAlign:"center"},itemsContainer:{width:f.layout.screenW,height:600,y:560,x:0,zIndex:2},Thumbnail:{borderRadius:16,width:185,height:278,scale:1,zIndex:2,transition:{scale:{duration:250,easing:"ease-in-out"}},border:{width:0,color:0},focus:{scale:1.1,border:{color:4294967142,width:8}}},FocusRing:{borderRadius:16,width:194,height:286,y:-5,x:-5,zIndex:-1},FPS:{color:255,height:42,width:140,x:20,y:20,zIndex:100},FPSLabel:{x:10,y:0,fontSize:36,textColor:L("#ffffff")},FPSValue:{x:90,y:0,fontSize:36,textColor:L("#ffffff")},showHeadline:{x:70,y:20},headlineBlur:{width:1920,height:150,x:0,y:0,zIndex:14,alpha:.9,color:L("#000000")},RowTitle:{height:60,width:300,marginTop:20,fontSize:36,color:L("#f0f0f0"),zIndex:2},Row:{display:"flex",justifyContent:"spaceBetween",height:300},Column:{display:"flex",flexDirection:"column",justifyContent:"flexStart",gap:20,width:f.layout.screenW-2*f.layout.marginX,x:f.layout.marginX+f.layout.gutterX,y:48,transition:{y:{duration:250,easing:"ease-in-out"}},zIndex:2},Rect:{width:250,height:100,y:10,x:300,color:L("#0000ff")},peopleBio:{...f.typography.body1,contain:"both",width:1500,height:400}},pn={width:120,height:40,color:L("#000000"),borderRadius:8,border:{width:2,color:L("#3333ff")},scale:1,focus:{scale:1.1,border:{width:5,color:L("#333333")}},transition:{scale:!0,color:!0}},Xl={color:L("#00A699"),height:8,y:2,x:-4,width:pn.width+8},Vl={fontSize:12,y:12,contain:"width",textAlign:"center",color:L("#F6F6F9"),height:pn.height,width:pn.width},mn={container:pn,topBar:Xl,text:Vl},Jr={width:386,height:136,color:L("#715cab"),focus:{color:L("#5a39a2")},disabled:{color:L("#291d43")}},Gl={fontSize:32,contain:"width",textAlign:"center",mountY:-.35,color:L("#FFFFFF"),height:Jr.height,width:Jr.width,focus:{fontSize:40},disabled:{color:L("#909090")}};function ql(r){return l(M,Q(r,{get style(){return fe.Thumbnail}}))}function xn(r){const[n,e]=_s(r,["items"]);return l(G,Q(e,{get style(){return fe.Row},get children(){return l(Sn,{get each(){return n.items},children:t=>l(ql,t)})}}))}function Zl(r){return l(M,Q(r,{forwardStates:!0,get style(){return mn.container},get children(){return l(N,{get style(){return mn.text},get children(){return r.children}})}}))}const Jl="eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyZDE4YjEwMTA0YjdiZTlkNjFiMWYwYjVlMGEwNzM2OCIsInN1YiI6IjYwZTVjMTdlNGNhNjc2MDA3NTA4Njc3MSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.D_nqH9kd-bhhWzeVsTDPYhHnsUaNAuyAa6YATmKHqsA",ec="https://api.themoviedb.org/3";let qo,Zo;const tc="w185",nc={headers:{"Content-Type":"application/json",Authorization:"Bearer "+Jl}};function kt(r,n=tc){return Zo+n+r}function rc(r,n={}){return qo?er(r,n):Jo().then(()=>er(r,n))}function er(r,n={}){return fetch(ec+r,{...nc,...n}).then(e=>e.json())}function Jo(){return er("/configuration").then(r=>{var n;return qo=r,Zo=(n=r.images)==null?void 0:n.secure_base_url,r})}const tt={get:rc,loadConfig:Jo};function oc(r,n){return r.length>n?r.substring(0,n-3)+"...":r}function ic(r,n=7){let e=[];for(let t=0,o=r.length;t({src:kt(n.poster_path||n.profile_path),tileSrc:kt(n.backdrop_path||n.profile_path,"w300"),backdrop:kt(n.backdrop_path,"w1280"),href:"/entity/".concat(n.media_type||"people","/").concat(n.id),shortTitle:oc(n.title||n.name,30),title:n.title||n.name,data:n,entityInfo:{type:n.media_type||"people",id:n.id},heroContent:{title:n.title||n.name,description:n.overview}}))}let Ln=new Map;const nn=new Map;function sc(r){return n=>{const e="/trending/".concat(r,"/week?page=").concat(n);if(Ln.has(e))return Ln.get(e);let t=tt.get(e).then(o=>{let i=o.results.filter(c=>!c.adult),s=(nn.has(r)?nn.get(r):[]).concat(Nt(i)),a=ic(s);return a[a.length-1].length<7?nn.set(r,a.pop()):nn.delete(r),a});return Ln.set(e,t),t}}function ac(r){const[n,e]=U([]),[t,o]=U(1),[i,s]=U(!1),[a]=et(t,r);return $n(()=>{const c=a();c&&ms(()=>{c.length===0&&s(!0),e(d=>[...d,...c])})}),{pages:n,page:t,setPage:o,setPages:e,end:i,setEnd:s}}const Tn=1100,lc={...f.typography.display2,width:Tn,height:58,contain:"both"},cc=r=>l(N,Q(r,{style:lc,get children(){return r.children}})),dc={...f.typography.body1,width:Tn,height:72,contain:"both"},hc={fontSize:20,lineHeight:20},uc=r=>l(N,Q(r,{style:dc,get children(){return r.children}}));function fc(r){return[l(Be,{get when(){return(r==null?void 0:r.rtCrit)&&(r==null?void 0:r.rtCrit)!=="0"},get children(){return[l(M,{src:"https://upload.wikimedia.org/wikipedia/commons/b/b6/Tomato-Torrent-Icon.png",title:"Rotten Tomatoes Rating",style:{width:30,height:30,marginRight:-6}}),l(N,{style:tr,get children(){return r.rtCrit+"%"}})]}}),l(Be,{get when(){return(r==null?void 0:r.rtFan)&&(r==null?void 0:r.rtFan)!=="0"},get children(){return[l(M,{src:"https://upload.wikimedia.org/wikipedia/commons/thumb/d/da/Rotten_Tomatoes_positive_audience.svg/80px-Rotten_Tomatoes_positive_audience.svg.png",title:"Rotten Tomatoes Rating",style:{width:24,height:30,marginRight:-6}}),l(N,{style:tr,get children(){return r.rtFan+"%"}})]}})]}const gc=r=>(()=>{var n=Pt("node");return Eo(Yo,n,()=>[8,15,13,15]),An(n,Q(r,{style:{color:"0x00000099",borderRadius:8,border:{width:3,color:"0xffffffff"}}}),!0),ko(n,l(N,{style:hc,get children(){return r.children}})),n})(),tr=f.typography.body2,pc=r=>l(M,{style:{display:"flex",flexDirection:"row",gap:12,width:Tn,height:48},get children(){return[l(N,{style:tr,get children(){return r.metaText}}),l(Sn,{get each(){return r.badges},children:n=>l(gc,{y:-5,children:n})}),pt(()=>fc(r.reviews))]}}),ei=r=>l(M,Q(r,{style:{display:"flex",flexDirection:"column",width:Tn,height:160,gap:16},get children(){return[l(cc,{get children(){return r.title}}),l(uc,{get children(){return r.description}}),l(pc,{get metaText(){return r.metaText},get badges(){return r.badges},get reviews(){return r.reviews}})]}}));function mc(r){const n=Math.floor(r/60),e=r%60;return n+"h "+(e<10?"0":"")+e+"m"}function eo(r){return r.split("-")[0]}function xc({type:r,id:n}){return tt.get("/".concat(r,"/").concat(n,"/recommendations")).then(({results:e})=>e.length?Nt(e.slice(0,7)):tt.get("/trending/".concat(r,"/week?page=1")).then(({results:t})=>Nt(t.slice(0,7))))}function yc({type:r,id:n}){return tt.get("/".concat(r,"/").concat(n,"/credits")).then(({cast:e})=>Nt(e.slice(0,7)))}function ti({type:r,id:n}){let e=r==="movie"?{rtCrit:86,rtFan:92}:{};return tt.get("/".concat(r,"/").concat(n)).then(t=>({backgroundImage:kt(t.backdrop_path,"original"),heroContent:{title:t.title||t.name,description:t.overview,badges:["HD"],metaText:r==="movie"?mc(t.runtime)+" - "+t.release_date:"".concat(eo(t.first_air_date)," - ").concat(eo(t.last_air_date)),reviews:e},...t}))}const to=()=>{const r=dr(),[n,e]=U(0),[t,o]=U();et(t,ti);const[i,s]=U({}),a=mt(),c=yo(()=>0),d=ne(()=>ac(sc(r.filter||"all")));$e(He(lr,y=>{y.backdrop&&Ee(y.backdrop),y.heroContent&&s(y.heroContent)},{defer:!0}));function u(){var b;(b=this.children.selected)==null||b.setFocus(),e((this.y||0)*-1+24);let y=d().pages().length;(y===0||this.parent.selected&&this.parent.selected>=y-2)&&d().setPage(x=>x+1)}function g(){let y=this.children.selected;F(y&&y.href),a(y.href)}return l(Be,{get when(){return d().pages().length},get children(){return[l(ei,Q({y:360,x:150},i)),l(M,{clipping:!0,get style(){return fe.itemsContainer},get children(){return l(ee,{plinko:!0,announce:"All Trending - Week",get y(){return n()},get style(){return fe.Column},get children(){return l(Sn,{get each(){return d().pages()},children:(y,b)=>l(xn,{get autofocus(){return c(b())},items:y,onFocus:u,onEnter:g})})}})}})]}})},vc=()=>{const r=mt(),n=yo(()=>0);function e(){let c=this.children.selected;F(c&&c.id),r("/"+c.id)}const t=[{title:"Flex Row",id:"flex",description:"Flex Row Implementation"},{title:"Flex Column",id:"flexcolumn",description:"Flex Column Implementation"},{title:"Flex Row Vertical Align",id:"flexsize",description:"Flex Row Vertical Align Implementation"},{title:"Flex Column Vertical Align",id:"flexcolumnsize",description:"Flex Column Vertical Align Implementation"},{title:"Buttons",id:"buttons",description:"Demo a few buttons"},{title:"Text",id:"text",description:"Text layout with flexbox"},{title:"Create Elements",id:"create",description:"Testing Show + children + inserting text"},{title:"Viewport",id:"viewport",description:"Events going in and out of viewport"}];function o(c){const d={width:370,height:320,borderRadius:6,scale:1,color:405488895,transition:{color:!0,scale:!0},focus:{scale:1.1,color:4294967295}},[u,g]=U(4294967295);return l(M,Q(c,{onFocus:()=>g(255),onBlur:()=>g(4294967295),style:d,get children(){return l(M,{x:30,get children(){return[l(N,{y:30,fontSize:84,get color(){return u()},get children(){return c.index}}),l(N,{y:140,fontSize:42,width:340,height:42,contain:"both",get color(){return u()},get children(){return c.title}}),l(N,{y:200,fontSize:28,width:330,contain:"width",get color(){return u()},get children(){return c.description}})]}})}}))}const[i,s]=U(140);function a(c){s(c.selected*-400+140)}return l(M,{colorTop:1147903743,colorBottom:743406847,get children(){return[l(M,{x:120,get children(){return[l(M,{src:"/assets/solidjs.png",width:101,height:90,y:40}),l(N,{fontSize:90,x:110,y:40,children:"Examples"}),l(M,{y:140,height:1,width:1800,color:3906468351})]}}),l(G,{onSelectedChanged:a,onEnter:e,transition:{x:{delay:20,duration:300}},get x(){return i()},y:300,width:4400,get style(){return fe.Row},justifyContent:"flexStart",gap:40,get children(){return l(Sn,{each:t,children:(c,d)=>l(o,Q({get autofocus(){return n(d())},get index(){return d()}},c))})}})]}})},wc=()=>{const r={width:900,height:500,y:350,x:150,gap:25,display:"flex",flexDirection:"column",justifyContent:"flexStart",color:L("00000000")},n={width:900,height:36,gap:6,display:"flex",flexDirection:"row",justifyContent:"flexStart",color:L("00000000")},e={fontSize:42},t={width:r.width,fontSize:26,contain:"width"},o={fontSize:26};return je(()=>{Ee("#000000")}),l(M,{autofocus:!0,style:r,get children(){return[l(N,{style:e,children:"Title of the Page"}),l(N,{style:t,children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer vel tempor tellus. Sed eu leo purus. Vestibulum sollicitudin eget tellus a varius. Phasellus est turpis, volutpat sed blandit sit amet, rutrum sit amet mauris. In dignissim elit orci, a sollicitudin ipsum faucibus et. Quisque vel quam rutrum, faucibus augue sed, scelerisque nunc."}),l(M,{style:n,get children(){return[l(N,{style:o,children:"Subline Text"}),l(M,{width:28,height:28,src:"/assets/rt-popcorn.png"}),l(N,{style:o,children:"More Text"})]}})]}})},bc=()=>{const r={width:900,height:500,y:50,x:150,gap:25,display:"flex",flexDirection:"column",justifyContent:"flexStart",color:L("00000000")},n={width:900,height:36,gap:6,display:"flex",flexDirection:"row",justifyContent:"flexStart",color:L("00000000")},e={fontSize:42},t={fontSize:26};let o,i;je(()=>{Ee("#000000"),o.animate({x:100},{duration:2e3}).start()});const[s,a]=U(),[c,d]=U();setTimeout(()=>{var A;a("- Inserted -"),(A=i.getChildById("child1"))==null||A.animate({x:600},{duration:2e3}).start()},2e3);const u={width:400,height:300,color:L("#0000ff")},g={color:L("#f54242"),focus:{color:L("#4287f5")}};function y(A){const p=wn(()=>A.children);return l(M,Q(A,{get style(){return[g,A.style,[u]]},get children(){return[l(M,{id:"child1",width:100,height:100,get color(){return L("#ff0000")},y:25,get children(){return[pt(()=>p()),l(M,{id:"subChild",x:150,width:100,height:100,get color(){return L("#00ff00")}}),l(N,{get children(){return A.title}})]}}),l(M,{width:100,height:100,get color(){return L("#ffff00")},y:175,get children(){return p()}})]}}))}const b={borderLeft:{width:8,color:95598118},borderTop:{width:8,color:631422246},borderRight:{width:8,color:95598118},borderBottom:{width:8,color:3316790822}},x={color:L("#cccccc"),focus:{color:L("#000000")}},w={color:L("#ffffff"),focus:{color:L("#f6f6cc")}};function S(A){return console.log("Ref is available: ",A),!0}return l(M,{style:r,get children(){return[l(N,{style:e,children:"Title of the Page"}),l(M,{style:n,get children(){return[l(N,{get children(){return c()}}),l(N,{style:t,get children(){return["Sub ",pt(()=>s())," Text"]}}),l(Be,{get when(){return s()},get children(){return l(M,{width:28,height:28,src:"/assets/rt-popcorn.png"})}}),l(N,{style:t,children:"More Text"})]}}),l(y,{autofocus:!0,ref(A){var p=i;typeof p=="function"?p(A):i=A},style:[w,x],get children(){return l(N,{children:"Child Test"})}}),l(M,{ref(A){var p=o;typeof p=="function"?p(A):o=A},style:b,width:100,height:100,get color(){return L("#00ff00")},x:900,y:400,get alpha(){return S(o)?1:.5}})]}})},Sc=()=>{let r,n;const[e,t]=U([]),o={width:100,height:100,x:-400,y:-400,rotation:0,borderRadius:50,color:L("#4287f5"),transition:{x:{duration:1250,easing:"linear"},y:{duration:1250,easing:"linear"},rotation:{duration:1400,easing:"ease-in-out"}}},i={fontSize:32,x:960,y:540,mount:.5,lineheight:52},s=(c,d)=>Math.floor(Math.random()*(d-c+1)+c);je(()=>{Ee("#000000"),r.x=1820/2,r.y=980/2,n=setInterval(()=>{r.rotation=s(-90,90),r.x=s(-300,2220),r.y=s(-300,1380)},2500)});function a(c,d){t(u=>[...u,c].slice(-4)),console.log(c)}return Me(()=>{clearInterval(n)}),l(M,{get children(){return[l(N,{style:i,get children(){return e().join("\n")}}),l(M,{autofocus:!0,style:o,ref(c){var d=r;typeof d=="function"?d(c):r=c},onEvents:[["inBounds",c=>a("inBounds")],["outOfBounds",c=>a("outOfBounds")],["inViewport",c=>a("inViewport")],["outOfViewport",c=>a("outOfViewport")]]})]}})},Ac=()=>{function r(o,i){this.states.toggle("disabled")}const n={display:"flex",justifyContent:"flexStart",width:1500,height:300,color:L("00000000"),gap:26,y:400};function e(o){return l(M,Q(o,{forwardStates:!0,get style(){return mn.container},get children(){return l(N,{get style(){return mn.text},get children(){return o.children}})}}))}const t=o=>(()=>{var i=Pt("node");return Eo(Yo,i,()=>[10,15]),An(i,Q(o,{get style(){return{color:L("#000000be"),borderRadius:8,border:{width:2,color:L("#ffffff")}}}}),!0),ko(i,l(N,{style:{fontSize:20},get children(){return o.children}})),i})();return[l(G,{x:100,y:200,gap:5,style:n,get children(){return[l(t,{children:"HD"}),l(t,{children:"PG13"}),l(t,{children:"NC17"}),l(N,{fontSize:30,children:"I like bananas"}),l(t,{children:"DOLBY"})]}}),l(G,{x:100,gap:40,style:n,get children(){return[l(e,{autofocus:!0,onEnter:r,children:"TV Shows"}),l(e,{states:{active:!0,disabled:!1},children:"Movies"}),l(e,{states:"active",children:"Sports"}),l(e,{states:"disabled",children:"News"})]}})]},Cc=()=>{const r={display:"flex",justifyContent:"flexStart",width:1600,height:110,color:L("#4dabf5")},n={fontSize:44,marginTop:25,marginBottom:-20,skipFocus:!0};function e(a){return l(M,Q(a,{style:{width:200,height:100,y:5,color:392801023}}))}const[t,o]=U(50);function i(){var a;(a=this.children.selected)==null||a.setFocus(),o(150+(this.y||0)*-1)}je(()=>{Ee("#333333")});const s=50;return l(ee,{x:160,get y(){return t()},gap:30,height:850,get width(){return r.width},get style(){return fe.Column},get children(){return[l(N,{style:n,children:"Flex Start"}),l(G,{gap:s,style:r,onFocus:i,get children(){return[l(e,{autofocus:!0}),l(e,{}),l(e,{}),l(e,{}),l(e,{})]}}),l(N,{style:n,children:"Flex Start - Margin Left"}),l(G,{gap:s,style:r,onFocus:i,get children(){return[l(e,{marginLeft:100}),l(e,{}),l(e,{marginLeft:100}),l(e,{}),l(e,{})]}}),l(N,{style:n,children:"Flex End"}),l(G,{gap:s,justifyContent:"flexEnd",style:r,onFocus:i,get children(){return[l(e,{}),l(e,{}),l(e,{}),l(e,{}),l(e,{})]}}),l(N,{style:n,children:"Flex End - Margin Right"}),l(G,{gap:s,justifyContent:"flexEnd",style:r,onFocus:i,get children(){return[l(e,{}),l(e,{marginRight:100}),l(e,{}),l(e,{}),l(e,{marginRight:100})]}}),l(N,{style:n,children:"Center - No Margin Support"}),l(G,{gap:s,justifyContent:"center",style:r,onFocus:i,get children(){return[l(e,{}),l(e,{}),l(e,{}),l(e,{}),l(e,{})]}}),l(N,{style:n,children:"Space Between - No Margin Support"}),l(G,{gap:s,justifyContent:"spaceBetween",style:r,onFocus:i,get children(){return[l(e,{}),l(e,{}),l(e,{}),l(e,{}),l(e,{})]}}),l(N,{style:n,children:"Space Evenly - No Margin Support"}),l(G,{gap:s,justifyContent:"spaceEvenly",style:r,onFocus:i,get children(){return[l(e,{}),l(e,{}),l(e,{}),l(e,{}),l(e,{})]}})]}})},Tc=()=>{const r={display:"flex",justifyContent:"flexStart",width:1600,height:110,color:L("#4dabf5")},n={fontSize:44,marginTop:25,marginBottom:-20,skipFocus:!0};function e(c){return l(M,Q(c,{style:{width:200,height:100,y:5,color:392801023}}))}function t(){return Math.floor(Math.random()*91)+10}const[o,i]=U(50);function s(){var c;(c=this.children.selected)==null||c.setFocus(),i(150+(this.y||0)*-1)}je(()=>{Ee("#333333")});const a=50;return l(ee,{x:160,get y(){return o()},gap:30,height:850,get width(){return r.width},get style(){return fe.Column},get children(){return[l(N,{style:n,children:"Flex Start - AlignItems: center"}),l(G,{alignItems:"center",gap:a,style:r,onFocus:s,get children(){return[l(e,{autofocus:!0,get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}})]}}),l(N,{style:n,children:"Flex Start - Margin Left - AlignItems: flexStart"}),l(G,{gap:a,alignItems:"flexStart",style:r,onFocus:s,get children(){return[l(e,{marginLeft:100,get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{marginLeft:100,get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}})]}}),l(N,{style:n,children:"Flex End - AlignItems: flexEnd"}),l(G,{gap:a,justifyContent:"flexEnd",alignItems:"flexEnd",style:r,onFocus:s,get children(){return[l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}})]}}),l(N,{style:n,children:"Flex End - Margin Right"}),l(G,{gap:a,justifyContent:"flexEnd",style:r,onFocus:s,get children(){return[l(e,{get height(){return t()}}),l(e,{marginRight:100,get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{marginRight:100,get height(){return t()}})]}}),l(N,{style:n,children:"Center - No Margin Support"}),l(G,{gap:a,justifyContent:"center",style:r,onFocus:s,get children(){return[l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}})]}}),l(N,{style:n,children:"Space Between - No Margin Support"}),l(G,{gap:a,justifyContent:"spaceBetween",style:r,onFocus:s,get children(){return[l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}})]}}),l(N,{style:n,children:"Space Evenly - No Margin Support"}),l(G,{gap:a,justifyContent:"spaceEvenly",style:r,onFocus:s,get children(){return[l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}}),l(e,{get height(){return t()}})]}})]}})},_c=()=>{const r={display:"flex",justifyContent:"spaceEvenly",width:1920,y:100,height:880,color:L("00000000")},n={display:"flex",flexDirection:"column",justifyContent:"flexStart",color:L("#4dabf5"),height:850,width:80},e={fontSize:44,y:20,x:150};function t(d){const u={width:o(),height:80,x:5,color:L("#1769aa")};return l(M,Q(d,{style:u}))}function o(){return Math.floor(Math.random()*61)+10}const[i,s]=U(50);function a(){var d;(d=this.children.selected)==null||d.setFocus(),s(150+(this.y||0)*-1)}je(()=>{Ee("#333333")});const c=50;return[l(N,{style:e,children:"Start, MarginTop, End, MarginBottom, Center, Between, Evenly"}),l(G,{gap:c,style:r,onFocus:a,get children(){return[l(ee,{gap:30,style:n,alignItems:"center",get children(){return[l(t,{autofocus:!0}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(ee,{gap:c,style:n,onFocus:a,alignItems:"flexStart",get children(){return[l(t,{marginTop:100}),l(t,{}),l(t,{marginTop:100}),l(t,{}),l(t,{})]}}),l(ee,{gap:c,alignItems:"flexEnd",justifyContent:"flexEnd",style:n,onFocus:a,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(ee,{gap:c,justifyContent:"flexEnd",style:n,onFocus:a,get children(){return[l(t,{}),l(t,{marginBottom:100}),l(t,{}),l(t,{}),l(t,{marginBottom:100})]}}),l(ee,{gap:c,justifyContent:"center",style:n,onFocus:a,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(ee,{gap:c,justifyContent:"spaceBetween",style:n,onFocus:a,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(ee,{gap:c,justifyContent:"spaceEvenly",style:n,onFocus:a,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}})]}})]},Ic=()=>{const r={display:"flex",justifyContent:"spaceEvenly",width:1920,y:100,height:880,color:L("00000000")},n={display:"flex",flexDirection:"column",justifyContent:"flexStart",color:L("#4dabf5"),height:850,width:60},e={fontSize:44,y:20,x:150};function t(c){const d={width:50,height:80,x:5,color:L("#1769aa")};return l(M,Q(c,{style:d}))}const[o,i]=U(50);function s(){var c;(c=this.children.selected)==null||c.setFocus(),i(150+(this.y||0)*-1)}je(()=>{Ee("#333333")});const a=50;return[l(N,{style:e,children:"Start, MarginTop, End, MarginBottom, Center, Between, Evenly"}),l(G,{gap:a,style:r,onFocus:s,get children(){return[l(ee,{gap:30,style:n,get children(){return[l(t,{autofocus:!0}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(ee,{gap:a,style:n,onFocus:s,get children(){return[l(t,{marginTop:100}),l(t,{}),l(t,{marginTop:100}),l(t,{}),l(t,{})]}}),l(ee,{gap:a,justifyContent:"flexEnd",style:n,onFocus:s,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(ee,{gap:a,justifyContent:"flexEnd",style:n,onFocus:s,get children(){return[l(t,{}),l(t,{marginBottom:100}),l(t,{}),l(t,{}),l(t,{marginBottom:100})]}}),l(ee,{gap:a,justifyContent:"center",style:n,onFocus:s,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(ee,{gap:a,justifyContent:"spaceBetween",style:n,onFocus:s,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}}),l(ee,{gap:a,justifyContent:"spaceEvenly",style:n,onFocus:s,get children(){return[l(t,{}),l(t,{}),l(t,{}),l(t,{}),l(t,{})]}})]}})]},Rc=()=>{function r(i,s){this.states.toggle("disabled")}const n={display:"flex",justifyContent:"flexStart",width:1500,height:300,color:L("00000000"),gap:26,y:400,x:100},e={width:386,height:136,color:"0x715cabff",focus:{color:"0x5a39a2ff"},disabled:{color:"0x291d43ff"}},t=["RoundedRectangle",{radius:65}];function o(i){return l(M,Q(i,{forwardStates:!0,style:e,shader:t,get children(){return l(N,{style:Gl,get children(){return i.children}})}}))}return l(G,{style:n,get children(){return[l(o,{autofocus:!0,onEnter:r,children:"Focused"}),l(o,{states:{active:!0,disabled:!1},children:"Normal"}),l(o,{states:"disabled",children:"Disabled"})]}})},Bc="https://storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd";function kc(){shaka.polyfill.installAll(),shaka.Player.isBrowserSupported()?Ec():console.error("Browser not supported!")}async function Ec(){const r=document.getElementById("video"),n=new shaka.Player;await n.attach(r),window.player=n,n.addEventListener("error",Fc);try{await n.load(Bc),console.log("The video has now been loaded!")}catch(e){ni(e)}}function Fc(r){ni(r.detail)}function ni(r){console.error("Error code",r.code,"object",r)}function Nc(){const r=document.getElementById("video");return r.hidden=!1,setTimeout(()=>r.play(),50),r.focus(),r}function Lc(){const r=document.getElementById("video");return r.hidden=!0,r.pause(),r}document.addEventListener("DOMContentLoaded",kc);const Mc=()=>{const r=dr(),n=mt(),[e]=et(()=>({...r}),ti),[t]=et(()=>({...r}),yc),[o]=et(()=>({...r}),xc),[i,s]=U(0);$e(He(e,A=>{Ee(A.backgroundImage)},{defer:!0}));const a=600,c={color:L("#000000"),alpha:0,width:1900,height:890,x:10,y:a,borderRadius:30};function d(){var A;(A=this.children.selected)==null||A.setFocus(),x.y=a,w.y=a,w.alpha=0}function u(){var A;(A=this.children.selected)==null||A.setFocus(),x.y=200,w.y=160,w.alpha=.9}function g(){let A=this.children.selected;F(A&&A.href),n(A.href)}function y(){Lc(),document.getElementsByTagName("canvas")[0].focus(),Qn(S),s(0)}function b(){const A=Nc();Qn(A),s(.9)}let x,w,S;return l(Be,{get when(){return e()},keyed:!0,get children(){return[l(M,{onUp:()=>S.setFocus(),onEscape:y,get children(){return[l(ei,Q({y:360,x:150},()=>e().heroContent)),l(Zl,{autofocus:!0,ref(A){var p=S;typeof p=="function"?p(A):S=A},y:560,x:150,onDown:()=>x.setFocus(),onEnter:b,children:"Watch Trailer"}),l(ee,{ref(A){var p=x;typeof p=="function"?p(A):x=A},y:a,x:140,get style(){return fe.Column},zIndex:5,get children(){return l(Be,{get when(){return pt(()=>!!o())()&&t()},get children(){return[l(N,{skipFocus:!0,get style(){return fe.RowTitle},children:"Recommendations"}),l(xn,{onFocus:d,onEnter:g,get items(){return o()}}),l(N,{skipFocus:!0,get style(){return fe.RowTitle},children:"Cast and Crew"}),l(xn,{onFocus:u,onEnter:g,get items(){return t()}})]}})}}),l(M,{ref(A){var p=w;typeof p=="function"?p(A):w=A},style:c,transition:{alpha:!0,y:!0}})]}}),l(M,{get alpha(){return i()},get color(){return L("#000000")},zIndex:200,transition:{alpha:!0}})]}})};function zc({id:r}){return tt.get("/person/".concat(r,"/combined_credits")).then(({cast:n})=>Nt(n.slice(0,7)))}function Pc({id:r}){return tt.get("/person/".concat(r)).then(n=>({backgroundImage:kt(n.profile_path,"original"),heroContent:{title:n.title||n.name,description:n.biography},...n}))}const Dc=()=>{const r=dr(),n=mt(),[e]=et(()=>({...r}),Pc),[t]=et(()=>({...r}),zc);$e(He(e,s=>{Ee(s.backgroundImage)},{defer:!0}));const o={color:L("#000000"),alpha:.8,width:1540,height:440,x:130,y:180,borderRadius:30};function i(){let s=this.children.selected;F(s&&s.href),n(s.href)}return l(Be,{get when(){return e()},keyed:!0,get children(){return[l(M,{x:150,y:200,get style(){return fe.Column},zIndex:3,get children(){return[l(N,{get style(){return f.typography.display2},get children(){return e().name}}),l(N,{get style(){return fe.peopleBio},get children(){return e().biography}})]}}),l(M,{style:o}),l(ee,{y:670,x:140,get style(){return fe.Column},get children(){return l(Be,{get when(){return t()},get children(){return[l(N,{skipFocus:!0,get style(){return fe.RowTitle},children:"Credits"}),l(xn,{autofocus:!0,onEnter:i,get items(){return t()}})]}})}})]}})},Oc=()=>(()=>{var r=Pt("node");return Qs(r,"style",{width:1920,height:1080,color:868483072}),r})(),Uc=new URL("AppCoreExtensions-tiD9qKNE.js",import.meta.url).href;Ae.debug=!1;Ae.animationsEnabled=!0;Ae.fontSettings.fontFamily="Ubuntu";Ae.fontSettings.color=L("#ffffff");Ae.fontSettings.fontSize=32;Ae.rendererOptions={coreExtensionModule:Uc,fpsUpdateInterval:1e3,enableInspector:!0};js(()=>l(ba,{root:r=>l(Kl,r),get children(){return[l(ue,{path:"",component:to}),l(ue,{path:"examples",component:vc}),l(ue,{path:"browse/:filter",component:to}),l(ue,{path:"text",component:wc}),l(ue,{path:"buttons",component:Ac}),l(ue,{path:"flex",component:Cc}),l(ue,{path:"create",component:bc}),l(ue,{path:"viewport",component:Sc}),l(ue,{path:"flexsize",component:Tc}),l(ue,{path:"flexcolumnsize",component:_c}),l(ue,{path:"flexcolumn",component:Ic}),l(ue,{path:"buttonsmaterial",component:Rc}),l(ue,{path:"entity/people/:id",component:Dc}),l(ue,{path:"entity/:type/:id",component:Mc}),l(ue,{path:"*all",component:Oc})]}}));export{Yc as __vite_legacy_guard}; +//# sourceMappingURL=index-DyIws3MF.js.map diff --git a/assets/index-DyIws3MF.js.map b/assets/index-DyIws3MF.js.map new file mode 100644 index 0000000..c5ed45f --- /dev/null +++ b/assets/index-DyIws3MF.js.map @@ -0,0 +1 @@ +{"version":3,"mappings":";;;;;;stCAqBO,MAAMA,EAAoB,CAE7B,YAAYC,EAAiB,CAD7BC,EAAA,wBAEI,KAAK,gBAAkBD,CAC1B,CACL,CCHO,MAAME,WAAuCH,EAAoB,CAIpE,YAAYC,EAAiBG,EAAS,SAClC,MAAMH,CAAe,EAJzBC,EAAA,kBAAa,IAAI,KACjBA,EAAA,+BAA0B,IAAI,KAC9BA,EAAA,gBAGI,KAAK,QAAU,CACX,0BAA0BG,EAAAD,EAAQ,2BAAR,KAAAC,EAAoC,IAC9D,+BAA+BC,EAAAF,EAAQ,gCAAR,KAAAE,EAAyC,GACpF,EAGQ,YAAY,IAAM,CACd,MAAMC,EAAM,KAAK,MACXC,EAAc,KAAK,QAAQ,8BACjC,UAAWC,KAAkB,KAAK,wBAC1BF,EAAME,EAAe,WAAaD,IAClC,KAAK,gBAAgBC,EAAe,EAAE,EACtC,KAAK,WAAW,OAAOA,EAAe,EAAE,EACxC,KAAK,wBAAwB,OAAOA,CAAc,EAGtE,EAAW,KAAK,QAAQ,wBAAwB,CAC3C,CACD,gBAAgBC,EAAS,OACrB,MAAMC,GAAYN,EAAAK,EAAQ,UAAR,YAAAL,EAAiB,GAEnC,GADAO,EAAaD,EAAW,0CAA0C,EAC9D,CAAC,KAAK,WAAW,IAAIA,CAAS,EAAG,CACjC,MAAMF,EAAiB,CACnB,GAAIE,EACJ,aAAc,EACd,WAAY,KAAK,IAAK,CACtC,EACY,KAAK,WAAW,IAAIA,EAAWF,CAAc,EAC7C,KAAK,wBAAwB,IAAIA,CAAc,CAClD,CACJ,CACD,yBAAyBC,EAAS,OAC9B,MAAMC,GAAYN,EAAAK,EAAQ,UAAR,YAAAL,EA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CAAE,EACT,CChCO,KAAM,CAACwkC,GAAkBC,EAAmB,EAAIngB,EAAqB,EAAE,ECD/DogB,EAAA,CACb,KAAM,oBACN,MAAO,CACL,QAAS,EACT,UAAW,GACX,SAAU,GACV,SAAU,GACV,KAAM,EACN,KAAM,EACN,OAAQ,GACR,OAAQ,GACR,OAAQ,GACR,OAAQ,GACR,OAAQ,EACT,EACD,UAAW,CACT,SAAU,CACR,KAAM,EACN,MAAO,GACP,KAAM,IACN,OAAQ,GACR,KAAM,IACN,MAAO,EACR,EACD,MAAO,CACL,KAAM,EACN,MAAO,IACP,KAAM,KACN,OAAQ,IACR,KAAM,KACN,MAAO,GACR,EACD,WAAY,CACV,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,mBAAoB,CAClB,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,eAAgB,CACd,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,SAAU,CACR,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,iBAAkB,CAChB,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,aAAc,CACZ,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,QAAS,CACP,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,gBAAiB,CACf,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,EACD,YAAa,CACX,eAAgB,2BAChB,MAAO,EACP,SAAU,GACX,CACF,EACD,MAAO,CACL,UACE,6ZACF,WACE,iZACF,iBACE,ylHACF,MACE,gZACH,EACD,MAAO,CACL,QAAS,CACP,UAAW,aACX,UAAW,aACX,UAAW,aACX,UAAW,aACX,UAAW,aACX,UAAW,aACX,UAAW,YACZ,EACD,MAAO,aACP,MAAO,aACP,KAAM,aACN,IAAK,aACL,OAAQ,aACR,OAAQ,aACR,MAAO,aACP,KAAM,aACN,OAAQ,aACR,SAAU,aACV,cAAe,aACf,QAAS,aACT,YAAa,aACb,qBAAsB,aACtB,oBAAqB,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EAC9B,EAED,MAAMxV,EAAM,GAEZ0N,SAEK1L,EAAI,CAAC9f,MAAO6pC,EAAQ7yB,SAAA,+DAAAwU,IAGpB2P,EAAG,CAACrd,MAAU9d,MAAOypC,EAAWvM,UAAgB,IAAAlmB,UAAA,CAAAwU,SAC9C6N,GAAM,CAACvb,IAAK,GAAI9d,MAAOwqC,EAAY,IAAAxzB,UAAA,CAAAwU,SACjCye,EAAK,CAACvE,UAAS,KAAAla,EACfye,EAAK,IAAAze,EACLye,EAAKze,MACLye,EAAKze,MACLye,EAAK,MAAAze,IAGP6N,GAAM,CAACvb,MAAU9d,MAAOwqC,EAActN,UAAgB,IAAAlmB,UAAA,CAAAwU,SACpDye,EAAK,CAACH,UAAW,IAAG,EAAAte,EACpBye,EAAKze,MACLye,EAAK,CAACH,UAAW,IAAG,EAAAte,EACpBye,EAAKze,MACLye,EAAK,MAAAze,IAGP6N,GAAM,CACLvb,MACA2oB,eAAgB,UAChBzmC,MAAOwqC,EACPtN,UAAgB,IAAAlmB,UAAA,QAAAwU,EAEfye,MAAKze,EACLye,EAAKze,MACLye,MAAKze,EACLye,EAAKze,MACLye,EAAK,MAAAze,IAGP6N,GAAM,CACLvb,MACA2oB,eAAgB,UAChBzmC,MAAOwqC,EACPtN,UAAgB,IAAAlmB,UAAA,QAAAwU,EAEfye,EAAKze,MACLye,EAAK,CAACF,aAAc,IAAGve,IACvBye,EAAKze,MACLye,EAAK,IAAAze,EACLye,EAAK,CAACF,aAAc,GAAG,KAAAve,IAGzB6N,GAAM,CACLvb,MACA2oB,eAAgB,SAChBzmC,MAAOwqC,EACPtN,UAAgB,IAAAlmB,UAAA,QAAAwU,EAEfye,MAAKze,EACLye,EAAKze,MACLye,MAAKze,EACLye,EAAKze,MACLye,EAAK,MAAAze,IAGP6N,GAAM,CACLvb,MACA2oB,eAAgB,eAChBzmC,MAAOwqC,EACPtN,UAAgB,IAAAlmB,UAAA,QAAAwU,EAEfye,MAAKze,EACLye,EAAKze,MACLye,MA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,OAAQ6C,UAAW4e,GAAQnb,IACrCgB,GAAK,CAACtH,KAAI,UAAW6C,UAAWwhB,GAAW/d,IAC3CgB,GAAK,CAACtH,KAAI,OAAQ6C,UAAW6hB,GAAQpe,IACrCgB,GAAK,CAACtH,KAAI,SAAU6C,UAAWkf,GAAUzb,IACzCgB,GAAK,CAACtH,KAAI,WAAY6C,UAAWsgB,GAAY7c,IAC7CgB,GAAK,CAACtH,KAAI,WAAY6C,UAAWqiB,GAAY5e,IAC7CgB,GAAK,CAACtH,KAAI,iBAAkB6C,UAAW6kB,GAAkBphB,IACzDgB,GAAK,CAACtH,KAAI,aAAc6C,UAAWwiB,GAAc/e,IACjDgB,GAAK,CAACtH,KAAI,kBAAmB6C,UAAW8kB,GAAmBrhB,IAC3DgB,GAAK,CAACtH,KAAI,oBAAqB6C,UAAWmkB,GAAM1gB,IAChDgB,GAAK,CAACtH,KAAI,mBAAoB6C,UAAWojB,GAAM3f,IAC/CgB,GAAK,CAACtH,KAAI,OAAQ6C,UAAWskB,EAAQ,MAEzC","names":["TextureUsageTracker","releaseCallback","__publicField","ManualCountTextureUsageTracker","options","_a","_b","now","thresholdMs","textureRefInfo","texture","textureId","assertTruthy","FinalizationRegistryTextureUsageTracker","stylePropertyMap","v","x","y","w","h","convertColorToRgba","color","a","b","g","r","domPropertyMap","Inspector","canvas","settings","isProductionEnvironment","_d","_c","_e","_f","rect","top","left","node","properties","div","key","driver","target","property","value","receiver","props","anim","parentId","parent","mappedStyleResponse","duration","delay","width","height","alpha","rotation","scale","animate","ShaderEffect","ref","uniformInfo","passParameters","declaredUniforms","uniforms","u","unif","uniType","uniformName","define","res","uni","trPropSetterDefaults","state","TextRenderer","stage","propSetters","setter","status","error","renderable","eventName","MAX_TEXTURE_DIMENSION","calcHeight","textBaseline","fontSize","lineHeight","numLines","offsetY","baselineOffset","LightningTextTextureRenderer","context","ff","ffs","i","n","fontSetting","err","renderInfo","precision","paddingLeft","paddingRight","wordWrapWidth","cutSx","cutEx","cutSy","cutEy","letterSpacing","textIndent","innerWidth","suffix","linesInfo","lines","usedLines","otherLines","al","j","m","maxLineWidth","lineWidths","lineWidth","linesOverride","linePositionX","linePositionY","drawLines","hlHeight","offset","hlPaddingLeft","hlPaddingRight","getRgbaString","drawLine","prevShadowSettings","textSplit","word","suffixWidth","wordLen","wordWidth","cutoffIndex","truncWordWidth","text","indent","allLines","realNewlines","resultLines","result","spaceLeft","words","wordWidthWithSpace","space","acc","char","resolvedGlobal","globalFontSet","getFontCssString","fontFamily","fontStyle","fontWeight","fontStretch","tmpElementBounds","createBound","CanvasTextRenderer","fontFace","WebTrFontFace","EventEmitter","cssString","maxLines","containedMaxLines","calcMaxLines","getNormalizedRgbaComponents","scrollY","contain","visibleWindow","renderWindow","canvasPages","elementBounds","intersectBound","visibleWindowHeight","maxLinesPerCanvasPage","renderWindowScreenX1","renderWindowScreenY1","renderWindowScreenX2","renderWindowScreenY2","pageHeight","page1Block","page1LineStart","page0LineStart","page2LineStart","scrollYNearestPage","pageInfo","transform","clippingRect","textW","textH","elementRect","intersectRect","pageSize","zIndex","combinedAlpha","getNormalizedAlphaComponent","quadColor","mergeColorAlphaPremultiplied","_h","_g","_j","_i","_l","_k","DefaultShader","WebGlCoreShader","renderer","textures","glw","DefaultShaderBatched","t","samplers","textureUnits","idx","effectCache","getResolvedEffect","effects","effectContructors","effect","_DynamicShader","shader","memize","regEffects","results","eff","index","fxClass","uniInfo","p","fxProp","propInfo","propsA","propsB","propsEffectsLen","effectA","effectB","effectNameCount","methods","declareUniforms","uFx","baseClass","nr","effectMethods","fx","fxProps","remap","cm","fxMethod","onShaderMask","onColorize","onEffectMask","reg","methodParameters","pm","sharedMethods","currentMask","drawEffects","current","currentClass","next","effectMethod","methodCollection","increment","DynamicShader","RoundedRectangle","IDENTITY_MATRIX_3x3","_SdfShader","resolvedProps","components","SdfShader","RadiusEffect","BorderEffect","rgba","_LinearGradientEffect","colors","stops","colorsL","tmp","rgbas","val","amount","loop","LinearGradientEffect","GrayscaleEffect","BorderRightEffect","BorderTopEffect","BorderBottomEffect","BorderLeftEffect","GlitchEffect","FadeOutEffect","_RadialGradientEffect","RadialGradientEffect","RadialProgressEffect","HolePunchEffect","CoreShaderManager","shType","shClass","effectType","effectClass","ShaderClass","cacheKey","ContextSpy","name","isCompressedTextureContainer","url","loadCompressedTexture","arrayBuffer","loadKTXData","loadPVRData","buffer","view","littleEndian","mipmaps","data","imageSize","header","dataOffset","pvrtcData","level","_ImageTexture","Texture","txManager","mimeType","src","premultiplyAlpha","blob","hasAlphaChannel","img","resolve","reject","e","ImageTexture","FLOATS_PER_GLYPH","getStartConditions","sdfFontSize","sdfLineHeight","verticalAlign","fontSizeRatio","lineCache","startLineIndex","sdfStartX","sdfVerticalAlignYOffset","sdfStartY","PeekableIterator","iterator","indexBase","nextResult","getUnicodeCodepoints","start","codePoint","measureText","shaperProps","shaper","glyphs","glyph","layoutText","curLineIndex","startX","startY","textAlign","vertexBuffer","rwSdf","trFontFace","forceFullLayoutCalc","scrollable","overflowSuffix","vertexLineHeight","vertexW","vertexLSpacing","startingLineCacheEntry","startingCodepointIndex","startingMaxX","startingMaxY","maxX","maxY","curX","curY","bufferOffset","lastWord","glyphResult","curLineBufferStart","bufferLineInfos","vertexTruncateHeight","overflowSuffVertexWidth","moreLines","nextLineWillFit","lineVertexW","xStartLastWordBoundary","lineIsBelowWindowTop","lineIsAboveWindowBottom","lineIsWithinWindow","charEndX","quadX","quadY","atlasEntry","uvWidth","uvHeight","vertexTextW","line","xOffset","roundUpToMultiple","multiple","roundDownToMultiple","setRenderWindow","outRenderWindow","bufferMargin","screen","sdf","isBoundPositive","x1","x2","y1Base","y1","y2","weightConversions","fontWeightToNumber","weight","rawResolveFontToUse","familyMapsByPriority","family","weightIn","style","stretch","fontFamiles","fontFaces","weightMap","fontFamilyWeight","msg","resolveFontToUse","TrFontManager","textRenderers","font","trId","tr","tmpRect","SdfTextRenderer","boundsOverlap","SdfTrFontFace","familyName","faceSet","debugData","neededLength","rwScreen","out2","debug","distanceRange","bufferUploaded","webGlBuffers","stride","webGlBuffer","BufferCollection","convertBoundToRect","copyRect","renderOp","WebGlCoreRenderOp","mergeColorAlpha","ctxTexture","classExtendsCoreExtension","Class","CoreExtension","loadCoreExtension","coreExtensionModule","module","__vitePreload","ExtensionClass","coreExtension","santizeCustomDataMap","d","validTypes","keys","valueType","RendererMain","resolvedSettings","appWidth","appHeight","deviceLogicalPixelRatio","devicePhysicalPixelRatio","enableInspector","useFinalizationRegistryTracker","deviceLogicalWidth","deviceLogicalHeight","targetEl","fpsData","frameTickData","_m","_n","_o","_p","_q","_r","_s","colorTl","colorTr","colorBl","colorBr","_t","_u","_v","_w","_x","_y","_z","_A","_B","_C","_D","_E","_F","_H","_G","_J","_I","_K","_M","_L","_O","_N","_P","_R","_Q","_T","_S","_U","textureType","id","desc","shaderType","CoreAnimation","propName","getTimingFunction","startValue","endValue","s","dt","easing","stopMethod","propValue","easingProgressValue","easingColorValue","mergeColorProgress","CoreAnimationController","manager","animation","promise","m0","m1","m2","m3","m4","m5","m6","m7","m8","Matrix3d","entries","tempMatrix","out","e0","e1","e2","e3","e4","e5","e6","e7","e8","sx","sy","angle","cos","sin","dst","transpose","other","rx1","rx2","rx3","rx4","ry1","ry2","ry3","ry4","RenderCoords","x3","y3","x4","y4","CoreNodeRenderState","CoreNodeRenderStateMap","UpdateType","CoreNode","dimensions","shManager","type","pivotTranslateX","pivotTranslateY","mountTranslateX","mountTranslateY","delta","parentClippingRect","childUpdateType","child","rectW","rectH","renderM","boundInsideBound","renderState","previous","event","newIsRenderable","isRenderable","tx","ty","ta","tb","tc","td","minX","minY","renderCoords","gt","clipping","isRotated","z","textureOptions","shaderProps","premultipliedColorTl","premultipliedColorTr","premultipliedColorBl","premultipliedColorBr","worldAlpha","newParent","oldParent","nextId","getNewId","MainOnlyNode","rendererMain","coreNode","payload","imageUrl","startLoop","isIdle","runLoop","getTimeStamp","AnimationManager","ImageWorkerManager","numImageWorkers","worker","numWorkers","workerCode","blobURL","workers","absoluteSrcUrl","_NoiseTexture","size","pixelData8","NoiseTexture","CoreTextureManager","ColorTexture","SubTexture","textureClass","TextureClass","descId","textureDescId","textureIdCache","textureRefCountMap","refCountObj","textureSource","TextureMemoryManager","byteThreshold","byteSize","bufferMemory","Stage","clearColor","rootId","boundsMargin","enableContextSpy","txMemByteThreshold","bm","debugInfo","WebGlCoreRenderer","rootNode","animationManager","renderRequested","fpsUpdateInterval","fps","trProps","textRendererOverride","rendererId","overrideFallback","possibleRenderer","resolvedTextRenderer","CoreTextNode","setWidth","setHeight","calcWidth","textRendererState","MainOnlyTextNode","MainCoreDriver","rendererSettings","equalFn","$PROXY","$TRACK","signalOptions","runEffects","runQueue","STALE","PENDING","UNOWNED","NO_INIT","Owner","Transition","ExternalSourceConfig","Listener","Updates","Effects","ExecCount","createRoot","fn","detachedOwner","listener","owner","unowned","root","updateFn","untrack","cleanNode","runUpdates","createSignal","writeSignal","readSignal","createComputed","c","createComputation","updateComputation","createRenderEffect","createEffect","runUserEffects","createMemo","isPromise","createResource","pSource","pFetcher","pOptions","source","fetcher","pr","initP","scheduled","resolved","dynamic","contexts","setValue","setError","track","trigger","setState","loadEnd","completeLoad","read","SuspenseContext","load","refetching","lookup","castError","createSelector","subs","l","onCleanup","batch","on","deps","isArray","prevInput","defer","prevValue","input","onMount","getOwner","runWithOwner","o","prev","prevListener","handleError","startTransition","createContext","defaultValue","createProvider","useContext","children","memo","resolveChildren","updates","lookUpstream","sSlot","isComp","TransitionRunning","markDownstream","time","runComputation","nextValue","init","pure","runTop","ancestors","wait","completeUpdates","queue","userLength","ignore","obs","FALLBACK","dispose","mapArray","list","mapFn","items","mapped","disposers","len","indexes","newItems","newLen","newIndices","newIndicesNext","temp","tempdisposers","tempIndexes","end","newEnd","item","disposer","mapper","set","createComponent","Comp","trueFn","propTraps","_","resolveSource","resolveSources","length","mergeProps","sources","proxy","sourcesMap","defined","sourceKeys","definedKeys","splitProps","blocked","k","otherObject","objects","isDefaultDesc","objectIndex","narrowedError","For","fallback","Show","keyed","condition","DEV","createShader","startLightningRenderer","Children","beforeNode","nodeIndexToRemove","isDevEnv","isDev","config","hasDebug","isObject","log","args","isFunc","isString","isNumber","isInteger","keyExists","obj","flattenStyles","States","callback","initialState","__super","_key","stateIndexToRemove","calculateFlex","numChildren","isRow","dimension","crossDimension","marginOne","marginTwo","prop","crossProp","containerSize","containerCrossSize","gap","justify","align","itemSize","crossAlignChild","calculatedSize","toPad","activeElement","setActiveElement","defaultAnimationSettings","convertEffectsToShader","styleEffects","borderAccessor","direction","LightningRendererNumberProps","LightningRendererNonAnimatingProps","ElementNode","animationSettings","focusedIndex","_node","loadedPayload","events","values","found","states","stylesToUndo","styleKey","newStyles","styles","handler","inode","radius","Text","_el$","_$createElement","View","createRenderer$1","createElement","createTextNode","isTextNode","replaceText","insertNode","removeNode","setProperty","getParentNode","getFirstChild","getNextSibling","insert","accessor","marker","initial","insertExpression","unwrapArray","multi","cleanChildren","array","normalizeIncomingArray","replacement","appendNodes","reconcileArrays","replaceNode","normalized","unwrap","parentNode","bLength","aEnd","bEnd","aStart","bStart","after","map","sequence","removed","inserted","el","isParent","newNode","oldNode","spreadExpression","prevProps","skipChildren","code","element","arg","createRenderer","universalLightning","anchor","solidRenderer","render","spread","setProp","use","hexColor","$$EVENTS","delegateEvents","eventNames","document","eventHandler","isServer","createBeforeLeave","listeners","subscribe","confirm","to","force","depth","saveCurrentDepth","keepDepth","notifyIfNotBlocked","notify","block","prevDepth","hasSchemeRegex","trimPathRegex","mockBase","normalizePath","path","omitSlash","resolvePath","base","from","basePath","fromPath","invariant","message","joinPaths","extractSearchParams","params","createMatcher","partial","matchFilters","pattern","splat","segments","location","locSegments","lenDiff","match","matchFilter","segment","locSegment","matchSegment","remainder","filter","isEqual","scoreRoute","route","score","createMemoObject","expandOptionals","prefix","prefixes","expansion","MAX_REDIRECTS","RouterContextObj","RouteContextObj","useRouter","useNavigate","useParams","createRoutes","routeDef","component","info","isLeaf","shared","asArray","originalPath","createBranch","routes","matches","createBranches","stack","branches","routeDefs","def","isEmptyArray","branch","getRouteMatches","createLocation","origin","path_","pathname","search","hash","intent","createRouterContext","integration","getContext","setSource","utils","parsePath","renderPath","beforeLeave","isRouting","setIsRouting","reference","setReference","referrers","submissions","baseRoute","navigatorFactory","preloadRoute","navigateFromRoute","replace","scroll","nextState","resolvedTo","navigateEnd","first","preloadData","prevIntent","createRouteContext","router","outlet","createRouterComponent","routerState","singleFlight","create","_$createComponent","Provider","Root","rootLoad","_$memo","Routes","when","routeStates","nextMatches","prevMatches","equal","prevMatch","nextMatch","createOutlet","splice","forEach","Route","childRoutes","intercept","get","querySelector","selector","createRouter","wrap","signal","bindEvent","scrollToHash","fallbackTop","actions","setupNativeEvents","preload","explicitLinks","actionBase","preloadTimeout","isSvg","handleAnchor","evt","svg","href","rel","handleAnchorClick","handleAnchorPreload","handleAnchorIn","handleAnchorOut","handleFormSubmit","actionRef","hashParser","str","HashRouter","getSource","hashIndex","tryOnCleanup","makeEventListener","createSingletonRoot","factory","disposeRoot","useKeyDownEvent","setEvent","keyMapEntries","focusPath","setFocusPath","useFocusManager","userKeyMap","keypressEvent","currentFocusedElm","prevFocusedElm","prevFocusPath","fp","elm","mappedKeyEvent","finalFocusElm","onKeyHandler","withPadding","padding","pad","right","bottom","firstChild","maxHeight","flattenStrings","series","flattenedSeries","pause","speak","phrase","utterances","lang","synth","utterance","speakSeries","remainingPhrases","nestedSeriesResults","active","retriesLeft","seriesResult","toSpeak","currentSeries","SpeechEngine","debounce","timeoutId","clear","resetFocusPathTimer","currentlySpeaking","voiceOutDisabled","fiveMinutes","debounceWithFlush","scopedValue","debounced","newValue","getElmName","onFocusChangeCore","Announcer","loaded","focusDiff","toAnnounceText","toAnnounce","textToSpeech","append","notification","focusDebounce","focusChangeTimeout","useAnnouncer","createSpriteMap","subTextures","spriteMapTexture","globalBackground","setGlobalBackground","theme","Background","bg1","bg2","heroMask","bgStyles","changeBackgrounds","startsWith","delayedBackgrounds","r$","_ref$","_ref$2","_ref$3","materialBrand","defaultModeKeys","defaultToneKeys","makeComponentStyles","themeKeys","modes","tones","themeStyles2","modeKeys","toneKeys","makeToneStyles","tones2","themeComponentStyles","modeStyles","toneStyles","tone","styles2","_a2","_b2","mode","makeModeStyles","modes2","makeBaseStyles","base2","mapThemeKeysToSolid","stylesToMap","themeKey","solidKey","convertComponentConfig","themeStyles3","variantName","convertedStyles","styleName","modeName","baseStyles","withScrolling","adjustment","componentRef","selectedElement","selected","lastSelected","lastItem","windowVal","updateLastIndex","currentVal","newVal","size2","direct","chainFunctions","onlyFunctions","func","innerArgs","onGridFocus","handleNavigation","num","defaultTone$e","themeStyles$d","container$e","defaultTone$d","themeStyles$c","container$d","defaultTone$c","themeStyles$b","container$c","text$6","icon$2","defaultTone$b","themeStyles$a","container$b","content","text$5","defaultTone$a","themeStyles$9","strokeWidth","container$a","icon$1","defaultTone$9","themeStyles$8","container$9","Container$9","styles$9","Column","onUp","onDown","defaultTone$8","themeStyles$7","container$8","text$4","themeStyles$6","defaultTone$7","container$7","text$3","icon","defaultTone$6","themeStyles$5","container$6","text$2","defaultTone$5","themeStyles$4","container$5","titleText","descriptionText","defaultTone$4","themeStyles$3","container$4","progress","defaultTone$3","themeStyles$2","container$3","Container$3","styles$3","Row","onLeft","onRight","defaultTone$2","themeStyles$1","container$2","text$1","defaultTone$1","themeStyles","container$1","defaultTone","tileThemeStyles","defaultSurfaceTone","surfaceThemeStyles","container","insetBottom","standardBottom","logoContainer","styles$1","import","icons","Icon","sprite","_$mergeProps","NavButton","forwardStates","typography","button1","NavDrawer","backdrop","navigate","onFocus","add","setFocus","onBlur","remove","onEnter","Gradient","fpsStyle","fpsLabel","textColor","fpsValue","setFps","avgFps","setAvgFps","minFps","setMinFps","maxFps","setMaxFps","count","totalFps","resetCounter","calcFps","Math","min","max","round","setupFPS","FPSCounter","toString","App","Menu","Escape","announcer","enabled","focusRingRef","navDrawer","lastFocused","onAnnouncer","onLast","history","back","onMenu","has","Button","TopBar","ButtonText","buttonStyles","MaterialButton","MaterialButtonText","Thumbnail","TileRow","local","others","each","API_KEY_V4","API_BASE","tmdbConfig","baseImageUrl","basePosterSize","defaultFetchParams","getImageUrl","posterSize","_get","loadConfig","api","truncateString","maxLength","chunkArray","convertItemsToTiles","cache","leftoverTiles","browseProvider","pageIndex","trending","tiles","chunks","createInfiniteScroll","pages","setPages","page","setPage","setEnd","contents","blockWidth","HeadlineStyles","display2","Headline","DescriptionStyles","body1","BadgeStyle","Description","getReviews","reviews","rtCrit","title","marginRight","MetaTextStyle","rtFan","Badge","borderRadius","border","body2","Metadata","display","flexDirection","metaText","badges","ContentBlock","description","minutesToHMM","minutes","hours","remainingMinutes","justYear","dateString","getRecommendations","getCredits","cast","getInfo","rt","Browse","columnY","setcolumnY","entityInfo","setEntityInfo","entityProvider","heroContent","setHeroContent","isFirst","provider","onRowFocus","numPages","entity","itemsContainer","plinko","announce","autofocus","Portal","demos","DemoTile","Container","transition","focus","setColor","rowX","setRowX","moveRow","row","colorTop","colorBottom","onSelectedChanged","justifyContent","demo","TextPage","OverviewContainer","SublineContainer","Title","Overview","Subline","CreatePage","myBox","childRef","insertTest","setInsertTest","emptyTest","setEmptyTest","setTimeout","getChildById","styleChild","someOtherStyle","ChildTest","borderStyles","borderLeft","borderTop","borderRight","borderBottom","childTestPassedStyles","childTestPassedStyles2","hasFocus","ViewportPage","ball","invervalTimer","ballStatus","setBallStatus","styleBall","mount","lineheight","randomIntBetween","floor","random","setInterval","logEvent","slice","console","clearInterval","join","onEvents","ButtonsPage","toggle","RowStyles","_$use","disabled","FlexPage","rowTitle","marginTop","marginBottom","skipFocus","Block","setColumnY","marginLeft","FlexSizePage","randSize","alignItems","FlexColumnPage","ColumnStyles","MaterialButtonsPage","manifestUri","initApp","initPlayer","video","player","onErrorEvent","onError","playVideo","closeVideo","Entity","credits","recommendations","backdropAlpha","setBackdropAlpha","backgroundImage","Backdrop","columnRef","backdropRef","onRowFocusAnimate","onEscape","getElementsByTagName","trailerButton","onEnterTrailer","RowTitle","People","peopleBio","biography","NotFound","_$setProp","coreExtensionModuleUrl","Config","animationsEnabled","fontSettings","rendererOptions","FlexColumnSizePage","ButtonsMaterialPage"],"ignoreList":[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,69,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,95,97],"sources":["../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/main-api/texture-usage-trackers/TextureUsageTracker.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/main-api/texture-usage-trackers/ManualCountTextureUsageTracker.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/main-api/texture-usage-trackers/FinalizationRegistryTextureUsageTracker.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/main-api/Inspector.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/ShaderEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/TextRenderer.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/LightningTextTextureRenderer.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/CanvasTextRenderer.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/DefaultShader.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/DefaultShaderBatched.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/DynamicShader.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/RoundedRectangle.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/SdfShader.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/RadiusEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/BorderEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/LinearGradientEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/GrayscaleEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/BorderRightEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/BorderTopEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/BorderBottomEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/BorderLeftEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/GlitchEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/FadeOutEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/RadialGradientEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/RadialProgressEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/HolePunchEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/CoreShaderManager.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/lib/ContextSpy.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/lib/textureCompression.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/textures/ImageTexture.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/constants.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/getStartConditions.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/PeekableGenerator.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/getUnicodeCodepoints.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/measureText.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/layoutText.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/util.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/setRenderWindow.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/TrFontManager.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/SdfTextRenderer.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/render-drivers/utils.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/main-api/RendererMain.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/animations/CoreAnimation.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/animations/CoreAnimationController.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/lib/Matrix3d.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/lib/RenderCoords.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/CoreNode.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/render-drivers/main/MainOnlyNode.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/platform.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/animations/AnimationManager.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/lib/ImageWorker.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/textures/NoiseTexture.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/CoreTextureManager.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/TextureMemoryManager.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/Stage.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/CoreTextNode.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/render-drivers/main/MainOnlyTextNode.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/render-drivers/main/MainCoreDriver.js","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/dist/solid.js","../../../../../solid/src/core/lightningInit.ts","../../../../../solid/src/core/node/children.ts","../../../../../solid/src/config.ts","../../../../../solid/src/core/utils.ts","../../../../../solid/src/core/node/states.ts","../../../../../solid/src/core/flex.ts","../../../../../solid/src/core/activeElement.ts","../../../../../solid/src/core/node/index.ts","../../../../../solid/src/components/Text.tsx","../../../../../solid/src/components/View.tsx","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/universal/dist/universal.js","../../../../../solid/src/core/solidUniversal.ts","../../../../../solid/src/core/render.ts","../../../../../solid/src/utils.ts","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/web/dist/web.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/lifecycle.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/utils.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routing.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/components.jsx","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/createRouter.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/data/action.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/data/events.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/HashRouter.js","../../../../node_modules/.pnpm/@solid-primitives+utils@6.2.3_solid-js@1.8.16/node_modules/@solid-primitives/utils/dist/chunk/R5675YMU.js","../../../../node_modules/.pnpm/@solid-primitives+event-listener@2.3.3_solid-js@1.8.16/node_modules/@solid-primitives/event-listener/dist/index.js","../../../../node_modules/.pnpm/@solid-primitives+rootless@1.4.5_solid-js@1.8.16/node_modules/@solid-primitives/rootless/dist/index.js","../../../../node_modules/.pnpm/@solid-primitives+keyboard@1.2.8_solid-js@1.8.16/node_modules/@solid-primitives/keyboard/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/utils.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/useFocusManager.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/withPadding.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/speech.js","../../../../node_modules/.pnpm/@solid-primitives+scheduled@1.4.3_solid-js@1.8.16/node_modules/@solid-primitives/scheduled/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/announcer.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/createSpriteMap.js","../../src/state.ts","../../../../node_modules/.pnpm/@lightningjs+l3-ui-theme-base@0.3.1/node_modules/@lightningjs/l3-ui-theme-base/theme.js","../../src/components/Background.tsx","../../../../node_modules/.pnpm/@lightningjs+solid-ui@0.6.0_@babel+core@7.24.3_@lightningjs+renderer@0.8.2_@lightningjs+solid_sggciuifiwrrln27zkml3bpb3u/node_modules/@lightningjs/solid-ui/dist/index.js","../../src/components/NavDrawer/NavDrawer.styles.ts","../../src/components/Icon.tsx","../../src/components/NavDrawer/NavDrawer.tsx","../../src/components/FPSCounter.tsx","../../src/pages/App.tsx","../../src/styles.ts","../../src/components/index.tsx","../../src/api/key.ts","../../src/api/index.ts","../../src/api/formatters/ItemFormatter.ts","../../src/api/providers/browse.ts","../../src/components/pagination.ts","../../src/components/ContentBlock.tsx","../../src/api/providers/entity.js","../../src/pages/Browse.tsx","../../src/pages/Portal.tsx","../../src/pages/Text.tsx","../../src/pages/Create.tsx","../../src/pages/Viewport.tsx","../../src/pages/Buttons.tsx","../../src/pages/Flex.tsx","../../src/pages/FlexSize.tsx","../../src/pages/FlexColumnSize.tsx","../../src/pages/FlexColumn.tsx","../../src/pages/ButtonsMaterial.tsx","../../src/video.js","../../src/pages/Entity.tsx","../../src/api/providers/people.js","../../src/pages/People.tsx","../../src/pages/NotFound.tsx","../../AppCoreExtensions.js?importChunkUrl","../../src/index.tsx"],"sourcesContent":["/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Texture Usage Tracker for Usage Based Texture Garbage Collection\n */\nexport class TextureUsageTracker {\n releaseCallback;\n constructor(releaseCallback) {\n this.releaseCallback = releaseCallback;\n }\n}\n//# sourceMappingURL=TextureUsageTracker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { TextureUsageTracker } from './TextureUsageTracker.js';\n/**\n * Usage-based Texture Garbage Collection Registry\n */\nexport class ManualCountTextureUsageTracker extends TextureUsageTracker {\n textureMap = new Map();\n zeroReferenceTextureSet = new Set();\n options;\n constructor(releaseCallback, options) {\n super(releaseCallback);\n this.options = {\n textureCleanupIntervalMs: options.textureCleanupIntervalMs ?? 10000,\n textureCleanupAgeThreadholdMs: options.textureCleanupAgeThreadholdMs ?? 60000,\n };\n // Periodically check for textures that are no longer referenced by any\n // Nodes and notify RendererMain to release them.\n setInterval(() => {\n const now = Date.now();\n const thresholdMs = this.options.textureCleanupAgeThreadholdMs;\n for (const textureRefInfo of this.zeroReferenceTextureSet) {\n if (now - textureRefInfo.lastUpdate > thresholdMs) {\n this.releaseCallback(textureRefInfo.id);\n this.textureMap.delete(textureRefInfo.id);\n this.zeroReferenceTextureSet.delete(textureRefInfo);\n }\n }\n }, this.options.textureCleanupIntervalMs);\n }\n registerTexture(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n if (!this.textureMap.has(textureId)) {\n const textureRefInfo = {\n id: textureId,\n nodeRefCount: 0,\n lastUpdate: Date.now(),\n };\n this.textureMap.set(textureId, textureRefInfo);\n this.zeroReferenceTextureSet.add(textureRefInfo);\n }\n }\n incrementTextureRefCount(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n let textureRefInfo = this.textureMap.get(textureId);\n if (!textureRefInfo) {\n // Texture has not been registered yet, so register it now.\n // This may happen if the TextureRef was cleaned up from the registry\n // but was still alive in memory and eventually re-used.\n this.registerTexture(texture);\n textureRefInfo = this.textureMap.get(textureId);\n }\n assertTruthy(textureRefInfo, 'Texture must have been registered');\n if (texture.txType === 'SubTexture') {\n // If this is a SubTexture, then increment the reference count of the\n // parent texture as well.\n this.incrementTextureRefCount(texture.props.texture);\n }\n textureRefInfo.nodeRefCount++;\n textureRefInfo.lastUpdate = Date.now();\n if (this.zeroReferenceTextureSet.has(textureRefInfo)) {\n this.zeroReferenceTextureSet.delete(textureRefInfo);\n }\n }\n decrementTextureRefCount(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n const textureRefInfo = this.textureMap.get(textureId);\n assertTruthy(textureRefInfo, 'Texture must have been registered');\n textureRefInfo.nodeRefCount--;\n textureRefInfo.lastUpdate = Date.now();\n if (textureRefInfo.nodeRefCount === 0) {\n this.zeroReferenceTextureSet.add(textureRefInfo);\n }\n if (texture.txType === 'SubTexture') {\n // If this is a SubTexture, then decrement the reference count of the\n // parent texture as well.\n this.decrementTextureRefCount(texture.props.texture);\n }\n }\n}\n//# sourceMappingURL=ManualCountTextureUsageTracker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { TextureUsageTracker } from './TextureUsageTracker.js';\nexport class FinalizationRegistryTextureUsageTracker extends TextureUsageTracker {\n registry;\n constructor(releaseCallback) {\n super(releaseCallback);\n this.registry = new FinalizationRegistry(releaseCallback);\n }\n registerTexture(texture) {\n assertTruthy(texture.options?.id, 'Texture must have an ID to be registered');\n this.registry.register(texture, texture.options?.id);\n }\n incrementTextureRefCount() {\n // No-op for FinalizationRegistry\n }\n decrementTextureRefCount() {\n // No-op for FinalizationRegistry\n }\n}\n//# sourceMappingURL=FinalizationRegistryTextureUsageTracker.js.map","import {} from './RendererMain.js';\nimport { isProductionEnvironment } from '../utils.js';\nconst stylePropertyMap = {\n alpha: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'opacity', value: `${v}` };\n },\n x: (x) => {\n return { prop: 'left', value: `${x}px` };\n },\n y: (y) => {\n return { prop: 'top', value: `${y}px` };\n },\n width: (w) => {\n if (w === 0) {\n return null;\n }\n return { prop: 'width', value: `${w}px` };\n },\n height: (h) => {\n if (h === 0) {\n return null;\n }\n return { prop: 'height', value: `${h}px` };\n },\n zIndex: () => 'zIndex',\n fontFamily: () => 'font-family',\n fontSize: () => 'font-size',\n fontStyle: () => 'font-style',\n fontWeight: () => 'font-weight',\n fontStretch: () => 'font-stretch',\n lineHeight: () => 'line-height',\n letterSpacing: () => 'letter-spacing',\n textAlign: () => 'text-align',\n overflowSuffix: () => 'overflow-suffix',\n maxLines: () => 'max-lines',\n contain: () => 'contain',\n verticalAlign: () => 'vertical-align',\n clipping: (v) => {\n if (v === false) {\n return null;\n }\n return { prop: 'overflow', value: v ? 'hidden' : 'visible' };\n },\n rotation: (v) => {\n if (v === 0) {\n return null;\n }\n return { prop: 'transform', value: `rotate(${v}rad)` };\n },\n scale: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scale(${v})` };\n },\n scaleX: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scaleX(${v})` };\n },\n scaleY: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scaleY(${v})` };\n },\n color: (v) => {\n if (v === 0) {\n return null;\n }\n return { prop: 'color', value: convertColorToRgba(v) };\n },\n};\nconst convertColorToRgba = (color) => {\n const a = (color & 0xff) / 255;\n const b = (color >> 8) & 0xff;\n const g = (color >> 16) & 0xff;\n const r = (color >> 24) & 0xff;\n return `rgba(${r},${g},${b},${a})`;\n};\nconst domPropertyMap = {\n id: 'id',\n};\nconst gradientColorPropertyMap = [\n 'colorTop',\n 'colorBottom',\n 'colorLeft',\n 'colorRight',\n 'colorTl',\n 'colorTr',\n 'colorBl',\n 'colorBr',\n];\nexport class Inspector {\n root = null;\n canvas = null;\n height = 1080;\n width = 1920;\n scaleX = 1;\n scaleY = 1;\n constructor(canvas, settings) {\n if (isProductionEnvironment())\n return;\n if (!settings) {\n throw new Error('settings is required');\n }\n // calc dimensions based on the devicePixelRatio\n this.height = Math.ceil(settings.appHeight ?? 1080 / (settings.deviceLogicalPixelRatio ?? 1));\n this.width = Math.ceil(settings.appWidth ?? 1900 / (settings.deviceLogicalPixelRatio ?? 1));\n this.scaleX = settings.deviceLogicalPixelRatio ?? 1;\n this.scaleY = settings.deviceLogicalPixelRatio ?? 1;\n this.canvas = canvas;\n this.root = document.createElement('div');\n this.setRootPosition();\n document.body.appendChild(this.root);\n //listen for changes on canvas\n const mutationObserver = new MutationObserver(this.setRootPosition.bind(this));\n mutationObserver.observe(canvas, {\n attributes: true,\n childList: false,\n subtree: false,\n });\n // Create a ResizeObserver to watch for changes in the element's size\n const resizeObserver = new ResizeObserver(this.setRootPosition.bind(this));\n resizeObserver.observe(canvas);\n //listen for changes on window\n window.addEventListener('resize', this.setRootPosition.bind(this));\n console.warn('Inspector is enabled, this will impact performance');\n }\n setRootPosition() {\n if (this.root === null || this.canvas === null) {\n return;\n }\n // get the world position of the canvas object, so we can match the inspector to it\n const rect = this.canvas.getBoundingClientRect();\n const top = document.documentElement.scrollTop + rect.top;\n const left = document.documentElement.scrollLeft + rect.left;\n this.root.id = 'root';\n this.root.style.left = `${left}px`;\n this.root.style.top = `${top}px`;\n this.root.style.width = `${this.width}px`;\n this.root.style.height = `${this.height}px`;\n this.root.style.position = 'absolute';\n this.root.style.transformOrigin = '0 0 0';\n this.root.style.transform = `scale(${this.scaleX}, ${this.scaleY})`;\n this.root.style.overflow = 'hidden';\n this.root.style.zIndex = '65534';\n }\n createDiv(node, properties) {\n const div = document.createElement('div');\n div.style.position = 'absolute';\n div.id = node.id.toString();\n // set initial properties\n for (const key in properties) {\n this.updateNodeProperty(div, \n // really typescript? really?\n key, properties[key]);\n }\n return div;\n }\n createNode(driver, properties) {\n const node = driver.createNode(properties);\n const div = this.createDiv(node, properties);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n div.node = node;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n node.div = div;\n return this.createProxy(node, div);\n }\n createTextNode(driver, properties) {\n const node = driver.createTextNode(properties);\n const div = this.createDiv(node, properties);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n div.node = node;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n node.div = div;\n return this.createProxy(node, div);\n }\n createProxy(node, div) {\n return new Proxy(node, {\n set: (target, property, value) => {\n this.updateNodeProperty(div, property, value);\n return Reflect.set(target, property, value);\n },\n get: (target, property, receiver) => {\n if (property === 'destroy') {\n this.destroyNode(target);\n }\n if (property === 'animate') {\n return (props, settings) => {\n const anim = target.animate(props, settings);\n // Trap the animate start function so we can update the inspector accordingly\n return new Proxy(anim, {\n get: (target, property, receiver) => {\n if (property === 'start') {\n this.animateNode(div, node, props, settings);\n }\n return Reflect.get(target, property, receiver);\n },\n });\n };\n }\n return Reflect.get(target, property, receiver);\n },\n });\n }\n destroyNode(node) {\n const div = document.getElementById(node.id.toString());\n div?.remove();\n }\n updateNodeProperty(div, property, \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value) {\n if (this.root === null || value === undefined || value === null) {\n return;\n }\n /**\n * Special case for parent property\n */\n if (property === 'parent') {\n const parentId = value.id;\n // only way to detect if the parent is the root node\n // if you are reading this and have a better way, please let me know\n if (parentId === 1) {\n this.root.appendChild(div);\n return;\n }\n const parent = document.getElementById(parentId.toString());\n parent?.appendChild(div);\n return;\n }\n // special case for text\n if (property === 'text') {\n div.innerHTML = String(value);\n // hide text because we can't render SDF fonts\n // it would look weird and obstruct the WebGL rendering\n div.style.visibility = 'hidden';\n return;\n }\n // special case for images\n // we're not setting any CSS properties to avoid images getting loaded twice\n // as the renderer will handle the loading of the image. Setting it to `data-src`\n if (property === 'src' && value) {\n div.setAttribute(`data-src`, String(value));\n return;\n }\n // special case for color gradients (normal colors are handled by the stylePropertyMap)\n // FIXME the renderer seems to return the same number for all colors\n // if (gradientColorPropertyMap.includes(property as string)) {\n // const color = convertColorToRgba(value as number);\n // div.setAttribute(`data-${property}`, color);\n // return;\n // }\n // CSS mappable attribute\n if (stylePropertyMap[property]) {\n const mappedStyleResponse = stylePropertyMap[property]?.(value);\n if (mappedStyleResponse === null) {\n return;\n }\n if (typeof mappedStyleResponse === 'string') {\n div.style.setProperty(mappedStyleResponse, String(value));\n return;\n }\n if (typeof mappedStyleResponse === 'object') {\n div.style.setProperty(mappedStyleResponse.prop, mappedStyleResponse.value);\n }\n return;\n }\n // DOM properties\n if (domPropertyMap[property]) {\n div.setAttribute(String(stylePropertyMap[property]), String(value));\n return;\n }\n // custom data properties\n if (property === 'data') {\n for (const key in value) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n div.setAttribute(`data-${key}`, String(value[key]));\n }\n return;\n }\n }\n // simple animation handler\n animateNode(div, node, props, settings) {\n const { duration = 1000, delay = 0,\n // easing = 'linear',\n // repeat = 0,\n // loop = false,\n // stopMethod = false,\n } = settings;\n const { x, y, width, height, alpha = 1, rotation = 0, scale = 1, color, } = props;\n // ignoring loops and repeats for now, as that might be a bit too much for the inspector\n function animate() {\n setTimeout(() => {\n div.style.top = `${y}px`;\n div.style.left = `${x}px`;\n div.style.width = `${width}px`;\n div.style.height = `${height}px`;\n div.style.opacity = `${alpha}`;\n div.style.rotate = `${rotation}rad`;\n div.style.scale = `${scale}`;\n div.style.color = convertColorToRgba(color);\n }, duration);\n }\n setTimeout(animate, delay);\n }\n}\n//# sourceMappingURL=Inspector.js.map","export class ShaderEffect {\n priority = 1;\n name = '';\n ref;\n target;\n passParameters = '';\n declaredUniforms = '';\n uniformInfo = {};\n static uniforms = {};\n static methods;\n static onShaderMask;\n static onColorize;\n static onEffectMask;\n static getEffectKey(props) {\n return '';\n }\n static getMethodParameters(uniforms, props) {\n const res = [];\n for (const u in uniforms) {\n const uni = uniforms[u];\n let define = '';\n if (uni.size) {\n define = `[${uni.size(props)}]`;\n }\n res.push(`${uni.type} ${u}${define}`);\n }\n return res.join(',');\n }\n constructor(options) {\n const { ref, target, props = {} } = options;\n this.ref = ref;\n this.target = target;\n const uniformInfo = {};\n const passParameters = [];\n let declaredUniforms = '';\n const uniforms = this.constructor.uniforms || {};\n for (const u in uniforms) {\n const unif = uniforms[u];\n const uniType = unif.type;\n //make unique uniform name\n const uniformName = `${ref}_${u}`;\n let define = '';\n if (unif.size) {\n define = `[${unif.size(props)}]`;\n }\n passParameters.push(uniformName);\n declaredUniforms += `uniform ${uniType} ${uniformName}${define};`;\n uniformInfo[u] = { name: uniformName, uniform: uniforms[u].method };\n }\n this.passParameters = passParameters.join(',');\n this.declaredUniforms = declaredUniforms;\n this.uniformInfo = uniformInfo;\n }\n static resolveDefaults(props) {\n return {};\n }\n static makeEffectKey(props) {\n return false;\n }\n}\n//# sourceMappingURL=ShaderEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst trPropSetterDefaults = {\n x: (state, value) => {\n state.props.x = value;\n },\n y: (state, value) => {\n state.props.y = value;\n },\n width: (state, value) => {\n state.props.width = value;\n },\n height: (state, value) => {\n state.props.height = value;\n },\n color: (state, value) => {\n state.props.color = value;\n },\n zIndex: (state, value) => {\n state.props.zIndex = value;\n },\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n },\n text: (state, value) => {\n state.props.text = value;\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n },\n contain: (state, value) => {\n state.props.contain = value;\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n },\n scrollable: (state, value) => {\n state.props.scrollable = value;\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n },\n debug: (state, value) => {\n state.props.debug = value;\n },\n};\nexport class TextRenderer {\n stage;\n set;\n constructor(stage) {\n this.stage = stage;\n const propSetters = {\n ...trPropSetterDefaults,\n ...this.getPropertySetters(),\n };\n // For each prop setter add a wrapper method that checks if the prop is\n // different before calling the setter\n this.set = Object.freeze(Object.fromEntries(Object.entries(propSetters).map(([key, setter]) => {\n return [\n key,\n (state, value) => {\n if (state.props[key] !== value) {\n setter(state, value);\n // Assume any prop change will require a render\n // This is required because otherwise a paused RAF will result\n // in renders when text props are changed.\n this.stage.requestRender();\n }\n },\n ];\n })));\n }\n setStatus(state, status, error) {\n // Don't emit the same status twice\n if (state.status === status) {\n return;\n }\n state.status = status;\n state.emitter.emit(status, error);\n }\n /**\n * Allows the CoreTextNode to communicate changes to the isRenderable state of\n * the itself.\n *\n * @param state\n * @param renderable\n */\n setIsRenderable(state, renderable) {\n state.isRenderable = renderable;\n }\n /**\n * Destroy/Clean up the state object\n *\n * @remarks\n * Opposite of createState(). Frees any event listeners / resources held by\n * the state that may not reliably get garbage collected.\n *\n * @param state\n */\n destroyState(state) {\n const stateEvents = ['loading', 'loaded', 'failed'];\n // Remove the old event listeners from previous state obj there was one\n stateEvents.forEach((eventName) => {\n state.emitter.off(eventName);\n });\n }\n /**\n * Schedule a state update via queueMicrotask\n *\n * @remarks\n * This method is used to schedule a state update via queueMicrotask. This\n * method should be called whenever a state update is needed, and it will\n * ensure that the state is only updated once per microtask.\n * @param state\n * @returns\n */\n scheduleUpdateState(state) {\n if (state.updateScheduled) {\n return;\n }\n state.updateScheduled = true;\n queueMicrotask(() => {\n state.updateScheduled = false;\n this.updateState(state);\n });\n }\n}\n//# sourceMappingURL=TextRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* eslint-disable @typescript-eslint/no-non-null-assertion */\nimport { getRgbaString } from '../../lib/utils.js';\nconst MAX_TEXTURE_DIMENSION = 2048;\n/**\n * Calculate height for the canvas\n *\n * @param textBaseline\n * @param fontSize\n * @param lineHeight\n * @param numLines\n * @param offsetY\n * @returns\n */\nfunction calcHeight(textBaseline, fontSize, lineHeight, numLines, offsetY) {\n const baselineOffset = textBaseline !== 'bottom' ? 0.5 * fontSize : 0;\n return (lineHeight * (numLines - 1) +\n baselineOffset +\n Math.max(lineHeight, fontSize) +\n (offsetY || 0));\n}\nexport class LightningTextTextureRenderer {\n _canvas;\n _context;\n _settings;\n renderInfo;\n constructor(canvas, context) {\n this._canvas = canvas;\n this._context = context;\n this._settings = this.mergeDefaults({});\n }\n set settings(v) {\n this._settings = this.mergeDefaults(v);\n }\n get settings() {\n return this._settings;\n }\n getPrecision() {\n return this._settings.precision;\n }\n setFontProperties() {\n this._context.font = this._getFontSetting();\n this._context.textBaseline = this._settings.textBaseline;\n }\n _getFontSetting() {\n const ff = [this._settings.fontFace];\n const ffs = [];\n for (let i = 0, n = ff.length; i < n; i++) {\n if (ff[i] === 'serif' || ff[i] === 'sans-serif') {\n ffs.push(ff[i]);\n }\n else {\n ffs.push(`\"${ff[i]}\"`);\n }\n }\n return `${this._settings.fontStyle} ${this._settings.fontSize * this.getPrecision()}px ${ffs.join(',')}`;\n }\n _load() {\n if (true && document.fonts) {\n const fontSetting = this._getFontSetting();\n try {\n if (!document.fonts.check(fontSetting, this._settings.text)) {\n // Use a promise that waits for loading.\n return document.fonts\n .load(fontSetting, this._settings.text)\n .catch((err) => {\n // Just load the fallback font.\n console.warn('[Lightning] Font load error', err, fontSetting);\n })\n .then(() => {\n if (!document.fonts.check(fontSetting, this._settings.text)) {\n console.warn('[Lightning] Font not found', fontSetting);\n }\n });\n }\n }\n catch (e) {\n console.warn(\"[Lightning] Can't check font loading for \" + fontSetting);\n }\n }\n }\n calculateRenderInfo() {\n const renderInfo = {};\n const precision = this.getPrecision();\n const paddingLeft = this._settings.paddingLeft * precision;\n const paddingRight = this._settings.paddingRight * precision;\n const fontSize = this._settings.fontSize * precision;\n let offsetY = this._settings.offsetY === null\n ? null\n : this._settings.offsetY * precision;\n let lineHeight = (this._settings.lineHeight || fontSize) * precision;\n const w = this._settings.w * precision;\n const h = this._settings.h * precision;\n let wordWrapWidth = this._settings.wordWrapWidth * precision;\n const cutSx = this._settings.cutSx * precision;\n const cutEx = this._settings.cutEx * precision;\n const cutSy = this._settings.cutSy * precision;\n const cutEy = this._settings.cutEy * precision;\n const letterSpacing = (this._settings.letterSpacing || 0) * precision;\n const textIndent = this._settings.textIndent * precision;\n // Set font properties.\n this.setFontProperties();\n // Total width.\n let width = w || 2048 / this.getPrecision();\n // Inner width.\n let innerWidth = width - paddingLeft;\n if (innerWidth < 10) {\n width += 10 - innerWidth;\n innerWidth = 10;\n }\n if (!wordWrapWidth) {\n wordWrapWidth = innerWidth;\n }\n // Text overflow\n if (this._settings.textOverflow && !this._settings.wordWrap) {\n let suffix;\n switch (this._settings.textOverflow) {\n case 'clip':\n suffix = '';\n break;\n case 'ellipsis':\n suffix = this._settings.overflowSuffix;\n break;\n default:\n suffix = this._settings.textOverflow;\n }\n this._settings.text = this.wrapWord(this._settings.text, wordWrapWidth - textIndent, suffix);\n }\n // word wrap\n // preserve original text\n let linesInfo;\n if (this._settings.wordWrap) {\n linesInfo = this.wrapText(this._settings.text, wordWrapWidth, letterSpacing, textIndent);\n }\n else {\n linesInfo = { l: this._settings.text.split(/(?:\\r\\n|\\r|\\n)/), n: [] };\n const n = linesInfo.l.length;\n for (let i = 0; i < n - 1; i++) {\n linesInfo.n.push(i);\n }\n }\n let lines = linesInfo.l;\n if (this._settings.maxLines && lines.length > this._settings.maxLines) {\n const usedLines = lines.slice(0, this._settings.maxLines);\n let otherLines = null;\n if (this._settings.overflowSuffix) {\n // Wrap again with max lines suffix enabled.\n const w = this._settings.overflowSuffix\n ? this.measureText(this._settings.overflowSuffix)\n : 0;\n const al = this.wrapText(usedLines[usedLines.length - 1], wordWrapWidth - w, letterSpacing, textIndent);\n usedLines[usedLines.length - 1] = `${al.l[0]}${this._settings.overflowSuffix}`;\n otherLines = [al.l.length > 1 ? al.l[1] : ''];\n }\n else {\n otherLines = [''];\n }\n // Re-assemble the remaining text.\n let i;\n const n = lines.length;\n let j = 0;\n const m = linesInfo.n.length;\n for (i = this._settings.maxLines; i < n; i++) {\n otherLines[j] += `${otherLines[j] ? ' ' : ''}${lines[i]}`;\n if (i + 1 < m && linesInfo.n[i + 1]) {\n j++;\n }\n }\n renderInfo.remainingText = otherLines.join('\\n');\n renderInfo.moreTextLines = true;\n lines = usedLines;\n }\n else {\n renderInfo.moreTextLines = false;\n renderInfo.remainingText = '';\n }\n // calculate text width\n let maxLineWidth = 0;\n const lineWidths = [];\n for (let i = 0; i < lines.length; i++) {\n const lineWidth = this.measureText(lines[i], letterSpacing) + (i === 0 ? textIndent : 0);\n lineWidths.push(lineWidth);\n maxLineWidth = Math.max(maxLineWidth, lineWidth);\n }\n renderInfo.lineWidths = lineWidths;\n if (!w) {\n // Auto-set width to max text length.\n width = maxLineWidth + paddingLeft + paddingRight;\n innerWidth = maxLineWidth;\n }\n // calculate text height\n lineHeight = lineHeight || fontSize;\n let height;\n if (h) {\n height = h;\n }\n else {\n height = calcHeight(this._settings.textBaseline, fontSize, lineHeight, lines.length, offsetY);\n }\n if (offsetY === null) {\n offsetY = fontSize;\n }\n renderInfo.w = width;\n renderInfo.h = height;\n renderInfo.lines = lines;\n renderInfo.precision = precision;\n if (!width) {\n // To prevent canvas errors.\n width = 1;\n }\n if (!height) {\n // To prevent canvas errors.\n height = 1;\n }\n if (cutSx || cutEx) {\n width = Math.min(width, cutEx - cutSx);\n }\n if (cutSy || cutEy) {\n height = Math.min(height, cutEy - cutSy);\n }\n renderInfo.width = width;\n renderInfo.innerWidth = innerWidth;\n renderInfo.height = height;\n renderInfo.fontSize = fontSize;\n renderInfo.cutSx = cutSx;\n renderInfo.cutSy = cutSy;\n renderInfo.cutEx = cutEx;\n renderInfo.cutEy = cutEy;\n renderInfo.lineHeight = lineHeight;\n renderInfo.lineWidths = lineWidths;\n renderInfo.offsetY = offsetY;\n renderInfo.paddingLeft = paddingLeft;\n renderInfo.paddingRight = paddingRight;\n renderInfo.letterSpacing = letterSpacing;\n renderInfo.textIndent = textIndent;\n return renderInfo;\n }\n draw(renderInfo, linesOverride) {\n const precision = this.getPrecision();\n // Allow lines to be overriden for partial rendering.\n const lines = linesOverride?.lines || renderInfo.lines;\n const lineWidths = linesOverride?.lineWidths || renderInfo.lineWidths;\n const height = linesOverride\n ? calcHeight(this._settings.textBaseline, renderInfo.fontSize, renderInfo.lineHeight, linesOverride.lines.length, this._settings.offsetY === null\n ? null\n : this._settings.offsetY * precision)\n : renderInfo.height;\n // Add extra margin to prevent issue with clipped text when scaling.\n this._canvas.width = Math.min(Math.ceil(renderInfo.width + this._settings.textRenderIssueMargin), MAX_TEXTURE_DIMENSION);\n this._canvas.height = Math.min(Math.ceil(height), MAX_TEXTURE_DIMENSION);\n // Canvas context has been reset.\n this.setFontProperties();\n if (renderInfo.fontSize >= 128) {\n // WpeWebKit bug: must force compositing because cairo-traps-compositor will not work with text first.\n this._context.globalAlpha = 0.01;\n this._context.fillRect(0, 0, 0.01, 0.01);\n this._context.globalAlpha = 1.0;\n }\n if (renderInfo.cutSx || renderInfo.cutSy) {\n this._context.translate(-renderInfo.cutSx, -renderInfo.cutSy);\n }\n let linePositionX;\n let linePositionY;\n const drawLines = [];\n // Draw lines line by line.\n for (let i = 0, n = lines.length; i < n; i++) {\n linePositionX = i === 0 ? renderInfo.textIndent : 0;\n // By default, text is aligned to top\n linePositionY = i * renderInfo.lineHeight + renderInfo.offsetY;\n if (this._settings.verticalAlign == 'middle') {\n linePositionY += (renderInfo.lineHeight - renderInfo.fontSize) / 2;\n }\n else if (this._settings.verticalAlign == 'bottom') {\n linePositionY += renderInfo.lineHeight - renderInfo.fontSize;\n }\n if (this._settings.textAlign === 'right') {\n linePositionX += renderInfo.innerWidth - lineWidths[i];\n }\n else if (this._settings.textAlign === 'center') {\n linePositionX += (renderInfo.innerWidth - lineWidths[i]) / 2;\n }\n linePositionX += renderInfo.paddingLeft;\n drawLines.push({\n text: lines[i],\n x: linePositionX,\n y: linePositionY,\n w: lineWidths[i],\n });\n }\n // Highlight.\n if (this._settings.highlight) {\n const color = this._settings.highlightColor;\n const hlHeight = this._settings.highlightHeight * precision || renderInfo.fontSize * 1.5;\n const offset = this._settings.highlightOffset * precision;\n const hlPaddingLeft = this._settings.highlightPaddingLeft !== null\n ? this._settings.highlightPaddingLeft * precision\n : renderInfo.paddingLeft;\n const hlPaddingRight = this._settings.highlightPaddingRight !== null\n ? this._settings.highlightPaddingRight * precision\n : renderInfo.paddingRight;\n this._context.fillStyle = getRgbaString(color);\n for (let i = 0; i < drawLines.length; i++) {\n const drawLine = drawLines[i];\n this._context.fillRect(drawLine.x - hlPaddingLeft, drawLine.y - renderInfo.offsetY + offset, drawLine.w + hlPaddingRight + hlPaddingLeft, hlHeight);\n }\n }\n // Text shadow.\n let prevShadowSettings = null;\n if (this._settings.shadow) {\n prevShadowSettings = [\n this._context.shadowColor,\n this._context.shadowOffsetX,\n this._context.shadowOffsetY,\n this._context.shadowBlur,\n ];\n this._context.shadowColor = getRgbaString(this._settings.shadowColor);\n this._context.shadowOffsetX = this._settings.shadowOffsetX * precision;\n this._context.shadowOffsetY = this._settings.shadowOffsetY * precision;\n this._context.shadowBlur = this._settings.shadowBlur * precision;\n }\n this._context.fillStyle = getRgbaString(this._settings.textColor);\n for (let i = 0, n = drawLines.length; i < n; i++) {\n const drawLine = drawLines[i];\n if (renderInfo.letterSpacing === 0) {\n this._context.fillText(drawLine.text, drawLine.x, drawLine.y);\n }\n else {\n const textSplit = drawLine.text.split('');\n let x = drawLine.x;\n for (let i = 0, j = textSplit.length; i < j; i++) {\n this._context.fillText(textSplit[i], x, drawLine.y);\n x += this.measureText(textSplit[i], renderInfo.letterSpacing);\n }\n }\n }\n if (prevShadowSettings) {\n this._context.shadowColor = prevShadowSettings[0];\n this._context.shadowOffsetX = prevShadowSettings[1];\n this._context.shadowOffsetY = prevShadowSettings[2];\n this._context.shadowBlur = prevShadowSettings[3];\n }\n if (renderInfo.cutSx || renderInfo.cutSy) {\n this._context.translate(renderInfo.cutSx, renderInfo.cutSy);\n }\n this.renderInfo = renderInfo;\n }\n wrapWord(word, wordWrapWidth, suffix) {\n const suffixWidth = this._context.measureText(suffix).width;\n const wordLen = word.length;\n const wordWidth = this._context.measureText(word).width;\n /* If word fits wrapWidth, do nothing */\n if (wordWidth <= wordWrapWidth) {\n return word;\n }\n /* Make initial guess for text cuttoff */\n let cutoffIndex = Math.floor((wordWrapWidth * wordLen) / wordWidth);\n let truncWordWidth = this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n /* In case guess was overestimated, shrink it letter by letter. */\n if (truncWordWidth > wordWrapWidth) {\n while (cutoffIndex > 0) {\n truncWordWidth =\n this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n if (truncWordWidth > wordWrapWidth) {\n cutoffIndex -= 1;\n }\n else {\n break;\n }\n }\n /* In case guess was underestimated, extend it letter by letter. */\n }\n else {\n while (cutoffIndex < wordLen) {\n truncWordWidth =\n this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n if (truncWordWidth < wordWrapWidth) {\n cutoffIndex += 1;\n }\n else {\n // Finally, when bound is crossed, retract last letter.\n cutoffIndex -= 1;\n break;\n }\n }\n }\n /* If wrapWidth is too short to even contain suffix alone, return empty string */\n return (word.substring(0, cutoffIndex) +\n (wordWrapWidth >= suffixWidth ? suffix : ''));\n }\n /**\n * Applies newlines to a string to have it optimally fit into the horizontal\n * bounds set by the Text object's wordWrapWidth property.\n */\n wrapText(text, wordWrapWidth, letterSpacing, indent = 0) {\n // Greedy wrapping algorithm that will wrap words as the line grows longer.\n // than its horizontal bounds.\n const lines = text.split(/\\r?\\n/g);\n let allLines = [];\n const realNewlines = [];\n for (let i = 0; i < lines.length; i++) {\n const resultLines = [];\n let result = '';\n let spaceLeft = wordWrapWidth - indent;\n const words = lines[i].split(' ');\n for (let j = 0; j < words.length; j++) {\n const wordWidth = this.measureText(words[j], letterSpacing);\n const wordWidthWithSpace = wordWidth + this.measureText(' ', letterSpacing);\n if (j === 0 || wordWidthWithSpace > spaceLeft) {\n // Skip printing the newline if it's the first word of the line that is.\n // greater than the word wrap width.\n if (j > 0) {\n resultLines.push(result);\n result = '';\n }\n result += words[j];\n spaceLeft = wordWrapWidth - wordWidth - (j === 0 ? indent : 0);\n }\n else {\n spaceLeft -= wordWidthWithSpace;\n result += ` ${words[j]}`;\n }\n }\n resultLines.push(result);\n result = '';\n allLines = allLines.concat(resultLines);\n if (i < lines.length - 1) {\n realNewlines.push(allLines.length);\n }\n }\n return { l: allLines, n: realNewlines };\n }\n measureText(word, space = 0) {\n if (!space) {\n return this._context.measureText(word).width;\n }\n return word.split('').reduce((acc, char) => {\n return acc + this._context.measureText(char).width + space;\n }, 0);\n }\n mergeDefaults(settings) {\n return {\n text: '',\n w: 0,\n h: 0,\n fontStyle: 'normal',\n fontSize: 40,\n fontFace: null,\n wordWrap: true,\n wordWrapWidth: 0,\n wordBreak: false,\n textOverflow: '',\n lineHeight: null,\n textBaseline: 'alphabetic',\n textAlign: 'left',\n verticalAlign: 'top',\n offsetY: null,\n maxLines: 0,\n overflowSuffix: '...',\n textColor: [1.0, 1.0, 1.0, 1.0],\n paddingLeft: 0,\n paddingRight: 0,\n shadow: false,\n shadowColor: [0.0, 0.0, 0.0, 1.0],\n shadowOffsetX: 0,\n shadowOffsetY: 0,\n shadowBlur: 5,\n highlight: false,\n highlightHeight: 0,\n highlightColor: [0.0, 0.0, 0.0, 1.0],\n highlightOffset: 0,\n highlightPaddingLeft: 0,\n highlightPaddingRight: 0,\n letterSpacing: 0,\n textIndent: 0,\n cutSx: 0,\n cutEx: 0,\n cutSy: 0,\n cutEy: 0,\n advancedRenderer: false,\n fontBaselineRatio: 0,\n precision: 1,\n textRenderIssueMargin: 0,\n ...settings,\n };\n }\n}\n//# sourceMappingURL=LightningTextTextureRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EventEmitter } from '../../../common/EventEmitter.js';\nimport { assertTruthy, mergeColorAlphaPremultiplied } from '../../../utils.js';\nimport { intersectRect, intersectBound, getNormalizedRgbaComponents, getNormalizedAlphaComponent, createBound, } from '../../lib/utils.js';\nimport { WebTrFontFace } from '../font-face-types/WebTrFontFace.js';\nimport { LightningTextTextureRenderer, } from './LightningTextTextureRenderer.js';\nimport { TextRenderer, } from './TextRenderer.js';\nconst resolvedGlobal = typeof self === 'undefined' ? globalThis : self;\n/**\n * Global font set regardless of if run in the main thread or a web worker\n */\nconst globalFontSet = (resolvedGlobal.document?.fonts ||\n resolvedGlobal.fonts);\nfunction getFontCssString(props) {\n const { fontFamily, fontStyle, fontWeight, fontStretch, fontSize } = props;\n return [fontStyle, fontWeight, fontStretch, `${fontSize}px`, fontFamily].join(' ');\n}\n/**\n * Ephemeral bounds object used for intersection calculations\n *\n * @remarks\n * Used to avoid creating a new object every time we need to intersect\n * element bounds.\n */\nconst tmpElementBounds = createBound(0, 0, 0, 0);\nexport class CanvasTextRenderer extends TextRenderer {\n canvas;\n context;\n rendererBounds;\n constructor(stage) {\n super(stage);\n if (typeof OffscreenCanvas !== 'undefined') {\n this.canvas = new OffscreenCanvas(0, 0);\n }\n else {\n this.canvas = document.createElement('canvas');\n }\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n let context = this.canvas.getContext('2d');\n if (!context) {\n // A browser may appear to support OffscreenCanvas but not actually support the Canvas '2d' context\n // Here we try getting the context again after falling back to an HTMLCanvasElement.\n // See: https://github.com/lightning-js/renderer/issues/26#issuecomment-1750438486\n this.canvas = document.createElement('canvas');\n context = this.canvas.getContext('2d');\n }\n assertTruthy(context);\n this.context = context;\n this.rendererBounds = {\n x1: 0,\n y1: 0,\n x2: this.stage.options.appWidth,\n y2: this.stage.options.appHeight,\n };\n }\n //#region Overrides\n getPropertySetters() {\n return {\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n text: (state, value) => {\n state.props.text = value;\n this.invalidateLayoutCache(state);\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n this.invalidateLayoutCache(state);\n },\n color: (state, value) => {\n state.props.color = value;\n this.invalidateLayoutCache(state);\n },\n x: (state, value) => {\n state.props.x = value;\n this.invalidateVisibleWindowCache(state);\n },\n y: (state, value) => {\n state.props.y = value;\n this.invalidateVisibleWindowCache(state);\n },\n contain: (state, value) => {\n state.props.contain = value;\n this.invalidateLayoutCache(state);\n },\n width: (state, value) => {\n state.props.width = value;\n // Only invalidate layout cache if we're containing in the horizontal direction\n if (state.props.contain !== 'none') {\n this.invalidateLayoutCache(state);\n }\n },\n height: (state, value) => {\n state.props.height = value;\n // Only invalidate layout cache if we're containing in the vertical direction\n if (state.props.contain === 'both') {\n this.invalidateLayoutCache(state);\n }\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n this.invalidateLayoutCache(state);\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n this.invalidateLayoutCache(state);\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n this.invalidateLayoutCache(state);\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n this.invalidateLayoutCache(state);\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n this.invalidateLayoutCache(state);\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n this.invalidateLayoutCache(state);\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n this.invalidateLayoutCache(state);\n },\n // debug: (state, value) => {\n // state.props.debug = value;\n // },\n };\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n canRenderFont(props) {\n // The canvas renderer can render any font because it automatically\n // falls back to system fonts. The CanvasTextRenderer should be\n // checked last if other renderers are preferred.\n return true;\n }\n isFontFaceSupported(fontFace) {\n return fontFace instanceof WebTrFontFace;\n }\n addFontFace(fontFace) {\n // Make sure the font face is an Canvas font face (it should have already passed\n // the `isFontFaceSupported` check)\n assertTruthy(fontFace instanceof WebTrFontFace);\n // We simply add the font face to the document\n // @ts-expect-error `add()` method should be available from a FontFaceSet\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n globalFontSet.add(fontFace.fontFace);\n }\n createState(props) {\n return {\n props,\n status: 'initialState',\n updateScheduled: false,\n emitter: new EventEmitter(),\n canvasPages: undefined,\n lightning2TextRenderer: new LightningTextTextureRenderer(this.canvas, this.context),\n renderWindow: undefined,\n visibleWindow: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n valid: false,\n },\n renderInfo: undefined,\n forceFullLayoutCalc: false,\n textW: 0,\n textH: 0,\n fontInfo: undefined,\n fontFaceLoadedHandler: undefined,\n isRenderable: false,\n debugData: {\n updateCount: 0,\n layoutCount: 0,\n drawCount: 0,\n lastLayoutNumCharacters: 0,\n layoutSum: 0,\n drawSum: 0,\n bufferSize: 0,\n },\n };\n }\n updateState(state) {\n // On the first update call we need to set the status to loading\n if (state.status === 'initialState') {\n this.setStatus(state, 'loading');\n }\n // If fontInfo is invalid, we need to establish it\n if (!state.fontInfo) {\n const cssString = getFontCssString(state.props);\n state.fontInfo = {\n cssString: cssString,\n // TODO: For efficiency we would use this here but it's not reliable on WPE -> document.fonts.check(cssString),\n loaded: false,\n };\n // If font is not loaded, set up a handler to update the font info when the font loads\n if (!state.fontInfo.loaded) {\n globalFontSet\n .load(cssString)\n .then(this.onFontLoaded.bind(this, state, cssString))\n .catch(this.onFontLoadError.bind(this, state, cssString));\n return;\n }\n }\n // If we're waiting for a font face to load, don't render anything\n if (!state.fontInfo.loaded) {\n return;\n }\n if (!state.renderInfo) {\n const maxLines = state.props.maxLines;\n const containedMaxLines = state.props.contain === 'both'\n ? Math.floor((state.props.height - state.props.offsetY) /\n state.props.lineHeight)\n : 0;\n const calcMaxLines = containedMaxLines > 0 && maxLines > 0\n ? Math.min(containedMaxLines, maxLines)\n : Math.max(containedMaxLines, maxLines);\n state.lightning2TextRenderer.settings = {\n text: state.props.text,\n textAlign: state.props.textAlign,\n fontFace: state.props.fontFamily,\n fontSize: state.props.fontSize,\n fontStyle: [\n state.props.fontStretch,\n state.props.fontStyle,\n state.props.fontWeight,\n ].join(' '),\n textColor: getNormalizedRgbaComponents(state.props.color),\n offsetY: state.props.fontSize + state.props.offsetY,\n wordWrap: state.props.contain !== 'none',\n wordWrapWidth: state.props.contain === 'none' ? undefined : state.props.width,\n letterSpacing: state.props.letterSpacing,\n lineHeight: state.props.lineHeight,\n maxLines: calcMaxLines,\n textBaseline: state.props.textBaseline,\n verticalAlign: state.props.verticalAlign,\n overflowSuffix: state.props.overflowSuffix,\n };\n // const renderInfoCalculateTime = performance.now();\n state.renderInfo = state.lightning2TextRenderer.calculateRenderInfo();\n // console.log(\n // 'Render info calculated in',\n // performance.now() - renderInfoCalculateTime,\n // 'ms',\n // );\n state.textH = state.renderInfo.lineHeight * state.renderInfo.lines.length;\n state.textW = state.renderInfo.width;\n // Invalidate renderWindow because the renderInfo changed\n state.renderWindow = undefined;\n }\n const { x, y, width, height, scrollY, contain } = state.props;\n const { visibleWindow } = state;\n let { renderWindow, canvasPages } = state;\n if (!visibleWindow.valid) {\n // Figure out whats actually in the bounds of the renderer/canvas (visibleWindow)\n const elementBounds = createBound(x, y, contain !== 'none' ? x + width : Infinity, contain === 'both' ? y + height : Infinity, tmpElementBounds);\n /**\n * Area that is visible on the screen.\n */\n intersectBound(this.rendererBounds, elementBounds, visibleWindow);\n visibleWindow.valid = true;\n }\n const visibleWindowHeight = visibleWindow.y2 - visibleWindow.y1;\n const maxLinesPerCanvasPage = Math.ceil(visibleWindowHeight / state.renderInfo.lineHeight);\n if (visibleWindowHeight === 0) {\n // Nothing to render. Clear any canvasPages and existing renderWindow\n // Return early.\n canvasPages = undefined;\n renderWindow = undefined;\n this.setStatus(state, 'loaded');\n return;\n }\n else if (renderWindow && canvasPages) {\n // Return early if we're still viewing inside the established render window\n // No need to re-render what we've already rendered\n const renderWindowScreenX1 = x + renderWindow.x1;\n const renderWindowScreenY1 = y - scrollY + renderWindow.y1;\n const renderWindowScreenX2 = x + renderWindow.x2;\n const renderWindowScreenY2 = y - scrollY + renderWindow.y2;\n if (renderWindowScreenX1 <= visibleWindow.x1 &&\n renderWindowScreenX2 >= visibleWindow.x2 &&\n renderWindowScreenY1 <= visibleWindow.y1 &&\n renderWindowScreenY2 >= visibleWindow.y2) {\n this.setStatus(state, 'loaded');\n return;\n }\n if (renderWindowScreenY2 < visibleWindow.y2) {\n // We've scrolled up, so we need to render the next page\n renderWindow.y1 += maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n renderWindow.y2 += maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n canvasPages.push(canvasPages.shift());\n canvasPages[2].lineNumStart =\n canvasPages[1].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[2].lineNumEnd =\n canvasPages[2].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[2].valid = false;\n }\n else if (renderWindowScreenY1 > visibleWindow.y1) {\n // We've scrolled down, so we need to render the previous page\n renderWindow.y1 -= maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n renderWindow.y2 -= maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n canvasPages.unshift(canvasPages.pop());\n canvasPages[0].lineNumStart =\n canvasPages[1].lineNumStart - maxLinesPerCanvasPage;\n canvasPages[0].lineNumEnd =\n canvasPages[0].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[0].valid = false;\n }\n }\n else {\n const pageHeight = state.renderInfo.lineHeight * maxLinesPerCanvasPage;\n const page1Block = Math.ceil(scrollY / pageHeight);\n const page1LineStart = page1Block * maxLinesPerCanvasPage;\n const page0LineStart = page1LineStart - maxLinesPerCanvasPage;\n const page2LineStart = page1LineStart + maxLinesPerCanvasPage;\n // We haven't rendered anything yet, so we need to render the first page\n // If canvasPages already exist, let's re-use the textures\n canvasPages = [\n {\n texture: canvasPages?.[0].texture,\n lineNumStart: page0LineStart,\n lineNumEnd: page0LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n {\n texture: canvasPages?.[1].texture,\n lineNumStart: page1LineStart,\n lineNumEnd: page1LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n {\n texture: canvasPages?.[2].texture,\n lineNumStart: page2LineStart,\n lineNumEnd: page2LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n ];\n state.canvasPages = canvasPages;\n const scrollYNearestPage = page1Block * pageHeight;\n renderWindow = {\n x1: 0,\n y1: scrollYNearestPage - pageHeight,\n x2: width,\n y2: scrollYNearestPage + pageHeight * 2,\n };\n }\n state.renderWindow = renderWindow;\n const pageDrawTime = performance.now();\n for (const pageInfo of canvasPages) {\n if (pageInfo.valid)\n continue;\n if (pageInfo.lineNumStart < 0) {\n pageInfo.texture?.setRenderableOwner(state, false);\n pageInfo.texture = this.stage.txManager.loadTexture('ImageTexture', {\n src: '',\n });\n pageInfo.texture.setRenderableOwner(state, state.isRenderable);\n pageInfo.valid = true;\n continue;\n }\n state.lightning2TextRenderer.draw(state.renderInfo, {\n lines: state.renderInfo.lines.slice(pageInfo.lineNumStart, pageInfo.lineNumEnd),\n lineWidths: state.renderInfo.lineWidths.slice(pageInfo.lineNumStart, pageInfo.lineNumEnd),\n });\n if (!(this.canvas.width === 0 || this.canvas.height === 0)) {\n pageInfo.texture?.setRenderableOwner(state, false);\n pageInfo.texture = this.stage.txManager.loadTexture('ImageTexture', {\n src: this.context.getImageData(0, 0, this.canvas.width, this.canvas.height),\n }, {\n preload: true,\n });\n pageInfo.texture.setRenderableOwner(state, state.isRenderable);\n }\n pageInfo.valid = true;\n }\n // console.log('pageDrawTime', performance.now() - pageDrawTime, 'ms');\n // Report final status\n this.setStatus(state, 'loaded');\n }\n renderQuads(state, transform, clippingRect, alpha) {\n const { stage } = this;\n const { canvasPages, textW = 0, textH = 0, renderWindow } = state;\n if (!canvasPages || !renderWindow)\n return;\n const { x, y, scrollY, contain, width, height /*, debug*/ } = state.props;\n const elementRect = {\n x: x,\n y: y,\n width: contain !== 'none' ? width : textW,\n height: contain === 'both' ? height : textH,\n };\n const visibleRect = intersectRect({\n x: 0,\n y: 0,\n width: stage.options.appWidth,\n height: stage.options.appHeight,\n }, elementRect);\n // if (!debug.disableScissor) {\n // renderer.enableScissor(\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n assertTruthy(canvasPages, 'canvasPages is not defined');\n assertTruthy(renderWindow, 'renderWindow is not defined');\n const renderWindowHeight = renderWindow.y2 - renderWindow.y1;\n const pageSize = renderWindowHeight / 3.0;\n const { zIndex, color } = state.props;\n // Color alpha of text is not properly rendered to the Canvas texture, so we\n // need to apply it here.\n const combinedAlpha = alpha * getNormalizedAlphaComponent(color);\n const quadColor = mergeColorAlphaPremultiplied(0xffffffff, combinedAlpha);\n if (canvasPages[0].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[0].texture?.dimensions?.width || 0,\n height: canvasPages[0].texture?.dimensions?.height || 0,\n texture: canvasPages[0].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n if (canvasPages[1].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[1].texture?.dimensions?.width || 0,\n height: canvasPages[1].texture?.dimensions?.height || 0,\n texture: canvasPages[1].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1 + pageSize,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n if (canvasPages[2].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[2].texture?.dimensions?.width || 0,\n height: canvasPages[2].texture?.dimensions?.height || 0,\n texture: canvasPages[2].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1 + pageSize + pageSize,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n // renderer.disableScissor();\n // if (debug.showElementRect) {\n // this.renderer.drawBorder(\n // Colors.Blue,\n // elementRect.x,\n // elementRect.y,\n // elementRect.w,\n // elementRect.h,\n // );\n // }\n // if (debug.showVisibleRect) {\n // this.renderer.drawBorder(\n // Colors.Green,\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // if (debug.showRenderWindow && renderWindow) {\n // this.renderer.drawBorder(\n // Colors.Red,\n // x + renderWindow.x1,\n // y + renderWindow.y1 - scrollY,\n // x + renderWindow.x2 - (x + renderWindow.x1),\n // y + renderWindow.y2 - scrollY - (y + renderWindow.y1 - scrollY),\n // );\n // }\n }\n setIsRenderable(state, renderable) {\n super.setIsRenderable(state, renderable);\n // Set state object owner from any canvas page textures\n state.canvasPages?.forEach((pageInfo) => {\n pageInfo.texture?.setRenderableOwner(state, renderable);\n });\n }\n destroyState(state) {\n // Remove state object owner from any canvas page textures\n state.canvasPages?.forEach((pageInfo) => {\n pageInfo.texture?.setRenderableOwner(state, false);\n });\n }\n //#endregion Overrides\n /**\n * Invalidate the visible window stored in the state. This will cause a new\n * visible window to be calculated on the next update.\n *\n * @param state\n */\n invalidateVisibleWindowCache(state) {\n state.visibleWindow.valid = false;\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n /**\n * Invalidate the layout cache stored in the state. This will cause the text\n * to be re-layed out on the next update.\n *\n * @remarks\n * This also invalidates the visible window cache.\n *\n * @param state\n */\n invalidateLayoutCache(state) {\n state.renderInfo = undefined;\n state.visibleWindow.valid = false;\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n onFontLoaded(state, cssString) {\n if (cssString !== state.fontInfo?.cssString || !state.fontInfo) {\n return;\n }\n state.fontInfo.loaded = true;\n this.scheduleUpdateState(state);\n }\n onFontLoadError(state, cssString, error) {\n if (cssString !== state.fontInfo?.cssString || !state.fontInfo) {\n return;\n }\n // Font didn't actually load, but we'll log the error and mark it as loaded\n // because the browser can still render with a fallback font.\n state.fontInfo.loaded = true;\n console.error(`CanvasTextRenderer: Error loading font '${state.fontInfo.cssString}'`, error);\n this.scheduleUpdateState(state);\n }\n}\n//# sourceMappingURL=CanvasTextRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\nexport class DefaultShader extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2fv' },\n ],\n });\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `,\n fragment: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate);\n gl_FragColor = vec4(v_color) * texture2D(u_texture, v_textureCoordinate);\n }\n `,\n };\n}\n//# sourceMappingURL=DefaultShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\n// import type { Texture } from '../textures/Texture';\nexport class DefaultShaderBatched extends WebGlCoreShader {\n supportsIndexedTextures = true;\n constructor(renderer) {\n super({\n renderer,\n attributes: [\n 'a_position',\n 'a_textureCoordinate',\n 'a_color',\n 'a_textureIndex',\n ],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_textures[0]', uniform: 'uniform1iv' },\n ],\n });\n }\n bindTextures(texture) {\n const { renderer, glw } = this;\n if (texture.length > renderer.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS) {\n throw new Error(`DefaultShaderBatched: Cannot bind more than ${renderer.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS} textures`);\n }\n texture.forEach((t, i) => {\n glw.activeTexture(i);\n glw.bindTexture(t.ctxTexture);\n });\n const samplers = Array.from(Array(texture.length).keys());\n this.setUniform('u_textures[0]', samplers);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `,\n fragment: (textureUnits) => `\n #define txUnits ${textureUnits}\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_image;\n uniform sampler2D u_textures[txUnits];\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n vec4 sampleFromTexture(sampler2D textures[${textureUnits}], int idx, vec2 uv) {\n ${Array.from(Array(textureUnits).keys())\n .map((idx) => `\n ${idx !== 0 ? 'else ' : ''}if (idx == ${idx}) {\n return texture2D(textures[${idx}], uv);\n }\n `)\n .join('')}\n return texture2D(textures[0], uv);\n }\n\n void main(){\n gl_FragColor = vec4(v_color) * sampleFromTexture(u_textures, int(v_textureIndex), v_textureCoordinate);\n }\n `,\n };\n}\n//# sourceMappingURL=DefaultShaderBatched.js.map","import { WebGlCoreShader, } from '../WebGlCoreShader.js';\nimport { ShaderEffect } from './effects/ShaderEffect.js';\nimport memize from 'memize';\nconst effectCache = new Map();\nconst getResolvedEffect = (effects, effectContructors) => {\n const key = JSON.stringify(effects);\n if (effectCache.has(key)) {\n return effectCache.get(key);\n }\n const value = (effects ?? []).map((effect) => ({\n type: effect.type,\n props: effectContructors[effect.type].resolveDefaults((effect.props || {})),\n }));\n effectCache.set(key, value);\n return value;\n};\nexport class DynamicShader extends WebGlCoreShader {\n effects = [];\n constructor(renderer, props, effectContructors) {\n const shader = DynamicShader.createShader(props, effectContructors);\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2fv' },\n { name: 'u_dimensions', uniform: 'uniform2fv' },\n { name: 'u_alpha', uniform: 'uniform1f' },\n ...shader.uniforms,\n ],\n shaderSources: {\n vertex: shader.vertex,\n fragment: shader.fragment,\n },\n });\n this.effects = shader.effects;\n this.calculateProps = memize(this.calculateProps.bind(this));\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n calculateProps(effects) {\n const regEffects = this.renderer.shManager.getRegisteredEffects();\n const results = [];\n effects?.forEach((eff, index) => {\n const effect = this.effects[index];\n const fxClass = regEffects[effect.name];\n const props = eff.props ?? {};\n const uniInfo = effect.uniformInfo;\n Object.keys(props).forEach((p) => {\n const fxProp = fxClass.uniforms[p];\n const propInfo = uniInfo[p];\n let value = fxProp.validator\n ? fxProp.validator(props[p], props)\n : props[p];\n if (Array.isArray(value)) {\n value = new Float32Array(value);\n }\n results.push({ name: propInfo.name, value });\n });\n });\n return results;\n }\n bindProps(props) {\n const results = this.calculateProps(props.effects);\n results.forEach((r) => {\n this.setUniform(r.name, r.value);\n });\n }\n canBatchShaderProps(propsA, propsB) {\n if (propsA.$dimensions.width !== propsB.$dimensions.width ||\n propsA.$dimensions.height !== propsB.$dimensions.height ||\n propsA.effects.length !== propsB.effects.length) {\n return false;\n }\n const propsEffectsLen = propsA.effects.length;\n let i = 0;\n for (; i < propsEffectsLen; i++) {\n const effectA = propsA.effects[i];\n const effectB = propsB.effects[i];\n if (effectA.type !== effectB.type) {\n return false;\n }\n for (const key in effectA.props) {\n if ((effectB.props && !effectB.props[key]) ||\n effectA.props[key] !== effectB.props[key]) {\n return false;\n }\n }\n }\n return true;\n }\n static createShader(props, effectContructors) {\n //counts duplicate effects\n const effectNameCount = {};\n const methods = {};\n let declareUniforms = '';\n const uniforms = [];\n const uFx = [];\n const effects = props.effects.map((effect) => {\n const baseClass = effectContructors[effect.type];\n const key = baseClass.getEffectKey(effect.props || {});\n effectNameCount[key] = effectNameCount[key] ? ++effectNameCount[key] : 1;\n const nr = effectNameCount[key];\n if (nr === 1) {\n uFx.push({ key, type: effect.type, props: effect.props });\n }\n //initialize new effect class;\n const fxClass = new baseClass({\n ref: `${key}${nr === 1 ? '' : nr}`,\n target: key,\n props: effect.props,\n });\n declareUniforms += fxClass.declaredUniforms;\n uniforms.push(...Object.values(fxClass.uniformInfo));\n return fxClass;\n });\n //build source\n let effectMethods = '';\n uFx?.forEach((fx) => {\n const fxClass = effectContructors[fx.type];\n const fxProps = fxClass.resolveDefaults((fx.props ?? {}));\n const remap = [];\n for (const m in fxClass.methods) {\n let cm = m;\n const fxMethod = fxClass.methods[m];\n if (methods[m] && methods[m] !== fxMethod) {\n cm = DynamicShader.resolveMethodDuplicate(m, fxMethod, methods);\n }\n methods[cm] = fxMethod.replace('function', cm);\n remap.push({ m, cm });\n }\n let onShaderMask = fxClass.onShaderMask instanceof Function\n ? fxClass.onShaderMask(fxProps)\n : fxClass.onShaderMask;\n let onColorize = fxClass.onColorize instanceof Function\n ? fxClass.onColorize(fxProps)\n : fxClass.onColorize;\n let onEffectMask = fxClass.onEffectMask instanceof Function\n ? fxClass.onEffectMask(fxProps)\n : fxClass.onEffectMask;\n remap.forEach((r) => {\n const { m, cm } = r;\n const reg = new RegExp(`\\\\$${m}`, 'g');\n if (onShaderMask) {\n onShaderMask = onShaderMask.replace(reg, cm);\n }\n if (onColorize) {\n onColorize = onColorize.replace(reg, cm);\n }\n if (onEffectMask) {\n onEffectMask = onEffectMask.replace(reg, cm);\n }\n });\n const methodParameters = fxClass.getMethodParameters(fxClass.uniforms, fxProps);\n const pm = methodParameters.length > 0 ? `, ${methodParameters}` : '';\n if (onShaderMask) {\n effectMethods += `\n float fx_${fx.key}_onShaderMask(float shaderMask ${pm}) {\n ${onShaderMask}\n }\n `;\n }\n if (onColorize) {\n effectMethods += `\n vec4 fx_${fx.key}_onColorize(float shaderMask, vec4 maskColor, vec4 shaderColor${pm}) {\n ${onColorize}\n }\n `;\n }\n if (onEffectMask) {\n effectMethods += `\n vec4 fx_${fx.key}_onEffectMask(float shaderMask, vec4 maskColor, vec4 shaderColor${pm}) {\n ${onEffectMask}\n }\n `;\n }\n });\n let sharedMethods = '';\n for (const m in methods) {\n sharedMethods += methods[m];\n }\n //fill main functions\n let currentMask = `mix(shaderColor, maskColor, clamp(-(lng_DefaultMask), 0.0, 1.0))`;\n let drawEffects = `\n\n `;\n for (let i = 0; i < effects.length; i++) {\n const current = effects[i];\n const pm = current.passParameters.length > 0 ? `, ${current.passParameters}` : '';\n const currentClass = effectContructors[current.name];\n if (currentClass.onShaderMask) {\n drawEffects += `\n shaderMask = fx_${current.target}_onShaderMask(shaderMask ${pm});\n `;\n }\n if (currentClass.onColorize) {\n drawEffects += `\n maskColor = fx_${current.target}_onColorize(shaderMask, maskColor, shaderColor${pm});\n `;\n }\n if (currentClass.onEffectMask) {\n currentMask = `fx_${current.target}_onEffectMask(shaderMask, maskColor, shaderColor${pm})`;\n }\n const next = effects[i + 1];\n if (next === undefined ||\n effectContructors[next.name].onEffectMask) {\n drawEffects += `\n shaderColor = ${currentMask};\n `;\n }\n }\n return {\n effects,\n uniforms,\n fragment: DynamicShader.fragment(declareUniforms, sharedMethods, effectMethods, drawEffects),\n vertex: DynamicShader.vertex(),\n };\n }\n static resolveMethodDuplicate(key, effectMethod, methodCollection, increment = 0) {\n const m = key + (increment > 0 ? increment : '');\n if (methodCollection[m] && methodCollection[m] !== effectMethod) {\n return this.resolveMethodDuplicate(key, effectMethod, methodCollection, ++increment);\n }\n return m;\n }\n static resolveDefaults(props, effectContructors) {\n return {\n effects: getResolvedEffect(props.effects, effectContructors),\n $dimensions: {\n width: 0,\n height: 0,\n },\n $alpha: 0,\n };\n }\n static makeCacheKey(props, effectContructors) {\n let fx = '';\n props.effects?.forEach((effect) => {\n const baseClass = effectContructors[effect.type];\n const key = baseClass.getEffectKey(effect.props || {});\n fx += `,${key}`;\n });\n return `DynamicShader${fx}`;\n }\n static z$__type__Props;\n static vertex = () => `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `;\n static fragment = (uniforms, methods, effectMethods, drawEffects) => `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n #define PI 3.14159265359\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_alpha;\n uniform float u_radius;\n uniform sampler2D u_texture;\n uniform float u_pixelRatio;\n\n ${uniforms}\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n ${methods}\n\n ${effectMethods}\n\n void main() {\n vec2 p = v_textureCoordinate.xy * u_dimensions - u_dimensions * 0.5;\n vec2 d = abs(p) - (u_dimensions) * 0.5;\n float lng_DefaultMask = min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n\n vec4 shaderColor = vec4(0.0);\n float shaderMask = lng_DefaultMask;\n\n vec4 maskColor = texture2D(u_texture, v_textureCoordinate) * v_color;\n\n shaderColor = mix(shaderColor, maskColor, clamp(-(lng_DefaultMask + 0.5), 0.0, 1.0));\n\n ${drawEffects}\n\n gl_FragColor = shaderColor * u_alpha;\n }\n `;\n}\n//# sourceMappingURL=DynamicShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader, } from '../WebGlCoreShader.js';\n/**\n * Similar to the {@link DefaultShader} but cuts out 4 rounded rectangle corners\n * as defined by the specified corner {@link RoundedRectangleProps.radius}\n */\nexport class RoundedRectangle extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2f' },\n { name: 'u_dimensions', uniform: 'uniform2fv' },\n { name: 'u_radius', uniform: 'uniform1f' },\n ],\n });\n }\n static z$__type__Props;\n static resolveDefaults(props) {\n return {\n radius: props.radius || 10,\n $dimensions: {\n width: 0,\n height: 0,\n },\n };\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n bindProps(props) {\n this.setUniform('u_radius', props.radius);\n }\n canBatchShaderProps(propsA, propsB) {\n return (propsA.radius === propsB.radius &&\n propsA.$dimensions.width === propsB.$dimensions.width &&\n propsA.$dimensions.height === propsB.$dimensions.height);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `,\n fragment: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_radius;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n float boxDist(vec2 p, vec2 size, float radius){\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n\n float fillMask(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate) * v_color;\n vec2 halfDimensions = u_dimensions * 0.5;\n\n float d = boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions + 0.5, u_radius);\n gl_FragColor = mix(vec4(0.0), color, fillMask(d));\n }\n `,\n };\n}\n//# sourceMappingURL=RoundedRectangle.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../lib/utils.js';\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\nconst IDENTITY_MATRIX_3x3 = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]);\n/**\n * SdfShader supports multi-channel and single-channel signed distance field textures.\n *\n * @remarks\n * This Shader is used by the {@link SdfTextRenderer}. Do not use thie Shader\n * directly. Instead create a Text Node and assign a SDF font family to it.\n *\n * @internalRemarks\n * The only thing this shader does to support multi-channel SDFs is to\n * add a median function to the fragment shader. If this one function call\n * ends up being a performance bottleneck we can always look at ways to\n * remove it.\n */\nexport class SdfShader extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_transform', uniform: 'uniformMatrix3fv' },\n { name: 'u_scrollY', uniform: 'uniform1f' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2f' },\n { name: 'u_color', uniform: 'uniform4fv' },\n { name: 'u_size', uniform: 'uniform1f' },\n { name: 'u_distanceRange', uniform: 'uniform1f' },\n { name: 'u_debug', uniform: 'uniform1i' },\n ],\n });\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n bindProps(props) {\n const resolvedProps = SdfShader.resolveDefaults(props);\n for (const key in resolvedProps) {\n if (key === 'transform') {\n this.setUniform('u_transform', false, resolvedProps[key]);\n }\n else if (key === 'scrollY') {\n this.setUniform('u_scrollY', resolvedProps[key]);\n }\n else if (key === 'color') {\n const components = getNormalizedRgbaComponents(resolvedProps.color);\n this.setUniform('u_color', components);\n }\n else if (key === 'size') {\n this.setUniform('u_size', resolvedProps[key]);\n }\n else if (key === 'distanceRange') {\n this.setUniform('u_distanceRange', resolvedProps[key]);\n }\n else if (key === 'debug') {\n this.setUniform('u_debug', resolvedProps[key] ? 1.0 : 0.0);\n }\n }\n }\n static resolveDefaults(props = {}) {\n return {\n transform: props.transform ?? IDENTITY_MATRIX_3x3,\n scrollY: props.scrollY ?? 0,\n color: props.color ?? 0xffffffff,\n size: props.size ?? 16,\n distanceRange: props.distanceRange ?? 1.0,\n debug: props.debug ?? false,\n };\n }\n static shaderSources = {\n vertex: `\n // an attribute is an input (in) to a vertex shader.\n // It will receive data from a buffer\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n\n uniform vec2 u_resolution;\n uniform mat3 u_transform;\n uniform float u_scrollY;\n uniform float u_pixelRatio;\n uniform float u_size;\n\n varying vec2 v_texcoord;\n\n void main() {\n vec2 scrolledPosition = a_position * u_size - vec2(0, u_scrollY);\n vec2 transformedPosition = (u_transform * vec3(scrolledPosition, 1)).xy;\n gl_Position = vec4((transformedPosition * u_pixelRatio / u_resolution * 2.0 - 1.0) * vec2(1, -1), 0, 1);\n v_texcoord = a_textureCoordinate;\n }\n `,\n fragment: `\n precision highp float;\n\n uniform vec4 u_color;\n uniform sampler2D u_texture;\n uniform float u_distanceRange;\n uniform float u_pixelRatio;\n uniform int u_debug;\n\n varying vec2 v_texcoord;\n\n float median(float r, float g, float b) {\n return max(min(r, g), min(max(r, g), b));\n }\n\n void main() {\n vec3 sample = texture2D(u_texture, v_texcoord).rgb;\n if (u_debug == 1) {\n gl_FragColor = vec4(sample.r, sample.g, sample.b, 1.0);\n return;\n }\n float scaledDistRange = u_distanceRange * u_pixelRatio;\n float sigDist = scaledDistRange * (median(sample.r, sample.g, sample.b) - 0.5);\n float opacity = clamp(sigDist + 0.5, 0.0, 1.0) * u_color.a;\n\n // Build the final color.\n // IMPORTANT: We must premultiply the color by the alpha value before returning it.\n gl_FragColor = vec4(u_color.r * opacity, u_color.g * opacity, u_color.b * opacity, opacity);\n }\n `,\n };\n}\n//# sourceMappingURL=SdfShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Masks the current maskcolor with rounded corners similar to {@link RoundedRectangle}\n */\nexport class RadiusEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radius';\n static getEffectKey() {\n return `radius`;\n }\n static uniforms = {\n radius: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n boxDist: `\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n `,\n };\n static resolveDefaults(props) {\n return {\n radius: props.radius ?? 10,\n };\n }\n static onShaderMask = `\n vec2 halfDimensions = u_dimensions * 0.5;\n float r = radius[0] * step(v_textureCoordinate.x, 0.5) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[1] * step(0.5, v_textureCoordinate.x) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[2] * step(0.5, v_textureCoordinate.x) * step(0.5, v_textureCoordinate.y);\n r = r + radius[3] * step(v_textureCoordinate.x, 0.5) * step(0.5, v_textureCoordinate.y);\n return $boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions, r);\n `;\n static onEffectMask = `\n return mix(vec4(0.0), maskColor, $fillMask(shaderMask));\n `;\n}\n//# sourceMappingURL=RadiusEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderEffect renders a border along all edges of an element\n */\nexport class BorderEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'border';\n static getEffectKey() {\n return `border`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static onEffectMask = `\n float mask = clamp(shaderMask + width, 0.0, 1.0) - clamp(shaderMask, 0.0, 1.0);\n return mix(shaderColor, mix(shaderColor, maskColor, maskColor.a), mask);\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Linear Gradient effect over a effect mask\n */\nexport class LinearGradientEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'linearGradient';\n static getEffectKey(props) {\n return `linearGradient${props.colors.length}`;\n }\n static resolveDefaults(props) {\n const colors = props.colors ?? [0xff000000, 0xffffffff];\n let stops = props.stops || [];\n if (stops.length === 0 || stops.length !== colors.length) {\n const colorsL = colors.length;\n let i = 0;\n const tmp = stops;\n for (; i < colorsL; i++) {\n if (stops[i]) {\n tmp[i] = stops[i];\n if (stops[i - 1] === undefined && tmp[i - 2] !== undefined) {\n tmp[i - 1] = tmp[i - 2] + (stops[i] - tmp[i - 2]) / 2;\n }\n }\n else {\n tmp[i] = i * (1 / (colors.length - 1));\n }\n }\n stops = tmp;\n }\n return {\n colors,\n stops,\n angle: props.angle ?? 0,\n };\n }\n static uniforms = {\n angle: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n colors: {\n value: 0xffffffff,\n validator: (rgbas) => {\n const cols = rgbas.map((rgbas) => getNormalizedRgbaComponents(rgbas));\n return cols.reduce((acc, val) => acc.concat(val), []);\n },\n size: (props) => props.colors.length,\n method: 'uniform4fv',\n type: 'vec4',\n },\n stops: {\n value: [],\n size: (props) => props.colors.length,\n method: 'uniform1fv',\n type: 'float',\n },\n };\n static methods = {\n fromLinear: `\n vec4 function(vec4 linearRGB) {\n vec4 higher = vec4(1.055)*pow(linearRGB, vec4(1.0/2.4)) - vec4(0.055);\n vec4 lower = linearRGB * vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n `,\n toLinear: `\n vec4 function(vec4 sRGB) {\n vec4 higher = pow((sRGB + vec4(0.055))/vec4(1.055), vec4(2.4));\n vec4 lower = sRGB/vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n `,\n calcPoint: `\n vec2 function(float d, float angle) {\n return d * vec2(cos(angle), sin(angle)) + (u_dimensions * 0.5);\n }\n `,\n };\n static ColorLoop = (amount) => {\n let loop = '';\n for (let i = 2; i < amount; i++) {\n loop += `colorOut = mix(colorOut, colors[${i}], clamp((dist - stops[${i - 1}]) / (stops[${i}] - stops[${i - 1}]), 0.0, 1.0));`;\n }\n return loop;\n };\n static onColorize = (props) => {\n const colors = props.colors.length || 1;\n return `\n float a = angle - (PI / 180.0 * 90.0);\n float lineDist = abs(u_dimensions.x * cos(a)) + abs(u_dimensions.y * sin(a));\n vec2 f = $calcPoint(lineDist * 0.5, a);\n vec2 t = $calcPoint(lineDist * 0.5, a + PI);\n vec2 gradVec = t - f;\n float dist = dot(v_textureCoordinate.xy * u_dimensions - f, gradVec) / dot(gradVec, gradVec);\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = $fromLinear(mix($toLinear(colors[0]), $toLinear(colors[1]), stopCalc));\n ${this.ColorLoop(colors)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `;\n };\n}\n//# sourceMappingURL=LinearGradientEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Grayscale effect grayscales the color values of the current mask color\n */\nexport class GrayscaleEffect extends ShaderEffect {\n name = 'grayscale';\n static getEffectKey() {\n return `grayscale`;\n }\n static resolveDefaults(props) {\n return {\n amount: props.amount ?? 1,\n };\n }\n static uniforms = {\n amount: {\n value: 1,\n method: 'uniform1f',\n type: 'float',\n },\n };\n static onColorize = `\n float grayness = 0.2 * maskColor.r + 0.6 * maskColor.g + 0.2 * maskColor.b;\n return vec4(amount * vec3(grayness) + (1.0 - amount) * maskColor.rgb, maskColor.a);\n `;\n}\n//# sourceMappingURL=GrayscaleEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the right side of an element\n */\nexport class BorderRightEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderRight';\n static getEffectKey() {\n return `borderRight`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(u_dimensions.x - width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderRightEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the top side of an element\n */\nexport class BorderTopEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderTop';\n static getEffectKey() {\n return `borderTop`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(0.0, width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderTopEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the bottom side of an element\n */\nexport class BorderBottomEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderBottom';\n static getEffectKey() {\n return `borderBottom`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(0.0, u_dimensions.y - width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderBottomEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the left of an element\n */\nexport class BorderLeftEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderLeft';\n static getEffectKey() {\n return `borderLeft`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderLeftEffect.js.map","import { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Renders a Glitch effect using the incoming texture\n */\nexport class GlitchEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'glitch';\n static getEffectKey(props) {\n return `glitch`;\n }\n static resolveDefaults(props) {\n return {\n amplitude: props.amplitude ?? 0.2,\n narrowness: props.narrowness ?? 4.0,\n blockiness: props.blockiness ?? 2.0,\n minimizer: props.minimizer ?? 8.0,\n time: props.time ?? Date.now(),\n };\n }\n static uniforms = {\n amplitude: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n narrowness: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n blockiness: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n minimizer: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n time: {\n value: 0,\n method: 'uniform1f',\n validator: (value) => {\n return (Date.now() - value) % 1000;\n },\n type: 'float',\n },\n };\n static methods = {\n rand: `\n float function(vec2 p, float time) {\n float t = floor(time * 20.) / 10.;\n return fract(sin(dot(p, vec2(t * 12.9898, t * 78.233))) * 43758.5453);\n }\n `,\n noise: `\n float function(vec2 uv, float blockiness, float time) {\n vec2 lv = fract(uv);\n vec2 id = floor(uv);\n\n float n1 = rand(id, time);\n float n2 = rand(id+vec2(1,0), time);\n float n3 = rand(id+vec2(0,1), time);\n float n4 = rand(id+vec2(1,1), time);\n vec2 u = smoothstep(0.0, 1.0 + blockiness, lv);\n return mix(mix(n1, n2, u.x), mix(n3, n4, u.x), u.y);\n }\n `,\n fbm: `\n float function(vec2 uv, int count, float blockiness, float complexity, float time) {\n float val = 0.0;\n float amp = 0.5;\n const int MAX_ITERATIONS = 10;\n\n for(int i = 0; i < MAX_ITERATIONS; i++) {\n if(i >= count) {break;}\n val += amp * noise(uv, blockiness, time);\n amp *= 0.5;\n uv *= complexity;\n }\n return val;\n }\n `,\n };\n static onColorize = `\n vec2 uv = v_textureCoordinate.xy;\n float aspect = u_dimensions.x / u_dimensions.y;\n vec2 a = vec2(uv.x * aspect , uv.y);\n vec2 uv2 = vec2(a.x / u_dimensions.x, exp(a.y));\n\n float shift = amplitude * pow($fbm(uv2, 4, blockiness, narrowness, time), minimizer);\n float colR = texture2D(u_texture, vec2(uv.x + shift, uv.y)).r * (1. - shift);\n float colG = texture2D(u_texture, vec2(uv.x - shift, uv.y)).g * (1. - shift);\n float colB = texture2D(u_texture, vec2(uv.x - shift, uv.y)).b * (1. - shift);\n\n vec3 f = vec3(colR, colG, colB);\n return vec4(f, texture2D(u_texture, vec2(uv.x - shift, uv.y)).a);\n `;\n}\n//# sourceMappingURL=GlitchEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\nexport class FadeOutEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'fadeOut';\n static getEffectKey() {\n return `fadeOut`;\n }\n static uniforms = {\n fade: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static resolveDefaults(props) {\n return {\n fade: props.fade ?? 10,\n };\n }\n static onColorize = `\n vec2 point = v_textureCoordinate.xy * u_dimensions.xy;\n vec2 pos1;\n vec2 pos2;\n vec2 d;\n float c;\n vec4 result = maskColor;\n\n\n if(fade[0] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x, point.y + fade[0]);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[1] > 0.0) {\n pos1 = vec2(point.x - u_dimensions.x - fade[1], v_textureCoordinate.y);\n pos2 = vec2(point.x - u_dimensions.x, v_textureCoordinate.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[2] > 0.0) {\n pos1 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y - fade[2]);\n pos2 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[3] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x + fade[3], point.y);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n return result;\n `;\n}\n//# sourceMappingURL=FadeOutEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\nexport class RadialGradientEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radialGradient';\n static getEffectKey(props) {\n return `radialGradient${props.colors.length}`;\n }\n static resolveDefaults(props) {\n const colors = props.colors ?? [0xff000000, 0xffffffff];\n let stops = props.stops || [];\n if (stops.length === 0 || stops.length !== colors.length) {\n const colorsL = colors.length;\n let i = 0;\n const tmp = stops;\n for (; i < colorsL; i++) {\n if (stops[i]) {\n tmp[i] = stops[i];\n if (stops[i - 1] === undefined && tmp[i - 2] !== undefined) {\n tmp[i - 1] = tmp[i - 2] + (stops[i] - tmp[i - 2]) / 2;\n }\n }\n else {\n tmp[i] = i * (1 / (colors.length - 1));\n }\n }\n stops = tmp;\n }\n return {\n colors,\n stops,\n width: props.width ?? 0,\n height: props.height ?? props.width ?? 0,\n pivot: props.pivot ?? [0.5, 0.5],\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n height: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n pivot: {\n value: [0.5, 0.5],\n method: 'uniform2fv',\n type: 'vec2',\n },\n colors: {\n value: 0xffffffff,\n validator: (rgbas) => {\n const cols = rgbas.map((rgbas) => getNormalizedRgbaComponents(rgbas));\n return cols.reduce((acc, val) => acc.concat(val), []);\n },\n size: (props) => props.colors.length,\n method: 'uniform4fv',\n type: 'vec4',\n },\n stops: {\n value: [],\n size: (props) => props.colors.length,\n method: 'uniform1fv',\n type: 'float',\n },\n };\n static ColorLoop = (amount) => {\n let loop = '';\n for (let i = 2; i < amount; i++) {\n loop += `colorOut = mix(colorOut, colors[${i}], clamp((dist - stops[${i - 1}]) / (stops[${i}] - stops[${i - 1}]), 0.0, 1.0));`;\n }\n return loop;\n };\n static onColorize = (props) => {\n const colors = props.colors.length || 1;\n return `\n vec2 point = v_textureCoordinate.xy * u_dimensions;\n vec2 projection = vec2(pivot.x * u_dimensions.x, pivot.y * u_dimensions.y);\n\n float dist = length((point - projection) / vec2(width, height));\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = mix(colors[0], colors[1], stopCalc);\n ${this.ColorLoop(colors)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `;\n };\n}\n//# sourceMappingURL=RadialGradientEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The RadialProgressEffect renders a border along all edges of an element\n */\nexport class RadialProgressEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radialProgress';\n static getEffectKey() {\n return `radialProgress`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n progress: props.progress ?? 0.5,\n offset: props.offset ?? 0,\n range: props.range ?? Math.PI * 2,\n rounded: props.rounded ?? false,\n radius: props.radius ?? 1,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n progress: {\n value: 0.5,\n method: 'uniform1f',\n type: 'float',\n },\n offset: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n range: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n rounded: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n validator: (value) => {\n return value ? 1 : 0;\n },\n },\n radius: {\n value: 1,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n rotateUV: `\n vec2 function(vec2 uv, float d) {\n float s = sin(d);\n float c = cos(d);\n mat2 rotMatrix = mat2(c, -s, s, c);\n return uv * rotMatrix;\n }\n `,\n drawDot: `\n float function(vec2 uv, vec2 p, float r) {\n uv += p;\n float circle = length(uv) - r;\n return clamp(-circle, 0.0, 1.0);\n }\n `,\n };\n static onEffectMask = `\n float outerRadius = radius * u_dimensions.y * 0.5;\n\n float endAngle = range * progress - 0.0005;\n\n vec2 uv = v_textureCoordinate.xy * u_dimensions.xy - u_dimensions * 0.5;\n\n uv = $rotateUV(uv, -(offset));\n float linewidth = width * u_pixelRatio;\n float circle = length(uv) - (outerRadius - linewidth) ;\n circle = abs(circle) - linewidth;\n circle = clamp(-circle, 0.0, 1.0);\n\n float angle = (atan(uv.x, -uv.y) / 3.14159265359 * 0.5);\n float p = endAngle / (PI * 2.);\n\n circle *= step(fract(angle), fract(p));\n\n circle = rounded < 1. ? circle : max(circle, $drawDot(uv, vec2(0, outerRadius - linewidth), linewidth));\n circle = rounded < 1. ? circle : max(circle, $drawDot($rotateUV(uv, -(endAngle)), vec2(0, outerRadius - linewidth), linewidth));\n\n return mix(shaderColor, maskColor, circle);\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=RadialProgressEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Masks the current maskcolor a holepunch effect with rounded corners similar to {@link RoundedRectangle}\n */\nexport class HolePunchEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'holePunch';\n static getEffectKey() {\n return `holePunch`;\n }\n static uniforms = {\n x: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n y: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n height: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n radius: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static resolveDefaults(props) {\n return {\n x: props.x || 0,\n y: props.y || 0,\n width: props.width || 50,\n height: props.height || 50,\n radius: props.radius ?? 0,\n };\n }\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n boxDist: `\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n `,\n };\n static onShaderMask = `\n vec2 halfDimensions = u_dimensions * 0.5;\n vec2 size = vec2(width, height) * 0.5;\n vec2 basePos = v_textureCoordinate.xy * u_dimensions.xy - vec2(x, y);\n vec2 pos = basePos - size;\n float r = radius[0] * step(pos.x, 0.5) * step(pos.y, 0.5);\n r = r + radius[1] * step(0.5, pos.x) * step(pos.y, 0.5);\n r = r + radius[2] * step(0.5, pos.x) * step(0.5, pos.y);\n r = r + radius[3] * step(pos.x, 0.5) * step(0.5, pos.y);\n return $boxDist(pos, size, r);\n `;\n static onEffectMask = `\n return mix(maskColor, vec4(0.0), $fillMask(shaderMask));\n `;\n}\n//# sourceMappingURL=HolePunchEffect.js.map","import { DefaultShader } from './renderers/webgl/shaders/DefaultShader.js';\nimport { DefaultShaderBatched } from './renderers/webgl/shaders/DefaultShaderBatched.js';\nimport { DynamicShader, } from './renderers/webgl/shaders/DynamicShader.js';\nimport { RoundedRectangle } from './renderers/webgl/shaders/RoundedRectangle.js';\nimport { SdfShader } from './renderers/webgl/shaders/SdfShader.js';\nimport { RadiusEffect } from './renderers/webgl/shaders/effects/RadiusEffect.js';\nimport { BorderEffect } from './renderers/webgl/shaders/effects/BorderEffect.js';\nimport { LinearGradientEffect, } from './renderers/webgl/shaders/effects/LinearGradientEffect.js';\nimport { GrayscaleEffect, } from './renderers/webgl/shaders/effects/GrayscaleEffect.js';\nimport { BorderRightEffect } from './renderers/webgl/shaders/effects/BorderRightEffect.js';\nimport { BorderTopEffect } from './renderers/webgl/shaders/effects/BorderTopEffect.js';\nimport { BorderBottomEffect } from './renderers/webgl/shaders/effects/BorderBottomEffect.js';\nimport { BorderLeftEffect } from './renderers/webgl/shaders/effects/BorderLeftEffect.js';\nimport { GlitchEffect, } from './renderers/webgl/shaders/effects/GlitchEffect.js';\nimport { FadeOutEffect, } from './renderers/webgl/shaders/effects/FadeOutEffect.js';\nimport { RadialGradientEffect, } from './renderers/webgl/shaders/effects/RadialGradientEffect.js';\nimport { RadialProgressEffect, } from './renderers/webgl/shaders/effects/RadialProgressEffect.js';\nimport { HolePunchEffect } from './renderers/webgl/shaders/effects/HolePunchEffect.js';\nexport class CoreShaderManager {\n shCache = new Map();\n shConstructors = {};\n attachedShader = null;\n effectConstructors = {};\n renderer;\n constructor() {\n this.registerShaderType('DefaultShader', DefaultShader);\n this.registerShaderType('DefaultShaderBatched', DefaultShaderBatched);\n this.registerShaderType('RoundedRectangle', RoundedRectangle);\n this.registerShaderType('DynamicShader', DynamicShader);\n this.registerShaderType('SdfShader', SdfShader);\n this.registerEffectType('border', BorderEffect);\n this.registerEffectType('borderBottom', BorderBottomEffect);\n this.registerEffectType('borderLeft', BorderLeftEffect);\n this.registerEffectType('borderRight', BorderRightEffect);\n this.registerEffectType('borderTop', BorderTopEffect);\n this.registerEffectType('fadeOut', FadeOutEffect);\n this.registerEffectType('linearGradient', LinearGradientEffect);\n this.registerEffectType('radialGradient', RadialGradientEffect);\n this.registerEffectType('grayscale', GrayscaleEffect);\n this.registerEffectType('glitch', GlitchEffect);\n this.registerEffectType('radius', RadiusEffect);\n this.registerEffectType('radialProgress', RadialProgressEffect);\n this.registerEffectType('holePunch', HolePunchEffect);\n }\n registerShaderType(shType, shClass) {\n this.shConstructors[shType] = shClass;\n }\n registerEffectType(effectType, effectClass) {\n this.effectConstructors[effectType] = effectClass;\n }\n getRegisteredEffects() {\n return this.effectConstructors;\n }\n getRegisteredShaders() {\n return this.shConstructors;\n }\n loadShader(shType, props) {\n if (!this.renderer) {\n throw new Error(`Renderer is not been defined`);\n }\n const ShaderClass = this.shConstructors[shType];\n if (!ShaderClass) {\n throw new Error(`Shader type \"${shType}\" is not registered`);\n }\n if (shType === 'DynamicShader') {\n return this.loadDynamicShader(props);\n }\n const resolvedProps = ShaderClass.resolveDefaults(props);\n const cacheKey = ShaderClass.makeCacheKey(resolvedProps) || ShaderClass.name;\n if (cacheKey && this.shCache.has(cacheKey)) {\n return {\n shader: this.shCache.get(cacheKey),\n props: resolvedProps,\n };\n }\n // @ts-expect-error ShaderClass WILL accept a Renderer\n const shader = new ShaderClass(this.renderer, props);\n if (cacheKey) {\n this.shCache.set(cacheKey, shader);\n }\n return {\n shader,\n props: resolvedProps,\n };\n }\n loadDynamicShader(props) {\n if (!this.renderer) {\n throw new Error(`Renderer is not been defined`);\n }\n const resolvedProps = DynamicShader.resolveDefaults(props, this.effectConstructors);\n const cacheKey = DynamicShader.makeCacheKey(resolvedProps, this.effectConstructors);\n if (cacheKey && this.shCache.has(cacheKey)) {\n return {\n shader: this.shCache.get(cacheKey),\n props: resolvedProps,\n };\n }\n const shader = new DynamicShader(this.renderer, props, this.effectConstructors);\n if (cacheKey) {\n this.shCache.set(cacheKey, shader);\n }\n return {\n shader: shader,\n props: resolvedProps,\n };\n }\n useShader(shader) {\n if (this.attachedShader === shader) {\n return;\n }\n if (this.attachedShader) {\n this.attachedShader.detach();\n }\n shader.attach();\n this.attachedShader = shader;\n }\n}\n//# sourceMappingURL=CoreShaderManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Class that keeps track of the invocations of Context methods when\n * the `enableContextSpy` renderer option is enabled.\n */\nexport class ContextSpy {\n data = {};\n reset() {\n this.data = {};\n }\n increment(name) {\n if (!this.data[name]) {\n this.data[name] = 0;\n }\n this.data[name]++;\n }\n getData() {\n return { ...this.data };\n }\n}\n//# sourceMappingURL=ContextSpy.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {} from '../textures/Texture.js';\n/**\n * Tests if the given location is a compressed texture container\n * @param url\n * @remarks\n * This function is used to determine if the given image url is a compressed\n * and only supports the following extensions: .ktx and .pvr\n * @returns\n */\nexport function isCompressedTextureContainer(url) {\n return /\\.(ktx|pvr)$/.test(url);\n}\n/**\n * Loads a compressed texture container\n * @param url\n * @returns\n */\nexport const loadCompressedTexture = async (url) => {\n const response = await fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n if (url.indexOf('.ktx') !== -1) {\n return loadKTXData(arrayBuffer);\n }\n return loadPVRData(arrayBuffer);\n};\n/**\n * Loads a KTX texture container and returns the texture data\n * @param buffer\n * @returns\n */\nconst loadKTXData = async (buffer) => {\n const view = new DataView(buffer);\n const littleEndian = view.getUint32(12) === 16909060 ? true : false;\n const mipmaps = [];\n const data = {\n glInternalFormat: view.getUint32(28, littleEndian),\n pixelWidth: view.getUint32(36, littleEndian),\n pixelHeight: view.getUint32(40, littleEndian),\n numberOfMipmapLevels: view.getUint32(56, littleEndian),\n bytesOfKeyValueData: view.getUint32(60, littleEndian),\n };\n let offset = 64;\n // Key Value Pairs of data start at byte offset 64\n // But the only known kvp is the API version, so skipping parsing.\n offset += data.bytesOfKeyValueData;\n for (let i = 0; i < data.numberOfMipmapLevels; i++) {\n const imageSize = view.getUint32(offset);\n offset += 4;\n mipmaps.push(view.buffer.slice(offset, imageSize));\n offset += imageSize;\n }\n return {\n data: {\n glInternalFormat: data.glInternalFormat,\n mipmaps,\n width: data.pixelWidth || 0,\n height: data.pixelHeight || 0,\n type: 'ktx',\n },\n premultiplyAlpha: false,\n };\n};\n/**\n * Loads a PVR texture container and returns the texture data\n * @param buffer\n * @returns\n */\nconst loadPVRData = async (buffer) => {\n // pvr header length in 32 bits\n const pvrHeaderLength = 13;\n // for now only we only support: COMPRESSED_RGB_ETC1_WEBGL\n const pvrFormatEtc1 = 0x8d64;\n const pvrWidth = 7;\n const pvrHeight = 6;\n const pvrMipmapCount = 11;\n const pvrMetadata = 12;\n const arrayBuffer = buffer;\n const header = new Int32Array(arrayBuffer, 0, pvrHeaderLength);\n // @ts-expect-error Object possibly undefined\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n const dataOffset = header[pvrMetadata] + 52;\n const pvrtcData = new Uint8Array(arrayBuffer, dataOffset);\n const mipmaps = [];\n const data = {\n pixelWidth: header[pvrWidth],\n pixelHeight: header[pvrHeight],\n numberOfMipmapLevels: header[pvrMipmapCount] || 0,\n };\n let offset = 0;\n let width = data.pixelWidth || 0;\n let height = data.pixelHeight || 0;\n for (let i = 0; i < data.numberOfMipmapLevels; i++) {\n const level = ((width + 3) >> 2) * ((height + 3) >> 2) * 8;\n const view = new Uint8Array(arrayBuffer, pvrtcData.byteOffset + offset, level);\n mipmaps.push(view);\n offset += level;\n width = width >> 1;\n height = height >> 1;\n }\n return {\n data: {\n glInternalFormat: pvrFormatEtc1,\n mipmaps: mipmaps,\n width: data.pixelWidth || 0,\n height: data.pixelHeight || 0,\n type: 'pvr',\n },\n premultiplyAlpha: false,\n };\n};\n//# sourceMappingURL=textureCompression.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\nimport { isCompressedTextureContainer, loadCompressedTexture, } from '../lib/textureCompression.js';\n/**\n * Texture consisting of an image loaded from a URL\n *\n * @remarks\n * The ImageTexture's {@link ImageTextureProps.src} prop defines the image URL\n * to be downloaded.\n *\n * By default, the texture's alpha values will be premultiplied into its color\n * values which is generally the desired setting before they are sent to the\n * texture's associated {@link Shader}. However, in special cases you may want\n * the Shader to receive straight (non-premultiplied) values. In that case you\n * can disable the default behavior by setting the\n * {@link ImageTextureProps.premultiplyAlpha} prop to `false`.\n */\nexport class ImageTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = ImageTexture.resolveDefaults(props);\n }\n hasAlphaChannel(mimeType) {\n return mimeType.indexOf('image/png') !== -1;\n }\n async getTextureData() {\n const { src, premultiplyAlpha } = this.props;\n if (!src) {\n return {\n data: null,\n };\n }\n if (src instanceof ImageData) {\n return {\n data: src,\n premultiplyAlpha,\n };\n }\n // Handle compressed textures\n if (isCompressedTextureContainer(src)) {\n return loadCompressedTexture(src);\n }\n if (this.txManager.imageWorkerManager) {\n return await this.txManager.imageWorkerManager.getImage(src, premultiplyAlpha);\n }\n else if (this.txManager.hasCreateImageBitmap) {\n const response = await fetch(src);\n const blob = await response.blob();\n const hasAlphaChannel = premultiplyAlpha ?? this.hasAlphaChannel(blob.type);\n return {\n data: await createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none',\n }),\n premultiplyAlpha: hasAlphaChannel,\n };\n }\n else {\n const img = new Image();\n img.src = src;\n await new Promise((resolve, reject) => {\n img.onload = () => resolve();\n img.onerror = () => reject(new Error(`Failed to load image`));\n }).catch((e) => {\n console.error(e);\n });\n return {\n data: img,\n premultiplyAlpha: premultiplyAlpha ?? true,\n };\n }\n }\n static makeCacheKey(props) {\n const resolvedProps = ImageTexture.resolveDefaults(props);\n // ImageTextures sourced by ImageData are non-cacheable\n if (resolvedProps.src instanceof ImageData) {\n return false;\n }\n return `ImageTexture,${resolvedProps.src},${resolvedProps.premultiplyAlpha}`;\n }\n static resolveDefaults(props) {\n return {\n src: props.src ?? '',\n premultiplyAlpha: props.premultiplyAlpha ?? true, // null,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=ImageTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Number of floating point numbers that represent a single glyph in the SDF vertex buffer.\n *\n * @remarks\n * The vertex buffer contains:\n * - 6 vertex positions\n * - 6 texture coordinates\n * - = 12 positions/coordinates per glyph\n *\n * Each vertex position and texture coordinate consist of 2 floating point numbers (x/y).\n * So there are 12 * 2 = 24 floating point numbers that make up a single glyph.\n */\nexport const FLOATS_PER_GLYPH = 24;\n//# sourceMappingURL=constants.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Gets the start conditions for the layout loop.\n *\n * @remarks\n * Returns `undefined` if the layout loop should not be run.\n *\n * @param fontSize\n * @param fontSizeRatio\n * @param sdfLineHeight\n * @param renderWindow\n * @param lineCache\n * @param textH\n * @returns\n */\nexport function getStartConditions(sdfFontSize, sdfLineHeight, lineHeight, verticalAlign, offsetY, fontSizeRatio, renderWindow, lineCache, textH) {\n // State variables\n const startLineIndex = Math.min(Math.max(renderWindow.firstLineIdx, 0), lineCache.length);\n // TODO: (fontSize / 6.4286 / fontSizeRatio) Adding this to the startY helps the text line up better with Canvas rendered text\n const sdfStartX = 0;\n let sdfVerticalAlignYOffset = 0;\n if (verticalAlign === 'middle') {\n sdfVerticalAlignYOffset = (sdfLineHeight - sdfFontSize) / 2;\n }\n else if (verticalAlign === 'bottom') {\n sdfVerticalAlignYOffset = sdfLineHeight - sdfFontSize;\n }\n const sdfOffsetY = offsetY / fontSizeRatio;\n const sdfStartY = sdfOffsetY + startLineIndex * sdfLineHeight + sdfVerticalAlignYOffset; // TODO: Figure out what determines the initial y offset of text.\n // Don't attempt to render anything if we know we're starting past the established end of the text\n if (textH && sdfStartY >= textH / fontSizeRatio) {\n return;\n }\n return {\n sdfX: sdfStartX,\n sdfY: sdfStartY,\n lineIndex: startLineIndex,\n };\n}\n//# sourceMappingURL=getStartConditions.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A wrapper Generator class that makes a generator peekable.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class PeekableIterator {\n iterator;\n peekBuffer = [];\n _lastIndex;\n constructor(iterator, indexBase = 0) {\n this.iterator = iterator;\n this.iterator = iterator;\n this._lastIndex = indexBase - 1;\n this.peekBuffer = [];\n }\n next() {\n const nextResult = this.peekBuffer.length > 0\n ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.peekBuffer.pop()\n : this.iterator.next();\n if (nextResult.done) {\n this._lastIndex = -1;\n }\n else {\n this._lastIndex++;\n }\n return nextResult;\n }\n peek() {\n if (this.peekBuffer.length > 0) {\n // We know that the buffer is not empty, so we can safely use the\n // non-null assertion operator\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.peekBuffer[0];\n }\n const result = this.iterator.next();\n this.peekBuffer.push(result);\n return result;\n }\n get lastIndex() {\n return this._lastIndex;\n }\n}\n//# sourceMappingURL=PeekableGenerator.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// Reversible Generator Wrapper Class\n/**\n * Generator function that yields each Unicode code point in the given string.\n */\nexport function* getUnicodeCodepoints(text, start = 0) {\n let i = start;\n while (i < text.length) {\n const codePoint = text.codePointAt(i);\n if (codePoint === undefined) {\n throw new Error('Invalid Unicode code point');\n }\n yield codePoint;\n i += codePoint <= 0xffff ? 1 : 2;\n }\n}\n//# sourceMappingURL=getUnicodeCodepoints.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { PeekableIterator } from './PeekableGenerator.js';\nimport { getUnicodeCodepoints } from './getUnicodeCodepoints.js';\n/**\n * Measures a single-line of text width ignoring any unmapped glyphs including line breaks\n *\n * @param text\n * @param shaperProps\n * @param shaper\n * @returns\n */\nexport function measureText(text, shaperProps, shaper) {\n const glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, 0), 0));\n let width = 0;\n for (const glyph of glyphs) {\n if (glyph.mapped) {\n width += glyph.xAdvance;\n }\n }\n return width;\n}\n//# sourceMappingURL=measureText.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../../../../utils.js';\nimport { PeekableIterator } from './PeekableGenerator.js';\nimport { getUnicodeCodepoints } from './getUnicodeCodepoints.js';\nimport { measureText } from './measureText.js';\nexport function layoutText(curLineIndex, startX, startY, text, textAlign, width, height, fontSize, lineHeight, letterSpacing, \n/**\n * Mutated\n */\nvertexBuffer, contain, \n/**\n * Mutated\n */\nlineCache, rwSdf, trFontFace, forceFullLayoutCalc, scrollable, overflowSuffix, maxLines) {\n assertTruthy(trFontFace, 'Font face must be loaded');\n assertTruthy(trFontFace.loaded, 'Font face must be loaded');\n assertTruthy(trFontFace.data, 'Font face must be loaded');\n assertTruthy(trFontFace.shaper, 'Font face must be loaded');\n // Regardless of fontSize (or other scaling properties), we layout the vertices of each glyph\n // using the fixed coordinate space determined by font size used to produce the atlas.\n // Scaling for display is handled by shader uniforms inexpensively.\n // So we have:\n // - vertex space: the space in which the vertices of each glyph are laid out\n // - screen space: the screen pixel space\n // Input properties such as x, y, w, fontSize, letterSpacing, etc. are all expressed in screen space.\n // We convert these to the vertex space by dividing them the `fontSizeRatio` factor.\n /**\n * See above\n */\n const fontSizeRatio = fontSize / trFontFace.data.info.size;\n /**\n * `lineHeight` in vertex coordinates\n */\n const vertexLineHeight = lineHeight / fontSizeRatio;\n /**\n * `w` in vertex coordinates\n */\n const vertexW = width / fontSizeRatio;\n /**\n * `letterSpacing` in vertex coordinates\n */\n const vertexLSpacing = letterSpacing / fontSizeRatio;\n const startingLineCacheEntry = lineCache[curLineIndex];\n const startingCodepointIndex = startingLineCacheEntry?.codepointIndex || 0;\n const startingMaxX = startingLineCacheEntry?.maxX || 0;\n const startingMaxY = startingLineCacheEntry?.maxY || 0;\n let maxX = startingMaxX;\n let maxY = startingMaxY;\n let curX = startX;\n let curY = startY;\n let bufferOffset = 0;\n /**\n * Buffer offset to last word boundry. This is -1 when we aren't in a word boundry.\n */\n const lastWord = {\n codepointIndex: -1,\n bufferOffset: -1,\n xStart: -1,\n };\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const shaper = trFontFace.shaper;\n const shaperProps = {\n letterSpacing: vertexLSpacing,\n };\n // Get glyphs\n let glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, startingCodepointIndex), startingCodepointIndex));\n let glyphResult;\n let curLineBufferStart = -1;\n const bufferLineInfos = [];\n const vertexTruncateHeight = height / fontSizeRatio;\n const overflowSuffVertexWidth = measureText(overflowSuffix, shaperProps, shaper);\n // Line-by-line layout\n let moreLines = true;\n while (moreLines) {\n const nextLineWillFit = (maxLines === 0 || curLineIndex + 1 < maxLines) &&\n (contain !== 'both' ||\n scrollable ||\n curY + vertexLineHeight + trFontFace.maxCharHeight <=\n vertexTruncateHeight);\n const lineVertexW = nextLineWillFit\n ? vertexW\n : vertexW - overflowSuffVertexWidth;\n /**\n * Vertex X position to the beginning of the last word boundary. This becomes -1 when we start traversing a word.\n */\n let xStartLastWordBoundary = 0;\n const lineIsBelowWindowTop = curY + vertexLineHeight >= rwSdf.y1;\n const lineIsAboveWindowBottom = curY <= rwSdf.y2;\n const lineIsWithinWindow = lineIsBelowWindowTop && lineIsAboveWindowBottom;\n // Layout glyphs in this line\n // Any break statements in this while loop will trigger a line break\n while ((glyphResult = glyphs.next()) && !glyphResult.done) {\n const glyph = glyphResult.value;\n if (curLineIndex === lineCache.length) {\n lineCache.push({\n codepointIndex: glyph.cluster,\n maxY,\n maxX,\n });\n }\n else if (curLineIndex > lineCache.length) {\n throw new Error('Unexpected lineCache length');\n }\n // If we encounter a word boundary (white space or newline) we invalidate\n // the lastWord and set the xStartLastWordBoundary if we haven't already.\n if (glyph.codepoint === 32 || glyph.codepoint === 10) {\n if (lastWord.codepointIndex !== -1) {\n lastWord.codepointIndex = -1;\n xStartLastWordBoundary = curX;\n }\n }\n else if (lastWord.codepointIndex === -1) {\n lastWord.codepointIndex = glyph.cluster;\n lastWord.bufferOffset = bufferOffset;\n lastWord.xStart = xStartLastWordBoundary;\n }\n if (glyph.mapped) {\n // Mapped glyph\n const charEndX = curX + glyph.xOffset + glyph.width;\n // Word wrap check\n if (\n // We are containing the text\n contain !== 'none' &&\n // The current glyph reaches outside the contained width\n charEndX >= lineVertexW &&\n // There is a last word that we can break to the next line\n lastWord.codepointIndex !== -1 &&\n // Prevents infinite loop when a single word is longer than the width\n lastWord.xStart > 0) {\n // The current word is about to go off the edge of the container width\n // Reinitialize the iterator starting at the last word\n // and proceeding to the next line\n if (nextLineWillFit) {\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, lastWord.codepointIndex), lastWord.codepointIndex));\n bufferOffset = lastWord.bufferOffset;\n break;\n }\n else {\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(overflowSuffix, 0), 0));\n curX = lastWord.xStart;\n bufferOffset = lastWord.bufferOffset;\n // HACK: For the rest of the line when inserting the overflow suffix,\n // set contain = 'none' to prevent an infinite loop.\n contain = 'none';\n }\n }\n else {\n // This glyph fits, so we can add it to the buffer\n const quadX = curX + glyph.xOffset;\n const quadY = curY + glyph.yOffset;\n // Only add to buffer for rendering if the line is within the render window\n if (lineIsWithinWindow) {\n if (curLineBufferStart === -1) {\n curLineBufferStart = bufferOffset;\n }\n const atlasEntry = trFontFace.getAtlasEntry(glyph.glyphId);\n // Add texture coordinates\n const u = atlasEntry.x / trFontFace.data.common.scaleW;\n const v = atlasEntry.y / trFontFace.data.common.scaleH;\n const uvWidth = atlasEntry.width / trFontFace.data.common.scaleW;\n const uvHeight = atlasEntry.height / trFontFace.data.common.scaleH;\n // TODO: (Performance) We can optimize this by using ELEMENT_ARRAY_BUFFER\n // eliminating the need to duplicate vertices\n // Top-left\n vertexBuffer[bufferOffset++] = quadX;\n vertexBuffer[bufferOffset++] = quadY;\n vertexBuffer[bufferOffset++] = u;\n vertexBuffer[bufferOffset++] = v;\n // Top-right\n vertexBuffer[bufferOffset++] = quadX + glyph.width;\n vertexBuffer[bufferOffset++] = quadY;\n vertexBuffer[bufferOffset++] = u + uvWidth;\n vertexBuffer[bufferOffset++] = v;\n // Bottom-left\n vertexBuffer[bufferOffset++] = quadX;\n vertexBuffer[bufferOffset++] = quadY + glyph.height;\n vertexBuffer[bufferOffset++] = u;\n vertexBuffer[bufferOffset++] = v + uvHeight;\n // Bottom-right\n vertexBuffer[bufferOffset++] = quadX + glyph.width;\n vertexBuffer[bufferOffset++] = quadY + glyph.height;\n vertexBuffer[bufferOffset++] = u + uvWidth;\n vertexBuffer[bufferOffset++] = v + uvHeight;\n }\n maxY = Math.max(maxY, quadY + glyph.height);\n maxX = Math.max(maxX, quadX + glyph.width);\n curX += glyph.xAdvance;\n }\n }\n else {\n // Unmapped character\n // Handle newlines\n if (glyph.codepoint === 10) {\n if (nextLineWillFit) {\n // The whole line fit, so we can break to the next line\n break;\n }\n else {\n // The whole line won't fit, so we need to add the overflow suffix\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(overflowSuffix, 0), 0));\n // HACK: For the rest of the line when inserting the overflow suffix,\n // set contain = 'none' to prevent an infinite loop.\n contain = 'none';\n }\n }\n }\n }\n // Prepare for the next line...\n if (curLineBufferStart !== -1) {\n bufferLineInfos.push({\n bufferStart: curLineBufferStart,\n bufferEnd: bufferOffset,\n });\n curLineBufferStart = -1;\n }\n curX = 0;\n curY += vertexLineHeight;\n curLineIndex++;\n lastWord.codepointIndex = -1;\n xStartLastWordBoundary = 0;\n // Figure out if there are any more lines to render...\n if (!forceFullLayoutCalc && contain === 'both' && curY > rwSdf.y2) {\n // Stop layout calculation early (for performance purposes) if:\n // - We're not forcing a full layout calculation (for width/height calculation)\n // - ...and we're containing the text vertically+horizontally (contain === 'both')\n // - ...and we have a render window\n // - ...and the next line is below the bottom of the render window\n moreLines = false;\n }\n else if (glyphResult && glyphResult.done) {\n // If we've reached the end of the text, we know we're done\n moreLines = false;\n }\n else if (!nextLineWillFit) {\n // If we're contained vertically+horizontally (contain === 'both')\n // but not scrollable and the next line won't fit, we're done.\n moreLines = false;\n }\n }\n // Use textAlign to determine if we need to adjust the x position of the text\n // in the buffer line by line\n if (textAlign === 'center') {\n const vertexTextW = contain === 'none' ? maxX : vertexW;\n for (let i = 0; i < bufferLineInfos.length; i++) {\n const line = bufferLineInfos[i];\n // - 4 = the x position of a rightmost vertex\n const lineWidth = \n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n vertexBuffer[line.bufferEnd - 4] - vertexBuffer[line.bufferStart];\n const xOffset = (vertexTextW - lineWidth) / 2;\n for (let j = line.bufferStart; j < line.bufferEnd; j += 4) {\n vertexBuffer[j] += xOffset;\n }\n }\n }\n else if (textAlign === 'right') {\n const vertexTextW = contain === 'none' ? maxX : vertexW;\n for (let i = 0; i < bufferLineInfos.length; i++) {\n const line = bufferLineInfos[i];\n const lineWidth = line.bufferEnd === line.bufferStart\n ? 0\n : // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n vertexBuffer[line.bufferEnd - 4] - vertexBuffer[line.bufferStart];\n const xOffset = vertexTextW - lineWidth;\n for (let j = line.bufferStart; j < line.bufferEnd; j += 4) {\n vertexBuffer[j] += xOffset;\n }\n }\n }\n assertTruthy(glyphResult);\n return {\n bufferNumFloats: bufferOffset,\n bufferNumQuads: bufferOffset / 16,\n layoutNumCharacters: glyphResult.done\n ? text.length - startingCodepointIndex\n : glyphResult.value.cluster - startingCodepointIndex + 1,\n fullyProcessed: !!glyphResult.done,\n maxX,\n maxY,\n };\n}\n//# sourceMappingURL=layoutText.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Round up to the nearest multiple of the given number.\n *\n * @param value\n * @param multiple\n * @returns\n */\nexport function roundUpToMultiple(value, multiple) {\n return Math.ceil(value / multiple) * multiple;\n}\n/**\n * Round down to the nearest multiple of the given number.\n *\n * @param value\n * @param multiple\n * @returns\n */\nexport function roundDownToMultiple(value, multiple) {\n return Math.floor(value / multiple) * multiple;\n}\n//# sourceMappingURL=util.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { isBoundPositive } from '../../../../lib/utils.js';\nimport { roundDownToMultiple, roundUpToMultiple } from './util.js';\n/**\n * Create a render window from the given parameters.\n *\n * @remarks\n * The render window is a rectangle that defines the area of the text that\n * should be rendered. It is used to skip rendering parts of the text that\n * are outside of the render window. The render window is relative to the\n * text's top left corner of the overrall text.\n *\n * @param x The x coordinate of the text element's top left corner relative to the screen.\n * @param y The y coordinate of the text element's top left corner relative to the screen.\n * @param scrollY The amount of pixels to scroll the text vertically.\n * @param lineHeight The number of extra lines to render above and below the visible window.\n * @param visibleWindow The visible window of the text element relative to the screen\n * @returns\n */\nexport function setRenderWindow(outRenderWindow, x, y, scrollY, lineHeight, bufferMargin, visibleWindow, fontSizeRatio) {\n const { screen, sdf } = outRenderWindow;\n if (!isBoundPositive(visibleWindow)) {\n screen.x1 = 0;\n screen.y1 = 0;\n screen.x2 = 0;\n screen.y2 = 0;\n sdf.x1 = 0;\n sdf.y1 = 0;\n sdf.x2 = 0;\n sdf.y2 = 0;\n outRenderWindow.numLines = 0;\n outRenderWindow.firstLineIdx = 0;\n }\n else {\n const x1 = visibleWindow.x1 - x;\n const x2 = x1 + (visibleWindow.x2 - visibleWindow.x1);\n const y1Base = visibleWindow.y1 - y + scrollY;\n const y1 = roundDownToMultiple(y1Base - bufferMargin, lineHeight || 1);\n const y2 = roundUpToMultiple(y1Base + (visibleWindow.y2 - visibleWindow.y1) + bufferMargin, lineHeight || 1);\n screen.x1 = x1;\n screen.y1 = y1;\n screen.x2 = x2;\n screen.y2 = y2;\n sdf.x1 = x1 / fontSizeRatio;\n sdf.y1 = y1 / fontSizeRatio;\n sdf.x2 = x2 / fontSizeRatio;\n sdf.y2 = y2 / fontSizeRatio;\n outRenderWindow.numLines = Math.ceil((y2 - y1) / lineHeight);\n outRenderWindow.firstLineIdx = lineHeight ? Math.floor(y1 / lineHeight) : 0;\n }\n outRenderWindow.valid = true;\n}\n//# sourceMappingURL=setRenderWindow.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport memize from 'memize';\nconst weightConversions = {\n normal: 400,\n bold: 700,\n bolder: 900,\n lighter: 100,\n};\nconst fontWeightToNumber = (weight) => {\n if (typeof weight === 'number') {\n return weight;\n }\n return weightConversions[weight] || 400;\n};\nfunction rawResolveFontToUse(familyMapsByPriority, family, weightIn, style, stretch) {\n let weight = fontWeightToNumber(weightIn);\n for (const fontFamiles of familyMapsByPriority) {\n const fontFaces = fontFamiles[family];\n if (!fontFaces) {\n continue;\n }\n if (fontFaces.size === 1) {\n // No Exact match found, find nearest weight match\n console.warn(`TrFontManager: Only one font face found for family: '${family}' - will be used for all weights and styles`);\n return fontFaces.values().next().value;\n }\n const weightMap = new Map();\n for (const fontFace of fontFaces) {\n const fontFamilyWeight = fontWeightToNumber(fontFace.descriptors.weight);\n if (fontFamilyWeight === weight &&\n fontFace.descriptors.style === style &&\n fontFace.descriptors.stretch === stretch) {\n return fontFace;\n }\n weightMap.set(fontFamilyWeight, fontFace);\n }\n // No Exact match found, find nearest weight match\n const msg = `TrFontManager: No exact match: '${family} Weight: ${weight} Style: ${style} Stretch: ${stretch}'`;\n console.error(msg);\n // Follow the CSS font-weight algorithm to find the nearest weight match\n // https://www.w3.org/TR/2018/REC-css-fonts-3-20180920/#font-matching-algorithm\n if (weight === 400 && weightMap.has(500)) {\n return weightMap.get(500);\n }\n if (weight === 500 && weightMap.has(400)) {\n return weightMap.get(400);\n }\n if (weight < 400) {\n while (weight > 0) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight -= 100;\n }\n // reset back for the next loop\n weight = 600;\n }\n while (weight < 1000) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight += 100;\n }\n // finally check lower again\n weight = 500;\n while (weight > 0) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight -= 100;\n }\n }\n return;\n}\nconst resolveFontToUse = memize(rawResolveFontToUse);\nexport class TrFontManager {\n textRenderers;\n constructor(textRenderers) {\n this.textRenderers = textRenderers;\n // Intentionally left blank\n }\n addFontFace(font) {\n // All the font face to all of the text renderers that support it\n for (const trId in this.textRenderers) {\n const tr = this.textRenderers[trId];\n if (tr && tr.isFontFaceSupported(font)) {\n tr.addFontFace(font);\n }\n }\n }\n /**\n * Utility method to resolve a single font face from a list of prioritized family maps based on\n * a set of font properties.\n *\n * @remarks\n * These are to be used by a text renderer to resolve a font face if needed.\n *\n * @param familyMapsByPriority\n * @param props\n * @returns\n */\n static resolveFontFace(familyMapsByPriority, props) {\n const { fontFamily, fontWeight, fontStyle, fontStretch } = props;\n return resolveFontToUse(familyMapsByPriority, fontFamily, fontWeight, fontStyle, fontStretch);\n }\n}\n//# sourceMappingURL=TrFontManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createBound, intersectRect, copyRect, boundsOverlap, convertBoundToRect, } from '../../../lib/utils.js';\nimport { TextRenderer, } from '../TextRenderer.js';\nimport { SdfTrFontFace } from '../../font-face-types/SdfTrFontFace/SdfTrFontFace.js';\nimport { FLOATS_PER_GLYPH } from './internal/constants.js';\nimport { getStartConditions } from './internal/getStartConditions.js';\nimport { layoutText } from './internal/layoutText.js';\nimport { setRenderWindow, } from './internal/setRenderWindow.js';\nimport { TrFontManager } from '../../TrFontManager.js';\nimport { assertTruthy, mergeColorAlpha } from '../../../../utils.js';\nimport { WebGlCoreRenderOp } from '../../../renderers/webgl/WebGlCoreRenderOp.js';\nimport { BufferCollection } from '../../../renderers/webgl/internal/BufferCollection.js';\nimport { EventEmitter } from '../../../../common/EventEmitter.js';\n/**\n * Ephemeral rect object used for calculations\n */\nconst tmpRect = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n};\n/**\n * Singleton class for rendering text using signed distance fields.\n *\n * @remarks\n * SdfTextRenderer supports both single-channel and multi-channel signed distance fields.\n */\nexport class SdfTextRenderer extends TextRenderer {\n /**\n * Map of font family names to a set of font faces.\n */\n ssdfFontFamilies = {};\n msdfFontFamilies = {};\n fontFamilyArray = [\n this.ssdfFontFamilies,\n this.msdfFontFamilies,\n ];\n sdfShader;\n rendererBounds;\n constructor(stage) {\n super(stage);\n this.sdfShader = this.stage.shManager.loadShader('SdfShader').shader;\n this.rendererBounds = {\n x1: 0,\n y1: 0,\n x2: this.stage.options.appWidth,\n y2: this.stage.options.appHeight,\n };\n }\n //#region Overrides\n getPropertySetters() {\n return {\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n this.invalidateLayoutCache(state);\n },\n text: (state, value) => {\n state.props.text = value;\n this.invalidateLayoutCache(state);\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n this.invalidateLayoutCache(state);\n },\n color: (state, value) => {\n state.props.color = value;\n },\n x: (state, value) => {\n state.props.x = value;\n if (state.elementBounds.valid) {\n this.setElementBoundsX(state);\n // Only schedule an update if the text is not already rendered\n // (renderWindow is invalid) and the element possibly overlaps the screen\n // This is to avoid unnecessary updates when we know text is off-screen\n if (!state.renderWindow.valid &&\n boundsOverlap(state.elementBounds, this.rendererBounds)) {\n this.scheduleUpdateState(state);\n }\n }\n },\n y: (state, value) => {\n state.props.y = value;\n if (state.elementBounds.valid) {\n this.setElementBoundsY(state);\n // See x() for explanation\n if (!state.renderWindow.valid &&\n boundsOverlap(state.elementBounds, this.rendererBounds)) {\n this.scheduleUpdateState(state);\n }\n }\n },\n contain: (state, value) => {\n state.props.contain = value;\n this.invalidateLayoutCache(state);\n },\n width: (state, value) => {\n state.props.width = value;\n // Only invalidate layout cache if we're containing in the horizontal direction\n if (state.props.contain !== 'none') {\n this.invalidateLayoutCache(state);\n }\n },\n height: (state, value) => {\n state.props.height = value;\n // Only invalidate layout cache if we're containing in the vertical direction\n if (state.props.contain === 'both') {\n this.invalidateLayoutCache(state);\n }\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n this.invalidateLayoutCache(state);\n },\n scrollable: (state, value) => {\n state.props.scrollable = value;\n this.invalidateLayoutCache(state);\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n // Scrolling doesn't need to invalidate any caches, but it does need to\n // schedule an update\n this.scheduleUpdateState(state);\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n this.invalidateLayoutCache(state);\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n this.invalidateLayoutCache(state);\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n this.invalidateLayoutCache(state);\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n this.invalidateLayoutCache(state);\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n this.invalidateLayoutCache(state);\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n this.invalidateLayoutCache(state);\n },\n debug: (state, value) => {\n state.props.debug = value;\n },\n };\n }\n canRenderFont(props) {\n // TODO: Support matching on font stretch, weight and style (if/when needed)\n // For now we just match on the font family name\n // '$$SDF_FAILURE_TEST$$' is used to test the 'failure' event coming from text\n const { fontFamily } = props;\n return (fontFamily in this.ssdfFontFamilies ||\n fontFamily in this.msdfFontFamilies ||\n fontFamily === '$$SDF_FAILURE_TEST$$');\n }\n isFontFaceSupported(fontFace) {\n return fontFace instanceof SdfTrFontFace;\n }\n addFontFace(fontFace) {\n // Make sure the font face is an SDF font face (it should have already passed\n // the `isFontFaceSupported` check)\n assertTruthy(fontFace instanceof SdfTrFontFace);\n const familyName = fontFace.fontFamily;\n const fontFamiles = fontFace.type === 'ssdf'\n ? this.ssdfFontFamilies\n : fontFace.type === 'msdf'\n ? this.msdfFontFamilies\n : undefined;\n if (!fontFamiles) {\n console.warn(`Invalid font face type: ${fontFace.type}`);\n return;\n }\n let faceSet = fontFamiles[familyName];\n if (!faceSet) {\n faceSet = new Set();\n fontFamiles[familyName] = faceSet;\n }\n faceSet.add(fontFace);\n }\n createState(props) {\n return {\n props,\n status: 'initialState',\n updateScheduled: false,\n emitter: new EventEmitter(),\n lineCache: [],\n forceFullLayoutCalc: false,\n renderWindow: {\n screen: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n },\n sdf: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n },\n firstLineIdx: 0,\n numLines: 0,\n valid: false,\n },\n elementBounds: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n valid: false,\n },\n clippingRect: {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n valid: false,\n },\n bufferNumFloats: 0,\n bufferNumQuads: 0,\n vertexBuffer: undefined,\n webGlBuffers: null,\n bufferUploaded: false,\n textH: undefined,\n textW: undefined,\n distanceRange: 0,\n trFontFace: undefined,\n isRenderable: false,\n debugData: {\n updateCount: 0,\n layoutCount: 0,\n lastLayoutNumCharacters: 0,\n layoutSum: 0,\n drawSum: 0,\n drawCount: 0,\n bufferSize: 0,\n },\n };\n }\n updateState(state) {\n let { trFontFace } = state;\n const { textH, lineCache, debugData, forceFullLayoutCalc } = state;\n debugData.updateCount++;\n // On the first update call we need to set the status to loading\n if (state.status === 'initialState') {\n this.setStatus(state, 'loading');\n }\n // Resolve font face if we haven't yet\n if (!trFontFace) {\n trFontFace = this.resolveFontFace(state.props);\n state.trFontFace = trFontFace;\n if (!trFontFace) {\n const msg = `SdfTextRenderer: Could not resolve font face for family: '${state.props.fontFamily}'`;\n console.error(msg);\n this.setStatus(state, 'failed', new Error(msg));\n return;\n }\n trFontFace.texture.setRenderableOwner(state, state.isRenderable);\n }\n // If the font hasn't been loaded yet, stop here.\n // Listen for the 'loaded' event and forward fontLoaded event\n if (!trFontFace.loaded) {\n trFontFace.once('loaded', () => {\n this.scheduleUpdateState(state);\n });\n return;\n }\n // If the font is loaded then so should the data\n assertTruthy(trFontFace.data, 'Font face data should be loaded');\n const { text, fontSize, x, y, contain, width, height, lineHeight, verticalAlign, scrollable, overflowSuffix, maxLines, } = state.props;\n // scrollY only has an effect when contain === 'both' and scrollable === true\n const scrollY = contain === 'both' && scrollable ? state.props.scrollY : 0;\n const { renderWindow } = state;\n /**\n * The font size of the SDF font face (the basis for SDF space units)\n */\n const sdfFontSize = trFontFace.data.info.size;\n /**\n * Divide screen space units by this to get the SDF space units\n * Mulitple SDF space units by this to get screen space units\n */\n const fontSizeRatio = fontSize / sdfFontSize;\n // Needed in renderWindow calculation\n const sdfLineHeight = lineHeight / fontSizeRatio;\n state.distanceRange =\n fontSizeRatio * trFontFace.data.distanceField.distanceRange;\n // Allocate buffers if needed\n const neededLength = text.length * FLOATS_PER_GLYPH;\n let vertexBuffer = state.vertexBuffer;\n if (!vertexBuffer || vertexBuffer.length < neededLength) {\n vertexBuffer = new Float32Array(neededLength * 2);\n }\n const elementBounds = state.elementBounds;\n if (!elementBounds.valid) {\n this.setElementBoundsX(state);\n this.setElementBoundsY(state);\n elementBounds.valid = true;\n }\n // Return early if we're still viewing inside the established render window\n // No need to re-render what we've already rendered\n // (Only if there's an established renderWindow and we're not suppressing early exit)\n if (!forceFullLayoutCalc && renderWindow.valid) {\n const rwScreen = renderWindow.screen;\n if (x + rwScreen.x1 <= elementBounds.x1 &&\n x + rwScreen.x2 >= elementBounds.x2 &&\n y - scrollY + rwScreen.y1 <= elementBounds.y1 &&\n y - scrollY + rwScreen.y2 >= elementBounds.y2) {\n this.setStatus(state, 'loaded');\n return;\n }\n // Otherwise invalidate the renderWindow so it can be redone\n renderWindow.valid = false;\n this.setStatus(state, 'loading');\n }\n const { offsetY, textAlign } = state.props;\n // Create a new renderWindow if needed\n if (!renderWindow.valid) {\n const isPossiblyOnScreen = boundsOverlap(elementBounds, this.rendererBounds);\n if (!isPossiblyOnScreen) {\n // If the element is not possibly on screen, we can skip the layout and rendering completely\n return;\n }\n setRenderWindow(renderWindow, x, y, scrollY, lineHeight, contain === 'both' ? elementBounds.y2 - elementBounds.y1 : 0, elementBounds, fontSizeRatio);\n // console.log('newRenderWindow', renderWindow);\n }\n const start = getStartConditions(sdfFontSize, sdfLineHeight, lineHeight, verticalAlign, offsetY, fontSizeRatio, renderWindow, lineCache, textH);\n if (!start) {\n // Nothing to render, return early, but still mark as loaded (since the text is just scrolled\n // out of view)\n this.setStatus(state, 'loaded');\n return;\n }\n const { letterSpacing } = state.props;\n const out2 = layoutText(start.lineIndex, start.sdfX, start.sdfY, text, textAlign, width, height, fontSize, lineHeight, letterSpacing, vertexBuffer, contain, lineCache, renderWindow.sdf, trFontFace, forceFullLayoutCalc, scrollable, overflowSuffix, maxLines);\n state.bufferUploaded = false;\n state.bufferNumFloats = out2.bufferNumFloats;\n state.bufferNumQuads = out2.bufferNumQuads;\n state.vertexBuffer = vertexBuffer;\n state.renderWindow = renderWindow;\n debugData.lastLayoutNumCharacters = out2.layoutNumCharacters;\n debugData.bufferSize = vertexBuffer.byteLength;\n // If we didn't exit early, we know we have completely computed w/h\n if (out2.fullyProcessed) {\n state.textW = out2.maxX * fontSizeRatio;\n state.textH = out2.maxY * fontSizeRatio;\n }\n // if (state.props.debug.printLayoutTime) {\n // debugData.layoutSum += performance.now() - updateStartTime;\n // debugData.layoutCount++;\n // }\n this.setStatus(state, 'loaded');\n }\n renderQuads(state, transform, clippingRect, alpha) {\n if (!state.vertexBuffer) {\n // Nothing to draw\n return;\n }\n const { renderer } = this.stage;\n const { fontSize, color, contain, scrollable, zIndex, debug } = state.props;\n // scrollY only has an effect when contain === 'both' and scrollable === true\n const scrollY = contain === 'both' && scrollable ? state.props.scrollY : 0;\n const { textW = 0, textH = 0, distanceRange, vertexBuffer, bufferUploaded, trFontFace, elementBounds, } = state;\n let { webGlBuffers } = state;\n if (!webGlBuffers) {\n const glw = renderer.glw;\n const stride = 4 * Float32Array.BYTES_PER_ELEMENT;\n const webGlBuffer = glw.createBuffer();\n assertTruthy(webGlBuffer);\n state.webGlBuffers = new BufferCollection([\n {\n buffer: webGlBuffer,\n attributes: {\n a_position: {\n name: 'a_position',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 0, // start at the beginning of the buffer\n },\n a_textureCoordinate: {\n name: 'a_textureCoordinate',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 2 * Float32Array.BYTES_PER_ELEMENT,\n },\n },\n },\n ]);\n state.bufferUploaded = false;\n assertTruthy(state.webGlBuffers);\n webGlBuffers = state.webGlBuffers;\n }\n if (!bufferUploaded) {\n const glw = renderer.glw;\n const buffer = webGlBuffers?.getBuffer('a_textureCoordinate') ?? null;\n glw.arrayBufferData(buffer, vertexBuffer, glw.STATIC_DRAW);\n state.bufferUploaded = true;\n }\n assertTruthy(trFontFace);\n if (scrollable && contain === 'both') {\n assertTruthy(elementBounds.valid);\n const elementRect = convertBoundToRect(elementBounds, tmpRect);\n if (clippingRect.valid) {\n state.clippingRect.valid = true;\n clippingRect = intersectRect(clippingRect, elementRect, state.clippingRect);\n }\n else {\n state.clippingRect.valid = true;\n clippingRect = copyRect(elementRect, state.clippingRect);\n }\n }\n const renderOp = new WebGlCoreRenderOp(renderer.glw, renderer.options, webGlBuffers, this.sdfShader, {\n transform: transform.data,\n // IMPORTANT: The SDF Shader expects the color NOT to be premultiplied\n // for the best blending results. Which is why we use `mergeColorAlpha`\n // instead of `mergeColorAlphaPremultiplied` here.\n color: mergeColorAlpha(color, alpha),\n size: fontSize / (trFontFace.data?.info.size || 0),\n scrollY,\n distanceRange,\n debug: debug.sdfShaderDebug,\n }, alpha, clippingRect, { height: textH, width: textW }, 0, zIndex);\n const texture = state.trFontFace?.texture;\n assertTruthy(texture);\n const ctxTexture = this.stage.txManager.getCtxTexture(texture);\n renderOp.addTexture(ctxTexture);\n renderOp.length = state.bufferNumFloats;\n renderOp.numQuads = state.bufferNumQuads;\n renderer.addRenderOp(renderOp);\n // if (!debug.disableScissor) {\n // renderer.enableScissor(\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // Draw the arrays\n // gl.drawArrays(\n // gl.TRIANGLES, // Primitive type\n // 0,\n // bufferNumVertices, // Number of verticies\n // );\n // renderer.disableScissor();\n // if (debug.showElementRect) {\n // this.renderer.drawBorder(\n // Colors.Blue,\n // elementRect.x,\n // elementRect.y,\n // elementRect.w,\n // elementRect.h,\n // );\n // }\n // if (debug.showVisibleRect) {\n // this.renderer.drawBorder(\n // Colors.Green,\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // if (debug.showRenderWindow && renderWindow) {\n // this.renderer.drawBorder(\n // Colors.Red,\n // x + renderWindow.x1,\n // y + renderWindow.y1 - scrollY,\n // x + renderWindow.x2 - (x + renderWindow.x1),\n // y + renderWindow.y2 - scrollY - (y + renderWindow.y1 - scrollY),\n // );\n // }\n // if (debug.printLayoutTime) {\n // debugData.drawSum += performance.now() - drawStartTime;\n // debugData.drawCount++;\n // }\n }\n setIsRenderable(state, renderable) {\n super.setIsRenderable(state, renderable);\n state.trFontFace?.texture.setRenderableOwner(state, renderable);\n }\n destroyState(state) {\n super.destroyState(state);\n // If there's a Font Face assigned we must free the owner relation to its texture\n state.trFontFace?.texture.setRenderableOwner(state, false);\n }\n //#endregion Overrides\n resolveFontFace(props) {\n return TrFontManager.resolveFontFace(this.fontFamilyArray, props);\n }\n /**\n * Release the loaded SDF font face\n *\n * @param state\n */\n releaseFontFace(state) {\n if (state.trFontFace) {\n state.trFontFace.texture.setRenderableOwner(state, false);\n state.trFontFace = undefined;\n }\n }\n /**\n * Invalidate the layout cache stored in the state. This will cause the text\n * to be re-layed out on the next update.\n *\n * @remarks\n * This also invalidates the visible window cache.\n *\n * @param state\n */\n invalidateLayoutCache(state) {\n state.renderWindow.valid = false;\n state.elementBounds.valid = false;\n state.textH = undefined;\n state.textW = undefined;\n state.lineCache = [];\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n setElementBoundsX(state) {\n const { x, contain, width } = state.props;\n const { elementBounds } = state;\n elementBounds.x1 = x;\n elementBounds.x2 = contain !== 'none' ? x + width : Infinity;\n }\n setElementBoundsY(state) {\n const { y, contain, height } = state.props;\n const { elementBounds } = state;\n elementBounds.y1 = y;\n elementBounds.y2 = contain === 'both' ? y + height : Infinity;\n }\n}\n//# sourceMappingURL=SdfTextRenderer.js.map","import { CoreExtension } from '../../exports/core-api.js';\n/**\n * Type guard that checks if a Class extends CoreExtension.\n *\n * @param Class\n * @returns\n */\nexport function classExtendsCoreExtension(Class) {\n return Class.prototype instanceof CoreExtension;\n}\nexport async function loadCoreExtension(coreExtensionModule, stage) {\n let module;\n try {\n console.log('Loading core extension', coreExtensionModule);\n module = (await import(coreExtensionModule /* @vite-ignore */));\n }\n catch (e) {\n console.error(`The core extension module at '${coreExtensionModule}' could not be loaded.`);\n console.error(e);\n return;\n }\n if (!module.default) {\n console.error(`The core extension module at '${coreExtensionModule}' does not have a default export.`);\n return;\n }\n const ExtensionClass = module.default;\n if (classExtendsCoreExtension(ExtensionClass)) {\n const coreExtension = new ExtensionClass();\n try {\n await coreExtension.run(stage);\n }\n catch (e) {\n console.error(`The core extension at '${coreExtensionModule}' threw an error.`);\n console.error(e);\n }\n }\n else {\n console.error(`The core extension at '${coreExtensionModule}' does not extend CoreExtension.`);\n }\n}\nexport function santizeCustomDataMap(d) {\n const validTypes = { boolean: true, string: true, number: true };\n const keys = Object.keys(d);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n if (!key) {\n continue;\n }\n const value = d[key];\n const valueType = typeof value;\n // Typescript doesn't understand the above const valueType ¯\\_(ツ)_/¯\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore-next-line\n if (valueType === 'string' && value.length > 2048) {\n console.warn(`Custom Data value for ${key} is too long, it will be truncated to 2048 characters`);\n // same here, see above comment, this can only be a string at this point\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore-next-line\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call\n d[key] = value.substring(0, 2048);\n }\n if (!validTypes[valueType]) {\n console.warn(`Custom Data value for ${key} is not a boolean, string, or number, it will be ignored`);\n delete d[key];\n }\n }\n return d;\n}\n//# sourceMappingURL=utils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ManualCountTextureUsageTracker, } from './texture-usage-trackers/ManualCountTextureUsageTracker.js';\nimport { FinalizationRegistryTextureUsageTracker } from './texture-usage-trackers/FinalizationRegistryTextureUsageTracker.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { Inspector } from './Inspector.js';\nimport { santizeCustomDataMap } from '../render-drivers/utils.js';\nimport { isProductionEnvironment } from '../utils.js';\n/**\n * The Renderer Main API\n *\n * @remarks\n * This is the primary class used to configure and operate the Renderer.\n *\n * It is used to create and destroy Nodes, as well as Texture and Shader\n * references.\n *\n * Example:\n * ```ts\n * import { RendererMain, MainCoreDriver } from '@lightningjs/renderer';\n *\n * // Initialize the Renderer\n * const renderer = new RendererMain(\n * {\n * appWidth: 1920,\n * appHeight: 1080\n * },\n * 'app',\n * new MainCoreDriver(),\n * );\n * ```\n */\nexport class RendererMain extends EventEmitter {\n root = null;\n driver;\n canvas;\n settings;\n inspector = null;\n nodes = new Map();\n nextTextureId = 1;\n /**\n * Texture Usage Tracker for Usage Based Texture Garbage Collection\n *\n * @remarks\n * For internal use only. DO NOT ACCESS.\n */\n textureTracker;\n /**\n * Constructs a new Renderer instance\n *\n * @param settings Renderer settings\n * @param target Element ID or HTMLElement to insert the canvas into\n * @param driver Core Driver to use\n */\n constructor(settings, target, driver) {\n super();\n const resolvedSettings = {\n appWidth: settings.appWidth || 1920,\n appHeight: settings.appHeight || 1080,\n txMemByteThreshold: settings.txMemByteThreshold || 124e6,\n boundsMargin: settings.boundsMargin || 0,\n deviceLogicalPixelRatio: settings.deviceLogicalPixelRatio || 1,\n devicePhysicalPixelRatio: settings.devicePhysicalPixelRatio || window.devicePixelRatio,\n clearColor: settings.clearColor ?? 0x00000000,\n coreExtensionModule: settings.coreExtensionModule || null,\n experimental_FinalizationRegistryTextureUsageTracker: settings.experimental_FinalizationRegistryTextureUsageTracker ?? false,\n textureCleanupOptions: settings.textureCleanupOptions || {},\n fpsUpdateInterval: settings.fpsUpdateInterval || 0,\n numImageWorkers: settings.numImageWorkers !== undefined ? settings.numImageWorkers : 2,\n enableContextSpy: settings.enableContextSpy ?? false,\n enableInspector: settings.enableInspector ?? false,\n };\n this.settings = resolvedSettings;\n const { appWidth, appHeight, deviceLogicalPixelRatio, devicePhysicalPixelRatio, enableInspector, } = resolvedSettings;\n const releaseCallback = (textureId) => {\n this.driver.releaseTexture(textureId);\n };\n const useFinalizationRegistryTracker = resolvedSettings.experimental_FinalizationRegistryTextureUsageTracker &&\n typeof FinalizationRegistry === 'function';\n this.textureTracker = useFinalizationRegistryTracker\n ? new FinalizationRegistryTextureUsageTracker(releaseCallback)\n : new ManualCountTextureUsageTracker(releaseCallback, this.settings.textureCleanupOptions);\n const deviceLogicalWidth = appWidth * deviceLogicalPixelRatio;\n const deviceLogicalHeight = appHeight * deviceLogicalPixelRatio;\n this.driver = driver;\n const canvas = document.createElement('canvas');\n this.canvas = canvas;\n canvas.width = deviceLogicalWidth * devicePhysicalPixelRatio;\n canvas.height = deviceLogicalHeight * devicePhysicalPixelRatio;\n canvas.style.width = `${deviceLogicalWidth}px`;\n canvas.style.height = `${deviceLogicalHeight}px`;\n let targetEl;\n if (typeof target === 'string') {\n targetEl = document.getElementById(target);\n }\n else {\n targetEl = target;\n }\n if (!targetEl) {\n throw new Error('Could not find target element');\n }\n // Hook up the driver's callbacks\n driver.onCreateNode = (node) => {\n this.nodes.set(node.id, node);\n };\n driver.onBeforeDestroyNode = (node) => {\n this.nodes.delete(node.id);\n };\n driver.onFpsUpdate = (fpsData) => {\n this.emit('fpsUpdate', fpsData);\n };\n driver.onFrameTick = (frameTickData) => {\n this.emit('frameTick', frameTickData);\n };\n driver.onIdle = () => {\n this.emit('idle');\n };\n targetEl.appendChild(canvas);\n if (enableInspector && !isProductionEnvironment()) {\n this.inspector = new Inspector(canvas, resolvedSettings);\n }\n }\n /**\n * Initialize the renderer\n *\n * @remarks\n * This method must be called and resolved asyncronously before any other\n * methods are called.\n */\n async init() {\n await this.driver.init(this, this.settings, this.canvas);\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.root = this.driver.getRootNode();\n }\n /**\n * Create a new scene graph node\n *\n * @remarks\n * A node is the main graphical building block of the Renderer scene graph. It\n * can be a container for other nodes, or it can be a leaf node that renders a\n * solid color, gradient, image, or specific texture, using a specific shader.\n *\n * To create a text node, see {@link createTextNode}.\n *\n * See {@link INode} for more details.\n *\n * @param props\n * @returns\n */\n createNode(props) {\n if (this.inspector) {\n return this.inspector.createNode(this.driver, this.resolveNodeDefaults(props));\n }\n return this.driver.createNode(this.resolveNodeDefaults(props));\n }\n /**\n * Create a new scene graph text node\n *\n * @remarks\n * A text node is the second graphical building block of the Renderer scene\n * graph. It renders text using a specific text renderer that is automatically\n * chosen based on the font requested and what type of fonts are installed\n * into an app via a CoreExtension.\n *\n * See {@link ITextNode} for more details.\n *\n * @param props\n * @returns\n */\n createTextNode(props) {\n const fontSize = props.fontSize ?? 16;\n const data = {\n ...this.resolveNodeDefaults(props),\n text: props.text ?? '',\n textRendererOverride: props.textRendererOverride ?? null,\n fontSize,\n fontFamily: props.fontFamily ?? 'sans-serif',\n fontStyle: props.fontStyle ?? 'normal',\n fontWeight: props.fontWeight ?? 'normal',\n fontStretch: props.fontStretch ?? 'normal',\n textAlign: props.textAlign ?? 'left',\n contain: props.contain ?? 'none',\n scrollable: props.scrollable ?? false,\n scrollY: props.scrollY ?? 0,\n offsetY: props.offsetY ?? 0,\n letterSpacing: props.letterSpacing ?? 0,\n lineHeight: props.lineHeight ?? fontSize,\n maxLines: props.maxLines ?? 0,\n textBaseline: props.textBaseline ?? 'alphabetic',\n verticalAlign: props.verticalAlign ?? 'top',\n overflowSuffix: props.overflowSuffix ?? '...',\n debug: props.debug ?? {},\n };\n if (this.inspector) {\n return this.inspector.createTextNode(this.driver, data);\n }\n return this.driver.createTextNode(data);\n }\n /**\n * Resolves the default property values for a Node\n *\n * @remarks\n * This method is used internally by the RendererMain to resolve the default\n * property values for a Node. It is exposed publicly so that it can be used\n * by Core Driver implementations.\n *\n * @param props\n * @returns\n */\n resolveNodeDefaults(props) {\n const color = props.color ?? 0xffffffff;\n const colorTl = props.colorTl ?? props.colorTop ?? props.colorLeft ?? color;\n const colorTr = props.colorTr ?? props.colorTop ?? props.colorRight ?? color;\n const colorBl = props.colorBl ?? props.colorBottom ?? props.colorLeft ?? color;\n const colorBr = props.colorBr ?? props.colorBottom ?? props.colorRight ?? color;\n const data = santizeCustomDataMap(props.data ?? {});\n return {\n x: props.x ?? 0,\n y: props.y ?? 0,\n width: props.width ?? 0,\n height: props.height ?? 0,\n alpha: props.alpha ?? 1,\n autosize: props.autosize ?? false,\n clipping: props.clipping ?? false,\n color,\n colorTop: props.colorTop ?? color,\n colorBottom: props.colorBottom ?? color,\n colorLeft: props.colorLeft ?? color,\n colorRight: props.colorRight ?? color,\n colorBl,\n colorBr,\n colorTl,\n colorTr,\n zIndex: props.zIndex ?? 0,\n zIndexLocked: props.zIndexLocked ?? 0,\n parent: props.parent ?? null,\n texture: props.texture ?? null,\n shader: props.shader ?? null,\n // Since setting the `src` will trigger a texture load, we need to set it after\n // we set the texture. Otherwise, problems happen.\n src: props.src ?? '',\n scale: props.scale ?? null,\n scaleX: props.scaleX ?? props.scale ?? 1,\n scaleY: props.scaleY ?? props.scale ?? 1,\n mount: props.mount ?? 0,\n mountX: props.mountX ?? props.mount ?? 0,\n mountY: props.mountY ?? props.mount ?? 0,\n pivot: props.pivot ?? 0.5,\n pivotX: props.pivotX ?? props.pivot ?? 0.5,\n pivotY: props.pivotY ?? props.pivot ?? 0.5,\n rotation: props.rotation ?? 0,\n data: data,\n };\n }\n /**\n * Destroy a node\n *\n * @remarks\n * This method destroys a node but does not destroy its children.\n *\n * @param node\n * @returns\n */\n destroyNode(node) {\n if (this.inspector) {\n this.inspector.destroyNode(node);\n }\n return this.driver.destroyNode(node);\n }\n /**\n * Create a new texture reference\n *\n * @remarks\n * This method creates a new reference to a texture. The texture is not\n * loaded until it is used on a node.\n *\n * It can be assigned to a node's `texture` property, or it can be used\n * when creating a SubTexture.\n *\n * @param textureType\n * @param props\n * @param options\n * @returns\n */\n createTexture(textureType, props, options) {\n const id = this.nextTextureId++;\n const desc = {\n descType: 'texture',\n txType: textureType,\n props,\n options: {\n ...options,\n // This ID is used to identify the texture in the CoreTextureManager's\n // ID Texture Map cache.\n id,\n },\n };\n this.textureTracker.registerTexture(desc);\n return desc;\n }\n /**\n * Create a new shader reference\n *\n * @remarks\n * This method creates a new reference to a shader. The shader is not\n * loaded until it is used on a Node.\n *\n * It can be assigned to a Node's `shader` property.\n *\n * @param shaderType\n * @param props\n * @returns\n */\n createShader(shaderType, props) {\n return {\n descType: 'shader',\n shType: shaderType,\n props: props,\n };\n }\n /**\n * Get a Node by its ID\n *\n * @param id\n * @returns\n */\n getNodeById(id) {\n return this.nodes.get(id) || null;\n }\n toggleFreeze() {\n throw new Error('Not implemented');\n }\n advanceFrame() {\n throw new Error('Not implemented');\n }\n /**\n * Re-render the current frame without advancing any running animations.\n *\n * @remarks\n * Any state changes will be reflected in the re-rendered frame. Useful for\n * debugging.\n *\n * May not do anything if the render loop is running on a separate worker.\n */\n rerender() {\n throw new Error('Not implemented');\n }\n}\n//# sourceMappingURL=RendererMain.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getTimingFunction } from '../utils.js';\nimport { mergeColorProgress } from '../../utils.js';\nimport { EventEmitter } from '../../common/EventEmitter.js';\nexport class CoreAnimation extends EventEmitter {\n node;\n props;\n settings;\n propStartValues = {};\n restoreValues = {};\n progress = 0;\n delayFor = 0;\n timingFunction;\n propsList; //fixme - aint got not time for this\n constructor(node, props, settings) {\n super();\n this.node = node;\n this.props = props;\n this.settings = settings;\n this.propStartValues = {};\n this.propsList = Object.keys(props);\n this.propsList.forEach((propName) => {\n this.propStartValues[propName] = node[propName];\n });\n this.timingFunction = (t) => t;\n if (settings.easing && typeof settings.easing === 'string') {\n this.timingFunction = getTimingFunction(settings.easing);\n }\n this.delayFor = settings.delay || 0;\n }\n reset() {\n this.progress = 0;\n this.delayFor = this.settings.delay || 0;\n this.update(0);\n }\n restore() {\n this.reset();\n Object.keys(this.props).forEach((propName) => {\n this.node[propName] = this.propStartValues[propName];\n });\n }\n reverse() {\n this.progress = 0;\n Object.keys(this.props).forEach((propName) => {\n // set the start value to the current value\n const startValue = this.props[propName];\n const endValue = this.propStartValues[propName];\n // swap the start and end values\n this.props[propName] = endValue;\n this.propStartValues[propName] = startValue;\n });\n // restore stop method if we are not looping\n if (!this.settings.loop) {\n this.settings.stopMethod = false;\n }\n }\n applyEasing(p, s, e) {\n return (this.timingFunction(p) || p) * (e - s) + s;\n }\n update(dt) {\n const { duration, loop, easing, stopMethod } = this.settings;\n if (!duration) {\n this.emit('finished', {});\n return;\n }\n if (this.delayFor > 0) {\n this.delayFor -= dt;\n return;\n }\n if (this.delayFor <= 0 && this.progress === 0) {\n this.emit('start', {});\n }\n this.progress += dt / duration;\n if (this.progress > 1) {\n this.progress = loop ? 0 : 1;\n if (stopMethod) {\n // If there's a stop method emit finished so the stop method can be applied.\n // TODO: We should probably reevaluate how stopMethod is implemented as currently\n // stop method 'reset' does not work when looping.\n this.emit('finished', {});\n return;\n }\n }\n for (let i = 0; i < this.propsList.length; i++) {\n const propName = this.propsList[i];\n const propValue = this.props[propName];\n const startValue = this.propStartValues[propName];\n const endValue = propValue;\n if (propName.indexOf('color') !== -1) {\n // check if we have to change the color to begin with\n if (startValue === endValue) {\n this.node[propName] = startValue;\n continue;\n }\n if (easing) {\n const easingProgressValue = this.timingFunction(this.progress) || this.progress;\n const easingColorValue = mergeColorProgress(startValue, endValue, easingProgressValue);\n this.node[propName] = easingColorValue;\n continue;\n }\n this.node[propName] = mergeColorProgress(startValue, endValue, this.progress);\n continue;\n }\n if (easing) {\n this.node[propName] = this.applyEasing(this.progress, startValue, endValue);\n continue;\n }\n this.node[propName] =\n startValue + (endValue - startValue) * this.progress;\n }\n if (this.progress === 1) {\n this.emit('finished', {});\n }\n }\n}\n//# sourceMappingURL=CoreAnimation.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nexport class CoreAnimationController {\n manager;\n animation;\n startedPromise = null;\n /**\n * If this is null, then the animation hasn't started yet.\n */\n startedResolve = null;\n stoppedPromise = null;\n /**\n * If this is null, then the animation is in a finished / stopped state.\n */\n stoppedResolve = null;\n constructor(manager, animation) {\n this.manager = manager;\n this.animation = animation;\n this.state = 'stopped';\n }\n state;\n start() {\n this.makeStartedPromise();\n this.animation.once('start', this.started.bind(this));\n this.makeStoppedPromise();\n this.animation.once('finished', this.finished.bind(this));\n // prevent registering the same animation twice\n if (!this.manager.activeAnimations.has(this.animation)) {\n this.manager.registerAnimation(this.animation);\n }\n this.state = 'running';\n return this;\n }\n stop() {\n this.manager.unregisterAnimation(this.animation);\n if (this.stoppedResolve !== null) {\n this.stoppedResolve();\n this.stoppedResolve = null;\n }\n this.animation.reset();\n this.state = 'stopped';\n return this;\n }\n pause() {\n this.manager.unregisterAnimation(this.animation);\n this.state = 'paused';\n return this;\n }\n restore() {\n this.stoppedResolve = null;\n this.animation.restore();\n return this;\n }\n waitUntilStarted() {\n this.makeStartedPromise();\n const promise = this.startedPromise;\n assertTruthy(promise);\n return promise;\n }\n waitUntilStopped() {\n this.makeStoppedPromise();\n const promise = this.stoppedPromise;\n assertTruthy(promise);\n return promise;\n }\n makeStartedPromise() {\n if (this.startedResolve === null) {\n this.startedPromise = new Promise((resolve) => {\n this.startedResolve = resolve;\n });\n }\n }\n makeStoppedPromise() {\n if (this.stoppedResolve === null) {\n this.stoppedPromise = new Promise((resolve) => {\n this.stoppedResolve = resolve;\n });\n }\n }\n started() {\n assertTruthy(this.startedResolve);\n // resolve promise (and pass current this to continue to the chain)\n this.startedResolve(this);\n this.startedResolve = null;\n }\n finished() {\n assertTruthy(this.stoppedResolve);\n // If the animation is looping, then we need to restart it.\n const { loop, stopMethod } = this.animation.settings;\n if (stopMethod === 'reverse') {\n this.animation.reverse();\n this.start();\n return;\n }\n // resolve promise\n this.stoppedResolve();\n this.stoppedResolve = null;\n if (loop) {\n return;\n }\n // unregister animation\n this.manager.unregisterAnimation(this.animation);\n }\n}\n//# sourceMappingURL=CoreAnimationController.js.map","/* eslint-disable @typescript-eslint/no-non-null-assertion */\n// Matrix3d is a 3x3 matrix in column-major order because that's how WebGL likes it.\n// The matrix is stored in a Float32Array in the following order:\n// | 0 3 6 |\n// | 1 4 7 |\n// | 2 5 8 |\n// The following constants are used to index into the array in a row-major way.\nconst m0 = 0;\nconst m1 = 3;\nconst m2 = 6;\nconst m3 = 1;\nconst m4 = 4;\nconst m5 = 7;\nconst m6 = 2;\nconst m7 = 5;\nconst m8 = 8;\n/**\n * A 3x3 matrix representing a 2D transformation.\n *\n * @remarks\n * The matrix is stored in column-major order in the `data` property which can\n * be passed directly to a WebGL shader uniform.\n *\n * The matrix is stored in a Float32Array in the following index order:\n * | 0 3 6 |\n * | 1 4 7 |\n * | 2 5 8 |\n *\n * Only the first two rows are really used for the transformation. The last row is\n * generally always `[0, 0, 1]` if you only use the 2D transformation methods\n * provided by this class.\n *\n * For convenience, entries in the first two rows can be accessed by the following\n * getter properties:\n * | ta tb tx |\n * | tc td ty |\n * | 0 0 1 |\n */\nexport class Matrix3d {\n data;\n /**\n * Creates a new 3x3 matrix.\n *\n * @param entries Row-major 3x3 matrix\n */\n constructor(entries) {\n if (entries) {\n // Transpose the input matrix so that it's in column-major order.\n this.data = new Float32Array(9);\n this.data[m0] = entries[0];\n this.data[m1] = entries[3];\n this.data[m2] = entries[6];\n this.data[m3] = entries[1];\n this.data[m4] = entries[4];\n this.data[m5] = entries[7];\n this.data[m6] = entries[2];\n this.data[m7] = entries[5];\n this.data[m8] = entries[8];\n }\n else {\n this.data = new Float32Array(9);\n }\n }\n /**\n * Returns a temporary matrix that can be used for calculations.\n *\n * @remarks\n * This is useful for avoiding allocations in tight loops.\n *\n * The matrix is not guaranteed to be the same between calls.\n *\n * @returns\n */\n static get temp() {\n return tempMatrix;\n }\n static multiply(a, b, out) {\n const e0 = a.data[m0] * b.data[m0] +\n a.data[m1] * b.data[m3] +\n a.data[m2] * b.data[m6];\n const e1 = a.data[m0] * b.data[m1] +\n a.data[m1] * b.data[m4] +\n a.data[m2] * b.data[m7];\n const e2 = a.data[m0] * b.data[m2] +\n a.data[m1] * b.data[m5] +\n a.data[m2] * b.data[m8];\n const e3 = a.data[m3] * b.data[m0] +\n a.data[m4] * b.data[m3] +\n a.data[m5] * b.data[m6];\n const e4 = a.data[m3] * b.data[m1] +\n a.data[m4] * b.data[m4] +\n a.data[m5] * b.data[m7];\n const e5 = a.data[m3] * b.data[m2] +\n a.data[m4] * b.data[m5] +\n a.data[m5] * b.data[m8];\n const e6 = a.data[m6] * b.data[m0] +\n a.data[m7] * b.data[m3] +\n a.data[m8] * b.data[m6];\n const e7 = a.data[m6] * b.data[m1] +\n a.data[m7] * b.data[m4] +\n a.data[m8] * b.data[m7];\n const e8 = a.data[m6] * b.data[m2] +\n a.data[m7] * b.data[m5] +\n a.data[m8] * b.data[m8];\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = e0;\n out.data[m1] = e1;\n out.data[m2] = e2;\n out.data[m3] = e3;\n out.data[m4] = e4;\n out.data[m5] = e5;\n out.data[m6] = e6;\n out.data[m7] = e7;\n out.data[m8] = e8;\n return out;\n }\n static identity(out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = 1;\n out.data[m1] = 0;\n out.data[m2] = 0;\n out.data[m3] = 0;\n out.data[m4] = 1;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static translate(x, y, out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = 1;\n out.data[m1] = 0;\n out.data[m2] = x;\n out.data[m3] = 0;\n out.data[m4] = 1;\n out.data[m5] = y;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static scale(sx, sy, out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = sx;\n out.data[m1] = 0;\n out.data[m2] = 0;\n out.data[m3] = 0;\n out.data[m4] = sy;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static rotate(angle, out) {\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = cos;\n out.data[m1] = -sin;\n out.data[m2] = 0;\n out.data[m3] = sin;\n out.data[m4] = cos;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static copy(src, dst, transpose) {\n if (!dst) {\n dst = new Matrix3d();\n }\n dst.data[0] = src.data[0];\n dst.data[1] = src.data[1];\n dst.data[2] = src.data[2];\n dst.data[3] = src.data[3];\n dst.data[4] = src.data[4];\n dst.data[5] = src.data[5];\n dst.data[6] = src.data[6];\n dst.data[7] = src.data[7];\n dst.data[8] = src.data[8];\n return dst;\n }\n translate(x, y) {\n this.data[m2] = this.data[m0] * x + this.data[m1] * y + this.data[m2];\n this.data[m5] = this.data[m3] * x + this.data[m4] * y + this.data[m5];\n return this;\n }\n scale(sx, sy) {\n this.data[m0] = this.data[m0] * sx;\n this.data[m1] = this.data[m1] * sy;\n this.data[m3] = this.data[m3] * sx;\n this.data[m4] = this.data[m4] * sy;\n return this;\n }\n rotate(angle) {\n if (angle === 0 || !((angle % Math.PI) * 2)) {\n return this;\n }\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n const e0 = this.data[m0] * cos + this.data[m1] * sin;\n const e1 = this.data[m1] * cos - this.data[m0] * sin;\n const e3 = this.data[m3] * cos + this.data[m4] * sin;\n const e4 = this.data[m4] * cos - this.data[m3] * sin;\n this.data[m0] = e0;\n this.data[m1] = e1;\n this.data[m3] = e3;\n this.data[m4] = e4;\n return this;\n }\n multiply(other) {\n return Matrix3d.multiply(this, other, this);\n }\n get tx() {\n return this.data[m2];\n }\n get ty() {\n return this.data[m5];\n }\n get ta() {\n return this.data[m0];\n }\n get tb() {\n return this.data[m1];\n }\n get tc() {\n return this.data[m3];\n }\n get td() {\n return this.data[m4];\n }\n transformPoint(x, y) {\n return [\n this.data[m0] * x + this.data[m1] * y + this.data[m2],\n this.data[m3] * x + this.data[m4] * y + this.data[m3],\n ];\n }\n}\nconst tempMatrix = new Matrix3d();\n//# sourceMappingURL=Matrix3d.js.map","const rx1 = 0;\nconst rx2 = 2;\nconst rx3 = 4;\nconst rx4 = 6;\nconst ry1 = 1;\nconst ry2 = 3;\nconst ry3 = 5;\nconst ry4 = 7;\nexport class RenderCoords {\n data;\n constructor(entries) {\n this.data = new Float32Array(8);\n if (entries) {\n this.data[rx1] = entries[rx1];\n this.data[rx2] = entries[rx2];\n this.data[rx3] = entries[rx3];\n this.data[rx4] = entries[rx4];\n this.data[ry1] = entries[ry1];\n this.data[ry2] = entries[ry2];\n this.data[ry3] = entries[ry3];\n this.data[ry4] = entries[ry4];\n }\n }\n static translate(x1, y1, x2, y2, x3, y3, x4, y4, out) {\n if (!out) {\n out = new RenderCoords();\n }\n out.data[rx1] = x1;\n out.data[rx2] = x2;\n out.data[rx3] = x3;\n out.data[rx4] = x4;\n out.data[ry1] = y1;\n out.data[ry2] = y2;\n out.data[ry3] = y3;\n out.data[ry4] = y4;\n return out;\n }\n get x1() {\n return this.data[rx1];\n }\n get x2() {\n return this.data[rx2];\n }\n get x3() {\n return this.data[rx3];\n }\n get x4() {\n return this.data[rx4];\n }\n get y1() {\n return this.data[ry1];\n }\n get y2() {\n return this.data[ry2];\n }\n get y3() {\n return this.data[ry3];\n }\n get y4() {\n return this.data[ry4];\n }\n}\n//# sourceMappingURL=RenderCoords.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy, mergeColorAlphaPremultiplied, getImageAspectRatio, } from '../utils.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { copyRect, intersectRect, createBound, boundInsideBound, } from './lib/utils.js';\nimport { Matrix3d } from './lib/Matrix3d.js';\nimport { RenderCoords } from './lib/RenderCoords.js';\nexport var CoreNodeRenderState;\n(function (CoreNodeRenderState) {\n CoreNodeRenderState[CoreNodeRenderState[\"Init\"] = 0] = \"Init\";\n CoreNodeRenderState[CoreNodeRenderState[\"OutOfBounds\"] = 2] = \"OutOfBounds\";\n CoreNodeRenderState[CoreNodeRenderState[\"InBounds\"] = 4] = \"InBounds\";\n CoreNodeRenderState[CoreNodeRenderState[\"InViewport\"] = 8] = \"InViewport\";\n})(CoreNodeRenderState || (CoreNodeRenderState = {}));\nconst CoreNodeRenderStateMap = new Map();\nCoreNodeRenderStateMap.set(CoreNodeRenderState.Init, 'init');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.OutOfBounds, 'outOfBounds');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.InBounds, 'inBounds');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.InViewport, 'inViewport');\nexport var UpdateType;\n(function (UpdateType) {\n /**\n * Child updates\n */\n UpdateType[UpdateType[\"Children\"] = 1] = \"Children\";\n /**\n * Scale/Rotate transform update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `scaleRotateTransform`\n */\n UpdateType[UpdateType[\"ScaleRotate\"] = 2] = \"ScaleRotate\";\n /**\n * Translate transform update (x/y/width/height/pivot/mount)\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `localTransform`\n */\n UpdateType[UpdateType[\"Local\"] = 4] = \"Local\";\n /**\n * Global Transform update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `globalTransform`\n * - `renderCoords`\n * - `renderBound`\n */\n UpdateType[UpdateType[\"Global\"] = 8] = \"Global\";\n /**\n * Clipping rect update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `clippingRect`\n */\n UpdateType[UpdateType[\"Clipping\"] = 16] = \"Clipping\";\n /**\n * Calculated ZIndex update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `calcZIndex`\n */\n UpdateType[UpdateType[\"CalculatedZIndex\"] = 32] = \"CalculatedZIndex\";\n /**\n * Z-Index Sorted Children update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `children` (sorts children by their `calcZIndex`)\n */\n UpdateType[UpdateType[\"ZIndexSortedChildren\"] = 64] = \"ZIndexSortedChildren\";\n /**\n * Premultiplied Colors update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `premultipliedColorTl`\n * - `premultipliedColorTr`\n * - `premultipliedColorBl`\n * - `premultipliedColorBr`\n */\n UpdateType[UpdateType[\"PremultipliedColors\"] = 128] = \"PremultipliedColors\";\n /**\n * World Alpha update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `worldAlpha` = `parent.worldAlpha` * `alpha`\n */\n UpdateType[UpdateType[\"WorldAlpha\"] = 256] = \"WorldAlpha\";\n /**\n * Render State update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `renderState`\n */\n UpdateType[UpdateType[\"RenderState\"] = 512] = \"RenderState\";\n /**\n * Is Renderable update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `isRenderable`\n */\n UpdateType[UpdateType[\"IsRenderable\"] = 1024] = \"IsRenderable\";\n /**\n * None\n */\n UpdateType[UpdateType[\"None\"] = 0] = \"None\";\n /**\n * All\n */\n UpdateType[UpdateType[\"All\"] = 2047] = \"All\";\n})(UpdateType || (UpdateType = {}));\nexport class CoreNode extends EventEmitter {\n stage;\n children = [];\n props;\n updateType = UpdateType.All;\n globalTransform;\n scaleRotateTransform;\n localTransform;\n renderCoords;\n renderBound;\n strictBound;\n preloadBound;\n clippingRect = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n valid: false,\n };\n isRenderable = false;\n renderState = CoreNodeRenderState.Init;\n worldAlpha = 1;\n premultipliedColorTl = 0;\n premultipliedColorTr = 0;\n premultipliedColorBl = 0;\n premultipliedColorBr = 0;\n calcZIndex = 0;\n constructor(stage, props) {\n super();\n this.stage = stage;\n this.props = {\n ...props,\n parent: null,\n };\n // Allow for parent to be processed appropriately\n this.parent = props.parent;\n this.updateScaleRotateTransform();\n }\n //#region Textures\n loadTexture(textureType, props, options = null) {\n // First unload any existing texture\n if (this.props.texture) {\n this.unloadTexture();\n }\n const { txManager } = this.stage;\n const texture = txManager.loadTexture(textureType, props, options);\n this.props.texture = texture;\n this.props.textureOptions = options;\n this.setUpdateType(UpdateType.IsRenderable);\n // If texture is already loaded / failed, trigger loaded event manually\n // so that users get a consistent event experience.\n // We do this in a microtask to allow listeners to be attached in the same\n // synchronous task after calling loadTexture()\n queueMicrotask(() => {\n if (texture.state === 'loaded') {\n this.onTextureLoaded(texture, texture.dimensions);\n }\n else if (texture.state === 'failed') {\n this.onTextureFailed(texture, texture.error);\n }\n else if (texture.state === 'freed') {\n this.onTextureFreed(texture);\n }\n texture.on('loaded', this.onTextureLoaded);\n texture.on('failed', this.onTextureFailed);\n texture.on('freed', this.onTextureFreed);\n });\n }\n unloadTexture() {\n if (this.props.texture) {\n const { texture } = this.props;\n texture.off('loaded', this.onTextureLoaded);\n texture.off('failed', this.onTextureFailed);\n texture.off('freed', this.onTextureFreed);\n texture.setRenderableOwner(this, false);\n }\n this.props.texture = null;\n this.props.textureOptions = null;\n this.setUpdateType(UpdateType.IsRenderable);\n }\n autosizeNode(dimensions) {\n if (this.autosize) {\n this.width = dimensions.width;\n this.height = dimensions.height;\n }\n }\n onTextureLoaded = (target, dimensions) => {\n this.autosizeNode(dimensions);\n // Texture was loaded. In case the RAF loop has already stopped, we request\n // a render to ensure the texture is rendered.\n this.stage.requestRender();\n this.emit('loaded', {\n type: 'texture',\n dimensions,\n });\n };\n onTextureFailed = (target, error) => {\n this.emit('failed', {\n type: 'texture',\n error,\n });\n };\n onTextureFreed = (target) => {\n this.emit('freed', {\n type: 'texture',\n });\n };\n //#endregion Textures\n loadShader(shaderType, props) {\n const shManager = this.stage.renderer.getShaderManager();\n assertTruthy(shManager);\n const { shader, props: p } = shManager.loadShader(shaderType, props);\n this.props.shader = shader;\n this.props.shaderProps = p;\n this.setUpdateType(UpdateType.IsRenderable);\n }\n /**\n * Change types types is used to determine the scope of the changes being applied\n *\n * @remarks\n * See {@link UpdateType} for more information on each type\n *\n * @param type\n */\n setUpdateType(type) {\n this.updateType |= type;\n // If we're updating this node at all, we need to inform the parent\n // (and all ancestors) that their children need updating as well\n const parent = this.props.parent;\n if (parent && !(parent.updateType & UpdateType.Children)) {\n parent.setUpdateType(UpdateType.Children);\n }\n }\n sortChildren() {\n this.children.sort((a, b) => a.calcZIndex - b.calcZIndex);\n }\n updateScaleRotateTransform() {\n this.scaleRotateTransform = Matrix3d.rotate(this.props.rotation, this.scaleRotateTransform).scale(this.props.scaleX, this.props.scaleY);\n }\n updateLocalTransform() {\n assertTruthy(this.scaleRotateTransform);\n const pivotTranslateX = this.props.pivotX * this.props.width;\n const pivotTranslateY = this.props.pivotY * this.props.height;\n const mountTranslateX = this.props.mountX * this.props.width;\n const mountTranslateY = this.props.mountY * this.props.height;\n this.localTransform = Matrix3d.translate(pivotTranslateX - mountTranslateX + this.props.x, pivotTranslateY - mountTranslateY + this.props.y, this.localTransform)\n .multiply(this.scaleRotateTransform)\n .translate(-pivotTranslateX, -pivotTranslateY);\n this.setUpdateType(UpdateType.Global);\n }\n /**\n * @todo: test for correct calculation flag\n * @param delta\n */\n update(delta, parentClippingRect) {\n if (this.updateType & UpdateType.ScaleRotate) {\n this.updateScaleRotateTransform();\n this.setUpdateType(UpdateType.Local);\n }\n if (this.updateType & UpdateType.Local) {\n this.updateLocalTransform();\n this.setUpdateType(UpdateType.Global);\n }\n const parent = this.props.parent;\n let childUpdateType = UpdateType.None;\n if (this.updateType & UpdateType.Global) {\n assertTruthy(this.localTransform);\n this.globalTransform = Matrix3d.copy(parent?.globalTransform || this.localTransform, this.globalTransform);\n if (parent) {\n this.globalTransform.multiply(this.localTransform);\n }\n this.calculateRenderCoords();\n this.updateBoundingRect();\n this.setUpdateType(UpdateType.Clipping | UpdateType.RenderState | UpdateType.Children);\n childUpdateType |= UpdateType.Global;\n }\n if (this.updateType & UpdateType.Clipping) {\n this.calculateClippingRect(parentClippingRect);\n this.setUpdateType(UpdateType.Children);\n childUpdateType |= UpdateType.Clipping;\n }\n if (this.updateType & UpdateType.WorldAlpha) {\n if (parent) {\n this.worldAlpha = parent.worldAlpha * this.props.alpha;\n }\n else {\n this.worldAlpha = this.props.alpha;\n }\n this.setUpdateType(UpdateType.Children |\n UpdateType.PremultipliedColors |\n UpdateType.IsRenderable);\n childUpdateType |= UpdateType.WorldAlpha;\n }\n if (this.updateType & UpdateType.PremultipliedColors) {\n this.premultipliedColorTl = mergeColorAlphaPremultiplied(this.props.colorTl, this.worldAlpha, true);\n // If all the colors are the same just sent them all to the same value\n if (this.props.colorTl === this.props.colorTr &&\n this.props.colorBl === this.props.colorBr &&\n this.props.colorTl === this.props.colorBl) {\n this.premultipliedColorTr =\n this.premultipliedColorBl =\n this.premultipliedColorBr =\n this.premultipliedColorTl;\n }\n else {\n this.premultipliedColorTr = mergeColorAlphaPremultiplied(this.props.colorTr, this.worldAlpha, true);\n this.premultipliedColorBl = mergeColorAlphaPremultiplied(this.props.colorBl, this.worldAlpha, true);\n this.premultipliedColorBr = mergeColorAlphaPremultiplied(this.props.colorBr, this.worldAlpha, true);\n }\n }\n if (this.updateType & UpdateType.RenderState) {\n this.updateRenderState(parentClippingRect);\n this.setUpdateType(UpdateType.IsRenderable);\n }\n if (this.updateType & UpdateType.IsRenderable) {\n this.updateIsRenderable();\n }\n // No need to update zIndex if there is no parent\n if (parent && this.updateType & UpdateType.CalculatedZIndex) {\n this.calculateZIndex();\n // Tell parent to re-sort children\n parent.setUpdateType(UpdateType.ZIndexSortedChildren);\n }\n if (this.updateType & UpdateType.Children && this.children.length) {\n this.children.forEach((child) => {\n // Trigger the depenedent update types on the child\n child.setUpdateType(childUpdateType);\n // If child has no updates, skip\n if (child.updateType === 0) {\n return;\n }\n child.update(delta, this.clippingRect);\n });\n }\n // Sorting children MUST happen after children have been updated so\n // that they have the oppotunity to update their calculated zIndex.\n if (this.updateType & UpdateType.ZIndexSortedChildren) {\n // reorder z-index\n this.sortChildren();\n }\n // reset update type\n this.updateType = 0;\n }\n //check if CoreNode is renderable based on props\n checkRenderProps() {\n if (this.props.texture) {\n return true;\n }\n if (!this.props.width || !this.props.height) {\n return false;\n }\n if (this.props.shader) {\n return true;\n }\n if (this.props.clipping) {\n return true;\n }\n if (this.props.color !== 0) {\n return true;\n }\n // Consider removing these checks and just using the color property check above.\n // Maybe add a forceRender prop for nodes that should always render.\n if (this.props.colorTop !== 0) {\n return true;\n }\n if (this.props.colorBottom !== 0) {\n return true;\n }\n if (this.props.colorLeft !== 0) {\n return true;\n }\n if (this.props.colorRight !== 0) {\n return true;\n }\n if (this.props.colorTl !== 0) {\n return true;\n }\n if (this.props.colorTr !== 0) {\n return true;\n }\n if (this.props.colorBl !== 0) {\n return true;\n }\n if (this.props.colorBr !== 0) {\n return true;\n }\n return false;\n }\n checkRenderBounds(parentClippingRect) {\n assertTruthy(this.renderBound);\n const rectW = parentClippingRect.width || this.stage.root.width;\n const rectH = parentClippingRect.height || this.stage.root.height;\n this.strictBound = createBound(parentClippingRect.x, parentClippingRect.y, parentClippingRect.x + rectW, parentClippingRect.y + rectH, this.strictBound);\n const renderM = this.stage.boundsMargin;\n this.preloadBound = createBound(parentClippingRect.x - renderM[3], parentClippingRect.y - renderM[0], parentClippingRect.x + rectW + renderM[1], parentClippingRect.y + rectH + renderM[2], this.preloadBound);\n if (boundInsideBound(this.renderBound, this.strictBound)) {\n return CoreNodeRenderState.InViewport;\n }\n if (boundInsideBound(this.renderBound, this.preloadBound)) {\n return CoreNodeRenderState.InBounds;\n }\n return CoreNodeRenderState.OutOfBounds;\n }\n updateRenderState(parentClippingRect) {\n const renderState = this.checkRenderBounds(parentClippingRect);\n if (renderState !== this.renderState) {\n let previous = this.renderState;\n this.renderState = renderState;\n if (previous === CoreNodeRenderState.InViewport) {\n this.emit('outOfViewport', {\n previous,\n current: renderState,\n });\n }\n if (previous < CoreNodeRenderState.InBounds &&\n renderState === CoreNodeRenderState.InViewport) {\n this.emit(CoreNodeRenderStateMap.get(CoreNodeRenderState.InBounds), {\n previous,\n current: renderState,\n });\n previous = CoreNodeRenderState.InBounds;\n }\n else if (previous > CoreNodeRenderState.InBounds &&\n renderState === CoreNodeRenderState.OutOfBounds) {\n this.emit(CoreNodeRenderStateMap.get(CoreNodeRenderState.InBounds), {\n previous,\n current: renderState,\n });\n previous = CoreNodeRenderState.InBounds;\n }\n const event = CoreNodeRenderStateMap.get(renderState);\n assertTruthy(event);\n this.emit(event, {\n previous,\n current: renderState,\n });\n }\n }\n setRenderState(state) {\n if (state !== this.renderState) {\n this.renderState = state;\n this.emit(CoreNodeRenderState[state]);\n }\n }\n /**\n * This function updates the `isRenderable` property based on certain conditions.\n *\n * @returns\n */\n updateIsRenderable() {\n let newIsRenderable;\n if (this.worldAlpha === 0 || !this.checkRenderProps()) {\n newIsRenderable = false;\n }\n else {\n newIsRenderable = this.renderState > CoreNodeRenderState.OutOfBounds;\n }\n if (this.isRenderable !== newIsRenderable) {\n this.isRenderable = newIsRenderable;\n this.onChangeIsRenderable(newIsRenderable);\n }\n }\n onChangeIsRenderable(isRenderable) {\n this.props.texture?.setRenderableOwner(this, isRenderable);\n }\n calculateRenderCoords() {\n const { width, height, globalTransform: transform } = this;\n assertTruthy(transform);\n const { tx, ty, ta, tb, tc, td } = transform;\n if (tb === 0 && tc === 0) {\n const minX = tx;\n const maxX = tx + width * ta;\n const minY = ty;\n const maxY = ty + height * td;\n this.renderCoords = RenderCoords.translate(\n //top-left\n minX, minY, \n //top-right\n maxX, minY, \n //bottom-right\n maxX, maxY, \n //bottom-left\n minX, maxY, this.renderCoords);\n }\n else {\n this.renderCoords = RenderCoords.translate(\n //top-left\n tx, ty, \n //top-right\n tx + width * ta, ty + width * tc, \n //bottom-right\n tx + width * ta + height * tb, ty + width * tc + height * td, \n //bottom-left\n tx + height * tb, ty + height * td, this.renderCoords);\n }\n }\n updateBoundingRect() {\n const { renderCoords, globalTransform: transform } = this;\n assertTruthy(transform);\n assertTruthy(renderCoords);\n const { tb, tc } = transform;\n const { x1, y1, x3, y3 } = renderCoords;\n if (tb === 0 || tc === 0) {\n this.renderBound = createBound(x1, y1, x3, y3, this.renderBound);\n }\n else {\n const { x2, x4, y2, y4 } = renderCoords;\n this.renderBound = createBound(Math.min(x1, x2, x3, x4), Math.min(y1, y2, y3, y4), Math.max(x1, x2, x3, x4), Math.max(y1, y2, y3, y4), this.renderBound);\n }\n }\n /**\n * This function calculates the clipping rectangle for a node.\n *\n * The function then checks if the node is rotated. If the node requires clipping and is not rotated, a new clipping rectangle is created based on the node's global transform and dimensions.\n * If a parent clipping rectangle exists, it is intersected with the node's clipping rectangle (if it exists), or replaces the node's clipping rectangle.\n *\n * Finally, the node's parentClippingRect and clippingRect properties are updated.\n */\n calculateClippingRect(parentClippingRect) {\n assertTruthy(this.globalTransform);\n const { clippingRect, props, globalTransform: gt } = this;\n const { clipping } = props;\n const isRotated = gt.tb !== 0 || gt.tc !== 0;\n if (clipping && !isRotated) {\n clippingRect.x = gt.tx;\n clippingRect.y = gt.ty;\n clippingRect.width = this.width * gt.ta;\n clippingRect.height = this.height * gt.td;\n clippingRect.valid = true;\n }\n else {\n clippingRect.valid = false;\n }\n if (parentClippingRect.valid && clippingRect.valid) {\n // Intersect parent clipping rect with node clipping rect\n intersectRect(parentClippingRect, clippingRect, clippingRect);\n }\n else if (parentClippingRect.valid) {\n // Copy parent clipping rect\n copyRect(parentClippingRect, clippingRect);\n clippingRect.valid = true;\n }\n }\n calculateZIndex() {\n const props = this.props;\n const z = props.zIndex || 0;\n const p = props.parent?.zIndex || 0;\n let zIndex = z;\n if (props.parent?.zIndexLocked) {\n zIndex = z < p ? z : p;\n }\n this.calcZIndex = zIndex;\n }\n /**\n * Destroy the node and cleanup all resources\n */\n destroy() {\n this.unloadTexture();\n this.clippingRect.valid = false;\n this.isRenderable = false;\n delete this.renderCoords;\n delete this.renderBound;\n delete this.strictBound;\n delete this.preloadBound;\n delete this.globalTransform;\n delete this.scaleRotateTransform;\n delete this.localTransform;\n this.props.texture = null;\n this.props.shader = null;\n this.removeAllListeners();\n this.parent = null;\n }\n renderQuads(renderer) {\n const { width, height, texture, textureOptions, shader, shaderProps } = this.props;\n const { premultipliedColorTl, premultipliedColorTr, premultipliedColorBl, premultipliedColorBr, } = this;\n const { zIndex, worldAlpha, globalTransform: gt, clippingRect } = this;\n assertTruthy(gt);\n // add to list of renderables to be sorted before rendering\n renderer.addQuad({\n width,\n height,\n colorTl: premultipliedColorTl,\n colorTr: premultipliedColorTr,\n colorBl: premultipliedColorBl,\n colorBr: premultipliedColorBr,\n texture,\n textureOptions,\n zIndex,\n shader,\n shaderProps,\n alpha: worldAlpha,\n clippingRect,\n tx: gt.tx,\n ty: gt.ty,\n ta: gt.ta,\n tb: gt.tb,\n tc: gt.tc,\n td: gt.td,\n });\n // Calculate absolute X and Y based on all ancestors\n // renderer.addQuad(absX, absY, w, h, color, texture, textureOptions, zIndex);\n }\n //#region Properties\n get id() {\n return this.props.id;\n }\n get x() {\n return this.props.x;\n }\n set x(value) {\n if (this.props.x !== value) {\n this.props.x = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get absX() {\n return (this.props.x +\n (this.props.parent?.absX || this.props.parent?.globalTransform?.tx || 0));\n }\n get absY() {\n return this.props.y + (this.props.parent?.absY ?? 0);\n }\n get y() {\n return this.props.y;\n }\n set y(value) {\n if (this.props.y !== value) {\n this.props.y = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get width() {\n return this.props.width;\n }\n set width(value) {\n if (this.props.width !== value) {\n this.props.width = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get height() {\n return this.props.height;\n }\n set height(value) {\n if (this.props.height !== value) {\n this.props.height = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get scale() {\n // The CoreNode `scale` property is only used by Animations.\n // Unlike INode, `null` should never be possibility for Animations.\n return this.scaleX;\n }\n set scale(value) {\n // The CoreNode `scale` property is only used by Animations.\n // Unlike INode, `null` should never be possibility for Animations.\n this.scaleX = value;\n this.scaleY = value;\n }\n get scaleX() {\n return this.props.scaleX;\n }\n set scaleX(value) {\n if (this.props.scaleX !== value) {\n this.props.scaleX = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get scaleY() {\n return this.props.scaleY;\n }\n set scaleY(value) {\n if (this.props.scaleY !== value) {\n this.props.scaleY = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get mount() {\n return this.props.mount;\n }\n set mount(value) {\n if (this.props.mountX !== value || this.props.mountY !== value) {\n this.props.mountX = value;\n this.props.mountY = value;\n this.props.mount = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get mountX() {\n return this.props.mountX;\n }\n set mountX(value) {\n if (this.props.mountX !== value) {\n this.props.mountX = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get mountY() {\n return this.props.mountY;\n }\n set mountY(value) {\n if (this.props.mountY !== value) {\n this.props.mountY = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivot() {\n return this.props.pivot;\n }\n set pivot(value) {\n if (this.props.pivotX !== value || this.props.pivotY !== value) {\n this.props.pivotX = value;\n this.props.pivotY = value;\n this.props.pivot = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivotX() {\n return this.props.pivotX;\n }\n set pivotX(value) {\n if (this.props.pivotX !== value) {\n this.props.pivotX = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivotY() {\n return this.props.pivotY;\n }\n set pivotY(value) {\n if (this.props.pivotY !== value) {\n this.props.pivotY = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get rotation() {\n return this.props.rotation;\n }\n set rotation(value) {\n if (this.props.rotation !== value) {\n this.props.rotation = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get alpha() {\n return this.props.alpha;\n }\n set alpha(value) {\n this.props.alpha = value;\n this.setUpdateType(UpdateType.PremultipliedColors | UpdateType.WorldAlpha);\n }\n get autosize() {\n return this.props.autosize;\n }\n set autosize(value) {\n this.props.autosize = value;\n }\n get clipping() {\n return this.props.clipping;\n }\n set clipping(value) {\n this.props.clipping = value;\n this.setUpdateType(UpdateType.Clipping);\n }\n get color() {\n return this.props.color;\n }\n set color(value) {\n if (this.props.colorTl !== value ||\n this.props.colorTr !== value ||\n this.props.colorBl !== value ||\n this.props.colorBr !== value) {\n this.colorTl = value;\n this.colorTr = value;\n this.colorBl = value;\n this.colorBr = value;\n }\n this.props.color = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTop() {\n return this.props.colorTop;\n }\n set colorTop(value) {\n if (this.props.colorTl !== value || this.props.colorTr !== value) {\n this.colorTl = value;\n this.colorTr = value;\n }\n this.props.colorTop = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBottom() {\n return this.props.colorBottom;\n }\n set colorBottom(value) {\n if (this.props.colorBl !== value || this.props.colorBr !== value) {\n this.colorBl = value;\n this.colorBr = value;\n }\n this.props.colorBottom = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorLeft() {\n return this.props.colorLeft;\n }\n set colorLeft(value) {\n if (this.props.colorTl !== value || this.props.colorBl !== value) {\n this.colorTl = value;\n this.colorBl = value;\n }\n this.props.colorLeft = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorRight() {\n return this.props.colorRight;\n }\n set colorRight(value) {\n if (this.props.colorTr !== value || this.props.colorBr !== value) {\n this.colorTr = value;\n this.colorBr = value;\n }\n this.props.colorRight = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTl() {\n return this.props.colorTl;\n }\n set colorTl(value) {\n this.props.colorTl = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTr() {\n return this.props.colorTr;\n }\n set colorTr(value) {\n this.props.colorTr = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBl() {\n return this.props.colorBl;\n }\n set colorBl(value) {\n this.props.colorBl = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBr() {\n return this.props.colorBr;\n }\n set colorBr(value) {\n this.props.colorBr = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n // we're only interested in parent zIndex to test\n // if we should use node zIndex is higher then parent zIndex\n get zIndexLocked() {\n return this.props.zIndexLocked || 0;\n }\n set zIndexLocked(value) {\n this.props.zIndexLocked = value;\n this.setUpdateType(UpdateType.CalculatedZIndex | UpdateType.Children);\n this.children.forEach((child) => {\n child.setUpdateType(UpdateType.CalculatedZIndex);\n });\n }\n get zIndex() {\n return this.props.zIndex;\n }\n set zIndex(value) {\n this.props.zIndex = value;\n this.setUpdateType(UpdateType.CalculatedZIndex | UpdateType.Children);\n this.children.forEach((child) => {\n child.setUpdateType(UpdateType.CalculatedZIndex);\n });\n }\n get parent() {\n return this.props.parent;\n }\n set parent(newParent) {\n const oldParent = this.props.parent;\n if (oldParent === newParent) {\n return;\n }\n this.props.parent = newParent;\n if (oldParent) {\n const index = oldParent.children.indexOf(this);\n assertTruthy(index !== -1, \"CoreNode.parent: Node not found in old parent's children!\");\n oldParent.children.splice(index, 1);\n oldParent.setUpdateType(UpdateType.Children | UpdateType.ZIndexSortedChildren);\n }\n if (newParent) {\n newParent.children.push(this);\n // Since this node has a new parent, to be safe, have it do a full update.\n this.setUpdateType(UpdateType.All);\n // Tell parent that it's children need to be updated and sorted.\n newParent.setUpdateType(UpdateType.Children | UpdateType.ZIndexSortedChildren);\n }\n this.updateScaleRotateTransform();\n }\n}\n//# sourceMappingURL=CoreNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { CoreAnimation } from '../../core/animations/CoreAnimation.js';\nimport { CoreAnimationController } from '../../core/animations/CoreAnimationController.js';\nimport { CoreNode } from '../../core/CoreNode.js';\nimport { EventEmitter } from '../../common/EventEmitter.js';\nimport { santizeCustomDataMap } from '../utils.js';\nlet nextId = 1;\nexport function getNewId() {\n return nextId++;\n}\nexport class MainOnlyNode extends EventEmitter {\n rendererMain;\n stage;\n id;\n coreNode;\n // Prop stores\n _children = [];\n _src = '';\n _parent = null;\n _texture = null;\n _shader = null;\n _data = {};\n constructor(props, rendererMain, stage, coreNode) {\n super();\n this.rendererMain = rendererMain;\n this.stage = stage;\n this.id = coreNode?.id ?? getNewId();\n this.coreNode =\n coreNode ||\n new CoreNode(this.stage, {\n id: this.id,\n x: props.x,\n y: props.y,\n width: props.width,\n height: props.height,\n alpha: props.alpha,\n autosize: props.autosize,\n clipping: props.clipping,\n color: props.color,\n colorTop: props.colorTop,\n colorBottom: props.colorBottom,\n colorLeft: props.colorLeft,\n colorRight: props.colorRight,\n colorTl: props.colorTl,\n colorTr: props.colorTr,\n colorBl: props.colorBl,\n colorBr: props.colorBr,\n zIndex: props.zIndex,\n zIndexLocked: props.zIndexLocked,\n scaleX: props.scaleX,\n scaleY: props.scaleY,\n mountX: props.mountX,\n mountY: props.mountY,\n mount: props.mount,\n pivot: props.pivot,\n pivotX: props.pivotX,\n pivotY: props.pivotY,\n rotation: props.rotation,\n parent: null,\n shader: null,\n shaderProps: null,\n texture: null,\n textureOptions: null,\n });\n // Forward loaded/failed events\n this.coreNode.on('loaded', this.onTextureLoaded);\n this.coreNode.on('failed', this.onTextureFailed);\n this.coreNode.on('freed', this.onTextureFreed);\n this.coreNode.on('outOfBounds', this.onOutOfBounds);\n this.coreNode.on('inBounds', this.onInBounds);\n this.coreNode.on('outOfViewport', this.onOutOfViewport);\n this.coreNode.on('inViewport', this.onInViewport);\n // Assign properties to this object\n this.parent = props.parent;\n this.shader = props.shader;\n this.texture = props.texture;\n this.src = props.src;\n this._data = props.data;\n }\n get x() {\n return this.coreNode.x;\n }\n set x(value) {\n this.coreNode.x = value;\n }\n get y() {\n return this.coreNode.y;\n }\n set y(value) {\n this.coreNode.y = value;\n }\n get width() {\n return this.coreNode.width;\n }\n set width(value) {\n this.coreNode.width = value;\n }\n get height() {\n return this.coreNode.height;\n }\n set height(value) {\n this.coreNode.height = value;\n }\n get alpha() {\n return this.coreNode.alpha;\n }\n set alpha(value) {\n this.coreNode.alpha = value;\n }\n get autosize() {\n return this.coreNode.autosize;\n }\n set autosize(value) {\n this.coreNode.autosize = value;\n }\n get clipping() {\n return this.coreNode.clipping;\n }\n set clipping(value) {\n this.coreNode.clipping = value;\n }\n get color() {\n return this.coreNode.color;\n }\n set color(value) {\n this.coreNode.color = value;\n }\n get colorTop() {\n return this.coreNode.colorTop;\n }\n set colorTop(value) {\n this.coreNode.colorTop = value;\n }\n get colorBottom() {\n return this.coreNode.colorBottom;\n }\n set colorBottom(value) {\n this.coreNode.colorBottom = value;\n }\n get colorLeft() {\n return this.coreNode.colorLeft;\n }\n set colorLeft(value) {\n this.coreNode.colorLeft = value;\n }\n get colorRight() {\n return this.coreNode.colorRight;\n }\n set colorRight(value) {\n this.coreNode.colorRight = value;\n }\n get colorTl() {\n return this.coreNode.colorTl;\n }\n set colorTl(value) {\n this.coreNode.colorTl = value;\n }\n get colorTr() {\n return this.coreNode.colorTr;\n }\n set colorTr(value) {\n this.coreNode.colorTr = value;\n }\n get colorBl() {\n return this.coreNode.colorBl;\n }\n set colorBl(value) {\n this.coreNode.colorBl = value;\n }\n get colorBr() {\n return this.coreNode.colorBr;\n }\n set colorBr(value) {\n this.coreNode.colorBr = value;\n }\n get scale() {\n if (this.scaleX !== this.scaleY) {\n return null;\n }\n return this.coreNode.scaleX;\n }\n set scale(value) {\n // We ignore `null` when it's set.\n if (value === null) {\n return;\n }\n this.coreNode.scaleX = value;\n this.coreNode.scaleY = value;\n }\n get scaleX() {\n return this.coreNode.scaleX;\n }\n set scaleX(value) {\n this.coreNode.scaleX = value;\n }\n get scaleY() {\n return this.coreNode.scaleY;\n }\n set scaleY(value) {\n this.coreNode.scaleY = value;\n }\n get mount() {\n return this.coreNode.mount;\n }\n set mount(value) {\n this.coreNode.mount = value;\n }\n get mountX() {\n return this.coreNode.mountX;\n }\n set mountX(value) {\n this.coreNode.mountX = value;\n }\n get mountY() {\n return this.coreNode.mountY;\n }\n set mountY(value) {\n this.coreNode.mountY = value;\n }\n get pivot() {\n return this.coreNode.pivot;\n }\n set pivot(value) {\n this.coreNode.pivot = value;\n }\n get pivotX() {\n return this.coreNode.pivotX;\n }\n set pivotX(value) {\n this.coreNode.pivotX = value;\n }\n get pivotY() {\n return this.coreNode.pivotY;\n }\n set pivotY(value) {\n this.coreNode.pivotY = value;\n }\n get rotation() {\n return this.coreNode.rotation;\n }\n set rotation(value) {\n this.coreNode.rotation = value;\n }\n get parent() {\n return this._parent;\n }\n set parent(newParent) {\n const oldParent = this._parent;\n this._parent = newParent;\n this.coreNode.parent = newParent?.coreNode ?? null;\n if (oldParent) {\n const index = oldParent.children.indexOf(this);\n assertTruthy(index !== -1, \"MainOnlyNode.parent: Node not found in old parent's children!\");\n oldParent.children.splice(index, 1);\n }\n if (newParent) {\n newParent.children.push(this);\n }\n }\n get children() {\n return this._children;\n }\n get zIndex() {\n return this.coreNode.zIndex;\n }\n set zIndex(value) {\n this.coreNode.zIndex = value;\n }\n get zIndexLocked() {\n return this.coreNode.zIndexLocked;\n }\n set zIndexLocked(value) {\n this.coreNode.zIndexLocked = value;\n }\n get src() {\n return this._src;\n }\n set src(imageUrl) {\n if (this._src === imageUrl) {\n return;\n }\n this._src = imageUrl;\n if (!imageUrl) {\n this.texture = null;\n return;\n }\n this.texture = this.rendererMain.createTexture('ImageTexture', {\n src: imageUrl,\n });\n }\n //#region Texture\n get texture() {\n return this._texture;\n }\n set texture(texture) {\n if (this._texture === texture) {\n return;\n }\n if (this._texture) {\n this.rendererMain.textureTracker.decrementTextureRefCount(this._texture);\n }\n if (texture) {\n this.rendererMain.textureTracker.incrementTextureRefCount(texture);\n }\n this._texture = texture;\n if (texture) {\n this.coreNode.loadTexture(texture.txType, texture.props, texture.options);\n }\n else {\n this.coreNode.unloadTexture();\n }\n }\n onTextureLoaded = (target, payload) => {\n this.emit('loaded', payload);\n };\n onTextureFailed = (target, payload) => {\n this.emit('failed', payload);\n };\n onTextureFreed = (target, payload) => {\n this.emit('freed', payload);\n };\n onOutOfBounds = (target, payload) => {\n this.emit('outOfBounds', payload);\n };\n onInBounds = (target, payload) => {\n this.emit('inBounds', payload);\n };\n onOutOfViewport = (target, payload) => {\n this.emit('outOfViewport', payload);\n };\n onInViewport = (target, payload) => {\n this.emit('inViewport', payload);\n };\n //#endregion Texture\n get shader() {\n return this._shader;\n }\n set shader(shader) {\n if (this._shader === shader) {\n return;\n }\n this._shader = shader;\n if (shader) {\n this.coreNode.loadShader(shader.shType, shader.props);\n }\n }\n get data() {\n return this._data;\n }\n set data(d) {\n this._data = santizeCustomDataMap(d);\n }\n destroy() {\n this.emit('beforeDestroy', {});\n //use while loop since setting parent to null removes it from array\n let child = this.children[0];\n while (child) {\n child.destroy();\n child = this.children[0];\n }\n this.coreNode.destroy();\n this.parent = null;\n this.texture = null;\n this.emit('afterDestroy', {});\n this.removeAllListeners();\n }\n flush() {\n // No-op\n }\n animate(props, settings) {\n const animation = new CoreAnimation(this.coreNode, props, settings);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call\n const controller = new CoreAnimationController(this.stage.animationManager, animation);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return controller;\n }\n}\n//# sourceMappingURL=MainOnlyNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Platform render loop initiator\n */\nexport const startLoop = (stage) => {\n let isIdle = false;\n const runLoop = () => {\n stage.updateAnimations();\n if (!stage.hasSceneUpdates()) {\n // We still need to calculate the fps else it looks like the app is frozen\n stage.calculateFps();\n setTimeout(runLoop, 16.666666666666668);\n if (!isIdle) {\n stage.emit('idle');\n isIdle = true;\n }\n return;\n }\n isIdle = false;\n stage.drawFrame();\n requestAnimationFrame(runLoop);\n };\n requestAnimationFrame(runLoop);\n};\n/**\n * Return unix timestamp\n * @return {number}\n */\nexport const getTimeStamp = () => {\n return performance ? performance.now() : Date.now();\n};\n//# sourceMappingURL=platform.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreAnimation } from './CoreAnimation.js';\nexport class AnimationManager {\n activeAnimations = new Set();\n registerAnimation(animation) {\n this.activeAnimations.add(animation);\n }\n unregisterAnimation(animation) {\n this.activeAnimations.delete(animation);\n }\n update(dt) {\n this.activeAnimations.forEach((animation) => {\n animation.update(dt);\n });\n }\n}\n//# sourceMappingURL=AnimationManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {} from '../textures/Texture.js';\nexport class ImageWorkerManager {\n imageWorkersEnabled = true;\n messageManager = {};\n workers = [];\n workerIndex = 0;\n constructor(numImageWorkers) {\n this.workers = this.createWorkers(numImageWorkers);\n this.workers.forEach((worker) => {\n worker.onmessage = this.handleMessage.bind(this);\n });\n }\n handleMessage(event) {\n const { src, data, error } = event.data;\n const msg = this.messageManager[src];\n if (msg) {\n const [resolve, reject] = msg;\n delete this.messageManager[src];\n if (error) {\n reject(new Error(error));\n }\n else {\n resolve(data);\n }\n }\n }\n createWorkers(numWorkers = 1) {\n const workerCode = `\n function hasAlphaChannel(mimeType) {\n return (mimeType.indexOf(\"image/png\") !== -1);\n }\n\n function getImage(src, premultiplyAlpha) {\n return new Promise(function(resolve, reject) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', src, true);\n xhr.responseType = 'blob';\n\n xhr.onload = function() {\n if (xhr.status === 200) {\n var blob = xhr.response;\n var hasAlphaChannel = premultiplyAlpha !== undefined ? premultiplyAlpha : hasAlphaChannel(blob.type);\n\n createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none'\n }).then(function(data) {\n resolve({ data: data, premultiplyAlpha: premultiplyAlpha });\n }).catch(function(error) {\n reject(error);\n });\n } else {\n reject(new Error('Failed to load image: ' + xhr.statusText));\n }\n };\n\n xhr.onerror = function() {\n reject(new Error('Network error occurred while trying to fetch the image.'));\n };\n\n xhr.send();\n });\n }\n\n self.onmessage = async (event) => {\n var src = event.data.src;\n var premultiplyAlpha = event.data.premultiplyAlpha;\n\n getImage(src, premultiplyAlpha)\n .then(function(data) {\n self.postMessage({ src: src, data: data }, [data.data]);\n })\n .catch(function(error) {\n self.postMessage({ src: src, error: error.message });\n });\n };\n `;\n const blob = new Blob([workerCode.replace('\"use strict\";', '')], {\n type: 'application/javascript',\n });\n const blobURL = (self.URL ? URL : webkitURL).createObjectURL(blob);\n const workers = [];\n for (let i = 0; i < numWorkers; i++) {\n workers.push(new Worker(blobURL));\n }\n return workers;\n }\n getNextWorker() {\n const worker = this.workers[this.workerIndex];\n this.workerIndex = (this.workerIndex + 1) % this.workers.length;\n return worker;\n }\n convertUrlToAbsolute(url) {\n const absoluteUrl = new URL(url, self.location.href);\n return absoluteUrl.href;\n }\n getImage(src, premultiplyAlpha) {\n return new Promise((resolve, reject) => {\n try {\n if (this.workers) {\n const absoluteSrcUrl = this.convertUrlToAbsolute(src);\n this.messageManager[absoluteSrcUrl] = [resolve, reject];\n this.getNextWorker().postMessage({\n src: absoluteSrcUrl,\n premultiplyAlpha,\n });\n }\n }\n catch (error) {\n reject(error);\n }\n });\n }\n}\n//# sourceMappingURL=ImageWorker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\n/**\n * Texture consisting of a random grid of greyscale pixels\n *\n * @remarks\n * The width and height of the NoiseTexture are defined by it's\n * {@link NoiseTextureProps.width} and {@link NoiseTextureProps.height}\n * properties. The {@link NoiseTextureProps.cacheId} prop can be varied in order\n * to bypass cache and get newly randomized texture data.\n */\nexport class NoiseTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = NoiseTexture.resolveDefaults(props);\n }\n async getTextureData() {\n const { width, height } = this.props;\n const size = width * height * 4;\n const pixelData8 = new Uint8ClampedArray(size);\n for (let i = 0; i < size; i += 4) {\n const v = Math.floor(Math.random() * 256);\n pixelData8[i] = v;\n pixelData8[i + 1] = v;\n pixelData8[i + 2] = v;\n pixelData8[i + 3] = 255;\n }\n return {\n data: new ImageData(pixelData8, width, height),\n };\n }\n static makeCacheKey(props) {\n const resolvedProps = NoiseTexture.resolveDefaults(props);\n return `NoiseTexture,${resolvedProps.width},${resolvedProps.height},${resolvedProps.cacheId}`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 128,\n height: props.height ?? 128,\n cacheId: props.cacheId ?? 0,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=NoiseTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../utils.js';\nimport { ImageWorkerManager } from './lib/ImageWorker.js';\nimport { ColorTexture } from './textures/ColorTexture.js';\nimport { ImageTexture } from './textures/ImageTexture.js';\nimport { NoiseTexture } from './textures/NoiseTexture.js';\nimport { SubTexture } from './textures/SubTexture.js';\nexport class CoreTextureManager {\n /**\n * Amount of used memory defined in pixels\n */\n usedMemory = 0;\n txConstructors = {};\n textureKeyCache = new Map();\n textureIdCache = new Map();\n ctxTextureCache = new WeakMap();\n textureRefCountMap = new WeakMap();\n imageWorkerManager = null;\n hasCreateImageBitmap = !!self.createImageBitmap;\n hasWorker = !!self.Worker;\n /**\n * Renderer that this texture manager is associated with\n *\n * @remarks\n * This MUST be set before the texture manager is used. Otherwise errors\n * will occur when using the texture manager.\n */\n renderer;\n constructor(numImageWorkers) {\n // Register default known texture types\n if (this.hasCreateImageBitmap && this.hasWorker) {\n this.imageWorkerManager = new ImageWorkerManager(numImageWorkers);\n }\n if (!this.hasCreateImageBitmap) {\n console.warn('[Lightning] createImageBitmap is not supported on this browser. ImageTexture will be slower.');\n }\n this.registerTextureType('ImageTexture', ImageTexture);\n this.registerTextureType('ColorTexture', ColorTexture);\n this.registerTextureType('NoiseTexture', NoiseTexture);\n this.registerTextureType('SubTexture', SubTexture);\n }\n registerTextureType(textureType, textureClass) {\n this.txConstructors[textureType] = textureClass;\n }\n loadTexture(textureType, props, options = null) {\n const TextureClass = this.txConstructors[textureType];\n if (!TextureClass) {\n throw new Error(`Texture type \"${textureType}\" is not registered`);\n }\n let texture;\n // If an ID is specified, try to get the texture from the ID cache first\n if (options?.id !== undefined && this.textureIdCache.has(options.id)) {\n // console.log('Getting texture by texture desc ID', options.id);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n texture = this.textureIdCache.get(options.id);\n }\n // If the texture is not found in the ID cache, try to get it from the key cache\n if (!texture) {\n const descId = options?.id;\n const cacheKey = options?.cacheKey ?? TextureClass.makeCacheKey(props);\n if (cacheKey && this.textureKeyCache.has(cacheKey)) {\n // console.log('Getting texture by cache key', cacheKey);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n texture = this.textureKeyCache.get(cacheKey);\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any\n texture = new TextureClass(this, props);\n }\n if (descId) {\n this.addTextureIdToCache(descId, cacheKey, texture);\n }\n }\n if (options?.preload) {\n const ctxTx = this.getCtxTexture(texture);\n ctxTx.load();\n }\n return texture;\n }\n /**\n * Add a `Texture` to the texture cache by its texture desc ID and cache key\n *\n * @remarks\n * This is used internally by the `CoreTextureManager` to cache textures\n * when they are created.\n *\n * It handles updating the texture ID cache, texture key cache, and texture\n * reference count map.\n *\n * @param textureDescId\n * @param cacheKey\n * @param texture\n */\n addTextureIdToCache(textureDescId, cacheKey, texture) {\n const { textureIdCache, textureRefCountMap } = this;\n textureIdCache.set(textureDescId, texture);\n if (textureRefCountMap.has(texture)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n textureRefCountMap.get(texture).count++;\n }\n else {\n textureRefCountMap.set(texture, { cacheKey, count: 1 });\n if (cacheKey) {\n this.textureKeyCache.set(cacheKey, texture);\n }\n }\n }\n /**\n * Remove a `Texture` from the texture cache by its texture desc ID\n *\n * @remarks\n * This is called externally by when we know (at least reasonably well) that\n * the `TextureRef` in the Main API space has been is no longer used. This\n * allows us to remove the `Texture` from the Usage Cache so that it can be\n * garbage collected as well.\n *\n * @param textureDescId\n */\n removeTextureIdFromCache(textureDescId) {\n const { textureIdCache, textureRefCountMap } = this;\n const texture = textureIdCache.get(textureDescId);\n if (!texture) {\n // Sometimes a texture is removed from the cache before it ever gets\n // added to the cache. This is fine and not an error.\n return;\n }\n textureIdCache.delete(textureDescId);\n if (textureRefCountMap.has(texture)) {\n const refCountObj = textureRefCountMap.get(texture);\n assertTruthy(refCountObj);\n refCountObj.count--;\n if (refCountObj.count === 0) {\n textureRefCountMap.delete(texture);\n // If the texture is not referenced anywhere else, remove it from the key cache\n // as well.\n // This should allow the `Texture` instance to be garbage collected.\n if (refCountObj.cacheKey) {\n this.textureKeyCache.delete(refCountObj.cacheKey);\n }\n }\n }\n // Free the ctx texture if it exists.\n this.ctxTextureCache.get(texture)?.free();\n }\n /**\n * Get an object containing debug information about the texture manager.\n *\n * @returns\n */\n getDebugInfo() {\n // const textureSet = new Set();\n // for (const texture of this.textureIdCache.values()) {\n // textureSet.add(texture);\n // }\n // for (const texture of this.textureKeyCache.values()) {\n // textureSet.add(texture);\n // }\n // TODO: Output number of bytes used by textures\n return {\n keyCacheSize: this.textureKeyCache.size,\n idCacheSize: this.textureIdCache.size,\n };\n }\n /**\n * Get a CoreContextTexture for the given Texture source.\n *\n * @remarks\n * If the texture source already has an allocated CoreContextTexture, it will be\n * returned from the cache. Otherwise, a new CoreContextTexture will be created\n * and cached.\n *\n * ContextTextures are stored in a WeakMap, so they will be garbage collected\n * when the Texture source is no longer referenced.\n *\n * @param textureSource\n * @returns\n */\n getCtxTexture(textureSource) {\n if (this.ctxTextureCache.has(textureSource)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.ctxTextureCache.get(textureSource);\n }\n const texture = this.renderer.createCtxTexture(textureSource);\n this.ctxTextureCache.set(textureSource, texture);\n return texture;\n }\n}\n//# sourceMappingURL=CoreTextureManager.js.map","export class TextureMemoryManager {\n memUsed = 0;\n textures = new Map();\n threshold;\n /**\n * @param byteThreshold Number of texture bytes to trigger garbage collection\n */\n constructor(byteThreshold) {\n this.threshold = byteThreshold;\n // If the threshold is 0, we disable the memory manager by replacing the\n // setTextureMemUse method with a no-op function.\n if (byteThreshold === 0) {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n this.setTextureMemUse = () => { };\n }\n }\n setTextureMemUse(ctxTexture, byteSize) {\n if (this.textures.has(ctxTexture)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.memUsed -= this.textures.get(ctxTexture);\n }\n if (byteSize === 0) {\n this.textures.delete(ctxTexture);\n return;\n }\n else {\n this.memUsed += byteSize;\n this.textures.set(ctxTexture, byteSize);\n }\n if (this.memUsed > this.threshold) {\n this.gc();\n }\n }\n gc() {\n this.textures.forEach((byteSize, ctxTexture) => {\n if (!ctxTexture.renderable) {\n ctxTexture.free();\n }\n });\n }\n}\n//# sourceMappingURL=TextureMemoryManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { startLoop, getTimeStamp } from './platform.js';\nimport { WebGlCoreRenderer } from './renderers/webgl/WebGlCoreRenderer.js';\nimport { assertTruthy } from '../utils.js';\nimport { AnimationManager } from './animations/AnimationManager.js';\nimport { CoreNode } from './CoreNode.js';\nimport { CoreTextureManager } from './CoreTextureManager.js';\nimport { TrFontManager } from './text-rendering/TrFontManager.js';\nimport { CoreShaderManager } from './CoreShaderManager.js';\nimport { SdfTextRenderer } from './text-rendering/renderers/SdfTextRenderer/SdfTextRenderer.js';\nimport { CanvasTextRenderer } from './text-rendering/renderers/CanvasTextRenderer.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { ContextSpy } from './lib/ContextSpy.js';\nimport { TextureMemoryManager } from './TextureMemoryManager.js';\nconst bufferMemory = 2e6;\nconst autoStart = true;\nexport class Stage extends EventEmitter {\n options;\n /// Module Instances\n animationManager;\n txManager;\n txMemManager;\n fontManager;\n textRenderers;\n shManager;\n renderer;\n root;\n boundsMargin;\n /// State\n deltaTime = 0;\n lastFrameTime = 0;\n currentFrameTime = 0;\n fpsNumFrames = 0;\n fpsElapsedTime = 0;\n renderRequested = false;\n /// Debug data\n contextSpy = null;\n /**\n * Stage constructor\n */\n constructor(options) {\n super();\n this.options = options;\n const { canvas, clearColor, rootId, debug, appWidth, appHeight, boundsMargin, enableContextSpy, numImageWorkers, txMemByteThreshold, } = options;\n this.txManager = new CoreTextureManager(numImageWorkers);\n this.txMemManager = new TextureMemoryManager(txMemByteThreshold);\n this.shManager = new CoreShaderManager();\n this.animationManager = new AnimationManager();\n this.contextSpy = enableContextSpy ? new ContextSpy() : null;\n let bm = [0, 0, 0, 0];\n if (boundsMargin) {\n bm = Array.isArray(boundsMargin)\n ? boundsMargin\n : [boundsMargin, boundsMargin, boundsMargin, boundsMargin];\n }\n this.boundsMargin = bm;\n if (debug?.monitorTextureCache) {\n setInterval(() => {\n assertTruthy(this.txManager);\n const debugInfo = this.txManager.getDebugInfo();\n console.log('Texture ID Cache Size: ', debugInfo.idCacheSize);\n console.log('Texture Key Cache Size: ', debugInfo.keyCacheSize);\n }, 1000);\n }\n this.renderer = new WebGlCoreRenderer({\n stage: this,\n canvas,\n pixelRatio: options.devicePhysicalPixelRatio * options.deviceLogicalPixelRatio,\n clearColor: clearColor ?? 0xff000000,\n bufferMemory,\n txManager: this.txManager,\n txMemManager: this.txMemManager,\n shManager: this.shManager,\n contextSpy: this.contextSpy,\n });\n // Must do this after renderer is created\n this.txManager.renderer = this.renderer;\n this.textRenderers = {\n canvas: new CanvasTextRenderer(this),\n sdf: new SdfTextRenderer(this),\n };\n this.fontManager = new TrFontManager(this.textRenderers);\n // create root node\n const rootNode = new CoreNode(this, {\n id: rootId,\n x: 0,\n y: 0,\n width: appWidth,\n height: appHeight,\n alpha: 1,\n autosize: false,\n clipping: false,\n color: 0x00000000,\n colorTop: 0x00000000,\n colorBottom: 0x00000000,\n colorLeft: 0x00000000,\n colorRight: 0x00000000,\n colorTl: 0x00000000,\n colorTr: 0x00000000,\n colorBl: 0x00000000,\n colorBr: 0x00000000,\n zIndex: 0,\n zIndexLocked: 0,\n scaleX: 1,\n scaleY: 1,\n mountX: 0,\n mountY: 0,\n mount: 0,\n pivot: 0.5,\n pivotX: 0.5,\n pivotY: 0.5,\n rotation: 0,\n parent: null,\n texture: null,\n textureOptions: null,\n shader: null,\n shaderProps: null,\n });\n this.root = rootNode;\n // execute platform start loop\n if (autoStart) {\n startLoop(this);\n }\n }\n /**\n * Update animations\n */\n updateAnimations() {\n const { animationManager } = this;\n if (!this.root) {\n return;\n }\n this.lastFrameTime = this.currentFrameTime;\n this.currentFrameTime = getTimeStamp();\n this.deltaTime = !this.lastFrameTime\n ? 100 / 6\n : this.currentFrameTime - this.lastFrameTime;\n this.emit('frameTick', {\n time: this.currentFrameTime,\n delta: this.deltaTime,\n });\n // step animation\n animationManager.update(this.deltaTime);\n }\n /**\n * Check if the scene has updates\n */\n hasSceneUpdates() {\n return !!this.root.updateType || this.renderRequested;\n }\n /**\n * Start a new frame draw\n */\n drawFrame() {\n const { renderer, renderRequested } = this;\n // Update tree if needed\n if (this.root.updateType !== 0) {\n this.root.update(this.deltaTime, this.root.clippingRect);\n }\n // test if we need to update the scene\n renderer?.reset();\n this.addQuads(this.root);\n renderer?.render();\n this.calculateFps();\n // Reset renderRequested flag if it was set\n if (renderRequested) {\n this.renderRequested = false;\n }\n }\n calculateFps() {\n // If there's an FPS update interval, emit the FPS update event\n // when the specified interval has elapsed.\n const { fpsUpdateInterval } = this.options;\n if (fpsUpdateInterval) {\n this.fpsNumFrames++;\n this.fpsElapsedTime += this.deltaTime;\n if (this.fpsElapsedTime >= fpsUpdateInterval) {\n const fps = Math.round((this.fpsNumFrames * 1000) / this.fpsElapsedTime);\n this.fpsNumFrames = 0;\n this.fpsElapsedTime = 0;\n this.emit('fpsUpdate', {\n fps,\n contextSpyData: this.contextSpy?.getData() ?? null,\n });\n this.contextSpy?.reset();\n }\n }\n }\n addQuads(node) {\n assertTruthy(this.renderer && node.globalTransform);\n if (node.isRenderable) {\n node.renderQuads(this.renderer);\n }\n for (let i = 0; i < node.children.length; i++) {\n const child = node.children[i];\n if (!child) {\n continue;\n }\n if (child?.worldAlpha === 0) {\n continue;\n }\n this.addQuads(child);\n }\n }\n /**\n * Request a render pass without forcing an update\n */\n requestRender() {\n this.renderRequested = true;\n }\n /**\n * Given a font name, and possible renderer override, return the best compatible text renderer.\n *\n * @remarks\n * Will always return at least a canvas renderer if no other suitable renderer can be resolved.\n *\n * @param fontFamily\n * @param textRendererOverride\n * @returns\n */\n resolveTextRenderer(trProps, textRendererOverride = null) {\n let rendererId = textRendererOverride;\n let overrideFallback = false;\n // Check if the override is valid (if one is provided)\n if (rendererId) {\n const possibleRenderer = this.textRenderers[rendererId];\n if (!possibleRenderer) {\n console.warn(`Text renderer override '${rendererId}' not found.`);\n rendererId = null;\n overrideFallback = true;\n }\n else if (!possibleRenderer.canRenderFont(trProps)) {\n console.warn(`Cannot use override text renderer '${rendererId}' for font`, trProps);\n rendererId = null;\n overrideFallback = true;\n }\n }\n if (!rendererId) {\n // Iterate through the text renderers and find the first one that can render the font\n for (const [trId, tr] of Object.entries(this.textRenderers)) {\n if (trId === 'canvas') {\n // Canvas is always a fallback\n continue;\n }\n if (tr.canRenderFont(trProps)) {\n rendererId = trId;\n break;\n }\n }\n if (!rendererId) {\n // If no renderer can be found, use the canvas renderer\n rendererId = 'canvas';\n }\n }\n if (overrideFallback) {\n console.warn(`Falling back to text renderer ${String(rendererId)}`);\n }\n // By now we are guaranteed to have a valid rendererId (at least Canvas);\n const resolvedTextRenderer = this.textRenderers[rendererId];\n assertTruthy(resolvedTextRenderer, 'resolvedTextRenderer undefined');\n // Need to explicitly cast to TextRenderer because TS doesn't like\n // the covariant state argument in the setter method map\n return resolvedTextRenderer;\n }\n}\n//# sourceMappingURL=Stage.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreNode, UpdateType } from './CoreNode.js';\nimport { assertTruthy } from '../utils.js';\nexport class CoreTextNode extends CoreNode {\n textRenderer;\n trState;\n _textRendererOverride = null;\n constructor(stage, props) {\n super(stage, props);\n this._textRendererOverride = props.textRendererOverride;\n const { resolvedTextRenderer, textRendererState } = this.resolveTextRendererAndState({\n x: this.absX,\n y: this.absY,\n width: props.width,\n height: props.height,\n textAlign: props.textAlign,\n color: props.color,\n zIndex: props.zIndex,\n contain: props.contain,\n scrollable: props.scrollable,\n scrollY: props.scrollY,\n offsetY: props.offsetY,\n letterSpacing: props.letterSpacing,\n debug: props.debug,\n fontFamily: props.fontFamily,\n fontSize: props.fontSize,\n fontStretch: props.fontStretch,\n fontStyle: props.fontStyle,\n fontWeight: props.fontWeight,\n text: props.text,\n lineHeight: props.lineHeight,\n maxLines: props.maxLines,\n textBaseline: props.textBaseline,\n verticalAlign: props.verticalAlign,\n overflowSuffix: props.overflowSuffix,\n });\n this.textRenderer = resolvedTextRenderer;\n this.trState = textRendererState;\n }\n onTextLoaded = () => {\n const { contain } = this;\n const setWidth = this.trState.props.width;\n const setHeight = this.trState.props.height;\n const calcWidth = this.trState.textW || 0;\n const calcHeight = this.trState.textH || 0;\n if (contain === 'both') {\n this.props.width = setWidth;\n this.props.height = setHeight;\n }\n else if (contain === 'width') {\n this.props.width = setWidth;\n this.props.height = calcHeight;\n }\n else if (contain === 'none') {\n this.props.width = calcWidth;\n this.props.height = calcHeight;\n }\n this.updateLocalTransform();\n // Incase the RAF loop has been stopped already before text was loaded,\n // we request a render so it can be drawn.\n this.stage.requestRender();\n this.emit('loaded', {\n type: 'text',\n dimensions: {\n width: this.trState.textW || 0,\n height: this.trState.textH || 0,\n },\n });\n };\n onTextFailed = (target, error) => {\n this.emit('failed', {\n type: 'text',\n error,\n });\n };\n get width() {\n return this.props.width;\n }\n set width(value) {\n this.props.width = value;\n this.textRenderer.set.width(this.trState, value);\n // If not containing, we must update the local transform to account for the\n // new width\n if (this.contain === 'none') {\n this.setUpdateType(UpdateType.Local);\n }\n }\n get height() {\n return this.props.height;\n }\n set height(value) {\n this.props.height = value;\n this.textRenderer.set.height(this.trState, value);\n // If not containing in the horizontal direction, we must update the local\n // transform to account for the new height\n if (this.contain !== 'both') {\n this.setUpdateType(UpdateType.Local);\n }\n }\n get color() {\n return this.trState.props.color;\n }\n set color(value) {\n this.textRenderer.set.color(this.trState, value);\n }\n get text() {\n return this.trState.props.text;\n }\n set text(value) {\n this.textRenderer.set.text(this.trState, value);\n }\n get textRendererOverride() {\n return this._textRendererOverride;\n }\n set textRendererOverride(value) {\n this._textRendererOverride = value;\n this.textRenderer.destroyState(this.trState);\n const { resolvedTextRenderer, textRendererState } = this.resolveTextRendererAndState(this.trState.props);\n this.textRenderer = resolvedTextRenderer;\n this.trState = textRendererState;\n }\n get fontSize() {\n return this.trState.props.fontSize;\n }\n set fontSize(value) {\n this.textRenderer.set.fontSize(this.trState, value);\n }\n get fontFamily() {\n return this.trState.props.fontFamily;\n }\n set fontFamily(value) {\n this.textRenderer.set.fontFamily(this.trState, value);\n }\n get fontStretch() {\n return this.trState.props.fontStretch;\n }\n set fontStretch(value) {\n this.textRenderer.set.fontStretch(this.trState, value);\n }\n get fontStyle() {\n return this.trState.props.fontStyle;\n }\n set fontStyle(value) {\n this.textRenderer.set.fontStyle(this.trState, value);\n }\n get fontWeight() {\n return this.trState.props.fontWeight;\n }\n set fontWeight(value) {\n this.textRenderer.set.fontWeight(this.trState, value);\n }\n get textAlign() {\n return this.trState.props.textAlign;\n }\n set textAlign(value) {\n this.textRenderer.set.textAlign(this.trState, value);\n }\n get contain() {\n return this.trState.props.contain;\n }\n set contain(value) {\n this.textRenderer.set.contain(this.trState, value);\n }\n get scrollable() {\n return this.trState.props.scrollable;\n }\n set scrollable(value) {\n this.textRenderer.set.scrollable(this.trState, value);\n }\n get scrollY() {\n return this.trState.props.scrollY;\n }\n set scrollY(value) {\n this.textRenderer.set.scrollY(this.trState, value);\n }\n get offsetY() {\n return this.trState.props.offsetY;\n }\n set offsetY(value) {\n this.textRenderer.set.offsetY(this.trState, value);\n }\n get letterSpacing() {\n return this.trState.props.letterSpacing;\n }\n set letterSpacing(value) {\n this.textRenderer.set.letterSpacing(this.trState, value);\n }\n get lineHeight() {\n return this.trState.props.lineHeight;\n }\n set lineHeight(value) {\n if (this.textRenderer.set.lineHeight) {\n this.textRenderer.set.lineHeight(this.trState, value);\n }\n }\n get maxLines() {\n return this.trState.props.maxLines;\n }\n set maxLines(value) {\n if (this.textRenderer.set.maxLines) {\n this.textRenderer.set.maxLines(this.trState, value);\n }\n }\n get textBaseline() {\n return this.trState.props.textBaseline;\n }\n set textBaseline(value) {\n if (this.textRenderer.set.textBaseline) {\n this.textRenderer.set.textBaseline(this.trState, value);\n }\n }\n get verticalAlign() {\n return this.trState.props.verticalAlign;\n }\n set verticalAlign(value) {\n if (this.textRenderer.set.verticalAlign) {\n this.textRenderer.set.verticalAlign(this.trState, value);\n }\n }\n get overflowSuffix() {\n return this.trState.props.overflowSuffix;\n }\n set overflowSuffix(value) {\n if (this.textRenderer.set.overflowSuffix) {\n this.textRenderer.set.overflowSuffix(this.trState, value);\n }\n }\n get debug() {\n return this.trState.props.debug;\n }\n set debug(value) {\n this.textRenderer.set.debug(this.trState, value);\n }\n update(delta, parentClippingRect) {\n super.update(delta, parentClippingRect);\n assertTruthy(this.globalTransform);\n // globalTransform is updated in super.update(delta)\n this.textRenderer.set.x(this.trState, this.globalTransform.tx);\n this.textRenderer.set.y(this.trState, this.globalTransform.ty);\n }\n checkRenderProps() {\n if (this.trState.props.text !== '') {\n return true;\n }\n return super.checkRenderProps();\n }\n onChangeIsRenderable(isRenderable) {\n super.onChangeIsRenderable(isRenderable);\n this.textRenderer.setIsRenderable(this.trState, isRenderable);\n }\n renderQuads(renderer) {\n assertTruthy(this.globalTransform);\n this.textRenderer.renderQuads(this.trState, this.globalTransform, this.clippingRect, this.worldAlpha);\n }\n /**\n * Destroy the node and cleanup all resources\n */\n destroy() {\n super.destroy();\n this.textRenderer.destroyState(this.trState);\n }\n /**\n * Resolve a text renderer and a new state based on the current text renderer props provided\n * @param props\n * @returns\n */\n resolveTextRendererAndState(props) {\n const resolvedTextRenderer = this.stage.resolveTextRenderer(props, this._textRendererOverride);\n const textRendererState = resolvedTextRenderer.createState(props);\n textRendererState.emitter.on('loaded', this.onTextLoaded);\n textRendererState.emitter.on('failed', this.onTextFailed);\n resolvedTextRenderer.scheduleUpdateState(textRendererState);\n return {\n resolvedTextRenderer,\n textRendererState,\n };\n }\n}\n//# sourceMappingURL=CoreTextNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { MainOnlyNode, getNewId } from './MainOnlyNode.js';\nimport { CoreTextNode } from '../../core/CoreTextNode.js';\nexport class MainOnlyTextNode extends MainOnlyNode {\n constructor(props, rendererMain, stage) {\n super(props, rendererMain, stage, new CoreTextNode(stage, {\n id: getNewId(),\n x: props.x,\n y: props.y,\n width: props.width,\n height: props.height,\n alpha: props.alpha,\n autosize: props.autosize,\n clipping: props.clipping,\n color: props.color,\n colorTop: props.colorTop,\n colorBottom: props.colorBottom,\n colorLeft: props.colorLeft,\n colorRight: props.colorRight,\n colorTl: props.colorTl,\n colorTr: props.colorTr,\n colorBl: props.colorBl,\n colorBr: props.colorBr,\n zIndex: props.zIndex,\n zIndexLocked: props.zIndexLocked,\n scaleX: props.scaleX,\n scaleY: props.scaleY,\n mountX: props.mountX,\n mountY: props.mountY,\n mount: props.mount,\n pivot: props.pivot,\n pivotX: props.pivotX,\n pivotY: props.pivotY,\n rotation: props.rotation,\n // Text properties\n text: props.text,\n fontSize: props.fontSize,\n fontFamily: props.fontFamily,\n fontWeight: props.fontWeight,\n fontStretch: props.fontStretch,\n fontStyle: props.fontStyle,\n contain: props.contain,\n scrollable: props.scrollable,\n letterSpacing: props.letterSpacing,\n textAlign: props.textAlign,\n scrollY: props.scrollY,\n offsetY: props.offsetY,\n textRendererOverride: props.textRendererOverride,\n lineHeight: props.lineHeight,\n maxLines: props.maxLines,\n textBaseline: props.textBaseline,\n verticalAlign: props.verticalAlign,\n overflowSuffix: props.overflowSuffix,\n debug: props.debug,\n // These properties will get set appropriately in the base MainOnlyNode class\n parent: null,\n texture: null,\n textureOptions: null,\n shader: null,\n shaderProps: null,\n }));\n }\n get text() {\n return this.coreNode.text;\n }\n set text(value) {\n this.coreNode.text = value;\n }\n get textRendererOverride() {\n return this.coreNode.textRendererOverride;\n }\n set textRendererOverride(value) {\n this.coreNode.textRendererOverride = value;\n }\n get fontSize() {\n return this.coreNode.fontSize;\n }\n set fontSize(value) {\n this.coreNode.fontSize = value;\n }\n get fontFamily() {\n return this.coreNode.fontFamily;\n }\n set fontFamily(value) {\n this.coreNode.fontFamily = value;\n }\n get fontWeight() {\n return this.coreNode.fontWeight;\n }\n set fontWeight(value) {\n this.coreNode.fontWeight = value;\n }\n get fontStretch() {\n return this.coreNode.fontStretch;\n }\n set fontStretch(value) {\n this.coreNode.fontStretch = value;\n }\n get fontStyle() {\n return this.coreNode.fontStyle;\n }\n set fontStyle(value) {\n this.coreNode.fontStyle = value;\n }\n get textAlign() {\n return this.coreNode.textAlign;\n }\n set textAlign(value) {\n this.coreNode.textAlign = value;\n }\n get contain() {\n return this.coreNode.contain;\n }\n set contain(value) {\n this.coreNode.contain = value;\n }\n get scrollable() {\n return this.coreNode.scrollable;\n }\n set scrollable(value) {\n this.coreNode.scrollable = value;\n }\n get scrollY() {\n return this.coreNode.scrollY;\n }\n set scrollY(value) {\n this.coreNode.scrollY = value;\n }\n get offsetY() {\n return this.coreNode.offsetY;\n }\n set offsetY(value) {\n this.coreNode.offsetY = value;\n }\n get letterSpacing() {\n return this.coreNode.letterSpacing;\n }\n set letterSpacing(value) {\n this.coreNode.letterSpacing = value;\n }\n get lineHeight() {\n return this.coreNode.lineHeight;\n }\n set lineHeight(value) {\n if (value) {\n this.coreNode.lineHeight = value;\n }\n }\n get maxLines() {\n return this.coreNode.maxLines;\n }\n set maxLines(value) {\n if (value) {\n this.coreNode.maxLines = value;\n }\n }\n get textBaseline() {\n return this.coreNode.textBaseline;\n }\n set textBaseline(value) {\n if (value) {\n this.coreNode.textBaseline = value;\n }\n }\n get verticalAlign() {\n return this.coreNode.verticalAlign;\n }\n set verticalAlign(value) {\n if (value) {\n this.coreNode.verticalAlign = value;\n }\n }\n get overflowSuffix() {\n return this.coreNode.overflowSuffix;\n }\n set overflowSuffix(value) {\n if (value) {\n this.coreNode.overflowSuffix = value;\n }\n }\n get debug() {\n return this.coreNode.debug;\n }\n set debug(value) {\n this.coreNode.debug = value;\n }\n}\n//# sourceMappingURL=MainOnlyTextNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { MainOnlyNode, getNewId } from './MainOnlyNode.js';\nimport { Stage, } from '../../core/Stage.js';\nimport { MainOnlyTextNode } from './MainOnlyTextNode.js';\nimport { loadCoreExtension } from '../utils.js';\nexport class MainCoreDriver {\n root = null;\n stage = null;\n rendererMain = null;\n async init(rendererMain, rendererSettings, canvas) {\n this.stage = new Stage({\n rootId: getNewId(),\n appWidth: rendererSettings.appWidth,\n appHeight: rendererSettings.appHeight,\n txMemByteThreshold: rendererSettings.txMemByteThreshold,\n boundsMargin: rendererSettings.boundsMargin,\n deviceLogicalPixelRatio: rendererSettings.deviceLogicalPixelRatio,\n devicePhysicalPixelRatio: rendererSettings.devicePhysicalPixelRatio,\n clearColor: rendererSettings.clearColor,\n canvas,\n fpsUpdateInterval: rendererSettings.fpsUpdateInterval,\n enableContextSpy: rendererSettings.enableContextSpy,\n numImageWorkers: rendererSettings.numImageWorkers,\n debug: {\n monitorTextureCache: false,\n },\n });\n this.rendererMain = rendererMain;\n assertTruthy(this.stage.root);\n const node = new MainOnlyNode(rendererMain.resolveNodeDefaults({}), this.rendererMain, this.stage, this.stage.root);\n this.root = node;\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n // Load the Core Extension Module if one was specified.\n if (rendererSettings.coreExtensionModule) {\n await loadCoreExtension(rendererSettings.coreExtensionModule, this.stage);\n }\n // Forward fpsUpdate events from the stage to RendererMain\n this.stage.on('fpsUpdate', ((stage, fpsData) => {\n this.onFpsUpdate(fpsData);\n }));\n this.stage.on('frameTick', ((stage, frameTickData) => {\n this.onFrameTick(frameTickData);\n }));\n this.stage.on('idle', () => {\n this.onIdle();\n });\n }\n createNode(props) {\n assertTruthy(this.rendererMain);\n assertTruthy(this.stage);\n const node = new MainOnlyNode(props, this.rendererMain, this.stage);\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n return node;\n }\n createTextNode(props) {\n assertTruthy(this.rendererMain);\n assertTruthy(this.stage);\n const node = new MainOnlyTextNode(props, this.rendererMain, this.stage);\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n return node;\n }\n // TODO: Remove?\n destroyNode(node) {\n node.destroy();\n }\n releaseTexture(id) {\n const { stage } = this;\n assertTruthy(stage);\n stage.txManager.removeTextureIdFromCache(id);\n }\n getRootNode() {\n assertTruthy(this.root);\n return this.root;\n }\n //#region Event Methods\n // The implementations for these event methods are provided by RendererMain\n onCreateNode(node) {\n throw new Error('Method not implemented.');\n }\n onBeforeDestroyNode(node) {\n throw new Error('Method not implemented.');\n }\n onFpsUpdate(fpsData) {\n throw new Error('Method not implemented.');\n }\n onFrameTick(frameTickData) {\n throw new Error('Method not implemented.');\n }\n onIdle() {\n throw new Error('Method not implemented.');\n }\n}\n//# sourceMappingURL=MainCoreDriver.js.map","let taskIdCounter = 1,\n isCallbackScheduled = false,\n isPerformingWork = false,\n taskQueue = [],\n currentTask = null,\n shouldYieldToHost = null,\n yieldInterval = 5,\n deadline = 0,\n maxYieldInterval = 300,\n scheduleCallback = null,\n scheduledCallback = null;\nconst maxSigned31BitInt = 1073741823;\nfunction setupScheduler() {\n const channel = new MessageChannel(),\n port = channel.port2;\n scheduleCallback = () => port.postMessage(null);\n channel.port1.onmessage = () => {\n if (scheduledCallback !== null) {\n const currentTime = performance.now();\n deadline = currentTime + yieldInterval;\n const hasTimeRemaining = true;\n try {\n const hasMoreWork = scheduledCallback(hasTimeRemaining, currentTime);\n if (!hasMoreWork) {\n scheduledCallback = null;\n } else port.postMessage(null);\n } catch (error) {\n port.postMessage(null);\n throw error;\n }\n }\n };\n if (navigator && navigator.scheduling && navigator.scheduling.isInputPending) {\n const scheduling = navigator.scheduling;\n shouldYieldToHost = () => {\n const currentTime = performance.now();\n if (currentTime >= deadline) {\n if (scheduling.isInputPending()) {\n return true;\n }\n return currentTime >= maxYieldInterval;\n } else {\n return false;\n }\n };\n } else {\n shouldYieldToHost = () => performance.now() >= deadline;\n }\n}\nfunction enqueue(taskQueue, task) {\n function findIndex() {\n let m = 0;\n let n = taskQueue.length - 1;\n while (m <= n) {\n const k = (n + m) >> 1;\n const cmp = task.expirationTime - taskQueue[k].expirationTime;\n if (cmp > 0) m = k + 1;\n else if (cmp < 0) n = k - 1;\n else return k;\n }\n return m;\n }\n taskQueue.splice(findIndex(), 0, task);\n}\nfunction requestCallback(fn, options) {\n if (!scheduleCallback) setupScheduler();\n let startTime = performance.now(),\n timeout = maxSigned31BitInt;\n if (options && options.timeout) timeout = options.timeout;\n const newTask = {\n id: taskIdCounter++,\n fn,\n startTime,\n expirationTime: startTime + timeout\n };\n enqueue(taskQueue, newTask);\n if (!isCallbackScheduled && !isPerformingWork) {\n isCallbackScheduled = true;\n scheduledCallback = flushWork;\n scheduleCallback();\n }\n return newTask;\n}\nfunction cancelCallback(task) {\n task.fn = null;\n}\nfunction flushWork(hasTimeRemaining, initialTime) {\n isCallbackScheduled = false;\n isPerformingWork = true;\n try {\n return workLoop(hasTimeRemaining, initialTime);\n } finally {\n currentTask = null;\n isPerformingWork = false;\n }\n}\nfunction workLoop(hasTimeRemaining, initialTime) {\n let currentTime = initialTime;\n currentTask = taskQueue[0] || null;\n while (currentTask !== null) {\n if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {\n break;\n }\n const callback = currentTask.fn;\n if (callback !== null) {\n currentTask.fn = null;\n const didUserCallbackTimeout = currentTask.expirationTime <= currentTime;\n callback(didUserCallbackTimeout);\n currentTime = performance.now();\n if (currentTask === taskQueue[0]) {\n taskQueue.shift();\n }\n } else taskQueue.shift();\n currentTask = taskQueue[0] || null;\n }\n return currentTask !== null;\n}\n\nconst sharedConfig = {\n context: undefined,\n registry: undefined\n};\nfunction setHydrateContext(context) {\n sharedConfig.context = context;\n}\nfunction nextHydrateContext() {\n return {\n ...sharedConfig.context,\n id: `${sharedConfig.context.id}${sharedConfig.context.count++}-`,\n count: 0\n };\n}\n\nconst equalFn = (a, b) => a === b;\nconst $PROXY = Symbol(\"solid-proxy\");\nconst $TRACK = Symbol(\"solid-track\");\nconst $DEVCOMP = Symbol(\"solid-dev-component\");\nconst signalOptions = {\n equals: equalFn\n};\nlet ERROR = null;\nlet runEffects = runQueue;\nconst STALE = 1;\nconst PENDING = 2;\nconst UNOWNED = {\n owned: null,\n cleanups: null,\n context: null,\n owner: null\n};\nconst NO_INIT = {};\nvar Owner = null;\nlet Transition = null;\nlet Scheduler = null;\nlet ExternalSourceConfig = null;\nlet Listener = null;\nlet Updates = null;\nlet Effects = null;\nlet ExecCount = 0;\nfunction createRoot(fn, detachedOwner) {\n const listener = Listener,\n owner = Owner,\n unowned = fn.length === 0,\n current = detachedOwner === undefined ? owner : detachedOwner,\n root = unowned\n ? UNOWNED\n : {\n owned: null,\n cleanups: null,\n context: current ? current.context : null,\n owner: current\n },\n updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root)));\n Owner = root;\n Listener = null;\n try {\n return runUpdates(updateFn, true);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n}\nfunction createSignal(value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const s = {\n value,\n observers: null,\n observerSlots: null,\n comparator: options.equals || undefined\n };\n const setter = value => {\n if (typeof value === \"function\") {\n if (Transition && Transition.running && Transition.sources.has(s)) value = value(s.tValue);\n else value = value(s.value);\n }\n return writeSignal(s, value);\n };\n return [readSignal.bind(s), setter];\n}\nfunction createComputed(fn, value, options) {\n const c = createComputation(fn, value, true, STALE);\n if (Scheduler && Transition && Transition.running) Updates.push(c);\n else updateComputation(c);\n}\nfunction createRenderEffect(fn, value, options) {\n const c = createComputation(fn, value, false, STALE);\n if (Scheduler && Transition && Transition.running) Updates.push(c);\n else updateComputation(c);\n}\nfunction createEffect(fn, value, options) {\n runEffects = runUserEffects;\n const c = createComputation(fn, value, false, STALE),\n s = SuspenseContext && useContext(SuspenseContext);\n if (s) c.suspense = s;\n if (!options || !options.render) c.user = true;\n Effects ? Effects.push(c) : updateComputation(c);\n}\nfunction createReaction(onInvalidate, options) {\n let fn;\n const c = createComputation(\n () => {\n fn ? fn() : untrack(onInvalidate);\n fn = undefined;\n },\n undefined,\n false,\n 0\n ),\n s = SuspenseContext && useContext(SuspenseContext);\n if (s) c.suspense = s;\n c.user = true;\n return tracking => {\n fn = tracking;\n updateComputation(c);\n };\n}\nfunction createMemo(fn, value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const c = createComputation(fn, value, true, 0);\n c.observers = null;\n c.observerSlots = null;\n c.comparator = options.equals || undefined;\n if (Scheduler && Transition && Transition.running) {\n c.tState = STALE;\n Updates.push(c);\n } else updateComputation(c);\n return readSignal.bind(c);\n}\nfunction isPromise(v) {\n return v && typeof v === \"object\" && \"then\" in v;\n}\nfunction createResource(pSource, pFetcher, pOptions) {\n let source;\n let fetcher;\n let options;\n if ((arguments.length === 2 && typeof pFetcher === \"object\") || arguments.length === 1) {\n source = true;\n fetcher = pSource;\n options = pFetcher || {};\n } else {\n source = pSource;\n fetcher = pFetcher;\n options = pOptions || {};\n }\n let pr = null,\n initP = NO_INIT,\n id = null,\n loadedUnderTransition = false,\n scheduled = false,\n resolved = \"initialValue\" in options,\n dynamic = typeof source === \"function\" && createMemo(source);\n const contexts = new Set(),\n [value, setValue] = (options.storage || createSignal)(options.initialValue),\n [error, setError] = createSignal(undefined),\n [track, trigger] = createSignal(undefined, {\n equals: false\n }),\n [state, setState] = createSignal(resolved ? \"ready\" : \"unresolved\");\n if (sharedConfig.context) {\n id = `${sharedConfig.context.id}${sharedConfig.context.count++}`;\n let v;\n if (options.ssrLoadFrom === \"initial\") initP = options.initialValue;\n else if (sharedConfig.load && (v = sharedConfig.load(id))) initP = v;\n }\n function loadEnd(p, v, error, key) {\n if (pr === p) {\n pr = null;\n key !== undefined && (resolved = true);\n if ((p === initP || v === initP) && options.onHydrated)\n queueMicrotask(() =>\n options.onHydrated(key, {\n value: v\n })\n );\n initP = NO_INIT;\n if (Transition && p && loadedUnderTransition) {\n Transition.promises.delete(p);\n loadedUnderTransition = false;\n runUpdates(() => {\n Transition.running = true;\n completeLoad(v, error);\n }, false);\n } else completeLoad(v, error);\n }\n return v;\n }\n function completeLoad(v, err) {\n runUpdates(() => {\n if (err === undefined) setValue(() => v);\n setState(err !== undefined ? \"errored\" : resolved ? \"ready\" : \"unresolved\");\n setError(err);\n for (const c of contexts.keys()) c.decrement();\n contexts.clear();\n }, false);\n }\n function read() {\n const c = SuspenseContext && useContext(SuspenseContext),\n v = value(),\n err = error();\n if (err !== undefined && !pr) throw err;\n if (Listener && !Listener.user && c) {\n createComputed(() => {\n track();\n if (pr) {\n if (c.resolved && Transition && loadedUnderTransition) Transition.promises.add(pr);\n else if (!contexts.has(c)) {\n c.increment();\n contexts.add(c);\n }\n }\n });\n }\n return v;\n }\n function load(refetching = true) {\n if (refetching !== false && scheduled) return;\n scheduled = false;\n const lookup = dynamic ? dynamic() : source;\n loadedUnderTransition = Transition && Transition.running;\n if (lookup == null || lookup === false) {\n loadEnd(pr, untrack(value));\n return;\n }\n if (Transition && pr) Transition.promises.delete(pr);\n const p =\n initP !== NO_INIT\n ? initP\n : untrack(() =>\n fetcher(lookup, {\n value: value(),\n refetching\n })\n );\n if (!isPromise(p)) {\n loadEnd(pr, p, undefined, lookup);\n return p;\n }\n pr = p;\n if (\"value\" in p) {\n if (p.status === \"success\") loadEnd(pr, p.value, undefined, lookup);\n else loadEnd(pr, undefined, undefined, lookup);\n return p;\n }\n scheduled = true;\n queueMicrotask(() => (scheduled = false));\n runUpdates(() => {\n setState(resolved ? \"refreshing\" : \"pending\");\n trigger();\n }, false);\n return p.then(\n v => loadEnd(p, v, undefined, lookup),\n e => loadEnd(p, undefined, castError(e), lookup)\n );\n }\n Object.defineProperties(read, {\n state: {\n get: () => state()\n },\n error: {\n get: () => error()\n },\n loading: {\n get() {\n const s = state();\n return s === \"pending\" || s === \"refreshing\";\n }\n },\n latest: {\n get() {\n if (!resolved) return read();\n const err = error();\n if (err && !pr) throw err;\n return value();\n }\n }\n });\n if (dynamic) createComputed(() => load(false));\n else load(false);\n return [\n read,\n {\n refetch: load,\n mutate: setValue\n }\n ];\n}\nfunction createDeferred(source, options) {\n let t,\n timeout = options ? options.timeoutMs : undefined;\n const node = createComputation(\n () => {\n if (!t || !t.fn)\n t = requestCallback(\n () => setDeferred(() => node.value),\n timeout !== undefined\n ? {\n timeout\n }\n : undefined\n );\n return source();\n },\n undefined,\n true\n );\n const [deferred, setDeferred] = createSignal(\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,\n options\n );\n updateComputation(node);\n setDeferred(() =>\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value\n );\n return deferred;\n}\nfunction createSelector(source, fn = equalFn, options) {\n const subs = new Map();\n const node = createComputation(\n p => {\n const v = source();\n for (const [key, val] of subs.entries())\n if (fn(key, v) !== fn(key, p)) {\n for (const c of val.values()) {\n c.state = STALE;\n if (c.pure) Updates.push(c);\n else Effects.push(c);\n }\n }\n return v;\n },\n undefined,\n true,\n STALE\n );\n updateComputation(node);\n return key => {\n const listener = Listener;\n if (listener) {\n let l;\n if ((l = subs.get(key))) l.add(listener);\n else subs.set(key, (l = new Set([listener])));\n onCleanup(() => {\n l.delete(listener);\n !l.size && subs.delete(key);\n });\n }\n return fn(\n key,\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value\n );\n };\n}\nfunction batch(fn) {\n return runUpdates(fn, false);\n}\nfunction untrack(fn) {\n if (!ExternalSourceConfig && Listener === null) return fn();\n const listener = Listener;\n Listener = null;\n try {\n if (ExternalSourceConfig) return ExternalSourceConfig.untrack(fn);\n return fn();\n } finally {\n Listener = listener;\n }\n}\nfunction on(deps, fn, options) {\n const isArray = Array.isArray(deps);\n let prevInput;\n let defer = options && options.defer;\n return prevValue => {\n let input;\n if (isArray) {\n input = Array(deps.length);\n for (let i = 0; i < deps.length; i++) input[i] = deps[i]();\n } else input = deps();\n if (defer) {\n defer = false;\n return prevValue;\n }\n const result = untrack(() => fn(input, prevInput, prevValue));\n prevInput = input;\n return result;\n };\n}\nfunction onMount(fn) {\n createEffect(() => untrack(fn));\n}\nfunction onCleanup(fn) {\n if (Owner === null);\n else if (Owner.cleanups === null) Owner.cleanups = [fn];\n else Owner.cleanups.push(fn);\n return fn;\n}\nfunction catchError(fn, handler) {\n ERROR || (ERROR = Symbol(\"error\"));\n Owner = createComputation(undefined, undefined, true);\n Owner.context = {\n ...Owner.context,\n [ERROR]: [handler]\n };\n if (Transition && Transition.running) Transition.sources.add(Owner);\n try {\n return fn();\n } catch (err) {\n handleError(err);\n } finally {\n Owner = Owner.owner;\n }\n}\nfunction getListener() {\n return Listener;\n}\nfunction getOwner() {\n return Owner;\n}\nfunction runWithOwner(o, fn) {\n const prev = Owner;\n const prevListener = Listener;\n Owner = o;\n Listener = null;\n try {\n return runUpdates(fn, true);\n } catch (err) {\n handleError(err);\n } finally {\n Owner = prev;\n Listener = prevListener;\n }\n}\nfunction enableScheduling(scheduler = requestCallback) {\n Scheduler = scheduler;\n}\nfunction startTransition(fn) {\n if (Transition && Transition.running) {\n fn();\n return Transition.done;\n }\n const l = Listener;\n const o = Owner;\n return Promise.resolve().then(() => {\n Listener = l;\n Owner = o;\n let t;\n if (Scheduler || SuspenseContext) {\n t =\n Transition ||\n (Transition = {\n sources: new Set(),\n effects: [],\n promises: new Set(),\n disposed: new Set(),\n queue: new Set(),\n running: true\n });\n t.done || (t.done = new Promise(res => (t.resolve = res)));\n t.running = true;\n }\n runUpdates(fn, false);\n Listener = Owner = null;\n return t ? t.done : undefined;\n });\n}\nconst [transPending, setTransPending] = /*@__PURE__*/ createSignal(false);\nfunction useTransition() {\n return [transPending, startTransition];\n}\nfunction resumeEffects(e) {\n Effects.push.apply(Effects, e);\n e.length = 0;\n}\nfunction createContext(defaultValue, options) {\n const id = Symbol(\"context\");\n return {\n id,\n Provider: createProvider(id),\n defaultValue\n };\n}\nfunction useContext(context) {\n return Owner && Owner.context && Owner.context[context.id] !== undefined\n ? Owner.context[context.id]\n : context.defaultValue;\n}\nfunction children(fn) {\n const children = createMemo(fn);\n const memo = createMemo(() => resolveChildren(children()));\n memo.toArray = () => {\n const c = memo();\n return Array.isArray(c) ? c : c != null ? [c] : [];\n };\n return memo;\n}\nlet SuspenseContext;\nfunction getSuspenseContext() {\n return SuspenseContext || (SuspenseContext = createContext());\n}\nfunction enableExternalSource(factory, untrack = fn => fn()) {\n if (ExternalSourceConfig) {\n const { factory: oldFactory, untrack: oldUntrack } = ExternalSourceConfig;\n ExternalSourceConfig = {\n factory: (fn, trigger) => {\n const oldSource = oldFactory(fn, trigger);\n const source = factory(x => oldSource.track(x), trigger);\n return {\n track: x => source.track(x),\n dispose() {\n source.dispose();\n oldSource.dispose();\n }\n };\n },\n untrack: fn => oldUntrack(() => untrack(fn))\n };\n } else {\n ExternalSourceConfig = {\n factory,\n untrack\n };\n }\n}\nfunction readSignal() {\n const runningTransition = Transition && Transition.running;\n if (this.sources && (runningTransition ? this.tState : this.state)) {\n if ((runningTransition ? this.tState : this.state) === STALE) updateComputation(this);\n else {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(this), false);\n Updates = updates;\n }\n }\n if (Listener) {\n const sSlot = this.observers ? this.observers.length : 0;\n if (!Listener.sources) {\n Listener.sources = [this];\n Listener.sourceSlots = [sSlot];\n } else {\n Listener.sources.push(this);\n Listener.sourceSlots.push(sSlot);\n }\n if (!this.observers) {\n this.observers = [Listener];\n this.observerSlots = [Listener.sources.length - 1];\n } else {\n this.observers.push(Listener);\n this.observerSlots.push(Listener.sources.length - 1);\n }\n }\n if (runningTransition && Transition.sources.has(this)) return this.tValue;\n return this.value;\n}\nfunction writeSignal(node, value, isComp) {\n let current =\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value;\n if (!node.comparator || !node.comparator(current, value)) {\n if (Transition) {\n const TransitionRunning = Transition.running;\n if (TransitionRunning || (!isComp && Transition.sources.has(node))) {\n Transition.sources.add(node);\n node.tValue = value;\n }\n if (!TransitionRunning) node.value = value;\n } else node.value = value;\n if (node.observers && node.observers.length) {\n runUpdates(() => {\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n const TransitionRunning = Transition && Transition.running;\n if (TransitionRunning && Transition.disposed.has(o)) continue;\n if (TransitionRunning ? !o.tState : !o.state) {\n if (o.pure) Updates.push(o);\n else Effects.push(o);\n if (o.observers) markDownstream(o);\n }\n if (!TransitionRunning) o.state = STALE;\n else o.tState = STALE;\n }\n if (Updates.length > 10e5) {\n Updates = [];\n if (false);\n throw new Error();\n }\n }, false);\n }\n }\n return value;\n}\nfunction updateComputation(node) {\n if (!node.fn) return;\n cleanNode(node);\n const time = ExecCount;\n runComputation(\n node,\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,\n time\n );\n if (Transition && !Transition.running && Transition.sources.has(node)) {\n queueMicrotask(() => {\n runUpdates(() => {\n Transition && (Transition.running = true);\n Listener = Owner = node;\n runComputation(node, node.tValue, time);\n Listener = Owner = null;\n }, false);\n });\n }\n}\nfunction runComputation(node, value, time) {\n let nextValue;\n const owner = Owner,\n listener = Listener;\n Listener = Owner = node;\n try {\n nextValue = node.fn(value);\n } catch (err) {\n if (node.pure) {\n if (Transition && Transition.running) {\n node.tState = STALE;\n node.tOwned && node.tOwned.forEach(cleanNode);\n node.tOwned = undefined;\n } else {\n node.state = STALE;\n node.owned && node.owned.forEach(cleanNode);\n node.owned = null;\n }\n }\n node.updatedAt = time + 1;\n return handleError(err);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n if (!node.updatedAt || node.updatedAt <= time) {\n if (node.updatedAt != null && \"observers\" in node) {\n writeSignal(node, nextValue, true);\n } else if (Transition && Transition.running && node.pure) {\n Transition.sources.add(node);\n node.tValue = nextValue;\n } else node.value = nextValue;\n node.updatedAt = time;\n }\n}\nfunction createComputation(fn, init, pure, state = STALE, options) {\n const c = {\n fn,\n state: state,\n updatedAt: null,\n owned: null,\n sources: null,\n sourceSlots: null,\n cleanups: null,\n value: init,\n owner: Owner,\n context: Owner ? Owner.context : null,\n pure\n };\n if (Transition && Transition.running) {\n c.state = 0;\n c.tState = state;\n }\n if (Owner === null);\n else if (Owner !== UNOWNED) {\n if (Transition && Transition.running && Owner.pure) {\n if (!Owner.tOwned) Owner.tOwned = [c];\n else Owner.tOwned.push(c);\n } else {\n if (!Owner.owned) Owner.owned = [c];\n else Owner.owned.push(c);\n }\n }\n if (ExternalSourceConfig && c.fn) {\n const [track, trigger] = createSignal(undefined, {\n equals: false\n });\n const ordinary = ExternalSourceConfig.factory(c.fn, trigger);\n onCleanup(() => ordinary.dispose());\n const triggerInTransition = () => startTransition(trigger).then(() => inTransition.dispose());\n const inTransition = ExternalSourceConfig.factory(c.fn, triggerInTransition);\n c.fn = x => {\n track();\n return Transition && Transition.running ? inTransition.track(x) : ordinary.track(x);\n };\n }\n return c;\n}\nfunction runTop(node) {\n const runningTransition = Transition && Transition.running;\n if ((runningTransition ? node.tState : node.state) === 0) return;\n if ((runningTransition ? node.tState : node.state) === PENDING) return lookUpstream(node);\n if (node.suspense && untrack(node.suspense.inFallback)) return node.suspense.effects.push(node);\n const ancestors = [node];\n while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {\n if (runningTransition && Transition.disposed.has(node)) return;\n if (runningTransition ? node.tState : node.state) ancestors.push(node);\n }\n for (let i = ancestors.length - 1; i >= 0; i--) {\n node = ancestors[i];\n if (runningTransition) {\n let top = node,\n prev = ancestors[i + 1];\n while ((top = top.owner) && top !== prev) {\n if (Transition.disposed.has(top)) return;\n }\n }\n if ((runningTransition ? node.tState : node.state) === STALE) {\n updateComputation(node);\n } else if ((runningTransition ? node.tState : node.state) === PENDING) {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(node, ancestors[0]), false);\n Updates = updates;\n }\n }\n}\nfunction runUpdates(fn, init) {\n if (Updates) return fn();\n let wait = false;\n if (!init) Updates = [];\n if (Effects) wait = true;\n else Effects = [];\n ExecCount++;\n try {\n const res = fn();\n completeUpdates(wait);\n return res;\n } catch (err) {\n if (!wait) Effects = null;\n Updates = null;\n handleError(err);\n }\n}\nfunction completeUpdates(wait) {\n if (Updates) {\n if (Scheduler && Transition && Transition.running) scheduleQueue(Updates);\n else runQueue(Updates);\n Updates = null;\n }\n if (wait) return;\n let res;\n if (Transition) {\n if (!Transition.promises.size && !Transition.queue.size) {\n const sources = Transition.sources;\n const disposed = Transition.disposed;\n Effects.push.apply(Effects, Transition.effects);\n res = Transition.resolve;\n for (const e of Effects) {\n \"tState\" in e && (e.state = e.tState);\n delete e.tState;\n }\n Transition = null;\n runUpdates(() => {\n for (const d of disposed) cleanNode(d);\n for (const v of sources) {\n v.value = v.tValue;\n if (v.owned) {\n for (let i = 0, len = v.owned.length; i < len; i++) cleanNode(v.owned[i]);\n }\n if (v.tOwned) v.owned = v.tOwned;\n delete v.tValue;\n delete v.tOwned;\n v.tState = 0;\n }\n setTransPending(false);\n }, false);\n } else if (Transition.running) {\n Transition.running = false;\n Transition.effects.push.apply(Transition.effects, Effects);\n Effects = null;\n setTransPending(true);\n return;\n }\n }\n const e = Effects;\n Effects = null;\n if (e.length) runUpdates(() => runEffects(e), false);\n if (res) res();\n}\nfunction runQueue(queue) {\n for (let i = 0; i < queue.length; i++) runTop(queue[i]);\n}\nfunction scheduleQueue(queue) {\n for (let i = 0; i < queue.length; i++) {\n const item = queue[i];\n const tasks = Transition.queue;\n if (!tasks.has(item)) {\n tasks.add(item);\n Scheduler(() => {\n tasks.delete(item);\n runUpdates(() => {\n Transition.running = true;\n runTop(item);\n }, false);\n Transition && (Transition.running = false);\n });\n }\n }\n}\nfunction runUserEffects(queue) {\n let i,\n userLength = 0;\n for (i = 0; i < queue.length; i++) {\n const e = queue[i];\n if (!e.user) runTop(e);\n else queue[userLength++] = e;\n }\n if (sharedConfig.context) {\n if (sharedConfig.count) {\n sharedConfig.effects || (sharedConfig.effects = []);\n sharedConfig.effects.push(...queue.slice(0, userLength));\n return;\n } else if (sharedConfig.effects) {\n queue = [...sharedConfig.effects, ...queue];\n userLength += sharedConfig.effects.length;\n delete sharedConfig.effects;\n }\n setHydrateContext();\n }\n for (i = 0; i < userLength; i++) runTop(queue[i]);\n}\nfunction lookUpstream(node, ignore) {\n const runningTransition = Transition && Transition.running;\n if (runningTransition) node.tState = 0;\n else node.state = 0;\n for (let i = 0; i < node.sources.length; i += 1) {\n const source = node.sources[i];\n if (source.sources) {\n const state = runningTransition ? source.tState : source.state;\n if (state === STALE) {\n if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))\n runTop(source);\n } else if (state === PENDING) lookUpstream(source, ignore);\n }\n }\n}\nfunction markDownstream(node) {\n const runningTransition = Transition && Transition.running;\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n if (runningTransition ? !o.tState : !o.state) {\n if (runningTransition) o.tState = PENDING;\n else o.state = PENDING;\n if (o.pure) Updates.push(o);\n else Effects.push(o);\n o.observers && markDownstream(o);\n }\n }\n}\nfunction cleanNode(node) {\n let i;\n if (node.sources) {\n while (node.sources.length) {\n const source = node.sources.pop(),\n index = node.sourceSlots.pop(),\n obs = source.observers;\n if (obs && obs.length) {\n const n = obs.pop(),\n s = source.observerSlots.pop();\n if (index < obs.length) {\n n.sourceSlots[s] = index;\n obs[index] = n;\n source.observerSlots[index] = s;\n }\n }\n }\n }\n if (Transition && Transition.running && node.pure) {\n if (node.tOwned) {\n for (i = node.tOwned.length - 1; i >= 0; i--) cleanNode(node.tOwned[i]);\n delete node.tOwned;\n }\n reset(node, true);\n } else if (node.owned) {\n for (i = node.owned.length - 1; i >= 0; i--) cleanNode(node.owned[i]);\n node.owned = null;\n }\n if (node.cleanups) {\n for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i]();\n node.cleanups = null;\n }\n if (Transition && Transition.running) node.tState = 0;\n else node.state = 0;\n}\nfunction reset(node, top) {\n if (!top) {\n node.tState = 0;\n Transition.disposed.add(node);\n }\n if (node.owned) {\n for (let i = 0; i < node.owned.length; i++) reset(node.owned[i]);\n }\n}\nfunction castError(err) {\n if (err instanceof Error) return err;\n return new Error(typeof err === \"string\" ? err : \"Unknown error\", {\n cause: err\n });\n}\nfunction runErrors(err, fns, owner) {\n try {\n for (const f of fns) f(err);\n } catch (e) {\n handleError(e, (owner && owner.owner) || null);\n }\n}\nfunction handleError(err, owner = Owner) {\n const fns = ERROR && owner && owner.context && owner.context[ERROR];\n const error = castError(err);\n if (!fns) throw error;\n if (Effects)\n Effects.push({\n fn() {\n runErrors(error, fns, owner);\n },\n state: STALE\n });\n else runErrors(error, fns, owner);\n}\nfunction resolveChildren(children) {\n if (typeof children === \"function\" && !children.length) return resolveChildren(children());\n if (Array.isArray(children)) {\n const results = [];\n for (let i = 0; i < children.length; i++) {\n const result = resolveChildren(children[i]);\n Array.isArray(result) ? results.push.apply(results, result) : results.push(result);\n }\n return results;\n }\n return children;\n}\nfunction createProvider(id, options) {\n return function provider(props) {\n let res;\n createRenderEffect(\n () =>\n (res = untrack(() => {\n Owner.context = {\n ...Owner.context,\n [id]: props.value\n };\n return children(() => props.children);\n })),\n undefined\n );\n return res;\n };\n}\nfunction onError(fn) {\n ERROR || (ERROR = Symbol(\"error\"));\n if (Owner === null);\n else if (Owner.context === null || !Owner.context[ERROR]) {\n Owner.context = {\n ...Owner.context,\n [ERROR]: [fn]\n };\n mutateContext(Owner, ERROR, [fn]);\n } else Owner.context[ERROR].push(fn);\n}\nfunction mutateContext(o, key, value) {\n if (o.owned) {\n for (let i = 0; i < o.owned.length; i++) {\n if (o.owned[i].context === o.context) mutateContext(o.owned[i], key, value);\n if (!o.owned[i].context) {\n o.owned[i].context = o.context;\n mutateContext(o.owned[i], key, value);\n } else if (!o.owned[i].context[key]) {\n o.owned[i].context[key] = value;\n mutateContext(o.owned[i], key, value);\n }\n }\n }\n}\n\nfunction observable(input) {\n return {\n subscribe(observer) {\n if (!(observer instanceof Object) || observer == null) {\n throw new TypeError(\"Expected the observer to be an object.\");\n }\n const handler =\n typeof observer === \"function\" ? observer : observer.next && observer.next.bind(observer);\n if (!handler) {\n return {\n unsubscribe() {}\n };\n }\n const dispose = createRoot(disposer => {\n createEffect(() => {\n const v = input();\n untrack(() => handler(v));\n });\n return disposer;\n });\n if (getOwner()) onCleanup(dispose);\n return {\n unsubscribe() {\n dispose();\n }\n };\n },\n [Symbol.observable || \"@@observable\"]() {\n return this;\n }\n };\n}\nfunction from(producer) {\n const [s, set] = createSignal(undefined, {\n equals: false\n });\n if (\"subscribe\" in producer) {\n const unsub = producer.subscribe(v => set(() => v));\n onCleanup(() => (\"unsubscribe\" in unsub ? unsub.unsubscribe() : unsub()));\n } else {\n const clean = producer(set);\n onCleanup(clean);\n }\n return s;\n}\n\nconst FALLBACK = Symbol(\"fallback\");\nfunction dispose(d) {\n for (let i = 0; i < d.length; i++) d[i]();\n}\nfunction mapArray(list, mapFn, options = {}) {\n let items = [],\n mapped = [],\n disposers = [],\n len = 0,\n indexes = mapFn.length > 1 ? [] : null;\n onCleanup(() => dispose(disposers));\n return () => {\n let newItems = list() || [],\n i,\n j;\n newItems[$TRACK];\n return untrack(() => {\n let newLen = newItems.length,\n newIndices,\n newIndicesNext,\n temp,\n tempdisposers,\n tempIndexes,\n start,\n end,\n newEnd,\n item;\n if (newLen === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n indexes && (indexes = []);\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot(disposer => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n } else if (len === 0) {\n mapped = new Array(newLen);\n for (j = 0; j < newLen; j++) {\n items[j] = newItems[j];\n mapped[j] = createRoot(mapper);\n }\n len = newLen;\n } else {\n temp = new Array(newLen);\n tempdisposers = new Array(newLen);\n indexes && (tempIndexes = new Array(newLen));\n for (\n start = 0, end = Math.min(len, newLen);\n start < end && items[start] === newItems[start];\n start++\n );\n for (\n end = len - 1, newEnd = newLen - 1;\n end >= start && newEnd >= start && items[end] === newItems[newEnd];\n end--, newEnd--\n ) {\n temp[newEnd] = mapped[end];\n tempdisposers[newEnd] = disposers[end];\n indexes && (tempIndexes[newEnd] = indexes[end]);\n }\n newIndices = new Map();\n newIndicesNext = new Array(newEnd + 1);\n for (j = newEnd; j >= start; j--) {\n item = newItems[j];\n i = newIndices.get(item);\n newIndicesNext[j] = i === undefined ? -1 : i;\n newIndices.set(item, j);\n }\n for (i = start; i <= end; i++) {\n item = items[i];\n j = newIndices.get(item);\n if (j !== undefined && j !== -1) {\n temp[j] = mapped[i];\n tempdisposers[j] = disposers[i];\n indexes && (tempIndexes[j] = indexes[i]);\n j = newIndicesNext[j];\n newIndices.set(item, j);\n } else disposers[i]();\n }\n for (j = start; j < newLen; j++) {\n if (j in temp) {\n mapped[j] = temp[j];\n disposers[j] = tempdisposers[j];\n if (indexes) {\n indexes[j] = tempIndexes[j];\n indexes[j](j);\n }\n } else mapped[j] = createRoot(mapper);\n }\n mapped = mapped.slice(0, (len = newLen));\n items = newItems.slice(0);\n }\n return mapped;\n });\n function mapper(disposer) {\n disposers[j] = disposer;\n if (indexes) {\n const [s, set] = createSignal(j);\n indexes[j] = set;\n return mapFn(newItems[j], s);\n }\n return mapFn(newItems[j]);\n }\n };\n}\nfunction indexArray(list, mapFn, options = {}) {\n let items = [],\n mapped = [],\n disposers = [],\n signals = [],\n len = 0,\n i;\n onCleanup(() => dispose(disposers));\n return () => {\n const newItems = list() || [];\n newItems[$TRACK];\n return untrack(() => {\n if (newItems.length === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n signals = [];\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot(disposer => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n return mapped;\n }\n if (items[0] === FALLBACK) {\n disposers[0]();\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n }\n for (i = 0; i < newItems.length; i++) {\n if (i < items.length && items[i] !== newItems[i]) {\n signals[i](() => newItems[i]);\n } else if (i >= items.length) {\n mapped[i] = createRoot(mapper);\n }\n }\n for (; i < items.length; i++) {\n disposers[i]();\n }\n len = signals.length = disposers.length = newItems.length;\n items = newItems.slice(0);\n return (mapped = mapped.slice(0, len));\n });\n function mapper(disposer) {\n disposers[i] = disposer;\n const [s, set] = createSignal(newItems[i]);\n signals[i] = set;\n return mapFn(s, i);\n }\n };\n}\n\nlet hydrationEnabled = false;\nfunction enableHydration() {\n hydrationEnabled = true;\n}\nfunction createComponent(Comp, props) {\n if (hydrationEnabled) {\n if (sharedConfig.context) {\n const c = sharedConfig.context;\n setHydrateContext(nextHydrateContext());\n const r = untrack(() => Comp(props || {}));\n setHydrateContext(c);\n return r;\n }\n }\n return untrack(() => Comp(props || {}));\n}\nfunction trueFn() {\n return true;\n}\nconst propTraps = {\n get(_, property, receiver) {\n if (property === $PROXY) return receiver;\n return _.get(property);\n },\n has(_, property) {\n if (property === $PROXY) return true;\n return _.has(property);\n },\n set: trueFn,\n deleteProperty: trueFn,\n getOwnPropertyDescriptor(_, property) {\n return {\n configurable: true,\n enumerable: true,\n get() {\n return _.get(property);\n },\n set: trueFn,\n deleteProperty: trueFn\n };\n },\n ownKeys(_) {\n return _.keys();\n }\n};\nfunction resolveSource(s) {\n return !(s = typeof s === \"function\" ? s() : s) ? {} : s;\n}\nfunction resolveSources() {\n for (let i = 0, length = this.length; i < length; ++i) {\n const v = this[i]();\n if (v !== undefined) return v;\n }\n}\nfunction mergeProps(...sources) {\n let proxy = false;\n for (let i = 0; i < sources.length; i++) {\n const s = sources[i];\n proxy = proxy || (!!s && $PROXY in s);\n sources[i] = typeof s === \"function\" ? ((proxy = true), createMemo(s)) : s;\n }\n if (proxy) {\n return new Proxy(\n {\n get(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n const v = resolveSource(sources[i])[property];\n if (v !== undefined) return v;\n }\n },\n has(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n if (property in resolveSource(sources[i])) return true;\n }\n return false;\n },\n keys() {\n const keys = [];\n for (let i = 0; i < sources.length; i++)\n keys.push(...Object.keys(resolveSource(sources[i])));\n return [...new Set(keys)];\n }\n },\n propTraps\n );\n }\n const sourcesMap = {};\n const defined = Object.create(null);\n for (let i = sources.length - 1; i >= 0; i--) {\n const source = sources[i];\n if (!source) continue;\n const sourceKeys = Object.getOwnPropertyNames(source);\n for (let i = sourceKeys.length - 1; i >= 0; i--) {\n const key = sourceKeys[i];\n if (key === \"__proto__\" || key === \"constructor\") continue;\n const desc = Object.getOwnPropertyDescriptor(source, key);\n if (!defined[key]) {\n defined[key] = desc.get\n ? {\n enumerable: true,\n configurable: true,\n get: resolveSources.bind((sourcesMap[key] = [desc.get.bind(source)]))\n }\n : desc.value !== undefined\n ? desc\n : undefined;\n } else {\n const sources = sourcesMap[key];\n if (sources) {\n if (desc.get) sources.push(desc.get.bind(source));\n else if (desc.value !== undefined) sources.push(() => desc.value);\n }\n }\n }\n }\n const target = {};\n const definedKeys = Object.keys(defined);\n for (let i = definedKeys.length - 1; i >= 0; i--) {\n const key = definedKeys[i],\n desc = defined[key];\n if (desc && desc.get) Object.defineProperty(target, key, desc);\n else target[key] = desc ? desc.value : undefined;\n }\n return target;\n}\nfunction splitProps(props, ...keys) {\n if ($PROXY in props) {\n const blocked = new Set(keys.length > 1 ? keys.flat() : keys[0]);\n const res = keys.map(k => {\n return new Proxy(\n {\n get(property) {\n return k.includes(property) ? props[property] : undefined;\n },\n has(property) {\n return k.includes(property) && property in props;\n },\n keys() {\n return k.filter(property => property in props);\n }\n },\n propTraps\n );\n });\n res.push(\n new Proxy(\n {\n get(property) {\n return blocked.has(property) ? undefined : props[property];\n },\n has(property) {\n return blocked.has(property) ? false : property in props;\n },\n keys() {\n return Object.keys(props).filter(k => !blocked.has(k));\n }\n },\n propTraps\n )\n );\n return res;\n }\n const otherObject = {};\n const objects = keys.map(() => ({}));\n for (const propName of Object.getOwnPropertyNames(props)) {\n const desc = Object.getOwnPropertyDescriptor(props, propName);\n const isDefaultDesc =\n !desc.get && !desc.set && desc.enumerable && desc.writable && desc.configurable;\n let blocked = false;\n let objectIndex = 0;\n for (const k of keys) {\n if (k.includes(propName)) {\n blocked = true;\n isDefaultDesc\n ? (objects[objectIndex][propName] = desc.value)\n : Object.defineProperty(objects[objectIndex], propName, desc);\n }\n ++objectIndex;\n }\n if (!blocked) {\n isDefaultDesc\n ? (otherObject[propName] = desc.value)\n : Object.defineProperty(otherObject, propName, desc);\n }\n }\n return [...objects, otherObject];\n}\nfunction lazy(fn) {\n let comp;\n let p;\n const wrap = props => {\n const ctx = sharedConfig.context;\n if (ctx) {\n const [s, set] = createSignal();\n sharedConfig.count || (sharedConfig.count = 0);\n sharedConfig.count++;\n (p || (p = fn())).then(mod => {\n setHydrateContext(ctx);\n sharedConfig.count--;\n set(() => mod.default);\n setHydrateContext();\n });\n comp = s;\n } else if (!comp) {\n const [s] = createResource(() => (p || (p = fn())).then(mod => mod.default));\n comp = s;\n }\n let Comp;\n return createMemo(\n () =>\n (Comp = comp()) &&\n untrack(() => {\n if (false);\n if (!ctx) return Comp(props);\n const c = sharedConfig.context;\n setHydrateContext(ctx);\n const r = Comp(props);\n setHydrateContext(c);\n return r;\n })\n );\n };\n wrap.preload = () => p || ((p = fn()).then(mod => (comp = () => mod.default)), p);\n return wrap;\n}\nlet counter = 0;\nfunction createUniqueId() {\n const ctx = sharedConfig.context;\n return ctx ? `${ctx.id}${ctx.count++}` : `cl-${counter++}`;\n}\n\nconst narrowedError = name => `Stale read from <${name}>.`;\nfunction For(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(mapArray(() => props.each, props.children, fallback || undefined));\n}\nfunction Index(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(indexArray(() => props.each, props.children, fallback || undefined));\n}\nfunction Show(props) {\n const keyed = props.keyed;\n const condition = createMemo(() => props.when, undefined, {\n equals: (a, b) => (keyed ? a === b : !a === !b)\n });\n return createMemo(\n () => {\n const c = condition();\n if (c) {\n const child = props.children;\n const fn = typeof child === \"function\" && child.length > 0;\n return fn\n ? untrack(() =>\n child(\n keyed\n ? c\n : () => {\n if (!untrack(condition)) throw narrowedError(\"Show\");\n return props.when;\n }\n )\n )\n : child;\n }\n return props.fallback;\n },\n undefined,\n undefined\n );\n}\nfunction Switch(props) {\n let keyed = false;\n const equals = (a, b) => (keyed ? a[1] === b[1] : !a[1] === !b[1]) && a[2] === b[2];\n const conditions = children(() => props.children),\n evalConditions = createMemo(\n () => {\n let conds = conditions();\n if (!Array.isArray(conds)) conds = [conds];\n for (let i = 0; i < conds.length; i++) {\n const c = conds[i].when;\n if (c) {\n keyed = !!conds[i].keyed;\n return [i, c, conds[i]];\n }\n }\n return [-1];\n },\n undefined,\n {\n equals\n }\n );\n return createMemo(\n () => {\n const [index, when, cond] = evalConditions();\n if (index < 0) return props.fallback;\n const c = cond.children;\n const fn = typeof c === \"function\" && c.length > 0;\n return fn\n ? untrack(() =>\n c(\n keyed\n ? when\n : () => {\n if (untrack(evalConditions)[0] !== index) throw narrowedError(\"Match\");\n return cond.when;\n }\n )\n )\n : c;\n },\n undefined,\n undefined\n );\n}\nfunction Match(props) {\n return props;\n}\nlet Errors;\nfunction resetErrorBoundaries() {\n Errors && [...Errors].forEach(fn => fn());\n}\nfunction ErrorBoundary(props) {\n let err;\n if (sharedConfig.context && sharedConfig.load)\n err = sharedConfig.load(sharedConfig.context.id + sharedConfig.context.count);\n const [errored, setErrored] = createSignal(err, undefined);\n Errors || (Errors = new Set());\n Errors.add(setErrored);\n onCleanup(() => Errors.delete(setErrored));\n return createMemo(\n () => {\n let e;\n if ((e = errored())) {\n const f = props.fallback;\n return typeof f === \"function\" && f.length ? untrack(() => f(e, () => setErrored())) : f;\n }\n return catchError(() => props.children, setErrored);\n },\n undefined,\n undefined\n );\n}\n\nconst suspenseListEquals = (a, b) =>\n a.showContent === b.showContent && a.showFallback === b.showFallback;\nconst SuspenseListContext = createContext();\nfunction SuspenseList(props) {\n let [wrapper, setWrapper] = createSignal(() => ({\n inFallback: false\n })),\n show;\n const listContext = useContext(SuspenseListContext);\n const [registry, setRegistry] = createSignal([]);\n if (listContext) {\n show = listContext.register(createMemo(() => wrapper()().inFallback));\n }\n const resolved = createMemo(\n prev => {\n const reveal = props.revealOrder,\n tail = props.tail,\n { showContent = true, showFallback = true } = show ? show() : {},\n reg = registry(),\n reverse = reveal === \"backwards\";\n if (reveal === \"together\") {\n const all = reg.every(inFallback => !inFallback());\n const res = reg.map(() => ({\n showContent: all && showContent,\n showFallback\n }));\n res.inFallback = !all;\n return res;\n }\n let stop = false;\n let inFallback = prev.inFallback;\n const res = [];\n for (let i = 0, len = reg.length; i < len; i++) {\n const n = reverse ? len - i - 1 : i,\n s = reg[n]();\n if (!stop && !s) {\n res[n] = {\n showContent,\n showFallback\n };\n } else {\n const next = !stop;\n if (next) inFallback = true;\n res[n] = {\n showContent: next,\n showFallback: !tail || (next && tail === \"collapsed\") ? showFallback : false\n };\n stop = true;\n }\n }\n if (!stop) inFallback = false;\n res.inFallback = inFallback;\n return res;\n },\n {\n inFallback: false\n }\n );\n setWrapper(() => resolved);\n return createComponent(SuspenseListContext.Provider, {\n value: {\n register: inFallback => {\n let index;\n setRegistry(registry => {\n index = registry.length;\n return [...registry, inFallback];\n });\n return createMemo(() => resolved()[index], undefined, {\n equals: suspenseListEquals\n });\n }\n },\n get children() {\n return props.children;\n }\n });\n}\nfunction Suspense(props) {\n let counter = 0,\n show,\n ctx,\n p,\n flicker,\n error;\n const [inFallback, setFallback] = createSignal(false),\n SuspenseContext = getSuspenseContext(),\n store = {\n increment: () => {\n if (++counter === 1) setFallback(true);\n },\n decrement: () => {\n if (--counter === 0) setFallback(false);\n },\n inFallback,\n effects: [],\n resolved: false\n },\n owner = getOwner();\n if (sharedConfig.context && sharedConfig.load) {\n const key = sharedConfig.context.id + sharedConfig.context.count;\n let ref = sharedConfig.load(key);\n if (ref) {\n if (typeof ref !== \"object\" || ref.status !== \"success\") p = ref;\n else sharedConfig.gather(key);\n }\n if (p && p !== \"$$f\") {\n const [s, set] = createSignal(undefined, {\n equals: false\n });\n flicker = s;\n p.then(\n () => {\n if (sharedConfig.done) return set();\n sharedConfig.gather(key);\n setHydrateContext(ctx);\n set();\n setHydrateContext();\n },\n err => {\n error = err;\n set();\n }\n );\n }\n }\n const listContext = useContext(SuspenseListContext);\n if (listContext) show = listContext.register(store.inFallback);\n let dispose;\n onCleanup(() => dispose && dispose());\n return createComponent(SuspenseContext.Provider, {\n value: store,\n get children() {\n return createMemo(() => {\n if (error) throw error;\n ctx = sharedConfig.context;\n if (flicker) {\n flicker();\n return (flicker = undefined);\n }\n if (ctx && p === \"$$f\") setHydrateContext();\n const rendered = createMemo(() => props.children);\n return createMemo(prev => {\n const inFallback = store.inFallback(),\n { showContent = true, showFallback = true } = show ? show() : {};\n if ((!inFallback || (p && p !== \"$$f\")) && showContent) {\n store.resolved = true;\n dispose && dispose();\n dispose = ctx = p = undefined;\n resumeEffects(store.effects);\n return rendered();\n }\n if (!showFallback) return;\n if (dispose) return prev;\n return createRoot(disposer => {\n dispose = disposer;\n if (ctx) {\n setHydrateContext({\n id: ctx.id + \"f\",\n count: 0\n });\n ctx = undefined;\n }\n return props.fallback;\n }, owner);\n });\n });\n }\n });\n}\n\nconst DEV = undefined;\n\nexport {\n $DEVCOMP,\n $PROXY,\n $TRACK,\n DEV,\n ErrorBoundary,\n For,\n Index,\n Match,\n Show,\n Suspense,\n SuspenseList,\n Switch,\n batch,\n cancelCallback,\n catchError,\n children,\n createComponent,\n createComputed,\n createContext,\n createDeferred,\n createEffect,\n createMemo,\n createReaction,\n createRenderEffect,\n createResource,\n createRoot,\n createSelector,\n createSignal,\n createUniqueId,\n enableExternalSource,\n enableHydration,\n enableScheduling,\n equalFn,\n from,\n getListener,\n getOwner,\n indexArray,\n lazy,\n mapArray,\n mergeProps,\n observable,\n on,\n onCleanup,\n onError,\n onMount,\n requestCallback,\n resetErrorBoundaries,\n runWithOwner,\n sharedConfig,\n splitProps,\n startTransition,\n untrack,\n useContext,\n useTransition\n};\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n MainCoreDriver,\n RendererMain,\n type RendererMainSettings,\n} from '@lightningjs/renderer';\n\nexport let renderer: RendererMain;\nexport let createShader: RendererMain['createShader'];\n\nexport interface SolidRendererOptions extends RendererMainSettings {\n threadXCoreWorkerUrl?: string;\n rootId: string | HTMLElement;\n}\n\nexport function getRenderer(): RendererMain {\n return renderer;\n}\n\nexport function startLightningRenderer(\n options: Partial = {},\n rootId: string | HTMLElement = 'app',\n): RendererMain {\n const driver = new MainCoreDriver();\n renderer = new RendererMain(options, rootId, driver);\n createShader = renderer.createShader.bind(renderer);\n return renderer;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { ElementNode, SolidNode } from './index.js';\n\n/**\n * Children class\n */\nexport default class Children extends Array {\n _parent: ElementNode;\n\n constructor(node: ElementNode) {\n super();\n this._parent = node;\n }\n\n get selected(): ElementNode | undefined {\n // For selected Elements should always be an ElementNode\n return this[this._parent.selected || 0] as ElementNode | undefined;\n }\n\n get firstChild() {\n return this[0];\n }\n\n insert(node: SolidNode, beforeNode: SolidNode) {\n if (beforeNode) {\n const index = this.indexOf(beforeNode);\n this.splice(index, 0, node);\n } else {\n this.push(node);\n }\n\n node.parent = this._parent;\n this._parent._isDirty = true;\n }\n\n remove(node: SolidNode) {\n const nodeIndexToRemove = this.indexOf(node);\n if (nodeIndexToRemove >= 0) {\n this.splice(nodeIndexToRemove, 1);\n }\n }\n}\n","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n AnimationSettings,\n RendererMainSettings,\n} from '@lightningjs/renderer';\nimport type { IntrinsicTextNodeStyleProps } from './intrinsicTypes.js';\n\ninterface Config {\n debug: boolean;\n animationSettings: Partial;\n animationsEnabled: boolean;\n fontSettings: Partial;\n rendererOptions?: Partial;\n}\n\nfunction isDevEnv(): boolean {\n return import.meta.env && import.meta.env.DEV;\n}\nexport const isDev = isDevEnv() || false;\n\nexport const config: Config = {\n debug: false,\n animationsEnabled: true,\n animationSettings: {\n duration: 250,\n easing: 'ease-in-out',\n },\n fontSettings: {\n fontFamily: 'Ubuntu',\n fontSize: 100,\n },\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { config, isDev } from '../config.js';\nimport type { SolidNode, SolidStyles } from './node/index.js';\n\nfunction hasDebug(node: any) {\n return isObject(node) && node.debug;\n}\n\nexport function log(msg: string, node: SolidNode, ...args: any[]) {\n if (isDev) {\n if (config.debug || hasDebug(node) || hasDebug(args[0])) {\n console.log(msg, node, ...args);\n }\n }\n}\n\nexport function isFunc(item: unknown): item is (...args: unknown[]) => unknown {\n return typeof item === 'function';\n}\n\nexport function isObject(\n item: unknown,\n): item is Record {\n return typeof item === 'object';\n}\n\nexport function isArray(item: unknown): item is any[] {\n return Array.isArray(item);\n}\n\nexport function isString(item: unknown): item is string {\n return typeof item === 'string';\n}\n\nexport function isNumber(item: unknown): item is number {\n return typeof item === 'number';\n}\n\nexport function isInteger(item: unknown): item is number {\n return Number.isInteger(item);\n}\n\nexport function keyExists(\n obj: Record,\n keys: (string | number | symbol)[],\n) {\n for (const key of keys) {\n if (key in obj) {\n return true;\n }\n }\n return false;\n}\n\nexport function flattenStyles(\n obj: SolidStyles | undefined | (SolidStyles | undefined)[],\n result: Record = {},\n): SolidStyles {\n if (isArray(obj)) {\n obj.forEach((item) => {\n flattenStyles(item, result);\n });\n } else if (obj) {\n // handle the case where the object is not an array\n for (const key in obj) {\n // be careful of 0 values\n if (result[key as keyof SolidStyles] === undefined) {\n result[key as keyof SolidStyles] = obj[key as keyof SolidStyles];\n }\n }\n }\n\n return result;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { isArray, isString } from '../utils.js';\n\nexport type NodeStates =\n | string[]\n | string\n | Record;\n\nexport default class States extends Array {\n private onChange: () => void;\n\n constructor(callback: () => void, initialState: NodeStates = {}) {\n if (isArray(initialState)) {\n super(...initialState);\n } else if (isString(initialState)) {\n super(initialState);\n } else {\n super(\n ...Object.entries(initialState)\n .filter(([_key, value]) => value)\n .map(([key]) => key),\n );\n }\n\n this.onChange = callback;\n return this;\n }\n\n has(state: string) {\n return this.indexOf(state) >= 0;\n }\n\n is(state: string) {\n return this.indexOf(state) >= 0;\n }\n\n add(state: string) {\n this.push(state);\n this.onChange();\n }\n\n toggle(state: string) {\n if (this.has(state)) {\n this.remove(state);\n } else {\n this.add(state);\n }\n }\n\n remove(state: string) {\n const stateIndexToRemove = this.indexOf(state);\n if (stateIndexToRemove >= 0) {\n this.splice(stateIndexToRemove, 1);\n this.onChange();\n }\n }\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { assertTruthy } from '@lightningjs/renderer/utils';\nimport type { ElementNode, SolidNode } from './node/index.js';\n\nexport default function (node: ElementNode): boolean {\n const children = [];\n for (let i = 0; i < node.children.length; i++) {\n const c = node.children[i]!;\n // Filter empty text nodes which are place holders for and elements missing dimensions\n if (c.name === 'TextNode') {\n continue;\n }\n\n // Skip layout for non flex items\n if (c.flexItem === false) {\n continue;\n }\n\n // text node hasnt loaded yet - skip layout\n if (c.name === 'text' && c.text !== '' && !(c.width || c.height)) {\n return false;\n }\n\n children.push(c);\n }\n\n const numChildren = children.length;\n const direction = node.flexDirection || 'row';\n const isRow = direction === 'row';\n const dimension = isRow ? 'width' : 'height';\n const crossDimension = isRow ? 'height' : 'width';\n const marginOne = isRow ? 'marginLeft' : 'marginTop';\n const marginTwo = isRow ? 'marginRight' : 'marginBottom';\n const prop = isRow ? 'x' : 'y';\n const crossProp = isRow ? 'y' : 'x';\n const containerSize = node[dimension] || 0;\n const containerCrossSize = node[crossDimension] || 0;\n const gap = node.gap || 0;\n const justify = node.justifyContent || 'flexStart';\n const align = node.alignItems;\n let itemSize = 0;\n if (['center', 'spaceBetween', 'spaceEvenly'].includes(justify)) {\n itemSize = children.reduce((prev, c) => prev + (c[dimension] || 0), 0);\n }\n\n // Only align children if container has a cross size\n const crossAlignChild =\n containerCrossSize && align\n ? (c: SolidNode) => {\n if (align === 'flexStart') {\n c[crossProp] = 0;\n } else if (align === 'center') {\n c[crossProp] = (containerCrossSize - (c[crossDimension] || 0)) / 2;\n } else if (align === 'flexEnd') {\n c[crossProp] = containerCrossSize - (c[crossDimension] || 0);\n }\n }\n : (c: SolidNode) => c;\n\n if (justify === 'flexStart') {\n let start = 0;\n children.forEach((c) => {\n c[prop] = start + (c[marginOne] || 0);\n start +=\n (c[dimension] || 0) + gap + (c[marginOne] || 0) + (c[marginTwo] || 0);\n crossAlignChild(c);\n });\n // Update container size\n if (node._autosized) {\n const calculatedSize = start - gap;\n if (calculatedSize !== node[dimension]) {\n node[dimension] = calculatedSize;\n return true;\n }\n }\n } else if (justify === 'flexEnd') {\n let start = containerSize;\n for (let i = numChildren - 1; i >= 0; i--) {\n const c = children[i];\n assertTruthy(c);\n c[prop] = start - (c[dimension] || 0) - (c[marginTwo] || 0);\n start -=\n (c[dimension] || 0) + gap + (c[marginOne] || 0) + (c[marginTwo] || 0);\n crossAlignChild(c);\n }\n } else if (justify === 'center') {\n let start = (containerSize - (itemSize + gap * (numChildren - 1))) / 2;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + gap;\n crossAlignChild(c);\n });\n } else if (justify === 'spaceBetween') {\n const toPad = (containerSize - itemSize) / (numChildren - 1);\n let start = 0;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + toPad;\n crossAlignChild(c);\n });\n } else if (justify === 'spaceEvenly') {\n const toPad = (containerSize - itemSize) / (numChildren + 1);\n let start = toPad;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + toPad;\n crossAlignChild(c);\n });\n }\n\n // Container was not updated\n return false;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { createSignal } from 'solid-js';\nimport type { ElementNode } from './node/index.js';\nexport const [activeElement, setActiveElement] = createSignal<\n ElementNode | undefined\n>(undefined);\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { renderer, createShader } from '../lightningInit.js';\nimport {\n type BorderStyleObject,\n type IntrinsicCommonProps,\n type IntrinsicNodeProps,\n type IntrinsicTextProps,\n type NodeStyles,\n type TextStyles,\n} from '../../index.js';\nimport Children from './children.js';\nimport States, { type NodeStates } from './states.js';\nimport calculateFlex from '../flex.js';\nimport {\n log,\n isArray,\n isNumber,\n isFunc,\n keyExists,\n flattenStyles,\n} from '../utils.js';\nimport { config } from '../../config.js';\nimport { setActiveElement } from '../activeElement.js';\nimport type {\n RendererMain,\n INode,\n INodeAnimatableProps,\n INodeWritableProps,\n ShaderRef,\n Dimensions,\n AnimationSettings,\n NodeLoadedPayload,\n} from '@lightningjs/renderer';\nimport { assertTruthy } from '@lightningjs/renderer/utils';\n\nconst { animationSettings: defaultAnimationSettings } = config;\n\nfunction convertEffectsToShader(styleEffects: any) {\n const effects = [];\n\n for (const [type, props] of Object.entries>(\n styleEffects,\n )) {\n effects.push({ type, props });\n }\n return createShader('DynamicShader', { effects: effects as any });\n}\n\nfunction borderAccessor(\n direction: '' | 'Top' | 'Right' | 'Bottom' | 'Left' = '',\n) {\n return {\n set(\n this: ElementNode,\n value: number | { width: number; color: number | string },\n ) {\n // Format: width || { width, color }\n if (isNumber(value)) {\n value = { width: value, color: 0x000000ff };\n }\n this.effects = {\n ...(this.effects || {}),\n ...{ [`border${direction}`]: value },\n };\n this[`_border${direction}`] = value;\n },\n get(this: ElementNode) {\n return this[`_border${direction}`];\n },\n };\n}\n\nconst LightningRendererNumberProps = [\n 'alpha',\n 'color',\n 'colorTop',\n 'colorRight',\n 'colorLeft',\n 'colorBottom',\n 'colorTl',\n 'colorTr',\n 'colorBl',\n 'colorBr',\n 'height',\n 'fontSize',\n 'lineHeight',\n 'mount',\n 'mountX',\n 'mountY',\n 'pivot',\n 'pivotX',\n 'pivotY',\n 'rotation',\n 'scale',\n 'width',\n 'worldX',\n 'worldY',\n 'x',\n 'y',\n 'zIndex',\n 'zIndexLocked',\n];\n\nconst LightningRendererNonAnimatingProps = [\n 'clipping',\n 'contain',\n 'fontFamily',\n 'fontStretch',\n 'fontStyle',\n 'fontWeight',\n 'letterSpacing',\n 'maxLines',\n 'offsetY',\n 'overflowSuffix',\n 'rtt',\n 'scrollable',\n 'scrollY',\n 'src',\n 'text',\n 'textAlign',\n 'textBaseline',\n 'textOverflow',\n 'texture',\n 'verticalAlign',\n 'wordWrap',\n];\n\nexport interface TextNode {\n id?: string;\n name: string;\n text: string;\n parent: ElementNode | undefined;\n zIndex?: number;\n states?: States;\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n marginLeft?: number;\n marginRight?: number;\n marginTop?: number;\n marginBottom?: number;\n flexItem?: boolean;\n _queueDelete?: boolean;\n}\n\nexport type SolidNode = ElementNode | TextNode;\nexport type SolidStyles = NodeStyles | TextStyles;\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\nexport interface ElementNode\n extends Partial>,\n IntrinsicCommonProps {\n [key: string]: unknown;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\nexport class ElementNode extends Object {\n id?: string;\n debug?: boolean;\n name: string;\n lng: INode | undefined;\n renderer?: RendererMain;\n selected?: number;\n rendered: boolean;\n autofocus: boolean;\n flexItem?: boolean;\n _queueDelete?: boolean;\n forwardFocus?:\n | number\n | ((this: ElementNode, elm: ElementNode) => boolean | void);\n\n private _undoStyles?: string[];\n private _renderProps?: IntrinsicNodeProps | IntrinsicTextProps;\n private _effects: any;\n private _parent: ElementNode | undefined;\n private _shader?: ShaderRef;\n private _style?: SolidStyles;\n private _states?: States;\n private _events?: Array<\n [string, (target: ElementNode, event?: Event) => void]\n >;\n private _animationSettings?: Partial;\n private _width?: number;\n private _height?: number;\n private _color?: number | string;\n public _borderRadius?: number;\n public _border?: BorderStyleObject;\n public _borderLeft?: BorderStyleObject;\n public _borderRight?: BorderStyleObject;\n public _borderTop?: BorderStyleObject;\n public _borderBottom?: BorderStyleObject;\n public _autosized?: boolean; // Public but uses _ prefix\n public _isDirty?: boolean; // Public but uses _ prefix\n private _animationQueue: Array<{\n props: Partial;\n animationSettings?: Partial;\n }> = [];\n private _animationQueueSettings: Partial | undefined;\n private _animationRunning: boolean = false;\n children: Children;\n\n constructor(name: string) {\n super();\n this.name = name;\n this.rendered = false;\n this.autofocus = false;\n this._renderProps = { x: 0, y: 0 };\n this.children = new Children(this);\n }\n\n get effects() {\n return this._effects;\n }\n\n set effects(v) {\n this._effects = v;\n if (this.rendered) {\n this.shader = convertEffectsToShader(v);\n }\n }\n\n get parent() {\n return this._parent;\n }\n\n set parent(p) {\n this._parent = p;\n if (this.rendered && this.lng) {\n this.lng.parent = p?.lng ?? null;\n }\n }\n\n get shader(): ShaderRef | undefined {\n return this._shader;\n }\n\n set shader(v: Parameters | ShaderRef | undefined) {\n if (isArray(v)) {\n this._shader = createShader(...v) as ShaderRef;\n } else {\n this._shader = v;\n }\n this._sendToLightning('shader', this._shader);\n }\n\n _sendToLightningAnimatable(name: string, value: number | string) {\n if (this.lng) {\n if (\n config.animationsEnabled &&\n this.transition &&\n (this.transition === true || this.transition[name])\n ) {\n const animationSettings =\n this.transition === true || this.transition[name] === true\n ? undefined\n : (this.transition[name] as undefined | AnimationSettings);\n\n return this.animate({ [name]: value }, animationSettings).start();\n }\n\n (this.lng[name as keyof INode] as number | string) = value;\n } else {\n this._renderProps![name] = value;\n }\n }\n\n _sendToLightning(name: string, value: unknown) {\n if (this.rendered && this.lng) {\n (this.lng[name as keyof INodeWritableProps] as unknown) = value;\n } else {\n this._renderProps![name] = value;\n }\n }\n\n animate(\n props: Partial,\n animationSettings?: Partial,\n ) {\n assertTruthy(this.lng, 'Node must be rendered before animating');\n return this.lng.animate(props, animationSettings || this.animationSettings);\n }\n\n chain(\n props: Partial,\n animationSettings?: Partial,\n ) {\n if (this._animationRunning) {\n this._animationQueue = [];\n this._animationRunning = false;\n }\n\n if (animationSettings) {\n this._animationQueueSettings = animationSettings;\n } else if (!this._animationQueueSettings) {\n this._animationQueueSettings =\n animationSettings || this.animationSettings;\n }\n animationSettings = animationSettings || this._animationQueueSettings;\n this._animationQueue.push({ props, animationSettings });\n return this;\n }\n\n async start() {\n let animation = this._animationQueue.shift();\n while (animation) {\n this._animationRunning = true;\n await this.animate(animation.props, animation.animationSettings)\n .start()\n .waitUntilStopped();\n animation = this._animationQueue.shift();\n }\n this._animationRunning = false;\n this._animationQueueSettings = undefined;\n }\n\n setFocus() {\n if (this.rendered) {\n // can be 0\n if (this.forwardFocus !== undefined) {\n if (isFunc(this.forwardFocus)) {\n if (this.forwardFocus.call(this, this) !== false) {\n return;\n }\n } else {\n const focusedIndex =\n typeof this.forwardFocus === 'number' ? this.forwardFocus : null;\n if (focusedIndex !== null && focusedIndex < this.children.length) {\n const child = this.children[focusedIndex];\n child instanceof ElementNode && child.setFocus();\n return;\n }\n }\n }\n // Delay setting focus so children can render (useful for Row + Column)\n queueMicrotask(() => setActiveElement(this));\n } else {\n this.autofocus = true;\n }\n }\n\n isTextNode() {\n return this.name === 'text';\n }\n\n _resizeOnTextLoad() {\n this.lng!.on('loaded', (_node: INode, loadedPayload: NodeLoadedPayload) => {\n if (loadedPayload.type === 'text') {\n const { dimensions } = loadedPayload;\n this.parent!.updateLayout(this, dimensions);\n }\n });\n }\n\n getText() {\n return this.children.map((c) => c.text).join('');\n }\n\n destroy() {\n if (this._queueDelete) {\n this.lng?.destroy();\n }\n }\n // Must be set before render\n set onEvents(\n events: Array<[string, (target: ElementNode, event?: any) => void]>,\n ) {\n this._events = events;\n }\n\n get onEvents() {\n return this._events || [];\n }\n\n set style(values: SolidStyles | (SolidStyles | undefined)[]) {\n if (isArray(values)) {\n this._style = flattenStyles(values);\n } else {\n this._style = values;\n }\n // Keys set in JSX are more important\n for (const key in this._style) {\n // be careful of 0 values\n if (this[key as keyof SolidStyles] === undefined) {\n this[key as keyof SolidStyles] = this._style[key as keyof SolidStyles];\n }\n }\n }\n\n get style(): SolidStyles {\n return this._style!;\n }\n\n get hasChildren() {\n return this.children.length > 0;\n }\n\n getChildById(id: string) {\n return this.children.find((c) => c.id === id);\n }\n\n searchChildrenById(id: string): SolidNode | undefined {\n // traverse all the childrens children\n for (const child of this.children) {\n if (child.id === id) {\n return child;\n }\n if (child instanceof ElementNode) {\n const found = child.searchChildrenById(id);\n if (found) {\n return found;\n }\n }\n }\n }\n\n set states(states: NodeStates) {\n this._states = new States(this._stateChanged.bind(this), states);\n if (this.rendered) {\n this._stateChanged();\n }\n }\n\n get states(): States {\n this._states = this._states || new States(this._stateChanged.bind(this));\n return this._states;\n }\n\n get animationSettings(): Partial {\n return this._animationSettings || defaultAnimationSettings;\n }\n\n set animationSettings(animationSettings: Partial) {\n this._animationSettings = animationSettings;\n }\n\n updateLayout(child?: ElementNode, dimensions?: Dimensions) {\n if (this.hasChildren) {\n log('Layout: ', this);\n isFunc(this.onBeforeLayout) &&\n this.onBeforeLayout.call(this, child, dimensions);\n\n if (this.display === 'flex') {\n if (calculateFlex(this)) {\n this.parent?.updateLayout();\n }\n }\n\n isFunc(this.onLayout) && this.onLayout.call(this, child, dimensions);\n }\n }\n\n _stateChanged() {\n log('State Changed: ', this, this.states);\n\n if (this.forwardStates) {\n // apply states to children first\n const states = this.states.slice() as States;\n this.children.forEach((c) => (c.states = states));\n }\n\n const states = this.states;\n\n if (this._undoStyles || (this.style && keyExists(this.style, states))) {\n this._undoStyles = this._undoStyles || [];\n const stylesToUndo: { [key: string]: any } = {};\n\n this._undoStyles.forEach((styleKey) => {\n stylesToUndo[styleKey] = this.style[styleKey];\n });\n\n const newStyles = states.reduce((acc, state) => {\n const styles = this.style[state];\n if (styles) {\n acc = {\n ...acc,\n ...styles,\n };\n }\n return acc;\n }, {});\n\n this._undoStyles = Object.keys(newStyles);\n\n // Apply transition first\n if ((newStyles as any).transition !== undefined) {\n this.transition = (newStyles as any).transition;\n }\n\n // Apply the styles\n Object.assign(this, { ...stylesToUndo, ...newStyles });\n }\n }\n\n render() {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const node = this;\n const parent = this.parent;\n\n if (!parent) {\n console.warn('Parent not set - no node created for: ', this);\n return;\n }\n\n if (!parent.rendered) {\n console.warn('Parent not rendered yet: ', this);\n return;\n }\n\n if (this.rendered) {\n console.warn('Node already rendered: ', this);\n return;\n }\n\n // Parent is dirty whenever a node is inserted after initial render\n if (parent._isDirty) {\n parent.updateLayout();\n parent._isDirty = false;\n }\n\n node.updateLayout();\n\n if (this.states.length) {\n this._stateChanged();\n }\n\n let props = node._renderProps as IntrinsicNodeProps | IntrinsicTextProps;\n\n if (parent.lng) {\n props.parent = parent.lng;\n }\n\n if (node._effects) {\n this.shader = convertEffectsToShader(node._effects);\n }\n\n if (node.isTextNode()) {\n props = {\n ...config.fontSettings,\n ...props,\n text: node.getText(),\n };\n\n if (props.contain) {\n if (!props.width) {\n props.width =\n (parent.width || 0) - (props.x || 0) - (props.marginRight || 0);\n node._width = props.width;\n node._autosized = true;\n }\n\n if (props.contain === 'both' && !props.height && !props.maxLines) {\n props.height =\n (parent.height || 0) - (props.y || 0) - (props.marginBottom || 0);\n node._height = props.height;\n node._autosized = true;\n }\n }\n\n log('Rendering: ', this, props);\n node.lng = renderer.createTextNode(props);\n\n if (isFunc(node.onLoad)) {\n node.lng.on('loaded', node.onLoad);\n }\n\n if (!node.width || !node.height) {\n node._autosized = true;\n node._resizeOnTextLoad();\n }\n } else {\n // If its not an image or texture apply some defaults\n if (!props.texture) {\n // Set width and height to parent less offset\n if (isNaN(props.width as number)) {\n props.width = (parent.width || 0) - (props.x || 0);\n node._width = props.width;\n node._autosized = true;\n }\n\n if (isNaN(props.height as number)) {\n props.height = (parent.height || 0) - (props.y || 0);\n node._height = props.height;\n node._autosized = true;\n }\n\n if (!props.color && !props.src) {\n // Default color to transparent - If you later set a src, you'll need\n // to set color '#ffffffff'\n node._color = props.color = 0x00000000;\n }\n }\n\n log('Rendering: ', this, props);\n node.lng = renderer.createNode(props);\n\n if (node.onFail) {\n node.lng.on('failed', node.onFail);\n }\n\n if (node.onLoad) {\n node.lng.on('loaded', node.onLoad);\n }\n }\n\n node.rendered = true;\n isFunc(this.onCreate) && this.onCreate.call(this, node);\n\n node.onEvents.forEach(([name, handler]) => {\n node.lng?.on(name, (inode, data) => handler(node, data));\n });\n\n // L3 Inspector adds div to the lng object\n //@ts-expect-error - div is not in the typings\n if (node.lng.div) {\n //@ts-expect-error - div is not in the typings\n node.lng.div.solid = node;\n }\n // clean up after first render;\n delete this._renderProps;\n\n if (node.name !== 'text') {\n node.children.forEach((c) => {\n if ((c as ElementNode).render) {\n (c as ElementNode).render();\n } else if (c.text !== '') {\n // Solid Show uses an empty text node as a placeholder\n console.warn('TextNode outside of : ', c);\n }\n });\n }\n\n node.autofocus && node.setFocus();\n }\n}\n\nfor (const key of LightningRendererNumberProps) {\n Object.defineProperty(ElementNode.prototype, key, {\n get(): number {\n return (this.lng && this.lng[key]) ?? this[`_${key}`];\n },\n set(v: number) {\n this[`_${key}`] = v;\n this._sendToLightningAnimatable(key, v);\n },\n });\n}\n\nfor (const key of LightningRendererNonAnimatingProps) {\n Object.defineProperty(ElementNode.prototype, key, {\n get() {\n return (this.lng && this.lng[key]) ?? this[`_${key}`];\n },\n set(v) {\n this[`_${key}`] = v;\n this._sendToLightning(key, v);\n },\n });\n}\n\n// Add Border Helpers\nObject.defineProperties(ElementNode.prototype, {\n borderRadius: {\n set(this: ElementNode, radius) {\n this._borderRadius = radius;\n this.effects = {\n ...(this.effects || {}),\n ...{ radius: { radius } },\n };\n },\n get(this: ElementNode) {\n return this._borderRadius;\n },\n },\n border: borderAccessor(),\n borderLeft: borderAccessor('Left'),\n borderRight: borderAccessor('Right'),\n borderTop: borderAccessor('Top'),\n borderBottom: borderAccessor('Bottom'),\n});\n\nObject.defineProperties(ElementNode.prototype, {\n linearGradient: {\n set(props = {}) {\n this._linearGradient = props;\n this.effects = {\n ...(this.effects || {}),\n ...{ linearGradient: props },\n };\n },\n get() {\n return this._linearGradient;\n },\n },\n});\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { type Component } from \"solid-js\";\nimport type { IntrinsicTextProps } from \"../intrinsicTypes.js\";\n\nexport const Text: Component = (props) => \n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { type Component } from \"solid-js\";\nimport { type IntrinsicNodeProps } from \"../intrinsicTypes.js\";\n\nexport const View: Component = (props) =>\n ;\n","import {\n createRoot,\n createRenderEffect,\n mergeProps,\n createMemo,\n createComponent,\n untrack\n} from \"solid-js\";\n\nfunction createRenderer$1({\n createElement,\n createTextNode,\n isTextNode,\n replaceText,\n insertNode,\n removeNode,\n setProperty,\n getParentNode,\n getFirstChild,\n getNextSibling\n}) {\n function insert(parent, accessor, marker, initial) {\n if (marker !== undefined && !initial) initial = [];\n if (typeof accessor !== \"function\") return insertExpression(parent, accessor, initial, marker);\n createRenderEffect(current => insertExpression(parent, accessor(), current, marker), initial);\n }\n function insertExpression(parent, value, current, marker, unwrapArray) {\n while (typeof current === \"function\") current = current();\n if (value === current) return current;\n const t = typeof value,\n multi = marker !== undefined;\n if (t === \"string\" || t === \"number\") {\n if (t === \"number\") value = value.toString();\n if (multi) {\n let node = current[0];\n if (node && isTextNode(node)) {\n replaceText(node, value);\n } else node = createTextNode(value);\n current = cleanChildren(parent, current, marker, node);\n } else {\n if (current !== \"\" && typeof current === \"string\") {\n replaceText(getFirstChild(parent), (current = value));\n } else {\n cleanChildren(parent, current, marker, createTextNode(value));\n current = value;\n }\n }\n } else if (value == null || t === \"boolean\") {\n current = cleanChildren(parent, current, marker);\n } else if (t === \"function\") {\n createRenderEffect(() => {\n let v = value();\n while (typeof v === \"function\") v = v();\n current = insertExpression(parent, v, current, marker);\n });\n return () => current;\n } else if (Array.isArray(value)) {\n const array = [];\n if (normalizeIncomingArray(array, value, unwrapArray)) {\n createRenderEffect(\n () => (current = insertExpression(parent, array, current, marker, true))\n );\n return () => current;\n }\n if (array.length === 0) {\n const replacement = cleanChildren(parent, current, marker);\n if (multi) return (current = replacement);\n } else {\n if (Array.isArray(current)) {\n if (current.length === 0) {\n appendNodes(parent, array, marker);\n } else reconcileArrays(parent, current, array);\n } else if (current == null || current === \"\") {\n appendNodes(parent, array);\n } else {\n reconcileArrays(parent, (multi && current) || [getFirstChild(parent)], array);\n }\n }\n current = array;\n } else {\n if (Array.isArray(current)) {\n if (multi) return (current = cleanChildren(parent, current, marker, value));\n cleanChildren(parent, current, null, value);\n } else if (current == null || current === \"\" || !getFirstChild(parent)) {\n insertNode(parent, value);\n } else replaceNode(parent, value, getFirstChild(parent));\n current = value;\n }\n return current;\n }\n function normalizeIncomingArray(normalized, array, unwrap) {\n let dynamic = false;\n for (let i = 0, len = array.length; i < len; i++) {\n let item = array[i],\n t;\n if (item == null || item === true || item === false);\n else if (Array.isArray(item)) {\n dynamic = normalizeIncomingArray(normalized, item) || dynamic;\n } else if ((t = typeof item) === \"string\" || t === \"number\") {\n normalized.push(createTextNode(item));\n } else if (t === \"function\") {\n if (unwrap) {\n while (typeof item === \"function\") item = item();\n dynamic =\n normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item]) || dynamic;\n } else {\n normalized.push(item);\n dynamic = true;\n }\n } else normalized.push(item);\n }\n return dynamic;\n }\n function reconcileArrays(parentNode, a, b) {\n let bLength = b.length,\n aEnd = a.length,\n bEnd = bLength,\n aStart = 0,\n bStart = 0,\n after = getNextSibling(a[aEnd - 1]),\n map = null;\n while (aStart < aEnd || bStart < bEnd) {\n if (a[aStart] === b[bStart]) {\n aStart++;\n bStart++;\n continue;\n }\n while (a[aEnd - 1] === b[bEnd - 1]) {\n aEnd--;\n bEnd--;\n }\n if (aEnd === aStart) {\n const node =\n bEnd < bLength ? (bStart ? getNextSibling(b[bStart - 1]) : b[bEnd - bStart]) : after;\n while (bStart < bEnd) insertNode(parentNode, b[bStart++], node);\n } else if (bEnd === bStart) {\n while (aStart < aEnd) {\n if (!map || !map.has(a[aStart])) removeNode(parentNode, a[aStart]);\n aStart++;\n }\n } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {\n const node = getNextSibling(a[--aEnd]);\n insertNode(parentNode, b[bStart++], getNextSibling(a[aStart++]));\n insertNode(parentNode, b[--bEnd], node);\n a[aEnd] = b[bEnd];\n } else {\n if (!map) {\n map = new Map();\n let i = bStart;\n while (i < bEnd) map.set(b[i], i++);\n }\n const index = map.get(a[aStart]);\n if (index != null) {\n if (bStart < index && index < bEnd) {\n let i = aStart,\n sequence = 1,\n t;\n while (++i < aEnd && i < bEnd) {\n if ((t = map.get(a[i])) == null || t !== index + sequence) break;\n sequence++;\n }\n if (sequence > index - bStart) {\n const node = a[aStart];\n while (bStart < index) insertNode(parentNode, b[bStart++], node);\n } else replaceNode(parentNode, b[bStart++], a[aStart++]);\n } else aStart++;\n } else removeNode(parentNode, a[aStart++]);\n }\n }\n }\n function cleanChildren(parent, current, marker, replacement) {\n if (marker === undefined) {\n let removed;\n while ((removed = getFirstChild(parent))) removeNode(parent, removed);\n replacement && insertNode(parent, replacement);\n return \"\";\n }\n const node = replacement || createTextNode(\"\");\n if (current.length) {\n let inserted = false;\n for (let i = current.length - 1; i >= 0; i--) {\n const el = current[i];\n if (node !== el) {\n const isParent = getParentNode(el) === parent;\n if (!inserted && !i)\n isParent ? replaceNode(parent, node, el) : insertNode(parent, node, marker);\n else isParent && removeNode(parent, el);\n } else inserted = true;\n }\n } else insertNode(parent, node, marker);\n return [node];\n }\n function appendNodes(parent, array, marker) {\n for (let i = 0, len = array.length; i < len; i++) insertNode(parent, array[i], marker);\n }\n function replaceNode(parent, newNode, oldNode) {\n insertNode(parent, newNode, oldNode);\n removeNode(parent, oldNode);\n }\n function spreadExpression(node, props, prevProps = {}, skipChildren) {\n props || (props = {});\n if (!skipChildren) {\n createRenderEffect(\n () => (prevProps.children = insertExpression(node, props.children, prevProps.children))\n );\n }\n createRenderEffect(() => props.ref && props.ref(node));\n createRenderEffect(() => {\n for (const prop in props) {\n if (prop === \"children\" || prop === \"ref\") continue;\n const value = props[prop];\n if (value === prevProps[prop]) continue;\n setProperty(node, prop, value, prevProps[prop]);\n prevProps[prop] = value;\n }\n });\n return prevProps;\n }\n return {\n render(code, element) {\n let disposer;\n createRoot(dispose => {\n disposer = dispose;\n insert(element, code());\n });\n return disposer;\n },\n insert,\n spread(node, accessor, skipChildren) {\n if (typeof accessor === \"function\") {\n createRenderEffect(current => spreadExpression(node, accessor(), current, skipChildren));\n } else spreadExpression(node, accessor, undefined, skipChildren);\n },\n createElement,\n createTextNode,\n insertNode,\n setProp(node, name, value, prev) {\n setProperty(node, name, value, prev);\n return value;\n },\n mergeProps,\n effect: createRenderEffect,\n memo: createMemo,\n createComponent,\n use(fn, element, arg) {\n return untrack(() => fn(element, arg));\n }\n };\n}\n\nfunction createRenderer(options) {\n const renderer = createRenderer$1(options);\n renderer.mergeProps = mergeProps;\n return renderer;\n}\n\nexport { createRenderer };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { assertTruthy } from '@lightningjs/renderer/utils';\nimport { log } from './utils.js';\nimport { ElementNode, type SolidNode, type TextNode } from './node/index.js';\nimport type { createRenderer } from 'solid-js/universal';\n\nexport type SolidRendererOptions = Parameters<\n typeof createRenderer\n>[0];\n\nexport default {\n createElement(name: string): ElementNode {\n return new ElementNode(name);\n },\n createTextNode(text: string): TextNode {\n // A text node is just a string - not the node\n return { name: 'TextNode', text, parent: undefined };\n },\n replaceText(node: TextNode, value: string): void {\n log('Replace Text: ', node, value);\n node.text = value;\n const parent = node.parent;\n assertTruthy(parent);\n parent.text = parent.getText();\n },\n setProperty(node: ElementNode, name: string, value: any = true): void {\n node[name] = value;\n },\n insertNode(parent: ElementNode, node: SolidNode, anchor: SolidNode): void {\n log('INSERT: ', parent, node, anchor);\n\n parent.children.insert(node, anchor);\n node._queueDelete = false;\n\n if (node instanceof ElementNode) {\n parent.rendered && node.render();\n } else if (parent.isTextNode()) {\n // TextNodes can be placed outside of nodes when is used as placeholder\n parent.text = parent.getText();\n }\n },\n isTextNode(node: ElementNode): boolean {\n return node.isTextNode();\n },\n removeNode(parent: ElementNode, node: SolidNode): void {\n log('REMOVE: ', parent, node);\n parent.children.remove(node);\n node._queueDelete = true;\n\n if (node instanceof ElementNode) {\n // Solid replacesNodes to move them (via insert and remove),\n // so we need to wait for the next microtask to destroy the node\n // in the event it gets a new parent.\n queueMicrotask(() => node.destroy());\n }\n },\n getParentNode(node: SolidNode): ElementNode | undefined {\n return node.parent;\n },\n getFirstChild(node: ElementNode): SolidNode | undefined {\n return node.children[0];\n },\n getNextSibling(node: SolidNode): SolidNode | undefined {\n const children = node.parent!.children || [];\n const index = children.indexOf(node) + 1;\n if (index < children.length) {\n return children[index];\n }\n return undefined;\n },\n} satisfies SolidRendererOptions;\n","/* eslint-disable @typescript-eslint/unbound-method */\n/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { createRenderer } from 'solid-js/universal';\nimport { config } from '../config.js';\nimport { startLightningRenderer } from './lightningInit.js';\nimport universalLightning from './solidUniversal.js';\nimport { ElementNode, type SolidNode } from './node/index.js';\nimport { splitProps, createMemo, untrack, type JSX } from 'solid-js';\n\nconst solidRenderer = createRenderer(universalLightning);\n\nexport const render = async function (\n code: () => JSX.Element,\n node?: string | HTMLElement | undefined,\n) {\n const renderer = startLightningRenderer(config.rendererOptions, node);\n await renderer.init();\n const rootNode = new ElementNode('App');\n rootNode.lng = renderer.root!;\n rootNode.rendered = true;\n // @ts-expect-error - code is jsx element and not SolidElement yet\n const dispose = solidRenderer.render(code, rootNode);\n return {\n dispose,\n rootNode,\n renderer,\n };\n};\n\nexport const {\n effect,\n memo,\n createComponent,\n createElement,\n createTextNode,\n insertNode,\n insert,\n spread,\n setProp,\n mergeProps,\n use,\n} = solidRenderer;\n\n/**\n * renders an arbitrary custom or native component and passes the other props\n * ```typescript\n * \n * ```\n * @description https://www.solidjs.com/docs/latest/api#dynamic\n */\nexport function Dynamic(\n props: T extends Record ? T : never,\n): SolidNode {\n const [p, others] = splitProps(props, ['component']);\n // eslint-disable-next-line @typescript-eslint/ban-types\n const cached = createMemo(() => p.component);\n return createMemo(() => {\n const component = cached();\n switch (typeof component) {\n case 'function':\n return untrack(() => component(others));\n\n case 'string':\n // eslint-disable-next-line no-case-declarations\n const el = createElement(component);\n spread(el, others);\n return el;\n\n default:\n break;\n }\n }) as unknown as SolidNode;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { isInteger } from './core/utils.js';\n\n/**\n * Converts a color string to a color number value.\n */\nexport function hexColor(color: string | number = ''): number {\n if (isInteger(color)) {\n return color;\n }\n\n if (typeof color === 'string') {\n // Renderer expects RGBA values\n if (color.startsWith('#')) {\n return Number(\n color.replace('#', '0x') + (color.length === 7 ? 'ff' : ''),\n );\n }\n\n if (color.startsWith('0x')) {\n return Number(color);\n }\n return Number('0x' + (color.length === 6 ? color + 'ff' : color));\n }\n\n return 0x00000000;\n}\n\n/**\n * Converts degrees to radians\n */\nexport function deg2rad(deg: number) {\n return (deg * Math.PI) / 180;\n}\n","import {\n createRoot,\n sharedConfig,\n createRenderEffect,\n untrack,\n enableHydration,\n getOwner,\n createEffect,\n runWithOwner,\n createMemo,\n createSignal,\n onCleanup,\n splitProps\n} from \"solid-js\";\nexport {\n ErrorBoundary,\n For,\n Index,\n Match,\n Show,\n Suspense,\n SuspenseList,\n Switch,\n createComponent,\n createRenderEffect as effect,\n getOwner,\n createMemo as memo,\n mergeProps,\n untrack\n} from \"solid-js\";\n\nconst booleans = [\n \"allowfullscreen\",\n \"async\",\n \"autofocus\",\n \"autoplay\",\n \"checked\",\n \"controls\",\n \"default\",\n \"disabled\",\n \"formnovalidate\",\n \"hidden\",\n \"indeterminate\",\n \"inert\",\n \"ismap\",\n \"loop\",\n \"multiple\",\n \"muted\",\n \"nomodule\",\n \"novalidate\",\n \"open\",\n \"playsinline\",\n \"readonly\",\n \"required\",\n \"reversed\",\n \"seamless\",\n \"selected\"\n];\nconst Properties = /*#__PURE__*/ new Set([\n \"className\",\n \"value\",\n \"readOnly\",\n \"formNoValidate\",\n \"isMap\",\n \"noModule\",\n \"playsInline\",\n ...booleans\n]);\nconst ChildProperties = /*#__PURE__*/ new Set([\n \"innerHTML\",\n \"textContent\",\n \"innerText\",\n \"children\"\n]);\nconst Aliases = /*#__PURE__*/ Object.assign(Object.create(null), {\n className: \"class\",\n htmlFor: \"for\"\n});\nconst PropAliases = /*#__PURE__*/ Object.assign(Object.create(null), {\n class: \"className\",\n formnovalidate: {\n $: \"formNoValidate\",\n BUTTON: 1,\n INPUT: 1\n },\n ismap: {\n $: \"isMap\",\n IMG: 1\n },\n nomodule: {\n $: \"noModule\",\n SCRIPT: 1\n },\n playsinline: {\n $: \"playsInline\",\n VIDEO: 1\n },\n readonly: {\n $: \"readOnly\",\n INPUT: 1,\n TEXTAREA: 1\n }\n});\nfunction getPropAlias(prop, tagName) {\n const a = PropAliases[prop];\n return typeof a === \"object\" ? (a[tagName] ? a[\"$\"] : undefined) : a;\n}\nconst DelegatedEvents = /*#__PURE__*/ new Set([\n \"beforeinput\",\n \"click\",\n \"dblclick\",\n \"contextmenu\",\n \"focusin\",\n \"focusout\",\n \"input\",\n \"keydown\",\n \"keyup\",\n \"mousedown\",\n \"mousemove\",\n \"mouseout\",\n \"mouseover\",\n \"mouseup\",\n \"pointerdown\",\n \"pointermove\",\n \"pointerout\",\n \"pointerover\",\n \"pointerup\",\n \"touchend\",\n \"touchmove\",\n \"touchstart\"\n]);\nconst SVGElements = /*#__PURE__*/ new Set([\n \"altGlyph\",\n \"altGlyphDef\",\n \"altGlyphItem\",\n \"animate\",\n \"animateColor\",\n \"animateMotion\",\n \"animateTransform\",\n \"circle\",\n \"clipPath\",\n \"color-profile\",\n \"cursor\",\n \"defs\",\n \"desc\",\n \"ellipse\",\n \"feBlend\",\n \"feColorMatrix\",\n \"feComponentTransfer\",\n \"feComposite\",\n \"feConvolveMatrix\",\n \"feDiffuseLighting\",\n \"feDisplacementMap\",\n \"feDistantLight\",\n \"feFlood\",\n \"feFuncA\",\n \"feFuncB\",\n \"feFuncG\",\n \"feFuncR\",\n \"feGaussianBlur\",\n \"feImage\",\n \"feMerge\",\n \"feMergeNode\",\n \"feMorphology\",\n \"feOffset\",\n \"fePointLight\",\n \"feSpecularLighting\",\n \"feSpotLight\",\n \"feTile\",\n \"feTurbulence\",\n \"filter\",\n \"font\",\n \"font-face\",\n \"font-face-format\",\n \"font-face-name\",\n \"font-face-src\",\n \"font-face-uri\",\n \"foreignObject\",\n \"g\",\n \"glyph\",\n \"glyphRef\",\n \"hkern\",\n \"image\",\n \"line\",\n \"linearGradient\",\n \"marker\",\n \"mask\",\n \"metadata\",\n \"missing-glyph\",\n \"mpath\",\n \"path\",\n \"pattern\",\n \"polygon\",\n \"polyline\",\n \"radialGradient\",\n \"rect\",\n \"set\",\n \"stop\",\n \"svg\",\n \"switch\",\n \"symbol\",\n \"text\",\n \"textPath\",\n \"tref\",\n \"tspan\",\n \"use\",\n \"view\",\n \"vkern\"\n]);\nconst SVGNamespace = {\n xlink: \"http://www.w3.org/1999/xlink\",\n xml: \"http://www.w3.org/XML/1998/namespace\"\n};\nconst DOMElements = /*#__PURE__*/ new Set([\n \"html\",\n \"base\",\n \"head\",\n \"link\",\n \"meta\",\n \"style\",\n \"title\",\n \"body\",\n \"address\",\n \"article\",\n \"aside\",\n \"footer\",\n \"header\",\n \"main\",\n \"nav\",\n \"section\",\n \"body\",\n \"blockquote\",\n \"dd\",\n \"div\",\n \"dl\",\n \"dt\",\n \"figcaption\",\n \"figure\",\n \"hr\",\n \"li\",\n \"ol\",\n \"p\",\n \"pre\",\n \"ul\",\n \"a\",\n \"abbr\",\n \"b\",\n \"bdi\",\n \"bdo\",\n \"br\",\n \"cite\",\n \"code\",\n \"data\",\n \"dfn\",\n \"em\",\n \"i\",\n \"kbd\",\n \"mark\",\n \"q\",\n \"rp\",\n \"rt\",\n \"ruby\",\n \"s\",\n \"samp\",\n \"small\",\n \"span\",\n \"strong\",\n \"sub\",\n \"sup\",\n \"time\",\n \"u\",\n \"var\",\n \"wbr\",\n \"area\",\n \"audio\",\n \"img\",\n \"map\",\n \"track\",\n \"video\",\n \"embed\",\n \"iframe\",\n \"object\",\n \"param\",\n \"picture\",\n \"portal\",\n \"source\",\n \"svg\",\n \"math\",\n \"canvas\",\n \"noscript\",\n \"script\",\n \"del\",\n \"ins\",\n \"caption\",\n \"col\",\n \"colgroup\",\n \"table\",\n \"tbody\",\n \"td\",\n \"tfoot\",\n \"th\",\n \"thead\",\n \"tr\",\n \"button\",\n \"datalist\",\n \"fieldset\",\n \"form\",\n \"input\",\n \"label\",\n \"legend\",\n \"meter\",\n \"optgroup\",\n \"option\",\n \"output\",\n \"progress\",\n \"select\",\n \"textarea\",\n \"details\",\n \"dialog\",\n \"menu\",\n \"summary\",\n \"details\",\n \"slot\",\n \"template\",\n \"acronym\",\n \"applet\",\n \"basefont\",\n \"bgsound\",\n \"big\",\n \"blink\",\n \"center\",\n \"content\",\n \"dir\",\n \"font\",\n \"frame\",\n \"frameset\",\n \"hgroup\",\n \"image\",\n \"keygen\",\n \"marquee\",\n \"menuitem\",\n \"nobr\",\n \"noembed\",\n \"noframes\",\n \"plaintext\",\n \"rb\",\n \"rtc\",\n \"shadow\",\n \"spacer\",\n \"strike\",\n \"tt\",\n \"xmp\",\n \"a\",\n \"abbr\",\n \"acronym\",\n \"address\",\n \"applet\",\n \"area\",\n \"article\",\n \"aside\",\n \"audio\",\n \"b\",\n \"base\",\n \"basefont\",\n \"bdi\",\n \"bdo\",\n \"bgsound\",\n \"big\",\n \"blink\",\n \"blockquote\",\n \"body\",\n \"br\",\n \"button\",\n \"canvas\",\n \"caption\",\n \"center\",\n \"cite\",\n \"code\",\n \"col\",\n \"colgroup\",\n \"content\",\n \"data\",\n \"datalist\",\n \"dd\",\n \"del\",\n \"details\",\n \"dfn\",\n \"dialog\",\n \"dir\",\n \"div\",\n \"dl\",\n \"dt\",\n \"em\",\n \"embed\",\n \"fieldset\",\n \"figcaption\",\n \"figure\",\n \"font\",\n \"footer\",\n \"form\",\n \"frame\",\n \"frameset\",\n \"head\",\n \"header\",\n \"hgroup\",\n \"hr\",\n \"html\",\n \"i\",\n \"iframe\",\n \"image\",\n \"img\",\n \"input\",\n \"ins\",\n \"kbd\",\n \"keygen\",\n \"label\",\n \"legend\",\n \"li\",\n \"link\",\n \"main\",\n \"map\",\n \"mark\",\n \"marquee\",\n \"menu\",\n \"menuitem\",\n \"meta\",\n \"meter\",\n \"nav\",\n \"nobr\",\n \"noembed\",\n \"noframes\",\n \"noscript\",\n \"object\",\n \"ol\",\n \"optgroup\",\n \"option\",\n \"output\",\n \"p\",\n \"param\",\n \"picture\",\n \"plaintext\",\n \"portal\",\n \"pre\",\n \"progress\",\n \"q\",\n \"rb\",\n \"rp\",\n \"rt\",\n \"rtc\",\n \"ruby\",\n \"s\",\n \"samp\",\n \"script\",\n \"section\",\n \"select\",\n \"shadow\",\n \"slot\",\n \"small\",\n \"source\",\n \"spacer\",\n \"span\",\n \"strike\",\n \"strong\",\n \"style\",\n \"sub\",\n \"summary\",\n \"sup\",\n \"table\",\n \"tbody\",\n \"td\",\n \"template\",\n \"textarea\",\n \"tfoot\",\n \"th\",\n \"thead\",\n \"time\",\n \"title\",\n \"tr\",\n \"track\",\n \"tt\",\n \"u\",\n \"ul\",\n \"var\",\n \"video\",\n \"wbr\",\n \"xmp\",\n \"input\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n \"h6\"\n]);\n\nfunction reconcileArrays(parentNode, a, b) {\n let bLength = b.length,\n aEnd = a.length,\n bEnd = bLength,\n aStart = 0,\n bStart = 0,\n after = a[aEnd - 1].nextSibling,\n map = null;\n while (aStart < aEnd || bStart < bEnd) {\n if (a[aStart] === b[bStart]) {\n aStart++;\n bStart++;\n continue;\n }\n while (a[aEnd - 1] === b[bEnd - 1]) {\n aEnd--;\n bEnd--;\n }\n if (aEnd === aStart) {\n const node = bEnd < bLength ? (bStart ? b[bStart - 1].nextSibling : b[bEnd - bStart]) : after;\n while (bStart < bEnd) parentNode.insertBefore(b[bStart++], node);\n } else if (bEnd === bStart) {\n while (aStart < aEnd) {\n if (!map || !map.has(a[aStart])) a[aStart].remove();\n aStart++;\n }\n } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {\n const node = a[--aEnd].nextSibling;\n parentNode.insertBefore(b[bStart++], a[aStart++].nextSibling);\n parentNode.insertBefore(b[--bEnd], node);\n a[aEnd] = b[bEnd];\n } else {\n if (!map) {\n map = new Map();\n let i = bStart;\n while (i < bEnd) map.set(b[i], i++);\n }\n const index = map.get(a[aStart]);\n if (index != null) {\n if (bStart < index && index < bEnd) {\n let i = aStart,\n sequence = 1,\n t;\n while (++i < aEnd && i < bEnd) {\n if ((t = map.get(a[i])) == null || t !== index + sequence) break;\n sequence++;\n }\n if (sequence > index - bStart) {\n const node = a[aStart];\n while (bStart < index) parentNode.insertBefore(b[bStart++], node);\n } else parentNode.replaceChild(b[bStart++], a[aStart++]);\n } else aStart++;\n } else a[aStart++].remove();\n }\n }\n}\n\nconst $$EVENTS = \"_$DX_DELEGATE\";\nfunction render(code, element, init, options = {}) {\n let disposer;\n createRoot(dispose => {\n disposer = dispose;\n element === document\n ? code()\n : insert(element, code(), element.firstChild ? null : undefined, init);\n }, options.owner);\n return () => {\n disposer();\n element.textContent = \"\";\n };\n}\nfunction template(html, isCE, isSVG) {\n let node;\n const create = () => {\n const t = document.createElement(\"template\");\n t.innerHTML = html;\n return isSVG ? t.content.firstChild.firstChild : t.content.firstChild;\n };\n const fn = isCE\n ? () => untrack(() => document.importNode(node || (node = create()), true))\n : () => (node || (node = create())).cloneNode(true);\n fn.cloneNode = fn;\n return fn;\n}\nfunction delegateEvents(eventNames, document = window.document) {\n const e = document[$$EVENTS] || (document[$$EVENTS] = new Set());\n for (let i = 0, l = eventNames.length; i < l; i++) {\n const name = eventNames[i];\n if (!e.has(name)) {\n e.add(name);\n document.addEventListener(name, eventHandler);\n }\n }\n}\nfunction clearDelegatedEvents(document = window.document) {\n if (document[$$EVENTS]) {\n for (let name of document[$$EVENTS].keys()) document.removeEventListener(name, eventHandler);\n delete document[$$EVENTS];\n }\n}\nfunction setProperty(node, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n node[name] = value;\n}\nfunction setAttribute(node, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttribute(name);\n else node.setAttribute(name, value);\n}\nfunction setAttributeNS(node, namespace, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttributeNS(namespace, name);\n else node.setAttributeNS(namespace, name, value);\n}\nfunction className(node, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttribute(\"class\");\n else node.className = value;\n}\nfunction addEventListener(node, name, handler, delegate) {\n if (delegate) {\n if (Array.isArray(handler)) {\n node[`$$${name}`] = handler[0];\n node[`$$${name}Data`] = handler[1];\n } else node[`$$${name}`] = handler;\n } else if (Array.isArray(handler)) {\n const handlerFn = handler[0];\n node.addEventListener(name, (handler[0] = e => handlerFn.call(node, handler[1], e)));\n } else node.addEventListener(name, handler);\n}\nfunction classList(node, value, prev = {}) {\n const classKeys = Object.keys(value || {}),\n prevKeys = Object.keys(prev);\n let i, len;\n for (i = 0, len = prevKeys.length; i < len; i++) {\n const key = prevKeys[i];\n if (!key || key === \"undefined\" || value[key]) continue;\n toggleClassKey(node, key, false);\n delete prev[key];\n }\n for (i = 0, len = classKeys.length; i < len; i++) {\n const key = classKeys[i],\n classValue = !!value[key];\n if (!key || key === \"undefined\" || prev[key] === classValue || !classValue) continue;\n toggleClassKey(node, key, true);\n prev[key] = classValue;\n }\n return prev;\n}\nfunction style(node, value, prev) {\n if (!value) return prev ? setAttribute(node, \"style\") : value;\n const nodeStyle = node.style;\n if (typeof value === \"string\") return (nodeStyle.cssText = value);\n typeof prev === \"string\" && (nodeStyle.cssText = prev = undefined);\n prev || (prev = {});\n value || (value = {});\n let v, s;\n for (s in prev) {\n value[s] == null && nodeStyle.removeProperty(s);\n delete prev[s];\n }\n for (s in value) {\n v = value[s];\n if (v !== prev[s]) {\n nodeStyle.setProperty(s, v);\n prev[s] = v;\n }\n }\n return prev;\n}\nfunction spread(node, props = {}, isSVG, skipChildren) {\n const prevProps = {};\n if (!skipChildren) {\n createRenderEffect(\n () => (prevProps.children = insertExpression(node, props.children, prevProps.children))\n );\n }\n createRenderEffect(() => props.ref && props.ref(node));\n createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));\n return prevProps;\n}\nfunction dynamicProperty(props, key) {\n const src = props[key];\n Object.defineProperty(props, key, {\n get() {\n return src();\n },\n enumerable: true\n });\n return props;\n}\nfunction use(fn, element, arg) {\n return untrack(() => fn(element, arg));\n}\nfunction insert(parent, accessor, marker, initial) {\n if (marker !== undefined && !initial) initial = [];\n if (typeof accessor !== \"function\") return insertExpression(parent, accessor, initial, marker);\n createRenderEffect(current => insertExpression(parent, accessor(), current, marker), initial);\n}\nfunction assign(node, props, isSVG, skipChildren, prevProps = {}, skipRef = false) {\n props || (props = {});\n for (const prop in prevProps) {\n if (!(prop in props)) {\n if (prop === \"children\") continue;\n prevProps[prop] = assignProp(node, prop, null, prevProps[prop], isSVG, skipRef);\n }\n }\n for (const prop in props) {\n if (prop === \"children\") {\n if (!skipChildren) insertExpression(node, props.children);\n continue;\n }\n const value = props[prop];\n prevProps[prop] = assignProp(node, prop, value, prevProps[prop], isSVG, skipRef);\n }\n}\nfunction hydrate$1(code, element, options = {}) {\n sharedConfig.completed = globalThis._$HY.completed;\n sharedConfig.events = globalThis._$HY.events;\n sharedConfig.load = id => globalThis._$HY.r[id];\n sharedConfig.has = id => id in globalThis._$HY.r;\n sharedConfig.gather = root => gatherHydratable(element, root);\n sharedConfig.registry = new Map();\n sharedConfig.context = {\n id: options.renderId || \"\",\n count: 0\n };\n gatherHydratable(element, options.renderId);\n const dispose = render(code, element, [...element.childNodes], options);\n sharedConfig.context = null;\n return dispose;\n}\nfunction getNextElement(template) {\n let node, key;\n if (!sharedConfig.context || !(node = sharedConfig.registry.get((key = getHydrationKey())))) {\n return template();\n }\n if (sharedConfig.completed) sharedConfig.completed.add(node);\n sharedConfig.registry.delete(key);\n return node;\n}\nfunction getNextMatch(el, nodeName) {\n while (el && el.localName !== nodeName) el = el.nextSibling;\n return el;\n}\nfunction getNextMarker(start) {\n let end = start,\n count = 0,\n current = [];\n if (sharedConfig.context) {\n while (end) {\n if (end.nodeType === 8) {\n const v = end.nodeValue;\n if (v === \"$\") count++;\n else if (v === \"/\") {\n if (count === 0) return [end, current];\n count--;\n }\n }\n current.push(end);\n end = end.nextSibling;\n }\n }\n return [end, current];\n}\nfunction runHydrationEvents() {\n if (sharedConfig.events && !sharedConfig.events.queued) {\n queueMicrotask(() => {\n const { completed, events } = sharedConfig;\n events.queued = false;\n while (events.length) {\n const [el, e] = events[0];\n if (!completed.has(el)) return;\n eventHandler(e);\n events.shift();\n }\n });\n sharedConfig.events.queued = true;\n }\n}\nfunction toPropertyName(name) {\n return name.toLowerCase().replace(/-([a-z])/g, (_, w) => w.toUpperCase());\n}\nfunction toggleClassKey(node, key, value) {\n const classNames = key.trim().split(/\\s+/);\n for (let i = 0, nameLen = classNames.length; i < nameLen; i++)\n node.classList.toggle(classNames[i], value);\n}\nfunction assignProp(node, prop, value, prev, isSVG, skipRef) {\n let isCE, isProp, isChildProp, propAlias, forceProp;\n if (prop === \"style\") return style(node, value, prev);\n if (prop === \"classList\") return classList(node, value, prev);\n if (value === prev) return prev;\n if (prop === \"ref\") {\n if (!skipRef) value(node);\n } else if (prop.slice(0, 3) === \"on:\") {\n const e = prop.slice(3);\n prev && node.removeEventListener(e, prev);\n value && node.addEventListener(e, value);\n } else if (prop.slice(0, 10) === \"oncapture:\") {\n const e = prop.slice(10);\n prev && node.removeEventListener(e, prev, true);\n value && node.addEventListener(e, value, true);\n } else if (prop.slice(0, 2) === \"on\") {\n const name = prop.slice(2).toLowerCase();\n const delegate = DelegatedEvents.has(name);\n if (!delegate && prev) {\n const h = Array.isArray(prev) ? prev[0] : prev;\n node.removeEventListener(name, h);\n }\n if (delegate || value) {\n addEventListener(node, name, value, delegate);\n delegate && delegateEvents([name]);\n }\n } else if (prop.slice(0, 5) === \"attr:\") {\n setAttribute(node, prop.slice(5), value);\n } else if (\n (forceProp = prop.slice(0, 5) === \"prop:\") ||\n (isChildProp = ChildProperties.has(prop)) ||\n (!isSVG &&\n ((propAlias = getPropAlias(prop, node.tagName)) || (isProp = Properties.has(prop)))) ||\n (isCE = node.nodeName.includes(\"-\"))\n ) {\n if (forceProp) {\n prop = prop.slice(5);\n isProp = true;\n } else if (!!sharedConfig.context && node.isConnected) return value;\n if (prop === \"class\" || prop === \"className\") className(node, value);\n else if (isCE && !isProp && !isChildProp) node[toPropertyName(prop)] = value;\n else node[propAlias || prop] = value;\n } else {\n const ns = isSVG && prop.indexOf(\":\") > -1 && SVGNamespace[prop.split(\":\")[0]];\n if (ns) setAttributeNS(node, ns, prop, value);\n else setAttribute(node, Aliases[prop] || prop, value);\n }\n return value;\n}\nfunction eventHandler(e) {\n const key = `$$${e.type}`;\n let node = (e.composedPath && e.composedPath()[0]) || e.target;\n if (e.target !== node) {\n Object.defineProperty(e, \"target\", {\n configurable: true,\n value: node\n });\n }\n Object.defineProperty(e, \"currentTarget\", {\n configurable: true,\n get() {\n return node || document;\n }\n });\n if (sharedConfig.registry && !sharedConfig.done) sharedConfig.done = _$HY.done = true;\n while (node) {\n const handler = node[key];\n if (handler && !node.disabled) {\n const data = node[`${key}Data`];\n data !== undefined ? handler.call(node, data, e) : handler.call(node, e);\n if (e.cancelBubble) return;\n }\n node = node._$host || node.parentNode || node.host;\n }\n}\nfunction insertExpression(parent, value, current, marker, unwrapArray) {\n const hydrating = !!sharedConfig.context && parent.isConnected;\n if (hydrating) {\n !current && (current = [...parent.childNodes]);\n let cleaned = [];\n for (let i = 0; i < current.length; i++) {\n const node = current[i];\n if (node.nodeType === 8 && node.data.slice(0, 2) === \"!$\") node.remove();\n else cleaned.push(node);\n }\n current = cleaned;\n }\n while (typeof current === \"function\") current = current();\n if (value === current) return current;\n const t = typeof value,\n multi = marker !== undefined;\n parent = (multi && current[0] && current[0].parentNode) || parent;\n if (t === \"string\" || t === \"number\") {\n if (hydrating) return current;\n if (t === \"number\") value = value.toString();\n if (multi) {\n let node = current[0];\n if (node && node.nodeType === 3) {\n node.data !== value && (node.data = value);\n } else node = document.createTextNode(value);\n current = cleanChildren(parent, current, marker, node);\n } else {\n if (current !== \"\" && typeof current === \"string\") {\n current = parent.firstChild.data = value;\n } else current = parent.textContent = value;\n }\n } else if (value == null || t === \"boolean\") {\n if (hydrating) return current;\n current = cleanChildren(parent, current, marker);\n } else if (t === \"function\") {\n createRenderEffect(() => {\n let v = value();\n while (typeof v === \"function\") v = v();\n current = insertExpression(parent, v, current, marker);\n });\n return () => current;\n } else if (Array.isArray(value)) {\n const array = [];\n const currentArray = current && Array.isArray(current);\n if (normalizeIncomingArray(array, value, current, unwrapArray)) {\n createRenderEffect(() => (current = insertExpression(parent, array, current, marker, true)));\n return () => current;\n }\n if (hydrating) {\n if (!array.length) return current;\n if (marker === undefined) return [...parent.childNodes];\n let node = array[0];\n let nodes = [node];\n while ((node = node.nextSibling) !== marker) nodes.push(node);\n return (current = nodes);\n }\n if (array.length === 0) {\n current = cleanChildren(parent, current, marker);\n if (multi) return current;\n } else if (currentArray) {\n if (current.length === 0) {\n appendNodes(parent, array, marker);\n } else reconcileArrays(parent, current, array);\n } else {\n current && cleanChildren(parent);\n appendNodes(parent, array);\n }\n current = array;\n } else if (value.nodeType) {\n if (hydrating && value.parentNode) return (current = multi ? [value] : value);\n if (Array.isArray(current)) {\n if (multi) return (current = cleanChildren(parent, current, marker, value));\n cleanChildren(parent, current, null, value);\n } else if (current == null || current === \"\" || !parent.firstChild) {\n parent.appendChild(value);\n } else parent.replaceChild(value, parent.firstChild);\n current = value;\n } else;\n return current;\n}\nfunction normalizeIncomingArray(normalized, array, current, unwrap) {\n let dynamic = false;\n for (let i = 0, len = array.length; i < len; i++) {\n let item = array[i],\n prev = current && current[normalized.length],\n t;\n if (item == null || item === true || item === false);\n else if ((t = typeof item) === \"object\" && item.nodeType) {\n normalized.push(item);\n } else if (Array.isArray(item)) {\n dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic;\n } else if (t === \"function\") {\n if (unwrap) {\n while (typeof item === \"function\") item = item();\n dynamic =\n normalizeIncomingArray(\n normalized,\n Array.isArray(item) ? item : [item],\n Array.isArray(prev) ? prev : [prev]\n ) || dynamic;\n } else {\n normalized.push(item);\n dynamic = true;\n }\n } else {\n const value = String(item);\n if (prev && prev.nodeType === 3 && prev.data === value) normalized.push(prev);\n else normalized.push(document.createTextNode(value));\n }\n }\n return dynamic;\n}\nfunction appendNodes(parent, array, marker = null) {\n for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker);\n}\nfunction cleanChildren(parent, current, marker, replacement) {\n if (marker === undefined) return (parent.textContent = \"\");\n const node = replacement || document.createTextNode(\"\");\n if (current.length) {\n let inserted = false;\n for (let i = current.length - 1; i >= 0; i--) {\n const el = current[i];\n if (node !== el) {\n const isParent = el.parentNode === parent;\n if (!inserted && !i)\n isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);\n else isParent && el.remove();\n } else inserted = true;\n }\n } else parent.insertBefore(node, marker);\n return [node];\n}\nfunction gatherHydratable(element, root) {\n const templates = element.querySelectorAll(`*[data-hk]`);\n for (let i = 0; i < templates.length; i++) {\n const node = templates[i];\n const key = node.getAttribute(\"data-hk\");\n if ((!root || key.startsWith(root)) && !sharedConfig.registry.has(key))\n sharedConfig.registry.set(key, node);\n }\n}\nfunction getHydrationKey() {\n const hydrate = sharedConfig.context;\n return `${hydrate.id}${hydrate.count++}`;\n}\nfunction NoHydration(props) {\n return sharedConfig.context ? undefined : props.children;\n}\nfunction Hydration(props) {\n return props.children;\n}\nconst voidFn = () => undefined;\nconst RequestContext = Symbol();\nfunction innerHTML(parent, content) {\n !sharedConfig.context && (parent.innerHTML = content);\n}\n\nfunction throwInBrowser(func) {\n const err = new Error(`${func.name} is not supported in the browser, returning undefined`);\n console.error(err);\n}\nfunction renderToString(fn, options) {\n throwInBrowser(renderToString);\n}\nfunction renderToStringAsync(fn, options) {\n throwInBrowser(renderToStringAsync);\n}\nfunction renderToStream(fn, options) {\n throwInBrowser(renderToStream);\n}\nfunction ssr(template, ...nodes) {}\nfunction ssrElement(name, props, children, needsId) {}\nfunction ssrClassList(value) {}\nfunction ssrStyle(value) {}\nfunction ssrAttribute(key, value) {}\nfunction ssrHydrationKey() {}\nfunction resolveSSRNode(node) {}\nfunction escape(html) {}\nfunction ssrSpread(props, isSVG, skipChildren) {}\n\nconst isServer = false;\nconst isDev = false;\nconst SVG_NAMESPACE = \"http://www.w3.org/2000/svg\";\nfunction createElement(tagName, isSVG = false) {\n return isSVG ? document.createElementNS(SVG_NAMESPACE, tagName) : document.createElement(tagName);\n}\nconst hydrate = (...args) => {\n enableHydration();\n return hydrate$1(...args);\n};\nfunction Portal(props) {\n const { useShadow } = props,\n marker = document.createTextNode(\"\"),\n mount = () => props.mount || document.body,\n owner = getOwner();\n let content;\n let hydrating = !!sharedConfig.context;\n createEffect(\n () => {\n if (hydrating) getOwner().user = hydrating = false;\n content || (content = runWithOwner(owner, () => createMemo(() => props.children)));\n const el = mount();\n if (el instanceof HTMLHeadElement) {\n const [clean, setClean] = createSignal(false);\n const cleanup = () => setClean(true);\n createRoot(dispose => insert(el, () => (!clean() ? content() : dispose()), null));\n onCleanup(cleanup);\n } else {\n const container = createElement(props.isSVG ? \"g\" : \"div\", props.isSVG),\n renderRoot =\n useShadow && container.attachShadow\n ? container.attachShadow({\n mode: \"open\"\n })\n : container;\n Object.defineProperty(container, \"_$host\", {\n get() {\n return marker.parentNode;\n },\n configurable: true\n });\n insert(renderRoot, content);\n el.appendChild(container);\n props.ref && props.ref(container);\n onCleanup(() => el.removeChild(container));\n }\n },\n undefined,\n {\n render: !hydrating\n }\n );\n return marker;\n}\nfunction Dynamic(props) {\n const [p, others] = splitProps(props, [\"component\"]);\n const cached = createMemo(() => p.component);\n return createMemo(() => {\n const component = cached();\n switch (typeof component) {\n case \"function\":\n return untrack(() => component(others));\n case \"string\":\n const isSvg = SVGElements.has(component);\n const el = sharedConfig.context ? getNextElement() : createElement(component, isSvg);\n spread(el, others, isSvg);\n return el;\n }\n });\n}\n\nexport {\n Aliases,\n voidFn as Assets,\n ChildProperties,\n DOMElements,\n DelegatedEvents,\n Dynamic,\n Hydration,\n voidFn as HydrationScript,\n NoHydration,\n Portal,\n Properties,\n RequestContext,\n SVGElements,\n SVGNamespace,\n addEventListener,\n assign,\n classList,\n className,\n clearDelegatedEvents,\n delegateEvents,\n dynamicProperty,\n escape,\n voidFn as generateHydrationScript,\n voidFn as getAssets,\n getHydrationKey,\n getNextElement,\n getNextMarker,\n getNextMatch,\n getPropAlias,\n voidFn as getRequestEvent,\n hydrate,\n innerHTML,\n insert,\n isDev,\n isServer,\n render,\n renderToStream,\n renderToString,\n renderToStringAsync,\n resolveSSRNode,\n runHydrationEvents,\n setAttribute,\n setAttributeNS,\n setProperty,\n spread,\n ssr,\n ssrAttribute,\n ssrClassList,\n ssrElement,\n ssrHydrationKey,\n ssrSpread,\n ssrStyle,\n style,\n template,\n use,\n voidFn as useAssets\n};\n","import { isServer } from \"solid-js/web\";\nexport function createBeforeLeave() {\n let listeners = new Set();\n function subscribe(listener) {\n listeners.add(listener);\n return () => listeners.delete(listener);\n }\n let ignore = false;\n function confirm(to, options) {\n if (ignore)\n return !(ignore = false);\n const e = {\n to,\n options,\n defaultPrevented: false,\n preventDefault: () => (e.defaultPrevented = true)\n };\n for (const l of listeners)\n l.listener({\n ...e,\n from: l.location,\n retry: (force) => {\n force && (ignore = true);\n l.navigate(to, { ...options, resolve: false });\n }\n });\n return !e.defaultPrevented;\n }\n return {\n subscribe,\n confirm\n };\n}\n// The following supports browser initiated blocking (eg back/forward)\nlet depth;\nexport function saveCurrentDepth() {\n if (!window.history.state || window.history.state._depth == null) {\n window.history.replaceState({ ...window.history.state, _depth: window.history.length - 1 }, \"\");\n }\n depth = window.history.state._depth;\n}\nif (!isServer) {\n saveCurrentDepth();\n}\nexport function keepDepth(state) {\n return {\n ...state,\n _depth: window.history.state && window.history.state._depth\n };\n}\nexport function notifyIfNotBlocked(notify, block) {\n let ignore = false;\n return () => {\n const prevDepth = depth;\n saveCurrentDepth();\n const delta = prevDepth == null ? null : depth - prevDepth;\n if (ignore) {\n ignore = false;\n return;\n }\n if (delta && block(delta)) {\n ignore = true;\n window.history.go(-delta);\n }\n else {\n notify();\n }\n };\n}\n","import { createMemo, getOwner, runWithOwner } from \"solid-js\";\nconst hasSchemeRegex = /^(?:[a-z0-9]+:)?\\/\\//i;\nconst trimPathRegex = /^\\/+|(\\/)\\/+$/g;\nexport const mockBase = \"http://sr\";\nexport function normalizePath(path, omitSlash = false) {\n const s = path.replace(trimPathRegex, \"$1\");\n return s ? (omitSlash || /^[?#]/.test(s) ? s : \"/\" + s) : \"\";\n}\nexport function resolvePath(base, path, from) {\n if (hasSchemeRegex.test(path)) {\n return undefined;\n }\n const basePath = normalizePath(base);\n const fromPath = from && normalizePath(from);\n let result = \"\";\n if (!fromPath || path.startsWith(\"/\")) {\n result = basePath;\n }\n else if (fromPath.toLowerCase().indexOf(basePath.toLowerCase()) !== 0) {\n result = basePath + fromPath;\n }\n else {\n result = fromPath;\n }\n return (result || \"/\") + normalizePath(path, !result);\n}\nexport function invariant(value, message) {\n if (value == null) {\n throw new Error(message);\n }\n return value;\n}\nexport function joinPaths(from, to) {\n return normalizePath(from).replace(/\\/*(\\*.*)?$/g, \"\") + normalizePath(to);\n}\nexport function extractSearchParams(url) {\n const params = {};\n url.searchParams.forEach((value, key) => {\n params[key] = value;\n });\n return params;\n}\nexport function createMatcher(path, partial, matchFilters) {\n const [pattern, splat] = path.split(\"/*\", 2);\n const segments = pattern.split(\"/\").filter(Boolean);\n const len = segments.length;\n return (location) => {\n const locSegments = location.split(\"/\").filter(Boolean);\n const lenDiff = locSegments.length - len;\n if (lenDiff < 0 || (lenDiff > 0 && splat === undefined && !partial)) {\n return null;\n }\n const match = {\n path: len ? \"\" : \"/\",\n params: {}\n };\n const matchFilter = (s) => matchFilters === undefined ? undefined : matchFilters[s];\n for (let i = 0; i < len; i++) {\n const segment = segments[i];\n const locSegment = locSegments[i];\n const dynamic = segment[0] === \":\";\n const key = dynamic ? segment.slice(1) : segment;\n if (dynamic && matchSegment(locSegment, matchFilter(key))) {\n match.params[key] = locSegment;\n }\n else if (dynamic || !matchSegment(locSegment, segment)) {\n return null;\n }\n match.path += `/${locSegment}`;\n }\n if (splat) {\n const remainder = lenDiff ? locSegments.slice(-lenDiff).join(\"/\") : \"\";\n if (matchSegment(remainder, matchFilter(splat))) {\n match.params[splat] = remainder;\n }\n else {\n return null;\n }\n }\n return match;\n };\n}\nfunction matchSegment(input, filter) {\n const isEqual = (s) => s.localeCompare(input, undefined, { sensitivity: \"base\" }) === 0;\n if (filter === undefined) {\n return true;\n }\n else if (typeof filter === \"string\") {\n return isEqual(filter);\n }\n else if (typeof filter === \"function\") {\n return filter(input);\n }\n else if (Array.isArray(filter)) {\n return filter.some(isEqual);\n }\n else if (filter instanceof RegExp) {\n return filter.test(input);\n }\n return false;\n}\nexport function scoreRoute(route) {\n const [pattern, splat] = route.pattern.split(\"/*\", 2);\n const segments = pattern.split(\"/\").filter(Boolean);\n return segments.reduce((score, segment) => score + (segment.startsWith(\":\") ? 2 : 3), segments.length - (splat === undefined ? 0 : 1));\n}\nexport function createMemoObject(fn) {\n const map = new Map();\n const owner = getOwner();\n return new Proxy({}, {\n get(_, property) {\n if (!map.has(property)) {\n runWithOwner(owner, () => map.set(property, createMemo(() => fn()[property])));\n }\n return map.get(property)();\n },\n getOwnPropertyDescriptor() {\n return {\n enumerable: true,\n configurable: true\n };\n },\n ownKeys() {\n return Reflect.ownKeys(fn());\n }\n });\n}\nexport function mergeSearchString(search, params) {\n const merged = new URLSearchParams(search);\n Object.entries(params).forEach(([key, value]) => {\n if (value == null || value === \"\") {\n merged.delete(key);\n }\n else {\n merged.set(key, String(value));\n }\n });\n const s = merged.toString();\n return s ? `?${s}` : \"\";\n}\nexport function expandOptionals(pattern) {\n let match = /(\\/?\\:[^\\/]+)\\?/.exec(pattern);\n if (!match)\n return [pattern];\n let prefix = pattern.slice(0, match.index);\n let suffix = pattern.slice(match.index + match[0].length);\n const prefixes = [prefix, (prefix += match[1])];\n // This section handles adjacent optional params. We don't actually want all permuations since\n // that will lead to equivalent routes which have the same number of params. For example\n // `/:a?/:b?/:c`? only has the unique expansion: `/`, `/:a`, `/:a/:b`, `/:a/:b/:c` and we can\n // discard `/:b`, `/:c`, `/:b/:c` by building them up in order and not recursing. This also helps\n // ensure predictability where earlier params have precidence.\n while ((match = /^(\\/\\:[^\\/]+)\\?/.exec(suffix))) {\n prefixes.push((prefix += match[1]));\n suffix = suffix.slice(match[0].length);\n }\n return expandOptionals(suffix).reduce((results, expansion) => [...results, ...prefixes.map(p => p + expansion)], []);\n}\n","import { runWithOwner } from \"solid-js\";\nimport { createComponent, createContext, createMemo, createRenderEffect, createSignal, on, onCleanup, untrack, useContext, startTransition, resetErrorBoundaries } from \"solid-js\";\nimport { isServer, getRequestEvent } from \"solid-js/web\";\nimport { createBeforeLeave } from \"./lifecycle.js\";\nimport { mockBase, createMemoObject, extractSearchParams, invariant, resolvePath, createMatcher, joinPaths, scoreRoute, mergeSearchString, expandOptionals } from \"./utils.js\";\nconst MAX_REDIRECTS = 100;\nexport const RouterContextObj = createContext();\nexport const RouteContextObj = createContext();\nexport const useRouter = () => invariant(useContext(RouterContextObj), \" and 'use' router primitives can be only used inside a Route.\");\nlet TempRoute;\nexport const useRoute = () => TempRoute || useContext(RouteContextObj) || useRouter().base;\nexport const useResolvedPath = (path) => {\n const route = useRoute();\n return createMemo(() => route.resolvePath(path()));\n};\nexport const useHref = (to) => {\n const router = useRouter();\n return createMemo(() => {\n const to_ = to();\n return to_ !== undefined ? router.renderPath(to_) : to_;\n });\n};\nexport const useNavigate = () => useRouter().navigatorFactory();\nexport const useLocation = () => useRouter().location;\nexport const useIsRouting = () => useRouter().isRouting;\nexport const useMatch = (path, matchFilters) => {\n const location = useLocation();\n const matchers = createMemo(() => expandOptionals(path()).map(path => createMatcher(path, undefined, matchFilters)));\n return createMemo(() => {\n for (const matcher of matchers()) {\n const match = matcher(location.pathname);\n if (match)\n return match;\n }\n });\n};\nexport const useParams = () => useRouter().params;\nexport const useSearchParams = () => {\n const location = useLocation();\n const navigate = useNavigate();\n const setSearchParams = (params, options) => {\n const searchString = untrack(() => location.pathname + mergeSearchString(location.search, params) + location.hash);\n navigate(searchString, {\n scroll: false,\n resolve: false,\n ...options\n });\n };\n return [location.query, setSearchParams];\n};\nexport const useBeforeLeave = (listener) => {\n const s = useRouter().beforeLeave.subscribe({\n listener,\n location: useLocation(),\n navigate: useNavigate()\n });\n onCleanup(s);\n};\nexport function createRoutes(routeDef, base = \"\") {\n const { component, load, children, info } = routeDef;\n const isLeaf = !children || (Array.isArray(children) && !children.length);\n const shared = {\n key: routeDef,\n component,\n load,\n info\n };\n return asArray(routeDef.path).reduce((acc, path) => {\n for (const originalPath of expandOptionals(path)) {\n const path = joinPaths(base, originalPath);\n let pattern = isLeaf ? path : path.split(\"/*\", 1)[0];\n pattern = pattern\n .split(\"/\")\n .map((s) => {\n return s.startsWith(\":\") || s.startsWith(\"*\") ? s : encodeURIComponent(s);\n })\n .join(\"/\");\n acc.push({\n ...shared,\n originalPath,\n pattern,\n matcher: createMatcher(pattern, !isLeaf, routeDef.matchFilters)\n });\n }\n return acc;\n }, []);\n}\nexport function createBranch(routes, index = 0) {\n return {\n routes,\n score: scoreRoute(routes[routes.length - 1]) * 10000 - index,\n matcher(location) {\n const matches = [];\n for (let i = routes.length - 1; i >= 0; i--) {\n const route = routes[i];\n const match = route.matcher(location);\n if (!match) {\n return null;\n }\n matches.unshift({\n ...match,\n route\n });\n }\n return matches;\n }\n };\n}\nfunction asArray(value) {\n return Array.isArray(value) ? value : [value];\n}\nexport function createBranches(routeDef, base = \"\", stack = [], branches = []) {\n const routeDefs = asArray(routeDef);\n for (let i = 0, len = routeDefs.length; i < len; i++) {\n const def = routeDefs[i];\n if (def && typeof def === \"object\") {\n if (!def.hasOwnProperty(\"path\"))\n def.path = \"\";\n const routes = createRoutes(def, base);\n for (const route of routes) {\n stack.push(route);\n const isEmptyArray = Array.isArray(def.children) && def.children.length === 0;\n if (def.children && !isEmptyArray) {\n createBranches(def.children, route.pattern, stack, branches);\n }\n else {\n const branch = createBranch([...stack], branches.length);\n branches.push(branch);\n }\n stack.pop();\n }\n }\n }\n // Stack will be empty on final return\n return stack.length ? branches : branches.sort((a, b) => b.score - a.score);\n}\nexport function getRouteMatches(branches, location) {\n for (let i = 0, len = branches.length; i < len; i++) {\n const match = branches[i].matcher(location);\n if (match) {\n return match;\n }\n }\n return [];\n}\nexport function createLocation(path, state) {\n const origin = new URL(mockBase);\n const url = createMemo(prev => {\n const path_ = path();\n try {\n return new URL(path_, origin);\n }\n catch (err) {\n console.error(`Invalid path ${path_}`);\n return prev;\n }\n }, origin, {\n equals: (a, b) => a.href === b.href\n });\n const pathname = createMemo(() => url().pathname);\n const search = createMemo(() => url().search, true);\n const hash = createMemo(() => url().hash);\n const key = () => \"\";\n return {\n get pathname() {\n return pathname();\n },\n get search() {\n return search();\n },\n get hash() {\n return hash();\n },\n get state() {\n return state();\n },\n get key() {\n return key();\n },\n query: createMemoObject(on(search, () => extractSearchParams(url())))\n };\n}\nlet intent;\nexport function getIntent() {\n return intent;\n}\nexport function createRouterContext(integration, branches, getContext, options = {}) {\n const { signal: [source, setSource], utils = {} } = integration;\n const parsePath = utils.parsePath || (p => p);\n const renderPath = utils.renderPath || (p => p);\n const beforeLeave = utils.beforeLeave || createBeforeLeave();\n const basePath = resolvePath(\"\", options.base || \"\");\n if (basePath === undefined) {\n throw new Error(`${basePath} is not a valid base path`);\n }\n else if (basePath && !source().value) {\n setSource({ value: basePath, replace: true, scroll: false });\n }\n const [isRouting, setIsRouting] = createSignal(false);\n const start = async (callback) => {\n setIsRouting(true);\n try {\n await startTransition(callback);\n }\n finally {\n setIsRouting(false);\n }\n };\n const [reference, setReference] = createSignal(source().value);\n const [state, setState] = createSignal(source().state);\n const location = createLocation(reference, state);\n const referrers = [];\n const submissions = createSignal(isServer ? initFromFlash() : []);\n const matches = createMemo(() => getRouteMatches(branches(), location.pathname));\n const params = createMemoObject(() => {\n const m = matches();\n const params = {};\n for (let i = 0; i < m.length; i++) {\n Object.assign(params, m[i].params);\n }\n return params;\n });\n const baseRoute = {\n pattern: basePath,\n path: () => basePath,\n outlet: () => null,\n resolvePath(to) {\n return resolvePath(basePath, to);\n }\n };\n createRenderEffect(() => {\n const { value, state } = source();\n // Untrack this whole block so `start` doesn't cause Solid's Listener to be preserved\n untrack(() => {\n if (value !== reference()) {\n start(() => {\n intent = \"native\";\n setReference(value);\n setState(state);\n resetErrorBoundaries();\n submissions[1]([]);\n }).then(() => {\n intent = undefined;\n });\n }\n });\n });\n return {\n base: baseRoute,\n location,\n params,\n isRouting,\n renderPath,\n parsePath,\n navigatorFactory,\n matches,\n beforeLeave,\n preloadRoute,\n singleFlight: options.singleFlight === undefined ? true : options.singleFlight,\n submissions\n };\n function navigateFromRoute(route, to, options) {\n // Untrack in case someone navigates in an effect - don't want to track `reference` or route paths\n untrack(() => {\n if (typeof to === \"number\") {\n if (!to) {\n // A delta of 0 means stay at the current location, so it is ignored\n }\n else if (utils.go) {\n utils.go(to);\n }\n else {\n console.warn(\"Router integration does not support relative routing\");\n }\n return;\n }\n const { replace, resolve, scroll, state: nextState } = {\n replace: false,\n resolve: true,\n scroll: true,\n ...options\n };\n const resolvedTo = resolve ? route.resolvePath(to) : resolvePath(\"\", to);\n if (resolvedTo === undefined) {\n throw new Error(`Path '${to}' is not a routable path`);\n }\n else if (referrers.length >= MAX_REDIRECTS) {\n throw new Error(\"Too many redirects\");\n }\n const current = reference();\n if (resolvedTo !== current || nextState !== state()) {\n if (isServer) {\n const e = getRequestEvent();\n e && (e.response = { status: 302, headers: new Headers({ Location: resolvedTo }) });\n setSource({ value: resolvedTo, replace, scroll, state: nextState });\n }\n else if (beforeLeave.confirm(resolvedTo, options)) {\n const len = referrers.push({ value: current, replace, scroll, state: state() });\n start(() => {\n intent = \"navigate\";\n setReference(resolvedTo);\n setState(nextState);\n resetErrorBoundaries();\n submissions[1]([]);\n }).then(() => {\n if (referrers.length === len) {\n intent = undefined;\n navigateEnd({\n value: resolvedTo,\n state: nextState\n });\n }\n });\n }\n }\n });\n }\n function navigatorFactory(route) {\n // Workaround for vite issue (https://github.com/vitejs/vite/issues/3803)\n route = route || useContext(RouteContextObj) || baseRoute;\n return (to, options) => navigateFromRoute(route, to, options);\n }\n function navigateEnd(next) {\n const first = referrers[0];\n if (first) {\n if (next.value !== first.value || next.state !== first.state) {\n setSource({\n ...next,\n replace: first.replace,\n scroll: first.scroll\n });\n }\n referrers.length = 0;\n }\n }\n function preloadRoute(url, preloadData) {\n const matches = getRouteMatches(branches(), url.pathname);\n const prevIntent = intent;\n intent = \"preload\";\n for (let match in matches) {\n const { route, params } = matches[match];\n route.component &&\n route.component.preload &&\n route.component.preload();\n const { load } = route;\n preloadData &&\n load &&\n runWithOwner(getContext(), () => load({\n params,\n location: {\n pathname: url.pathname,\n search: url.search,\n hash: url.hash,\n query: extractSearchParams(url),\n state: null,\n key: \"\"\n },\n intent: \"preload\"\n }));\n }\n intent = prevIntent;\n }\n function initFromFlash() {\n const e = getRequestEvent();\n return (e && e.router && e.router.submission\n ? [e.router.submission]\n : []);\n }\n}\nexport function createRouteContext(router, parent, outlet, match) {\n const { base, location, params } = router;\n const { pattern, component, load } = match().route;\n const path = createMemo(() => match().path);\n component &&\n component.preload &&\n component.preload();\n const data = load ? load({ params, location, intent: intent || \"initial\" }) : undefined;\n const route = {\n parent,\n pattern,\n path,\n outlet: () => component\n ? createComponent(component, {\n params,\n location,\n data,\n get children() {\n return outlet();\n }\n })\n : outlet(),\n resolvePath(to) {\n return resolvePath(base.path(), to, path());\n }\n };\n return route;\n}\n","/*@refresh skip*/\nimport { getRequestEvent, isServer } from \"solid-js/web\";\nimport { children, createMemo, createRoot, getOwner, mergeProps, on, Show, untrack } from \"solid-js\";\nimport { createBranches, createRouteContext, createRouterContext, getRouteMatches, RouteContextObj, RouterContextObj } from \"../routing.js\";\nexport const createRouterComponent = (router) => (props) => {\n const { base } = props;\n const routeDefs = children(() => props.children);\n const branches = createMemo(() => createBranches(routeDefs(), props.base || \"\"));\n let context;\n const routerState = createRouterContext(router, branches, () => context, {\n base,\n singleFlight: props.singleFlight\n });\n router.create && router.create(routerState);\n return (\n \n {(context = getOwner()) && null}\n \n \n );\n};\nfunction Root(props) {\n const location = props.routerState.location;\n const params = props.routerState.params;\n const data = createMemo(() => props.load && untrack(() => props.load({ params, location, intent: \"preload\" })));\n return (\n {Root => (\n {props.children}\n )}\n );\n}\nfunction Routes(props) {\n if (isServer) {\n const e = getRequestEvent();\n if (e && e.router && e.router.dataOnly) {\n dataOnly(e, props.routerState, props.branches);\n return;\n }\n e &&\n ((e.router || (e.router = {})).matches ||\n (e.router.matches = props.routerState.matches().map(({ route, path, params }) => ({\n path: route.originalPath,\n pattern: route.pattern,\n match: path,\n params,\n info: route.info\n }))));\n }\n const disposers = [];\n let root;\n const routeStates = createMemo(on(props.routerState.matches, (nextMatches, prevMatches, prev) => {\n let equal = prevMatches && nextMatches.length === prevMatches.length;\n const next = [];\n for (let i = 0, len = nextMatches.length; i < len; i++) {\n const prevMatch = prevMatches && prevMatches[i];\n const nextMatch = nextMatches[i];\n if (prev && prevMatch && nextMatch.route.key === prevMatch.route.key) {\n next[i] = prev[i];\n }\n else {\n equal = false;\n if (disposers[i]) {\n disposers[i]();\n }\n createRoot(dispose => {\n disposers[i] = dispose;\n next[i] = createRouteContext(props.routerState, next[i - 1] || props.routerState.base, createOutlet(() => routeStates()[i + 1]), () => props.routerState.matches()[i]);\n });\n }\n }\n disposers.splice(nextMatches.length).forEach(dispose => dispose());\n if (prev && equal) {\n return prev;\n }\n root = next[0];\n return next;\n }));\n return createOutlet(() => routeStates() && root)();\n}\nconst createOutlet = (child) => {\n return () => (\n {child => {child.outlet()}}\n );\n};\nexport const Route = (props) => {\n const childRoutes = children(() => props.children);\n return mergeProps(props, {\n get children() {\n return childRoutes();\n }\n });\n};\n// for data only mode with single flight mutations\nfunction dataOnly(event, routerState, branches) {\n const url = new URL(event.request.url);\n const prevMatches = getRouteMatches(branches, new URL(event.router.previousUrl || event.request.url).pathname);\n const matches = getRouteMatches(branches, url.pathname);\n for (let match = 0; match < matches.length; match++) {\n if (!prevMatches[match] || matches[match].route !== prevMatches[match].route)\n event.router.dataOnly = true;\n const { route, params } = matches[match];\n route.load &&\n route.load({\n params,\n location: routerState.location,\n intent: \"preload\"\n });\n }\n}\n","import { createSignal, onCleanup } from \"solid-js\";\nimport { createRouterComponent } from \"./components.jsx\";\nfunction intercept([value, setValue], get, set) {\n return [get ? () => get(value()) : value, set ? (v) => setValue(set(v)) : setValue];\n}\nfunction querySelector(selector) {\n if (selector === \"#\") {\n return null;\n }\n // Guard against selector being an invalid CSS selector\n try {\n return document.querySelector(selector);\n }\n catch (e) {\n return null;\n }\n}\nexport function createRouter(config) {\n let ignore = false;\n const wrap = (value) => (typeof value === \"string\" ? { value } : value);\n const signal = intercept(createSignal(wrap(config.get()), { equals: (a, b) => a.value === b.value }), undefined, next => {\n !ignore && config.set(next);\n return next;\n });\n config.init &&\n onCleanup(config.init((value = config.get()) => {\n ignore = true;\n signal[1](wrap(value));\n ignore = false;\n }));\n return createRouterComponent({\n signal,\n create: config.create,\n utils: config.utils\n });\n}\nexport function bindEvent(target, type, handler) {\n target.addEventListener(type, handler);\n return () => target.removeEventListener(type, handler);\n}\nexport function scrollToHash(hash, fallbackTop) {\n const el = querySelector(`#${hash}`);\n if (el) {\n el.scrollIntoView();\n }\n else if (fallbackTop) {\n window.scrollTo(0, 0);\n }\n}\n","import { $TRACK, createMemo, createSignal, onCleanup, getOwner } from \"solid-js\";\nimport { isServer } from \"solid-js/web\";\nimport { useRouter } from \"../routing.js\";\nimport { mockBase } from \"../utils.js\";\nimport { cacheKeyOp, hashKey, revalidate, cache } from \"./cache.js\";\nexport const actions = /* #__PURE__ */ new Map();\nexport function useSubmissions(fn, filter) {\n const router = useRouter();\n const subs = createMemo(() => router.submissions[0]().filter(s => s.url === fn.toString() && (!filter || filter(s.input))));\n return new Proxy([], {\n get(_, property) {\n if (property === $TRACK)\n return subs();\n if (property === \"pending\")\n return subs().some(sub => !sub.result);\n return subs()[property];\n }\n });\n}\nexport function useSubmission(fn, filter) {\n const submissions = useSubmissions(fn, filter);\n return new Proxy({}, {\n get(_, property) {\n return submissions[submissions.length - 1]?.[property];\n }\n });\n}\nexport function useAction(action) {\n const r = useRouter();\n return (...args) => action.apply({ r }, args);\n}\nexport function action(fn, name) {\n function mutate(...variables) {\n const router = this.r;\n const form = this.f;\n const p = (router.singleFlight && fn.withOptions\n ? fn.withOptions({ headers: { \"X-Single-Flight\": \"true\" } })\n : fn)(...variables);\n const [result, setResult] = createSignal();\n let submission;\n function handler(error) {\n return async (res) => {\n const result = await handleResponse(res, error, router.navigatorFactory());\n if (!result)\n return submission.clear();\n setResult(result);\n if (result.error && !form)\n throw result.error;\n return result.data;\n };\n }\n router.submissions[1](s => [\n ...s,\n (submission = {\n input: variables,\n url,\n get result() {\n return result()?.data;\n },\n get error() {\n return result()?.error;\n },\n get pending() {\n return !result();\n },\n clear() {\n router.submissions[1](v => v.filter(i => i.input !== variables));\n },\n retry() {\n setResult(undefined);\n const p = fn(...variables);\n return p.then(handler(), handler(true));\n }\n })\n ]);\n return p.then(handler(), handler(true));\n }\n const url = fn.url ||\n (name && `https://action/${name}`) ||\n (!isServer ? `https://action/${hashString(fn.toString())}` : \"\");\n return toAction(mutate, url);\n}\nfunction toAction(fn, url) {\n fn.toString = () => {\n if (!url)\n throw new Error(\"Client Actions need explicit names if server rendered\");\n return url;\n };\n fn.with = function (...args) {\n const newFn = function (...passedArgs) {\n return fn.call(this, ...args, ...passedArgs);\n };\n const uri = new URL(url, mockBase);\n uri.searchParams.set(\"args\", hashKey(args));\n return toAction(newFn, (uri.origin === \"https://action\" ? uri.origin : \"\") + uri.pathname + uri.search);\n };\n fn.url = url;\n if (!isServer) {\n actions.set(url, fn);\n getOwner() && onCleanup(() => actions.delete(url));\n }\n return fn;\n}\nconst hashString = (s) => s.split(\"\").reduce((a, b) => ((a << 5) - a + b.charCodeAt(0)) | 0, 0);\nasync function handleResponse(response, error, navigate) {\n let data;\n let keys;\n let invalidateKeys;\n if (response instanceof Response) {\n if (response.headers.has(\"X-Revalidate\"))\n keys = invalidateKeys = response.headers.get(\"X-Revalidate\").split(\",\");\n if (response.customBody) {\n data = await response.customBody();\n if (response.headers.has(\"X-Single-Flight\")) {\n keys || (keys = []);\n invalidateKeys || (invalidateKeys = []);\n Object.keys(data).forEach(key => {\n if (key === \"_$value\")\n return;\n keys.push(key);\n cache.set(key, data[key]);\n });\n data = data._$value;\n }\n }\n if (response.headers.has(\"Location\")) {\n const locationUrl = response.headers.get(\"Location\") || \"/\";\n if (locationUrl.startsWith(\"http\")) {\n window.location.href = locationUrl;\n }\n else {\n navigate(locationUrl);\n }\n }\n }\n else if (error)\n return { error: response };\n else\n data = response;\n // invalidate\n cacheKeyOp(invalidateKeys, entry => (entry[0] = 0));\n // trigger revalidation\n await revalidate(keys, false);\n return data != null ? { data } : undefined;\n}\n","import { delegateEvents } from \"solid-js/web\";\nimport { onCleanup } from \"solid-js\";\nimport { actions } from \"./action.js\";\nimport { mockBase } from \"../utils.js\";\nexport function setupNativeEvents(preload = true, explicitLinks = false, actionBase = \"/_server\") {\n return (router) => {\n const basePath = router.base.path();\n const navigateFromRoute = router.navigatorFactory(router.base);\n let preloadTimeout = {};\n function isSvg(el) {\n return el.namespaceURI === \"http://www.w3.org/2000/svg\";\n }\n function handleAnchor(evt) {\n if (evt.defaultPrevented ||\n evt.button !== 0 ||\n evt.metaKey ||\n evt.altKey ||\n evt.ctrlKey ||\n evt.shiftKey)\n return;\n const a = evt\n .composedPath()\n .find(el => el instanceof Node && el.nodeName.toUpperCase() === \"A\");\n if (!a || (explicitLinks && !a.hasAttribute(\"link\")))\n return;\n const svg = isSvg(a);\n const href = svg ? a.href.baseVal : a.href;\n const target = svg ? a.target.baseVal : a.target;\n if (target || (!href && !a.hasAttribute(\"state\")))\n return;\n const rel = (a.getAttribute(\"rel\") || \"\").split(/\\s+/);\n if (a.hasAttribute(\"download\") || (rel && rel.includes(\"external\")))\n return;\n const url = svg ? new URL(href, document.baseURI) : new URL(href);\n if (url.origin !== window.location.origin ||\n (basePath && url.pathname && !url.pathname.toLowerCase().startsWith(basePath.toLowerCase())))\n return;\n return [a, url];\n }\n function handleAnchorClick(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n const to = router.parsePath(url.pathname + url.search + url.hash);\n const state = a.getAttribute(\"state\");\n evt.preventDefault();\n navigateFromRoute(to, {\n resolve: false,\n replace: a.hasAttribute(\"replace\"),\n scroll: !a.hasAttribute(\"noscroll\"),\n state: state && JSON.parse(state)\n });\n }\n function handleAnchorPreload(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n if (!preloadTimeout[url.pathname])\n router.preloadRoute(url, a.getAttribute(\"preload\") !== \"false\");\n }\n function handleAnchorIn(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n if (preloadTimeout[url.pathname])\n return;\n preloadTimeout[url.pathname] = setTimeout(() => {\n router.preloadRoute(url, a.getAttribute(\"preload\") !== \"false\");\n delete preloadTimeout[url.pathname];\n }, 200);\n }\n function handleAnchorOut(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [, url] = res;\n if (preloadTimeout[url.pathname]) {\n clearTimeout(preloadTimeout[url.pathname]);\n delete preloadTimeout[url.pathname];\n }\n }\n function handleFormSubmit(evt) {\n let actionRef = evt.submitter && evt.submitter.hasAttribute(\"formaction\")\n ? evt.submitter.getAttribute(\"formaction\")\n : evt.target.getAttribute(\"action\");\n if (!actionRef)\n return;\n if (!actionRef.startsWith(\"https://action/\")) {\n // normalize server actions\n const url = new URL(actionRef, mockBase);\n actionRef = router.parsePath(url.pathname + url.search);\n if (!actionRef.startsWith(actionBase))\n return;\n }\n if (evt.target.method.toUpperCase() !== \"POST\")\n throw new Error(\"Only POST forms are supported for Actions\");\n const handler = actions.get(actionRef);\n if (handler) {\n evt.preventDefault();\n const data = new FormData(evt.target);\n if (evt.submitter && evt.submitter.name)\n data.append(evt.submitter.name, evt.submitter.value);\n handler.call({ r: router, f: evt.target }, data);\n }\n }\n // ensure delegated event run first\n delegateEvents([\"click\", \"submit\"]);\n document.addEventListener(\"click\", handleAnchorClick);\n if (preload) {\n document.addEventListener(\"mouseover\", handleAnchorIn);\n document.addEventListener(\"mouseout\", handleAnchorOut);\n document.addEventListener(\"focusin\", handleAnchorPreload);\n document.addEventListener(\"touchstart\", handleAnchorPreload);\n }\n document.addEventListener(\"submit\", handleFormSubmit);\n onCleanup(() => {\n document.removeEventListener(\"click\", handleAnchorClick);\n if (preload) {\n document.removeEventListener(\"mouseover\", handleAnchorIn);\n document.removeEventListener(\"mouseout\", handleAnchorOut);\n document.removeEventListener(\"focusin\", handleAnchorPreload);\n document.removeEventListener(\"touchstart\", handleAnchorPreload);\n }\n document.removeEventListener(\"submit\", handleFormSubmit);\n });\n };\n}\n","import { setupNativeEvents } from \"../data/events.js\";\nimport { createRouter, scrollToHash, bindEvent } from \"./createRouter.js\";\nimport { createBeforeLeave, keepDepth, notifyIfNotBlocked, saveCurrentDepth } from \"../lifecycle.js\";\nexport function hashParser(str) {\n const to = str.replace(/^.*?#/, \"\");\n // Hash-only hrefs like `#foo` from plain anchors will come in as `/#foo` whereas a link to\n // `/foo` will be `/#/foo`. Check if the to starts with a `/` and if not append it as a hash\n // to the current path so we can handle these in-page anchors correctly.\n if (!to.startsWith(\"/\")) {\n const [, path = \"/\"] = window.location.hash.split(\"#\", 2);\n return `${path}#${to}`;\n }\n return to;\n}\nexport function HashRouter(props) {\n const getSource = () => window.location.hash.slice(1);\n const beforeLeave = createBeforeLeave();\n return createRouter({\n get: getSource,\n set({ value, replace, scroll, state }) {\n if (replace) {\n window.history.replaceState(keepDepth(state), \"\", \"#\" + value);\n }\n else {\n window.location.hash = value;\n }\n const hashIndex = value.indexOf(\"#\");\n const hash = hashIndex >= 0 ? value.slice(hashIndex + 1) : \"\";\n scrollToHash(hash, scroll);\n saveCurrentDepth();\n },\n init: notify => bindEvent(window, \"hashchange\", notifyIfNotBlocked(notify, delta => !beforeLeave.confirm(delta && delta < 0 ? delta : getSource()))),\n create: setupNativeEvents(props.preload, props.explicitLinks, props.actionBase),\n utils: {\n go: delta => window.history.go(delta),\n renderPath: path => `#${path}`,\n parsePath: hashParser,\n beforeLeave\n }\n })(props);\n}\n","import { DEV, equalFn, untrack, getOwner, onCleanup, createSignal, sharedConfig, onMount } from 'solid-js';\nimport { isServer } from 'solid-js/web';\nexport { isServer } from 'solid-js/web';\n\n// src/index.ts\nvar isClient = !isServer;\nvar isDev = isClient && !!DEV;\nvar isProd = !isDev;\nvar noop = () => void 0;\nvar trueFn = () => true;\nvar falseFn = () => false;\nvar defaultEquals = equalFn;\nvar EQUALS_FALSE_OPTIONS = { equals: false };\nvar INTERNAL_OPTIONS = { internal: true };\nvar ofClass = (v, c) => v instanceof c || v && v.constructor === c;\nfunction isObject(value) {\n return value !== null && (typeof value === \"object\" || typeof value === \"function\");\n}\nvar isNonNullable = (i) => i != null;\nvar filterNonNullable = (arr) => arr.filter(isNonNullable);\nvar compare = (a, b) => a < b ? -1 : a > b ? 1 : 0;\nvar arrayEquals = (a, b) => a === b || a.length === b.length && a.every((e, i) => e === b[i]);\nfunction chain(callbacks) {\n return (...args) => {\n for (const callback of callbacks)\n callback && callback(...args);\n };\n}\nfunction reverseChain(callbacks) {\n return (...args) => {\n for (let i = callbacks.length - 1; i >= 0; i--) {\n const callback = callbacks[i];\n callback && callback(...args);\n }\n };\n}\nvar clamp = (n, min, max) => Math.min(Math.max(n, min), max);\nvar access = (v) => typeof v === \"function\" && !v.length ? v() : v;\nvar asArray = (value) => Array.isArray(value) ? value : value ? [value] : [];\nvar accessArray = (list) => list.map((v) => access(v));\nvar withAccess = (value, fn) => {\n const _value = access(value);\n typeof _value != null && fn(_value);\n};\nvar asAccessor = (v) => typeof v === \"function\" ? v : () => v;\nfunction accessWith(valueOrFn, ...args) {\n return typeof valueOrFn === \"function\" ? valueOrFn(...args) : valueOrFn;\n}\nfunction defer(deps, fn, initialValue) {\n const isArray = Array.isArray(deps);\n let prevInput;\n let shouldDefer = true;\n return (prevValue) => {\n let input;\n if (isArray) {\n input = Array(deps.length);\n for (let i = 0; i < deps.length; i++)\n input[i] = deps[i]();\n } else\n input = deps();\n if (shouldDefer) {\n shouldDefer = false;\n prevInput = input;\n return initialValue;\n }\n const result = untrack(() => fn(input, prevInput, prevValue));\n prevInput = input;\n return result;\n };\n}\nvar entries = Object.entries;\nvar keys = Object.keys;\nvar tryOnCleanup = isDev ? (fn) => getOwner() ? onCleanup(fn) : fn : onCleanup;\nvar createCallbackStack = () => {\n let stack = [];\n const clear = () => stack = [];\n return {\n push: (...callbacks) => stack.push(...callbacks),\n execute(arg0, arg1, arg2, arg3) {\n stack.forEach((cb) => cb(arg0, arg1, arg2, arg3));\n clear();\n },\n clear\n };\n};\nfunction createMicrotask(fn) {\n let calls = 0;\n let args;\n onCleanup(() => calls = 0);\n return (...a) => {\n args = a, calls++;\n queueMicrotask(() => --calls === 0 && fn(...args));\n };\n}\nfunction createHydratableSignal(serverValue, update, options) {\n if (isServer) {\n return createSignal(serverValue, options);\n }\n if (sharedConfig.context) {\n const [state, setState] = createSignal(serverValue, options);\n onMount(() => setState(() => update()));\n return [state, setState];\n }\n return createSignal(update(), options);\n}\nvar createHydrateSignal = createHydratableSignal;\nfunction handleDiffArray(current, prev, handleAdded, handleRemoved) {\n const currLength = current.length;\n const prevLength = prev.length;\n let i = 0;\n if (!prevLength) {\n for (; i < currLength; i++)\n handleAdded(current[i]);\n return;\n }\n if (!currLength) {\n for (; i < prevLength; i++)\n handleRemoved(prev[i]);\n return;\n }\n for (; i < prevLength; i++) {\n if (prev[i] !== current[i])\n break;\n }\n let prevEl;\n let currEl;\n prev = prev.slice(i);\n current = current.slice(i);\n for (prevEl of prev) {\n if (!current.includes(prevEl))\n handleRemoved(prevEl);\n }\n for (currEl of current) {\n if (!prev.includes(currEl))\n handleAdded(currEl);\n }\n}\n\nexport { EQUALS_FALSE_OPTIONS, INTERNAL_OPTIONS, access, accessArray, accessWith, arrayEquals, asAccessor, asArray, chain, clamp, compare, createCallbackStack, createHydratableSignal, createHydrateSignal, createMicrotask, defaultEquals, defer, entries, falseFn, filterNonNullable, handleDiffArray, isClient, isDev, isNonNullable, isObject, isProd, keys, noop, ofClass, reverseChain, trueFn, tryOnCleanup, withAccess };\n","import { tryOnCleanup, entries, createCallbackStack, asArray, access, keys } from '@solid-primitives/utils';\nimport { createEffect, createRenderEffect, createSignal, onCleanup } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/eventListener.ts\nfunction makeEventListener(target, type, handler, options) {\n target.addEventListener(type, handler, options);\n return tryOnCleanup(target.removeEventListener.bind(target, type, handler, options));\n}\nfunction createEventListener(targets, type, handler, options) {\n if (isServer)\n return;\n const attachListeners = () => {\n asArray(access(targets)).forEach((el) => {\n if (el)\n asArray(access(type)).forEach((type2) => makeEventListener(el, type2, handler, options));\n });\n };\n if (typeof targets === \"function\")\n createEffect(attachListeners);\n else\n createRenderEffect(attachListeners);\n}\nfunction createEventSignal(target, type, options) {\n if (isServer) {\n return () => void 0;\n }\n const [lastEvent, setLastEvent] = createSignal();\n createEventListener(target, type, setLastEvent, options);\n return lastEvent;\n}\nvar eventListener = (target, props) => {\n createEffect(() => {\n const [type, handler, options] = props();\n makeEventListener(target, type, handler, options);\n });\n};\nfunction createEventListenerMap(targets, handlersMap, options) {\n if (isServer) {\n return;\n }\n for (const [eventName, handler] of entries(handlersMap)) {\n if (handler)\n createEventListener(targets, eventName, handler, options);\n }\n}\nvar attachPropListeners = (target, props) => {\n keys(props).forEach((attr) => {\n if (attr.startsWith(\"on\") && typeof props[attr] === \"function\")\n makeEventListener(target, attr.substring(2).toLowerCase(), props[attr]);\n });\n};\nvar WindowEventListener = (props) => {\n if (isServer)\n return null;\n attachPropListeners(window, props);\n};\nvar DocumentEventListener = (props) => {\n if (isServer)\n return null;\n attachPropListeners(document, props);\n};\nfunction makeEventListenerStack(target, options) {\n if (isServer) {\n return [() => () => void 0, () => void 0];\n }\n const { push, execute } = createCallbackStack();\n return [\n (type, handler, overwriteOptions) => {\n const clear = makeEventListener(target, type, handler, overwriteOptions ?? options);\n push(clear);\n return clear;\n },\n onCleanup(execute)\n ];\n}\n\n// src/callbackWrappers.ts\nvar preventDefault = (callback) => (e) => {\n e.preventDefault();\n callback(e);\n};\nvar stopPropagation = (callback) => (e) => {\n e.stopPropagation();\n callback(e);\n};\nvar stopImmediatePropagation = (callback) => (e) => {\n e.stopImmediatePropagation();\n callback(e);\n};\n\nexport { DocumentEventListener, WindowEventListener, createEventListener, createEventListenerMap, createEventSignal, eventListener, makeEventListener, makeEventListenerStack, preventDefault, stopImmediatePropagation, stopPropagation };\n","import { getOwner, createRoot, runWithOwner, onCleanup, sharedConfig, createSignal, batch } from 'solid-js';\nimport { isServer } from 'solid-js/web';\nimport { asArray, access, trueFn, noop, createMicrotask } from '@solid-primitives/utils';\n\n// src/index.ts\nfunction createSubRoot(fn, ...owners) {\n if (owners.length === 0)\n owners = [getOwner()];\n return createRoot((dispose) => {\n asArray(access(owners)).forEach(\n (owner) => owner && runWithOwner(owner, onCleanup.bind(void 0, dispose))\n );\n return fn(dispose);\n }, owners[0]);\n}\nvar createBranch = createSubRoot;\nvar createCallback = (callback, owner = getOwner()) => owner ? (...args) => runWithOwner(owner, () => callback(...args)) : callback;\nfunction createDisposable(fn, ...owners) {\n return createSubRoot(\n (dispose) => {\n fn(dispose);\n return dispose;\n },\n ...owners\n );\n}\nfunction createSingletonRoot(factory, detachedOwner = getOwner()) {\n let listeners = 0, value, disposeRoot;\n return () => {\n listeners++;\n onCleanup(() => {\n listeners--;\n queueMicrotask(() => {\n if (!listeners && disposeRoot) {\n disposeRoot();\n disposeRoot = value = void 0;\n }\n });\n });\n if (!disposeRoot) {\n createRoot((dispose) => value = factory(disposeRoot = dispose), detachedOwner);\n }\n return value;\n };\n}\nvar createSharedRoot = createSingletonRoot;\nfunction createHydratableSingletonRoot(factory) {\n const owner = getOwner();\n const singleton = createSingletonRoot(factory, owner);\n return () => isServer || sharedConfig.context ? createRoot(factory, owner) : singleton();\n}\nfunction createRootPool(factory, options = {}) {\n if (isServer) {\n const owner2 = getOwner();\n return (args) => createRoot((dispose) => factory(() => args, trueFn, dispose), owner2);\n }\n let length = 0;\n const { limit = 100 } = options, pool = new Array(limit), owner = getOwner(), mapRoot = factory.length > 1 ? (dispose, [args, set]) => {\n const [active, setA] = createSignal(true);\n const root = {\n dispose,\n set,\n setA,\n active,\n v: factory(args, active, () => disposeRoot(root))\n };\n return root;\n } : (dispose, [args, set]) => ({\n dispose,\n set,\n setA: trueFn,\n active: trueFn,\n v: factory(args, trueFn, noop)\n }), limitPool = createMicrotask(() => {\n if (length > limit) {\n for (let i = limit; i < length; i++) {\n pool[i].dispose();\n pool[i] = void 0;\n }\n length = limit;\n }\n }), cleanupRoot = (root) => {\n if (root.dispose !== noop) {\n pool[length++] = root;\n root.setA(false);\n limitPool();\n }\n }, disposeRoot = (root) => {\n root.dispose();\n root.dispose = noop;\n if (root.active())\n root.setA(false);\n else {\n pool[pool.indexOf(root)] = pool[--length];\n pool[length] = void 0;\n }\n };\n onCleanup(() => {\n for (let i = 0; i < length; i++)\n pool[i].dispose();\n length = 0;\n });\n return (arg) => {\n let root;\n if (length) {\n root = pool[--length];\n pool[length] = void 0;\n batch(() => {\n root.set(() => arg);\n root.setA(true);\n });\n } else\n root = createRoot((dispose) => mapRoot(dispose, createSignal(arg)), owner);\n onCleanup(() => cleanupRoot(root));\n return root.v;\n };\n}\n\nexport { createBranch, createCallback, createDisposable, createHydratableSingletonRoot, createRootPool, createSharedRoot, createSingletonRoot, createSubRoot };\n","import { makeEventListener } from '@solid-primitives/event-listener';\nimport { createSingletonRoot } from '@solid-primitives/rootless';\nimport { arrayEquals } from '@solid-primitives/utils';\nimport { createSignal, untrack, createMemo, createEffect, on } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/index.ts\nfunction equalsKeyHoldSequence(sequence, model) {\n for (let i = sequence.length - 1; i >= 0; i--) {\n const _model = model.slice(0, i + 1);\n if (!arrayEquals(sequence[i], _model))\n return false;\n }\n return true;\n}\nvar useKeyDownEvent = /* @__PURE__ */ createSingletonRoot(\n () => {\n if (isServer) {\n return () => null;\n }\n const [event, setEvent] = createSignal(null);\n makeEventListener(window, \"keydown\", (e) => {\n setEvent(e);\n setTimeout(() => setEvent(null));\n });\n return event;\n }\n);\nvar useKeyDownList = /* @__PURE__ */ createSingletonRoot(() => {\n if (isServer) {\n const keys = () => [];\n keys[0] = keys;\n keys[1] = { event: () => null };\n keys[Symbol.iterator] = function* () {\n yield keys[0];\n yield keys[1];\n };\n return keys;\n }\n const [pressedKeys, setPressedKeys] = createSignal([]), reset = () => setPressedKeys([]), event = useKeyDownEvent();\n makeEventListener(window, \"keydown\", (e) => {\n if (e.repeat || typeof e.key !== \"string\")\n return;\n const key = e.key.toUpperCase(), currentKeys = pressedKeys();\n if (currentKeys.includes(key))\n return;\n const keys = [...currentKeys, key];\n if (currentKeys.length === 0 && key !== \"ALT\" && key !== \"CONTROL\" && key !== \"META\" && key !== \"SHIFT\") {\n if (e.shiftKey)\n keys.unshift(\"SHIFT\");\n if (e.altKey)\n keys.unshift(\"ALT\");\n if (e.ctrlKey)\n keys.unshift(\"CONTROL\");\n if (e.metaKey)\n keys.unshift(\"META\");\n }\n setPressedKeys(keys);\n });\n makeEventListener(window, \"keyup\", (e) => {\n if (typeof e.key !== \"string\")\n return;\n const key = e.key.toUpperCase();\n setPressedKeys((prev) => prev.filter((_key) => _key !== key));\n });\n makeEventListener(window, \"blur\", reset);\n makeEventListener(window, \"contextmenu\", (e) => {\n e.defaultPrevented || reset();\n });\n pressedKeys[0] = pressedKeys;\n pressedKeys[1] = { event };\n pressedKeys[Symbol.iterator] = function* () {\n yield pressedKeys[0];\n yield pressedKeys[1];\n };\n return pressedKeys;\n});\nvar useCurrentlyHeldKey = /* @__PURE__ */ createSingletonRoot(\n () => {\n if (isServer) {\n return () => null;\n }\n const keys = useKeyDownList();\n let prevKeys = untrack(keys);\n return createMemo(() => {\n const _keys = keys();\n const prev = prevKeys;\n prevKeys = _keys;\n if (prev.length === 0 && _keys.length === 1)\n return _keys[0];\n return null;\n });\n }\n);\nvar useKeyDownSequence = /* @__PURE__ */ createSingletonRoot(() => {\n if (isServer) {\n return () => [];\n }\n const keys = useKeyDownList();\n return createMemo((prev) => {\n if (keys().length === 0)\n return [];\n return [...prev, keys()];\n }, []);\n});\nfunction createKeyHold(key, options = {}) {\n if (isServer) {\n return () => false;\n }\n key = key.toUpperCase();\n const { preventDefault = true } = options, event = useKeyDownEvent(), heldKey = useCurrentlyHeldKey();\n return createMemo(() => heldKey() === key && (preventDefault && event()?.preventDefault(), true));\n}\nfunction createShortcut(keys, callback, options = {}) {\n if (isServer || !keys.length) {\n return;\n }\n keys = keys.map((key) => key.toUpperCase());\n const { preventDefault = true } = options, event = useKeyDownEvent(), sequence = useKeyDownSequence();\n let reset = false;\n const handleSequenceWithReset = (sequence2) => {\n if (!sequence2.length)\n return reset = false;\n if (reset)\n return;\n const e = event();\n if (sequence2.length < keys.length) {\n if (equalsKeyHoldSequence(sequence2, keys.slice(0, sequence2.length))) {\n preventDefault && e && e.preventDefault();\n } else {\n reset = true;\n }\n } else {\n reset = true;\n if (equalsKeyHoldSequence(sequence2, keys)) {\n preventDefault && e && e.preventDefault();\n callback(e);\n }\n }\n };\n const handleSequenceWithoutReset = (sequence2) => {\n const last = sequence2.at(-1);\n if (!last)\n return;\n const e = event();\n if (preventDefault && last.length < keys.length) {\n if (arrayEquals(last, keys.slice(0, keys.length - 1))) {\n e && e.preventDefault();\n }\n return;\n }\n if (arrayEquals(last, keys)) {\n const prev = sequence2.at(-2);\n if (!prev || arrayEquals(prev, keys.slice(0, keys.length - 1))) {\n preventDefault && e && e.preventDefault();\n callback(e);\n }\n }\n };\n createEffect(\n on(sequence, options.requireReset ? handleSequenceWithReset : handleSequenceWithoutReset)\n );\n}\n\nexport { createKeyHold, createShortcut, useCurrentlyHeldKey, useKeyDownEvent, useKeyDownList, useKeyDownSequence };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nexport function isFunc(item) {\n return typeof item === 'function';\n}\nexport function isObject(item) {\n return typeof item === 'object';\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function isArray(item) {\n return Array.isArray(item);\n}\nexport function isString(item) {\n return typeof item === 'string';\n}\nexport function isNumber(item) {\n return typeof item === 'number';\n}\nexport function isInteger(item) {\n return Number.isInteger(item);\n}\nexport function keyExists(obj, keys) {\n for (const key of keys) {\n if (key in obj) {\n return true;\n }\n }\n return false;\n}\n/**\n * Asserts a condition is truthy, otherwise throws an error\n *\n * @remarks\n * Useful at the top of functions to ensure certain conditions, arguments and\n * properties are set/met before continuing. When using this function,\n * TypeScript will narrow away falsy types from the condition.\n *\n * @param condition\n * @param message\n * @returns\n */\nexport function assertTruthy(condition, message) {\n if (!condition) {\n throw new Error(message || 'Assertion failed');\n }\n}\n//# sourceMappingURL=utils.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { createEffect, on, createSignal, untrack, } from 'solid-js';\nimport { useKeyDownEvent } from '@solid-primitives/keyboard';\nimport { activeElement, ElementNode } from '@lightningjs/solid';\nimport { isFunc, isArray } from './utils.js';\nconst keyMapEntries = {\n ArrowLeft: 'Left',\n ArrowRight: 'Right',\n ArrowUp: 'Up',\n ArrowDown: 'Down',\n Enter: 'Enter',\n l: 'Last',\n ' ': 'Space',\n Backspace: 'Back',\n Escape: 'Escape',\n};\nconst [focusPath, setFocusPath] = createSignal([]);\nexport { focusPath };\nexport const useFocusManager = (userKeyMap) => {\n const keypressEvent = useKeyDownEvent();\n if (userKeyMap) {\n // Flatten the userKeyMap to a hash\n for (const [key, value] of Object.entries(userKeyMap)) {\n if (isArray(value)) {\n value.forEach((v) => {\n keyMapEntries[v] = key;\n });\n }\n else {\n keyMapEntries[value] = key;\n }\n }\n }\n createEffect(on(activeElement, (currentFocusedElm, prevFocusedElm, prevFocusPath = []) => {\n const newFocusedElms = [];\n let current = currentFocusedElm;\n const fp = [];\n while (current) {\n if (!current.states.has('focus')) {\n current.states.add('focus');\n isFunc(current.onFocus) &&\n current.onFocus.call(current, currentFocusedElm, prevFocusedElm);\n newFocusedElms.push(current);\n }\n fp.push(current);\n current = current.parent;\n }\n prevFocusPath.forEach((elm) => {\n if (!fp.includes(elm)) {\n elm.states.remove('focus');\n isFunc(elm.onBlur) &&\n elm.onBlur.call(elm, currentFocusedElm, prevFocusedElm);\n }\n });\n setFocusPath(fp);\n return fp;\n }, { defer: true }));\n createEffect(() => {\n const e = keypressEvent();\n if (e) {\n // Search keyMap for the value of the pressed key or keyCode if value undefined\n const mappedKeyEvent = keyMapEntries[e.key] || keyMapEntries[e.keyCode];\n untrack(() => {\n const fp = focusPath();\n let finalFocusElm = undefined;\n for (const elm of fp) {\n finalFocusElm = finalFocusElm || elm;\n if (mappedKeyEvent) {\n const onKeyHandler = elm[`on${mappedKeyEvent}`];\n if (isFunc(onKeyHandler)) {\n if (onKeyHandler.call(elm, e, elm, finalFocusElm) === true) {\n break;\n }\n }\n }\n else {\n console.log(`Unhandled key event: ${e.key}`);\n }\n if (isFunc(elm.onKeyPress)) {\n if (elm.onKeyPress.call(elm, e, mappedKeyEvent, elm, finalFocusElm) === true) {\n break;\n }\n }\n }\n return false;\n });\n }\n });\n return focusPath;\n};\n//# sourceMappingURL=useFocusManager.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { ElementNode } from '@lightningjs/solid';\n// To use with TS import withPadding and then put withPadding; on the next line to prevent tree shaking\nexport function withPadding(el, padding) {\n const pad = padding();\n let top, left, right, bottom;\n if (Array.isArray(pad)) {\n // top right bottom left\n if (pad.length === 2) {\n top = bottom = pad[0];\n left = right = pad[1];\n }\n else if (pad.length === 3) {\n top = pad[0];\n left = right = pad[1];\n bottom = pad[2];\n }\n else {\n [top, right, bottom, left] = pad;\n }\n }\n else {\n top = right = bottom = left = pad;\n }\n el.onBeforeLayout = (node, size) => {\n if (size) {\n el.width =\n el.children.reduce((acc, c) => {\n return acc + (c.width || 0);\n }, 0) +\n left +\n right;\n const firstChild = el.children[0];\n if (firstChild) {\n // set padding or marginLeft for flex\n firstChild.x = left;\n firstChild.marginLeft = left;\n }\n let maxHeight = 0;\n el.children.forEach((c) => {\n c.y = top;\n c.marginTop = top;\n maxHeight = Math.max(maxHeight, c.height || 0);\n });\n el.height = maxHeight + top + bottom;\n }\n };\n}\n//# sourceMappingURL=withPadding.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n/* global SpeechSynthesisErrorEvent */\nfunction flattenStrings(series = []) {\n const flattenedSeries = [];\n let i;\n for (i = 0; i < series.length; i++) {\n const s = series[i];\n if (typeof s === 'string' && !s.includes('PAUSE-')) {\n flattenedSeries.push(series[i]);\n }\n else {\n break;\n }\n }\n // add a \"word boundary\" to ensure the Announcer doesn't automatically try to\n // interpret strings that look like dates but are not actually dates\n // for example, if \"Rising Sun\" and \"1993\" are meant to be two separate lines,\n // when read together, \"Sun 1993\" is interpretted as \"Sunday 1993\"\n return [flattenedSeries.join(',\\b ')].concat(series.slice(i));\n}\nfunction delay(pause) {\n return new Promise((resolve) => {\n setTimeout(resolve, pause);\n });\n}\n/**\n * Speak a string\n *\n * @param phrase Phrase to speak\n * @param utterances An array which the new SpeechSynthesisUtterance instance representing this utterance will be appended\n * @param lang Language to speak in\n * @return {Promise} Promise resolved when the utterance has finished speaking, and rejected if there's an error\n */\nfunction speak(phrase, utterances, lang = 'en-US') {\n const synth = window.speechSynthesis;\n return new Promise((resolve, reject) => {\n const utterance = new SpeechSynthesisUtterance(phrase);\n utterance.lang = lang;\n utterance.onend = () => {\n resolve();\n };\n utterance.onerror = (e) => {\n reject(e);\n };\n utterances.push(utterance);\n synth.speak(utterance);\n });\n}\nfunction speakSeries(series, lang, root = true) {\n const synth = window.speechSynthesis;\n const remainingPhrases = flattenStrings(Array.isArray(series) ? series : [series]);\n const nestedSeriesResults = [];\n /*\n We hold this array of SpeechSynthesisUtterances in order to prevent them from being\n garbage collected prematurely on STB hardware which can cause the 'onend' events of\n utterances to not fire consistently.\n */\n const utterances = [];\n let active = true;\n const seriesChain = (async () => {\n try {\n while (active && remainingPhrases.length) {\n const phrase = await Promise.resolve(remainingPhrases.shift());\n if (!active) {\n // Exit\n // Need to check this after the await in case it was cancelled in between\n break;\n }\n else if (typeof phrase === 'string' && phrase.includes('PAUSE-')) {\n // Pause it\n let pause = Number(phrase.split('PAUSE-')[1]) * 1000;\n if (isNaN(pause)) {\n pause = 0;\n }\n await delay(pause);\n }\n else if (typeof phrase === 'string' && phrase.length) {\n // Speak it\n const totalRetries = 3;\n let retriesLeft = totalRetries;\n while (active && retriesLeft > 0) {\n try {\n await speak(phrase, utterances, lang);\n retriesLeft = 0;\n }\n catch (e) {\n // eslint-disable-next-line no-undef\n if (e instanceof SpeechSynthesisErrorEvent) {\n if (e.error === 'network') {\n retriesLeft--;\n console.warn(`Speech synthesis network error. Retries left: ${retriesLeft}`);\n await delay(500 * (totalRetries - retriesLeft));\n }\n else if (e.error === 'canceled' ||\n e.error === 'interrupted') {\n // Cancel or interrupt error (ignore)\n retriesLeft = 0;\n }\n else {\n throw new Error(`SpeechSynthesisErrorEvent: ${e.error}`);\n }\n }\n else {\n throw e;\n }\n }\n }\n }\n else if (typeof phrase === 'function') {\n const seriesResult = speakSeries(phrase(), lang, false);\n nestedSeriesResults.push(seriesResult);\n await seriesResult.series;\n }\n else if (Array.isArray(phrase)) {\n // Speak it (recursively)\n const seriesResult = speakSeries(phrase, lang, false);\n nestedSeriesResults.push(seriesResult);\n await seriesResult.series;\n }\n }\n }\n finally {\n active = false;\n }\n })();\n return {\n series: seriesChain,\n get active() {\n return active;\n },\n append: (toSpeak) => {\n remainingPhrases.push(toSpeak);\n },\n cancel: () => {\n if (!active) {\n return;\n }\n if (root) {\n synth.cancel();\n }\n nestedSeriesResults.forEach((nestedSeriesResults) => {\n nestedSeriesResults.cancel();\n });\n active = false;\n },\n };\n}\nlet currentSeries;\nexport default function (toSpeak, lang = 'en-US') {\n currentSeries && currentSeries.cancel();\n currentSeries = speakSeries(toSpeak, lang);\n return currentSeries;\n}\n//# sourceMappingURL=speech.js.map","import { getOwner, onCleanup, createSignal, getListener } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/index.ts\nvar debounce = (callback, wait) => {\n if (isServer) {\n return Object.assign(() => void 0, { clear: () => void 0 });\n }\n let timeoutId;\n const clear = () => clearTimeout(timeoutId);\n if (getOwner())\n onCleanup(clear);\n const debounced = (...args) => {\n if (timeoutId !== void 0)\n clear();\n timeoutId = setTimeout(() => callback(...args), wait);\n };\n return Object.assign(debounced, { clear });\n};\nvar throttle = (callback, wait) => {\n if (isServer) {\n return Object.assign(() => void 0, { clear: () => void 0 });\n }\n let isThrottled = false, timeoutId, lastArgs;\n const throttled = (...args) => {\n lastArgs = args;\n if (isThrottled)\n return;\n isThrottled = true;\n timeoutId = setTimeout(() => {\n callback(...lastArgs);\n isThrottled = false;\n }, wait);\n };\n const clear = () => {\n clearTimeout(timeoutId);\n isThrottled = false;\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(throttled, { clear });\n};\nvar scheduleIdle = isServer ? () => Object.assign(() => void 0, { clear: () => void 0 }) : (\n // requestIdleCallback is not supported in Safari\n window.requestIdleCallback ? (callback, maxWait) => {\n let isDeferred = false, id, lastArgs;\n const deferred = (...args) => {\n lastArgs = args;\n if (isDeferred)\n return;\n isDeferred = true;\n id = requestIdleCallback(\n () => {\n callback(...lastArgs);\n isDeferred = false;\n },\n { timeout: maxWait }\n );\n };\n const clear = () => {\n cancelIdleCallback(id);\n isDeferred = false;\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(deferred, { clear });\n } : (\n // fallback to setTimeout (throttle)\n (callback) => throttle(callback)\n )\n);\nfunction leading(schedule, callback, wait) {\n if (isServer) {\n let called = false;\n const scheduled2 = (...args) => {\n if (called)\n return;\n called = true;\n callback(...args);\n };\n return Object.assign(scheduled2, { clear: () => void 0 });\n }\n let isScheduled = false;\n const scheduled = schedule(() => isScheduled = false, wait);\n const func = (...args) => {\n if (!isScheduled)\n callback(...args);\n isScheduled = true;\n scheduled();\n };\n const clear = () => {\n isScheduled = false;\n scheduled.clear();\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(func, { clear });\n}\nfunction leadingAndTrailing(schedule, callback, wait) {\n if (isServer) {\n let called = false;\n const scheduled2 = (...args) => {\n if (called)\n return;\n called = true;\n callback(...args);\n };\n return Object.assign(scheduled2, { clear: () => void 0 });\n }\n let State;\n ((State2) => {\n State2[State2[\"Ready\"] = 0] = \"Ready\";\n State2[State2[\"Leading\"] = 1] = \"Leading\";\n State2[State2[\"Trailing\"] = 2] = \"Trailing\";\n })(State || (State = {}));\n let state = 0 /* Ready */;\n const scheduled = schedule((args) => {\n state === 2 /* Trailing */ && callback(...args);\n state = 0 /* Ready */;\n }, wait);\n const fn = (...args) => {\n if (state !== 2 /* Trailing */) {\n if (state === 0 /* Ready */)\n callback(...args);\n state += 1;\n }\n scheduled(args);\n };\n const clear = () => {\n state = 0 /* Ready */;\n scheduled.clear();\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(fn, { clear });\n}\nfunction createScheduled(schedule) {\n let listeners = 0;\n let isDirty = false;\n const [track, dirty] = createSignal(void 0, { equals: false });\n const call = schedule(() => {\n isDirty = true;\n dirty();\n });\n return () => {\n if (!isDirty)\n call(), track();\n if (isDirty) {\n isDirty = !!listeners;\n return true;\n }\n if (getListener()) {\n listeners++;\n onCleanup(() => listeners--);\n }\n return false;\n };\n}\n\nexport { createScheduled, debounce, leading, leadingAndTrailing, scheduleIdle, throttle };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { untrack } from 'solid-js';\nimport SpeechEngine, {} from './speech.js';\nimport { debounce } from '@solid-primitives/scheduled';\nimport { focusPath } from '../useFocusManager.js';\nlet resetFocusPathTimer;\nlet prevFocusPath = [];\nlet currentlySpeaking;\nlet voiceOutDisabled = false;\nconst fiveMinutes = 300000;\nfunction debounceWithFlush(callback, time) {\n const trigger = debounce(callback, time);\n let scopedValue;\n const debounced = (newValue) => {\n scopedValue = newValue;\n trigger(newValue);\n };\n debounced.flush = () => {\n trigger.clear();\n callback(scopedValue);\n };\n debounced.clear = trigger.clear;\n return debounced;\n}\nfunction getElmName(elm) {\n return elm.id || elm.name;\n}\nfunction onFocusChangeCore(focusPath = []) {\n if (!Announcer.onFocusChange || !Announcer.enabled) {\n return;\n }\n const loaded = focusPath.every((elm) => !elm.loading);\n const focusDiff = focusPath.filter((elm) => !prevFocusPath.includes(elm));\n resetFocusPathTimer();\n if (!loaded && Announcer.onFocusChange) {\n Announcer.onFocusChange([]);\n return;\n }\n prevFocusPath = focusPath.slice(0);\n const toAnnounceText = [];\n const toAnnounce = focusDiff.reduce((acc, elm) => {\n if (elm.announce) {\n acc.push([getElmName(elm), 'Announce', elm.announce]);\n toAnnounceText.push(elm.announce);\n }\n else if (elm.title) {\n acc.push([getElmName(elm), 'Title', elm.title]);\n toAnnounceText.push(elm.title);\n }\n else {\n acc.push([getElmName(elm), 'No Announce', '']);\n }\n return acc;\n }, []);\n focusDiff.reverse().reduce((acc, elm) => {\n if (elm.announceContext) {\n acc.push([getElmName(elm), 'Context', elm.announceContext]);\n toAnnounceText.push(elm.announceContext);\n }\n else {\n acc.push([getElmName(elm), 'No Context', '']);\n }\n return acc;\n }, toAnnounce);\n if (Announcer.debug) {\n console.table(toAnnounce);\n }\n if (toAnnounceText.length) {\n return Announcer.speak(toAnnounceText.reduce((acc, val) => acc.concat(val), []));\n }\n}\nfunction textToSpeech(toSpeak) {\n if (voiceOutDisabled) {\n return;\n }\n return (currentlySpeaking = SpeechEngine(toSpeak));\n}\nexport const Announcer = {\n debug: false,\n enabled: true,\n cancel: function () {\n currentlySpeaking && currentlySpeaking.cancel();\n },\n clearPrevFocus: function (depth = 0) {\n prevFocusPath = prevFocusPath.slice(0, depth);\n resetFocusPathTimer();\n },\n speak: function (text, { append = false, notification = false } = {}) {\n if (Announcer.onFocusChange && Announcer.enabled) {\n Announcer.onFocusChange.flush();\n if (append && currentlySpeaking && currentlySpeaking.active) {\n currentlySpeaking.append(text);\n }\n else {\n Announcer.cancel();\n textToSpeech(text);\n }\n if (notification) {\n voiceOutDisabled = true;\n currentlySpeaking?.series\n .finally(() => {\n voiceOutDisabled = false;\n Announcer.refresh();\n })\n .catch(console.error);\n }\n }\n return currentlySpeaking;\n },\n refresh: function (depth = 0) {\n Announcer.clearPrevFocus(depth);\n Announcer.onFocusChange &&\n Announcer.onFocusChange(untrack(() => focusPath()));\n },\n setupTimers: function ({ focusDebounce = 400, focusChangeTimeout = fiveMinutes, } = {}) {\n Announcer.onFocusChange = debounceWithFlush(onFocusChangeCore, focusDebounce);\n resetFocusPathTimer = debounceWithFlush(() => {\n // Reset focus path for full announce\n prevFocusPath = [];\n }, focusChangeTimeout);\n },\n};\n//# sourceMappingURL=announcer.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { createEffect, on } from 'solid-js';\nimport { Announcer } from './announcer.js';\nimport { focusPath } from '../useFocusManager.js';\nexport const useAnnouncer = () => {\n Announcer.setupTimers();\n createEffect(on(focusPath, Announcer.onFocusChange, { defer: true }));\n return Announcer;\n};\n//# sourceMappingURL=index.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { renderer } from '@lightningjs/solid';\nimport {} from '@lightningjs/renderer';\nexport function createSpriteMap(src, subTextures) {\n const spriteMapTexture = renderer.createTexture('ImageTexture', {\n src,\n });\n return subTextures.reduce((acc, t) => {\n const { x, y, width, height } = t;\n acc[t.name] = renderer.createTexture('SubTexture', {\n texture: spriteMapTexture,\n x,\n y,\n width,\n height,\n });\n return acc;\n }, {});\n}\n//# sourceMappingURL=createSpriteMap.js.map","import { createSignal } from \"solid-js\";\nexport const [globalBackground, setGlobalBackground] = createSignal(\"\");\n","export default {\n name: 'Base Lightning TV',\n alpha: {\n primary: 1,\n secondary: 0.7,\n tertiary: 0.1,\n inactive: 0.5,\n full: 1,\n none: 0,\n alpha1: 0.1,\n alpha2: 0.3,\n alpha3: 0.5,\n alpha4: 0.7,\n alpha5: 0.9\n },\n animation: {\n duration: {\n none: 0,\n xfast: 0.1,\n fast: 0.25,\n normal: 0.5,\n slow: 0.75,\n xslow: 0.9\n },\n delay: {\n none: 0,\n xfast: 0.01,\n fast: 0.025,\n normal: 0.05,\n slow: 0.075,\n xslow: 0.09\n },\n expressive: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n expressiveEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n expressiveExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standard: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standardEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standardExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utility: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utilityEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utilityExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n }\n },\n asset: {\n arrowLeft:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAi0lEQVRIDWNgGAWjIfD//38JID5Fk5AAGqwKxPeA+D/VLQCaaQLEr0CGgwBVLQCa5wbEn0EGwwDVLAAaGA3Ev2AGw2iqWAA0rBiI/8EMRaYptgBoWDeygehsci1gIlcjWfqArqZdEMFcBLSEdpGMZAntkimSJbTLaEiW0K6oQLKEdoUdzJJRemiHAAD4n+yzPWCs7QAAAABJRU5ErkJggg==',\n arrowRight:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAg0lEQVRIDWNgGAWjIYArBP7//38KiCVwyVMsDjQcBO4BsSrFhmEzAGw8hHgFpEywqaFIDMkCEPMzELtRZCC6ZjQLQNxfQByNro5sPhYLQEL/gLiYbEORNeKwACbcDVPLBGMMOhrmVDSapkFE00imaTKlaUajaVFB28Ju0CXrUQfhDAEAEgHss6NhpLQAAAAASUVORK5CYII=',\n backspaceOutline:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZU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2gPOGFGAD8roJgF0t+qkx6jorgApElwE4aQwxZp6n3YNxsPyzA7yst/4iSdvEMFqaHUCjKZEZ91IgAeolWzotFEiAkoWQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC',\n check:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAOCAYAAAAi2ky3AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACtSURBVHgBvdPdDcIgEAfwoy8Nb45QN3AGF2s36Ahu4gpuIDoBfSgfpdoTlCbEWEMh6T8hFzjyg5AAkBHOcQe5UWqspRx435sDpMYj6IYQwwVSEiJ2MKVUBWuzLSLl2HL+uxmNCGFO8yaL7RHxve6qRZoAuS4hxac8735elWVx7jrtMKL1o0Gcat9jhExHSukN/kUIFZ7MpDRtzE1isDRkAUtDvrA8ZI597FUf8gWH9P0b4gko9wAAAABJRU5ErkJggg=='\n },\n color: {\n palette: {\n 'blue-20': '0xbecffeff',\n 'blue-40': '0x93a9fdff',\n 'blue-90': '0x000033ff',\n 'grey-05': '0xf8f7faff',\n 'grey-40': '0x929096ff',\n 'grey-70': '0x48474bff',\n 'grey-90': '0x181819ff'\n },\n white: '0xffffffff',\n black: '0x000000ff',\n grey: '0x929096ff',\n red: '0xe74c3cff',\n orange: '0xdc7633ff',\n yellow: '0xf7dc6fff',\n green: '0x2ecc71ff',\n blue: '0x93a9fdff',\n purple: '0x663399ff',\n material: '0x181819ff',\n materialBrand: '0x000033ff',\n overlay: '0x181819b3',\n textNeutral: '0xf8f7faff',\n textNeutralSecondary: '0xf8f7fab3',\n textNeutralTertiary: '0xf8f7fa1a',\n textNeutralDisabled: '0xf8f7fa80',\n textInverse: '0x181819ff',\n textInverseSecondary: '0x181819b3',\n textInverseTertiary: '0x1818191a',\n textInverseDisabled: '0x18181980',\n textBrand: '0x93a9fdff',\n textBrandSecondary: '0x93a9fdb3',\n textBrandTertiary: '0x93a9fd1a',\n textBrandDisabled: '0x93a9fd80',\n textPositive: '0x2ecc71ff',\n textNegative: '0xe74c3cff',\n textInfo: '0x93a9fdff',\n textCaution: '0xdc7633ff',\n fillTransparent: '0xffffff0',\n fillNeutral: '0xf8f7faff',\n fillNeutralSecondary: '0xf8f7fab3',\n fillNeutralTertiary: '0xf8f7fa1a',\n fillNeutralDisabled: '0xf8f7fa80',\n fillInverse: '0x181819ff',\n fillInverseSecondary: '0x181819b3',\n fillInverseTertiary: '0x1818191a',\n fillInverseDisabled: '0x18181980',\n fillBrand: '0x93a9fdff',\n fillBrandSecondary: '0x93a9fdb3',\n fillBrandTertiary: '0x93a9fd1a',\n fillBrandDisabled: '0x93a9fd80',\n fillPositive: '0x2ecc71ff',\n fillNegative: '0xe74c3cff',\n fillInfo: '0x93a9fdff',\n fillCaution: '0xdc7633ff',\n strokeNeutral: '0xf8f7faff',\n strokeNeutralSecondary: '0xf8f7fab3',\n strokeNeutralTertiary: '0xf8f7fa1a',\n strokeNeutralDisabled: '0xf8f7fa80',\n strokeInverse: '0x181819ff',\n strokeInverseSecondary: '0x181819b3',\n strokeInverseTertiary: '0x1818191a',\n strokeInverseDisabled: '0x18181980',\n strokeBrand: '0x93a9fdff',\n strokeBrandSecondary: '0x93a9fdb3',\n strokeBrandTertiary: '0x93a9fd1a',\n strokeBrandDisabled: '0x93a9fd80',\n strokePositive: '0x2ecc71ff',\n strokeNegative: '0xe74c3cff',\n strokeInfo: '0x93a9fdff',\n strokeCaution: '0xdc7633ff',\n interactiveNeutral: '0xffffff1a',\n interactiveNeutralFocus: '0xffffffff',\n interactiveNeutralFocusSoft: '0xffffff1a',\n interactiveInverse: '0x48474b1a',\n interactiveInverseFocus: '0x48474bff',\n interactiveInverseFocusSoft: '0x48474b1a',\n interactiveBrand: '0xbecffe1a',\n interactiveBrandFocus: '0xbecffeff',\n interactiveBrandFocusSoft: '0xbecffe1a',\n shadowNeutral: '0x000000b3',\n shadowNeutralFocus: '0x000000b3',\n shadowNeutralFocusSoft: '0x000000b3',\n shadowNeutralText: '0x000000ff',\n shadowInverse: '0x000000b3',\n shadowInverseFocus: '0x000000b3',\n shadowInverseFocusSoft: '0x000000b3',\n shadowInverseText: '0x000000ff',\n shadowBrand: '0x000000b3',\n shadowBrandFocus: '0x000000b3',\n shadowBrandFocusSoft: '0x000000b3',\n shadowBrandText: '0x000000ff'\n },\n font: [],\n layout: {\n columnCount: 10,\n focusScale: 1.2,\n gutterX: 20,\n gutterY: 20,\n marginX: 150,\n marginY: 150,\n safe: 50,\n screenW: 1920,\n screenH: 1080\n },\n radius: { none: 0, xs: 2, sm: 4, md: 8, lg: 16, xl: 24 },\n spacer: {\n none: 0,\n xxs: 2,\n xs: 4,\n sm: 8,\n md: 10,\n lg: 20,\n xl: 30,\n xxl: 40,\n xxxl: 50\n },\n stroke: { none: 0, sm: 2, md: 4, lg: 6, xl: 8 },\n typography: {\n display1: {\n fontFamily: 'Arial',\n fontSize: 75,\n lineHeight: 85,\n fontWeight: 500,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n display2: {\n fontFamily: 'Arial',\n fontSize: 50,\n lineHeight: 60,\n fontWeight: 500,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline1: {\n fontFamily: 'Arial',\n fontSize: 35,\n fontWeight: 500,\n lineHeight: 48,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline2: {\n fontFamily: 'Arial',\n fontSize: 30,\n fontWeight: 500,\n lineHeight: 40,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline3: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 500,\n lineHeight: 36,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body1: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 300,\n lineHeight: 40,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body2: {\n fontFamily: 'Arial',\n fontSize: 22,\n fontWeight: 300,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body3: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 300,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n button1: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n button2: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n callout1: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n caption1: {\n fontFamily: 'Arial',\n fontSize: 15,\n fontWeight: 500,\n lineHeight: 24,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n tag1: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 24,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n footnote1: {\n fontFamily: 'Arial',\n fontSize: 22,\n fontWeight: 300,\n lineHeight: 30,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n }\n },\n componentConfig: {\n Keyboard: {\n base: {\n keyProps: {\n delete: {\n title: null,\n icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6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IJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC'\n }\n }\n }\n }\n }\n};\n","import { type AnimationSettings } from \"@lightningjs/renderer\";\nimport { globalBackground } from \"../state.js\";\nimport {\n type IntrinsicNodeStyleProps,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { createEffect, on } from \"solid-js\";\nimport { debounce } from \"@solid-primitives/scheduled\";\nimport theme from \"theme\";\n\nexport default function Background() {\n let bg1, bg2, heroMask;\n let active = 0;\n const alpha = 1;\n const animationSettings = {\n duration: 750,\n easing: \"ease-in-out\",\n } satisfies Partial;\n const bgStyles = {\n alpha,\n color: 0xffffffff,\n } satisfies IntrinsicNodeStyleProps;\n\n function changeBackgrounds(img: string) {\n if (img.startsWith(\"#\")) {\n bg1.color = hexColor(img);\n bg1.src = \"\";\n bg1.alpha = 1;\n active = 1;\n bg2.alpha = 0;\n heroMask.alpha = 0;\n return;\n } else {\n bg1.color = 0xffffffff;\n heroMask.alpha = 1;\n }\n\n if (active === 0) {\n bg1.src = img;\n active = 1;\n return;\n }\n\n if (active === 1) {\n bg2.src = img;\n active = 2;\n bg2.alpha = 0;\n bg2.animate({ alpha }, animationSettings).start();\n bg1.animate({ alpha: 0 }, animationSettings).start();\n return;\n }\n\n if (active === 2) {\n bg1.src = img;\n active = 1;\n bg1.alpha = 0;\n bg1.animate({ alpha }, animationSettings).start();\n bg2.animate({ alpha: 0 }, animationSettings).start();\n }\n }\n\n const delayedBackgrounds = debounce(changeBackgrounds, 400);\n\n createEffect(\n on(\n globalBackground,\n (img: string) => {\n delayedBackgrounds(img);\n },\n { defer: true },\n ),\n );\n\n return (\n <>\n \n \n \n \n \n \n );\n}\n","var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;\nimport { ElementNode, createComponent, View, mergeProps, createElement, use, spread, insert, Show, Text as Text$7, memo, For as For$1 } from \"@lightningjs/solid\";\nimport theme from \"theme\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nconst equalFn = (a, b) => a === b;\nconst $TRACK = Symbol(\"solid-track\");\nconst signalOptions = {\n equals: equalFn\n};\nlet runEffects = runQueue;\nconst STALE = 1;\nconst PENDING = 2;\nconst UNOWNED = {\n owned: null,\n cleanups: null,\n context: null,\n owner: null\n};\nvar Owner = null;\nlet Transition = null;\nlet ExternalSourceConfig = null;\nlet Listener = null;\nlet Updates = null;\nlet Effects = null;\nlet ExecCount = 0;\nfunction createRoot(fn, detachedOwner) {\n const listener = Listener, owner = Owner, unowned = fn.length === 0, current = detachedOwner === void 0 ? owner : detachedOwner, root = unowned ? UNOWNED : {\n owned: null,\n cleanups: null,\n context: current ? current.context : null,\n owner: current\n }, updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root)));\n Owner = root;\n Listener = null;\n try {\n return runUpdates(updateFn, true);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n}\nfunction createSignal(value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const s = {\n value,\n observers: null,\n observerSlots: null,\n comparator: options.equals || void 0\n };\n const setter = (value2) => {\n if (typeof value2 === \"function\") {\n value2 = value2(s.value);\n }\n return writeSignal(s, value2);\n };\n return [readSignal.bind(s), setter];\n}\nfunction createMemo(fn, value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const c = createComputation(fn, value, true, 0);\n c.observers = null;\n c.observerSlots = null;\n c.comparator = options.equals || void 0;\n updateComputation(c);\n return readSignal.bind(c);\n}\nfunction untrack(fn) {\n if (Listener === null)\n return fn();\n const listener = Listener;\n Listener = null;\n try {\n if (ExternalSourceConfig)\n ;\n return fn();\n } finally {\n Listener = listener;\n }\n}\nfunction onCleanup(fn) {\n if (Owner === null)\n ;\n else if (Owner.cleanups === null)\n Owner.cleanups = [fn];\n else\n Owner.cleanups.push(fn);\n return fn;\n}\nfunction readSignal() {\n if (this.sources && this.state) {\n if (this.state === STALE)\n updateComputation(this);\n else {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(this), false);\n Updates = updates;\n }\n }\n if (Listener) {\n const sSlot = this.observers ? this.observers.length : 0;\n if (!Listener.sources) {\n Listener.sources = [this];\n Listener.sourceSlots = [sSlot];\n } else {\n Listener.sources.push(this);\n Listener.sourceSlots.push(sSlot);\n }\n if (!this.observers) {\n this.observers = [Listener];\n this.observerSlots = [Listener.sources.length - 1];\n } else {\n this.observers.push(Listener);\n this.observerSlots.push(Listener.sources.length - 1);\n }\n }\n return this.value;\n}\nfunction writeSignal(node, value, isComp) {\n let current = node.value;\n if (!node.comparator || !node.comparator(current, value)) {\n node.value = value;\n if (node.observers && node.observers.length) {\n runUpdates(() => {\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n const TransitionRunning = Transition && Transition.running;\n if (TransitionRunning && Transition.disposed.has(o))\n ;\n if (TransitionRunning ? !o.tState : !o.state) {\n if (o.pure)\n Updates.push(o);\n else\n Effects.push(o);\n if (o.observers)\n markDownstream(o);\n }\n if (!TransitionRunning)\n o.state = STALE;\n }\n if (Updates.length > 1e6) {\n Updates = [];\n if (false)\n ;\n throw new Error();\n }\n }, false);\n }\n }\n return value;\n}\nfunction updateComputation(node) {\n if (!node.fn)\n return;\n cleanNode(node);\n const time = ExecCount;\n runComputation(\n node,\n node.value,\n time\n );\n}\nfunction runComputation(node, value, time) {\n let nextValue;\n const owner = Owner, listener = Listener;\n Listener = Owner = node;\n try {\n nextValue = node.fn(value);\n } catch (err) {\n if (node.pure) {\n {\n node.state = STALE;\n node.owned && node.owned.forEach(cleanNode);\n node.owned = null;\n }\n }\n node.updatedAt = time + 1;\n return handleError(err);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n if (!node.updatedAt || node.updatedAt <= time) {\n if (node.updatedAt != null && \"observers\" in node) {\n writeSignal(node, nextValue);\n } else\n node.value = nextValue;\n node.updatedAt = time;\n }\n}\nfunction createComputation(fn, init, pure, state = STALE, options) {\n const c = {\n fn,\n state,\n updatedAt: null,\n owned: null,\n sources: null,\n sourceSlots: null,\n cleanups: null,\n value: init,\n owner: Owner,\n context: Owner ? Owner.context : null,\n pure\n };\n if (Owner === null)\n ;\n else if (Owner !== UNOWNED) {\n {\n if (!Owner.owned)\n Owner.owned = [c];\n else\n Owner.owned.push(c);\n }\n }\n return c;\n}\nfunction runTop(node) {\n if (node.state === 0)\n return;\n if (node.state === PENDING)\n return lookUpstream(node);\n if (node.suspense && untrack(node.suspense.inFallback))\n return node.suspense.effects.push(node);\n const ancestors = [node];\n while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {\n if (node.state)\n ancestors.push(node);\n }\n for (let i = ancestors.length - 1; i >= 0; i--) {\n node = ancestors[i];\n if (node.state === STALE) {\n updateComputation(node);\n } else if (node.state === PENDING) {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(node, ancestors[0]), false);\n Updates = updates;\n }\n }\n}\nfunction runUpdates(fn, init) {\n if (Updates)\n return fn();\n let wait = false;\n if (!init)\n Updates = [];\n if (Effects)\n wait = true;\n else\n Effects = [];\n ExecCount++;\n try {\n const res = fn();\n completeUpdates(wait);\n return res;\n } catch (err) {\n if (!wait)\n Effects = null;\n Updates = null;\n handleError(err);\n }\n}\nfunction completeUpdates(wait) {\n if (Updates) {\n runQueue(Updates);\n Updates = null;\n }\n if (wait)\n return;\n const e = Effects;\n Effects = null;\n if (e.length)\n runUpdates(() => runEffects(e), false);\n}\nfunction runQueue(queue) {\n for (let i = 0; i < queue.length; i++)\n runTop(queue[i]);\n}\nfunction lookUpstream(node, ignore) {\n node.state = 0;\n for (let i = 0; i < node.sources.length; i += 1) {\n const source = node.sources[i];\n if (source.sources) {\n const state = source.state;\n if (state === STALE) {\n if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))\n runTop(source);\n } else if (state === PENDING)\n lookUpstream(source, ignore);\n }\n }\n}\nfunction markDownstream(node) {\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n if (!o.state) {\n o.state = PENDING;\n if (o.pure)\n Updates.push(o);\n else\n Effects.push(o);\n o.observers && markDownstream(o);\n }\n }\n}\nfunction cleanNode(node) {\n let i;\n if (node.sources) {\n while (node.sources.length) {\n const source = node.sources.pop(), index = node.sourceSlots.pop(), obs = source.observers;\n if (obs && obs.length) {\n const n = obs.pop(), s = source.observerSlots.pop();\n if (index < obs.length) {\n n.sourceSlots[s] = index;\n obs[index] = n;\n source.observerSlots[index] = s;\n }\n }\n }\n }\n if (node.owned) {\n for (i = node.owned.length - 1; i >= 0; i--)\n cleanNode(node.owned[i]);\n node.owned = null;\n }\n if (node.cleanups) {\n for (i = node.cleanups.length - 1; i >= 0; i--)\n node.cleanups[i]();\n node.cleanups = null;\n }\n node.state = 0;\n}\nfunction castError(err) {\n if (err instanceof Error)\n return err;\n return new Error(typeof err === \"string\" ? err : \"Unknown error\", {\n cause: err\n });\n}\nfunction handleError(err, owner = Owner) {\n const error = castError(err);\n throw error;\n}\nconst FALLBACK = Symbol(\"fallback\");\nfunction dispose(d) {\n for (let i = 0; i < d.length; i++)\n d[i]();\n}\nfunction mapArray(list, mapFn, options = {}) {\n let items = [], mapped = [], disposers = [], len = 0, indexes = mapFn.length > 1 ? [] : null;\n onCleanup(() => dispose(disposers));\n return () => {\n let newItems = list() || [], i, j;\n newItems[$TRACK];\n return untrack(() => {\n let newLen = newItems.length, newIndices, newIndicesNext, temp, tempdisposers, tempIndexes, start, end, newEnd, item;\n if (newLen === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n indexes && (indexes = []);\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot((disposer) => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n } else if (len === 0) {\n mapped = new Array(newLen);\n for (j = 0; j < newLen; j++) {\n items[j] = newItems[j];\n mapped[j] = createRoot(mapper);\n }\n len = newLen;\n } else {\n temp = new Array(newLen);\n tempdisposers = new Array(newLen);\n indexes && (tempIndexes = new Array(newLen));\n for (start = 0, end = Math.min(len, newLen); start < end && items[start] === newItems[start]; start++)\n ;\n for (end = len - 1, newEnd = newLen - 1; end >= start && newEnd >= start && items[end] === newItems[newEnd]; end--, newEnd--) {\n temp[newEnd] = mapped[end];\n tempdisposers[newEnd] = disposers[end];\n indexes && (tempIndexes[newEnd] = indexes[end]);\n }\n newIndices = /* @__PURE__ */ new Map();\n newIndicesNext = new Array(newEnd + 1);\n for (j = newEnd; j >= start; j--) {\n item = newItems[j];\n i = newIndices.get(item);\n newIndicesNext[j] = i === void 0 ? -1 : i;\n newIndices.set(item, j);\n }\n for (i = start; i <= end; i++) {\n item = items[i];\n j = newIndices.get(item);\n if (j !== void 0 && j !== -1) {\n temp[j] = mapped[i];\n tempdisposers[j] = disposers[i];\n indexes && (tempIndexes[j] = indexes[i]);\n j = newIndicesNext[j];\n newIndices.set(item, j);\n } else\n disposers[i]();\n }\n for (j = start; j < newLen; j++) {\n if (j in temp) {\n mapped[j] = temp[j];\n disposers[j] = tempdisposers[j];\n if (indexes) {\n indexes[j] = tempIndexes[j];\n indexes[j](j);\n }\n } else\n mapped[j] = createRoot(mapper);\n }\n mapped = mapped.slice(0, len = newLen);\n items = newItems.slice(0);\n }\n return mapped;\n });\n function mapper(disposer) {\n disposers[j] = disposer;\n if (indexes) {\n const [s, set] = createSignal(j);\n indexes[j] = set;\n return mapFn(newItems[j], s);\n }\n return mapFn(newItems[j]);\n }\n };\n}\nfunction For(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(mapArray(() => props.each, props.children, fallback || void 0));\n}\nconst defaultModeKeys = [\"focus\", \"disabled\"];\nconst defaultToneKeys = [\"brand\", \"inverse\", \"neutral\"];\nfunction makeComponentStyles({ themeKeys, base, modes, tones, themeStyles: themeStyles2, modeKeys = defaultModeKeys, toneKeys = defaultToneKeys }, debug = false) {\n const makeToneStyles = (tones2, themeComponentStyles, modeStyles) => {\n const toneStyles = toneKeys.map((tone) => {\n const styles2 = {};\n const styleList = new Set(\n [].concat.apply([], [(tones2 == null ? void 0 : tones2[tone]) ?? {}, (themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) ?? {}].map(Object.keys))\n );\n styleList.forEach((styleKey) => {\n var _a2, _b2;\n if (!modeKeys.includes(styleKey)) {\n styles2[styleKey] = ((_a2 = themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) == null ? void 0 : _a2[styleKey]) ?? ((_b2 = tones2 == null ? void 0 : tones2[tone]) == null ? void 0 : _b2[styleKey]);\n }\n });\n modeKeys.forEach((mode) => {\n var _a2, _b2;\n styles2[mode] = {\n ...modeStyles[mode],\n // fallbacks from base.mode\n ...(_a2 = tones2 == null ? void 0 : tones2[tone]) == null ? void 0 : _a2[mode],\n // component configured tone.mode\n ...(_b2 = themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) == null ? void 0 : _b2[mode]\n // theme configure tone.mode\n };\n });\n return [tone, styles2];\n });\n return Object.fromEntries(toneStyles);\n };\n const makeModeStyles = (modes2, themeComponentStyles) => {\n const modeStyles = modeKeys.map((mode) => {\n return [mode, { ...modes2 == null ? void 0 : modes2[mode], ...themeComponentStyles == null ? void 0 : themeComponentStyles[mode] }];\n });\n const modeObject = Object.fromEntries(modeStyles);\n return modeObject;\n };\n const makeBaseStyles = (base2, themeComponentStyles) => {\n const baseStyles = {\n ...base2,\n ...themeComponentStyles.base\n };\n return baseStyles;\n };\n const mapThemeKeysToSolid = (stylesToMap) => Object.fromEntries(\n Object.entries(themeKeys).filter(([_, themeKey]) => stylesToMap[themeKey]).map(([solidKey, themeKey]) => [solidKey, stylesToMap[themeKey]])\n );\n const convertComponentConfig = (themeStyles3) => {\n const convertedThemeStyles = Object.fromEntries(\n // iterate through each variant\n Object.entries(themeStyles3).map(([variantName, styles2]) => {\n const convertedStyles = mapThemeKeysToSolid(styles2);\n Object.entries(styles2).filter(([styleName, _]) => modeKeys.includes(styleName)).forEach(([modeName, modeStyles]) => {\n convertedStyles[modeName] = mapThemeKeysToSolid(modeStyles);\n });\n return [variantName, convertedStyles];\n })\n );\n return convertedThemeStyles;\n };\n const generateSolidStylesFromLookupObject = (base2, modes2, tones2) => {\n const themeComponentStyles = convertComponentConfig(themeStyles2);\n debug && console.log(themeComponentStyles);\n const baseStyles = makeBaseStyles(base2, themeComponentStyles);\n debug && console.log(baseStyles);\n const modeStyles = makeModeStyles(modes2, themeComponentStyles);\n debug && console.log(modeStyles);\n const toneStyles = makeToneStyles(tones2, themeComponentStyles, modeStyles);\n debug && console.log(toneStyles);\n return {\n base: {\n ...baseStyles,\n ...modeStyles\n },\n tones: toneStyles\n };\n };\n return generateSolidStylesFromLookupObject(base, modes, tones);\n}\nfunction withScrolling(adjustment = 0) {\n return (componentRef, selectedElement, selected, lastSelected) => {\n if (componentRef.children.length === 0) {\n return;\n }\n const gap = componentRef.gap || 0;\n const scroll = componentRef.scroll || \"auto\";\n const [lastItem, windowVal] = updateLastIndex(componentRef);\n const currentVal = componentRef.flexDirection === \"row\" ? componentRef.x : componentRef.y;\n const newVal = componentRef.flexDirection === \"row\" ? selectedElement.x : selectedElement.y;\n const size2 = componentRef.flexDirection === \"row\" ? selectedElement.width : selectedElement.height;\n const direct = selected > lastSelected ? \"positive\" : \"negative\";\n let next = currentVal;\n if (scroll === \"auto\") {\n if (componentRef.scrollIndex != void 0 && componentRef.scrollIndex >= 0) {\n if (componentRef.selected >= componentRef.scrollIndex) {\n if (direct === \"positive\") {\n next = currentVal - size2 - gap;\n } else {\n next = currentVal + size2 + gap;\n }\n }\n } else if (Math.abs(currentVal) + windowVal < lastItem.position + lastItem.size || newVal < Math.abs(currentVal)) {\n next = -newVal + adjustment;\n }\n } else if (scroll === \"always\" || scroll === \"edge\" && direct === \"negative\" && Math.abs(currentVal) > newVal) {\n next = -newVal + adjustment;\n } else if (scroll === \"edge\" && direct === \"positive\" && Math.abs(currentVal) + windowVal < newVal + size2) {\n next = currentVal - size2 - gap;\n }\n if (componentRef.flexDirection === \"row\" && componentRef.x !== next) {\n componentRef.x = next;\n } else if (componentRef.flexDirection === \"column\" && componentRef.y !== next) {\n componentRef.y = next;\n }\n };\n}\nfunction updateLastIndex(items) {\n let lastItem, windowVal;\n if (items.flexDirection === \"row\") {\n lastItem = {\n position: items.children[items.children.length - 1].x,\n size: items.children[items.children.length - 1].width\n };\n windowVal = items.width;\n } else {\n lastItem = {\n position: items.children[items.children.length - 1].y,\n size: items.children[items.children.length - 1].height\n };\n windowVal = items.height;\n }\n return [lastItem, windowVal];\n}\nconst useItemLayout = (itemLayout) => {\n if (itemLayout) {\n const width = (theme.layout.screenW - theme.layout.marginX * 2) / itemLayout.upCount - theme.layout.gutterX;\n const height = width / itemLayout.ratioX * itemLayout.ratioY;\n return { width, height };\n }\n return {};\n};\nconst chainFunctions = (...args) => {\n const onlyFunctions = args.filter((func) => typeof func === \"function\");\n if (onlyFunctions.length === 0) {\n return void 0;\n }\n return function(...innerArgs) {\n for (const func of onlyFunctions) {\n if (func.apply(this, innerArgs) === true) {\n return true;\n }\n }\n };\n};\nfunction assertTruthy(condition, message) {\n return;\n}\nfunction onGridFocus() {\n if (!this || this.selected === void 0 || this.children.length === 0)\n return false;\n let child = this.children[this.selected];\n while (child == null ? void 0 : child.skipFocus) {\n this.selected++;\n child = this.children[this.selected];\n }\n if (!(child instanceof ElementNode))\n return false;\n child.setFocus();\n}\nfunction handleNavigation(direction) {\n return function() {\n var _a2, _b2;\n const numChildren = this.children.length;\n const wrap = this.wrap;\n const lastSelected = this.selected || 0;\n if (numChildren === 0) {\n return false;\n }\n if (direction === \"right\" || direction === \"down\") {\n do {\n this.selected = (this.selected || 0) % numChildren + 1;\n if (this.selected >= numChildren) {\n if (!wrap) {\n this.selected = void 0;\n break;\n }\n this.selected = 0;\n }\n } while ((_a2 = this.children[this.selected]) == null ? void 0 : _a2.skipFocus);\n } else if (direction === \"left\" || direction === \"up\") {\n do {\n this.selected = (this.selected || 0) % numChildren - 1;\n if (this.selected < 0) {\n if (!wrap) {\n this.selected = void 0;\n break;\n }\n this.selected = numChildren - 1;\n }\n } while ((_b2 = this.children[this.selected]) == null ? void 0 : _b2.skipFocus);\n }\n if (this.selected === void 0) {\n this.selected = lastSelected;\n if (this.children[this.selected].states.has(\"focus\")) {\n return false;\n }\n }\n const active = this.children[this.selected];\n this.onSelectedChanged && this.onSelectedChanged.call(this, this, active, this.selected, lastSelected);\n if (this.plinko && lastSelected !== void 0) {\n const lastSelectedChild = this.children[lastSelected];\n const num = lastSelectedChild.selected || 0;\n active.selected = num < active.children.length ? num : active.children.length - 1;\n }\n active.setFocus();\n return true;\n };\n}\nfunction scrollToIndex(componentRef, selectedIndex) {\n if (!componentRef || componentRef.selected === void 0 || componentRef.children.length === 0 || componentRef.children.length <= selectedIndex || componentRef.selected === selectedIndex) {\n return false;\n }\n componentRef.selected = selectedIndex;\n if (componentRef.flexDirection === \"row\") {\n componentRef.x = -componentRef.children[selectedIndex].x;\n } else if (componentRef.flexDirection === \"column\") {\n componentRef.y = -componentRef.children[selectedIndex].y;\n }\n}\nconst { Artwork: { defaultTone: defaultTone$e, ...themeStyles$d } = { styles: {} } } = (_a = theme) == null ? void 0 : _a.componentConfig;\nconst container$e = {\n themeKeys: {\n fillColor: \"fillColor\",\n borderRadius: \"borderRadius\",\n scale: \"imageScale\",\n pivotX: \"imageScalePivotX\",\n pivotY: \"imageScalePivotY\"\n },\n base: {\n borderRadius: theme.radius.md,\n fallbackSrc: void 0,\n fillColor: theme.color.overlay,\n gradientColor: theme.color.material,\n pivotX: 0.5,\n pivotY: 0.5,\n scale: void 0\n },\n themeStyles: themeStyles$d\n};\nconst Container$e = makeComponentStyles(container$e);\nconst styles$e = {\n tone: defaultTone$e || \"neutral\",\n Container: Container$e\n};\nconst formatArtwork = (props) => {\n let src = props.src ? props.src : props.fallbackSrc;\n if (src && props.srcCallback && typeof props.srcCallback === \"function\") {\n src = props.srcCallback({\n closestAspectRatio: void 0,\n aspectRatio: void 0,\n src,\n width: props.width,\n height: props.height\n });\n }\n return src;\n};\nconst Artwork = (props) => {\n const formattedArtwork = createMemo(() => formatArtwork(props));\n return createComponent(View, mergeProps(props, {\n get color() {\n var _a2;\n return Boolean(formattedArtwork()) ? void 0 : props.color ?? ((_a2 = styles$e.Container.tones[props.tone ?? styles$e.tone]) == null ? void 0 : _a2.fillColor) ?? styles$e.Container.base.fillColor;\n },\n get style() {\n return [...[props.style].flat(), styles$e.Container.tones[props.tone || styles$e.tone], styles$e.Container.base];\n },\n get src() {\n return formattedArtwork();\n }\n }));\n};\nconst { Icon: { defaultTone: defaultTone$d, ...themeStyles$c } = { styles: {} } } = (_b = theme) == null ? void 0 : _b.componentConfig;\nconst container$d = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n width: 100,\n height: 100,\n color: theme.color.fillInverse\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand\n }\n },\n themeStyles: themeStyles$c\n};\nconst Container$d = makeComponentStyles(container$d);\nconst styles$d = {\n tone: defaultTone$d || \"neutral\",\n Container: Container$d\n};\nconst Icon$3 = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$d.Container.tones) == null ? void 0 : _a2[props.tone || styles$d.tone],\n styles$d.Container.base\n ];\n },\n forwardStates: true\n }));\n};\nconst { Badge: { defaultTone: defaultTone$c, ...themeStyles$b } = { styles: {} } } = (_c = theme) == null ? void 0 : _c.componentConfig;\nconst container$c = {\n themeKeys: {\n color: \"backgroundColor\"\n },\n base: {\n color: theme.color.fillInverseSecondary,\n borderRadius: theme.radius.sm,\n // borderRadius must be applied _before_ border to prevent the node from breaking\n border: {\n color: theme.color.strokeInverse,\n width: theme.stroke.sm\n },\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n padding: [\n theme.spacer.md - theme.stroke.sm,\n theme.spacer.xs + theme.stroke.sm,\n theme.spacer.md + theme.stroke.sm,\n theme.spacer.md + theme.stroke.sm\n ]\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutralSecondary,\n borderRadius: theme.radius.sm,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: theme.stroke.sm\n }\n },\n brand: {\n color: theme.color.fillBrand,\n borderRadius: theme.radius.sm,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: theme.stroke.sm\n }\n }\n },\n themeStyles: themeStyles$b\n};\nconst text$6 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.tag1,\n color: theme.color.textNeutral\n },\n tones: {\n inverse: {\n color: theme.color.textInverse\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$b\n};\nconst icon$2 = {\n themeKeys: {\n color: \"iconColor\"\n },\n base: {\n color: theme.color.textNeutral\n },\n tones: {\n inverse: {\n color: theme.color.textInverse\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$b\n};\nconst Container$c = makeComponentStyles(container$c);\nconst Icon$2 = makeComponentStyles(icon$2);\nconst Text$6 = makeComponentStyles(text$6);\nconst styles$c = {\n tone: defaultTone$c || \"neutral\",\n Container: Container$c,\n Icon: Icon$2,\n Text: Text$6\n};\nconst Badge = (props) => {\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2, _b2;\n return props.padding ?? ((_b2 = (_a2 = styles$c.Container) == null ? void 0 : _a2.tones[props.tone ?? styles$c.tone]) == null ? void 0 : _b2.padding) ?? styles$c.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$c.Container.tones[props.tone || styles$c.tone],\n styles$c.Container.base\n ];\n },\n \"forwardStates\": true\n }), true);\n insert(_el$, createComponent(Show, {\n get when() {\n return Boolean(props.icon && props.iconAlign !== \"right\");\n },\n get children() {\n return createComponent(Icon$3, mergeProps(() => props.icon, {\n get style() {\n return [styles$c.Icon.tones[props.tone ?? styles$c.tone], styles$c.Icon.base];\n }\n }));\n }\n }), null);\n insert(_el$, createComponent(Text$7, {\n get style() {\n return [styles$c.Text.tones[props.tone ?? styles$c.tone], styles$c.Text.base];\n },\n get tone() {\n return props.tone || styles$c.tone;\n },\n get children() {\n return props.title;\n }\n }), null);\n insert(_el$, createComponent(Show, {\n get when() {\n return Boolean(props.icon && props.iconAlign === \"right\");\n },\n get children() {\n return createComponent(Icon$3, mergeProps(() => props.icon, {\n get style() {\n var _a2;\n return [\n (_a2 = styles$c.Icon.tones) == null ? void 0 : _a2[props.tone ?? styles$c.tone],\n //\n styles$c.Icon.base\n ];\n }\n }));\n }\n }), null);\n return _el$;\n })();\n};\nconst { Button: { defaultTone: defaultTone$b, ...themeStyles$a } = { styles: {} } } = (_d = theme) == null ? void 0 : _d.componentConfig;\nconst container$b = {\n themeKeys: {\n textAlign: \"textAlign\",\n borderRadius: \"radius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\"\n },\n base: {\n height: theme.typography.button1.lineHeight + theme.spacer.xl * 2,\n display: \"flex\",\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n color: theme.color.interactiveNeutral,\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm,\n contentColor: theme.color.fillNeutral\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse\n },\n brand: {\n color: theme.color.interactiveBrand,\n focus: {\n color: theme.color.fillNeutral\n }\n }\n },\n themeStyles: themeStyles$a\n};\nconst content = {\n themeKeys: {\n color: \"contentColor\"\n },\n base: {\n color: theme.color.textNeutral\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.fillBrand\n }\n }\n },\n themeStyles: themeStyles$a\n};\nconst text$5 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.button1\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.fillBrand\n }\n }\n },\n themeStyles: themeStyles$a\n};\nconst Container$b = makeComponentStyles(container$b);\nconst Content = makeComponentStyles(content);\nconst Text$5 = makeComponentStyles(text$5);\nconst styles$b = {\n tone: defaultTone$b || \"neutral\",\n Container: Container$b,\n Content,\n Text: Text$5\n};\nconst Button = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$b.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$b.tone],\n styles$b.Container.base\n ];\n },\n forwardStates: true,\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n ...[(_a2 = props.style) == null ? void 0 : _a2.Text].flat(),\n //\n styles$b.Text.tones[props.tone ?? styles$b.tone],\n styles$b.Text.base\n ];\n },\n get children() {\n return props.children;\n }\n });\n }\n }));\n};\nconst ButtonContainer = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$b.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$b.tone],\n styles$b.Container.base\n ];\n },\n forwardStates: true\n }));\n};\nconst { Checkbox: { defaultTone: defaultTone$a, ...themeStyles$9 } = { styles: {} } } = (_e = theme) == null ? void 0 : _e.componentConfig;\nconst strokeWidth = theme.stroke.sm;\nconst size = theme.spacer.xxl;\nconst container$a = {\n themeKeys: {\n color: \"color\",\n borderRadius: \"borderRadius\",\n border: \"border\",\n justifyContent: \"justifyContent\"\n },\n base: {\n width: size,\n height: size,\n display: \"flex\",\n justifyContent: \"center\",\n color: theme.color.fillNeutral,\n alignItems: \"center\",\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverse,\n width: strokeWidth\n }\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n tones: {\n brand: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutralSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillBrand\n }\n },\n neutral: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillInverseSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutral\n }\n },\n inverse: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutralSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: strokeWidth\n },\n color: theme.color.fillInverse\n }\n }\n },\n modeKeys: [\"focus\", \"disabled\", \"checked\"],\n themeStyles: themeStyles$9\n};\nconst icon$1 = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n width: theme.spacer.lg,\n height: theme.spacer.lg,\n src: theme.asset.check\n },\n tones: {\n neutral: {\n color: theme.color.fillInverse\n },\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillInverse\n }\n },\n themeStyles: themeStyles$9\n};\nconst Container$a = makeComponentStyles(container$a);\nconst Icon$1 = makeComponentStyles(icon$1);\nconst styles$a = {\n tone: defaultTone$a || \"neutral\",\n Container: Container$a,\n Icon: Icon$1\n};\nconst check = \"/assets/images/check-icon.png\";\nconst Checkbox = (props) => {\n return createComponent(View, mergeProps({\n forwardStates: true\n }, props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$a.Container.tones[props.tone ?? styles$a.tone],\n styles$a.Container.base\n ];\n },\n get states() {\n return {\n checked: props.checked\n };\n },\n get children() {\n return memo(() => !!props.checked)() ? props.children || createComponent(Icon$3, {\n src: check,\n get style() {\n var _a2;\n return [\n ...[(_a2 = props.style) == null ? void 0 : _a2.Icon].flat(),\n //\n styles$a.Icon.tones[props.tone || styles$a.tone],\n styles$a.Icon.base\n ];\n }\n }) : \"\";\n }\n }));\n};\nconst { Column: { defaultTone: defaultTone$9, ...themeStyles$8 } = { styles: {} } } = (_f = theme) == null ? void 0 : _f.componentConfig;\nconst container$9 = {\n themeKeys: {\n gap: \"itemSpacing\",\n scrollIndex: \"scrollIndex\",\n itemTransition: \"itemTransition\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"flexStart\",\n flexDirection: \"column\",\n gap: theme.layout.gutterY,\n itemTransition: {\n ...theme.animation.standardEntrance,\n duration: theme.animation.duration.fast\n }\n },\n themeStyles: themeStyles$8\n};\nconst Container$9 = makeComponentStyles(container$9);\nconst styles$9 = {\n tone: defaultTone$9 || \"neutral\",\n Container: Container$9\n};\nconst Column = (props) => {\n const onUp = handleNavigation(\"up\");\n const onDown = handleNavigation(\"down\");\n return createComponent(View, mergeProps(props, {\n get onUp() {\n return chainFunctions(props.onUp, onUp);\n },\n get onDown() {\n return chainFunctions(props.onDown, onDown);\n },\n get selected() {\n return props.selected || 0;\n },\n forwardFocus: onGridFocus,\n get onSelectedChanged() {\n return chainFunctions(props.onSelectedChanged, props.scroll !== \"none\" ? withScrolling(props.y) : void 0);\n },\n get style() {\n return [...[props.style].flat(), styles$9.Container.tones[props.tone ?? styles$9.tone], styles$9.Container.base];\n }\n }));\n};\nconst { Label: { defaultTone: defaultTone$8, ...themeStyles$7 } = { styles: {} } } = (_g = theme) == null ? void 0 : _g.componentConfig;\nconst container$8 = {\n themeKeys: {\n color: \"backgroundColor\",\n borderRadius: \"radius\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"center\",\n color: theme.color.textNeutral,\n padding: [theme.spacer.md, theme.spacer.lg],\n // TODO themed padding values\n borderRadius: [theme.radius.md, theme.radius.md, theme.radius.md, theme.radius.none],\n height: theme.typography.caption1.lineHeight + theme.spacer.md,\n neutral: {\n backgroundColor: theme.color.fillNeutral\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.orange\n }\n }\n },\n themeStyles: themeStyles$7\n};\nconst text$4 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.caption1,\n color: theme.color.textInverse\n },\n tones: {\n inverse: {\n color: theme.color.textNeutral\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$7\n};\nconst Container$8 = makeComponentStyles(container$8);\nconst Text$4 = makeComponentStyles(text$4);\nconst styles$8 = {\n tone: defaultTone$8 || \"neutral\",\n Container: Container$8,\n Text: Text$4\n};\nconst Label = (props) => {\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2;\n return props.padding ?? ((_a2 = styles$8.Container.tones[props.tone ?? styles$8.tone]) == null ? void 0 : _a2.padding) ?? styles$8.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$8.Container.tones[props.tone || styles$8.tone],\n styles$8.Container.base\n ];\n },\n \"forwardStates\": true\n }), true);\n insert(_el$, createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$8.Text.tones[props.tone || styles$8.tone],\n styles$8.Text.base\n ];\n },\n get children() {\n return props.title;\n }\n }));\n return _el$;\n })();\n};\nconst { Rating: { styles: themeStyles$6, defaultTone: defaultTone$7 } = { styles: {}, defaultTone: \"neutral\" } } = (_h = theme) == null ? void 0 : _h.componentConfig;\nconst container$7 = {\n themeKeys: {\n justifyContent: \"justifyContent\",\n itemSpacing: \"itemSpacing\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n itemSpacing: theme.spacer.sm\n },\n toneModes: {},\n themeStyles: themeStyles$6\n};\nconst text$3 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n color: theme.color.textNeutral,\n ...theme.typography.body2\n },\n toneModes: {},\n themeStyles: themeStyles$6\n};\nconst icon = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n height: theme.typography.body2.lineHeight,\n width: theme.typography.body2.lineHeight,\n color: theme.color.fillNeutral,\n marginRight: theme.spacer.sm\n },\n toneModes: {},\n themeStyles: themeStyles$6\n};\nconst Container$7 = makeComponentStyles(container$7);\nconst Icon = makeComponentStyles(icon);\nconst Text$3 = makeComponentStyles(text$3);\nconst styles$7 = {\n tone: defaultTone$7,\n Container: Container$7,\n Text: Text$3,\n Icon\n};\nconst Rating = (props) => {\n const formatTitle = (title) => {\n if (typeof title !== \"string\" && typeof title !== \"number\" || !String(title).trim().length) {\n return;\n }\n let formatted = title;\n if (!Number.isNaN(title) && Number(title) >= 0 && Number(title) <= 100) {\n formatted += \"%\";\n }\n return formatted;\n };\n const formattedTitle = createMemo(() => formatTitle(props.title));\n return createComponent(View, mergeProps(props, {\n forwardStates: true,\n get style() {\n return [...[props.style].flat(), styles$7.Container.tones[props.tone || styles$7.tone], styles$7.Container.base];\n },\n get children() {\n return [createComponent(Show, {\n get when() {\n return props.src;\n },\n get children() {\n return createComponent(Icon$3, {\n forwardStates: true,\n get src() {\n return props.src;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Icon,\n //\n styles$7.Icon.tones[props.tone || styles$7.tone],\n styles$7.Icon.base\n ];\n }\n });\n }\n }), createComponent(Show, {\n get when() {\n return formattedTitle();\n },\n get children() {\n return createComponent(Text$7, {\n get marginRight() {\n return props.marginRight;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$7.Text.tones[props.tone || styles$7.tone],\n styles$7.Text.base\n ];\n },\n get children() {\n return formattedTitle();\n }\n });\n }\n })];\n }\n }));\n};\nconst { Details: { defaultTone: defaultTone$6, ...themeStyles$5 } = { styles: {} } } = (_i = theme) == null ? void 0 : _i.componentConfig;\nconst container$6 = {\n themeKeys: {\n alignItems: \"alignItems\",\n contentSpacing: \"contentSpacing\",\n badgeContentSpacing: \"badgeContentSpacing\",\n ratingContentSpacing: \"ratingContentSpacing\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n contentSpacing: theme.spacer.lg,\n badgeContentSpacing: theme.spacer.sm,\n ratingContentSpacing: theme.spacer.lg\n },\n themeStyles: themeStyles$5\n};\nconst text$2 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.body2,\n marginRight: theme.spacer.lg,\n color: theme.color.textNeutral\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverse,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutral,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$5\n};\nconst Container$6 = makeComponentStyles(container$6);\nconst Text$2 = makeComponentStyles(text$2);\nconst styles$6 = {\n tone: defaultTone$6 || \"neutral\",\n Container: Container$6,\n Text: Text$2\n};\nconst Details = (props) => {\n return createComponent(View, mergeProps({\n get style() {\n return [...[props.style].flat(), styles$6.Container.tones[props.tone || styles$6.tone], styles$6.Container.base];\n },\n forwardStates: true,\n onBeforeLayout: (node, dimensions) => {\n var _a2;\n if ((dimensions == null ? void 0 : dimensions.height) && node.parent) {\n node.parent.height = dimensions.height;\n (_a2 = node.parent) == null ? void 0 : _a2.updateLayout();\n }\n }\n }, props, {\n get children() {\n return [createComponent(Show, {\n get when() {\n return props.title;\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$6.Text.tones[props.tone || styles$6.tone],\n styles$6.Text.base\n ];\n },\n get children() {\n return props.title;\n }\n });\n }\n }), createComponent(For$1, {\n get each() {\n return props.badges;\n },\n children: (badge, idx) => createComponent(Badge, mergeProps(badge, {\n get marginRight() {\n var _a2, _b2, _c2, _d2, _e2, _f2, _g2;\n return ((_a2 = props.badges) == null ? void 0 : _a2.length) && idx() === props.badges.length - 1 ? ((_c2 = (_b2 = props.style) == null ? void 0 : _b2.Container) == null ? void 0 : _c2.contentSpacing) ?? ((_d2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _d2.contentSpacing) ?? styles$6.Container.base.contentSpacing : ((_f2 = (_e2 = props.style) == null ? void 0 : _e2.Container) == null ? void 0 : _f2.badgeContentSpacing) ?? ((_g2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _g2.badgeContentSpacing) ?? styles$6.Container.base.badgeContentSpacing;\n }\n }))\n }), createComponent(For$1, {\n get each() {\n return props.ratings;\n },\n children: (rating, idx) => createComponent(Rating, mergeProps(rating, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$6.Text.tones[props.tone || styles$6.tone],\n styles$6.Text.base\n ];\n },\n forwardStates: true,\n get marginRight() {\n var _a2, _b2, _c2, _d2;\n return ((_a2 = props.ratings) == null ? void 0 : _a2.length) && idx() === props.ratings.length - 1 ? 0 : ((_c2 = (_b2 = props.style) == null ? void 0 : _b2.Container) == null ? void 0 : _c2.ratingContentSpacing) ?? ((_d2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _d2.ratingContentSpacing) ?? styles$6.Container.base.ratingContentSpacing;\n }\n }))\n })];\n }\n }));\n};\nconst { Metadata: { defaultTone: defaultTone$5, ...themeStyles$4 } = { styles: {} } } = (_j = theme) == null ? void 0 : _j.componentConfig;\nconst container$5 = {\n themeKeys: {\n justifyContent: \"justifyContent\",\n alpha: \"alpha\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n alpha: theme.alpha.primary\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n themeStyles: themeStyles$4\n};\nconst titleText = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n maxLines: 1,\n contain: \"width\",\n ...theme.typography.headline3,\n color: theme.color.textNeutral\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverse,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutral,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$4\n};\nconst descriptionText = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n contain: \"width\",\n maxLines: 2,\n ...theme.typography.body2,\n color: theme.color.textNeutralSecondary\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverseSecondary,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutralSecondary,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$4\n};\nconst Container$5 = makeComponentStyles(container$5);\nconst DescriptionText = makeComponentStyles(descriptionText);\nconst TitleText = makeComponentStyles(titleText);\nconst styles$5 = {\n tone: defaultTone$5 || \"neutral\",\n Container: Container$5,\n TitleText,\n DescriptionText\n};\nconst Metadata = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n return [...[props.style].flat(), styles$5.Container.tones[props.tone || styles$5.tone], styles$5.Container.base];\n },\n forwardStates: true,\n get children() {\n return [createComponent(Text$7, {\n get width() {\n return props.width;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.TitleText,\n //\n styles$5.TitleText.tones[props.tone || styles$5.tone],\n styles$5.TitleText.base\n ];\n },\n get children() {\n return props.title;\n }\n }), createComponent(Show, {\n get when() {\n return props.description;\n },\n get children() {\n return createComponent(Text$7, {\n get width() {\n return props.width;\n },\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.DescriptionText, styles$5.DescriptionText.tones[props.tone || styles$5.tone], styles$5.DescriptionText.base];\n },\n get children() {\n return props.description;\n }\n });\n }\n }), createComponent(Details, mergeProps({\n get width() {\n return props.width;\n }\n }, () => props.details, {\n get tone() {\n return props.tone ?? styles$5.tone;\n }\n }))];\n }\n }));\n};\nconst { ProgressBar: { defaultTone: defaultTone$4, ...themeStyles$3 } = { styles: {} } } = (_k = theme) == null ? void 0 : _k.componentConfig;\nconst container$4 = {\n themeKeys: {\n color: \"barColor\",\n borderRadius: \"borderRadius\"\n },\n base: {\n height: theme.spacer.md,\n color: theme.color.fillNeutralTertiary,\n borderRadius: theme.radius.xs\n },\n tones: {\n inverse: {\n color: theme.color.fillInverseTertiary\n }\n },\n themeStyles: themeStyles$3\n};\nconst progress = {\n themeKeys: {\n color: \"progressColor\",\n borderRadius: \"borderRadius\"\n },\n base: {\n borderRadius: theme.radius.xs,\n color: theme.color.fillNeutral\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand\n }\n },\n themeStyles: themeStyles$3\n};\nconst Container$4 = makeComponentStyles(container$4);\nconst ProgressBar$1 = makeComponentStyles(progress);\nconst styles$4 = {\n tone: defaultTone$4 || \"neutral\",\n Container: Container$4,\n ProgressBar: ProgressBar$1\n};\nconst ProgressBar = (props) => {\n return createComponent(View, mergeProps(props, {\n forwardStates: true,\n get style() {\n return [...[props.style].flat(), styles$4.Container.tones[props.tone || styles$4.tone], styles$4.Container.base];\n },\n get children() {\n return createComponent(View, {\n forwardStates: true,\n get animationSettings() {\n return props.animationSettings;\n },\n get width() {\n return props.width * props.progress;\n },\n get color() {\n return props.progressColor;\n },\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.ProgressBar, styles$4.ProgressBar.tones[props.tone || styles$4.tone], styles$4.ProgressBar.base];\n }\n });\n }\n }));\n};\nconst { Row: { defaultTone: defaultTone$3, ...themeStyles$2 } = { styles: {} } } = (_l = theme) == null ? void 0 : _l.componentConfig;\nconst container$3 = {\n themeKeys: {\n gap: \"itemSpacing\",\n scrollIndex: \"scrollIndex\",\n itemTransition: \"itemTransition\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"flexStart\",\n flexDirection: \"row\",\n gap: theme.layout.gutterX,\n width: theme.layout.screenW,\n itemTransition: {\n ...theme.animation.standardEntrance,\n duration: theme.animation.duration.fast\n }\n },\n themeStyles: themeStyles$2\n};\nconst Container$3 = makeComponentStyles(container$3);\nconst styles$3 = {\n tone: defaultTone$3,\n Container: Container$3\n};\nconst Row = (props) => {\n const onLeft = handleNavigation(\"left\");\n const onRight = handleNavigation(\"right\");\n return createComponent(View, mergeProps(props, {\n get selected() {\n return props.selected || 0;\n },\n get onLeft() {\n return chainFunctions(props.onLeft, onLeft);\n },\n get onRight() {\n return chainFunctions(props.onRight, onRight);\n },\n forwardFocus: onGridFocus,\n get onSelectedChanged() {\n return chainFunctions(props.onSelectedChanged, props.scroll !== \"none\" ? withScrolling(props.x) : void 0);\n },\n get tone() {\n return props.tone ?? styles$3.tone;\n },\n get style() {\n return [...[props.style].flat(), styles$3.Container.tones[props.tone || styles$3.tone], styles$3.Container.base];\n },\n get states() {\n return props.tone ?? styles$3.tone;\n }\n }));\n};\nconst { Keyboard: { defaultTone: defaultTone$2, ...themeStyles$1 } = { styles: {} } } = (_m = theme) == null ? void 0 : _m.componentConfig;\nconst container$2 = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n screenW: \"screenW\",\n marginX: \"marginX\"\n },\n base: {\n keySpacing: theme.spacer.md,\n screenW: theme.layout.screenW,\n marginX: theme.layout.marginX,\n height: 100\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$1\n};\nconst key = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n textAlign: \"textAlign\",\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\",\n baseWidth: \"baseWidth\",\n sizes: \"sizes\",\n contentColor: \"contentColor\"\n // what is this used for\n },\n base: {\n keySpacing: theme.spacer.md,\n height: theme.spacer.md * 9,\n paddingX: theme.spacer.md,\n sizes: {\n sm: 1,\n md: 2,\n lg: 3,\n xl: 4,\n xxl: 5\n },\n contentColor: theme.color.fillNeutral,\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n baseWidth: theme.spacer.md * 7,\n color: theme.color.interactiveNeutral,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled,\n contentColor: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse,\n focus: {\n color: theme.color.interactiveInverseFocus,\n contentColor: theme.color.fillNeutral\n }\n },\n brand: {\n focus: {\n contentColor: theme.color.fillNeutral\n }\n }\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$1\n};\nconst text$1 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.headline2\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n focus: {\n color: theme.color.textNeutral\n }\n }\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$1\n};\nconst Container$2 = makeComponentStyles(container$2);\nconst Key$1 = makeComponentStyles(key);\nconst Text$1 = makeComponentStyles(text$1);\nconst styles$2 = {\n tone: defaultTone$2,\n Container: Container$2,\n Key: Key$1,\n // TODO why was this wrapped in {}?\n Text: Text$1\n};\nconst { Key: { defaultTone: defaultTone$1, ...themeStyles } = { styles: {} } } = (_n = theme) == null ? void 0 : _n.componentConfig;\nconst container$1 = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n textAlign: \"textAlign\",\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\",\n baseWidth: \"baseWidth\",\n sizes: \"sizes\",\n contentColor: \"contentColor\"\n },\n base: {\n keySpacing: theme.spacer.md,\n height: theme.spacer.md * 9,\n paddingX: theme.spacer.md,\n contentColor: theme.color.fillNeutral,\n sizes: {\n sm: 1,\n md: 2,\n lg: 3,\n xl: 4,\n xxl: 5\n },\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n baseWidth: theme.spacer.md * 7,\n color: theme.color.interactiveNeutral,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled,\n contentColor: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse,\n focus: {\n color: theme.color.interactiveInverseFocus,\n contentColor: theme.color.fillNeutral\n }\n },\n brand: {\n focus: {\n contentColor: theme.color.fillNeutral\n }\n }\n },\n themeStyles\n};\nconst text = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.headline2\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n focus: {\n color: theme.color.textNeutral\n }\n }\n },\n themeStyles\n};\nconst Container$1 = makeComponentStyles(container$1);\nconst Text = makeComponentStyles(text);\nconst styles$1 = {\n tone: defaultTone$1 || \"neutral\",\n Container: Container$1,\n Text\n};\nconst Key = (props) => {\n const style1 = (props == null ? void 0 : props.style) ?? styles$1;\n return createComponent(ButtonContainer, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$1.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$1.tone],\n styles$1.Container.base\n ];\n },\n forwardStates: true,\n get width() {\n var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2;\n return (((_d2 = (_c2 = (_b2 = (_a2 = style1.Container) == null ? void 0 : _a2.tones) == null ? void 0 : _b2[props.tone ?? styles$1.tone]) == null ? void 0 : _c2.sizes) == null ? void 0 : _d2[props.size || \"sm\"]) ?? style1.Container.base.sizes[props.size || \"sm\"]) * (((_g2 = (_f2 = (_e2 = style1.Container) == null ? void 0 : _e2.tones) == null ? void 0 : _f2[props.tone ?? styles$1.tone]) == null ? void 0 : _g2.baseWidth) ?? style1.Container.base.baseWidth) + (((_i2 = (_h2 = style1.Container.tones) == null ? void 0 : _h2[props.tone ?? styles$1.tone]) == null ? void 0 : _i2.keySpacing) ?? style1.Container.base.keySpacing) * (((_l2 = (_k2 = (_j2 = style1.Container.tones) == null ? void 0 : _j2[props.tone ?? styles$1.tone]) == null ? void 0 : _k2.sizes) == null ? void 0 : _l2[props.size || \"sm\"]) ?? style1.Container.base.sizes[props.size || \"sm\"] - 1);\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$1.Text.tones[props.tone ?? styles$1.tone],\n styles$1.Text.base\n ];\n },\n get children() {\n return props.title ? props.title : \"\";\n }\n });\n }\n }));\n};\nconst KeyboardSimple = (props) => {\n return createComponent(Column, {\n get autofocus() {\n return props.autofocus;\n },\n plinko: true,\n get itemSpacing() {\n var _a2;\n return props.keySpacing ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.keySpacing) ?? styles$2.Container.base.keySpacing;\n },\n get justifyContent() {\n return props.centerKeyboard && props.centerKeyboard ? \"center\" : \"flexStart\";\n },\n get children() {\n return createComponent(For, {\n get each() {\n return props.formats;\n },\n children: (row) => createComponent(Row, {\n get justifyContent() {\n return props.centerKeys && props.centerKeys ? \"center\" : \"flexStart\";\n },\n get itemSpacing() {\n var _a2;\n return props.keySpacing ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.keySpacing) ?? styles$2.Container.base.keySpacing;\n },\n get height() {\n var _a2;\n return (props == null ? void 0 : props.height) ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.height) ?? styles$2.Container.base.height;\n },\n get wrap() {\n return props.rowWrap;\n },\n get children() {\n return createComponent(For, {\n each: row,\n children: (key2) => createComponent(Key, mergeProps({\n get style() {\n var _a2;\n return (_a2 = props.style) == null ? void 0 : _a2.Key;\n }\n }, typeof key2 === \"string\" ? {} : key2, {\n get title() {\n return key2.title || key2.icon ? key2.title : key2;\n }\n }))\n });\n }\n })\n });\n }\n });\n};\nconst Keyboard = (props) => {\n return createComponent(KeyboardSimple, mergeProps(props, {\n get style() {\n return [...[props.style].flat(), styles$2.Container.tones[props.tone ?? styles$2.tone], styles$2.Container.base];\n }\n }));\n};\nconst { Tile: { defaultTone, ...tileThemeStyles } = { styles: {} } } = (_o = theme) == null ? void 0 : _o.componentConfig;\nconst { Surface: { defaultSurfaceTone, ...surfaceThemeStyles } = { styles: {} } } = (_p = theme) == null ? void 0 : _p.componentConfig;\nconst container = {\n themeKeys: {\n alpha: \"alpha\",\n paddingYProgress: \"paddingYProgress\"\n },\n base: {\n width: 400,\n height: 240,\n padding: [40, 10],\n // TODO support separate paddingX and paddingY values from theme, possibly formatter\n paddingYProgress: theme.spacer.xl,\n paddingYBetweenContent: theme.spacer.md,\n borderRadius: theme.radius.md,\n alpha: theme.alpha.primary\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n themeStyles: {\n ...surfaceThemeStyles,\n ...tileThemeStyles\n }\n};\nconst insetBottom = {\n themeKeys: {},\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n mountY: 1\n },\n themeStyles: tileThemeStyles\n};\nconst standardBottom = {\n themeKeys: {},\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\"\n },\n themeStyles: tileThemeStyles\n};\nconst logoContainer = {\n themeKeys: {},\n base: {\n width: theme.spacer.lg * 5,\n height: theme.spacer.xxl + theme.spacer.md\n },\n themeStyles: tileThemeStyles\n};\nconst Container = makeComponentStyles(container);\nconst InsetBottom = makeComponentStyles(insetBottom);\nconst StandardBottom = makeComponentStyles(standardBottom);\nconst LogoContainer = makeComponentStyles(logoContainer);\nconst styles = {\n tone: defaultTone || defaultSurfaceTone || \"neutral\",\n Container,\n InsetBottom,\n StandardBottom,\n LogoContainer\n};\nconst Tile = (props) => {\n const [isFocused, setIsFocused] = createSignal(false);\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2;\n return props.padding ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.padding) ?? styles.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n \"onFocus\": () => setIsFocused(true),\n \"onBlur\": () => setIsFocused(false),\n get style() {\n return [...[props.style].flat(), styles.Container.tones[props.tone ?? styles.tone], styles.Container.base];\n }\n }), true);\n insert(_el$, createComponent(Artwork, mergeProps(() => props.artwork, {\n get tone() {\n return props.tone ?? styles.tone;\n },\n get width() {\n var _a2;\n return props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width;\n },\n get height() {\n var _a2;\n return props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height;\n }\n })), null);\n insert(_el$, createComponent(Show, {\n get when() {\n return props.persistentMetadata || isFocused();\n },\n get children() {\n return [createComponent(View, {\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[1]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[1]) ?? styles.Container.base.padding[1];\n },\n get children() {\n return props.topLeft;\n }\n }), createComponent(View, {\n get x() {\n var _a2, _b2, _c2;\n return ((props == null ? void 0 : props.width) ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[0]) ?? ((_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0]);\n },\n get y() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[1]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[1]) ?? styles.Container.base.padding[1];\n },\n mountX: 1,\n get children() {\n return props.topRight;\n }\n }), createComponent(View, {\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.InsetBottom, styles.InsetBottom.tones[props.tone ?? styles.tone], styles.InsetBottom.base];\n },\n get width() {\n var _a2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - styles.Container.base.padding[0] * 2;\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2, _d2, _e2, _f2;\n return (props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) - (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]) - (((_e2 = props.progressBar) == null ? void 0 : _e2.progress) > 0 ? props.paddingYProgress ?? ((_f2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _f2.paddingYProgress) ?? styles.Container.base.paddingYProgress : 0);\n },\n get children() {\n return props.inset;\n }\n }), createComponent(View, {\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.StandardBottom, styles.StandardBottom.tones[props.tone ?? styles.tone], styles.StandardBottom.base];\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2, _d2;\n return Number(props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) + (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]);\n },\n get width() {\n var _a2, _b2, _c2, _d2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]) * 2;\n },\n get children() {\n return props.bottom;\n }\n })];\n }\n }), null);\n insert(_el$, createComponent(Show, {\n get when() {\n var _a2;\n return ((_a2 = props.progressBar) == null ? void 0 : _a2.progress) ? props.progressBar.progress > 0 : 0;\n },\n get children() {\n return createComponent(ProgressBar, mergeProps(() => props.progressBar, {\n get width() {\n var _a2, _b2, _c2, _d2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[0]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[0]) ?? styles.Container.base.padding[0]) * 2;\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2;\n return (props.height ?? props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) - (props.paddingYProgress ?? ((_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.paddingYProgress) ?? styles.Container.base.paddingYProgress) - (((_c2 = props == null ? void 0 : props.progressBar) == null ? void 0 : _c2.height) || 0);\n }\n }));\n }\n }), null);\n return _el$;\n })();\n};\nexport {\n Artwork,\n Badge,\n Button,\n ButtonContainer,\n Checkbox,\n Column,\n Icon$3 as Icon,\n Keyboard,\n Label,\n Metadata,\n ProgressBar,\n Row,\n Tile,\n styles$e as artworkStyles,\n assertTruthy,\n styles$c as badgeStyles,\n styles$b as buttonStyles,\n chainFunctions,\n styles$a as checkboxStyles,\n styles$9 as columnStyles,\n handleNavigation,\n styles$d as iconStyles,\n styles$2 as keyboardStyles,\n styles$8 as labelStyles,\n makeComponentStyles,\n styles$5 as metadataStyles,\n onGridFocus,\n styles$4 as progressBarStyles,\n styles$3 as rowStyles,\n scrollToIndex,\n styles as tileStyles,\n useItemLayout,\n withScrolling\n};\n//# sourceMappingURL=index.js.map\n","import { IntrinsicNodeStyleProps, hexColor } from \"@lightningjs/solid\";\nimport theme from \"theme\";\n\nexport default {\n Column: {\n flexDirection: \"column\",\n display: \"flex\",\n width: 320,\n height: 600,\n y: 360,\n gap: 20,\n zIndex: 101,\n transition: {\n x: {\n duration: 250,\n easing: \"ease-in-out\",\n },\n },\n x: 8,\n focus: {\n x: theme.layout.marginX,\n },\n } satisfies IntrinsicNodeStyleProps,\n Gradient: {\n zIndex: 99,\n color: hexColor(\"#000000\"),\n src: \"./assets/sidenav.png\",\n alpha: 0,\n width: 1200,\n height: 1080,\n focus: {\n alpha: 1,\n },\n transition: { alpha: true },\n } satisfies IntrinsicNodeStyleProps,\n NavButton: {\n zIndex: 102,\n height: 70,\n width: 100,\n borderRadius: 8,\n focus: {\n color: hexColor(\"#424242\"),\n },\n active: {\n width: 328,\n height: 70,\n },\n } satisfies IntrinsicNodeStyleProps,\n};\n","import { For, IntrinsicNodeProps, View } from \"@lightningjs/solid\";\nimport { createSpriteMap } from \"@lightningjs/solid-primitives\";\n// Icons from https://uxwing.com/\n\nconst basePath = import.meta.env.BASE_URL;\n\nconst icons = [\n { name: \"experiment\", width: 81, height: 100, x: 0, y: 0 },\n { name: \"trending\", width: 100, height: 56, x: 81, y: 0 },\n { name: \"tv\", width: 100, height: 68, x: 181, y: 0 },\n { name: \"movie\", width: 94, height: 100, x: 282, y: 0 },\n];\n\ninterface IconProps extends IntrinsicNodeProps {\n name: string;\n}\n\nfunction Icon(props: IconProps) {\n const sprite = createSpriteMap(basePath + \"assets/icons_white.png\", icons);\n\n return (\n \n );\n}\n\nexport default Icon;\nexport function PreviewIcons() {\n return (\n <>\n \n \n {(icon, i) => }\n \n \n );\n}\n","import { useNavigate } from \"@solidjs/router\";\nimport {\n View,\n Text,\n IntrinsicNodeProps,\n ElementNode,\n} from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport styles from \"./NavDrawer.styles\";\nimport Icon from \"../Icon\";\nimport theme from \"theme\";\n\ninterface NavButtonProps extends IntrinsicNodeProps {\n icon: string;\n children: string;\n}\n\nfunction NavButton(props: NavButtonProps) {\n return (\n \n \n \n \n \n {props.children}\n \n \n );\n}\n\nexport default function NavDrawer(props) {\n let backdrop;\n const navigate = useNavigate();\n\n function onFocus(this: ElementNode) {\n backdrop.states.add(\"focus\");\n this.children.forEach((c) => c.states!.add(\"active\"));\n this.children.selected!.setFocus();\n }\n\n function onBlur(this: ElementNode) {\n backdrop.states.remove(\"focus\");\n this.selected = 0;\n this.children.forEach((c) => c.states!.remove(\"active\"));\n }\n\n return (\n <>\n \n navigate(\"/browse/all\")} icon=\"trending\">\n Trending\n \n navigate(\"/browse/movie\")}>\n Movies\n \n navigate(\"/browse/tv\")}>\n TV\n \n navigate(\"/examples\")}>\n Examples\n \n \n \n \n );\n}\n","import { View, Text, hexColor } from \"@lightningjs/solid\";\nimport { createSignal } from \"solid-js\";\nimport { debounce } from \"@solid-primitives/scheduled\";\n\nconst fpsStyle = {\n color: 0x000000ff,\n height: 90,\n width: 330,\n x: 1500,\n y: 20,\n alpha: 0.8,\n zIndex: 100,\n};\n\nconst fpsLabel = {\n x: 10,\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n};\n\nconst fpsValue = {\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n};\n\nconst [fps, setFps] = createSignal(0);\nconst [avgFps, setAvgFps] = createSignal(0);\nconst [minFps, setMinFps] = createSignal(99);\nconst [maxFps, setMaxFps] = createSignal(0);\n\nlet count = 0;\nlet totalFps = 0;\n\nconst resetCounter = debounce(() => {\n // clear fps\n totalFps = 0;\n count = 0;\n setMinFps(99);\n}, 10000);\n\n// Clear min fps after 10 seconds to avoid showing a low fps\n// setTimeout(() => setMinFps(99), 9999);\n\nconst calcFps = (fps: number) => {\n if (!fps) return;\n\n setFps(fps);\n setMinFps((prev) => Math.min(fps, prev));\n setMaxFps((prev) => Math.max(fps, prev));\n\n totalFps += fps;\n count++;\n\n setAvgFps(Math.round(totalFps / count));\n\n resetCounter();\n};\n\nexport function setupFPS(root) {\n root.renderer.on(\"fpsUpdate\", (target, fpsData) => {\n const fps = typeof fpsData === \"number\" ? fpsData : fpsData.fps;\n if (fps > 5) {\n calcFps(fps);\n }\n });\n}\n\nexport const FPSCounter = (props) => {\n return (\n \n \n FPS:\n \n {fps().toString()}\n \n \n\n \n AVG:\n \n {avgFps().toString()}\n \n \n\n \n MIN:\n \n {minFps().toString()}\n \n \n\n \n MAX:\n \n {maxFps().toString()}\n \n \n \n );\n};\n","import { useNavigate } from \"@solidjs/router\";\nimport { View, activeElement, hexColor, renderer } from \"@lightningjs/solid\";\nimport { useFocusManager, useAnnouncer } from \"@lightningjs/solid-primitives\";\nimport Background from \"../components/Background\";\nimport NavDrawer from \"../components/NavDrawer/NavDrawer\";\nimport { FocusRing } from \"../components\";\nimport { FPSCounter, setupFPS } from \"../components/FPSCounter\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\nimport { onMount } from \"solid-js\";\n\ndeclare module \"@lightningjs/solid-primitives\" {\n // Augment the FocusManager KeyMap interface with our custom keys\n interface KeyMap {\n Announcer: string;\n Menu: string;\n Escape: string;\n }\n}\n\ndeclare module \"@lightningjs/solid\" {\n interface ElementNode {\n heroContent?: boolean;\n backdrop?: any;\n entityInfo?: any;\n href?: string;\n }\n}\n\nconst App = (props) => {\n useFocusManager({\n Announcer: \"a\",\n Menu: \"m\",\n Escape: \"Escape\",\n });\n const announcer = useAnnouncer();\n announcer.enabled = false;\n const navigate = useNavigate();\n\n let focusRingRef, navDrawer, lastFocused, happy;\n\n onMount(() => {\n setupFPS({ renderer });\n });\n\n return (\n (announcer.enabled = !announcer.enabled)}\n onLast={() => history.back()}\n onMenu={() => navigate(\"/\")}\n style={{ width: 1920, height: 1080 }}\n onLeft={() => {\n if (navDrawer.states.has(\"focus\")) {\n return false;\n }\n lastFocused = activeElement();\n navDrawer.setFocus();\n }}\n onRight={() => navDrawer.states.has(\"focus\") && lastFocused.setFocus()}\n >\n \n \n\n {props.children}\n\n \n {/* */}\n \n );\n};\n\nexport default App;\n","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n hexColor,\n} from \"@lightningjs/solid\";\nimport theme from \"theme\";\n\n// Augment existing intrinsic style prop interfaces to include our own\n// app-specific states\ndeclare module \"@lightningjs/solid\" {\n interface IntrinsicNodeStyleProps {\n // TODO: Refactor states to use a $ prefix\n active?: IntrinsicNodeStyleProps;\n disabled?: IntrinsicNodeStyleProps;\n }\n\n interface IntrinsicTextNodeStyleProps {\n // TODO: Refactor states to use a $ prefix\n active?: IntrinsicTextNodeStyleProps;\n disabled?: IntrinsicTextNodeStyleProps;\n }\n}\n\nexport default {\n Page: {\n width: 1920,\n height: 1080,\n },\n headlineText: {\n width: 1200,\n height: 240,\n x: 360,\n // lineHeight: 170, // TODO: Add back when lineHeight is supported\n y: 455,\n contain: \"both\",\n fontSize: 66,\n textAlign: \"center\",\n } satisfies IntrinsicTextNodeStyleProps,\n headlineSubText: {\n width: 960,\n height: 170,\n // lineHeight: 170, // TODO: Add back when lineHeight is supported\n x: 530,\n y: 655,\n contain: \"both\",\n fontSize: 48,\n textAlign: \"center\",\n } satisfies IntrinsicTextNodeStyleProps,\n itemsContainer: {\n width: theme.layout.screenW,\n height: 600,\n y: 560,\n x: 0,\n zIndex: 2,\n },\n Thumbnail: {\n borderRadius: 16,\n width: 185,\n height: 278,\n scale: 1,\n zIndex: 2,\n transition: { scale: { duration: 250, easing: \"ease-in-out\" } },\n border: { width: 0, color: 0x00000000 },\n focus: { scale: 1.1, border: { color: 0xffffff66, width: 8 } },\n },\n FocusRing: {\n borderRadius: 16,\n width: 194,\n height: 286,\n y: -5,\n x: -5,\n zIndex: -1,\n },\n FPS: {\n color: 0x000000ff,\n height: 42,\n width: 140,\n x: 20,\n y: 20,\n zIndex: 100,\n } as const,\n FPSLabel: {\n x: 10,\n y: 0,\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n },\n FPSValue: {\n x: 90,\n y: 0,\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n },\n showHeadline: { x: 70, y: 20 },\n headlineBlur: {\n width: 1920,\n height: 150,\n x: 0,\n y: 0,\n zIndex: 14,\n alpha: 0.9,\n color: hexColor(\"#000000\"),\n },\n RowTitle: {\n height: 60,\n width: 300,\n marginTop: 20,\n fontSize: 36,\n color: hexColor(\"#f0f0f0\"),\n zIndex: 2,\n } satisfies IntrinsicTextNodeStyleProps,\n Row: {\n display: \"flex\",\n justifyContent: \"spaceBetween\",\n height: 300,\n },\n Column: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n gap: 20,\n width: theme.layout.screenW - 2 * theme.layout.marginX,\n x: theme.layout.marginX + theme.layout.gutterX,\n y: 48,\n transition: { y: { duration: 250, easing: \"ease-in-out\" } },\n zIndex: 2,\n },\n Rect: {\n width: 250,\n height: 100,\n y: 10,\n x: 300,\n color: hexColor(\"#0000ff\"),\n },\n peopleBio: {\n ...theme.typography.body1,\n contain: \"both\",\n width: 1500,\n height: 400,\n } satisfies IntrinsicTextNodeStyleProps,\n} as const;\n\nconst Button = {\n width: 120,\n height: 40,\n color: hexColor(\"#000000\"),\n borderRadius: 8,\n border: { width: 2, color: hexColor(\"#3333ff\") },\n scale: 1,\n focus: {\n scale: 1.1,\n border: { width: 5, color: hexColor(\"#333333\") },\n },\n transition: { scale: true, color: true },\n} satisfies IntrinsicNodeStyleProps;\n\nconst TopBar = {\n color: hexColor(\"#00A699\"),\n height: 8,\n y: 2,\n x: -4,\n width: Button.width + 8,\n} satisfies IntrinsicNodeStyleProps;\n\nconst ButtonText = {\n fontSize: 12,\n y: 12,\n // lineHeight: Button.height, // TODO: Add back when lineHeight is supported\n contain: \"width\",\n textAlign: \"center\",\n color: hexColor(\"#F6F6F9\"),\n height: Button.height,\n width: Button.width,\n} satisfies IntrinsicTextNodeStyleProps;\n\nexport const buttonStyles = {\n container: Button,\n topBar: TopBar,\n text: ButtonText,\n} satisfies Record;\n\nexport const MaterialButton = {\n width: 386,\n height: 136,\n color: hexColor(\"#715cab\"),\n focus: {\n color: hexColor(\"#5a39a2\"),\n },\n disabled: {\n color: hexColor(\"#291d43\"),\n },\n} satisfies IntrinsicNodeStyleProps;\n\nexport const MaterialButtonText = {\n fontSize: 32,\n contain: \"width\",\n textAlign: \"center\",\n mountY: -0.35,\n color: hexColor(\"#FFFFFF\"),\n height: MaterialButton.height,\n width: MaterialButton.width,\n // lineHeight: MaterialButton.height, // TODO: Add back when lineHeight is supported\n focus: {\n fontSize: 40,\n },\n disabled: {\n color: hexColor(\"#909090\"),\n },\n} satisfies IntrinsicTextNodeStyleProps;\n","import { IntrinsicNodeProps, View, Text } from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { For, splitProps } from \"solid-js\";\nimport styles, { buttonStyles } from \"../styles\";\nimport { type Tile } from \"../api/formatters/ItemFormatter\";\n\nexport function Thumbnail(props: IntrinsicNodeProps) {\n return ;\n}\n\nexport function FocusRing(props: IntrinsicNodeProps) {\n return ;\n}\n\nexport interface TileRowProps extends IntrinsicNodeProps {\n items: Tile[];\n}\n\nexport function TileRow(props: TileRowProps) {\n const [local, others] = splitProps(props, [\"items\"]);\n\n return (\n \n {(item) => }\n \n );\n}\n\nexport function Button(props) {\n return (\n \n {props.children}\n \n );\n}\n","export default 'eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyZDE4YjEwMTA0YjdiZTlkNjFiMWYwYjVlMGEwNzM2OCIsInN1YiI6IjYwZTVjMTdlNGNhNjc2MDA3NTA4Njc3MSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.D_nqH9kd-bhhWzeVsTDPYhHnsUaNAuyAa6YATmKHqsA';\n","import API_KEY_V4 from \"./key\";\nconst API_BASE = \"https://api.themoviedb.org/3\";\nlet tmdbConfig;\nlet baseImageUrl;\nconst basePosterSize = \"w185\";\n\nconst defaultFetchParams = {\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: \"Bearer \" + API_KEY_V4,\n },\n};\n\nexport function getImageUrl(path: string, posterSize: string = basePosterSize) {\n return baseImageUrl + posterSize + path;\n}\n\nfunction get(path: string, params: RequestInit = {}) {\n if (tmdbConfig) {\n return _get(path, params);\n } else {\n return loadConfig().then(() => _get(path, params));\n }\n}\n\nfunction _get(path: string, params: RequestInit = {}) {\n return fetch(API_BASE + path, {\n ...defaultFetchParams,\n ...params,\n }).then((r) => r.json());\n}\n\nfunction loadConfig() {\n return _get(\"/configuration\").then((data) => {\n tmdbConfig = data;\n baseImageUrl = data.images?.secure_base_url;\n return data;\n });\n}\n\nexport default {\n get,\n loadConfig,\n};\n","import { getImageUrl } from \"../index\";\n\nfunction truncateString(str: string, maxLength: number): string {\n if (str.length > maxLength) {\n return str.substring(0, maxLength - 3) + \"...\";\n }\n return str;\n}\n\nexport function chunkArray(array: string[], size = 7) {\n let result: string[][] = [];\n for (let i = 0, j = array.length; i < j; i += size) {\n result.push(array.slice(i, i + size));\n }\n return result;\n}\n\nexport interface Tile {\n src: string;\n tileSrc: string;\n backdrop: string;\n href: string;\n shortTitle: string;\n title: string;\n data: unknown;\n entityInfo: {\n type: string;\n id: string;\n };\n heroContent: {\n title: string;\n description: string;\n };\n}\n\n// TODO: Remove `any` type\nexport function convertItemsToTiles(items: any[] = []): Tile[] {\n return items.map((item) => ({\n src: getImageUrl(item.poster_path || item.profile_path),\n tileSrc: getImageUrl(item.backdrop_path || item.profile_path, \"w300\"),\n backdrop: getImageUrl(item.backdrop_path, \"w1280\"),\n href: `/entity/${item.media_type || \"people\"}/${item.id}`,\n shortTitle: truncateString(item.title || item.name, 30),\n title: item.title || item.name,\n data: item,\n entityInfo: {\n type: item.media_type || \"people\",\n id: item.id,\n },\n heroContent: {\n title: item.title || item.name,\n description: item.overview,\n },\n }));\n}\n","import api from \"..\";\nimport { convertItemsToTiles, chunkArray } from \"../formatters/ItemFormatter\";\n\nlet cache = new Map();\nconst leftoverTiles = new Map();\n\nexport default function (filter: string) {\n return (pageIndex: number): Promise => {\n const url = `/trending/${filter}/week?page=${pageIndex}`;\n if (cache.has(url)) {\n return cache.get(url);\n }\n\n let result = api.get(url).then((trending) => {\n let results = trending.results.filter((r) => !r.adult);\n let tiles = (\n leftoverTiles.has(filter) ? leftoverTiles.get(filter) : []\n ).concat(convertItemsToTiles(results));\n let chunks = chunkArray(tiles);\n if (chunks[chunks.length - 1].length < 7) {\n leftoverTiles.set(filter, chunks.pop());\n } else {\n leftoverTiles.delete(filter);\n }\n return chunks;\n });\n\n cache.set(url, result);\n return result;\n };\n}\n","import { createSignal, createComputed, batch, createResource } from \"solid-js\";\n\nexport function createInfiniteScroll(fetcher: (page: number) => Promise) {\n const [pages, setPages] = createSignal([]);\n const [page, setPage] = createSignal(1);\n const [end, setEnd] = createSignal(false);\n\n const [contents] = createResource(page, fetcher);\n\n createComputed(() => {\n const content = contents();\n if (!content) return;\n batch(() => {\n if (content.length === 0) setEnd(true);\n setPages((p) => [...p, ...content]);\n });\n });\n\n return {\n pages,\n page,\n setPage,\n setPages,\n end,\n setEnd,\n };\n}\n","import {\n View,\n Text,\n Show,\n IntrinsicNodeStyleProps,\n For,\n} from \"@lightningjs/solid\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nimport theme from \"theme\";\nwithPadding;\n\nconst blockWidth = 1100;\nconst HeadlineStyles = {\n ...theme.typography.display2,\n width: blockWidth,\n height: 58,\n contain: \"both\",\n};\nconst Headline = (props) => (\n \n {props.children}\n \n);\n\nconst DescriptionStyles = {\n ...theme.typography.body1,\n width: blockWidth,\n height: 72,\n contain: \"both\",\n};\n\nconst BadgeStyle = {\n fontSize: 20,\n lineHeight: 20,\n};\n\nconst Description = (props) => (\n \n {props.children}\n \n);\n\nfunction getReviews(reviews) {\n return (\n <>\n \n \n {reviews.rtCrit + \"%\"}\n \n \n \n {reviews.rtFan + \"%\"}\n \n \n );\n}\n\nconst Badge = (props) => {\n return (\n \n {props.children}\n \n );\n};\n\nconst MetaTextStyle = theme.typography.body2;\n\nconst Metadata = (props) => (\n \n {props.metaText}\n {(item) => {item}}\n {getReviews(props.reviews)}\n \n);\n\nconst ContentBlock = (props) => {\n const style = {\n display: \"flex\",\n flexDirection: \"column\",\n width: blockWidth,\n height: 160,\n gap: 16,\n };\n return (\n \n {props.title}\n {props.description}\n \n \n );\n};\n\nexport default ContentBlock;\n","import api, { getImageUrl } from \"..\";\nimport { convertItemsToTiles } from \"../formatters/ItemFormatter\";\n\nexport function minutesToHMM(minutes) {\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return (\n hours + \"h \" + (remainingMinutes < 10 ? \"0\" : \"\") + remainingMinutes + \"m\"\n );\n}\n\nfunction justYear(dateString) {\n const parts = dateString.split(\"-\");\n return parts[0];\n}\n\nexport function getRecommendations({ type, id }) {\n return api.get(`/${type}/${id}/recommendations`).then(({ results }) => {\n if (results.length) {\n return convertItemsToTiles(results.slice(0, 7));\n }\n return api\n .get(`/trending/${type}/week?page=1`)\n .then(({ results }) => convertItemsToTiles(results.slice(0, 7)));\n });\n}\n\nexport function getCredits({ type, id }) {\n return api\n .get(`/${type}/${id}/credits`)\n .then(({ cast }) => convertItemsToTiles(cast.slice(0, 7)));\n}\n\nexport function getInfo({ type, id }) {\n let rt =\n type === \"movie\"\n ? {\n rtCrit: 86,\n rtFan: 92,\n }\n : {};\n\n return api.get(`/${type}/${id}`).then((data) => ({\n backgroundImage: getImageUrl(data.backdrop_path, \"original\"),\n heroContent: {\n title: data.title || data.name,\n description: data.overview,\n badges: [\"HD\"],\n metaText:\n type === \"movie\"\n ? minutesToHMM(data.runtime) + \" - \" + data.release_date\n : `${justYear(data.first_air_date)} - ${justYear(data.last_air_date)}`,\n reviews: rt,\n },\n ...data,\n }));\n}\n","import {\n createEffect,\n createMemo,\n on,\n createSignal,\n Show,\n createResource,\n createSelector,\n For,\n} from \"solid-js\";\nimport { ElementNode, View, activeElement } from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport { useNavigate, useParams } from \"@solidjs/router\";\nimport { TileRow } from \"../components\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\nimport browseProvider from \"../api/providers/browse\";\nimport { createInfiniteScroll } from \"../components/pagination\";\nimport ContentBlock from \"../components/ContentBlock\";\nimport * as entityProvider from \"../api/providers/entity\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\n\nconst Browse = () => {\n const params = useParams();\n const [columnY, setcolumnY] = createSignal(0);\n const [entityInfo, setEntityInfo] = createSignal();\n const [entityData] = createResource(entityInfo, entityProvider.getInfo);\n const [heroContent, setHeroContent] = createSignal({});\n const navigate = useNavigate();\n const isFirst = createSelector(() => {\n return 0;\n });\n\n const provider = createMemo(() => {\n return createInfiniteScroll(browseProvider(params.filter || \"all\"));\n });\n\n createEffect(\n on(\n activeElement,\n (elm) => {\n if (elm.backdrop) {\n setGlobalBackground(elm.backdrop);\n }\n // if (elm.entityInfo) {\n // setEntityInfo(elm.entityInfo);\n // }\n if (elm.heroContent) {\n setHeroContent(elm.heroContent);\n }\n },\n { defer: true },\n ),\n );\n\n function onRowFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setcolumnY((this.y || 0) * -1 + 24);\n let numPages = provider().pages().length;\n\n if (\n numPages === 0 ||\n (this.parent.selected && this.parent.selected >= numPages - 2)\n ) {\n provider().setPage((p) => p + 1);\n }\n }\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n }\n\n return (\n \n \n \n \n \n {(items, i) => (\n \n )}\n \n \n \n \n );\n};\n\nexport default Browse;\n","import { createSignal, createSelector, For } from \"solid-js\";\nimport { ElementNode, View, Text, activeElement } from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { useNavigate } from \"@solidjs/router\";\nimport styles from \"../styles\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\n\nconst Portal = () => {\n const navigate = useNavigate();\n const isFirst = createSelector(() => {\n return 0;\n });\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.id);\n navigate(\"/\" + entity.id);\n }\n\n const demos = [\n {\n title: \"Flex Row\",\n id: \"flex\",\n description: \"Flex Row Implementation\",\n },\n {\n title: \"Flex Column\",\n id: \"flexcolumn\",\n description: \"Flex Column Implementation\",\n },\n {\n title: \"Flex Row Vertical Align\",\n id: \"flexsize\",\n description: \"Flex Row Vertical Align Implementation\",\n },\n {\n title: \"Flex Column Vertical Align\",\n id: \"flexcolumnsize\",\n description: \"Flex Column Vertical Align Implementation\",\n },\n {\n title: \"Buttons\",\n id: \"buttons\",\n description: \"Demo a few buttons\",\n },\n {\n title: \"Text\",\n id: \"text\",\n description: \"Text layout with flexbox\",\n },\n {\n title: \"Create Elements\",\n id: \"create\",\n description: \"Testing Show + children + inserting text\",\n },\n {\n title: \"Viewport\",\n id: \"viewport\",\n description: \"Events going in and out of viewport\",\n },\n ];\n\n function DemoTile(props) {\n const Container = {\n width: 370,\n height: 320,\n borderRadius: 6,\n scale: 1,\n color: 0x182b44ff,\n transition: { color: true, scale: true },\n focus: {\n scale: 1.1,\n color: 0xffffffff,\n },\n };\n const [color, setColor] = createSignal(0xffffffff);\n\n return (\n setColor(0x000000ff)}\n onBlur={() => setColor(0xffffffff)}\n style={Container}\n >\n \n \n {props.index}\n \n \n {props.title}\n \n \n {props.description}\n \n \n \n );\n }\n\n const [rowX, setRowX] = createSignal(140);\n\n function moveRow(row) {\n setRowX(row.selected * -400 + 140);\n }\n\n return (\n \n \n \n \n Examples\n \n \n \n \n \n {(demo, i) => (\n \n )}\n \n \n \n );\n};\n\nexport default Portal;\n","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst TextPage = () => {\n const OverviewContainer = {\n width: 900,\n height: 500,\n y: 350,\n x: 150,\n gap: 25,\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const SublineContainer = {\n width: 900,\n height: 36,\n gap: 6,\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const Title = {\n fontSize: 42,\n };\n\n const Overview = {\n width: OverviewContainer.width,\n fontSize: 26,\n contain: \"width\",\n } satisfies IntrinsicTextNodeStyleProps;\n\n const Subline = {\n fontSize: 26,\n };\n\n onMount(() => {\n setGlobalBackground(\"#000000\");\n });\n\n return (\n \n Title of the Page\n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer vel\n tempor tellus. Sed eu leo purus. Vestibulum sollicitudin eget tellus a\n varius. Phasellus est turpis, volutpat sed blandit sit amet, rutrum sit\n amet mauris. In dignissim elit orci, a sollicitudin ipsum faucibus et.\n Quisque vel quam rutrum, faucibus augue sed, scelerisque nunc.\n \n \n Subline Text\n \n More Text\n \n \n );\n};\n\nexport default TextPage;\n","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Show, children, createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst CreatePage = () => {\n const OverviewContainer = {\n width: 900,\n height: 500,\n y: 50,\n x: 150,\n gap: 25,\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const SublineContainer = {\n width: 900,\n height: 36,\n gap: 6,\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const Title = {\n fontSize: 42,\n };\n\n const Subline = {\n fontSize: 26,\n };\n\n let myBox, childRef;\n onMount(() => {\n setGlobalBackground(\"#000000\");\n myBox.animate({ x: 100 }, { duration: 2000 }).start();\n });\n\n const [insertTest, setInsertTest] = createSignal();\n const [emptyTest, setEmptyTest] = createSignal();\n\n setTimeout(() => {\n setInsertTest(\"- Inserted -\");\n childRef\n .getChildById(\"child1\")\n //.searchChildrenById('subChild') - more expensive version of getChildById\n ?.animate({ x: 600 }, { duration: 2000 })\n .start();\n }, 2000);\n\n const styleChild = {\n width: 400,\n height: 300,\n // Solid blue\n color: hexColor(\"#0000ff\"),\n } as const;\n\n const someOtherStyle = {\n // pretty red\n color: hexColor(\"#f54242\"),\n focus: {\n // pretty blue\n color: hexColor(\"#4287f5\"),\n },\n };\n\n function ChildTest(props) {\n // This causes a parent not rendered error since we're rendering it twice in the template\n const resolved = children(() => props.children);\n return (\n \n \n {resolved()}\n \n {props.title}\n \n \n {resolved()}\n \n \n );\n }\n\n const borderStyles = {\n borderLeft: {\n width: 8,\n color: 0x05b2b626,\n },\n borderTop: {\n width: 8,\n color: 0x25a2bd26,\n },\n borderRight: {\n width: 8,\n color: 0x05b2b626,\n },\n borderBottom: {\n width: 8,\n color: 0xc5b23626,\n },\n } as const;\n\n const childTestPassedStyles = {\n // grey color\n color: hexColor(\"#cccccc\"),\n focus: {\n // black\n color: hexColor(\"#000000\"),\n },\n };\n\n const childTestPassedStyles2 = {\n // white color\n color: hexColor(\"#ffffff\"),\n focus: {\n // white something...\n color: hexColor(\"#f6f6cc\"),\n },\n };\n\n function hasFocus(elm) {\n console.log(\"Ref is available: \", elm);\n return true;\n }\n\n return (\n \n Title of the Page\n \n {emptyTest()}\n Sub {insertTest()} Text\n \n \n \n More Text\n \n \n Child Test\n \n \n \n );\n};\n\nexport default CreatePage;\n","import { Text, View, hexColor } from \"@lightningjs/solid\";\nimport { onMount, onCleanup, createSignal } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nexport default () => {\n let ball, invervalTimer;\n\n const [ballStatus, setBallStatus] = createSignal([]);\n\n const styleBall = {\n width: 100,\n height: 100,\n x: -400,\n y: -400,\n rotation: 0,\n borderRadius: 50,\n color: hexColor(\"#4287f5\"),\n transition: {\n x: { duration: 1250, easing: \"linear\" },\n y: { duration: 1250, easing: \"linear\" },\n rotation: { duration: 1400, easing: \"ease-in-out\" },\n },\n } as const;\n\n const Title = {\n fontSize: 32,\n x: 960,\n y: 540,\n mount: 0.5,\n lineheight: 52,\n };\n\n const randomIntBetween = (from, to) =>\n Math.floor(Math.random() * (to - from + 1) + from);\n\n onMount(() => {\n setGlobalBackground(\"#000000\");\n\n ball.x = (1920 - 100) / 2;\n ball.y = (1080 - 100) / 2;\n invervalTimer = setInterval(() => {\n ball.rotation = randomIntBetween(-90, 90);\n ball.x = randomIntBetween(-300, 2220);\n ball.y = randomIntBetween(-300, 1380);\n }, 2500);\n });\n\n function logEvent(name, elm) {\n setBallStatus((prev) => {\n return [...prev, name].slice(-4);\n });\n console.log(name);\n }\n\n onCleanup(() => {\n clearInterval(invervalTimer);\n });\n\n return (\n \n {ballStatus().join(\"\\n\")}\n logEvent(\"inBounds\", elm)],\n [\"outOfBounds\", (elm) => logEvent(\"outOfBounds\", elm)],\n [\"inViewport\", (elm) => logEvent(\"inViewport\", elm)],\n [\"outOfViewport\", (elm) => logEvent(\"outOfViewport\", elm)],\n ]}\n />\n \n );\n};\n","import {\n View,\n Text,\n ElementNode,\n IntrinsicNodeProps,\n hexColor,\n IntrinsicNodeStyleProps,\n} from \"@lightningjs/solid\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { buttonStyles } from \"../styles\";\nwithPadding;\n\nconst ButtonsPage = () => {\n function onEnter(this: ElementNode, event, elm) {\n this.states.toggle(\"disabled\");\n }\n\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1500,\n height: 300,\n color: hexColor(\"00000000\"),\n gap: 26,\n y: 400,\n } satisfies IntrinsicNodeStyleProps;\n\n function Button(props) {\n return (\n \n {props.children}\n \n );\n }\n\n const Badge = (props: IntrinsicNodeProps) => {\n return (\n \n \n {props.children as string}\n \n \n );\n };\n return (\n <>\n \n HD\n PG13\n NC17\n I like bananas\n DOLBY\n \n\n \n \n \n \n \n \n \n );\n};\n\nexport default ButtonsPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1600,\n height: 110,\n color: hexColor(\"#4dabf5\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n marginTop: 25,\n marginBottom: -20,\n skipFocus: true,\n };\n\n function Block(props) {\n const styles = {\n width: 200,\n height: 100,\n y: 5,\n color: 0x1769aaff,\n };\n\n return ;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Flex Start\n \n \n \n \n \n \n \n Flex Start - Margin Left\n \n \n \n \n \n \n \n Flex End\n \n \n \n \n \n \n \n\n Flex End - Margin Right\n \n \n \n \n \n \n \n\n Center - No Margin Support\n \n \n \n \n \n \n \n\n Space Between - No Margin Support\n \n \n \n \n \n \n \n\n Space Evenly - No Margin Support\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexSizePage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1600,\n height: 110,\n color: hexColor(\"#4dabf5\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n marginTop: 25,\n marginBottom: -20,\n skipFocus: true,\n };\n\n function Block(props) {\n const styles = {\n width: 200,\n height: 100,\n y: 5,\n color: 0x1769aaff,\n };\n\n return ;\n }\n\n function randSize() {\n // size 21 to 100\n return Math.floor(Math.random() * 91) + 10;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Flex Start - AlignItems: center\n \n \n \n \n \n \n \n \n Flex Start - Margin Left - AlignItems: flexStart\n \n \n \n \n \n \n \n \n Flex End - AlignItems: flexEnd\n \n \n \n \n \n \n \n\n Flex End - Margin Right\n \n \n \n \n \n \n \n\n Center - No Margin Support\n \n \n \n \n \n \n \n\n Space Between - No Margin Support\n \n \n \n \n \n \n \n\n Space Evenly - No Margin Support\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexSizePage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexColumnPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n width: 1920,\n y: 100,\n height: 880,\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const ColumnStyles = {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"#4dabf5\"),\n height: 850,\n width: 80,\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n y: 20,\n x: 150,\n };\n\n function Block(props) {\n const styles = {\n width: randSize(),\n height: 80,\n x: 5,\n color: hexColor(\"#1769aa\"),\n };\n\n return ;\n }\n\n function randSize() {\n // size 10 to 70\n return Math.floor(Math.random() * 61) + 10;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Start, MarginTop, End, MarginBottom, Center, Between, Evenly\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexColumnPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexColumnPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n width: 1920,\n y: 100,\n height: 880,\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const ColumnStyles = {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"#4dabf5\"),\n height: 850,\n width: 60,\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n y: 20,\n x: 150,\n };\n\n function Block(props) {\n const styles = {\n width: 50,\n height: 80,\n x: 5,\n color: hexColor(\"#1769aa\"),\n };\n\n return ;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Start, MarginTop, End, MarginBottom, Center, Between, Evenly\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexColumnPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\n\nimport { MaterialButtonText } from \"../styles\";\n\nconst MaterialButtonsPage = () => {\n function onEnter(this: ElementNode, event, elm) {\n this.states.toggle(\"disabled\");\n }\n\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1500,\n height: 300,\n color: hexColor(\"00000000\"),\n gap: 26,\n y: 400,\n x: 100,\n } satisfies IntrinsicNodeStyleProps;\n\n const MaterialButton = {\n width: 386,\n height: 136,\n color: \"0x715cabff\",\n focus: {\n color: \"0x5a39a2ff\",\n },\n disabled: {\n color: \"0x291d43ff\",\n },\n };\n const RoundedRectangle = [\"RoundedRectangle\", { radius: 65 }];\n function Button(props) {\n return (\n \n {props.children}\n \n );\n }\n\n return (\n \n \n \n \n \n );\n};\n\nexport default MaterialButtonsPage;\n","// Documentation from Shaka player:\n// https://shaka-player-demo.appspot.com/docs/api/tutorial-basic-usage.html\n\nconst manifestUri =\n \"https://storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd\";\n\nfunction initApp() {\n // Install built-in polyfills to patch browser incompatibilities.\n shaka.polyfill.installAll();\n\n // Check to see if the browser supports the basic APIs Shaka needs.\n if (shaka.Player.isBrowserSupported()) {\n // Everything looks good!\n initPlayer();\n } else {\n // This browser does not have the minimum set of APIs we need.\n console.error(\"Browser not supported!\");\n }\n}\n\nasync function initPlayer() {\n // Create a Player instance.\n const video = document.getElementById(\"video\");\n const player = new shaka.Player();\n await player.attach(video);\n\n // Attach player to the window to make it easy to access in the JS console.\n window.player = player;\n\n // Listen for error events.\n player.addEventListener(\"error\", onErrorEvent);\n\n // Try to load a manifest.\n // This is an asynchronous process.\n try {\n await player.load(manifestUri);\n // This runs if the asynchronous load is successful.\n console.log(\"The video has now been loaded!\");\n } catch (e) {\n // onError is executed if the asynchronous load fails.\n onError(e);\n }\n}\n\nfunction onErrorEvent(event) {\n // Extract the shaka.util.Error object from the event.\n onError(event.detail);\n}\n\nfunction onError(error) {\n // Log the error.\n console.error(\"Error code\", error.code, \"object\", error);\n}\n\nexport function playVideo() {\n const video = document.getElementById(\"video\");\n video.hidden = false;\n // Needs delay from hidden to play in Chrome\n setTimeout(() => video.play(), 50);\n video.focus();\n return video;\n}\n\nexport function closeVideo() {\n const video = document.getElementById(\"video\");\n video.hidden = true;\n video.pause();\n return video;\n}\n\ndocument.addEventListener(\"DOMContentLoaded\", initApp);\n","import {\n ElementNode,\n Text,\n View,\n Show,\n hexColor,\n setActiveElement,\n} from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport { useParams } from \"@solidjs/router\";\nimport { createEffect, createResource, on, createSignal } from \"solid-js\";\nimport { TileRow, Button } from \"../components\";\nimport { setGlobalBackground } from \"../state\";\nimport ContentBlock from \"../components/ContentBlock\";\nimport { useNavigate } from \"@solidjs/router\";\nimport styles from \"../styles\";\nimport * as provider from \"../api/providers/entity\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\nimport type { Tile } from \"../api/formatters/ItemFormatter\";\nimport { playVideo, closeVideo } from \"../video\";\n\nconst Entity = () => {\n const params = useParams();\n const navigate = useNavigate();\n\n const [data] = createResource(() => ({ ...params }), provider.getInfo);\n const [credits] = createResource(\n () => ({ ...params }),\n provider.getCredits,\n );\n const [recommendations] = createResource(\n () => ({ ...params }),\n provider.getRecommendations,\n );\n const [backdropAlpha, setBackdropAlpha] = createSignal(0);\n\n createEffect(\n on(\n data,\n (data) => {\n setGlobalBackground(data.backgroundImage);\n },\n { defer: true },\n ),\n );\n\n const columnY = 600;\n\n const Backdrop = {\n color: hexColor(\"#000000\"),\n alpha: 0,\n width: 1900,\n height: 890,\n x: 10,\n y: columnY,\n borderRadius: 30,\n };\n\n function onRowFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n columnRef.y = columnY;\n backdropRef.y = columnY;\n backdropRef.alpha = 0;\n }\n\n function onRowFocusAnimate(this: ElementNode) {\n this.children.selected?.setFocus();\n columnRef.y = 200;\n backdropRef.y = 160;\n backdropRef.alpha = 0.9;\n }\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n }\n\n function onEscape() {\n closeVideo();\n // Set focus back to lightning app\n document.getElementsByTagName(\"canvas\")[0].focus();\n setActiveElement(trailerButton);\n setBackdropAlpha(0);\n }\n\n function onEnterTrailer() {\n const video = playVideo();\n setActiveElement(video);\n setBackdropAlpha(0.9);\n }\n\n let columnRef, backdropRef, trailerButton;\n\n return (\n \n trailerButton.setFocus()} onEscape={onEscape}>\n \n columnRef.setFocus()}\n onEnter={onEnterTrailer}\n >\n Watch Trailer\n \n \n \n \n Recommendations\n \n \n \n Cast and Crew\n \n \n \n \n \n \n \n \n );\n};\n\nexport default Entity;\n","import api, { getImageUrl } from \"..\";\nimport { convertItemsToTiles } from \"../formatters/ItemFormatter\";\n\nexport function minutesToHMM(minutes) {\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return (\n hours + \"h \" + (remainingMinutes < 10 ? \"0\" : \"\") + remainingMinutes + \"m\"\n );\n}\n\nfunction justYear(dateString) {\n const parts = dateString.split(\"-\");\n return parts[0];\n}\n\nexport function getCredits({ id }) {\n return api\n .get(`/person/${id}/combined_credits`)\n .then(({ cast }) => convertItemsToTiles(cast.slice(0, 7)));\n}\n\nexport function getInfo({ id }) {\n return api.get(`/person/${id}`).then((data) => ({\n backgroundImage: getImageUrl(data.profile_path, \"original\"),\n heroContent: {\n title: data.title || data.name,\n description: data.biography,\n },\n ...data,\n }));\n}\n","import { ElementNode, Text, View, Show, hexColor } from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport { useParams } from \"@solidjs/router\";\nimport { createEffect, createResource, on } from \"solid-js\";\nimport { TileRow } from \"../components\";\nimport { setGlobalBackground } from \"../state\";\nimport { useNavigate } from \"@solidjs/router\";\nimport theme from \"theme\";\nimport styles from \"../styles\";\nimport * as provider from \"../api/providers/people\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\n\nconst People = () => {\n const params = useParams();\n const navigate = useNavigate();\n\n const [data] = createResource(() => ({ ...params }), provider.getInfo);\n const [credits] = createResource(() => ({ ...params }), provider.getCredits);\n\n createEffect(\n on(\n data,\n (data) => {\n setGlobalBackground(data.backgroundImage);\n },\n { defer: true },\n ),\n );\n\n const Backdrop = {\n color: hexColor(\"#000000\"),\n alpha: 0.8,\n width: 1540,\n height: 440,\n x: 130,\n y: 180,\n borderRadius: 30,\n };\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n }\n\n return (\n \n \n {data().name}\n {data().biography}\n \n \n \n \n \n Credits\n \n \n \n \n \n );\n};\n\nexport default People;\n","const NotFound = () => {\n return ;\n};\n\nexport default NotFound;\n","export default import.meta.ROLLUP_FILE_URL_DM04K3OB;","import {\n render,\n Config,\n SolidNode,\n SolidRendererOptions,\n hexColor,\n ElementNode,\n} from \"@lightningjs/solid\";\nimport { HashRouter, Route } from \"@solidjs/router\";\nimport App from \"./pages/App\";\nimport Browse from \"./pages/Browse\";\nimport Portal from \"./pages/Portal\";\nimport TextPage from \"./pages/Text\";\nimport CreatePage from \"./pages/Create\";\nimport ViewportPage from \"./pages/Viewport\";\nimport ButtonsPage from \"./pages/Buttons\";\nimport FlexPage from \"./pages/Flex\";\nimport FlexSizePage from \"./pages/FlexSize\";\nimport FlexColumnSizePage from \"./pages/FlexColumnSize\";\nimport FlexColumnPage from \"./pages/FlexColumn\";\nimport ButtonsMaterialPage from \"./pages/ButtonsMaterial\";\nimport Entity from \"./pages/Entity\";\nimport People from \"./pages/People\";\nimport NotFound from \"./pages/NotFound\";\nimport coreExtensionModuleUrl from \"./AppCoreExtensions.js?importChunkUrl\";\n\nconst logFps = true;\nConfig.debug = false;\nConfig.animationsEnabled = true;\nConfig.fontSettings.fontFamily = \"Ubuntu\";\nConfig.fontSettings.color = hexColor(\"#ffffff\");\nConfig.fontSettings.fontSize = 32;\nConfig.rendererOptions = {\n coreExtensionModule: coreExtensionModuleUrl,\n fpsUpdateInterval: logFps ? 1000 : 0,\n enableInspector: true,\n // deviceLogicalPixelRatio: 1\n};\n\nrender(() => (\n }>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n));\n"],"file":"assets/index-DyIws3MF.js"} \ No newline at end of file diff --git a/assets/index-legacy-CFPn_sx5.js b/assets/index-legacy-CFPn_sx5.js new file mode 100644 index 0000000..56d92fc --- /dev/null +++ b/assets/index-legacy-CFPn_sx5.js @@ -0,0 +1,2 @@ +!function(){var e=["defaultTone"],t=["defaultTone"],r=["defaultTone"],n=["defaultTone"],o=["defaultTone"],i=["defaultTone"],s=["defaultTone"],a=["defaultTone"],l=["defaultTone"],d=["defaultTone"],h=["defaultTone"],u=["defaultTone"],c=["defaultTone"],f=["defaultTone"],p=["defaultSurfaceTone"];function v(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,s,a=[],l=!0,d=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){d=!0,o=e}finally{try{if(!l&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(d)throw o}}return a}}(e,t)||C(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */m=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function d(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,r){return e[t]=r}}function h(e,t,r,n){var i=t&&t.prototype instanceof x?t:x,s=Object.create(i.prototype),a=new E(n||[]);return o(s,"_invoke",{value:k(e,r,a)}),s}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var c="suspendedStart",f="suspendedYield",p="executing",v="completed",g={};function x(){}function y(){}function b(){}var w={};d(w,s,(function(){return this}));var S=Object.getPrototypeOf,A=S&&S(S(N([])));A&&A!==r&&n.call(A,s)&&(w=A);var C=b.prototype=x.prototype=Object.create(w);function T(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function _(e,t){function r(o,i,s,a){var l=u(e[o],e,i);if("throw"!==l.type){var d=l.arg,h=d.value;return h&&"object"==typeof h&&n.call(h,"__await")?t.resolve(h.__await).then((function(e){r("next",e,s,a)}),(function(e){r("throw",e,s,a)})):t.resolve(h).then((function(e){d.value=e,s(d)}),(function(e){return r("throw",e,s,a)}))}a(l.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function k(t,r,n){var o=c;return function(i,s){if(o===p)throw Error("Generator is already running");if(o===v){if("throw"===i)throw s;return{value:e,done:!0}}for(n.method=i,n.arg=s;;){var a=n.delegate;if(a){var l=I(a,n);if(l){if(l===g)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===c)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var d=u(t,r,n);if("normal"===d.type){if(o=n.done?v:f,d.arg===g)continue;return{value:d.arg,done:n.done}}"throw"===d.type&&(o=v,n.method="throw",n.arg=d.arg)}}}function I(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,I(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=u(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var s=i.arg;return s?s.done?(r[t.resultName]=s.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function B(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(B,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return o("end");if(s.tryLoc<=this.prev){var l=n.call(s,"catchLoc"),d=n.call(s,"finallyLoc");if(l&&d){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),R(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;R(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},t}function x(e,t,r,n,o,i,s){try{var a=e[i](s),l=a.value}catch(d){return void r(d)}a.done?t(l):Promise.resolve(l).then(n,o)}function y(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function s(e){x(i,n,o,s,a,"next",e)}function a(e){x(i,n,o,s,a,"throw",e)}s(void 0)}))}}function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function w(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){a=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw i}}}}function C(e,t){if(e){if("string"==typeof e)return T(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?T(e,t):void 0}}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{C=e.a,T=e.i,_=e.g,k=e.c,I=e.W,B=e.E,R=e.b,E=e.d,N=e.e,F=e.f,L=e.m,z=e.h,M=e.j,P=e.T,D=e.k,O=e.l,U=e.S,W=e.B,Y=e.n,j=e.o,H=e.p,Q=e.q,K=e.C,$=e.r,X=e.s,G=e.t,V=e.u,Z=e.v,q=e.w}],execute:function(){var x,J,ee,te=m().mark(Xe),re=document.createElement("style");re.textContent="html,body,*{padding:0;margin:0}video{position:absolute;top:0;left:0;z-index:2;outline:none}.center-element{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}\n",document.head.appendChild(re);class ne{constructor(e){S(this,"releaseCallback",void 0),this.releaseCallback=e}}class oe extends ne{constructor(e,t){var r,n;super(e),S(this,"textureMap",new Map),S(this,"zeroReferenceTextureSet",new Set),S(this,"options",void 0),this.options={textureCleanupIntervalMs:null!==(r=t.textureCleanupIntervalMs)&&void 0!==r?r:1e4,textureCleanupAgeThreadholdMs:null!==(n=t.textureCleanupAgeThreadholdMs)&&void 0!==n?n:6e4},setInterval((()=>{var e,t=Date.now(),r=this.options.textureCleanupAgeThreadholdMs,n=A(this.zeroReferenceTextureSet);try{for(n.s();!(e=n.n()).done;){var o=e.value;t-o.lastUpdate>r&&(this.releaseCallback(o.id),this.textureMap.delete(o.id),this.zeroReferenceTextureSet.delete(o))}}catch(i){n.e(i)}finally{n.f()}}),this.options.textureCleanupIntervalMs)}registerTexture(e){var t,r=null===(t=e.options)||void 0===t?void 0:t.id;if(C(r,"Texture must have an id to be registered"),!this.textureMap.has(r)){var n={id:r,nodeRefCount:0,lastUpdate:Date.now()};this.textureMap.set(r,n),this.zeroReferenceTextureSet.add(n)}}incrementTextureRefCount(e){var t,r=null===(t=e.options)||void 0===t?void 0:t.id;C(r,"Texture must have an id to be registered");var n=this.textureMap.get(r);n||(this.registerTexture(e),n=this.textureMap.get(r)),C(n,"Texture must have been registered"),"SubTexture"===e.txType&&this.incrementTextureRefCount(e.props.texture),n.nodeRefCount++,n.lastUpdate=Date.now(),this.zeroReferenceTextureSet.has(n)&&this.zeroReferenceTextureSet.delete(n)}decrementTextureRefCount(e){var t,r=null===(t=e.options)||void 0===t?void 0:t.id;C(r,"Texture must have an id to be registered");var n=this.textureMap.get(r);C(n,"Texture must have been registered"),n.nodeRefCount--,n.lastUpdate=Date.now(),0===n.nodeRefCount&&this.zeroReferenceTextureSet.add(n),"SubTexture"===e.txType&&this.decrementTextureRefCount(e.props.texture)}}class ie extends ne{constructor(e){super(e),S(this,"registry",void 0),this.registry=new FinalizationRegistry(e)}registerTexture(e){var t,r;C(null===(t=e.options)||void 0===t?void 0:t.id,"Texture must have an ID to be registered"),this.registry.register(e,null===(r=e.options)||void 0===r?void 0:r.id)}incrementTextureRefCount(){}decrementTextureRefCount(){}}var se={alpha:e=>1===e?null:{prop:"opacity",value:`${e}`},x:e=>({prop:"left",value:`${e}px`}),y:e=>({prop:"top",value:`${e}px`}),width:e=>0===e?null:{prop:"width",value:`${e}px`},height:e=>0===e?null:{prop:"height",value:`${e}px`},zIndex:()=>"zIndex",fontFamily:()=>"font-family",fontSize:()=>"font-size",fontStyle:()=>"font-style",fontWeight:()=>"font-weight",fontStretch:()=>"font-stretch",lineHeight:()=>"line-height",letterSpacing:()=>"letter-spacing",textAlign:()=>"text-align",overflowSuffix:()=>"overflow-suffix",maxLines:()=>"max-lines",contain:()=>"contain",verticalAlign:()=>"vertical-align",clipping:e=>!1===e?null:{prop:"overflow",value:e?"hidden":"visible"},rotation:e=>0===e?null:{prop:"transform",value:`rotate(${e}rad)`},scale:e=>1===e?null:{prop:"transform",value:`scale(${e})`},scaleX:e=>1===e?null:{prop:"transform",value:`scaleX(${e})`},scaleY:e=>1===e?null:{prop:"transform",value:`scaleY(${e})`},color:e=>0===e?null:{prop:"color",value:ae(e)}},ae=e=>`rgba(${e>>24&255},${e>>16&255},${e>>8&255},${(255&e)/255})`,le={id:"id"};class de{constructor(e,t){var r,n,o,i,s,a;if(S(this,"root",null),S(this,"canvas",null),S(this,"height",1080),S(this,"width",1920),S(this,"scaleX",1),S(this,"scaleY",1),!T()){if(!t)throw new Error("settings is required");this.height=Math.ceil(null!==(r=t.appHeight)&&void 0!==r?r:1080/(null!==(n=t.deviceLogicalPixelRatio)&&void 0!==n?n:1)),this.width=Math.ceil(null!==(o=t.appWidth)&&void 0!==o?o:1900/(null!==(i=t.deviceLogicalPixelRatio)&&void 0!==i?i:1)),this.scaleX=null!==(s=t.deviceLogicalPixelRatio)&&void 0!==s?s:1,this.scaleY=null!==(a=t.deviceLogicalPixelRatio)&&void 0!==a?a:1,this.canvas=e,this.root=document.createElement("div"),this.setRootPosition(),document.body.appendChild(this.root),new MutationObserver(this.setRootPosition.bind(this)).observe(e,{attributes:!0,childList:!1,subtree:!1}),new ResizeObserver(this.setRootPosition.bind(this)).observe(e),window.addEventListener("resize",this.setRootPosition.bind(this)),console.warn("Inspector is enabled, this will impact performance")}}setRootPosition(){if(null!==this.root&&null!==this.canvas){var e=this.canvas.getBoundingClientRect(),t=document.documentElement.scrollTop+e.top,r=document.documentElement.scrollLeft+e.left;this.root.id="root",this.root.style.left=`${r}px`,this.root.style.top=`${t}px`,this.root.style.width=`${this.width}px`,this.root.style.height=`${this.height}px`,this.root.style.position="absolute",this.root.style.transformOrigin="0 0 0",this.root.style.transform=`scale(${this.scaleX}, ${this.scaleY})`,this.root.style.overflow="hidden",this.root.style.zIndex="65534"}}createDiv(e,t){var r=document.createElement("div");for(var n in r.style.position="absolute",r.id=e.id.toString(),t)this.updateNodeProperty(r,n,t[n]);return r}createNode(e,t){var r=e.createNode(t),n=this.createDiv(r,t);return n.node=r,r.div=n,this.createProxy(r,n)}createTextNode(e,t){var r=e.createTextNode(t),n=this.createDiv(r,t);return n.node=r,r.div=n,this.createProxy(r,n)}createProxy(e,t){return new Proxy(e,{set:(e,r,n)=>(this.updateNodeProperty(t,r,n),Reflect.set(e,r,n)),get:(r,n,o)=>("destroy"===n&&this.destroyNode(r),"animate"===n?(n,o)=>{var i=r.animate(n,o);return new Proxy(i,{get:(r,i,s)=>("start"===i&&this.animateNode(t,e,n,o),Reflect.get(r,i,s))})}:Reflect.get(r,n,o))})}destroyNode(e){var t=document.getElementById(e.id.toString());null==t||t.remove()}updateNodeProperty(e,t,r){if(null!==this.root&&null!=r)if("parent"!==t){if("text"===t)return e.innerHTML=String(r),void(e.style.visibility="hidden");if("src"===t&&r)e.setAttribute("data-src",String(r));else{if(se[t]){var n,o=null===(n=se[t])||void 0===n?void 0:n.call(se,r);if(null===o)return;return"string"==typeof o?void e.style.setProperty(o,String(r)):void("object"==typeof o&&e.style.setProperty(o.prop,o.value))}if(le[t])e.setAttribute(String(se[t]),String(r));else if("data"!==t);else for(var i in r)e.setAttribute(`data-${i}`,String(r[i]))}}else{var s=r.id;if(1===s)return void this.root.appendChild(e);var a=document.getElementById(s.toString());null==a||a.appendChild(e)}}animateNode(e,t,r,n){var o=n.duration,i=void 0===o?1e3:o,s=n.delay,a=void 0===s?0:s,l=r.x,d=r.y,h=r.width,u=r.height,c=r.alpha,f=void 0===c?1:c,p=r.rotation,v=void 0===p?0:p,g=r.scale,m=void 0===g?1:g,x=r.color;setTimeout((function(){setTimeout((()=>{e.style.top=`${d}px`,e.style.left=`${l}px`,e.style.width=`${h}px`,e.style.height=`${u}px`,e.style.opacity=`${f}`,e.style.rotate=`${v}rad`,e.style.scale=`${m}`,e.style.color=ae(x)}),i)}),a)}}var he=function(e,t,r){var n=Promise.resolve();return n.then((()=>e())).catch((e=>{var t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}))};class ue{static getEffectKey(e){return""}static getMethodParameters(e,t){var r=[];for(var n in e){var o=e[n],i="";o.size&&(i=`[${o.size(t)}]`),r.push(`${o.type} ${n}${i}`)}return r.join(",")}constructor(e){S(this,"priority",1),S(this,"name",""),S(this,"ref",void 0),S(this,"target",void 0),S(this,"passParameters",""),S(this,"declaredUniforms",""),S(this,"uniformInfo",{});var t=e.ref,r=e.target,n=e.props,o=void 0===n?{}:n;this.ref=t,this.target=r;var i={},s=[],a="",l=this.constructor.uniforms||{};for(var d in l){var h=l[d],u=h.type,c=`${t}_${d}`,f="";h.size&&(f=`[${h.size(o)}]`),s.push(c),a+=`uniform ${u} ${c}${f};`,i[d]={name:c,uniform:l[d].method}}this.passParameters=s.join(","),this.declaredUniforms=a,this.uniformInfo=i}static resolveDefaults(e){return{}}static makeEffectKey(e){return!1}}S(ue,"uniforms",{}),S(ue,"methods",void 0),S(ue,"onShaderMask",void 0),S(ue,"onColorize",void 0),S(ue,"onEffectMask",void 0);var ce={x:(e,t)=>{e.props.x=t},y:(e,t)=>{e.props.y=t},width:(e,t)=>{e.props.width=t},height:(e,t)=>{e.props.height=t},color:(e,t)=>{e.props.color=t},zIndex:(e,t)=>{e.props.zIndex=t},fontFamily:(e,t)=>{e.props.fontFamily=t},fontWeight:(e,t)=>{e.props.fontWeight=t},fontStyle:(e,t)=>{e.props.fontStyle=t},fontStretch:(e,t)=>{e.props.fontStretch=t},fontSize:(e,t)=>{e.props.fontSize=t},text:(e,t)=>{e.props.text=t},textAlign:(e,t)=>{e.props.textAlign=t},contain:(e,t)=>{e.props.contain=t},offsetY:(e,t)=>{e.props.offsetY=t},scrollable:(e,t)=>{e.props.scrollable=t},scrollY:(e,t)=>{e.props.scrollY=t},letterSpacing:(e,t)=>{e.props.letterSpacing=t},lineHeight:(e,t)=>{e.props.lineHeight=t},maxLines:(e,t)=>{e.props.maxLines=t},textBaseline:(e,t)=>{e.props.textBaseline=t},verticalAlign:(e,t)=>{e.props.verticalAlign=t},overflowSuffix:(e,t)=>{e.props.overflowSuffix=t},debug:(e,t)=>{e.props.debug=t}};class fe{constructor(e){S(this,"stage",void 0),S(this,"set",void 0),this.stage=e;var t=w(w({},ce),this.getPropertySetters());this.set=Object.freeze(Object.fromEntries(Object.entries(t).map((([e,t])=>[e,(r,n)=>{r.props[e]!==n&&(t(r,n),this.stage.requestRender())}]))))}setStatus(e,t,r){e.status!==t&&(e.status=t,e.emitter.emit(t,r))}setIsRenderable(e,t){e.isRenderable=t}destroyState(e){["loading","loaded","failed"].forEach((t=>{e.emitter.off(t)}))}scheduleUpdateState(e){e.updateScheduled||(e.updateScheduled=!0,queueMicrotask((()=>{e.updateScheduled=!1,this.updateState(e)})))}}function pe(e,t,r,n,o){return r*(n-1)+("bottom"!==e?.5*t:0)+Math.max(r,t)+(o||0)}class ve{constructor(e,t){S(this,"_canvas",void 0),S(this,"_context",void 0),S(this,"_settings",void 0),S(this,"renderInfo",void 0),this._canvas=e,this._context=t,this._settings=this.mergeDefaults({})}set settings(e){this._settings=this.mergeDefaults(e)}get settings(){return this._settings}getPrecision(){return this._settings.precision}setFontProperties(){this._context.font=this._getFontSetting(),this._context.textBaseline=this._settings.textBaseline}_getFontSetting(){for(var e=[this._settings.fontFace],t=[],r=0,n=e.length;r{console.warn("[Lightning] Font load error",t,e)})).then((()=>{document.fonts.check(e,this._settings.text)||console.warn("[Lightning] Font not found",e)}))}catch(t){console.warn("[Lightning] Can't check font loading for "+e)}}}calculateRenderInfo(){var e={},t=this.getPrecision(),r=this._settings.paddingLeft*t,n=this._settings.paddingRight*t,o=this._settings.fontSize*t,i=null===this._settings.offsetY?null:this._settings.offsetY*t,s=(this._settings.lineHeight||o)*t,a=this._settings.w*t,l=this._settings.h*t,d=this._settings.wordWrapWidth*t,h=this._settings.cutSx*t,u=this._settings.cutEx*t,c=this._settings.cutSy*t,f=this._settings.cutEy*t,p=(this._settings.letterSpacing||0)*t,v=this._settings.textIndent*t;this.setFontProperties();var g,m=a||2048/this.getPrecision(),x=m-r;if(x<10&&(m+=10-x,x=10),d||(d=x),this._settings.textOverflow&&!this._settings.wordWrap){var y;switch(this._settings.textOverflow){case"clip":y="";break;case"ellipsis":y=this._settings.overflowSuffix;break;default:y=this._settings.textOverflow}this._settings.text=this.wrapWord(this._settings.text,d-v,y)}if(this._settings.wordWrap)g=this.wrapText(this._settings.text,d,p,v);else for(var b=(g={l:this._settings.text.split(/(?:\r\n|\r|\n)/),n:[]}).l.length,w=0;wthis._settings.maxLines){var A,C=S.slice(0,this._settings.maxLines),T=null;if(this._settings.overflowSuffix){var _=this._settings.overflowSuffix?this.measureText(this._settings.overflowSuffix):0,k=this.wrapText(C[C.length-1],d-_,p,v);C[C.length-1]=`${k.l[0]}${this._settings.overflowSuffix}`,T=[k.l.length>1?k.l[1]:""]}else T=[""];var I=S.length,B=0,R=g.n.length;for(A=this._settings.maxLines;A=128&&(this._context.globalAlpha=.01,this._context.fillRect(0,0,.01,.01),this._context.globalAlpha=1),(e.cutSx||e.cutSy)&&this._context.translate(-e.cutSx,-e.cutSy);for(var l=[],d=0,h=i.length;dt)for(;s>0&&(a=this._context.measureText(e.substring(0,s)).width+n)>t;)s-=1;else for(;s=n?r:"")}wrapText(e,t,r,n=0){for(var o=e.split(/\r?\n/g),i=[],s=[],a=0;ah?(c>0&&(l.push(d),d=""),d+=u[c],h=t-f-(0===c?n:0)):(h-=p,d+=` ${u[c]}`)}l.push(d),d="",i=i.concat(l),ae+this._context.measureText(r).width+t),0):this._context.measureText(e).width}mergeDefaults(e){return w({text:"",w:0,h:0,fontStyle:"normal",fontSize:40,fontFace:null,wordWrap:!0,wordWrapWidth:0,wordBreak:!1,textOverflow:"",lineHeight:null,textBaseline:"alphabetic",textAlign:"left",verticalAlign:"top",offsetY:null,maxLines:0,overflowSuffix:"...",textColor:[1,1,1,1],paddingLeft:0,paddingRight:0,shadow:!1,shadowColor:[0,0,0,1],shadowOffsetX:0,shadowOffsetY:0,shadowBlur:5,highlight:!1,highlightHeight:0,highlightColor:[0,0,0,1],highlightOffset:0,highlightPaddingLeft:0,highlightPaddingRight:0,letterSpacing:0,textIndent:0,cutSx:0,cutEx:0,cutSy:0,cutEy:0,advancedRenderer:!1,fontBaselineRatio:0,precision:1,textRenderIssueMargin:0},e)}}var ge="undefined"==typeof self?globalThis:self,me=(null===(x=ge.document)||void 0===x?void 0:x.fonts)||ge.fonts;var xe=k(0,0,0,0);class ye extends fe{constructor(e){super(e),S(this,"canvas",void 0),S(this,"context",void 0),S(this,"rendererBounds",void 0),"undefined"!=typeof OffscreenCanvas?this.canvas=new OffscreenCanvas(0,0):this.canvas=document.createElement("canvas");var t=this.canvas.getContext("2d");t||(this.canvas=document.createElement("canvas"),t=this.canvas.getContext("2d")),C(t),this.context=t,this.rendererBounds={x1:0,y1:0,x2:this.stage.options.appWidth,y2:this.stage.options.appHeight}}getPropertySetters(){return{fontFamily:(e,t)=>{e.props.fontFamily=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontWeight:(e,t)=>{e.props.fontWeight=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontStyle:(e,t)=>{e.props.fontStyle=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontStretch:(e,t)=>{e.props.fontStretch=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},fontSize:(e,t)=>{e.props.fontSize=t,e.fontInfo=void 0,this.invalidateLayoutCache(e)},text:(e,t)=>{e.props.text=t,this.invalidateLayoutCache(e)},textAlign:(e,t)=>{e.props.textAlign=t,this.invalidateLayoutCache(e)},color:(e,t)=>{e.props.color=t,this.invalidateLayoutCache(e)},x:(e,t)=>{e.props.x=t,this.invalidateVisibleWindowCache(e)},y:(e,t)=>{e.props.y=t,this.invalidateVisibleWindowCache(e)},contain:(e,t)=>{e.props.contain=t,this.invalidateLayoutCache(e)},width:(e,t)=>{e.props.width=t,"none"!==e.props.contain&&this.invalidateLayoutCache(e)},height:(e,t)=>{e.props.height=t,"both"===e.props.contain&&this.invalidateLayoutCache(e)},offsetY:(e,t)=>{e.props.offsetY=t,this.invalidateLayoutCache(e)},scrollY:(e,t)=>{e.props.scrollY=t},letterSpacing:(e,t)=>{e.props.letterSpacing=t,this.invalidateLayoutCache(e)},lineHeight:(e,t)=>{e.props.lineHeight=t,this.invalidateLayoutCache(e)},maxLines:(e,t)=>{e.props.maxLines=t,this.invalidateLayoutCache(e)},textBaseline:(e,t)=>{e.props.textBaseline=t,this.invalidateLayoutCache(e)},verticalAlign:(e,t)=>{e.props.verticalAlign=t,this.invalidateLayoutCache(e)},overflowSuffix:(e,t)=>{e.props.overflowSuffix=t,this.invalidateLayoutCache(e)}}}canRenderFont(e){return!0}isFontFaceSupported(e){return e instanceof I}addFontFace(e){C(e instanceof I),me.add(e.fontFace)}createState(e){return{props:e,status:"initialState",updateScheduled:!1,emitter:new B,canvasPages:void 0,lightning2TextRenderer:new ve(this.canvas,this.context),renderWindow:void 0,visibleWindow:{x1:0,y1:0,x2:0,y2:0,valid:!1},renderInfo:void 0,forceFullLayoutCalc:!1,textW:0,textH:0,fontInfo:void 0,fontFaceLoadedHandler:void 0,isRenderable:!1,debugData:{updateCount:0,layoutCount:0,drawCount:0,lastLayoutNumCharacters:0,layoutSum:0,drawSum:0,bufferSize:0}}}updateState(e){if("initialState"===e.status&&this.setStatus(e,"loading"),!e.fontInfo){var t=(r=e.props,n=r.fontFamily,[r.fontStyle,r.fontWeight,r.fontStretch,`${r.fontSize}px`,n].join(" "));if(e.fontInfo={cssString:t,loaded:!1},!e.fontInfo.loaded)return void me.load(t).then(this.onFontLoaded.bind(this,e,t)).catch(this.onFontLoadError.bind(this,e,t))}var r,n;if(e.fontInfo.loaded){if(!e.renderInfo){var o=e.props.maxLines,i="both"===e.props.contain?Math.floor((e.props.height-e.props.offsetY)/e.props.lineHeight):0,s=i>0&&o>0?Math.min(i,o):Math.max(i,o);e.lightning2TextRenderer.settings={text:e.props.text,textAlign:e.props.textAlign,fontFace:e.props.fontFamily,fontSize:e.props.fontSize,fontStyle:[e.props.fontStretch,e.props.fontStyle,e.props.fontWeight].join(" "),textColor:R(e.props.color),offsetY:e.props.fontSize+e.props.offsetY,wordWrap:"none"!==e.props.contain,wordWrapWidth:"none"===e.props.contain?void 0:e.props.width,letterSpacing:e.props.letterSpacing,lineHeight:e.props.lineHeight,maxLines:s,textBaseline:e.props.textBaseline,verticalAlign:e.props.verticalAlign,overflowSuffix:e.props.overflowSuffix},e.renderInfo=e.lightning2TextRenderer.calculateRenderInfo(),e.textH=e.renderInfo.lineHeight*e.renderInfo.lines.length,e.textW=e.renderInfo.width,e.renderWindow=void 0}var a=e.props,l=a.x,d=a.y,h=a.width,u=a.height,c=a.scrollY,f=a.contain,p=e.visibleWindow,v=e.renderWindow,g=e.canvasPages;if(!p.valid){var m=k(l,d,"none"!==f?l+h:1/0,"both"===f?d+u:1/0,xe);E(this.rendererBounds,m,p),p.valid=!0}var x=p.y2-p.y1,y=Math.ceil(x/e.renderInfo.lineHeight);if(0===x)return g=void 0,v=void 0,void this.setStatus(e,"loaded");if(v&&g){var b=l+v.x1,w=d-c+v.y1,S=l+v.x2,C=d-c+v.y2;if(b<=p.x1&&S>=p.x2&&w<=p.y1&&C>=p.y2)return void this.setStatus(e,"loaded");Cp.y1&&(v.y1-=y*e.renderInfo.lineHeight,v.y2-=y*e.renderInfo.lineHeight,g.unshift(g.pop()),g[0].lineNumStart=g[1].lineNumStart-y,g[0].lineNumEnd=g[0].lineNumStart+y,g[0].valid=!1)}else{var T,_,I,B=e.renderInfo.lineHeight*y,N=Math.ceil(c/B),F=N*y,L=F-y,z=F+y;g=[{texture:null===(T=g)||void 0===T?void 0:T[0].texture,lineNumStart:L,lineNumEnd:L+y,valid:!1},{texture:null===(_=g)||void 0===_?void 0:_[1].texture,lineNumStart:F,lineNumEnd:F+y,valid:!1},{texture:null===(I=g)||void 0===I?void 0:I[2].texture,lineNumStart:z,lineNumEnd:z+y,valid:!1}],e.canvasPages=g;var M=N*B;v={x1:0,y1:M-B,x2:h,y2:M+2*B}}e.renderWindow=v,performance.now();var P,D=A(g);try{for(D.s();!(P=D.n()).done;){var O=P.value;if(!O.valid)if(O.lineNumStart<0){var U;null===(U=O.texture)||void 0===U||U.setRenderableOwner(e,!1),O.texture=this.stage.txManager.loadTexture("ImageTexture",{src:""}),O.texture.setRenderableOwner(e,e.isRenderable),O.valid=!0}else{var W;if(e.lightning2TextRenderer.draw(e.renderInfo,{lines:e.renderInfo.lines.slice(O.lineNumStart,O.lineNumEnd),lineWidths:e.renderInfo.lineWidths.slice(O.lineNumStart,O.lineNumEnd)}),0!==this.canvas.width&&0!==this.canvas.height)null===(W=O.texture)||void 0===W||W.setRenderableOwner(e,!1),O.texture=this.stage.txManager.loadTexture("ImageTexture",{src:this.context.getImageData(0,0,this.canvas.width,this.canvas.height)},{preload:!0}),O.texture.setRenderableOwner(e,e.isRenderable);O.valid=!0}}}catch(Y){D.e(Y)}finally{D.f()}this.setStatus(e,"loaded")}}renderQuads(e,t,r,n){var o=this.stage,i=e.canvasPages,s=e.textW,a=void 0===s?0:s,l=e.textH,d=void 0===l?0:l,h=e.renderWindow;if(i&&h){var u=e.props,c=u.x,f=u.y,p=u.scrollY,v=u.contain,g=u.width,m=u.height,x={x:c,y:f,width:"none"!==v?g:a,height:"both"===v?m:d};N({x:0,y:0,width:o.options.appWidth,height:o.options.appHeight},x),C(i,"canvasPages is not defined"),C(h,"renderWindow is not defined");var y,b,w,S,A,T,_=(h.y2-h.y1)/3,k=e.props,I=k.zIndex,B=k.color,R=n*F(B),E=L(4294967295,R);if(i[0].valid)this.stage.renderer.addQuad({alpha:R,clippingRect:r,colorBl:E,colorBr:E,colorTl:E,colorTr:E,width:(null===(y=i[0].texture)||void 0===y||null===(y=y.dimensions)||void 0===y?void 0:y.width)||0,height:(null===(b=i[0].texture)||void 0===b||null===(b=b.dimensions)||void 0===b?void 0:b.height)||0,texture:i[0].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:I,tx:t.tx,ty:t.ty-p+h.y1,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td});if(i[1].valid)this.stage.renderer.addQuad({alpha:R,clippingRect:r,colorBl:E,colorBr:E,colorTl:E,colorTr:E,width:(null===(w=i[1].texture)||void 0===w||null===(w=w.dimensions)||void 0===w?void 0:w.width)||0,height:(null===(S=i[1].texture)||void 0===S||null===(S=S.dimensions)||void 0===S?void 0:S.height)||0,texture:i[1].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:I,tx:t.tx,ty:t.ty-p+h.y1+_,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td});if(i[2].valid)this.stage.renderer.addQuad({alpha:R,clippingRect:r,colorBl:E,colorBr:E,colorTl:E,colorTr:E,width:(null===(A=i[2].texture)||void 0===A||null===(A=A.dimensions)||void 0===A?void 0:A.width)||0,height:(null===(T=i[2].texture)||void 0===T||null===(T=T.dimensions)||void 0===T?void 0:T.height)||0,texture:i[2].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:I,tx:t.tx,ty:t.ty-p+h.y1+_+_,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td})}}setIsRenderable(e,t){var r;super.setIsRenderable(e,t),null===(r=e.canvasPages)||void 0===r||r.forEach((r=>{var n;null===(n=r.texture)||void 0===n||n.setRenderableOwner(e,t)}))}destroyState(e){var t;null===(t=e.canvasPages)||void 0===t||t.forEach((t=>{var r;null===(r=t.texture)||void 0===r||r.setRenderableOwner(e,!1)}))}invalidateVisibleWindowCache(e){e.visibleWindow.valid=!1,this.setStatus(e,"loading"),this.scheduleUpdateState(e)}invalidateLayoutCache(e){e.renderInfo=void 0,e.visibleWindow.valid=!1,this.setStatus(e,"loading"),this.scheduleUpdateState(e)}onFontLoaded(e,t){var r;t===(null===(r=e.fontInfo)||void 0===r?void 0:r.cssString)&&e.fontInfo&&(e.fontInfo.loaded=!0,this.scheduleUpdateState(e))}onFontLoadError(e,t,r){var n;t===(null===(n=e.fontInfo)||void 0===n?void 0:n.cssString)&&e.fontInfo&&(e.fontInfo.loaded=!0,console.error(`CanvasTextRenderer: Error loading font '${e.fontInfo.cssString}'`,r),this.scheduleUpdateState(e))}}class be extends z{constructor(e){super({renderer:e,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2fv"}]})}bindTextures(e){var t=this.glw;t.activeTexture(0),t.bindTexture(e[0].ctxTexture)}}S(be,"shaderSources",{vertex:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n ",fragment:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate);\n gl_FragColor = vec4(v_color) * texture2D(u_texture, v_textureCoordinate);\n }\n "});class we extends z{constructor(e){super({renderer:e,attributes:["a_position","a_textureCoordinate","a_color","a_textureIndex"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_textures[0]",uniform:"uniform1iv"}]}),S(this,"supportsIndexedTextures",!0)}bindTextures(e){var t=this.renderer,r=this.glw;if(e.length>t.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS)throw new Error(`DefaultShaderBatched: Cannot bind more than ${t.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS} textures`);e.forEach(((e,t)=>{r.activeTexture(t),r.bindTexture(e.ctxTexture)}));var n=Array.from(Array(e.length).keys());this.setUniform("u_textures[0]",n)}}S(we,"shaderSources",{vertex:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n ",fragment:e=>`\n #define txUnits ${e}\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_image;\n uniform sampler2D u_textures[txUnits];\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n vec4 sampleFromTexture(sampler2D textures[${e}], int idx, vec2 uv) {\n ${Array.from(Array(e).keys()).map((e=>`\n ${0!==e?"else ":""}if (idx == ${e}) {\n return texture2D(textures[${e}], uv);\n }\n `)).join("")}\n return texture2D(textures[0], uv);\n }\n\n void main(){\n gl_FragColor = vec4(v_color) * sampleFromTexture(u_textures, int(v_textureIndex), v_textureCoordinate);\n }\n `});var Se=new Map,Ae=(e,t)=>{var r=JSON.stringify(e);if(Se.has(r))return Se.get(r);var n=(null!=e?e:[]).map((e=>({type:e.type,props:t[e.type].resolveDefaults(e.props||{})})));return Se.set(r,n),n};class Ce extends z{constructor(e,t,r){var n=Ce.createShader(t,r);super({renderer:e,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2fv"},{name:"u_dimensions",uniform:"uniform2fv"},{name:"u_alpha",uniform:"uniform1f"},...n.uniforms],shaderSources:{vertex:n.vertex,fragment:n.fragment}}),S(this,"effects",[]),this.effects=n.effects,this.calculateProps=M(this.calculateProps.bind(this))}bindTextures(e){var t=this.glw;t.activeTexture(0),t.bindTexture(e[0].ctxTexture)}calculateProps(e){var t=this.renderer.shManager.getRegisteredEffects(),r=[];return null==e||e.forEach(((e,n)=>{var o,i=this.effects[n],s=t[i.name],a=null!==(o=e.props)&&void 0!==o?o:{},l=i.uniformInfo;Object.keys(a).forEach((e=>{var t=s.uniforms[e],n=l[e],o=t.validator?t.validator(a[e],a):a[e];Array.isArray(o)&&(o=new Float32Array(o)),r.push({name:n.name,value:o})}))})),r}bindProps(e){this.calculateProps(e.effects).forEach((e=>{this.setUniform(e.name,e.value)}))}canBatchShaderProps(e,t){if(e.$dimensions.width!==t.$dimensions.width||e.$dimensions.height!==t.$dimensions.height||e.effects.length!==t.effects.length)return!1;for(var r=e.effects.length,n=0;n{var n=t[e.type],a=n.getEffectKey(e.props||{});r[a]=r[a]?++r[a]:1;var l=r[a];1===l&&s.push({key:a,type:e.type,props:e.props});var d=new n({ref:`${a}${1===l?"":l}`,target:a,props:e.props});return o+=d.declaredUniforms,i.push(...Object.values(d.uniformInfo)),d})),l="";null==s||s.forEach((e=>{var r,o=t[e.type],i=o.resolveDefaults(null!==(r=e.props)&&void 0!==r?r:{}),s=[];for(var a in o.methods){var d=a,h=o.methods[a];n[a]&&n[a]!==h&&(d=Ce.resolveMethodDuplicate(a,h,n)),n[d]=h.replace("function",d),s.push({m:a,cm:d})}var u=o.onShaderMask instanceof Function?o.onShaderMask(i):o.onShaderMask,c=o.onColorize instanceof Function?o.onColorize(i):o.onColorize,f=o.onEffectMask instanceof Function?o.onEffectMask(i):o.onEffectMask;s.forEach((e=>{var t=e.m,r=e.cm,n=new RegExp(`\\$${t}`,"g");u&&(u=u.replace(n,r)),c&&(c=c.replace(n,r)),f&&(f=f.replace(n,r))}));var p=o.getMethodParameters(o.uniforms,i),v=p.length>0?`, ${p}`:"";u&&(l+=`\n float fx_${e.key}_onShaderMask(float shaderMask ${v}) {\n ${u}\n }\n `),c&&(l+=`\n vec4 fx_${e.key}_onColorize(float shaderMask, vec4 maskColor, vec4 shaderColor${v}) {\n ${c}\n }\n `),f&&(l+=`\n vec4 fx_${e.key}_onEffectMask(float shaderMask, vec4 maskColor, vec4 shaderColor${v}) {\n ${f}\n }\n `)}));var d="";for(var h in n)d+=n[h];for(var u="mix(shaderColor, maskColor, clamp(-(lng_DefaultMask), 0.0, 1.0))",c="\n\n ",f=0;f0?`, ${p.passParameters}`:"",g=t[p.name];g.onShaderMask&&(c+=`\n shaderMask = fx_${p.target}_onShaderMask(shaderMask ${v});\n `),g.onColorize&&(c+=`\n maskColor = fx_${p.target}_onColorize(shaderMask, maskColor, shaderColor${v});\n `),g.onEffectMask&&(u=`fx_${p.target}_onEffectMask(shaderMask, maskColor, shaderColor${v})`);var m=a[f+1];(void 0===m||t[m.name].onEffectMask)&&(c+=`\n shaderColor = ${u};\n `)}return{effects:a,uniforms:i,fragment:Ce.fragment(o,d,l,c),vertex:Ce.vertex()}}static resolveMethodDuplicate(e,t,r,n=0){var o=e+(n>0?n:"");return r[o]&&r[o]!==t?this.resolveMethodDuplicate(e,t,r,++n):o}static resolveDefaults(e,t){return{effects:Ae(e.effects,t),$dimensions:{width:0,height:0},$alpha:0}}static makeCacheKey(e,t){var r,n="";return null===(r=e.effects)||void 0===r||r.forEach((e=>{var r=t[e.type].getEffectKey(e.props||{});n+=`,${r}`})),`DynamicShader${n}`}}S(Ce,"z$__type__Props",void 0),S(Ce,"vertex",(()=>"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n ")),S(Ce,"fragment",((e,t,r,n)=>`\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n #define PI 3.14159265359\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_alpha;\n uniform float u_radius;\n uniform sampler2D u_texture;\n uniform float u_pixelRatio;\n\n ${e}\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n ${t}\n\n ${r}\n\n void main() {\n vec2 p = v_textureCoordinate.xy * u_dimensions - u_dimensions * 0.5;\n vec2 d = abs(p) - (u_dimensions) * 0.5;\n float lng_DefaultMask = min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n\n vec4 shaderColor = vec4(0.0);\n float shaderMask = lng_DefaultMask;\n\n vec4 maskColor = texture2D(u_texture, v_textureCoordinate) * v_color;\n\n shaderColor = mix(shaderColor, maskColor, clamp(-(lng_DefaultMask + 0.5), 0.0, 1.0));\n\n ${n}\n\n gl_FragColor = shaderColor * u_alpha;\n }\n `));class Te extends z{constructor(e){super({renderer:e,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2f"},{name:"u_dimensions",uniform:"uniform2fv"},{name:"u_radius",uniform:"uniform1f"}]})}static resolveDefaults(e){return{radius:e.radius||10,$dimensions:{width:0,height:0}}}bindTextures(e){var t=this.glw;t.activeTexture(0),t.bindTexture(e[0].ctxTexture)}bindProps(e){this.setUniform("u_radius",e.radius)}canBatchShaderProps(e,t){return e.radius===t.radius&&e.$dimensions.width===t.$dimensions.width&&e.$dimensions.height===t.$dimensions.height}}S(Te,"z$__type__Props",void 0),S(Te,"shaderSources",{vertex:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n ",fragment:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_radius;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n float boxDist(vec2 p, vec2 size, float radius){\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n\n float fillMask(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate) * v_color;\n vec2 halfDimensions = u_dimensions * 0.5;\n\n float d = boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions + 0.5, u_radius);\n gl_FragColor = mix(vec4(0.0), color, fillMask(d));\n }\n "});var _e=new Float32Array([1,0,0,0,1,0,0,0,1]);class ke extends z{constructor(e){super({renderer:e,attributes:["a_position","a_textureCoordinate"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_transform",uniform:"uniformMatrix3fv"},{name:"u_scrollY",uniform:"uniform1f"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2f"},{name:"u_color",uniform:"uniform4fv"},{name:"u_size",uniform:"uniform1f"},{name:"u_distanceRange",uniform:"uniform1f"},{name:"u_debug",uniform:"uniform1i"}]})}bindTextures(e){var t=this.glw;t.activeTexture(0),t.bindTexture(e[0].ctxTexture)}bindProps(e){var t=ke.resolveDefaults(e);for(var r in t)if("transform"===r)this.setUniform("u_transform",!1,t[r]);else if("scrollY"===r)this.setUniform("u_scrollY",t[r]);else if("color"===r){var n=R(t.color);this.setUniform("u_color",n)}else"size"===r?this.setUniform("u_size",t[r]):"distanceRange"===r?this.setUniform("u_distanceRange",t[r]):"debug"===r&&this.setUniform("u_debug",t[r]?1:0)}static resolveDefaults(e={}){var t,r,n,o,i,s;return{transform:null!==(t=e.transform)&&void 0!==t?t:_e,scrollY:null!==(r=e.scrollY)&&void 0!==r?r:0,color:null!==(n=e.color)&&void 0!==n?n:4294967295,size:null!==(o=e.size)&&void 0!==o?o:16,distanceRange:null!==(i=e.distanceRange)&&void 0!==i?i:1,debug:null!==(s=e.debug)&&void 0!==s&&s}}}S(ke,"shaderSources",{vertex:"\n // an attribute is an input (in) to a vertex shader.\n // It will receive data from a buffer\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n\n uniform vec2 u_resolution;\n uniform mat3 u_transform;\n uniform float u_scrollY;\n uniform float u_pixelRatio;\n uniform float u_size;\n\n varying vec2 v_texcoord;\n\n void main() {\n vec2 scrolledPosition = a_position * u_size - vec2(0, u_scrollY);\n vec2 transformedPosition = (u_transform * vec3(scrolledPosition, 1)).xy;\n gl_Position = vec4((transformedPosition * u_pixelRatio / u_resolution * 2.0 - 1.0) * vec2(1, -1), 0, 1);\n v_texcoord = a_textureCoordinate;\n }\n ",fragment:"\n precision highp float;\n\n uniform vec4 u_color;\n uniform sampler2D u_texture;\n uniform float u_distanceRange;\n uniform float u_pixelRatio;\n uniform int u_debug;\n\n varying vec2 v_texcoord;\n\n float median(float r, float g, float b) {\n return max(min(r, g), min(max(r, g), b));\n }\n\n void main() {\n vec3 sample = texture2D(u_texture, v_texcoord).rgb;\n if (u_debug == 1) {\n gl_FragColor = vec4(sample.r, sample.g, sample.b, 1.0);\n return;\n }\n float scaledDistRange = u_distanceRange * u_pixelRatio;\n float sigDist = scaledDistRange * (median(sample.r, sample.g, sample.b) - 0.5);\n float opacity = clamp(sigDist + 0.5, 0.0, 1.0) * u_color.a;\n\n // Build the final color.\n // IMPORTANT: We must premultiply the color by the alpha value before returning it.\n gl_FragColor = vec4(u_color.r * opacity, u_color.g * opacity, u_color.b * opacity, opacity);\n }\n "});class Ie extends ue{constructor(...e){super(...e),S(this,"name","radius")}static getEffectKey(){return"radius"}static resolveDefaults(e){var t;return{radius:null!==(t=e.radius)&&void 0!==t?t:10}}}S(Ie,"z$__type__Props",void 0),S(Ie,"uniforms",{radius:{value:0,method:"uniform4fv",type:"vec4",validator:e=>{var t=e;return Array.isArray(t)?2===t.length?t=[t[0],t[1],t[0],t[1]]:3===t.length?t=[t[0],t[1],t[2],t[0]]:4!==t.length&&(t=[t[0],t[0],t[0],t[0]]):"number"==typeof t&&(t=[t,t,t,t]),t}}}),S(Ie,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",boxDist:"\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n "}),S(Ie,"onShaderMask","\n vec2 halfDimensions = u_dimensions * 0.5;\n float r = radius[0] * step(v_textureCoordinate.x, 0.5) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[1] * step(0.5, v_textureCoordinate.x) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[2] * step(0.5, v_textureCoordinate.x) * step(0.5, v_textureCoordinate.y);\n r = r + radius[3] * step(v_textureCoordinate.x, 0.5) * step(0.5, v_textureCoordinate.y);\n return $boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions, r);\n "),S(Ie,"onEffectMask","\n return mix(vec4(0.0), maskColor, $fillMask(shaderMask));\n ");class Be extends ue{constructor(...e){super(...e),S(this,"name","border")}static getEffectKey(){return"border"}static resolveDefaults(e){var t,r;return{width:null!==(t=e.width)&&void 0!==t?t:10,color:null!==(r=e.color)&&void 0!==r?r:4294967295}}}S(Be,"z$__type__Props",void 0),S(Be,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>R(e),method:"uniform4fv",type:"vec4"}}),S(Be,"onEffectMask","\n float mask = clamp(shaderMask + width, 0.0, 1.0) - clamp(shaderMask, 0.0, 1.0);\n return mix(shaderColor, mix(shaderColor, maskColor, maskColor.a), mask);\n "),S(Be,"onColorize","\n return color;\n ");class Re extends ue{constructor(...e){super(...e),S(this,"name","linearGradient")}static getEffectKey(e){return`linearGradient${e.colors.length}`}static resolveDefaults(e){var t,r,n=null!==(t=e.colors)&&void 0!==t?t:[4278190080,4294967295],o=e.stops||[];if(0===o.length||o.length!==n.length){for(var i=n.length,s=0,a=o;se.map((e=>R(e))).reduce(((e,t)=>e.concat(t)),[]),size:e=>e.colors.length,method:"uniform4fv",type:"vec4"},stops:{value:[],size:e=>e.colors.length,method:"uniform1fv",type:"float"}}),S(Re,"methods",{fromLinear:"\n vec4 function(vec4 linearRGB) {\n vec4 higher = vec4(1.055)*pow(linearRGB, vec4(1.0/2.4)) - vec4(0.055);\n vec4 lower = linearRGB * vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n ",toLinear:"\n vec4 function(vec4 sRGB) {\n vec4 higher = pow((sRGB + vec4(0.055))/vec4(1.055), vec4(2.4));\n vec4 lower = sRGB/vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n ",calcPoint:"\n vec2 function(float d, float angle) {\n return d * vec2(cos(angle), sin(angle)) + (u_dimensions * 0.5);\n }\n "}),S(Re,"ColorLoop",(e=>{for(var t="",r=2;r{var t=e.colors.length||1;return`\n float a = angle - (PI / 180.0 * 90.0);\n float lineDist = abs(u_dimensions.x * cos(a)) + abs(u_dimensions.y * sin(a));\n vec2 f = $calcPoint(lineDist * 0.5, a);\n vec2 t = $calcPoint(lineDist * 0.5, a + PI);\n vec2 gradVec = t - f;\n float dist = dot(v_textureCoordinate.xy * u_dimensions - f, gradVec) / dot(gradVec, gradVec);\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = $fromLinear(mix($toLinear(colors[0]), $toLinear(colors[1]), stopCalc));\n ${J.ColorLoop(t)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `}));class Ee extends ue{constructor(...e){super(...e),S(this,"name","grayscale")}static getEffectKey(){return"grayscale"}static resolveDefaults(e){var t;return{amount:null!==(t=e.amount)&&void 0!==t?t:1}}}S(Ee,"uniforms",{amount:{value:1,method:"uniform1f",type:"float"}}),S(Ee,"onColorize","\n float grayness = 0.2 * maskColor.r + 0.6 * maskColor.g + 0.2 * maskColor.b;\n return vec4(amount * vec3(grayness) + (1.0 - amount) * maskColor.rgb, maskColor.a);\n ");class Ne extends ue{constructor(...e){super(...e),S(this,"name","borderRight")}static getEffectKey(){return"borderRight"}static resolveDefaults(e){var t,r;return{width:null!==(t=e.width)&&void 0!==t?t:10,color:null!==(r=e.color)&&void 0!==r?r:4294967295}}}S(Ne,"z$__type__Props",void 0),S(Ne,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>R(e),method:"uniform4fv",type:"vec4"}}),S(Ne,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),S(Ne,"onEffectMask","\n vec2 pos = vec2(u_dimensions.x - width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),S(Ne,"onColorize","\n return color;\n ");class Fe extends ue{constructor(...e){super(...e),S(this,"name","borderTop")}static getEffectKey(){return"borderTop"}static resolveDefaults(e){var t,r;return{width:null!==(t=e.width)&&void 0!==t?t:10,color:null!==(r=e.color)&&void 0!==r?r:4294967295}}}S(Fe,"z$__type__Props",void 0),S(Fe,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>R(e),method:"uniform4fv",type:"vec4"}}),S(Fe,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),S(Fe,"onEffectMask","\n vec2 pos = vec2(0.0, width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),S(Fe,"onColorize","\n return color;\n ");class Le extends ue{constructor(...e){super(...e),S(this,"name","borderBottom")}static getEffectKey(){return"borderBottom"}static resolveDefaults(e){var t,r;return{width:null!==(t=e.width)&&void 0!==t?t:10,color:null!==(r=e.color)&&void 0!==r?r:4294967295}}}S(Le,"z$__type__Props",void 0),S(Le,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>R(e),method:"uniform4fv",type:"vec4"}}),S(Le,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),S(Le,"onEffectMask","\n vec2 pos = vec2(0.0, u_dimensions.y - width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),S(Le,"onColorize","\n return color;\n ");class ze extends ue{constructor(...e){super(...e),S(this,"name","borderLeft")}static getEffectKey(){return"borderLeft"}static resolveDefaults(e){var t,r;return{width:null!==(t=e.width)&&void 0!==t?t:10,color:null!==(r=e.color)&&void 0!==r?r:4294967295}}}S(ze,"z$__type__Props",void 0),S(ze,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>R(e),method:"uniform4fv",type:"vec4"}}),S(ze,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",rectDist:"\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n "}),S(ze,"onEffectMask","\n vec2 pos = vec2(width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n "),S(ze,"onColorize","\n return color;\n ");class Me extends ue{constructor(...e){super(...e),S(this,"name","glitch")}static getEffectKey(e){return"glitch"}static resolveDefaults(e){var t,r,n,o,i;return{amplitude:null!==(t=e.amplitude)&&void 0!==t?t:.2,narrowness:null!==(r=e.narrowness)&&void 0!==r?r:4,blockiness:null!==(n=e.blockiness)&&void 0!==n?n:2,minimizer:null!==(o=e.minimizer)&&void 0!==o?o:8,time:null!==(i=e.time)&&void 0!==i?i:Date.now()}}}S(Me,"z$__type__Props",void 0),S(Me,"uniforms",{amplitude:{value:0,method:"uniform1f",type:"float"},narrowness:{value:0,method:"uniform1f",type:"float"},blockiness:{value:0,method:"uniform1f",type:"float"},minimizer:{value:0,method:"uniform1f",type:"float"},time:{value:0,method:"uniform1f",validator:e=>(Date.now()-e)%1e3,type:"float"}}),S(Me,"methods",{rand:"\n float function(vec2 p, float time) {\n float t = floor(time * 20.) / 10.;\n return fract(sin(dot(p, vec2(t * 12.9898, t * 78.233))) * 43758.5453);\n }\n ",noise:"\n float function(vec2 uv, float blockiness, float time) {\n vec2 lv = fract(uv);\n vec2 id = floor(uv);\n\n float n1 = rand(id, time);\n float n2 = rand(id+vec2(1,0), time);\n float n3 = rand(id+vec2(0,1), time);\n float n4 = rand(id+vec2(1,1), time);\n vec2 u = smoothstep(0.0, 1.0 + blockiness, lv);\n return mix(mix(n1, n2, u.x), mix(n3, n4, u.x), u.y);\n }\n ",fbm:"\n float function(vec2 uv, int count, float blockiness, float complexity, float time) {\n float val = 0.0;\n float amp = 0.5;\n const int MAX_ITERATIONS = 10;\n\n for(int i = 0; i < MAX_ITERATIONS; i++) {\n if(i >= count) {break;}\n val += amp * noise(uv, blockiness, time);\n amp *= 0.5;\n uv *= complexity;\n }\n return val;\n }\n "}),S(Me,"onColorize","\n vec2 uv = v_textureCoordinate.xy;\n float aspect = u_dimensions.x / u_dimensions.y;\n vec2 a = vec2(uv.x * aspect , uv.y);\n vec2 uv2 = vec2(a.x / u_dimensions.x, exp(a.y));\n\n float shift = amplitude * pow($fbm(uv2, 4, blockiness, narrowness, time), minimizer);\n float colR = texture2D(u_texture, vec2(uv.x + shift, uv.y)).r * (1. - shift);\n float colG = texture2D(u_texture, vec2(uv.x - shift, uv.y)).g * (1. - shift);\n float colB = texture2D(u_texture, vec2(uv.x - shift, uv.y)).b * (1. - shift);\n\n vec3 f = vec3(colR, colG, colB);\n return vec4(f, texture2D(u_texture, vec2(uv.x - shift, uv.y)).a);\n ");class Pe extends ue{constructor(...e){super(...e),S(this,"name","fadeOut")}static getEffectKey(){return"fadeOut"}static resolveDefaults(e){var t;return{fade:null!==(t=e.fade)&&void 0!==t?t:10}}}S(Pe,"z$__type__Props",void 0),S(Pe,"uniforms",{fade:{value:0,method:"uniform4fv",type:"vec4",validator:e=>{var t=e;return Array.isArray(t)?2===t.length?t=[t[0],t[1],t[0],t[1]]:3===t.length?t=[t[0],t[1],t[2],t[0]]:4!==t.length&&(t=[t[0],t[0],t[0],t[0]]):"number"==typeof t&&(t=[t,t,t,t]),t}}}),S(Pe,"onColorize","\n vec2 point = v_textureCoordinate.xy * u_dimensions.xy;\n vec2 pos1;\n vec2 pos2;\n vec2 d;\n float c;\n vec4 result = maskColor;\n\n\n if(fade[0] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x, point.y + fade[0]);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[1] > 0.0) {\n pos1 = vec2(point.x - u_dimensions.x - fade[1], v_textureCoordinate.y);\n pos2 = vec2(point.x - u_dimensions.x, v_textureCoordinate.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[2] > 0.0) {\n pos1 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y - fade[2]);\n pos2 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[3] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x + fade[3], point.y);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n return result;\n ");class De extends ue{constructor(...e){super(...e),S(this,"name","radialGradient")}static getEffectKey(e){return`radialGradient${e.colors.length}`}static resolveDefaults(e){var t,r,n,o,i,s=null!==(t=e.colors)&&void 0!==t?t:[4278190080,4294967295],a=e.stops||[];if(0===a.length||a.length!==s.length){for(var l=s.length,d=0,h=a;de.map((e=>R(e))).reduce(((e,t)=>e.concat(t)),[]),size:e=>e.colors.length,method:"uniform4fv",type:"vec4"},stops:{value:[],size:e=>e.colors.length,method:"uniform1fv",type:"float"}}),S(De,"ColorLoop",(e=>{for(var t="",r=2;r{var t=e.colors.length||1;return`\n vec2 point = v_textureCoordinate.xy * u_dimensions;\n vec2 projection = vec2(pivot.x * u_dimensions.x, pivot.y * u_dimensions.y);\n\n float dist = length((point - projection) / vec2(width, height));\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = mix(colors[0], colors[1], stopCalc);\n ${ee.ColorLoop(t)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `}));class Oe extends ue{constructor(...e){super(...e),S(this,"name","radialProgress")}static getEffectKey(){return"radialProgress"}static resolveDefaults(e){var t,r,n,o,i,s,a;return{width:null!==(t=e.width)&&void 0!==t?t:10,progress:null!==(r=e.progress)&&void 0!==r?r:.5,offset:null!==(n=e.offset)&&void 0!==n?n:0,range:null!==(o=e.range)&&void 0!==o?o:2*Math.PI,rounded:null!==(i=e.rounded)&&void 0!==i&&i,radius:null!==(s=e.radius)&&void 0!==s?s:1,color:null!==(a=e.color)&&void 0!==a?a:4294967295}}}S(Oe,"z$__type__Props",void 0),S(Oe,"uniforms",{width:{value:0,method:"uniform1f",type:"float"},progress:{value:.5,method:"uniform1f",type:"float"},offset:{value:0,method:"uniform1f",type:"float"},range:{value:0,method:"uniform1f",type:"float"},rounded:{value:0,method:"uniform1f",type:"float",validator:e=>e?1:0},radius:{value:1,method:"uniform1f",type:"float"},color:{value:4294967295,validator:e=>R(e),method:"uniform4fv",type:"vec4"}}),S(Oe,"methods",{rotateUV:"\n vec2 function(vec2 uv, float d) {\n float s = sin(d);\n float c = cos(d);\n mat2 rotMatrix = mat2(c, -s, s, c);\n return uv * rotMatrix;\n }\n ",drawDot:"\n float function(vec2 uv, vec2 p, float r) {\n uv += p;\n float circle = length(uv) - r;\n return clamp(-circle, 0.0, 1.0);\n }\n "}),S(Oe,"onEffectMask","\n float outerRadius = radius * u_dimensions.y * 0.5;\n\n float endAngle = range * progress - 0.0005;\n\n vec2 uv = v_textureCoordinate.xy * u_dimensions.xy - u_dimensions * 0.5;\n\n uv = $rotateUV(uv, -(offset));\n float linewidth = width * u_pixelRatio;\n float circle = length(uv) - (outerRadius - linewidth) ;\n circle = abs(circle) - linewidth;\n circle = clamp(-circle, 0.0, 1.0);\n\n float angle = (atan(uv.x, -uv.y) / 3.14159265359 * 0.5);\n float p = endAngle / (PI * 2.);\n\n circle *= step(fract(angle), fract(p));\n\n circle = rounded < 1. ? circle : max(circle, $drawDot(uv, vec2(0, outerRadius - linewidth), linewidth));\n circle = rounded < 1. ? circle : max(circle, $drawDot($rotateUV(uv, -(endAngle)), vec2(0, outerRadius - linewidth), linewidth));\n\n return mix(shaderColor, maskColor, circle);\n "),S(Oe,"onColorize","\n return color;\n ");class Ue extends ue{constructor(...e){super(...e),S(this,"name","holePunch")}static getEffectKey(){return"holePunch"}static resolveDefaults(e){var t;return{x:e.x||0,y:e.y||0,width:e.width||50,height:e.height||50,radius:null!==(t=e.radius)&&void 0!==t?t:0}}}S(Ue,"z$__type__Props",void 0),S(Ue,"uniforms",{x:{value:0,method:"uniform1f",type:"float"},y:{value:0,method:"uniform1f",type:"float"},width:{value:0,method:"uniform1f",type:"float"},height:{value:0,method:"uniform1f",type:"float"},radius:{value:0,method:"uniform4fv",type:"vec4",validator:e=>{var t=e;return Array.isArray(t)?2===t.length?t=[t[0],t[1],t[0],t[1]]:3===t.length?t=[t[0],t[1],t[2],t[0]]:4!==t.length&&(t=[t[0],t[0],t[0],t[0]]):"number"==typeof t&&(t=[t,t,t,t]),t}}}),S(Ue,"methods",{fillMask:"\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n ",boxDist:"\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n "}),S(Ue,"onShaderMask","\n vec2 halfDimensions = u_dimensions * 0.5;\n vec2 size = vec2(width, height) * 0.5;\n vec2 basePos = v_textureCoordinate.xy * u_dimensions.xy - vec2(x, y);\n vec2 pos = basePos - size;\n float r = radius[0] * step(pos.x, 0.5) * step(pos.y, 0.5);\n r = r + radius[1] * step(0.5, pos.x) * step(pos.y, 0.5);\n r = r + radius[2] * step(0.5, pos.x) * step(0.5, pos.y);\n r = r + radius[3] * step(pos.x, 0.5) * step(0.5, pos.y);\n return $boxDist(pos, size, r);\n "),S(Ue,"onEffectMask","\n return mix(maskColor, vec4(0.0), $fillMask(shaderMask));\n ");class We{constructor(){S(this,"shCache",new Map),S(this,"shConstructors",{}),S(this,"attachedShader",null),S(this,"effectConstructors",{}),S(this,"renderer",void 0),this.registerShaderType("DefaultShader",be),this.registerShaderType("DefaultShaderBatched",we),this.registerShaderType("RoundedRectangle",Te),this.registerShaderType("DynamicShader",Ce),this.registerShaderType("SdfShader",ke),this.registerEffectType("border",Be),this.registerEffectType("borderBottom",Le),this.registerEffectType("borderLeft",ze),this.registerEffectType("borderRight",Ne),this.registerEffectType("borderTop",Fe),this.registerEffectType("fadeOut",Pe),this.registerEffectType("linearGradient",Re),this.registerEffectType("radialGradient",De),this.registerEffectType("grayscale",Ee),this.registerEffectType("glitch",Me),this.registerEffectType("radius",Ie),this.registerEffectType("radialProgress",Oe),this.registerEffectType("holePunch",Ue)}registerShaderType(e,t){this.shConstructors[e]=t}registerEffectType(e,t){this.effectConstructors[e]=t}getRegisteredEffects(){return this.effectConstructors}getRegisteredShaders(){return this.shConstructors}loadShader(e,t){if(!this.renderer)throw new Error("Renderer is not been defined");var r=this.shConstructors[e];if(!r)throw new Error(`Shader type "${e}" is not registered`);if("DynamicShader"===e)return this.loadDynamicShader(t);var n=r.resolveDefaults(t),o=r.makeCacheKey(n)||r.name;if(o&&this.shCache.has(o))return{shader:this.shCache.get(o),props:n};var i=new r(this.renderer,t);return o&&this.shCache.set(o,i),{shader:i,props:n}}loadDynamicShader(e){if(!this.renderer)throw new Error("Renderer is not been defined");var t=Ce.resolveDefaults(e,this.effectConstructors),r=Ce.makeCacheKey(t,this.effectConstructors);if(r&&this.shCache.has(r))return{shader:this.shCache.get(r),props:t};var n=new Ce(this.renderer,e,this.effectConstructors);return r&&this.shCache.set(r,n),{shader:n,props:t}}useShader(e){this.attachedShader!==e&&(this.attachedShader&&this.attachedShader.detach(),e.attach(),this.attachedShader=e)}}class Ye{constructor(){S(this,"data",{})}reset(){this.data={}}increment(e){this.data[e]||(this.data[e]=0),this.data[e]++}getData(){return w({},this.data)}}var je=function(){var e=y(m().mark((function e(t){var r,n;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(t);case 2:return r=e.sent,e.next=5,r.arrayBuffer();case 5:if(n=e.sent,-1===t.indexOf(".ktx")){e.next=8;break}return e.abrupt("return",He(n));case 8:return e.abrupt("return",Qe(n));case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),He=function(){var e=y(m().mark((function e(t){var r,n,o,i,s,a,l;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(r=new DataView(t),n=16909060===r.getUint32(12),o=[],i={glInternalFormat:r.getUint32(28,n),pixelWidth:r.getUint32(36,n),pixelHeight:r.getUint32(40,n),numberOfMipmapLevels:r.getUint32(56,n),bytesOfKeyValueData:r.getUint32(60,n)},s=64,s+=i.bytesOfKeyValueData,a=0;a>2)*(h+3>>2)*8,f=new Uint8Array(r,i.byteOffset+l,c),s.push(f),l+=c,d>>=1,h>>=1;return e.abrupt("return",{data:{glInternalFormat:36196,mipmaps:s,width:a.pixelWidth||0,height:a.pixelHeight||0,type:"pvr"},premultiplyAlpha:!1});case 17:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();class Ke extends P{constructor(e,t){super(e),S(this,"props",void 0),this.props=Ke.resolveDefaults(t)}hasAlphaChannel(e){return-1!==e.indexOf("image/png")}getTextureData(){var e=this;return y(m().mark((function t(){var r,n,o,i,s,a,l;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.props,n=r.src,o=r.premultiplyAlpha,n){t.next=3;break}return t.abrupt("return",{data:null});case 3:if(!(n instanceof ImageData)){t.next=5;break}return t.abrupt("return",{data:n,premultiplyAlpha:o});case 5:if(!/\.(ktx|pvr)$/.test(n)){t.next=7;break}return t.abrupt("return",je(n));case 7:if(!e.txManager.imageWorkerManager){t.next=13;break}return t.next=10,e.txManager.imageWorkerManager.getImage(n,o);case 10:return t.abrupt("return",t.sent);case 13:if(!e.txManager.hasCreateImageBitmap){t.next=28;break}return t.next=16,fetch(n);case 16:return i=t.sent,t.next=19,i.blob();case 19:return s=t.sent,a=null!=o?o:e.hasAlphaChannel(s.type),t.next=23,createImageBitmap(s,{premultiplyAlpha:a?"premultiply":"none",colorSpaceConversion:"none",imageOrientation:"none"});case 23:return t.t0=t.sent,t.t1=a,t.abrupt("return",{data:t.t0,premultiplyAlpha:t.t1});case 28:return(l=new Image).src=n,t.next=32,new Promise(((e,t)=>{l.onload=()=>e(),l.onerror=()=>t(new Error("Failed to load image"))})).catch((e=>{console.error(e)}));case 32:return t.abrupt("return",{data:l,premultiplyAlpha:null==o||o});case 33:case"end":return t.stop()}}),t)})))()}static makeCacheKey(e){var t=Ke.resolveDefaults(e);return!(t.src instanceof ImageData)&&`ImageTexture,${t.src},${t.premultiplyAlpha}`}static resolveDefaults(e){var t,r;return{src:null!==(t=e.src)&&void 0!==t?t:"",premultiplyAlpha:null===(r=e.premultiplyAlpha)||void 0===r||r}}}S(Ke,"z$__type__Props",void 0);class $e{constructor(e,t=0){S(this,"iterator",void 0),S(this,"peekBuffer",[]),S(this,"_lastIndex",void 0),this.iterator=e,this.iterator=e,this._lastIndex=t-1,this.peekBuffer=[]}next(){var e=this.peekBuffer.length>0?this.peekBuffer.pop():this.iterator.next();return e.done?this._lastIndex=-1:this._lastIndex++,e}peek(){if(this.peekBuffer.length>0)return this.peekBuffer[0];var e=this.iterator.next();return this.peekBuffer.push(e),e}get lastIndex(){return this._lastIndex}}function Xe(e,t=0){var r,n;return m().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:r=t;case 1:if(!(r=f.y1,K=E<=f.y2,$=Q&&K;(y=M.next())&&!y.done;){var X=y.value;if(e===c.length)c.push({codepointIndex:X.cluster,maxY:B,maxX:I});else if(e>c.length)throw new Error("Unexpected lineCache length");if(32===X.codepoint||10===X.codepoint?-1!==F.codepointIndex&&(F.codepointIndex=-1,H=R):-1===F.codepointIndex&&(F.codepointIndex=X.cluster,F.bufferOffset=N,F.xStart=H),X.mapped){var G=R+X.xOffset+X.width;if("none"!==u&&G>=j&&-1!==F.codepointIndex&&F.xStart>0){if(Y){M=L.shapeText(z,new $e(Xe(n,F.codepointIndex),F.codepointIndex)),N=F.bufferOffset;break}M=L.shapeText(z,new $e(Xe(m,0),0)),R=F.xStart,N=F.bufferOffset,u="none"}else{var V=R+X.xOffset,Z=E+X.yOffset;if($){-1===P&&(P=N);var q=p.getAtlasEntry(X.glyphId),J=q.x/p.data.common.scaleW,ee=q.y/p.data.common.scaleH,te=q.width/p.data.common.scaleW,re=q.height/p.data.common.scaleH;h[N++]=V,h[N++]=Z,h[N++]=J,h[N++]=ee,h[N++]=V+X.width,h[N++]=Z,h[N++]=J+te,h[N++]=ee,h[N++]=V,h[N++]=Z+X.height,h[N++]=J,h[N++]=ee+re,h[N++]=V+X.width,h[N++]=Z+X.height,h[N++]=J+te,h[N++]=ee+re}B=Math.max(B,Z+X.height),I=Math.max(I,V+X.width),R+=X.xAdvance}}else if(10===X.codepoint){if(Y)break;M=L.shapeText(z,new $e(Xe(m,0),0)),u="none"}}-1!==P&&(D.push({bufferStart:P,bufferEnd:N}),P=-1),R=0,E+=w,e++,F.codepointIndex=-1,H=0,!v&&"both"===u&&E>f.y2||y&&y.done?W=!1:Y||(W=!1)}if("center"===o)for(var ne="none"===u?I:S,oe=0;oe"number"==typeof e?e:Ze[e]||400;var Je=M((function(e,t,r,n,o){var i,s=qe(r),a=A(e);try{for(a.s();!(i=a.n()).done;){var l=i.value[t];if(l){if(1===l.size)return console.warn(`TrFontManager: Only one font face found for family: '${t}' - will be used for all weights and styles`),l.values().next().value;var d,h=new Map,u=A(l);try{for(u.s();!(d=u.n()).done;){var c=d.value,f=qe(c.descriptors.weight);if(f===s&&c.descriptors.style===n&&c.descriptors.stretch===o)return c;h.set(f,c)}}catch(v){u.e(v)}finally{u.f()}var p=`TrFontManager: No exact match: '${t} Weight: ${s} Style: ${n} Stretch: ${o}'`;if(console.error(p),400===s&&h.has(500))return h.get(500);if(500===s&&h.has(400))return h.get(400);if(s<400){for(;s>0;){if(h.has(s))return h.get(s);s-=100}s=600}for(;s<1e3;){if(h.has(s))return h.get(s);s+=100}for(s=500;s>0;){if(h.has(s))return h.get(s);s-=100}}}}catch(v){a.e(v)}finally{a.f()}}));class et{constructor(e){S(this,"textRenderers",void 0),this.textRenderers=e}addFontFace(e){for(var t in this.textRenderers){var r=this.textRenderers[t];r&&r.isFontFaceSupported(e)&&r.addFontFace(e)}}static resolveFontFace(e,t){var r=t.fontFamily,n=t.fontWeight,o=t.fontStyle,i=t.fontStretch;return Je(e,r,n,o,i)}}var tt={x:0,y:0,width:0,height:0};class rt extends fe{constructor(e){super(e),S(this,"ssdfFontFamilies",{}),S(this,"msdfFontFamilies",{}),S(this,"fontFamilyArray",[this.ssdfFontFamilies,this.msdfFontFamilies]),S(this,"sdfShader",void 0),S(this,"rendererBounds",void 0),this.sdfShader=this.stage.shManager.loadShader("SdfShader").shader,this.rendererBounds={x1:0,y1:0,x2:this.stage.options.appWidth,y2:this.stage.options.appHeight}}getPropertySetters(){return{fontFamily:(e,t)=>{e.props.fontFamily=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontWeight:(e,t)=>{e.props.fontWeight=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontStyle:(e,t)=>{e.props.fontStyle=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontStretch:(e,t)=>{e.props.fontStretch=t,this.releaseFontFace(e),this.invalidateLayoutCache(e)},fontSize:(e,t)=>{e.props.fontSize=t,this.invalidateLayoutCache(e)},text:(e,t)=>{e.props.text=t,this.invalidateLayoutCache(e)},textAlign:(e,t)=>{e.props.textAlign=t,this.invalidateLayoutCache(e)},color:(e,t)=>{e.props.color=t},x:(e,t)=>{e.props.x=t,e.elementBounds.valid&&(this.setElementBoundsX(e),!e.renderWindow.valid&&O(e.elementBounds,this.rendererBounds)&&this.scheduleUpdateState(e))},y:(e,t)=>{e.props.y=t,e.elementBounds.valid&&(this.setElementBoundsY(e),!e.renderWindow.valid&&O(e.elementBounds,this.rendererBounds)&&this.scheduleUpdateState(e))},contain:(e,t)=>{e.props.contain=t,this.invalidateLayoutCache(e)},width:(e,t)=>{e.props.width=t,"none"!==e.props.contain&&this.invalidateLayoutCache(e)},height:(e,t)=>{e.props.height=t,"both"===e.props.contain&&this.invalidateLayoutCache(e)},offsetY:(e,t)=>{e.props.offsetY=t,this.invalidateLayoutCache(e)},scrollable:(e,t)=>{e.props.scrollable=t,this.invalidateLayoutCache(e)},scrollY:(e,t)=>{e.props.scrollY=t,this.scheduleUpdateState(e)},letterSpacing:(e,t)=>{e.props.letterSpacing=t,this.invalidateLayoutCache(e)},lineHeight:(e,t)=>{e.props.lineHeight=t,this.invalidateLayoutCache(e)},maxLines:(e,t)=>{e.props.maxLines=t,this.invalidateLayoutCache(e)},textBaseline:(e,t)=>{e.props.textBaseline=t,this.invalidateLayoutCache(e)},verticalAlign:(e,t)=>{e.props.verticalAlign=t,this.invalidateLayoutCache(e)},overflowSuffix:(e,t)=>{e.props.overflowSuffix=t,this.invalidateLayoutCache(e)},debug:(e,t)=>{e.props.debug=t}}}canRenderFont(e){var t=e.fontFamily;return t in this.ssdfFontFamilies||t in this.msdfFontFamilies||"$$SDF_FAILURE_TEST$$"===t}isFontFaceSupported(e){return e instanceof U}addFontFace(e){C(e instanceof U);var t=e.fontFamily,r="ssdf"===e.type?this.ssdfFontFamilies:"msdf"===e.type?this.msdfFontFamilies:void 0;if(r){var n=r[t];n||(n=new Set,r[t]=n),n.add(e)}else console.warn(`Invalid font face type: ${e.type}`)}createState(e){return{props:e,status:"initialState",updateScheduled:!1,emitter:new B,lineCache:[],forceFullLayoutCalc:!1,renderWindow:{screen:{x1:0,y1:0,x2:0,y2:0},sdf:{x1:0,y1:0,x2:0,y2:0},firstLineIdx:0,numLines:0,valid:!1},elementBounds:{x1:0,y1:0,x2:0,y2:0,valid:!1},clippingRect:{x:0,y:0,width:0,height:0,valid:!1},bufferNumFloats:0,bufferNumQuads:0,vertexBuffer:void 0,webGlBuffers:null,bufferUploaded:!1,textH:void 0,textW:void 0,distanceRange:0,trFontFace:void 0,isRenderable:!1,debugData:{updateCount:0,layoutCount:0,lastLayoutNumCharacters:0,layoutSum:0,drawSum:0,drawCount:0,bufferSize:0}}}updateState(e){var t=e.trFontFace,r=e.textH,n=e.lineCache,o=e.debugData,i=e.forceFullLayoutCalc;if(o.updateCount++,"initialState"===e.status&&this.setStatus(e,"loading"),!t){if(t=this.resolveFontFace(e.props),e.trFontFace=t,!t){var s=`SdfTextRenderer: Could not resolve font face for family: '${e.props.fontFamily}'`;return console.error(s),void this.setStatus(e,"failed",new Error(s))}t.texture.setRenderableOwner(e,e.isRenderable)}if(t.loaded){C(t.data,"Font face data should be loaded");var a=e.props,l=a.text,d=a.fontSize,h=a.x,u=a.y,c=a.contain,f=a.width,p=a.height,v=a.lineHeight,g=a.verticalAlign,m=a.scrollable,x=a.overflowSuffix,y=a.maxLines,b="both"===c&&m?e.props.scrollY:0,w=e.renderWindow,S=t.data.info.size,A=d/S,T=v/A;e.distanceRange=A*t.data.distanceField.distanceRange;var _=24*l.length,k=e.vertexBuffer;(!k||k.length<_)&&(k=new Float32Array(2*_));var I=e.elementBounds;if(I.valid||(this.setElementBoundsX(e),this.setElementBoundsY(e),I.valid=!0),!i&&w.valid){var B=w.screen;if(h+B.x1<=I.x1&&h+B.x2>=I.x2&&u-b+B.y1<=I.y1&&u-b+B.y2>=I.y2)return void this.setStatus(e,"loaded");w.valid=!1,this.setStatus(e,"loading")}var R=e.props,E=R.offsetY,N=R.textAlign;if(!w.valid){if(!O(I,this.rendererBounds))return;Ve(w,h,u,b,v,"both"===c?I.y2-I.y1:0,I,A)}var F=function(e,t,r,n,o,i,s,a,l){var d=Math.min(Math.max(s.firstLineIdx,0),a.length),h=0;"middle"===n?h=(t-e)/2:"bottom"===n&&(h=t-e);var u=o/i+d*t+h;if(!(l&&u>=l/i))return{sdfX:0,sdfY:u,lineIndex:d}}(S,T,0,g,E,A,w,n,r);if(F){var L=e.props.letterSpacing,z=Ge(F.lineIndex,F.sdfX,F.sdfY,l,N,f,p,d,v,L,k,c,n,w.sdf,t,i,m,x,y);e.bufferUploaded=!1,e.bufferNumFloats=z.bufferNumFloats,e.bufferNumQuads=z.bufferNumQuads,e.vertexBuffer=k,e.renderWindow=w,o.lastLayoutNumCharacters=z.layoutNumCharacters,o.bufferSize=k.byteLength,z.fullyProcessed&&(e.textW=z.maxX*A,e.textH=z.maxY*A),this.setStatus(e,"loaded")}else this.setStatus(e,"loaded")}else t.once("loaded",(()=>{this.scheduleUpdateState(e)}))}renderQuads(e,t,r,n){var o,i;if(e.vertexBuffer){var s=this.stage.renderer,a=e.props,l=a.fontSize,d=a.color,h=a.contain,u=a.scrollable,c=a.zIndex,f=a.debug,p="both"===h&&u?e.props.scrollY:0,v=e.textW,g=void 0===v?0:v,m=e.textH,x=void 0===m?0:m,y=e.distanceRange,b=e.vertexBuffer,w=e.bufferUploaded,S=e.trFontFace,A=e.elementBounds,T=e.webGlBuffers;if(!T){var _=s.glw,k=4*Float32Array.BYTES_PER_ELEMENT,I=_.createBuffer();C(I),e.webGlBuffers=new W([{buffer:I,attributes:{a_position:{name:"a_position",size:2,type:_.FLOAT,normalized:!1,stride:k,offset:0},a_textureCoordinate:{name:"a_textureCoordinate",size:2,type:_.FLOAT,normalized:!1,stride:k,offset:2*Float32Array.BYTES_PER_ELEMENT}}}]),e.bufferUploaded=!1,C(e.webGlBuffers),T=e.webGlBuffers}if(!w){var B,R,E=s.glw,F=null!==(B=null===(R=T)||void 0===R?void 0:R.getBuffer("a_textureCoordinate"))&&void 0!==B?B:null;E.arrayBufferData(F,b,E.STATIC_DRAW),e.bufferUploaded=!0}if(C(S),u&&"both"===h){C(A.valid);var L=Y(A,tt);r.valid?(e.clippingRect.valid=!0,r=N(r,L,e.clippingRect)):(e.clippingRect.valid=!0,r=j(L,e.clippingRect))}var z=new H(s.glw,s.options,T,this.sdfShader,{transform:t.data,color:Q(d,n),size:l/((null===(o=S.data)||void 0===o?void 0:o.info.size)||0),scrollY:p,distanceRange:y,debug:f.sdfShaderDebug},n,r,{height:x,width:g},0,c),M=null===(i=e.trFontFace)||void 0===i?void 0:i.texture;C(M);var P=this.stage.txManager.getCtxTexture(M);z.addTexture(P),z.length=e.bufferNumFloats,z.numQuads=e.bufferNumQuads,s.addRenderOp(z)}}setIsRenderable(e,t){var r;super.setIsRenderable(e,t),null===(r=e.trFontFace)||void 0===r||r.texture.setRenderableOwner(e,t)}destroyState(e){var t;super.destroyState(e),null===(t=e.trFontFace)||void 0===t||t.texture.setRenderableOwner(e,!1)}resolveFontFace(e){return et.resolveFontFace(this.fontFamilyArray,e)}releaseFontFace(e){e.trFontFace&&(e.trFontFace.texture.setRenderableOwner(e,!1),e.trFontFace=void 0)}invalidateLayoutCache(e){e.renderWindow.valid=!1,e.elementBounds.valid=!1,e.textH=void 0,e.textW=void 0,e.lineCache=[],this.setStatus(e,"loading"),this.scheduleUpdateState(e)}setElementBoundsX(e){var t=e.props,r=t.x,n=t.contain,o=t.width,i=e.elementBounds;i.x1=r,i.x2="none"!==n?r+o:1/0}setElementBoundsY(e){var t=e.props,r=t.y,n=t.contain,o=t.height,i=e.elementBounds;i.y1=r,i.y2="both"===n?r+o:1/0}}function nt(e,t){return ot.apply(this,arguments)}function ot(){return(ot=y(m().mark((function e(t,r){var n,o,i;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,console.log("Loading core extension",t),e.next=4,he((()=>b.import(t)),void 0);case 4:n=e.sent,e.next=12;break;case 7:return e.prev=7,e.t0=e.catch(0),console.error(`The core extension module at '${t}' could not be loaded.`),console.error(e.t0),e.abrupt("return");case 12:if(n.default){e.next=15;break}return console.error(`The core extension module at '${t}' does not have a default export.`),e.abrupt("return");case 15:if(o=n.default,!(o.prototype instanceof K)){e.next=29;break}return i=new o,e.prev=18,e.next=21,i.run(r);case 21:e.next=27;break;case 23:e.prev=23,e.t1=e.catch(18),console.error(`The core extension at '${t}' threw an error.`),console.error(e.t1);case 27:e.next=30;break;case 29:console.error(`The core extension at '${t}' does not extend CoreExtension.`);case 30:case"end":return e.stop()}}),e,null,[[0,7],[18,23]])})))).apply(this,arguments)}function it(e){for(var t={boolean:!0,string:!0,number:!0},r=Object.keys(e),n=0;n2048&&(console.warn(`Custom Data value for ${o} is too long, it will be truncated to 2048 characters`),e[o]=i.substring(0,2048)),t[s]||(console.warn(`Custom Data value for ${o} is not a boolean, string, or number, it will be ignored`),delete e[o])}}return e}class st extends B{constructor(e,t,r){var n,o,i,s;super(),S(this,"root",null),S(this,"driver",void 0),S(this,"canvas",void 0),S(this,"settings",void 0),S(this,"inspector",null),S(this,"nodes",new Map),S(this,"nextTextureId",1),S(this,"textureTracker",void 0);var a={appWidth:e.appWidth||1920,appHeight:e.appHeight||1080,txMemByteThreshold:e.txMemByteThreshold||124e6,boundsMargin:e.boundsMargin||0,deviceLogicalPixelRatio:e.deviceLogicalPixelRatio||1,devicePhysicalPixelRatio:e.devicePhysicalPixelRatio||window.devicePixelRatio,clearColor:null!==(n=e.clearColor)&&void 0!==n?n:0,coreExtensionModule:e.coreExtensionModule||null,experimental_FinalizationRegistryTextureUsageTracker:null!==(o=e.experimental_FinalizationRegistryTextureUsageTracker)&&void 0!==o&&o,textureCleanupOptions:e.textureCleanupOptions||{},fpsUpdateInterval:e.fpsUpdateInterval||0,numImageWorkers:void 0!==e.numImageWorkers?e.numImageWorkers:2,enableContextSpy:null!==(i=e.enableContextSpy)&&void 0!==i&&i,enableInspector:null!==(s=e.enableInspector)&&void 0!==s&&s};this.settings=a;var l=a.appWidth,d=a.appHeight,h=a.deviceLogicalPixelRatio,u=a.devicePhysicalPixelRatio,c=a.enableInspector,f=e=>{this.driver.releaseTexture(e)},p=a.experimental_FinalizationRegistryTextureUsageTracker&&"function"==typeof FinalizationRegistry;this.textureTracker=p?new ie(f):new oe(f,this.settings.textureCleanupOptions);var v=l*h,g=d*h;this.driver=r;var m,x=document.createElement("canvas");if(this.canvas=x,x.width=v*u,x.height=g*u,x.style.width=`${v}px`,x.style.height=`${g}px`,!(m="string"==typeof t?document.getElementById(t):t))throw new Error("Could not find target element");r.onCreateNode=e=>{this.nodes.set(e.id,e)},r.onBeforeDestroyNode=e=>{this.nodes.delete(e.id)},r.onFpsUpdate=e=>{this.emit("fpsUpdate",e)},r.onFrameTick=e=>{this.emit("frameTick",e)},r.onIdle=()=>{this.emit("idle")},m.appendChild(x),c&&!T()&&(this.inspector=new de(x,a))}init(){var e=this;return y(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.driver.init(e,e.settings,e.canvas);case 2:e.root=e.driver.getRootNode();case 3:case"end":return t.stop()}}),t)})))()}createNode(e){return this.inspector?this.inspector.createNode(this.driver,this.resolveNodeDefaults(e)):this.driver.createNode(this.resolveNodeDefaults(e))}createTextNode(e){var t,r,n,o,i,s,a,l,d,h,u,c,f,p,v,g,m,x,y,b=null!==(t=e.fontSize)&&void 0!==t?t:16,S=w(w({},this.resolveNodeDefaults(e)),{},{text:null!==(r=e.text)&&void 0!==r?r:"",textRendererOverride:null!==(n=e.textRendererOverride)&&void 0!==n?n:null,fontSize:b,fontFamily:null!==(o=e.fontFamily)&&void 0!==o?o:"sans-serif",fontStyle:null!==(i=e.fontStyle)&&void 0!==i?i:"normal",fontWeight:null!==(s=e.fontWeight)&&void 0!==s?s:"normal",fontStretch:null!==(a=e.fontStretch)&&void 0!==a?a:"normal",textAlign:null!==(l=e.textAlign)&&void 0!==l?l:"left",contain:null!==(d=e.contain)&&void 0!==d?d:"none",scrollable:null!==(h=e.scrollable)&&void 0!==h&&h,scrollY:null!==(u=e.scrollY)&&void 0!==u?u:0,offsetY:null!==(c=e.offsetY)&&void 0!==c?c:0,letterSpacing:null!==(f=e.letterSpacing)&&void 0!==f?f:0,lineHeight:null!==(p=e.lineHeight)&&void 0!==p?p:b,maxLines:null!==(v=e.maxLines)&&void 0!==v?v:0,textBaseline:null!==(g=e.textBaseline)&&void 0!==g?g:"alphabetic",verticalAlign:null!==(m=e.verticalAlign)&&void 0!==m?m:"top",overflowSuffix:null!==(x=e.overflowSuffix)&&void 0!==x?x:"...",debug:null!==(y=e.debug)&&void 0!==y?y:{}});return this.inspector?this.inspector.createTextNode(this.driver,S):this.driver.createTextNode(S)}resolveNodeDefaults(e){var t,r,n,o,i,s,a,l,d,h,u,c,f,p,v,g,m,x,y,b,w,S,A,C,T,_,k,I,B,R,E,N,F,L,z,M,P,D,O,U,W,Y,j,H,Q,K,$,X=null!==(t=e.color)&&void 0!==t?t:4294967295,G=null!==(r=null!==(n=null!==(o=e.colorTl)&&void 0!==o?o:e.colorTop)&&void 0!==n?n:e.colorLeft)&&void 0!==r?r:X,V=null!==(i=null!==(s=null!==(a=e.colorTr)&&void 0!==a?a:e.colorTop)&&void 0!==s?s:e.colorRight)&&void 0!==i?i:X,Z=null!==(l=null!==(d=null!==(h=e.colorBl)&&void 0!==h?h:e.colorBottom)&&void 0!==d?d:e.colorLeft)&&void 0!==l?l:X,q=null!==(u=null!==(c=null!==(f=e.colorBr)&&void 0!==f?f:e.colorBottom)&&void 0!==c?c:e.colorRight)&&void 0!==u?u:X,J=it(null!==(p=e.data)&&void 0!==p?p:{});return{x:null!==(v=e.x)&&void 0!==v?v:0,y:null!==(g=e.y)&&void 0!==g?g:0,width:null!==(m=e.width)&&void 0!==m?m:0,height:null!==(x=e.height)&&void 0!==x?x:0,alpha:null!==(y=e.alpha)&&void 0!==y?y:1,autosize:null!==(b=e.autosize)&&void 0!==b&&b,clipping:null!==(w=e.clipping)&&void 0!==w&&w,color:X,colorTop:null!==(S=e.colorTop)&&void 0!==S?S:X,colorBottom:null!==(A=e.colorBottom)&&void 0!==A?A:X,colorLeft:null!==(C=e.colorLeft)&&void 0!==C?C:X,colorRight:null!==(T=e.colorRight)&&void 0!==T?T:X,colorBl:Z,colorBr:q,colorTl:G,colorTr:V,zIndex:null!==(_=e.zIndex)&&void 0!==_?_:0,zIndexLocked:null!==(k=e.zIndexLocked)&&void 0!==k?k:0,parent:null!==(I=e.parent)&&void 0!==I?I:null,texture:null!==(B=e.texture)&&void 0!==B?B:null,shader:null!==(R=e.shader)&&void 0!==R?R:null,src:null!==(E=e.src)&&void 0!==E?E:"",scale:null!==(N=e.scale)&&void 0!==N?N:null,scaleX:null!==(F=null!==(L=e.scaleX)&&void 0!==L?L:e.scale)&&void 0!==F?F:1,scaleY:null!==(z=null!==(M=e.scaleY)&&void 0!==M?M:e.scale)&&void 0!==z?z:1,mount:null!==(P=e.mount)&&void 0!==P?P:0,mountX:null!==(D=null!==(O=e.mountX)&&void 0!==O?O:e.mount)&&void 0!==D?D:0,mountY:null!==(U=null!==(W=e.mountY)&&void 0!==W?W:e.mount)&&void 0!==U?U:0,pivot:null!==(Y=e.pivot)&&void 0!==Y?Y:.5,pivotX:null!==(j=null!==(H=e.pivotX)&&void 0!==H?H:e.pivot)&&void 0!==j?j:.5,pivotY:null!==(Q=null!==(K=e.pivotY)&&void 0!==K?K:e.pivot)&&void 0!==Q?Q:.5,rotation:null!==($=e.rotation)&&void 0!==$?$:0,data:J}}destroyNode(e){return this.inspector&&this.inspector.destroyNode(e),this.driver.destroyNode(e)}createTexture(e,t,r){var n=this.nextTextureId++,o={descType:"texture",txType:e,props:t,options:w(w({},r),{},{id:n})};return this.textureTracker.registerTexture(o),o}createShader(e,t){return{descType:"shader",shType:e,props:t}}getNodeById(e){return this.nodes.get(e)||null}toggleFreeze(){throw new Error("Not implemented")}advanceFrame(){throw new Error("Not implemented")}rerender(){throw new Error("Not implemented")}}class at extends B{constructor(e,t,r){super(),S(this,"node",void 0),S(this,"props",void 0),S(this,"settings",void 0),S(this,"propStartValues",{}),S(this,"restoreValues",{}),S(this,"progress",0),S(this,"delayFor",0),S(this,"timingFunction",void 0),S(this,"propsList",void 0),this.node=e,this.props=t,this.settings=r,this.propStartValues={},this.propsList=Object.keys(t),this.propsList.forEach((t=>{this.propStartValues[t]=e[t]})),this.timingFunction=e=>e,r.easing&&"string"==typeof r.easing&&(this.timingFunction=$(r.easing)),this.delayFor=r.delay||0}reset(){this.progress=0,this.delayFor=this.settings.delay||0,this.update(0)}restore(){this.reset(),Object.keys(this.props).forEach((e=>{this.node[e]=this.propStartValues[e]}))}reverse(){this.progress=0,Object.keys(this.props).forEach((e=>{var t=this.props[e],r=this.propStartValues[e];this.props[e]=r,this.propStartValues[e]=t})),this.settings.loop||(this.settings.stopMethod=!1)}applyEasing(e,t,r){return(this.timingFunction(e)||e)*(r-t)+t}update(e){var t=this.settings,r=t.duration,n=t.loop,o=t.easing,i=t.stopMethod;if(r)if(this.delayFor>0)this.delayFor-=e;else if(this.delayFor<=0&&0===this.progress&&this.emit("start",{}),this.progress+=e/r,this.progress>1&&(this.progress=n?0:1,i))this.emit("finished",{});else{for(var s=0;s{this.startedResolve=e})))}makeStoppedPromise(){null===this.stoppedResolve&&(this.stoppedPromise=new Promise((e=>{this.stoppedResolve=e})))}started(){C(this.startedResolve),this.startedResolve(this),this.startedResolve=null}finished(){C(this.stoppedResolve);var e=this.animation.settings,t=e.loop;if("reverse"===e.stopMethod)return this.animation.reverse(),void this.start();this.stoppedResolve(),this.stoppedResolve=null,t||this.manager.unregisterAnimation(this.animation)}}class dt{constructor(e){S(this,"data",void 0),e?(this.data=new Float32Array(9),this.data[0]=e[0],this.data[3]=e[3],this.data[6]=e[6],this.data[1]=e[1],this.data[4]=e[4],this.data[7]=e[7],this.data[2]=e[2],this.data[5]=e[5],this.data[8]=e[8]):this.data=new Float32Array(9)}static get temp(){return ut}static multiply(e,t,r){var n=e.data[0]*t.data[0]+e.data[3]*t.data[1]+e.data[6]*t.data[2],o=e.data[0]*t.data[3]+e.data[3]*t.data[4]+e.data[6]*t.data[5],i=e.data[0]*t.data[6]+e.data[3]*t.data[7]+e.data[6]*t.data[8],s=e.data[1]*t.data[0]+e.data[4]*t.data[1]+e.data[7]*t.data[2],a=e.data[1]*t.data[3]+e.data[4]*t.data[4]+e.data[7]*t.data[5],l=e.data[1]*t.data[6]+e.data[4]*t.data[7]+e.data[7]*t.data[8],d=e.data[2]*t.data[0]+e.data[5]*t.data[1]+e.data[8]*t.data[2],h=e.data[2]*t.data[3]+e.data[5]*t.data[4]+e.data[8]*t.data[5],u=e.data[2]*t.data[6]+e.data[5]*t.data[7]+e.data[8]*t.data[8];return r||(r=new dt),r.data[0]=n,r.data[3]=o,r.data[6]=i,r.data[1]=s,r.data[4]=a,r.data[7]=l,r.data[2]=d,r.data[5]=h,r.data[8]=u,r}static identity(e){return e||(e=new dt),e.data[0]=1,e.data[3]=0,e.data[6]=0,e.data[1]=0,e.data[4]=1,e.data[7]=0,e.data[2]=0,e.data[5]=0,e.data[8]=1,e}static translate(e,t,r){return r||(r=new dt),r.data[0]=1,r.data[3]=0,r.data[6]=e,r.data[1]=0,r.data[4]=1,r.data[7]=t,r.data[2]=0,r.data[5]=0,r.data[8]=1,r}static scale(e,t,r){return r||(r=new dt),r.data[0]=e,r.data[3]=0,r.data[6]=0,r.data[1]=0,r.data[4]=t,r.data[7]=0,r.data[2]=0,r.data[5]=0,r.data[8]=1,r}static rotate(e,t){var r=Math.cos(e),n=Math.sin(e);return t||(t=new dt),t.data[0]=r,t.data[3]=-n,t.data[6]=0,t.data[1]=n,t.data[4]=r,t.data[7]=0,t.data[2]=0,t.data[5]=0,t.data[8]=1,t}static copy(e,t,r){return t||(t=new dt),t.data[0]=e.data[0],t.data[1]=e.data[1],t.data[2]=e.data[2],t.data[3]=e.data[3],t.data[4]=e.data[4],t.data[5]=e.data[5],t.data[6]=e.data[6],t.data[7]=e.data[7],t.data[8]=e.data[8],t}translate(e,t){return this.data[6]=this.data[0]*e+this.data[3]*t+this.data[6],this.data[7]=this.data[1]*e+this.data[4]*t+this.data[7],this}scale(e,t){return this.data[0]=this.data[0]*e,this.data[3]=this.data[3]*t,this.data[1]=this.data[1]*e,this.data[4]=this.data[4]*t,this}rotate(e){if(0===e||!(e%Math.PI*2))return this;var t=Math.cos(e),r=Math.sin(e),n=this.data[0]*t+this.data[3]*r,o=this.data[3]*t-this.data[0]*r,i=this.data[1]*t+this.data[4]*r,s=this.data[4]*t-this.data[1]*r;return this.data[0]=n,this.data[3]=o,this.data[1]=i,this.data[4]=s,this}multiply(e){return dt.multiply(this,e,this)}get tx(){return this.data[6]}get ty(){return this.data[7]}get ta(){return this.data[0]}get tb(){return this.data[3]}get tc(){return this.data[1]}get td(){return this.data[4]}transformPoint(e,t){return[this.data[0]*e+this.data[3]*t+this.data[6],this.data[1]*e+this.data[4]*t+this.data[1]]}}var ht,ut=new dt;class ct{constructor(e){S(this,"data",void 0),this.data=new Float32Array(8),e&&(this.data[0]=e[0],this.data[2]=e[2],this.data[4]=e[4],this.data[6]=e[6],this.data[1]=e[1],this.data[3]=e[3],this.data[5]=e[5],this.data[7]=e[7])}static translate(e,t,r,n,o,i,s,a,l){return l||(l=new ct),l.data[0]=e,l.data[2]=r,l.data[4]=o,l.data[6]=s,l.data[1]=t,l.data[3]=n,l.data[5]=i,l.data[7]=a,l}get x1(){return this.data[0]}get x2(){return this.data[2]}get x3(){return this.data[4]}get x4(){return this.data[6]}get y1(){return this.data[1]}get y2(){return this.data[3]}get y3(){return this.data[5]}get y4(){return this.data[7]}}!function(e){e[e.Init=0]="Init",e[e.OutOfBounds=2]="OutOfBounds",e[e.InBounds=4]="InBounds",e[e.InViewport=8]="InViewport"}(ht||(ht={}));var ft,pt=new Map;pt.set(ht.Init,"init"),pt.set(ht.OutOfBounds,"outOfBounds"),pt.set(ht.InBounds,"inBounds"),pt.set(ht.InViewport,"inViewport"),function(e){e[e.Children=1]="Children",e[e.ScaleRotate=2]="ScaleRotate",e[e.Local=4]="Local",e[e.Global=8]="Global",e[e.Clipping=16]="Clipping",e[e.CalculatedZIndex=32]="CalculatedZIndex",e[e.ZIndexSortedChildren=64]="ZIndexSortedChildren",e[e.PremultipliedColors=128]="PremultipliedColors",e[e.WorldAlpha=256]="WorldAlpha",e[e.RenderState=512]="RenderState",e[e.IsRenderable=1024]="IsRenderable",e[e.None=0]="None",e[e.All=2047]="All"}(ft||(ft={}));class vt extends B{constructor(e,t){super(),S(this,"stage",void 0),S(this,"children",[]),S(this,"props",void 0),S(this,"updateType",ft.All),S(this,"globalTransform",void 0),S(this,"scaleRotateTransform",void 0),S(this,"localTransform",void 0),S(this,"renderCoords",void 0),S(this,"renderBound",void 0),S(this,"strictBound",void 0),S(this,"preloadBound",void 0),S(this,"clippingRect",{x:0,y:0,width:0,height:0,valid:!1}),S(this,"isRenderable",!1),S(this,"renderState",ht.Init),S(this,"worldAlpha",1),S(this,"premultipliedColorTl",0),S(this,"premultipliedColorTr",0),S(this,"premultipliedColorBl",0),S(this,"premultipliedColorBr",0),S(this,"calcZIndex",0),S(this,"onTextureLoaded",((e,t)=>{this.autosizeNode(t),this.stage.requestRender(),this.emit("loaded",{type:"texture",dimensions:t})})),S(this,"onTextureFailed",((e,t)=>{this.emit("failed",{type:"texture",error:t})})),S(this,"onTextureFreed",(e=>{this.emit("freed",{type:"texture"})})),this.stage=e,this.props=w(w({},t),{},{parent:null}),this.parent=t.parent,this.updateScaleRotateTransform()}loadTexture(e,t,r=null){this.props.texture&&this.unloadTexture();var n=this.stage.txManager.loadTexture(e,t,r);this.props.texture=n,this.props.textureOptions=r,this.setUpdateType(ft.IsRenderable),queueMicrotask((()=>{"loaded"===n.state?this.onTextureLoaded(n,n.dimensions):"failed"===n.state?this.onTextureFailed(n,n.error):"freed"===n.state&&this.onTextureFreed(n),n.on("loaded",this.onTextureLoaded),n.on("failed",this.onTextureFailed),n.on("freed",this.onTextureFreed)}))}unloadTexture(){if(this.props.texture){var e=this.props.texture;e.off("loaded",this.onTextureLoaded),e.off("failed",this.onTextureFailed),e.off("freed",this.onTextureFreed),e.setRenderableOwner(this,!1)}this.props.texture=null,this.props.textureOptions=null,this.setUpdateType(ft.IsRenderable)}autosizeNode(e){this.autosize&&(this.width=e.width,this.height=e.height)}loadShader(e,t){var r=this.stage.renderer.getShaderManager();C(r);var n=r.loadShader(e,t),o=n.shader,i=n.props;this.props.shader=o,this.props.shaderProps=i,this.setUpdateType(ft.IsRenderable)}setUpdateType(e){this.updateType|=e;var t=this.props.parent;!t||t.updateType&ft.Children||t.setUpdateType(ft.Children)}sortChildren(){this.children.sort(((e,t)=>e.calcZIndex-t.calcZIndex))}updateScaleRotateTransform(){this.scaleRotateTransform=dt.rotate(this.props.rotation,this.scaleRotateTransform).scale(this.props.scaleX,this.props.scaleY)}updateLocalTransform(){C(this.scaleRotateTransform);var e=this.props.pivotX*this.props.width,t=this.props.pivotY*this.props.height,r=this.props.mountX*this.props.width,n=this.props.mountY*this.props.height;this.localTransform=dt.translate(e-r+this.props.x,t-n+this.props.y,this.localTransform).multiply(this.scaleRotateTransform).translate(-e,-t),this.setUpdateType(ft.Global)}update(e,t){this.updateType&ft.ScaleRotate&&(this.updateScaleRotateTransform(),this.setUpdateType(ft.Local)),this.updateType&ft.Local&&(this.updateLocalTransform(),this.setUpdateType(ft.Global));var r=this.props.parent,n=ft.None;this.updateType&ft.Global&&(C(this.localTransform),this.globalTransform=dt.copy((null==r?void 0:r.globalTransform)||this.localTransform,this.globalTransform),r&&this.globalTransform.multiply(this.localTransform),this.calculateRenderCoords(),this.updateBoundingRect(),this.setUpdateType(ft.Clipping|ft.RenderState|ft.Children),n|=ft.Global),this.updateType&ft.Clipping&&(this.calculateClippingRect(t),this.setUpdateType(ft.Children),n|=ft.Clipping),this.updateType&ft.WorldAlpha&&(this.worldAlpha=r?r.worldAlpha*this.props.alpha:this.props.alpha,this.setUpdateType(ft.Children|ft.PremultipliedColors|ft.IsRenderable),n|=ft.WorldAlpha),this.updateType&ft.PremultipliedColors&&(this.premultipliedColorTl=L(this.props.colorTl,this.worldAlpha,!0),this.props.colorTl===this.props.colorTr&&this.props.colorBl===this.props.colorBr&&this.props.colorTl===this.props.colorBl?this.premultipliedColorTr=this.premultipliedColorBl=this.premultipliedColorBr=this.premultipliedColorTl:(this.premultipliedColorTr=L(this.props.colorTr,this.worldAlpha,!0),this.premultipliedColorBl=L(this.props.colorBl,this.worldAlpha,!0),this.premultipliedColorBr=L(this.props.colorBr,this.worldAlpha,!0))),this.updateType&ft.RenderState&&(this.updateRenderState(t),this.setUpdateType(ft.IsRenderable)),this.updateType&ft.IsRenderable&&this.updateIsRenderable(),r&&this.updateType&ft.CalculatedZIndex&&(this.calculateZIndex(),r.setUpdateType(ft.ZIndexSortedChildren)),this.updateType&ft.Children&&this.children.length&&this.children.forEach((t=>{t.setUpdateType(n),0!==t.updateType&&t.update(e,this.clippingRect)})),this.updateType&ft.ZIndexSortedChildren&&this.sortChildren(),this.updateType=0}checkRenderProps(){return!!this.props.texture||!(!this.props.width||!this.props.height)&&(!!this.props.shader||(!!this.props.clipping||(0!==this.props.color||(0!==this.props.colorTop||(0!==this.props.colorBottom||(0!==this.props.colorLeft||(0!==this.props.colorRight||(0!==this.props.colorTl||(0!==this.props.colorTr||(0!==this.props.colorBl||0!==this.props.colorBr))))))))))}checkRenderBounds(e){C(this.renderBound);var t=e.width||this.stage.root.width,r=e.height||this.stage.root.height;this.strictBound=k(e.x,e.y,e.x+t,e.y+r,this.strictBound);var n=this.stage.boundsMargin;return this.preloadBound=k(e.x-n[3],e.y-n[0],e.x+t+n[1],e.y+r+n[2],this.preloadBound),G(this.renderBound,this.strictBound)?ht.InViewport:G(this.renderBound,this.preloadBound)?ht.InBounds:ht.OutOfBounds}updateRenderState(e){var t=this.checkRenderBounds(e);if(t!==this.renderState){var r=this.renderState;this.renderState=t,r===ht.InViewport&&this.emit("outOfViewport",{previous:r,current:t}),(rht.InBounds&&t===ht.OutOfBounds)&&(this.emit(pt.get(ht.InBounds),{previous:r,current:t}),r=ht.InBounds);var n=pt.get(t);C(n),this.emit(n,{previous:r,current:t})}}setRenderState(e){e!==this.renderState&&(this.renderState=e,this.emit(ht[e]))}updateIsRenderable(){var e;e=!(0===this.worldAlpha||!this.checkRenderProps())&&this.renderState>ht.OutOfBounds,this.isRenderable!==e&&(this.isRenderable=e,this.onChangeIsRenderable(e))}onChangeIsRenderable(e){var t;null===(t=this.props.texture)||void 0===t||t.setRenderableOwner(this,e)}calculateRenderCoords(){var e=this.width,t=this.height,r=this.globalTransform;C(r);var n=r.tx,o=r.ty,i=r.ta,s=r.tb,a=r.tc,l=r.td;if(0===s&&0===a){var d=n,h=n+e*i,u=o,c=o+t*l;this.renderCoords=ct.translate(d,u,h,u,h,c,d,c,this.renderCoords)}else this.renderCoords=ct.translate(n,o,n+e*i,o+e*a,n+e*i+t*s,o+e*a+t*l,n+t*s,o+t*l,this.renderCoords)}updateBoundingRect(){var e=this.renderCoords,t=this.globalTransform;C(t),C(e);var r=t.tb,n=t.tc,o=e.x1,i=e.y1,s=e.x3,a=e.y3;if(0===r||0===n)this.renderBound=k(o,i,s,a,this.renderBound);else{var l=e.x2,d=e.x4,h=e.y2,u=e.y4;this.renderBound=k(Math.min(o,l,s,d),Math.min(i,h,a,u),Math.max(o,l,s,d),Math.max(i,h,a,u),this.renderBound)}}calculateClippingRect(e){C(this.globalTransform);var t=this.clippingRect,r=this.props,n=this.globalTransform,o=r.clipping,i=0!==n.tb||0!==n.tc;o&&!i?(t.x=n.tx,t.y=n.ty,t.width=this.width*n.ta,t.height=this.height*n.td,t.valid=!0):t.valid=!1,e.valid&&t.valid?N(e,t,t):e.valid&&(j(e,t),t.valid=!0)}calculateZIndex(){var e,t,r=this.props,n=r.zIndex||0,o=(null===(e=r.parent)||void 0===e?void 0:e.zIndex)||0,i=n;null!==(t=r.parent)&&void 0!==t&&t.zIndexLocked&&(i=n{e.setUpdateType(ft.CalculatedZIndex)}))}get zIndex(){return this.props.zIndex}set zIndex(e){this.props.zIndex=e,this.setUpdateType(ft.CalculatedZIndex|ft.Children),this.children.forEach((e=>{e.setUpdateType(ft.CalculatedZIndex)}))}get parent(){return this.props.parent}set parent(e){var t=this.props.parent;if(t!==e){if(this.props.parent=e,t){var r=t.children.indexOf(this);C(-1!==r,"CoreNode.parent: Node not found in old parent's children!"),t.children.splice(r,1),t.setUpdateType(ft.Children|ft.ZIndexSortedChildren)}e&&(e.children.push(this),this.setUpdateType(ft.All),e.setUpdateType(ft.Children|ft.ZIndexSortedChildren)),this.updateScaleRotateTransform()}}}var gt=1;function mt(){return gt++}class xt extends B{constructor(e,t,r,n){var o;super(),S(this,"rendererMain",void 0),S(this,"stage",void 0),S(this,"id",void 0),S(this,"coreNode",void 0),S(this,"_children",[]),S(this,"_src",""),S(this,"_parent",null),S(this,"_texture",null),S(this,"_shader",null),S(this,"_data",{}),S(this,"onTextureLoaded",((e,t)=>{this.emit("loaded",t)})),S(this,"onTextureFailed",((e,t)=>{this.emit("failed",t)})),S(this,"onTextureFreed",((e,t)=>{this.emit("freed",t)})),S(this,"onOutOfBounds",((e,t)=>{this.emit("outOfBounds",t)})),S(this,"onInBounds",((e,t)=>{this.emit("inBounds",t)})),S(this,"onOutOfViewport",((e,t)=>{this.emit("outOfViewport",t)})),S(this,"onInViewport",((e,t)=>{this.emit("inViewport",t)})),this.rendererMain=t,this.stage=r,this.id=null!==(o=null==n?void 0:n.id)&&void 0!==o?o:mt(),this.coreNode=n||new vt(this.stage,{id:this.id,x:e.x,y:e.y,width:e.width,height:e.height,alpha:e.alpha,autosize:e.autosize,clipping:e.clipping,color:e.color,colorTop:e.colorTop,colorBottom:e.colorBottom,colorLeft:e.colorLeft,colorRight:e.colorRight,colorTl:e.colorTl,colorTr:e.colorTr,colorBl:e.colorBl,colorBr:e.colorBr,zIndex:e.zIndex,zIndexLocked:e.zIndexLocked,scaleX:e.scaleX,scaleY:e.scaleY,mountX:e.mountX,mountY:e.mountY,mount:e.mount,pivot:e.pivot,pivotX:e.pivotX,pivotY:e.pivotY,rotation:e.rotation,parent:null,shader:null,shaderProps:null,texture:null,textureOptions:null}),this.coreNode.on("loaded",this.onTextureLoaded),this.coreNode.on("failed",this.onTextureFailed),this.coreNode.on("freed",this.onTextureFreed),this.coreNode.on("outOfBounds",this.onOutOfBounds),this.coreNode.on("inBounds",this.onInBounds),this.coreNode.on("outOfViewport",this.onOutOfViewport),this.coreNode.on("inViewport",this.onInViewport),this.parent=e.parent,this.shader=e.shader,this.texture=e.texture,this.src=e.src,this._data=e.data}get x(){return this.coreNode.x}set x(e){this.coreNode.x=e}get y(){return this.coreNode.y}set y(e){this.coreNode.y=e}get width(){return this.coreNode.width}set width(e){this.coreNode.width=e}get height(){return this.coreNode.height}set height(e){this.coreNode.height=e}get alpha(){return this.coreNode.alpha}set alpha(e){this.coreNode.alpha=e}get autosize(){return this.coreNode.autosize}set autosize(e){this.coreNode.autosize=e}get clipping(){return this.coreNode.clipping}set clipping(e){this.coreNode.clipping=e}get color(){return this.coreNode.color}set color(e){this.coreNode.color=e}get colorTop(){return this.coreNode.colorTop}set colorTop(e){this.coreNode.colorTop=e}get colorBottom(){return this.coreNode.colorBottom}set colorBottom(e){this.coreNode.colorBottom=e}get colorLeft(){return this.coreNode.colorLeft}set colorLeft(e){this.coreNode.colorLeft=e}get colorRight(){return this.coreNode.colorRight}set colorRight(e){this.coreNode.colorRight=e}get colorTl(){return this.coreNode.colorTl}set colorTl(e){this.coreNode.colorTl=e}get colorTr(){return this.coreNode.colorTr}set colorTr(e){this.coreNode.colorTr=e}get colorBl(){return this.coreNode.colorBl}set colorBl(e){this.coreNode.colorBl=e}get colorBr(){return this.coreNode.colorBr}set colorBr(e){this.coreNode.colorBr=e}get scale(){return this.scaleX!==this.scaleY?null:this.coreNode.scaleX}set scale(e){null!==e&&(this.coreNode.scaleX=e,this.coreNode.scaleY=e)}get scaleX(){return this.coreNode.scaleX}set scaleX(e){this.coreNode.scaleX=e}get scaleY(){return this.coreNode.scaleY}set scaleY(e){this.coreNode.scaleY=e}get mount(){return this.coreNode.mount}set mount(e){this.coreNode.mount=e}get mountX(){return this.coreNode.mountX}set mountX(e){this.coreNode.mountX=e}get mountY(){return this.coreNode.mountY}set mountY(e){this.coreNode.mountY=e}get pivot(){return this.coreNode.pivot}set pivot(e){this.coreNode.pivot=e}get pivotX(){return this.coreNode.pivotX}set pivotX(e){this.coreNode.pivotX=e}get pivotY(){return this.coreNode.pivotY}set pivotY(e){this.coreNode.pivotY=e}get rotation(){return this.coreNode.rotation}set rotation(e){this.coreNode.rotation=e}get parent(){return this._parent}set parent(e){var t,r=this._parent;if(this._parent=e,this.coreNode.parent=null!==(t=null==e?void 0:e.coreNode)&&void 0!==t?t:null,r){var n=r.children.indexOf(this);C(-1!==n,"MainOnlyNode.parent: Node not found in old parent's children!"),r.children.splice(n,1)}e&&e.children.push(this)}get children(){return this._children}get zIndex(){return this.coreNode.zIndex}set zIndex(e){this.coreNode.zIndex=e}get zIndexLocked(){return this.coreNode.zIndexLocked}set zIndexLocked(e){this.coreNode.zIndexLocked=e}get src(){return this._src}set src(e){this._src!==e&&(this._src=e,this.texture=e?this.rendererMain.createTexture("ImageTexture",{src:e}):null)}get texture(){return this._texture}set texture(e){this._texture!==e&&(this._texture&&this.rendererMain.textureTracker.decrementTextureRefCount(this._texture),e&&this.rendererMain.textureTracker.incrementTextureRefCount(e),this._texture=e,e?this.coreNode.loadTexture(e.txType,e.props,e.options):this.coreNode.unloadTexture())}get shader(){return this._shader}set shader(e){this._shader!==e&&(this._shader=e,e&&this.coreNode.loadShader(e.shType,e.props))}get data(){return this._data}set data(e){this._data=it(e)}destroy(){this.emit("beforeDestroy",{});for(var e=this.children[0];e;)e.destroy(),e=this.children[0];this.coreNode.destroy(),this.parent=null,this.texture=null,this.emit("afterDestroy",{}),this.removeAllListeners()}flush(){}animate(e,t){var r=new at(this.coreNode,e,t);return new lt(this.stage.animationManager,r)}}class yt{constructor(){S(this,"activeAnimations",new Set)}registerAnimation(e){this.activeAnimations.add(e)}unregisterAnimation(e){this.activeAnimations.delete(e)}update(e){this.activeAnimations.forEach((t=>{t.update(e)}))}}class bt{constructor(e){S(this,"imageWorkersEnabled",!0),S(this,"messageManager",{}),S(this,"workers",[]),S(this,"workerIndex",0),this.workers=this.createWorkers(e),this.workers.forEach((e=>{e.onmessage=this.handleMessage.bind(this)}))}handleMessage(e){var t=e.data,r=t.src,n=t.data,o=t.error,i=this.messageManager[r];if(i){var s=g(i,2),a=s[0],l=s[1];delete this.messageManager[r],o?l(new Error(o)):a(n)}}createWorkers(e=1){for(var t=new Blob(["\n function hasAlphaChannel(mimeType) {\n return (mimeType.indexOf(\"image/png\") !== -1);\n }\n\n function getImage(src, premultiplyAlpha) {\n return new Promise(function(resolve, reject) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', src, true);\n xhr.responseType = 'blob';\n\n xhr.onload = function() {\n if (xhr.status === 200) {\n var blob = xhr.response;\n var hasAlphaChannel = premultiplyAlpha !== undefined ? premultiplyAlpha : hasAlphaChannel(blob.type);\n\n createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none'\n }).then(function(data) {\n resolve({ data: data, premultiplyAlpha: premultiplyAlpha });\n }).catch(function(error) {\n reject(error);\n });\n } else {\n reject(new Error('Failed to load image: ' + xhr.statusText));\n }\n };\n\n xhr.onerror = function() {\n reject(new Error('Network error occurred while trying to fetch the image.'));\n };\n\n xhr.send();\n });\n }\n\n self.onmessage = async (event) => {\n var src = event.data.src;\n var premultiplyAlpha = event.data.premultiplyAlpha;\n\n getImage(src, premultiplyAlpha)\n .then(function(data) {\n self.postMessage({ src: src, data: data }, [data.data]);\n })\n .catch(function(error) {\n self.postMessage({ src: src, error: error.message });\n });\n };\n ".replace('"use strict";',"")],{type:"application/javascript"}),r=(self.URL?URL:webkitURL).createObjectURL(t),n=[],o=0;o{try{if(this.workers){var o=this.convertUrlToAbsolute(e);this.messageManager[o]=[r,n],this.getNextWorker().postMessage({src:o,premultiplyAlpha:t})}}catch(i){n(i)}}))}}class wt extends P{constructor(e,t){super(e),S(this,"props",void 0),this.props=wt.resolveDefaults(t)}getTextureData(){var e=this;return y(m().mark((function t(){var r,n,o,i,s,a,l;return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(r=e.props,n=r.width,o=r.height,i=n*o*4,s=new Uint8ClampedArray(i),a=0;a{})}setTextureMemUse(e,t){this.textures.has(e)&&(this.memUsed-=this.textures.get(e)),0!==t?(this.memUsed+=t,this.textures.set(e,t),this.memUsed>this.threshold&&this.gc()):this.textures.delete(e)}gc(){this.textures.forEach(((e,t)=>{t.renderable||t.free()}))}}class Ct extends B{constructor(e){super(),S(this,"options",void 0),S(this,"animationManager",void 0),S(this,"txManager",void 0),S(this,"txMemManager",void 0),S(this,"fontManager",void 0),S(this,"textRenderers",void 0),S(this,"shManager",void 0),S(this,"renderer",void 0),S(this,"root",void 0),S(this,"boundsMargin",void 0),S(this,"deltaTime",0),S(this,"lastFrameTime",0),S(this,"currentFrameTime",0),S(this,"fpsNumFrames",0),S(this,"fpsElapsedTime",0),S(this,"renderRequested",!1),S(this,"contextSpy",null),this.options=e;var t=e.canvas,r=e.clearColor,n=e.rootId,o=e.debug,i=e.appWidth,s=e.appHeight,a=e.boundsMargin,l=e.enableContextSpy,d=e.numImageWorkers,h=e.txMemByteThreshold;this.txManager=new St(d),this.txMemManager=new At(h),this.shManager=new We,this.animationManager=new yt,this.contextSpy=l?new Ye:null;var u=[0,0,0,0];a&&(u=Array.isArray(a)?a:[a,a,a,a]),this.boundsMargin=u,null!=o&&o.monitorTextureCache&&setInterval((()=>{C(this.txManager);var e=this.txManager.getDebugInfo();console.log("Texture ID Cache Size: ",e.idCacheSize),console.log("Texture Key Cache Size: ",e.keyCacheSize)}),1e3),this.renderer=new q({stage:this,canvas:t,pixelRatio:e.devicePhysicalPixelRatio*e.deviceLogicalPixelRatio,clearColor:null!=r?r:4278190080,bufferMemory:2e6,txManager:this.txManager,txMemManager:this.txMemManager,shManager:this.shManager,contextSpy:this.contextSpy}),this.txManager.renderer=this.renderer,this.textRenderers={canvas:new ye(this),sdf:new rt(this)},this.fontManager=new et(this.textRenderers);var c,f,p,v=new vt(this,{id:n,x:0,y:0,width:i,height:s,alpha:1,autosize:!1,clipping:!1,color:0,colorTop:0,colorBottom:0,colorLeft:0,colorRight:0,colorTl:0,colorTr:0,colorBl:0,colorBr:0,zIndex:0,zIndexLocked:0,scaleX:1,scaleY:1,mountX:0,mountY:0,mount:0,pivot:.5,pivotX:.5,pivotY:.5,rotation:0,parent:null,texture:null,textureOptions:null,shader:null,shaderProps:null});this.root=v,c=this,f=!1,p=()=>{if(c.updateAnimations(),!c.hasSceneUpdates())return c.calculateFps(),setTimeout(p,16.666666666666668),void(f||(c.emit("idle"),f=!0));f=!1,c.drawFrame(),requestAnimationFrame(p)},requestAnimationFrame(p)}updateAnimations(){var e=this.animationManager;this.root&&(this.lastFrameTime=this.currentFrameTime,this.currentFrameTime=performance?performance.now():Date.now(),this.deltaTime=this.lastFrameTime?this.currentFrameTime-this.lastFrameTime:100/6,this.emit("frameTick",{time:this.currentFrameTime,delta:this.deltaTime}),e.update(this.deltaTime))}hasSceneUpdates(){return!!this.root.updateType||this.renderRequested}drawFrame(){var e=this.renderer,t=this.renderRequested;0!==this.root.updateType&&this.root.update(this.deltaTime,this.root.clippingRect),null==e||e.reset(),this.addQuads(this.root),null==e||e.render(),this.calculateFps(),t&&(this.renderRequested=!1)}calculateFps(){var e=this.options.fpsUpdateInterval;if(e&&(this.fpsNumFrames++,this.fpsElapsedTime+=this.deltaTime,this.fpsElapsedTime>=e)){var t,r,n,o=Math.round(1e3*this.fpsNumFrames/this.fpsElapsedTime);this.fpsNumFrames=0,this.fpsElapsedTime=0,this.emit("fpsUpdate",{fps:o,contextSpyData:null!==(t=null===(r=this.contextSpy)||void 0===r?void 0:r.getData())&&void 0!==t?t:null}),null===(n=this.contextSpy)||void 0===n||n.reset()}}addQuads(e){C(this.renderer&&e.globalTransform),e.isRenderable&&e.renderQuads(this.renderer);for(var t=0;t{var e=this.contain,t=this.trState.props.width,r=this.trState.props.height,n=this.trState.textW||0,o=this.trState.textH||0;"both"===e?(this.props.width=t,this.props.height=r):"width"===e?(this.props.width=t,this.props.height=o):"none"===e&&(this.props.width=n,this.props.height=o),this.updateLocalTransform(),this.stage.requestRender(),this.emit("loaded",{type:"text",dimensions:{width:this.trState.textW||0,height:this.trState.textH||0}})})),S(this,"onTextFailed",((e,t)=>{this.emit("failed",{type:"text",error:t})})),this._textRendererOverride=t.textRendererOverride;var r=this.resolveTextRendererAndState({x:this.absX,y:this.absY,width:t.width,height:t.height,textAlign:t.textAlign,color:t.color,zIndex:t.zIndex,contain:t.contain,scrollable:t.scrollable,scrollY:t.scrollY,offsetY:t.offsetY,letterSpacing:t.letterSpacing,debug:t.debug,fontFamily:t.fontFamily,fontSize:t.fontSize,fontStretch:t.fontStretch,fontStyle:t.fontStyle,fontWeight:t.fontWeight,text:t.text,lineHeight:t.lineHeight,maxLines:t.maxLines,textBaseline:t.textBaseline,verticalAlign:t.verticalAlign,overflowSuffix:t.overflowSuffix}),n=r.resolvedTextRenderer,o=r.textRendererState;this.textRenderer=n,this.trState=o}get width(){return this.props.width}set width(e){this.props.width=e,this.textRenderer.set.width(this.trState,e),"none"===this.contain&&this.setUpdateType(ft.Local)}get height(){return this.props.height}set height(e){this.props.height=e,this.textRenderer.set.height(this.trState,e),"both"!==this.contain&&this.setUpdateType(ft.Local)}get color(){return this.trState.props.color}set color(e){this.textRenderer.set.color(this.trState,e)}get text(){return this.trState.props.text}set text(e){this.textRenderer.set.text(this.trState,e)}get textRendererOverride(){return this._textRendererOverride}set textRendererOverride(e){this._textRendererOverride=e,this.textRenderer.destroyState(this.trState);var t=this.resolveTextRendererAndState(this.trState.props),r=t.resolvedTextRenderer,n=t.textRendererState;this.textRenderer=r,this.trState=n}get fontSize(){return this.trState.props.fontSize}set fontSize(e){this.textRenderer.set.fontSize(this.trState,e)}get fontFamily(){return this.trState.props.fontFamily}set fontFamily(e){this.textRenderer.set.fontFamily(this.trState,e)}get fontStretch(){return this.trState.props.fontStretch}set fontStretch(e){this.textRenderer.set.fontStretch(this.trState,e)}get fontStyle(){return this.trState.props.fontStyle}set fontStyle(e){this.textRenderer.set.fontStyle(this.trState,e)}get fontWeight(){return this.trState.props.fontWeight}set fontWeight(e){this.textRenderer.set.fontWeight(this.trState,e)}get textAlign(){return this.trState.props.textAlign}set textAlign(e){this.textRenderer.set.textAlign(this.trState,e)}get contain(){return this.trState.props.contain}set contain(e){this.textRenderer.set.contain(this.trState,e)}get scrollable(){return this.trState.props.scrollable}set scrollable(e){this.textRenderer.set.scrollable(this.trState,e)}get scrollY(){return this.trState.props.scrollY}set scrollY(e){this.textRenderer.set.scrollY(this.trState,e)}get offsetY(){return this.trState.props.offsetY}set offsetY(e){this.textRenderer.set.offsetY(this.trState,e)}get letterSpacing(){return this.trState.props.letterSpacing}set letterSpacing(e){this.textRenderer.set.letterSpacing(this.trState,e)}get lineHeight(){return this.trState.props.lineHeight}set lineHeight(e){this.textRenderer.set.lineHeight&&this.textRenderer.set.lineHeight(this.trState,e)}get maxLines(){return this.trState.props.maxLines}set maxLines(e){this.textRenderer.set.maxLines&&this.textRenderer.set.maxLines(this.trState,e)}get textBaseline(){return this.trState.props.textBaseline}set textBaseline(e){this.textRenderer.set.textBaseline&&this.textRenderer.set.textBaseline(this.trState,e)}get verticalAlign(){return this.trState.props.verticalAlign}set verticalAlign(e){this.textRenderer.set.verticalAlign&&this.textRenderer.set.verticalAlign(this.trState,e)}get overflowSuffix(){return this.trState.props.overflowSuffix}set overflowSuffix(e){this.textRenderer.set.overflowSuffix&&this.textRenderer.set.overflowSuffix(this.trState,e)}get debug(){return this.trState.props.debug}set debug(e){this.textRenderer.set.debug(this.trState,e)}update(e,t){super.update(e,t),C(this.globalTransform),this.textRenderer.set.x(this.trState,this.globalTransform.tx),this.textRenderer.set.y(this.trState,this.globalTransform.ty)}checkRenderProps(){return""!==this.trState.props.text||super.checkRenderProps()}onChangeIsRenderable(e){super.onChangeIsRenderable(e),this.textRenderer.setIsRenderable(this.trState,e)}renderQuads(e){C(this.globalTransform),this.textRenderer.renderQuads(this.trState,this.globalTransform,this.clippingRect,this.worldAlpha)}destroy(){super.destroy(),this.textRenderer.destroyState(this.trState)}resolveTextRendererAndState(e){var t=this.stage.resolveTextRenderer(e,this._textRendererOverride),r=t.createState(e);return r.emitter.on("loaded",this.onTextLoaded),r.emitter.on("failed",this.onTextFailed),t.scheduleUpdateState(r),{resolvedTextRenderer:t,textRendererState:r}}}class _t extends xt{constructor(e,t,r){super(e,t,r,new Tt(r,{id:mt(),x:e.x,y:e.y,width:e.width,height:e.height,alpha:e.alpha,autosize:e.autosize,clipping:e.clipping,color:e.color,colorTop:e.colorTop,colorBottom:e.colorBottom,colorLeft:e.colorLeft,colorRight:e.colorRight,colorTl:e.colorTl,colorTr:e.colorTr,colorBl:e.colorBl,colorBr:e.colorBr,zIndex:e.zIndex,zIndexLocked:e.zIndexLocked,scaleX:e.scaleX,scaleY:e.scaleY,mountX:e.mountX,mountY:e.mountY,mount:e.mount,pivot:e.pivot,pivotX:e.pivotX,pivotY:e.pivotY,rotation:e.rotation,text:e.text,fontSize:e.fontSize,fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontStretch:e.fontStretch,fontStyle:e.fontStyle,contain:e.contain,scrollable:e.scrollable,letterSpacing:e.letterSpacing,textAlign:e.textAlign,scrollY:e.scrollY,offsetY:e.offsetY,textRendererOverride:e.textRendererOverride,lineHeight:e.lineHeight,maxLines:e.maxLines,textBaseline:e.textBaseline,verticalAlign:e.verticalAlign,overflowSuffix:e.overflowSuffix,debug:e.debug,parent:null,texture:null,textureOptions:null,shader:null,shaderProps:null}))}get text(){return this.coreNode.text}set text(e){this.coreNode.text=e}get textRendererOverride(){return this.coreNode.textRendererOverride}set textRendererOverride(e){this.coreNode.textRendererOverride=e}get fontSize(){return this.coreNode.fontSize}set fontSize(e){this.coreNode.fontSize=e}get fontFamily(){return this.coreNode.fontFamily}set fontFamily(e){this.coreNode.fontFamily=e}get fontWeight(){return this.coreNode.fontWeight}set fontWeight(e){this.coreNode.fontWeight=e}get fontStretch(){return this.coreNode.fontStretch}set fontStretch(e){this.coreNode.fontStretch=e}get fontStyle(){return this.coreNode.fontStyle}set fontStyle(e){this.coreNode.fontStyle=e}get textAlign(){return this.coreNode.textAlign}set textAlign(e){this.coreNode.textAlign=e}get contain(){return this.coreNode.contain}set contain(e){this.coreNode.contain=e}get scrollable(){return this.coreNode.scrollable}set scrollable(e){this.coreNode.scrollable=e}get scrollY(){return this.coreNode.scrollY}set scrollY(e){this.coreNode.scrollY=e}get offsetY(){return this.coreNode.offsetY}set offsetY(e){this.coreNode.offsetY=e}get letterSpacing(){return this.coreNode.letterSpacing}set letterSpacing(e){this.coreNode.letterSpacing=e}get lineHeight(){return this.coreNode.lineHeight}set lineHeight(e){e&&(this.coreNode.lineHeight=e)}get maxLines(){return this.coreNode.maxLines}set maxLines(e){e&&(this.coreNode.maxLines=e)}get textBaseline(){return this.coreNode.textBaseline}set textBaseline(e){e&&(this.coreNode.textBaseline=e)}get verticalAlign(){return this.coreNode.verticalAlign}set verticalAlign(e){e&&(this.coreNode.verticalAlign=e)}get overflowSuffix(){return this.coreNode.overflowSuffix}set overflowSuffix(e){e&&(this.coreNode.overflowSuffix=e)}get debug(){return this.coreNode.debug}set debug(e){this.coreNode.debug=e}}class kt{constructor(){S(this,"root",null),S(this,"stage",null),S(this,"rendererMain",null)}init(e,t,r){var n=this;return y(m().mark((function o(){var i;return m().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(n.stage=new Ct({rootId:mt(),appWidth:t.appWidth,appHeight:t.appHeight,txMemByteThreshold:t.txMemByteThreshold,boundsMargin:t.boundsMargin,deviceLogicalPixelRatio:t.deviceLogicalPixelRatio,devicePhysicalPixelRatio:t.devicePhysicalPixelRatio,clearColor:t.clearColor,canvas:r,fpsUpdateInterval:t.fpsUpdateInterval,enableContextSpy:t.enableContextSpy,numImageWorkers:t.numImageWorkers,debug:{monitorTextureCache:!1}}),n.rendererMain=e,C(n.stage.root),i=new xt(e.resolveNodeDefaults({}),n.rendererMain,n.stage,n.stage.root),n.root=i,i.once("beforeDestroy",n.onBeforeDestroyNode.bind(n,i)),n.onCreateNode(i),!t.coreExtensionModule){o.next=10;break}return o.next=10,nt(t.coreExtensionModule,n.stage);case 10:n.stage.on("fpsUpdate",((e,t)=>{n.onFpsUpdate(t)})),n.stage.on("frameTick",((e,t)=>{n.onFrameTick(t)})),n.stage.on("idle",(()=>{n.onIdle()}));case 13:case"end":return o.stop()}}),o)})))()}createNode(e){C(this.rendererMain),C(this.stage);var t=new xt(e,this.rendererMain,this.stage);return t.once("beforeDestroy",this.onBeforeDestroyNode.bind(this,t)),this.onCreateNode(t),t}createTextNode(e){C(this.rendererMain),C(this.stage);var t=new _t(e,this.rendererMain,this.stage);return t.once("beforeDestroy",this.onBeforeDestroyNode.bind(this,t)),this.onCreateNode(t),t}destroyNode(e){e.destroy()}releaseTexture(e){var t=this.stage;C(t),t.txManager.removeTextureIdFromCache(e)}getRootNode(){return C(this.root),this.root}onCreateNode(e){throw new Error("Method not implemented.")}onBeforeDestroyNode(e){throw new Error("Method not implemented.")}onFpsUpdate(e){throw new Error("Method not implemented.")}onFrameTick(e){throw new Error("Method not implemented.")}onIdle(){throw new Error("Method not implemented.")}}var It,Bt=(e,t)=>e===t,Rt=Symbol("solid-proxy"),Et=Symbol("solid-track"),Nt={equals:Bt},Ft=pr,Lt=1,zt=2,Mt={owned:null,cleanups:null,context:null,owner:null},Pt={},Dt=null,Ot=null,Ut=null,Wt=null,Yt=null,jt=0;function Ht(e,t){var r=Ut,n=Dt,o=0===e.length,i=void 0===t?n:t,s=o?Mt:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e((()=>qt((()=>xr(s)))));Dt=s,Ut=null;try{return fr(a,!0)}finally{Ut=r,Dt=n}}function Qt(e,t){var r={value:e,observers:null,observerSlots:null,comparator:(t=t?Object.assign({},Nt,t):Nt).equals||void 0};return[lr.bind(r),e=>("function"==typeof e&&(e=e(r.value)),dr(r,e))]}function Kt(e,t,r){hr(ur(e,t,!0,Lt))}function $t(e,t,r){hr(ur(e,t,!1,Lt))}function Xt(e,t,r){Ft=vr;var n=ur(e,t,!1,Lt);r&&r.render||(n.user=!0),Yt?Yt.push(n):hr(n)}function Gt(e,t,r){r=r?Object.assign({},Nt,r):Nt;var n=ur(e,t,!0,0);return n.observers=null,n.observerSlots=null,n.comparator=r.equals||void 0,hr(n),lr.bind(n)}function Vt(e,t,r){var n,o,i;2===arguments.length&&"object"==typeof t||1===arguments.length?(n=!0,o=e,i=t||{}):(n=e,o=t,i=r||{});var s=null,a=Pt,l=!1,d="initialValue"in i,h="function"==typeof n&&Gt(n),u=new Set,c=g((i.storage||Qt)(i.initialValue),2),f=c[0],p=c[1],v=g(Qt(void 0),2),m=v[0],x=v[1],y=g(Qt(void 0,{equals:!1}),2),b=y[0],w=y[1],S=g(Qt(d?"ready":"unresolved"),2),C=S[0],T=S[1];function _(e,t,r,n){return s===e&&(s=null,void 0!==n&&(d=!0),e!==a&&t!==a||!i.onHydrated||queueMicrotask((()=>i.onHydrated(n,{value:t}))),a=Pt,function(e,t){fr((()=>{void 0===t&&p((()=>e)),T(void 0!==t?"errored":d?"ready":"unresolved"),x(t);var r,n=A(u.keys());try{for(n.s();!(r=n.n()).done;){r.value.decrement()}}catch(t){n.e(t)}finally{n.f()}u.clear()}),!1)}(t,r)),t}function k(){var e=It,t=f(),r=m();if(void 0!==r&&!s)throw r;return Ut&&!Ut.user&&e&&Kt((()=>{b(),s&&(e.resolved||u.has(e)||(e.increment(),u.add(e)))})),t}function I(e=!0){if(!1===e||!l){l=!1;var t=h?h():n;if(null!=t&&!1!==t){var r,i=a!==Pt?a:qt((()=>o(t,{value:f(),refetching:e})));return(r=i)&&"object"==typeof r&&"then"in r?(s=i,"value"in i?("success"===i.status?_(s,i.value,void 0,t):_(s,void 0,void 0,t),i):(l=!0,queueMicrotask((()=>l=!1)),fr((()=>{T(d?"refreshing":"pending"),w()}),!1),i.then((e=>_(i,e,void 0,t)),(e=>_(i,void 0,yr(e),t))))):(_(s,i,void 0,t),i)}_(s,qt(f))}}return Object.defineProperties(k,{state:{get:()=>C()},error:{get:()=>m()},loading:{get(){var e=C();return"pending"===e||"refreshing"===e}},latest:{get(){if(!d)return k();var e=m();if(e&&!s)throw e;return f()}}}),h?Kt((()=>I(!1))):I(!1),[k,{refetch:I,mutate:p}]}function Zt(e,t=Bt,r){var n=new Map,o=ur((r=>{var o,i=e(),s=A(n.entries());try{for(s.s();!(o=s.n()).done;){var a=g(o.value,2),l=a[0],d=a[1];if(t(l,i)!==t(l,r)){var h,u=A(d.values());try{for(u.s();!(h=u.n()).done;){var c=h.value;c.state=Lt,c.pure?Wt.push(c):Yt.push(c)}}catch(f){u.e(f)}finally{u.f()}}}}catch(f){s.e(f)}finally{s.f()}return i}),void 0,!0,Lt);return hr(o),e=>{var r,i=Ut;i&&((r=n.get(e))?r.add(i):n.set(e,r=new Set([i])),tr((()=>{r.delete(i),!r.size&&n.delete(e)})));return t(e,o.value)}}function qt(e){if(null===Ut)return e();var t=Ut;Ut=null;try{return e()}finally{Ut=t}}function Jt(e,t,r){var n,o=Array.isArray(e),i=r&&r.defer;return r=>{var s;if(o){s=Array(e.length);for(var a=0;at(s,n,r)));return n=s,l}}function er(e){Xt((()=>qt(e)))}function tr(e){return null===Dt||(null===Dt.cleanups?Dt.cleanups=[e]:Dt.cleanups.push(e)),e}function rr(){return Dt}function nr(e,t){var r=Dt,n=Ut;Dt=e,Ut=null;try{return fr(t,!0)}catch(o){br(o)}finally{Dt=r,Ut=n}}function or(e){var t=Ut,r=Dt;return Promise.resolve().then((()=>{Ut=t,Dt=r,fr(e,!1),Ut=Dt=null}))}function ir(e,t){var r=Symbol("context");return{id:r,Provider:Sr(r),defaultValue:e}}function sr(e){return Dt&&Dt.context&&void 0!==Dt.context[e.id]?Dt.context[e.id]:e.defaultValue}function ar(e){var t=Gt(e),r=Gt((()=>wr(t())));return r.toArray=()=>{var e=r();return Array.isArray(e)?e:null!=e?[e]:[]},r}function lr(){if(this.sources&&this.state)if(this.state===Lt)hr(this);else{var e=Wt;Wt=null,fr((()=>gr(this)),!1),Wt=e}if(Ut){var t=this.observers?this.observers.length:0;Ut.sources?(Ut.sources.push(this),Ut.sourceSlots.push(t)):(Ut.sources=[this],Ut.sourceSlots=[t]),this.observers?(this.observers.push(Ut),this.observerSlots.push(Ut.sources.length-1)):(this.observers=[Ut],this.observerSlots=[Ut.sources.length-1])}return this.value}function dr(e,t,r){var n=e.value;return e.comparator&&e.comparator(n,t)||(e.value=t,e.observers&&e.observers.length&&fr((()=>{for(var t=0;t1e6)throw Wt=[],new Error}),!1)),t}function hr(e){if(e.fn){xr(e);var t=jt;!function(e,t,r){var n,o=Dt,i=Ut;Ut=Dt=e;try{n=e.fn(t)}catch(s){return e.pure&&(e.state=Lt,e.owned&&e.owned.forEach(xr),e.owned=null),e.updatedAt=r+1,br(s)}finally{Ut=i,Dt=o}(!e.updatedAt||e.updatedAt<=r)&&(null!=e.updatedAt&&"observers"in e?dr(e,n):e.value=n,e.updatedAt=r)}(e,e.value,t)}}function ur(e,t,r,n=Lt,o){var i={fn:e,state:n,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:Dt,context:Dt?Dt.context:null,pure:r};return null===Dt||Dt!==Mt&&(Dt.owned?Dt.owned.push(i):Dt.owned=[i]),i}function cr(e){if(0!==e.state){if(e.state===zt)return gr(e);if(e.suspense&&qt(e.suspense.inFallback))return e.suspense.effects.push(e);for(var t=[e];(e=e.owner)&&(!e.updatedAt||e.updatedAt=0;r--)if((e=t[r]).state===Lt)hr(e);else if(e.state===zt){var n=Wt;Wt=null,fr((()=>gr(e,t[0])),!1),Wt=n}}}function fr(e,t){if(Wt)return e();var r=!1;t||(Wt=[]),Yt?r=!0:Yt=[],jt++;try{var n=e();return function(e){Wt&&(pr(Wt),Wt=null);if(e)return;var t=Yt;Yt=null,t.length&&fr((()=>Ft(t)),!1)}(r),n}catch(o){r||(Yt=null),Wt=null,br(o)}}function pr(e){for(var t=0;t=0;t--)xr(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function yr(e){return e instanceof Error?e:new Error("string"==typeof e?e:"Unknown error",{cause:e})}function br(e,t=Dt){throw yr(e)}function wr(e){if("function"==typeof e&&!e.length)return wr(e());if(Array.isArray(e)){for(var t=[],r=0;rr=qt((()=>(Dt.context=w(w({},Dt.context),{},{[e]:t.value}),ar((()=>t.children)))))),void 0),r}}var Ar=Symbol("fallback");function Cr(e){for(var t=0;te(t||{})))}function _r(){return!0}var kr={get:(e,t,r)=>t===Rt?r:e.get(t),has:(e,t)=>t===Rt||e.has(t),set:_r,deleteProperty:_r,getOwnPropertyDescriptor:(e,t)=>({configurable:!0,enumerable:!0,get:()=>e.get(t),set:_r,deleteProperty:_r}),ownKeys:e=>e.keys()};function Ir(e){return(e="function"==typeof e?e():e)?e:{}}function Br(){for(var e=0,t=this.length;e=0;r--){var n=Ir(e[r])[t];if(void 0!==n)return n}},has(t){for(var r=e.length-1;r>=0;r--)if(t in Ir(e[r]))return!0;return!1},keys(){for(var t=[],r=0;r=0;s--){var a=e[s];if(a)for(var l=Object.getOwnPropertyNames(a),d=function(){var e=l[h];if("__proto__"===e||"constructor"===e)return 1;var t=Object.getOwnPropertyDescriptor(a,e);if(i[e]){var r=o[e];r&&(t.get?r.push(t.get.bind(a)):void 0!==t.value&&r.push((()=>t.value)))}else i[e]=t.get?{enumerable:!0,configurable:!0,get:Br.bind(o[e]=[t.get.bind(a)])}:void 0!==t.value?t:void 0},h=l.length-1;h>=0;h--)d()}for(var u={},c=Object.keys(i),f=c.length-1;f>=0;f--){var p=c[f],v=i[p];v&&v.get?Object.defineProperty(u,p,v):u[p]=v?v.value:void 0}return u}var Er=e=>`Stale read from <${e}>.`;function Nr(e){var t="fallback"in e&&{fallback:()=>e.fallback};return Gt(function(e,t,r={}){var n=[],o=[],i=[],s=0,a=t.length>1?[]:null;return tr((()=>Cr(i))),()=>{var l,d,h=e()||[];return h[Et],qt((()=>{var e,t,c,f,p,v,g,m,x,y=h.length;if(0===y)0!==s&&(Cr(i),i=[],n=[],o=[],s=0,a&&(a=[])),r.fallback&&(n=[Ar],o[0]=Ht((e=>(i[0]=e,r.fallback()))),s=1);else if(0===s){for(o=new Array(y),d=0;d=v&&m>=v&&n[g]===h[m];g--,m--)c[m]=o[g],f[m]=i[g],a&&(p[m]=a[g]);for(e=new Map,t=new Array(m+1),d=m;d>=v;d--)x=h[d],l=e.get(x),t[d]=void 0===l?-1:l,e.set(x,d);for(l=v;l<=g;l++)x=n[l],void 0!==(d=e.get(x))&&-1!==d?(c[d]=o[l],f[d]=i[l],a&&(p[d]=a[l]),d=t[d],e.set(x,d)):i[l]();for(d=v;de.each),e.children,t||void 0))}function Fr(e){var t=e.keyed,r=Gt((()=>e.when),void 0,{equals:(e,r)=>t?e===r:!e==!r});return Gt((()=>{var n=r();if(n){var o=e.children;return"function"==typeof o&&o.length>0?qt((()=>o(t?n:()=>{if(!qt(r))throw Er("Show");return e.when}))):o}return e.fallback}),void 0,void 0)}var Lr,zr;function Mr(e={},t="app"){var r=new kt;return Lr=new st(e,t,r),zr=Lr.createShader.bind(Lr),Lr}class Pr extends Array{constructor(e){super(),S(this,"_parent",void 0),this._parent=e}get selected(){return this[this._parent.selected||0]}get firstChild(){return this[0]}insert(e,t){if(t){var r=this.indexOf(t);this.splice(r,0,e)}else this.push(e);e.parent=this._parent,this._parent._isDirty=!0}remove(e){var t=this.indexOf(e);t>=0&&this.splice(t,1)}}var Dr={debug:!1,animationsEnabled:!0,animationSettings:{duration:250,easing:"ease-in-out"},fontSettings:{fontFamily:"Ubuntu",fontSize:100}};function Or(e,t,...r){false}function Ur(e){return"function"==typeof e}function Wr(e){return Array.isArray(e)}function Yr(e,t={}){if(Wr(e))e.forEach((e=>{Yr(e,t)}));else if(e)for(var r in e)void 0===t[r]&&(t[r]=e[r]);return t}class jr extends Array{constructor(e,t={}){return Wr(t)?(super(...t),S(this,"onChange",void 0)):"string"==typeof t?(super(t),S(this,"onChange",void 0)):(super(...Object.entries(t).filter((([e,t])=>t)).map((([e])=>e))),S(this,"onChange",void 0)),this.onChange=e,this}has(e){return this.indexOf(e)>=0}is(e){return this.indexOf(e)>=0}add(e){this.push(e),this.onChange()}toggle(e){this.has(e)?this.remove(e):this.add(e)}remove(e){var t=this.indexOf(e);t>=0&&(this.splice(t,1),this.onChange())}}var Hr=g(Qt(void 0),2),Qr=Hr[0],Kr=Hr[1],$r=Dr.animationSettings;function Xr(e){for(var t=[],r=0,n=Object.entries(e);rKr(this)))}else this.autofocus=!0}isTextNode(){return"text"===this.name}_resizeOnTextLoad(){this.lng.on("loaded",((e,t)=>{if("text"===t.type){var r=t.dimensions;this.parent.updateLayout(this,r)}}))}getText(){return this.children.map((e=>e.text)).join("")}destroy(){var e;this._queueDelete&&(null===(e=this.lng)||void 0===e||e.destroy())}set onEvents(e){this._events=e}get onEvents(){return this._events||[]}set style(e){for(var t in Wr(e)?this._style=Yr(e):this._style=e,this._style)void 0===this[t]&&(this[t]=this._style[t])}get style(){return this._style}get hasChildren(){return this.children.length>0}getChildById(e){return this.children.find((t=>t.id===e))}searchChildrenById(e){var t,r=A(this.children);try{for(r.s();!(t=r.n()).done;){var n=t.value;if(n.id===e)return n;if(n instanceof Vr){var o=n.searchChildrenById(e);if(o)return o}}}catch(i){r.e(i)}finally{r.f()}}set states(e){this._states=new jr(this._stateChanged.bind(this),e),this.rendered&&this._stateChanged()}get states(){return this._states=this._states||new jr(this._stateChanged.bind(this)),this._states}get animationSettings(){return this._animationSettings||$r}set animationSettings(e){this._animationSettings=e}updateLayout(e,t){if(this.hasChildren){var r;if(Or(),Ur(this.onBeforeLayout)&&this.onBeforeLayout.call(this,e,t),"flex"===this.display)if(function(e){for(var t=[],r=0;re+(t[s]||0)),0));var x=f&&g?e=>{"flexStart"===g?e[u]=0:"center"===g?e[u]=(f-(e[a]||0))/2:"flexEnd"===g&&(e[u]=f-(e[a]||0))}:e=>e;if("flexStart"===v){var y=0;if(t.forEach((e=>{e[h]=y+(e[l]||0),y+=(e[s]||0)+p+(e[l]||0)+(e[d]||0),x(e)})),e._autosized){var b=y-p;if(b!==e[s])return e[s]=b,!0}}else if("flexEnd"===v)for(var w=c,S=o-1;S>=0;S--){var A=t[S];C(A),A[h]=w-(A[s]||0)-(A[d]||0),w-=(A[s]||0)+p+(A[l]||0)+(A[d]||0),x(A)}else if("center"===v){var T=(c-(m+p*(o-1)))/2;t.forEach((e=>{e[h]=T,T+=(e[s]||0)+p,x(e)}))}else if("spaceBetween"===v){var _=(c-m)/(o-1),k=0;t.forEach((e=>{e[h]=k,k+=(e[s]||0)+_,x(e)}))}else if("spaceEvenly"===v){var I=(c-m)/(o+1),B=I;t.forEach((e=>{e[h]=B,B+=(e[s]||0)+I,x(e)}))}return!1}(this))null===(r=this.parent)||void 0===r||r.updateLayout();Ur(this.onLayout)&&this.onLayout.call(this,e,t)}}_stateChanged(){if(Or(0,0,this.states),this.forwardStates){var e=this.states.slice();this.children.forEach((t=>t.states=e))}var t=this.states;if(this._undoStyles||this.style&&function(e,t){var r,n=A(t);try{for(n.s();!(r=n.n()).done;)if(r.value in e)return!0}catch(o){n.e(o)}finally{n.f()}return!1}(this.style,t)){this._undoStyles=this._undoStyles||[];var r={};this._undoStyles.forEach((e=>{r[e]=this.style[e]}));var n=t.reduce(((e,t)=>{var r=this.style[t];return r&&(e=w(w({},e),r)),e}),{});this._undoStyles=Object.keys(n),void 0!==n.transition&&(this.transition=n.transition),Object.assign(this,w(w({},r),n))}}render(){var e=this,t=this.parent;if(t)if(t.rendered)if(this.rendered)console.warn("Node already rendered: ",this);else{t._isDirty&&(t.updateLayout(),t._isDirty=!1),e.updateLayout(),this.states.length&&this._stateChanged();var r=e._renderProps;t.lng&&(r.parent=t.lng),e._effects&&(this.shader=Xr(e._effects)),e.isTextNode()?((r=w(w(w({},Dr.fontSettings),r),{},{text:e.getText()})).contain&&(r.width||(r.width=(t.width||0)-(r.x||0)-(r.marginRight||0),e._width=r.width,e._autosized=!0),"both"!==r.contain||r.height||r.maxLines||(r.height=(t.height||0)-(r.y||0)-(r.marginBottom||0),e._height=r.height,e._autosized=!0)),Or(0,0),e.lng=Lr.createTextNode(r),Ur(e.onLoad)&&e.lng.on("loaded",e.onLoad),e.width&&e.height||(e._autosized=!0,e._resizeOnTextLoad())):(r.texture||(isNaN(r.width)&&(r.width=(t.width||0)-(r.x||0),e._width=r.width,e._autosized=!0),isNaN(r.height)&&(r.height=(t.height||0)-(r.y||0),e._height=r.height,e._autosized=!0),r.color||r.src||(e._color=r.color=0)),Or(0,0),e.lng=Lr.createNode(r),e.onFail&&e.lng.on("failed",e.onFail),e.onLoad&&e.lng.on("loaded",e.onLoad)),e.rendered=!0,Ur(this.onCreate)&&this.onCreate.call(this,e),e.onEvents.forEach((([t,r])=>{var n;null===(n=e.lng)||void 0===n||n.on(t,((t,n)=>r(e,n)))})),e.lng.div&&(e.lng.div.solid=e),delete this._renderProps,"text"!==e.name&&e.children.forEach((e=>{e.render?e.render():""!==e.text&&console.warn("TextNode outside of : ",e)})),e.autofocus&&e.setFocus()}else console.warn("Parent not rendered yet: ",this);else console.warn("Parent not set - no node created for: ",this)}}for(var Zr=function(){var e=Jr[qr];Object.defineProperty(Vr.prototype,e,{get(){var t;return null!==(t=this.lng&&this.lng[e])&&void 0!==t?t:this[`_${e}`]},set(t){this[`_${e}`]=t,this._sendToLightningAnimatable(e,t)}})},qr=0,Jr=["alpha","color","colorTop","colorRight","colorLeft","colorBottom","colorTl","colorTr","colorBl","colorBr","height","fontSize","lineHeight","mount","mountX","mountY","pivot","pivotX","pivotY","rotation","scale","width","worldX","worldY","x","y","zIndex","zIndexLocked"];qr{return t=cn("text"),pn(t,e,!1),t;var t},on=e=>{return t=cn("node"),pn(t,e,!1),t;var t};function sn({createElement:e,createTextNode:t,isTextNode:r,replaceText:n,insertNode:o,removeNode:i,setProperty:s,getParentNode:a,getFirstChild:l,getNextSibling:d}){function h(e,t,r,n){if(void 0===r||n||(n=[]),"function"!=typeof t)return u(e,t,n,r);$t((n=>u(e,t(),n,r)),n)}function u(e,i,s,a,d){for(;"function"==typeof s;)s=s();if(i===s)return s;var h=typeof i,m=void 0!==a;if("string"===h||"number"===h)if("number"===h&&(i=i.toString()),m){var x=s[0];x&&r(x)?n(x,i):x=t(i),s=p(e,s,a,x)}else""!==s&&"string"==typeof s?n(l(e),s=i):(p(e,s,a,t(i)),s=i);else if(null==i||"boolean"===h)s=p(e,s,a);else{if("function"===h)return $t((()=>{for(var t=i();"function"==typeof t;)t=t();s=u(e,t,s,a)})),()=>s;if(Array.isArray(i)){var y=[];if(c(y,i,d))return $t((()=>s=u(e,y,s,a,!0))),()=>s;if(0===y.length){var b=p(e,s,a);if(m)return s=b}else Array.isArray(s)?0===s.length?v(e,y,a):f(e,s,y):null==s||""===s?v(e,y):f(e,m&&s||[l(e)],y);s=y}else{if(Array.isArray(s)){if(m)return s=p(e,s,a,i);p(e,s,null,i)}else null!=s&&""!==s&&l(e)?g(e,i,l(e)):o(e,i);s=i}}return s}function c(e,r,n){for(var o=!1,i=0,s=r.length;im-h)for(var w=t[l];h=0;c--){var f=r[c];if(h!==f){var p=a(f)===e;u||c?p&&i(e,f):p?g(e,h,f):o(e,h,n)}else u=!0}else o(e,h,n);return[h]}function v(e,t,r){for(var n=0,i=t.length;nr.children=u(e,t.children,r.children))),$t((()=>t.ref&&t.ref(e))),$t((()=>{for(var n in t)if("children"!==n&&"ref"!==n){var o=t[n];o!==r[n]&&(s(e,n,o,r[n]),r[n]=o)}})),r}return{render(e,t){var r;return Ht((n=>{r=n,h(t,e())})),r},insert:h,spread(e,t,r){"function"==typeof t?$t((n=>m(e,t(),n,r))):m(e,t,void 0,r)},createElement:e,createTextNode:t,insertNode:o,setProp:(e,t,r,n)=>(s(e,t,r,n),r),mergeProps:Rr,effect:$t,memo:Gt,createComponent:Tr,use:(e,t,r)=>qt((()=>e(t,r)))}}var an={createElement:e=>new Vr(e),createTextNode:e=>({name:"TextNode",text:e,parent:void 0}),replaceText(e,t){Or(0,0),e.text=t;var r=e.parent;C(r),r.text=r.getText()},setProperty(e,t,r=!0){e[t]=r},insertNode(e,t,r){Or(0,0),e.children.insert(t,r),t._queueDelete=!1,t instanceof Vr?e.rendered&&t.render():e.isTextNode()&&(e.text=e.getText())},isTextNode:e=>e.isTextNode(),removeNode(e,t){Or(0,0),e.children.remove(t),t._queueDelete=!0,t instanceof Vr&&queueMicrotask((()=>t.destroy()))},getParentNode:e=>e.parent,getFirstChild:e=>e.children[0],getNextSibling(e){var t=e.parent.children||[],r=t.indexOf(e)+1;if(rr||document});r;){var n=r[t];if(n&&!r.disabled){var o=r[`${t}Data`];if(void 0!==o?n.call(r,o,e):n.call(r,e),e.cancelBubble)return}r=r._$host||r.parentNode||r.host}}var wn;function Sn(){var e=new Set;var t=!1;return{subscribe:function(t){return e.add(t),()=>e.delete(t)},confirm:function(r,n){if(t)return!(t=!1);var o,i={to:r,options:n,defaultPrevented:!1,preventDefault:()=>i.defaultPrevented=!0},s=A(e);try{var a=function(){var e=o.value;e.listener(w(w({},i),{},{from:e.location,retry:o=>{o&&(t=!0),e.navigate(r,w(w({},n),{},{resolve:!1}))}}))};for(s.s();!(o=s.n()).done;)a()}catch(l){s.e(l)}finally{s.f()}return!i.defaultPrevented}}}function An(){window.history.state&&null!=window.history.state._depth||window.history.replaceState(w(w({},window.history.state),{},{_depth:window.history.length-1}),""),wn=window.history.state._depth}An();var Cn=/^(?:[a-z0-9]+:)?\/\//i,Tn=/^\/+|(\/)\/+$/g,_n="http://sr";function kn(e,t=!1){var r=e.replace(Tn,"$1");return r?t||/^[?#]/.test(r)?r:"/"+r:""}function In(e,t,r){if(!Cn.test(t)){var n=kn(e),o=r&&kn(r),i="";return((i=!o||t.startsWith("/")?n:0!==o.toLowerCase().indexOf(n.toLowerCase())?n+o:o)||"/")+kn(t,!i)}}function Bn(e){var t={};return e.searchParams.forEach(((e,r)=>{t[r]=e})),t}function Rn(e,t,r){var n=g(e.split("/*",2),2),o=n[0],i=n[1],s=o.split("/").filter(Boolean),a=s.length;return e=>{var n=e.split("/").filter(Boolean),o=n.length-a;if(o<0||o>0&&void 0===i&&!t)return null;for(var l={path:a?"":"/",params:{}},d=e=>void 0===r?void 0:r[e],h=0;h0===t.localeCompare(e,void 0,{sensitivity:"base"});return void 0===t||("string"==typeof t?r(t):"function"==typeof t?t(e):Array.isArray(t)?t.some(r):t instanceof RegExp&&t.test(e))}function Nn(e){var t=new Map,r=rr();return new Proxy({},{get:(n,o)=>(t.has(o)||nr(r,(()=>t.set(o,Gt((()=>e()[o]))))),t.get(o)()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),ownKeys:()=>Reflect.ownKeys(e())})}function Fn(e){var t=/(\/?\:[^\/]+)\?/.exec(e);if(!t)return[e];for(var r=e.slice(0,t.index),n=e.slice(t.index+t[0].length),o=[r,r+=t[1]];t=/^(\/\:[^\/]+)\?/.exec(n);)o.push(r+=t[1]),n=n.slice(t[0].length);return Fn(n).reduce(((e,t)=>[...e,...o.map((e=>e+t))]),[])}var Ln,zn=ir(),Mn=ir(),Pn=()=>function(e,t){if(null==e)throw new Error(t);return e}(sr(zn)," and 'use' router primitives can be only used inside a Route."),Dn=()=>Pn().navigatorFactory(),On=()=>Pn().params;function Un(e,t=""){var r=e.component,n=e.load,o=e.children,i=e.info,s=!o||Array.isArray(o)&&!o.length,a={key:e,component:r,load:n,info:i};return Yn(e.path).reduce(((r,n)=>{var o,i,l=A(Fn(n));try{for(l.s();!(o=l.n()).done;){var d=o.value,h=(i=d,kn(t).replace(/\/*(\*.*)?$/g,"")+kn(i)),u=s?h:h.split("/*",1)[0];u=u.split("/").map((e=>e.startsWith(":")||e.startsWith("*")?e:encodeURIComponent(e))).join("/"),r.push(w(w({},a),{},{originalPath:d,pattern:u,matcher:Rn(u,!s,e.matchFilters)}))}}catch(c){l.e(c)}finally{l.f()}return r}),[])}function Wn(e,t=0){return{routes:e,score:1e4*(r=e[e.length-1],n=g(r.pattern.split("/*",2),2),o=n[0],i=n[1],s=o.split("/").filter(Boolean),s.reduce(((e,t)=>e+(t.startsWith(":")?2:3)),s.length-(void 0===i?0:1)))-t,matcher(t){for(var r=[],n=e.length-1;n>=0;n--){var o=e[n],i=o.matcher(t);if(!i)return null;r.unshift(w(w({},i),{},{route:o}))}return r}};var r,n,o,i,s}function Yn(e){return Array.isArray(e)?e:[e]}function jn(e,t="",r=[],n=[]){for(var o=Yn(e),i=0,s=o.length;it.score-e.score))}function Hn(e,t){for(var r=0,n=e.length;re),h=l.renderPath||(e=>e),u=l.beforeLeave||Sn(),c=In("",n.base||"");if(void 0===c)throw new Error(`${c} is not a valid base path`);c&&!i().value&&s({value:c,replace:!0,scroll:!1});var f=g(Qt(!1),2),p=f[0],v=f[1],x=function(){var e=y(m().mark((function e(t){return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return v(!0),e.prev=1,e.next=4,or(t);case 4:return e.prev=4,v(!1),e.finish(4);case 7:case"end":return e.stop()}}),e,null,[[1,,4,7]])})));return function(t){return e.apply(this,arguments)}}(),b=g(Qt(i().value),2),S=b[0],A=b[1],C=g(Qt(i().state),2),T=C[0],_=C[1],k=function(e,t){var r=new URL(_n),n=Gt((t=>{var n=e();try{return new URL(n,r)}catch(o){return console.error(`Invalid path ${n}`),t}}),r,{equals:(e,t)=>e.href===t.href}),o=Gt((()=>n().pathname)),i=Gt((()=>n().search),!0),s=Gt((()=>n().hash));return{get pathname(){return o()},get search(){return i()},get hash(){return s()},get state(){return t()},get key(){return""},query:Nn(Jt(i,(()=>Bn(n()))))}}(S,T),I=[],B=Qt([]),R=Gt((()=>Hn(t(),k.pathname))),E=Nn((()=>{for(var e=R(),t={},r=0;rc,outlet:()=>null,resolvePath:e=>In(c,e)};return $t((()=>{var e=i(),t=e.value,r=e.state;qt((()=>{t!==S()&&x((()=>{Ln="native",A(t),_(r),B[1]([])})).then((()=>{Ln=void 0}))}))})),{base:N,location:k,params:E,isRouting:p,renderPath:h,parsePath:d,navigatorFactory:function(e){return e=e||sr(Mn)||N,(t,r)=>function(e,t,r){qt((()=>{if("number"!=typeof t){var n=w({replace:!1,resolve:!0,scroll:!0},r),o=n.replace,i=n.resolve,a=n.scroll,d=n.state,h=i?e.resolvePath(t):In("",t);if(void 0===h)throw new Error(`Path '${t}' is not a routable path`);if(I.length>=100)throw new Error("Too many redirects");var c=S();if((h!==c||d!==T())&&u.confirm(h,r)){var f=I.push({value:c,replace:o,scroll:a,state:T()});x((()=>{Ln="navigate",A(h),_(d),B[1]([])})).then((()=>{var e,t;I.length===f&&(Ln=void 0,e={value:h,state:d},(t=I[0])&&(e.value===t.value&&e.state===t.state||s(w(w({},e),{},{replace:t.replace,scroll:t.scroll})),I.length=0))}))}}else t&&(l.go?l.go(t):console.warn("Router integration does not support relative routing"))}))}(e,t,r)},matches:R,beforeLeave:u,preloadRoute:function(e,n){var o=Hn(t(),e.pathname),i=Ln;Ln="preload";var s=function(){var t=o[a],i=t.route,s=t.params;i.component&&i.component.preload&&i.component.preload();var l=i.load;n&&l&&nr(r(),(()=>l({params:s,location:{pathname:e.pathname,search:e.search,hash:e.hash,query:Bn(e),state:null,key:""},intent:"preload"})))};for(var a in o)s();Ln=i},singleFlight:void 0===n.singleFlight||n.singleFlight,submissions:B}}var Kn=e=>t=>{var r,n=t.base,o=ar((()=>t.children)),i=Gt((()=>jn(o(),t.base||""))),s=Qn(e,i,(()=>r),{base:n,singleFlight:t.singleFlight});return e.create&&e.create(s),un(zn.Provider,{value:s,get children(){return un($n,{routerState:s,get root(){return t.root},get load(){return t.rootLoad},get children(){return[hn((()=>(r=rr())&&null)),un(Xn,{routerState:s,get branches(){return i()}})]}})}})};function $n(e){var t=e.routerState.location,r=e.routerState.params,n=Gt((()=>e.load&&qt((()=>e.load({params:r,location:t,intent:"preload"})))));return un(Fr,{get when(){return e.root},keyed:!0,get fallback(){return e.children},children:o=>un(o,{params:r,location:t,get data(){return n()},get children(){return e.children}})})}function Xn(e){var t,r=[],n=Gt(Jt(e.routerState.matches,((o,i,s)=>{for(var a=i&&o.length===i.length,l=[],d=function(t){var d=i&&i[t],h=o[t];s&&d&&h.route.key===d.route.key?l[t]=s[t]:(a=!1,r[t]&&r[t](),Ht((o=>{r[t]=o,l[t]=function(e,t,r,n){var o=e.base,i=e.location,s=e.params,a=n().route,l=a.pattern,d=a.component,h=a.load,u=Gt((()=>n().path));d&&d.preload&&d.preload();var c=h?h({params:s,location:i,intent:Ln||"initial"}):void 0;return{parent:t,pattern:l,path:u,outlet:()=>d?Tr(d,{params:s,location:i,data:c,get children(){return r()}}):r(),resolvePath:e=>In(o.path(),e,u())}}(e.routerState,l[t-1]||e.routerState.base,Gn((()=>n()[t+1])),(()=>e.routerState.matches()[t]))})))},h=0,u=o.length;he())),s&&a?s:(t=l[0],l)})));return Gn((()=>n()&&t))()}var Gn=e=>()=>un(Fr,{get when(){return e()},keyed:!0,children:e=>un(Mn.Provider,{value:e,get children(){return e.outlet()}})}),Vn=e=>{var t=ar((()=>e.children));return Rr(e,{get children(){return t()}})};function Zn(e,t){var r=function(e){if("#"===e)return null;try{return document.querySelector(e)}catch(t){return null}}(`#${e}`);r?r.scrollIntoView():t&&window.scrollTo(0,0)}var qn=new Map;function Jn(e=!0,t=!1,r="/_server"){return n=>{var o=n.base.path(),i=n.navigatorFactory(n.base),s={};function a(e){if(!(e.defaultPrevented||0!==e.button||e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)){var r=e.composedPath().find((e=>e instanceof Node&&"A"===e.nodeName.toUpperCase()));if(r&&(!t||r.hasAttribute("link"))){var n="http://www.w3.org/2000/svg"===r.namespaceURI,i=n?r.href.baseVal:r.href;if(!(n?r.target.baseVal:r.target)&&(i||r.hasAttribute("state"))){var s=(r.getAttribute("rel")||"").split(/\s+/);if(!(r.hasAttribute("download")||s&&s.includes("external"))){var a=n?new URL(i,document.baseURI):new URL(i);if(!(a.origin!==window.location.origin||o&&a.pathname&&!a.pathname.toLowerCase().startsWith(o.toLowerCase())))return[r,a]}}}}}function l(e){var t=a(e);if(t){var r=g(t,2),o=r[0],s=r[1],l=n.parsePath(s.pathname+s.search+s.hash),d=o.getAttribute("state");e.preventDefault(),i(l,{resolve:!1,replace:o.hasAttribute("replace"),scroll:!o.hasAttribute("noscroll"),state:d&&JSON.parse(d)})}}function d(e){var t=a(e);if(t){var r=g(t,2),o=r[0],i=r[1];s[i.pathname]||n.preloadRoute(i,"false"!==o.getAttribute("preload"))}}function h(e){var t=a(e);if(t){var r=g(t,2),o=r[0],i=r[1];s[i.pathname]||(s[i.pathname]=setTimeout((()=>{n.preloadRoute(i,"false"!==o.getAttribute("preload")),delete s[i.pathname]}),200))}}function u(e){var t=a(e);if(t){var r=g(t,2)[1];s[r.pathname]&&(clearTimeout(s[r.pathname]),delete s[r.pathname])}}function c(e){var t=e.submitter&&e.submitter.hasAttribute("formaction")?e.submitter.getAttribute("formaction"):e.target.getAttribute("action");if(t){if(!t.startsWith("https://action/")){var o=new URL(t,_n);if(!(t=n.parsePath(o.pathname+o.search)).startsWith(r))return}if("POST"!==e.target.method.toUpperCase())throw new Error("Only POST forms are supported for Actions");var i=qn.get(t);if(i){e.preventDefault();var s=new FormData(e.target);e.submitter&&e.submitter.name&&s.append(e.submitter.name,e.submitter.value),i.call({r:n,f:e.target},s)}}}!function(e,t=window.document){for(var r=t[yn]||(t[yn]=new Set),n=0,o=e.length;n{document.removeEventListener("click",l),e&&(document.removeEventListener("mouseover",h),document.removeEventListener("mouseout",u),document.removeEventListener("focusin",d),document.removeEventListener("touchstart",d)),document.removeEventListener("submit",c)}))}}function eo(e){var t=e.replace(/^.*?#/,"");if(!t.startsWith("/")){var r=g(window.location.hash.split("#",2),2)[1];return`${void 0===r?"/":r}#${t}`}return t}function to(e){var t=()=>window.location.hash.slice(1),r=Sn();return function(e){var t=!1,r=e=>"string"==typeof e?{value:e}:e,n=function([e,t],r,n){return[r?()=>r(e()):e,n?e=>t(n(e)):t]}(Qt(r(e.get()),{equals:(e,t)=>e.value===t.value}),void 0,(r=>(!t&&e.set(r),r)));return e.init&&tr(e.init(((o=e.get())=>{t=!0,n[1](r(o)),t=!1}))),Kn({signal:n,create:e.create,utils:e.utils})}({get:t,set({value:e,replace:t,scroll:r,state:n}){t?window.history.replaceState(function(e){return w(w({},e),{},{_depth:window.history.state&&window.history.state._depth})}(n),"","#"+e):window.location.hash=e;var o=e.indexOf("#");Zn(o>=0?e.slice(o+1):"",r),An()},init:e=>{return n=window,o="hashchange",i=function(e,t){var r=!1;return()=>{var n=wn;An();var o=null==n?null:wn-n;r?r=!1:o&&t(o)?(r=!0,window.history.go(-o)):e()}}(e,(e=>!r.confirm(e&&e<0?e:t()))),n.addEventListener(o,i),()=>n.removeEventListener(o,i);var n,o,i},create:Jn(e.preload,e.explicitLinks,e.actionBase),utils:{go:e=>window.history.go(e),renderPath:e=>`#${e}`,parsePath:eo,beforeLeave:r}})(e)}var ro=tr;function no(e,t=rr()){var r,n,o=0;return()=>(o++,tr((()=>{o--,queueMicrotask((()=>{!o&&n&&(n(),n=r=void 0)}))})),n||Ht((t=>r=e(n=t)),t),r)}var oo=no((()=>{var e,t,r,n,o=g(Qt(null),2),i=o[0],s=o[1];return e=window,t="keydown",r=e=>{s(e),setTimeout((()=>s(null)))},e.addEventListener(t,r,n),ro(e.removeEventListener.bind(e,t,r,n)),i}));function io(e){return"function"==typeof e}var so,ao={ArrowLeft:"Left",ArrowRight:"Right",ArrowUp:"Up",ArrowDown:"Down",Enter:"Enter",l:"Last"," ":"Space",Backspace:"Back",Escape:"Escape"},lo=g(Qt([]),2),ho=lo[0],uo=lo[1],co=e=>{var t=oo();if(e)for(var r=function(){var e,t=g(o[n],2),r=t[0],i=t[1];e=i,Array.isArray(e)?i.forEach((e=>{ao[e]=r})):ao[i]=r},n=0,o=Object.entries(e);n{for(var n=e,o=[];n;)n.states.has("focus")||(n.states.add("focus"),io(n.onFocus)&&n.onFocus.call(n,e,t)),o.push(n),n=n.parent;return r.forEach((r=>{o.includes(r)||(r.states.remove("focus"),io(r.onBlur)&&r.onBlur.call(r,e,t))})),uo(o),o}),{defer:!0})),Xt((()=>{var e=t();if(e){var r=ao[e.key]||ao[e.keyCode];qt((()=>{var t,n=void 0,o=A(ho());try{for(o.s();!(t=o.n()).done;){var i=t.value;if(n=n||i,r){var s=i[`on${r}`];if(io(s)&&!0===s.call(i,e,i,n))break}else console.log(`Unhandled key event: ${e.key}`);if(io(i.onKeyPress)&&!0===i.onKeyPress.call(i,e,r,i,n))break}}catch(a){o.e(a)}finally{o.f()}return!1}))}})),ho};function fo(e,t){var r,n,o,i,s=t();if(Array.isArray(s))if(2===s.length)r=i=s[0],n=o=s[1];else if(3===s.length)r=s[0],n=o=s[1],i=s[2];else{var a=g(s,4);r=a[0],o=a[1],i=a[2],n=a[3]}else r=o=i=n=s;e.onBeforeLayout=(t,s)=>{if(s){e.width=e.children.reduce(((e,t)=>e+(t.width||0)),0)+n+o;var a=e.children[0];a&&(a.x=n,a.marginLeft=n);var l=0;e.children.forEach((e=>{e.y=r,e.marginTop=r,l=Math.max(l,e.height||0)})),e.height=l+r+i}}}function po(e){return new Promise((t=>{setTimeout(t,e)}))}function vo(e,t,r="en-US"){var n=window.speechSynthesis;return new Promise(((o,i)=>{var s=new SpeechSynthesisUtterance(e);s.lang=r,s.onend=()=>{o()},s.onerror=e=>{i(e)},t.push(s),n.speak(s)}))}function go(e,t,r=!0){var n=window.speechSynthesis,o=function(e=[]){var t,r=[];for(t=0;t0)){e.next=46;break}return e.prev=20,e.next=23,vo(r,s,t);case 23:d=0,e.next=44;break;case 26:if(e.prev=26,e.t0=e.catch(20),!(e.t0 instanceof SpeechSynthesisErrorEvent)){e.next=43;break}if("network"!==e.t0.error){e.next=36;break}return d--,console.warn(`Speech synthesis network error. Retries left: ${d}`),e.next=34,po(500*(l-d));case 34:e.next=41;break;case 36:if("canceled"!==e.t0.error&&"interrupted"!==e.t0.error){e.next=40;break}d=0,e.next=41;break;case 40:throw new Error(`SpeechSynthesisErrorEvent: ${e.t0.error}`);case 41:e.next=44;break;case 43:throw e.t0;case 44:e.next=19;break;case 46:e.next=60;break;case 48:if("function"!=typeof r){e.next=55;break}return h=go(r(),t,!1),i.push(h),e.next=53,h.series;case 53:e.next=60;break;case 55:if(!Array.isArray(r)){e.next=60;break}return u=go(r,t,!1),i.push(u),e.next=60,u.series;case 60:e.next=1;break;case 62:return e.prev=62,a=!1,e.finish(62);case 65:case"end":return e.stop()}}),e,null,[[0,,62,65],[20,26]])})))(),get active(){return a},append:e=>{o.push(e)},cancel:()=>{a&&(r&&n.cancel(),i.forEach((e=>{e.cancel()})),a=!1)}}}function mo(e,t="en-US"){return so&&so.cancel(),so=go(e,t)}var xo,yo,bo=(e,t)=>{var r,n=()=>clearTimeout(r);rr()&&tr(n);return Object.assign(((...o)=>{void 0!==r&&n(),r=setTimeout((()=>e(...o)),t)}),{clear:n})},wo=[],So=!1;function Ao(e,t){var r,n=bo(e,t),o=e=>{r=e,n(e)};return o.flush=()=>{n.clear(),e(r)},o.clear=n.clear,o}function Co(e){return e.id||e.name}function To(e=[]){if(_o.onFocusChange&&_o.enabled){var t=e.every((e=>!e.loading)),r=e.filter((e=>!wo.includes(e)));if(xo(),t||!_o.onFocusChange){wo=e.slice(0);var n=[],o=r.reduce(((e,t)=>(t.announce?(e.push([Co(t),"Announce",t.announce]),n.push(t.announce)):t.title?(e.push([Co(t),"Title",t.title]),n.push(t.title)):e.push([Co(t),"No Announce",""]),e)),[]);return r.reverse().reduce(((e,t)=>(t.announceContext?(e.push([Co(t),"Context",t.announceContext]),n.push(t.announceContext)):e.push([Co(t),"No Context",""]),e)),o),_o.debug&&console.table(o),n.length?_o.speak(n.reduce(((e,t)=>e.concat(t)),[])):void 0}_o.onFocusChange([])}}var _o={debug:!1,enabled:!0,cancel:function(){yo&&yo.cancel()},clearPrevFocus:function(e=0){wo=wo.slice(0,e),xo()},speak:function(e,{append:t=!1,notification:r=!1}={}){var n;_o.onFocusChange&&_o.enabled&&(_o.onFocusChange.flush(),t&&yo&&yo.active?yo.append(e):(_o.cancel(),function(e){if(!So)yo=mo(e)}(e)),r&&(So=!0,null===(n=yo)||void 0===n||n.series.finally((()=>{So=!1,_o.refresh()})).catch(console.error)));return yo},refresh:function(e=0){_o.clearPrevFocus(e),_o.onFocusChange&&_o.onFocusChange(qt((()=>ho())))},setupTimers:function({focusDebounce:e=400,focusChangeTimeout:t=3e5}={}){_o.onFocusChange=Ao(To,e),xo=Ao((()=>{wo=[]}),t)}};var ko,Io,Bo,Ro,Eo,No,Fo,Lo,zo,Mo,Po,Do,Oo,Uo,Wo,Yo,jo=g(Qt(""),2),Ho=jo[0],Qo=jo[1],Ko={name:"Base Lightning TV",alpha:{primary:1,secondary:.7,tertiary:.1,inactive:.5,full:1,none:0,alpha1:.1,alpha2:.3,alpha3:.5,alpha4:.7,alpha5:.9},animation:{duration:{none:0,xfast:.1,fast:.25,normal:.5,slow:.75,xslow:.9},delay:{none:0,xfast:.01,fast:.025,normal:.05,slow:.075,xslow:.09},expressive:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},expressiveEntrance:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},expressiveExit:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},standard:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},standardEntrance:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},standardExit:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},utility:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},utilityEntrance:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},utilityExit:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25}},asset:{arrowLeft:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAi0lEQVRIDWNgGAWjIfD//38JID5Fk5AAGqwKxPeA+D/VLQCaaQLEr0CGgwBVLQCa5wbEn0EGwwDVLAAaGA3Ev2AGw2iqWAA0rBiI/8EMRaYptgBoWDeygehsci1gIlcjWfqArqZdEMFcBLSEdpGMZAntkimSJbTLaEiW0K6oQLKEdoUdzJJRemiHAAD4n+yzPWCs7QAAAABJRU5ErkJggg==",arrowRight:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAg0lEQVRIDWNgGAWjIYArBP7//38KiCVwyVMsDjQcBO4BsSrFhmEzAGw8hHgFpEywqaFIDMkCEPMzELtRZCC6ZjQLQNxfQByNro5sPhYLQEL/gLiYbEORNeKwACbcDVPLBGMMOhrmVDSapkFE00imaTKlaUajaVFB28Ju0CXrU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SRtu0+v1DRABaKPADijV+3SaZUCNgE5geTNEZnmAFBtkDGix6b4Xld2BNvJcaHUPEClF6oNMoZE2eXOtm3q1ZFha1mfWQBUINoL4Kqurbm7vPEj1bOAqx3udW0kk62+swGoQHQ2gPOGFGAD8roJgF0t+qkx6jorgApElwE4aQwxZp6n3YNxsPyzA7yst/4iSdvEMFqaHUCjKZEZ91IgAeolWzotFEiAkoWQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC",check:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAOCAYAAAAi2ky3AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACtSURBVHgBvdPdDcIgEAfwoy8Nb45QN3AGF2s36Ahu4gpuIDoBfSgfpdoTlCbEWEMh6T8hFzjyg5AAkBHOcQe5UWqspRx435sDpMYj6IYQwwVSEiJ2MKVUBWuzLSLl2HL+uxmNCGFO8yaL7RHxve6qRZoAuS4hxac8735elWVx7jrtMKL1o0Gcat9jhExHSukN/kUIFZ7MpDRtzE1isDRkAUtDvrA8ZI597FUf8gWH9P0b4gko9wAAAABJRU5ErkJggg=="},color:{palette:{"blue-20":"0xbecffeff","blue-40":"0x93a9fdff","blue-90":"0x000033ff","grey-05":"0xf8f7faff","grey-40":"0x929096ff","grey-70":"0x48474bff","grey-90":"0x181819ff"},white:"0xffffffff",black:"0x000000ff",grey:"0x929096ff",red:"0xe74c3cff",orange:"0xdc7633ff",yellow:"0xf7dc6fff",green:"0x2ecc71ff",blue:"0x93a9fdff",purple:"0x663399ff",material:"0x181819ff",materialBrand:"0x000033ff",overlay:"0x181819b3",textNeutral:"0xf8f7faff",textNeutralSecondary:"0xf8f7fab3",textNeutralTertiary:"0xf8f7fa1a",textNeutralDisabled:"0xf8f7fa80",textInverse:"0x181819ff",textInverseSecondary:"0x181819b3",textInverseTertiary:"0x1818191a",textInverseDisabled:"0x18181980",textBrand:"0x93a9fdff",textBrandSecondary:"0x93a9fdb3",textBrandTertiary:"0x93a9fd1a",textBrandDisabled:"0x93a9fd80",textPositive:"0x2ecc71ff",textNegative:"0xe74c3cff",textInfo:"0x93a9fdff",textCaution:"0xdc7633ff",fillTransparent:"0xffffff0",fillNeutral:"0xf8f7faff",fillNeutralSecondary:"0xf8f7fab3",fillNeutralTertiary:"0xf8f7fa1a",fillNeutralDisabled:"0xf8f7fa80",fillInverse:"0x181819ff",fillInverseSecondary:"0x181819b3",fillInverseTertiary:"0x1818191a",fillInverseDisabled:"0x18181980",fillBrand:"0x93a9fdff",fillBrandSecondary:"0x93a9fdb3",fillBrandTertiary:"0x93a9fd1a",fillBrandDisabled:"0x93a9fd80",fillPositive:"0x2ecc71ff",fillNegative:"0xe74c3cff",fillInfo:"0x93a9fdff",fillCaution:"0xdc7633ff",strokeNeutral:"0xf8f7faff",strokeNeutralSecondary:"0xf8f7fab3",strokeNeutralTertiary:"0xf8f7fa1a",strokeNeutralDisabled:"0xf8f7fa80",strokeInverse:"0x181819ff",strokeInverseSecondary:"0x181819b3",strokeInverseTertiary:"0x1818191a",strokeInverseDisabled:"0x18181980",strokeBrand:"0x93a9fdff",strokeBrandSecondary:"0x93a9fdb3",strokeBrandTertiary:"0x93a9fd1a",strokeBrandDisabled:"0x93a9fd80",strokePositive:"0x2ecc71ff",strokeNegative:"0xe74c3cff",strokeInfo:"0x93a9fdff",strokeCaution:"0xdc7633ff",interactiveNeutral:"0xffffff1a",interactiveNeutralFocus:"0xffffffff",interactiveNeutralFocusSoft:"0xffffff1a",interactiveInverse:"0x48474b1a",interactiveInverseFocus:"0x48474bff",interactiveInverseFocusSoft:"0x48474b1a",interactiveBrand:"0xbecffe1a",interactiveBrandFocus:"0xbecffeff",interactiveBrandFocusSoft:"0xbecffe1a",shadowNeutral:"0x000000b3",shadowNeutralFocus:"0x000000b3",shadowNeutralFocusSoft:"0x000000b3",shadowNeutralText:"0x000000ff",shadowInverse:"0x000000b3",shadowInverseFocus:"0x000000b3",shadowInverseFocusSoft:"0x000000b3",shadowInverseText:"0x000000ff",shadowBrand:"0x000000b3",shadowBrandFocus:"0x000000b3",shadowBrandFocusSoft:"0x000000b3",shadowBrandText:"0x000000ff"},font:[],layout:{columnCount:10,focusScale:1.2,gutterX:20,gutterY:20,marginX:150,marginY:150,safe:50,screenW:1920,screenH:1080},radius:{none:0,xs:2,sm:4,md:8,lg:16,xl:24},spacer:{none:0,xxs:2,xs:4,sm:8,md:10,lg:20,xl:30,xxl:40,xxxl:50},stroke:{none:0,sm:2,md:4,lg:6,xl:8},typography:{display1:{fontFamily:"Arial",fontSize:75,lineHeight:85,fontWeight:500,verticalAlign:"middle",textBaseline:"bottom"},display2:{fontFamily:"Arial",fontSize:50,lineHeight:60,fontWeight:500,verticalAlign:"middle",textBaseline:"bottom"},headline1:{fontFamily:"Arial",fontSize:35,fontWeight:500,lineHeight:48,verticalAlign:"middle",textBaseline:"bottom"},headline2:{fontFamily:"Arial",fontSize:30,fontWeight:500,lineHeight:40,verticalAlign:"middle",textBaseline:"bottom"},headline3:{fontFamily:"Arial",fontSize:25,fontWeight:500,lineHeight:36,verticalAlign:"middle",textBaseline:"bottom"},body1:{fontFamily:"Arial",fontSize:25,fontWeight:300,lineHeight:40,verticalAlign:"middle",textBaseline:"bottom"},body2:{fontFamily:"Arial",fontSize:22,fontWeight:300,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},body3:{fontFamily:"Arial",fontSize:20,fontWeight:300,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},button1:{fontFamily:"Arial",fontSize:25,fontWeight:500,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},button2:{fontFamily:"Arial",fontSize:20,fontWeight:500,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},callout1:{fontFamily:"Arial",fontSize:20,fontWeight:500,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},caption1:{fontFamily:"Arial",fontSize:15,fontWeight:500,lineHeight:24,verticalAlign:"middle",textBaseline:"bottom"},tag1:{fontFamily:"Arial",fontSize:20,fontWeight:500,lineHeight:24,verticalAlign:"middle",textBaseline:"bottom"},footnote1:{fontFamily:"Arial",fontSize:22,fontWeight:300,lineHeight:30,verticalAlign:"middle",textBaseline:"bottom"}},componentConfig:{Keyboard:{base:{keyProps:{delete:{title:null,icon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGohMqUBAAQZ80zUVQAKUEIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypfPsAJJ0NYC92XRHKPB3AAfLv18BuBLAFSR/NKZWswJI0vkA3jCmILsw75sAvIfkR8eo22wAknQSgMvGEGFD8vwxgFeQvGrI+s4CIEnHAPgugHsMWfkNzevDAM4i+Z8h6t88QJLuXOB5yBAVzjxuVeBaAM8ieXNUjzkAdAmA50Yrmv5HKPATACeQ/GNEm6YBkvRyANblZhpHAXsfekpkOGsWIEmPAHA9gDuOo13mWhS4gOSZfdVoEiBJ9wFwA4D7961Y+lUpsK/v7KxVgL4K4ElOCS4l+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BLSHqvX781q1YAqg0yfoDkq5psrQYLJeldAF7nKFr1x+wmACq9kAUZLazvvTV4P8kDDlE22kTSQ4uuK9dCF5HuR/I3NYI1A1CBaB+AK50VsAMj7TJeixNl2kYBSccCsB/ZMQ6Brif5GIfdYSZNAVQg8rzsLSphl/Hapby2LDZTUaBcq/56ALb1fOVxLkuinULy4loRmwOoQGQX7T7DWZnPk3y203bXmkl6AIA91isDOBGADV3e1HsJbasA1QYZvUKl3fYKPI2knXFQnZoEqPRCNUHG6oqnwyEFLiJ5Wl89mgWoQFQTZOyrwSb7WUztcSRtu0+v1DRABaKPADijV+3SaZUCNgE5geTNEZnmAFBtkDGix6b4Xld2BNvJcaHUPEClF6oNMoZE2eXOtm3q1ZFha1mfWQBUINoL4Kqurbm7vPEj1bOAqx3udW0kk62+swGoQHQ2gPOGFGAD8roJgF0t+qkx6jorgApElwE4aQwxZp6n3YNxsPyzA7yst/4iSdvEMFqaHUCjKZEZ91IgAeolWzotFEiAkoWQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC"}}}}}};function $o(){var e,t,r,n=0,o={duration:750,easing:"ease-in-out"},i={alpha:1,color:4294967295};var s=bo((function(i){return i.startsWith("#")?(e.color=xn(i),e.src="",e.alpha=1,n=1,t.alpha=0,void(r.alpha=0)):(e.color=4294967295,r.alpha=1,0===n?(e.src=i,void(n=1)):1===n?(t.src=i,n=2,t.alpha=0,t.animate({alpha:1},o).start(),void e.animate({alpha:0},o).start()):void(2===n&&(e.src=i,n=1,e.alpha=0,e.animate({alpha:1},o).start(),t.animate({alpha:0},o).start())))}),400);return Xt(Jt(Ho,(e=>{s(e)}),{defer:!0})),un(on,{width:1920,height:1080,zIndex:-5,get children(){return[un(on,{ref(t){"function"==typeof e?e(t):e=t},style:i}),un(on,{ref(e){"function"==typeof t?t(e):t=e},style:i,alpha:0}),un(on,{ref(e){"function"==typeof r?r(e):r=e},src:"./assets/hero-mask-inverted.png",get color(){return xn(Ko.color.materialBrand)},width:1920,height:1080})]}})}var Xo=["focus","disabled"],Go=["brand","inverse","neutral"];function Vo({themeKeys:e,base:t,modes:r,tones:n,themeStyles:o,modeKeys:i=Xo,toneKeys:s=Go},a=!1){var l=t=>Object.fromEntries(Object.entries(e).filter((([e,r])=>t[r])).map((([e,r])=>[e,t[r]])));return((e,t,r)=>{var n,d=(n=o,Object.fromEntries(Object.entries(n).map((([e,t])=>{var r=l(t);return Object.entries(t).filter((([e,t])=>i.includes(e))).forEach((([e,t])=>{r[e]=l(t)})),[e,r]}))));a&&console.log(d);var h=((e,t)=>w(w({},e),t.base))(e,d);a&&console.log(h);var u=((e,t)=>{var r=i.map((r=>[r,w(w({},null==e?void 0:e[r]),null==t?void 0:t[r])]));return Object.fromEntries(r)})(t,d);a&&console.log(u);var c=((e,t,r)=>{var n=s.map((n=>{var o,s,a={};return new Set([].concat.apply([],[null!==(o=null==e?void 0:e[n])&&void 0!==o?o:{},null!==(s=null==t?void 0:t[n])&&void 0!==s?s:{}].map(Object.keys))).forEach((r=>{var o,s,l;i.includes(r)||(a[r]=null!==(l=null==(o=null==t?void 0:t[n])?void 0:o[r])&&void 0!==l?l:null==(s=null==e?void 0:e[n])?void 0:s[r])})),i.forEach((o=>{var i,s;a[o]=w(w(w({},r[o]),null==(i=null==e?void 0:e[n])?void 0:i[o]),null==(s=null==t?void 0:t[n])?void 0:s[o])})),[n,a]}));return Object.fromEntries(n)})(r,d,u);return a&&console.log(c),{base:w(w({},h),u),tones:c}})(t,r,n)}function Zo(e=0){return(t,r,n,o)=>{if(0!==t.children.length){var i=t.gap||0,s=t.scroll||"auto",a=function(e){var t,r;"row"===e.flexDirection?(t={position:e.children[e.children.length-1].x,size:e.children[e.children.length-1].width},r=e.width):(t={position:e.children[e.children.length-1].y,size:e.children[e.children.length-1].height},r=e.height);return[t,r]}(t),l=g(a,2),d=l[0],h=l[1],u="row"===t.flexDirection?t.x:t.y,c="row"===t.flexDirection?r.x:r.y,f="row"===t.flexDirection?r.width:r.height,p=n>o?"positive":"negative",v=u;"auto"===s?null!=t.scrollIndex&&t.scrollIndex>=0?t.selected>=t.scrollIndex&&(v="positive"===p?u-f-i:u+f+i):(Math.abs(u)+hc?v=-c+e:"edge"===s&&"positive"===p&&Math.abs(u)+h{var t=e.filter((e=>"function"==typeof e));if(0!==t.length)return function(...e){var r,n=A(t);try{for(n.s();!(r=n.n()).done;){if(!0===r.value.apply(this,e))return!0}}catch(o){n.e(o)}finally{n.f()}}};function Jo(){if(!this||void 0===this.selected||0===this.children.length)return!1;for(var e=this.children[this.selected];null==e?void 0:e.skipFocus;)this.selected++,e=this.children[this.selected];if(!(e instanceof Vr))return!1;e.setFocus()}function ei(e){return function(){var t,r,n=this.children.length,o=this.wrap,i=this.selected||0;if(0===n)return!1;if("right"===e||"down"===e){do{if(this.selected=(this.selected||0)%n+1,this.selected>=n){if(!o){this.selected=void 0;break}this.selected=0}}while(null==(t=this.children[this.selected])?void 0:t.skipFocus)}else if("left"===e||"up"===e)do{if(this.selected=(this.selected||0)%n-1,this.selected<0){if(!o){this.selected=void 0;break}this.selected=n-1}}while(null==(r=this.children[this.selected])?void 0:r.skipFocus);if(void 0===this.selected&&(this.selected=i,this.children[this.selected].states.has("focus")))return!1;var s=this.children[this.selected];if(this.onSelectedChanged&&this.onSelectedChanged.call(this,this,s,this.selected,i),this.plinko&&void 0!==i){var a=this.children[i].selected||0;s.selected=a{var t=ei("up"),r=ei("down");return un(on,gn(e,{get onUp(){return qo(e.onUp,t)},get onDown(){return qo(e.onDown,r)},get selected(){return e.selected||0},forwardFocus:Jo,get onSelectedChanged(){return qo(e.onSelectedChanged,"none"!==e.scroll?Zo(e.y):void 0)},get style(){var t;return[...[e.style].flat(),Ri.Container.tones[null!==(t=e.tone)&&void 0!==t?t:Ri.tone],Ri.Container.base]}}))},Ni=(null==(Fo=Ko)?void 0:Fo.componentConfig).Label,Fi=void 0===Ni?{styles:{}}:Ni,Li=(Fi.defaultTone,v(Fi,s)),zi={themeKeys:{color:"backgroundColor",borderRadius:"radius"},base:{display:"flex",justifyContent:"center",color:Ko.color.textNeutral,padding:[Ko.spacer.md,Ko.spacer.lg],borderRadius:[Ko.radius.md,Ko.radius.md,Ko.radius.md,Ko.radius.none],height:Ko.typography.caption1.lineHeight+Ko.spacer.md,neutral:{backgroundColor:Ko.color.fillNeutral}},tones:{inverse:{color:Ko.color.fillInverse},brand:{color:Ko.color.fillBrand,focus:{color:Ko.color.orange}}},themeStyles:Li},Mi={themeKeys:{color:"textColor"},base:w(w({},Ko.typography.caption1),{},{color:Ko.color.textInverse}),tones:{inverse:{color:Ko.color.textNeutral},brand:{color:Ko.color.textNeutral}},themeStyles:Li};Vo(zi),Vo(Mi);var Pi=(null==(Lo=Ko)?void 0:Lo.componentConfig).Rating,Di=void 0===Pi?{styles:{},defaultTone:"neutral"}:Pi,Oi=Di.styles,Ui=(Di.defaultTone,{themeKeys:{justifyContent:"justifyContent",itemSpacing:"itemSpacing"},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",itemSpacing:Ko.spacer.sm},toneModes:{},themeStyles:Oi}),Wi={themeKeys:{color:"textColor"},base:w({color:Ko.color.textNeutral},Ko.typography.body2),toneModes:{},themeStyles:Oi},Yi={themeKeys:{color:"color"},base:{height:Ko.typography.body2.lineHeight,width:Ko.typography.body2.lineHeight,color:Ko.color.fillNeutral,marginRight:Ko.spacer.sm},toneModes:{},themeStyles:Oi};Vo(Ui),Vo(Yi),Vo(Wi);var ji=(null==(zo=Ko)?void 0:zo.componentConfig).Details,Hi=void 0===ji?{styles:{}}:ji,Qi=(Hi.defaultTone,v(Hi,a)),Ki={themeKeys:{alignItems:"alignItems",contentSpacing:"contentSpacing",badgeContentSpacing:"badgeContentSpacing",ratingContentSpacing:"ratingContentSpacing"},base:{display:"flex",flexDirection:"row",alignItems:"center",contentSpacing:Ko.spacer.lg,badgeContentSpacing:Ko.spacer.sm,ratingContentSpacing:Ko.spacer.lg},themeStyles:Qi},$i={themeKeys:{color:"textColor"},base:w(w({},Ko.typography.body2),{},{marginRight:Ko.spacer.lg,color:Ko.color.textNeutral}),tones:{neutral:{disabled:{color:Ko.color.textNeutralDisabled}},inverse:{color:Ko.color.textInverse,disabled:{color:Ko.color.textNeutralDisabled}},brand:{color:Ko.color.textNeutral,disabled:{color:Ko.color.textNeutralDisabled}}},themeStyles:Qi};Vo(Ki),Vo($i);var Xi=(null==(Mo=Ko)?void 0:Mo.componentConfig).Metadata,Gi=void 0===Xi?{styles:{}}:Xi,Vi=(Gi.defaultTone,v(Gi,l)),Zi={themeKeys:{justifyContent:"justifyContent",alpha:"alpha"},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",alpha:Ko.alpha.primary},modes:{disabled:{alpha:Ko.alpha.inactive}},themeStyles:Vi},qi={themeKeys:{color:"textColor"},base:w(w({maxLines:1,contain:"width"},Ko.typography.headline3),{},{color:Ko.color.textNeutral}),tones:{neutral:{disabled:{color:Ko.color.textNeutralDisabled}},inverse:{color:Ko.color.textInverse,disabled:{color:Ko.color.textNeutralDisabled}},brand:{color:Ko.color.textNeutral,disabled:{color:Ko.color.textNeutralDisabled}}},themeStyles:Vi},Ji={themeKeys:{color:"textColor"},base:w(w({contain:"width",maxLines:2},Ko.typography.body2),{},{color:Ko.color.textNeutralSecondary}),tones:{neutral:{disabled:{color:Ko.color.textNeutralDisabled}},inverse:{color:Ko.color.textInverseSecondary,disabled:{color:Ko.color.textNeutralDisabled}},brand:{color:Ko.color.textNeutralSecondary,disabled:{color:Ko.color.textNeutralDisabled}}},themeStyles:Vi};Vo(Zi),Vo(Ji),Vo(qi);var es=(null==(Po=Ko)?void 0:Po.componentConfig).ProgressBar,ts=void 0===es?{styles:{}}:es,rs=(ts.defaultTone,v(ts,d)),ns={themeKeys:{color:"barColor",borderRadius:"borderRadius"},base:{height:Ko.spacer.md,color:Ko.color.fillNeutralTertiary,borderRadius:Ko.radius.xs},tones:{inverse:{color:Ko.color.fillInverseTertiary}},themeStyles:rs},os={themeKeys:{color:"progressColor",borderRadius:"borderRadius"},base:{borderRadius:Ko.radius.xs,color:Ko.color.fillNeutral},tones:{inverse:{color:Ko.color.fillInverse},brand:{color:Ko.color.fillBrand}},themeStyles:rs};Vo(ns),Vo(os);var is=(null==(Do=Ko)?void 0:Do.componentConfig).Row,ss=void 0===is?{styles:{}}:is,as=ss.defaultTone,ls=v(ss,h),ds={tone:as,Container:Vo({themeKeys:{gap:"itemSpacing",scrollIndex:"scrollIndex",itemTransition:"itemTransition"},base:{display:"flex",justifyContent:"flexStart",flexDirection:"row",gap:Ko.layout.gutterX,width:Ko.layout.screenW,itemTransition:w(w({},Ko.animation.standardEntrance),{},{duration:Ko.animation.duration.fast})},themeStyles:ls})},hs=e=>{var t=ei("left"),r=ei("right");return un(on,gn(e,{get selected(){return e.selected||0},get onLeft(){return qo(e.onLeft,t)},get onRight(){return qo(e.onRight,r)},forwardFocus:Jo,get onSelectedChanged(){return qo(e.onSelectedChanged,"none"!==e.scroll?Zo(e.x):void 0)},get tone(){var t;return null!==(t=e.tone)&&void 0!==t?t:ds.tone},get style(){return[...[e.style].flat(),ds.Container.tones[e.tone||ds.tone],ds.Container.base]},get states(){var t;return null!==(t=e.tone)&&void 0!==t?t:ds.tone}}))},us=(null==(Oo=Ko)?void 0:Oo.componentConfig).Keyboard,cs=void 0===us?{styles:{}}:us,fs=(cs.defaultTone,v(cs,u)),ps={themeKeys:{keySpacing:"keySpacing",screenW:"screenW",marginX:"marginX"},base:{keySpacing:Ko.spacer.md,screenW:Ko.layout.screenW,marginX:Ko.layout.marginX,height:100},themeStyles:fs},vs={themeKeys:{keySpacing:"keySpacing",textAlign:"textAlign",borderRadius:"borderRadius",color:"backgroundColor",justifyContent:"justifyContent",baseWidth:"baseWidth",sizes:"sizes",contentColor:"contentColor"},base:{keySpacing:Ko.spacer.md,height:9*Ko.spacer.md,paddingX:Ko.spacer.md,sizes:{sm:1,md:2,lg:3,xl:4,xxl:5},contentColor:Ko.color.fillNeutral,padding:[Ko.spacer.xxxl,Ko.spacer.xl],baseWidth:7*Ko.spacer.md,color:Ko.color.interactiveNeutral,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:Ko.radius.sm},modes:{focus:{color:Ko.color.interactiveNeutralFocus,contentColor:Ko.color.fillInverse},disabled:{color:Ko.color.fillNeutralDisabled,contentColor:Ko.color.fillNeutralDisabled}},tones:{inverse:{color:Ko.color.interactiveInverse,focus:{color:Ko.color.interactiveInverseFocus,contentColor:Ko.color.fillNeutral}},brand:{focus:{contentColor:Ko.color.fillNeutral}}},themeStyles:fs},gs={themeKeys:{color:"textColor"},base:w({textAlign:"left",color:Ko.color.textNeutral},Ko.typography.headline2),modes:{focus:{color:Ko.color.textInverse},disabled:{color:Ko.color.textNeutralDisabled}},tones:{inverse:{focus:{color:Ko.color.textNeutral}}},themeStyles:fs};Vo(ps),Vo(vs),Vo(gs);var ms=(null==(Uo=Ko)?void 0:Uo.componentConfig).Key,xs=void 0===ms?{styles:{}}:ms,ys=(xs.defaultTone,v(xs,c)),bs={themeKeys:{keySpacing:"keySpacing",textAlign:"textAlign",borderRadius:"borderRadius",color:"backgroundColor",justifyContent:"justifyContent",baseWidth:"baseWidth",sizes:"sizes",contentColor:"contentColor"},base:{keySpacing:Ko.spacer.md,height:9*Ko.spacer.md,paddingX:Ko.spacer.md,contentColor:Ko.color.fillNeutral,sizes:{sm:1,md:2,lg:3,xl:4,xxl:5},padding:[Ko.spacer.xxxl,Ko.spacer.xl],baseWidth:7*Ko.spacer.md,color:Ko.color.interactiveNeutral,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:Ko.radius.sm},modes:{focus:{color:Ko.color.interactiveNeutralFocus,contentColor:Ko.color.fillInverse},disabled:{color:Ko.color.fillNeutralDisabled,contentColor:Ko.color.fillNeutralDisabled}},tones:{inverse:{color:Ko.color.interactiveInverse,focus:{color:Ko.color.interactiveInverseFocus,contentColor:Ko.color.fillNeutral}},brand:{focus:{contentColor:Ko.color.fillNeutral}}},themeStyles:ys},ws={themeKeys:{color:"textColor"},base:w({textAlign:"left",color:Ko.color.textNeutral},Ko.typography.headline2),modes:{focus:{color:Ko.color.textInverse},disabled:{color:Ko.color.textNeutralDisabled}},tones:{inverse:{focus:{color:Ko.color.textNeutral}}},themeStyles:ys};Vo(bs),Vo(ws);var Ss=(null==(Wo=Ko)?void 0:Wo.componentConfig).Tile,As=void 0===Ss?{styles:{}}:Ss,Cs=(As.defaultTone,v(As,f)),Ts=(null==(Yo=Ko)?void 0:Yo.componentConfig).Surface,_s=void 0===Ts?{styles:{}}:Ts,ks=(_s.defaultSurfaceTone,v(_s,p)),Is={themeKeys:{alpha:"alpha",paddingYProgress:"paddingYProgress"},base:{width:400,height:240,padding:[40,10],paddingYProgress:Ko.spacer.xl,paddingYBetweenContent:Ko.spacer.md,borderRadius:Ko.radius.md,alpha:Ko.alpha.primary},modes:{disabled:{alpha:Ko.alpha.inactive}},themeStyles:w(w({},ks),Cs)},Bs={themeKeys:{},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart",mountY:1},themeStyles:Cs},Rs={themeKeys:{},base:{display:"flex",flexDirection:"column",justifyContent:"flexStart"},themeStyles:Cs},Es={themeKeys:{},base:{width:5*Ko.spacer.lg,height:Ko.spacer.xxl+Ko.spacer.md},themeStyles:Cs};Vo(Is),Vo(Bs),Vo(Rs),Vo(Es);var Ns={Column:{flexDirection:"column",display:"flex",width:320,height:600,y:360,gap:20,zIndex:101,transition:{x:{duration:250,easing:"ease-in-out"}},x:8,focus:{x:Ko.layout.marginX}},Gradient:{zIndex:99,color:xn("#000000"),src:"./assets/sidenav.png",alpha:0,width:1200,height:1080,focus:{alpha:1},transition:{alpha:!0}},NavButton:{zIndex:102,height:70,width:100,borderRadius:8,focus:{color:xn("#424242")},active:{width:328,height:70}}},Fs="/solid-demo-app/",Ls=[{name:"experiment",width:81,height:100,x:0,y:0},{name:"trending",width:100,height:56,x:81,y:0},{name:"tv",width:100,height:68,x:181,y:0},{name:"movie",width:94,height:100,x:282,y:0}];function zs(e){var t,r,n,o=(t=Fs+"assets/icons_white.png",r=Ls,n=Lr.createTexture("ImageTexture",{src:t}),r.reduce(((e,t)=>{var r=t.x,o=t.y,i=t.width,s=t.height;return e[t.name]=Lr.createTexture("SubTexture",{texture:n,x:r,y:o,width:i,height:s}),e}),{}));return un(on,gn(e,{get texture(){return o[e.name]},get width(){return o[e.name].props.width},get height(){return o[e.name].props.height},get x(){return(100-(o[e.name].props.width||0))/2},get y(){return(100-(o[e.name].props.height||0))/2}}))}function Ms(e){return un(on,gn(e,{forwardStates:!0,get style(){return Ns.NavButton},get children(){return[un(on,{y:-16,get children(){return un(zs,{scale:.5,get name(){return e.icon}})}}),un(nn,{get style(){return w(w({},Ko.typography.button1),{},{fontSize:38,x:116,y:24,height:50,alpha:0,active:{alpha:1}})},get children(){return e.children}})]}}))}function Ps(e){var t,r=Dn();return[un(Ei,gn(e,{onFocus:function(){t.states.add("focus"),this.children.forEach((e=>e.states.add("active"))),this.children.selected.setFocus()},onBlur:function(){t.states.remove("focus"),this.selected=0,this.children.forEach((e=>e.states.remove("active")))},get style(){return Ns.Column},scroll:"none",get children(){return[un(Ms,{onEnter:()=>r("/browse/all"),icon:"trending",children:"Trending"}),un(Ms,{icon:"movie",onEnter:()=>r("/browse/movie"),children:"Movies"}),un(Ms,{icon:"tv",onEnter:()=>r("/browse/tv"),children:"TV"}),un(Ms,{icon:"experiment",onEnter:()=>r("/examples"),children:"Examples"})]}})),un(on,{ref(e){"function"==typeof t?t(e):t=e},get style(){return Ns.Gradient}})]}var Ds={color:255,height:90,width:330,x:1500,y:20,alpha:.8,zIndex:100},Os={x:10,fontSize:36,textColor:xn("#ffffff")},Us={fontSize:36,textColor:xn("#ffffff")},Ws=g(Qt(0),2),Ys=Ws[0],js=Ws[1],Hs=g(Qt(0),2),Qs=Hs[0],Ks=Hs[1],$s=g(Qt(99),2),Xs=$s[0],Gs=$s[1],Vs=g(Qt(0),2),Zs=Vs[0],qs=Vs[1],Js=0,ea=0,ta=bo((()=>{ea=0,Js=0,Gs(99)}),1e4);function ra(e){e.renderer.on("fpsUpdate",((e,t)=>{var r="number"==typeof t?t:t.fps;r>5&&(e=>{e&&(js(e),Gs((t=>Math.min(e,t))),qs((t=>Math.max(e,t))),ea+=e,Js++,Ks(Math.round(ea/Js)),ta())})(r)}))}var na=e=>un(on,gn(e,{style:Ds,get children(){return[un(on,{get children(){return[un(nn,{style:Os,children:"FPS:"}),un(nn,{style:Us,x:94,get children(){return Ys().toString()}})]}}),un(on,{x:160,get children(){return[un(nn,{style:Os,children:"AVG:"}),un(nn,{style:Us,x:104,get children(){return Qs().toString()}})]}}),un(on,{x:0,y:40,get children(){return[un(nn,{style:Os,children:"MIN:"}),un(nn,{style:Us,x:94,get children(){return Xs().toString()}})]}}),un(on,{x:160,y:40,get children(){return[un(nn,{style:Os,children:"MAX:"}),un(nn,{style:Us,x:104,get children(){return Zs().toString()}})]}})]}})),oa=e=>{co({Announcer:"a",Menu:"m",Escape:"Escape"});var t=(_o.setupTimers(),Xt(Jt(ho,_o.onFocusChange,{defer:!0})),_o);t.enabled=!1;var r,n,o=Dn();return er((()=>{ra({renderer:Lr})})),un(on,{onAnnouncer:()=>t.enabled=!t.enabled,onLast:()=>history.back(),onMenu:()=>o("/"),style:{width:1920,height:1080},onLeft:()=>{if(r.states.has("focus"))return!1;n=Qr(),r.setFocus()},onRight:()=>r.states.has("focus")&&n.setFocus(),get children(){return[un($o,{}),un(na,{}),hn((()=>e.children)),un(Ps,{ref(e){"function"==typeof r?r(e):r=e}})]}})},ia={Page:{width:1920,height:1080},headlineText:{width:1200,height:240,x:360,y:455,contain:"both",fontSize:66,textAlign:"center"},headlineSubText:{width:960,height:170,x:530,y:655,contain:"both",fontSize:48,textAlign:"center"},itemsContainer:{width:Ko.layout.screenW,height:600,y:560,x:0,zIndex:2},Thumbnail:{borderRadius:16,width:185,height:278,scale:1,zIndex:2,transition:{scale:{duration:250,easing:"ease-in-out"}},border:{width:0,color:0},focus:{scale:1.1,border:{color:4294967142,width:8}}},FocusRing:{borderRadius:16,width:194,height:286,y:-5,x:-5,zIndex:-1},FPS:{color:255,height:42,width:140,x:20,y:20,zIndex:100},FPSLabel:{x:10,y:0,fontSize:36,textColor:xn("#ffffff")},FPSValue:{x:90,y:0,fontSize:36,textColor:xn("#ffffff")},showHeadline:{x:70,y:20},headlineBlur:{width:1920,height:150,x:0,y:0,zIndex:14,alpha:.9,color:xn("#000000")},RowTitle:{height:60,width:300,marginTop:20,fontSize:36,color:xn("#f0f0f0"),zIndex:2},Row:{display:"flex",justifyContent:"spaceBetween",height:300},Column:{display:"flex",flexDirection:"column",justifyContent:"flexStart",gap:20,width:Ko.layout.screenW-2*Ko.layout.marginX,x:Ko.layout.marginX+Ko.layout.gutterX,y:48,transition:{y:{duration:250,easing:"ease-in-out"}},zIndex:2},Rect:{width:250,height:100,y:10,x:300,color:xn("#0000ff")},peopleBio:w(w({},Ko.typography.body1),{},{contain:"both",width:1500,height:400})},sa={width:120,height:40,color:xn("#000000"),borderRadius:8,border:{width:2,color:xn("#3333ff")},scale:1,focus:{scale:1.1,border:{width:5,color:xn("#333333")}},transition:{scale:!0,color:!0}},aa={container:sa,topBar:{color:xn("#00A699"),height:8,y:2,x:-4,width:sa.width+8},text:{fontSize:12,y:12,contain:"width",textAlign:"center",color:xn("#F6F6F9"),height:sa.height,width:sa.width}},la=386,da=136,ha=(xn("#715cab"),xn("#5a39a2"),xn("#291d43"),{fontSize:32,contain:"width",textAlign:"center",mountY:-.35,color:xn("#FFFFFF"),height:da,width:la,focus:{fontSize:40},disabled:{color:xn("#909090")}});function ua(e){return un(on,gn(e,{get style(){return ia.Thumbnail}}))}function ca(e){var t=function(e,...t){if(Rt in e){var r=new Set(t.length>1?t.flat():t[0]),n=t.map((t=>new Proxy({get:r=>t.includes(r)?e[r]:void 0,has:r=>t.includes(r)&&r in e,keys:()=>t.filter((t=>t in e))},kr)));return n.push(new Proxy({get:t=>r.has(t)?void 0:e[t],has:t=>!r.has(t)&&t in e,keys:()=>Object.keys(e).filter((e=>!r.has(e)))},kr)),n}var o,i={},s=t.map((()=>({}))),a=A(Object.getOwnPropertyNames(e));try{for(a.s();!(o=a.n()).done;){var l,d=o.value,h=Object.getOwnPropertyDescriptor(e,d),u=!h.get&&!h.set&&h.enumerable&&h.writable&&h.configurable,c=!1,f=0,p=A(t);try{for(p.s();!(l=p.n()).done;)l.value.includes(d)&&(c=!0,u?s[f][d]=h.value:Object.defineProperty(s[f],d,h)),++f}catch(v){p.e(v)}finally{p.f()}c||(u?i[d]=h.value:Object.defineProperty(i,d,h))}}catch(v){a.e(v)}finally{a.f()}return[...s,i]}(e,["items"]),r=g(t,2),n=r[0],o=r[1];return un(hs,gn(o,{get style(){return ia.Row},get children(){return un(Nr,{get each(){return n.items},children:e=>un(ua,e)})}}))}function fa(e){return un(on,gn(e,{forwardStates:!0,get style(){return aa.container},get children(){return un(nn,{get style(){return aa.text},get children(){return e.children}})}}))}var pa,va,ga="https://api.themoviedb.org/3",ma="w185",xa={headers:{"Content-Type":"application/json",Authorization:"Bearer eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyZDE4YjEwMTA0YjdiZTlkNjFiMWYwYjVlMGEwNzM2OCIsInN1YiI6IjYwZTVjMTdlNGNhNjc2MDA3NTA4Njc3MSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.D_nqH9kd-bhhWzeVsTDPYhHnsUaNAuyAa6YATmKHqsA"}};function ya(e,t=ma){return va+t+e}function ba(e,t={}){return fetch(ga+e,w(w({},xa),t)).then((e=>e.json()))}function wa(){return ba("/configuration").then((e=>{var t;return pa=e,va=null===(t=e.images)||void 0===t?void 0:t.secure_base_url,e}))}var Sa={get:function(e,t={}){return pa?ba(e,t):wa().then((()=>ba(e,t)))},loadConfig:wa};function Aa(e=[]){return e.map((e=>{return{src:ya(e.poster_path||e.profile_path),tileSrc:ya(e.backdrop_path||e.profile_path,"w300"),backdrop:ya(e.backdrop_path,"w1280"),href:`/entity/${e.media_type||"people"}/${e.id}`,shortTitle:(t=e.title||e.name,r=30,t.length>r?t.substring(0,r-3)+"...":t),title:e.title||e.name,data:e,entityInfo:{type:e.media_type||"people",id:e.id},heroContent:{title:e.title||e.name,description:e.overview}};var t,r}))}var Ca=new Map,Ta=new Map;function _a(e){var t=g(Qt([]),2),r=t[0],n=t[1],o=g(Qt(1),2),i=o[0],s=o[1],a=g(Qt(!1),2),l=a[0],d=a[1],h=g(Vt(i,e),1)[0];return Kt((()=>{var e=h();e&&fr((()=>{0===e.length&&d(!0),n((t=>[...t,...e]))}),!1)})),{pages:r,page:i,setPage:s,setPages:n,end:l,setEnd:d}}var ka=1100,Ia=w(w({},Ko.typography.display2),{},{width:ka,height:58,contain:"both"}),Ba=e=>un(nn,gn(e,{style:Ia,get children(){return e.children}})),Ra=w(w({},Ko.typography.body1),{},{width:ka,height:72,contain:"both"}),Ea={fontSize:20,lineHeight:20},Na=e=>un(nn,gn(e,{style:Ra,get children(){return e.children}}));var Fa=e=>{return t=cn("node"),mn(fo,t,(()=>[8,15,13,15])),pn(t,gn(e,{style:{color:"0x00000099",borderRadius:8,border:{width:3,color:"0xffffffff"}}}),!0),fn(t,un(nn,{style:Ea,get children(){return e.children}})),t;var t},La=Ko.typography.body2,za=e=>un(on,{style:{display:"flex",flexDirection:"row",gap:12,width:ka,height:48},get children(){return[un(nn,{style:La,get children(){return e.metaText}}),un(Nr,{get each(){return e.badges},children:e=>un(Fa,{y:-5,children:e})}),hn((()=>{return t=e.reviews,[un(Fr,{get when(){return(null==t?void 0:t.rtCrit)&&"0"!==(null==t?void 0:t.rtCrit)},get children(){return[un(on,{src:"https://upload.wikimedia.org/wikipedia/commons/b/b6/Tomato-Torrent-Icon.png",title:"Rotten Tomatoes Rating",style:{width:30,height:30,marginRight:-6}}),un(nn,{style:La,get children(){return t.rtCrit+"%"}})]}}),un(Fr,{get when(){return(null==t?void 0:t.rtFan)&&"0"!==(null==t?void 0:t.rtFan)},get children(){return[un(on,{src:"https://upload.wikimedia.org/wikipedia/commons/thumb/d/da/Rotten_Tomatoes_positive_audience.svg/80px-Rotten_Tomatoes_positive_audience.svg.png",title:"Rotten Tomatoes Rating",style:{width:24,height:30,marginRight:-6}}),un(nn,{style:La,get children(){return t.rtFan+"%"}})]}})];var t}))]}}),Ma=e=>un(on,gn(e,{style:{display:"flex",flexDirection:"column",width:ka,height:160,gap:16},get children(){return[un(Ba,{get children(){return e.title}}),un(Na,{get children(){return e.description}}),un(za,{get metaText(){return e.metaText},get badges(){return e.badges},get reviews(){return e.reviews}})]}}));function Pa(e){return e.split("-")[0]}function Da({type:e,id:t}){return Sa.get(`/${e}/${t}/recommendations`).then((({results:t})=>t.length?Aa(t.slice(0,7)):Sa.get(`/trending/${e}/week?page=1`).then((({results:e})=>Aa(e.slice(0,7))))))}function Oa({type:e,id:t}){return Sa.get(`/${e}/${t}/credits`).then((({cast:e})=>Aa(e.slice(0,7))))}function Ua({type:e,id:t}){var r="movie"===e?{rtCrit:86,rtFan:92}:{};return Sa.get(`/${e}/${t}`).then((t=>{return w({backgroundImage:ya(t.backdrop_path,"original"),heroContent:{title:t.title||t.name,description:t.overview,badges:["HD"],metaText:"movie"===e?(n=t.runtime,o=n%60,Math.floor(n/60)+"h "+(o<10?"0":"")+o+"m - "+t.release_date):`${Pa(t.first_air_date)} - ${Pa(t.last_air_date)}`,reviews:r}},t);var n,o}))}var Wa=()=>{var e=On(),t=g(Qt(0),2),r=t[0],n=t[1],o=g(Qt(),2),i=o[0];o[1];Vt(i,Ua);var s=g(Qt({}),2),a=s[0],l=s[1],d=Dn(),h=Zt((()=>0)),u=Gt((()=>{return _a((t=e.filter||"all",e=>{var r=`/trending/${t}/week?page=${e}`;if(Ca.has(r))return Ca.get(r);var n=Sa.get(r).then((e=>{var r=e.results.filter((e=>!e.adult)),n=function(e,t=7){for(var r=[],n=0,o=e.length;n=t-2)&&u().setPage((e=>e+1))}function f(){var e=this.children.selected;C(e&&e.href),d(e.href)}return Xt(Jt(Qr,(e=>{e.backdrop&&Qo(e.backdrop),e.heroContent&&l(e.heroContent)}),{defer:!0})),un(Fr,{get when(){return u().pages().length},get children(){return[un(Ma,gn({y:360,x:150},a)),un(on,{clipping:!0,get style(){return ia.itemsContainer},get children(){return un(Ei,{plinko:!0,announce:"All Trending - Week",get y(){return r()},get style(){return ia.Column},get children(){return un(Nr,{get each(){return u().pages()},children:(e,t)=>un(ca,{get autofocus(){return h(t())},items:e,onFocus:c,onEnter:f})})}})}})]}})},Ya=()=>{var e=Dn(),t=Zt((()=>0));function r(){var t=this.children.selected;C(t&&t.id),e("/"+t.id)}var n=[{title:"Flex Row",id:"flex",description:"Flex Row Implementation"},{title:"Flex Column",id:"flexcolumn",description:"Flex Column Implementation"},{title:"Flex Row Vertical Align",id:"flexsize",description:"Flex Row Vertical Align Implementation"},{title:"Flex Column Vertical Align",id:"flexcolumnsize",description:"Flex Column Vertical Align Implementation"},{title:"Buttons",id:"buttons",description:"Demo a few buttons"},{title:"Text",id:"text",description:"Text layout with flexbox"},{title:"Create Elements",id:"create",description:"Testing Show + children + inserting text"},{title:"Viewport",id:"viewport",description:"Events going in and out of viewport"}];function o(e){var t=g(Qt(4294967295),2),r=t[0],n=t[1];return un(on,gn(e,{onFocus:()=>n(255),onBlur:()=>n(4294967295),style:{width:370,height:320,borderRadius:6,scale:1,color:405488895,transition:{color:!0,scale:!0},focus:{scale:1.1,color:4294967295}},get children(){return un(on,{x:30,get children(){return[un(nn,{y:30,fontSize:84,get color(){return r()},get children(){return e.index}}),un(nn,{y:140,fontSize:42,width:340,height:42,contain:"both",get color(){return r()},get children(){return e.title}}),un(nn,{y:200,fontSize:28,width:330,contain:"width",get color(){return r()},get children(){return e.description}})]}})}}))}var i=g(Qt(140),2),s=i[0],a=i[1];function l(e){a(-400*e.selected+140)}return un(on,{colorTop:1147903743,colorBottom:743406847,get children(){return[un(on,{x:120,get children(){return[un(on,{src:"/assets/solidjs.png",width:101,height:90,y:40}),un(nn,{fontSize:90,x:110,y:40,children:"Examples"}),un(on,{y:140,height:1,width:1800,color:3906468351})]}}),un(hs,{onSelectedChanged:l,onEnter:r,transition:{x:{delay:20,duration:300}},get x(){return s()},y:300,width:4400,get style(){return ia.Row},justifyContent:"flexStart",gap:40,get children(){return un(Nr,{each:n,children:(e,r)=>un(o,gn({get autofocus(){return t(r())},get index(){return r()}},e))})}})]}})},ja=()=>{var e={width:900,height:500,y:350,x:150,gap:25,display:"flex",flexDirection:"column",justifyContent:"flexStart",color:xn("00000000")},t={width:900,height:36,gap:6,display:"flex",flexDirection:"row",justifyContent:"flexStart",color:xn("00000000")},r={fontSize:42},n={width:e.width,fontSize:26,contain:"width"},o={fontSize:26};return er((()=>{Qo("#000000")})),un(on,{autofocus:!0,style:e,get children(){return[un(nn,{style:r,children:"Title of the Page"}),un(nn,{style:n,children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer vel tempor tellus. Sed eu leo purus. Vestibulum sollicitudin eget tellus a varius. Phasellus est turpis, volutpat sed blandit sit amet, rutrum sit amet mauris. In dignissim elit orci, a sollicitudin ipsum faucibus et. Quisque vel quam rutrum, faucibus augue sed, scelerisque nunc."}),un(on,{style:t,get children(){return[un(nn,{style:o,children:"Subline Text"}),un(on,{width:28,height:28,src:"/assets/rt-popcorn.png"}),un(nn,{style:o,children:"More Text"})]}})]}})},Ha=()=>{var e,t,r={width:900,height:500,y:50,x:150,gap:25,display:"flex",flexDirection:"column",justifyContent:"flexStart",color:xn("00000000")},n={width:900,height:36,gap:6,display:"flex",flexDirection:"row",justifyContent:"flexStart",color:xn("00000000")},o={fontSize:42},i={fontSize:26};er((()=>{Qo("#000000"),e.animate({x:100},{duration:2e3}).start()}));var s=g(Qt(),2),a=s[0],l=s[1],d=g(Qt(),2),h=d[0];d[1];setTimeout((()=>{var e;l("- Inserted -"),null===(e=t.getChildById("child1"))||void 0===e||e.animate({x:600},{duration:2e3}).start()}),2e3);var u={width:400,height:300,color:xn("#0000ff")},c={color:xn("#f54242"),focus:{color:xn("#4287f5")}};function f(e){var t=ar((()=>e.children));return un(on,gn(e,{get style(){return[c,e.style,[u]]},get children(){return[un(on,{id:"child1",width:100,height:100,get color(){return xn("#ff0000")},y:25,get children(){return[hn((()=>t())),un(on,{id:"subChild",x:150,width:100,height:100,get color(){return xn("#00ff00")}}),un(nn,{get children(){return e.title}})]}}),un(on,{width:100,height:100,get color(){return xn("#ffff00")},y:175,get children(){return t()}})]}}))}var p={borderLeft:{width:8,color:95598118},borderTop:{width:8,color:631422246},borderRight:{width:8,color:95598118},borderBottom:{width:8,color:3316790822}},v={color:xn("#cccccc"),focus:{color:xn("#000000")}},m={color:xn("#ffffff"),focus:{color:xn("#f6f6cc")}};return un(on,{style:r,get children(){return[un(nn,{style:o,children:"Title of the Page"}),un(on,{style:n,get children(){return[un(nn,{get children(){return h()}}),un(nn,{style:i,get children(){return["Sub ",hn((()=>a()))," Text"]}}),un(Fr,{get when(){return a()},get children(){return un(on,{width:28,height:28,src:"/assets/rt-popcorn.png"})}}),un(nn,{style:i,children:"More Text"})]}}),un(f,{autofocus:!0,ref(e){"function"==typeof t?t(e):t=e},style:[m,v],get children(){return un(nn,{children:"Child Test"})}}),un(on,{ref(t){"function"==typeof e?e(t):e=t},style:p,width:100,height:100,get color(){return xn("#00ff00")},x:900,y:400,get alpha(){return t=e,console.log("Ref is available: ",t),1;var t}})]}})},Qa=()=>{var e,t,r=g(Qt([]),2),n=r[0],o=r[1],i={width:100,height:100,x:-400,y:-400,rotation:0,borderRadius:50,color:xn("#4287f5"),transition:{x:{duration:1250,easing:"linear"},y:{duration:1250,easing:"linear"},rotation:{duration:1400,easing:"ease-in-out"}}},s={fontSize:32,x:960,y:540,mount:.5,lineheight:52},a=(e,t)=>Math.floor(Math.random()*(t-e+1)+e);function l(e,t){o((t=>[...t,e].slice(-4))),console.log(e)}return er((()=>{Qo("#000000"),e.x=910,e.y=490,t=setInterval((()=>{e.rotation=a(-90,90),e.x=a(-300,2220),e.y=a(-300,1380)}),2500)})),tr((()=>{clearInterval(t)})),un(on,{get children(){return[un(nn,{style:s,get children(){return n().join("\n")}}),un(on,{autofocus:!0,style:i,ref(t){"function"==typeof e?e(t):e=t},onEvents:[["inBounds",e=>l("inBounds")],["outOfBounds",e=>l("outOfBounds")],["inViewport",e=>l("inViewport")],["outOfViewport",e=>l("outOfViewport")]]})]}})},Ka=()=>{function e(e,t){this.states.toggle("disabled")}var t={display:"flex",justifyContent:"flexStart",width:1500,height:300,color:xn("00000000"),gap:26,y:400};function r(e){return un(on,gn(e,{forwardStates:!0,get style(){return aa.container},get children(){return un(nn,{get style(){return aa.text},get children(){return e.children}})}}))}var n=e=>{return t=cn("node"),mn(fo,t,(()=>[10,15])),pn(t,gn(e,{get style(){return{color:xn("#000000be"),borderRadius:8,border:{width:2,color:xn("#ffffff")}}}}),!0),fn(t,un(nn,{style:{fontSize:20},get children(){return e.children}})),t;var t};return[un(hs,{x:100,y:200,gap:5,style:t,get children(){return[un(n,{children:"HD"}),un(n,{children:"PG13"}),un(n,{children:"NC17"}),un(nn,{fontSize:30,children:"I like bananas"}),un(n,{children:"DOLBY"})]}}),un(hs,{x:100,gap:40,style:t,get children(){return[un(r,{autofocus:!0,onEnter:e,children:"TV Shows"}),un(r,{states:{active:!0,disabled:!1},children:"Movies"}),un(r,{states:"active",children:"Sports"}),un(r,{states:"disabled",children:"News"})]}})]},$a=()=>{var e={display:"flex",justifyContent:"flexStart",width:1600,height:110,color:xn("#4dabf5")},t={fontSize:44,marginTop:25,marginBottom:-20,skipFocus:!0};function r(e){return un(on,gn(e,{style:{width:200,height:100,y:5,color:392801023}}))}var n=g(Qt(50),2),o=n[0],i=n[1];function s(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),i(150+-1*(this.y||0))}er((()=>{Qo("#333333")}));var a=50;return un(Ei,{x:160,get y(){return o()},gap:30,height:850,get width(){return e.width},get style(){return ia.Column},get children(){return[un(nn,{style:t,children:"Flex Start"}),un(hs,{gap:a,style:e,onFocus:s,get children(){return[un(r,{autofocus:!0}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(nn,{style:t,children:"Flex Start - Margin Left"}),un(hs,{gap:a,style:e,onFocus:s,get children(){return[un(r,{marginLeft:100}),un(r,{}),un(r,{marginLeft:100}),un(r,{}),un(r,{})]}}),un(nn,{style:t,children:"Flex End"}),un(hs,{gap:a,justifyContent:"flexEnd",style:e,onFocus:s,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(nn,{style:t,children:"Flex End - Margin Right"}),un(hs,{gap:a,justifyContent:"flexEnd",style:e,onFocus:s,get children(){return[un(r,{}),un(r,{marginRight:100}),un(r,{}),un(r,{}),un(r,{marginRight:100})]}}),un(nn,{style:t,children:"Center - No Margin Support"}),un(hs,{gap:a,justifyContent:"center",style:e,onFocus:s,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(nn,{style:t,children:"Space Between - No Margin Support"}),un(hs,{gap:a,justifyContent:"spaceBetween",style:e,onFocus:s,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(nn,{style:t,children:"Space Evenly - No Margin Support"}),un(hs,{gap:a,justifyContent:"spaceEvenly",style:e,onFocus:s,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}})]}})},Xa=()=>{var e={display:"flex",justifyContent:"flexStart",width:1600,height:110,color:xn("#4dabf5")},t={fontSize:44,marginTop:25,marginBottom:-20,skipFocus:!0};function r(e){return un(on,gn(e,{style:{width:200,height:100,y:5,color:392801023}}))}function n(){return Math.floor(91*Math.random())+10}var o=g(Qt(50),2),i=o[0],s=o[1];function a(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),s(150+-1*(this.y||0))}er((()=>{Qo("#333333")}));var l=50;return un(Ei,{x:160,get y(){return i()},gap:30,height:850,get width(){return e.width},get style(){return ia.Column},get children(){return[un(nn,{style:t,children:"Flex Start - AlignItems: center"}),un(hs,{alignItems:"center",gap:l,style:e,onFocus:a,get children(){return[un(r,{autofocus:!0,get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}})]}}),un(nn,{style:t,children:"Flex Start - Margin Left - AlignItems: flexStart"}),un(hs,{gap:l,alignItems:"flexStart",style:e,onFocus:a,get children(){return[un(r,{marginLeft:100,get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{marginLeft:100,get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}})]}}),un(nn,{style:t,children:"Flex End - AlignItems: flexEnd"}),un(hs,{gap:l,justifyContent:"flexEnd",alignItems:"flexEnd",style:e,onFocus:a,get children(){return[un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}})]}}),un(nn,{style:t,children:"Flex End - Margin Right"}),un(hs,{gap:l,justifyContent:"flexEnd",style:e,onFocus:a,get children(){return[un(r,{get height(){return n()}}),un(r,{marginRight:100,get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{marginRight:100,get height(){return n()}})]}}),un(nn,{style:t,children:"Center - No Margin Support"}),un(hs,{gap:l,justifyContent:"center",style:e,onFocus:a,get children(){return[un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}})]}}),un(nn,{style:t,children:"Space Between - No Margin Support"}),un(hs,{gap:l,justifyContent:"spaceBetween",style:e,onFocus:a,get children(){return[un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}})]}}),un(nn,{style:t,children:"Space Evenly - No Margin Support"}),un(hs,{gap:l,justifyContent:"spaceEvenly",style:e,onFocus:a,get children(){return[un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}}),un(r,{get height(){return n()}})]}})]}})},Ga=()=>{var e={display:"flex",justifyContent:"spaceEvenly",width:1920,y:100,height:880,color:xn("00000000")},t={display:"flex",flexDirection:"column",justifyContent:"flexStart",color:xn("#4dabf5"),height:850,width:80};function r(e){var t={width:Math.floor(61*Math.random())+10,height:80,x:5,color:xn("#1769aa")};return un(on,gn(e,{style:t}))}var n=g(Qt(50),2),o=(n[0],n[1]);function i(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),o(150+-1*(this.y||0))}er((()=>{Qo("#333333")}));var s=50;return[un(nn,{style:{fontSize:44,y:20,x:150},children:"Start, MarginTop, End, MarginBottom, Center, Between, Evenly"}),un(hs,{gap:s,style:e,onFocus:i,get children(){return[un(Ei,{gap:30,style:t,alignItems:"center",get children(){return[un(r,{autofocus:!0}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(Ei,{gap:s,style:t,onFocus:i,alignItems:"flexStart",get children(){return[un(r,{marginTop:100}),un(r,{}),un(r,{marginTop:100}),un(r,{}),un(r,{})]}}),un(Ei,{gap:s,alignItems:"flexEnd",justifyContent:"flexEnd",style:t,onFocus:i,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(Ei,{gap:s,justifyContent:"flexEnd",style:t,onFocus:i,get children(){return[un(r,{}),un(r,{marginBottom:100}),un(r,{}),un(r,{}),un(r,{marginBottom:100})]}}),un(Ei,{gap:s,justifyContent:"center",style:t,onFocus:i,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(Ei,{gap:s,justifyContent:"spaceBetween",style:t,onFocus:i,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(Ei,{gap:s,justifyContent:"spaceEvenly",style:t,onFocus:i,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}})]}})]},Va=()=>{var e={display:"flex",justifyContent:"spaceEvenly",width:1920,y:100,height:880,color:xn("00000000")},t={display:"flex",flexDirection:"column",justifyContent:"flexStart",color:xn("#4dabf5"),height:850,width:60};function r(e){var t={width:50,height:80,x:5,color:xn("#1769aa")};return un(on,gn(e,{style:t}))}var n=g(Qt(50),2),o=(n[0],n[1]);function i(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),o(150+-1*(this.y||0))}er((()=>{Qo("#333333")}));var s=50;return[un(nn,{style:{fontSize:44,y:20,x:150},children:"Start, MarginTop, End, MarginBottom, Center, Between, Evenly"}),un(hs,{gap:s,style:e,onFocus:i,get children(){return[un(Ei,{gap:30,style:t,get children(){return[un(r,{autofocus:!0}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(Ei,{gap:s,style:t,onFocus:i,get children(){return[un(r,{marginTop:100}),un(r,{}),un(r,{marginTop:100}),un(r,{}),un(r,{})]}}),un(Ei,{gap:s,justifyContent:"flexEnd",style:t,onFocus:i,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(Ei,{gap:s,justifyContent:"flexEnd",style:t,onFocus:i,get children(){return[un(r,{}),un(r,{marginBottom:100}),un(r,{}),un(r,{}),un(r,{marginBottom:100})]}}),un(Ei,{gap:s,justifyContent:"center",style:t,onFocus:i,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(Ei,{gap:s,justifyContent:"spaceBetween",style:t,onFocus:i,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}}),un(Ei,{gap:s,justifyContent:"spaceEvenly",style:t,onFocus:i,get children(){return[un(r,{}),un(r,{}),un(r,{}),un(r,{}),un(r,{})]}})]}})]},Za=()=>{function e(e,t){this.states.toggle("disabled")}var t={display:"flex",justifyContent:"flexStart",width:1500,height:300,color:xn("00000000"),gap:26,y:400,x:100},r={width:386,height:136,color:"0x715cabff",focus:{color:"0x5a39a2ff"},disabled:{color:"0x291d43ff"}},n=["RoundedRectangle",{radius:65}];function o(e){return un(on,gn(e,{forwardStates:!0,style:r,shader:n,get children(){return un(nn,{style:ha,get children(){return e.children}})}}))}return un(hs,{style:t,get children(){return[un(o,{autofocus:!0,onEnter:e,children:"Focused"}),un(o,{states:{active:!0,disabled:!1},children:"Normal"}),un(o,{states:"disabled",children:"Disabled"})]}})},qa="https://storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd";function Ja(){return(Ja=y(m().mark((function e(){var t,r;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=document.getElementById("video"),r=new shaka.Player,e.next=4,r.attach(t);case 4:return window.player=r,r.addEventListener("error",el),e.prev=6,e.next=9,r.load(qa);case 9:console.log("The video has now been loaded!"),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(6),tl(e.t0);case 15:case"end":return e.stop()}}),e,null,[[6,12]])})))).apply(this,arguments)}function el(e){tl(e.detail)}function tl(e){console.error("Error code",e.code,"object",e)}document.addEventListener("DOMContentLoaded",(function(){shaka.polyfill.installAll(),shaka.Player.isBrowserSupported()?function(){Ja.apply(this,arguments)}():console.error("Browser not supported!")}));var rl=()=>{var e=On(),t=Dn(),r=g(Vt((()=>w({},e)),Ua),1)[0],n=g(Vt((()=>w({},e)),Oa),1)[0],o=g(Vt((()=>w({},e)),Da),1)[0],i=g(Qt(0),2),s=i[0],a=i[1];Xt(Jt(r,(e=>{Qo(e.backgroundImage)}),{defer:!0}));var l,d,h,u=600,c={color:xn("#000000"),alpha:0,width:1900,height:890,x:10,y:u,borderRadius:30};function f(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),l.y=u,d.y=u,d.alpha=0}function p(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),l.y=200,d.y=160,d.alpha=.9}function v(){var e=this.children.selected;C(e&&e.href),t(e.href)}function m(){var e;(e=document.getElementById("video")).hidden=!0,e.pause(),document.getElementsByTagName("canvas")[0].focus(),Kr(h),a(0)}function x(){var e=function(){var e=document.getElementById("video");return e.hidden=!1,setTimeout((()=>e.play()),50),e.focus(),e}();Kr(e),a(.9)}return un(Fr,{get when(){return r()},keyed:!0,get children(){return[un(on,{onUp:()=>h.setFocus(),onEscape:m,get children(){return[un(Ma,gn({y:360,x:150},(()=>r().heroContent))),un(fa,{autofocus:!0,ref(e){"function"==typeof h?h(e):h=e},y:560,x:150,onDown:()=>l.setFocus(),onEnter:x,children:"Watch Trailer"}),un(Ei,{ref(e){"function"==typeof l?l(e):l=e},y:u,x:140,get style(){return ia.Column},zIndex:5,get children(){return un(Fr,{get when(){return hn((()=>!!o()))()&&n()},get children(){return[un(nn,{skipFocus:!0,get style(){return ia.RowTitle},children:"Recommendations"}),un(ca,{onFocus:f,onEnter:v,get items(){return o()}}),un(nn,{skipFocus:!0,get style(){return ia.RowTitle},children:"Cast and Crew"}),un(ca,{onFocus:p,onEnter:v,get items(){return n()}})]}})}}),un(on,{ref(e){"function"==typeof d?d(e):d=e},style:c,transition:{alpha:!0,y:!0}})]}}),un(on,{get alpha(){return s()},get color(){return xn("#000000")},zIndex:200,transition:{alpha:!0}})]}})};function nl({id:e}){return Sa.get(`/person/${e}/combined_credits`).then((({cast:e})=>Aa(e.slice(0,7))))}function ol({id:e}){return Sa.get(`/person/${e}`).then((e=>w({backgroundImage:ya(e.profile_path,"original"),heroContent:{title:e.title||e.name,description:e.biography}},e)))}var il=()=>{var e=On(),t=Dn(),r=g(Vt((()=>w({},e)),ol),1)[0],n=g(Vt((()=>w({},e)),nl),1)[0];Xt(Jt(r,(e=>{Qo(e.backgroundImage)}),{defer:!0}));var o={color:xn("#000000"),alpha:.8,width:1540,height:440,x:130,y:180,borderRadius:30};function i(){var e=this.children.selected;C(e&&e.href),t(e.href)}return un(Fr,{get when(){return r()},keyed:!0,get children(){return[un(on,{x:150,y:200,get style(){return ia.Column},zIndex:3,get children(){return[un(nn,{get style(){return Ko.typography.display2},get children(){return r().name}}),un(nn,{get style(){return ia.peopleBio},get children(){return r().biography}})]}}),un(on,{style:o}),un(Ei,{y:670,x:140,get style(){return ia.Column},get children(){return un(Fr,{get when(){return n()},get children(){return[un(nn,{skipFocus:!0,get style(){return ia.RowTitle},children:"Credits"}),un(ca,{autofocus:!0,onEnter:i,get items(){return n()}})]}})}})]}})},sl=()=>{return e=cn("node"),vn(e,"style",{width:1920,height:1080,color:868483072}),e;var e},al=new URL("AppCoreExtensions-legacy-CjL-s2b8.js",b.meta.url).href;Dr.debug=!1,Dr.animationsEnabled=!0,Dr.fontSettings.fontFamily="Ubuntu",Dr.fontSettings.color=xn("#ffffff"),Dr.fontSettings.fontSize=32,Dr.rendererOptions={coreExtensionModule:al,fpsUpdateInterval:1e3,enableInspector:!0},dn((()=>un(to,{root:e=>un(oa,e),get children(){return[un(Vn,{path:"",component:Wa}),un(Vn,{path:"examples",component:Ya}),un(Vn,{path:"browse/:filter",component:Wa}),un(Vn,{path:"text",component:ja}),un(Vn,{path:"buttons",component:Ka}),un(Vn,{path:"flex",component:$a}),un(Vn,{path:"create",component:Ha}),un(Vn,{path:"viewport",component:Qa}),un(Vn,{path:"flexsize",component:Xa}),un(Vn,{path:"flexcolumnsize",component:Ga}),un(Vn,{path:"flexcolumn",component:Va}),un(Vn,{path:"buttonsmaterial",component:Za}),un(Vn,{path:"entity/people/:id",component:il}),un(Vn,{path:"entity/:type/:id",component:rl}),un(Vn,{path:"*all",component:sl})]}})))}}}))}(); +//# sourceMappingURL=index-legacy-CFPn_sx5.js.map diff --git a/assets/index-legacy-CFPn_sx5.js.map b/assets/index-legacy-CFPn_sx5.js.map new file mode 100644 index 0000000..b916961 --- /dev/null +++ b/assets/index-legacy-CFPn_sx5.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index-legacy-CFPn_sx5.js","sources":["../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/getUnicodeCodepoints.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/main-api/texture-usage-trackers/TextureUsageTracker.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/main-api/texture-usage-trackers/ManualCountTextureUsageTracker.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/main-api/texture-usage-trackers/FinalizationRegistryTextureUsageTracker.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/main-api/Inspector.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/ShaderEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/TextRenderer.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/LightningTextTextureRenderer.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/CanvasTextRenderer.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/DefaultShader.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/DefaultShaderBatched.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/DynamicShader.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/RoundedRectangle.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/SdfShader.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/RadiusEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/BorderEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/LinearGradientEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/GrayscaleEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/BorderRightEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/BorderTopEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/BorderBottomEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/BorderLeftEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/GlitchEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/FadeOutEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/RadialGradientEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/RadialProgressEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/HolePunchEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/CoreShaderManager.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/lib/ContextSpy.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/lib/textureCompression.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/textures/ImageTexture.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/constants.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/PeekableGenerator.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/measureText.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/layoutText.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/setRenderWindow.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/util.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/TrFontManager.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/SdfTextRenderer.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/getStartConditions.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/render-drivers/utils.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/main-api/RendererMain.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/animations/CoreAnimation.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/animations/CoreAnimationController.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/lib/Matrix3d.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/CoreNode.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/lib/RenderCoords.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/render-drivers/main/MainOnlyNode.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/animations/AnimationManager.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/lib/ImageWorker.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/textures/NoiseTexture.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/CoreTextureManager.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/TextureMemoryManager.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/Stage.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/platform.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/core/CoreTextNode.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/render-drivers/main/MainOnlyTextNode.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.2/node_modules/@lightningjs/renderer/dist/src/render-drivers/main/MainCoreDriver.js","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/dist/solid.js","../../../../../solid/src/core/lightningInit.ts","../../../../../solid/src/core/node/children.ts","../../../../../solid/src/config.ts","../../../../../solid/src/core/utils.ts","../../../../../solid/src/core/node/states.ts","../../../../../solid/src/core/activeElement.ts","../../../../../solid/src/core/node/index.ts","../../../../../solid/src/core/flex.ts","../../../../../solid/src/components/Text.tsx","../../../../../solid/src/components/View.tsx","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/universal/dist/universal.js","../../../../../solid/src/core/solidUniversal.ts","../../../../../solid/src/core/render.ts","../../../../../solid/src/utils.ts","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/web/dist/web.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/lifecycle.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/utils.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routing.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/components.jsx","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/createRouter.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/data/action.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/data/events.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/HashRouter.js","../../../../node_modules/.pnpm/@solid-primitives+utils@6.2.3_solid-js@1.8.16/node_modules/@solid-primitives/utils/dist/chunk/R5675YMU.js","../../../../node_modules/.pnpm/@solid-primitives+rootless@1.4.5_solid-js@1.8.16/node_modules/@solid-primitives/rootless/dist/index.js","../../../../node_modules/.pnpm/@solid-primitives+keyboard@1.2.8_solid-js@1.8.16/node_modules/@solid-primitives/keyboard/dist/index.js","../../../../node_modules/.pnpm/@solid-primitives+event-listener@2.3.3_solid-js@1.8.16/node_modules/@solid-primitives/event-listener/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/utils.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/useFocusManager.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/speech.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/withPadding.js","../../../../node_modules/.pnpm/@solid-primitives+scheduled@1.4.3_solid-js@1.8.16/node_modules/@solid-primitives/scheduled/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/announcer.js","../../src/state.ts","../../../../node_modules/.pnpm/@lightningjs+solid-ui@0.6.0_@babel+core@7.24.3_@lightningjs+renderer@0.8.2_@lightningjs+solid_sggciuifiwrrln27zkml3bpb3u/node_modules/@lightningjs/solid-ui/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+l3-ui-theme-base@0.3.1/node_modules/@lightningjs/l3-ui-theme-base/theme.js","../../src/components/Background.tsx","../../src/components/NavDrawer/NavDrawer.styles.ts","../../src/components/Icon.tsx","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/createSpriteMap.js","../../src/components/NavDrawer/NavDrawer.tsx","../../src/components/FPSCounter.tsx","../../src/pages/App.tsx","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.2_@lightningjs+solid@0.15.1_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/index.js","../../src/styles.ts","../../src/components/index.tsx","../../src/api/key.ts","../../src/api/index.ts","../../src/api/formatters/ItemFormatter.ts","../../src/api/providers/browse.ts","../../src/components/pagination.ts","../../src/components/ContentBlock.tsx","../../src/api/providers/entity.js","../../src/pages/Browse.tsx","../../src/pages/Portal.tsx","../../src/pages/Text.tsx","../../src/pages/Create.tsx","../../src/pages/Viewport.tsx","../../src/pages/Buttons.tsx","../../src/pages/Flex.tsx","../../src/pages/FlexSize.tsx","../../src/pages/FlexColumnSize.tsx","../../src/pages/FlexColumn.tsx","../../src/pages/ButtonsMaterial.tsx","../../src/video.js","../../src/pages/Entity.tsx","../../src/api/providers/people.js","../../src/pages/People.tsx","../../src/pages/NotFound.tsx","../../AppCoreExtensions.js?importChunkUrl","../../src/index.tsx"],"sourcesContent":["/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// Reversible Generator Wrapper Class\n/**\n * Generator function that yields each Unicode code point in the given string.\n */\nexport function* getUnicodeCodepoints(text, start = 0) {\n let i = start;\n while (i < text.length) {\n const codePoint = text.codePointAt(i);\n if (codePoint === undefined) {\n throw new Error('Invalid Unicode code point');\n }\n yield codePoint;\n i += codePoint <= 0xffff ? 1 : 2;\n }\n}\n//# sourceMappingURL=getUnicodeCodepoints.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Texture Usage Tracker for Usage Based Texture Garbage Collection\n */\nexport class TextureUsageTracker {\n releaseCallback;\n constructor(releaseCallback) {\n this.releaseCallback = releaseCallback;\n }\n}\n//# sourceMappingURL=TextureUsageTracker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { TextureUsageTracker } from './TextureUsageTracker.js';\n/**\n * Usage-based Texture Garbage Collection Registry\n */\nexport class ManualCountTextureUsageTracker extends TextureUsageTracker {\n textureMap = new Map();\n zeroReferenceTextureSet = new Set();\n options;\n constructor(releaseCallback, options) {\n super(releaseCallback);\n this.options = {\n textureCleanupIntervalMs: options.textureCleanupIntervalMs ?? 10000,\n textureCleanupAgeThreadholdMs: options.textureCleanupAgeThreadholdMs ?? 60000,\n };\n // Periodically check for textures that are no longer referenced by any\n // Nodes and notify RendererMain to release them.\n setInterval(() => {\n const now = Date.now();\n const thresholdMs = this.options.textureCleanupAgeThreadholdMs;\n for (const textureRefInfo of this.zeroReferenceTextureSet) {\n if (now - textureRefInfo.lastUpdate > thresholdMs) {\n this.releaseCallback(textureRefInfo.id);\n this.textureMap.delete(textureRefInfo.id);\n this.zeroReferenceTextureSet.delete(textureRefInfo);\n }\n }\n }, this.options.textureCleanupIntervalMs);\n }\n registerTexture(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n if (!this.textureMap.has(textureId)) {\n const textureRefInfo = {\n id: textureId,\n nodeRefCount: 0,\n lastUpdate: Date.now(),\n };\n this.textureMap.set(textureId, textureRefInfo);\n this.zeroReferenceTextureSet.add(textureRefInfo);\n }\n }\n incrementTextureRefCount(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n let textureRefInfo = this.textureMap.get(textureId);\n if (!textureRefInfo) {\n // Texture has not been registered yet, so register it now.\n // This may happen if the TextureRef was cleaned up from the registry\n // but was still alive in memory and eventually re-used.\n this.registerTexture(texture);\n textureRefInfo = this.textureMap.get(textureId);\n }\n assertTruthy(textureRefInfo, 'Texture must have been registered');\n if (texture.txType === 'SubTexture') {\n // If this is a SubTexture, then increment the reference count of the\n // parent texture as well.\n this.incrementTextureRefCount(texture.props.texture);\n }\n textureRefInfo.nodeRefCount++;\n textureRefInfo.lastUpdate = Date.now();\n if (this.zeroReferenceTextureSet.has(textureRefInfo)) {\n this.zeroReferenceTextureSet.delete(textureRefInfo);\n }\n }\n decrementTextureRefCount(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n const textureRefInfo = this.textureMap.get(textureId);\n assertTruthy(textureRefInfo, 'Texture must have been registered');\n textureRefInfo.nodeRefCount--;\n textureRefInfo.lastUpdate = Date.now();\n if (textureRefInfo.nodeRefCount === 0) {\n this.zeroReferenceTextureSet.add(textureRefInfo);\n }\n if (texture.txType === 'SubTexture') {\n // If this is a SubTexture, then decrement the reference count of the\n // parent texture as well.\n this.decrementTextureRefCount(texture.props.texture);\n }\n }\n}\n//# sourceMappingURL=ManualCountTextureUsageTracker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { TextureUsageTracker } from './TextureUsageTracker.js';\nexport class FinalizationRegistryTextureUsageTracker extends TextureUsageTracker {\n registry;\n constructor(releaseCallback) {\n super(releaseCallback);\n this.registry = new FinalizationRegistry(releaseCallback);\n }\n registerTexture(texture) {\n assertTruthy(texture.options?.id, 'Texture must have an ID to be registered');\n this.registry.register(texture, texture.options?.id);\n }\n incrementTextureRefCount() {\n // No-op for FinalizationRegistry\n }\n decrementTextureRefCount() {\n // No-op for FinalizationRegistry\n }\n}\n//# sourceMappingURL=FinalizationRegistryTextureUsageTracker.js.map","import {} from './RendererMain.js';\nimport { isProductionEnvironment } from '../utils.js';\nconst stylePropertyMap = {\n alpha: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'opacity', value: `${v}` };\n },\n x: (x) => {\n return { prop: 'left', value: `${x}px` };\n },\n y: (y) => {\n return { prop: 'top', value: `${y}px` };\n },\n width: (w) => {\n if (w === 0) {\n return null;\n }\n return { prop: 'width', value: `${w}px` };\n },\n height: (h) => {\n if (h === 0) {\n return null;\n }\n return { prop: 'height', value: `${h}px` };\n },\n zIndex: () => 'zIndex',\n fontFamily: () => 'font-family',\n fontSize: () => 'font-size',\n fontStyle: () => 'font-style',\n fontWeight: () => 'font-weight',\n fontStretch: () => 'font-stretch',\n lineHeight: () => 'line-height',\n letterSpacing: () => 'letter-spacing',\n textAlign: () => 'text-align',\n overflowSuffix: () => 'overflow-suffix',\n maxLines: () => 'max-lines',\n contain: () => 'contain',\n verticalAlign: () => 'vertical-align',\n clipping: (v) => {\n if (v === false) {\n return null;\n }\n return { prop: 'overflow', value: v ? 'hidden' : 'visible' };\n },\n rotation: (v) => {\n if (v === 0) {\n return null;\n }\n return { prop: 'transform', value: `rotate(${v}rad)` };\n },\n scale: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scale(${v})` };\n },\n scaleX: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scaleX(${v})` };\n },\n scaleY: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scaleY(${v})` };\n },\n color: (v) => {\n if (v === 0) {\n return null;\n }\n return { prop: 'color', value: convertColorToRgba(v) };\n },\n};\nconst convertColorToRgba = (color) => {\n const a = (color & 0xff) / 255;\n const b = (color >> 8) & 0xff;\n const g = (color >> 16) & 0xff;\n const r = (color >> 24) & 0xff;\n return `rgba(${r},${g},${b},${a})`;\n};\nconst domPropertyMap = {\n id: 'id',\n};\nconst gradientColorPropertyMap = [\n 'colorTop',\n 'colorBottom',\n 'colorLeft',\n 'colorRight',\n 'colorTl',\n 'colorTr',\n 'colorBl',\n 'colorBr',\n];\nexport class Inspector {\n root = null;\n canvas = null;\n height = 1080;\n width = 1920;\n scaleX = 1;\n scaleY = 1;\n constructor(canvas, settings) {\n if (isProductionEnvironment())\n return;\n if (!settings) {\n throw new Error('settings is required');\n }\n // calc dimensions based on the devicePixelRatio\n this.height = Math.ceil(settings.appHeight ?? 1080 / (settings.deviceLogicalPixelRatio ?? 1));\n this.width = Math.ceil(settings.appWidth ?? 1900 / (settings.deviceLogicalPixelRatio ?? 1));\n this.scaleX = settings.deviceLogicalPixelRatio ?? 1;\n this.scaleY = settings.deviceLogicalPixelRatio ?? 1;\n this.canvas = canvas;\n this.root = document.createElement('div');\n this.setRootPosition();\n document.body.appendChild(this.root);\n //listen for changes on canvas\n const mutationObserver = new MutationObserver(this.setRootPosition.bind(this));\n mutationObserver.observe(canvas, {\n attributes: true,\n childList: false,\n subtree: false,\n });\n // Create a ResizeObserver to watch for changes in the element's size\n const resizeObserver = new ResizeObserver(this.setRootPosition.bind(this));\n resizeObserver.observe(canvas);\n //listen for changes on window\n window.addEventListener('resize', this.setRootPosition.bind(this));\n console.warn('Inspector is enabled, this will impact performance');\n }\n setRootPosition() {\n if (this.root === null || this.canvas === null) {\n return;\n }\n // get the world position of the canvas object, so we can match the inspector to it\n const rect = this.canvas.getBoundingClientRect();\n const top = document.documentElement.scrollTop + rect.top;\n const left = document.documentElement.scrollLeft + rect.left;\n this.root.id = 'root';\n this.root.style.left = `${left}px`;\n this.root.style.top = `${top}px`;\n this.root.style.width = `${this.width}px`;\n this.root.style.height = `${this.height}px`;\n this.root.style.position = 'absolute';\n this.root.style.transformOrigin = '0 0 0';\n this.root.style.transform = `scale(${this.scaleX}, ${this.scaleY})`;\n this.root.style.overflow = 'hidden';\n this.root.style.zIndex = '65534';\n }\n createDiv(node, properties) {\n const div = document.createElement('div');\n div.style.position = 'absolute';\n div.id = node.id.toString();\n // set initial properties\n for (const key in properties) {\n this.updateNodeProperty(div, \n // really typescript? really?\n key, properties[key]);\n }\n return div;\n }\n createNode(driver, properties) {\n const node = driver.createNode(properties);\n const div = this.createDiv(node, properties);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n div.node = node;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n node.div = div;\n return this.createProxy(node, div);\n }\n createTextNode(driver, properties) {\n const node = driver.createTextNode(properties);\n const div = this.createDiv(node, properties);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n div.node = node;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n node.div = div;\n return this.createProxy(node, div);\n }\n createProxy(node, div) {\n return new Proxy(node, {\n set: (target, property, value) => {\n this.updateNodeProperty(div, property, value);\n return Reflect.set(target, property, value);\n },\n get: (target, property, receiver) => {\n if (property === 'destroy') {\n this.destroyNode(target);\n }\n if (property === 'animate') {\n return (props, settings) => {\n const anim = target.animate(props, settings);\n // Trap the animate start function so we can update the inspector accordingly\n return new Proxy(anim, {\n get: (target, property, receiver) => {\n if (property === 'start') {\n this.animateNode(div, node, props, settings);\n }\n return Reflect.get(target, property, receiver);\n },\n });\n };\n }\n return Reflect.get(target, property, receiver);\n },\n });\n }\n destroyNode(node) {\n const div = document.getElementById(node.id.toString());\n div?.remove();\n }\n updateNodeProperty(div, property, \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value) {\n if (this.root === null || value === undefined || value === null) {\n return;\n }\n /**\n * Special case for parent property\n */\n if (property === 'parent') {\n const parentId = value.id;\n // only way to detect if the parent is the root node\n // if you are reading this and have a better way, please let me know\n if (parentId === 1) {\n this.root.appendChild(div);\n return;\n }\n const parent = document.getElementById(parentId.toString());\n parent?.appendChild(div);\n return;\n }\n // special case for text\n if (property === 'text') {\n div.innerHTML = String(value);\n // hide text because we can't render SDF fonts\n // it would look weird and obstruct the WebGL rendering\n div.style.visibility = 'hidden';\n return;\n }\n // special case for images\n // we're not setting any CSS properties to avoid images getting loaded twice\n // as the renderer will handle the loading of the image. Setting it to `data-src`\n if (property === 'src' && value) {\n div.setAttribute(`data-src`, String(value));\n return;\n }\n // special case for color gradients (normal colors are handled by the stylePropertyMap)\n // FIXME the renderer seems to return the same number for all colors\n // if (gradientColorPropertyMap.includes(property as string)) {\n // const color = convertColorToRgba(value as number);\n // div.setAttribute(`data-${property}`, color);\n // return;\n // }\n // CSS mappable attribute\n if (stylePropertyMap[property]) {\n const mappedStyleResponse = stylePropertyMap[property]?.(value);\n if (mappedStyleResponse === null) {\n return;\n }\n if (typeof mappedStyleResponse === 'string') {\n div.style.setProperty(mappedStyleResponse, String(value));\n return;\n }\n if (typeof mappedStyleResponse === 'object') {\n div.style.setProperty(mappedStyleResponse.prop, mappedStyleResponse.value);\n }\n return;\n }\n // DOM properties\n if (domPropertyMap[property]) {\n div.setAttribute(String(stylePropertyMap[property]), String(value));\n return;\n }\n // custom data properties\n if (property === 'data') {\n for (const key in value) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n div.setAttribute(`data-${key}`, String(value[key]));\n }\n return;\n }\n }\n // simple animation handler\n animateNode(div, node, props, settings) {\n const { duration = 1000, delay = 0,\n // easing = 'linear',\n // repeat = 0,\n // loop = false,\n // stopMethod = false,\n } = settings;\n const { x, y, width, height, alpha = 1, rotation = 0, scale = 1, color, } = props;\n // ignoring loops and repeats for now, as that might be a bit too much for the inspector\n function animate() {\n setTimeout(() => {\n div.style.top = `${y}px`;\n div.style.left = `${x}px`;\n div.style.width = `${width}px`;\n div.style.height = `${height}px`;\n div.style.opacity = `${alpha}`;\n div.style.rotate = `${rotation}rad`;\n div.style.scale = `${scale}`;\n div.style.color = convertColorToRgba(color);\n }, duration);\n }\n setTimeout(animate, delay);\n }\n}\n//# sourceMappingURL=Inspector.js.map","export class ShaderEffect {\n priority = 1;\n name = '';\n ref;\n target;\n passParameters = '';\n declaredUniforms = '';\n uniformInfo = {};\n static uniforms = {};\n static methods;\n static onShaderMask;\n static onColorize;\n static onEffectMask;\n static getEffectKey(props) {\n return '';\n }\n static getMethodParameters(uniforms, props) {\n const res = [];\n for (const u in uniforms) {\n const uni = uniforms[u];\n let define = '';\n if (uni.size) {\n define = `[${uni.size(props)}]`;\n }\n res.push(`${uni.type} ${u}${define}`);\n }\n return res.join(',');\n }\n constructor(options) {\n const { ref, target, props = {} } = options;\n this.ref = ref;\n this.target = target;\n const uniformInfo = {};\n const passParameters = [];\n let declaredUniforms = '';\n const uniforms = this.constructor.uniforms || {};\n for (const u in uniforms) {\n const unif = uniforms[u];\n const uniType = unif.type;\n //make unique uniform name\n const uniformName = `${ref}_${u}`;\n let define = '';\n if (unif.size) {\n define = `[${unif.size(props)}]`;\n }\n passParameters.push(uniformName);\n declaredUniforms += `uniform ${uniType} ${uniformName}${define};`;\n uniformInfo[u] = { name: uniformName, uniform: uniforms[u].method };\n }\n this.passParameters = passParameters.join(',');\n this.declaredUniforms = declaredUniforms;\n this.uniformInfo = uniformInfo;\n }\n static resolveDefaults(props) {\n return {};\n }\n static makeEffectKey(props) {\n return false;\n }\n}\n//# sourceMappingURL=ShaderEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst trPropSetterDefaults = {\n x: (state, value) => {\n state.props.x = value;\n },\n y: (state, value) => {\n state.props.y = value;\n },\n width: (state, value) => {\n state.props.width = value;\n },\n height: (state, value) => {\n state.props.height = value;\n },\n color: (state, value) => {\n state.props.color = value;\n },\n zIndex: (state, value) => {\n state.props.zIndex = value;\n },\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n },\n text: (state, value) => {\n state.props.text = value;\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n },\n contain: (state, value) => {\n state.props.contain = value;\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n },\n scrollable: (state, value) => {\n state.props.scrollable = value;\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n },\n debug: (state, value) => {\n state.props.debug = value;\n },\n};\nexport class TextRenderer {\n stage;\n set;\n constructor(stage) {\n this.stage = stage;\n const propSetters = {\n ...trPropSetterDefaults,\n ...this.getPropertySetters(),\n };\n // For each prop setter add a wrapper method that checks if the prop is\n // different before calling the setter\n this.set = Object.freeze(Object.fromEntries(Object.entries(propSetters).map(([key, setter]) => {\n return [\n key,\n (state, value) => {\n if (state.props[key] !== value) {\n setter(state, value);\n // Assume any prop change will require a render\n // This is required because otherwise a paused RAF will result\n // in renders when text props are changed.\n this.stage.requestRender();\n }\n },\n ];\n })));\n }\n setStatus(state, status, error) {\n // Don't emit the same status twice\n if (state.status === status) {\n return;\n }\n state.status = status;\n state.emitter.emit(status, error);\n }\n /**\n * Allows the CoreTextNode to communicate changes to the isRenderable state of\n * the itself.\n *\n * @param state\n * @param renderable\n */\n setIsRenderable(state, renderable) {\n state.isRenderable = renderable;\n }\n /**\n * Destroy/Clean up the state object\n *\n * @remarks\n * Opposite of createState(). Frees any event listeners / resources held by\n * the state that may not reliably get garbage collected.\n *\n * @param state\n */\n destroyState(state) {\n const stateEvents = ['loading', 'loaded', 'failed'];\n // Remove the old event listeners from previous state obj there was one\n stateEvents.forEach((eventName) => {\n state.emitter.off(eventName);\n });\n }\n /**\n * Schedule a state update via queueMicrotask\n *\n * @remarks\n * This method is used to schedule a state update via queueMicrotask. This\n * method should be called whenever a state update is needed, and it will\n * ensure that the state is only updated once per microtask.\n * @param state\n * @returns\n */\n scheduleUpdateState(state) {\n if (state.updateScheduled) {\n return;\n }\n state.updateScheduled = true;\n queueMicrotask(() => {\n state.updateScheduled = false;\n this.updateState(state);\n });\n }\n}\n//# sourceMappingURL=TextRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* eslint-disable @typescript-eslint/no-non-null-assertion */\nimport { getRgbaString } from '../../lib/utils.js';\nconst MAX_TEXTURE_DIMENSION = 2048;\n/**\n * Calculate height for the canvas\n *\n * @param textBaseline\n * @param fontSize\n * @param lineHeight\n * @param numLines\n * @param offsetY\n * @returns\n */\nfunction calcHeight(textBaseline, fontSize, lineHeight, numLines, offsetY) {\n const baselineOffset = textBaseline !== 'bottom' ? 0.5 * fontSize : 0;\n return (lineHeight * (numLines - 1) +\n baselineOffset +\n Math.max(lineHeight, fontSize) +\n (offsetY || 0));\n}\nexport class LightningTextTextureRenderer {\n _canvas;\n _context;\n _settings;\n renderInfo;\n constructor(canvas, context) {\n this._canvas = canvas;\n this._context = context;\n this._settings = this.mergeDefaults({});\n }\n set settings(v) {\n this._settings = this.mergeDefaults(v);\n }\n get settings() {\n return this._settings;\n }\n getPrecision() {\n return this._settings.precision;\n }\n setFontProperties() {\n this._context.font = this._getFontSetting();\n this._context.textBaseline = this._settings.textBaseline;\n }\n _getFontSetting() {\n const ff = [this._settings.fontFace];\n const ffs = [];\n for (let i = 0, n = ff.length; i < n; i++) {\n if (ff[i] === 'serif' || ff[i] === 'sans-serif') {\n ffs.push(ff[i]);\n }\n else {\n ffs.push(`\"${ff[i]}\"`);\n }\n }\n return `${this._settings.fontStyle} ${this._settings.fontSize * this.getPrecision()}px ${ffs.join(',')}`;\n }\n _load() {\n if (true && document.fonts) {\n const fontSetting = this._getFontSetting();\n try {\n if (!document.fonts.check(fontSetting, this._settings.text)) {\n // Use a promise that waits for loading.\n return document.fonts\n .load(fontSetting, this._settings.text)\n .catch((err) => {\n // Just load the fallback font.\n console.warn('[Lightning] Font load error', err, fontSetting);\n })\n .then(() => {\n if (!document.fonts.check(fontSetting, this._settings.text)) {\n console.warn('[Lightning] Font not found', fontSetting);\n }\n });\n }\n }\n catch (e) {\n console.warn(\"[Lightning] Can't check font loading for \" + fontSetting);\n }\n }\n }\n calculateRenderInfo() {\n const renderInfo = {};\n const precision = this.getPrecision();\n const paddingLeft = this._settings.paddingLeft * precision;\n const paddingRight = this._settings.paddingRight * precision;\n const fontSize = this._settings.fontSize * precision;\n let offsetY = this._settings.offsetY === null\n ? null\n : this._settings.offsetY * precision;\n let lineHeight = (this._settings.lineHeight || fontSize) * precision;\n const w = this._settings.w * precision;\n const h = this._settings.h * precision;\n let wordWrapWidth = this._settings.wordWrapWidth * precision;\n const cutSx = this._settings.cutSx * precision;\n const cutEx = this._settings.cutEx * precision;\n const cutSy = this._settings.cutSy * precision;\n const cutEy = this._settings.cutEy * precision;\n const letterSpacing = (this._settings.letterSpacing || 0) * precision;\n const textIndent = this._settings.textIndent * precision;\n // Set font properties.\n this.setFontProperties();\n // Total width.\n let width = w || 2048 / this.getPrecision();\n // Inner width.\n let innerWidth = width - paddingLeft;\n if (innerWidth < 10) {\n width += 10 - innerWidth;\n innerWidth = 10;\n }\n if (!wordWrapWidth) {\n wordWrapWidth = innerWidth;\n }\n // Text overflow\n if (this._settings.textOverflow && !this._settings.wordWrap) {\n let suffix;\n switch (this._settings.textOverflow) {\n case 'clip':\n suffix = '';\n break;\n case 'ellipsis':\n suffix = this._settings.overflowSuffix;\n break;\n default:\n suffix = this._settings.textOverflow;\n }\n this._settings.text = this.wrapWord(this._settings.text, wordWrapWidth - textIndent, suffix);\n }\n // word wrap\n // preserve original text\n let linesInfo;\n if (this._settings.wordWrap) {\n linesInfo = this.wrapText(this._settings.text, wordWrapWidth, letterSpacing, textIndent);\n }\n else {\n linesInfo = { l: this._settings.text.split(/(?:\\r\\n|\\r|\\n)/), n: [] };\n const n = linesInfo.l.length;\n for (let i = 0; i < n - 1; i++) {\n linesInfo.n.push(i);\n }\n }\n let lines = linesInfo.l;\n if (this._settings.maxLines && lines.length > this._settings.maxLines) {\n const usedLines = lines.slice(0, this._settings.maxLines);\n let otherLines = null;\n if (this._settings.overflowSuffix) {\n // Wrap again with max lines suffix enabled.\n const w = this._settings.overflowSuffix\n ? this.measureText(this._settings.overflowSuffix)\n : 0;\n const al = this.wrapText(usedLines[usedLines.length - 1], wordWrapWidth - w, letterSpacing, textIndent);\n usedLines[usedLines.length - 1] = `${al.l[0]}${this._settings.overflowSuffix}`;\n otherLines = [al.l.length > 1 ? al.l[1] : ''];\n }\n else {\n otherLines = [''];\n }\n // Re-assemble the remaining text.\n let i;\n const n = lines.length;\n let j = 0;\n const m = linesInfo.n.length;\n for (i = this._settings.maxLines; i < n; i++) {\n otherLines[j] += `${otherLines[j] ? ' ' : ''}${lines[i]}`;\n if (i + 1 < m && linesInfo.n[i + 1]) {\n j++;\n }\n }\n renderInfo.remainingText = otherLines.join('\\n');\n renderInfo.moreTextLines = true;\n lines = usedLines;\n }\n else {\n renderInfo.moreTextLines = false;\n renderInfo.remainingText = '';\n }\n // calculate text width\n let maxLineWidth = 0;\n const lineWidths = [];\n for (let i = 0; i < lines.length; i++) {\n const lineWidth = this.measureText(lines[i], letterSpacing) + (i === 0 ? textIndent : 0);\n lineWidths.push(lineWidth);\n maxLineWidth = Math.max(maxLineWidth, lineWidth);\n }\n renderInfo.lineWidths = lineWidths;\n if (!w) {\n // Auto-set width to max text length.\n width = maxLineWidth + paddingLeft + paddingRight;\n innerWidth = maxLineWidth;\n }\n // calculate text height\n lineHeight = lineHeight || fontSize;\n let height;\n if (h) {\n height = h;\n }\n else {\n height = calcHeight(this._settings.textBaseline, fontSize, lineHeight, lines.length, offsetY);\n }\n if (offsetY === null) {\n offsetY = fontSize;\n }\n renderInfo.w = width;\n renderInfo.h = height;\n renderInfo.lines = lines;\n renderInfo.precision = precision;\n if (!width) {\n // To prevent canvas errors.\n width = 1;\n }\n if (!height) {\n // To prevent canvas errors.\n height = 1;\n }\n if (cutSx || cutEx) {\n width = Math.min(width, cutEx - cutSx);\n }\n if (cutSy || cutEy) {\n height = Math.min(height, cutEy - cutSy);\n }\n renderInfo.width = width;\n renderInfo.innerWidth = innerWidth;\n renderInfo.height = height;\n renderInfo.fontSize = fontSize;\n renderInfo.cutSx = cutSx;\n renderInfo.cutSy = cutSy;\n renderInfo.cutEx = cutEx;\n renderInfo.cutEy = cutEy;\n renderInfo.lineHeight = lineHeight;\n renderInfo.lineWidths = lineWidths;\n renderInfo.offsetY = offsetY;\n renderInfo.paddingLeft = paddingLeft;\n renderInfo.paddingRight = paddingRight;\n renderInfo.letterSpacing = letterSpacing;\n renderInfo.textIndent = textIndent;\n return renderInfo;\n }\n draw(renderInfo, linesOverride) {\n const precision = this.getPrecision();\n // Allow lines to be overriden for partial rendering.\n const lines = linesOverride?.lines || renderInfo.lines;\n const lineWidths = linesOverride?.lineWidths || renderInfo.lineWidths;\n const height = linesOverride\n ? calcHeight(this._settings.textBaseline, renderInfo.fontSize, renderInfo.lineHeight, linesOverride.lines.length, this._settings.offsetY === null\n ? null\n : this._settings.offsetY * precision)\n : renderInfo.height;\n // Add extra margin to prevent issue with clipped text when scaling.\n this._canvas.width = Math.min(Math.ceil(renderInfo.width + this._settings.textRenderIssueMargin), MAX_TEXTURE_DIMENSION);\n this._canvas.height = Math.min(Math.ceil(height), MAX_TEXTURE_DIMENSION);\n // Canvas context has been reset.\n this.setFontProperties();\n if (renderInfo.fontSize >= 128) {\n // WpeWebKit bug: must force compositing because cairo-traps-compositor will not work with text first.\n this._context.globalAlpha = 0.01;\n this._context.fillRect(0, 0, 0.01, 0.01);\n this._context.globalAlpha = 1.0;\n }\n if (renderInfo.cutSx || renderInfo.cutSy) {\n this._context.translate(-renderInfo.cutSx, -renderInfo.cutSy);\n }\n let linePositionX;\n let linePositionY;\n const drawLines = [];\n // Draw lines line by line.\n for (let i = 0, n = lines.length; i < n; i++) {\n linePositionX = i === 0 ? renderInfo.textIndent : 0;\n // By default, text is aligned to top\n linePositionY = i * renderInfo.lineHeight + renderInfo.offsetY;\n if (this._settings.verticalAlign == 'middle') {\n linePositionY += (renderInfo.lineHeight - renderInfo.fontSize) / 2;\n }\n else if (this._settings.verticalAlign == 'bottom') {\n linePositionY += renderInfo.lineHeight - renderInfo.fontSize;\n }\n if (this._settings.textAlign === 'right') {\n linePositionX += renderInfo.innerWidth - lineWidths[i];\n }\n else if (this._settings.textAlign === 'center') {\n linePositionX += (renderInfo.innerWidth - lineWidths[i]) / 2;\n }\n linePositionX += renderInfo.paddingLeft;\n drawLines.push({\n text: lines[i],\n x: linePositionX,\n y: linePositionY,\n w: lineWidths[i],\n });\n }\n // Highlight.\n if (this._settings.highlight) {\n const color = this._settings.highlightColor;\n const hlHeight = this._settings.highlightHeight * precision || renderInfo.fontSize * 1.5;\n const offset = this._settings.highlightOffset * precision;\n const hlPaddingLeft = this._settings.highlightPaddingLeft !== null\n ? this._settings.highlightPaddingLeft * precision\n : renderInfo.paddingLeft;\n const hlPaddingRight = this._settings.highlightPaddingRight !== null\n ? this._settings.highlightPaddingRight * precision\n : renderInfo.paddingRight;\n this._context.fillStyle = getRgbaString(color);\n for (let i = 0; i < drawLines.length; i++) {\n const drawLine = drawLines[i];\n this._context.fillRect(drawLine.x - hlPaddingLeft, drawLine.y - renderInfo.offsetY + offset, drawLine.w + hlPaddingRight + hlPaddingLeft, hlHeight);\n }\n }\n // Text shadow.\n let prevShadowSettings = null;\n if (this._settings.shadow) {\n prevShadowSettings = [\n this._context.shadowColor,\n this._context.shadowOffsetX,\n this._context.shadowOffsetY,\n this._context.shadowBlur,\n ];\n this._context.shadowColor = getRgbaString(this._settings.shadowColor);\n this._context.shadowOffsetX = this._settings.shadowOffsetX * precision;\n this._context.shadowOffsetY = this._settings.shadowOffsetY * precision;\n this._context.shadowBlur = this._settings.shadowBlur * precision;\n }\n this._context.fillStyle = getRgbaString(this._settings.textColor);\n for (let i = 0, n = drawLines.length; i < n; i++) {\n const drawLine = drawLines[i];\n if (renderInfo.letterSpacing === 0) {\n this._context.fillText(drawLine.text, drawLine.x, drawLine.y);\n }\n else {\n const textSplit = drawLine.text.split('');\n let x = drawLine.x;\n for (let i = 0, j = textSplit.length; i < j; i++) {\n this._context.fillText(textSplit[i], x, drawLine.y);\n x += this.measureText(textSplit[i], renderInfo.letterSpacing);\n }\n }\n }\n if (prevShadowSettings) {\n this._context.shadowColor = prevShadowSettings[0];\n this._context.shadowOffsetX = prevShadowSettings[1];\n this._context.shadowOffsetY = prevShadowSettings[2];\n this._context.shadowBlur = prevShadowSettings[3];\n }\n if (renderInfo.cutSx || renderInfo.cutSy) {\n this._context.translate(renderInfo.cutSx, renderInfo.cutSy);\n }\n this.renderInfo = renderInfo;\n }\n wrapWord(word, wordWrapWidth, suffix) {\n const suffixWidth = this._context.measureText(suffix).width;\n const wordLen = word.length;\n const wordWidth = this._context.measureText(word).width;\n /* If word fits wrapWidth, do nothing */\n if (wordWidth <= wordWrapWidth) {\n return word;\n }\n /* Make initial guess for text cuttoff */\n let cutoffIndex = Math.floor((wordWrapWidth * wordLen) / wordWidth);\n let truncWordWidth = this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n /* In case guess was overestimated, shrink it letter by letter. */\n if (truncWordWidth > wordWrapWidth) {\n while (cutoffIndex > 0) {\n truncWordWidth =\n this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n if (truncWordWidth > wordWrapWidth) {\n cutoffIndex -= 1;\n }\n else {\n break;\n }\n }\n /* In case guess was underestimated, extend it letter by letter. */\n }\n else {\n while (cutoffIndex < wordLen) {\n truncWordWidth =\n this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n if (truncWordWidth < wordWrapWidth) {\n cutoffIndex += 1;\n }\n else {\n // Finally, when bound is crossed, retract last letter.\n cutoffIndex -= 1;\n break;\n }\n }\n }\n /* If wrapWidth is too short to even contain suffix alone, return empty string */\n return (word.substring(0, cutoffIndex) +\n (wordWrapWidth >= suffixWidth ? suffix : ''));\n }\n /**\n * Applies newlines to a string to have it optimally fit into the horizontal\n * bounds set by the Text object's wordWrapWidth property.\n */\n wrapText(text, wordWrapWidth, letterSpacing, indent = 0) {\n // Greedy wrapping algorithm that will wrap words as the line grows longer.\n // than its horizontal bounds.\n const lines = text.split(/\\r?\\n/g);\n let allLines = [];\n const realNewlines = [];\n for (let i = 0; i < lines.length; i++) {\n const resultLines = [];\n let result = '';\n let spaceLeft = wordWrapWidth - indent;\n const words = lines[i].split(' ');\n for (let j = 0; j < words.length; j++) {\n const wordWidth = this.measureText(words[j], letterSpacing);\n const wordWidthWithSpace = wordWidth + this.measureText(' ', letterSpacing);\n if (j === 0 || wordWidthWithSpace > spaceLeft) {\n // Skip printing the newline if it's the first word of the line that is.\n // greater than the word wrap width.\n if (j > 0) {\n resultLines.push(result);\n result = '';\n }\n result += words[j];\n spaceLeft = wordWrapWidth - wordWidth - (j === 0 ? indent : 0);\n }\n else {\n spaceLeft -= wordWidthWithSpace;\n result += ` ${words[j]}`;\n }\n }\n resultLines.push(result);\n result = '';\n allLines = allLines.concat(resultLines);\n if (i < lines.length - 1) {\n realNewlines.push(allLines.length);\n }\n }\n return { l: allLines, n: realNewlines };\n }\n measureText(word, space = 0) {\n if (!space) {\n return this._context.measureText(word).width;\n }\n return word.split('').reduce((acc, char) => {\n return acc + this._context.measureText(char).width + space;\n }, 0);\n }\n mergeDefaults(settings) {\n return {\n text: '',\n w: 0,\n h: 0,\n fontStyle: 'normal',\n fontSize: 40,\n fontFace: null,\n wordWrap: true,\n wordWrapWidth: 0,\n wordBreak: false,\n textOverflow: '',\n lineHeight: null,\n textBaseline: 'alphabetic',\n textAlign: 'left',\n verticalAlign: 'top',\n offsetY: null,\n maxLines: 0,\n overflowSuffix: '...',\n textColor: [1.0, 1.0, 1.0, 1.0],\n paddingLeft: 0,\n paddingRight: 0,\n shadow: false,\n shadowColor: [0.0, 0.0, 0.0, 1.0],\n shadowOffsetX: 0,\n shadowOffsetY: 0,\n shadowBlur: 5,\n highlight: false,\n highlightHeight: 0,\n highlightColor: [0.0, 0.0, 0.0, 1.0],\n highlightOffset: 0,\n highlightPaddingLeft: 0,\n highlightPaddingRight: 0,\n letterSpacing: 0,\n textIndent: 0,\n cutSx: 0,\n cutEx: 0,\n cutSy: 0,\n cutEy: 0,\n advancedRenderer: false,\n fontBaselineRatio: 0,\n precision: 1,\n textRenderIssueMargin: 0,\n ...settings,\n };\n }\n}\n//# sourceMappingURL=LightningTextTextureRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EventEmitter } from '../../../common/EventEmitter.js';\nimport { assertTruthy, mergeColorAlphaPremultiplied } from '../../../utils.js';\nimport { intersectRect, intersectBound, getNormalizedRgbaComponents, getNormalizedAlphaComponent, createBound, } from '../../lib/utils.js';\nimport { WebTrFontFace } from '../font-face-types/WebTrFontFace.js';\nimport { LightningTextTextureRenderer, } from './LightningTextTextureRenderer.js';\nimport { TextRenderer, } from './TextRenderer.js';\nconst resolvedGlobal = typeof self === 'undefined' ? globalThis : self;\n/**\n * Global font set regardless of if run in the main thread or a web worker\n */\nconst globalFontSet = (resolvedGlobal.document?.fonts ||\n resolvedGlobal.fonts);\nfunction getFontCssString(props) {\n const { fontFamily, fontStyle, fontWeight, fontStretch, fontSize } = props;\n return [fontStyle, fontWeight, fontStretch, `${fontSize}px`, fontFamily].join(' ');\n}\n/**\n * Ephemeral bounds object used for intersection calculations\n *\n * @remarks\n * Used to avoid creating a new object every time we need to intersect\n * element bounds.\n */\nconst tmpElementBounds = createBound(0, 0, 0, 0);\nexport class CanvasTextRenderer extends TextRenderer {\n canvas;\n context;\n rendererBounds;\n constructor(stage) {\n super(stage);\n if (typeof OffscreenCanvas !== 'undefined') {\n this.canvas = new OffscreenCanvas(0, 0);\n }\n else {\n this.canvas = document.createElement('canvas');\n }\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n let context = this.canvas.getContext('2d');\n if (!context) {\n // A browser may appear to support OffscreenCanvas but not actually support the Canvas '2d' context\n // Here we try getting the context again after falling back to an HTMLCanvasElement.\n // See: https://github.com/lightning-js/renderer/issues/26#issuecomment-1750438486\n this.canvas = document.createElement('canvas');\n context = this.canvas.getContext('2d');\n }\n assertTruthy(context);\n this.context = context;\n this.rendererBounds = {\n x1: 0,\n y1: 0,\n x2: this.stage.options.appWidth,\n y2: this.stage.options.appHeight,\n };\n }\n //#region Overrides\n getPropertySetters() {\n return {\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n text: (state, value) => {\n state.props.text = value;\n this.invalidateLayoutCache(state);\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n this.invalidateLayoutCache(state);\n },\n color: (state, value) => {\n state.props.color = value;\n this.invalidateLayoutCache(state);\n },\n x: (state, value) => {\n state.props.x = value;\n this.invalidateVisibleWindowCache(state);\n },\n y: (state, value) => {\n state.props.y = value;\n this.invalidateVisibleWindowCache(state);\n },\n contain: (state, value) => {\n state.props.contain = value;\n this.invalidateLayoutCache(state);\n },\n width: (state, value) => {\n state.props.width = value;\n // Only invalidate layout cache if we're containing in the horizontal direction\n if (state.props.contain !== 'none') {\n this.invalidateLayoutCache(state);\n }\n },\n height: (state, value) => {\n state.props.height = value;\n // Only invalidate layout cache if we're containing in the vertical direction\n if (state.props.contain === 'both') {\n this.invalidateLayoutCache(state);\n }\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n this.invalidateLayoutCache(state);\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n this.invalidateLayoutCache(state);\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n this.invalidateLayoutCache(state);\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n this.invalidateLayoutCache(state);\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n this.invalidateLayoutCache(state);\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n this.invalidateLayoutCache(state);\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n this.invalidateLayoutCache(state);\n },\n // debug: (state, value) => {\n // state.props.debug = value;\n // },\n };\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n canRenderFont(props) {\n // The canvas renderer can render any font because it automatically\n // falls back to system fonts. The CanvasTextRenderer should be\n // checked last if other renderers are preferred.\n return true;\n }\n isFontFaceSupported(fontFace) {\n return fontFace instanceof WebTrFontFace;\n }\n addFontFace(fontFace) {\n // Make sure the font face is an Canvas font face (it should have already passed\n // the `isFontFaceSupported` check)\n assertTruthy(fontFace instanceof WebTrFontFace);\n // We simply add the font face to the document\n // @ts-expect-error `add()` method should be available from a FontFaceSet\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n globalFontSet.add(fontFace.fontFace);\n }\n createState(props) {\n return {\n props,\n status: 'initialState',\n updateScheduled: false,\n emitter: new EventEmitter(),\n canvasPages: undefined,\n lightning2TextRenderer: new LightningTextTextureRenderer(this.canvas, this.context),\n renderWindow: undefined,\n visibleWindow: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n valid: false,\n },\n renderInfo: undefined,\n forceFullLayoutCalc: false,\n textW: 0,\n textH: 0,\n fontInfo: undefined,\n fontFaceLoadedHandler: undefined,\n isRenderable: false,\n debugData: {\n updateCount: 0,\n layoutCount: 0,\n drawCount: 0,\n lastLayoutNumCharacters: 0,\n layoutSum: 0,\n drawSum: 0,\n bufferSize: 0,\n },\n };\n }\n updateState(state) {\n // On the first update call we need to set the status to loading\n if (state.status === 'initialState') {\n this.setStatus(state, 'loading');\n }\n // If fontInfo is invalid, we need to establish it\n if (!state.fontInfo) {\n const cssString = getFontCssString(state.props);\n state.fontInfo = {\n cssString: cssString,\n // TODO: For efficiency we would use this here but it's not reliable on WPE -> document.fonts.check(cssString),\n loaded: false,\n };\n // If font is not loaded, set up a handler to update the font info when the font loads\n if (!state.fontInfo.loaded) {\n globalFontSet\n .load(cssString)\n .then(this.onFontLoaded.bind(this, state, cssString))\n .catch(this.onFontLoadError.bind(this, state, cssString));\n return;\n }\n }\n // If we're waiting for a font face to load, don't render anything\n if (!state.fontInfo.loaded) {\n return;\n }\n if (!state.renderInfo) {\n const maxLines = state.props.maxLines;\n const containedMaxLines = state.props.contain === 'both'\n ? Math.floor((state.props.height - state.props.offsetY) /\n state.props.lineHeight)\n : 0;\n const calcMaxLines = containedMaxLines > 0 && maxLines > 0\n ? Math.min(containedMaxLines, maxLines)\n : Math.max(containedMaxLines, maxLines);\n state.lightning2TextRenderer.settings = {\n text: state.props.text,\n textAlign: state.props.textAlign,\n fontFace: state.props.fontFamily,\n fontSize: state.props.fontSize,\n fontStyle: [\n state.props.fontStretch,\n state.props.fontStyle,\n state.props.fontWeight,\n ].join(' '),\n textColor: getNormalizedRgbaComponents(state.props.color),\n offsetY: state.props.fontSize + state.props.offsetY,\n wordWrap: state.props.contain !== 'none',\n wordWrapWidth: state.props.contain === 'none' ? undefined : state.props.width,\n letterSpacing: state.props.letterSpacing,\n lineHeight: state.props.lineHeight,\n maxLines: calcMaxLines,\n textBaseline: state.props.textBaseline,\n verticalAlign: state.props.verticalAlign,\n overflowSuffix: state.props.overflowSuffix,\n };\n // const renderInfoCalculateTime = performance.now();\n state.renderInfo = state.lightning2TextRenderer.calculateRenderInfo();\n // console.log(\n // 'Render info calculated in',\n // performance.now() - renderInfoCalculateTime,\n // 'ms',\n // );\n state.textH = state.renderInfo.lineHeight * state.renderInfo.lines.length;\n state.textW = state.renderInfo.width;\n // Invalidate renderWindow because the renderInfo changed\n state.renderWindow = undefined;\n }\n const { x, y, width, height, scrollY, contain } = state.props;\n const { visibleWindow } = state;\n let { renderWindow, canvasPages } = state;\n if (!visibleWindow.valid) {\n // Figure out whats actually in the bounds of the renderer/canvas (visibleWindow)\n const elementBounds = createBound(x, y, contain !== 'none' ? x + width : Infinity, contain === 'both' ? y + height : Infinity, tmpElementBounds);\n /**\n * Area that is visible on the screen.\n */\n intersectBound(this.rendererBounds, elementBounds, visibleWindow);\n visibleWindow.valid = true;\n }\n const visibleWindowHeight = visibleWindow.y2 - visibleWindow.y1;\n const maxLinesPerCanvasPage = Math.ceil(visibleWindowHeight / state.renderInfo.lineHeight);\n if (visibleWindowHeight === 0) {\n // Nothing to render. Clear any canvasPages and existing renderWindow\n // Return early.\n canvasPages = undefined;\n renderWindow = undefined;\n this.setStatus(state, 'loaded');\n return;\n }\n else if (renderWindow && canvasPages) {\n // Return early if we're still viewing inside the established render window\n // No need to re-render what we've already rendered\n const renderWindowScreenX1 = x + renderWindow.x1;\n const renderWindowScreenY1 = y - scrollY + renderWindow.y1;\n const renderWindowScreenX2 = x + renderWindow.x2;\n const renderWindowScreenY2 = y - scrollY + renderWindow.y2;\n if (renderWindowScreenX1 <= visibleWindow.x1 &&\n renderWindowScreenX2 >= visibleWindow.x2 &&\n renderWindowScreenY1 <= visibleWindow.y1 &&\n renderWindowScreenY2 >= visibleWindow.y2) {\n this.setStatus(state, 'loaded');\n return;\n }\n if (renderWindowScreenY2 < visibleWindow.y2) {\n // We've scrolled up, so we need to render the next page\n renderWindow.y1 += maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n renderWindow.y2 += maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n canvasPages.push(canvasPages.shift());\n canvasPages[2].lineNumStart =\n canvasPages[1].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[2].lineNumEnd =\n canvasPages[2].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[2].valid = false;\n }\n else if (renderWindowScreenY1 > visibleWindow.y1) {\n // We've scrolled down, so we need to render the previous page\n renderWindow.y1 -= maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n renderWindow.y2 -= maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n canvasPages.unshift(canvasPages.pop());\n canvasPages[0].lineNumStart =\n canvasPages[1].lineNumStart - maxLinesPerCanvasPage;\n canvasPages[0].lineNumEnd =\n canvasPages[0].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[0].valid = false;\n }\n }\n else {\n const pageHeight = state.renderInfo.lineHeight * maxLinesPerCanvasPage;\n const page1Block = Math.ceil(scrollY / pageHeight);\n const page1LineStart = page1Block * maxLinesPerCanvasPage;\n const page0LineStart = page1LineStart - maxLinesPerCanvasPage;\n const page2LineStart = page1LineStart + maxLinesPerCanvasPage;\n // We haven't rendered anything yet, so we need to render the first page\n // If canvasPages already exist, let's re-use the textures\n canvasPages = [\n {\n texture: canvasPages?.[0].texture,\n lineNumStart: page0LineStart,\n lineNumEnd: page0LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n {\n texture: canvasPages?.[1].texture,\n lineNumStart: page1LineStart,\n lineNumEnd: page1LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n {\n texture: canvasPages?.[2].texture,\n lineNumStart: page2LineStart,\n lineNumEnd: page2LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n ];\n state.canvasPages = canvasPages;\n const scrollYNearestPage = page1Block * pageHeight;\n renderWindow = {\n x1: 0,\n y1: scrollYNearestPage - pageHeight,\n x2: width,\n y2: scrollYNearestPage + pageHeight * 2,\n };\n }\n state.renderWindow = renderWindow;\n const pageDrawTime = performance.now();\n for (const pageInfo of canvasPages) {\n if (pageInfo.valid)\n continue;\n if (pageInfo.lineNumStart < 0) {\n pageInfo.texture?.setRenderableOwner(state, false);\n pageInfo.texture = this.stage.txManager.loadTexture('ImageTexture', {\n src: '',\n });\n pageInfo.texture.setRenderableOwner(state, state.isRenderable);\n pageInfo.valid = true;\n continue;\n }\n state.lightning2TextRenderer.draw(state.renderInfo, {\n lines: state.renderInfo.lines.slice(pageInfo.lineNumStart, pageInfo.lineNumEnd),\n lineWidths: state.renderInfo.lineWidths.slice(pageInfo.lineNumStart, pageInfo.lineNumEnd),\n });\n if (!(this.canvas.width === 0 || this.canvas.height === 0)) {\n pageInfo.texture?.setRenderableOwner(state, false);\n pageInfo.texture = this.stage.txManager.loadTexture('ImageTexture', {\n src: this.context.getImageData(0, 0, this.canvas.width, this.canvas.height),\n }, {\n preload: true,\n });\n pageInfo.texture.setRenderableOwner(state, state.isRenderable);\n }\n pageInfo.valid = true;\n }\n // console.log('pageDrawTime', performance.now() - pageDrawTime, 'ms');\n // Report final status\n this.setStatus(state, 'loaded');\n }\n renderQuads(state, transform, clippingRect, alpha) {\n const { stage } = this;\n const { canvasPages, textW = 0, textH = 0, renderWindow } = state;\n if (!canvasPages || !renderWindow)\n return;\n const { x, y, scrollY, contain, width, height /*, debug*/ } = state.props;\n const elementRect = {\n x: x,\n y: y,\n width: contain !== 'none' ? width : textW,\n height: contain === 'both' ? height : textH,\n };\n const visibleRect = intersectRect({\n x: 0,\n y: 0,\n width: stage.options.appWidth,\n height: stage.options.appHeight,\n }, elementRect);\n // if (!debug.disableScissor) {\n // renderer.enableScissor(\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n assertTruthy(canvasPages, 'canvasPages is not defined');\n assertTruthy(renderWindow, 'renderWindow is not defined');\n const renderWindowHeight = renderWindow.y2 - renderWindow.y1;\n const pageSize = renderWindowHeight / 3.0;\n const { zIndex, color } = state.props;\n // Color alpha of text is not properly rendered to the Canvas texture, so we\n // need to apply it here.\n const combinedAlpha = alpha * getNormalizedAlphaComponent(color);\n const quadColor = mergeColorAlphaPremultiplied(0xffffffff, combinedAlpha);\n if (canvasPages[0].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[0].texture?.dimensions?.width || 0,\n height: canvasPages[0].texture?.dimensions?.height || 0,\n texture: canvasPages[0].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n if (canvasPages[1].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[1].texture?.dimensions?.width || 0,\n height: canvasPages[1].texture?.dimensions?.height || 0,\n texture: canvasPages[1].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1 + pageSize,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n if (canvasPages[2].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[2].texture?.dimensions?.width || 0,\n height: canvasPages[2].texture?.dimensions?.height || 0,\n texture: canvasPages[2].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1 + pageSize + pageSize,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n // renderer.disableScissor();\n // if (debug.showElementRect) {\n // this.renderer.drawBorder(\n // Colors.Blue,\n // elementRect.x,\n // elementRect.y,\n // elementRect.w,\n // elementRect.h,\n // );\n // }\n // if (debug.showVisibleRect) {\n // this.renderer.drawBorder(\n // Colors.Green,\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // if (debug.showRenderWindow && renderWindow) {\n // this.renderer.drawBorder(\n // Colors.Red,\n // x + renderWindow.x1,\n // y + renderWindow.y1 - scrollY,\n // x + renderWindow.x2 - (x + renderWindow.x1),\n // y + renderWindow.y2 - scrollY - (y + renderWindow.y1 - scrollY),\n // );\n // }\n }\n setIsRenderable(state, renderable) {\n super.setIsRenderable(state, renderable);\n // Set state object owner from any canvas page textures\n state.canvasPages?.forEach((pageInfo) => {\n pageInfo.texture?.setRenderableOwner(state, renderable);\n });\n }\n destroyState(state) {\n // Remove state object owner from any canvas page textures\n state.canvasPages?.forEach((pageInfo) => {\n pageInfo.texture?.setRenderableOwner(state, false);\n });\n }\n //#endregion Overrides\n /**\n * Invalidate the visible window stored in the state. This will cause a new\n * visible window to be calculated on the next update.\n *\n * @param state\n */\n invalidateVisibleWindowCache(state) {\n state.visibleWindow.valid = false;\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n /**\n * Invalidate the layout cache stored in the state. This will cause the text\n * to be re-layed out on the next update.\n *\n * @remarks\n * This also invalidates the visible window cache.\n *\n * @param state\n */\n invalidateLayoutCache(state) {\n state.renderInfo = undefined;\n state.visibleWindow.valid = false;\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n onFontLoaded(state, cssString) {\n if (cssString !== state.fontInfo?.cssString || !state.fontInfo) {\n return;\n }\n state.fontInfo.loaded = true;\n this.scheduleUpdateState(state);\n }\n onFontLoadError(state, cssString, error) {\n if (cssString !== state.fontInfo?.cssString || !state.fontInfo) {\n return;\n }\n // Font didn't actually load, but we'll log the error and mark it as loaded\n // because the browser can still render with a fallback font.\n state.fontInfo.loaded = true;\n console.error(`CanvasTextRenderer: Error loading font '${state.fontInfo.cssString}'`, error);\n this.scheduleUpdateState(state);\n }\n}\n//# sourceMappingURL=CanvasTextRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\nexport class DefaultShader extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2fv' },\n ],\n });\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `,\n fragment: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate);\n gl_FragColor = vec4(v_color) * texture2D(u_texture, v_textureCoordinate);\n }\n `,\n };\n}\n//# sourceMappingURL=DefaultShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\n// import type { Texture } from '../textures/Texture';\nexport class DefaultShaderBatched extends WebGlCoreShader {\n supportsIndexedTextures = true;\n constructor(renderer) {\n super({\n renderer,\n attributes: [\n 'a_position',\n 'a_textureCoordinate',\n 'a_color',\n 'a_textureIndex',\n ],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_textures[0]', uniform: 'uniform1iv' },\n ],\n });\n }\n bindTextures(texture) {\n const { renderer, glw } = this;\n if (texture.length > renderer.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS) {\n throw new Error(`DefaultShaderBatched: Cannot bind more than ${renderer.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS} textures`);\n }\n texture.forEach((t, i) => {\n glw.activeTexture(i);\n glw.bindTexture(t.ctxTexture);\n });\n const samplers = Array.from(Array(texture.length).keys());\n this.setUniform('u_textures[0]', samplers);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `,\n fragment: (textureUnits) => `\n #define txUnits ${textureUnits}\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_image;\n uniform sampler2D u_textures[txUnits];\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n vec4 sampleFromTexture(sampler2D textures[${textureUnits}], int idx, vec2 uv) {\n ${Array.from(Array(textureUnits).keys())\n .map((idx) => `\n ${idx !== 0 ? 'else ' : ''}if (idx == ${idx}) {\n return texture2D(textures[${idx}], uv);\n }\n `)\n .join('')}\n return texture2D(textures[0], uv);\n }\n\n void main(){\n gl_FragColor = vec4(v_color) * sampleFromTexture(u_textures, int(v_textureIndex), v_textureCoordinate);\n }\n `,\n };\n}\n//# sourceMappingURL=DefaultShaderBatched.js.map","import { WebGlCoreShader, } from '../WebGlCoreShader.js';\nimport { ShaderEffect } from './effects/ShaderEffect.js';\nimport memize from 'memize';\nconst effectCache = new Map();\nconst getResolvedEffect = (effects, effectContructors) => {\n const key = JSON.stringify(effects);\n if (effectCache.has(key)) {\n return effectCache.get(key);\n }\n const value = (effects ?? []).map((effect) => ({\n type: effect.type,\n props: effectContructors[effect.type].resolveDefaults((effect.props || {})),\n }));\n effectCache.set(key, value);\n return value;\n};\nexport class DynamicShader extends WebGlCoreShader {\n effects = [];\n constructor(renderer, props, effectContructors) {\n const shader = DynamicShader.createShader(props, effectContructors);\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2fv' },\n { name: 'u_dimensions', uniform: 'uniform2fv' },\n { name: 'u_alpha', uniform: 'uniform1f' },\n ...shader.uniforms,\n ],\n shaderSources: {\n vertex: shader.vertex,\n fragment: shader.fragment,\n },\n });\n this.effects = shader.effects;\n this.calculateProps = memize(this.calculateProps.bind(this));\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n calculateProps(effects) {\n const regEffects = this.renderer.shManager.getRegisteredEffects();\n const results = [];\n effects?.forEach((eff, index) => {\n const effect = this.effects[index];\n const fxClass = regEffects[effect.name];\n const props = eff.props ?? {};\n const uniInfo = effect.uniformInfo;\n Object.keys(props).forEach((p) => {\n const fxProp = fxClass.uniforms[p];\n const propInfo = uniInfo[p];\n let value = fxProp.validator\n ? fxProp.validator(props[p], props)\n : props[p];\n if (Array.isArray(value)) {\n value = new Float32Array(value);\n }\n results.push({ name: propInfo.name, value });\n });\n });\n return results;\n }\n bindProps(props) {\n const results = this.calculateProps(props.effects);\n results.forEach((r) => {\n this.setUniform(r.name, r.value);\n });\n }\n canBatchShaderProps(propsA, propsB) {\n if (propsA.$dimensions.width !== propsB.$dimensions.width ||\n propsA.$dimensions.height !== propsB.$dimensions.height ||\n propsA.effects.length !== propsB.effects.length) {\n return false;\n }\n const propsEffectsLen = propsA.effects.length;\n let i = 0;\n for (; i < propsEffectsLen; i++) {\n const effectA = propsA.effects[i];\n const effectB = propsB.effects[i];\n if (effectA.type !== effectB.type) {\n return false;\n }\n for (const key in effectA.props) {\n if ((effectB.props && !effectB.props[key]) ||\n effectA.props[key] !== effectB.props[key]) {\n return false;\n }\n }\n }\n return true;\n }\n static createShader(props, effectContructors) {\n //counts duplicate effects\n const effectNameCount = {};\n const methods = {};\n let declareUniforms = '';\n const uniforms = [];\n const uFx = [];\n const effects = props.effects.map((effect) => {\n const baseClass = effectContructors[effect.type];\n const key = baseClass.getEffectKey(effect.props || {});\n effectNameCount[key] = effectNameCount[key] ? ++effectNameCount[key] : 1;\n const nr = effectNameCount[key];\n if (nr === 1) {\n uFx.push({ key, type: effect.type, props: effect.props });\n }\n //initialize new effect class;\n const fxClass = new baseClass({\n ref: `${key}${nr === 1 ? '' : nr}`,\n target: key,\n props: effect.props,\n });\n declareUniforms += fxClass.declaredUniforms;\n uniforms.push(...Object.values(fxClass.uniformInfo));\n return fxClass;\n });\n //build source\n let effectMethods = '';\n uFx?.forEach((fx) => {\n const fxClass = effectContructors[fx.type];\n const fxProps = fxClass.resolveDefaults((fx.props ?? {}));\n const remap = [];\n for (const m in fxClass.methods) {\n let cm = m;\n const fxMethod = fxClass.methods[m];\n if (methods[m] && methods[m] !== fxMethod) {\n cm = DynamicShader.resolveMethodDuplicate(m, fxMethod, methods);\n }\n methods[cm] = fxMethod.replace('function', cm);\n remap.push({ m, cm });\n }\n let onShaderMask = fxClass.onShaderMask instanceof Function\n ? fxClass.onShaderMask(fxProps)\n : fxClass.onShaderMask;\n let onColorize = fxClass.onColorize instanceof Function\n ? fxClass.onColorize(fxProps)\n : fxClass.onColorize;\n let onEffectMask = fxClass.onEffectMask instanceof Function\n ? fxClass.onEffectMask(fxProps)\n : fxClass.onEffectMask;\n remap.forEach((r) => {\n const { m, cm } = r;\n const reg = new RegExp(`\\\\$${m}`, 'g');\n if (onShaderMask) {\n onShaderMask = onShaderMask.replace(reg, cm);\n }\n if (onColorize) {\n onColorize = onColorize.replace(reg, cm);\n }\n if (onEffectMask) {\n onEffectMask = onEffectMask.replace(reg, cm);\n }\n });\n const methodParameters = fxClass.getMethodParameters(fxClass.uniforms, fxProps);\n const pm = methodParameters.length > 0 ? `, ${methodParameters}` : '';\n if (onShaderMask) {\n effectMethods += `\n float fx_${fx.key}_onShaderMask(float shaderMask ${pm}) {\n ${onShaderMask}\n }\n `;\n }\n if (onColorize) {\n effectMethods += `\n vec4 fx_${fx.key}_onColorize(float shaderMask, vec4 maskColor, vec4 shaderColor${pm}) {\n ${onColorize}\n }\n `;\n }\n if (onEffectMask) {\n effectMethods += `\n vec4 fx_${fx.key}_onEffectMask(float shaderMask, vec4 maskColor, vec4 shaderColor${pm}) {\n ${onEffectMask}\n }\n `;\n }\n });\n let sharedMethods = '';\n for (const m in methods) {\n sharedMethods += methods[m];\n }\n //fill main functions\n let currentMask = `mix(shaderColor, maskColor, clamp(-(lng_DefaultMask), 0.0, 1.0))`;\n let drawEffects = `\n\n `;\n for (let i = 0; i < effects.length; i++) {\n const current = effects[i];\n const pm = current.passParameters.length > 0 ? `, ${current.passParameters}` : '';\n const currentClass = effectContructors[current.name];\n if (currentClass.onShaderMask) {\n drawEffects += `\n shaderMask = fx_${current.target}_onShaderMask(shaderMask ${pm});\n `;\n }\n if (currentClass.onColorize) {\n drawEffects += `\n maskColor = fx_${current.target}_onColorize(shaderMask, maskColor, shaderColor${pm});\n `;\n }\n if (currentClass.onEffectMask) {\n currentMask = `fx_${current.target}_onEffectMask(shaderMask, maskColor, shaderColor${pm})`;\n }\n const next = effects[i + 1];\n if (next === undefined ||\n effectContructors[next.name].onEffectMask) {\n drawEffects += `\n shaderColor = ${currentMask};\n `;\n }\n }\n return {\n effects,\n uniforms,\n fragment: DynamicShader.fragment(declareUniforms, sharedMethods, effectMethods, drawEffects),\n vertex: DynamicShader.vertex(),\n };\n }\n static resolveMethodDuplicate(key, effectMethod, methodCollection, increment = 0) {\n const m = key + (increment > 0 ? increment : '');\n if (methodCollection[m] && methodCollection[m] !== effectMethod) {\n return this.resolveMethodDuplicate(key, effectMethod, methodCollection, ++increment);\n }\n return m;\n }\n static resolveDefaults(props, effectContructors) {\n return {\n effects: getResolvedEffect(props.effects, effectContructors),\n $dimensions: {\n width: 0,\n height: 0,\n },\n $alpha: 0,\n };\n }\n static makeCacheKey(props, effectContructors) {\n let fx = '';\n props.effects?.forEach((effect) => {\n const baseClass = effectContructors[effect.type];\n const key = baseClass.getEffectKey(effect.props || {});\n fx += `,${key}`;\n });\n return `DynamicShader${fx}`;\n }\n static z$__type__Props;\n static vertex = () => `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `;\n static fragment = (uniforms, methods, effectMethods, drawEffects) => `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n #define PI 3.14159265359\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_alpha;\n uniform float u_radius;\n uniform sampler2D u_texture;\n uniform float u_pixelRatio;\n\n ${uniforms}\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n ${methods}\n\n ${effectMethods}\n\n void main() {\n vec2 p = v_textureCoordinate.xy * u_dimensions - u_dimensions * 0.5;\n vec2 d = abs(p) - (u_dimensions) * 0.5;\n float lng_DefaultMask = min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n\n vec4 shaderColor = vec4(0.0);\n float shaderMask = lng_DefaultMask;\n\n vec4 maskColor = texture2D(u_texture, v_textureCoordinate) * v_color;\n\n shaderColor = mix(shaderColor, maskColor, clamp(-(lng_DefaultMask + 0.5), 0.0, 1.0));\n\n ${drawEffects}\n\n gl_FragColor = shaderColor * u_alpha;\n }\n `;\n}\n//# sourceMappingURL=DynamicShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader, } from '../WebGlCoreShader.js';\n/**\n * Similar to the {@link DefaultShader} but cuts out 4 rounded rectangle corners\n * as defined by the specified corner {@link RoundedRectangleProps.radius}\n */\nexport class RoundedRectangle extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2f' },\n { name: 'u_dimensions', uniform: 'uniform2fv' },\n { name: 'u_radius', uniform: 'uniform1f' },\n ],\n });\n }\n static z$__type__Props;\n static resolveDefaults(props) {\n return {\n radius: props.radius || 10,\n $dimensions: {\n width: 0,\n height: 0,\n },\n };\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n bindProps(props) {\n this.setUniform('u_radius', props.radius);\n }\n canBatchShaderProps(propsA, propsB) {\n return (propsA.radius === propsB.radius &&\n propsA.$dimensions.width === propsB.$dimensions.width &&\n propsA.$dimensions.height === propsB.$dimensions.height);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `,\n fragment: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_radius;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n float boxDist(vec2 p, vec2 size, float radius){\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n\n float fillMask(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate) * v_color;\n vec2 halfDimensions = u_dimensions * 0.5;\n\n float d = boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions + 0.5, u_radius);\n gl_FragColor = mix(vec4(0.0), color, fillMask(d));\n }\n `,\n };\n}\n//# sourceMappingURL=RoundedRectangle.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../lib/utils.js';\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\nconst IDENTITY_MATRIX_3x3 = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]);\n/**\n * SdfShader supports multi-channel and single-channel signed distance field textures.\n *\n * @remarks\n * This Shader is used by the {@link SdfTextRenderer}. Do not use thie Shader\n * directly. Instead create a Text Node and assign a SDF font family to it.\n *\n * @internalRemarks\n * The only thing this shader does to support multi-channel SDFs is to\n * add a median function to the fragment shader. If this one function call\n * ends up being a performance bottleneck we can always look at ways to\n * remove it.\n */\nexport class SdfShader extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_transform', uniform: 'uniformMatrix3fv' },\n { name: 'u_scrollY', uniform: 'uniform1f' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2f' },\n { name: 'u_color', uniform: 'uniform4fv' },\n { name: 'u_size', uniform: 'uniform1f' },\n { name: 'u_distanceRange', uniform: 'uniform1f' },\n { name: 'u_debug', uniform: 'uniform1i' },\n ],\n });\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n bindProps(props) {\n const resolvedProps = SdfShader.resolveDefaults(props);\n for (const key in resolvedProps) {\n if (key === 'transform') {\n this.setUniform('u_transform', false, resolvedProps[key]);\n }\n else if (key === 'scrollY') {\n this.setUniform('u_scrollY', resolvedProps[key]);\n }\n else if (key === 'color') {\n const components = getNormalizedRgbaComponents(resolvedProps.color);\n this.setUniform('u_color', components);\n }\n else if (key === 'size') {\n this.setUniform('u_size', resolvedProps[key]);\n }\n else if (key === 'distanceRange') {\n this.setUniform('u_distanceRange', resolvedProps[key]);\n }\n else if (key === 'debug') {\n this.setUniform('u_debug', resolvedProps[key] ? 1.0 : 0.0);\n }\n }\n }\n static resolveDefaults(props = {}) {\n return {\n transform: props.transform ?? IDENTITY_MATRIX_3x3,\n scrollY: props.scrollY ?? 0,\n color: props.color ?? 0xffffffff,\n size: props.size ?? 16,\n distanceRange: props.distanceRange ?? 1.0,\n debug: props.debug ?? false,\n };\n }\n static shaderSources = {\n vertex: `\n // an attribute is an input (in) to a vertex shader.\n // It will receive data from a buffer\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n\n uniform vec2 u_resolution;\n uniform mat3 u_transform;\n uniform float u_scrollY;\n uniform float u_pixelRatio;\n uniform float u_size;\n\n varying vec2 v_texcoord;\n\n void main() {\n vec2 scrolledPosition = a_position * u_size - vec2(0, u_scrollY);\n vec2 transformedPosition = (u_transform * vec3(scrolledPosition, 1)).xy;\n gl_Position = vec4((transformedPosition * u_pixelRatio / u_resolution * 2.0 - 1.0) * vec2(1, -1), 0, 1);\n v_texcoord = a_textureCoordinate;\n }\n `,\n fragment: `\n precision highp float;\n\n uniform vec4 u_color;\n uniform sampler2D u_texture;\n uniform float u_distanceRange;\n uniform float u_pixelRatio;\n uniform int u_debug;\n\n varying vec2 v_texcoord;\n\n float median(float r, float g, float b) {\n return max(min(r, g), min(max(r, g), b));\n }\n\n void main() {\n vec3 sample = texture2D(u_texture, v_texcoord).rgb;\n if (u_debug == 1) {\n gl_FragColor = vec4(sample.r, sample.g, sample.b, 1.0);\n return;\n }\n float scaledDistRange = u_distanceRange * u_pixelRatio;\n float sigDist = scaledDistRange * (median(sample.r, sample.g, sample.b) - 0.5);\n float opacity = clamp(sigDist + 0.5, 0.0, 1.0) * u_color.a;\n\n // Build the final color.\n // IMPORTANT: We must premultiply the color by the alpha value before returning it.\n gl_FragColor = vec4(u_color.r * opacity, u_color.g * opacity, u_color.b * opacity, opacity);\n }\n `,\n };\n}\n//# sourceMappingURL=SdfShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Masks the current maskcolor with rounded corners similar to {@link RoundedRectangle}\n */\nexport class RadiusEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radius';\n static getEffectKey() {\n return `radius`;\n }\n static uniforms = {\n radius: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n boxDist: `\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n `,\n };\n static resolveDefaults(props) {\n return {\n radius: props.radius ?? 10,\n };\n }\n static onShaderMask = `\n vec2 halfDimensions = u_dimensions * 0.5;\n float r = radius[0] * step(v_textureCoordinate.x, 0.5) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[1] * step(0.5, v_textureCoordinate.x) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[2] * step(0.5, v_textureCoordinate.x) * step(0.5, v_textureCoordinate.y);\n r = r + radius[3] * step(v_textureCoordinate.x, 0.5) * step(0.5, v_textureCoordinate.y);\n return $boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions, r);\n `;\n static onEffectMask = `\n return mix(vec4(0.0), maskColor, $fillMask(shaderMask));\n `;\n}\n//# sourceMappingURL=RadiusEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderEffect renders a border along all edges of an element\n */\nexport class BorderEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'border';\n static getEffectKey() {\n return `border`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static onEffectMask = `\n float mask = clamp(shaderMask + width, 0.0, 1.0) - clamp(shaderMask, 0.0, 1.0);\n return mix(shaderColor, mix(shaderColor, maskColor, maskColor.a), mask);\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Linear Gradient effect over a effect mask\n */\nexport class LinearGradientEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'linearGradient';\n static getEffectKey(props) {\n return `linearGradient${props.colors.length}`;\n }\n static resolveDefaults(props) {\n const colors = props.colors ?? [0xff000000, 0xffffffff];\n let stops = props.stops || [];\n if (stops.length === 0 || stops.length !== colors.length) {\n const colorsL = colors.length;\n let i = 0;\n const tmp = stops;\n for (; i < colorsL; i++) {\n if (stops[i]) {\n tmp[i] = stops[i];\n if (stops[i - 1] === undefined && tmp[i - 2] !== undefined) {\n tmp[i - 1] = tmp[i - 2] + (stops[i] - tmp[i - 2]) / 2;\n }\n }\n else {\n tmp[i] = i * (1 / (colors.length - 1));\n }\n }\n stops = tmp;\n }\n return {\n colors,\n stops,\n angle: props.angle ?? 0,\n };\n }\n static uniforms = {\n angle: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n colors: {\n value: 0xffffffff,\n validator: (rgbas) => {\n const cols = rgbas.map((rgbas) => getNormalizedRgbaComponents(rgbas));\n return cols.reduce((acc, val) => acc.concat(val), []);\n },\n size: (props) => props.colors.length,\n method: 'uniform4fv',\n type: 'vec4',\n },\n stops: {\n value: [],\n size: (props) => props.colors.length,\n method: 'uniform1fv',\n type: 'float',\n },\n };\n static methods = {\n fromLinear: `\n vec4 function(vec4 linearRGB) {\n vec4 higher = vec4(1.055)*pow(linearRGB, vec4(1.0/2.4)) - vec4(0.055);\n vec4 lower = linearRGB * vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n `,\n toLinear: `\n vec4 function(vec4 sRGB) {\n vec4 higher = pow((sRGB + vec4(0.055))/vec4(1.055), vec4(2.4));\n vec4 lower = sRGB/vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n `,\n calcPoint: `\n vec2 function(float d, float angle) {\n return d * vec2(cos(angle), sin(angle)) + (u_dimensions * 0.5);\n }\n `,\n };\n static ColorLoop = (amount) => {\n let loop = '';\n for (let i = 2; i < amount; i++) {\n loop += `colorOut = mix(colorOut, colors[${i}], clamp((dist - stops[${i - 1}]) / (stops[${i}] - stops[${i - 1}]), 0.0, 1.0));`;\n }\n return loop;\n };\n static onColorize = (props) => {\n const colors = props.colors.length || 1;\n return `\n float a = angle - (PI / 180.0 * 90.0);\n float lineDist = abs(u_dimensions.x * cos(a)) + abs(u_dimensions.y * sin(a));\n vec2 f = $calcPoint(lineDist * 0.5, a);\n vec2 t = $calcPoint(lineDist * 0.5, a + PI);\n vec2 gradVec = t - f;\n float dist = dot(v_textureCoordinate.xy * u_dimensions - f, gradVec) / dot(gradVec, gradVec);\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = $fromLinear(mix($toLinear(colors[0]), $toLinear(colors[1]), stopCalc));\n ${this.ColorLoop(colors)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `;\n };\n}\n//# sourceMappingURL=LinearGradientEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Grayscale effect grayscales the color values of the current mask color\n */\nexport class GrayscaleEffect extends ShaderEffect {\n name = 'grayscale';\n static getEffectKey() {\n return `grayscale`;\n }\n static resolveDefaults(props) {\n return {\n amount: props.amount ?? 1,\n };\n }\n static uniforms = {\n amount: {\n value: 1,\n method: 'uniform1f',\n type: 'float',\n },\n };\n static onColorize = `\n float grayness = 0.2 * maskColor.r + 0.6 * maskColor.g + 0.2 * maskColor.b;\n return vec4(amount * vec3(grayness) + (1.0 - amount) * maskColor.rgb, maskColor.a);\n `;\n}\n//# sourceMappingURL=GrayscaleEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the right side of an element\n */\nexport class BorderRightEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderRight';\n static getEffectKey() {\n return `borderRight`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(u_dimensions.x - width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderRightEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the top side of an element\n */\nexport class BorderTopEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderTop';\n static getEffectKey() {\n return `borderTop`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(0.0, width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderTopEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the bottom side of an element\n */\nexport class BorderBottomEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderBottom';\n static getEffectKey() {\n return `borderBottom`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(0.0, u_dimensions.y - width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderBottomEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the left of an element\n */\nexport class BorderLeftEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderLeft';\n static getEffectKey() {\n return `borderLeft`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderLeftEffect.js.map","import { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Renders a Glitch effect using the incoming texture\n */\nexport class GlitchEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'glitch';\n static getEffectKey(props) {\n return `glitch`;\n }\n static resolveDefaults(props) {\n return {\n amplitude: props.amplitude ?? 0.2,\n narrowness: props.narrowness ?? 4.0,\n blockiness: props.blockiness ?? 2.0,\n minimizer: props.minimizer ?? 8.0,\n time: props.time ?? Date.now(),\n };\n }\n static uniforms = {\n amplitude: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n narrowness: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n blockiness: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n minimizer: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n time: {\n value: 0,\n method: 'uniform1f',\n validator: (value) => {\n return (Date.now() - value) % 1000;\n },\n type: 'float',\n },\n };\n static methods = {\n rand: `\n float function(vec2 p, float time) {\n float t = floor(time * 20.) / 10.;\n return fract(sin(dot(p, vec2(t * 12.9898, t * 78.233))) * 43758.5453);\n }\n `,\n noise: `\n float function(vec2 uv, float blockiness, float time) {\n vec2 lv = fract(uv);\n vec2 id = floor(uv);\n\n float n1 = rand(id, time);\n float n2 = rand(id+vec2(1,0), time);\n float n3 = rand(id+vec2(0,1), time);\n float n4 = rand(id+vec2(1,1), time);\n vec2 u = smoothstep(0.0, 1.0 + blockiness, lv);\n return mix(mix(n1, n2, u.x), mix(n3, n4, u.x), u.y);\n }\n `,\n fbm: `\n float function(vec2 uv, int count, float blockiness, float complexity, float time) {\n float val = 0.0;\n float amp = 0.5;\n const int MAX_ITERATIONS = 10;\n\n for(int i = 0; i < MAX_ITERATIONS; i++) {\n if(i >= count) {break;}\n val += amp * noise(uv, blockiness, time);\n amp *= 0.5;\n uv *= complexity;\n }\n return val;\n }\n `,\n };\n static onColorize = `\n vec2 uv = v_textureCoordinate.xy;\n float aspect = u_dimensions.x / u_dimensions.y;\n vec2 a = vec2(uv.x * aspect , uv.y);\n vec2 uv2 = vec2(a.x / u_dimensions.x, exp(a.y));\n\n float shift = amplitude * pow($fbm(uv2, 4, blockiness, narrowness, time), minimizer);\n float colR = texture2D(u_texture, vec2(uv.x + shift, uv.y)).r * (1. - shift);\n float colG = texture2D(u_texture, vec2(uv.x - shift, uv.y)).g * (1. - shift);\n float colB = texture2D(u_texture, vec2(uv.x - shift, uv.y)).b * (1. - shift);\n\n vec3 f = vec3(colR, colG, colB);\n return vec4(f, texture2D(u_texture, vec2(uv.x - shift, uv.y)).a);\n `;\n}\n//# sourceMappingURL=GlitchEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\nexport class FadeOutEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'fadeOut';\n static getEffectKey() {\n return `fadeOut`;\n }\n static uniforms = {\n fade: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static resolveDefaults(props) {\n return {\n fade: props.fade ?? 10,\n };\n }\n static onColorize = `\n vec2 point = v_textureCoordinate.xy * u_dimensions.xy;\n vec2 pos1;\n vec2 pos2;\n vec2 d;\n float c;\n vec4 result = maskColor;\n\n\n if(fade[0] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x, point.y + fade[0]);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[1] > 0.0) {\n pos1 = vec2(point.x - u_dimensions.x - fade[1], v_textureCoordinate.y);\n pos2 = vec2(point.x - u_dimensions.x, v_textureCoordinate.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[2] > 0.0) {\n pos1 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y - fade[2]);\n pos2 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[3] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x + fade[3], point.y);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n return result;\n `;\n}\n//# sourceMappingURL=FadeOutEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\nexport class RadialGradientEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radialGradient';\n static getEffectKey(props) {\n return `radialGradient${props.colors.length}`;\n }\n static resolveDefaults(props) {\n const colors = props.colors ?? [0xff000000, 0xffffffff];\n let stops = props.stops || [];\n if (stops.length === 0 || stops.length !== colors.length) {\n const colorsL = colors.length;\n let i = 0;\n const tmp = stops;\n for (; i < colorsL; i++) {\n if (stops[i]) {\n tmp[i] = stops[i];\n if (stops[i - 1] === undefined && tmp[i - 2] !== undefined) {\n tmp[i - 1] = tmp[i - 2] + (stops[i] - tmp[i - 2]) / 2;\n }\n }\n else {\n tmp[i] = i * (1 / (colors.length - 1));\n }\n }\n stops = tmp;\n }\n return {\n colors,\n stops,\n width: props.width ?? 0,\n height: props.height ?? props.width ?? 0,\n pivot: props.pivot ?? [0.5, 0.5],\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n height: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n pivot: {\n value: [0.5, 0.5],\n method: 'uniform2fv',\n type: 'vec2',\n },\n colors: {\n value: 0xffffffff,\n validator: (rgbas) => {\n const cols = rgbas.map((rgbas) => getNormalizedRgbaComponents(rgbas));\n return cols.reduce((acc, val) => acc.concat(val), []);\n },\n size: (props) => props.colors.length,\n method: 'uniform4fv',\n type: 'vec4',\n },\n stops: {\n value: [],\n size: (props) => props.colors.length,\n method: 'uniform1fv',\n type: 'float',\n },\n };\n static ColorLoop = (amount) => {\n let loop = '';\n for (let i = 2; i < amount; i++) {\n loop += `colorOut = mix(colorOut, colors[${i}], clamp((dist - stops[${i - 1}]) / (stops[${i}] - stops[${i - 1}]), 0.0, 1.0));`;\n }\n return loop;\n };\n static onColorize = (props) => {\n const colors = props.colors.length || 1;\n return `\n vec2 point = v_textureCoordinate.xy * u_dimensions;\n vec2 projection = vec2(pivot.x * u_dimensions.x, pivot.y * u_dimensions.y);\n\n float dist = length((point - projection) / vec2(width, height));\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = mix(colors[0], colors[1], stopCalc);\n ${this.ColorLoop(colors)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `;\n };\n}\n//# sourceMappingURL=RadialGradientEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The RadialProgressEffect renders a border along all edges of an element\n */\nexport class RadialProgressEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radialProgress';\n static getEffectKey() {\n return `radialProgress`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n progress: props.progress ?? 0.5,\n offset: props.offset ?? 0,\n range: props.range ?? Math.PI * 2,\n rounded: props.rounded ?? false,\n radius: props.radius ?? 1,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n progress: {\n value: 0.5,\n method: 'uniform1f',\n type: 'float',\n },\n offset: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n range: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n rounded: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n validator: (value) => {\n return value ? 1 : 0;\n },\n },\n radius: {\n value: 1,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n rotateUV: `\n vec2 function(vec2 uv, float d) {\n float s = sin(d);\n float c = cos(d);\n mat2 rotMatrix = mat2(c, -s, s, c);\n return uv * rotMatrix;\n }\n `,\n drawDot: `\n float function(vec2 uv, vec2 p, float r) {\n uv += p;\n float circle = length(uv) - r;\n return clamp(-circle, 0.0, 1.0);\n }\n `,\n };\n static onEffectMask = `\n float outerRadius = radius * u_dimensions.y * 0.5;\n\n float endAngle = range * progress - 0.0005;\n\n vec2 uv = v_textureCoordinate.xy * u_dimensions.xy - u_dimensions * 0.5;\n\n uv = $rotateUV(uv, -(offset));\n float linewidth = width * u_pixelRatio;\n float circle = length(uv) - (outerRadius - linewidth) ;\n circle = abs(circle) - linewidth;\n circle = clamp(-circle, 0.0, 1.0);\n\n float angle = (atan(uv.x, -uv.y) / 3.14159265359 * 0.5);\n float p = endAngle / (PI * 2.);\n\n circle *= step(fract(angle), fract(p));\n\n circle = rounded < 1. ? circle : max(circle, $drawDot(uv, vec2(0, outerRadius - linewidth), linewidth));\n circle = rounded < 1. ? circle : max(circle, $drawDot($rotateUV(uv, -(endAngle)), vec2(0, outerRadius - linewidth), linewidth));\n\n return mix(shaderColor, maskColor, circle);\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=RadialProgressEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Masks the current maskcolor a holepunch effect with rounded corners similar to {@link RoundedRectangle}\n */\nexport class HolePunchEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'holePunch';\n static getEffectKey() {\n return `holePunch`;\n }\n static uniforms = {\n x: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n y: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n height: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n radius: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static resolveDefaults(props) {\n return {\n x: props.x || 0,\n y: props.y || 0,\n width: props.width || 50,\n height: props.height || 50,\n radius: props.radius ?? 0,\n };\n }\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n boxDist: `\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n `,\n };\n static onShaderMask = `\n vec2 halfDimensions = u_dimensions * 0.5;\n vec2 size = vec2(width, height) * 0.5;\n vec2 basePos = v_textureCoordinate.xy * u_dimensions.xy - vec2(x, y);\n vec2 pos = basePos - size;\n float r = radius[0] * step(pos.x, 0.5) * step(pos.y, 0.5);\n r = r + radius[1] * step(0.5, pos.x) * step(pos.y, 0.5);\n r = r + radius[2] * step(0.5, pos.x) * step(0.5, pos.y);\n r = r + radius[3] * step(pos.x, 0.5) * step(0.5, pos.y);\n return $boxDist(pos, size, r);\n `;\n static onEffectMask = `\n return mix(maskColor, vec4(0.0), $fillMask(shaderMask));\n `;\n}\n//# sourceMappingURL=HolePunchEffect.js.map","import { DefaultShader } from './renderers/webgl/shaders/DefaultShader.js';\nimport { DefaultShaderBatched } from './renderers/webgl/shaders/DefaultShaderBatched.js';\nimport { DynamicShader, } from './renderers/webgl/shaders/DynamicShader.js';\nimport { RoundedRectangle } from './renderers/webgl/shaders/RoundedRectangle.js';\nimport { SdfShader } from './renderers/webgl/shaders/SdfShader.js';\nimport { RadiusEffect } from './renderers/webgl/shaders/effects/RadiusEffect.js';\nimport { BorderEffect } from './renderers/webgl/shaders/effects/BorderEffect.js';\nimport { LinearGradientEffect, } from './renderers/webgl/shaders/effects/LinearGradientEffect.js';\nimport { GrayscaleEffect, } from './renderers/webgl/shaders/effects/GrayscaleEffect.js';\nimport { BorderRightEffect } from './renderers/webgl/shaders/effects/BorderRightEffect.js';\nimport { BorderTopEffect } from './renderers/webgl/shaders/effects/BorderTopEffect.js';\nimport { BorderBottomEffect } from './renderers/webgl/shaders/effects/BorderBottomEffect.js';\nimport { BorderLeftEffect } from './renderers/webgl/shaders/effects/BorderLeftEffect.js';\nimport { GlitchEffect, } from './renderers/webgl/shaders/effects/GlitchEffect.js';\nimport { FadeOutEffect, } from './renderers/webgl/shaders/effects/FadeOutEffect.js';\nimport { RadialGradientEffect, } from './renderers/webgl/shaders/effects/RadialGradientEffect.js';\nimport { RadialProgressEffect, } from './renderers/webgl/shaders/effects/RadialProgressEffect.js';\nimport { HolePunchEffect } from './renderers/webgl/shaders/effects/HolePunchEffect.js';\nexport class CoreShaderManager {\n shCache = new Map();\n shConstructors = {};\n attachedShader = null;\n effectConstructors = {};\n renderer;\n constructor() {\n this.registerShaderType('DefaultShader', DefaultShader);\n this.registerShaderType('DefaultShaderBatched', DefaultShaderBatched);\n this.registerShaderType('RoundedRectangle', RoundedRectangle);\n this.registerShaderType('DynamicShader', DynamicShader);\n this.registerShaderType('SdfShader', SdfShader);\n this.registerEffectType('border', BorderEffect);\n this.registerEffectType('borderBottom', BorderBottomEffect);\n this.registerEffectType('borderLeft', BorderLeftEffect);\n this.registerEffectType('borderRight', BorderRightEffect);\n this.registerEffectType('borderTop', BorderTopEffect);\n this.registerEffectType('fadeOut', FadeOutEffect);\n this.registerEffectType('linearGradient', LinearGradientEffect);\n this.registerEffectType('radialGradient', RadialGradientEffect);\n this.registerEffectType('grayscale', GrayscaleEffect);\n this.registerEffectType('glitch', GlitchEffect);\n this.registerEffectType('radius', RadiusEffect);\n this.registerEffectType('radialProgress', RadialProgressEffect);\n this.registerEffectType('holePunch', HolePunchEffect);\n }\n registerShaderType(shType, shClass) {\n this.shConstructors[shType] = shClass;\n }\n registerEffectType(effectType, effectClass) {\n this.effectConstructors[effectType] = effectClass;\n }\n getRegisteredEffects() {\n return this.effectConstructors;\n }\n getRegisteredShaders() {\n return this.shConstructors;\n }\n loadShader(shType, props) {\n if (!this.renderer) {\n throw new Error(`Renderer is not been defined`);\n }\n const ShaderClass = this.shConstructors[shType];\n if (!ShaderClass) {\n throw new Error(`Shader type \"${shType}\" is not registered`);\n }\n if (shType === 'DynamicShader') {\n return this.loadDynamicShader(props);\n }\n const resolvedProps = ShaderClass.resolveDefaults(props);\n const cacheKey = ShaderClass.makeCacheKey(resolvedProps) || ShaderClass.name;\n if (cacheKey && this.shCache.has(cacheKey)) {\n return {\n shader: this.shCache.get(cacheKey),\n props: resolvedProps,\n };\n }\n // @ts-expect-error ShaderClass WILL accept a Renderer\n const shader = new ShaderClass(this.renderer, props);\n if (cacheKey) {\n this.shCache.set(cacheKey, shader);\n }\n return {\n shader,\n props: resolvedProps,\n };\n }\n loadDynamicShader(props) {\n if (!this.renderer) {\n throw new Error(`Renderer is not been defined`);\n }\n const resolvedProps = DynamicShader.resolveDefaults(props, this.effectConstructors);\n const cacheKey = DynamicShader.makeCacheKey(resolvedProps, this.effectConstructors);\n if (cacheKey && this.shCache.has(cacheKey)) {\n return {\n shader: this.shCache.get(cacheKey),\n props: resolvedProps,\n };\n }\n const shader = new DynamicShader(this.renderer, props, this.effectConstructors);\n if (cacheKey) {\n this.shCache.set(cacheKey, shader);\n }\n return {\n shader: shader,\n props: resolvedProps,\n };\n }\n useShader(shader) {\n if (this.attachedShader === shader) {\n return;\n }\n if (this.attachedShader) {\n this.attachedShader.detach();\n }\n shader.attach();\n this.attachedShader = shader;\n }\n}\n//# sourceMappingURL=CoreShaderManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Class that keeps track of the invocations of Context methods when\n * the `enableContextSpy` renderer option is enabled.\n */\nexport class ContextSpy {\n data = {};\n reset() {\n this.data = {};\n }\n increment(name) {\n if (!this.data[name]) {\n this.data[name] = 0;\n }\n this.data[name]++;\n }\n getData() {\n return { ...this.data };\n }\n}\n//# sourceMappingURL=ContextSpy.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {} from '../textures/Texture.js';\n/**\n * Tests if the given location is a compressed texture container\n * @param url\n * @remarks\n * This function is used to determine if the given image url is a compressed\n * and only supports the following extensions: .ktx and .pvr\n * @returns\n */\nexport function isCompressedTextureContainer(url) {\n return /\\.(ktx|pvr)$/.test(url);\n}\n/**\n * Loads a compressed texture container\n * @param url\n * @returns\n */\nexport const loadCompressedTexture = async (url) => {\n const response = await fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n if (url.indexOf('.ktx') !== -1) {\n return loadKTXData(arrayBuffer);\n }\n return loadPVRData(arrayBuffer);\n};\n/**\n * Loads a KTX texture container and returns the texture data\n * @param buffer\n * @returns\n */\nconst loadKTXData = async (buffer) => {\n const view = new DataView(buffer);\n const littleEndian = view.getUint32(12) === 16909060 ? true : false;\n const mipmaps = [];\n const data = {\n glInternalFormat: view.getUint32(28, littleEndian),\n pixelWidth: view.getUint32(36, littleEndian),\n pixelHeight: view.getUint32(40, littleEndian),\n numberOfMipmapLevels: view.getUint32(56, littleEndian),\n bytesOfKeyValueData: view.getUint32(60, littleEndian),\n };\n let offset = 64;\n // Key Value Pairs of data start at byte offset 64\n // But the only known kvp is the API version, so skipping parsing.\n offset += data.bytesOfKeyValueData;\n for (let i = 0; i < data.numberOfMipmapLevels; i++) {\n const imageSize = view.getUint32(offset);\n offset += 4;\n mipmaps.push(view.buffer.slice(offset, imageSize));\n offset += imageSize;\n }\n return {\n data: {\n glInternalFormat: data.glInternalFormat,\n mipmaps,\n width: data.pixelWidth || 0,\n height: data.pixelHeight || 0,\n type: 'ktx',\n },\n premultiplyAlpha: false,\n };\n};\n/**\n * Loads a PVR texture container and returns the texture data\n * @param buffer\n * @returns\n */\nconst loadPVRData = async (buffer) => {\n // pvr header length in 32 bits\n const pvrHeaderLength = 13;\n // for now only we only support: COMPRESSED_RGB_ETC1_WEBGL\n const pvrFormatEtc1 = 0x8d64;\n const pvrWidth = 7;\n const pvrHeight = 6;\n const pvrMipmapCount = 11;\n const pvrMetadata = 12;\n const arrayBuffer = buffer;\n const header = new Int32Array(arrayBuffer, 0, pvrHeaderLength);\n // @ts-expect-error Object possibly undefined\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n const dataOffset = header[pvrMetadata] + 52;\n const pvrtcData = new Uint8Array(arrayBuffer, dataOffset);\n const mipmaps = [];\n const data = {\n pixelWidth: header[pvrWidth],\n pixelHeight: header[pvrHeight],\n numberOfMipmapLevels: header[pvrMipmapCount] || 0,\n };\n let offset = 0;\n let width = data.pixelWidth || 0;\n let height = data.pixelHeight || 0;\n for (let i = 0; i < data.numberOfMipmapLevels; i++) {\n const level = ((width + 3) >> 2) * ((height + 3) >> 2) * 8;\n const view = new Uint8Array(arrayBuffer, pvrtcData.byteOffset + offset, level);\n mipmaps.push(view);\n offset += level;\n width = width >> 1;\n height = height >> 1;\n }\n return {\n data: {\n glInternalFormat: pvrFormatEtc1,\n mipmaps: mipmaps,\n width: data.pixelWidth || 0,\n height: data.pixelHeight || 0,\n type: 'pvr',\n },\n premultiplyAlpha: false,\n };\n};\n//# sourceMappingURL=textureCompression.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\nimport { isCompressedTextureContainer, loadCompressedTexture, } from '../lib/textureCompression.js';\n/**\n * Texture consisting of an image loaded from a URL\n *\n * @remarks\n * The ImageTexture's {@link ImageTextureProps.src} prop defines the image URL\n * to be downloaded.\n *\n * By default, the texture's alpha values will be premultiplied into its color\n * values which is generally the desired setting before they are sent to the\n * texture's associated {@link Shader}. However, in special cases you may want\n * the Shader to receive straight (non-premultiplied) values. In that case you\n * can disable the default behavior by setting the\n * {@link ImageTextureProps.premultiplyAlpha} prop to `false`.\n */\nexport class ImageTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = ImageTexture.resolveDefaults(props);\n }\n hasAlphaChannel(mimeType) {\n return mimeType.indexOf('image/png') !== -1;\n }\n async getTextureData() {\n const { src, premultiplyAlpha } = this.props;\n if (!src) {\n return {\n data: null,\n };\n }\n if (src instanceof ImageData) {\n return {\n data: src,\n premultiplyAlpha,\n };\n }\n // Handle compressed textures\n if (isCompressedTextureContainer(src)) {\n return loadCompressedTexture(src);\n }\n if (this.txManager.imageWorkerManager) {\n return await this.txManager.imageWorkerManager.getImage(src, premultiplyAlpha);\n }\n else if (this.txManager.hasCreateImageBitmap) {\n const response = await fetch(src);\n const blob = await response.blob();\n const hasAlphaChannel = premultiplyAlpha ?? this.hasAlphaChannel(blob.type);\n return {\n data: await createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none',\n }),\n premultiplyAlpha: hasAlphaChannel,\n };\n }\n else {\n const img = new Image();\n img.src = src;\n await new Promise((resolve, reject) => {\n img.onload = () => resolve();\n img.onerror = () => reject(new Error(`Failed to load image`));\n }).catch((e) => {\n console.error(e);\n });\n return {\n data: img,\n premultiplyAlpha: premultiplyAlpha ?? true,\n };\n }\n }\n static makeCacheKey(props) {\n const resolvedProps = ImageTexture.resolveDefaults(props);\n // ImageTextures sourced by ImageData are non-cacheable\n if (resolvedProps.src instanceof ImageData) {\n return false;\n }\n return `ImageTexture,${resolvedProps.src},${resolvedProps.premultiplyAlpha}`;\n }\n static resolveDefaults(props) {\n return {\n src: props.src ?? '',\n premultiplyAlpha: props.premultiplyAlpha ?? true, // null,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=ImageTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Number of floating point numbers that represent a single glyph in the SDF vertex buffer.\n *\n * @remarks\n * The vertex buffer contains:\n * - 6 vertex positions\n * - 6 texture coordinates\n * - = 12 positions/coordinates per glyph\n *\n * Each vertex position and texture coordinate consist of 2 floating point numbers (x/y).\n * So there are 12 * 2 = 24 floating point numbers that make up a single glyph.\n */\nexport const FLOATS_PER_GLYPH = 24;\n//# sourceMappingURL=constants.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A wrapper Generator class that makes a generator peekable.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class PeekableIterator {\n iterator;\n peekBuffer = [];\n _lastIndex;\n constructor(iterator, indexBase = 0) {\n this.iterator = iterator;\n this.iterator = iterator;\n this._lastIndex = indexBase - 1;\n this.peekBuffer = [];\n }\n next() {\n const nextResult = this.peekBuffer.length > 0\n ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.peekBuffer.pop()\n : this.iterator.next();\n if (nextResult.done) {\n this._lastIndex = -1;\n }\n else {\n this._lastIndex++;\n }\n return nextResult;\n }\n peek() {\n if (this.peekBuffer.length > 0) {\n // We know that the buffer is not empty, so we can safely use the\n // non-null assertion operator\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.peekBuffer[0];\n }\n const result = this.iterator.next();\n this.peekBuffer.push(result);\n return result;\n }\n get lastIndex() {\n return this._lastIndex;\n }\n}\n//# sourceMappingURL=PeekableGenerator.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { PeekableIterator } from './PeekableGenerator.js';\nimport { getUnicodeCodepoints } from './getUnicodeCodepoints.js';\n/**\n * Measures a single-line of text width ignoring any unmapped glyphs including line breaks\n *\n * @param text\n * @param shaperProps\n * @param shaper\n * @returns\n */\nexport function measureText(text, shaperProps, shaper) {\n const glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, 0), 0));\n let width = 0;\n for (const glyph of glyphs) {\n if (glyph.mapped) {\n width += glyph.xAdvance;\n }\n }\n return width;\n}\n//# sourceMappingURL=measureText.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../../../../utils.js';\nimport { PeekableIterator } from './PeekableGenerator.js';\nimport { getUnicodeCodepoints } from './getUnicodeCodepoints.js';\nimport { measureText } from './measureText.js';\nexport function layoutText(curLineIndex, startX, startY, text, textAlign, width, height, fontSize, lineHeight, letterSpacing, \n/**\n * Mutated\n */\nvertexBuffer, contain, \n/**\n * Mutated\n */\nlineCache, rwSdf, trFontFace, forceFullLayoutCalc, scrollable, overflowSuffix, maxLines) {\n assertTruthy(trFontFace, 'Font face must be loaded');\n assertTruthy(trFontFace.loaded, 'Font face must be loaded');\n assertTruthy(trFontFace.data, 'Font face must be loaded');\n assertTruthy(trFontFace.shaper, 'Font face must be loaded');\n // Regardless of fontSize (or other scaling properties), we layout the vertices of each glyph\n // using the fixed coordinate space determined by font size used to produce the atlas.\n // Scaling for display is handled by shader uniforms inexpensively.\n // So we have:\n // - vertex space: the space in which the vertices of each glyph are laid out\n // - screen space: the screen pixel space\n // Input properties such as x, y, w, fontSize, letterSpacing, etc. are all expressed in screen space.\n // We convert these to the vertex space by dividing them the `fontSizeRatio` factor.\n /**\n * See above\n */\n const fontSizeRatio = fontSize / trFontFace.data.info.size;\n /**\n * `lineHeight` in vertex coordinates\n */\n const vertexLineHeight = lineHeight / fontSizeRatio;\n /**\n * `w` in vertex coordinates\n */\n const vertexW = width / fontSizeRatio;\n /**\n * `letterSpacing` in vertex coordinates\n */\n const vertexLSpacing = letterSpacing / fontSizeRatio;\n const startingLineCacheEntry = lineCache[curLineIndex];\n const startingCodepointIndex = startingLineCacheEntry?.codepointIndex || 0;\n const startingMaxX = startingLineCacheEntry?.maxX || 0;\n const startingMaxY = startingLineCacheEntry?.maxY || 0;\n let maxX = startingMaxX;\n let maxY = startingMaxY;\n let curX = startX;\n let curY = startY;\n let bufferOffset = 0;\n /**\n * Buffer offset to last word boundry. This is -1 when we aren't in a word boundry.\n */\n const lastWord = {\n codepointIndex: -1,\n bufferOffset: -1,\n xStart: -1,\n };\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const shaper = trFontFace.shaper;\n const shaperProps = {\n letterSpacing: vertexLSpacing,\n };\n // Get glyphs\n let glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, startingCodepointIndex), startingCodepointIndex));\n let glyphResult;\n let curLineBufferStart = -1;\n const bufferLineInfos = [];\n const vertexTruncateHeight = height / fontSizeRatio;\n const overflowSuffVertexWidth = measureText(overflowSuffix, shaperProps, shaper);\n // Line-by-line layout\n let moreLines = true;\n while (moreLines) {\n const nextLineWillFit = (maxLines === 0 || curLineIndex + 1 < maxLines) &&\n (contain !== 'both' ||\n scrollable ||\n curY + vertexLineHeight + trFontFace.maxCharHeight <=\n vertexTruncateHeight);\n const lineVertexW = nextLineWillFit\n ? vertexW\n : vertexW - overflowSuffVertexWidth;\n /**\n * Vertex X position to the beginning of the last word boundary. This becomes -1 when we start traversing a word.\n */\n let xStartLastWordBoundary = 0;\n const lineIsBelowWindowTop = curY + vertexLineHeight >= rwSdf.y1;\n const lineIsAboveWindowBottom = curY <= rwSdf.y2;\n const lineIsWithinWindow = lineIsBelowWindowTop && lineIsAboveWindowBottom;\n // Layout glyphs in this line\n // Any break statements in this while loop will trigger a line break\n while ((glyphResult = glyphs.next()) && !glyphResult.done) {\n const glyph = glyphResult.value;\n if (curLineIndex === lineCache.length) {\n lineCache.push({\n codepointIndex: glyph.cluster,\n maxY,\n maxX,\n });\n }\n else if (curLineIndex > lineCache.length) {\n throw new Error('Unexpected lineCache length');\n }\n // If we encounter a word boundary (white space or newline) we invalidate\n // the lastWord and set the xStartLastWordBoundary if we haven't already.\n if (glyph.codepoint === 32 || glyph.codepoint === 10) {\n if (lastWord.codepointIndex !== -1) {\n lastWord.codepointIndex = -1;\n xStartLastWordBoundary = curX;\n }\n }\n else if (lastWord.codepointIndex === -1) {\n lastWord.codepointIndex = glyph.cluster;\n lastWord.bufferOffset = bufferOffset;\n lastWord.xStart = xStartLastWordBoundary;\n }\n if (glyph.mapped) {\n // Mapped glyph\n const charEndX = curX + glyph.xOffset + glyph.width;\n // Word wrap check\n if (\n // We are containing the text\n contain !== 'none' &&\n // The current glyph reaches outside the contained width\n charEndX >= lineVertexW &&\n // There is a last word that we can break to the next line\n lastWord.codepointIndex !== -1 &&\n // Prevents infinite loop when a single word is longer than the width\n lastWord.xStart > 0) {\n // The current word is about to go off the edge of the container width\n // Reinitialize the iterator starting at the last word\n // and proceeding to the next line\n if (nextLineWillFit) {\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, lastWord.codepointIndex), lastWord.codepointIndex));\n bufferOffset = lastWord.bufferOffset;\n break;\n }\n else {\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(overflowSuffix, 0), 0));\n curX = lastWord.xStart;\n bufferOffset = lastWord.bufferOffset;\n // HACK: For the rest of the line when inserting the overflow suffix,\n // set contain = 'none' to prevent an infinite loop.\n contain = 'none';\n }\n }\n else {\n // This glyph fits, so we can add it to the buffer\n const quadX = curX + glyph.xOffset;\n const quadY = curY + glyph.yOffset;\n // Only add to buffer for rendering if the line is within the render window\n if (lineIsWithinWindow) {\n if (curLineBufferStart === -1) {\n curLineBufferStart = bufferOffset;\n }\n const atlasEntry = trFontFace.getAtlasEntry(glyph.glyphId);\n // Add texture coordinates\n const u = atlasEntry.x / trFontFace.data.common.scaleW;\n const v = atlasEntry.y / trFontFace.data.common.scaleH;\n const uvWidth = atlasEntry.width / trFontFace.data.common.scaleW;\n const uvHeight = atlasEntry.height / trFontFace.data.common.scaleH;\n // TODO: (Performance) We can optimize this by using ELEMENT_ARRAY_BUFFER\n // eliminating the need to duplicate vertices\n // Top-left\n vertexBuffer[bufferOffset++] = quadX;\n vertexBuffer[bufferOffset++] = quadY;\n vertexBuffer[bufferOffset++] = u;\n vertexBuffer[bufferOffset++] = v;\n // Top-right\n vertexBuffer[bufferOffset++] = quadX + glyph.width;\n vertexBuffer[bufferOffset++] = quadY;\n vertexBuffer[bufferOffset++] = u + uvWidth;\n vertexBuffer[bufferOffset++] = v;\n // Bottom-left\n vertexBuffer[bufferOffset++] = quadX;\n vertexBuffer[bufferOffset++] = quadY + glyph.height;\n vertexBuffer[bufferOffset++] = u;\n vertexBuffer[bufferOffset++] = v + uvHeight;\n // Bottom-right\n vertexBuffer[bufferOffset++] = quadX + glyph.width;\n vertexBuffer[bufferOffset++] = quadY + glyph.height;\n vertexBuffer[bufferOffset++] = u + uvWidth;\n vertexBuffer[bufferOffset++] = v + uvHeight;\n }\n maxY = Math.max(maxY, quadY + glyph.height);\n maxX = Math.max(maxX, quadX + glyph.width);\n curX += glyph.xAdvance;\n }\n }\n else {\n // Unmapped character\n // Handle newlines\n if (glyph.codepoint === 10) {\n if (nextLineWillFit) {\n // The whole line fit, so we can break to the next line\n break;\n }\n else {\n // The whole line won't fit, so we need to add the overflow suffix\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(overflowSuffix, 0), 0));\n // HACK: For the rest of the line when inserting the overflow suffix,\n // set contain = 'none' to prevent an infinite loop.\n contain = 'none';\n }\n }\n }\n }\n // Prepare for the next line...\n if (curLineBufferStart !== -1) {\n bufferLineInfos.push({\n bufferStart: curLineBufferStart,\n bufferEnd: bufferOffset,\n });\n curLineBufferStart = -1;\n }\n curX = 0;\n curY += vertexLineHeight;\n curLineIndex++;\n lastWord.codepointIndex = -1;\n xStartLastWordBoundary = 0;\n // Figure out if there are any more lines to render...\n if (!forceFullLayoutCalc && contain === 'both' && curY > rwSdf.y2) {\n // Stop layout calculation early (for performance purposes) if:\n // - We're not forcing a full layout calculation (for width/height calculation)\n // - ...and we're containing the text vertically+horizontally (contain === 'both')\n // - ...and we have a render window\n // - ...and the next line is below the bottom of the render window\n moreLines = false;\n }\n else if (glyphResult && glyphResult.done) {\n // If we've reached the end of the text, we know we're done\n moreLines = false;\n }\n else if (!nextLineWillFit) {\n // If we're contained vertically+horizontally (contain === 'both')\n // but not scrollable and the next line won't fit, we're done.\n moreLines = false;\n }\n }\n // Use textAlign to determine if we need to adjust the x position of the text\n // in the buffer line by line\n if (textAlign === 'center') {\n const vertexTextW = contain === 'none' ? maxX : vertexW;\n for (let i = 0; i < bufferLineInfos.length; i++) {\n const line = bufferLineInfos[i];\n // - 4 = the x position of a rightmost vertex\n const lineWidth = \n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n vertexBuffer[line.bufferEnd - 4] - vertexBuffer[line.bufferStart];\n const xOffset = (vertexTextW - lineWidth) / 2;\n for (let j = line.bufferStart; j < line.bufferEnd; j += 4) {\n vertexBuffer[j] += xOffset;\n }\n }\n }\n else if (textAlign === 'right') {\n const vertexTextW = contain === 'none' ? maxX : vertexW;\n for (let i = 0; i < bufferLineInfos.length; i++) {\n const line = bufferLineInfos[i];\n const lineWidth = line.bufferEnd === line.bufferStart\n ? 0\n : // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n vertexBuffer[line.bufferEnd - 4] - vertexBuffer[line.bufferStart];\n const xOffset = vertexTextW - lineWidth;\n for (let j = line.bufferStart; j < line.bufferEnd; j += 4) {\n vertexBuffer[j] += xOffset;\n }\n }\n }\n assertTruthy(glyphResult);\n return {\n bufferNumFloats: bufferOffset,\n bufferNumQuads: bufferOffset / 16,\n layoutNumCharacters: glyphResult.done\n ? text.length - startingCodepointIndex\n : glyphResult.value.cluster - startingCodepointIndex + 1,\n fullyProcessed: !!glyphResult.done,\n maxX,\n maxY,\n };\n}\n//# sourceMappingURL=layoutText.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { isBoundPositive } from '../../../../lib/utils.js';\nimport { roundDownToMultiple, roundUpToMultiple } from './util.js';\n/**\n * Create a render window from the given parameters.\n *\n * @remarks\n * The render window is a rectangle that defines the area of the text that\n * should be rendered. It is used to skip rendering parts of the text that\n * are outside of the render window. The render window is relative to the\n * text's top left corner of the overrall text.\n *\n * @param x The x coordinate of the text element's top left corner relative to the screen.\n * @param y The y coordinate of the text element's top left corner relative to the screen.\n * @param scrollY The amount of pixels to scroll the text vertically.\n * @param lineHeight The number of extra lines to render above and below the visible window.\n * @param visibleWindow The visible window of the text element relative to the screen\n * @returns\n */\nexport function setRenderWindow(outRenderWindow, x, y, scrollY, lineHeight, bufferMargin, visibleWindow, fontSizeRatio) {\n const { screen, sdf } = outRenderWindow;\n if (!isBoundPositive(visibleWindow)) {\n screen.x1 = 0;\n screen.y1 = 0;\n screen.x2 = 0;\n screen.y2 = 0;\n sdf.x1 = 0;\n sdf.y1 = 0;\n sdf.x2 = 0;\n sdf.y2 = 0;\n outRenderWindow.numLines = 0;\n outRenderWindow.firstLineIdx = 0;\n }\n else {\n const x1 = visibleWindow.x1 - x;\n const x2 = x1 + (visibleWindow.x2 - visibleWindow.x1);\n const y1Base = visibleWindow.y1 - y + scrollY;\n const y1 = roundDownToMultiple(y1Base - bufferMargin, lineHeight || 1);\n const y2 = roundUpToMultiple(y1Base + (visibleWindow.y2 - visibleWindow.y1) + bufferMargin, lineHeight || 1);\n screen.x1 = x1;\n screen.y1 = y1;\n screen.x2 = x2;\n screen.y2 = y2;\n sdf.x1 = x1 / fontSizeRatio;\n sdf.y1 = y1 / fontSizeRatio;\n sdf.x2 = x2 / fontSizeRatio;\n sdf.y2 = y2 / fontSizeRatio;\n outRenderWindow.numLines = Math.ceil((y2 - y1) / lineHeight);\n outRenderWindow.firstLineIdx = lineHeight ? Math.floor(y1 / lineHeight) : 0;\n }\n outRenderWindow.valid = true;\n}\n//# sourceMappingURL=setRenderWindow.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Round up to the nearest multiple of the given number.\n *\n * @param value\n * @param multiple\n * @returns\n */\nexport function roundUpToMultiple(value, multiple) {\n return Math.ceil(value / multiple) * multiple;\n}\n/**\n * Round down to the nearest multiple of the given number.\n *\n * @param value\n * @param multiple\n * @returns\n */\nexport function roundDownToMultiple(value, multiple) {\n return Math.floor(value / multiple) * multiple;\n}\n//# sourceMappingURL=util.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport memize from 'memize';\nconst weightConversions = {\n normal: 400,\n bold: 700,\n bolder: 900,\n lighter: 100,\n};\nconst fontWeightToNumber = (weight) => {\n if (typeof weight === 'number') {\n return weight;\n }\n return weightConversions[weight] || 400;\n};\nfunction rawResolveFontToUse(familyMapsByPriority, family, weightIn, style, stretch) {\n let weight = fontWeightToNumber(weightIn);\n for (const fontFamiles of familyMapsByPriority) {\n const fontFaces = fontFamiles[family];\n if (!fontFaces) {\n continue;\n }\n if (fontFaces.size === 1) {\n // No Exact match found, find nearest weight match\n console.warn(`TrFontManager: Only one font face found for family: '${family}' - will be used for all weights and styles`);\n return fontFaces.values().next().value;\n }\n const weightMap = new Map();\n for (const fontFace of fontFaces) {\n const fontFamilyWeight = fontWeightToNumber(fontFace.descriptors.weight);\n if (fontFamilyWeight === weight &&\n fontFace.descriptors.style === style &&\n fontFace.descriptors.stretch === stretch) {\n return fontFace;\n }\n weightMap.set(fontFamilyWeight, fontFace);\n }\n // No Exact match found, find nearest weight match\n const msg = `TrFontManager: No exact match: '${family} Weight: ${weight} Style: ${style} Stretch: ${stretch}'`;\n console.error(msg);\n // Follow the CSS font-weight algorithm to find the nearest weight match\n // https://www.w3.org/TR/2018/REC-css-fonts-3-20180920/#font-matching-algorithm\n if (weight === 400 && weightMap.has(500)) {\n return weightMap.get(500);\n }\n if (weight === 500 && weightMap.has(400)) {\n return weightMap.get(400);\n }\n if (weight < 400) {\n while (weight > 0) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight -= 100;\n }\n // reset back for the next loop\n weight = 600;\n }\n while (weight < 1000) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight += 100;\n }\n // finally check lower again\n weight = 500;\n while (weight > 0) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight -= 100;\n }\n }\n return;\n}\nconst resolveFontToUse = memize(rawResolveFontToUse);\nexport class TrFontManager {\n textRenderers;\n constructor(textRenderers) {\n this.textRenderers = textRenderers;\n // Intentionally left blank\n }\n addFontFace(font) {\n // All the font face to all of the text renderers that support it\n for (const trId in this.textRenderers) {\n const tr = this.textRenderers[trId];\n if (tr && tr.isFontFaceSupported(font)) {\n tr.addFontFace(font);\n }\n }\n }\n /**\n * Utility method to resolve a single font face from a list of prioritized family maps based on\n * a set of font properties.\n *\n * @remarks\n * These are to be used by a text renderer to resolve a font face if needed.\n *\n * @param familyMapsByPriority\n * @param props\n * @returns\n */\n static resolveFontFace(familyMapsByPriority, props) {\n const { fontFamily, fontWeight, fontStyle, fontStretch } = props;\n return resolveFontToUse(familyMapsByPriority, fontFamily, fontWeight, fontStyle, fontStretch);\n }\n}\n//# sourceMappingURL=TrFontManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createBound, intersectRect, copyRect, boundsOverlap, convertBoundToRect, } from '../../../lib/utils.js';\nimport { TextRenderer, } from '../TextRenderer.js';\nimport { SdfTrFontFace } from '../../font-face-types/SdfTrFontFace/SdfTrFontFace.js';\nimport { FLOATS_PER_GLYPH } from './internal/constants.js';\nimport { getStartConditions } from './internal/getStartConditions.js';\nimport { layoutText } from './internal/layoutText.js';\nimport { setRenderWindow, } from './internal/setRenderWindow.js';\nimport { TrFontManager } from '../../TrFontManager.js';\nimport { assertTruthy, mergeColorAlpha } from '../../../../utils.js';\nimport { WebGlCoreRenderOp } from '../../../renderers/webgl/WebGlCoreRenderOp.js';\nimport { BufferCollection } from '../../../renderers/webgl/internal/BufferCollection.js';\nimport { EventEmitter } from '../../../../common/EventEmitter.js';\n/**\n * Ephemeral rect object used for calculations\n */\nconst tmpRect = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n};\n/**\n * Singleton class for rendering text using signed distance fields.\n *\n * @remarks\n * SdfTextRenderer supports both single-channel and multi-channel signed distance fields.\n */\nexport class SdfTextRenderer extends TextRenderer {\n /**\n * Map of font family names to a set of font faces.\n */\n ssdfFontFamilies = {};\n msdfFontFamilies = {};\n fontFamilyArray = [\n this.ssdfFontFamilies,\n this.msdfFontFamilies,\n ];\n sdfShader;\n rendererBounds;\n constructor(stage) {\n super(stage);\n this.sdfShader = this.stage.shManager.loadShader('SdfShader').shader;\n this.rendererBounds = {\n x1: 0,\n y1: 0,\n x2: this.stage.options.appWidth,\n y2: this.stage.options.appHeight,\n };\n }\n //#region Overrides\n getPropertySetters() {\n return {\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n this.invalidateLayoutCache(state);\n },\n text: (state, value) => {\n state.props.text = value;\n this.invalidateLayoutCache(state);\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n this.invalidateLayoutCache(state);\n },\n color: (state, value) => {\n state.props.color = value;\n },\n x: (state, value) => {\n state.props.x = value;\n if (state.elementBounds.valid) {\n this.setElementBoundsX(state);\n // Only schedule an update if the text is not already rendered\n // (renderWindow is invalid) and the element possibly overlaps the screen\n // This is to avoid unnecessary updates when we know text is off-screen\n if (!state.renderWindow.valid &&\n boundsOverlap(state.elementBounds, this.rendererBounds)) {\n this.scheduleUpdateState(state);\n }\n }\n },\n y: (state, value) => {\n state.props.y = value;\n if (state.elementBounds.valid) {\n this.setElementBoundsY(state);\n // See x() for explanation\n if (!state.renderWindow.valid &&\n boundsOverlap(state.elementBounds, this.rendererBounds)) {\n this.scheduleUpdateState(state);\n }\n }\n },\n contain: (state, value) => {\n state.props.contain = value;\n this.invalidateLayoutCache(state);\n },\n width: (state, value) => {\n state.props.width = value;\n // Only invalidate layout cache if we're containing in the horizontal direction\n if (state.props.contain !== 'none') {\n this.invalidateLayoutCache(state);\n }\n },\n height: (state, value) => {\n state.props.height = value;\n // Only invalidate layout cache if we're containing in the vertical direction\n if (state.props.contain === 'both') {\n this.invalidateLayoutCache(state);\n }\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n this.invalidateLayoutCache(state);\n },\n scrollable: (state, value) => {\n state.props.scrollable = value;\n this.invalidateLayoutCache(state);\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n // Scrolling doesn't need to invalidate any caches, but it does need to\n // schedule an update\n this.scheduleUpdateState(state);\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n this.invalidateLayoutCache(state);\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n this.invalidateLayoutCache(state);\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n this.invalidateLayoutCache(state);\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n this.invalidateLayoutCache(state);\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n this.invalidateLayoutCache(state);\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n this.invalidateLayoutCache(state);\n },\n debug: (state, value) => {\n state.props.debug = value;\n },\n };\n }\n canRenderFont(props) {\n // TODO: Support matching on font stretch, weight and style (if/when needed)\n // For now we just match on the font family name\n // '$$SDF_FAILURE_TEST$$' is used to test the 'failure' event coming from text\n const { fontFamily } = props;\n return (fontFamily in this.ssdfFontFamilies ||\n fontFamily in this.msdfFontFamilies ||\n fontFamily === '$$SDF_FAILURE_TEST$$');\n }\n isFontFaceSupported(fontFace) {\n return fontFace instanceof SdfTrFontFace;\n }\n addFontFace(fontFace) {\n // Make sure the font face is an SDF font face (it should have already passed\n // the `isFontFaceSupported` check)\n assertTruthy(fontFace instanceof SdfTrFontFace);\n const familyName = fontFace.fontFamily;\n const fontFamiles = fontFace.type === 'ssdf'\n ? this.ssdfFontFamilies\n : fontFace.type === 'msdf'\n ? this.msdfFontFamilies\n : undefined;\n if (!fontFamiles) {\n console.warn(`Invalid font face type: ${fontFace.type}`);\n return;\n }\n let faceSet = fontFamiles[familyName];\n if (!faceSet) {\n faceSet = new Set();\n fontFamiles[familyName] = faceSet;\n }\n faceSet.add(fontFace);\n }\n createState(props) {\n return {\n props,\n status: 'initialState',\n updateScheduled: false,\n emitter: new EventEmitter(),\n lineCache: [],\n forceFullLayoutCalc: false,\n renderWindow: {\n screen: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n },\n sdf: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n },\n firstLineIdx: 0,\n numLines: 0,\n valid: false,\n },\n elementBounds: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n valid: false,\n },\n clippingRect: {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n valid: false,\n },\n bufferNumFloats: 0,\n bufferNumQuads: 0,\n vertexBuffer: undefined,\n webGlBuffers: null,\n bufferUploaded: false,\n textH: undefined,\n textW: undefined,\n distanceRange: 0,\n trFontFace: undefined,\n isRenderable: false,\n debugData: {\n updateCount: 0,\n layoutCount: 0,\n lastLayoutNumCharacters: 0,\n layoutSum: 0,\n drawSum: 0,\n drawCount: 0,\n bufferSize: 0,\n },\n };\n }\n updateState(state) {\n let { trFontFace } = state;\n const { textH, lineCache, debugData, forceFullLayoutCalc } = state;\n debugData.updateCount++;\n // On the first update call we need to set the status to loading\n if (state.status === 'initialState') {\n this.setStatus(state, 'loading');\n }\n // Resolve font face if we haven't yet\n if (!trFontFace) {\n trFontFace = this.resolveFontFace(state.props);\n state.trFontFace = trFontFace;\n if (!trFontFace) {\n const msg = `SdfTextRenderer: Could not resolve font face for family: '${state.props.fontFamily}'`;\n console.error(msg);\n this.setStatus(state, 'failed', new Error(msg));\n return;\n }\n trFontFace.texture.setRenderableOwner(state, state.isRenderable);\n }\n // If the font hasn't been loaded yet, stop here.\n // Listen for the 'loaded' event and forward fontLoaded event\n if (!trFontFace.loaded) {\n trFontFace.once('loaded', () => {\n this.scheduleUpdateState(state);\n });\n return;\n }\n // If the font is loaded then so should the data\n assertTruthy(trFontFace.data, 'Font face data should be loaded');\n const { text, fontSize, x, y, contain, width, height, lineHeight, verticalAlign, scrollable, overflowSuffix, maxLines, } = state.props;\n // scrollY only has an effect when contain === 'both' and scrollable === true\n const scrollY = contain === 'both' && scrollable ? state.props.scrollY : 0;\n const { renderWindow } = state;\n /**\n * The font size of the SDF font face (the basis for SDF space units)\n */\n const sdfFontSize = trFontFace.data.info.size;\n /**\n * Divide screen space units by this to get the SDF space units\n * Mulitple SDF space units by this to get screen space units\n */\n const fontSizeRatio = fontSize / sdfFontSize;\n // Needed in renderWindow calculation\n const sdfLineHeight = lineHeight / fontSizeRatio;\n state.distanceRange =\n fontSizeRatio * trFontFace.data.distanceField.distanceRange;\n // Allocate buffers if needed\n const neededLength = text.length * FLOATS_PER_GLYPH;\n let vertexBuffer = state.vertexBuffer;\n if (!vertexBuffer || vertexBuffer.length < neededLength) {\n vertexBuffer = new Float32Array(neededLength * 2);\n }\n const elementBounds = state.elementBounds;\n if (!elementBounds.valid) {\n this.setElementBoundsX(state);\n this.setElementBoundsY(state);\n elementBounds.valid = true;\n }\n // Return early if we're still viewing inside the established render window\n // No need to re-render what we've already rendered\n // (Only if there's an established renderWindow and we're not suppressing early exit)\n if (!forceFullLayoutCalc && renderWindow.valid) {\n const rwScreen = renderWindow.screen;\n if (x + rwScreen.x1 <= elementBounds.x1 &&\n x + rwScreen.x2 >= elementBounds.x2 &&\n y - scrollY + rwScreen.y1 <= elementBounds.y1 &&\n y - scrollY + rwScreen.y2 >= elementBounds.y2) {\n this.setStatus(state, 'loaded');\n return;\n }\n // Otherwise invalidate the renderWindow so it can be redone\n renderWindow.valid = false;\n this.setStatus(state, 'loading');\n }\n const { offsetY, textAlign } = state.props;\n // Create a new renderWindow if needed\n if (!renderWindow.valid) {\n const isPossiblyOnScreen = boundsOverlap(elementBounds, this.rendererBounds);\n if (!isPossiblyOnScreen) {\n // If the element is not possibly on screen, we can skip the layout and rendering completely\n return;\n }\n setRenderWindow(renderWindow, x, y, scrollY, lineHeight, contain === 'both' ? elementBounds.y2 - elementBounds.y1 : 0, elementBounds, fontSizeRatio);\n // console.log('newRenderWindow', renderWindow);\n }\n const start = getStartConditions(sdfFontSize, sdfLineHeight, lineHeight, verticalAlign, offsetY, fontSizeRatio, renderWindow, lineCache, textH);\n if (!start) {\n // Nothing to render, return early, but still mark as loaded (since the text is just scrolled\n // out of view)\n this.setStatus(state, 'loaded');\n return;\n }\n const { letterSpacing } = state.props;\n const out2 = layoutText(start.lineIndex, start.sdfX, start.sdfY, text, textAlign, width, height, fontSize, lineHeight, letterSpacing, vertexBuffer, contain, lineCache, renderWindow.sdf, trFontFace, forceFullLayoutCalc, scrollable, overflowSuffix, maxLines);\n state.bufferUploaded = false;\n state.bufferNumFloats = out2.bufferNumFloats;\n state.bufferNumQuads = out2.bufferNumQuads;\n state.vertexBuffer = vertexBuffer;\n state.renderWindow = renderWindow;\n debugData.lastLayoutNumCharacters = out2.layoutNumCharacters;\n debugData.bufferSize = vertexBuffer.byteLength;\n // If we didn't exit early, we know we have completely computed w/h\n if (out2.fullyProcessed) {\n state.textW = out2.maxX * fontSizeRatio;\n state.textH = out2.maxY * fontSizeRatio;\n }\n // if (state.props.debug.printLayoutTime) {\n // debugData.layoutSum += performance.now() - updateStartTime;\n // debugData.layoutCount++;\n // }\n this.setStatus(state, 'loaded');\n }\n renderQuads(state, transform, clippingRect, alpha) {\n if (!state.vertexBuffer) {\n // Nothing to draw\n return;\n }\n const { renderer } = this.stage;\n const { fontSize, color, contain, scrollable, zIndex, debug } = state.props;\n // scrollY only has an effect when contain === 'both' and scrollable === true\n const scrollY = contain === 'both' && scrollable ? state.props.scrollY : 0;\n const { textW = 0, textH = 0, distanceRange, vertexBuffer, bufferUploaded, trFontFace, elementBounds, } = state;\n let { webGlBuffers } = state;\n if (!webGlBuffers) {\n const glw = renderer.glw;\n const stride = 4 * Float32Array.BYTES_PER_ELEMENT;\n const webGlBuffer = glw.createBuffer();\n assertTruthy(webGlBuffer);\n state.webGlBuffers = new BufferCollection([\n {\n buffer: webGlBuffer,\n attributes: {\n a_position: {\n name: 'a_position',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 0, // start at the beginning of the buffer\n },\n a_textureCoordinate: {\n name: 'a_textureCoordinate',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 2 * Float32Array.BYTES_PER_ELEMENT,\n },\n },\n },\n ]);\n state.bufferUploaded = false;\n assertTruthy(state.webGlBuffers);\n webGlBuffers = state.webGlBuffers;\n }\n if (!bufferUploaded) {\n const glw = renderer.glw;\n const buffer = webGlBuffers?.getBuffer('a_textureCoordinate') ?? null;\n glw.arrayBufferData(buffer, vertexBuffer, glw.STATIC_DRAW);\n state.bufferUploaded = true;\n }\n assertTruthy(trFontFace);\n if (scrollable && contain === 'both') {\n assertTruthy(elementBounds.valid);\n const elementRect = convertBoundToRect(elementBounds, tmpRect);\n if (clippingRect.valid) {\n state.clippingRect.valid = true;\n clippingRect = intersectRect(clippingRect, elementRect, state.clippingRect);\n }\n else {\n state.clippingRect.valid = true;\n clippingRect = copyRect(elementRect, state.clippingRect);\n }\n }\n const renderOp = new WebGlCoreRenderOp(renderer.glw, renderer.options, webGlBuffers, this.sdfShader, {\n transform: transform.data,\n // IMPORTANT: The SDF Shader expects the color NOT to be premultiplied\n // for the best blending results. Which is why we use `mergeColorAlpha`\n // instead of `mergeColorAlphaPremultiplied` here.\n color: mergeColorAlpha(color, alpha),\n size: fontSize / (trFontFace.data?.info.size || 0),\n scrollY,\n distanceRange,\n debug: debug.sdfShaderDebug,\n }, alpha, clippingRect, { height: textH, width: textW }, 0, zIndex);\n const texture = state.trFontFace?.texture;\n assertTruthy(texture);\n const ctxTexture = this.stage.txManager.getCtxTexture(texture);\n renderOp.addTexture(ctxTexture);\n renderOp.length = state.bufferNumFloats;\n renderOp.numQuads = state.bufferNumQuads;\n renderer.addRenderOp(renderOp);\n // if (!debug.disableScissor) {\n // renderer.enableScissor(\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // Draw the arrays\n // gl.drawArrays(\n // gl.TRIANGLES, // Primitive type\n // 0,\n // bufferNumVertices, // Number of verticies\n // );\n // renderer.disableScissor();\n // if (debug.showElementRect) {\n // this.renderer.drawBorder(\n // Colors.Blue,\n // elementRect.x,\n // elementRect.y,\n // elementRect.w,\n // elementRect.h,\n // );\n // }\n // if (debug.showVisibleRect) {\n // this.renderer.drawBorder(\n // Colors.Green,\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // if (debug.showRenderWindow && renderWindow) {\n // this.renderer.drawBorder(\n // Colors.Red,\n // x + renderWindow.x1,\n // y + renderWindow.y1 - scrollY,\n // x + renderWindow.x2 - (x + renderWindow.x1),\n // y + renderWindow.y2 - scrollY - (y + renderWindow.y1 - scrollY),\n // );\n // }\n // if (debug.printLayoutTime) {\n // debugData.drawSum += performance.now() - drawStartTime;\n // debugData.drawCount++;\n // }\n }\n setIsRenderable(state, renderable) {\n super.setIsRenderable(state, renderable);\n state.trFontFace?.texture.setRenderableOwner(state, renderable);\n }\n destroyState(state) {\n super.destroyState(state);\n // If there's a Font Face assigned we must free the owner relation to its texture\n state.trFontFace?.texture.setRenderableOwner(state, false);\n }\n //#endregion Overrides\n resolveFontFace(props) {\n return TrFontManager.resolveFontFace(this.fontFamilyArray, props);\n }\n /**\n * Release the loaded SDF font face\n *\n * @param state\n */\n releaseFontFace(state) {\n if (state.trFontFace) {\n state.trFontFace.texture.setRenderableOwner(state, false);\n state.trFontFace = undefined;\n }\n }\n /**\n * Invalidate the layout cache stored in the state. This will cause the text\n * to be re-layed out on the next update.\n *\n * @remarks\n * This also invalidates the visible window cache.\n *\n * @param state\n */\n invalidateLayoutCache(state) {\n state.renderWindow.valid = false;\n state.elementBounds.valid = false;\n state.textH = undefined;\n state.textW = undefined;\n state.lineCache = [];\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n setElementBoundsX(state) {\n const { x, contain, width } = state.props;\n const { elementBounds } = state;\n elementBounds.x1 = x;\n elementBounds.x2 = contain !== 'none' ? x + width : Infinity;\n }\n setElementBoundsY(state) {\n const { y, contain, height } = state.props;\n const { elementBounds } = state;\n elementBounds.y1 = y;\n elementBounds.y2 = contain === 'both' ? y + height : Infinity;\n }\n}\n//# sourceMappingURL=SdfTextRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Gets the start conditions for the layout loop.\n *\n * @remarks\n * Returns `undefined` if the layout loop should not be run.\n *\n * @param fontSize\n * @param fontSizeRatio\n * @param sdfLineHeight\n * @param renderWindow\n * @param lineCache\n * @param textH\n * @returns\n */\nexport function getStartConditions(sdfFontSize, sdfLineHeight, lineHeight, verticalAlign, offsetY, fontSizeRatio, renderWindow, lineCache, textH) {\n // State variables\n const startLineIndex = Math.min(Math.max(renderWindow.firstLineIdx, 0), lineCache.length);\n // TODO: (fontSize / 6.4286 / fontSizeRatio) Adding this to the startY helps the text line up better with Canvas rendered text\n const sdfStartX = 0;\n let sdfVerticalAlignYOffset = 0;\n if (verticalAlign === 'middle') {\n sdfVerticalAlignYOffset = (sdfLineHeight - sdfFontSize) / 2;\n }\n else if (verticalAlign === 'bottom') {\n sdfVerticalAlignYOffset = sdfLineHeight - sdfFontSize;\n }\n const sdfOffsetY = offsetY / fontSizeRatio;\n const sdfStartY = sdfOffsetY + startLineIndex * sdfLineHeight + sdfVerticalAlignYOffset; // TODO: Figure out what determines the initial y offset of text.\n // Don't attempt to render anything if we know we're starting past the established end of the text\n if (textH && sdfStartY >= textH / fontSizeRatio) {\n return;\n }\n return {\n sdfX: sdfStartX,\n sdfY: sdfStartY,\n lineIndex: startLineIndex,\n };\n}\n//# sourceMappingURL=getStartConditions.js.map","import { CoreExtension } from '../../exports/core-api.js';\n/**\n * Type guard that checks if a Class extends CoreExtension.\n *\n * @param Class\n * @returns\n */\nexport function classExtendsCoreExtension(Class) {\n return Class.prototype instanceof CoreExtension;\n}\nexport async function loadCoreExtension(coreExtensionModule, stage) {\n let module;\n try {\n console.log('Loading core extension', coreExtensionModule);\n module = (await import(coreExtensionModule /* @vite-ignore */));\n }\n catch (e) {\n console.error(`The core extension module at '${coreExtensionModule}' could not be loaded.`);\n console.error(e);\n return;\n }\n if (!module.default) {\n console.error(`The core extension module at '${coreExtensionModule}' does not have a default export.`);\n return;\n }\n const ExtensionClass = module.default;\n if (classExtendsCoreExtension(ExtensionClass)) {\n const coreExtension = new ExtensionClass();\n try {\n await coreExtension.run(stage);\n }\n catch (e) {\n console.error(`The core extension at '${coreExtensionModule}' threw an error.`);\n console.error(e);\n }\n }\n else {\n console.error(`The core extension at '${coreExtensionModule}' does not extend CoreExtension.`);\n }\n}\nexport function santizeCustomDataMap(d) {\n const validTypes = { boolean: true, string: true, number: true };\n const keys = Object.keys(d);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n if (!key) {\n continue;\n }\n const value = d[key];\n const valueType = typeof value;\n // Typescript doesn't understand the above const valueType ¯\\_(ツ)_/¯\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore-next-line\n if (valueType === 'string' && value.length > 2048) {\n console.warn(`Custom Data value for ${key} is too long, it will be truncated to 2048 characters`);\n // same here, see above comment, this can only be a string at this point\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore-next-line\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call\n d[key] = value.substring(0, 2048);\n }\n if (!validTypes[valueType]) {\n console.warn(`Custom Data value for ${key} is not a boolean, string, or number, it will be ignored`);\n delete d[key];\n }\n }\n return d;\n}\n//# sourceMappingURL=utils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ManualCountTextureUsageTracker, } from './texture-usage-trackers/ManualCountTextureUsageTracker.js';\nimport { FinalizationRegistryTextureUsageTracker } from './texture-usage-trackers/FinalizationRegistryTextureUsageTracker.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { Inspector } from './Inspector.js';\nimport { santizeCustomDataMap } from '../render-drivers/utils.js';\nimport { isProductionEnvironment } from '../utils.js';\n/**\n * The Renderer Main API\n *\n * @remarks\n * This is the primary class used to configure and operate the Renderer.\n *\n * It is used to create and destroy Nodes, as well as Texture and Shader\n * references.\n *\n * Example:\n * ```ts\n * import { RendererMain, MainCoreDriver } from '@lightningjs/renderer';\n *\n * // Initialize the Renderer\n * const renderer = new RendererMain(\n * {\n * appWidth: 1920,\n * appHeight: 1080\n * },\n * 'app',\n * new MainCoreDriver(),\n * );\n * ```\n */\nexport class RendererMain extends EventEmitter {\n root = null;\n driver;\n canvas;\n settings;\n inspector = null;\n nodes = new Map();\n nextTextureId = 1;\n /**\n * Texture Usage Tracker for Usage Based Texture Garbage Collection\n *\n * @remarks\n * For internal use only. DO NOT ACCESS.\n */\n textureTracker;\n /**\n * Constructs a new Renderer instance\n *\n * @param settings Renderer settings\n * @param target Element ID or HTMLElement to insert the canvas into\n * @param driver Core Driver to use\n */\n constructor(settings, target, driver) {\n super();\n const resolvedSettings = {\n appWidth: settings.appWidth || 1920,\n appHeight: settings.appHeight || 1080,\n txMemByteThreshold: settings.txMemByteThreshold || 124e6,\n boundsMargin: settings.boundsMargin || 0,\n deviceLogicalPixelRatio: settings.deviceLogicalPixelRatio || 1,\n devicePhysicalPixelRatio: settings.devicePhysicalPixelRatio || window.devicePixelRatio,\n clearColor: settings.clearColor ?? 0x00000000,\n coreExtensionModule: settings.coreExtensionModule || null,\n experimental_FinalizationRegistryTextureUsageTracker: settings.experimental_FinalizationRegistryTextureUsageTracker ?? false,\n textureCleanupOptions: settings.textureCleanupOptions || {},\n fpsUpdateInterval: settings.fpsUpdateInterval || 0,\n numImageWorkers: settings.numImageWorkers !== undefined ? settings.numImageWorkers : 2,\n enableContextSpy: settings.enableContextSpy ?? false,\n enableInspector: settings.enableInspector ?? false,\n };\n this.settings = resolvedSettings;\n const { appWidth, appHeight, deviceLogicalPixelRatio, devicePhysicalPixelRatio, enableInspector, } = resolvedSettings;\n const releaseCallback = (textureId) => {\n this.driver.releaseTexture(textureId);\n };\n const useFinalizationRegistryTracker = resolvedSettings.experimental_FinalizationRegistryTextureUsageTracker &&\n typeof FinalizationRegistry === 'function';\n this.textureTracker = useFinalizationRegistryTracker\n ? new FinalizationRegistryTextureUsageTracker(releaseCallback)\n : new ManualCountTextureUsageTracker(releaseCallback, this.settings.textureCleanupOptions);\n const deviceLogicalWidth = appWidth * deviceLogicalPixelRatio;\n const deviceLogicalHeight = appHeight * deviceLogicalPixelRatio;\n this.driver = driver;\n const canvas = document.createElement('canvas');\n this.canvas = canvas;\n canvas.width = deviceLogicalWidth * devicePhysicalPixelRatio;\n canvas.height = deviceLogicalHeight * devicePhysicalPixelRatio;\n canvas.style.width = `${deviceLogicalWidth}px`;\n canvas.style.height = `${deviceLogicalHeight}px`;\n let targetEl;\n if (typeof target === 'string') {\n targetEl = document.getElementById(target);\n }\n else {\n targetEl = target;\n }\n if (!targetEl) {\n throw new Error('Could not find target element');\n }\n // Hook up the driver's callbacks\n driver.onCreateNode = (node) => {\n this.nodes.set(node.id, node);\n };\n driver.onBeforeDestroyNode = (node) => {\n this.nodes.delete(node.id);\n };\n driver.onFpsUpdate = (fpsData) => {\n this.emit('fpsUpdate', fpsData);\n };\n driver.onFrameTick = (frameTickData) => {\n this.emit('frameTick', frameTickData);\n };\n driver.onIdle = () => {\n this.emit('idle');\n };\n targetEl.appendChild(canvas);\n if (enableInspector && !isProductionEnvironment()) {\n this.inspector = new Inspector(canvas, resolvedSettings);\n }\n }\n /**\n * Initialize the renderer\n *\n * @remarks\n * This method must be called and resolved asyncronously before any other\n * methods are called.\n */\n async init() {\n await this.driver.init(this, this.settings, this.canvas);\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.root = this.driver.getRootNode();\n }\n /**\n * Create a new scene graph node\n *\n * @remarks\n * A node is the main graphical building block of the Renderer scene graph. It\n * can be a container for other nodes, or it can be a leaf node that renders a\n * solid color, gradient, image, or specific texture, using a specific shader.\n *\n * To create a text node, see {@link createTextNode}.\n *\n * See {@link INode} for more details.\n *\n * @param props\n * @returns\n */\n createNode(props) {\n if (this.inspector) {\n return this.inspector.createNode(this.driver, this.resolveNodeDefaults(props));\n }\n return this.driver.createNode(this.resolveNodeDefaults(props));\n }\n /**\n * Create a new scene graph text node\n *\n * @remarks\n * A text node is the second graphical building block of the Renderer scene\n * graph. It renders text using a specific text renderer that is automatically\n * chosen based on the font requested and what type of fonts are installed\n * into an app via a CoreExtension.\n *\n * See {@link ITextNode} for more details.\n *\n * @param props\n * @returns\n */\n createTextNode(props) {\n const fontSize = props.fontSize ?? 16;\n const data = {\n ...this.resolveNodeDefaults(props),\n text: props.text ?? '',\n textRendererOverride: props.textRendererOverride ?? null,\n fontSize,\n fontFamily: props.fontFamily ?? 'sans-serif',\n fontStyle: props.fontStyle ?? 'normal',\n fontWeight: props.fontWeight ?? 'normal',\n fontStretch: props.fontStretch ?? 'normal',\n textAlign: props.textAlign ?? 'left',\n contain: props.contain ?? 'none',\n scrollable: props.scrollable ?? false,\n scrollY: props.scrollY ?? 0,\n offsetY: props.offsetY ?? 0,\n letterSpacing: props.letterSpacing ?? 0,\n lineHeight: props.lineHeight ?? fontSize,\n maxLines: props.maxLines ?? 0,\n textBaseline: props.textBaseline ?? 'alphabetic',\n verticalAlign: props.verticalAlign ?? 'top',\n overflowSuffix: props.overflowSuffix ?? '...',\n debug: props.debug ?? {},\n };\n if (this.inspector) {\n return this.inspector.createTextNode(this.driver, data);\n }\n return this.driver.createTextNode(data);\n }\n /**\n * Resolves the default property values for a Node\n *\n * @remarks\n * This method is used internally by the RendererMain to resolve the default\n * property values for a Node. It is exposed publicly so that it can be used\n * by Core Driver implementations.\n *\n * @param props\n * @returns\n */\n resolveNodeDefaults(props) {\n const color = props.color ?? 0xffffffff;\n const colorTl = props.colorTl ?? props.colorTop ?? props.colorLeft ?? color;\n const colorTr = props.colorTr ?? props.colorTop ?? props.colorRight ?? color;\n const colorBl = props.colorBl ?? props.colorBottom ?? props.colorLeft ?? color;\n const colorBr = props.colorBr ?? props.colorBottom ?? props.colorRight ?? color;\n const data = santizeCustomDataMap(props.data ?? {});\n return {\n x: props.x ?? 0,\n y: props.y ?? 0,\n width: props.width ?? 0,\n height: props.height ?? 0,\n alpha: props.alpha ?? 1,\n autosize: props.autosize ?? false,\n clipping: props.clipping ?? false,\n color,\n colorTop: props.colorTop ?? color,\n colorBottom: props.colorBottom ?? color,\n colorLeft: props.colorLeft ?? color,\n colorRight: props.colorRight ?? color,\n colorBl,\n colorBr,\n colorTl,\n colorTr,\n zIndex: props.zIndex ?? 0,\n zIndexLocked: props.zIndexLocked ?? 0,\n parent: props.parent ?? null,\n texture: props.texture ?? null,\n shader: props.shader ?? null,\n // Since setting the `src` will trigger a texture load, we need to set it after\n // we set the texture. Otherwise, problems happen.\n src: props.src ?? '',\n scale: props.scale ?? null,\n scaleX: props.scaleX ?? props.scale ?? 1,\n scaleY: props.scaleY ?? props.scale ?? 1,\n mount: props.mount ?? 0,\n mountX: props.mountX ?? props.mount ?? 0,\n mountY: props.mountY ?? props.mount ?? 0,\n pivot: props.pivot ?? 0.5,\n pivotX: props.pivotX ?? props.pivot ?? 0.5,\n pivotY: props.pivotY ?? props.pivot ?? 0.5,\n rotation: props.rotation ?? 0,\n data: data,\n };\n }\n /**\n * Destroy a node\n *\n * @remarks\n * This method destroys a node but does not destroy its children.\n *\n * @param node\n * @returns\n */\n destroyNode(node) {\n if (this.inspector) {\n this.inspector.destroyNode(node);\n }\n return this.driver.destroyNode(node);\n }\n /**\n * Create a new texture reference\n *\n * @remarks\n * This method creates a new reference to a texture. The texture is not\n * loaded until it is used on a node.\n *\n * It can be assigned to a node's `texture` property, or it can be used\n * when creating a SubTexture.\n *\n * @param textureType\n * @param props\n * @param options\n * @returns\n */\n createTexture(textureType, props, options) {\n const id = this.nextTextureId++;\n const desc = {\n descType: 'texture',\n txType: textureType,\n props,\n options: {\n ...options,\n // This ID is used to identify the texture in the CoreTextureManager's\n // ID Texture Map cache.\n id,\n },\n };\n this.textureTracker.registerTexture(desc);\n return desc;\n }\n /**\n * Create a new shader reference\n *\n * @remarks\n * This method creates a new reference to a shader. The shader is not\n * loaded until it is used on a Node.\n *\n * It can be assigned to a Node's `shader` property.\n *\n * @param shaderType\n * @param props\n * @returns\n */\n createShader(shaderType, props) {\n return {\n descType: 'shader',\n shType: shaderType,\n props: props,\n };\n }\n /**\n * Get a Node by its ID\n *\n * @param id\n * @returns\n */\n getNodeById(id) {\n return this.nodes.get(id) || null;\n }\n toggleFreeze() {\n throw new Error('Not implemented');\n }\n advanceFrame() {\n throw new Error('Not implemented');\n }\n /**\n * Re-render the current frame without advancing any running animations.\n *\n * @remarks\n * Any state changes will be reflected in the re-rendered frame. Useful for\n * debugging.\n *\n * May not do anything if the render loop is running on a separate worker.\n */\n rerender() {\n throw new Error('Not implemented');\n }\n}\n//# sourceMappingURL=RendererMain.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getTimingFunction } from '../utils.js';\nimport { mergeColorProgress } from '../../utils.js';\nimport { EventEmitter } from '../../common/EventEmitter.js';\nexport class CoreAnimation extends EventEmitter {\n node;\n props;\n settings;\n propStartValues = {};\n restoreValues = {};\n progress = 0;\n delayFor = 0;\n timingFunction;\n propsList; //fixme - aint got not time for this\n constructor(node, props, settings) {\n super();\n this.node = node;\n this.props = props;\n this.settings = settings;\n this.propStartValues = {};\n this.propsList = Object.keys(props);\n this.propsList.forEach((propName) => {\n this.propStartValues[propName] = node[propName];\n });\n this.timingFunction = (t) => t;\n if (settings.easing && typeof settings.easing === 'string') {\n this.timingFunction = getTimingFunction(settings.easing);\n }\n this.delayFor = settings.delay || 0;\n }\n reset() {\n this.progress = 0;\n this.delayFor = this.settings.delay || 0;\n this.update(0);\n }\n restore() {\n this.reset();\n Object.keys(this.props).forEach((propName) => {\n this.node[propName] = this.propStartValues[propName];\n });\n }\n reverse() {\n this.progress = 0;\n Object.keys(this.props).forEach((propName) => {\n // set the start value to the current value\n const startValue = this.props[propName];\n const endValue = this.propStartValues[propName];\n // swap the start and end values\n this.props[propName] = endValue;\n this.propStartValues[propName] = startValue;\n });\n // restore stop method if we are not looping\n if (!this.settings.loop) {\n this.settings.stopMethod = false;\n }\n }\n applyEasing(p, s, e) {\n return (this.timingFunction(p) || p) * (e - s) + s;\n }\n update(dt) {\n const { duration, loop, easing, stopMethod } = this.settings;\n if (!duration) {\n this.emit('finished', {});\n return;\n }\n if (this.delayFor > 0) {\n this.delayFor -= dt;\n return;\n }\n if (this.delayFor <= 0 && this.progress === 0) {\n this.emit('start', {});\n }\n this.progress += dt / duration;\n if (this.progress > 1) {\n this.progress = loop ? 0 : 1;\n if (stopMethod) {\n // If there's a stop method emit finished so the stop method can be applied.\n // TODO: We should probably reevaluate how stopMethod is implemented as currently\n // stop method 'reset' does not work when looping.\n this.emit('finished', {});\n return;\n }\n }\n for (let i = 0; i < this.propsList.length; i++) {\n const propName = this.propsList[i];\n const propValue = this.props[propName];\n const startValue = this.propStartValues[propName];\n const endValue = propValue;\n if (propName.indexOf('color') !== -1) {\n // check if we have to change the color to begin with\n if (startValue === endValue) {\n this.node[propName] = startValue;\n continue;\n }\n if (easing) {\n const easingProgressValue = this.timingFunction(this.progress) || this.progress;\n const easingColorValue = mergeColorProgress(startValue, endValue, easingProgressValue);\n this.node[propName] = easingColorValue;\n continue;\n }\n this.node[propName] = mergeColorProgress(startValue, endValue, this.progress);\n continue;\n }\n if (easing) {\n this.node[propName] = this.applyEasing(this.progress, startValue, endValue);\n continue;\n }\n this.node[propName] =\n startValue + (endValue - startValue) * this.progress;\n }\n if (this.progress === 1) {\n this.emit('finished', {});\n }\n }\n}\n//# sourceMappingURL=CoreAnimation.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nexport class CoreAnimationController {\n manager;\n animation;\n startedPromise = null;\n /**\n * If this is null, then the animation hasn't started yet.\n */\n startedResolve = null;\n stoppedPromise = null;\n /**\n * If this is null, then the animation is in a finished / stopped state.\n */\n stoppedResolve = null;\n constructor(manager, animation) {\n this.manager = manager;\n this.animation = animation;\n this.state = 'stopped';\n }\n state;\n start() {\n this.makeStartedPromise();\n this.animation.once('start', this.started.bind(this));\n this.makeStoppedPromise();\n this.animation.once('finished', this.finished.bind(this));\n // prevent registering the same animation twice\n if (!this.manager.activeAnimations.has(this.animation)) {\n this.manager.registerAnimation(this.animation);\n }\n this.state = 'running';\n return this;\n }\n stop() {\n this.manager.unregisterAnimation(this.animation);\n if (this.stoppedResolve !== null) {\n this.stoppedResolve();\n this.stoppedResolve = null;\n }\n this.animation.reset();\n this.state = 'stopped';\n return this;\n }\n pause() {\n this.manager.unregisterAnimation(this.animation);\n this.state = 'paused';\n return this;\n }\n restore() {\n this.stoppedResolve = null;\n this.animation.restore();\n return this;\n }\n waitUntilStarted() {\n this.makeStartedPromise();\n const promise = this.startedPromise;\n assertTruthy(promise);\n return promise;\n }\n waitUntilStopped() {\n this.makeStoppedPromise();\n const promise = this.stoppedPromise;\n assertTruthy(promise);\n return promise;\n }\n makeStartedPromise() {\n if (this.startedResolve === null) {\n this.startedPromise = new Promise((resolve) => {\n this.startedResolve = resolve;\n });\n }\n }\n makeStoppedPromise() {\n if (this.stoppedResolve === null) {\n this.stoppedPromise = new Promise((resolve) => {\n this.stoppedResolve = resolve;\n });\n }\n }\n started() {\n assertTruthy(this.startedResolve);\n // resolve promise (and pass current this to continue to the chain)\n this.startedResolve(this);\n this.startedResolve = null;\n }\n finished() {\n assertTruthy(this.stoppedResolve);\n // If the animation is looping, then we need to restart it.\n const { loop, stopMethod } = this.animation.settings;\n if (stopMethod === 'reverse') {\n this.animation.reverse();\n this.start();\n return;\n }\n // resolve promise\n this.stoppedResolve();\n this.stoppedResolve = null;\n if (loop) {\n return;\n }\n // unregister animation\n this.manager.unregisterAnimation(this.animation);\n }\n}\n//# sourceMappingURL=CoreAnimationController.js.map","/* eslint-disable @typescript-eslint/no-non-null-assertion */\n// Matrix3d is a 3x3 matrix in column-major order because that's how WebGL likes it.\n// The matrix is stored in a Float32Array in the following order:\n// | 0 3 6 |\n// | 1 4 7 |\n// | 2 5 8 |\n// The following constants are used to index into the array in a row-major way.\nconst m0 = 0;\nconst m1 = 3;\nconst m2 = 6;\nconst m3 = 1;\nconst m4 = 4;\nconst m5 = 7;\nconst m6 = 2;\nconst m7 = 5;\nconst m8 = 8;\n/**\n * A 3x3 matrix representing a 2D transformation.\n *\n * @remarks\n * The matrix is stored in column-major order in the `data` property which can\n * be passed directly to a WebGL shader uniform.\n *\n * The matrix is stored in a Float32Array in the following index order:\n * | 0 3 6 |\n * | 1 4 7 |\n * | 2 5 8 |\n *\n * Only the first two rows are really used for the transformation. The last row is\n * generally always `[0, 0, 1]` if you only use the 2D transformation methods\n * provided by this class.\n *\n * For convenience, entries in the first two rows can be accessed by the following\n * getter properties:\n * | ta tb tx |\n * | tc td ty |\n * | 0 0 1 |\n */\nexport class Matrix3d {\n data;\n /**\n * Creates a new 3x3 matrix.\n *\n * @param entries Row-major 3x3 matrix\n */\n constructor(entries) {\n if (entries) {\n // Transpose the input matrix so that it's in column-major order.\n this.data = new Float32Array(9);\n this.data[m0] = entries[0];\n this.data[m1] = entries[3];\n this.data[m2] = entries[6];\n this.data[m3] = entries[1];\n this.data[m4] = entries[4];\n this.data[m5] = entries[7];\n this.data[m6] = entries[2];\n this.data[m7] = entries[5];\n this.data[m8] = entries[8];\n }\n else {\n this.data = new Float32Array(9);\n }\n }\n /**\n * Returns a temporary matrix that can be used for calculations.\n *\n * @remarks\n * This is useful for avoiding allocations in tight loops.\n *\n * The matrix is not guaranteed to be the same between calls.\n *\n * @returns\n */\n static get temp() {\n return tempMatrix;\n }\n static multiply(a, b, out) {\n const e0 = a.data[m0] * b.data[m0] +\n a.data[m1] * b.data[m3] +\n a.data[m2] * b.data[m6];\n const e1 = a.data[m0] * b.data[m1] +\n a.data[m1] * b.data[m4] +\n a.data[m2] * b.data[m7];\n const e2 = a.data[m0] * b.data[m2] +\n a.data[m1] * b.data[m5] +\n a.data[m2] * b.data[m8];\n const e3 = a.data[m3] * b.data[m0] +\n a.data[m4] * b.data[m3] +\n a.data[m5] * b.data[m6];\n const e4 = a.data[m3] * b.data[m1] +\n a.data[m4] * b.data[m4] +\n a.data[m5] * b.data[m7];\n const e5 = a.data[m3] * b.data[m2] +\n a.data[m4] * b.data[m5] +\n a.data[m5] * b.data[m8];\n const e6 = a.data[m6] * b.data[m0] +\n a.data[m7] * b.data[m3] +\n a.data[m8] * b.data[m6];\n const e7 = a.data[m6] * b.data[m1] +\n a.data[m7] * b.data[m4] +\n a.data[m8] * b.data[m7];\n const e8 = a.data[m6] * b.data[m2] +\n a.data[m7] * b.data[m5] +\n a.data[m8] * b.data[m8];\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = e0;\n out.data[m1] = e1;\n out.data[m2] = e2;\n out.data[m3] = e3;\n out.data[m4] = e4;\n out.data[m5] = e5;\n out.data[m6] = e6;\n out.data[m7] = e7;\n out.data[m8] = e8;\n return out;\n }\n static identity(out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = 1;\n out.data[m1] = 0;\n out.data[m2] = 0;\n out.data[m3] = 0;\n out.data[m4] = 1;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static translate(x, y, out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = 1;\n out.data[m1] = 0;\n out.data[m2] = x;\n out.data[m3] = 0;\n out.data[m4] = 1;\n out.data[m5] = y;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static scale(sx, sy, out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = sx;\n out.data[m1] = 0;\n out.data[m2] = 0;\n out.data[m3] = 0;\n out.data[m4] = sy;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static rotate(angle, out) {\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = cos;\n out.data[m1] = -sin;\n out.data[m2] = 0;\n out.data[m3] = sin;\n out.data[m4] = cos;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static copy(src, dst, transpose) {\n if (!dst) {\n dst = new Matrix3d();\n }\n dst.data[0] = src.data[0];\n dst.data[1] = src.data[1];\n dst.data[2] = src.data[2];\n dst.data[3] = src.data[3];\n dst.data[4] = src.data[4];\n dst.data[5] = src.data[5];\n dst.data[6] = src.data[6];\n dst.data[7] = src.data[7];\n dst.data[8] = src.data[8];\n return dst;\n }\n translate(x, y) {\n this.data[m2] = this.data[m0] * x + this.data[m1] * y + this.data[m2];\n this.data[m5] = this.data[m3] * x + this.data[m4] * y + this.data[m5];\n return this;\n }\n scale(sx, sy) {\n this.data[m0] = this.data[m0] * sx;\n this.data[m1] = this.data[m1] * sy;\n this.data[m3] = this.data[m3] * sx;\n this.data[m4] = this.data[m4] * sy;\n return this;\n }\n rotate(angle) {\n if (angle === 0 || !((angle % Math.PI) * 2)) {\n return this;\n }\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n const e0 = this.data[m0] * cos + this.data[m1] * sin;\n const e1 = this.data[m1] * cos - this.data[m0] * sin;\n const e3 = this.data[m3] * cos + this.data[m4] * sin;\n const e4 = this.data[m4] * cos - this.data[m3] * sin;\n this.data[m0] = e0;\n this.data[m1] = e1;\n this.data[m3] = e3;\n this.data[m4] = e4;\n return this;\n }\n multiply(other) {\n return Matrix3d.multiply(this, other, this);\n }\n get tx() {\n return this.data[m2];\n }\n get ty() {\n return this.data[m5];\n }\n get ta() {\n return this.data[m0];\n }\n get tb() {\n return this.data[m1];\n }\n get tc() {\n return this.data[m3];\n }\n get td() {\n return this.data[m4];\n }\n transformPoint(x, y) {\n return [\n this.data[m0] * x + this.data[m1] * y + this.data[m2],\n this.data[m3] * x + this.data[m4] * y + this.data[m3],\n ];\n }\n}\nconst tempMatrix = new Matrix3d();\n//# sourceMappingURL=Matrix3d.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy, mergeColorAlphaPremultiplied, getImageAspectRatio, } from '../utils.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { copyRect, intersectRect, createBound, boundInsideBound, } from './lib/utils.js';\nimport { Matrix3d } from './lib/Matrix3d.js';\nimport { RenderCoords } from './lib/RenderCoords.js';\nexport var CoreNodeRenderState;\n(function (CoreNodeRenderState) {\n CoreNodeRenderState[CoreNodeRenderState[\"Init\"] = 0] = \"Init\";\n CoreNodeRenderState[CoreNodeRenderState[\"OutOfBounds\"] = 2] = \"OutOfBounds\";\n CoreNodeRenderState[CoreNodeRenderState[\"InBounds\"] = 4] = \"InBounds\";\n CoreNodeRenderState[CoreNodeRenderState[\"InViewport\"] = 8] = \"InViewport\";\n})(CoreNodeRenderState || (CoreNodeRenderState = {}));\nconst CoreNodeRenderStateMap = new Map();\nCoreNodeRenderStateMap.set(CoreNodeRenderState.Init, 'init');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.OutOfBounds, 'outOfBounds');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.InBounds, 'inBounds');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.InViewport, 'inViewport');\nexport var UpdateType;\n(function (UpdateType) {\n /**\n * Child updates\n */\n UpdateType[UpdateType[\"Children\"] = 1] = \"Children\";\n /**\n * Scale/Rotate transform update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `scaleRotateTransform`\n */\n UpdateType[UpdateType[\"ScaleRotate\"] = 2] = \"ScaleRotate\";\n /**\n * Translate transform update (x/y/width/height/pivot/mount)\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `localTransform`\n */\n UpdateType[UpdateType[\"Local\"] = 4] = \"Local\";\n /**\n * Global Transform update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `globalTransform`\n * - `renderCoords`\n * - `renderBound`\n */\n UpdateType[UpdateType[\"Global\"] = 8] = \"Global\";\n /**\n * Clipping rect update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `clippingRect`\n */\n UpdateType[UpdateType[\"Clipping\"] = 16] = \"Clipping\";\n /**\n * Calculated ZIndex update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `calcZIndex`\n */\n UpdateType[UpdateType[\"CalculatedZIndex\"] = 32] = \"CalculatedZIndex\";\n /**\n * Z-Index Sorted Children update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `children` (sorts children by their `calcZIndex`)\n */\n UpdateType[UpdateType[\"ZIndexSortedChildren\"] = 64] = \"ZIndexSortedChildren\";\n /**\n * Premultiplied Colors update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `premultipliedColorTl`\n * - `premultipliedColorTr`\n * - `premultipliedColorBl`\n * - `premultipliedColorBr`\n */\n UpdateType[UpdateType[\"PremultipliedColors\"] = 128] = \"PremultipliedColors\";\n /**\n * World Alpha update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `worldAlpha` = `parent.worldAlpha` * `alpha`\n */\n UpdateType[UpdateType[\"WorldAlpha\"] = 256] = \"WorldAlpha\";\n /**\n * Render State update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `renderState`\n */\n UpdateType[UpdateType[\"RenderState\"] = 512] = \"RenderState\";\n /**\n * Is Renderable update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `isRenderable`\n */\n UpdateType[UpdateType[\"IsRenderable\"] = 1024] = \"IsRenderable\";\n /**\n * None\n */\n UpdateType[UpdateType[\"None\"] = 0] = \"None\";\n /**\n * All\n */\n UpdateType[UpdateType[\"All\"] = 2047] = \"All\";\n})(UpdateType || (UpdateType = {}));\nexport class CoreNode extends EventEmitter {\n stage;\n children = [];\n props;\n updateType = UpdateType.All;\n globalTransform;\n scaleRotateTransform;\n localTransform;\n renderCoords;\n renderBound;\n strictBound;\n preloadBound;\n clippingRect = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n valid: false,\n };\n isRenderable = false;\n renderState = CoreNodeRenderState.Init;\n worldAlpha = 1;\n premultipliedColorTl = 0;\n premultipliedColorTr = 0;\n premultipliedColorBl = 0;\n premultipliedColorBr = 0;\n calcZIndex = 0;\n constructor(stage, props) {\n super();\n this.stage = stage;\n this.props = {\n ...props,\n parent: null,\n };\n // Allow for parent to be processed appropriately\n this.parent = props.parent;\n this.updateScaleRotateTransform();\n }\n //#region Textures\n loadTexture(textureType, props, options = null) {\n // First unload any existing texture\n if (this.props.texture) {\n this.unloadTexture();\n }\n const { txManager } = this.stage;\n const texture = txManager.loadTexture(textureType, props, options);\n this.props.texture = texture;\n this.props.textureOptions = options;\n this.setUpdateType(UpdateType.IsRenderable);\n // If texture is already loaded / failed, trigger loaded event manually\n // so that users get a consistent event experience.\n // We do this in a microtask to allow listeners to be attached in the same\n // synchronous task after calling loadTexture()\n queueMicrotask(() => {\n if (texture.state === 'loaded') {\n this.onTextureLoaded(texture, texture.dimensions);\n }\n else if (texture.state === 'failed') {\n this.onTextureFailed(texture, texture.error);\n }\n else if (texture.state === 'freed') {\n this.onTextureFreed(texture);\n }\n texture.on('loaded', this.onTextureLoaded);\n texture.on('failed', this.onTextureFailed);\n texture.on('freed', this.onTextureFreed);\n });\n }\n unloadTexture() {\n if (this.props.texture) {\n const { texture } = this.props;\n texture.off('loaded', this.onTextureLoaded);\n texture.off('failed', this.onTextureFailed);\n texture.off('freed', this.onTextureFreed);\n texture.setRenderableOwner(this, false);\n }\n this.props.texture = null;\n this.props.textureOptions = null;\n this.setUpdateType(UpdateType.IsRenderable);\n }\n autosizeNode(dimensions) {\n if (this.autosize) {\n this.width = dimensions.width;\n this.height = dimensions.height;\n }\n }\n onTextureLoaded = (target, dimensions) => {\n this.autosizeNode(dimensions);\n // Texture was loaded. In case the RAF loop has already stopped, we request\n // a render to ensure the texture is rendered.\n this.stage.requestRender();\n this.emit('loaded', {\n type: 'texture',\n dimensions,\n });\n };\n onTextureFailed = (target, error) => {\n this.emit('failed', {\n type: 'texture',\n error,\n });\n };\n onTextureFreed = (target) => {\n this.emit('freed', {\n type: 'texture',\n });\n };\n //#endregion Textures\n loadShader(shaderType, props) {\n const shManager = this.stage.renderer.getShaderManager();\n assertTruthy(shManager);\n const { shader, props: p } = shManager.loadShader(shaderType, props);\n this.props.shader = shader;\n this.props.shaderProps = p;\n this.setUpdateType(UpdateType.IsRenderable);\n }\n /**\n * Change types types is used to determine the scope of the changes being applied\n *\n * @remarks\n * See {@link UpdateType} for more information on each type\n *\n * @param type\n */\n setUpdateType(type) {\n this.updateType |= type;\n // If we're updating this node at all, we need to inform the parent\n // (and all ancestors) that their children need updating as well\n const parent = this.props.parent;\n if (parent && !(parent.updateType & UpdateType.Children)) {\n parent.setUpdateType(UpdateType.Children);\n }\n }\n sortChildren() {\n this.children.sort((a, b) => a.calcZIndex - b.calcZIndex);\n }\n updateScaleRotateTransform() {\n this.scaleRotateTransform = Matrix3d.rotate(this.props.rotation, this.scaleRotateTransform).scale(this.props.scaleX, this.props.scaleY);\n }\n updateLocalTransform() {\n assertTruthy(this.scaleRotateTransform);\n const pivotTranslateX = this.props.pivotX * this.props.width;\n const pivotTranslateY = this.props.pivotY * this.props.height;\n const mountTranslateX = this.props.mountX * this.props.width;\n const mountTranslateY = this.props.mountY * this.props.height;\n this.localTransform = Matrix3d.translate(pivotTranslateX - mountTranslateX + this.props.x, pivotTranslateY - mountTranslateY + this.props.y, this.localTransform)\n .multiply(this.scaleRotateTransform)\n .translate(-pivotTranslateX, -pivotTranslateY);\n this.setUpdateType(UpdateType.Global);\n }\n /**\n * @todo: test for correct calculation flag\n * @param delta\n */\n update(delta, parentClippingRect) {\n if (this.updateType & UpdateType.ScaleRotate) {\n this.updateScaleRotateTransform();\n this.setUpdateType(UpdateType.Local);\n }\n if (this.updateType & UpdateType.Local) {\n this.updateLocalTransform();\n this.setUpdateType(UpdateType.Global);\n }\n const parent = this.props.parent;\n let childUpdateType = UpdateType.None;\n if (this.updateType & UpdateType.Global) {\n assertTruthy(this.localTransform);\n this.globalTransform = Matrix3d.copy(parent?.globalTransform || this.localTransform, this.globalTransform);\n if (parent) {\n this.globalTransform.multiply(this.localTransform);\n }\n this.calculateRenderCoords();\n this.updateBoundingRect();\n this.setUpdateType(UpdateType.Clipping | UpdateType.RenderState | UpdateType.Children);\n childUpdateType |= UpdateType.Global;\n }\n if (this.updateType & UpdateType.Clipping) {\n this.calculateClippingRect(parentClippingRect);\n this.setUpdateType(UpdateType.Children);\n childUpdateType |= UpdateType.Clipping;\n }\n if (this.updateType & UpdateType.WorldAlpha) {\n if (parent) {\n this.worldAlpha = parent.worldAlpha * this.props.alpha;\n }\n else {\n this.worldAlpha = this.props.alpha;\n }\n this.setUpdateType(UpdateType.Children |\n UpdateType.PremultipliedColors |\n UpdateType.IsRenderable);\n childUpdateType |= UpdateType.WorldAlpha;\n }\n if (this.updateType & UpdateType.PremultipliedColors) {\n this.premultipliedColorTl = mergeColorAlphaPremultiplied(this.props.colorTl, this.worldAlpha, true);\n // If all the colors are the same just sent them all to the same value\n if (this.props.colorTl === this.props.colorTr &&\n this.props.colorBl === this.props.colorBr &&\n this.props.colorTl === this.props.colorBl) {\n this.premultipliedColorTr =\n this.premultipliedColorBl =\n this.premultipliedColorBr =\n this.premultipliedColorTl;\n }\n else {\n this.premultipliedColorTr = mergeColorAlphaPremultiplied(this.props.colorTr, this.worldAlpha, true);\n this.premultipliedColorBl = mergeColorAlphaPremultiplied(this.props.colorBl, this.worldAlpha, true);\n this.premultipliedColorBr = mergeColorAlphaPremultiplied(this.props.colorBr, this.worldAlpha, true);\n }\n }\n if (this.updateType & UpdateType.RenderState) {\n this.updateRenderState(parentClippingRect);\n this.setUpdateType(UpdateType.IsRenderable);\n }\n if (this.updateType & UpdateType.IsRenderable) {\n this.updateIsRenderable();\n }\n // No need to update zIndex if there is no parent\n if (parent && this.updateType & UpdateType.CalculatedZIndex) {\n this.calculateZIndex();\n // Tell parent to re-sort children\n parent.setUpdateType(UpdateType.ZIndexSortedChildren);\n }\n if (this.updateType & UpdateType.Children && this.children.length) {\n this.children.forEach((child) => {\n // Trigger the depenedent update types on the child\n child.setUpdateType(childUpdateType);\n // If child has no updates, skip\n if (child.updateType === 0) {\n return;\n }\n child.update(delta, this.clippingRect);\n });\n }\n // Sorting children MUST happen after children have been updated so\n // that they have the oppotunity to update their calculated zIndex.\n if (this.updateType & UpdateType.ZIndexSortedChildren) {\n // reorder z-index\n this.sortChildren();\n }\n // reset update type\n this.updateType = 0;\n }\n //check if CoreNode is renderable based on props\n checkRenderProps() {\n if (this.props.texture) {\n return true;\n }\n if (!this.props.width || !this.props.height) {\n return false;\n }\n if (this.props.shader) {\n return true;\n }\n if (this.props.clipping) {\n return true;\n }\n if (this.props.color !== 0) {\n return true;\n }\n // Consider removing these checks and just using the color property check above.\n // Maybe add a forceRender prop for nodes that should always render.\n if (this.props.colorTop !== 0) {\n return true;\n }\n if (this.props.colorBottom !== 0) {\n return true;\n }\n if (this.props.colorLeft !== 0) {\n return true;\n }\n if (this.props.colorRight !== 0) {\n return true;\n }\n if (this.props.colorTl !== 0) {\n return true;\n }\n if (this.props.colorTr !== 0) {\n return true;\n }\n if (this.props.colorBl !== 0) {\n return true;\n }\n if (this.props.colorBr !== 0) {\n return true;\n }\n return false;\n }\n checkRenderBounds(parentClippingRect) {\n assertTruthy(this.renderBound);\n const rectW = parentClippingRect.width || this.stage.root.width;\n const rectH = parentClippingRect.height || this.stage.root.height;\n this.strictBound = createBound(parentClippingRect.x, parentClippingRect.y, parentClippingRect.x + rectW, parentClippingRect.y + rectH, this.strictBound);\n const renderM = this.stage.boundsMargin;\n this.preloadBound = createBound(parentClippingRect.x - renderM[3], parentClippingRect.y - renderM[0], parentClippingRect.x + rectW + renderM[1], parentClippingRect.y + rectH + renderM[2], this.preloadBound);\n if (boundInsideBound(this.renderBound, this.strictBound)) {\n return CoreNodeRenderState.InViewport;\n }\n if (boundInsideBound(this.renderBound, this.preloadBound)) {\n return CoreNodeRenderState.InBounds;\n }\n return CoreNodeRenderState.OutOfBounds;\n }\n updateRenderState(parentClippingRect) {\n const renderState = this.checkRenderBounds(parentClippingRect);\n if (renderState !== this.renderState) {\n let previous = this.renderState;\n this.renderState = renderState;\n if (previous === CoreNodeRenderState.InViewport) {\n this.emit('outOfViewport', {\n previous,\n current: renderState,\n });\n }\n if (previous < CoreNodeRenderState.InBounds &&\n renderState === CoreNodeRenderState.InViewport) {\n this.emit(CoreNodeRenderStateMap.get(CoreNodeRenderState.InBounds), {\n previous,\n current: renderState,\n });\n previous = CoreNodeRenderState.InBounds;\n }\n else if (previous > CoreNodeRenderState.InBounds &&\n renderState === CoreNodeRenderState.OutOfBounds) {\n this.emit(CoreNodeRenderStateMap.get(CoreNodeRenderState.InBounds), {\n previous,\n current: renderState,\n });\n previous = CoreNodeRenderState.InBounds;\n }\n const event = CoreNodeRenderStateMap.get(renderState);\n assertTruthy(event);\n this.emit(event, {\n previous,\n current: renderState,\n });\n }\n }\n setRenderState(state) {\n if (state !== this.renderState) {\n this.renderState = state;\n this.emit(CoreNodeRenderState[state]);\n }\n }\n /**\n * This function updates the `isRenderable` property based on certain conditions.\n *\n * @returns\n */\n updateIsRenderable() {\n let newIsRenderable;\n if (this.worldAlpha === 0 || !this.checkRenderProps()) {\n newIsRenderable = false;\n }\n else {\n newIsRenderable = this.renderState > CoreNodeRenderState.OutOfBounds;\n }\n if (this.isRenderable !== newIsRenderable) {\n this.isRenderable = newIsRenderable;\n this.onChangeIsRenderable(newIsRenderable);\n }\n }\n onChangeIsRenderable(isRenderable) {\n this.props.texture?.setRenderableOwner(this, isRenderable);\n }\n calculateRenderCoords() {\n const { width, height, globalTransform: transform } = this;\n assertTruthy(transform);\n const { tx, ty, ta, tb, tc, td } = transform;\n if (tb === 0 && tc === 0) {\n const minX = tx;\n const maxX = tx + width * ta;\n const minY = ty;\n const maxY = ty + height * td;\n this.renderCoords = RenderCoords.translate(\n //top-left\n minX, minY, \n //top-right\n maxX, minY, \n //bottom-right\n maxX, maxY, \n //bottom-left\n minX, maxY, this.renderCoords);\n }\n else {\n this.renderCoords = RenderCoords.translate(\n //top-left\n tx, ty, \n //top-right\n tx + width * ta, ty + width * tc, \n //bottom-right\n tx + width * ta + height * tb, ty + width * tc + height * td, \n //bottom-left\n tx + height * tb, ty + height * td, this.renderCoords);\n }\n }\n updateBoundingRect() {\n const { renderCoords, globalTransform: transform } = this;\n assertTruthy(transform);\n assertTruthy(renderCoords);\n const { tb, tc } = transform;\n const { x1, y1, x3, y3 } = renderCoords;\n if (tb === 0 || tc === 0) {\n this.renderBound = createBound(x1, y1, x3, y3, this.renderBound);\n }\n else {\n const { x2, x4, y2, y4 } = renderCoords;\n this.renderBound = createBound(Math.min(x1, x2, x3, x4), Math.min(y1, y2, y3, y4), Math.max(x1, x2, x3, x4), Math.max(y1, y2, y3, y4), this.renderBound);\n }\n }\n /**\n * This function calculates the clipping rectangle for a node.\n *\n * The function then checks if the node is rotated. If the node requires clipping and is not rotated, a new clipping rectangle is created based on the node's global transform and dimensions.\n * If a parent clipping rectangle exists, it is intersected with the node's clipping rectangle (if it exists), or replaces the node's clipping rectangle.\n *\n * Finally, the node's parentClippingRect and clippingRect properties are updated.\n */\n calculateClippingRect(parentClippingRect) {\n assertTruthy(this.globalTransform);\n const { clippingRect, props, globalTransform: gt } = this;\n const { clipping } = props;\n const isRotated = gt.tb !== 0 || gt.tc !== 0;\n if (clipping && !isRotated) {\n clippingRect.x = gt.tx;\n clippingRect.y = gt.ty;\n clippingRect.width = this.width * gt.ta;\n clippingRect.height = this.height * gt.td;\n clippingRect.valid = true;\n }\n else {\n clippingRect.valid = false;\n }\n if (parentClippingRect.valid && clippingRect.valid) {\n // Intersect parent clipping rect with node clipping rect\n intersectRect(parentClippingRect, clippingRect, clippingRect);\n }\n else if (parentClippingRect.valid) {\n // Copy parent clipping rect\n copyRect(parentClippingRect, clippingRect);\n clippingRect.valid = true;\n }\n }\n calculateZIndex() {\n const props = this.props;\n const z = props.zIndex || 0;\n const p = props.parent?.zIndex || 0;\n let zIndex = z;\n if (props.parent?.zIndexLocked) {\n zIndex = z < p ? z : p;\n }\n this.calcZIndex = zIndex;\n }\n /**\n * Destroy the node and cleanup all resources\n */\n destroy() {\n this.unloadTexture();\n this.clippingRect.valid = false;\n this.isRenderable = false;\n delete this.renderCoords;\n delete this.renderBound;\n delete this.strictBound;\n delete this.preloadBound;\n delete this.globalTransform;\n delete this.scaleRotateTransform;\n delete this.localTransform;\n this.props.texture = null;\n this.props.shader = null;\n this.removeAllListeners();\n this.parent = null;\n }\n renderQuads(renderer) {\n const { width, height, texture, textureOptions, shader, shaderProps } = this.props;\n const { premultipliedColorTl, premultipliedColorTr, premultipliedColorBl, premultipliedColorBr, } = this;\n const { zIndex, worldAlpha, globalTransform: gt, clippingRect } = this;\n assertTruthy(gt);\n // add to list of renderables to be sorted before rendering\n renderer.addQuad({\n width,\n height,\n colorTl: premultipliedColorTl,\n colorTr: premultipliedColorTr,\n colorBl: premultipliedColorBl,\n colorBr: premultipliedColorBr,\n texture,\n textureOptions,\n zIndex,\n shader,\n shaderProps,\n alpha: worldAlpha,\n clippingRect,\n tx: gt.tx,\n ty: gt.ty,\n ta: gt.ta,\n tb: gt.tb,\n tc: gt.tc,\n td: gt.td,\n });\n // Calculate absolute X and Y based on all ancestors\n // renderer.addQuad(absX, absY, w, h, color, texture, textureOptions, zIndex);\n }\n //#region Properties\n get id() {\n return this.props.id;\n }\n get x() {\n return this.props.x;\n }\n set x(value) {\n if (this.props.x !== value) {\n this.props.x = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get absX() {\n return (this.props.x +\n (this.props.parent?.absX || this.props.parent?.globalTransform?.tx || 0));\n }\n get absY() {\n return this.props.y + (this.props.parent?.absY ?? 0);\n }\n get y() {\n return this.props.y;\n }\n set y(value) {\n if (this.props.y !== value) {\n this.props.y = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get width() {\n return this.props.width;\n }\n set width(value) {\n if (this.props.width !== value) {\n this.props.width = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get height() {\n return this.props.height;\n }\n set height(value) {\n if (this.props.height !== value) {\n this.props.height = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get scale() {\n // The CoreNode `scale` property is only used by Animations.\n // Unlike INode, `null` should never be possibility for Animations.\n return this.scaleX;\n }\n set scale(value) {\n // The CoreNode `scale` property is only used by Animations.\n // Unlike INode, `null` should never be possibility for Animations.\n this.scaleX = value;\n this.scaleY = value;\n }\n get scaleX() {\n return this.props.scaleX;\n }\n set scaleX(value) {\n if (this.props.scaleX !== value) {\n this.props.scaleX = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get scaleY() {\n return this.props.scaleY;\n }\n set scaleY(value) {\n if (this.props.scaleY !== value) {\n this.props.scaleY = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get mount() {\n return this.props.mount;\n }\n set mount(value) {\n if (this.props.mountX !== value || this.props.mountY !== value) {\n this.props.mountX = value;\n this.props.mountY = value;\n this.props.mount = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get mountX() {\n return this.props.mountX;\n }\n set mountX(value) {\n if (this.props.mountX !== value) {\n this.props.mountX = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get mountY() {\n return this.props.mountY;\n }\n set mountY(value) {\n if (this.props.mountY !== value) {\n this.props.mountY = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivot() {\n return this.props.pivot;\n }\n set pivot(value) {\n if (this.props.pivotX !== value || this.props.pivotY !== value) {\n this.props.pivotX = value;\n this.props.pivotY = value;\n this.props.pivot = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivotX() {\n return this.props.pivotX;\n }\n set pivotX(value) {\n if (this.props.pivotX !== value) {\n this.props.pivotX = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivotY() {\n return this.props.pivotY;\n }\n set pivotY(value) {\n if (this.props.pivotY !== value) {\n this.props.pivotY = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get rotation() {\n return this.props.rotation;\n }\n set rotation(value) {\n if (this.props.rotation !== value) {\n this.props.rotation = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get alpha() {\n return this.props.alpha;\n }\n set alpha(value) {\n this.props.alpha = value;\n this.setUpdateType(UpdateType.PremultipliedColors | UpdateType.WorldAlpha);\n }\n get autosize() {\n return this.props.autosize;\n }\n set autosize(value) {\n this.props.autosize = value;\n }\n get clipping() {\n return this.props.clipping;\n }\n set clipping(value) {\n this.props.clipping = value;\n this.setUpdateType(UpdateType.Clipping);\n }\n get color() {\n return this.props.color;\n }\n set color(value) {\n if (this.props.colorTl !== value ||\n this.props.colorTr !== value ||\n this.props.colorBl !== value ||\n this.props.colorBr !== value) {\n this.colorTl = value;\n this.colorTr = value;\n this.colorBl = value;\n this.colorBr = value;\n }\n this.props.color = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTop() {\n return this.props.colorTop;\n }\n set colorTop(value) {\n if (this.props.colorTl !== value || this.props.colorTr !== value) {\n this.colorTl = value;\n this.colorTr = value;\n }\n this.props.colorTop = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBottom() {\n return this.props.colorBottom;\n }\n set colorBottom(value) {\n if (this.props.colorBl !== value || this.props.colorBr !== value) {\n this.colorBl = value;\n this.colorBr = value;\n }\n this.props.colorBottom = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorLeft() {\n return this.props.colorLeft;\n }\n set colorLeft(value) {\n if (this.props.colorTl !== value || this.props.colorBl !== value) {\n this.colorTl = value;\n this.colorBl = value;\n }\n this.props.colorLeft = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorRight() {\n return this.props.colorRight;\n }\n set colorRight(value) {\n if (this.props.colorTr !== value || this.props.colorBr !== value) {\n this.colorTr = value;\n this.colorBr = value;\n }\n this.props.colorRight = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTl() {\n return this.props.colorTl;\n }\n set colorTl(value) {\n this.props.colorTl = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTr() {\n return this.props.colorTr;\n }\n set colorTr(value) {\n this.props.colorTr = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBl() {\n return this.props.colorBl;\n }\n set colorBl(value) {\n this.props.colorBl = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBr() {\n return this.props.colorBr;\n }\n set colorBr(value) {\n this.props.colorBr = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n // we're only interested in parent zIndex to test\n // if we should use node zIndex is higher then parent zIndex\n get zIndexLocked() {\n return this.props.zIndexLocked || 0;\n }\n set zIndexLocked(value) {\n this.props.zIndexLocked = value;\n this.setUpdateType(UpdateType.CalculatedZIndex | UpdateType.Children);\n this.children.forEach((child) => {\n child.setUpdateType(UpdateType.CalculatedZIndex);\n });\n }\n get zIndex() {\n return this.props.zIndex;\n }\n set zIndex(value) {\n this.props.zIndex = value;\n this.setUpdateType(UpdateType.CalculatedZIndex | UpdateType.Children);\n this.children.forEach((child) => {\n child.setUpdateType(UpdateType.CalculatedZIndex);\n });\n }\n get parent() {\n return this.props.parent;\n }\n set parent(newParent) {\n const oldParent = this.props.parent;\n if (oldParent === newParent) {\n return;\n }\n this.props.parent = newParent;\n if (oldParent) {\n const index = oldParent.children.indexOf(this);\n assertTruthy(index !== -1, \"CoreNode.parent: Node not found in old parent's children!\");\n oldParent.children.splice(index, 1);\n oldParent.setUpdateType(UpdateType.Children | UpdateType.ZIndexSortedChildren);\n }\n if (newParent) {\n newParent.children.push(this);\n // Since this node has a new parent, to be safe, have it do a full update.\n this.setUpdateType(UpdateType.All);\n // Tell parent that it's children need to be updated and sorted.\n newParent.setUpdateType(UpdateType.Children | UpdateType.ZIndexSortedChildren);\n }\n this.updateScaleRotateTransform();\n }\n}\n//# sourceMappingURL=CoreNode.js.map","const rx1 = 0;\nconst rx2 = 2;\nconst rx3 = 4;\nconst rx4 = 6;\nconst ry1 = 1;\nconst ry2 = 3;\nconst ry3 = 5;\nconst ry4 = 7;\nexport class RenderCoords {\n data;\n constructor(entries) {\n this.data = new Float32Array(8);\n if (entries) {\n this.data[rx1] = entries[rx1];\n this.data[rx2] = entries[rx2];\n this.data[rx3] = entries[rx3];\n this.data[rx4] = entries[rx4];\n this.data[ry1] = entries[ry1];\n this.data[ry2] = entries[ry2];\n this.data[ry3] = entries[ry3];\n this.data[ry4] = entries[ry4];\n }\n }\n static translate(x1, y1, x2, y2, x3, y3, x4, y4, out) {\n if (!out) {\n out = new RenderCoords();\n }\n out.data[rx1] = x1;\n out.data[rx2] = x2;\n out.data[rx3] = x3;\n out.data[rx4] = x4;\n out.data[ry1] = y1;\n out.data[ry2] = y2;\n out.data[ry3] = y3;\n out.data[ry4] = y4;\n return out;\n }\n get x1() {\n return this.data[rx1];\n }\n get x2() {\n return this.data[rx2];\n }\n get x3() {\n return this.data[rx3];\n }\n get x4() {\n return this.data[rx4];\n }\n get y1() {\n return this.data[ry1];\n }\n get y2() {\n return this.data[ry2];\n }\n get y3() {\n return this.data[ry3];\n }\n get y4() {\n return this.data[ry4];\n }\n}\n//# sourceMappingURL=RenderCoords.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { CoreAnimation } from '../../core/animations/CoreAnimation.js';\nimport { CoreAnimationController } from '../../core/animations/CoreAnimationController.js';\nimport { CoreNode } from '../../core/CoreNode.js';\nimport { EventEmitter } from '../../common/EventEmitter.js';\nimport { santizeCustomDataMap } from '../utils.js';\nlet nextId = 1;\nexport function getNewId() {\n return nextId++;\n}\nexport class MainOnlyNode extends EventEmitter {\n rendererMain;\n stage;\n id;\n coreNode;\n // Prop stores\n _children = [];\n _src = '';\n _parent = null;\n _texture = null;\n _shader = null;\n _data = {};\n constructor(props, rendererMain, stage, coreNode) {\n super();\n this.rendererMain = rendererMain;\n this.stage = stage;\n this.id = coreNode?.id ?? getNewId();\n this.coreNode =\n coreNode ||\n new CoreNode(this.stage, {\n id: this.id,\n x: props.x,\n y: props.y,\n width: props.width,\n height: props.height,\n alpha: props.alpha,\n autosize: props.autosize,\n clipping: props.clipping,\n color: props.color,\n colorTop: props.colorTop,\n colorBottom: props.colorBottom,\n colorLeft: props.colorLeft,\n colorRight: props.colorRight,\n colorTl: props.colorTl,\n colorTr: props.colorTr,\n colorBl: props.colorBl,\n colorBr: props.colorBr,\n zIndex: props.zIndex,\n zIndexLocked: props.zIndexLocked,\n scaleX: props.scaleX,\n scaleY: props.scaleY,\n mountX: props.mountX,\n mountY: props.mountY,\n mount: props.mount,\n pivot: props.pivot,\n pivotX: props.pivotX,\n pivotY: props.pivotY,\n rotation: props.rotation,\n parent: null,\n shader: null,\n shaderProps: null,\n texture: null,\n textureOptions: null,\n });\n // Forward loaded/failed events\n this.coreNode.on('loaded', this.onTextureLoaded);\n this.coreNode.on('failed', this.onTextureFailed);\n this.coreNode.on('freed', this.onTextureFreed);\n this.coreNode.on('outOfBounds', this.onOutOfBounds);\n this.coreNode.on('inBounds', this.onInBounds);\n this.coreNode.on('outOfViewport', this.onOutOfViewport);\n this.coreNode.on('inViewport', this.onInViewport);\n // Assign properties to this object\n this.parent = props.parent;\n this.shader = props.shader;\n this.texture = props.texture;\n this.src = props.src;\n this._data = props.data;\n }\n get x() {\n return this.coreNode.x;\n }\n set x(value) {\n this.coreNode.x = value;\n }\n get y() {\n return this.coreNode.y;\n }\n set y(value) {\n this.coreNode.y = value;\n }\n get width() {\n return this.coreNode.width;\n }\n set width(value) {\n this.coreNode.width = value;\n }\n get height() {\n return this.coreNode.height;\n }\n set height(value) {\n this.coreNode.height = value;\n }\n get alpha() {\n return this.coreNode.alpha;\n }\n set alpha(value) {\n this.coreNode.alpha = value;\n }\n get autosize() {\n return this.coreNode.autosize;\n }\n set autosize(value) {\n this.coreNode.autosize = value;\n }\n get clipping() {\n return this.coreNode.clipping;\n }\n set clipping(value) {\n this.coreNode.clipping = value;\n }\n get color() {\n return this.coreNode.color;\n }\n set color(value) {\n this.coreNode.color = value;\n }\n get colorTop() {\n return this.coreNode.colorTop;\n }\n set colorTop(value) {\n this.coreNode.colorTop = value;\n }\n get colorBottom() {\n return this.coreNode.colorBottom;\n }\n set colorBottom(value) {\n this.coreNode.colorBottom = value;\n }\n get colorLeft() {\n return this.coreNode.colorLeft;\n }\n set colorLeft(value) {\n this.coreNode.colorLeft = value;\n }\n get colorRight() {\n return this.coreNode.colorRight;\n }\n set colorRight(value) {\n this.coreNode.colorRight = value;\n }\n get colorTl() {\n return this.coreNode.colorTl;\n }\n set colorTl(value) {\n this.coreNode.colorTl = value;\n }\n get colorTr() {\n return this.coreNode.colorTr;\n }\n set colorTr(value) {\n this.coreNode.colorTr = value;\n }\n get colorBl() {\n return this.coreNode.colorBl;\n }\n set colorBl(value) {\n this.coreNode.colorBl = value;\n }\n get colorBr() {\n return this.coreNode.colorBr;\n }\n set colorBr(value) {\n this.coreNode.colorBr = value;\n }\n get scale() {\n if (this.scaleX !== this.scaleY) {\n return null;\n }\n return this.coreNode.scaleX;\n }\n set scale(value) {\n // We ignore `null` when it's set.\n if (value === null) {\n return;\n }\n this.coreNode.scaleX = value;\n this.coreNode.scaleY = value;\n }\n get scaleX() {\n return this.coreNode.scaleX;\n }\n set scaleX(value) {\n this.coreNode.scaleX = value;\n }\n get scaleY() {\n return this.coreNode.scaleY;\n }\n set scaleY(value) {\n this.coreNode.scaleY = value;\n }\n get mount() {\n return this.coreNode.mount;\n }\n set mount(value) {\n this.coreNode.mount = value;\n }\n get mountX() {\n return this.coreNode.mountX;\n }\n set mountX(value) {\n this.coreNode.mountX = value;\n }\n get mountY() {\n return this.coreNode.mountY;\n }\n set mountY(value) {\n this.coreNode.mountY = value;\n }\n get pivot() {\n return this.coreNode.pivot;\n }\n set pivot(value) {\n this.coreNode.pivot = value;\n }\n get pivotX() {\n return this.coreNode.pivotX;\n }\n set pivotX(value) {\n this.coreNode.pivotX = value;\n }\n get pivotY() {\n return this.coreNode.pivotY;\n }\n set pivotY(value) {\n this.coreNode.pivotY = value;\n }\n get rotation() {\n return this.coreNode.rotation;\n }\n set rotation(value) {\n this.coreNode.rotation = value;\n }\n get parent() {\n return this._parent;\n }\n set parent(newParent) {\n const oldParent = this._parent;\n this._parent = newParent;\n this.coreNode.parent = newParent?.coreNode ?? null;\n if (oldParent) {\n const index = oldParent.children.indexOf(this);\n assertTruthy(index !== -1, \"MainOnlyNode.parent: Node not found in old parent's children!\");\n oldParent.children.splice(index, 1);\n }\n if (newParent) {\n newParent.children.push(this);\n }\n }\n get children() {\n return this._children;\n }\n get zIndex() {\n return this.coreNode.zIndex;\n }\n set zIndex(value) {\n this.coreNode.zIndex = value;\n }\n get zIndexLocked() {\n return this.coreNode.zIndexLocked;\n }\n set zIndexLocked(value) {\n this.coreNode.zIndexLocked = value;\n }\n get src() {\n return this._src;\n }\n set src(imageUrl) {\n if (this._src === imageUrl) {\n return;\n }\n this._src = imageUrl;\n if (!imageUrl) {\n this.texture = null;\n return;\n }\n this.texture = this.rendererMain.createTexture('ImageTexture', {\n src: imageUrl,\n });\n }\n //#region Texture\n get texture() {\n return this._texture;\n }\n set texture(texture) {\n if (this._texture === texture) {\n return;\n }\n if (this._texture) {\n this.rendererMain.textureTracker.decrementTextureRefCount(this._texture);\n }\n if (texture) {\n this.rendererMain.textureTracker.incrementTextureRefCount(texture);\n }\n this._texture = texture;\n if (texture) {\n this.coreNode.loadTexture(texture.txType, texture.props, texture.options);\n }\n else {\n this.coreNode.unloadTexture();\n }\n }\n onTextureLoaded = (target, payload) => {\n this.emit('loaded', payload);\n };\n onTextureFailed = (target, payload) => {\n this.emit('failed', payload);\n };\n onTextureFreed = (target, payload) => {\n this.emit('freed', payload);\n };\n onOutOfBounds = (target, payload) => {\n this.emit('outOfBounds', payload);\n };\n onInBounds = (target, payload) => {\n this.emit('inBounds', payload);\n };\n onOutOfViewport = (target, payload) => {\n this.emit('outOfViewport', payload);\n };\n onInViewport = (target, payload) => {\n this.emit('inViewport', payload);\n };\n //#endregion Texture\n get shader() {\n return this._shader;\n }\n set shader(shader) {\n if (this._shader === shader) {\n return;\n }\n this._shader = shader;\n if (shader) {\n this.coreNode.loadShader(shader.shType, shader.props);\n }\n }\n get data() {\n return this._data;\n }\n set data(d) {\n this._data = santizeCustomDataMap(d);\n }\n destroy() {\n this.emit('beforeDestroy', {});\n //use while loop since setting parent to null removes it from array\n let child = this.children[0];\n while (child) {\n child.destroy();\n child = this.children[0];\n }\n this.coreNode.destroy();\n this.parent = null;\n this.texture = null;\n this.emit('afterDestroy', {});\n this.removeAllListeners();\n }\n flush() {\n // No-op\n }\n animate(props, settings) {\n const animation = new CoreAnimation(this.coreNode, props, settings);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call\n const controller = new CoreAnimationController(this.stage.animationManager, animation);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return controller;\n }\n}\n//# sourceMappingURL=MainOnlyNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreAnimation } from './CoreAnimation.js';\nexport class AnimationManager {\n activeAnimations = new Set();\n registerAnimation(animation) {\n this.activeAnimations.add(animation);\n }\n unregisterAnimation(animation) {\n this.activeAnimations.delete(animation);\n }\n update(dt) {\n this.activeAnimations.forEach((animation) => {\n animation.update(dt);\n });\n }\n}\n//# sourceMappingURL=AnimationManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {} from '../textures/Texture.js';\nexport class ImageWorkerManager {\n imageWorkersEnabled = true;\n messageManager = {};\n workers = [];\n workerIndex = 0;\n constructor(numImageWorkers) {\n this.workers = this.createWorkers(numImageWorkers);\n this.workers.forEach((worker) => {\n worker.onmessage = this.handleMessage.bind(this);\n });\n }\n handleMessage(event) {\n const { src, data, error } = event.data;\n const msg = this.messageManager[src];\n if (msg) {\n const [resolve, reject] = msg;\n delete this.messageManager[src];\n if (error) {\n reject(new Error(error));\n }\n else {\n resolve(data);\n }\n }\n }\n createWorkers(numWorkers = 1) {\n const workerCode = `\n function hasAlphaChannel(mimeType) {\n return (mimeType.indexOf(\"image/png\") !== -1);\n }\n\n function getImage(src, premultiplyAlpha) {\n return new Promise(function(resolve, reject) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', src, true);\n xhr.responseType = 'blob';\n\n xhr.onload = function() {\n if (xhr.status === 200) {\n var blob = xhr.response;\n var hasAlphaChannel = premultiplyAlpha !== undefined ? premultiplyAlpha : hasAlphaChannel(blob.type);\n\n createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none'\n }).then(function(data) {\n resolve({ data: data, premultiplyAlpha: premultiplyAlpha });\n }).catch(function(error) {\n reject(error);\n });\n } else {\n reject(new Error('Failed to load image: ' + xhr.statusText));\n }\n };\n\n xhr.onerror = function() {\n reject(new Error('Network error occurred while trying to fetch the image.'));\n };\n\n xhr.send();\n });\n }\n\n self.onmessage = async (event) => {\n var src = event.data.src;\n var premultiplyAlpha = event.data.premultiplyAlpha;\n\n getImage(src, premultiplyAlpha)\n .then(function(data) {\n self.postMessage({ src: src, data: data }, [data.data]);\n })\n .catch(function(error) {\n self.postMessage({ src: src, error: error.message });\n });\n };\n `;\n const blob = new Blob([workerCode.replace('\"use strict\";', '')], {\n type: 'application/javascript',\n });\n const blobURL = (self.URL ? URL : webkitURL).createObjectURL(blob);\n const workers = [];\n for (let i = 0; i < numWorkers; i++) {\n workers.push(new Worker(blobURL));\n }\n return workers;\n }\n getNextWorker() {\n const worker = this.workers[this.workerIndex];\n this.workerIndex = (this.workerIndex + 1) % this.workers.length;\n return worker;\n }\n convertUrlToAbsolute(url) {\n const absoluteUrl = new URL(url, self.location.href);\n return absoluteUrl.href;\n }\n getImage(src, premultiplyAlpha) {\n return new Promise((resolve, reject) => {\n try {\n if (this.workers) {\n const absoluteSrcUrl = this.convertUrlToAbsolute(src);\n this.messageManager[absoluteSrcUrl] = [resolve, reject];\n this.getNextWorker().postMessage({\n src: absoluteSrcUrl,\n premultiplyAlpha,\n });\n }\n }\n catch (error) {\n reject(error);\n }\n });\n }\n}\n//# sourceMappingURL=ImageWorker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\n/**\n * Texture consisting of a random grid of greyscale pixels\n *\n * @remarks\n * The width and height of the NoiseTexture are defined by it's\n * {@link NoiseTextureProps.width} and {@link NoiseTextureProps.height}\n * properties. The {@link NoiseTextureProps.cacheId} prop can be varied in order\n * to bypass cache and get newly randomized texture data.\n */\nexport class NoiseTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = NoiseTexture.resolveDefaults(props);\n }\n async getTextureData() {\n const { width, height } = this.props;\n const size = width * height * 4;\n const pixelData8 = new Uint8ClampedArray(size);\n for (let i = 0; i < size; i += 4) {\n const v = Math.floor(Math.random() * 256);\n pixelData8[i] = v;\n pixelData8[i + 1] = v;\n pixelData8[i + 2] = v;\n pixelData8[i + 3] = 255;\n }\n return {\n data: new ImageData(pixelData8, width, height),\n };\n }\n static makeCacheKey(props) {\n const resolvedProps = NoiseTexture.resolveDefaults(props);\n return `NoiseTexture,${resolvedProps.width},${resolvedProps.height},${resolvedProps.cacheId}`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 128,\n height: props.height ?? 128,\n cacheId: props.cacheId ?? 0,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=NoiseTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../utils.js';\nimport { ImageWorkerManager } from './lib/ImageWorker.js';\nimport { ColorTexture } from './textures/ColorTexture.js';\nimport { ImageTexture } from './textures/ImageTexture.js';\nimport { NoiseTexture } from './textures/NoiseTexture.js';\nimport { SubTexture } from './textures/SubTexture.js';\nexport class CoreTextureManager {\n /**\n * Amount of used memory defined in pixels\n */\n usedMemory = 0;\n txConstructors = {};\n textureKeyCache = new Map();\n textureIdCache = new Map();\n ctxTextureCache = new WeakMap();\n textureRefCountMap = new WeakMap();\n imageWorkerManager = null;\n hasCreateImageBitmap = !!self.createImageBitmap;\n hasWorker = !!self.Worker;\n /**\n * Renderer that this texture manager is associated with\n *\n * @remarks\n * This MUST be set before the texture manager is used. Otherwise errors\n * will occur when using the texture manager.\n */\n renderer;\n constructor(numImageWorkers) {\n // Register default known texture types\n if (this.hasCreateImageBitmap && this.hasWorker) {\n this.imageWorkerManager = new ImageWorkerManager(numImageWorkers);\n }\n if (!this.hasCreateImageBitmap) {\n console.warn('[Lightning] createImageBitmap is not supported on this browser. ImageTexture will be slower.');\n }\n this.registerTextureType('ImageTexture', ImageTexture);\n this.registerTextureType('ColorTexture', ColorTexture);\n this.registerTextureType('NoiseTexture', NoiseTexture);\n this.registerTextureType('SubTexture', SubTexture);\n }\n registerTextureType(textureType, textureClass) {\n this.txConstructors[textureType] = textureClass;\n }\n loadTexture(textureType, props, options = null) {\n const TextureClass = this.txConstructors[textureType];\n if (!TextureClass) {\n throw new Error(`Texture type \"${textureType}\" is not registered`);\n }\n let texture;\n // If an ID is specified, try to get the texture from the ID cache first\n if (options?.id !== undefined && this.textureIdCache.has(options.id)) {\n // console.log('Getting texture by texture desc ID', options.id);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n texture = this.textureIdCache.get(options.id);\n }\n // If the texture is not found in the ID cache, try to get it from the key cache\n if (!texture) {\n const descId = options?.id;\n const cacheKey = options?.cacheKey ?? TextureClass.makeCacheKey(props);\n if (cacheKey && this.textureKeyCache.has(cacheKey)) {\n // console.log('Getting texture by cache key', cacheKey);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n texture = this.textureKeyCache.get(cacheKey);\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any\n texture = new TextureClass(this, props);\n }\n if (descId) {\n this.addTextureIdToCache(descId, cacheKey, texture);\n }\n }\n if (options?.preload) {\n const ctxTx = this.getCtxTexture(texture);\n ctxTx.load();\n }\n return texture;\n }\n /**\n * Add a `Texture` to the texture cache by its texture desc ID and cache key\n *\n * @remarks\n * This is used internally by the `CoreTextureManager` to cache textures\n * when they are created.\n *\n * It handles updating the texture ID cache, texture key cache, and texture\n * reference count map.\n *\n * @param textureDescId\n * @param cacheKey\n * @param texture\n */\n addTextureIdToCache(textureDescId, cacheKey, texture) {\n const { textureIdCache, textureRefCountMap } = this;\n textureIdCache.set(textureDescId, texture);\n if (textureRefCountMap.has(texture)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n textureRefCountMap.get(texture).count++;\n }\n else {\n textureRefCountMap.set(texture, { cacheKey, count: 1 });\n if (cacheKey) {\n this.textureKeyCache.set(cacheKey, texture);\n }\n }\n }\n /**\n * Remove a `Texture` from the texture cache by its texture desc ID\n *\n * @remarks\n * This is called externally by when we know (at least reasonably well) that\n * the `TextureRef` in the Main API space has been is no longer used. This\n * allows us to remove the `Texture` from the Usage Cache so that it can be\n * garbage collected as well.\n *\n * @param textureDescId\n */\n removeTextureIdFromCache(textureDescId) {\n const { textureIdCache, textureRefCountMap } = this;\n const texture = textureIdCache.get(textureDescId);\n if (!texture) {\n // Sometimes a texture is removed from the cache before it ever gets\n // added to the cache. This is fine and not an error.\n return;\n }\n textureIdCache.delete(textureDescId);\n if (textureRefCountMap.has(texture)) {\n const refCountObj = textureRefCountMap.get(texture);\n assertTruthy(refCountObj);\n refCountObj.count--;\n if (refCountObj.count === 0) {\n textureRefCountMap.delete(texture);\n // If the texture is not referenced anywhere else, remove it from the key cache\n // as well.\n // This should allow the `Texture` instance to be garbage collected.\n if (refCountObj.cacheKey) {\n this.textureKeyCache.delete(refCountObj.cacheKey);\n }\n }\n }\n // Free the ctx texture if it exists.\n this.ctxTextureCache.get(texture)?.free();\n }\n /**\n * Get an object containing debug information about the texture manager.\n *\n * @returns\n */\n getDebugInfo() {\n // const textureSet = new Set();\n // for (const texture of this.textureIdCache.values()) {\n // textureSet.add(texture);\n // }\n // for (const texture of this.textureKeyCache.values()) {\n // textureSet.add(texture);\n // }\n // TODO: Output number of bytes used by textures\n return {\n keyCacheSize: this.textureKeyCache.size,\n idCacheSize: this.textureIdCache.size,\n };\n }\n /**\n * Get a CoreContextTexture for the given Texture source.\n *\n * @remarks\n * If the texture source already has an allocated CoreContextTexture, it will be\n * returned from the cache. Otherwise, a new CoreContextTexture will be created\n * and cached.\n *\n * ContextTextures are stored in a WeakMap, so they will be garbage collected\n * when the Texture source is no longer referenced.\n *\n * @param textureSource\n * @returns\n */\n getCtxTexture(textureSource) {\n if (this.ctxTextureCache.has(textureSource)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.ctxTextureCache.get(textureSource);\n }\n const texture = this.renderer.createCtxTexture(textureSource);\n this.ctxTextureCache.set(textureSource, texture);\n return texture;\n }\n}\n//# sourceMappingURL=CoreTextureManager.js.map","export class TextureMemoryManager {\n memUsed = 0;\n textures = new Map();\n threshold;\n /**\n * @param byteThreshold Number of texture bytes to trigger garbage collection\n */\n constructor(byteThreshold) {\n this.threshold = byteThreshold;\n // If the threshold is 0, we disable the memory manager by replacing the\n // setTextureMemUse method with a no-op function.\n if (byteThreshold === 0) {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n this.setTextureMemUse = () => { };\n }\n }\n setTextureMemUse(ctxTexture, byteSize) {\n if (this.textures.has(ctxTexture)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.memUsed -= this.textures.get(ctxTexture);\n }\n if (byteSize === 0) {\n this.textures.delete(ctxTexture);\n return;\n }\n else {\n this.memUsed += byteSize;\n this.textures.set(ctxTexture, byteSize);\n }\n if (this.memUsed > this.threshold) {\n this.gc();\n }\n }\n gc() {\n this.textures.forEach((byteSize, ctxTexture) => {\n if (!ctxTexture.renderable) {\n ctxTexture.free();\n }\n });\n }\n}\n//# sourceMappingURL=TextureMemoryManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { startLoop, getTimeStamp } from './platform.js';\nimport { WebGlCoreRenderer } from './renderers/webgl/WebGlCoreRenderer.js';\nimport { assertTruthy } from '../utils.js';\nimport { AnimationManager } from './animations/AnimationManager.js';\nimport { CoreNode } from './CoreNode.js';\nimport { CoreTextureManager } from './CoreTextureManager.js';\nimport { TrFontManager } from './text-rendering/TrFontManager.js';\nimport { CoreShaderManager } from './CoreShaderManager.js';\nimport { SdfTextRenderer } from './text-rendering/renderers/SdfTextRenderer/SdfTextRenderer.js';\nimport { CanvasTextRenderer } from './text-rendering/renderers/CanvasTextRenderer.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { ContextSpy } from './lib/ContextSpy.js';\nimport { TextureMemoryManager } from './TextureMemoryManager.js';\nconst bufferMemory = 2e6;\nconst autoStart = true;\nexport class Stage extends EventEmitter {\n options;\n /// Module Instances\n animationManager;\n txManager;\n txMemManager;\n fontManager;\n textRenderers;\n shManager;\n renderer;\n root;\n boundsMargin;\n /// State\n deltaTime = 0;\n lastFrameTime = 0;\n currentFrameTime = 0;\n fpsNumFrames = 0;\n fpsElapsedTime = 0;\n renderRequested = false;\n /// Debug data\n contextSpy = null;\n /**\n * Stage constructor\n */\n constructor(options) {\n super();\n this.options = options;\n const { canvas, clearColor, rootId, debug, appWidth, appHeight, boundsMargin, enableContextSpy, numImageWorkers, txMemByteThreshold, } = options;\n this.txManager = new CoreTextureManager(numImageWorkers);\n this.txMemManager = new TextureMemoryManager(txMemByteThreshold);\n this.shManager = new CoreShaderManager();\n this.animationManager = new AnimationManager();\n this.contextSpy = enableContextSpy ? new ContextSpy() : null;\n let bm = [0, 0, 0, 0];\n if (boundsMargin) {\n bm = Array.isArray(boundsMargin)\n ? boundsMargin\n : [boundsMargin, boundsMargin, boundsMargin, boundsMargin];\n }\n this.boundsMargin = bm;\n if (debug?.monitorTextureCache) {\n setInterval(() => {\n assertTruthy(this.txManager);\n const debugInfo = this.txManager.getDebugInfo();\n console.log('Texture ID Cache Size: ', debugInfo.idCacheSize);\n console.log('Texture Key Cache Size: ', debugInfo.keyCacheSize);\n }, 1000);\n }\n this.renderer = new WebGlCoreRenderer({\n stage: this,\n canvas,\n pixelRatio: options.devicePhysicalPixelRatio * options.deviceLogicalPixelRatio,\n clearColor: clearColor ?? 0xff000000,\n bufferMemory,\n txManager: this.txManager,\n txMemManager: this.txMemManager,\n shManager: this.shManager,\n contextSpy: this.contextSpy,\n });\n // Must do this after renderer is created\n this.txManager.renderer = this.renderer;\n this.textRenderers = {\n canvas: new CanvasTextRenderer(this),\n sdf: new SdfTextRenderer(this),\n };\n this.fontManager = new TrFontManager(this.textRenderers);\n // create root node\n const rootNode = new CoreNode(this, {\n id: rootId,\n x: 0,\n y: 0,\n width: appWidth,\n height: appHeight,\n alpha: 1,\n autosize: false,\n clipping: false,\n color: 0x00000000,\n colorTop: 0x00000000,\n colorBottom: 0x00000000,\n colorLeft: 0x00000000,\n colorRight: 0x00000000,\n colorTl: 0x00000000,\n colorTr: 0x00000000,\n colorBl: 0x00000000,\n colorBr: 0x00000000,\n zIndex: 0,\n zIndexLocked: 0,\n scaleX: 1,\n scaleY: 1,\n mountX: 0,\n mountY: 0,\n mount: 0,\n pivot: 0.5,\n pivotX: 0.5,\n pivotY: 0.5,\n rotation: 0,\n parent: null,\n texture: null,\n textureOptions: null,\n shader: null,\n shaderProps: null,\n });\n this.root = rootNode;\n // execute platform start loop\n if (autoStart) {\n startLoop(this);\n }\n }\n /**\n * Update animations\n */\n updateAnimations() {\n const { animationManager } = this;\n if (!this.root) {\n return;\n }\n this.lastFrameTime = this.currentFrameTime;\n this.currentFrameTime = getTimeStamp();\n this.deltaTime = !this.lastFrameTime\n ? 100 / 6\n : this.currentFrameTime - this.lastFrameTime;\n this.emit('frameTick', {\n time: this.currentFrameTime,\n delta: this.deltaTime,\n });\n // step animation\n animationManager.update(this.deltaTime);\n }\n /**\n * Check if the scene has updates\n */\n hasSceneUpdates() {\n return !!this.root.updateType || this.renderRequested;\n }\n /**\n * Start a new frame draw\n */\n drawFrame() {\n const { renderer, renderRequested } = this;\n // Update tree if needed\n if (this.root.updateType !== 0) {\n this.root.update(this.deltaTime, this.root.clippingRect);\n }\n // test if we need to update the scene\n renderer?.reset();\n this.addQuads(this.root);\n renderer?.render();\n this.calculateFps();\n // Reset renderRequested flag if it was set\n if (renderRequested) {\n this.renderRequested = false;\n }\n }\n calculateFps() {\n // If there's an FPS update interval, emit the FPS update event\n // when the specified interval has elapsed.\n const { fpsUpdateInterval } = this.options;\n if (fpsUpdateInterval) {\n this.fpsNumFrames++;\n this.fpsElapsedTime += this.deltaTime;\n if (this.fpsElapsedTime >= fpsUpdateInterval) {\n const fps = Math.round((this.fpsNumFrames * 1000) / this.fpsElapsedTime);\n this.fpsNumFrames = 0;\n this.fpsElapsedTime = 0;\n this.emit('fpsUpdate', {\n fps,\n contextSpyData: this.contextSpy?.getData() ?? null,\n });\n this.contextSpy?.reset();\n }\n }\n }\n addQuads(node) {\n assertTruthy(this.renderer && node.globalTransform);\n if (node.isRenderable) {\n node.renderQuads(this.renderer);\n }\n for (let i = 0; i < node.children.length; i++) {\n const child = node.children[i];\n if (!child) {\n continue;\n }\n if (child?.worldAlpha === 0) {\n continue;\n }\n this.addQuads(child);\n }\n }\n /**\n * Request a render pass without forcing an update\n */\n requestRender() {\n this.renderRequested = true;\n }\n /**\n * Given a font name, and possible renderer override, return the best compatible text renderer.\n *\n * @remarks\n * Will always return at least a canvas renderer if no other suitable renderer can be resolved.\n *\n * @param fontFamily\n * @param textRendererOverride\n * @returns\n */\n resolveTextRenderer(trProps, textRendererOverride = null) {\n let rendererId = textRendererOverride;\n let overrideFallback = false;\n // Check if the override is valid (if one is provided)\n if (rendererId) {\n const possibleRenderer = this.textRenderers[rendererId];\n if (!possibleRenderer) {\n console.warn(`Text renderer override '${rendererId}' not found.`);\n rendererId = null;\n overrideFallback = true;\n }\n else if (!possibleRenderer.canRenderFont(trProps)) {\n console.warn(`Cannot use override text renderer '${rendererId}' for font`, trProps);\n rendererId = null;\n overrideFallback = true;\n }\n }\n if (!rendererId) {\n // Iterate through the text renderers and find the first one that can render the font\n for (const [trId, tr] of Object.entries(this.textRenderers)) {\n if (trId === 'canvas') {\n // Canvas is always a fallback\n continue;\n }\n if (tr.canRenderFont(trProps)) {\n rendererId = trId;\n break;\n }\n }\n if (!rendererId) {\n // If no renderer can be found, use the canvas renderer\n rendererId = 'canvas';\n }\n }\n if (overrideFallback) {\n console.warn(`Falling back to text renderer ${String(rendererId)}`);\n }\n // By now we are guaranteed to have a valid rendererId (at least Canvas);\n const resolvedTextRenderer = this.textRenderers[rendererId];\n assertTruthy(resolvedTextRenderer, 'resolvedTextRenderer undefined');\n // Need to explicitly cast to TextRenderer because TS doesn't like\n // the covariant state argument in the setter method map\n return resolvedTextRenderer;\n }\n}\n//# sourceMappingURL=Stage.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Platform render loop initiator\n */\nexport const startLoop = (stage) => {\n let isIdle = false;\n const runLoop = () => {\n stage.updateAnimations();\n if (!stage.hasSceneUpdates()) {\n // We still need to calculate the fps else it looks like the app is frozen\n stage.calculateFps();\n setTimeout(runLoop, 16.666666666666668);\n if (!isIdle) {\n stage.emit('idle');\n isIdle = true;\n }\n return;\n }\n isIdle = false;\n stage.drawFrame();\n requestAnimationFrame(runLoop);\n };\n requestAnimationFrame(runLoop);\n};\n/**\n * Return unix timestamp\n * @return {number}\n */\nexport const getTimeStamp = () => {\n return performance ? performance.now() : Date.now();\n};\n//# sourceMappingURL=platform.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreNode, UpdateType } from './CoreNode.js';\nimport { assertTruthy } from '../utils.js';\nexport class CoreTextNode extends CoreNode {\n textRenderer;\n trState;\n _textRendererOverride = null;\n constructor(stage, props) {\n super(stage, props);\n this._textRendererOverride = props.textRendererOverride;\n const { resolvedTextRenderer, textRendererState } = this.resolveTextRendererAndState({\n x: this.absX,\n y: this.absY,\n width: props.width,\n height: props.height,\n textAlign: props.textAlign,\n color: props.color,\n zIndex: props.zIndex,\n contain: props.contain,\n scrollable: props.scrollable,\n scrollY: props.scrollY,\n offsetY: props.offsetY,\n letterSpacing: props.letterSpacing,\n debug: props.debug,\n fontFamily: props.fontFamily,\n fontSize: props.fontSize,\n fontStretch: props.fontStretch,\n fontStyle: props.fontStyle,\n fontWeight: props.fontWeight,\n text: props.text,\n lineHeight: props.lineHeight,\n maxLines: props.maxLines,\n textBaseline: props.textBaseline,\n verticalAlign: props.verticalAlign,\n overflowSuffix: props.overflowSuffix,\n });\n this.textRenderer = resolvedTextRenderer;\n this.trState = textRendererState;\n }\n onTextLoaded = () => {\n const { contain } = this;\n const setWidth = this.trState.props.width;\n const setHeight = this.trState.props.height;\n const calcWidth = this.trState.textW || 0;\n const calcHeight = this.trState.textH || 0;\n if (contain === 'both') {\n this.props.width = setWidth;\n this.props.height = setHeight;\n }\n else if (contain === 'width') {\n this.props.width = setWidth;\n this.props.height = calcHeight;\n }\n else if (contain === 'none') {\n this.props.width = calcWidth;\n this.props.height = calcHeight;\n }\n this.updateLocalTransform();\n // Incase the RAF loop has been stopped already before text was loaded,\n // we request a render so it can be drawn.\n this.stage.requestRender();\n this.emit('loaded', {\n type: 'text',\n dimensions: {\n width: this.trState.textW || 0,\n height: this.trState.textH || 0,\n },\n });\n };\n onTextFailed = (target, error) => {\n this.emit('failed', {\n type: 'text',\n error,\n });\n };\n get width() {\n return this.props.width;\n }\n set width(value) {\n this.props.width = value;\n this.textRenderer.set.width(this.trState, value);\n // If not containing, we must update the local transform to account for the\n // new width\n if (this.contain === 'none') {\n this.setUpdateType(UpdateType.Local);\n }\n }\n get height() {\n return this.props.height;\n }\n set height(value) {\n this.props.height = value;\n this.textRenderer.set.height(this.trState, value);\n // If not containing in the horizontal direction, we must update the local\n // transform to account for the new height\n if (this.contain !== 'both') {\n this.setUpdateType(UpdateType.Local);\n }\n }\n get color() {\n return this.trState.props.color;\n }\n set color(value) {\n this.textRenderer.set.color(this.trState, value);\n }\n get text() {\n return this.trState.props.text;\n }\n set text(value) {\n this.textRenderer.set.text(this.trState, value);\n }\n get textRendererOverride() {\n return this._textRendererOverride;\n }\n set textRendererOverride(value) {\n this._textRendererOverride = value;\n this.textRenderer.destroyState(this.trState);\n const { resolvedTextRenderer, textRendererState } = this.resolveTextRendererAndState(this.trState.props);\n this.textRenderer = resolvedTextRenderer;\n this.trState = textRendererState;\n }\n get fontSize() {\n return this.trState.props.fontSize;\n }\n set fontSize(value) {\n this.textRenderer.set.fontSize(this.trState, value);\n }\n get fontFamily() {\n return this.trState.props.fontFamily;\n }\n set fontFamily(value) {\n this.textRenderer.set.fontFamily(this.trState, value);\n }\n get fontStretch() {\n return this.trState.props.fontStretch;\n }\n set fontStretch(value) {\n this.textRenderer.set.fontStretch(this.trState, value);\n }\n get fontStyle() {\n return this.trState.props.fontStyle;\n }\n set fontStyle(value) {\n this.textRenderer.set.fontStyle(this.trState, value);\n }\n get fontWeight() {\n return this.trState.props.fontWeight;\n }\n set fontWeight(value) {\n this.textRenderer.set.fontWeight(this.trState, value);\n }\n get textAlign() {\n return this.trState.props.textAlign;\n }\n set textAlign(value) {\n this.textRenderer.set.textAlign(this.trState, value);\n }\n get contain() {\n return this.trState.props.contain;\n }\n set contain(value) {\n this.textRenderer.set.contain(this.trState, value);\n }\n get scrollable() {\n return this.trState.props.scrollable;\n }\n set scrollable(value) {\n this.textRenderer.set.scrollable(this.trState, value);\n }\n get scrollY() {\n return this.trState.props.scrollY;\n }\n set scrollY(value) {\n this.textRenderer.set.scrollY(this.trState, value);\n }\n get offsetY() {\n return this.trState.props.offsetY;\n }\n set offsetY(value) {\n this.textRenderer.set.offsetY(this.trState, value);\n }\n get letterSpacing() {\n return this.trState.props.letterSpacing;\n }\n set letterSpacing(value) {\n this.textRenderer.set.letterSpacing(this.trState, value);\n }\n get lineHeight() {\n return this.trState.props.lineHeight;\n }\n set lineHeight(value) {\n if (this.textRenderer.set.lineHeight) {\n this.textRenderer.set.lineHeight(this.trState, value);\n }\n }\n get maxLines() {\n return this.trState.props.maxLines;\n }\n set maxLines(value) {\n if (this.textRenderer.set.maxLines) {\n this.textRenderer.set.maxLines(this.trState, value);\n }\n }\n get textBaseline() {\n return this.trState.props.textBaseline;\n }\n set textBaseline(value) {\n if (this.textRenderer.set.textBaseline) {\n this.textRenderer.set.textBaseline(this.trState, value);\n }\n }\n get verticalAlign() {\n return this.trState.props.verticalAlign;\n }\n set verticalAlign(value) {\n if (this.textRenderer.set.verticalAlign) {\n this.textRenderer.set.verticalAlign(this.trState, value);\n }\n }\n get overflowSuffix() {\n return this.trState.props.overflowSuffix;\n }\n set overflowSuffix(value) {\n if (this.textRenderer.set.overflowSuffix) {\n this.textRenderer.set.overflowSuffix(this.trState, value);\n }\n }\n get debug() {\n return this.trState.props.debug;\n }\n set debug(value) {\n this.textRenderer.set.debug(this.trState, value);\n }\n update(delta, parentClippingRect) {\n super.update(delta, parentClippingRect);\n assertTruthy(this.globalTransform);\n // globalTransform is updated in super.update(delta)\n this.textRenderer.set.x(this.trState, this.globalTransform.tx);\n this.textRenderer.set.y(this.trState, this.globalTransform.ty);\n }\n checkRenderProps() {\n if (this.trState.props.text !== '') {\n return true;\n }\n return super.checkRenderProps();\n }\n onChangeIsRenderable(isRenderable) {\n super.onChangeIsRenderable(isRenderable);\n this.textRenderer.setIsRenderable(this.trState, isRenderable);\n }\n renderQuads(renderer) {\n assertTruthy(this.globalTransform);\n this.textRenderer.renderQuads(this.trState, this.globalTransform, this.clippingRect, this.worldAlpha);\n }\n /**\n * Destroy the node and cleanup all resources\n */\n destroy() {\n super.destroy();\n this.textRenderer.destroyState(this.trState);\n }\n /**\n * Resolve a text renderer and a new state based on the current text renderer props provided\n * @param props\n * @returns\n */\n resolveTextRendererAndState(props) {\n const resolvedTextRenderer = this.stage.resolveTextRenderer(props, this._textRendererOverride);\n const textRendererState = resolvedTextRenderer.createState(props);\n textRendererState.emitter.on('loaded', this.onTextLoaded);\n textRendererState.emitter.on('failed', this.onTextFailed);\n resolvedTextRenderer.scheduleUpdateState(textRendererState);\n return {\n resolvedTextRenderer,\n textRendererState,\n };\n }\n}\n//# sourceMappingURL=CoreTextNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { MainOnlyNode, getNewId } from './MainOnlyNode.js';\nimport { CoreTextNode } from '../../core/CoreTextNode.js';\nexport class MainOnlyTextNode extends MainOnlyNode {\n constructor(props, rendererMain, stage) {\n super(props, rendererMain, stage, new CoreTextNode(stage, {\n id: getNewId(),\n x: props.x,\n y: props.y,\n width: props.width,\n height: props.height,\n alpha: props.alpha,\n autosize: props.autosize,\n clipping: props.clipping,\n color: props.color,\n colorTop: props.colorTop,\n colorBottom: props.colorBottom,\n colorLeft: props.colorLeft,\n colorRight: props.colorRight,\n colorTl: props.colorTl,\n colorTr: props.colorTr,\n colorBl: props.colorBl,\n colorBr: props.colorBr,\n zIndex: props.zIndex,\n zIndexLocked: props.zIndexLocked,\n scaleX: props.scaleX,\n scaleY: props.scaleY,\n mountX: props.mountX,\n mountY: props.mountY,\n mount: props.mount,\n pivot: props.pivot,\n pivotX: props.pivotX,\n pivotY: props.pivotY,\n rotation: props.rotation,\n // Text properties\n text: props.text,\n fontSize: props.fontSize,\n fontFamily: props.fontFamily,\n fontWeight: props.fontWeight,\n fontStretch: props.fontStretch,\n fontStyle: props.fontStyle,\n contain: props.contain,\n scrollable: props.scrollable,\n letterSpacing: props.letterSpacing,\n textAlign: props.textAlign,\n scrollY: props.scrollY,\n offsetY: props.offsetY,\n textRendererOverride: props.textRendererOverride,\n lineHeight: props.lineHeight,\n maxLines: props.maxLines,\n textBaseline: props.textBaseline,\n verticalAlign: props.verticalAlign,\n overflowSuffix: props.overflowSuffix,\n debug: props.debug,\n // These properties will get set appropriately in the base MainOnlyNode class\n parent: null,\n texture: null,\n textureOptions: null,\n shader: null,\n shaderProps: null,\n }));\n }\n get text() {\n return this.coreNode.text;\n }\n set text(value) {\n this.coreNode.text = value;\n }\n get textRendererOverride() {\n return this.coreNode.textRendererOverride;\n }\n set textRendererOverride(value) {\n this.coreNode.textRendererOverride = value;\n }\n get fontSize() {\n return this.coreNode.fontSize;\n }\n set fontSize(value) {\n this.coreNode.fontSize = value;\n }\n get fontFamily() {\n return this.coreNode.fontFamily;\n }\n set fontFamily(value) {\n this.coreNode.fontFamily = value;\n }\n get fontWeight() {\n return this.coreNode.fontWeight;\n }\n set fontWeight(value) {\n this.coreNode.fontWeight = value;\n }\n get fontStretch() {\n return this.coreNode.fontStretch;\n }\n set fontStretch(value) {\n this.coreNode.fontStretch = value;\n }\n get fontStyle() {\n return this.coreNode.fontStyle;\n }\n set fontStyle(value) {\n this.coreNode.fontStyle = value;\n }\n get textAlign() {\n return this.coreNode.textAlign;\n }\n set textAlign(value) {\n this.coreNode.textAlign = value;\n }\n get contain() {\n return this.coreNode.contain;\n }\n set contain(value) {\n this.coreNode.contain = value;\n }\n get scrollable() {\n return this.coreNode.scrollable;\n }\n set scrollable(value) {\n this.coreNode.scrollable = value;\n }\n get scrollY() {\n return this.coreNode.scrollY;\n }\n set scrollY(value) {\n this.coreNode.scrollY = value;\n }\n get offsetY() {\n return this.coreNode.offsetY;\n }\n set offsetY(value) {\n this.coreNode.offsetY = value;\n }\n get letterSpacing() {\n return this.coreNode.letterSpacing;\n }\n set letterSpacing(value) {\n this.coreNode.letterSpacing = value;\n }\n get lineHeight() {\n return this.coreNode.lineHeight;\n }\n set lineHeight(value) {\n if (value) {\n this.coreNode.lineHeight = value;\n }\n }\n get maxLines() {\n return this.coreNode.maxLines;\n }\n set maxLines(value) {\n if (value) {\n this.coreNode.maxLines = value;\n }\n }\n get textBaseline() {\n return this.coreNode.textBaseline;\n }\n set textBaseline(value) {\n if (value) {\n this.coreNode.textBaseline = value;\n }\n }\n get verticalAlign() {\n return this.coreNode.verticalAlign;\n }\n set verticalAlign(value) {\n if (value) {\n this.coreNode.verticalAlign = value;\n }\n }\n get overflowSuffix() {\n return this.coreNode.overflowSuffix;\n }\n set overflowSuffix(value) {\n if (value) {\n this.coreNode.overflowSuffix = value;\n }\n }\n get debug() {\n return this.coreNode.debug;\n }\n set debug(value) {\n this.coreNode.debug = value;\n }\n}\n//# sourceMappingURL=MainOnlyTextNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { MainOnlyNode, getNewId } from './MainOnlyNode.js';\nimport { Stage, } from '../../core/Stage.js';\nimport { MainOnlyTextNode } from './MainOnlyTextNode.js';\nimport { loadCoreExtension } from '../utils.js';\nexport class MainCoreDriver {\n root = null;\n stage = null;\n rendererMain = null;\n async init(rendererMain, rendererSettings, canvas) {\n this.stage = new Stage({\n rootId: getNewId(),\n appWidth: rendererSettings.appWidth,\n appHeight: rendererSettings.appHeight,\n txMemByteThreshold: rendererSettings.txMemByteThreshold,\n boundsMargin: rendererSettings.boundsMargin,\n deviceLogicalPixelRatio: rendererSettings.deviceLogicalPixelRatio,\n devicePhysicalPixelRatio: rendererSettings.devicePhysicalPixelRatio,\n clearColor: rendererSettings.clearColor,\n canvas,\n fpsUpdateInterval: rendererSettings.fpsUpdateInterval,\n enableContextSpy: rendererSettings.enableContextSpy,\n numImageWorkers: rendererSettings.numImageWorkers,\n debug: {\n monitorTextureCache: false,\n },\n });\n this.rendererMain = rendererMain;\n assertTruthy(this.stage.root);\n const node = new MainOnlyNode(rendererMain.resolveNodeDefaults({}), this.rendererMain, this.stage, this.stage.root);\n this.root = node;\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n // Load the Core Extension Module if one was specified.\n if (rendererSettings.coreExtensionModule) {\n await loadCoreExtension(rendererSettings.coreExtensionModule, this.stage);\n }\n // Forward fpsUpdate events from the stage to RendererMain\n this.stage.on('fpsUpdate', ((stage, fpsData) => {\n this.onFpsUpdate(fpsData);\n }));\n this.stage.on('frameTick', ((stage, frameTickData) => {\n this.onFrameTick(frameTickData);\n }));\n this.stage.on('idle', () => {\n this.onIdle();\n });\n }\n createNode(props) {\n assertTruthy(this.rendererMain);\n assertTruthy(this.stage);\n const node = new MainOnlyNode(props, this.rendererMain, this.stage);\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n return node;\n }\n createTextNode(props) {\n assertTruthy(this.rendererMain);\n assertTruthy(this.stage);\n const node = new MainOnlyTextNode(props, this.rendererMain, this.stage);\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n return node;\n }\n // TODO: Remove?\n destroyNode(node) {\n node.destroy();\n }\n releaseTexture(id) {\n const { stage } = this;\n assertTruthy(stage);\n stage.txManager.removeTextureIdFromCache(id);\n }\n getRootNode() {\n assertTruthy(this.root);\n return this.root;\n }\n //#region Event Methods\n // The implementations for these event methods are provided by RendererMain\n onCreateNode(node) {\n throw new Error('Method not implemented.');\n }\n onBeforeDestroyNode(node) {\n throw new Error('Method not implemented.');\n }\n onFpsUpdate(fpsData) {\n throw new Error('Method not implemented.');\n }\n onFrameTick(frameTickData) {\n throw new Error('Method not implemented.');\n }\n onIdle() {\n throw new Error('Method not implemented.');\n }\n}\n//# sourceMappingURL=MainCoreDriver.js.map","let taskIdCounter = 1,\n isCallbackScheduled = false,\n isPerformingWork = false,\n taskQueue = [],\n currentTask = null,\n shouldYieldToHost = null,\n yieldInterval = 5,\n deadline = 0,\n maxYieldInterval = 300,\n scheduleCallback = null,\n scheduledCallback = null;\nconst maxSigned31BitInt = 1073741823;\nfunction setupScheduler() {\n const channel = new MessageChannel(),\n port = channel.port2;\n scheduleCallback = () => port.postMessage(null);\n channel.port1.onmessage = () => {\n if (scheduledCallback !== null) {\n const currentTime = performance.now();\n deadline = currentTime + yieldInterval;\n const hasTimeRemaining = true;\n try {\n const hasMoreWork = scheduledCallback(hasTimeRemaining, currentTime);\n if (!hasMoreWork) {\n scheduledCallback = null;\n } else port.postMessage(null);\n } catch (error) {\n port.postMessage(null);\n throw error;\n }\n }\n };\n if (navigator && navigator.scheduling && navigator.scheduling.isInputPending) {\n const scheduling = navigator.scheduling;\n shouldYieldToHost = () => {\n const currentTime = performance.now();\n if (currentTime >= deadline) {\n if (scheduling.isInputPending()) {\n return true;\n }\n return currentTime >= maxYieldInterval;\n } else {\n return false;\n }\n };\n } else {\n shouldYieldToHost = () => performance.now() >= deadline;\n }\n}\nfunction enqueue(taskQueue, task) {\n function findIndex() {\n let m = 0;\n let n = taskQueue.length - 1;\n while (m <= n) {\n const k = (n + m) >> 1;\n const cmp = task.expirationTime - taskQueue[k].expirationTime;\n if (cmp > 0) m = k + 1;\n else if (cmp < 0) n = k - 1;\n else return k;\n }\n return m;\n }\n taskQueue.splice(findIndex(), 0, task);\n}\nfunction requestCallback(fn, options) {\n if (!scheduleCallback) setupScheduler();\n let startTime = performance.now(),\n timeout = maxSigned31BitInt;\n if (options && options.timeout) timeout = options.timeout;\n const newTask = {\n id: taskIdCounter++,\n fn,\n startTime,\n expirationTime: startTime + timeout\n };\n enqueue(taskQueue, newTask);\n if (!isCallbackScheduled && !isPerformingWork) {\n isCallbackScheduled = true;\n scheduledCallback = flushWork;\n scheduleCallback();\n }\n return newTask;\n}\nfunction cancelCallback(task) {\n task.fn = null;\n}\nfunction flushWork(hasTimeRemaining, initialTime) {\n isCallbackScheduled = false;\n isPerformingWork = true;\n try {\n return workLoop(hasTimeRemaining, initialTime);\n } finally {\n currentTask = null;\n isPerformingWork = false;\n }\n}\nfunction workLoop(hasTimeRemaining, initialTime) {\n let currentTime = initialTime;\n currentTask = taskQueue[0] || null;\n while (currentTask !== null) {\n if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {\n break;\n }\n const callback = currentTask.fn;\n if (callback !== null) {\n currentTask.fn = null;\n const didUserCallbackTimeout = currentTask.expirationTime <= currentTime;\n callback(didUserCallbackTimeout);\n currentTime = performance.now();\n if (currentTask === taskQueue[0]) {\n taskQueue.shift();\n }\n } else taskQueue.shift();\n currentTask = taskQueue[0] || null;\n }\n return currentTask !== null;\n}\n\nconst sharedConfig = {\n context: undefined,\n registry: undefined\n};\nfunction setHydrateContext(context) {\n sharedConfig.context = context;\n}\nfunction nextHydrateContext() {\n return {\n ...sharedConfig.context,\n id: `${sharedConfig.context.id}${sharedConfig.context.count++}-`,\n count: 0\n };\n}\n\nconst equalFn = (a, b) => a === b;\nconst $PROXY = Symbol(\"solid-proxy\");\nconst $TRACK = Symbol(\"solid-track\");\nconst $DEVCOMP = Symbol(\"solid-dev-component\");\nconst signalOptions = {\n equals: equalFn\n};\nlet ERROR = null;\nlet runEffects = runQueue;\nconst STALE = 1;\nconst PENDING = 2;\nconst UNOWNED = {\n owned: null,\n cleanups: null,\n context: null,\n owner: null\n};\nconst NO_INIT = {};\nvar Owner = null;\nlet Transition = null;\nlet Scheduler = null;\nlet ExternalSourceConfig = null;\nlet Listener = null;\nlet Updates = null;\nlet Effects = null;\nlet ExecCount = 0;\nfunction createRoot(fn, detachedOwner) {\n const listener = Listener,\n owner = Owner,\n unowned = fn.length === 0,\n current = detachedOwner === undefined ? owner : detachedOwner,\n root = unowned\n ? UNOWNED\n : {\n owned: null,\n cleanups: null,\n context: current ? current.context : null,\n owner: current\n },\n updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root)));\n Owner = root;\n Listener = null;\n try {\n return runUpdates(updateFn, true);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n}\nfunction createSignal(value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const s = {\n value,\n observers: null,\n observerSlots: null,\n comparator: options.equals || undefined\n };\n const setter = value => {\n if (typeof value === \"function\") {\n if (Transition && Transition.running && Transition.sources.has(s)) value = value(s.tValue);\n else value = value(s.value);\n }\n return writeSignal(s, value);\n };\n return [readSignal.bind(s), setter];\n}\nfunction createComputed(fn, value, options) {\n const c = createComputation(fn, value, true, STALE);\n if (Scheduler && Transition && Transition.running) Updates.push(c);\n else updateComputation(c);\n}\nfunction createRenderEffect(fn, value, options) {\n const c = createComputation(fn, value, false, STALE);\n if (Scheduler && Transition && Transition.running) Updates.push(c);\n else updateComputation(c);\n}\nfunction createEffect(fn, value, options) {\n runEffects = runUserEffects;\n const c = createComputation(fn, value, false, STALE),\n s = SuspenseContext && useContext(SuspenseContext);\n if (s) c.suspense = s;\n if (!options || !options.render) c.user = true;\n Effects ? Effects.push(c) : updateComputation(c);\n}\nfunction createReaction(onInvalidate, options) {\n let fn;\n const c = createComputation(\n () => {\n fn ? fn() : untrack(onInvalidate);\n fn = undefined;\n },\n undefined,\n false,\n 0\n ),\n s = SuspenseContext && useContext(SuspenseContext);\n if (s) c.suspense = s;\n c.user = true;\n return tracking => {\n fn = tracking;\n updateComputation(c);\n };\n}\nfunction createMemo(fn, value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const c = createComputation(fn, value, true, 0);\n c.observers = null;\n c.observerSlots = null;\n c.comparator = options.equals || undefined;\n if (Scheduler && Transition && Transition.running) {\n c.tState = STALE;\n Updates.push(c);\n } else updateComputation(c);\n return readSignal.bind(c);\n}\nfunction isPromise(v) {\n return v && typeof v === \"object\" && \"then\" in v;\n}\nfunction createResource(pSource, pFetcher, pOptions) {\n let source;\n let fetcher;\n let options;\n if ((arguments.length === 2 && typeof pFetcher === \"object\") || arguments.length === 1) {\n source = true;\n fetcher = pSource;\n options = pFetcher || {};\n } else {\n source = pSource;\n fetcher = pFetcher;\n options = pOptions || {};\n }\n let pr = null,\n initP = NO_INIT,\n id = null,\n loadedUnderTransition = false,\n scheduled = false,\n resolved = \"initialValue\" in options,\n dynamic = typeof source === \"function\" && createMemo(source);\n const contexts = new Set(),\n [value, setValue] = (options.storage || createSignal)(options.initialValue),\n [error, setError] = createSignal(undefined),\n [track, trigger] = createSignal(undefined, {\n equals: false\n }),\n [state, setState] = createSignal(resolved ? \"ready\" : \"unresolved\");\n if (sharedConfig.context) {\n id = `${sharedConfig.context.id}${sharedConfig.context.count++}`;\n let v;\n if (options.ssrLoadFrom === \"initial\") initP = options.initialValue;\n else if (sharedConfig.load && (v = sharedConfig.load(id))) initP = v;\n }\n function loadEnd(p, v, error, key) {\n if (pr === p) {\n pr = null;\n key !== undefined && (resolved = true);\n if ((p === initP || v === initP) && options.onHydrated)\n queueMicrotask(() =>\n options.onHydrated(key, {\n value: v\n })\n );\n initP = NO_INIT;\n if (Transition && p && loadedUnderTransition) {\n Transition.promises.delete(p);\n loadedUnderTransition = false;\n runUpdates(() => {\n Transition.running = true;\n completeLoad(v, error);\n }, false);\n } else completeLoad(v, error);\n }\n return v;\n }\n function completeLoad(v, err) {\n runUpdates(() => {\n if (err === undefined) setValue(() => v);\n setState(err !== undefined ? \"errored\" : resolved ? \"ready\" : \"unresolved\");\n setError(err);\n for (const c of contexts.keys()) c.decrement();\n contexts.clear();\n }, false);\n }\n function read() {\n const c = SuspenseContext && useContext(SuspenseContext),\n v = value(),\n err = error();\n if (err !== undefined && !pr) throw err;\n if (Listener && !Listener.user && c) {\n createComputed(() => {\n track();\n if (pr) {\n if (c.resolved && Transition && loadedUnderTransition) Transition.promises.add(pr);\n else if (!contexts.has(c)) {\n c.increment();\n contexts.add(c);\n }\n }\n });\n }\n return v;\n }\n function load(refetching = true) {\n if (refetching !== false && scheduled) return;\n scheduled = false;\n const lookup = dynamic ? dynamic() : source;\n loadedUnderTransition = Transition && Transition.running;\n if (lookup == null || lookup === false) {\n loadEnd(pr, untrack(value));\n return;\n }\n if (Transition && pr) Transition.promises.delete(pr);\n const p =\n initP !== NO_INIT\n ? initP\n : untrack(() =>\n fetcher(lookup, {\n value: value(),\n refetching\n })\n );\n if (!isPromise(p)) {\n loadEnd(pr, p, undefined, lookup);\n return p;\n }\n pr = p;\n if (\"value\" in p) {\n if (p.status === \"success\") loadEnd(pr, p.value, undefined, lookup);\n else loadEnd(pr, undefined, undefined, lookup);\n return p;\n }\n scheduled = true;\n queueMicrotask(() => (scheduled = false));\n runUpdates(() => {\n setState(resolved ? \"refreshing\" : \"pending\");\n trigger();\n }, false);\n return p.then(\n v => loadEnd(p, v, undefined, lookup),\n e => loadEnd(p, undefined, castError(e), lookup)\n );\n }\n Object.defineProperties(read, {\n state: {\n get: () => state()\n },\n error: {\n get: () => error()\n },\n loading: {\n get() {\n const s = state();\n return s === \"pending\" || s === \"refreshing\";\n }\n },\n latest: {\n get() {\n if (!resolved) return read();\n const err = error();\n if (err && !pr) throw err;\n return value();\n }\n }\n });\n if (dynamic) createComputed(() => load(false));\n else load(false);\n return [\n read,\n {\n refetch: load,\n mutate: setValue\n }\n ];\n}\nfunction createDeferred(source, options) {\n let t,\n timeout = options ? options.timeoutMs : undefined;\n const node = createComputation(\n () => {\n if (!t || !t.fn)\n t = requestCallback(\n () => setDeferred(() => node.value),\n timeout !== undefined\n ? {\n timeout\n }\n : undefined\n );\n return source();\n },\n undefined,\n true\n );\n const [deferred, setDeferred] = createSignal(\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,\n options\n );\n updateComputation(node);\n setDeferred(() =>\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value\n );\n return deferred;\n}\nfunction createSelector(source, fn = equalFn, options) {\n const subs = new Map();\n const node = createComputation(\n p => {\n const v = source();\n for (const [key, val] of subs.entries())\n if (fn(key, v) !== fn(key, p)) {\n for (const c of val.values()) {\n c.state = STALE;\n if (c.pure) Updates.push(c);\n else Effects.push(c);\n }\n }\n return v;\n },\n undefined,\n true,\n STALE\n );\n updateComputation(node);\n return key => {\n const listener = Listener;\n if (listener) {\n let l;\n if ((l = subs.get(key))) l.add(listener);\n else subs.set(key, (l = new Set([listener])));\n onCleanup(() => {\n l.delete(listener);\n !l.size && subs.delete(key);\n });\n }\n return fn(\n key,\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value\n );\n };\n}\nfunction batch(fn) {\n return runUpdates(fn, false);\n}\nfunction untrack(fn) {\n if (!ExternalSourceConfig && Listener === null) return fn();\n const listener = Listener;\n Listener = null;\n try {\n if (ExternalSourceConfig) return ExternalSourceConfig.untrack(fn);\n return fn();\n } finally {\n Listener = listener;\n }\n}\nfunction on(deps, fn, options) {\n const isArray = Array.isArray(deps);\n let prevInput;\n let defer = options && options.defer;\n return prevValue => {\n let input;\n if (isArray) {\n input = Array(deps.length);\n for (let i = 0; i < deps.length; i++) input[i] = deps[i]();\n } else input = deps();\n if (defer) {\n defer = false;\n return prevValue;\n }\n const result = untrack(() => fn(input, prevInput, prevValue));\n prevInput = input;\n return result;\n };\n}\nfunction onMount(fn) {\n createEffect(() => untrack(fn));\n}\nfunction onCleanup(fn) {\n if (Owner === null);\n else if (Owner.cleanups === null) Owner.cleanups = [fn];\n else Owner.cleanups.push(fn);\n return fn;\n}\nfunction catchError(fn, handler) {\n ERROR || (ERROR = Symbol(\"error\"));\n Owner = createComputation(undefined, undefined, true);\n Owner.context = {\n ...Owner.context,\n [ERROR]: [handler]\n };\n if (Transition && Transition.running) Transition.sources.add(Owner);\n try {\n return fn();\n } catch (err) {\n handleError(err);\n } finally {\n Owner = Owner.owner;\n }\n}\nfunction getListener() {\n return Listener;\n}\nfunction getOwner() {\n return Owner;\n}\nfunction runWithOwner(o, fn) {\n const prev = Owner;\n const prevListener = Listener;\n Owner = o;\n Listener = null;\n try {\n return runUpdates(fn, true);\n } catch (err) {\n handleError(err);\n } finally {\n Owner = prev;\n Listener = prevListener;\n }\n}\nfunction enableScheduling(scheduler = requestCallback) {\n Scheduler = scheduler;\n}\nfunction startTransition(fn) {\n if (Transition && Transition.running) {\n fn();\n return Transition.done;\n }\n const l = Listener;\n const o = Owner;\n return Promise.resolve().then(() => {\n Listener = l;\n Owner = o;\n let t;\n if (Scheduler || SuspenseContext) {\n t =\n Transition ||\n (Transition = {\n sources: new Set(),\n effects: [],\n promises: new Set(),\n disposed: new Set(),\n queue: new Set(),\n running: true\n });\n t.done || (t.done = new Promise(res => (t.resolve = res)));\n t.running = true;\n }\n runUpdates(fn, false);\n Listener = Owner = null;\n return t ? t.done : undefined;\n });\n}\nconst [transPending, setTransPending] = /*@__PURE__*/ createSignal(false);\nfunction useTransition() {\n return [transPending, startTransition];\n}\nfunction resumeEffects(e) {\n Effects.push.apply(Effects, e);\n e.length = 0;\n}\nfunction createContext(defaultValue, options) {\n const id = Symbol(\"context\");\n return {\n id,\n Provider: createProvider(id),\n defaultValue\n };\n}\nfunction useContext(context) {\n return Owner && Owner.context && Owner.context[context.id] !== undefined\n ? Owner.context[context.id]\n : context.defaultValue;\n}\nfunction children(fn) {\n const children = createMemo(fn);\n const memo = createMemo(() => resolveChildren(children()));\n memo.toArray = () => {\n const c = memo();\n return Array.isArray(c) ? c : c != null ? [c] : [];\n };\n return memo;\n}\nlet SuspenseContext;\nfunction getSuspenseContext() {\n return SuspenseContext || (SuspenseContext = createContext());\n}\nfunction enableExternalSource(factory, untrack = fn => fn()) {\n if (ExternalSourceConfig) {\n const { factory: oldFactory, untrack: oldUntrack } = ExternalSourceConfig;\n ExternalSourceConfig = {\n factory: (fn, trigger) => {\n const oldSource = oldFactory(fn, trigger);\n const source = factory(x => oldSource.track(x), trigger);\n return {\n track: x => source.track(x),\n dispose() {\n source.dispose();\n oldSource.dispose();\n }\n };\n },\n untrack: fn => oldUntrack(() => untrack(fn))\n };\n } else {\n ExternalSourceConfig = {\n factory,\n untrack\n };\n }\n}\nfunction readSignal() {\n const runningTransition = Transition && Transition.running;\n if (this.sources && (runningTransition ? this.tState : this.state)) {\n if ((runningTransition ? this.tState : this.state) === STALE) updateComputation(this);\n else {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(this), false);\n Updates = updates;\n }\n }\n if (Listener) {\n const sSlot = this.observers ? this.observers.length : 0;\n if (!Listener.sources) {\n Listener.sources = [this];\n Listener.sourceSlots = [sSlot];\n } else {\n Listener.sources.push(this);\n Listener.sourceSlots.push(sSlot);\n }\n if (!this.observers) {\n this.observers = [Listener];\n this.observerSlots = [Listener.sources.length - 1];\n } else {\n this.observers.push(Listener);\n this.observerSlots.push(Listener.sources.length - 1);\n }\n }\n if (runningTransition && Transition.sources.has(this)) return this.tValue;\n return this.value;\n}\nfunction writeSignal(node, value, isComp) {\n let current =\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value;\n if (!node.comparator || !node.comparator(current, value)) {\n if (Transition) {\n const TransitionRunning = Transition.running;\n if (TransitionRunning || (!isComp && Transition.sources.has(node))) {\n Transition.sources.add(node);\n node.tValue = value;\n }\n if (!TransitionRunning) node.value = value;\n } else node.value = value;\n if (node.observers && node.observers.length) {\n runUpdates(() => {\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n const TransitionRunning = Transition && Transition.running;\n if (TransitionRunning && Transition.disposed.has(o)) continue;\n if (TransitionRunning ? !o.tState : !o.state) {\n if (o.pure) Updates.push(o);\n else Effects.push(o);\n if (o.observers) markDownstream(o);\n }\n if (!TransitionRunning) o.state = STALE;\n else o.tState = STALE;\n }\n if (Updates.length > 10e5) {\n Updates = [];\n if (false);\n throw new Error();\n }\n }, false);\n }\n }\n return value;\n}\nfunction updateComputation(node) {\n if (!node.fn) return;\n cleanNode(node);\n const time = ExecCount;\n runComputation(\n node,\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,\n time\n );\n if (Transition && !Transition.running && Transition.sources.has(node)) {\n queueMicrotask(() => {\n runUpdates(() => {\n Transition && (Transition.running = true);\n Listener = Owner = node;\n runComputation(node, node.tValue, time);\n Listener = Owner = null;\n }, false);\n });\n }\n}\nfunction runComputation(node, value, time) {\n let nextValue;\n const owner = Owner,\n listener = Listener;\n Listener = Owner = node;\n try {\n nextValue = node.fn(value);\n } catch (err) {\n if (node.pure) {\n if (Transition && Transition.running) {\n node.tState = STALE;\n node.tOwned && node.tOwned.forEach(cleanNode);\n node.tOwned = undefined;\n } else {\n node.state = STALE;\n node.owned && node.owned.forEach(cleanNode);\n node.owned = null;\n }\n }\n node.updatedAt = time + 1;\n return handleError(err);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n if (!node.updatedAt || node.updatedAt <= time) {\n if (node.updatedAt != null && \"observers\" in node) {\n writeSignal(node, nextValue, true);\n } else if (Transition && Transition.running && node.pure) {\n Transition.sources.add(node);\n node.tValue = nextValue;\n } else node.value = nextValue;\n node.updatedAt = time;\n }\n}\nfunction createComputation(fn, init, pure, state = STALE, options) {\n const c = {\n fn,\n state: state,\n updatedAt: null,\n owned: null,\n sources: null,\n sourceSlots: null,\n cleanups: null,\n value: init,\n owner: Owner,\n context: Owner ? Owner.context : null,\n pure\n };\n if (Transition && Transition.running) {\n c.state = 0;\n c.tState = state;\n }\n if (Owner === null);\n else if (Owner !== UNOWNED) {\n if (Transition && Transition.running && Owner.pure) {\n if (!Owner.tOwned) Owner.tOwned = [c];\n else Owner.tOwned.push(c);\n } else {\n if (!Owner.owned) Owner.owned = [c];\n else Owner.owned.push(c);\n }\n }\n if (ExternalSourceConfig && c.fn) {\n const [track, trigger] = createSignal(undefined, {\n equals: false\n });\n const ordinary = ExternalSourceConfig.factory(c.fn, trigger);\n onCleanup(() => ordinary.dispose());\n const triggerInTransition = () => startTransition(trigger).then(() => inTransition.dispose());\n const inTransition = ExternalSourceConfig.factory(c.fn, triggerInTransition);\n c.fn = x => {\n track();\n return Transition && Transition.running ? inTransition.track(x) : ordinary.track(x);\n };\n }\n return c;\n}\nfunction runTop(node) {\n const runningTransition = Transition && Transition.running;\n if ((runningTransition ? node.tState : node.state) === 0) return;\n if ((runningTransition ? node.tState : node.state) === PENDING) return lookUpstream(node);\n if (node.suspense && untrack(node.suspense.inFallback)) return node.suspense.effects.push(node);\n const ancestors = [node];\n while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {\n if (runningTransition && Transition.disposed.has(node)) return;\n if (runningTransition ? node.tState : node.state) ancestors.push(node);\n }\n for (let i = ancestors.length - 1; i >= 0; i--) {\n node = ancestors[i];\n if (runningTransition) {\n let top = node,\n prev = ancestors[i + 1];\n while ((top = top.owner) && top !== prev) {\n if (Transition.disposed.has(top)) return;\n }\n }\n if ((runningTransition ? node.tState : node.state) === STALE) {\n updateComputation(node);\n } else if ((runningTransition ? node.tState : node.state) === PENDING) {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(node, ancestors[0]), false);\n Updates = updates;\n }\n }\n}\nfunction runUpdates(fn, init) {\n if (Updates) return fn();\n let wait = false;\n if (!init) Updates = [];\n if (Effects) wait = true;\n else Effects = [];\n ExecCount++;\n try {\n const res = fn();\n completeUpdates(wait);\n return res;\n } catch (err) {\n if (!wait) Effects = null;\n Updates = null;\n handleError(err);\n }\n}\nfunction completeUpdates(wait) {\n if (Updates) {\n if (Scheduler && Transition && Transition.running) scheduleQueue(Updates);\n else runQueue(Updates);\n Updates = null;\n }\n if (wait) return;\n let res;\n if (Transition) {\n if (!Transition.promises.size && !Transition.queue.size) {\n const sources = Transition.sources;\n const disposed = Transition.disposed;\n Effects.push.apply(Effects, Transition.effects);\n res = Transition.resolve;\n for (const e of Effects) {\n \"tState\" in e && (e.state = e.tState);\n delete e.tState;\n }\n Transition = null;\n runUpdates(() => {\n for (const d of disposed) cleanNode(d);\n for (const v of sources) {\n v.value = v.tValue;\n if (v.owned) {\n for (let i = 0, len = v.owned.length; i < len; i++) cleanNode(v.owned[i]);\n }\n if (v.tOwned) v.owned = v.tOwned;\n delete v.tValue;\n delete v.tOwned;\n v.tState = 0;\n }\n setTransPending(false);\n }, false);\n } else if (Transition.running) {\n Transition.running = false;\n Transition.effects.push.apply(Transition.effects, Effects);\n Effects = null;\n setTransPending(true);\n return;\n }\n }\n const e = Effects;\n Effects = null;\n if (e.length) runUpdates(() => runEffects(e), false);\n if (res) res();\n}\nfunction runQueue(queue) {\n for (let i = 0; i < queue.length; i++) runTop(queue[i]);\n}\nfunction scheduleQueue(queue) {\n for (let i = 0; i < queue.length; i++) {\n const item = queue[i];\n const tasks = Transition.queue;\n if (!tasks.has(item)) {\n tasks.add(item);\n Scheduler(() => {\n tasks.delete(item);\n runUpdates(() => {\n Transition.running = true;\n runTop(item);\n }, false);\n Transition && (Transition.running = false);\n });\n }\n }\n}\nfunction runUserEffects(queue) {\n let i,\n userLength = 0;\n for (i = 0; i < queue.length; i++) {\n const e = queue[i];\n if (!e.user) runTop(e);\n else queue[userLength++] = e;\n }\n if (sharedConfig.context) {\n if (sharedConfig.count) {\n sharedConfig.effects || (sharedConfig.effects = []);\n sharedConfig.effects.push(...queue.slice(0, userLength));\n return;\n } else if (sharedConfig.effects) {\n queue = [...sharedConfig.effects, ...queue];\n userLength += sharedConfig.effects.length;\n delete sharedConfig.effects;\n }\n setHydrateContext();\n }\n for (i = 0; i < userLength; i++) runTop(queue[i]);\n}\nfunction lookUpstream(node, ignore) {\n const runningTransition = Transition && Transition.running;\n if (runningTransition) node.tState = 0;\n else node.state = 0;\n for (let i = 0; i < node.sources.length; i += 1) {\n const source = node.sources[i];\n if (source.sources) {\n const state = runningTransition ? source.tState : source.state;\n if (state === STALE) {\n if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))\n runTop(source);\n } else if (state === PENDING) lookUpstream(source, ignore);\n }\n }\n}\nfunction markDownstream(node) {\n const runningTransition = Transition && Transition.running;\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n if (runningTransition ? !o.tState : !o.state) {\n if (runningTransition) o.tState = PENDING;\n else o.state = PENDING;\n if (o.pure) Updates.push(o);\n else Effects.push(o);\n o.observers && markDownstream(o);\n }\n }\n}\nfunction cleanNode(node) {\n let i;\n if (node.sources) {\n while (node.sources.length) {\n const source = node.sources.pop(),\n index = node.sourceSlots.pop(),\n obs = source.observers;\n if (obs && obs.length) {\n const n = obs.pop(),\n s = source.observerSlots.pop();\n if (index < obs.length) {\n n.sourceSlots[s] = index;\n obs[index] = n;\n source.observerSlots[index] = s;\n }\n }\n }\n }\n if (Transition && Transition.running && node.pure) {\n if (node.tOwned) {\n for (i = node.tOwned.length - 1; i >= 0; i--) cleanNode(node.tOwned[i]);\n delete node.tOwned;\n }\n reset(node, true);\n } else if (node.owned) {\n for (i = node.owned.length - 1; i >= 0; i--) cleanNode(node.owned[i]);\n node.owned = null;\n }\n if (node.cleanups) {\n for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i]();\n node.cleanups = null;\n }\n if (Transition && Transition.running) node.tState = 0;\n else node.state = 0;\n}\nfunction reset(node, top) {\n if (!top) {\n node.tState = 0;\n Transition.disposed.add(node);\n }\n if (node.owned) {\n for (let i = 0; i < node.owned.length; i++) reset(node.owned[i]);\n }\n}\nfunction castError(err) {\n if (err instanceof Error) return err;\n return new Error(typeof err === \"string\" ? err : \"Unknown error\", {\n cause: err\n });\n}\nfunction runErrors(err, fns, owner) {\n try {\n for (const f of fns) f(err);\n } catch (e) {\n handleError(e, (owner && owner.owner) || null);\n }\n}\nfunction handleError(err, owner = Owner) {\n const fns = ERROR && owner && owner.context && owner.context[ERROR];\n const error = castError(err);\n if (!fns) throw error;\n if (Effects)\n Effects.push({\n fn() {\n runErrors(error, fns, owner);\n },\n state: STALE\n });\n else runErrors(error, fns, owner);\n}\nfunction resolveChildren(children) {\n if (typeof children === \"function\" && !children.length) return resolveChildren(children());\n if (Array.isArray(children)) {\n const results = [];\n for (let i = 0; i < children.length; i++) {\n const result = resolveChildren(children[i]);\n Array.isArray(result) ? results.push.apply(results, result) : results.push(result);\n }\n return results;\n }\n return children;\n}\nfunction createProvider(id, options) {\n return function provider(props) {\n let res;\n createRenderEffect(\n () =>\n (res = untrack(() => {\n Owner.context = {\n ...Owner.context,\n [id]: props.value\n };\n return children(() => props.children);\n })),\n undefined\n );\n return res;\n };\n}\nfunction onError(fn) {\n ERROR || (ERROR = Symbol(\"error\"));\n if (Owner === null);\n else if (Owner.context === null || !Owner.context[ERROR]) {\n Owner.context = {\n ...Owner.context,\n [ERROR]: [fn]\n };\n mutateContext(Owner, ERROR, [fn]);\n } else Owner.context[ERROR].push(fn);\n}\nfunction mutateContext(o, key, value) {\n if (o.owned) {\n for (let i = 0; i < o.owned.length; i++) {\n if (o.owned[i].context === o.context) mutateContext(o.owned[i], key, value);\n if (!o.owned[i].context) {\n o.owned[i].context = o.context;\n mutateContext(o.owned[i], key, value);\n } else if (!o.owned[i].context[key]) {\n o.owned[i].context[key] = value;\n mutateContext(o.owned[i], key, value);\n }\n }\n }\n}\n\nfunction observable(input) {\n return {\n subscribe(observer) {\n if (!(observer instanceof Object) || observer == null) {\n throw new TypeError(\"Expected the observer to be an object.\");\n }\n const handler =\n typeof observer === \"function\" ? observer : observer.next && observer.next.bind(observer);\n if (!handler) {\n return {\n unsubscribe() {}\n };\n }\n const dispose = createRoot(disposer => {\n createEffect(() => {\n const v = input();\n untrack(() => handler(v));\n });\n return disposer;\n });\n if (getOwner()) onCleanup(dispose);\n return {\n unsubscribe() {\n dispose();\n }\n };\n },\n [Symbol.observable || \"@@observable\"]() {\n return this;\n }\n };\n}\nfunction from(producer) {\n const [s, set] = createSignal(undefined, {\n equals: false\n });\n if (\"subscribe\" in producer) {\n const unsub = producer.subscribe(v => set(() => v));\n onCleanup(() => (\"unsubscribe\" in unsub ? unsub.unsubscribe() : unsub()));\n } else {\n const clean = producer(set);\n onCleanup(clean);\n }\n return s;\n}\n\nconst FALLBACK = Symbol(\"fallback\");\nfunction dispose(d) {\n for (let i = 0; i < d.length; i++) d[i]();\n}\nfunction mapArray(list, mapFn, options = {}) {\n let items = [],\n mapped = [],\n disposers = [],\n len = 0,\n indexes = mapFn.length > 1 ? [] : null;\n onCleanup(() => dispose(disposers));\n return () => {\n let newItems = list() || [],\n i,\n j;\n newItems[$TRACK];\n return untrack(() => {\n let newLen = newItems.length,\n newIndices,\n newIndicesNext,\n temp,\n tempdisposers,\n tempIndexes,\n start,\n end,\n newEnd,\n item;\n if (newLen === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n indexes && (indexes = []);\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot(disposer => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n } else if (len === 0) {\n mapped = new Array(newLen);\n for (j = 0; j < newLen; j++) {\n items[j] = newItems[j];\n mapped[j] = createRoot(mapper);\n }\n len = newLen;\n } else {\n temp = new Array(newLen);\n tempdisposers = new Array(newLen);\n indexes && (tempIndexes = new Array(newLen));\n for (\n start = 0, end = Math.min(len, newLen);\n start < end && items[start] === newItems[start];\n start++\n );\n for (\n end = len - 1, newEnd = newLen - 1;\n end >= start && newEnd >= start && items[end] === newItems[newEnd];\n end--, newEnd--\n ) {\n temp[newEnd] = mapped[end];\n tempdisposers[newEnd] = disposers[end];\n indexes && (tempIndexes[newEnd] = indexes[end]);\n }\n newIndices = new Map();\n newIndicesNext = new Array(newEnd + 1);\n for (j = newEnd; j >= start; j--) {\n item = newItems[j];\n i = newIndices.get(item);\n newIndicesNext[j] = i === undefined ? -1 : i;\n newIndices.set(item, j);\n }\n for (i = start; i <= end; i++) {\n item = items[i];\n j = newIndices.get(item);\n if (j !== undefined && j !== -1) {\n temp[j] = mapped[i];\n tempdisposers[j] = disposers[i];\n indexes && (tempIndexes[j] = indexes[i]);\n j = newIndicesNext[j];\n newIndices.set(item, j);\n } else disposers[i]();\n }\n for (j = start; j < newLen; j++) {\n if (j in temp) {\n mapped[j] = temp[j];\n disposers[j] = tempdisposers[j];\n if (indexes) {\n indexes[j] = tempIndexes[j];\n indexes[j](j);\n }\n } else mapped[j] = createRoot(mapper);\n }\n mapped = mapped.slice(0, (len = newLen));\n items = newItems.slice(0);\n }\n return mapped;\n });\n function mapper(disposer) {\n disposers[j] = disposer;\n if (indexes) {\n const [s, set] = createSignal(j);\n indexes[j] = set;\n return mapFn(newItems[j], s);\n }\n return mapFn(newItems[j]);\n }\n };\n}\nfunction indexArray(list, mapFn, options = {}) {\n let items = [],\n mapped = [],\n disposers = [],\n signals = [],\n len = 0,\n i;\n onCleanup(() => dispose(disposers));\n return () => {\n const newItems = list() || [];\n newItems[$TRACK];\n return untrack(() => {\n if (newItems.length === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n signals = [];\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot(disposer => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n return mapped;\n }\n if (items[0] === FALLBACK) {\n disposers[0]();\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n }\n for (i = 0; i < newItems.length; i++) {\n if (i < items.length && items[i] !== newItems[i]) {\n signals[i](() => newItems[i]);\n } else if (i >= items.length) {\n mapped[i] = createRoot(mapper);\n }\n }\n for (; i < items.length; i++) {\n disposers[i]();\n }\n len = signals.length = disposers.length = newItems.length;\n items = newItems.slice(0);\n return (mapped = mapped.slice(0, len));\n });\n function mapper(disposer) {\n disposers[i] = disposer;\n const [s, set] = createSignal(newItems[i]);\n signals[i] = set;\n return mapFn(s, i);\n }\n };\n}\n\nlet hydrationEnabled = false;\nfunction enableHydration() {\n hydrationEnabled = true;\n}\nfunction createComponent(Comp, props) {\n if (hydrationEnabled) {\n if (sharedConfig.context) {\n const c = sharedConfig.context;\n setHydrateContext(nextHydrateContext());\n const r = untrack(() => Comp(props || {}));\n setHydrateContext(c);\n return r;\n }\n }\n return untrack(() => Comp(props || {}));\n}\nfunction trueFn() {\n return true;\n}\nconst propTraps = {\n get(_, property, receiver) {\n if (property === $PROXY) return receiver;\n return _.get(property);\n },\n has(_, property) {\n if (property === $PROXY) return true;\n return _.has(property);\n },\n set: trueFn,\n deleteProperty: trueFn,\n getOwnPropertyDescriptor(_, property) {\n return {\n configurable: true,\n enumerable: true,\n get() {\n return _.get(property);\n },\n set: trueFn,\n deleteProperty: trueFn\n };\n },\n ownKeys(_) {\n return _.keys();\n }\n};\nfunction resolveSource(s) {\n return !(s = typeof s === \"function\" ? s() : s) ? {} : s;\n}\nfunction resolveSources() {\n for (let i = 0, length = this.length; i < length; ++i) {\n const v = this[i]();\n if (v !== undefined) return v;\n }\n}\nfunction mergeProps(...sources) {\n let proxy = false;\n for (let i = 0; i < sources.length; i++) {\n const s = sources[i];\n proxy = proxy || (!!s && $PROXY in s);\n sources[i] = typeof s === \"function\" ? ((proxy = true), createMemo(s)) : s;\n }\n if (proxy) {\n return new Proxy(\n {\n get(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n const v = resolveSource(sources[i])[property];\n if (v !== undefined) return v;\n }\n },\n has(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n if (property in resolveSource(sources[i])) return true;\n }\n return false;\n },\n keys() {\n const keys = [];\n for (let i = 0; i < sources.length; i++)\n keys.push(...Object.keys(resolveSource(sources[i])));\n return [...new Set(keys)];\n }\n },\n propTraps\n );\n }\n const sourcesMap = {};\n const defined = Object.create(null);\n for (let i = sources.length - 1; i >= 0; i--) {\n const source = sources[i];\n if (!source) continue;\n const sourceKeys = Object.getOwnPropertyNames(source);\n for (let i = sourceKeys.length - 1; i >= 0; i--) {\n const key = sourceKeys[i];\n if (key === \"__proto__\" || key === \"constructor\") continue;\n const desc = Object.getOwnPropertyDescriptor(source, key);\n if (!defined[key]) {\n defined[key] = desc.get\n ? {\n enumerable: true,\n configurable: true,\n get: resolveSources.bind((sourcesMap[key] = [desc.get.bind(source)]))\n }\n : desc.value !== undefined\n ? desc\n : undefined;\n } else {\n const sources = sourcesMap[key];\n if (sources) {\n if (desc.get) sources.push(desc.get.bind(source));\n else if (desc.value !== undefined) sources.push(() => desc.value);\n }\n }\n }\n }\n const target = {};\n const definedKeys = Object.keys(defined);\n for (let i = definedKeys.length - 1; i >= 0; i--) {\n const key = definedKeys[i],\n desc = defined[key];\n if (desc && desc.get) Object.defineProperty(target, key, desc);\n else target[key] = desc ? desc.value : undefined;\n }\n return target;\n}\nfunction splitProps(props, ...keys) {\n if ($PROXY in props) {\n const blocked = new Set(keys.length > 1 ? keys.flat() : keys[0]);\n const res = keys.map(k => {\n return new Proxy(\n {\n get(property) {\n return k.includes(property) ? props[property] : undefined;\n },\n has(property) {\n return k.includes(property) && property in props;\n },\n keys() {\n return k.filter(property => property in props);\n }\n },\n propTraps\n );\n });\n res.push(\n new Proxy(\n {\n get(property) {\n return blocked.has(property) ? undefined : props[property];\n },\n has(property) {\n return blocked.has(property) ? false : property in props;\n },\n keys() {\n return Object.keys(props).filter(k => !blocked.has(k));\n }\n },\n propTraps\n )\n );\n return res;\n }\n const otherObject = {};\n const objects = keys.map(() => ({}));\n for (const propName of Object.getOwnPropertyNames(props)) {\n const desc = Object.getOwnPropertyDescriptor(props, propName);\n const isDefaultDesc =\n !desc.get && !desc.set && desc.enumerable && desc.writable && desc.configurable;\n let blocked = false;\n let objectIndex = 0;\n for (const k of keys) {\n if (k.includes(propName)) {\n blocked = true;\n isDefaultDesc\n ? (objects[objectIndex][propName] = desc.value)\n : Object.defineProperty(objects[objectIndex], propName, desc);\n }\n ++objectIndex;\n }\n if (!blocked) {\n isDefaultDesc\n ? (otherObject[propName] = desc.value)\n : Object.defineProperty(otherObject, propName, desc);\n }\n }\n return [...objects, otherObject];\n}\nfunction lazy(fn) {\n let comp;\n let p;\n const wrap = props => {\n const ctx = sharedConfig.context;\n if (ctx) {\n const [s, set] = createSignal();\n sharedConfig.count || (sharedConfig.count = 0);\n sharedConfig.count++;\n (p || (p = fn())).then(mod => {\n setHydrateContext(ctx);\n sharedConfig.count--;\n set(() => mod.default);\n setHydrateContext();\n });\n comp = s;\n } else if (!comp) {\n const [s] = createResource(() => (p || (p = fn())).then(mod => mod.default));\n comp = s;\n }\n let Comp;\n return createMemo(\n () =>\n (Comp = comp()) &&\n untrack(() => {\n if (false);\n if (!ctx) return Comp(props);\n const c = sharedConfig.context;\n setHydrateContext(ctx);\n const r = Comp(props);\n setHydrateContext(c);\n return r;\n })\n );\n };\n wrap.preload = () => p || ((p = fn()).then(mod => (comp = () => mod.default)), p);\n return wrap;\n}\nlet counter = 0;\nfunction createUniqueId() {\n const ctx = sharedConfig.context;\n return ctx ? `${ctx.id}${ctx.count++}` : `cl-${counter++}`;\n}\n\nconst narrowedError = name => `Stale read from <${name}>.`;\nfunction For(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(mapArray(() => props.each, props.children, fallback || undefined));\n}\nfunction Index(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(indexArray(() => props.each, props.children, fallback || undefined));\n}\nfunction Show(props) {\n const keyed = props.keyed;\n const condition = createMemo(() => props.when, undefined, {\n equals: (a, b) => (keyed ? a === b : !a === !b)\n });\n return createMemo(\n () => {\n const c = condition();\n if (c) {\n const child = props.children;\n const fn = typeof child === \"function\" && child.length > 0;\n return fn\n ? untrack(() =>\n child(\n keyed\n ? c\n : () => {\n if (!untrack(condition)) throw narrowedError(\"Show\");\n return props.when;\n }\n )\n )\n : child;\n }\n return props.fallback;\n },\n undefined,\n undefined\n );\n}\nfunction Switch(props) {\n let keyed = false;\n const equals = (a, b) => (keyed ? a[1] === b[1] : !a[1] === !b[1]) && a[2] === b[2];\n const conditions = children(() => props.children),\n evalConditions = createMemo(\n () => {\n let conds = conditions();\n if (!Array.isArray(conds)) conds = [conds];\n for (let i = 0; i < conds.length; i++) {\n const c = conds[i].when;\n if (c) {\n keyed = !!conds[i].keyed;\n return [i, c, conds[i]];\n }\n }\n return [-1];\n },\n undefined,\n {\n equals\n }\n );\n return createMemo(\n () => {\n const [index, when, cond] = evalConditions();\n if (index < 0) return props.fallback;\n const c = cond.children;\n const fn = typeof c === \"function\" && c.length > 0;\n return fn\n ? untrack(() =>\n c(\n keyed\n ? when\n : () => {\n if (untrack(evalConditions)[0] !== index) throw narrowedError(\"Match\");\n return cond.when;\n }\n )\n )\n : c;\n },\n undefined,\n undefined\n );\n}\nfunction Match(props) {\n return props;\n}\nlet Errors;\nfunction resetErrorBoundaries() {\n Errors && [...Errors].forEach(fn => fn());\n}\nfunction ErrorBoundary(props) {\n let err;\n if (sharedConfig.context && sharedConfig.load)\n err = sharedConfig.load(sharedConfig.context.id + sharedConfig.context.count);\n const [errored, setErrored] = createSignal(err, undefined);\n Errors || (Errors = new Set());\n Errors.add(setErrored);\n onCleanup(() => Errors.delete(setErrored));\n return createMemo(\n () => {\n let e;\n if ((e = errored())) {\n const f = props.fallback;\n return typeof f === \"function\" && f.length ? untrack(() => f(e, () => setErrored())) : f;\n }\n return catchError(() => props.children, setErrored);\n },\n undefined,\n undefined\n );\n}\n\nconst suspenseListEquals = (a, b) =>\n a.showContent === b.showContent && a.showFallback === b.showFallback;\nconst SuspenseListContext = createContext();\nfunction SuspenseList(props) {\n let [wrapper, setWrapper] = createSignal(() => ({\n inFallback: false\n })),\n show;\n const listContext = useContext(SuspenseListContext);\n const [registry, setRegistry] = createSignal([]);\n if (listContext) {\n show = listContext.register(createMemo(() => wrapper()().inFallback));\n }\n const resolved = createMemo(\n prev => {\n const reveal = props.revealOrder,\n tail = props.tail,\n { showContent = true, showFallback = true } = show ? show() : {},\n reg = registry(),\n reverse = reveal === \"backwards\";\n if (reveal === \"together\") {\n const all = reg.every(inFallback => !inFallback());\n const res = reg.map(() => ({\n showContent: all && showContent,\n showFallback\n }));\n res.inFallback = !all;\n return res;\n }\n let stop = false;\n let inFallback = prev.inFallback;\n const res = [];\n for (let i = 0, len = reg.length; i < len; i++) {\n const n = reverse ? len - i - 1 : i,\n s = reg[n]();\n if (!stop && !s) {\n res[n] = {\n showContent,\n showFallback\n };\n } else {\n const next = !stop;\n if (next) inFallback = true;\n res[n] = {\n showContent: next,\n showFallback: !tail || (next && tail === \"collapsed\") ? showFallback : false\n };\n stop = true;\n }\n }\n if (!stop) inFallback = false;\n res.inFallback = inFallback;\n return res;\n },\n {\n inFallback: false\n }\n );\n setWrapper(() => resolved);\n return createComponent(SuspenseListContext.Provider, {\n value: {\n register: inFallback => {\n let index;\n setRegistry(registry => {\n index = registry.length;\n return [...registry, inFallback];\n });\n return createMemo(() => resolved()[index], undefined, {\n equals: suspenseListEquals\n });\n }\n },\n get children() {\n return props.children;\n }\n });\n}\nfunction Suspense(props) {\n let counter = 0,\n show,\n ctx,\n p,\n flicker,\n error;\n const [inFallback, setFallback] = createSignal(false),\n SuspenseContext = getSuspenseContext(),\n store = {\n increment: () => {\n if (++counter === 1) setFallback(true);\n },\n decrement: () => {\n if (--counter === 0) setFallback(false);\n },\n inFallback,\n effects: [],\n resolved: false\n },\n owner = getOwner();\n if (sharedConfig.context && sharedConfig.load) {\n const key = sharedConfig.context.id + sharedConfig.context.count;\n let ref = sharedConfig.load(key);\n if (ref) {\n if (typeof ref !== \"object\" || ref.status !== \"success\") p = ref;\n else sharedConfig.gather(key);\n }\n if (p && p !== \"$$f\") {\n const [s, set] = createSignal(undefined, {\n equals: false\n });\n flicker = s;\n p.then(\n () => {\n if (sharedConfig.done) return set();\n sharedConfig.gather(key);\n setHydrateContext(ctx);\n set();\n setHydrateContext();\n },\n err => {\n error = err;\n set();\n }\n );\n }\n }\n const listContext = useContext(SuspenseListContext);\n if (listContext) show = listContext.register(store.inFallback);\n let dispose;\n onCleanup(() => dispose && dispose());\n return createComponent(SuspenseContext.Provider, {\n value: store,\n get children() {\n return createMemo(() => {\n if (error) throw error;\n ctx = sharedConfig.context;\n if (flicker) {\n flicker();\n return (flicker = undefined);\n }\n if (ctx && p === \"$$f\") setHydrateContext();\n const rendered = createMemo(() => props.children);\n return createMemo(prev => {\n const inFallback = store.inFallback(),\n { showContent = true, showFallback = true } = show ? show() : {};\n if ((!inFallback || (p && p !== \"$$f\")) && showContent) {\n store.resolved = true;\n dispose && dispose();\n dispose = ctx = p = undefined;\n resumeEffects(store.effects);\n return rendered();\n }\n if (!showFallback) return;\n if (dispose) return prev;\n return createRoot(disposer => {\n dispose = disposer;\n if (ctx) {\n setHydrateContext({\n id: ctx.id + \"f\",\n count: 0\n });\n ctx = undefined;\n }\n return props.fallback;\n }, owner);\n });\n });\n }\n });\n}\n\nconst DEV = undefined;\n\nexport {\n $DEVCOMP,\n $PROXY,\n $TRACK,\n DEV,\n ErrorBoundary,\n For,\n Index,\n Match,\n Show,\n Suspense,\n SuspenseList,\n Switch,\n batch,\n cancelCallback,\n catchError,\n children,\n createComponent,\n createComputed,\n createContext,\n createDeferred,\n createEffect,\n createMemo,\n createReaction,\n createRenderEffect,\n createResource,\n createRoot,\n createSelector,\n createSignal,\n createUniqueId,\n enableExternalSource,\n enableHydration,\n enableScheduling,\n equalFn,\n from,\n getListener,\n getOwner,\n indexArray,\n lazy,\n mapArray,\n mergeProps,\n observable,\n on,\n onCleanup,\n onError,\n onMount,\n requestCallback,\n resetErrorBoundaries,\n runWithOwner,\n sharedConfig,\n splitProps,\n startTransition,\n untrack,\n useContext,\n useTransition\n};\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n MainCoreDriver,\n RendererMain,\n type RendererMainSettings,\n} from '@lightningjs/renderer';\n\nexport let renderer: RendererMain;\nexport let createShader: RendererMain['createShader'];\n\nexport interface SolidRendererOptions extends RendererMainSettings {\n threadXCoreWorkerUrl?: string;\n rootId: string | HTMLElement;\n}\n\nexport function getRenderer(): RendererMain {\n return renderer;\n}\n\nexport function startLightningRenderer(\n options: Partial = {},\n rootId: string | HTMLElement = 'app',\n): RendererMain {\n const driver = new MainCoreDriver();\n renderer = new RendererMain(options, rootId, driver);\n createShader = renderer.createShader.bind(renderer);\n return renderer;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { ElementNode, SolidNode } from './index.js';\n\n/**\n * Children class\n */\nexport default class Children extends Array {\n _parent: ElementNode;\n\n constructor(node: ElementNode) {\n super();\n this._parent = node;\n }\n\n get selected(): ElementNode | undefined {\n // For selected Elements should always be an ElementNode\n return this[this._parent.selected || 0] as ElementNode | undefined;\n }\n\n get firstChild() {\n return this[0];\n }\n\n insert(node: SolidNode, beforeNode: SolidNode) {\n if (beforeNode) {\n const index = this.indexOf(beforeNode);\n this.splice(index, 0, node);\n } else {\n this.push(node);\n }\n\n node.parent = this._parent;\n this._parent._isDirty = true;\n }\n\n remove(node: SolidNode) {\n const nodeIndexToRemove = this.indexOf(node);\n if (nodeIndexToRemove >= 0) {\n this.splice(nodeIndexToRemove, 1);\n }\n }\n}\n","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n AnimationSettings,\n RendererMainSettings,\n} from '@lightningjs/renderer';\nimport type { IntrinsicTextNodeStyleProps } from './intrinsicTypes.js';\n\ninterface Config {\n debug: boolean;\n animationSettings: Partial;\n animationsEnabled: boolean;\n fontSettings: Partial;\n rendererOptions?: Partial;\n}\n\nfunction isDevEnv(): boolean {\n return import.meta.env && import.meta.env.DEV;\n}\nexport const isDev = isDevEnv() || false;\n\nexport const config: Config = {\n debug: false,\n animationsEnabled: true,\n animationSettings: {\n duration: 250,\n easing: 'ease-in-out',\n },\n fontSettings: {\n fontFamily: 'Ubuntu',\n fontSize: 100,\n },\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { config, isDev } from '../config.js';\nimport type { SolidNode, SolidStyles } from './node/index.js';\n\nfunction hasDebug(node: any) {\n return isObject(node) && node.debug;\n}\n\nexport function log(msg: string, node: SolidNode, ...args: any[]) {\n if (isDev) {\n if (config.debug || hasDebug(node) || hasDebug(args[0])) {\n console.log(msg, node, ...args);\n }\n }\n}\n\nexport function isFunc(item: unknown): item is (...args: unknown[]) => unknown {\n return typeof item === 'function';\n}\n\nexport function isObject(\n item: unknown,\n): item is Record {\n return typeof item === 'object';\n}\n\nexport function isArray(item: unknown): item is any[] {\n return Array.isArray(item);\n}\n\nexport function isString(item: unknown): item is string {\n return typeof item === 'string';\n}\n\nexport function isNumber(item: unknown): item is number {\n return typeof item === 'number';\n}\n\nexport function isInteger(item: unknown): item is number {\n return Number.isInteger(item);\n}\n\nexport function keyExists(\n obj: Record,\n keys: (string | number | symbol)[],\n) {\n for (const key of keys) {\n if (key in obj) {\n return true;\n }\n }\n return false;\n}\n\nexport function flattenStyles(\n obj: SolidStyles | undefined | (SolidStyles | undefined)[],\n result: Record = {},\n): SolidStyles {\n if (isArray(obj)) {\n obj.forEach((item) => {\n flattenStyles(item, result);\n });\n } else if (obj) {\n // handle the case where the object is not an array\n for (const key in obj) {\n // be careful of 0 values\n if (result[key as keyof SolidStyles] === undefined) {\n result[key as keyof SolidStyles] = obj[key as keyof SolidStyles];\n }\n }\n }\n\n return result;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { isArray, isString } from '../utils.js';\n\nexport type NodeStates =\n | string[]\n | string\n | Record;\n\nexport default class States extends Array {\n private onChange: () => void;\n\n constructor(callback: () => void, initialState: NodeStates = {}) {\n if (isArray(initialState)) {\n super(...initialState);\n } else if (isString(initialState)) {\n super(initialState);\n } else {\n super(\n ...Object.entries(initialState)\n .filter(([_key, value]) => value)\n .map(([key]) => key),\n );\n }\n\n this.onChange = callback;\n return this;\n }\n\n has(state: string) {\n return this.indexOf(state) >= 0;\n }\n\n is(state: string) {\n return this.indexOf(state) >= 0;\n }\n\n add(state: string) {\n this.push(state);\n this.onChange();\n }\n\n toggle(state: string) {\n if (this.has(state)) {\n this.remove(state);\n } else {\n this.add(state);\n }\n }\n\n remove(state: string) {\n const stateIndexToRemove = this.indexOf(state);\n if (stateIndexToRemove >= 0) {\n this.splice(stateIndexToRemove, 1);\n this.onChange();\n }\n }\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { createSignal } from 'solid-js';\nimport type { ElementNode } from './node/index.js';\nexport const [activeElement, setActiveElement] = createSignal<\n ElementNode | undefined\n>(undefined);\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { renderer, createShader } from '../lightningInit.js';\nimport {\n type BorderStyleObject,\n type IntrinsicCommonProps,\n type IntrinsicNodeProps,\n type IntrinsicTextProps,\n type NodeStyles,\n type TextStyles,\n} from '../../index.js';\nimport Children from './children.js';\nimport States, { type NodeStates } from './states.js';\nimport calculateFlex from '../flex.js';\nimport {\n log,\n isArray,\n isNumber,\n isFunc,\n keyExists,\n flattenStyles,\n} from '../utils.js';\nimport { config } from '../../config.js';\nimport { setActiveElement } from '../activeElement.js';\nimport type {\n RendererMain,\n INode,\n INodeAnimatableProps,\n INodeWritableProps,\n ShaderRef,\n Dimensions,\n AnimationSettings,\n NodeLoadedPayload,\n} from '@lightningjs/renderer';\nimport { assertTruthy } from '@lightningjs/renderer/utils';\n\nconst { animationSettings: defaultAnimationSettings } = config;\n\nfunction convertEffectsToShader(styleEffects: any) {\n const effects = [];\n\n for (const [type, props] of Object.entries>(\n styleEffects,\n )) {\n effects.push({ type, props });\n }\n return createShader('DynamicShader', { effects: effects as any });\n}\n\nfunction borderAccessor(\n direction: '' | 'Top' | 'Right' | 'Bottom' | 'Left' = '',\n) {\n return {\n set(\n this: ElementNode,\n value: number | { width: number; color: number | string },\n ) {\n // Format: width || { width, color }\n if (isNumber(value)) {\n value = { width: value, color: 0x000000ff };\n }\n this.effects = {\n ...(this.effects || {}),\n ...{ [`border${direction}`]: value },\n };\n this[`_border${direction}`] = value;\n },\n get(this: ElementNode) {\n return this[`_border${direction}`];\n },\n };\n}\n\nconst LightningRendererNumberProps = [\n 'alpha',\n 'color',\n 'colorTop',\n 'colorRight',\n 'colorLeft',\n 'colorBottom',\n 'colorTl',\n 'colorTr',\n 'colorBl',\n 'colorBr',\n 'height',\n 'fontSize',\n 'lineHeight',\n 'mount',\n 'mountX',\n 'mountY',\n 'pivot',\n 'pivotX',\n 'pivotY',\n 'rotation',\n 'scale',\n 'width',\n 'worldX',\n 'worldY',\n 'x',\n 'y',\n 'zIndex',\n 'zIndexLocked',\n];\n\nconst LightningRendererNonAnimatingProps = [\n 'clipping',\n 'contain',\n 'fontFamily',\n 'fontStretch',\n 'fontStyle',\n 'fontWeight',\n 'letterSpacing',\n 'maxLines',\n 'offsetY',\n 'overflowSuffix',\n 'rtt',\n 'scrollable',\n 'scrollY',\n 'src',\n 'text',\n 'textAlign',\n 'textBaseline',\n 'textOverflow',\n 'texture',\n 'verticalAlign',\n 'wordWrap',\n];\n\nexport interface TextNode {\n id?: string;\n name: string;\n text: string;\n parent: ElementNode | undefined;\n zIndex?: number;\n states?: States;\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n marginLeft?: number;\n marginRight?: number;\n marginTop?: number;\n marginBottom?: number;\n flexItem?: boolean;\n _queueDelete?: boolean;\n}\n\nexport type SolidNode = ElementNode | TextNode;\nexport type SolidStyles = NodeStyles | TextStyles;\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\nexport interface ElementNode\n extends Partial>,\n IntrinsicCommonProps {\n [key: string]: unknown;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\nexport class ElementNode extends Object {\n id?: string;\n debug?: boolean;\n name: string;\n lng: INode | undefined;\n renderer?: RendererMain;\n selected?: number;\n rendered: boolean;\n autofocus: boolean;\n flexItem?: boolean;\n _queueDelete?: boolean;\n forwardFocus?:\n | number\n | ((this: ElementNode, elm: ElementNode) => boolean | void);\n\n private _undoStyles?: string[];\n private _renderProps?: IntrinsicNodeProps | IntrinsicTextProps;\n private _effects: any;\n private _parent: ElementNode | undefined;\n private _shader?: ShaderRef;\n private _style?: SolidStyles;\n private _states?: States;\n private _events?: Array<\n [string, (target: ElementNode, event?: Event) => void]\n >;\n private _animationSettings?: Partial;\n private _width?: number;\n private _height?: number;\n private _color?: number | string;\n public _borderRadius?: number;\n public _border?: BorderStyleObject;\n public _borderLeft?: BorderStyleObject;\n public _borderRight?: BorderStyleObject;\n public _borderTop?: BorderStyleObject;\n public _borderBottom?: BorderStyleObject;\n public _autosized?: boolean; // Public but uses _ prefix\n public _isDirty?: boolean; // Public but uses _ prefix\n private _animationQueue: Array<{\n props: Partial;\n animationSettings?: Partial;\n }> = [];\n private _animationQueueSettings: Partial | undefined;\n private _animationRunning: boolean = false;\n children: Children;\n\n constructor(name: string) {\n super();\n this.name = name;\n this.rendered = false;\n this.autofocus = false;\n this._renderProps = { x: 0, y: 0 };\n this.children = new Children(this);\n }\n\n get effects() {\n return this._effects;\n }\n\n set effects(v) {\n this._effects = v;\n if (this.rendered) {\n this.shader = convertEffectsToShader(v);\n }\n }\n\n get parent() {\n return this._parent;\n }\n\n set parent(p) {\n this._parent = p;\n if (this.rendered && this.lng) {\n this.lng.parent = p?.lng ?? null;\n }\n }\n\n get shader(): ShaderRef | undefined {\n return this._shader;\n }\n\n set shader(v: Parameters | ShaderRef | undefined) {\n if (isArray(v)) {\n this._shader = createShader(...v) as ShaderRef;\n } else {\n this._shader = v;\n }\n this._sendToLightning('shader', this._shader);\n }\n\n _sendToLightningAnimatable(name: string, value: number | string) {\n if (this.lng) {\n if (\n config.animationsEnabled &&\n this.transition &&\n (this.transition === true || this.transition[name])\n ) {\n const animationSettings =\n this.transition === true || this.transition[name] === true\n ? undefined\n : (this.transition[name] as undefined | AnimationSettings);\n\n return this.animate({ [name]: value }, animationSettings).start();\n }\n\n (this.lng[name as keyof INode] as number | string) = value;\n } else {\n this._renderProps![name] = value;\n }\n }\n\n _sendToLightning(name: string, value: unknown) {\n if (this.rendered && this.lng) {\n (this.lng[name as keyof INodeWritableProps] as unknown) = value;\n } else {\n this._renderProps![name] = value;\n }\n }\n\n animate(\n props: Partial,\n animationSettings?: Partial,\n ) {\n assertTruthy(this.lng, 'Node must be rendered before animating');\n return this.lng.animate(props, animationSettings || this.animationSettings);\n }\n\n chain(\n props: Partial,\n animationSettings?: Partial,\n ) {\n if (this._animationRunning) {\n this._animationQueue = [];\n this._animationRunning = false;\n }\n\n if (animationSettings) {\n this._animationQueueSettings = animationSettings;\n } else if (!this._animationQueueSettings) {\n this._animationQueueSettings =\n animationSettings || this.animationSettings;\n }\n animationSettings = animationSettings || this._animationQueueSettings;\n this._animationQueue.push({ props, animationSettings });\n return this;\n }\n\n async start() {\n let animation = this._animationQueue.shift();\n while (animation) {\n this._animationRunning = true;\n await this.animate(animation.props, animation.animationSettings)\n .start()\n .waitUntilStopped();\n animation = this._animationQueue.shift();\n }\n this._animationRunning = false;\n this._animationQueueSettings = undefined;\n }\n\n setFocus() {\n if (this.rendered) {\n // can be 0\n if (this.forwardFocus !== undefined) {\n if (isFunc(this.forwardFocus)) {\n if (this.forwardFocus.call(this, this) !== false) {\n return;\n }\n } else {\n const focusedIndex =\n typeof this.forwardFocus === 'number' ? this.forwardFocus : null;\n if (focusedIndex !== null && focusedIndex < this.children.length) {\n const child = this.children[focusedIndex];\n child instanceof ElementNode && child.setFocus();\n return;\n }\n }\n }\n // Delay setting focus so children can render (useful for Row + Column)\n queueMicrotask(() => setActiveElement(this));\n } else {\n this.autofocus = true;\n }\n }\n\n isTextNode() {\n return this.name === 'text';\n }\n\n _resizeOnTextLoad() {\n this.lng!.on('loaded', (_node: INode, loadedPayload: NodeLoadedPayload) => {\n if (loadedPayload.type === 'text') {\n const { dimensions } = loadedPayload;\n this.parent!.updateLayout(this, dimensions);\n }\n });\n }\n\n getText() {\n return this.children.map((c) => c.text).join('');\n }\n\n destroy() {\n if (this._queueDelete) {\n this.lng?.destroy();\n }\n }\n // Must be set before render\n set onEvents(\n events: Array<[string, (target: ElementNode, event?: any) => void]>,\n ) {\n this._events = events;\n }\n\n get onEvents() {\n return this._events || [];\n }\n\n set style(values: SolidStyles | (SolidStyles | undefined)[]) {\n if (isArray(values)) {\n this._style = flattenStyles(values);\n } else {\n this._style = values;\n }\n // Keys set in JSX are more important\n for (const key in this._style) {\n // be careful of 0 values\n if (this[key as keyof SolidStyles] === undefined) {\n this[key as keyof SolidStyles] = this._style[key as keyof SolidStyles];\n }\n }\n }\n\n get style(): SolidStyles {\n return this._style!;\n }\n\n get hasChildren() {\n return this.children.length > 0;\n }\n\n getChildById(id: string) {\n return this.children.find((c) => c.id === id);\n }\n\n searchChildrenById(id: string): SolidNode | undefined {\n // traverse all the childrens children\n for (const child of this.children) {\n if (child.id === id) {\n return child;\n }\n if (child instanceof ElementNode) {\n const found = child.searchChildrenById(id);\n if (found) {\n return found;\n }\n }\n }\n }\n\n set states(states: NodeStates) {\n this._states = new States(this._stateChanged.bind(this), states);\n if (this.rendered) {\n this._stateChanged();\n }\n }\n\n get states(): States {\n this._states = this._states || new States(this._stateChanged.bind(this));\n return this._states;\n }\n\n get animationSettings(): Partial {\n return this._animationSettings || defaultAnimationSettings;\n }\n\n set animationSettings(animationSettings: Partial) {\n this._animationSettings = animationSettings;\n }\n\n updateLayout(child?: ElementNode, dimensions?: Dimensions) {\n if (this.hasChildren) {\n log('Layout: ', this);\n isFunc(this.onBeforeLayout) &&\n this.onBeforeLayout.call(this, child, dimensions);\n\n if (this.display === 'flex') {\n if (calculateFlex(this)) {\n this.parent?.updateLayout();\n }\n }\n\n isFunc(this.onLayout) && this.onLayout.call(this, child, dimensions);\n }\n }\n\n _stateChanged() {\n log('State Changed: ', this, this.states);\n\n if (this.forwardStates) {\n // apply states to children first\n const states = this.states.slice() as States;\n this.children.forEach((c) => (c.states = states));\n }\n\n const states = this.states;\n\n if (this._undoStyles || (this.style && keyExists(this.style, states))) {\n this._undoStyles = this._undoStyles || [];\n const stylesToUndo: { [key: string]: any } = {};\n\n this._undoStyles.forEach((styleKey) => {\n stylesToUndo[styleKey] = this.style[styleKey];\n });\n\n const newStyles = states.reduce((acc, state) => {\n const styles = this.style[state];\n if (styles) {\n acc = {\n ...acc,\n ...styles,\n };\n }\n return acc;\n }, {});\n\n this._undoStyles = Object.keys(newStyles);\n\n // Apply transition first\n if ((newStyles as any).transition !== undefined) {\n this.transition = (newStyles as any).transition;\n }\n\n // Apply the styles\n Object.assign(this, { ...stylesToUndo, ...newStyles });\n }\n }\n\n render() {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const node = this;\n const parent = this.parent;\n\n if (!parent) {\n console.warn('Parent not set - no node created for: ', this);\n return;\n }\n\n if (!parent.rendered) {\n console.warn('Parent not rendered yet: ', this);\n return;\n }\n\n if (this.rendered) {\n console.warn('Node already rendered: ', this);\n return;\n }\n\n // Parent is dirty whenever a node is inserted after initial render\n if (parent._isDirty) {\n parent.updateLayout();\n parent._isDirty = false;\n }\n\n node.updateLayout();\n\n if (this.states.length) {\n this._stateChanged();\n }\n\n let props = node._renderProps as IntrinsicNodeProps | IntrinsicTextProps;\n\n if (parent.lng) {\n props.parent = parent.lng;\n }\n\n if (node._effects) {\n this.shader = convertEffectsToShader(node._effects);\n }\n\n if (node.isTextNode()) {\n props = {\n ...config.fontSettings,\n ...props,\n text: node.getText(),\n };\n\n if (props.contain) {\n if (!props.width) {\n props.width =\n (parent.width || 0) - (props.x || 0) - (props.marginRight || 0);\n node._width = props.width;\n node._autosized = true;\n }\n\n if (props.contain === 'both' && !props.height && !props.maxLines) {\n props.height =\n (parent.height || 0) - (props.y || 0) - (props.marginBottom || 0);\n node._height = props.height;\n node._autosized = true;\n }\n }\n\n log('Rendering: ', this, props);\n node.lng = renderer.createTextNode(props);\n\n if (isFunc(node.onLoad)) {\n node.lng.on('loaded', node.onLoad);\n }\n\n if (!node.width || !node.height) {\n node._autosized = true;\n node._resizeOnTextLoad();\n }\n } else {\n // If its not an image or texture apply some defaults\n if (!props.texture) {\n // Set width and height to parent less offset\n if (isNaN(props.width as number)) {\n props.width = (parent.width || 0) - (props.x || 0);\n node._width = props.width;\n node._autosized = true;\n }\n\n if (isNaN(props.height as number)) {\n props.height = (parent.height || 0) - (props.y || 0);\n node._height = props.height;\n node._autosized = true;\n }\n\n if (!props.color && !props.src) {\n // Default color to transparent - If you later set a src, you'll need\n // to set color '#ffffffff'\n node._color = props.color = 0x00000000;\n }\n }\n\n log('Rendering: ', this, props);\n node.lng = renderer.createNode(props);\n\n if (node.onFail) {\n node.lng.on('failed', node.onFail);\n }\n\n if (node.onLoad) {\n node.lng.on('loaded', node.onLoad);\n }\n }\n\n node.rendered = true;\n isFunc(this.onCreate) && this.onCreate.call(this, node);\n\n node.onEvents.forEach(([name, handler]) => {\n node.lng?.on(name, (inode, data) => handler(node, data));\n });\n\n // L3 Inspector adds div to the lng object\n //@ts-expect-error - div is not in the typings\n if (node.lng.div) {\n //@ts-expect-error - div is not in the typings\n node.lng.div.solid = node;\n }\n // clean up after first render;\n delete this._renderProps;\n\n if (node.name !== 'text') {\n node.children.forEach((c) => {\n if ((c as ElementNode).render) {\n (c as ElementNode).render();\n } else if (c.text !== '') {\n // Solid Show uses an empty text node as a placeholder\n console.warn('TextNode outside of : ', c);\n }\n });\n }\n\n node.autofocus && node.setFocus();\n }\n}\n\nfor (const key of LightningRendererNumberProps) {\n Object.defineProperty(ElementNode.prototype, key, {\n get(): number {\n return (this.lng && this.lng[key]) ?? this[`_${key}`];\n },\n set(v: number) {\n this[`_${key}`] = v;\n this._sendToLightningAnimatable(key, v);\n },\n });\n}\n\nfor (const key of LightningRendererNonAnimatingProps) {\n Object.defineProperty(ElementNode.prototype, key, {\n get() {\n return (this.lng && this.lng[key]) ?? this[`_${key}`];\n },\n set(v) {\n this[`_${key}`] = v;\n this._sendToLightning(key, v);\n },\n });\n}\n\n// Add Border Helpers\nObject.defineProperties(ElementNode.prototype, {\n borderRadius: {\n set(this: ElementNode, radius) {\n this._borderRadius = radius;\n this.effects = {\n ...(this.effects || {}),\n ...{ radius: { radius } },\n };\n },\n get(this: ElementNode) {\n return this._borderRadius;\n },\n },\n border: borderAccessor(),\n borderLeft: borderAccessor('Left'),\n borderRight: borderAccessor('Right'),\n borderTop: borderAccessor('Top'),\n borderBottom: borderAccessor('Bottom'),\n});\n\nObject.defineProperties(ElementNode.prototype, {\n linearGradient: {\n set(props = {}) {\n this._linearGradient = props;\n this.effects = {\n ...(this.effects || {}),\n ...{ linearGradient: props },\n };\n },\n get() {\n return this._linearGradient;\n },\n },\n});\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { assertTruthy } from '@lightningjs/renderer/utils';\nimport type { ElementNode, SolidNode } from './node/index.js';\n\nexport default function (node: ElementNode): boolean {\n const children = [];\n for (let i = 0; i < node.children.length; i++) {\n const c = node.children[i]!;\n // Filter empty text nodes which are place holders for and elements missing dimensions\n if (c.name === 'TextNode') {\n continue;\n }\n\n // Skip layout for non flex items\n if (c.flexItem === false) {\n continue;\n }\n\n // text node hasnt loaded yet - skip layout\n if (c.name === 'text' && c.text !== '' && !(c.width || c.height)) {\n return false;\n }\n\n children.push(c);\n }\n\n const numChildren = children.length;\n const direction = node.flexDirection || 'row';\n const isRow = direction === 'row';\n const dimension = isRow ? 'width' : 'height';\n const crossDimension = isRow ? 'height' : 'width';\n const marginOne = isRow ? 'marginLeft' : 'marginTop';\n const marginTwo = isRow ? 'marginRight' : 'marginBottom';\n const prop = isRow ? 'x' : 'y';\n const crossProp = isRow ? 'y' : 'x';\n const containerSize = node[dimension] || 0;\n const containerCrossSize = node[crossDimension] || 0;\n const gap = node.gap || 0;\n const justify = node.justifyContent || 'flexStart';\n const align = node.alignItems;\n let itemSize = 0;\n if (['center', 'spaceBetween', 'spaceEvenly'].includes(justify)) {\n itemSize = children.reduce((prev, c) => prev + (c[dimension] || 0), 0);\n }\n\n // Only align children if container has a cross size\n const crossAlignChild =\n containerCrossSize && align\n ? (c: SolidNode) => {\n if (align === 'flexStart') {\n c[crossProp] = 0;\n } else if (align === 'center') {\n c[crossProp] = (containerCrossSize - (c[crossDimension] || 0)) / 2;\n } else if (align === 'flexEnd') {\n c[crossProp] = containerCrossSize - (c[crossDimension] || 0);\n }\n }\n : (c: SolidNode) => c;\n\n if (justify === 'flexStart') {\n let start = 0;\n children.forEach((c) => {\n c[prop] = start + (c[marginOne] || 0);\n start +=\n (c[dimension] || 0) + gap + (c[marginOne] || 0) + (c[marginTwo] || 0);\n crossAlignChild(c);\n });\n // Update container size\n if (node._autosized) {\n const calculatedSize = start - gap;\n if (calculatedSize !== node[dimension]) {\n node[dimension] = calculatedSize;\n return true;\n }\n }\n } else if (justify === 'flexEnd') {\n let start = containerSize;\n for (let i = numChildren - 1; i >= 0; i--) {\n const c = children[i];\n assertTruthy(c);\n c[prop] = start - (c[dimension] || 0) - (c[marginTwo] || 0);\n start -=\n (c[dimension] || 0) + gap + (c[marginOne] || 0) + (c[marginTwo] || 0);\n crossAlignChild(c);\n }\n } else if (justify === 'center') {\n let start = (containerSize - (itemSize + gap * (numChildren - 1))) / 2;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + gap;\n crossAlignChild(c);\n });\n } else if (justify === 'spaceBetween') {\n const toPad = (containerSize - itemSize) / (numChildren - 1);\n let start = 0;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + toPad;\n crossAlignChild(c);\n });\n } else if (justify === 'spaceEvenly') {\n const toPad = (containerSize - itemSize) / (numChildren + 1);\n let start = toPad;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + toPad;\n crossAlignChild(c);\n });\n }\n\n // Container was not updated\n return false;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { type Component } from \"solid-js\";\nimport type { IntrinsicTextProps } from \"../intrinsicTypes.js\";\n\nexport const Text: Component = (props) => \n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { type Component } from \"solid-js\";\nimport { type IntrinsicNodeProps } from \"../intrinsicTypes.js\";\n\nexport const View: Component = (props) =>\n ;\n","import {\n createRoot,\n createRenderEffect,\n mergeProps,\n createMemo,\n createComponent,\n untrack\n} from \"solid-js\";\n\nfunction createRenderer$1({\n createElement,\n createTextNode,\n isTextNode,\n replaceText,\n insertNode,\n removeNode,\n setProperty,\n getParentNode,\n getFirstChild,\n getNextSibling\n}) {\n function insert(parent, accessor, marker, initial) {\n if (marker !== undefined && !initial) initial = [];\n if (typeof accessor !== \"function\") return insertExpression(parent, accessor, initial, marker);\n createRenderEffect(current => insertExpression(parent, accessor(), current, marker), initial);\n }\n function insertExpression(parent, value, current, marker, unwrapArray) {\n while (typeof current === \"function\") current = current();\n if (value === current) return current;\n const t = typeof value,\n multi = marker !== undefined;\n if (t === \"string\" || t === \"number\") {\n if (t === \"number\") value = value.toString();\n if (multi) {\n let node = current[0];\n if (node && isTextNode(node)) {\n replaceText(node, value);\n } else node = createTextNode(value);\n current = cleanChildren(parent, current, marker, node);\n } else {\n if (current !== \"\" && typeof current === \"string\") {\n replaceText(getFirstChild(parent), (current = value));\n } else {\n cleanChildren(parent, current, marker, createTextNode(value));\n current = value;\n }\n }\n } else if (value == null || t === \"boolean\") {\n current = cleanChildren(parent, current, marker);\n } else if (t === \"function\") {\n createRenderEffect(() => {\n let v = value();\n while (typeof v === \"function\") v = v();\n current = insertExpression(parent, v, current, marker);\n });\n return () => current;\n } else if (Array.isArray(value)) {\n const array = [];\n if (normalizeIncomingArray(array, value, unwrapArray)) {\n createRenderEffect(\n () => (current = insertExpression(parent, array, current, marker, true))\n );\n return () => current;\n }\n if (array.length === 0) {\n const replacement = cleanChildren(parent, current, marker);\n if (multi) return (current = replacement);\n } else {\n if (Array.isArray(current)) {\n if (current.length === 0) {\n appendNodes(parent, array, marker);\n } else reconcileArrays(parent, current, array);\n } else if (current == null || current === \"\") {\n appendNodes(parent, array);\n } else {\n reconcileArrays(parent, (multi && current) || [getFirstChild(parent)], array);\n }\n }\n current = array;\n } else {\n if (Array.isArray(current)) {\n if (multi) return (current = cleanChildren(parent, current, marker, value));\n cleanChildren(parent, current, null, value);\n } else if (current == null || current === \"\" || !getFirstChild(parent)) {\n insertNode(parent, value);\n } else replaceNode(parent, value, getFirstChild(parent));\n current = value;\n }\n return current;\n }\n function normalizeIncomingArray(normalized, array, unwrap) {\n let dynamic = false;\n for (let i = 0, len = array.length; i < len; i++) {\n let item = array[i],\n t;\n if (item == null || item === true || item === false);\n else if (Array.isArray(item)) {\n dynamic = normalizeIncomingArray(normalized, item) || dynamic;\n } else if ((t = typeof item) === \"string\" || t === \"number\") {\n normalized.push(createTextNode(item));\n } else if (t === \"function\") {\n if (unwrap) {\n while (typeof item === \"function\") item = item();\n dynamic =\n normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item]) || dynamic;\n } else {\n normalized.push(item);\n dynamic = true;\n }\n } else normalized.push(item);\n }\n return dynamic;\n }\n function reconcileArrays(parentNode, a, b) {\n let bLength = b.length,\n aEnd = a.length,\n bEnd = bLength,\n aStart = 0,\n bStart = 0,\n after = getNextSibling(a[aEnd - 1]),\n map = null;\n while (aStart < aEnd || bStart < bEnd) {\n if (a[aStart] === b[bStart]) {\n aStart++;\n bStart++;\n continue;\n }\n while (a[aEnd - 1] === b[bEnd - 1]) {\n aEnd--;\n bEnd--;\n }\n if (aEnd === aStart) {\n const node =\n bEnd < bLength ? (bStart ? getNextSibling(b[bStart - 1]) : b[bEnd - bStart]) : after;\n while (bStart < bEnd) insertNode(parentNode, b[bStart++], node);\n } else if (bEnd === bStart) {\n while (aStart < aEnd) {\n if (!map || !map.has(a[aStart])) removeNode(parentNode, a[aStart]);\n aStart++;\n }\n } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {\n const node = getNextSibling(a[--aEnd]);\n insertNode(parentNode, b[bStart++], getNextSibling(a[aStart++]));\n insertNode(parentNode, b[--bEnd], node);\n a[aEnd] = b[bEnd];\n } else {\n if (!map) {\n map = new Map();\n let i = bStart;\n while (i < bEnd) map.set(b[i], i++);\n }\n const index = map.get(a[aStart]);\n if (index != null) {\n if (bStart < index && index < bEnd) {\n let i = aStart,\n sequence = 1,\n t;\n while (++i < aEnd && i < bEnd) {\n if ((t = map.get(a[i])) == null || t !== index + sequence) break;\n sequence++;\n }\n if (sequence > index - bStart) {\n const node = a[aStart];\n while (bStart < index) insertNode(parentNode, b[bStart++], node);\n } else replaceNode(parentNode, b[bStart++], a[aStart++]);\n } else aStart++;\n } else removeNode(parentNode, a[aStart++]);\n }\n }\n }\n function cleanChildren(parent, current, marker, replacement) {\n if (marker === undefined) {\n let removed;\n while ((removed = getFirstChild(parent))) removeNode(parent, removed);\n replacement && insertNode(parent, replacement);\n return \"\";\n }\n const node = replacement || createTextNode(\"\");\n if (current.length) {\n let inserted = false;\n for (let i = current.length - 1; i >= 0; i--) {\n const el = current[i];\n if (node !== el) {\n const isParent = getParentNode(el) === parent;\n if (!inserted && !i)\n isParent ? replaceNode(parent, node, el) : insertNode(parent, node, marker);\n else isParent && removeNode(parent, el);\n } else inserted = true;\n }\n } else insertNode(parent, node, marker);\n return [node];\n }\n function appendNodes(parent, array, marker) {\n for (let i = 0, len = array.length; i < len; i++) insertNode(parent, array[i], marker);\n }\n function replaceNode(parent, newNode, oldNode) {\n insertNode(parent, newNode, oldNode);\n removeNode(parent, oldNode);\n }\n function spreadExpression(node, props, prevProps = {}, skipChildren) {\n props || (props = {});\n if (!skipChildren) {\n createRenderEffect(\n () => (prevProps.children = insertExpression(node, props.children, prevProps.children))\n );\n }\n createRenderEffect(() => props.ref && props.ref(node));\n createRenderEffect(() => {\n for (const prop in props) {\n if (prop === \"children\" || prop === \"ref\") continue;\n const value = props[prop];\n if (value === prevProps[prop]) continue;\n setProperty(node, prop, value, prevProps[prop]);\n prevProps[prop] = value;\n }\n });\n return prevProps;\n }\n return {\n render(code, element) {\n let disposer;\n createRoot(dispose => {\n disposer = dispose;\n insert(element, code());\n });\n return disposer;\n },\n insert,\n spread(node, accessor, skipChildren) {\n if (typeof accessor === \"function\") {\n createRenderEffect(current => spreadExpression(node, accessor(), current, skipChildren));\n } else spreadExpression(node, accessor, undefined, skipChildren);\n },\n createElement,\n createTextNode,\n insertNode,\n setProp(node, name, value, prev) {\n setProperty(node, name, value, prev);\n return value;\n },\n mergeProps,\n effect: createRenderEffect,\n memo: createMemo,\n createComponent,\n use(fn, element, arg) {\n return untrack(() => fn(element, arg));\n }\n };\n}\n\nfunction createRenderer(options) {\n const renderer = createRenderer$1(options);\n renderer.mergeProps = mergeProps;\n return renderer;\n}\n\nexport { createRenderer };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { assertTruthy } from '@lightningjs/renderer/utils';\nimport { log } from './utils.js';\nimport { ElementNode, type SolidNode, type TextNode } from './node/index.js';\nimport type { createRenderer } from 'solid-js/universal';\n\nexport type SolidRendererOptions = Parameters<\n typeof createRenderer\n>[0];\n\nexport default {\n createElement(name: string): ElementNode {\n return new ElementNode(name);\n },\n createTextNode(text: string): TextNode {\n // A text node is just a string - not the node\n return { name: 'TextNode', text, parent: undefined };\n },\n replaceText(node: TextNode, value: string): void {\n log('Replace Text: ', node, value);\n node.text = value;\n const parent = node.parent;\n assertTruthy(parent);\n parent.text = parent.getText();\n },\n setProperty(node: ElementNode, name: string, value: any = true): void {\n node[name] = value;\n },\n insertNode(parent: ElementNode, node: SolidNode, anchor: SolidNode): void {\n log('INSERT: ', parent, node, anchor);\n\n parent.children.insert(node, anchor);\n node._queueDelete = false;\n\n if (node instanceof ElementNode) {\n parent.rendered && node.render();\n } else if (parent.isTextNode()) {\n // TextNodes can be placed outside of nodes when is used as placeholder\n parent.text = parent.getText();\n }\n },\n isTextNode(node: ElementNode): boolean {\n return node.isTextNode();\n },\n removeNode(parent: ElementNode, node: SolidNode): void {\n log('REMOVE: ', parent, node);\n parent.children.remove(node);\n node._queueDelete = true;\n\n if (node instanceof ElementNode) {\n // Solid replacesNodes to move them (via insert and remove),\n // so we need to wait for the next microtask to destroy the node\n // in the event it gets a new parent.\n queueMicrotask(() => node.destroy());\n }\n },\n getParentNode(node: SolidNode): ElementNode | undefined {\n return node.parent;\n },\n getFirstChild(node: ElementNode): SolidNode | undefined {\n return node.children[0];\n },\n getNextSibling(node: SolidNode): SolidNode | undefined {\n const children = node.parent!.children || [];\n const index = children.indexOf(node) + 1;\n if (index < children.length) {\n return children[index];\n }\n return undefined;\n },\n} satisfies SolidRendererOptions;\n","/* eslint-disable @typescript-eslint/unbound-method */\n/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { createRenderer } from 'solid-js/universal';\nimport { config } from '../config.js';\nimport { startLightningRenderer } from './lightningInit.js';\nimport universalLightning from './solidUniversal.js';\nimport { ElementNode, type SolidNode } from './node/index.js';\nimport { splitProps, createMemo, untrack, type JSX } from 'solid-js';\n\nconst solidRenderer = createRenderer(universalLightning);\n\nexport const render = async function (\n code: () => JSX.Element,\n node?: string | HTMLElement | undefined,\n) {\n const renderer = startLightningRenderer(config.rendererOptions, node);\n await renderer.init();\n const rootNode = new ElementNode('App');\n rootNode.lng = renderer.root!;\n rootNode.rendered = true;\n // @ts-expect-error - code is jsx element and not SolidElement yet\n const dispose = solidRenderer.render(code, rootNode);\n return {\n dispose,\n rootNode,\n renderer,\n };\n};\n\nexport const {\n effect,\n memo,\n createComponent,\n createElement,\n createTextNode,\n insertNode,\n insert,\n spread,\n setProp,\n mergeProps,\n use,\n} = solidRenderer;\n\n/**\n * renders an arbitrary custom or native component and passes the other props\n * ```typescript\n * \n * ```\n * @description https://www.solidjs.com/docs/latest/api#dynamic\n */\nexport function Dynamic(\n props: T extends Record ? T : never,\n): SolidNode {\n const [p, others] = splitProps(props, ['component']);\n // eslint-disable-next-line @typescript-eslint/ban-types\n const cached = createMemo(() => p.component);\n return createMemo(() => {\n const component = cached();\n switch (typeof component) {\n case 'function':\n return untrack(() => component(others));\n\n case 'string':\n // eslint-disable-next-line no-case-declarations\n const el = createElement(component);\n spread(el, others);\n return el;\n\n default:\n break;\n }\n }) as unknown as SolidNode;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { isInteger } from './core/utils.js';\n\n/**\n * Converts a color string to a color number value.\n */\nexport function hexColor(color: string | number = ''): number {\n if (isInteger(color)) {\n return color;\n }\n\n if (typeof color === 'string') {\n // Renderer expects RGBA values\n if (color.startsWith('#')) {\n return Number(\n color.replace('#', '0x') + (color.length === 7 ? 'ff' : ''),\n );\n }\n\n if (color.startsWith('0x')) {\n return Number(color);\n }\n return Number('0x' + (color.length === 6 ? color + 'ff' : color));\n }\n\n return 0x00000000;\n}\n\n/**\n * Converts degrees to radians\n */\nexport function deg2rad(deg: number) {\n return (deg * Math.PI) / 180;\n}\n","import {\n createRoot,\n sharedConfig,\n createRenderEffect,\n untrack,\n enableHydration,\n getOwner,\n createEffect,\n runWithOwner,\n createMemo,\n createSignal,\n onCleanup,\n splitProps\n} from \"solid-js\";\nexport {\n ErrorBoundary,\n For,\n Index,\n Match,\n Show,\n Suspense,\n SuspenseList,\n Switch,\n createComponent,\n createRenderEffect as effect,\n getOwner,\n createMemo as memo,\n mergeProps,\n untrack\n} from \"solid-js\";\n\nconst booleans = [\n \"allowfullscreen\",\n \"async\",\n \"autofocus\",\n \"autoplay\",\n \"checked\",\n \"controls\",\n \"default\",\n \"disabled\",\n \"formnovalidate\",\n \"hidden\",\n \"indeterminate\",\n \"inert\",\n \"ismap\",\n \"loop\",\n \"multiple\",\n \"muted\",\n \"nomodule\",\n \"novalidate\",\n \"open\",\n \"playsinline\",\n \"readonly\",\n \"required\",\n \"reversed\",\n \"seamless\",\n \"selected\"\n];\nconst Properties = /*#__PURE__*/ new Set([\n \"className\",\n \"value\",\n \"readOnly\",\n \"formNoValidate\",\n \"isMap\",\n \"noModule\",\n \"playsInline\",\n ...booleans\n]);\nconst ChildProperties = /*#__PURE__*/ new Set([\n \"innerHTML\",\n \"textContent\",\n \"innerText\",\n \"children\"\n]);\nconst Aliases = /*#__PURE__*/ Object.assign(Object.create(null), {\n className: \"class\",\n htmlFor: \"for\"\n});\nconst PropAliases = /*#__PURE__*/ Object.assign(Object.create(null), {\n class: \"className\",\n formnovalidate: {\n $: \"formNoValidate\",\n BUTTON: 1,\n INPUT: 1\n },\n ismap: {\n $: \"isMap\",\n IMG: 1\n },\n nomodule: {\n $: \"noModule\",\n SCRIPT: 1\n },\n playsinline: {\n $: \"playsInline\",\n VIDEO: 1\n },\n readonly: {\n $: \"readOnly\",\n INPUT: 1,\n TEXTAREA: 1\n }\n});\nfunction getPropAlias(prop, tagName) {\n const a = PropAliases[prop];\n return typeof a === \"object\" ? (a[tagName] ? a[\"$\"] : undefined) : a;\n}\nconst DelegatedEvents = /*#__PURE__*/ new Set([\n \"beforeinput\",\n \"click\",\n \"dblclick\",\n \"contextmenu\",\n \"focusin\",\n \"focusout\",\n \"input\",\n \"keydown\",\n \"keyup\",\n \"mousedown\",\n \"mousemove\",\n \"mouseout\",\n \"mouseover\",\n \"mouseup\",\n \"pointerdown\",\n \"pointermove\",\n \"pointerout\",\n \"pointerover\",\n \"pointerup\",\n \"touchend\",\n \"touchmove\",\n \"touchstart\"\n]);\nconst SVGElements = /*#__PURE__*/ new Set([\n \"altGlyph\",\n \"altGlyphDef\",\n \"altGlyphItem\",\n \"animate\",\n \"animateColor\",\n \"animateMotion\",\n \"animateTransform\",\n \"circle\",\n \"clipPath\",\n \"color-profile\",\n \"cursor\",\n \"defs\",\n \"desc\",\n \"ellipse\",\n \"feBlend\",\n \"feColorMatrix\",\n \"feComponentTransfer\",\n \"feComposite\",\n \"feConvolveMatrix\",\n \"feDiffuseLighting\",\n \"feDisplacementMap\",\n \"feDistantLight\",\n \"feFlood\",\n \"feFuncA\",\n \"feFuncB\",\n \"feFuncG\",\n \"feFuncR\",\n \"feGaussianBlur\",\n \"feImage\",\n \"feMerge\",\n \"feMergeNode\",\n \"feMorphology\",\n \"feOffset\",\n \"fePointLight\",\n \"feSpecularLighting\",\n \"feSpotLight\",\n \"feTile\",\n \"feTurbulence\",\n \"filter\",\n \"font\",\n \"font-face\",\n \"font-face-format\",\n \"font-face-name\",\n \"font-face-src\",\n \"font-face-uri\",\n \"foreignObject\",\n \"g\",\n \"glyph\",\n \"glyphRef\",\n \"hkern\",\n \"image\",\n \"line\",\n \"linearGradient\",\n \"marker\",\n \"mask\",\n \"metadata\",\n \"missing-glyph\",\n \"mpath\",\n \"path\",\n \"pattern\",\n \"polygon\",\n \"polyline\",\n \"radialGradient\",\n \"rect\",\n \"set\",\n \"stop\",\n \"svg\",\n \"switch\",\n \"symbol\",\n \"text\",\n \"textPath\",\n \"tref\",\n \"tspan\",\n \"use\",\n \"view\",\n \"vkern\"\n]);\nconst SVGNamespace = {\n xlink: \"http://www.w3.org/1999/xlink\",\n xml: \"http://www.w3.org/XML/1998/namespace\"\n};\nconst DOMElements = /*#__PURE__*/ new Set([\n \"html\",\n \"base\",\n \"head\",\n \"link\",\n \"meta\",\n \"style\",\n \"title\",\n \"body\",\n \"address\",\n \"article\",\n \"aside\",\n \"footer\",\n \"header\",\n \"main\",\n \"nav\",\n \"section\",\n \"body\",\n \"blockquote\",\n \"dd\",\n \"div\",\n \"dl\",\n \"dt\",\n \"figcaption\",\n \"figure\",\n \"hr\",\n \"li\",\n \"ol\",\n \"p\",\n \"pre\",\n \"ul\",\n \"a\",\n \"abbr\",\n \"b\",\n \"bdi\",\n \"bdo\",\n \"br\",\n \"cite\",\n \"code\",\n \"data\",\n \"dfn\",\n \"em\",\n \"i\",\n \"kbd\",\n \"mark\",\n \"q\",\n \"rp\",\n \"rt\",\n \"ruby\",\n \"s\",\n \"samp\",\n \"small\",\n \"span\",\n \"strong\",\n \"sub\",\n \"sup\",\n \"time\",\n \"u\",\n \"var\",\n \"wbr\",\n \"area\",\n \"audio\",\n \"img\",\n \"map\",\n \"track\",\n \"video\",\n \"embed\",\n \"iframe\",\n \"object\",\n \"param\",\n \"picture\",\n \"portal\",\n \"source\",\n \"svg\",\n \"math\",\n \"canvas\",\n \"noscript\",\n \"script\",\n \"del\",\n \"ins\",\n \"caption\",\n \"col\",\n \"colgroup\",\n \"table\",\n \"tbody\",\n \"td\",\n \"tfoot\",\n \"th\",\n \"thead\",\n \"tr\",\n \"button\",\n \"datalist\",\n \"fieldset\",\n \"form\",\n \"input\",\n \"label\",\n \"legend\",\n \"meter\",\n \"optgroup\",\n \"option\",\n \"output\",\n \"progress\",\n \"select\",\n \"textarea\",\n \"details\",\n \"dialog\",\n \"menu\",\n \"summary\",\n \"details\",\n \"slot\",\n \"template\",\n \"acronym\",\n \"applet\",\n \"basefont\",\n \"bgsound\",\n \"big\",\n \"blink\",\n \"center\",\n \"content\",\n \"dir\",\n \"font\",\n \"frame\",\n \"frameset\",\n \"hgroup\",\n \"image\",\n \"keygen\",\n \"marquee\",\n \"menuitem\",\n \"nobr\",\n \"noembed\",\n \"noframes\",\n \"plaintext\",\n \"rb\",\n \"rtc\",\n \"shadow\",\n \"spacer\",\n \"strike\",\n \"tt\",\n \"xmp\",\n \"a\",\n \"abbr\",\n \"acronym\",\n \"address\",\n \"applet\",\n \"area\",\n \"article\",\n \"aside\",\n \"audio\",\n \"b\",\n \"base\",\n \"basefont\",\n \"bdi\",\n \"bdo\",\n \"bgsound\",\n \"big\",\n \"blink\",\n \"blockquote\",\n \"body\",\n \"br\",\n \"button\",\n \"canvas\",\n \"caption\",\n \"center\",\n \"cite\",\n \"code\",\n \"col\",\n \"colgroup\",\n \"content\",\n \"data\",\n \"datalist\",\n \"dd\",\n \"del\",\n \"details\",\n \"dfn\",\n \"dialog\",\n \"dir\",\n \"div\",\n \"dl\",\n \"dt\",\n \"em\",\n \"embed\",\n \"fieldset\",\n \"figcaption\",\n \"figure\",\n \"font\",\n \"footer\",\n \"form\",\n \"frame\",\n \"frameset\",\n \"head\",\n \"header\",\n \"hgroup\",\n \"hr\",\n \"html\",\n \"i\",\n \"iframe\",\n \"image\",\n \"img\",\n \"input\",\n \"ins\",\n \"kbd\",\n \"keygen\",\n \"label\",\n \"legend\",\n \"li\",\n \"link\",\n \"main\",\n \"map\",\n \"mark\",\n \"marquee\",\n \"menu\",\n \"menuitem\",\n \"meta\",\n \"meter\",\n \"nav\",\n \"nobr\",\n \"noembed\",\n \"noframes\",\n \"noscript\",\n \"object\",\n \"ol\",\n \"optgroup\",\n \"option\",\n \"output\",\n \"p\",\n \"param\",\n \"picture\",\n \"plaintext\",\n \"portal\",\n \"pre\",\n \"progress\",\n \"q\",\n \"rb\",\n \"rp\",\n \"rt\",\n \"rtc\",\n \"ruby\",\n \"s\",\n \"samp\",\n \"script\",\n \"section\",\n \"select\",\n \"shadow\",\n \"slot\",\n \"small\",\n \"source\",\n \"spacer\",\n \"span\",\n \"strike\",\n \"strong\",\n \"style\",\n \"sub\",\n \"summary\",\n \"sup\",\n \"table\",\n \"tbody\",\n \"td\",\n \"template\",\n \"textarea\",\n \"tfoot\",\n \"th\",\n \"thead\",\n \"time\",\n \"title\",\n \"tr\",\n \"track\",\n \"tt\",\n \"u\",\n \"ul\",\n \"var\",\n \"video\",\n \"wbr\",\n \"xmp\",\n \"input\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n \"h6\"\n]);\n\nfunction reconcileArrays(parentNode, a, b) {\n let bLength = b.length,\n aEnd = a.length,\n bEnd = bLength,\n aStart = 0,\n bStart = 0,\n after = a[aEnd - 1].nextSibling,\n map = null;\n while (aStart < aEnd || bStart < bEnd) {\n if (a[aStart] === b[bStart]) {\n aStart++;\n bStart++;\n continue;\n }\n while (a[aEnd - 1] === b[bEnd - 1]) {\n aEnd--;\n bEnd--;\n }\n if (aEnd === aStart) {\n const node = bEnd < bLength ? (bStart ? b[bStart - 1].nextSibling : b[bEnd - bStart]) : after;\n while (bStart < bEnd) parentNode.insertBefore(b[bStart++], node);\n } else if (bEnd === bStart) {\n while (aStart < aEnd) {\n if (!map || !map.has(a[aStart])) a[aStart].remove();\n aStart++;\n }\n } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {\n const node = a[--aEnd].nextSibling;\n parentNode.insertBefore(b[bStart++], a[aStart++].nextSibling);\n parentNode.insertBefore(b[--bEnd], node);\n a[aEnd] = b[bEnd];\n } else {\n if (!map) {\n map = new Map();\n let i = bStart;\n while (i < bEnd) map.set(b[i], i++);\n }\n const index = map.get(a[aStart]);\n if (index != null) {\n if (bStart < index && index < bEnd) {\n let i = aStart,\n sequence = 1,\n t;\n while (++i < aEnd && i < bEnd) {\n if ((t = map.get(a[i])) == null || t !== index + sequence) break;\n sequence++;\n }\n if (sequence > index - bStart) {\n const node = a[aStart];\n while (bStart < index) parentNode.insertBefore(b[bStart++], node);\n } else parentNode.replaceChild(b[bStart++], a[aStart++]);\n } else aStart++;\n } else a[aStart++].remove();\n }\n }\n}\n\nconst $$EVENTS = \"_$DX_DELEGATE\";\nfunction render(code, element, init, options = {}) {\n let disposer;\n createRoot(dispose => {\n disposer = dispose;\n element === document\n ? code()\n : insert(element, code(), element.firstChild ? null : undefined, init);\n }, options.owner);\n return () => {\n disposer();\n element.textContent = \"\";\n };\n}\nfunction template(html, isCE, isSVG) {\n let node;\n const create = () => {\n const t = document.createElement(\"template\");\n t.innerHTML = html;\n return isSVG ? t.content.firstChild.firstChild : t.content.firstChild;\n };\n const fn = isCE\n ? () => untrack(() => document.importNode(node || (node = create()), true))\n : () => (node || (node = create())).cloneNode(true);\n fn.cloneNode = fn;\n return fn;\n}\nfunction delegateEvents(eventNames, document = window.document) {\n const e = document[$$EVENTS] || (document[$$EVENTS] = new Set());\n for (let i = 0, l = eventNames.length; i < l; i++) {\n const name = eventNames[i];\n if (!e.has(name)) {\n e.add(name);\n document.addEventListener(name, eventHandler);\n }\n }\n}\nfunction clearDelegatedEvents(document = window.document) {\n if (document[$$EVENTS]) {\n for (let name of document[$$EVENTS].keys()) document.removeEventListener(name, eventHandler);\n delete document[$$EVENTS];\n }\n}\nfunction setProperty(node, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n node[name] = value;\n}\nfunction setAttribute(node, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttribute(name);\n else node.setAttribute(name, value);\n}\nfunction setAttributeNS(node, namespace, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttributeNS(namespace, name);\n else node.setAttributeNS(namespace, name, value);\n}\nfunction className(node, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttribute(\"class\");\n else node.className = value;\n}\nfunction addEventListener(node, name, handler, delegate) {\n if (delegate) {\n if (Array.isArray(handler)) {\n node[`$$${name}`] = handler[0];\n node[`$$${name}Data`] = handler[1];\n } else node[`$$${name}`] = handler;\n } else if (Array.isArray(handler)) {\n const handlerFn = handler[0];\n node.addEventListener(name, (handler[0] = e => handlerFn.call(node, handler[1], e)));\n } else node.addEventListener(name, handler);\n}\nfunction classList(node, value, prev = {}) {\n const classKeys = Object.keys(value || {}),\n prevKeys = Object.keys(prev);\n let i, len;\n for (i = 0, len = prevKeys.length; i < len; i++) {\n const key = prevKeys[i];\n if (!key || key === \"undefined\" || value[key]) continue;\n toggleClassKey(node, key, false);\n delete prev[key];\n }\n for (i = 0, len = classKeys.length; i < len; i++) {\n const key = classKeys[i],\n classValue = !!value[key];\n if (!key || key === \"undefined\" || prev[key] === classValue || !classValue) continue;\n toggleClassKey(node, key, true);\n prev[key] = classValue;\n }\n return prev;\n}\nfunction style(node, value, prev) {\n if (!value) return prev ? setAttribute(node, \"style\") : value;\n const nodeStyle = node.style;\n if (typeof value === \"string\") return (nodeStyle.cssText = value);\n typeof prev === \"string\" && (nodeStyle.cssText = prev = undefined);\n prev || (prev = {});\n value || (value = {});\n let v, s;\n for (s in prev) {\n value[s] == null && nodeStyle.removeProperty(s);\n delete prev[s];\n }\n for (s in value) {\n v = value[s];\n if (v !== prev[s]) {\n nodeStyle.setProperty(s, v);\n prev[s] = v;\n }\n }\n return prev;\n}\nfunction spread(node, props = {}, isSVG, skipChildren) {\n const prevProps = {};\n if (!skipChildren) {\n createRenderEffect(\n () => (prevProps.children = insertExpression(node, props.children, prevProps.children))\n );\n }\n createRenderEffect(() => props.ref && props.ref(node));\n createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));\n return prevProps;\n}\nfunction dynamicProperty(props, key) {\n const src = props[key];\n Object.defineProperty(props, key, {\n get() {\n return src();\n },\n enumerable: true\n });\n return props;\n}\nfunction use(fn, element, arg) {\n return untrack(() => fn(element, arg));\n}\nfunction insert(parent, accessor, marker, initial) {\n if (marker !== undefined && !initial) initial = [];\n if (typeof accessor !== \"function\") return insertExpression(parent, accessor, initial, marker);\n createRenderEffect(current => insertExpression(parent, accessor(), current, marker), initial);\n}\nfunction assign(node, props, isSVG, skipChildren, prevProps = {}, skipRef = false) {\n props || (props = {});\n for (const prop in prevProps) {\n if (!(prop in props)) {\n if (prop === \"children\") continue;\n prevProps[prop] = assignProp(node, prop, null, prevProps[prop], isSVG, skipRef);\n }\n }\n for (const prop in props) {\n if (prop === \"children\") {\n if (!skipChildren) insertExpression(node, props.children);\n continue;\n }\n const value = props[prop];\n prevProps[prop] = assignProp(node, prop, value, prevProps[prop], isSVG, skipRef);\n }\n}\nfunction hydrate$1(code, element, options = {}) {\n sharedConfig.completed = globalThis._$HY.completed;\n sharedConfig.events = globalThis._$HY.events;\n sharedConfig.load = id => globalThis._$HY.r[id];\n sharedConfig.has = id => id in globalThis._$HY.r;\n sharedConfig.gather = root => gatherHydratable(element, root);\n sharedConfig.registry = new Map();\n sharedConfig.context = {\n id: options.renderId || \"\",\n count: 0\n };\n gatherHydratable(element, options.renderId);\n const dispose = render(code, element, [...element.childNodes], options);\n sharedConfig.context = null;\n return dispose;\n}\nfunction getNextElement(template) {\n let node, key;\n if (!sharedConfig.context || !(node = sharedConfig.registry.get((key = getHydrationKey())))) {\n return template();\n }\n if (sharedConfig.completed) sharedConfig.completed.add(node);\n sharedConfig.registry.delete(key);\n return node;\n}\nfunction getNextMatch(el, nodeName) {\n while (el && el.localName !== nodeName) el = el.nextSibling;\n return el;\n}\nfunction getNextMarker(start) {\n let end = start,\n count = 0,\n current = [];\n if (sharedConfig.context) {\n while (end) {\n if (end.nodeType === 8) {\n const v = end.nodeValue;\n if (v === \"$\") count++;\n else if (v === \"/\") {\n if (count === 0) return [end, current];\n count--;\n }\n }\n current.push(end);\n end = end.nextSibling;\n }\n }\n return [end, current];\n}\nfunction runHydrationEvents() {\n if (sharedConfig.events && !sharedConfig.events.queued) {\n queueMicrotask(() => {\n const { completed, events } = sharedConfig;\n events.queued = false;\n while (events.length) {\n const [el, e] = events[0];\n if (!completed.has(el)) return;\n eventHandler(e);\n events.shift();\n }\n });\n sharedConfig.events.queued = true;\n }\n}\nfunction toPropertyName(name) {\n return name.toLowerCase().replace(/-([a-z])/g, (_, w) => w.toUpperCase());\n}\nfunction toggleClassKey(node, key, value) {\n const classNames = key.trim().split(/\\s+/);\n for (let i = 0, nameLen = classNames.length; i < nameLen; i++)\n node.classList.toggle(classNames[i], value);\n}\nfunction assignProp(node, prop, value, prev, isSVG, skipRef) {\n let isCE, isProp, isChildProp, propAlias, forceProp;\n if (prop === \"style\") return style(node, value, prev);\n if (prop === \"classList\") return classList(node, value, prev);\n if (value === prev) return prev;\n if (prop === \"ref\") {\n if (!skipRef) value(node);\n } else if (prop.slice(0, 3) === \"on:\") {\n const e = prop.slice(3);\n prev && node.removeEventListener(e, prev);\n value && node.addEventListener(e, value);\n } else if (prop.slice(0, 10) === \"oncapture:\") {\n const e = prop.slice(10);\n prev && node.removeEventListener(e, prev, true);\n value && node.addEventListener(e, value, true);\n } else if (prop.slice(0, 2) === \"on\") {\n const name = prop.slice(2).toLowerCase();\n const delegate = DelegatedEvents.has(name);\n if (!delegate && prev) {\n const h = Array.isArray(prev) ? prev[0] : prev;\n node.removeEventListener(name, h);\n }\n if (delegate || value) {\n addEventListener(node, name, value, delegate);\n delegate && delegateEvents([name]);\n }\n } else if (prop.slice(0, 5) === \"attr:\") {\n setAttribute(node, prop.slice(5), value);\n } else if (\n (forceProp = prop.slice(0, 5) === \"prop:\") ||\n (isChildProp = ChildProperties.has(prop)) ||\n (!isSVG &&\n ((propAlias = getPropAlias(prop, node.tagName)) || (isProp = Properties.has(prop)))) ||\n (isCE = node.nodeName.includes(\"-\"))\n ) {\n if (forceProp) {\n prop = prop.slice(5);\n isProp = true;\n } else if (!!sharedConfig.context && node.isConnected) return value;\n if (prop === \"class\" || prop === \"className\") className(node, value);\n else if (isCE && !isProp && !isChildProp) node[toPropertyName(prop)] = value;\n else node[propAlias || prop] = value;\n } else {\n const ns = isSVG && prop.indexOf(\":\") > -1 && SVGNamespace[prop.split(\":\")[0]];\n if (ns) setAttributeNS(node, ns, prop, value);\n else setAttribute(node, Aliases[prop] || prop, value);\n }\n return value;\n}\nfunction eventHandler(e) {\n const key = `$$${e.type}`;\n let node = (e.composedPath && e.composedPath()[0]) || e.target;\n if (e.target !== node) {\n Object.defineProperty(e, \"target\", {\n configurable: true,\n value: node\n });\n }\n Object.defineProperty(e, \"currentTarget\", {\n configurable: true,\n get() {\n return node || document;\n }\n });\n if (sharedConfig.registry && !sharedConfig.done) sharedConfig.done = _$HY.done = true;\n while (node) {\n const handler = node[key];\n if (handler && !node.disabled) {\n const data = node[`${key}Data`];\n data !== undefined ? handler.call(node, data, e) : handler.call(node, e);\n if (e.cancelBubble) return;\n }\n node = node._$host || node.parentNode || node.host;\n }\n}\nfunction insertExpression(parent, value, current, marker, unwrapArray) {\n const hydrating = !!sharedConfig.context && parent.isConnected;\n if (hydrating) {\n !current && (current = [...parent.childNodes]);\n let cleaned = [];\n for (let i = 0; i < current.length; i++) {\n const node = current[i];\n if (node.nodeType === 8 && node.data.slice(0, 2) === \"!$\") node.remove();\n else cleaned.push(node);\n }\n current = cleaned;\n }\n while (typeof current === \"function\") current = current();\n if (value === current) return current;\n const t = typeof value,\n multi = marker !== undefined;\n parent = (multi && current[0] && current[0].parentNode) || parent;\n if (t === \"string\" || t === \"number\") {\n if (hydrating) return current;\n if (t === \"number\") value = value.toString();\n if (multi) {\n let node = current[0];\n if (node && node.nodeType === 3) {\n node.data !== value && (node.data = value);\n } else node = document.createTextNode(value);\n current = cleanChildren(parent, current, marker, node);\n } else {\n if (current !== \"\" && typeof current === \"string\") {\n current = parent.firstChild.data = value;\n } else current = parent.textContent = value;\n }\n } else if (value == null || t === \"boolean\") {\n if (hydrating) return current;\n current = cleanChildren(parent, current, marker);\n } else if (t === \"function\") {\n createRenderEffect(() => {\n let v = value();\n while (typeof v === \"function\") v = v();\n current = insertExpression(parent, v, current, marker);\n });\n return () => current;\n } else if (Array.isArray(value)) {\n const array = [];\n const currentArray = current && Array.isArray(current);\n if (normalizeIncomingArray(array, value, current, unwrapArray)) {\n createRenderEffect(() => (current = insertExpression(parent, array, current, marker, true)));\n return () => current;\n }\n if (hydrating) {\n if (!array.length) return current;\n if (marker === undefined) return [...parent.childNodes];\n let node = array[0];\n let nodes = [node];\n while ((node = node.nextSibling) !== marker) nodes.push(node);\n return (current = nodes);\n }\n if (array.length === 0) {\n current = cleanChildren(parent, current, marker);\n if (multi) return current;\n } else if (currentArray) {\n if (current.length === 0) {\n appendNodes(parent, array, marker);\n } else reconcileArrays(parent, current, array);\n } else {\n current && cleanChildren(parent);\n appendNodes(parent, array);\n }\n current = array;\n } else if (value.nodeType) {\n if (hydrating && value.parentNode) return (current = multi ? [value] : value);\n if (Array.isArray(current)) {\n if (multi) return (current = cleanChildren(parent, current, marker, value));\n cleanChildren(parent, current, null, value);\n } else if (current == null || current === \"\" || !parent.firstChild) {\n parent.appendChild(value);\n } else parent.replaceChild(value, parent.firstChild);\n current = value;\n } else;\n return current;\n}\nfunction normalizeIncomingArray(normalized, array, current, unwrap) {\n let dynamic = false;\n for (let i = 0, len = array.length; i < len; i++) {\n let item = array[i],\n prev = current && current[normalized.length],\n t;\n if (item == null || item === true || item === false);\n else if ((t = typeof item) === \"object\" && item.nodeType) {\n normalized.push(item);\n } else if (Array.isArray(item)) {\n dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic;\n } else if (t === \"function\") {\n if (unwrap) {\n while (typeof item === \"function\") item = item();\n dynamic =\n normalizeIncomingArray(\n normalized,\n Array.isArray(item) ? item : [item],\n Array.isArray(prev) ? prev : [prev]\n ) || dynamic;\n } else {\n normalized.push(item);\n dynamic = true;\n }\n } else {\n const value = String(item);\n if (prev && prev.nodeType === 3 && prev.data === value) normalized.push(prev);\n else normalized.push(document.createTextNode(value));\n }\n }\n return dynamic;\n}\nfunction appendNodes(parent, array, marker = null) {\n for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker);\n}\nfunction cleanChildren(parent, current, marker, replacement) {\n if (marker === undefined) return (parent.textContent = \"\");\n const node = replacement || document.createTextNode(\"\");\n if (current.length) {\n let inserted = false;\n for (let i = current.length - 1; i >= 0; i--) {\n const el = current[i];\n if (node !== el) {\n const isParent = el.parentNode === parent;\n if (!inserted && !i)\n isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);\n else isParent && el.remove();\n } else inserted = true;\n }\n } else parent.insertBefore(node, marker);\n return [node];\n}\nfunction gatherHydratable(element, root) {\n const templates = element.querySelectorAll(`*[data-hk]`);\n for (let i = 0; i < templates.length; i++) {\n const node = templates[i];\n const key = node.getAttribute(\"data-hk\");\n if ((!root || key.startsWith(root)) && !sharedConfig.registry.has(key))\n sharedConfig.registry.set(key, node);\n }\n}\nfunction getHydrationKey() {\n const hydrate = sharedConfig.context;\n return `${hydrate.id}${hydrate.count++}`;\n}\nfunction NoHydration(props) {\n return sharedConfig.context ? undefined : props.children;\n}\nfunction Hydration(props) {\n return props.children;\n}\nconst voidFn = () => undefined;\nconst RequestContext = Symbol();\nfunction innerHTML(parent, content) {\n !sharedConfig.context && (parent.innerHTML = content);\n}\n\nfunction throwInBrowser(func) {\n const err = new Error(`${func.name} is not supported in the browser, returning undefined`);\n console.error(err);\n}\nfunction renderToString(fn, options) {\n throwInBrowser(renderToString);\n}\nfunction renderToStringAsync(fn, options) {\n throwInBrowser(renderToStringAsync);\n}\nfunction renderToStream(fn, options) {\n throwInBrowser(renderToStream);\n}\nfunction ssr(template, ...nodes) {}\nfunction ssrElement(name, props, children, needsId) {}\nfunction ssrClassList(value) {}\nfunction ssrStyle(value) {}\nfunction ssrAttribute(key, value) {}\nfunction ssrHydrationKey() {}\nfunction resolveSSRNode(node) {}\nfunction escape(html) {}\nfunction ssrSpread(props, isSVG, skipChildren) {}\n\nconst isServer = false;\nconst isDev = false;\nconst SVG_NAMESPACE = \"http://www.w3.org/2000/svg\";\nfunction createElement(tagName, isSVG = false) {\n return isSVG ? document.createElementNS(SVG_NAMESPACE, tagName) : document.createElement(tagName);\n}\nconst hydrate = (...args) => {\n enableHydration();\n return hydrate$1(...args);\n};\nfunction Portal(props) {\n const { useShadow } = props,\n marker = document.createTextNode(\"\"),\n mount = () => props.mount || document.body,\n owner = getOwner();\n let content;\n let hydrating = !!sharedConfig.context;\n createEffect(\n () => {\n if (hydrating) getOwner().user = hydrating = false;\n content || (content = runWithOwner(owner, () => createMemo(() => props.children)));\n const el = mount();\n if (el instanceof HTMLHeadElement) {\n const [clean, setClean] = createSignal(false);\n const cleanup = () => setClean(true);\n createRoot(dispose => insert(el, () => (!clean() ? content() : dispose()), null));\n onCleanup(cleanup);\n } else {\n const container = createElement(props.isSVG ? \"g\" : \"div\", props.isSVG),\n renderRoot =\n useShadow && container.attachShadow\n ? container.attachShadow({\n mode: \"open\"\n })\n : container;\n Object.defineProperty(container, \"_$host\", {\n get() {\n return marker.parentNode;\n },\n configurable: true\n });\n insert(renderRoot, content);\n el.appendChild(container);\n props.ref && props.ref(container);\n onCleanup(() => el.removeChild(container));\n }\n },\n undefined,\n {\n render: !hydrating\n }\n );\n return marker;\n}\nfunction Dynamic(props) {\n const [p, others] = splitProps(props, [\"component\"]);\n const cached = createMemo(() => p.component);\n return createMemo(() => {\n const component = cached();\n switch (typeof component) {\n case \"function\":\n return untrack(() => component(others));\n case \"string\":\n const isSvg = SVGElements.has(component);\n const el = sharedConfig.context ? getNextElement() : createElement(component, isSvg);\n spread(el, others, isSvg);\n return el;\n }\n });\n}\n\nexport {\n Aliases,\n voidFn as Assets,\n ChildProperties,\n DOMElements,\n DelegatedEvents,\n Dynamic,\n Hydration,\n voidFn as HydrationScript,\n NoHydration,\n Portal,\n Properties,\n RequestContext,\n SVGElements,\n SVGNamespace,\n addEventListener,\n assign,\n classList,\n className,\n clearDelegatedEvents,\n delegateEvents,\n dynamicProperty,\n escape,\n voidFn as generateHydrationScript,\n voidFn as getAssets,\n getHydrationKey,\n getNextElement,\n getNextMarker,\n getNextMatch,\n getPropAlias,\n voidFn as getRequestEvent,\n hydrate,\n innerHTML,\n insert,\n isDev,\n isServer,\n render,\n renderToStream,\n renderToString,\n renderToStringAsync,\n resolveSSRNode,\n runHydrationEvents,\n setAttribute,\n setAttributeNS,\n setProperty,\n spread,\n ssr,\n ssrAttribute,\n ssrClassList,\n ssrElement,\n ssrHydrationKey,\n ssrSpread,\n ssrStyle,\n style,\n template,\n use,\n voidFn as useAssets\n};\n","import { isServer } from \"solid-js/web\";\nexport function createBeforeLeave() {\n let listeners = new Set();\n function subscribe(listener) {\n listeners.add(listener);\n return () => listeners.delete(listener);\n }\n let ignore = false;\n function confirm(to, options) {\n if (ignore)\n return !(ignore = false);\n const e = {\n to,\n options,\n defaultPrevented: false,\n preventDefault: () => (e.defaultPrevented = true)\n };\n for (const l of listeners)\n l.listener({\n ...e,\n from: l.location,\n retry: (force) => {\n force && (ignore = true);\n l.navigate(to, { ...options, resolve: false });\n }\n });\n return !e.defaultPrevented;\n }\n return {\n subscribe,\n confirm\n };\n}\n// The following supports browser initiated blocking (eg back/forward)\nlet depth;\nexport function saveCurrentDepth() {\n if (!window.history.state || window.history.state._depth == null) {\n window.history.replaceState({ ...window.history.state, _depth: window.history.length - 1 }, \"\");\n }\n depth = window.history.state._depth;\n}\nif (!isServer) {\n saveCurrentDepth();\n}\nexport function keepDepth(state) {\n return {\n ...state,\n _depth: window.history.state && window.history.state._depth\n };\n}\nexport function notifyIfNotBlocked(notify, block) {\n let ignore = false;\n return () => {\n const prevDepth = depth;\n saveCurrentDepth();\n const delta = prevDepth == null ? null : depth - prevDepth;\n if (ignore) {\n ignore = false;\n return;\n }\n if (delta && block(delta)) {\n ignore = true;\n window.history.go(-delta);\n }\n else {\n notify();\n }\n };\n}\n","import { createMemo, getOwner, runWithOwner } from \"solid-js\";\nconst hasSchemeRegex = /^(?:[a-z0-9]+:)?\\/\\//i;\nconst trimPathRegex = /^\\/+|(\\/)\\/+$/g;\nexport const mockBase = \"http://sr\";\nexport function normalizePath(path, omitSlash = false) {\n const s = path.replace(trimPathRegex, \"$1\");\n return s ? (omitSlash || /^[?#]/.test(s) ? s : \"/\" + s) : \"\";\n}\nexport function resolvePath(base, path, from) {\n if (hasSchemeRegex.test(path)) {\n return undefined;\n }\n const basePath = normalizePath(base);\n const fromPath = from && normalizePath(from);\n let result = \"\";\n if (!fromPath || path.startsWith(\"/\")) {\n result = basePath;\n }\n else if (fromPath.toLowerCase().indexOf(basePath.toLowerCase()) !== 0) {\n result = basePath + fromPath;\n }\n else {\n result = fromPath;\n }\n return (result || \"/\") + normalizePath(path, !result);\n}\nexport function invariant(value, message) {\n if (value == null) {\n throw new Error(message);\n }\n return value;\n}\nexport function joinPaths(from, to) {\n return normalizePath(from).replace(/\\/*(\\*.*)?$/g, \"\") + normalizePath(to);\n}\nexport function extractSearchParams(url) {\n const params = {};\n url.searchParams.forEach((value, key) => {\n params[key] = value;\n });\n return params;\n}\nexport function createMatcher(path, partial, matchFilters) {\n const [pattern, splat] = path.split(\"/*\", 2);\n const segments = pattern.split(\"/\").filter(Boolean);\n const len = segments.length;\n return (location) => {\n const locSegments = location.split(\"/\").filter(Boolean);\n const lenDiff = locSegments.length - len;\n if (lenDiff < 0 || (lenDiff > 0 && splat === undefined && !partial)) {\n return null;\n }\n const match = {\n path: len ? \"\" : \"/\",\n params: {}\n };\n const matchFilter = (s) => matchFilters === undefined ? undefined : matchFilters[s];\n for (let i = 0; i < len; i++) {\n const segment = segments[i];\n const locSegment = locSegments[i];\n const dynamic = segment[0] === \":\";\n const key = dynamic ? segment.slice(1) : segment;\n if (dynamic && matchSegment(locSegment, matchFilter(key))) {\n match.params[key] = locSegment;\n }\n else if (dynamic || !matchSegment(locSegment, segment)) {\n return null;\n }\n match.path += `/${locSegment}`;\n }\n if (splat) {\n const remainder = lenDiff ? locSegments.slice(-lenDiff).join(\"/\") : \"\";\n if (matchSegment(remainder, matchFilter(splat))) {\n match.params[splat] = remainder;\n }\n else {\n return null;\n }\n }\n return match;\n };\n}\nfunction matchSegment(input, filter) {\n const isEqual = (s) => s.localeCompare(input, undefined, { sensitivity: \"base\" }) === 0;\n if (filter === undefined) {\n return true;\n }\n else if (typeof filter === \"string\") {\n return isEqual(filter);\n }\n else if (typeof filter === \"function\") {\n return filter(input);\n }\n else if (Array.isArray(filter)) {\n return filter.some(isEqual);\n }\n else if (filter instanceof RegExp) {\n return filter.test(input);\n }\n return false;\n}\nexport function scoreRoute(route) {\n const [pattern, splat] = route.pattern.split(\"/*\", 2);\n const segments = pattern.split(\"/\").filter(Boolean);\n return segments.reduce((score, segment) => score + (segment.startsWith(\":\") ? 2 : 3), segments.length - (splat === undefined ? 0 : 1));\n}\nexport function createMemoObject(fn) {\n const map = new Map();\n const owner = getOwner();\n return new Proxy({}, {\n get(_, property) {\n if (!map.has(property)) {\n runWithOwner(owner, () => map.set(property, createMemo(() => fn()[property])));\n }\n return map.get(property)();\n },\n getOwnPropertyDescriptor() {\n return {\n enumerable: true,\n configurable: true\n };\n },\n ownKeys() {\n return Reflect.ownKeys(fn());\n }\n });\n}\nexport function mergeSearchString(search, params) {\n const merged = new URLSearchParams(search);\n Object.entries(params).forEach(([key, value]) => {\n if (value == null || value === \"\") {\n merged.delete(key);\n }\n else {\n merged.set(key, String(value));\n }\n });\n const s = merged.toString();\n return s ? `?${s}` : \"\";\n}\nexport function expandOptionals(pattern) {\n let match = /(\\/?\\:[^\\/]+)\\?/.exec(pattern);\n if (!match)\n return [pattern];\n let prefix = pattern.slice(0, match.index);\n let suffix = pattern.slice(match.index + match[0].length);\n const prefixes = [prefix, (prefix += match[1])];\n // This section handles adjacent optional params. We don't actually want all permuations since\n // that will lead to equivalent routes which have the same number of params. For example\n // `/:a?/:b?/:c`? only has the unique expansion: `/`, `/:a`, `/:a/:b`, `/:a/:b/:c` and we can\n // discard `/:b`, `/:c`, `/:b/:c` by building them up in order and not recursing. This also helps\n // ensure predictability where earlier params have precidence.\n while ((match = /^(\\/\\:[^\\/]+)\\?/.exec(suffix))) {\n prefixes.push((prefix += match[1]));\n suffix = suffix.slice(match[0].length);\n }\n return expandOptionals(suffix).reduce((results, expansion) => [...results, ...prefixes.map(p => p + expansion)], []);\n}\n","import { runWithOwner } from \"solid-js\";\nimport { createComponent, createContext, createMemo, createRenderEffect, createSignal, on, onCleanup, untrack, useContext, startTransition, resetErrorBoundaries } from \"solid-js\";\nimport { isServer, getRequestEvent } from \"solid-js/web\";\nimport { createBeforeLeave } from \"./lifecycle.js\";\nimport { mockBase, createMemoObject, extractSearchParams, invariant, resolvePath, createMatcher, joinPaths, scoreRoute, mergeSearchString, expandOptionals } from \"./utils.js\";\nconst MAX_REDIRECTS = 100;\nexport const RouterContextObj = createContext();\nexport const RouteContextObj = createContext();\nexport const useRouter = () => invariant(useContext(RouterContextObj), \" and 'use' router primitives can be only used inside a Route.\");\nlet TempRoute;\nexport const useRoute = () => TempRoute || useContext(RouteContextObj) || useRouter().base;\nexport const useResolvedPath = (path) => {\n const route = useRoute();\n return createMemo(() => route.resolvePath(path()));\n};\nexport const useHref = (to) => {\n const router = useRouter();\n return createMemo(() => {\n const to_ = to();\n return to_ !== undefined ? router.renderPath(to_) : to_;\n });\n};\nexport const useNavigate = () => useRouter().navigatorFactory();\nexport const useLocation = () => useRouter().location;\nexport const useIsRouting = () => useRouter().isRouting;\nexport const useMatch = (path, matchFilters) => {\n const location = useLocation();\n const matchers = createMemo(() => expandOptionals(path()).map(path => createMatcher(path, undefined, matchFilters)));\n return createMemo(() => {\n for (const matcher of matchers()) {\n const match = matcher(location.pathname);\n if (match)\n return match;\n }\n });\n};\nexport const useParams = () => useRouter().params;\nexport const useSearchParams = () => {\n const location = useLocation();\n const navigate = useNavigate();\n const setSearchParams = (params, options) => {\n const searchString = untrack(() => location.pathname + mergeSearchString(location.search, params) + location.hash);\n navigate(searchString, {\n scroll: false,\n resolve: false,\n ...options\n });\n };\n return [location.query, setSearchParams];\n};\nexport const useBeforeLeave = (listener) => {\n const s = useRouter().beforeLeave.subscribe({\n listener,\n location: useLocation(),\n navigate: useNavigate()\n });\n onCleanup(s);\n};\nexport function createRoutes(routeDef, base = \"\") {\n const { component, load, children, info } = routeDef;\n const isLeaf = !children || (Array.isArray(children) && !children.length);\n const shared = {\n key: routeDef,\n component,\n load,\n info\n };\n return asArray(routeDef.path).reduce((acc, path) => {\n for (const originalPath of expandOptionals(path)) {\n const path = joinPaths(base, originalPath);\n let pattern = isLeaf ? path : path.split(\"/*\", 1)[0];\n pattern = pattern\n .split(\"/\")\n .map((s) => {\n return s.startsWith(\":\") || s.startsWith(\"*\") ? s : encodeURIComponent(s);\n })\n .join(\"/\");\n acc.push({\n ...shared,\n originalPath,\n pattern,\n matcher: createMatcher(pattern, !isLeaf, routeDef.matchFilters)\n });\n }\n return acc;\n }, []);\n}\nexport function createBranch(routes, index = 0) {\n return {\n routes,\n score: scoreRoute(routes[routes.length - 1]) * 10000 - index,\n matcher(location) {\n const matches = [];\n for (let i = routes.length - 1; i >= 0; i--) {\n const route = routes[i];\n const match = route.matcher(location);\n if (!match) {\n return null;\n }\n matches.unshift({\n ...match,\n route\n });\n }\n return matches;\n }\n };\n}\nfunction asArray(value) {\n return Array.isArray(value) ? value : [value];\n}\nexport function createBranches(routeDef, base = \"\", stack = [], branches = []) {\n const routeDefs = asArray(routeDef);\n for (let i = 0, len = routeDefs.length; i < len; i++) {\n const def = routeDefs[i];\n if (def && typeof def === \"object\") {\n if (!def.hasOwnProperty(\"path\"))\n def.path = \"\";\n const routes = createRoutes(def, base);\n for (const route of routes) {\n stack.push(route);\n const isEmptyArray = Array.isArray(def.children) && def.children.length === 0;\n if (def.children && !isEmptyArray) {\n createBranches(def.children, route.pattern, stack, branches);\n }\n else {\n const branch = createBranch([...stack], branches.length);\n branches.push(branch);\n }\n stack.pop();\n }\n }\n }\n // Stack will be empty on final return\n return stack.length ? branches : branches.sort((a, b) => b.score - a.score);\n}\nexport function getRouteMatches(branches, location) {\n for (let i = 0, len = branches.length; i < len; i++) {\n const match = branches[i].matcher(location);\n if (match) {\n return match;\n }\n }\n return [];\n}\nexport function createLocation(path, state) {\n const origin = new URL(mockBase);\n const url = createMemo(prev => {\n const path_ = path();\n try {\n return new URL(path_, origin);\n }\n catch (err) {\n console.error(`Invalid path ${path_}`);\n return prev;\n }\n }, origin, {\n equals: (a, b) => a.href === b.href\n });\n const pathname = createMemo(() => url().pathname);\n const search = createMemo(() => url().search, true);\n const hash = createMemo(() => url().hash);\n const key = () => \"\";\n return {\n get pathname() {\n return pathname();\n },\n get search() {\n return search();\n },\n get hash() {\n return hash();\n },\n get state() {\n return state();\n },\n get key() {\n return key();\n },\n query: createMemoObject(on(search, () => extractSearchParams(url())))\n };\n}\nlet intent;\nexport function getIntent() {\n return intent;\n}\nexport function createRouterContext(integration, branches, getContext, options = {}) {\n const { signal: [source, setSource], utils = {} } = integration;\n const parsePath = utils.parsePath || (p => p);\n const renderPath = utils.renderPath || (p => p);\n const beforeLeave = utils.beforeLeave || createBeforeLeave();\n const basePath = resolvePath(\"\", options.base || \"\");\n if (basePath === undefined) {\n throw new Error(`${basePath} is not a valid base path`);\n }\n else if (basePath && !source().value) {\n setSource({ value: basePath, replace: true, scroll: false });\n }\n const [isRouting, setIsRouting] = createSignal(false);\n const start = async (callback) => {\n setIsRouting(true);\n try {\n await startTransition(callback);\n }\n finally {\n setIsRouting(false);\n }\n };\n const [reference, setReference] = createSignal(source().value);\n const [state, setState] = createSignal(source().state);\n const location = createLocation(reference, state);\n const referrers = [];\n const submissions = createSignal(isServer ? initFromFlash() : []);\n const matches = createMemo(() => getRouteMatches(branches(), location.pathname));\n const params = createMemoObject(() => {\n const m = matches();\n const params = {};\n for (let i = 0; i < m.length; i++) {\n Object.assign(params, m[i].params);\n }\n return params;\n });\n const baseRoute = {\n pattern: basePath,\n path: () => basePath,\n outlet: () => null,\n resolvePath(to) {\n return resolvePath(basePath, to);\n }\n };\n createRenderEffect(() => {\n const { value, state } = source();\n // Untrack this whole block so `start` doesn't cause Solid's Listener to be preserved\n untrack(() => {\n if (value !== reference()) {\n start(() => {\n intent = \"native\";\n setReference(value);\n setState(state);\n resetErrorBoundaries();\n submissions[1]([]);\n }).then(() => {\n intent = undefined;\n });\n }\n });\n });\n return {\n base: baseRoute,\n location,\n params,\n isRouting,\n renderPath,\n parsePath,\n navigatorFactory,\n matches,\n beforeLeave,\n preloadRoute,\n singleFlight: options.singleFlight === undefined ? true : options.singleFlight,\n submissions\n };\n function navigateFromRoute(route, to, options) {\n // Untrack in case someone navigates in an effect - don't want to track `reference` or route paths\n untrack(() => {\n if (typeof to === \"number\") {\n if (!to) {\n // A delta of 0 means stay at the current location, so it is ignored\n }\n else if (utils.go) {\n utils.go(to);\n }\n else {\n console.warn(\"Router integration does not support relative routing\");\n }\n return;\n }\n const { replace, resolve, scroll, state: nextState } = {\n replace: false,\n resolve: true,\n scroll: true,\n ...options\n };\n const resolvedTo = resolve ? route.resolvePath(to) : resolvePath(\"\", to);\n if (resolvedTo === undefined) {\n throw new Error(`Path '${to}' is not a routable path`);\n }\n else if (referrers.length >= MAX_REDIRECTS) {\n throw new Error(\"Too many redirects\");\n }\n const current = reference();\n if (resolvedTo !== current || nextState !== state()) {\n if (isServer) {\n const e = getRequestEvent();\n e && (e.response = { status: 302, headers: new Headers({ Location: resolvedTo }) });\n setSource({ value: resolvedTo, replace, scroll, state: nextState });\n }\n else if (beforeLeave.confirm(resolvedTo, options)) {\n const len = referrers.push({ value: current, replace, scroll, state: state() });\n start(() => {\n intent = \"navigate\";\n setReference(resolvedTo);\n setState(nextState);\n resetErrorBoundaries();\n submissions[1]([]);\n }).then(() => {\n if (referrers.length === len) {\n intent = undefined;\n navigateEnd({\n value: resolvedTo,\n state: nextState\n });\n }\n });\n }\n }\n });\n }\n function navigatorFactory(route) {\n // Workaround for vite issue (https://github.com/vitejs/vite/issues/3803)\n route = route || useContext(RouteContextObj) || baseRoute;\n return (to, options) => navigateFromRoute(route, to, options);\n }\n function navigateEnd(next) {\n const first = referrers[0];\n if (first) {\n if (next.value !== first.value || next.state !== first.state) {\n setSource({\n ...next,\n replace: first.replace,\n scroll: first.scroll\n });\n }\n referrers.length = 0;\n }\n }\n function preloadRoute(url, preloadData) {\n const matches = getRouteMatches(branches(), url.pathname);\n const prevIntent = intent;\n intent = \"preload\";\n for (let match in matches) {\n const { route, params } = matches[match];\n route.component &&\n route.component.preload &&\n route.component.preload();\n const { load } = route;\n preloadData &&\n load &&\n runWithOwner(getContext(), () => load({\n params,\n location: {\n pathname: url.pathname,\n search: url.search,\n hash: url.hash,\n query: extractSearchParams(url),\n state: null,\n key: \"\"\n },\n intent: \"preload\"\n }));\n }\n intent = prevIntent;\n }\n function initFromFlash() {\n const e = getRequestEvent();\n return (e && e.router && e.router.submission\n ? [e.router.submission]\n : []);\n }\n}\nexport function createRouteContext(router, parent, outlet, match) {\n const { base, location, params } = router;\n const { pattern, component, load } = match().route;\n const path = createMemo(() => match().path);\n component &&\n component.preload &&\n component.preload();\n const data = load ? load({ params, location, intent: intent || \"initial\" }) : undefined;\n const route = {\n parent,\n pattern,\n path,\n outlet: () => component\n ? createComponent(component, {\n params,\n location,\n data,\n get children() {\n return outlet();\n }\n })\n : outlet(),\n resolvePath(to) {\n return resolvePath(base.path(), to, path());\n }\n };\n return route;\n}\n","/*@refresh skip*/\nimport { getRequestEvent, isServer } from \"solid-js/web\";\nimport { children, createMemo, createRoot, getOwner, mergeProps, on, Show, untrack } from \"solid-js\";\nimport { createBranches, createRouteContext, createRouterContext, getRouteMatches, RouteContextObj, RouterContextObj } from \"../routing.js\";\nexport const createRouterComponent = (router) => (props) => {\n const { base } = props;\n const routeDefs = children(() => props.children);\n const branches = createMemo(() => createBranches(routeDefs(), props.base || \"\"));\n let context;\n const routerState = createRouterContext(router, branches, () => context, {\n base,\n singleFlight: props.singleFlight\n });\n router.create && router.create(routerState);\n return (\n \n {(context = getOwner()) && null}\n \n \n );\n};\nfunction Root(props) {\n const location = props.routerState.location;\n const params = props.routerState.params;\n const data = createMemo(() => props.load && untrack(() => props.load({ params, location, intent: \"preload\" })));\n return (\n {Root => (\n {props.children}\n )}\n );\n}\nfunction Routes(props) {\n if (isServer) {\n const e = getRequestEvent();\n if (e && e.router && e.router.dataOnly) {\n dataOnly(e, props.routerState, props.branches);\n return;\n }\n e &&\n ((e.router || (e.router = {})).matches ||\n (e.router.matches = props.routerState.matches().map(({ route, path, params }) => ({\n path: route.originalPath,\n pattern: route.pattern,\n match: path,\n params,\n info: route.info\n }))));\n }\n const disposers = [];\n let root;\n const routeStates = createMemo(on(props.routerState.matches, (nextMatches, prevMatches, prev) => {\n let equal = prevMatches && nextMatches.length === prevMatches.length;\n const next = [];\n for (let i = 0, len = nextMatches.length; i < len; i++) {\n const prevMatch = prevMatches && prevMatches[i];\n const nextMatch = nextMatches[i];\n if (prev && prevMatch && nextMatch.route.key === prevMatch.route.key) {\n next[i] = prev[i];\n }\n else {\n equal = false;\n if (disposers[i]) {\n disposers[i]();\n }\n createRoot(dispose => {\n disposers[i] = dispose;\n next[i] = createRouteContext(props.routerState, next[i - 1] || props.routerState.base, createOutlet(() => routeStates()[i + 1]), () => props.routerState.matches()[i]);\n });\n }\n }\n disposers.splice(nextMatches.length).forEach(dispose => dispose());\n if (prev && equal) {\n return prev;\n }\n root = next[0];\n return next;\n }));\n return createOutlet(() => routeStates() && root)();\n}\nconst createOutlet = (child) => {\n return () => (\n {child => {child.outlet()}}\n );\n};\nexport const Route = (props) => {\n const childRoutes = children(() => props.children);\n return mergeProps(props, {\n get children() {\n return childRoutes();\n }\n });\n};\n// for data only mode with single flight mutations\nfunction dataOnly(event, routerState, branches) {\n const url = new URL(event.request.url);\n const prevMatches = getRouteMatches(branches, new URL(event.router.previousUrl || event.request.url).pathname);\n const matches = getRouteMatches(branches, url.pathname);\n for (let match = 0; match < matches.length; match++) {\n if (!prevMatches[match] || matches[match].route !== prevMatches[match].route)\n event.router.dataOnly = true;\n const { route, params } = matches[match];\n route.load &&\n route.load({\n params,\n location: routerState.location,\n intent: \"preload\"\n });\n }\n}\n","import { createSignal, onCleanup } from \"solid-js\";\nimport { createRouterComponent } from \"./components.jsx\";\nfunction intercept([value, setValue], get, set) {\n return [get ? () => get(value()) : value, set ? (v) => setValue(set(v)) : setValue];\n}\nfunction querySelector(selector) {\n if (selector === \"#\") {\n return null;\n }\n // Guard against selector being an invalid CSS selector\n try {\n return document.querySelector(selector);\n }\n catch (e) {\n return null;\n }\n}\nexport function createRouter(config) {\n let ignore = false;\n const wrap = (value) => (typeof value === \"string\" ? { value } : value);\n const signal = intercept(createSignal(wrap(config.get()), { equals: (a, b) => a.value === b.value }), undefined, next => {\n !ignore && config.set(next);\n return next;\n });\n config.init &&\n onCleanup(config.init((value = config.get()) => {\n ignore = true;\n signal[1](wrap(value));\n ignore = false;\n }));\n return createRouterComponent({\n signal,\n create: config.create,\n utils: config.utils\n });\n}\nexport function bindEvent(target, type, handler) {\n target.addEventListener(type, handler);\n return () => target.removeEventListener(type, handler);\n}\nexport function scrollToHash(hash, fallbackTop) {\n const el = querySelector(`#${hash}`);\n if (el) {\n el.scrollIntoView();\n }\n else if (fallbackTop) {\n window.scrollTo(0, 0);\n }\n}\n","import { $TRACK, createMemo, createSignal, onCleanup, getOwner } from \"solid-js\";\nimport { isServer } from \"solid-js/web\";\nimport { useRouter } from \"../routing.js\";\nimport { mockBase } from \"../utils.js\";\nimport { cacheKeyOp, hashKey, revalidate, cache } from \"./cache.js\";\nexport const actions = /* #__PURE__ */ new Map();\nexport function useSubmissions(fn, filter) {\n const router = useRouter();\n const subs = createMemo(() => router.submissions[0]().filter(s => s.url === fn.toString() && (!filter || filter(s.input))));\n return new Proxy([], {\n get(_, property) {\n if (property === $TRACK)\n return subs();\n if (property === \"pending\")\n return subs().some(sub => !sub.result);\n return subs()[property];\n }\n });\n}\nexport function useSubmission(fn, filter) {\n const submissions = useSubmissions(fn, filter);\n return new Proxy({}, {\n get(_, property) {\n return submissions[submissions.length - 1]?.[property];\n }\n });\n}\nexport function useAction(action) {\n const r = useRouter();\n return (...args) => action.apply({ r }, args);\n}\nexport function action(fn, name) {\n function mutate(...variables) {\n const router = this.r;\n const form = this.f;\n const p = (router.singleFlight && fn.withOptions\n ? fn.withOptions({ headers: { \"X-Single-Flight\": \"true\" } })\n : fn)(...variables);\n const [result, setResult] = createSignal();\n let submission;\n function handler(error) {\n return async (res) => {\n const result = await handleResponse(res, error, router.navigatorFactory());\n if (!result)\n return submission.clear();\n setResult(result);\n if (result.error && !form)\n throw result.error;\n return result.data;\n };\n }\n router.submissions[1](s => [\n ...s,\n (submission = {\n input: variables,\n url,\n get result() {\n return result()?.data;\n },\n get error() {\n return result()?.error;\n },\n get pending() {\n return !result();\n },\n clear() {\n router.submissions[1](v => v.filter(i => i.input !== variables));\n },\n retry() {\n setResult(undefined);\n const p = fn(...variables);\n return p.then(handler(), handler(true));\n }\n })\n ]);\n return p.then(handler(), handler(true));\n }\n const url = fn.url ||\n (name && `https://action/${name}`) ||\n (!isServer ? `https://action/${hashString(fn.toString())}` : \"\");\n return toAction(mutate, url);\n}\nfunction toAction(fn, url) {\n fn.toString = () => {\n if (!url)\n throw new Error(\"Client Actions need explicit names if server rendered\");\n return url;\n };\n fn.with = function (...args) {\n const newFn = function (...passedArgs) {\n return fn.call(this, ...args, ...passedArgs);\n };\n const uri = new URL(url, mockBase);\n uri.searchParams.set(\"args\", hashKey(args));\n return toAction(newFn, (uri.origin === \"https://action\" ? uri.origin : \"\") + uri.pathname + uri.search);\n };\n fn.url = url;\n if (!isServer) {\n actions.set(url, fn);\n getOwner() && onCleanup(() => actions.delete(url));\n }\n return fn;\n}\nconst hashString = (s) => s.split(\"\").reduce((a, b) => ((a << 5) - a + b.charCodeAt(0)) | 0, 0);\nasync function handleResponse(response, error, navigate) {\n let data;\n let keys;\n let invalidateKeys;\n if (response instanceof Response) {\n if (response.headers.has(\"X-Revalidate\"))\n keys = invalidateKeys = response.headers.get(\"X-Revalidate\").split(\",\");\n if (response.customBody) {\n data = await response.customBody();\n if (response.headers.has(\"X-Single-Flight\")) {\n keys || (keys = []);\n invalidateKeys || (invalidateKeys = []);\n Object.keys(data).forEach(key => {\n if (key === \"_$value\")\n return;\n keys.push(key);\n cache.set(key, data[key]);\n });\n data = data._$value;\n }\n }\n if (response.headers.has(\"Location\")) {\n const locationUrl = response.headers.get(\"Location\") || \"/\";\n if (locationUrl.startsWith(\"http\")) {\n window.location.href = locationUrl;\n }\n else {\n navigate(locationUrl);\n }\n }\n }\n else if (error)\n return { error: response };\n else\n data = response;\n // invalidate\n cacheKeyOp(invalidateKeys, entry => (entry[0] = 0));\n // trigger revalidation\n await revalidate(keys, false);\n return data != null ? { data } : undefined;\n}\n","import { delegateEvents } from \"solid-js/web\";\nimport { onCleanup } from \"solid-js\";\nimport { actions } from \"./action.js\";\nimport { mockBase } from \"../utils.js\";\nexport function setupNativeEvents(preload = true, explicitLinks = false, actionBase = \"/_server\") {\n return (router) => {\n const basePath = router.base.path();\n const navigateFromRoute = router.navigatorFactory(router.base);\n let preloadTimeout = {};\n function isSvg(el) {\n return el.namespaceURI === \"http://www.w3.org/2000/svg\";\n }\n function handleAnchor(evt) {\n if (evt.defaultPrevented ||\n evt.button !== 0 ||\n evt.metaKey ||\n evt.altKey ||\n evt.ctrlKey ||\n evt.shiftKey)\n return;\n const a = evt\n .composedPath()\n .find(el => el instanceof Node && el.nodeName.toUpperCase() === \"A\");\n if (!a || (explicitLinks && !a.hasAttribute(\"link\")))\n return;\n const svg = isSvg(a);\n const href = svg ? a.href.baseVal : a.href;\n const target = svg ? a.target.baseVal : a.target;\n if (target || (!href && !a.hasAttribute(\"state\")))\n return;\n const rel = (a.getAttribute(\"rel\") || \"\").split(/\\s+/);\n if (a.hasAttribute(\"download\") || (rel && rel.includes(\"external\")))\n return;\n const url = svg ? new URL(href, document.baseURI) : new URL(href);\n if (url.origin !== window.location.origin ||\n (basePath && url.pathname && !url.pathname.toLowerCase().startsWith(basePath.toLowerCase())))\n return;\n return [a, url];\n }\n function handleAnchorClick(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n const to = router.parsePath(url.pathname + url.search + url.hash);\n const state = a.getAttribute(\"state\");\n evt.preventDefault();\n navigateFromRoute(to, {\n resolve: false,\n replace: a.hasAttribute(\"replace\"),\n scroll: !a.hasAttribute(\"noscroll\"),\n state: state && JSON.parse(state)\n });\n }\n function handleAnchorPreload(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n if (!preloadTimeout[url.pathname])\n router.preloadRoute(url, a.getAttribute(\"preload\") !== \"false\");\n }\n function handleAnchorIn(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n if (preloadTimeout[url.pathname])\n return;\n preloadTimeout[url.pathname] = setTimeout(() => {\n router.preloadRoute(url, a.getAttribute(\"preload\") !== \"false\");\n delete preloadTimeout[url.pathname];\n }, 200);\n }\n function handleAnchorOut(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [, url] = res;\n if (preloadTimeout[url.pathname]) {\n clearTimeout(preloadTimeout[url.pathname]);\n delete preloadTimeout[url.pathname];\n }\n }\n function handleFormSubmit(evt) {\n let actionRef = evt.submitter && evt.submitter.hasAttribute(\"formaction\")\n ? evt.submitter.getAttribute(\"formaction\")\n : evt.target.getAttribute(\"action\");\n if (!actionRef)\n return;\n if (!actionRef.startsWith(\"https://action/\")) {\n // normalize server actions\n const url = new URL(actionRef, mockBase);\n actionRef = router.parsePath(url.pathname + url.search);\n if (!actionRef.startsWith(actionBase))\n return;\n }\n if (evt.target.method.toUpperCase() !== \"POST\")\n throw new Error(\"Only POST forms are supported for Actions\");\n const handler = actions.get(actionRef);\n if (handler) {\n evt.preventDefault();\n const data = new FormData(evt.target);\n if (evt.submitter && evt.submitter.name)\n data.append(evt.submitter.name, evt.submitter.value);\n handler.call({ r: router, f: evt.target }, data);\n }\n }\n // ensure delegated event run first\n delegateEvents([\"click\", \"submit\"]);\n document.addEventListener(\"click\", handleAnchorClick);\n if (preload) {\n document.addEventListener(\"mouseover\", handleAnchorIn);\n document.addEventListener(\"mouseout\", handleAnchorOut);\n document.addEventListener(\"focusin\", handleAnchorPreload);\n document.addEventListener(\"touchstart\", handleAnchorPreload);\n }\n document.addEventListener(\"submit\", handleFormSubmit);\n onCleanup(() => {\n document.removeEventListener(\"click\", handleAnchorClick);\n if (preload) {\n document.removeEventListener(\"mouseover\", handleAnchorIn);\n document.removeEventListener(\"mouseout\", handleAnchorOut);\n document.removeEventListener(\"focusin\", handleAnchorPreload);\n document.removeEventListener(\"touchstart\", handleAnchorPreload);\n }\n document.removeEventListener(\"submit\", handleFormSubmit);\n });\n };\n}\n","import { setupNativeEvents } from \"../data/events.js\";\nimport { createRouter, scrollToHash, bindEvent } from \"./createRouter.js\";\nimport { createBeforeLeave, keepDepth, notifyIfNotBlocked, saveCurrentDepth } from \"../lifecycle.js\";\nexport function hashParser(str) {\n const to = str.replace(/^.*?#/, \"\");\n // Hash-only hrefs like `#foo` from plain anchors will come in as `/#foo` whereas a link to\n // `/foo` will be `/#/foo`. Check if the to starts with a `/` and if not append it as a hash\n // to the current path so we can handle these in-page anchors correctly.\n if (!to.startsWith(\"/\")) {\n const [, path = \"/\"] = window.location.hash.split(\"#\", 2);\n return `${path}#${to}`;\n }\n return to;\n}\nexport function HashRouter(props) {\n const getSource = () => window.location.hash.slice(1);\n const beforeLeave = createBeforeLeave();\n return createRouter({\n get: getSource,\n set({ value, replace, scroll, state }) {\n if (replace) {\n window.history.replaceState(keepDepth(state), \"\", \"#\" + value);\n }\n else {\n window.location.hash = value;\n }\n const hashIndex = value.indexOf(\"#\");\n const hash = hashIndex >= 0 ? value.slice(hashIndex + 1) : \"\";\n scrollToHash(hash, scroll);\n saveCurrentDepth();\n },\n init: notify => bindEvent(window, \"hashchange\", notifyIfNotBlocked(notify, delta => !beforeLeave.confirm(delta && delta < 0 ? delta : getSource()))),\n create: setupNativeEvents(props.preload, props.explicitLinks, props.actionBase),\n utils: {\n go: delta => window.history.go(delta),\n renderPath: path => `#${path}`,\n parsePath: hashParser,\n beforeLeave\n }\n })(props);\n}\n","import { DEV, equalFn, untrack, getOwner, onCleanup, createSignal, sharedConfig, onMount } from 'solid-js';\nimport { isServer } from 'solid-js/web';\nexport { isServer } from 'solid-js/web';\n\n// src/index.ts\nvar isClient = !isServer;\nvar isDev = isClient && !!DEV;\nvar isProd = !isDev;\nvar noop = () => void 0;\nvar trueFn = () => true;\nvar falseFn = () => false;\nvar defaultEquals = equalFn;\nvar EQUALS_FALSE_OPTIONS = { equals: false };\nvar INTERNAL_OPTIONS = { internal: true };\nvar ofClass = (v, c) => v instanceof c || v && v.constructor === c;\nfunction isObject(value) {\n return value !== null && (typeof value === \"object\" || typeof value === \"function\");\n}\nvar isNonNullable = (i) => i != null;\nvar filterNonNullable = (arr) => arr.filter(isNonNullable);\nvar compare = (a, b) => a < b ? -1 : a > b ? 1 : 0;\nvar arrayEquals = (a, b) => a === b || a.length === b.length && a.every((e, i) => e === b[i]);\nfunction chain(callbacks) {\n return (...args) => {\n for (const callback of callbacks)\n callback && callback(...args);\n };\n}\nfunction reverseChain(callbacks) {\n return (...args) => {\n for (let i = callbacks.length - 1; i >= 0; i--) {\n const callback = callbacks[i];\n callback && callback(...args);\n }\n };\n}\nvar clamp = (n, min, max) => Math.min(Math.max(n, min), max);\nvar access = (v) => typeof v === \"function\" && !v.length ? v() : v;\nvar asArray = (value) => Array.isArray(value) ? value : value ? [value] : [];\nvar accessArray = (list) => list.map((v) => access(v));\nvar withAccess = (value, fn) => {\n const _value = access(value);\n typeof _value != null && fn(_value);\n};\nvar asAccessor = (v) => typeof v === \"function\" ? v : () => v;\nfunction accessWith(valueOrFn, ...args) {\n return typeof valueOrFn === \"function\" ? valueOrFn(...args) : valueOrFn;\n}\nfunction defer(deps, fn, initialValue) {\n const isArray = Array.isArray(deps);\n let prevInput;\n let shouldDefer = true;\n return (prevValue) => {\n let input;\n if (isArray) {\n input = Array(deps.length);\n for (let i = 0; i < deps.length; i++)\n input[i] = deps[i]();\n } else\n input = deps();\n if (shouldDefer) {\n shouldDefer = false;\n prevInput = input;\n return initialValue;\n }\n const result = untrack(() => fn(input, prevInput, prevValue));\n prevInput = input;\n return result;\n };\n}\nvar entries = Object.entries;\nvar keys = Object.keys;\nvar tryOnCleanup = isDev ? (fn) => getOwner() ? onCleanup(fn) : fn : onCleanup;\nvar createCallbackStack = () => {\n let stack = [];\n const clear = () => stack = [];\n return {\n push: (...callbacks) => stack.push(...callbacks),\n execute(arg0, arg1, arg2, arg3) {\n stack.forEach((cb) => cb(arg0, arg1, arg2, arg3));\n clear();\n },\n clear\n };\n};\nfunction createMicrotask(fn) {\n let calls = 0;\n let args;\n onCleanup(() => calls = 0);\n return (...a) => {\n args = a, calls++;\n queueMicrotask(() => --calls === 0 && fn(...args));\n };\n}\nfunction createHydratableSignal(serverValue, update, options) {\n if (isServer) {\n return createSignal(serverValue, options);\n }\n if (sharedConfig.context) {\n const [state, setState] = createSignal(serverValue, options);\n onMount(() => setState(() => update()));\n return [state, setState];\n }\n return createSignal(update(), options);\n}\nvar createHydrateSignal = createHydratableSignal;\nfunction handleDiffArray(current, prev, handleAdded, handleRemoved) {\n const currLength = current.length;\n const prevLength = prev.length;\n let i = 0;\n if (!prevLength) {\n for (; i < currLength; i++)\n handleAdded(current[i]);\n return;\n }\n if (!currLength) {\n for (; i < prevLength; i++)\n handleRemoved(prev[i]);\n return;\n }\n for (; i < prevLength; i++) {\n if (prev[i] !== current[i])\n break;\n }\n let prevEl;\n let currEl;\n prev = prev.slice(i);\n current = current.slice(i);\n for (prevEl of prev) {\n if (!current.includes(prevEl))\n handleRemoved(prevEl);\n }\n for (currEl of current) {\n if (!prev.includes(currEl))\n handleAdded(currEl);\n }\n}\n\nexport { EQUALS_FALSE_OPTIONS, INTERNAL_OPTIONS, access, accessArray, accessWith, arrayEquals, asAccessor, asArray, chain, clamp, compare, createCallbackStack, createHydratableSignal, createHydrateSignal, createMicrotask, defaultEquals, defer, entries, falseFn, filterNonNullable, handleDiffArray, isClient, isDev, isNonNullable, isObject, isProd, keys, noop, ofClass, reverseChain, trueFn, tryOnCleanup, withAccess };\n","import { getOwner, createRoot, runWithOwner, onCleanup, sharedConfig, createSignal, batch } from 'solid-js';\nimport { isServer } from 'solid-js/web';\nimport { asArray, access, trueFn, noop, createMicrotask } from '@solid-primitives/utils';\n\n// src/index.ts\nfunction createSubRoot(fn, ...owners) {\n if (owners.length === 0)\n owners = [getOwner()];\n return createRoot((dispose) => {\n asArray(access(owners)).forEach(\n (owner) => owner && runWithOwner(owner, onCleanup.bind(void 0, dispose))\n );\n return fn(dispose);\n }, owners[0]);\n}\nvar createBranch = createSubRoot;\nvar createCallback = (callback, owner = getOwner()) => owner ? (...args) => runWithOwner(owner, () => callback(...args)) : callback;\nfunction createDisposable(fn, ...owners) {\n return createSubRoot(\n (dispose) => {\n fn(dispose);\n return dispose;\n },\n ...owners\n );\n}\nfunction createSingletonRoot(factory, detachedOwner = getOwner()) {\n let listeners = 0, value, disposeRoot;\n return () => {\n listeners++;\n onCleanup(() => {\n listeners--;\n queueMicrotask(() => {\n if (!listeners && disposeRoot) {\n disposeRoot();\n disposeRoot = value = void 0;\n }\n });\n });\n if (!disposeRoot) {\n createRoot((dispose) => value = factory(disposeRoot = dispose), detachedOwner);\n }\n return value;\n };\n}\nvar createSharedRoot = createSingletonRoot;\nfunction createHydratableSingletonRoot(factory) {\n const owner = getOwner();\n const singleton = createSingletonRoot(factory, owner);\n return () => isServer || sharedConfig.context ? createRoot(factory, owner) : singleton();\n}\nfunction createRootPool(factory, options = {}) {\n if (isServer) {\n const owner2 = getOwner();\n return (args) => createRoot((dispose) => factory(() => args, trueFn, dispose), owner2);\n }\n let length = 0;\n const { limit = 100 } = options, pool = new Array(limit), owner = getOwner(), mapRoot = factory.length > 1 ? (dispose, [args, set]) => {\n const [active, setA] = createSignal(true);\n const root = {\n dispose,\n set,\n setA,\n active,\n v: factory(args, active, () => disposeRoot(root))\n };\n return root;\n } : (dispose, [args, set]) => ({\n dispose,\n set,\n setA: trueFn,\n active: trueFn,\n v: factory(args, trueFn, noop)\n }), limitPool = createMicrotask(() => {\n if (length > limit) {\n for (let i = limit; i < length; i++) {\n pool[i].dispose();\n pool[i] = void 0;\n }\n length = limit;\n }\n }), cleanupRoot = (root) => {\n if (root.dispose !== noop) {\n pool[length++] = root;\n root.setA(false);\n limitPool();\n }\n }, disposeRoot = (root) => {\n root.dispose();\n root.dispose = noop;\n if (root.active())\n root.setA(false);\n else {\n pool[pool.indexOf(root)] = pool[--length];\n pool[length] = void 0;\n }\n };\n onCleanup(() => {\n for (let i = 0; i < length; i++)\n pool[i].dispose();\n length = 0;\n });\n return (arg) => {\n let root;\n if (length) {\n root = pool[--length];\n pool[length] = void 0;\n batch(() => {\n root.set(() => arg);\n root.setA(true);\n });\n } else\n root = createRoot((dispose) => mapRoot(dispose, createSignal(arg)), owner);\n onCleanup(() => cleanupRoot(root));\n return root.v;\n };\n}\n\nexport { createBranch, createCallback, createDisposable, createHydratableSingletonRoot, createRootPool, createSharedRoot, createSingletonRoot, createSubRoot };\n","import { makeEventListener } from '@solid-primitives/event-listener';\nimport { createSingletonRoot } from '@solid-primitives/rootless';\nimport { arrayEquals } from '@solid-primitives/utils';\nimport { createSignal, untrack, createMemo, createEffect, on } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/index.ts\nfunction equalsKeyHoldSequence(sequence, model) {\n for (let i = sequence.length - 1; i >= 0; i--) {\n const _model = model.slice(0, i + 1);\n if (!arrayEquals(sequence[i], _model))\n return false;\n }\n return true;\n}\nvar useKeyDownEvent = /* @__PURE__ */ createSingletonRoot(\n () => {\n if (isServer) {\n return () => null;\n }\n const [event, setEvent] = createSignal(null);\n makeEventListener(window, \"keydown\", (e) => {\n setEvent(e);\n setTimeout(() => setEvent(null));\n });\n return event;\n }\n);\nvar useKeyDownList = /* @__PURE__ */ createSingletonRoot(() => {\n if (isServer) {\n const keys = () => [];\n keys[0] = keys;\n keys[1] = { event: () => null };\n keys[Symbol.iterator] = function* () {\n yield keys[0];\n yield keys[1];\n };\n return keys;\n }\n const [pressedKeys, setPressedKeys] = createSignal([]), reset = () => setPressedKeys([]), event = useKeyDownEvent();\n makeEventListener(window, \"keydown\", (e) => {\n if (e.repeat || typeof e.key !== \"string\")\n return;\n const key = e.key.toUpperCase(), currentKeys = pressedKeys();\n if (currentKeys.includes(key))\n return;\n const keys = [...currentKeys, key];\n if (currentKeys.length === 0 && key !== \"ALT\" && key !== \"CONTROL\" && key !== \"META\" && key !== \"SHIFT\") {\n if (e.shiftKey)\n keys.unshift(\"SHIFT\");\n if (e.altKey)\n keys.unshift(\"ALT\");\n if (e.ctrlKey)\n keys.unshift(\"CONTROL\");\n if (e.metaKey)\n keys.unshift(\"META\");\n }\n setPressedKeys(keys);\n });\n makeEventListener(window, \"keyup\", (e) => {\n if (typeof e.key !== \"string\")\n return;\n const key = e.key.toUpperCase();\n setPressedKeys((prev) => prev.filter((_key) => _key !== key));\n });\n makeEventListener(window, \"blur\", reset);\n makeEventListener(window, \"contextmenu\", (e) => {\n e.defaultPrevented || reset();\n });\n pressedKeys[0] = pressedKeys;\n pressedKeys[1] = { event };\n pressedKeys[Symbol.iterator] = function* () {\n yield pressedKeys[0];\n yield pressedKeys[1];\n };\n return pressedKeys;\n});\nvar useCurrentlyHeldKey = /* @__PURE__ */ createSingletonRoot(\n () => {\n if (isServer) {\n return () => null;\n }\n const keys = useKeyDownList();\n let prevKeys = untrack(keys);\n return createMemo(() => {\n const _keys = keys();\n const prev = prevKeys;\n prevKeys = _keys;\n if (prev.length === 0 && _keys.length === 1)\n return _keys[0];\n return null;\n });\n }\n);\nvar useKeyDownSequence = /* @__PURE__ */ createSingletonRoot(() => {\n if (isServer) {\n return () => [];\n }\n const keys = useKeyDownList();\n return createMemo((prev) => {\n if (keys().length === 0)\n return [];\n return [...prev, keys()];\n }, []);\n});\nfunction createKeyHold(key, options = {}) {\n if (isServer) {\n return () => false;\n }\n key = key.toUpperCase();\n const { preventDefault = true } = options, event = useKeyDownEvent(), heldKey = useCurrentlyHeldKey();\n return createMemo(() => heldKey() === key && (preventDefault && event()?.preventDefault(), true));\n}\nfunction createShortcut(keys, callback, options = {}) {\n if (isServer || !keys.length) {\n return;\n }\n keys = keys.map((key) => key.toUpperCase());\n const { preventDefault = true } = options, event = useKeyDownEvent(), sequence = useKeyDownSequence();\n let reset = false;\n const handleSequenceWithReset = (sequence2) => {\n if (!sequence2.length)\n return reset = false;\n if (reset)\n return;\n const e = event();\n if (sequence2.length < keys.length) {\n if (equalsKeyHoldSequence(sequence2, keys.slice(0, sequence2.length))) {\n preventDefault && e && e.preventDefault();\n } else {\n reset = true;\n }\n } else {\n reset = true;\n if (equalsKeyHoldSequence(sequence2, keys)) {\n preventDefault && e && e.preventDefault();\n callback(e);\n }\n }\n };\n const handleSequenceWithoutReset = (sequence2) => {\n const last = sequence2.at(-1);\n if (!last)\n return;\n const e = event();\n if (preventDefault && last.length < keys.length) {\n if (arrayEquals(last, keys.slice(0, keys.length - 1))) {\n e && e.preventDefault();\n }\n return;\n }\n if (arrayEquals(last, keys)) {\n const prev = sequence2.at(-2);\n if (!prev || arrayEquals(prev, keys.slice(0, keys.length - 1))) {\n preventDefault && e && e.preventDefault();\n callback(e);\n }\n }\n };\n createEffect(\n on(sequence, options.requireReset ? handleSequenceWithReset : handleSequenceWithoutReset)\n );\n}\n\nexport { createKeyHold, createShortcut, useCurrentlyHeldKey, useKeyDownEvent, useKeyDownList, useKeyDownSequence };\n","import { tryOnCleanup, entries, createCallbackStack, asArray, access, keys } from '@solid-primitives/utils';\nimport { createEffect, createRenderEffect, createSignal, onCleanup } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/eventListener.ts\nfunction makeEventListener(target, type, handler, options) {\n target.addEventListener(type, handler, options);\n return tryOnCleanup(target.removeEventListener.bind(target, type, handler, options));\n}\nfunction createEventListener(targets, type, handler, options) {\n if (isServer)\n return;\n const attachListeners = () => {\n asArray(access(targets)).forEach((el) => {\n if (el)\n asArray(access(type)).forEach((type2) => makeEventListener(el, type2, handler, options));\n });\n };\n if (typeof targets === \"function\")\n createEffect(attachListeners);\n else\n createRenderEffect(attachListeners);\n}\nfunction createEventSignal(target, type, options) {\n if (isServer) {\n return () => void 0;\n }\n const [lastEvent, setLastEvent] = createSignal();\n createEventListener(target, type, setLastEvent, options);\n return lastEvent;\n}\nvar eventListener = (target, props) => {\n createEffect(() => {\n const [type, handler, options] = props();\n makeEventListener(target, type, handler, options);\n });\n};\nfunction createEventListenerMap(targets, handlersMap, options) {\n if (isServer) {\n return;\n }\n for (const [eventName, handler] of entries(handlersMap)) {\n if (handler)\n createEventListener(targets, eventName, handler, options);\n }\n}\nvar attachPropListeners = (target, props) => {\n keys(props).forEach((attr) => {\n if (attr.startsWith(\"on\") && typeof props[attr] === \"function\")\n makeEventListener(target, attr.substring(2).toLowerCase(), props[attr]);\n });\n};\nvar WindowEventListener = (props) => {\n if (isServer)\n return null;\n attachPropListeners(window, props);\n};\nvar DocumentEventListener = (props) => {\n if (isServer)\n return null;\n attachPropListeners(document, props);\n};\nfunction makeEventListenerStack(target, options) {\n if (isServer) {\n return [() => () => void 0, () => void 0];\n }\n const { push, execute } = createCallbackStack();\n return [\n (type, handler, overwriteOptions) => {\n const clear = makeEventListener(target, type, handler, overwriteOptions ?? options);\n push(clear);\n return clear;\n },\n onCleanup(execute)\n ];\n}\n\n// src/callbackWrappers.ts\nvar preventDefault = (callback) => (e) => {\n e.preventDefault();\n callback(e);\n};\nvar stopPropagation = (callback) => (e) => {\n e.stopPropagation();\n callback(e);\n};\nvar stopImmediatePropagation = (callback) => (e) => {\n e.stopImmediatePropagation();\n callback(e);\n};\n\nexport { DocumentEventListener, WindowEventListener, createEventListener, createEventListenerMap, createEventSignal, eventListener, makeEventListener, makeEventListenerStack, preventDefault, stopImmediatePropagation, stopPropagation };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nexport function isFunc(item) {\n return typeof item === 'function';\n}\nexport function isObject(item) {\n return typeof item === 'object';\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function isArray(item) {\n return Array.isArray(item);\n}\nexport function isString(item) {\n return typeof item === 'string';\n}\nexport function isNumber(item) {\n return typeof item === 'number';\n}\nexport function isInteger(item) {\n return Number.isInteger(item);\n}\nexport function keyExists(obj, keys) {\n for (const key of keys) {\n if (key in obj) {\n return true;\n }\n }\n return false;\n}\n/**\n * Asserts a condition is truthy, otherwise throws an error\n *\n * @remarks\n * Useful at the top of functions to ensure certain conditions, arguments and\n * properties are set/met before continuing. When using this function,\n * TypeScript will narrow away falsy types from the condition.\n *\n * @param condition\n * @param message\n * @returns\n */\nexport function assertTruthy(condition, message) {\n if (!condition) {\n throw new Error(message || 'Assertion failed');\n }\n}\n//# sourceMappingURL=utils.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { createEffect, on, createSignal, untrack, } from 'solid-js';\nimport { useKeyDownEvent } from '@solid-primitives/keyboard';\nimport { activeElement, ElementNode } from '@lightningjs/solid';\nimport { isFunc, isArray } from './utils.js';\nconst keyMapEntries = {\n ArrowLeft: 'Left',\n ArrowRight: 'Right',\n ArrowUp: 'Up',\n ArrowDown: 'Down',\n Enter: 'Enter',\n l: 'Last',\n ' ': 'Space',\n Backspace: 'Back',\n Escape: 'Escape',\n};\nconst [focusPath, setFocusPath] = createSignal([]);\nexport { focusPath };\nexport const useFocusManager = (userKeyMap) => {\n const keypressEvent = useKeyDownEvent();\n if (userKeyMap) {\n // Flatten the userKeyMap to a hash\n for (const [key, value] of Object.entries(userKeyMap)) {\n if (isArray(value)) {\n value.forEach((v) => {\n keyMapEntries[v] = key;\n });\n }\n else {\n keyMapEntries[value] = key;\n }\n }\n }\n createEffect(on(activeElement, (currentFocusedElm, prevFocusedElm, prevFocusPath = []) => {\n const newFocusedElms = [];\n let current = currentFocusedElm;\n const fp = [];\n while (current) {\n if (!current.states.has('focus')) {\n current.states.add('focus');\n isFunc(current.onFocus) &&\n current.onFocus.call(current, currentFocusedElm, prevFocusedElm);\n newFocusedElms.push(current);\n }\n fp.push(current);\n current = current.parent;\n }\n prevFocusPath.forEach((elm) => {\n if (!fp.includes(elm)) {\n elm.states.remove('focus');\n isFunc(elm.onBlur) &&\n elm.onBlur.call(elm, currentFocusedElm, prevFocusedElm);\n }\n });\n setFocusPath(fp);\n return fp;\n }, { defer: true }));\n createEffect(() => {\n const e = keypressEvent();\n if (e) {\n // Search keyMap for the value of the pressed key or keyCode if value undefined\n const mappedKeyEvent = keyMapEntries[e.key] || keyMapEntries[e.keyCode];\n untrack(() => {\n const fp = focusPath();\n let finalFocusElm = undefined;\n for (const elm of fp) {\n finalFocusElm = finalFocusElm || elm;\n if (mappedKeyEvent) {\n const onKeyHandler = elm[`on${mappedKeyEvent}`];\n if (isFunc(onKeyHandler)) {\n if (onKeyHandler.call(elm, e, elm, finalFocusElm) === true) {\n break;\n }\n }\n }\n else {\n console.log(`Unhandled key event: ${e.key}`);\n }\n if (isFunc(elm.onKeyPress)) {\n if (elm.onKeyPress.call(elm, e, mappedKeyEvent, elm, finalFocusElm) === true) {\n break;\n }\n }\n }\n return false;\n });\n }\n });\n return focusPath;\n};\n//# sourceMappingURL=useFocusManager.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n/* global SpeechSynthesisErrorEvent */\nfunction flattenStrings(series = []) {\n const flattenedSeries = [];\n let i;\n for (i = 0; i < series.length; i++) {\n const s = series[i];\n if (typeof s === 'string' && !s.includes('PAUSE-')) {\n flattenedSeries.push(series[i]);\n }\n else {\n break;\n }\n }\n // add a \"word boundary\" to ensure the Announcer doesn't automatically try to\n // interpret strings that look like dates but are not actually dates\n // for example, if \"Rising Sun\" and \"1993\" are meant to be two separate lines,\n // when read together, \"Sun 1993\" is interpretted as \"Sunday 1993\"\n return [flattenedSeries.join(',\\b ')].concat(series.slice(i));\n}\nfunction delay(pause) {\n return new Promise((resolve) => {\n setTimeout(resolve, pause);\n });\n}\n/**\n * Speak a string\n *\n * @param phrase Phrase to speak\n * @param utterances An array which the new SpeechSynthesisUtterance instance representing this utterance will be appended\n * @param lang Language to speak in\n * @return {Promise} Promise resolved when the utterance has finished speaking, and rejected if there's an error\n */\nfunction speak(phrase, utterances, lang = 'en-US') {\n const synth = window.speechSynthesis;\n return new Promise((resolve, reject) => {\n const utterance = new SpeechSynthesisUtterance(phrase);\n utterance.lang = lang;\n utterance.onend = () => {\n resolve();\n };\n utterance.onerror = (e) => {\n reject(e);\n };\n utterances.push(utterance);\n synth.speak(utterance);\n });\n}\nfunction speakSeries(series, lang, root = true) {\n const synth = window.speechSynthesis;\n const remainingPhrases = flattenStrings(Array.isArray(series) ? series : [series]);\n const nestedSeriesResults = [];\n /*\n We hold this array of SpeechSynthesisUtterances in order to prevent them from being\n garbage collected prematurely on STB hardware which can cause the 'onend' events of\n utterances to not fire consistently.\n */\n const utterances = [];\n let active = true;\n const seriesChain = (async () => {\n try {\n while (active && remainingPhrases.length) {\n const phrase = await Promise.resolve(remainingPhrases.shift());\n if (!active) {\n // Exit\n // Need to check this after the await in case it was cancelled in between\n break;\n }\n else if (typeof phrase === 'string' && phrase.includes('PAUSE-')) {\n // Pause it\n let pause = Number(phrase.split('PAUSE-')[1]) * 1000;\n if (isNaN(pause)) {\n pause = 0;\n }\n await delay(pause);\n }\n else if (typeof phrase === 'string' && phrase.length) {\n // Speak it\n const totalRetries = 3;\n let retriesLeft = totalRetries;\n while (active && retriesLeft > 0) {\n try {\n await speak(phrase, utterances, lang);\n retriesLeft = 0;\n }\n catch (e) {\n // eslint-disable-next-line no-undef\n if (e instanceof SpeechSynthesisErrorEvent) {\n if (e.error === 'network') {\n retriesLeft--;\n console.warn(`Speech synthesis network error. Retries left: ${retriesLeft}`);\n await delay(500 * (totalRetries - retriesLeft));\n }\n else if (e.error === 'canceled' ||\n e.error === 'interrupted') {\n // Cancel or interrupt error (ignore)\n retriesLeft = 0;\n }\n else {\n throw new Error(`SpeechSynthesisErrorEvent: ${e.error}`);\n }\n }\n else {\n throw e;\n }\n }\n }\n }\n else if (typeof phrase === 'function') {\n const seriesResult = speakSeries(phrase(), lang, false);\n nestedSeriesResults.push(seriesResult);\n await seriesResult.series;\n }\n else if (Array.isArray(phrase)) {\n // Speak it (recursively)\n const seriesResult = speakSeries(phrase, lang, false);\n nestedSeriesResults.push(seriesResult);\n await seriesResult.series;\n }\n }\n }\n finally {\n active = false;\n }\n })();\n return {\n series: seriesChain,\n get active() {\n return active;\n },\n append: (toSpeak) => {\n remainingPhrases.push(toSpeak);\n },\n cancel: () => {\n if (!active) {\n return;\n }\n if (root) {\n synth.cancel();\n }\n nestedSeriesResults.forEach((nestedSeriesResults) => {\n nestedSeriesResults.cancel();\n });\n active = false;\n },\n };\n}\nlet currentSeries;\nexport default function (toSpeak, lang = 'en-US') {\n currentSeries && currentSeries.cancel();\n currentSeries = speakSeries(toSpeak, lang);\n return currentSeries;\n}\n//# sourceMappingURL=speech.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { ElementNode } from '@lightningjs/solid';\n// To use with TS import withPadding and then put withPadding; on the next line to prevent tree shaking\nexport function withPadding(el, padding) {\n const pad = padding();\n let top, left, right, bottom;\n if (Array.isArray(pad)) {\n // top right bottom left\n if (pad.length === 2) {\n top = bottom = pad[0];\n left = right = pad[1];\n }\n else if (pad.length === 3) {\n top = pad[0];\n left = right = pad[1];\n bottom = pad[2];\n }\n else {\n [top, right, bottom, left] = pad;\n }\n }\n else {\n top = right = bottom = left = pad;\n }\n el.onBeforeLayout = (node, size) => {\n if (size) {\n el.width =\n el.children.reduce((acc, c) => {\n return acc + (c.width || 0);\n }, 0) +\n left +\n right;\n const firstChild = el.children[0];\n if (firstChild) {\n // set padding or marginLeft for flex\n firstChild.x = left;\n firstChild.marginLeft = left;\n }\n let maxHeight = 0;\n el.children.forEach((c) => {\n c.y = top;\n c.marginTop = top;\n maxHeight = Math.max(maxHeight, c.height || 0);\n });\n el.height = maxHeight + top + bottom;\n }\n };\n}\n//# sourceMappingURL=withPadding.js.map","import { getOwner, onCleanup, createSignal, getListener } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/index.ts\nvar debounce = (callback, wait) => {\n if (isServer) {\n return Object.assign(() => void 0, { clear: () => void 0 });\n }\n let timeoutId;\n const clear = () => clearTimeout(timeoutId);\n if (getOwner())\n onCleanup(clear);\n const debounced = (...args) => {\n if (timeoutId !== void 0)\n clear();\n timeoutId = setTimeout(() => callback(...args), wait);\n };\n return Object.assign(debounced, { clear });\n};\nvar throttle = (callback, wait) => {\n if (isServer) {\n return Object.assign(() => void 0, { clear: () => void 0 });\n }\n let isThrottled = false, timeoutId, lastArgs;\n const throttled = (...args) => {\n lastArgs = args;\n if (isThrottled)\n return;\n isThrottled = true;\n timeoutId = setTimeout(() => {\n callback(...lastArgs);\n isThrottled = false;\n }, wait);\n };\n const clear = () => {\n clearTimeout(timeoutId);\n isThrottled = false;\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(throttled, { clear });\n};\nvar scheduleIdle = isServer ? () => Object.assign(() => void 0, { clear: () => void 0 }) : (\n // requestIdleCallback is not supported in Safari\n window.requestIdleCallback ? (callback, maxWait) => {\n let isDeferred = false, id, lastArgs;\n const deferred = (...args) => {\n lastArgs = args;\n if (isDeferred)\n return;\n isDeferred = true;\n id = requestIdleCallback(\n () => {\n callback(...lastArgs);\n isDeferred = false;\n },\n { timeout: maxWait }\n );\n };\n const clear = () => {\n cancelIdleCallback(id);\n isDeferred = false;\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(deferred, { clear });\n } : (\n // fallback to setTimeout (throttle)\n (callback) => throttle(callback)\n )\n);\nfunction leading(schedule, callback, wait) {\n if (isServer) {\n let called = false;\n const scheduled2 = (...args) => {\n if (called)\n return;\n called = true;\n callback(...args);\n };\n return Object.assign(scheduled2, { clear: () => void 0 });\n }\n let isScheduled = false;\n const scheduled = schedule(() => isScheduled = false, wait);\n const func = (...args) => {\n if (!isScheduled)\n callback(...args);\n isScheduled = true;\n scheduled();\n };\n const clear = () => {\n isScheduled = false;\n scheduled.clear();\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(func, { clear });\n}\nfunction leadingAndTrailing(schedule, callback, wait) {\n if (isServer) {\n let called = false;\n const scheduled2 = (...args) => {\n if (called)\n return;\n called = true;\n callback(...args);\n };\n return Object.assign(scheduled2, { clear: () => void 0 });\n }\n let State;\n ((State2) => {\n State2[State2[\"Ready\"] = 0] = \"Ready\";\n State2[State2[\"Leading\"] = 1] = \"Leading\";\n State2[State2[\"Trailing\"] = 2] = \"Trailing\";\n })(State || (State = {}));\n let state = 0 /* Ready */;\n const scheduled = schedule((args) => {\n state === 2 /* Trailing */ && callback(...args);\n state = 0 /* Ready */;\n }, wait);\n const fn = (...args) => {\n if (state !== 2 /* Trailing */) {\n if (state === 0 /* Ready */)\n callback(...args);\n state += 1;\n }\n scheduled(args);\n };\n const clear = () => {\n state = 0 /* Ready */;\n scheduled.clear();\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(fn, { clear });\n}\nfunction createScheduled(schedule) {\n let listeners = 0;\n let isDirty = false;\n const [track, dirty] = createSignal(void 0, { equals: false });\n const call = schedule(() => {\n isDirty = true;\n dirty();\n });\n return () => {\n if (!isDirty)\n call(), track();\n if (isDirty) {\n isDirty = !!listeners;\n return true;\n }\n if (getListener()) {\n listeners++;\n onCleanup(() => listeners--);\n }\n return false;\n };\n}\n\nexport { createScheduled, debounce, leading, leadingAndTrailing, scheduleIdle, throttle };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { untrack } from 'solid-js';\nimport SpeechEngine, {} from './speech.js';\nimport { debounce } from '@solid-primitives/scheduled';\nimport { focusPath } from '../useFocusManager.js';\nlet resetFocusPathTimer;\nlet prevFocusPath = [];\nlet currentlySpeaking;\nlet voiceOutDisabled = false;\nconst fiveMinutes = 300000;\nfunction debounceWithFlush(callback, time) {\n const trigger = debounce(callback, time);\n let scopedValue;\n const debounced = (newValue) => {\n scopedValue = newValue;\n trigger(newValue);\n };\n debounced.flush = () => {\n trigger.clear();\n callback(scopedValue);\n };\n debounced.clear = trigger.clear;\n return debounced;\n}\nfunction getElmName(elm) {\n return elm.id || elm.name;\n}\nfunction onFocusChangeCore(focusPath = []) {\n if (!Announcer.onFocusChange || !Announcer.enabled) {\n return;\n }\n const loaded = focusPath.every((elm) => !elm.loading);\n const focusDiff = focusPath.filter((elm) => !prevFocusPath.includes(elm));\n resetFocusPathTimer();\n if (!loaded && Announcer.onFocusChange) {\n Announcer.onFocusChange([]);\n return;\n }\n prevFocusPath = focusPath.slice(0);\n const toAnnounceText = [];\n const toAnnounce = focusDiff.reduce((acc, elm) => {\n if (elm.announce) {\n acc.push([getElmName(elm), 'Announce', elm.announce]);\n toAnnounceText.push(elm.announce);\n }\n else if (elm.title) {\n acc.push([getElmName(elm), 'Title', elm.title]);\n toAnnounceText.push(elm.title);\n }\n else {\n acc.push([getElmName(elm), 'No Announce', '']);\n }\n return acc;\n }, []);\n focusDiff.reverse().reduce((acc, elm) => {\n if (elm.announceContext) {\n acc.push([getElmName(elm), 'Context', elm.announceContext]);\n toAnnounceText.push(elm.announceContext);\n }\n else {\n acc.push([getElmName(elm), 'No Context', '']);\n }\n return acc;\n }, toAnnounce);\n if (Announcer.debug) {\n console.table(toAnnounce);\n }\n if (toAnnounceText.length) {\n return Announcer.speak(toAnnounceText.reduce((acc, val) => acc.concat(val), []));\n }\n}\nfunction textToSpeech(toSpeak) {\n if (voiceOutDisabled) {\n return;\n }\n return (currentlySpeaking = SpeechEngine(toSpeak));\n}\nexport const Announcer = {\n debug: false,\n enabled: true,\n cancel: function () {\n currentlySpeaking && currentlySpeaking.cancel();\n },\n clearPrevFocus: function (depth = 0) {\n prevFocusPath = prevFocusPath.slice(0, depth);\n resetFocusPathTimer();\n },\n speak: function (text, { append = false, notification = false } = {}) {\n if (Announcer.onFocusChange && Announcer.enabled) {\n Announcer.onFocusChange.flush();\n if (append && currentlySpeaking && currentlySpeaking.active) {\n currentlySpeaking.append(text);\n }\n else {\n Announcer.cancel();\n textToSpeech(text);\n }\n if (notification) {\n voiceOutDisabled = true;\n currentlySpeaking?.series\n .finally(() => {\n voiceOutDisabled = false;\n Announcer.refresh();\n })\n .catch(console.error);\n }\n }\n return currentlySpeaking;\n },\n refresh: function (depth = 0) {\n Announcer.clearPrevFocus(depth);\n Announcer.onFocusChange &&\n Announcer.onFocusChange(untrack(() => focusPath()));\n },\n setupTimers: function ({ focusDebounce = 400, focusChangeTimeout = fiveMinutes, } = {}) {\n Announcer.onFocusChange = debounceWithFlush(onFocusChangeCore, focusDebounce);\n resetFocusPathTimer = debounceWithFlush(() => {\n // Reset focus path for full announce\n prevFocusPath = [];\n }, focusChangeTimeout);\n },\n};\n//# sourceMappingURL=announcer.js.map","import { createSignal } from \"solid-js\";\nexport const [globalBackground, setGlobalBackground] = createSignal(\"\");\n","var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;\nimport { ElementNode, createComponent, View, mergeProps, createElement, use, spread, insert, Show, Text as Text$7, memo, For as For$1 } from \"@lightningjs/solid\";\nimport theme from \"theme\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nconst equalFn = (a, b) => a === b;\nconst $TRACK = Symbol(\"solid-track\");\nconst signalOptions = {\n equals: equalFn\n};\nlet runEffects = runQueue;\nconst STALE = 1;\nconst PENDING = 2;\nconst UNOWNED = {\n owned: null,\n cleanups: null,\n context: null,\n owner: null\n};\nvar Owner = null;\nlet Transition = null;\nlet ExternalSourceConfig = null;\nlet Listener = null;\nlet Updates = null;\nlet Effects = null;\nlet ExecCount = 0;\nfunction createRoot(fn, detachedOwner) {\n const listener = Listener, owner = Owner, unowned = fn.length === 0, current = detachedOwner === void 0 ? owner : detachedOwner, root = unowned ? UNOWNED : {\n owned: null,\n cleanups: null,\n context: current ? current.context : null,\n owner: current\n }, updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root)));\n Owner = root;\n Listener = null;\n try {\n return runUpdates(updateFn, true);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n}\nfunction createSignal(value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const s = {\n value,\n observers: null,\n observerSlots: null,\n comparator: options.equals || void 0\n };\n const setter = (value2) => {\n if (typeof value2 === \"function\") {\n value2 = value2(s.value);\n }\n return writeSignal(s, value2);\n };\n return [readSignal.bind(s), setter];\n}\nfunction createMemo(fn, value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const c = createComputation(fn, value, true, 0);\n c.observers = null;\n c.observerSlots = null;\n c.comparator = options.equals || void 0;\n updateComputation(c);\n return readSignal.bind(c);\n}\nfunction untrack(fn) {\n if (Listener === null)\n return fn();\n const listener = Listener;\n Listener = null;\n try {\n if (ExternalSourceConfig)\n ;\n return fn();\n } finally {\n Listener = listener;\n }\n}\nfunction onCleanup(fn) {\n if (Owner === null)\n ;\n else if (Owner.cleanups === null)\n Owner.cleanups = [fn];\n else\n Owner.cleanups.push(fn);\n return fn;\n}\nfunction readSignal() {\n if (this.sources && this.state) {\n if (this.state === STALE)\n updateComputation(this);\n else {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(this), false);\n Updates = updates;\n }\n }\n if (Listener) {\n const sSlot = this.observers ? this.observers.length : 0;\n if (!Listener.sources) {\n Listener.sources = [this];\n Listener.sourceSlots = [sSlot];\n } else {\n Listener.sources.push(this);\n Listener.sourceSlots.push(sSlot);\n }\n if (!this.observers) {\n this.observers = [Listener];\n this.observerSlots = [Listener.sources.length - 1];\n } else {\n this.observers.push(Listener);\n this.observerSlots.push(Listener.sources.length - 1);\n }\n }\n return this.value;\n}\nfunction writeSignal(node, value, isComp) {\n let current = node.value;\n if (!node.comparator || !node.comparator(current, value)) {\n node.value = value;\n if (node.observers && node.observers.length) {\n runUpdates(() => {\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n const TransitionRunning = Transition && Transition.running;\n if (TransitionRunning && Transition.disposed.has(o))\n ;\n if (TransitionRunning ? !o.tState : !o.state) {\n if (o.pure)\n Updates.push(o);\n else\n Effects.push(o);\n if (o.observers)\n markDownstream(o);\n }\n if (!TransitionRunning)\n o.state = STALE;\n }\n if (Updates.length > 1e6) {\n Updates = [];\n if (false)\n ;\n throw new Error();\n }\n }, false);\n }\n }\n return value;\n}\nfunction updateComputation(node) {\n if (!node.fn)\n return;\n cleanNode(node);\n const time = ExecCount;\n runComputation(\n node,\n node.value,\n time\n );\n}\nfunction runComputation(node, value, time) {\n let nextValue;\n const owner = Owner, listener = Listener;\n Listener = Owner = node;\n try {\n nextValue = node.fn(value);\n } catch (err) {\n if (node.pure) {\n {\n node.state = STALE;\n node.owned && node.owned.forEach(cleanNode);\n node.owned = null;\n }\n }\n node.updatedAt = time + 1;\n return handleError(err);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n if (!node.updatedAt || node.updatedAt <= time) {\n if (node.updatedAt != null && \"observers\" in node) {\n writeSignal(node, nextValue);\n } else\n node.value = nextValue;\n node.updatedAt = time;\n }\n}\nfunction createComputation(fn, init, pure, state = STALE, options) {\n const c = {\n fn,\n state,\n updatedAt: null,\n owned: null,\n sources: null,\n sourceSlots: null,\n cleanups: null,\n value: init,\n owner: Owner,\n context: Owner ? Owner.context : null,\n pure\n };\n if (Owner === null)\n ;\n else if (Owner !== UNOWNED) {\n {\n if (!Owner.owned)\n Owner.owned = [c];\n else\n Owner.owned.push(c);\n }\n }\n return c;\n}\nfunction runTop(node) {\n if (node.state === 0)\n return;\n if (node.state === PENDING)\n return lookUpstream(node);\n if (node.suspense && untrack(node.suspense.inFallback))\n return node.suspense.effects.push(node);\n const ancestors = [node];\n while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {\n if (node.state)\n ancestors.push(node);\n }\n for (let i = ancestors.length - 1; i >= 0; i--) {\n node = ancestors[i];\n if (node.state === STALE) {\n updateComputation(node);\n } else if (node.state === PENDING) {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(node, ancestors[0]), false);\n Updates = updates;\n }\n }\n}\nfunction runUpdates(fn, init) {\n if (Updates)\n return fn();\n let wait = false;\n if (!init)\n Updates = [];\n if (Effects)\n wait = true;\n else\n Effects = [];\n ExecCount++;\n try {\n const res = fn();\n completeUpdates(wait);\n return res;\n } catch (err) {\n if (!wait)\n Effects = null;\n Updates = null;\n handleError(err);\n }\n}\nfunction completeUpdates(wait) {\n if (Updates) {\n runQueue(Updates);\n Updates = null;\n }\n if (wait)\n return;\n const e = Effects;\n Effects = null;\n if (e.length)\n runUpdates(() => runEffects(e), false);\n}\nfunction runQueue(queue) {\n for (let i = 0; i < queue.length; i++)\n runTop(queue[i]);\n}\nfunction lookUpstream(node, ignore) {\n node.state = 0;\n for (let i = 0; i < node.sources.length; i += 1) {\n const source = node.sources[i];\n if (source.sources) {\n const state = source.state;\n if (state === STALE) {\n if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))\n runTop(source);\n } else if (state === PENDING)\n lookUpstream(source, ignore);\n }\n }\n}\nfunction markDownstream(node) {\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n if (!o.state) {\n o.state = PENDING;\n if (o.pure)\n Updates.push(o);\n else\n Effects.push(o);\n o.observers && markDownstream(o);\n }\n }\n}\nfunction cleanNode(node) {\n let i;\n if (node.sources) {\n while (node.sources.length) {\n const source = node.sources.pop(), index = node.sourceSlots.pop(), obs = source.observers;\n if (obs && obs.length) {\n const n = obs.pop(), s = source.observerSlots.pop();\n if (index < obs.length) {\n n.sourceSlots[s] = index;\n obs[index] = n;\n source.observerSlots[index] = s;\n }\n }\n }\n }\n if (node.owned) {\n for (i = node.owned.length - 1; i >= 0; i--)\n cleanNode(node.owned[i]);\n node.owned = null;\n }\n if (node.cleanups) {\n for (i = node.cleanups.length - 1; i >= 0; i--)\n node.cleanups[i]();\n node.cleanups = null;\n }\n node.state = 0;\n}\nfunction castError(err) {\n if (err instanceof Error)\n return err;\n return new Error(typeof err === \"string\" ? err : \"Unknown error\", {\n cause: err\n });\n}\nfunction handleError(err, owner = Owner) {\n const error = castError(err);\n throw error;\n}\nconst FALLBACK = Symbol(\"fallback\");\nfunction dispose(d) {\n for (let i = 0; i < d.length; i++)\n d[i]();\n}\nfunction mapArray(list, mapFn, options = {}) {\n let items = [], mapped = [], disposers = [], len = 0, indexes = mapFn.length > 1 ? [] : null;\n onCleanup(() => dispose(disposers));\n return () => {\n let newItems = list() || [], i, j;\n newItems[$TRACK];\n return untrack(() => {\n let newLen = newItems.length, newIndices, newIndicesNext, temp, tempdisposers, tempIndexes, start, end, newEnd, item;\n if (newLen === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n indexes && (indexes = []);\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot((disposer) => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n } else if (len === 0) {\n mapped = new Array(newLen);\n for (j = 0; j < newLen; j++) {\n items[j] = newItems[j];\n mapped[j] = createRoot(mapper);\n }\n len = newLen;\n } else {\n temp = new Array(newLen);\n tempdisposers = new Array(newLen);\n indexes && (tempIndexes = new Array(newLen));\n for (start = 0, end = Math.min(len, newLen); start < end && items[start] === newItems[start]; start++)\n ;\n for (end = len - 1, newEnd = newLen - 1; end >= start && newEnd >= start && items[end] === newItems[newEnd]; end--, newEnd--) {\n temp[newEnd] = mapped[end];\n tempdisposers[newEnd] = disposers[end];\n indexes && (tempIndexes[newEnd] = indexes[end]);\n }\n newIndices = /* @__PURE__ */ new Map();\n newIndicesNext = new Array(newEnd + 1);\n for (j = newEnd; j >= start; j--) {\n item = newItems[j];\n i = newIndices.get(item);\n newIndicesNext[j] = i === void 0 ? -1 : i;\n newIndices.set(item, j);\n }\n for (i = start; i <= end; i++) {\n item = items[i];\n j = newIndices.get(item);\n if (j !== void 0 && j !== -1) {\n temp[j] = mapped[i];\n tempdisposers[j] = disposers[i];\n indexes && (tempIndexes[j] = indexes[i]);\n j = newIndicesNext[j];\n newIndices.set(item, j);\n } else\n disposers[i]();\n }\n for (j = start; j < newLen; j++) {\n if (j in temp) {\n mapped[j] = temp[j];\n disposers[j] = tempdisposers[j];\n if (indexes) {\n indexes[j] = tempIndexes[j];\n indexes[j](j);\n }\n } else\n mapped[j] = createRoot(mapper);\n }\n mapped = mapped.slice(0, len = newLen);\n items = newItems.slice(0);\n }\n return mapped;\n });\n function mapper(disposer) {\n disposers[j] = disposer;\n if (indexes) {\n const [s, set] = createSignal(j);\n indexes[j] = set;\n return mapFn(newItems[j], s);\n }\n return mapFn(newItems[j]);\n }\n };\n}\nfunction For(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(mapArray(() => props.each, props.children, fallback || void 0));\n}\nconst defaultModeKeys = [\"focus\", \"disabled\"];\nconst defaultToneKeys = [\"brand\", \"inverse\", \"neutral\"];\nfunction makeComponentStyles({ themeKeys, base, modes, tones, themeStyles: themeStyles2, modeKeys = defaultModeKeys, toneKeys = defaultToneKeys }, debug = false) {\n const makeToneStyles = (tones2, themeComponentStyles, modeStyles) => {\n const toneStyles = toneKeys.map((tone) => {\n const styles2 = {};\n const styleList = new Set(\n [].concat.apply([], [(tones2 == null ? void 0 : tones2[tone]) ?? {}, (themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) ?? {}].map(Object.keys))\n );\n styleList.forEach((styleKey) => {\n var _a2, _b2;\n if (!modeKeys.includes(styleKey)) {\n styles2[styleKey] = ((_a2 = themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) == null ? void 0 : _a2[styleKey]) ?? ((_b2 = tones2 == null ? void 0 : tones2[tone]) == null ? void 0 : _b2[styleKey]);\n }\n });\n modeKeys.forEach((mode) => {\n var _a2, _b2;\n styles2[mode] = {\n ...modeStyles[mode],\n // fallbacks from base.mode\n ...(_a2 = tones2 == null ? void 0 : tones2[tone]) == null ? void 0 : _a2[mode],\n // component configured tone.mode\n ...(_b2 = themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) == null ? void 0 : _b2[mode]\n // theme configure tone.mode\n };\n });\n return [tone, styles2];\n });\n return Object.fromEntries(toneStyles);\n };\n const makeModeStyles = (modes2, themeComponentStyles) => {\n const modeStyles = modeKeys.map((mode) => {\n return [mode, { ...modes2 == null ? void 0 : modes2[mode], ...themeComponentStyles == null ? void 0 : themeComponentStyles[mode] }];\n });\n const modeObject = Object.fromEntries(modeStyles);\n return modeObject;\n };\n const makeBaseStyles = (base2, themeComponentStyles) => {\n const baseStyles = {\n ...base2,\n ...themeComponentStyles.base\n };\n return baseStyles;\n };\n const mapThemeKeysToSolid = (stylesToMap) => Object.fromEntries(\n Object.entries(themeKeys).filter(([_, themeKey]) => stylesToMap[themeKey]).map(([solidKey, themeKey]) => [solidKey, stylesToMap[themeKey]])\n );\n const convertComponentConfig = (themeStyles3) => {\n const convertedThemeStyles = Object.fromEntries(\n // iterate through each variant\n Object.entries(themeStyles3).map(([variantName, styles2]) => {\n const convertedStyles = mapThemeKeysToSolid(styles2);\n Object.entries(styles2).filter(([styleName, _]) => modeKeys.includes(styleName)).forEach(([modeName, modeStyles]) => {\n convertedStyles[modeName] = mapThemeKeysToSolid(modeStyles);\n });\n return [variantName, convertedStyles];\n })\n );\n return convertedThemeStyles;\n };\n const generateSolidStylesFromLookupObject = (base2, modes2, tones2) => {\n const themeComponentStyles = convertComponentConfig(themeStyles2);\n debug && console.log(themeComponentStyles);\n const baseStyles = makeBaseStyles(base2, themeComponentStyles);\n debug && console.log(baseStyles);\n const modeStyles = makeModeStyles(modes2, themeComponentStyles);\n debug && console.log(modeStyles);\n const toneStyles = makeToneStyles(tones2, themeComponentStyles, modeStyles);\n debug && console.log(toneStyles);\n return {\n base: {\n ...baseStyles,\n ...modeStyles\n },\n tones: toneStyles\n };\n };\n return generateSolidStylesFromLookupObject(base, modes, tones);\n}\nfunction withScrolling(adjustment = 0) {\n return (componentRef, selectedElement, selected, lastSelected) => {\n if (componentRef.children.length === 0) {\n return;\n }\n const gap = componentRef.gap || 0;\n const scroll = componentRef.scroll || \"auto\";\n const [lastItem, windowVal] = updateLastIndex(componentRef);\n const currentVal = componentRef.flexDirection === \"row\" ? componentRef.x : componentRef.y;\n const newVal = componentRef.flexDirection === \"row\" ? selectedElement.x : selectedElement.y;\n const size2 = componentRef.flexDirection === \"row\" ? selectedElement.width : selectedElement.height;\n const direct = selected > lastSelected ? \"positive\" : \"negative\";\n let next = currentVal;\n if (scroll === \"auto\") {\n if (componentRef.scrollIndex != void 0 && componentRef.scrollIndex >= 0) {\n if (componentRef.selected >= componentRef.scrollIndex) {\n if (direct === \"positive\") {\n next = currentVal - size2 - gap;\n } else {\n next = currentVal + size2 + gap;\n }\n }\n } else if (Math.abs(currentVal) + windowVal < lastItem.position + lastItem.size || newVal < Math.abs(currentVal)) {\n next = -newVal + adjustment;\n }\n } else if (scroll === \"always\" || scroll === \"edge\" && direct === \"negative\" && Math.abs(currentVal) > newVal) {\n next = -newVal + adjustment;\n } else if (scroll === \"edge\" && direct === \"positive\" && Math.abs(currentVal) + windowVal < newVal + size2) {\n next = currentVal - size2 - gap;\n }\n if (componentRef.flexDirection === \"row\" && componentRef.x !== next) {\n componentRef.x = next;\n } else if (componentRef.flexDirection === \"column\" && componentRef.y !== next) {\n componentRef.y = next;\n }\n };\n}\nfunction updateLastIndex(items) {\n let lastItem, windowVal;\n if (items.flexDirection === \"row\") {\n lastItem = {\n position: items.children[items.children.length - 1].x,\n size: items.children[items.children.length - 1].width\n };\n windowVal = items.width;\n } else {\n lastItem = {\n position: items.children[items.children.length - 1].y,\n size: items.children[items.children.length - 1].height\n };\n windowVal = items.height;\n }\n return [lastItem, windowVal];\n}\nconst useItemLayout = (itemLayout) => {\n if (itemLayout) {\n const width = (theme.layout.screenW - theme.layout.marginX * 2) / itemLayout.upCount - theme.layout.gutterX;\n const height = width / itemLayout.ratioX * itemLayout.ratioY;\n return { width, height };\n }\n return {};\n};\nconst chainFunctions = (...args) => {\n const onlyFunctions = args.filter((func) => typeof func === \"function\");\n if (onlyFunctions.length === 0) {\n return void 0;\n }\n return function(...innerArgs) {\n for (const func of onlyFunctions) {\n if (func.apply(this, innerArgs) === true) {\n return true;\n }\n }\n };\n};\nfunction assertTruthy(condition, message) {\n return;\n}\nfunction onGridFocus() {\n if (!this || this.selected === void 0 || this.children.length === 0)\n return false;\n let child = this.children[this.selected];\n while (child == null ? void 0 : child.skipFocus) {\n this.selected++;\n child = this.children[this.selected];\n }\n if (!(child instanceof ElementNode))\n return false;\n child.setFocus();\n}\nfunction handleNavigation(direction) {\n return function() {\n var _a2, _b2;\n const numChildren = this.children.length;\n const wrap = this.wrap;\n const lastSelected = this.selected || 0;\n if (numChildren === 0) {\n return false;\n }\n if (direction === \"right\" || direction === \"down\") {\n do {\n this.selected = (this.selected || 0) % numChildren + 1;\n if (this.selected >= numChildren) {\n if (!wrap) {\n this.selected = void 0;\n break;\n }\n this.selected = 0;\n }\n } while ((_a2 = this.children[this.selected]) == null ? void 0 : _a2.skipFocus);\n } else if (direction === \"left\" || direction === \"up\") {\n do {\n this.selected = (this.selected || 0) % numChildren - 1;\n if (this.selected < 0) {\n if (!wrap) {\n this.selected = void 0;\n break;\n }\n this.selected = numChildren - 1;\n }\n } while ((_b2 = this.children[this.selected]) == null ? void 0 : _b2.skipFocus);\n }\n if (this.selected === void 0) {\n this.selected = lastSelected;\n if (this.children[this.selected].states.has(\"focus\")) {\n return false;\n }\n }\n const active = this.children[this.selected];\n this.onSelectedChanged && this.onSelectedChanged.call(this, this, active, this.selected, lastSelected);\n if (this.plinko && lastSelected !== void 0) {\n const lastSelectedChild = this.children[lastSelected];\n const num = lastSelectedChild.selected || 0;\n active.selected = num < active.children.length ? num : active.children.length - 1;\n }\n active.setFocus();\n return true;\n };\n}\nfunction scrollToIndex(componentRef, selectedIndex) {\n if (!componentRef || componentRef.selected === void 0 || componentRef.children.length === 0 || componentRef.children.length <= selectedIndex || componentRef.selected === selectedIndex) {\n return false;\n }\n componentRef.selected = selectedIndex;\n if (componentRef.flexDirection === \"row\") {\n componentRef.x = -componentRef.children[selectedIndex].x;\n } else if (componentRef.flexDirection === \"column\") {\n componentRef.y = -componentRef.children[selectedIndex].y;\n }\n}\nconst { Artwork: { defaultTone: defaultTone$e, ...themeStyles$d } = { styles: {} } } = (_a = theme) == null ? void 0 : _a.componentConfig;\nconst container$e = {\n themeKeys: {\n fillColor: \"fillColor\",\n borderRadius: \"borderRadius\",\n scale: \"imageScale\",\n pivotX: \"imageScalePivotX\",\n pivotY: \"imageScalePivotY\"\n },\n base: {\n borderRadius: theme.radius.md,\n fallbackSrc: void 0,\n fillColor: theme.color.overlay,\n gradientColor: theme.color.material,\n pivotX: 0.5,\n pivotY: 0.5,\n scale: void 0\n },\n themeStyles: themeStyles$d\n};\nconst Container$e = makeComponentStyles(container$e);\nconst styles$e = {\n tone: defaultTone$e || \"neutral\",\n Container: Container$e\n};\nconst formatArtwork = (props) => {\n let src = props.src ? props.src : props.fallbackSrc;\n if (src && props.srcCallback && typeof props.srcCallback === \"function\") {\n src = props.srcCallback({\n closestAspectRatio: void 0,\n aspectRatio: void 0,\n src,\n width: props.width,\n height: props.height\n });\n }\n return src;\n};\nconst Artwork = (props) => {\n const formattedArtwork = createMemo(() => formatArtwork(props));\n return createComponent(View, mergeProps(props, {\n get color() {\n var _a2;\n return Boolean(formattedArtwork()) ? void 0 : props.color ?? ((_a2 = styles$e.Container.tones[props.tone ?? styles$e.tone]) == null ? void 0 : _a2.fillColor) ?? styles$e.Container.base.fillColor;\n },\n get style() {\n return [...[props.style].flat(), styles$e.Container.tones[props.tone || styles$e.tone], styles$e.Container.base];\n },\n get src() {\n return formattedArtwork();\n }\n }));\n};\nconst { Icon: { defaultTone: defaultTone$d, ...themeStyles$c } = { styles: {} } } = (_b = theme) == null ? void 0 : _b.componentConfig;\nconst container$d = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n width: 100,\n height: 100,\n color: theme.color.fillInverse\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand\n }\n },\n themeStyles: themeStyles$c\n};\nconst Container$d = makeComponentStyles(container$d);\nconst styles$d = {\n tone: defaultTone$d || \"neutral\",\n Container: Container$d\n};\nconst Icon$3 = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$d.Container.tones) == null ? void 0 : _a2[props.tone || styles$d.tone],\n styles$d.Container.base\n ];\n },\n forwardStates: true\n }));\n};\nconst { Badge: { defaultTone: defaultTone$c, ...themeStyles$b } = { styles: {} } } = (_c = theme) == null ? void 0 : _c.componentConfig;\nconst container$c = {\n themeKeys: {\n color: \"backgroundColor\"\n },\n base: {\n color: theme.color.fillInverseSecondary,\n borderRadius: theme.radius.sm,\n // borderRadius must be applied _before_ border to prevent the node from breaking\n border: {\n color: theme.color.strokeInverse,\n width: theme.stroke.sm\n },\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n padding: [\n theme.spacer.md - theme.stroke.sm,\n theme.spacer.xs + theme.stroke.sm,\n theme.spacer.md + theme.stroke.sm,\n theme.spacer.md + theme.stroke.sm\n ]\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutralSecondary,\n borderRadius: theme.radius.sm,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: theme.stroke.sm\n }\n },\n brand: {\n color: theme.color.fillBrand,\n borderRadius: theme.radius.sm,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: theme.stroke.sm\n }\n }\n },\n themeStyles: themeStyles$b\n};\nconst text$6 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.tag1,\n color: theme.color.textNeutral\n },\n tones: {\n inverse: {\n color: theme.color.textInverse\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$b\n};\nconst icon$2 = {\n themeKeys: {\n color: \"iconColor\"\n },\n base: {\n color: theme.color.textNeutral\n },\n tones: {\n inverse: {\n color: theme.color.textInverse\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$b\n};\nconst Container$c = makeComponentStyles(container$c);\nconst Icon$2 = makeComponentStyles(icon$2);\nconst Text$6 = makeComponentStyles(text$6);\nconst styles$c = {\n tone: defaultTone$c || \"neutral\",\n Container: Container$c,\n Icon: Icon$2,\n Text: Text$6\n};\nconst Badge = (props) => {\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2, _b2;\n return props.padding ?? ((_b2 = (_a2 = styles$c.Container) == null ? void 0 : _a2.tones[props.tone ?? styles$c.tone]) == null ? void 0 : _b2.padding) ?? styles$c.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$c.Container.tones[props.tone || styles$c.tone],\n styles$c.Container.base\n ];\n },\n \"forwardStates\": true\n }), true);\n insert(_el$, createComponent(Show, {\n get when() {\n return Boolean(props.icon && props.iconAlign !== \"right\");\n },\n get children() {\n return createComponent(Icon$3, mergeProps(() => props.icon, {\n get style() {\n return [styles$c.Icon.tones[props.tone ?? styles$c.tone], styles$c.Icon.base];\n }\n }));\n }\n }), null);\n insert(_el$, createComponent(Text$7, {\n get style() {\n return [styles$c.Text.tones[props.tone ?? styles$c.tone], styles$c.Text.base];\n },\n get tone() {\n return props.tone || styles$c.tone;\n },\n get children() {\n return props.title;\n }\n }), null);\n insert(_el$, createComponent(Show, {\n get when() {\n return Boolean(props.icon && props.iconAlign === \"right\");\n },\n get children() {\n return createComponent(Icon$3, mergeProps(() => props.icon, {\n get style() {\n var _a2;\n return [\n (_a2 = styles$c.Icon.tones) == null ? void 0 : _a2[props.tone ?? styles$c.tone],\n //\n styles$c.Icon.base\n ];\n }\n }));\n }\n }), null);\n return _el$;\n })();\n};\nconst { Button: { defaultTone: defaultTone$b, ...themeStyles$a } = { styles: {} } } = (_d = theme) == null ? void 0 : _d.componentConfig;\nconst container$b = {\n themeKeys: {\n textAlign: \"textAlign\",\n borderRadius: \"radius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\"\n },\n base: {\n height: theme.typography.button1.lineHeight + theme.spacer.xl * 2,\n display: \"flex\",\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n color: theme.color.interactiveNeutral,\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm,\n contentColor: theme.color.fillNeutral\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse\n },\n brand: {\n color: theme.color.interactiveBrand,\n focus: {\n color: theme.color.fillNeutral\n }\n }\n },\n themeStyles: themeStyles$a\n};\nconst content = {\n themeKeys: {\n color: \"contentColor\"\n },\n base: {\n color: theme.color.textNeutral\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.fillBrand\n }\n }\n },\n themeStyles: themeStyles$a\n};\nconst text$5 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.button1\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.fillBrand\n }\n }\n },\n themeStyles: themeStyles$a\n};\nconst Container$b = makeComponentStyles(container$b);\nconst Content = makeComponentStyles(content);\nconst Text$5 = makeComponentStyles(text$5);\nconst styles$b = {\n tone: defaultTone$b || \"neutral\",\n Container: Container$b,\n Content,\n Text: Text$5\n};\nconst Button = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$b.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$b.tone],\n styles$b.Container.base\n ];\n },\n forwardStates: true,\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n ...[(_a2 = props.style) == null ? void 0 : _a2.Text].flat(),\n //\n styles$b.Text.tones[props.tone ?? styles$b.tone],\n styles$b.Text.base\n ];\n },\n get children() {\n return props.children;\n }\n });\n }\n }));\n};\nconst ButtonContainer = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$b.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$b.tone],\n styles$b.Container.base\n ];\n },\n forwardStates: true\n }));\n};\nconst { Checkbox: { defaultTone: defaultTone$a, ...themeStyles$9 } = { styles: {} } } = (_e = theme) == null ? void 0 : _e.componentConfig;\nconst strokeWidth = theme.stroke.sm;\nconst size = theme.spacer.xxl;\nconst container$a = {\n themeKeys: {\n color: \"color\",\n borderRadius: \"borderRadius\",\n border: \"border\",\n justifyContent: \"justifyContent\"\n },\n base: {\n width: size,\n height: size,\n display: \"flex\",\n justifyContent: \"center\",\n color: theme.color.fillNeutral,\n alignItems: \"center\",\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverse,\n width: strokeWidth\n }\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n tones: {\n brand: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutralSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillBrand\n }\n },\n neutral: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillInverseSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutral\n }\n },\n inverse: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutralSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: strokeWidth\n },\n color: theme.color.fillInverse\n }\n }\n },\n modeKeys: [\"focus\", \"disabled\", \"checked\"],\n themeStyles: themeStyles$9\n};\nconst icon$1 = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n width: theme.spacer.lg,\n height: theme.spacer.lg,\n src: theme.asset.check\n },\n tones: {\n neutral: {\n color: theme.color.fillInverse\n },\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillInverse\n }\n },\n themeStyles: themeStyles$9\n};\nconst Container$a = makeComponentStyles(container$a);\nconst Icon$1 = makeComponentStyles(icon$1);\nconst styles$a = {\n tone: defaultTone$a || \"neutral\",\n Container: Container$a,\n Icon: Icon$1\n};\nconst check = \"/assets/images/check-icon.png\";\nconst Checkbox = (props) => {\n return createComponent(View, mergeProps({\n forwardStates: true\n }, props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$a.Container.tones[props.tone ?? styles$a.tone],\n styles$a.Container.base\n ];\n },\n get states() {\n return {\n checked: props.checked\n };\n },\n get children() {\n return memo(() => !!props.checked)() ? props.children || createComponent(Icon$3, {\n src: check,\n get style() {\n var _a2;\n return [\n ...[(_a2 = props.style) == null ? void 0 : _a2.Icon].flat(),\n //\n styles$a.Icon.tones[props.tone || styles$a.tone],\n styles$a.Icon.base\n ];\n }\n }) : \"\";\n }\n }));\n};\nconst { Column: { defaultTone: defaultTone$9, ...themeStyles$8 } = { styles: {} } } = (_f = theme) == null ? void 0 : _f.componentConfig;\nconst container$9 = {\n themeKeys: {\n gap: \"itemSpacing\",\n scrollIndex: \"scrollIndex\",\n itemTransition: \"itemTransition\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"flexStart\",\n flexDirection: \"column\",\n gap: theme.layout.gutterY,\n itemTransition: {\n ...theme.animation.standardEntrance,\n duration: theme.animation.duration.fast\n }\n },\n themeStyles: themeStyles$8\n};\nconst Container$9 = makeComponentStyles(container$9);\nconst styles$9 = {\n tone: defaultTone$9 || \"neutral\",\n Container: Container$9\n};\nconst Column = (props) => {\n const onUp = handleNavigation(\"up\");\n const onDown = handleNavigation(\"down\");\n return createComponent(View, mergeProps(props, {\n get onUp() {\n return chainFunctions(props.onUp, onUp);\n },\n get onDown() {\n return chainFunctions(props.onDown, onDown);\n },\n get selected() {\n return props.selected || 0;\n },\n forwardFocus: onGridFocus,\n get onSelectedChanged() {\n return chainFunctions(props.onSelectedChanged, props.scroll !== \"none\" ? withScrolling(props.y) : void 0);\n },\n get style() {\n return [...[props.style].flat(), styles$9.Container.tones[props.tone ?? styles$9.tone], styles$9.Container.base];\n }\n }));\n};\nconst { Label: { defaultTone: defaultTone$8, ...themeStyles$7 } = { styles: {} } } = (_g = theme) == null ? void 0 : _g.componentConfig;\nconst container$8 = {\n themeKeys: {\n color: \"backgroundColor\",\n borderRadius: \"radius\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"center\",\n color: theme.color.textNeutral,\n padding: [theme.spacer.md, theme.spacer.lg],\n // TODO themed padding values\n borderRadius: [theme.radius.md, theme.radius.md, theme.radius.md, theme.radius.none],\n height: theme.typography.caption1.lineHeight + theme.spacer.md,\n neutral: {\n backgroundColor: theme.color.fillNeutral\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.orange\n }\n }\n },\n themeStyles: themeStyles$7\n};\nconst text$4 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.caption1,\n color: theme.color.textInverse\n },\n tones: {\n inverse: {\n color: theme.color.textNeutral\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$7\n};\nconst Container$8 = makeComponentStyles(container$8);\nconst Text$4 = makeComponentStyles(text$4);\nconst styles$8 = {\n tone: defaultTone$8 || \"neutral\",\n Container: Container$8,\n Text: Text$4\n};\nconst Label = (props) => {\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2;\n return props.padding ?? ((_a2 = styles$8.Container.tones[props.tone ?? styles$8.tone]) == null ? void 0 : _a2.padding) ?? styles$8.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$8.Container.tones[props.tone || styles$8.tone],\n styles$8.Container.base\n ];\n },\n \"forwardStates\": true\n }), true);\n insert(_el$, createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$8.Text.tones[props.tone || styles$8.tone],\n styles$8.Text.base\n ];\n },\n get children() {\n return props.title;\n }\n }));\n return _el$;\n })();\n};\nconst { Rating: { styles: themeStyles$6, defaultTone: defaultTone$7 } = { styles: {}, defaultTone: \"neutral\" } } = (_h = theme) == null ? void 0 : _h.componentConfig;\nconst container$7 = {\n themeKeys: {\n justifyContent: \"justifyContent\",\n itemSpacing: \"itemSpacing\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n itemSpacing: theme.spacer.sm\n },\n toneModes: {},\n themeStyles: themeStyles$6\n};\nconst text$3 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n color: theme.color.textNeutral,\n ...theme.typography.body2\n },\n toneModes: {},\n themeStyles: themeStyles$6\n};\nconst icon = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n height: theme.typography.body2.lineHeight,\n width: theme.typography.body2.lineHeight,\n color: theme.color.fillNeutral,\n marginRight: theme.spacer.sm\n },\n toneModes: {},\n themeStyles: themeStyles$6\n};\nconst Container$7 = makeComponentStyles(container$7);\nconst Icon = makeComponentStyles(icon);\nconst Text$3 = makeComponentStyles(text$3);\nconst styles$7 = {\n tone: defaultTone$7,\n Container: Container$7,\n Text: Text$3,\n Icon\n};\nconst Rating = (props) => {\n const formatTitle = (title) => {\n if (typeof title !== \"string\" && typeof title !== \"number\" || !String(title).trim().length) {\n return;\n }\n let formatted = title;\n if (!Number.isNaN(title) && Number(title) >= 0 && Number(title) <= 100) {\n formatted += \"%\";\n }\n return formatted;\n };\n const formattedTitle = createMemo(() => formatTitle(props.title));\n return createComponent(View, mergeProps(props, {\n forwardStates: true,\n get style() {\n return [...[props.style].flat(), styles$7.Container.tones[props.tone || styles$7.tone], styles$7.Container.base];\n },\n get children() {\n return [createComponent(Show, {\n get when() {\n return props.src;\n },\n get children() {\n return createComponent(Icon$3, {\n forwardStates: true,\n get src() {\n return props.src;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Icon,\n //\n styles$7.Icon.tones[props.tone || styles$7.tone],\n styles$7.Icon.base\n ];\n }\n });\n }\n }), createComponent(Show, {\n get when() {\n return formattedTitle();\n },\n get children() {\n return createComponent(Text$7, {\n get marginRight() {\n return props.marginRight;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$7.Text.tones[props.tone || styles$7.tone],\n styles$7.Text.base\n ];\n },\n get children() {\n return formattedTitle();\n }\n });\n }\n })];\n }\n }));\n};\nconst { Details: { defaultTone: defaultTone$6, ...themeStyles$5 } = { styles: {} } } = (_i = theme) == null ? void 0 : _i.componentConfig;\nconst container$6 = {\n themeKeys: {\n alignItems: \"alignItems\",\n contentSpacing: \"contentSpacing\",\n badgeContentSpacing: \"badgeContentSpacing\",\n ratingContentSpacing: \"ratingContentSpacing\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n contentSpacing: theme.spacer.lg,\n badgeContentSpacing: theme.spacer.sm,\n ratingContentSpacing: theme.spacer.lg\n },\n themeStyles: themeStyles$5\n};\nconst text$2 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.body2,\n marginRight: theme.spacer.lg,\n color: theme.color.textNeutral\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverse,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutral,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$5\n};\nconst Container$6 = makeComponentStyles(container$6);\nconst Text$2 = makeComponentStyles(text$2);\nconst styles$6 = {\n tone: defaultTone$6 || \"neutral\",\n Container: Container$6,\n Text: Text$2\n};\nconst Details = (props) => {\n return createComponent(View, mergeProps({\n get style() {\n return [...[props.style].flat(), styles$6.Container.tones[props.tone || styles$6.tone], styles$6.Container.base];\n },\n forwardStates: true,\n onBeforeLayout: (node, dimensions) => {\n var _a2;\n if ((dimensions == null ? void 0 : dimensions.height) && node.parent) {\n node.parent.height = dimensions.height;\n (_a2 = node.parent) == null ? void 0 : _a2.updateLayout();\n }\n }\n }, props, {\n get children() {\n return [createComponent(Show, {\n get when() {\n return props.title;\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$6.Text.tones[props.tone || styles$6.tone],\n styles$6.Text.base\n ];\n },\n get children() {\n return props.title;\n }\n });\n }\n }), createComponent(For$1, {\n get each() {\n return props.badges;\n },\n children: (badge, idx) => createComponent(Badge, mergeProps(badge, {\n get marginRight() {\n var _a2, _b2, _c2, _d2, _e2, _f2, _g2;\n return ((_a2 = props.badges) == null ? void 0 : _a2.length) && idx() === props.badges.length - 1 ? ((_c2 = (_b2 = props.style) == null ? void 0 : _b2.Container) == null ? void 0 : _c2.contentSpacing) ?? ((_d2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _d2.contentSpacing) ?? styles$6.Container.base.contentSpacing : ((_f2 = (_e2 = props.style) == null ? void 0 : _e2.Container) == null ? void 0 : _f2.badgeContentSpacing) ?? ((_g2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _g2.badgeContentSpacing) ?? styles$6.Container.base.badgeContentSpacing;\n }\n }))\n }), createComponent(For$1, {\n get each() {\n return props.ratings;\n },\n children: (rating, idx) => createComponent(Rating, mergeProps(rating, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$6.Text.tones[props.tone || styles$6.tone],\n styles$6.Text.base\n ];\n },\n forwardStates: true,\n get marginRight() {\n var _a2, _b2, _c2, _d2;\n return ((_a2 = props.ratings) == null ? void 0 : _a2.length) && idx() === props.ratings.length - 1 ? 0 : ((_c2 = (_b2 = props.style) == null ? void 0 : _b2.Container) == null ? void 0 : _c2.ratingContentSpacing) ?? ((_d2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _d2.ratingContentSpacing) ?? styles$6.Container.base.ratingContentSpacing;\n }\n }))\n })];\n }\n }));\n};\nconst { Metadata: { defaultTone: defaultTone$5, ...themeStyles$4 } = { styles: {} } } = (_j = theme) == null ? void 0 : _j.componentConfig;\nconst container$5 = {\n themeKeys: {\n justifyContent: \"justifyContent\",\n alpha: \"alpha\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n alpha: theme.alpha.primary\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n themeStyles: themeStyles$4\n};\nconst titleText = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n maxLines: 1,\n contain: \"width\",\n ...theme.typography.headline3,\n color: theme.color.textNeutral\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverse,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutral,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$4\n};\nconst descriptionText = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n contain: \"width\",\n maxLines: 2,\n ...theme.typography.body2,\n color: theme.color.textNeutralSecondary\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverseSecondary,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutralSecondary,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$4\n};\nconst Container$5 = makeComponentStyles(container$5);\nconst DescriptionText = makeComponentStyles(descriptionText);\nconst TitleText = makeComponentStyles(titleText);\nconst styles$5 = {\n tone: defaultTone$5 || \"neutral\",\n Container: Container$5,\n TitleText,\n DescriptionText\n};\nconst Metadata = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n return [...[props.style].flat(), styles$5.Container.tones[props.tone || styles$5.tone], styles$5.Container.base];\n },\n forwardStates: true,\n get children() {\n return [createComponent(Text$7, {\n get width() {\n return props.width;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.TitleText,\n //\n styles$5.TitleText.tones[props.tone || styles$5.tone],\n styles$5.TitleText.base\n ];\n },\n get children() {\n return props.title;\n }\n }), createComponent(Show, {\n get when() {\n return props.description;\n },\n get children() {\n return createComponent(Text$7, {\n get width() {\n return props.width;\n },\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.DescriptionText, styles$5.DescriptionText.tones[props.tone || styles$5.tone], styles$5.DescriptionText.base];\n },\n get children() {\n return props.description;\n }\n });\n }\n }), createComponent(Details, mergeProps({\n get width() {\n return props.width;\n }\n }, () => props.details, {\n get tone() {\n return props.tone ?? styles$5.tone;\n }\n }))];\n }\n }));\n};\nconst { ProgressBar: { defaultTone: defaultTone$4, ...themeStyles$3 } = { styles: {} } } = (_k = theme) == null ? void 0 : _k.componentConfig;\nconst container$4 = {\n themeKeys: {\n color: \"barColor\",\n borderRadius: \"borderRadius\"\n },\n base: {\n height: theme.spacer.md,\n color: theme.color.fillNeutralTertiary,\n borderRadius: theme.radius.xs\n },\n tones: {\n inverse: {\n color: theme.color.fillInverseTertiary\n }\n },\n themeStyles: themeStyles$3\n};\nconst progress = {\n themeKeys: {\n color: \"progressColor\",\n borderRadius: \"borderRadius\"\n },\n base: {\n borderRadius: theme.radius.xs,\n color: theme.color.fillNeutral\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand\n }\n },\n themeStyles: themeStyles$3\n};\nconst Container$4 = makeComponentStyles(container$4);\nconst ProgressBar$1 = makeComponentStyles(progress);\nconst styles$4 = {\n tone: defaultTone$4 || \"neutral\",\n Container: Container$4,\n ProgressBar: ProgressBar$1\n};\nconst ProgressBar = (props) => {\n return createComponent(View, mergeProps(props, {\n forwardStates: true,\n get style() {\n return [...[props.style].flat(), styles$4.Container.tones[props.tone || styles$4.tone], styles$4.Container.base];\n },\n get children() {\n return createComponent(View, {\n forwardStates: true,\n get animationSettings() {\n return props.animationSettings;\n },\n get width() {\n return props.width * props.progress;\n },\n get color() {\n return props.progressColor;\n },\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.ProgressBar, styles$4.ProgressBar.tones[props.tone || styles$4.tone], styles$4.ProgressBar.base];\n }\n });\n }\n }));\n};\nconst { Row: { defaultTone: defaultTone$3, ...themeStyles$2 } = { styles: {} } } = (_l = theme) == null ? void 0 : _l.componentConfig;\nconst container$3 = {\n themeKeys: {\n gap: \"itemSpacing\",\n scrollIndex: \"scrollIndex\",\n itemTransition: \"itemTransition\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"flexStart\",\n flexDirection: \"row\",\n gap: theme.layout.gutterX,\n width: theme.layout.screenW,\n itemTransition: {\n ...theme.animation.standardEntrance,\n duration: theme.animation.duration.fast\n }\n },\n themeStyles: themeStyles$2\n};\nconst Container$3 = makeComponentStyles(container$3);\nconst styles$3 = {\n tone: defaultTone$3,\n Container: Container$3\n};\nconst Row = (props) => {\n const onLeft = handleNavigation(\"left\");\n const onRight = handleNavigation(\"right\");\n return createComponent(View, mergeProps(props, {\n get selected() {\n return props.selected || 0;\n },\n get onLeft() {\n return chainFunctions(props.onLeft, onLeft);\n },\n get onRight() {\n return chainFunctions(props.onRight, onRight);\n },\n forwardFocus: onGridFocus,\n get onSelectedChanged() {\n return chainFunctions(props.onSelectedChanged, props.scroll !== \"none\" ? withScrolling(props.x) : void 0);\n },\n get tone() {\n return props.tone ?? styles$3.tone;\n },\n get style() {\n return [...[props.style].flat(), styles$3.Container.tones[props.tone || styles$3.tone], styles$3.Container.base];\n },\n get states() {\n return props.tone ?? styles$3.tone;\n }\n }));\n};\nconst { Keyboard: { defaultTone: defaultTone$2, ...themeStyles$1 } = { styles: {} } } = (_m = theme) == null ? void 0 : _m.componentConfig;\nconst container$2 = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n screenW: \"screenW\",\n marginX: \"marginX\"\n },\n base: {\n keySpacing: theme.spacer.md,\n screenW: theme.layout.screenW,\n marginX: theme.layout.marginX,\n height: 100\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$1\n};\nconst key = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n textAlign: \"textAlign\",\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\",\n baseWidth: \"baseWidth\",\n sizes: \"sizes\",\n contentColor: \"contentColor\"\n // what is this used for\n },\n base: {\n keySpacing: theme.spacer.md,\n height: theme.spacer.md * 9,\n paddingX: theme.spacer.md,\n sizes: {\n sm: 1,\n md: 2,\n lg: 3,\n xl: 4,\n xxl: 5\n },\n contentColor: theme.color.fillNeutral,\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n baseWidth: theme.spacer.md * 7,\n color: theme.color.interactiveNeutral,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled,\n contentColor: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse,\n focus: {\n color: theme.color.interactiveInverseFocus,\n contentColor: theme.color.fillNeutral\n }\n },\n brand: {\n focus: {\n contentColor: theme.color.fillNeutral\n }\n }\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$1\n};\nconst text$1 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.headline2\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n focus: {\n color: theme.color.textNeutral\n }\n }\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$1\n};\nconst Container$2 = makeComponentStyles(container$2);\nconst Key$1 = makeComponentStyles(key);\nconst Text$1 = makeComponentStyles(text$1);\nconst styles$2 = {\n tone: defaultTone$2,\n Container: Container$2,\n Key: Key$1,\n // TODO why was this wrapped in {}?\n Text: Text$1\n};\nconst { Key: { defaultTone: defaultTone$1, ...themeStyles } = { styles: {} } } = (_n = theme) == null ? void 0 : _n.componentConfig;\nconst container$1 = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n textAlign: \"textAlign\",\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\",\n baseWidth: \"baseWidth\",\n sizes: \"sizes\",\n contentColor: \"contentColor\"\n },\n base: {\n keySpacing: theme.spacer.md,\n height: theme.spacer.md * 9,\n paddingX: theme.spacer.md,\n contentColor: theme.color.fillNeutral,\n sizes: {\n sm: 1,\n md: 2,\n lg: 3,\n xl: 4,\n xxl: 5\n },\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n baseWidth: theme.spacer.md * 7,\n color: theme.color.interactiveNeutral,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled,\n contentColor: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse,\n focus: {\n color: theme.color.interactiveInverseFocus,\n contentColor: theme.color.fillNeutral\n }\n },\n brand: {\n focus: {\n contentColor: theme.color.fillNeutral\n }\n }\n },\n themeStyles\n};\nconst text = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.headline2\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n focus: {\n color: theme.color.textNeutral\n }\n }\n },\n themeStyles\n};\nconst Container$1 = makeComponentStyles(container$1);\nconst Text = makeComponentStyles(text);\nconst styles$1 = {\n tone: defaultTone$1 || \"neutral\",\n Container: Container$1,\n Text\n};\nconst Key = (props) => {\n const style1 = (props == null ? void 0 : props.style) ?? styles$1;\n return createComponent(ButtonContainer, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$1.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$1.tone],\n styles$1.Container.base\n ];\n },\n forwardStates: true,\n get width() {\n var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2;\n return (((_d2 = (_c2 = (_b2 = (_a2 = style1.Container) == null ? void 0 : _a2.tones) == null ? void 0 : _b2[props.tone ?? styles$1.tone]) == null ? void 0 : _c2.sizes) == null ? void 0 : _d2[props.size || \"sm\"]) ?? style1.Container.base.sizes[props.size || \"sm\"]) * (((_g2 = (_f2 = (_e2 = style1.Container) == null ? void 0 : _e2.tones) == null ? void 0 : _f2[props.tone ?? styles$1.tone]) == null ? void 0 : _g2.baseWidth) ?? style1.Container.base.baseWidth) + (((_i2 = (_h2 = style1.Container.tones) == null ? void 0 : _h2[props.tone ?? styles$1.tone]) == null ? void 0 : _i2.keySpacing) ?? style1.Container.base.keySpacing) * (((_l2 = (_k2 = (_j2 = style1.Container.tones) == null ? void 0 : _j2[props.tone ?? styles$1.tone]) == null ? void 0 : _k2.sizes) == null ? void 0 : _l2[props.size || \"sm\"]) ?? style1.Container.base.sizes[props.size || \"sm\"] - 1);\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$1.Text.tones[props.tone ?? styles$1.tone],\n styles$1.Text.base\n ];\n },\n get children() {\n return props.title ? props.title : \"\";\n }\n });\n }\n }));\n};\nconst KeyboardSimple = (props) => {\n return createComponent(Column, {\n get autofocus() {\n return props.autofocus;\n },\n plinko: true,\n get itemSpacing() {\n var _a2;\n return props.keySpacing ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.keySpacing) ?? styles$2.Container.base.keySpacing;\n },\n get justifyContent() {\n return props.centerKeyboard && props.centerKeyboard ? \"center\" : \"flexStart\";\n },\n get children() {\n return createComponent(For, {\n get each() {\n return props.formats;\n },\n children: (row) => createComponent(Row, {\n get justifyContent() {\n return props.centerKeys && props.centerKeys ? \"center\" : \"flexStart\";\n },\n get itemSpacing() {\n var _a2;\n return props.keySpacing ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.keySpacing) ?? styles$2.Container.base.keySpacing;\n },\n get height() {\n var _a2;\n return (props == null ? void 0 : props.height) ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.height) ?? styles$2.Container.base.height;\n },\n get wrap() {\n return props.rowWrap;\n },\n get children() {\n return createComponent(For, {\n each: row,\n children: (key2) => createComponent(Key, mergeProps({\n get style() {\n var _a2;\n return (_a2 = props.style) == null ? void 0 : _a2.Key;\n }\n }, typeof key2 === \"string\" ? {} : key2, {\n get title() {\n return key2.title || key2.icon ? key2.title : key2;\n }\n }))\n });\n }\n })\n });\n }\n });\n};\nconst Keyboard = (props) => {\n return createComponent(KeyboardSimple, mergeProps(props, {\n get style() {\n return [...[props.style].flat(), styles$2.Container.tones[props.tone ?? styles$2.tone], styles$2.Container.base];\n }\n }));\n};\nconst { Tile: { defaultTone, ...tileThemeStyles } = { styles: {} } } = (_o = theme) == null ? void 0 : _o.componentConfig;\nconst { Surface: { defaultSurfaceTone, ...surfaceThemeStyles } = { styles: {} } } = (_p = theme) == null ? void 0 : _p.componentConfig;\nconst container = {\n themeKeys: {\n alpha: \"alpha\",\n paddingYProgress: \"paddingYProgress\"\n },\n base: {\n width: 400,\n height: 240,\n padding: [40, 10],\n // TODO support separate paddingX and paddingY values from theme, possibly formatter\n paddingYProgress: theme.spacer.xl,\n paddingYBetweenContent: theme.spacer.md,\n borderRadius: theme.radius.md,\n alpha: theme.alpha.primary\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n themeStyles: {\n ...surfaceThemeStyles,\n ...tileThemeStyles\n }\n};\nconst insetBottom = {\n themeKeys: {},\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n mountY: 1\n },\n themeStyles: tileThemeStyles\n};\nconst standardBottom = {\n themeKeys: {},\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\"\n },\n themeStyles: tileThemeStyles\n};\nconst logoContainer = {\n themeKeys: {},\n base: {\n width: theme.spacer.lg * 5,\n height: theme.spacer.xxl + theme.spacer.md\n },\n themeStyles: tileThemeStyles\n};\nconst Container = makeComponentStyles(container);\nconst InsetBottom = makeComponentStyles(insetBottom);\nconst StandardBottom = makeComponentStyles(standardBottom);\nconst LogoContainer = makeComponentStyles(logoContainer);\nconst styles = {\n tone: defaultTone || defaultSurfaceTone || \"neutral\",\n Container,\n InsetBottom,\n StandardBottom,\n LogoContainer\n};\nconst Tile = (props) => {\n const [isFocused, setIsFocused] = createSignal(false);\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2;\n return props.padding ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.padding) ?? styles.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n \"onFocus\": () => setIsFocused(true),\n \"onBlur\": () => setIsFocused(false),\n get style() {\n return [...[props.style].flat(), styles.Container.tones[props.tone ?? styles.tone], styles.Container.base];\n }\n }), true);\n insert(_el$, createComponent(Artwork, mergeProps(() => props.artwork, {\n get tone() {\n return props.tone ?? styles.tone;\n },\n get width() {\n var _a2;\n return props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width;\n },\n get height() {\n var _a2;\n return props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height;\n }\n })), null);\n insert(_el$, createComponent(Show, {\n get when() {\n return props.persistentMetadata || isFocused();\n },\n get children() {\n return [createComponent(View, {\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[1]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[1]) ?? styles.Container.base.padding[1];\n },\n get children() {\n return props.topLeft;\n }\n }), createComponent(View, {\n get x() {\n var _a2, _b2, _c2;\n return ((props == null ? void 0 : props.width) ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[0]) ?? ((_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0]);\n },\n get y() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[1]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[1]) ?? styles.Container.base.padding[1];\n },\n mountX: 1,\n get children() {\n return props.topRight;\n }\n }), createComponent(View, {\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.InsetBottom, styles.InsetBottom.tones[props.tone ?? styles.tone], styles.InsetBottom.base];\n },\n get width() {\n var _a2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - styles.Container.base.padding[0] * 2;\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2, _d2, _e2, _f2;\n return (props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) - (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]) - (((_e2 = props.progressBar) == null ? void 0 : _e2.progress) > 0 ? props.paddingYProgress ?? ((_f2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _f2.paddingYProgress) ?? styles.Container.base.paddingYProgress : 0);\n },\n get children() {\n return props.inset;\n }\n }), createComponent(View, {\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.StandardBottom, styles.StandardBottom.tones[props.tone ?? styles.tone], styles.StandardBottom.base];\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2, _d2;\n return Number(props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) + (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]);\n },\n get width() {\n var _a2, _b2, _c2, _d2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]) * 2;\n },\n get children() {\n return props.bottom;\n }\n })];\n }\n }), null);\n insert(_el$, createComponent(Show, {\n get when() {\n var _a2;\n return ((_a2 = props.progressBar) == null ? void 0 : _a2.progress) ? props.progressBar.progress > 0 : 0;\n },\n get children() {\n return createComponent(ProgressBar, mergeProps(() => props.progressBar, {\n get width() {\n var _a2, _b2, _c2, _d2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[0]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[0]) ?? styles.Container.base.padding[0]) * 2;\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2;\n return (props.height ?? props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) - (props.paddingYProgress ?? ((_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.paddingYProgress) ?? styles.Container.base.paddingYProgress) - (((_c2 = props == null ? void 0 : props.progressBar) == null ? void 0 : _c2.height) || 0);\n }\n }));\n }\n }), null);\n return _el$;\n })();\n};\nexport {\n Artwork,\n Badge,\n Button,\n ButtonContainer,\n Checkbox,\n Column,\n Icon$3 as Icon,\n Keyboard,\n Label,\n Metadata,\n ProgressBar,\n Row,\n Tile,\n styles$e as artworkStyles,\n assertTruthy,\n styles$c as badgeStyles,\n styles$b as buttonStyles,\n chainFunctions,\n styles$a as checkboxStyles,\n styles$9 as columnStyles,\n handleNavigation,\n styles$d as iconStyles,\n styles$2 as keyboardStyles,\n styles$8 as labelStyles,\n makeComponentStyles,\n styles$5 as metadataStyles,\n onGridFocus,\n styles$4 as progressBarStyles,\n styles$3 as rowStyles,\n scrollToIndex,\n styles as tileStyles,\n useItemLayout,\n withScrolling\n};\n//# sourceMappingURL=index.js.map\n","export default {\n name: 'Base Lightning TV',\n alpha: {\n primary: 1,\n secondary: 0.7,\n tertiary: 0.1,\n inactive: 0.5,\n full: 1,\n none: 0,\n alpha1: 0.1,\n alpha2: 0.3,\n alpha3: 0.5,\n alpha4: 0.7,\n alpha5: 0.9\n },\n animation: {\n duration: {\n none: 0,\n xfast: 0.1,\n fast: 0.25,\n normal: 0.5,\n slow: 0.75,\n xslow: 0.9\n },\n delay: {\n none: 0,\n xfast: 0.01,\n fast: 0.025,\n normal: 0.05,\n slow: 0.075,\n xslow: 0.09\n },\n expressive: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n expressiveEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n expressiveExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standard: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standardEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standardExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utility: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utilityEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utilityExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n }\n },\n asset: {\n arrowLeft:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAi0lEQVRIDWNgGAWjIfD//38JID5Fk5AAGqwKxPeA+D/VLQCaaQLEr0CGgwBVLQCa5wbEn0EGwwDVLAAaGA3Ev2AGw2iqWAA0rBiI/8EMRaYptgBoWDeygehsci1gIlcjWfqArqZdEMFcBLSEdpGMZAntkimSJbTLaEiW0K6oQLKEdoUdzJJRemiHAAD4n+yzPWCs7QAAAABJRU5ErkJggg==',\n arrowRight:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAg0lEQVRIDWNgGAWjIYArBP7//38KiCVwyVMsDjQcBO4BsSrFhmEzAGw8hHgFpEywqaFIDMkCEPMzELtRZCC6ZjQLQNxfQByNro5sPhYLQEL/gLiYbEORNeKwACbcDVPLBGMMOhrmVDSapkFE00imaTKlaUajaVFB28Ju0CXrUQfhDAEAEgHss6NhpLQAAAAASUVORK5CYII=',\n backspaceOutline:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0T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YNxsPyzA7yst/4iSdvEMFqaHUCjKZEZ91IgAeolWzotFEiAkoWQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC',\n check:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAOCAYAAAAi2ky3AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACtSURBVHgBvdPdDcIgEAfwoy8Nb45QN3AGF2s36Ahu4gpuIDoBfSgfpdoTlCbEWEMh6T8hFzjyg5AAkBHOcQe5UWqspRx435sDpMYj6IYQwwVSEiJ2MKVUBWuzLSLl2HL+uxmNCGFO8yaL7RHxve6qRZoAuS4hxac8735elWVx7jrtMKL1o0Gcat9jhExHSukN/kUIFZ7MpDRtzE1isDRkAUtDvrA8ZI597FUf8gWH9P0b4gko9wAAAABJRU5ErkJggg=='\n },\n color: {\n palette: {\n 'blue-20': '0xbecffeff',\n 'blue-40': '0x93a9fdff',\n 'blue-90': '0x000033ff',\n 'grey-05': '0xf8f7faff',\n 'grey-40': '0x929096ff',\n 'grey-70': '0x48474bff',\n 'grey-90': '0x181819ff'\n },\n white: '0xffffffff',\n black: '0x000000ff',\n grey: '0x929096ff',\n red: '0xe74c3cff',\n orange: '0xdc7633ff',\n yellow: '0xf7dc6fff',\n green: '0x2ecc71ff',\n blue: '0x93a9fdff',\n purple: '0x663399ff',\n material: '0x181819ff',\n materialBrand: '0x000033ff',\n overlay: '0x181819b3',\n textNeutral: '0xf8f7faff',\n textNeutralSecondary: '0xf8f7fab3',\n textNeutralTertiary: '0xf8f7fa1a',\n textNeutralDisabled: '0xf8f7fa80',\n textInverse: '0x181819ff',\n textInverseSecondary: '0x181819b3',\n textInverseTertiary: '0x1818191a',\n textInverseDisabled: '0x18181980',\n textBrand: '0x93a9fdff',\n textBrandSecondary: '0x93a9fdb3',\n textBrandTertiary: '0x93a9fd1a',\n textBrandDisabled: '0x93a9fd80',\n textPositive: '0x2ecc71ff',\n textNegative: '0xe74c3cff',\n textInfo: '0x93a9fdff',\n textCaution: '0xdc7633ff',\n fillTransparent: '0xffffff0',\n fillNeutral: '0xf8f7faff',\n fillNeutralSecondary: '0xf8f7fab3',\n fillNeutralTertiary: '0xf8f7fa1a',\n fillNeutralDisabled: '0xf8f7fa80',\n fillInverse: '0x181819ff',\n fillInverseSecondary: '0x181819b3',\n fillInverseTertiary: '0x1818191a',\n fillInverseDisabled: '0x18181980',\n fillBrand: '0x93a9fdff',\n fillBrandSecondary: '0x93a9fdb3',\n fillBrandTertiary: '0x93a9fd1a',\n fillBrandDisabled: '0x93a9fd80',\n fillPositive: '0x2ecc71ff',\n fillNegative: '0xe74c3cff',\n fillInfo: '0x93a9fdff',\n fillCaution: '0xdc7633ff',\n strokeNeutral: '0xf8f7faff',\n strokeNeutralSecondary: '0xf8f7fab3',\n strokeNeutralTertiary: '0xf8f7fa1a',\n strokeNeutralDisabled: '0xf8f7fa80',\n strokeInverse: '0x181819ff',\n strokeInverseSecondary: '0x181819b3',\n strokeInverseTertiary: '0x1818191a',\n strokeInverseDisabled: '0x18181980',\n strokeBrand: '0x93a9fdff',\n strokeBrandSecondary: '0x93a9fdb3',\n strokeBrandTertiary: '0x93a9fd1a',\n strokeBrandDisabled: '0x93a9fd80',\n strokePositive: '0x2ecc71ff',\n strokeNegative: '0xe74c3cff',\n strokeInfo: '0x93a9fdff',\n strokeCaution: '0xdc7633ff',\n interactiveNeutral: '0xffffff1a',\n interactiveNeutralFocus: '0xffffffff',\n interactiveNeutralFocusSoft: '0xffffff1a',\n interactiveInverse: '0x48474b1a',\n interactiveInverseFocus: '0x48474bff',\n interactiveInverseFocusSoft: '0x48474b1a',\n interactiveBrand: '0xbecffe1a',\n interactiveBrandFocus: '0xbecffeff',\n interactiveBrandFocusSoft: '0xbecffe1a',\n shadowNeutral: '0x000000b3',\n shadowNeutralFocus: '0x000000b3',\n shadowNeutralFocusSoft: '0x000000b3',\n shadowNeutralText: '0x000000ff',\n shadowInverse: '0x000000b3',\n shadowInverseFocus: '0x000000b3',\n shadowInverseFocusSoft: '0x000000b3',\n shadowInverseText: '0x000000ff',\n shadowBrand: '0x000000b3',\n shadowBrandFocus: '0x000000b3',\n shadowBrandFocusSoft: '0x000000b3',\n shadowBrandText: '0x000000ff'\n },\n font: [],\n layout: {\n columnCount: 10,\n focusScale: 1.2,\n gutterX: 20,\n gutterY: 20,\n marginX: 150,\n marginY: 150,\n safe: 50,\n screenW: 1920,\n screenH: 1080\n },\n radius: { none: 0, xs: 2, sm: 4, md: 8, lg: 16, xl: 24 },\n spacer: {\n none: 0,\n xxs: 2,\n xs: 4,\n sm: 8,\n md: 10,\n lg: 20,\n xl: 30,\n xxl: 40,\n xxxl: 50\n },\n stroke: { none: 0, sm: 2, md: 4, lg: 6, xl: 8 },\n typography: {\n display1: {\n fontFamily: 'Arial',\n fontSize: 75,\n lineHeight: 85,\n fontWeight: 500,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n display2: {\n fontFamily: 'Arial',\n fontSize: 50,\n lineHeight: 60,\n fontWeight: 500,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline1: {\n fontFamily: 'Arial',\n fontSize: 35,\n fontWeight: 500,\n lineHeight: 48,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline2: {\n fontFamily: 'Arial',\n fontSize: 30,\n fontWeight: 500,\n lineHeight: 40,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline3: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 500,\n lineHeight: 36,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body1: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 300,\n lineHeight: 40,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body2: {\n fontFamily: 'Arial',\n fontSize: 22,\n fontWeight: 300,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body3: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 300,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n button1: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n button2: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n callout1: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n caption1: {\n fontFamily: 'Arial',\n fontSize: 15,\n fontWeight: 500,\n lineHeight: 24,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n tag1: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 24,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n footnote1: {\n fontFamily: 'Arial',\n fontSize: 22,\n fontWeight: 300,\n lineHeight: 30,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n }\n },\n componentConfig: {\n Keyboard: {\n base: {\n keyProps: {\n delete: {\n title: null,\n icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGohMqUBAAQZ80zUVQAKUEIQ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kAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC'\n }\n }\n }\n }\n }\n};\n","import { type AnimationSettings } from \"@lightningjs/renderer\";\nimport { globalBackground } from \"../state.js\";\nimport {\n type IntrinsicNodeStyleProps,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { createEffect, on } from \"solid-js\";\nimport { debounce } from \"@solid-primitives/scheduled\";\nimport theme from \"theme\";\n\nexport default function Background() {\n let bg1, bg2, heroMask;\n let active = 0;\n const alpha = 1;\n const animationSettings = {\n duration: 750,\n easing: \"ease-in-out\",\n } satisfies Partial;\n const bgStyles = {\n alpha,\n color: 0xffffffff,\n } satisfies IntrinsicNodeStyleProps;\n\n function changeBackgrounds(img: string) {\n if (img.startsWith(\"#\")) {\n bg1.color = hexColor(img);\n bg1.src = \"\";\n bg1.alpha = 1;\n active = 1;\n bg2.alpha = 0;\n heroMask.alpha = 0;\n return;\n } else {\n bg1.color = 0xffffffff;\n heroMask.alpha = 1;\n }\n\n if (active === 0) {\n bg1.src = img;\n active = 1;\n return;\n }\n\n if (active === 1) {\n bg2.src = img;\n active = 2;\n bg2.alpha = 0;\n bg2.animate({ alpha }, animationSettings).start();\n bg1.animate({ alpha: 0 }, animationSettings).start();\n return;\n }\n\n if (active === 2) {\n bg1.src = img;\n active = 1;\n bg1.alpha = 0;\n bg1.animate({ alpha }, animationSettings).start();\n bg2.animate({ alpha: 0 }, animationSettings).start();\n }\n }\n\n const delayedBackgrounds = debounce(changeBackgrounds, 400);\n\n createEffect(\n on(\n globalBackground,\n (img: string) => {\n delayedBackgrounds(img);\n },\n { defer: true },\n ),\n );\n\n return (\n <>\n \n \n \n \n \n \n );\n}\n","import { IntrinsicNodeStyleProps, hexColor } from \"@lightningjs/solid\";\nimport theme from \"theme\";\n\nexport default {\n Column: {\n flexDirection: \"column\",\n display: \"flex\",\n width: 320,\n height: 600,\n y: 360,\n gap: 20,\n zIndex: 101,\n transition: {\n x: {\n duration: 250,\n easing: \"ease-in-out\",\n },\n },\n x: 8,\n focus: {\n x: theme.layout.marginX,\n },\n } satisfies IntrinsicNodeStyleProps,\n Gradient: {\n zIndex: 99,\n color: hexColor(\"#000000\"),\n src: \"./assets/sidenav.png\",\n alpha: 0,\n width: 1200,\n height: 1080,\n focus: {\n alpha: 1,\n },\n transition: { alpha: true },\n } satisfies IntrinsicNodeStyleProps,\n NavButton: {\n zIndex: 102,\n height: 70,\n width: 100,\n borderRadius: 8,\n focus: {\n color: hexColor(\"#424242\"),\n },\n active: {\n width: 328,\n height: 70,\n },\n } satisfies IntrinsicNodeStyleProps,\n};\n","import { For, IntrinsicNodeProps, View } from \"@lightningjs/solid\";\nimport { createSpriteMap } from \"@lightningjs/solid-primitives\";\n// Icons from https://uxwing.com/\n\nconst basePath = import.meta.env.BASE_URL;\n\nconst icons = [\n { name: \"experiment\", width: 81, height: 100, x: 0, y: 0 },\n { name: \"trending\", width: 100, height: 56, x: 81, y: 0 },\n { name: \"tv\", width: 100, height: 68, x: 181, y: 0 },\n { name: \"movie\", width: 94, height: 100, x: 282, y: 0 },\n];\n\ninterface IconProps extends IntrinsicNodeProps {\n name: string;\n}\n\nfunction Icon(props: IconProps) {\n const sprite = createSpriteMap(basePath + \"assets/icons_white.png\", icons);\n\n return (\n \n );\n}\n\nexport default Icon;\nexport function PreviewIcons() {\n return (\n <>\n \n \n {(icon, i) => }\n \n \n );\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { renderer } from '@lightningjs/solid';\nimport {} from '@lightningjs/renderer';\nexport function createSpriteMap(src, subTextures) {\n const spriteMapTexture = renderer.createTexture('ImageTexture', {\n src,\n });\n return subTextures.reduce((acc, t) => {\n const { x, y, width, height } = t;\n acc[t.name] = renderer.createTexture('SubTexture', {\n texture: spriteMapTexture,\n x,\n y,\n width,\n height,\n });\n return acc;\n }, {});\n}\n//# sourceMappingURL=createSpriteMap.js.map","import { useNavigate } from \"@solidjs/router\";\nimport {\n View,\n Text,\n IntrinsicNodeProps,\n ElementNode,\n} from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport styles from \"./NavDrawer.styles\";\nimport Icon from \"../Icon\";\nimport theme from \"theme\";\n\ninterface NavButtonProps extends IntrinsicNodeProps {\n icon: string;\n children: string;\n}\n\nfunction NavButton(props: NavButtonProps) {\n return (\n \n \n \n \n \n {props.children}\n \n \n );\n}\n\nexport default function NavDrawer(props) {\n let backdrop;\n const navigate = useNavigate();\n\n function onFocus(this: ElementNode) {\n backdrop.states.add(\"focus\");\n this.children.forEach((c) => c.states!.add(\"active\"));\n this.children.selected!.setFocus();\n }\n\n function onBlur(this: ElementNode) {\n backdrop.states.remove(\"focus\");\n this.selected = 0;\n this.children.forEach((c) => c.states!.remove(\"active\"));\n }\n\n return (\n <>\n \n navigate(\"/browse/all\")} icon=\"trending\">\n Trending\n \n navigate(\"/browse/movie\")}>\n Movies\n \n navigate(\"/browse/tv\")}>\n TV\n \n navigate(\"/examples\")}>\n Examples\n \n \n \n \n );\n}\n","import { View, Text, hexColor } from \"@lightningjs/solid\";\nimport { createSignal } from \"solid-js\";\nimport { debounce } from \"@solid-primitives/scheduled\";\n\nconst fpsStyle = {\n color: 0x000000ff,\n height: 90,\n width: 330,\n x: 1500,\n y: 20,\n alpha: 0.8,\n zIndex: 100,\n};\n\nconst fpsLabel = {\n x: 10,\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n};\n\nconst fpsValue = {\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n};\n\nconst [fps, setFps] = createSignal(0);\nconst [avgFps, setAvgFps] = createSignal(0);\nconst [minFps, setMinFps] = createSignal(99);\nconst [maxFps, setMaxFps] = createSignal(0);\n\nlet count = 0;\nlet totalFps = 0;\n\nconst resetCounter = debounce(() => {\n // clear fps\n totalFps = 0;\n count = 0;\n setMinFps(99);\n}, 10000);\n\n// Clear min fps after 10 seconds to avoid showing a low fps\n// setTimeout(() => setMinFps(99), 9999);\n\nconst calcFps = (fps: number) => {\n if (!fps) return;\n\n setFps(fps);\n setMinFps((prev) => Math.min(fps, prev));\n setMaxFps((prev) => Math.max(fps, prev));\n\n totalFps += fps;\n count++;\n\n setAvgFps(Math.round(totalFps / count));\n\n resetCounter();\n};\n\nexport function setupFPS(root) {\n root.renderer.on(\"fpsUpdate\", (target, fpsData) => {\n const fps = typeof fpsData === \"number\" ? fpsData : fpsData.fps;\n if (fps > 5) {\n calcFps(fps);\n }\n });\n}\n\nexport const FPSCounter = (props) => {\n return (\n \n \n FPS:\n \n {fps().toString()}\n \n \n\n \n AVG:\n \n {avgFps().toString()}\n \n \n\n \n MIN:\n \n {minFps().toString()}\n \n \n\n \n MAX:\n \n {maxFps().toString()}\n \n \n \n );\n};\n","import { useNavigate } from \"@solidjs/router\";\nimport { View, activeElement, hexColor, renderer } from \"@lightningjs/solid\";\nimport { useFocusManager, useAnnouncer } from \"@lightningjs/solid-primitives\";\nimport Background from \"../components/Background\";\nimport NavDrawer from \"../components/NavDrawer/NavDrawer\";\nimport { FocusRing } from \"../components\";\nimport { FPSCounter, setupFPS } from \"../components/FPSCounter\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\nimport { onMount } from \"solid-js\";\n\ndeclare module \"@lightningjs/solid-primitives\" {\n // Augment the FocusManager KeyMap interface with our custom keys\n interface KeyMap {\n Announcer: string;\n Menu: string;\n Escape: string;\n }\n}\n\ndeclare module \"@lightningjs/solid\" {\n interface ElementNode {\n heroContent?: boolean;\n backdrop?: any;\n entityInfo?: any;\n href?: string;\n }\n}\n\nconst App = (props) => {\n useFocusManager({\n Announcer: \"a\",\n Menu: \"m\",\n Escape: \"Escape\",\n });\n const announcer = useAnnouncer();\n announcer.enabled = false;\n const navigate = useNavigate();\n\n let focusRingRef, navDrawer, lastFocused, happy;\n\n onMount(() => {\n setupFPS({ renderer });\n });\n\n return (\n (announcer.enabled = !announcer.enabled)}\n onLast={() => history.back()}\n onMenu={() => navigate(\"/\")}\n style={{ width: 1920, height: 1080 }}\n onLeft={() => {\n if (navDrawer.states.has(\"focus\")) {\n return false;\n }\n lastFocused = activeElement();\n navDrawer.setFocus();\n }}\n onRight={() => navDrawer.states.has(\"focus\") && lastFocused.setFocus()}\n >\n \n \n\n {props.children}\n\n \n {/* */}\n \n );\n};\n\nexport default App;\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { createEffect, on } from 'solid-js';\nimport { Announcer } from './announcer.js';\nimport { focusPath } from '../useFocusManager.js';\nexport const useAnnouncer = () => {\n Announcer.setupTimers();\n createEffect(on(focusPath, Announcer.onFocusChange, { defer: true }));\n return Announcer;\n};\n//# sourceMappingURL=index.js.map","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n hexColor,\n} from \"@lightningjs/solid\";\nimport theme from \"theme\";\n\n// Augment existing intrinsic style prop interfaces to include our own\n// app-specific states\ndeclare module \"@lightningjs/solid\" {\n interface IntrinsicNodeStyleProps {\n // TODO: Refactor states to use a $ prefix\n active?: IntrinsicNodeStyleProps;\n disabled?: IntrinsicNodeStyleProps;\n }\n\n interface IntrinsicTextNodeStyleProps {\n // TODO: Refactor states to use a $ prefix\n active?: IntrinsicTextNodeStyleProps;\n disabled?: IntrinsicTextNodeStyleProps;\n }\n}\n\nexport default {\n Page: {\n width: 1920,\n height: 1080,\n },\n headlineText: {\n width: 1200,\n height: 240,\n x: 360,\n // lineHeight: 170, // TODO: Add back when lineHeight is supported\n y: 455,\n contain: \"both\",\n fontSize: 66,\n textAlign: \"center\",\n } satisfies IntrinsicTextNodeStyleProps,\n headlineSubText: {\n width: 960,\n height: 170,\n // lineHeight: 170, // TODO: Add back when lineHeight is supported\n x: 530,\n y: 655,\n contain: \"both\",\n fontSize: 48,\n textAlign: \"center\",\n } satisfies IntrinsicTextNodeStyleProps,\n itemsContainer: {\n width: theme.layout.screenW,\n height: 600,\n y: 560,\n x: 0,\n zIndex: 2,\n },\n Thumbnail: {\n borderRadius: 16,\n width: 185,\n height: 278,\n scale: 1,\n zIndex: 2,\n transition: { scale: { duration: 250, easing: \"ease-in-out\" } },\n border: { width: 0, color: 0x00000000 },\n focus: { scale: 1.1, border: { color: 0xffffff66, width: 8 } },\n },\n FocusRing: {\n borderRadius: 16,\n width: 194,\n height: 286,\n y: -5,\n x: -5,\n zIndex: -1,\n },\n FPS: {\n color: 0x000000ff,\n height: 42,\n width: 140,\n x: 20,\n y: 20,\n zIndex: 100,\n } as const,\n FPSLabel: {\n x: 10,\n y: 0,\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n },\n FPSValue: {\n x: 90,\n y: 0,\n fontSize: 36,\n textColor: hexColor(\"#ffffff\"),\n },\n showHeadline: { x: 70, y: 20 },\n headlineBlur: {\n width: 1920,\n height: 150,\n x: 0,\n y: 0,\n zIndex: 14,\n alpha: 0.9,\n color: hexColor(\"#000000\"),\n },\n RowTitle: {\n height: 60,\n width: 300,\n marginTop: 20,\n fontSize: 36,\n color: hexColor(\"#f0f0f0\"),\n zIndex: 2,\n } satisfies IntrinsicTextNodeStyleProps,\n Row: {\n display: \"flex\",\n justifyContent: \"spaceBetween\",\n height: 300,\n },\n Column: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n gap: 20,\n width: theme.layout.screenW - 2 * theme.layout.marginX,\n x: theme.layout.marginX + theme.layout.gutterX,\n y: 48,\n transition: { y: { duration: 250, easing: \"ease-in-out\" } },\n zIndex: 2,\n },\n Rect: {\n width: 250,\n height: 100,\n y: 10,\n x: 300,\n color: hexColor(\"#0000ff\"),\n },\n peopleBio: {\n ...theme.typography.body1,\n contain: \"both\",\n width: 1500,\n height: 400,\n } satisfies IntrinsicTextNodeStyleProps,\n} as const;\n\nconst Button = {\n width: 120,\n height: 40,\n color: hexColor(\"#000000\"),\n borderRadius: 8,\n border: { width: 2, color: hexColor(\"#3333ff\") },\n scale: 1,\n focus: {\n scale: 1.1,\n border: { width: 5, color: hexColor(\"#333333\") },\n },\n transition: { scale: true, color: true },\n} satisfies IntrinsicNodeStyleProps;\n\nconst TopBar = {\n color: hexColor(\"#00A699\"),\n height: 8,\n y: 2,\n x: -4,\n width: Button.width + 8,\n} satisfies IntrinsicNodeStyleProps;\n\nconst ButtonText = {\n fontSize: 12,\n y: 12,\n // lineHeight: Button.height, // TODO: Add back when lineHeight is supported\n contain: \"width\",\n textAlign: \"center\",\n color: hexColor(\"#F6F6F9\"),\n height: Button.height,\n width: Button.width,\n} satisfies IntrinsicTextNodeStyleProps;\n\nexport const buttonStyles = {\n container: Button,\n topBar: TopBar,\n text: ButtonText,\n} satisfies Record;\n\nexport const MaterialButton = {\n width: 386,\n height: 136,\n color: hexColor(\"#715cab\"),\n focus: {\n color: hexColor(\"#5a39a2\"),\n },\n disabled: {\n color: hexColor(\"#291d43\"),\n },\n} satisfies IntrinsicNodeStyleProps;\n\nexport const MaterialButtonText = {\n fontSize: 32,\n contain: \"width\",\n textAlign: \"center\",\n mountY: -0.35,\n color: hexColor(\"#FFFFFF\"),\n height: MaterialButton.height,\n width: MaterialButton.width,\n // lineHeight: MaterialButton.height, // TODO: Add back when lineHeight is supported\n focus: {\n fontSize: 40,\n },\n disabled: {\n color: hexColor(\"#909090\"),\n },\n} satisfies IntrinsicTextNodeStyleProps;\n","import { IntrinsicNodeProps, View, Text } from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { For, splitProps } from \"solid-js\";\nimport styles, { buttonStyles } from \"../styles\";\nimport { type Tile } from \"../api/formatters/ItemFormatter\";\n\nexport function Thumbnail(props: IntrinsicNodeProps) {\n return ;\n}\n\nexport function FocusRing(props: IntrinsicNodeProps) {\n return ;\n}\n\nexport interface TileRowProps extends IntrinsicNodeProps {\n items: Tile[];\n}\n\nexport function TileRow(props: TileRowProps) {\n const [local, others] = splitProps(props, [\"items\"]);\n\n return (\n \n {(item) => }\n \n );\n}\n\nexport function Button(props) {\n return (\n \n {props.children}\n \n );\n}\n","export default 'eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyZDE4YjEwMTA0YjdiZTlkNjFiMWYwYjVlMGEwNzM2OCIsInN1YiI6IjYwZTVjMTdlNGNhNjc2MDA3NTA4Njc3MSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.D_nqH9kd-bhhWzeVsTDPYhHnsUaNAuyAa6YATmKHqsA';\n","import API_KEY_V4 from \"./key\";\nconst API_BASE = \"https://api.themoviedb.org/3\";\nlet tmdbConfig;\nlet baseImageUrl;\nconst basePosterSize = \"w185\";\n\nconst defaultFetchParams = {\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: \"Bearer \" + API_KEY_V4,\n },\n};\n\nexport function getImageUrl(path: string, posterSize: string = basePosterSize) {\n return baseImageUrl + posterSize + path;\n}\n\nfunction get(path: string, params: RequestInit = {}) {\n if (tmdbConfig) {\n return _get(path, params);\n } else {\n return loadConfig().then(() => _get(path, params));\n }\n}\n\nfunction _get(path: string, params: RequestInit = {}) {\n return fetch(API_BASE + path, {\n ...defaultFetchParams,\n ...params,\n }).then((r) => r.json());\n}\n\nfunction loadConfig() {\n return _get(\"/configuration\").then((data) => {\n tmdbConfig = data;\n baseImageUrl = data.images?.secure_base_url;\n return data;\n });\n}\n\nexport default {\n get,\n loadConfig,\n};\n","import { getImageUrl } from \"../index\";\n\nfunction truncateString(str: string, maxLength: number): string {\n if (str.length > maxLength) {\n return str.substring(0, maxLength - 3) + \"...\";\n }\n return str;\n}\n\nexport function chunkArray(array: string[], size = 7) {\n let result: string[][] = [];\n for (let i = 0, j = array.length; i < j; i += size) {\n result.push(array.slice(i, i + size));\n }\n return result;\n}\n\nexport interface Tile {\n src: string;\n tileSrc: string;\n backdrop: string;\n href: string;\n shortTitle: string;\n title: string;\n data: unknown;\n entityInfo: {\n type: string;\n id: string;\n };\n heroContent: {\n title: string;\n description: string;\n };\n}\n\n// TODO: Remove `any` type\nexport function convertItemsToTiles(items: any[] = []): Tile[] {\n return items.map((item) => ({\n src: getImageUrl(item.poster_path || item.profile_path),\n tileSrc: getImageUrl(item.backdrop_path || item.profile_path, \"w300\"),\n backdrop: getImageUrl(item.backdrop_path, \"w1280\"),\n href: `/entity/${item.media_type || \"people\"}/${item.id}`,\n shortTitle: truncateString(item.title || item.name, 30),\n title: item.title || item.name,\n data: item,\n entityInfo: {\n type: item.media_type || \"people\",\n id: item.id,\n },\n heroContent: {\n title: item.title || item.name,\n description: item.overview,\n },\n }));\n}\n","import api from \"..\";\nimport { convertItemsToTiles, chunkArray } from \"../formatters/ItemFormatter\";\n\nlet cache = new Map();\nconst leftoverTiles = new Map();\n\nexport default function (filter: string) {\n return (pageIndex: number): Promise => {\n const url = `/trending/${filter}/week?page=${pageIndex}`;\n if (cache.has(url)) {\n return cache.get(url);\n }\n\n let result = api.get(url).then((trending) => {\n let results = trending.results.filter((r) => !r.adult);\n let tiles = (\n leftoverTiles.has(filter) ? leftoverTiles.get(filter) : []\n ).concat(convertItemsToTiles(results));\n let chunks = chunkArray(tiles);\n if (chunks[chunks.length - 1].length < 7) {\n leftoverTiles.set(filter, chunks.pop());\n } else {\n leftoverTiles.delete(filter);\n }\n return chunks;\n });\n\n cache.set(url, result);\n return result;\n };\n}\n","import { createSignal, createComputed, batch, createResource } from \"solid-js\";\n\nexport function createInfiniteScroll(fetcher: (page: number) => Promise) {\n const [pages, setPages] = createSignal([]);\n const [page, setPage] = createSignal(1);\n const [end, setEnd] = createSignal(false);\n\n const [contents] = createResource(page, fetcher);\n\n createComputed(() => {\n const content = contents();\n if (!content) return;\n batch(() => {\n if (content.length === 0) setEnd(true);\n setPages((p) => [...p, ...content]);\n });\n });\n\n return {\n pages,\n page,\n setPage,\n setPages,\n end,\n setEnd,\n };\n}\n","import {\n View,\n Text,\n Show,\n IntrinsicNodeStyleProps,\n For,\n} from \"@lightningjs/solid\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nimport theme from \"theme\";\nwithPadding;\n\nconst blockWidth = 1100;\nconst HeadlineStyles = {\n ...theme.typography.display2,\n width: blockWidth,\n height: 58,\n contain: \"both\",\n};\nconst Headline = (props) => (\n \n {props.children}\n \n);\n\nconst DescriptionStyles = {\n ...theme.typography.body1,\n width: blockWidth,\n height: 72,\n contain: \"both\",\n};\n\nconst BadgeStyle = {\n fontSize: 20,\n lineHeight: 20,\n};\n\nconst Description = (props) => (\n \n {props.children}\n \n);\n\nfunction getReviews(reviews) {\n return (\n <>\n \n \n {reviews.rtCrit + \"%\"}\n \n \n \n {reviews.rtFan + \"%\"}\n \n \n );\n}\n\nconst Badge = (props) => {\n return (\n \n {props.children}\n \n );\n};\n\nconst MetaTextStyle = theme.typography.body2;\n\nconst Metadata = (props) => (\n \n {props.metaText}\n {(item) => {item}}\n {getReviews(props.reviews)}\n \n);\n\nconst ContentBlock = (props) => {\n const style = {\n display: \"flex\",\n flexDirection: \"column\",\n width: blockWidth,\n height: 160,\n gap: 16,\n };\n return (\n \n {props.title}\n {props.description}\n \n \n );\n};\n\nexport default ContentBlock;\n","import api, { getImageUrl } from \"..\";\nimport { convertItemsToTiles } from \"../formatters/ItemFormatter\";\n\nexport function minutesToHMM(minutes) {\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return (\n hours + \"h \" + (remainingMinutes < 10 ? \"0\" : \"\") + remainingMinutes + \"m\"\n );\n}\n\nfunction justYear(dateString) {\n const parts = dateString.split(\"-\");\n return parts[0];\n}\n\nexport function getRecommendations({ type, id }) {\n return api.get(`/${type}/${id}/recommendations`).then(({ results }) => {\n if (results.length) {\n return convertItemsToTiles(results.slice(0, 7));\n }\n return api\n .get(`/trending/${type}/week?page=1`)\n .then(({ results }) => convertItemsToTiles(results.slice(0, 7)));\n });\n}\n\nexport function getCredits({ type, id }) {\n return api\n .get(`/${type}/${id}/credits`)\n .then(({ cast }) => convertItemsToTiles(cast.slice(0, 7)));\n}\n\nexport function getInfo({ type, id }) {\n let rt =\n type === \"movie\"\n ? {\n rtCrit: 86,\n rtFan: 92,\n }\n : {};\n\n return api.get(`/${type}/${id}`).then((data) => ({\n backgroundImage: getImageUrl(data.backdrop_path, \"original\"),\n heroContent: {\n title: data.title || data.name,\n description: data.overview,\n badges: [\"HD\"],\n metaText:\n type === \"movie\"\n ? minutesToHMM(data.runtime) + \" - \" + data.release_date\n : `${justYear(data.first_air_date)} - ${justYear(data.last_air_date)}`,\n reviews: rt,\n },\n ...data,\n }));\n}\n","import {\n createEffect,\n createMemo,\n on,\n createSignal,\n Show,\n createResource,\n createSelector,\n For,\n} from \"solid-js\";\nimport { ElementNode, View, activeElement } from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport { useNavigate, useParams } from \"@solidjs/router\";\nimport { TileRow } from \"../components\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\nimport browseProvider from \"../api/providers/browse\";\nimport { createInfiniteScroll } from \"../components/pagination\";\nimport ContentBlock from \"../components/ContentBlock\";\nimport * as entityProvider from \"../api/providers/entity\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\n\nconst Browse = () => {\n const params = useParams();\n const [columnY, setcolumnY] = createSignal(0);\n const [entityInfo, setEntityInfo] = createSignal();\n const [entityData] = createResource(entityInfo, entityProvider.getInfo);\n const [heroContent, setHeroContent] = createSignal({});\n const navigate = useNavigate();\n const isFirst = createSelector(() => {\n return 0;\n });\n\n const provider = createMemo(() => {\n return createInfiniteScroll(browseProvider(params.filter || \"all\"));\n });\n\n createEffect(\n on(\n activeElement,\n (elm) => {\n if (elm.backdrop) {\n setGlobalBackground(elm.backdrop);\n }\n // if (elm.entityInfo) {\n // setEntityInfo(elm.entityInfo);\n // }\n if (elm.heroContent) {\n setHeroContent(elm.heroContent);\n }\n },\n { defer: true },\n ),\n );\n\n function onRowFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setcolumnY((this.y || 0) * -1 + 24);\n let numPages = provider().pages().length;\n\n if (\n numPages === 0 ||\n (this.parent.selected && this.parent.selected >= numPages - 2)\n ) {\n provider().setPage((p) => p + 1);\n }\n }\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n }\n\n return (\n \n \n \n \n \n {(items, i) => (\n \n )}\n \n \n \n \n );\n};\n\nexport default Browse;\n","import { createSignal, createSelector, For } from \"solid-js\";\nimport { ElementNode, View, Text, activeElement } from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { useNavigate } from \"@solidjs/router\";\nimport styles from \"../styles\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\n\nconst Portal = () => {\n const navigate = useNavigate();\n const isFirst = createSelector(() => {\n return 0;\n });\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.id);\n navigate(\"/\" + entity.id);\n }\n\n const demos = [\n {\n title: \"Flex Row\",\n id: \"flex\",\n description: \"Flex Row Implementation\",\n },\n {\n title: \"Flex Column\",\n id: \"flexcolumn\",\n description: \"Flex Column Implementation\",\n },\n {\n title: \"Flex Row Vertical Align\",\n id: \"flexsize\",\n description: \"Flex Row Vertical Align Implementation\",\n },\n {\n title: \"Flex Column Vertical Align\",\n id: \"flexcolumnsize\",\n description: \"Flex Column Vertical Align Implementation\",\n },\n {\n title: \"Buttons\",\n id: \"buttons\",\n description: \"Demo a few buttons\",\n },\n {\n title: \"Text\",\n id: \"text\",\n description: \"Text layout with flexbox\",\n },\n {\n title: \"Create Elements\",\n id: \"create\",\n description: \"Testing Show + children + inserting text\",\n },\n {\n title: \"Viewport\",\n id: \"viewport\",\n description: \"Events going in and out of viewport\",\n },\n ];\n\n function DemoTile(props) {\n const Container = {\n width: 370,\n height: 320,\n borderRadius: 6,\n scale: 1,\n color: 0x182b44ff,\n transition: { color: true, scale: true },\n focus: {\n scale: 1.1,\n color: 0xffffffff,\n },\n };\n const [color, setColor] = createSignal(0xffffffff);\n\n return (\n setColor(0x000000ff)}\n onBlur={() => setColor(0xffffffff)}\n style={Container}\n >\n \n \n {props.index}\n \n \n {props.title}\n \n \n {props.description}\n \n \n \n );\n }\n\n const [rowX, setRowX] = createSignal(140);\n\n function moveRow(row) {\n setRowX(row.selected * -400 + 140);\n }\n\n return (\n \n \n \n \n Examples\n \n \n \n \n \n {(demo, i) => (\n \n )}\n \n \n \n );\n};\n\nexport default Portal;\n","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst TextPage = () => {\n const OverviewContainer = {\n width: 900,\n height: 500,\n y: 350,\n x: 150,\n gap: 25,\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const SublineContainer = {\n width: 900,\n height: 36,\n gap: 6,\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const Title = {\n fontSize: 42,\n };\n\n const Overview = {\n width: OverviewContainer.width,\n fontSize: 26,\n contain: \"width\",\n } satisfies IntrinsicTextNodeStyleProps;\n\n const Subline = {\n fontSize: 26,\n };\n\n onMount(() => {\n setGlobalBackground(\"#000000\");\n });\n\n return (\n \n Title of the Page\n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer vel\n tempor tellus. Sed eu leo purus. Vestibulum sollicitudin eget tellus a\n varius. Phasellus est turpis, volutpat sed blandit sit amet, rutrum sit\n amet mauris. In dignissim elit orci, a sollicitudin ipsum faucibus et.\n Quisque vel quam rutrum, faucibus augue sed, scelerisque nunc.\n \n \n Subline Text\n \n More Text\n \n \n );\n};\n\nexport default TextPage;\n","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Show, children, createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst CreatePage = () => {\n const OverviewContainer = {\n width: 900,\n height: 500,\n y: 50,\n x: 150,\n gap: 25,\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const SublineContainer = {\n width: 900,\n height: 36,\n gap: 6,\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const Title = {\n fontSize: 42,\n };\n\n const Subline = {\n fontSize: 26,\n };\n\n let myBox, childRef;\n onMount(() => {\n setGlobalBackground(\"#000000\");\n myBox.animate({ x: 100 }, { duration: 2000 }).start();\n });\n\n const [insertTest, setInsertTest] = createSignal();\n const [emptyTest, setEmptyTest] = createSignal();\n\n setTimeout(() => {\n setInsertTest(\"- Inserted -\");\n childRef\n .getChildById(\"child1\")\n //.searchChildrenById('subChild') - more expensive version of getChildById\n ?.animate({ x: 600 }, { duration: 2000 })\n .start();\n }, 2000);\n\n const styleChild = {\n width: 400,\n height: 300,\n // Solid blue\n color: hexColor(\"#0000ff\"),\n } as const;\n\n const someOtherStyle = {\n // pretty red\n color: hexColor(\"#f54242\"),\n focus: {\n // pretty blue\n color: hexColor(\"#4287f5\"),\n },\n };\n\n function ChildTest(props) {\n // This causes a parent not rendered error since we're rendering it twice in the template\n const resolved = children(() => props.children);\n return (\n \n \n {resolved()}\n \n {props.title}\n \n \n {resolved()}\n \n \n );\n }\n\n const borderStyles = {\n borderLeft: {\n width: 8,\n color: 0x05b2b626,\n },\n borderTop: {\n width: 8,\n color: 0x25a2bd26,\n },\n borderRight: {\n width: 8,\n color: 0x05b2b626,\n },\n borderBottom: {\n width: 8,\n color: 0xc5b23626,\n },\n } as const;\n\n const childTestPassedStyles = {\n // grey color\n color: hexColor(\"#cccccc\"),\n focus: {\n // black\n color: hexColor(\"#000000\"),\n },\n };\n\n const childTestPassedStyles2 = {\n // white color\n color: hexColor(\"#ffffff\"),\n focus: {\n // white something...\n color: hexColor(\"#f6f6cc\"),\n },\n };\n\n function hasFocus(elm) {\n console.log(\"Ref is available: \", elm);\n return true;\n }\n\n return (\n \n Title of the Page\n \n {emptyTest()}\n Sub {insertTest()} Text\n \n \n \n More Text\n \n \n Child Test\n \n \n \n );\n};\n\nexport default CreatePage;\n","import { Text, View, hexColor } from \"@lightningjs/solid\";\nimport { onMount, onCleanup, createSignal } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nexport default () => {\n let ball, invervalTimer;\n\n const [ballStatus, setBallStatus] = createSignal([]);\n\n const styleBall = {\n width: 100,\n height: 100,\n x: -400,\n y: -400,\n rotation: 0,\n borderRadius: 50,\n color: hexColor(\"#4287f5\"),\n transition: {\n x: { duration: 1250, easing: \"linear\" },\n y: { duration: 1250, easing: \"linear\" },\n rotation: { duration: 1400, easing: \"ease-in-out\" },\n },\n } as const;\n\n const Title = {\n fontSize: 32,\n x: 960,\n y: 540,\n mount: 0.5,\n lineheight: 52,\n };\n\n const randomIntBetween = (from, to) =>\n Math.floor(Math.random() * (to - from + 1) + from);\n\n onMount(() => {\n setGlobalBackground(\"#000000\");\n\n ball.x = (1920 - 100) / 2;\n ball.y = (1080 - 100) / 2;\n invervalTimer = setInterval(() => {\n ball.rotation = randomIntBetween(-90, 90);\n ball.x = randomIntBetween(-300, 2220);\n ball.y = randomIntBetween(-300, 1380);\n }, 2500);\n });\n\n function logEvent(name, elm) {\n setBallStatus((prev) => {\n return [...prev, name].slice(-4);\n });\n console.log(name);\n }\n\n onCleanup(() => {\n clearInterval(invervalTimer);\n });\n\n return (\n \n {ballStatus().join(\"\\n\")}\n logEvent(\"inBounds\", elm)],\n [\"outOfBounds\", (elm) => logEvent(\"outOfBounds\", elm)],\n [\"inViewport\", (elm) => logEvent(\"inViewport\", elm)],\n [\"outOfViewport\", (elm) => logEvent(\"outOfViewport\", elm)],\n ]}\n />\n \n );\n};\n","import {\n View,\n Text,\n ElementNode,\n IntrinsicNodeProps,\n hexColor,\n IntrinsicNodeStyleProps,\n} from \"@lightningjs/solid\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { buttonStyles } from \"../styles\";\nwithPadding;\n\nconst ButtonsPage = () => {\n function onEnter(this: ElementNode, event, elm) {\n this.states.toggle(\"disabled\");\n }\n\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1500,\n height: 300,\n color: hexColor(\"00000000\"),\n gap: 26,\n y: 400,\n } satisfies IntrinsicNodeStyleProps;\n\n function Button(props) {\n return (\n \n {props.children}\n \n );\n }\n\n const Badge = (props: IntrinsicNodeProps) => {\n return (\n \n \n {props.children as string}\n \n \n );\n };\n return (\n <>\n \n HD\n PG13\n NC17\n I like bananas\n DOLBY\n \n\n \n \n \n \n \n \n \n );\n};\n\nexport default ButtonsPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1600,\n height: 110,\n color: hexColor(\"#4dabf5\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n marginTop: 25,\n marginBottom: -20,\n skipFocus: true,\n };\n\n function Block(props) {\n const styles = {\n width: 200,\n height: 100,\n y: 5,\n color: 0x1769aaff,\n };\n\n return ;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Flex Start\n \n \n \n \n \n \n \n Flex Start - Margin Left\n \n \n \n \n \n \n \n Flex End\n \n \n \n \n \n \n \n\n Flex End - Margin Right\n \n \n \n \n \n \n \n\n Center - No Margin Support\n \n \n \n \n \n \n \n\n Space Between - No Margin Support\n \n \n \n \n \n \n \n\n Space Evenly - No Margin Support\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport styles from \"../styles\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexSizePage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1600,\n height: 110,\n color: hexColor(\"#4dabf5\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n marginTop: 25,\n marginBottom: -20,\n skipFocus: true,\n };\n\n function Block(props) {\n const styles = {\n width: 200,\n height: 100,\n y: 5,\n color: 0x1769aaff,\n };\n\n return ;\n }\n\n function randSize() {\n // size 21 to 100\n return Math.floor(Math.random() * 91) + 10;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Flex Start - AlignItems: center\n \n \n \n \n \n \n \n \n Flex Start - Margin Left - AlignItems: flexStart\n \n \n \n \n \n \n \n \n Flex End - AlignItems: flexEnd\n \n \n \n \n \n \n \n\n Flex End - Margin Right\n \n \n \n \n \n \n \n\n Center - No Margin Support\n \n \n \n \n \n \n \n\n Space Between - No Margin Support\n \n \n \n \n \n \n \n\n Space Evenly - No Margin Support\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexSizePage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexColumnPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n width: 1920,\n y: 100,\n height: 880,\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const ColumnStyles = {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"#4dabf5\"),\n height: 850,\n width: 80,\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n y: 20,\n x: 150,\n };\n\n function Block(props) {\n const styles = {\n width: randSize(),\n height: 80,\n x: 5,\n color: hexColor(\"#1769aa\"),\n };\n\n return ;\n }\n\n function randSize() {\n // size 10 to 70\n return Math.floor(Math.random() * 61) + 10;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Start, MarginTop, End, MarginBottom, Center, Between, Evenly\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexColumnPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Column, Row } from \"@lightningjs/solid-ui\";\nimport { createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexColumnPage = () => {\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n width: 1920,\n y: 100,\n height: 880,\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const ColumnStyles = {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"#4dabf5\"),\n height: 850,\n width: 60,\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n y: 20,\n x: 150,\n };\n\n function Block(props) {\n const styles = {\n width: 50,\n height: 80,\n x: 5,\n color: hexColor(\"#1769aa\"),\n };\n\n return ;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground(\"#333333\");\n });\n\n const gap = 50;\n\n return (\n <>\n \n Start, MarginTop, End, MarginBottom, Center, Between, Evenly\n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexColumnPage;\n","import {\n ElementNode,\n IntrinsicNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\n\nimport { MaterialButtonText } from \"../styles\";\n\nconst MaterialButtonsPage = () => {\n function onEnter(this: ElementNode, event, elm) {\n this.states.toggle(\"disabled\");\n }\n\n const RowStyles = {\n display: \"flex\",\n justifyContent: \"flexStart\",\n width: 1500,\n height: 300,\n color: hexColor(\"00000000\"),\n gap: 26,\n y: 400,\n x: 100,\n } satisfies IntrinsicNodeStyleProps;\n\n const MaterialButton = {\n width: 386,\n height: 136,\n color: \"0x715cabff\",\n focus: {\n color: \"0x5a39a2ff\",\n },\n disabled: {\n color: \"0x291d43ff\",\n },\n };\n const RoundedRectangle = [\"RoundedRectangle\", { radius: 65 }];\n function Button(props) {\n return (\n \n {props.children}\n \n );\n }\n\n return (\n \n \n \n \n \n );\n};\n\nexport default MaterialButtonsPage;\n","// Documentation from Shaka player:\n// https://shaka-player-demo.appspot.com/docs/api/tutorial-basic-usage.html\n\nconst manifestUri =\n \"https://storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd\";\n\nfunction initApp() {\n // Install built-in polyfills to patch browser incompatibilities.\n shaka.polyfill.installAll();\n\n // Check to see if the browser supports the basic APIs Shaka needs.\n if (shaka.Player.isBrowserSupported()) {\n // Everything looks good!\n initPlayer();\n } else {\n // This browser does not have the minimum set of APIs we need.\n console.error(\"Browser not supported!\");\n }\n}\n\nasync function initPlayer() {\n // Create a Player instance.\n const video = document.getElementById(\"video\");\n const player = new shaka.Player();\n await player.attach(video);\n\n // Attach player to the window to make it easy to access in the JS console.\n window.player = player;\n\n // Listen for error events.\n player.addEventListener(\"error\", onErrorEvent);\n\n // Try to load a manifest.\n // This is an asynchronous process.\n try {\n await player.load(manifestUri);\n // This runs if the asynchronous load is successful.\n console.log(\"The video has now been loaded!\");\n } catch (e) {\n // onError is executed if the asynchronous load fails.\n onError(e);\n }\n}\n\nfunction onErrorEvent(event) {\n // Extract the shaka.util.Error object from the event.\n onError(event.detail);\n}\n\nfunction onError(error) {\n // Log the error.\n console.error(\"Error code\", error.code, \"object\", error);\n}\n\nexport function playVideo() {\n const video = document.getElementById(\"video\");\n video.hidden = false;\n // Needs delay from hidden to play in Chrome\n setTimeout(() => video.play(), 50);\n video.focus();\n return video;\n}\n\nexport function closeVideo() {\n const video = document.getElementById(\"video\");\n video.hidden = true;\n video.pause();\n return video;\n}\n\ndocument.addEventListener(\"DOMContentLoaded\", initApp);\n","import {\n ElementNode,\n Text,\n View,\n Show,\n hexColor,\n setActiveElement,\n} from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport { useParams } from \"@solidjs/router\";\nimport { createEffect, createResource, on, createSignal } from \"solid-js\";\nimport { TileRow, Button } from \"../components\";\nimport { setGlobalBackground } from \"../state\";\nimport ContentBlock from \"../components/ContentBlock\";\nimport { useNavigate } from \"@solidjs/router\";\nimport styles from \"../styles\";\nimport * as provider from \"../api/providers/entity\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\nimport type { Tile } from \"../api/formatters/ItemFormatter\";\nimport { playVideo, closeVideo } from \"../video\";\n\nconst Entity = () => {\n const params = useParams();\n const navigate = useNavigate();\n\n const [data] = createResource(() => ({ ...params }), provider.getInfo);\n const [credits] = createResource(\n () => ({ ...params }),\n provider.getCredits,\n );\n const [recommendations] = createResource(\n () => ({ ...params }),\n provider.getRecommendations,\n );\n const [backdropAlpha, setBackdropAlpha] = createSignal(0);\n\n createEffect(\n on(\n data,\n (data) => {\n setGlobalBackground(data.backgroundImage);\n },\n { defer: true },\n ),\n );\n\n const columnY = 600;\n\n const Backdrop = {\n color: hexColor(\"#000000\"),\n alpha: 0,\n width: 1900,\n height: 890,\n x: 10,\n y: columnY,\n borderRadius: 30,\n };\n\n function onRowFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n columnRef.y = columnY;\n backdropRef.y = columnY;\n backdropRef.alpha = 0;\n }\n\n function onRowFocusAnimate(this: ElementNode) {\n this.children.selected?.setFocus();\n columnRef.y = 200;\n backdropRef.y = 160;\n backdropRef.alpha = 0.9;\n }\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n }\n\n function onEscape() {\n closeVideo();\n // Set focus back to lightning app\n document.getElementsByTagName(\"canvas\")[0].focus();\n setActiveElement(trailerButton);\n setBackdropAlpha(0);\n }\n\n function onEnterTrailer() {\n const video = playVideo();\n setActiveElement(video);\n setBackdropAlpha(0.9);\n }\n\n let columnRef, backdropRef, trailerButton;\n\n return (\n \n trailerButton.setFocus()} onEscape={onEscape}>\n \n columnRef.setFocus()}\n onEnter={onEnterTrailer}\n >\n Watch Trailer\n \n \n \n \n Recommendations\n \n \n \n Cast and Crew\n \n \n \n \n \n \n \n \n );\n};\n\nexport default Entity;\n","import api, { getImageUrl } from \"..\";\nimport { convertItemsToTiles } from \"../formatters/ItemFormatter\";\n\nexport function minutesToHMM(minutes) {\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return (\n hours + \"h \" + (remainingMinutes < 10 ? \"0\" : \"\") + remainingMinutes + \"m\"\n );\n}\n\nfunction justYear(dateString) {\n const parts = dateString.split(\"-\");\n return parts[0];\n}\n\nexport function getCredits({ id }) {\n return api\n .get(`/person/${id}/combined_credits`)\n .then(({ cast }) => convertItemsToTiles(cast.slice(0, 7)));\n}\n\nexport function getInfo({ id }) {\n return api.get(`/person/${id}`).then((data) => ({\n backgroundImage: getImageUrl(data.profile_path, \"original\"),\n heroContent: {\n title: data.title || data.name,\n description: data.biography,\n },\n ...data,\n }));\n}\n","import { ElementNode, Text, View, Show, hexColor } from \"@lightningjs/solid\";\nimport { Column } from \"@lightningjs/solid-ui\";\nimport { useParams } from \"@solidjs/router\";\nimport { createEffect, createResource, on } from \"solid-js\";\nimport { TileRow } from \"../components\";\nimport { setGlobalBackground } from \"../state\";\nimport { useNavigate } from \"@solidjs/router\";\nimport theme from \"theme\";\nimport styles from \"../styles\";\nimport * as provider from \"../api/providers/people\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\n\nconst People = () => {\n const params = useParams();\n const navigate = useNavigate();\n\n const [data] = createResource(() => ({ ...params }), provider.getInfo);\n const [credits] = createResource(() => ({ ...params }), provider.getCredits);\n\n createEffect(\n on(\n data,\n (data) => {\n setGlobalBackground(data.backgroundImage);\n },\n { defer: true },\n ),\n );\n\n const Backdrop = {\n color: hexColor(\"#000000\"),\n alpha: 0.8,\n width: 1540,\n height: 440,\n x: 130,\n y: 180,\n borderRadius: 30,\n };\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n }\n\n return (\n \n \n {data().name}\n {data().biography}\n \n \n \n \n \n Credits\n \n \n \n \n \n );\n};\n\nexport default People;\n","const NotFound = () => {\n return ;\n};\n\nexport default NotFound;\n","export default import.meta.ROLLUP_FILE_URL_DM04K3OB;","import {\n render,\n Config,\n SolidNode,\n SolidRendererOptions,\n hexColor,\n ElementNode,\n} from \"@lightningjs/solid\";\nimport { HashRouter, Route } from \"@solidjs/router\";\nimport App from \"./pages/App\";\nimport Browse from \"./pages/Browse\";\nimport Portal from \"./pages/Portal\";\nimport TextPage from \"./pages/Text\";\nimport CreatePage from \"./pages/Create\";\nimport ViewportPage from \"./pages/Viewport\";\nimport ButtonsPage from \"./pages/Buttons\";\nimport FlexPage from \"./pages/Flex\";\nimport FlexSizePage from \"./pages/FlexSize\";\nimport FlexColumnSizePage from \"./pages/FlexColumnSize\";\nimport FlexColumnPage from \"./pages/FlexColumn\";\nimport ButtonsMaterialPage from \"./pages/ButtonsMaterial\";\nimport Entity from \"./pages/Entity\";\nimport People from \"./pages/People\";\nimport NotFound from \"./pages/NotFound\";\nimport coreExtensionModuleUrl from \"./AppCoreExtensions.js?importChunkUrl\";\n\nconst logFps = true;\nConfig.debug = false;\nConfig.animationsEnabled = true;\nConfig.fontSettings.fontFamily = \"Ubuntu\";\nConfig.fontSettings.color = hexColor(\"#ffffff\");\nConfig.fontSettings.fontSize = 32;\nConfig.rendererOptions = {\n coreExtensionModule: coreExtensionModuleUrl,\n fpsUpdateInterval: logFps ? 1000 : 0,\n enableInspector: true,\n // deviceLogicalPixelRatio: 1\n};\n\nrender(() => (\n }>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n));\n"],"names":["getUnicodeCodepoints","TextureUsageTracker","constructor","releaseCallback","_defineProperty","this","ManualCountTextureUsageTracker","options","_options$textureClean","_options$textureClean2","super","Map","Set","textureCleanupIntervalMs","textureCleanupAgeThreadholdMs","setInterval","_step4","now","Date","thresholdMs","_iterator4","_createForOfIteratorHelper","zeroReferenceTextureSet","s","n","done","textureRefInfo","value","lastUpdate","id","textureMap","delete","err","e","f","registerTexture","texture","_texture$options","textureId","assertTruthy","has","nodeRefCount","set","add","incrementTextureRefCount","_texture$options2","get","txType","props","decrementTextureRefCount","_texture$options3","FinalizationRegistryTextureUsageTracker","registry","FinalizationRegistry","_texture$options4","_texture$options5","register","stylePropertyMap","alpha","v","prop","x","y","width","w","height","h","zIndex","fontFamily","fontSize","fontStyle","fontWeight","fontStretch","lineHeight","letterSpacing","textAlign","overflowSuffix","maxLines","contain","verticalAlign","clipping","rotation","scale","scaleX","scaleY","color","convertColorToRgba","domPropertyMap","Inspector","canvas","settings","_settings$appHeight","_settings$deviceLogic","_settings$appWidth","_settings$deviceLogic2","_settings$deviceLogic3","_settings$deviceLogic4","isProductionEnvironment","Error","Math","ceil","appHeight","deviceLogicalPixelRatio","appWidth","root","document","createElement","setRootPosition","body","appendChild","MutationObserver","bind","observe","attributes","childList","subtree","ResizeObserver","window","addEventListener","console","warn","rect","getBoundingClientRect","top","documentElement","scrollTop","left","scrollLeft","style","position","transformOrigin","transform","overflow","createDiv","node","properties","div","key","toString","updateNodeProperty","createNode","driver","createProxy","createTextNode","Proxy","target","property","Reflect","receiver","destroyNode","anim","animate","animateNode","getElementById","remove","innerHTML","String","visibility","setAttribute","_stylePropertyMap$pro","mappedStyleResponse","call","setProperty","parentId","parent","_settings$duration","duration","_settings$delay","delay","_props$alpha","_props$rotation","_props$scale","setTimeout","opacity","rotate","ShaderEffect","getEffectKey","getMethodParameters","uniforms","res","u","uni","define","size","push","type","join","ref","_options$props","uniformInfo","passParameters","declaredUniforms","unif","uniType","uniformName","name","uniform","method","resolveDefaults","makeEffectKey","trPropSetterDefaults","state","text","offsetY","scrollable","scrollY","textBaseline","debug","TextRenderer","stage","propSetters","_objectSpread","getPropertySetters","Object","freeze","fromEntries","entries","map","setter","requestRender","setStatus","status","error","emitter","emit","setIsRenderable","renderable","isRenderable","destroyState","forEach","eventName","off","scheduleUpdateState","updateScheduled","queueMicrotask","updateState","calcHeight","numLines","max","LightningTextTextureRenderer","context","_canvas","_context","_settings","mergeDefaults","getPrecision","precision","setFontProperties","font","_getFontSetting","ff","fontFace","ffs","i","length","_load","fonts","fontSetting","check","load","catch","then","calculateRenderInfo","renderInfo","paddingLeft","paddingRight","wordWrapWidth","cutSx","cutEx","cutSy","cutEy","textIndent","linesInfo","innerWidth","textOverflow","wordWrap","suffix","wrapWord","wrapText","l","split","lines","usedLines","slice","otherLines","measureText","al","j","m","remainingText","moreTextLines","maxLineWidth","lineWidths","lineWidth","min","draw","linesOverride","linePositionX","linePositionY","textRenderIssueMargin","globalAlpha","fillRect","translate","drawLines","highlight","highlightColor","hlHeight","highlightHeight","offset","highlightOffset","hlPaddingLeft","highlightPaddingLeft","hlPaddingRight","highlightPaddingRight","fillStyle","getRgbaString","drawLine","prevShadowSettings","shadow","shadowColor","shadowOffsetX","shadowOffsetY","shadowBlur","textColor","fillText","textSplit","word","suffixWidth","wordLen","wordWidth","cutoffIndex","floor","truncWordWidth","substring","indent","allLines","realNewlines","resultLines","result","spaceLeft","words","wordWidthWithSpace","concat","space","reduce","acc","char","wordBreak","advancedRenderer","fontBaselineRatio","resolvedGlobal","self","globalThis","globalFontSet","_resolvedGlobal$docum","tmpElementBounds","createBound","CanvasTextRenderer","OffscreenCanvas","getContext","rendererBounds","x1","y1","x2","y2","fontInfo","undefined","invalidateLayoutCache","invalidateVisibleWindowCache","canRenderFont","isFontFaceSupported","WebTrFontFace","addFontFace","createState","EventEmitter","canvasPages","lightning2TextRenderer","renderWindow","visibleWindow","valid","forceFullLayoutCalc","textW","textH","fontFaceLoadedHandler","debugData","updateCount","layoutCount","drawCount","lastLayoutNumCharacters","layoutSum","drawSum","bufferSize","cssString","loaded","onFontLoaded","onFontLoadError","containedMaxLines","calcMaxLines","getNormalizedRgbaComponents","_state$props","elementBounds","Infinity","intersectBound","visibleWindowHeight","maxLinesPerCanvasPage","renderWindowScreenX1","renderWindowScreenY1","renderWindowScreenX2","renderWindowScreenY2","shift","lineNumStart","lineNumEnd","unshift","pop","_canvasPages","_canvasPages2","_canvasPages3","pageHeight","page1Block","page1LineStart","page0LineStart","page2LineStart","scrollYNearestPage","performance","_step5","_iterator5","pageInfo","_pageInfo$texture","setRenderableOwner","txManager","loadTexture","src","_pageInfo$texture2","getImageData","preload","renderQuads","clippingRect","_state$textW","_state$textH","_state$props2","elementRect","intersectRect","_canvasPages$0$textur","_canvasPages$0$textur2","_canvasPages$1$textur","_canvasPages$1$textur2","_canvasPages$2$textur","_canvasPages$2$textur2","pageSize","_state$props3","combinedAlpha","getNormalizedAlphaComponent","quadColor","mergeColorAlphaPremultiplied","renderer","addQuad","colorBl","colorBr","colorTl","colorTr","dimensions","textureOptions","shader","shaderProps","tx","ty","ta","tb","tc","td","_state$canvasPages","_pageInfo$texture3","_state$canvasPages2","_pageInfo$texture4","_state$fontInfo","_state$fontInfo2","DefaultShader","WebGlCoreShader","bindTextures","textures","glw","activeTexture","bindTexture","ctxTexture","vertex","fragment","DefaultShaderBatched","system","parameters","MAX_VERTEX_TEXTURE_IMAGE_UNITS","t","samplers","Array","from","keys","setUniform","textureUnits","idx","effectCache","getResolvedEffect","effects","effectContructors","JSON","stringify","effect","DynamicShader","createShader","shaderSources","calculateProps","memize","regEffects","shManager","getRegisteredEffects","results","eff","index","_eff$props","fxClass","uniInfo","p","fxProp","propInfo","validator","isArray","Float32Array","bindProps","r","canBatchShaderProps","propsA","propsB","$dimensions","propsEffectsLen","effectA","effectB","effectNameCount","methods","declareUniforms","uFx","baseClass","nr","values","effectMethods","fx","_fx$props","fxProps","remap","cm","fxMethod","resolveMethodDuplicate","replace","onShaderMask","Function","onColorize","onEffectMask","reg","RegExp","methodParameters","pm","sharedMethods","currentMask","drawEffects","current","currentClass","next","effectMethod","methodCollection","increment","$alpha","makeCacheKey","_props$effects","RoundedRectangle","radius","IDENTITY_MATRIX_3x3","SdfShader","resolvedProps","components","_props$transform","_props$scrollY","_props$color","_props$size","_props$distanceRange","_props$debug","distanceRange","RadiusEffect","args","_props$radius","fillMask","boxDist","BorderEffect","_props$width","_props$color2","rgba","LinearGradientEffect","colors","_props$colors","_props$angle","stops","colorsL","tmp","angle","_LinearGradientEffect","rgbas","val","fromLinear","toLinear","calcPoint","amount","loop","ColorLoop","GrayscaleEffect","_props$amount","BorderRightEffect","_props$width2","_props$color3","rectDist","BorderTopEffect","_props$width3","_props$color4","BorderBottomEffect","_props$width4","_props$color5","BorderLeftEffect","_props$width5","_props$color6","GlitchEffect","_props$amplitude","_props$narrowness","_props$blockiness","_props$minimizer","_props$time","amplitude","narrowness","blockiness","minimizer","time","rand","noise","fbm","FadeOutEffect","_props$fade","fade","RadialGradientEffect","_props$colors2","_props$width6","_ref","_props$height","_props$pivot","pivot","_RadialGradientEffect","RadialProgressEffect","_props$width7","_props$progress","_props$offset","_props$range","_props$rounded","_props$radius2","_props$color7","progress","range","PI","rounded","rotateUV","drawDot","HolePunchEffect","_props$radius3","CoreShaderManager","registerShaderType","registerEffectType","shType","shClass","shConstructors","effectType","effectClass","effectConstructors","getRegisteredShaders","loadShader","ShaderClass","loadDynamicShader","cacheKey","shCache","useShader","attachedShader","detach","attach","ContextSpy","reset","data","getData","loadCompressedTexture","_ref2","_asyncToGenerator","_regeneratorRuntime","mark","_callee","url","response","arrayBuffer","wrap","prev","fetch","sent","indexOf","abrupt","loadKTXData","loadPVRData","stop","_x2","apply","arguments","_ref3","_callee2","buffer","view","littleEndian","mipmaps","imageSize","_context2","DataView","getUint32","glInternalFormat","pixelWidth","pixelHeight","numberOfMipmapLevels","bytesOfKeyValueData","premultiplyAlpha","_x3","_ref4","_callee3","pvrHeaderLength","header","dataOffset","pvrtcData","level","_context3","Int32Array","Uint8Array","byteOffset","_x4","ImageTexture","Texture","hasAlphaChannel","mimeType","getTextureData","_this","_callee4","_this$props","blob","img","_callee4$","_context4","ImageData","test","imageWorkerManager","getImage","hasCreateImageBitmap","createImageBitmap","colorSpaceConversion","imageOrientation","t0","t1","Image","Promise","resolve","reject","onload","onerror","_props$src","_props$premultiplyAlp","PeekableIterator","iterator","indexBase","_lastIndex","peekBuffer","nextResult","peek","lastIndex","start","codePoint","getUnicodeCodepoints$","_context5","codePointAt","_marked","layoutText","curLineIndex","startX","startY","vertexBuffer","lineCache","rwSdf","trFontFace","shaper","glyphResult","fontSizeRatio","info","vertexLineHeight","vertexW","vertexLSpacing","startingLineCacheEntry","startingCodepointIndex","codepointIndex","maxX","maxY","curX","curY","bufferOffset","lastWord","xStart","shaperProps","glyphs","shapeText","curLineBufferStart","bufferLineInfos","vertexTruncateHeight","overflowSuffVertexWidth","_step6","_iterator6","glyph","mapped","xAdvance","moreLines","nextLineWillFit","maxCharHeight","lineVertexW","xStartLastWordBoundary","lineIsBelowWindowTop","lineIsAboveWindowBottom","lineIsWithinWindow","cluster","codepoint","charEndX","xOffset","quadX","quadY","yOffset","atlasEntry","getAtlasEntry","glyphId","common","scaleW","scaleH","uvWidth","uvHeight","bufferStart","bufferEnd","vertexTextW","line","bufferNumFloats","bufferNumQuads","layoutNumCharacters","fullyProcessed","setRenderWindow","outRenderWindow","bufferMargin","multiple","screen","sdf","isBoundPositive","y1Base","roundUpToMultiple","firstLineIdx","weightConversions","normal","bold","bolder","lighter","fontWeightToNumber","weight","resolveFontToUse","familyMapsByPriority","family","weightIn","stretch","_step7","_iterator7","fontFaces","_step8","weightMap","_iterator8","fontFamilyWeight","descriptors","msg","TrFontManager","textRenderers","trId","tr","resolveFontFace","tmpRect","SdfTextRenderer","ssdfFontFamilies","msdfFontFamilies","sdfShader","releaseFontFace","setElementBoundsX","boundsOverlap","setElementBoundsY","SdfTrFontFace","familyName","fontFamiles","faceSet","webGlBuffers","bufferUploaded","_state$props4","sdfFontSize","sdfLineHeight","distanceField","neededLength","rwScreen","_state$props5","startLineIndex","sdfVerticalAlignYOffset","sdfStartY","sdfX","sdfY","lineIndex","getStartConditions","out2","byteLength","once","_trFontFace$data","_state$trFontFace","_state$props6","_state$textW2","_state$textH2","stride","BYTES_PER_ELEMENT","webGlBuffer","createBuffer","BufferCollection","a_position","FLOAT","normalized","a_textureCoordinate","_webGlBuffers$getBuff","_webGlBuffers","getBuffer","arrayBufferData","STATIC_DRAW","convertBoundToRect","copyRect","renderOp","WebGlCoreRenderOp","mergeColorAlpha","sdfShaderDebug","getCtxTexture","addTexture","numQuads","addRenderOp","_state$trFontFace2","_state$trFontFace3","fontFamilyArray","_state$props7","_state$props8","loadCoreExtension","_x5","_x6","_loadCoreExtension","_callee12","coreExtensionModule","module$1","ExtensionClass","coreExtension","_callee12$","_context13","log","__vitePreload","module","default","classExtendsCoreExtension","prototype","CoreExtension","run","santizeCustomDataMap","d","validTypes","boolean","string","number","valueType","RendererMain","_settings$clearColor","_settings$experimenta","_settings$enableConte","_settings$enableInspe","resolvedSettings","txMemByteThreshold","boundsMargin","devicePhysicalPixelRatio","devicePixelRatio","clearColor","experimental_FinalizationRegistryTextureUsageTracker","textureCleanupOptions","fpsUpdateInterval","numImageWorkers","enableContextSpy","enableInspector","releaseTexture","useFinalizationRegistryTracker","textureTracker","deviceLogicalWidth","deviceLogicalHeight","targetEl","onCreateNode","nodes","onBeforeDestroyNode","onFpsUpdate","fpsData","onFrameTick","frameTickData","onIdle","inspector","init","_this2","_callee5","_context6","getRootNode","resolveNodeDefaults","_props$fontSize","_props$text","_props$textRendererOv","_props$fontFamily","_props$fontStyle","_props$fontWeight","_props$fontStretch","_props$textAlign","_props$contain","_props$scrollable","_props$scrollY2","_props$offsetY","_props$letterSpacing","_props$lineHeight","_props$maxLines","_props$textBaseline","_props$verticalAlign","_props$overflowSuffix","_props$debug2","textRendererOverride","_props$color8","_ref5","_ref6","_props$colorTl","_ref7","_ref8","_props$colorTr","_ref9","_ref10","_props$colorBl","_ref11","_ref12","_props$colorBr","_props$data","_props$x","_props$y","_props$width8","_props$height2","_props$alpha2","_props$autosize","_props$clipping","_props$colorTop","_props$colorBottom","_props$colorLeft","_props$colorRight","_props$zIndex","_props$zIndexLocked","_props$parent","_props$texture","_props$shader","_props$src2","_props$scale2","_ref13","_props$scaleX","_ref14","_props$scaleY","_props$mount","_ref15","_props$mountX","_ref16","_props$mountY","_props$pivot2","_ref17","_props$pivotX","_ref18","_props$pivotY","_props$rotation2","colorTop","colorLeft","colorRight","colorBottom","autosize","zIndexLocked","mount","mountX","mountY","pivotX","pivotY","createTexture","textureType","nextTextureId","desc","descType","shaderType","getNodeById","toggleFreeze","advanceFrame","rerender","CoreAnimation","propStartValues","propsList","propName","timingFunction","easing","getTimingFunction","delayFor","update","restore","reverse","startValue","endValue","stopMethod","applyEasing","dt","_this$settings","propValue","easingProgressValue","easingColorValue","mergeColorProgress","CoreAnimationController","manager","animation","makeStartedPromise","started","makeStoppedPromise","finished","activeAnimations","registerAnimation","unregisterAnimation","stoppedResolve","pause","waitUntilStarted","promise","startedPromise","waitUntilStopped","stoppedPromise","startedResolve","_this$animation$setti","Matrix3d","temp","tempMatrix","multiply","a","b","out","e0","e1","e2","e3","e4","e5","e6","e7","e8","identity","sx","sy","cos","sin","copy","dst","transpose","other","transformPoint","CoreNodeRenderState","RenderCoords","x3","y3","x4","y4","UpdateType","CoreNodeRenderStateMap","Init","OutOfBounds","InBounds","InViewport","CoreNode","All","autosizeNode","updateScaleRotateTransform","unloadTexture","setUpdateType","IsRenderable","onTextureLoaded","onTextureFailed","onTextureFreed","on","getShaderManager","_shManager$loadShader","updateType","Children","sortChildren","children","sort","calcZIndex","scaleRotateTransform","updateLocalTransform","pivotTranslateX","pivotTranslateY","mountTranslateX","mountTranslateY","localTransform","Global","delta","parentClippingRect","ScaleRotate","Local","childUpdateType","None","globalTransform","calculateRenderCoords","updateBoundingRect","Clipping","RenderState","calculateClippingRect","WorldAlpha","worldAlpha","PremultipliedColors","premultipliedColorTl","premultipliedColorTr","premultipliedColorBl","premultipliedColorBr","updateRenderState","updateIsRenderable","CalculatedZIndex","calculateZIndex","ZIndexSortedChildren","child","checkRenderProps","checkRenderBounds","renderBound","rectW","rectH","strictBound","renderM","preloadBound","boundInsideBound","renderState","previous","event","setRenderState","newIsRenderable","onChangeIsRenderable","_this$props$texture","minX","minY","renderCoords","gt","isRotated","_props$parent2","_props$parent3","z","destroy","removeAllListeners","_this$props2","absX","_this$props$parent","_this$props$parent2","absY","_this$props$parent$ab","_this$props$parent3","newParent","oldParent","splice","nextId","getNewId","MainOnlyNode","rendererMain","coreNode","_coreNode$id","payload","onOutOfBounds","onInBounds","onOutOfViewport","onInViewport","_data","_parent","_newParent$coreNode","_children","_src","imageUrl","_texture","_shader","flush","animationManager","AnimationManager","ImageWorkerManager","workers","createWorkers","worker","onmessage","handleMessage","_event$data","messageManager","_msg","_slicedToArray","numWorkers","Blob","blobURL","URL","webkitURL","createObjectURL","Worker","getNextWorker","workerIndex","convertUrlToAbsolute","location","href","absoluteSrcUrl","postMessage","NoiseTexture","_this3","_callee6","_this3$props","pixelData8","_context7","Uint8ClampedArray","random","cacheId","_props$width9","_props$height3","_props$cacheId","CoreTextureManager","WeakMap","hasWorker","registerTextureType","ColorTexture","SubTexture","textureClass","txConstructors","TextureClass","textureIdCache","_options$cacheKey","descId","textureKeyCache","addTextureIdToCache","textureDescId","textureRefCountMap","count","removeTextureIdFromCache","_this$ctxTextureCache","refCountObj","ctxTextureCache","free","getDebugInfo","keyCacheSize","idCacheSize","textureSource","createCtxTexture","TextureMemoryManager","byteThreshold","threshold","setTextureMemUse","byteSize","memUsed","gc","Stage","rootId","txMemManager","contextSpy","bm","monitorTextureCache","debugInfo","WebGlCoreRenderer","pixelRatio","bufferMemory","fontManager","isIdle","runLoop","rootNode","updateAnimations","hasSceneUpdates","calculateFps","drawFrame","requestAnimationFrame","lastFrameTime","currentFrameTime","deltaTime","renderRequested","addQuads","render","fpsNumFrames","fpsElapsedTime","_this$contextSpy$getD","_this$contextSpy","_this$contextSpy2","fps","round","contextSpyData","resolveTextRenderer","trProps","rendererId","overrideFallback","possibleRenderer","_i8","_Object$entries","_Object$entries$_i","resolvedTextRenderer","CoreTextNode","setWidth","trState","setHeight","calcWidth","_textRendererOverride","_this$resolveTextRend","resolveTextRendererAndState","textRendererState","textRenderer","_this$resolveTextRend2","onTextLoaded","onTextFailed","MainOnlyTextNode","MainCoreDriver","rendererSettings","_this4","_callee7","_context8","SuspenseContext","equalFn","$PROXY","Symbol","$TRACK","signalOptions","equals","runEffects","runQueue","STALE","PENDING","UNOWNED","owned","cleanups","owner","NO_INIT","Owner","Transition","Listener","Updates","Effects","ExecCount","createRoot","fn","detachedOwner","listener","unowned","updateFn","untrack","cleanNode","runUpdates","createSignal","observers","observerSlots","comparator","assign","readSignal","writeSignal","createComputed","updateComputation","createComputation","createRenderEffect","createEffect","runUserEffects","c","user","createMemo","createResource","pSource","pFetcher","pOptions","source","fetcher","pr","initP","scheduled","resolved","dynamic","contexts","_ref20","storage","initialValue","setValue","_createSignal2","setError","_createSignal3","_createSignal4","track","trigger","_createSignal6","setState","loadEnd","onHydrated","_step9","_iterator9","decrement","clear","completeLoad","read","refetching","lookup","castError","defineProperties","loading","latest","refetch","mutate","createSelector","subs","_step10","_iterator10","_step10$value","_iterator11","_step11","pure","onCleanup","deps","prevInput","defer","prevValue","input","onMount","getOwner","runWithOwner","o","prevListener","handleError","startTransition","createContext","defaultValue","Provider","createProvider","useContext","memo","resolveChildren","toArray","sources","updates","lookUpstream","sSlot","sourceSlots","isComp","TransitionRunning","running","disposed","tState","markDownstream","nextValue","updatedAt","runComputation","runTop","suspense","inFallback","ancestors","wait","completeUpdates","queue","userLength","ignore","obs","cause","FALLBACK","dispose","createComponent","Comp","trueFn","propTraps","_","deleteProperty","getOwnPropertyDescriptor","configurable","enumerable","ownKeys","resolveSource","resolveSources","mergeProps","proxy","sourcesMap","defined","create","sourceKeys","getOwnPropertyNames","_loop","definedKeys","defineProperty","narrowedError","For","fallback","list","mapFn","items","disposers","len","indexes","newItems","newIndices","newIndicesNext","tempdisposers","tempIndexes","end","newEnd","item","newLen","disposer","mapper","_createSignal8","mapArray","each","Show","keyed","condition","when","startLightningRenderer","selected","firstChild","insert","beforeNode","_isDirty","nodeIndexToRemove","config","animationsEnabled","animationSettings","fontSettings","isFunc","flattenStyles","obj","States","callback","initialState","filter","_key","onChange","is","toggle","stateIndexToRemove","_createSignal10","activeElement","setActiveElement","defaultAnimationSettings","convertEffectsToShader","styleEffects","_i16","_Object$entries2","_Object$entries2$_i","borderAccessor","direction","ElementNode","rendered","autofocus","_renderProps","_effects","_p$lng","lng","_sendToLightning","_sendToLightningAnimatable","transition","chain","_animationRunning","_animationQueue","_animationQueueSettings","_this5","_callee8","_context9","setFocus","forwardFocus","focusedIndex","isTextNode","_resizeOnTextLoad","_node","loadedPayload","updateLayout","getText","_this$lng","_queueDelete","onEvents","events","_events","_style","hasChildren","getChildById","find","searchChildrenById","_iterator15","_step15","found","states","_states","_stateChanged","_animationSettings","_this$parent","onBeforeLayout","display","flexItem","numChildren","isRow","flexDirection","dimension","crossDimension","marginOne","marginTwo","crossProp","containerSize","containerCrossSize","gap","justify","justifyContent","align","alignItems","itemSize","includes","crossAlignChild","_autosized","calculatedSize","toPad","calculateFlex","onLayout","forwardStates","_undoStyles","_step14","_iterator14","keyExists","stylesToUndo","styleKey","newStyles","styles","marginRight","_width","marginBottom","_height","onLoad","isNaN","_color","onFail","onCreate","handler","_node$lng","inode","solid","_loop2","_ref21","_i17","_LightningRendererNum","_loop3","_ref22","_i18","_LightningRendererNon","borderRadius","_borderRadius","border","borderLeft","borderRight","borderTop","borderBottom","linearGradient","_linearGradient","Text","_el$","_$createElement","View","createRenderer$1","replaceText","insertNode","removeNode","getParentNode","getFirstChild","getNextSibling","accessor","marker","initial","insertExpression","unwrapArray","multi","cleanChildren","array","normalizeIncomingArray","replacement","appendNodes","reconcileArrays","replaceNode","unwrap","parentNode","bLength","aEnd","bEnd","aStart","bStart","after","sequence","removed","inserted","el","isParent","newNode","oldNode","spreadExpression","prevProps","skipChildren","code","element","spread","setProp","use","arg","universalLightning","anchor","solidRenderer","createRenderer","_ref23","_callee9","_context10","rendererOptions","_x7","_x8","hexColor","Number","isInteger","startsWith","$$EVENTS","eventHandler","composedPath","disabled","cancelBubble","_$host","host","depth","createBeforeLeave","listeners","subscribe","confirm","to","_step16","defaultPrevented","preventDefault","_iterator16","_loop4","retry","force","navigate","saveCurrentDepth","history","_depth","replaceState","hasSchemeRegex","trimPathRegex","mockBase","normalizePath","path","omitSlash","resolvePath","base","basePath","fromPath","toLowerCase","extractSearchParams","params","searchParams","createMatcher","partial","matchFilters","_path$split2","pattern","splat","segments","Boolean","locSegments","lenDiff","match","matchFilter","segment","locSegment","matchSegment","remainder","isEqual","localeCompare","sensitivity","some","createMemoObject","expandOptionals","exec","prefix","prefixes","expansion","intent","RouterContextObj","RouteContextObj","useRouter","message","invariant","useNavigate","navigatorFactory","useParams","createRoutes","routeDef","component","isLeaf","shared","asArray","_step17","_iterator17","originalPath","encodeURIComponent","matcher","createBranch","routes","score","route","_route$pattern$split2","matches","createBranches","stack","branches","routeDefs","def","hasOwnProperty","_step18","_iterator18","isEmptyArray","branch","getRouteMatches","createRouterContext","integration","_integration$signal","signal","setSource","_integration$utils","utils","parsePath","renderPath","beforeLeave","scroll","_createSignal12","isRouting","setIsRouting","_ref24","_callee10","_context11","finish","_x9","_createSignal14","reference","setReference","_createSignal16","origin","path_","pathname","search","hash","query","createLocation","referrers","submissions","baseRoute","outlet","_source","_replace$resolve$scro","nextState","resolvedTo","first","go","navigateFromRoute","preloadRoute","preloadData","prevIntent","_loop5","_matches$match","singleFlight","createRouterComponent","routerState","router","_$createComponent","Root","rootLoad","_$memo","Routes","routeStates","nextMatches","prevMatches","equal","_loop6","prevMatch","nextMatch","_match$route","createRouteContext","createOutlet","Route","childRoutes","scrollToHash","fallbackTop","selector","querySelector","scrollIntoView","scrollTo","actions","setupNativeEvents","explicitLinks","actionBase","preloadTimeout","handleAnchor","evt","button","metaKey","altKey","ctrlKey","shiftKey","Node","nodeName","toUpperCase","hasAttribute","svg","namespaceURI","baseVal","rel","getAttribute","baseURI","handleAnchorClick","_res","parse","handleAnchorPreload","_res2","handleAnchorIn","_res3","handleAnchorOut","clearTimeout","handleFormSubmit","actionRef","submitter","FormData","append","eventNames","delegateEvents","removeEventListener","hashParser","str","_window$location$hash3","HashRouter","getSource","intercept","createRouter","keepDepth","hashIndex","notify","bindEvent","block","prevDepth","notifyIfNotBlocked","tryOnCleanup","createSingletonRoot","factory","disposeRoot","useKeyDownEvent","_createSignal18","setEvent","makeEventListener","currentSeries","keyMapEntries","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter","Backspace","Escape","_createSignal20","focusPath","setFocusPath","useFocusManager","userKeyMap","keypressEvent","_loop7","_Object$entries3$_i","_Object$entries3","_i20","currentFocusedElm","prevFocusedElm","prevFocusPath","fp","onFocus","elm","onBlur","mappedKeyEvent","keyCode","_step19","finalFocusElm","_iterator19","onKeyHandler","onKeyPress","withPadding","padding","right","bottom","pad","_pad","marginLeft","maxHeight","marginTop","speak","phrase","utterances","lang","synth","speechSynthesis","utterance","SpeechSynthesisUtterance","onend","speakSeries","series","remainingPhrases","flattenedSeries","flattenStrings","nestedSeriesResults","active","_callee11","totalRetries","retriesLeft","seriesResult","_seriesResult","_callee11$","_context12","SpeechSynthesisErrorEvent","toSpeak","cancel","SpeechEngine","resetFocusPathTimer","currentlySpeaking","debounce","timeoutId","debounced","voiceOutDisabled","debounceWithFlush","scopedValue","newValue","getElmName","onFocusChangeCore","Announcer","onFocusChange","enabled","every","focusDiff","toAnnounceText","toAnnounce","announce","title","announceContext","table","clearPrevFocus","notification","_currentlySpeaking","textToSpeech","finally","refresh","setupTimers","focusDebounce","focusChangeTimeout","_a","_b","_c","_d","_e","_f","_g","_h","_i","_j","_k","_l","_m","_n","_o","_p","_createSignal22","globalBackground","setGlobalBackground","theme","primary","secondary","tertiary","inactive","full","none","alpha1","alpha2","alpha3","alpha4","alpha5","xfast","fast","slow","xslow","expressive","expressiveEntrance","expressiveExit","standard","standardEntrance","standardExit","utility","utilityEntrance","utilityExit","asset","arrowLeft","arrowRight","backspaceOutline","palette","white","black","grey","red","orange","yellow","green","blue","purple","material","materialBrand","overlay","textNeutral","textNeutralSecondary","textNeutralTertiary","textNeutralDisabled","textInverse","textInverseSecondary","textInverseTertiary","textInverseDisabled","textBrand","textBrandSecondary","textBrandTertiary","textBrandDisabled","textPositive","textNegative","textInfo","textCaution","fillTransparent","fillNeutral","fillNeutralSecondary","fillNeutralTertiary","fillNeutralDisabled","fillInverse","fillInverseSecondary","fillInverseTertiary","fillInverseDisabled","fillBrand","fillBrandSecondary","fillBrandTertiary","fillBrandDisabled","fillPositive","fillNegative","fillInfo","fillCaution","strokeNeutral","strokeNeutralSecondary","strokeNeutralTertiary","strokeNeutralDisabled","strokeInverse","strokeInverseSecondary","strokeInverseTertiary","strokeInverseDisabled","strokeBrand","strokeBrandSecondary","strokeBrandTertiary","strokeBrandDisabled","strokePositive","strokeNegative","strokeInfo","strokeCaution","interactiveNeutral","interactiveNeutralFocus","interactiveNeutralFocusSoft","interactiveInverse","interactiveInverseFocus","interactiveInverseFocusSoft","interactiveBrand","interactiveBrandFocus","interactiveBrandFocusSoft","shadowNeutral","shadowNeutralFocus","shadowNeutralFocusSoft","shadowNeutralText","shadowInverse","shadowInverseFocus","shadowInverseFocusSoft","shadowInverseText","shadowBrand","shadowBrandFocus","shadowBrandFocusSoft","shadowBrandText","layout","columnCount","focusScale","gutterX","gutterY","marginX","marginY","safe","screenW","screenH","xs","sm","md","lg","xl","spacer","xxs","xxl","xxxl","stroke","typography","display1","display2","headline1","headline2","headline3","body1","body2","body3","button1","button2","callout1","caption1","tag1","footnote1","componentConfig","Keyboard","keyProps","icon","Background","bg1","bg2","heroMask","bgStyles","delayedBackgrounds","r$","defaultModeKeys","defaultToneKeys","makeComponentStyles","themeKeys","modes","tones","themeStyles","themeStyles2","modeKeys","toneKeys","mapThemeKeysToSolid","stylesToMap","themeKey","solidKey","generateSolidStylesFromLookupObject","base2","modes2","tones2","themeStyles3","themeComponentStyles","variantName","styles2","convertedStyles","styleName","modeName","modeStyles","baseStyles","makeBaseStyles","makeModeStyles","mode","toneStyles","makeToneStyles","tone","_ref26","_ref27","_a2","_b2","_ref28","withScrolling","adjustment","componentRef","selectedElement","lastSelected","_updateLastIndex","lastItem","windowVal","updateLastIndex","_updateLastIndex2","currentVal","newVal","size2","direct","scrollIndex","abs","chainFunctions","onlyFunctions","func","innerArgs","_step20","_iterator20","onGridFocus","skipFocus","handleNavigation","onSelectedChanged","plinko","num","_ref29$Artwork","Artwork","_ref29$Artwork2","themeStyles$d","defaultTone","_objectWithoutProperties","_excluded","fillColor","fallbackSrc","gradientColor","_ref30$Icon","Icon","_ref30$Icon2","themeStyles$c","_excluded2","inverse","brand","_ref31$Badge","Badge","_ref31$Badge2","themeStyles$b","_excluded3","container$c","text$6","icon$2","_ref32$Button","Button","_ref32$Button2","themeStyles$a","_excluded4","container$b","contentColor","focus","content","text$5","_ref33$Checkbox","Checkbox","_ref33$Checkbox2","themeStyles$9","_excluded5","strokeWidth","container$a","checked","neutral","icon$1","_ref34$Column","Column","_ref34$Column2","defaultTone$9","themeStyles$8","_excluded6","styles$9","Container","itemTransition","onUp","onDown","_props$tone","flat","_ref35$Label","Label","_ref35$Label2","themeStyles$7","_excluded7","container$8","backgroundColor","text$4","_ref36$Rating","Rating","_ref36$Rating2","themeStyles$6","container$7","itemSpacing","toneModes","text$3","_ref37$Details","Details","_ref37$Details2","themeStyles$5","_excluded8","container$6","contentSpacing","badgeContentSpacing","ratingContentSpacing","text$2","_ref38$Metadata","Metadata","_ref38$Metadata2","themeStyles$4","_excluded9","container$5","titleText","descriptionText","_ref39$ProgressBar","ProgressBar","_ref39$ProgressBar2","themeStyles$3","_excluded10","container$4","_ref40$Row","Row","_ref40$Row2","defaultTone$3","themeStyles$2","_excluded11","styles$3","onLeft","onRight","_props$tone2","_props$tone3","_ref41$Keyboard","_ref41$Keyboard2","themeStyles$1","_excluded12","container$2","keySpacing","baseWidth","sizes","paddingX","text$1","_ref42$Key","Key","_ref42$Key2","_excluded13","container$1","_ref43$Tile","Tile","_ref43$Tile2","tileThemeStyles","_excluded14","_ref44$Surface","Surface","_ref44$Surface2","surfaceThemeStyles","defaultSurfaceTone","_excluded15","container","paddingYProgress","paddingYBetweenContent","insetBottom","standardBottom","logoContainer","styles$1","Gradient","NavButton","import","icons","subTextures","spriteMapTexture","sprite","_$mergeProps","NavDrawer","backdrop","onEnter","fpsStyle","fpsLabel","fpsValue","_createSignal24","setFps","_createSignal26","avgFps","setAvgFps","_createSignal28","minFps","setMinFps","_createSignal30","maxFps","setMaxFps","totalFps","resetCounter","setupFPS","calcFps","FPSCounter","App","Menu","announcer","navDrawer","lastFocused","onAnnouncer","onLast","back","onMenu","Page","headlineText","headlineSubText","itemsContainer","Thumbnail","FocusRing","FPS","FPSLabel","FPSValue","showHeadline","headlineBlur","RowTitle","Rect","peopleBio","buttonStyles","topBar","MaterialButton","MaterialButtonText","TileRow","_splitProps","blocked","k","_step12","otherObject","objects","_iterator12","_step13","isDefaultDesc","writable","objectIndex","_iterator13","splitProps","_splitProps2","local","others","tmdbConfig","baseImageUrl","API_BASE","basePosterSize","defaultFetchParams","headers","Authorization","getImageUrl","posterSize","_get","json","loadConfig","_data$images","images","secure_base_url","api","convertItemsToTiles","poster_path","profile_path","tileSrc","backdrop_path","media_type","shortTitle","maxLength","entityInfo","heroContent","description","overview","cache","leftoverTiles","createInfiniteScroll","_createSignal32","pages","setPages","_createSignal34","page","setPage","_createSignal36","setEnd","contents","blockWidth","HeadlineStyles","Headline","DescriptionStyles","BadgeStyle","Description","MetaTextStyle","metaText","badges","getReviews","reviews","rtCrit","rtFan","ContentBlock","justYear","dateString","getRecommendations","getCredits","cast","getInfo","rt","backgroundImage","minutes","runtime","remainingMinutes","minutesToHMM","release_date","first_air_date","last_air_date","Browse","_createSignal38","columnY","setcolumnY","_createSignal40","entityProvider","_createSignal42","setHeroContent","isFirst","provider","pageIndex","trending","adult","chunks","chunkArray","onRowFocus","_this$children$select","numPages","entity","Portal","demos","DemoTile","_createSignal44","setColor","_createSignal46","rowX","setRowX","moveRow","row","demo","TextPage","OverviewContainer","SublineContainer","Title","Overview","Subline","CreatePage","myBox","childRef","_createSignal48","insertTest","setInsertTest","_createSignal50","emptyTest","_childRef$getChildByI","styleChild","someOtherStyle","ChildTest","borderStyles","childTestPassedStyles","childTestPassedStyles2","hasFocus","ViewportPage","ball","invervalTimer","_createSignal52","ballStatus","setBallStatus","styleBall","lineheight","randomIntBetween","logEvent","clearInterval","ButtonsPage","RowStyles","_$use","FlexPage","rowTitle","Block","_createSignal54","setColumnY","_this$children$select2","FlexSizePage","randSize","_createSignal56","_this$children$select3","FlexColumnPage","ColumnStyles","_createSignal58","_this$children$select4","_createSignal60","_this$children$select5","MaterialButtonsPage","manifestUri","_initPlayer","_callee13","video","player","_callee13$","_context14","shaka","Player","onErrorEvent","onError","detail","polyfill","installAll","isBrowserSupported","initPlayer","Entity","credits","recommendations","_createSignal62","backdropAlpha","setBackdropAlpha","columnRef","backdropRef","trailerButton","Backdrop","_this$children$select6","onRowFocusAnimate","_this$children$select7","onEscape","hidden","getElementsByTagName","onEnterTrailer","play","playVideo","biography","People","NotFound","_$setProp","coreExtensionModuleUrl","meta","Config","FlexColumnSizePage","ButtonsMaterialPage"],"mappings":"y9UAsBiBA,sQCDV,MAAMC,GAETC,WAAAA,CAAYC,GAAiBC,EAAAC,KAAA,uBAAA,GACzBA,KAAKF,gBAAkBA,CAC1B,ECFE,MAAMG,WAAuCL,GAIhDC,WAAAA,CAAYC,EAAiBI,GAAS,IAAAC,EAAAC,EAClCC,MAAMP,GAAiBC,oBAJd,IAAIO,KAAKP,EACIC,KAAA,0BAAA,IAAIO,KAAKR,EAAAC,KAAA,eAAA,GAI/BA,KAAKE,QAAU,CACXM,iCAAwBL,EAAED,EAAQM,gCAAwB,IAAAL,EAAAA,EAAI,IAC9DM,8BAAoE,QAAvCL,EAAEF,EAAQO,qCAA6BL,IAAAA,EAAAA,EAAI,KAI5EM,aAAY,KACR,IAEyDC,EAFnDC,EAAMC,KAAKD,MACXE,EAAcd,KAAKE,QAAQO,8BAA8BM,EAAAC,EAClChB,KAAKiB,yBAAuB,IAAzD,IAAAF,EAAAG,MAAAP,EAAAI,EAAAI,KAAAC,MAA2D,CAAA,IAAhDC,EAAcV,EAAAW,MACjBV,EAAMS,EAAeE,WAAaT,IAClCd,KAAKF,gBAAgBuB,EAAeG,IACpCxB,KAAKyB,WAAWC,OAAOL,EAAeG,IACtCxB,KAAKiB,wBAAwBS,OAAOL,GAE3C,CAAA,CAAAM,MAAAA,GAAAZ,EAAAa,EAAAD,EAAAZ,CAAAA,QAAAA,EAAAc,GACb,IAAW7B,KAAKE,QAAQM,yBACnB,CACDsB,eAAAA,CAAgBC,GAAS,IAAAC,EACfC,EAA2B,QAAlBD,EAAGD,EAAQ7B,eAAO,IAAA8B,OAAA,EAAfA,EAAiBR,GAEnC,GADAU,EAAaD,EAAW,6CACnBjC,KAAKyB,WAAWU,IAAIF,GAAY,CACjC,IAAMZ,EAAiB,CACnBG,GAAIS,EACJG,aAAc,EACdb,WAAYV,KAAKD,OAErBZ,KAAKy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73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,93,94,98,102]} \ No newline at end of file diff --git a/assets/index-legacy-CN18kCrR.js b/assets/index-legacy-CN18kCrR.js deleted file mode 100644 index d7ee353..0000000 --- a/assets/index-legacy-CN18kCrR.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(){var e=["defaultTone"],t=["defaultTone"],n=["defaultTone"],r=["defaultTone"],o=["defaultTone"],i=["defaultTone"],a=["defaultTone"],s=["defaultTone"],l=["defaultTone"],u=["defaultTone"],c=["defaultTone"],d=["defaultTone"],f=["defaultTone"],h=["defaultTone"],p=["defaultSurfaceTone"];function v(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function g(e){var t="function"==typeof Map?new Map:void 0;return g=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(A())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&_(o,n.prototype),o}(e,arguments,C(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),_(n,e)},g(e)}function y(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */y=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var i=t&&t.prototype instanceof m?t:m,a=Object.create(i.prototype),s=new E(r||[]);return o(a,"_invoke",{value:_(e,n,s)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var f="suspendedStart",h="suspendedYield",p="executing",v="completed",g={};function m(){}function x(){}function b(){}var w={};u(w,a,(function(){return this}));var k=Object.getPrototypeOf,S=k&&k(k(N([])));S&&S!==n&&r.call(S,a)&&(w=S);var A=b.prototype=m.prototype=Object.create(w);function C(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function n(o,i,a,s){var l=d(e[o],e,i);if("throw"!==l.type){var u=l.arg,c=u.value;return c&&"object"==typeof c&&r.call(c,"__await")?t.resolve(c.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(c).then((function(e){u.value=e,a(u)}),(function(e){return n("throw",e,a,s)}))}s(l.arg)}var i;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return i=i?i.then(o,o):o()}})}function _(t,n,r){var o=f;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var l=R(s,r);if(l){if(l===g)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===f)throw o=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=p;var u=d(t,n,r);if("normal"===u.type){if(o=r.done?v:h,u.arg===g)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=v,r.method="throw",r.arg=u.arg)}}}function R(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,R(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function I(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function B(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(I,this),this.reset(!0)}function N(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var l=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(l&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),B(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;B(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:N(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function m(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(u){return void n(u)}s.done?t(l):Promise.resolve(l).then(r,o)}function x(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){m(i,r,o,a,s,"next",e)}function s(e){m(i,r,o,a,s,"throw",e)}a(void 0)}))}}function b(){return b="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=C(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},b.apply(this,arguments)}function w(e,t,n){return t=C(t),k(e,A()?Reflect.construct(t,n||[],C(e).constructor):t.apply(e,n))}function k(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return S(e)}function S(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function A(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(A=function(){return!!e})()}function C(e){return C=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},C(e)}function T(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_(e,t)}function _(e,t){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_(e,t)}function R(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function O(e,t){if(e){if("string"==typeof e)return D(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?D(e,t):void 0}}function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0])||arguments[0];if(!1===e||!l){l=!1;var t=c?c():r;if(null!=t&&!1!==t){var n,i=s!==we?s:ze((function(){return o(t,{value:h(),refetching:e})}));return(n=i)&&"object"==typeof n&&"then"in n?(a=i,"value"in i?("success"===i.status?A(a,i.value,void 0,t):A(a,void 0,void 0,t),i):(l=!0,queueMicrotask((function(){return l=!1})),qe((function(){S(u?"refreshing":"pending"),b()}),!1),i.then((function(e){return A(i,e,void 0,t)}),(function(e){return A(i,void 0,rt(e),t)})))):(A(a,i,void 0,t),i)}A(a,ze(h))}}return Object.defineProperties(C,{state:{get:function(){return k()}},error:{get:function(){return g()}},loading:{get:function(){var e=k();return"pending"===e||"refreshing"===e}},latest:{get:function(){if(!u)return C();var e=g();if(e&&!a)throw e;return h()}}}),c?Be((function(){return T(!1)})):T(!1),[C,{refetch:T,mutate:p}]}function Me(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:he,n=new Map,r=Ve((function(r){var o,i=e(),a=P(n.entries());try{for(a.s();!(o=a.n()).done;){var s=z(o.value,2),l=s[0],u=s[1];if(t(l,i)!==t(l,r)){var c,d=P(u.values());try{for(d.s();!(c=d.n()).done;){var f=c.value;f.state=me,f.pure?Ce.push(f):Te.push(f)}}catch(h){d.e(h)}finally{d.f()}}}}catch(h){a.e(h)}finally{a.f()}return i}),void 0,!0,me);return Ge(r),function(e){var o,i=Ae;i&&((o=n.get(e))?o.add(i):n.set(e,o=new Set([i])),De((function(){o.delete(i),!o.size&&n.delete(e)})));return t(e,r.value)}}function ze(e){if(null===Ae)return e();var t=Ae;Ae=null;try{return e()}finally{Ae=t}}function Pe(e,t,n){var r,o=Array.isArray(e),i=n&&n.defer;return function(n){var a;if(o){a=Array(e.length);for(var s=0;s1e6)throw Ce=[],new Error}),!1)),t}function Ge(e){if(e.fn){nt(e);var t=_e;!function(e,t,n){var r,o=ke,i=Ae;Ae=ke=e;try{r=e.fn(t)}catch(a){return e.pure&&(e.state=me,e.owned&&e.owned.forEach(nt),e.owned=null),e.updatedAt=n+1,ot(a)}finally{Ae=i,ke=o}(!e.updatedAt||e.updatedAt<=n)&&(null!=e.updatedAt&&"observers"in e?Xe(e,r):e.value=r,e.updatedAt=n)}(e,e.value,t)}}function Ve(e,t,n){var r={fn:e,state:arguments.length>3&&void 0!==arguments[3]?arguments[3]:me,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:ke,context:ke?ke.context:null,pure:n};return null===ke||ke!==be&&(ke.owned?ke.owned.push(r):ke.owned=[r]),r}function Ze(e){if(0!==e.state){if(e.state===xe)return et(e);if(e.suspense&&ze(e.suspense.inFallback))return e.suspense.effects.push(e);for(var t=[e];(e=e.owner)&&(!e.updatedAt||e.updatedAt<_e);)e.state&&t.push(e);for(var n=t.length-1;n>=0;n--)if((e=t[n]).state===me)Ge(e);else if(e.state===xe){var r=Ce;Ce=null,qe((function(){return et(e,t[0])}),!1),Ce=r}}}function qe(e,t){if(Ce)return e();var n=!1;t||(Ce=[]),Te?n=!0:Te=[],_e++;try{var r=e();return function(e){Ce&&(Je(Ce),Ce=null);if(e)return;var t=Te;Te=null,t.length&&qe((function(){return ye(t)}),!1)}(n),r}catch(o){n||(Te=null),Ce=null,ot(o)}}function Je(e){for(var t=0;t=0;t--)nt(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function rt(e){return e instanceof Error?e:new Error("string"==typeof e?e:"Unknown error",{cause:e})}function ot(e){throw rt(e)}function it(e){if("function"==typeof e&&!e.length)return it(e());if(Array.isArray(e)){for(var t=[],n=0;n=0;n--){var r=ft(t[n])[e];if(void 0!==r)return r}},has:function(e){for(var n=t.length-1;n>=0;n--)if(e in ft(t[n]))return!0;return!1},keys:function(){for(var e=[],n=0;n=0;l--){var u=t[l];if(u)for(var c=Object.getOwnPropertyNames(u),d=function(){var e=c[f];if("__proto__"===e||"constructor"===e)return 1;var t=Object.getOwnPropertyDescriptor(u,e);if(s[e]){var n=a[e];n&&(t.get?n.push(t.get.bind(u)):void 0!==t.value&&n.push((function(){return t.value})))}else s[e]=t.get?{enumerable:!0,configurable:!0,get:ht.bind(a[e]=[t.get.bind(u)])}:void 0!==t.value?t:void 0},f=c.length-1;f>=0;f--)d()}for(var h={},p=Object.keys(s),v=p.length-1;v>=0;v--){var g=p[v],y=s[g];y&&y.get?Object.defineProperty(h,g,y):h[g]=y?y.value:void 0}return h}var vt=function(e){return"Stale read from <".concat(e,">.")};function gt(e){var t="fallback"in e&&{fallback:function(){return e.fallback}};return Fe(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=[],o=[],i=[],a=0,s=t.length>1?[]:null;return De((function(){return lt(i)})),function(){var l,u,c=e()||[];return c[ve],ze((function(){var e,t,f,h,p,v,g,y,m,x=c.length;if(0===x)0!==a&&(lt(i),i=[],r=[],o=[],a=0,s&&(s=[])),n.fallback&&(r=[st],o[0]=Re((function(e){return i[0]=e,n.fallback()})),a=1);else if(0===a){for(o=new Array(x),u=0;u=v&&y>=v&&r[g]===c[y];g--,y--)f[y]=o[g],h[y]=i[g],s&&(p[y]=s[g]);for(e=new Map,t=new Array(y+1),u=y;u>=v;u--)m=c[u],l=e.get(m),t[u]=void 0===l?-1:l,e.set(m,u);for(l=v;l<=g;l++)m=r[l],void 0!==(u=e.get(m))&&-1!==u?(f[u]=o[l],h[u]=i[l],s&&(p[u]=s[l]),u=t[u],e.set(m,u)):i[l]();for(u=v;u0?ze((function(){return o(t?r:function(){if(!ze(n))throw vt("Show");return e.when})})):o}return e.fallback}),void 0,void 0)}var mt=z(Ie(void 0),2),xt=mt[0],bt=mt[1],wt=I((function e(t){B(this,e),L(this,"releaseCallback",void 0),this.releaseCallback=t})),kt=function(e){function t(e,n){var r,o,i;return B(this,t),L(i=w(this,t,[e]),"textureMap",new Map),L(i,"zeroReferenceTextureSet",new Set),L(i,"options",void 0),i.options={textureCleanupIntervalMs:null!==(r=n.textureCleanupIntervalMs)&&void 0!==r?r:1e4,textureCleanupAgeThreadholdMs:null!==(o=n.textureCleanupAgeThreadholdMs)&&void 0!==o?o:6e4},setInterval((function(){var e,t=Date.now(),n=i.options.textureCleanupAgeThreadholdMs,r=P(i.zeroReferenceTextureSet);try{for(r.s();!(e=r.n()).done;){var o=e.value;t-o.lastUpdate>n&&(i.releaseCallback(o.id),i.textureMap.delete(o.id),i.zeroReferenceTextureSet.delete(o))}}catch(a){r.e(a)}finally{r.f()}}),i.options.textureCleanupIntervalMs),i}return T(t,e),I(t,[{key:"registerTexture",value:function(e){var t,n=null===(t=e.options)||void 0===t?void 0:t.id;if(_(n,"Texture must have an id to be registered"),!this.textureMap.has(n)){var r={id:n,nodeRefCount:0,lastUpdate:Date.now()};this.textureMap.set(n,r),this.zeroReferenceTextureSet.add(r)}}},{key:"incrementTextureRefCount",value:function(e){var t,n=null===(t=e.options)||void 0===t?void 0:t.id;_(n,"Texture must have an id to be registered");var r=this.textureMap.get(n);r||(this.registerTexture(e),r=this.textureMap.get(n)),_(r,"Texture must have been registered"),"SubTexture"===e.txType&&this.incrementTextureRefCount(e.props.texture),r.nodeRefCount++,r.lastUpdate=Date.now(),this.zeroReferenceTextureSet.has(r)&&this.zeroReferenceTextureSet.delete(r)}},{key:"decrementTextureRefCount",value:function(e){var t,n=null===(t=e.options)||void 0===t?void 0:t.id;_(n,"Texture must have an id to be registered");var r=this.textureMap.get(n);_(r,"Texture must have been registered"),r.nodeRefCount--,r.lastUpdate=Date.now(),0===r.nodeRefCount&&this.zeroReferenceTextureSet.add(r),"SubTexture"===e.txType&&this.decrementTextureRefCount(e.props.texture)}}])}(wt),St=function(e){function t(e){var n;return B(this,t),L(n=w(this,t,[e]),"registry",void 0),n.registry=new FinalizationRegistry(e),n}return T(t,e),I(t,[{key:"registerTexture",value:function(e){var t,n;_(null===(t=e.options)||void 0===t?void 0:t.id,"Texture must have an ID to be registered"),this.registry.register(e,null===(n=e.options)||void 0===n?void 0:n.id)}},{key:"incrementTextureRefCount",value:function(){}},{key:"decrementTextureRefCount",value:function(){}}])}(wt),At={alpha:function(e){return 1===e?null:{prop:"opacity",value:"".concat(e)}},x:function(e){return{prop:"left",value:"".concat(e,"px")}},y:function(e){return{prop:"top",value:"".concat(e,"px")}},width:function(e){return 0===e?null:{prop:"width",value:"".concat(e,"px")}},height:function(e){return 0===e?null:{prop:"height",value:"".concat(e,"px")}},zIndex:function(){return"zIndex"},fontFamily:function(){return"font-family"},fontSize:function(){return"font-size"},fontStyle:function(){return"font-style"},fontWeight:function(){return"font-weight"},fontStretch:function(){return"font-stretch"},lineHeight:function(){return"line-height"},letterSpacing:function(){return"letter-spacing"},textAlign:function(){return"text-align"},overflowSuffix:function(){return"overflow-suffix"},maxLines:function(){return"max-lines"},contain:function(){return"contain"},verticalAlign:function(){return"vertical-align"},clipping:function(e){return!1===e?null:{prop:"overflow",value:e?"hidden":"visible"}},rotation:function(e){return 0===e?null:{prop:"transform",value:"rotate(".concat(e,"rad)")}},scale:function(e){return 1===e?null:{prop:"transform",value:"scale(".concat(e,")")}},scaleX:function(e){return 1===e?null:{prop:"transform",value:"scaleX(".concat(e,")")}},scaleY:function(e){return 1===e?null:{prop:"transform",value:"scaleY(".concat(e,")")}},color:function(e){return 0===e?null:{prop:"color",value:Ct(e)}}},Ct=function(e){var t=(255&e)/255,n=e>>8&255,r=e>>16&255;return"rgba(".concat(e>>24&255,",").concat(r,",").concat(n,",").concat(t,")")},Tt={id:"id"},_t=function(){return I((function e(t,n){var r,o,i,a,s,l;if(B(this,e),L(this,"root",null),L(this,"canvas",null),L(this,"height",1080),L(this,"width",1920),L(this,"scaleX",1),L(this,"scaleY",1),!R()){if(!n)throw new Error("settings is required");this.height=Math.ceil(null!==(r=n.appHeight)&&void 0!==r?r:1080/(null!==(o=n.deviceLogicalPixelRatio)&&void 0!==o?o:1)),this.width=Math.ceil(null!==(i=n.appWidth)&&void 0!==i?i:1900/(null!==(a=n.deviceLogicalPixelRatio)&&void 0!==a?a:1)),this.scaleX=null!==(s=n.deviceLogicalPixelRatio)&&void 0!==s?s:1,this.scaleY=null!==(l=n.deviceLogicalPixelRatio)&&void 0!==l?l:1,this.canvas=t,this.root=document.createElement("div"),this.setRootPosition(),document.body.appendChild(this.root),new MutationObserver(this.setRootPosition.bind(this)).observe(t,{attributes:!0,childList:!1,subtree:!1}),new ResizeObserver(this.setRootPosition.bind(this)).observe(t),window.addEventListener("resize",this.setRootPosition.bind(this)),console.warn("Inspector is enabled, this will impact performance")}}),[{key:"setRootPosition",value:function(){if(null!==this.root&&null!==this.canvas){var e=this.canvas.getBoundingClientRect(),t=document.documentElement.scrollTop+e.top,n=document.documentElement.scrollLeft+e.left;this.root.id="root",this.root.style.left="".concat(n,"px"),this.root.style.top="".concat(t,"px"),this.root.style.width="".concat(this.width,"px"),this.root.style.height="".concat(this.height,"px"),this.root.style.position="absolute",this.root.style.transformOrigin="0 0 0",this.root.style.transform="scale(".concat(this.scaleX,", ").concat(this.scaleY,")"),this.root.style.overflow="hidden",this.root.style.zIndex="65534"}}},{key:"createDiv",value:function(e,t){var n=document.createElement("div");for(var r in n.style.position="absolute",n.id=e.id.toString(),t)this.updateNodeProperty(n,r,t[r]);return n}},{key:"createNode",value:function(e,t){var n=e.createNode(t),r=this.createDiv(n,t);return r.node=n,n.div=r,this.createProxy(n,r)}},{key:"createTextNode",value:function(e,t){var n=e.createTextNode(t),r=this.createDiv(n,t);return this.createProxy(n,r)}},{key:"createProxy",value:function(e,t){var n=this;return new Proxy(e,{set:function(e,r,o){return n.updateNodeProperty(t,r,o),Reflect.set(e,r,o)},get:function(r,o,i){return"destroy"===o&&n.destroyNode(r),"animate"===o?function(o,i){var a=r.animate(o,i);return new Proxy(a,{get:function(r,a,s){return"start"===a&&n.animateNode(t,e,o,i),Reflect.get(r,a,s)}})}:Reflect.get(r,o,i)}})}},{key:"destroyNode",value:function(e){var t=document.getElementById(e.id.toString());null==t||t.remove()}},{key:"updateNodeProperty",value:function(e,t,n){if(null!==this.root&&null!=n)if("parent"!==t){if("text"===t)return e.innerHTML=String(n),void(e.style.visibility="hidden");if("src"===t&&n)e.setAttribute("data-src",String(n));else{if(At[t]){var r,o=null===(r=At[t])||void 0===r?void 0:r.call(At,n);if(null===o)return;return"string"==typeof o?void e.style.setProperty(o,String(n)):void("object"==typeof o&&e.style.setProperty(o.prop,o.value))}if(Tt[t])e.setAttribute(String(At[t]),String(n));else if("data"!==t);else for(var i in n)e.setAttribute("data-".concat(i),String(n[i]))}}else{var a=n.id;if(1===a)return void this.root.appendChild(e);var s=document.getElementById(a.toString());null==s||s.appendChild(e)}}},{key:"animateNode",value:function(e,t,n,r){var o=r.duration,i=void 0===o?1e3:o,a=r.delay,s=void 0===a?0:a,l=n.x,u=n.y,c=n.width,d=n.height,f=n.alpha,h=void 0===f?1:f,p=n.rotation,v=void 0===p?0:p,g=n.scale,y=void 0===g?1:g,m=n.color;setTimeout((function(){setTimeout((function(){e.style.top="".concat(u,"px"),e.style.left="".concat(l,"px"),e.style.width="".concat(c,"px"),e.style.height="".concat(d,"px"),e.style.opacity="".concat(h),e.style.rotate="".concat(v,"rad"),e.style.scale="".concat(y),e.style.color=Ct(m)}),i)}),s)}}])}(),Rt=function(e,t,n){var r=Promise.resolve();return r.then((function(){return e()})).catch((function(e){var t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}))},It=function(){return I((function e(t){B(this,e),L(this,"priority",1),L(this,"name",""),L(this,"ref",void 0),L(this,"target",void 0),L(this,"passParameters",""),L(this,"declaredUniforms",""),L(this,"uniformInfo",{});var n=t.ref,r=t.target,o=t.props,i=void 0===o?{}:o;this.ref=n,this.target=r;var a={},s=[],l="",u=this.constructor.uniforms||{};for(var c in u){var d=u[c],f=d.type,h="".concat(n,"_").concat(c),p="";d.size&&(p="[".concat(d.size(i),"]")),s.push(h),l+="uniform ".concat(f," ").concat(h).concat(p,";"),a[c]={name:h,uniform:u[c].method}}this.passParameters=s.join(","),this.declaredUniforms=l,this.uniformInfo=a}),null,[{key:"getEffectKey",value:function(e){return""}},{key:"getMethodParameters",value:function(e,t){var n=[];for(var r in e){var o=e[r],i="";o.size&&(i="[".concat(o.size(t),"]")),n.push("".concat(o.type," ").concat(r).concat(i))}return n.join(",")}},{key:"resolveDefaults",value:function(e){return{}}},{key:"makeEffectKey",value:function(e){return!1}}])}();L(It,"uniforms",{}),L(It,"methods",void 0),L(It,"onShaderMask",void 0),L(It,"onColorize",void 0),L(It,"onEffectMask",void 0);var Bt={x:function(e,t){e.props.x=t},y:function(e,t){e.props.y=t},width:function(e,t){e.props.width=t},height:function(e,t){e.props.height=t},color:function(e,t){e.props.color=t},zIndex:function(e,t){e.props.zIndex=t},fontFamily:function(e,t){e.props.fontFamily=t},fontWeight:function(e,t){e.props.fontWeight=t},fontStyle:function(e,t){e.props.fontStyle=t},fontStretch:function(e,t){e.props.fontStretch=t},fontSize:function(e,t){e.props.fontSize=t},text:function(e,t){e.props.text=t},textAlign:function(e,t){e.props.textAlign=t},contain:function(e,t){e.props.contain=t},offsetY:function(e,t){e.props.offsetY=t},scrollable:function(e,t){e.props.scrollable=t},scrollY:function(e,t){e.props.scrollY=t},letterSpacing:function(e,t){e.props.letterSpacing=t},lineHeight:function(e,t){e.props.lineHeight=t},maxLines:function(e,t){e.props.maxLines=t},textBaseline:function(e,t){e.props.textBaseline=t},verticalAlign:function(e,t){e.props.verticalAlign=t},overflowSuffix:function(e,t){e.props.overflowSuffix=t},debug:function(e,t){e.props.debug=t}},Et=function(){return I((function e(t){var n=this;B(this,e),L(this,"stage",void 0),L(this,"set",void 0),this.stage=t;var r=F(F({},Bt),this.getPropertySetters());this.set=Object.freeze(Object.fromEntries(Object.entries(r).map((function(e){var t=z(e,2),r=t[0],o=t[1];return[r,function(e,t){e.props[r]!==t&&(o(e,t),n.stage.requestRender())}]}))))}),[{key:"setStatus",value:function(e,t,n){e.status!==t&&(e.status=t,e.emitter.emit(t,n))}},{key:"setIsRenderable",value:function(e,t){e.isRenderable=t}},{key:"destroyState",value:function(e){["loading","loaded","failed"].forEach((function(t){e.emitter.off(t)}))}},{key:"scheduleUpdateState",value:function(e){var t=this;e.updateScheduled||(e.updateScheduled=!0,queueMicrotask((function(){e.updateScheduled=!1,t.updateState(e)})))}}])}();function Nt(e,t,n,r,o){return n*(r-1)+("bottom"!==e?.5*t:0)+Math.max(n,t)+(o||0)}var Ft=function(){return I((function e(t,n){B(this,e),L(this,"_canvas",void 0),L(this,"_context",void 0),L(this,"_settings",void 0),L(this,"renderInfo",void 0),this._canvas=t,this._context=n,this._settings=this.mergeDefaults({})}),[{key:"settings",get:function(){return this._settings},set:function(e){this._settings=this.mergeDefaults(e)}},{key:"getPrecision",value:function(){return this._settings.precision}},{key:"setFontProperties",value:function(){this._context.font=this._getFontSetting(),this._context.textBaseline=this._settings.textBaseline}},{key:"_getFontSetting",value:function(){for(var e=[this._settings.fontFace],t=[],n=0,r=e.length;nthis._settings.maxLines){var S,A=k.slice(0,this._settings.maxLines),C=null;if(this._settings.overflowSuffix){var T=this._settings.overflowSuffix?this.measureText(this._settings.overflowSuffix):0,_=this.wrapText(A[A.length-1],u-T,p,v);A[A.length-1]="".concat(_.l[0]).concat(this._settings.overflowSuffix),C=[_.l.length>1?_.l[1]:""]}else C=[""];var R=k.length,I=0,B=g.n.length;for(S=this._settings.maxLines;S=128&&(this._context.globalAlpha=.01,this._context.fillRect(0,0,.01,.01),this._context.globalAlpha=1),(e.cutSx||e.cutSy)&&this._context.translate(-e.cutSx,-e.cutSy);for(var l=[],u=0,c=i.length;ut)for(;a>0&&(s=this._context.measureText(e.substring(0,a)).width+r)>t;)a-=1;else for(;a=r?n:"")}},{key:"wrapText",value:function(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=e.split(/\r?\n/g),i=[],a=[],s=0;sc?(f>0&&(l.push(u),u=""),u+=d[f],c=t-h-(0===f?r:0)):(c-=p,u+=" ".concat(d[f]))}l.push(u),u="",i=i.concat(l),s1&&void 0!==arguments[1]?arguments[1]:0;return n?e.split("").reduce((function(e,r){return e+t._context.measureText(r).width+n}),0):this._context.measureText(e).width}},{key:"mergeDefaults",value:function(e){return F({text:"",w:0,h:0,fontStyle:"normal",fontSize:40,fontFace:null,wordWrap:!0,wordWrapWidth:0,wordBreak:!1,textOverflow:"",lineHeight:null,textBaseline:"alphabetic",textAlign:"left",verticalAlign:"top",offsetY:null,maxLines:0,overflowSuffix:"...",textColor:[1,1,1,1],paddingLeft:0,paddingRight:0,shadow:!1,shadowColor:[0,0,0,1],shadowOffsetX:0,shadowOffsetY:0,shadowBlur:5,highlight:!1,highlightHeight:0,highlightColor:[0,0,0,1],highlightOffset:0,highlightPaddingLeft:0,highlightPaddingRight:0,letterSpacing:0,textIndent:0,cutSx:0,cutEx:0,cutSy:0,cutEy:0,advancedRenderer:!1,fontBaselineRatio:0,precision:1,textRenderIssueMargin:0},e)}}])}(),Lt="undefined"==typeof self?globalThis:self,Mt=(null===(m=Lt.document)||void 0===m?void 0:m.fonts)||Lt.fonts;var zt=M(0,0,0,0),Pt=function(e){function t(e){var n;B(this,t),L(n=w(this,t,[e]),"canvas",void 0),L(n,"context",void 0),L(n,"rendererBounds",void 0),"undefined"!=typeof OffscreenCanvas?n.canvas=new OffscreenCanvas(0,0):n.canvas=document.createElement("canvas");var r=n.canvas.getContext("2d");return r||(n.canvas=document.createElement("canvas"),r=n.canvas.getContext("2d")),_(r),n.context=r,n.rendererBounds={x1:0,y1:0,x2:n.stage.options.appWidth,y2:n.stage.options.appHeight},n}return T(t,e),I(t,[{key:"getPropertySetters",value:function(){var e=this;return{fontFamily:function(t,n){t.props.fontFamily=n,t.fontInfo=void 0,e.invalidateLayoutCache(t)},fontWeight:function(t,n){t.props.fontWeight=n,t.fontInfo=void 0,e.invalidateLayoutCache(t)},fontStyle:function(t,n){t.props.fontStyle=n,t.fontInfo=void 0,e.invalidateLayoutCache(t)},fontStretch:function(t,n){t.props.fontStretch=n,t.fontInfo=void 0,e.invalidateLayoutCache(t)},fontSize:function(t,n){t.props.fontSize=n,t.fontInfo=void 0,e.invalidateLayoutCache(t)},text:function(t,n){t.props.text=n,e.invalidateLayoutCache(t)},textAlign:function(t,n){t.props.textAlign=n,e.invalidateLayoutCache(t)},color:function(t,n){t.props.color=n,e.invalidateLayoutCache(t)},x:function(t,n){t.props.x=n,e.invalidateVisibleWindowCache(t)},y:function(t,n){t.props.y=n,e.invalidateVisibleWindowCache(t)},contain:function(t,n){t.props.contain=n,e.invalidateLayoutCache(t)},width:function(t,n){t.props.width=n,"none"!==t.props.contain&&e.invalidateLayoutCache(t)},height:function(t,n){t.props.height=n,"both"===t.props.contain&&e.invalidateLayoutCache(t)},offsetY:function(t,n){t.props.offsetY=n,e.invalidateLayoutCache(t)},scrollY:function(e,t){e.props.scrollY=t},letterSpacing:function(t,n){t.props.letterSpacing=n,e.invalidateLayoutCache(t)},lineHeight:function(t,n){t.props.lineHeight=n,e.invalidateLayoutCache(t)},maxLines:function(t,n){t.props.maxLines=n,e.invalidateLayoutCache(t)},textBaseline:function(t,n){t.props.textBaseline=n,e.invalidateLayoutCache(t)},verticalAlign:function(t,n){t.props.verticalAlign=n,e.invalidateLayoutCache(t)},overflowSuffix:function(t,n){t.props.overflowSuffix=n,e.invalidateLayoutCache(t)}}}},{key:"canRenderFont",value:function(e){return!0}},{key:"isFontFaceSupported",value:function(e){return e instanceof O}},{key:"addFontFace",value:function(e){_(e instanceof O),Mt.add(e.fontFace)}},{key:"createState",value:function(e){return{props:e,status:"initialState",updateScheduled:!1,emitter:new D,canvasPages:void 0,lightning2TextRenderer:new Ft(this.canvas,this.context),renderWindow:void 0,visibleWindow:{x1:0,y1:0,x2:0,y2:0,valid:!1},renderInfo:void 0,forceFullLayoutCalc:!1,textW:0,textH:0,fontInfo:void 0,fontFaceLoadedHandler:void 0,isRenderable:!1,debugData:{updateCount:0,layoutCount:0,drawCount:0,lastLayoutNumCharacters:0,layoutSum:0,drawSum:0,bufferSize:0}}}},{key:"updateState",value:function(e){if("initialState"===e.status&&this.setStatus(e,"loading"),!e.fontInfo){var t=(n=e.props,r=n.fontFamily,o=n.fontStyle,i=n.fontWeight,a=n.fontStretch,s=n.fontSize,[o,i,a,"".concat(s,"px"),r].join(" "));if(e.fontInfo={cssString:t,loaded:!1},!e.fontInfo.loaded)return void Mt.load(t).then(this.onFontLoaded.bind(this,e,t)).catch(this.onFontLoadError.bind(this,e,t))}var n,r,o,i,a,s;if(e.fontInfo.loaded){if(!e.renderInfo){var l=e.props.maxLines,u="both"===e.props.contain?Math.floor((e.props.height-e.props.offsetY)/e.props.lineHeight):0,c=u>0&&l>0?Math.min(u,l):Math.max(u,l);e.lightning2TextRenderer.settings={text:e.props.text,textAlign:e.props.textAlign,fontFace:e.props.fontFamily,fontSize:e.props.fontSize,fontStyle:[e.props.fontStretch,e.props.fontStyle,e.props.fontWeight].join(" "),textColor:U(e.props.color),offsetY:e.props.fontSize+e.props.offsetY,wordWrap:"none"!==e.props.contain,wordWrapWidth:"none"===e.props.contain?void 0:e.props.width,letterSpacing:e.props.letterSpacing,lineHeight:e.props.lineHeight,maxLines:c,textBaseline:e.props.textBaseline,verticalAlign:e.props.verticalAlign,overflowSuffix:e.props.overflowSuffix},e.renderInfo=e.lightning2TextRenderer.calculateRenderInfo(),e.textH=e.renderInfo.lineHeight*e.renderInfo.lines.length,e.textW=e.renderInfo.width,e.renderWindow=void 0}var d=e.props,f=d.x,h=d.y,p=d.width,v=d.height,g=d.scrollY,y=d.contain,m=e.visibleWindow,x=e.renderWindow,b=e.canvasPages;if(!m.valid){var w=M(f,h,"none"!==y?f+p:1/0,"both"===y?h+v:1/0,zt);W(this.rendererBounds,w,m),m.valid=!0}var k=m.y2-m.y1,S=Math.ceil(k/e.renderInfo.lineHeight);if(0===k)return b=void 0,x=void 0,void this.setStatus(e,"loaded");if(x&&b){var A=f+x.x1,C=h-g+x.y1,T=f+x.x2,_=h-g+x.y2;if(A<=m.x1&&T>=m.x2&&C<=m.y1&&_>=m.y2)return void this.setStatus(e,"loaded");_m.y1&&(x.y1-=S*e.renderInfo.lineHeight,x.y2-=S*e.renderInfo.lineHeight,b.unshift(b.pop()),b[0].lineNumStart=b[1].lineNumStart-S,b[0].lineNumEnd=b[0].lineNumStart+S,b[0].valid=!1)}else{var R,I,B,E=e.renderInfo.lineHeight*S,N=Math.ceil(g/E),F=N*S,L=F-S,z=F+S;b=[{texture:null===(R=b)||void 0===R?void 0:R[0].texture,lineNumStart:L,lineNumEnd:L+S,valid:!1},{texture:null===(I=b)||void 0===I?void 0:I[1].texture,lineNumStart:F,lineNumEnd:F+S,valid:!1},{texture:null===(B=b)||void 0===B?void 0:B[2].texture,lineNumStart:z,lineNumEnd:z+S,valid:!1}],e.canvasPages=b;var O=N*E;x={x1:0,y1:O-E,x2:p,y2:O+2*E}}e.renderWindow=x,performance.now();var D,j=P(b);try{for(j.s();!(D=j.n()).done;){var Y=D.value;if(!Y.valid)if(Y.lineNumStart<0){var H;null===(H=Y.texture)||void 0===H||H.setRenderableOwner(e,!1),Y.texture=this.stage.txManager.loadTexture("ImageTexture",{src:""}),Y.texture.setRenderableOwner(e,e.isRenderable),Y.valid=!0}else{var Q;if(e.lightning2TextRenderer.draw(e.renderInfo,{lines:e.renderInfo.lines.slice(Y.lineNumStart,Y.lineNumEnd),lineWidths:e.renderInfo.lineWidths.slice(Y.lineNumStart,Y.lineNumEnd)}),0!==this.canvas.width&&0!==this.canvas.height)null===(Q=Y.texture)||void 0===Q||Q.setRenderableOwner(e,!1),Y.texture=this.stage.txManager.loadTexture("ImageTexture",{src:this.context.getImageData(0,0,this.canvas.width,this.canvas.height)},{preload:!0}),Y.texture.setRenderableOwner(e,e.isRenderable);Y.valid=!0}}}catch(K){j.e(K)}finally{j.f()}this.setStatus(e,"loaded")}}},{key:"renderQuads",value:function(e,t,n,r){var o=this.stage,i=e.canvasPages,a=e.textW,s=void 0===a?0:a,l=e.textH,u=void 0===l?0:l,c=e.renderWindow;if(i&&c){var d=e.props,f=d.x,h=d.y,p=d.scrollY,v=d.contain,g=d.width,y=d.height,m={x:f,y:h,width:"none"!==v?g:s,height:"both"===v?y:u};j({x:0,y:0,width:o.options.appWidth,height:o.options.appHeight},m),_(i,"canvasPages is not defined"),_(c,"renderWindow is not defined");var x,b,w,k,S,A,C=(c.y2-c.y1)/3,T=e.props,R=T.zIndex,I=T.color,B=r*Y(I),E=H(4294967295,B);if(i[0].valid)this.stage.renderer.addQuad({alpha:B,clippingRect:n,colorBl:E,colorBr:E,colorTl:E,colorTr:E,width:(null===(x=i[0].texture)||void 0===x||null===(x=x.dimensions)||void 0===x?void 0:x.width)||0,height:(null===(b=i[0].texture)||void 0===b||null===(b=b.dimensions)||void 0===b?void 0:b.height)||0,texture:i[0].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:R,tx:t.tx,ty:t.ty-p+c.y1,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td});if(i[1].valid)this.stage.renderer.addQuad({alpha:B,clippingRect:n,colorBl:E,colorBr:E,colorTl:E,colorTr:E,width:(null===(w=i[1].texture)||void 0===w||null===(w=w.dimensions)||void 0===w?void 0:w.width)||0,height:(null===(k=i[1].texture)||void 0===k||null===(k=k.dimensions)||void 0===k?void 0:k.height)||0,texture:i[1].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:R,tx:t.tx,ty:t.ty-p+c.y1+C,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td});if(i[2].valid)this.stage.renderer.addQuad({alpha:B,clippingRect:n,colorBl:E,colorBr:E,colorTl:E,colorTr:E,width:(null===(S=i[2].texture)||void 0===S||null===(S=S.dimensions)||void 0===S?void 0:S.width)||0,height:(null===(A=i[2].texture)||void 0===A||null===(A=A.dimensions)||void 0===A?void 0:A.height)||0,texture:i[2].texture,textureOptions:{},shader:null,shaderProps:null,zIndex:R,tx:t.tx,ty:t.ty-p+c.y1+C+C,ta:t.ta,tb:t.tb,tc:t.tc,td:t.td})}}},{key:"setIsRenderable",value:function(e,n){var r;b(C(t.prototype),"setIsRenderable",this).call(this,e,n),null===(r=e.canvasPages)||void 0===r||r.forEach((function(t){var r;null===(r=t.texture)||void 0===r||r.setRenderableOwner(e,n)}))}},{key:"destroyState",value:function(e){var t;null===(t=e.canvasPages)||void 0===t||t.forEach((function(t){var n;null===(n=t.texture)||void 0===n||n.setRenderableOwner(e,!1)}))}},{key:"invalidateVisibleWindowCache",value:function(e){e.visibleWindow.valid=!1,this.setStatus(e,"loading"),this.scheduleUpdateState(e)}},{key:"invalidateLayoutCache",value:function(e){e.renderInfo=void 0,e.visibleWindow.valid=!1,this.setStatus(e,"loading"),this.scheduleUpdateState(e)}},{key:"onFontLoaded",value:function(e,t){var n;t===(null===(n=e.fontInfo)||void 0===n?void 0:n.cssString)&&e.fontInfo&&(e.fontInfo.loaded=!0,this.scheduleUpdateState(e))}},{key:"onFontLoadError",value:function(e,t,n){var r;t===(null===(r=e.fontInfo)||void 0===r?void 0:r.cssString)&&e.fontInfo&&(e.fontInfo.loaded=!0,console.error("CanvasTextRenderer: Error loading font '".concat(e.fontInfo.cssString,"'"),n),this.scheduleUpdateState(e))}}])}(Et),Ot=function(e){function t(e){return B(this,t),w(this,t,[{renderer:e,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2fv"}]}])}return T(t,e),I(t,[{key:"bindTextures",value:function(e){var t=this.glw;t.activeTexture(0),t.bindTexture(e[0].ctxTexture)}}])}(Q);L(Ot,"shaderSources",{vertex:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n ",fragment:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate);\n gl_FragColor = vec4(v_color) * texture2D(u_texture, v_textureCoordinate);\n }\n "});var Dt=function(e){function t(e){var n;return B(this,t),L(n=w(this,t,[{renderer:e,attributes:["a_position","a_textureCoordinate","a_color","a_textureIndex"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_textures[0]",uniform:"uniform1iv"}]}]),"supportsIndexedTextures",!0),n}return T(t,e),I(t,[{key:"bindTextures",value:function(e){var t=this.renderer,n=this.glw;if(e.length>t.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS)throw new Error("DefaultShaderBatched: Cannot bind more than ".concat(t.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS," textures"));e.forEach((function(e,t){n.activeTexture(t),n.bindTexture(e.ctxTexture)}));var r=Array.from(Array(e.length).keys());this.setUniform("u_textures[0]",r)}}])}(Q);L(Dt,"shaderSources",{vertex:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n ",fragment:function(e){return"\n #define txUnits ".concat(e,"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_image;\n uniform sampler2D u_textures[txUnits];\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n vec4 sampleFromTexture(sampler2D textures[").concat(e,"], int idx, vec2 uv) {\n ").concat(Array.from(Array(e).keys()).map((function(e){return"\n ".concat(0!==e?"else ":"","if (idx == ").concat(e,") {\n return texture2D(textures[").concat(e,"], uv);\n }\n ")})).join(""),"\n return texture2D(textures[0], uv);\n }\n\n void main(){\n gl_FragColor = vec4(v_color) * sampleFromTexture(u_textures, int(v_textureIndex), v_textureCoordinate);\n }\n ")}});var Ut=new Map,Wt=function(e,t){var n=JSON.stringify(e);if(Ut.has(n))return Ut.get(n);var r=(null!=e?e:[]).map((function(e){return{type:e.type,props:t[e.type].resolveDefaults(e.props||{})}}));return Ut.set(n,r),r},jt=function(e){function t(e,n,r){var o;B(this,t);var i=t.createShader(n,r);return L(o=w(this,t,[{renderer:e,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2fv"},{name:"u_dimensions",uniform:"uniform2fv"},{name:"u_alpha",uniform:"uniform1f"}].concat(E(i.uniforms)),shaderSources:{vertex:i.vertex,fragment:i.fragment}}]),"effects",[]),o.effects=i.effects,o.calculateProps=K(o.calculateProps.bind(o)),o}return T(t,e),I(t,[{key:"bindTextures",value:function(e){var t=this.glw;t.activeTexture(0),t.bindTexture(e[0].ctxTexture)}},{key:"calculateProps",value:function(e){var t=this,n=this.renderer.shManager.getRegisteredEffects(),r=[];return null==e||e.forEach((function(e,o){var i,a=t.effects[o],s=n[a.name],l=null!==(i=e.props)&&void 0!==i?i:{},u=a.uniformInfo;Object.keys(l).forEach((function(e){var t=s.uniforms[e],n=u[e],o=t.validator?t.validator(l[e],l):l[e];Array.isArray(o)&&(o=new Float32Array(o)),r.push({name:n.name,value:o})}))})),r}},{key:"bindProps",value:function(e){var t=this;this.calculateProps(e.effects).forEach((function(e){t.setUniform(e.name,e.value)}))}}],[{key:"createShader",value:function(e,n){var r={},o={},i="",a=[],s=[],l=e.effects.map((function(e){var t=n[e.type],o=t.getEffectKey(e.props||{});r[o]=r[o]?++r[o]:1;var l=r[o];1===l&&s.push({key:o,type:e.type,props:e.props});var u=new t({ref:"".concat(o).concat(1===l?"":l),target:o,props:e.props});return i+=u.declaredUniforms,a.push.apply(a,E(Object.values(u.uniformInfo))),u})),u="";null==s||s.forEach((function(e){var r,i=n[e.type],a=i.resolveDefaults(null!==(r=e.props)&&void 0!==r?r:{}),s=[];for(var l in i.methods){var c=l,d=i.methods[l];o[l]&&o[l]!==d&&(c=t.resolveMethodDuplicate(l,d,o)),o[c]=d.replace("function",c),s.push({m:l,cm:c})}var f=i.onShaderMask instanceof Function?i.onShaderMask(a):i.onShaderMask,h=i.onColorize instanceof Function?i.onColorize(a):i.onColorize,p=i.onEffectMask instanceof Function?i.onEffectMask(a):i.onEffectMask;s.forEach((function(e){var t=e.m,n=e.cm,r=new RegExp("\\$".concat(t),"g");f&&(f=f.replace(r,n)),h&&(h=h.replace(r,n)),p&&(p=p.replace(r,n))}));var v=i.getMethodParameters(i.uniforms,a),g=v.length>0?", ".concat(v):"";f&&(u+="\n float fx_".concat(e.key,"_onShaderMask(float shaderMask ").concat(g,") {\n ").concat(f,"\n }\n ")),h&&(u+="\n vec4 fx_".concat(e.key,"_onColorize(float shaderMask, vec4 maskColor, vec4 shaderColor").concat(g,") {\n ").concat(h,"\n }\n ")),p&&(u+="\n vec4 fx_".concat(e.key,"_onEffectMask(float shaderMask, vec4 maskColor, vec4 shaderColor").concat(g,") {\n ").concat(p,"\n }\n "))}));var c="";for(var d in o)c+=o[d];for(var f="mix(shaderColor, maskColor, clamp(-(lng_DefaultMask), 0.0, 1.0))",h="\n\n ",p=0;p0?", ".concat(v.passParameters):"",y=n[v.name];y.onShaderMask&&(h+="\n shaderMask = fx_".concat(v.target,"_onShaderMask(shaderMask ").concat(g,");\n ")),y.onColorize&&(h+="\n maskColor = fx_".concat(v.target,"_onColorize(shaderMask, maskColor, shaderColor").concat(g,");\n ")),y.onEffectMask&&(f="fx_".concat(v.target,"_onEffectMask(shaderMask, maskColor, shaderColor").concat(g,")"));var m=l[p+1];(void 0===m||n[m.name].onEffectMask)&&(h+="\n shaderColor = ".concat(f,";\n "))}return{effects:l,uniforms:a,fragment:t.fragment(i,c,u,h),vertex:t.vertex()}}},{key:"resolveMethodDuplicate",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=e+(r>0?r:"");return n[o]&&n[o]!==t?this.resolveMethodDuplicate(e,t,n,++r):o}},{key:"resolveDefaults",value:function(e,t){return{effects:Wt(e.effects,t),$dimensions:{width:0,height:0},$alpha:0}}},{key:"makeCacheKey",value:function(e,t){var n,r="";return null===(n=e.effects)||void 0===n||n.forEach((function(e){var n=t[e.type].getEffectKey(e.props||{});r+=",".concat(n)})),"DynamicShader".concat(r)}}])}(Q);L(jt,"z$__type__Props",void 0),L(jt,"vertex",(function(){return"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n "})),L(jt,"fragment",(function(e,t,n,r){return"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n #define PI 3.14159265359\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_alpha;\n uniform float u_radius;\n uniform sampler2D u_texture;\n uniform float u_pixelRatio;\n\n ".concat(e,"\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n ").concat(t,"\n\n ").concat(n,"\n\n void main() {\n vec2 p = v_textureCoordinate.xy * u_dimensions - u_dimensions * 0.5;\n vec2 d = abs(p) - (u_dimensions) * 0.5;\n float lng_DefaultMask = min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n\n vec4 shaderColor = vec4(0.0);\n float shaderMask = lng_DefaultMask;\n\n vec4 maskColor = texture2D(u_texture, v_textureCoordinate) * v_color;\n\n shaderColor = mix(shaderColor, maskColor, clamp(-(lng_DefaultMask + 0.5), 0.0, 1.0));\n\n ").concat(r,"\n\n gl_FragColor = shaderColor * u_alpha;\n }\n ")}));var Yt=function(e){function t(e){return B(this,t),w(this,t,[{renderer:e,attributes:["a_position","a_textureCoordinate","a_color"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2f"},{name:"u_dimensions",uniform:"uniform2fv"},{name:"u_radius",uniform:"uniform1f"}]}])}return T(t,e),I(t,[{key:"bindTextures",value:function(e){var t=this.glw;t.activeTexture(0),t.bindTexture(e[0].ctxTexture)}},{key:"bindProps",value:function(e){this.setUniform("u_radius",e.radius)}},{key:"canBatchShaderProps",value:function(e,t){return e.radius===t.radius&&e.$dimensions.width===t.$dimensions.width&&e.$dimensions.height===t.$dimensions.height}}],[{key:"resolveDefaults",value:function(e){return{radius:e.radius||10,$dimensions:{width:0,height:0}}}}])}(Q);L(Yt,"z$__type__Props",void 0),L(Yt,"shaderSources",{vertex:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n ",fragment:"\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_radius;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n float boxDist(vec2 p, vec2 size, float radius){\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n\n float fillMask(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate) * v_color;\n vec2 halfDimensions = u_dimensions * 0.5;\n\n float d = boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions + 0.5, u_radius);\n gl_FragColor = mix(vec4(0.0), color, fillMask(d));\n }\n "});var Ht=new Float32Array([1,0,0,0,1,0,0,0,1]),Qt=function(e){function t(e){return B(this,t),w(this,t,[{renderer:e,attributes:["a_position","a_textureCoordinate"],uniforms:[{name:"u_resolution",uniform:"uniform2fv"},{name:"u_transform",uniform:"uniformMatrix3fv"},{name:"u_scrollY",uniform:"uniform1f"},{name:"u_pixelRatio",uniform:"uniform1f"},{name:"u_texture",uniform:"uniform2f"},{name:"u_color",uniform:"uniform4fv"},{name:"u_size",uniform:"uniform1f"},{name:"u_distanceRange",uniform:"uniform1f"},{name:"u_debug",uniform:"uniform1i"}]}])}return T(t,e),I(t,[{key:"bindTextures",value:function(e){var t=this.glw;t.activeTexture(0),t.bindTexture(e[0].ctxTexture)}},{key:"bindProps",value:function(e){var n=t.resolveDefaults(e);for(var r in n)if("transform"===r)this.setUniform("u_transform",!1,n[r]);else if("scrollY"===r)this.setUniform("u_scrollY",n[r]);else if("color"===r){var o=U(n.color);this.setUniform("u_color",o)}else"size"===r?this.setUniform("u_size",n[r]):"distanceRange"===r?this.setUniform("u_distanceRange",n[r]):"debug"===r&&this.setUniform("u_debug",n[r]?1:0)}}],[{key:"resolveDefaults",value:function(){var e,t,n,r,o,i,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{transform:null!==(e=a.transform)&&void 0!==e?e:Ht,scrollY:null!==(t=a.scrollY)&&void 0!==t?t:0,color:null!==(n=a.color)&&void 0!==n?n:4294967295,size:null!==(r=a.size)&&void 0!==r?r:16,distanceRange:null!==(o=a.distanceRange)&&void 0!==o?o:1,debug:null!==(i=a.debug)&&void 0!==i&&i}}}])}(Q);L(Qt,"shaderSources",{vertex:"\n // an attribute is an input (in) to a vertex shader.\n // It will receive data from a buffer\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n\n uniform vec2 u_resolution;\n uniform mat3 u_transform;\n uniform float u_scrollY;\n uniform float u_pixelRatio;\n uniform float u_size;\n\n varying vec2 v_texcoord;\n\n void main() {\n vec2 scrolledPosition = a_position * u_size - vec2(0, u_scrollY);\n vec2 transformedPosition = (u_transform * vec3(scrolledPosition, 1)).xy;\n gl_Position = vec4((transformedPosition * u_pixelRatio / u_resolution * 2.0 - 1.0) * vec2(1, -1), 0, 1);\n v_texcoord = a_textureCoordinate;\n }\n ",fragment:"\n precision highp float;\n\n uniform vec4 u_color;\n uniform sampler2D u_texture;\n uniform float u_distanceRange;\n uniform float u_pixelRatio;\n uniform int u_debug;\n\n varying vec2 v_texcoord;\n\n float median(float r, float g, float b) {\n return max(min(r, g), min(max(r, g), b));\n }\n\n void main() {\n vec3 sample = texture2D(u_texture, v_texcoord).rgb;\n if (u_debug == 1) {\n gl_FragColor = vec4(sample.r, sample.g, sample.b, 1.0);\n return;\n }\n float scaledDistRange = u_distanceRange * u_pixelRatio;\n float sigDist = scaledDistRange * (median(sample.r, sample.g, sample.b) - 0.5);\n float opacity = clamp(sigDist + 0.5, 0.0, 1.0) * u_color.a;\n\n // Build the final color.\n // IMPORTANT: We must premultiply the color by the alpha value before returning it.\n gl_FragColor = vec4(u_color.r * opacity, u_color.g * opacity, u_color.b * opacity, opacity);\n }\n "});var Kt=function(e){function t(){var e;B(this,t);for(var n=arguments.length,r=new Array(n),o=0;o= count) {break;}\n val += amp * noise(uv, blockiness, time);\n amp *= 0.5;\n uv *= complexity;\n }\n return val;\n }\n "}),L(en,"onColorize","\n vec2 uv = v_textureCoordinate.xy;\n float aspect = u_dimensions.x / u_dimensions.y;\n vec2 a = vec2(uv.x * aspect , uv.y);\n vec2 uv2 = vec2(a.x / u_dimensions.x, exp(a.y));\n\n float shift = amplitude * pow($fbm(uv2, 4, blockiness, narrowness, time), minimizer);\n float colR = texture2D(u_texture, vec2(uv.x + shift, uv.y)).r * (1. - shift);\n float colG = texture2D(u_texture, vec2(uv.x - shift, uv.y)).g * (1. - shift);\n float colB = texture2D(u_texture, vec2(uv.x - shift, uv.y)).b * (1. - shift);\n\n vec3 f = vec3(colR, colG, colB);\n return vec4(f, texture2D(u_texture, vec2(uv.x - shift, uv.y)).a);\n ");var tn=function(e){function t(){var e;B(this,t);for(var n=arguments.length,r=new Array(n),o=0;o 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x, point.y + fade[0]);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[1] > 0.0) {\n pos1 = vec2(point.x - u_dimensions.x - fade[1], v_textureCoordinate.y);\n pos2 = vec2(point.x - u_dimensions.x, v_textureCoordinate.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[2] > 0.0) {\n pos1 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y - fade[2]);\n pos2 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[3] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x + fade[3], point.y);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n return result;\n ");var nn=function(e){function t(){var e;B(this,t);for(var n=arguments.length,r=new Array(n),o=0;o>2)*(c+3>>2)*8,h=new Uint8Array(n,i.byteOffset+l,f),a.push(h),l+=f,u>>=1,c>>=1;return e.abrupt("return",{data:{glInternalFormat:36196,mipmaps:a,width:s.pixelWidth||0,height:s.pixelHeight||0,type:"pvr"},premultiplyAlpha:!1});case 17:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),dn=function(e){function t(e,n){var r;return B(this,t),L(r=w(this,t,[e]),"props",void 0),r.props=t.resolveDefaults(n),r}return T(t,e),I(t,[{key:"hasAlphaChannel",value:function(e){return-1!==e.indexOf("image/png")}},{key:"getTextureData",value:(n=x(y().mark((function e(){var t,n,r,o,i,a,s;return y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.props,n=t.src,r=t.premultiplyAlpha,n){e.next=3;break}return e.abrupt("return",{data:null});case 3:if(!(n instanceof ImageData)){e.next=5;break}return e.abrupt("return",{data:n,premultiplyAlpha:r});case 5:if(!/\.(ktx|pvr)$/.test(n)){e.next=7;break}return e.abrupt("return",ln(n));case 7:if(!this.txManager.imageWorkerManager){e.next=13;break}return e.next=10,this.txManager.imageWorkerManager.getImage(n,r);case 10:return e.abrupt("return",e.sent);case 13:if(!this.txManager.hasCreateImageBitmap){e.next=28;break}return e.next=16,fetch(n);case 16:return o=e.sent,e.next=19,o.blob();case 19:return i=e.sent,a=null!=r?r:this.hasAlphaChannel(i.type),e.next=23,createImageBitmap(i,{premultiplyAlpha:a?"premultiply":"none",colorSpaceConversion:"none",imageOrientation:"none"});case 23:return e.t0=e.sent,e.t1=a,e.abrupt("return",{data:e.t0,premultiplyAlpha:e.t1});case 28:return(s=new Image).src=n,e.next=32,new Promise((function(e,t){s.onload=function(){return e()},s.onerror=function(){return t(new Error("Failed to load image"))}})).catch((function(e){console.error(e)}));case 32:return e.abrupt("return",{data:s,premultiplyAlpha:null==r||r});case 33:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})}],[{key:"makeCacheKey",value:function(e){var n=t.resolveDefaults(e);return!(n.src instanceof ImageData)&&"ImageTexture,".concat(n.src,",").concat(n.premultiplyAlpha)}},{key:"resolveDefaults",value:function(e){var t,n;return{src:null!==(t=e.src)&&void 0!==t?t:"",premultiplyAlpha:null===(n=e.premultiplyAlpha)||void 0===n||n}}}]);var n}(X);L(dn,"z$__type__Props",void 0);var fn=function(){return I((function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;B(this,e),L(this,"iterator",void 0),L(this,"peekBuffer",[]),L(this,"_lastIndex",void 0),this.iterator=t,this.iterator=t,this._lastIndex=n-1,this.peekBuffer=[]}),[{key:"next",value:function(){var e=this.peekBuffer.length>0?this.peekBuffer.pop():this.iterator.next();return e.done?this._lastIndex=-1:this._lastIndex++,e}},{key:"peek",value:function(){if(this.peekBuffer.length>0)return this.peekBuffer[0];var e=this.iterator.next();return this.peekBuffer.push(e),e}},{key:"lastIndex",get:function(){return this._lastIndex}}])}();function hn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return y().mark((function n(){var r,o;return y().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:r=t;case 1:if(!(r=h.y1,K=B<=h.y2,X=Q&&K;(x=M.next())&&!x.done;){var G=x.value;if(e===f.length)f.push({codepointIndex:G.cluster,maxY:R,maxX:T});else if(e>f.length)throw new Error("Unexpected lineCache length");if(32===G.codepoint||10===G.codepoint?-1!==N.codepointIndex&&(N.codepointIndex=-1,H=I):-1===N.codepointIndex&&(N.codepointIndex=G.cluster,N.bufferOffset=E,N.xStart=H),G.mapped){var V=I+G.xOffset+G.width;if("none"!==d&&V>=Y&&-1!==N.codepointIndex&&N.xStart>0){if(j){M=F.shapeText(L,new fn(hn(r,N.codepointIndex),N.codepointIndex)),E=N.bufferOffset;break}M=F.shapeText(L,new fn(hn(y,0),0)),I=N.xStart,E=N.bufferOffset,d="none"}else{var Z=I+G.xOffset,q=B+G.yOffset;if(X){-1===z&&(z=E);var J=p.getAtlasEntry(G.glyphId),$=J.x/p.data.common.scaleW,ee=J.y/p.data.common.scaleH,te=J.width/p.data.common.scaleW,ne=J.height/p.data.common.scaleH;c[E++]=Z,c[E++]=q,c[E++]=$,c[E++]=ee,c[E++]=Z+G.width,c[E++]=q,c[E++]=$+te,c[E++]=ee,c[E++]=Z,c[E++]=q+G.height,c[E++]=$,c[E++]=ee+ne,c[E++]=Z+G.width,c[E++]=q+G.height,c[E++]=$+te,c[E++]=ee+ne}R=Math.max(R,q+G.height),T=Math.max(T,Z+G.width),I+=G.xAdvance}}else if(10===G.codepoint){if(j)break;M=F.shapeText(L,new fn(hn(y,0),0)),d="none"}}-1!==z&&(O.push({bufferStart:z,bufferEnd:E}),z=-1),I=0,B+=w,e++,N.codepointIndex=-1,H=0,!v&&"both"===d&&B>h.y2||x&&x.done?W=!1:j||(W=!1)}if("center"===o)for(var re="none"===d?T:k,oe=0;oe0;){if(c.has(a))return c.get(a);a-=100}a=600}for(;a<1e3;){if(c.has(a))return c.get(a);a+=100}for(a=500;a>0;){if(c.has(a))return c.get(a);a-=100}}}}catch(v){s.e(v)}finally{s.f()}})),xn=function(){return I((function e(t){B(this,e),L(this,"textRenderers",void 0),this.textRenderers=t}),[{key:"addFontFace",value:function(e){for(var t in this.textRenderers){var n=this.textRenderers[t];n&&n.isFontFaceSupported(e)&&n.addFontFace(e)}}}],[{key:"resolveFontFace",value:function(e,t){var n=t.fontFamily,r=t.fontWeight,o=t.fontStyle,i=t.fontStretch;return mn(e,n,r,o,i)}}])}(),bn={x:0,y:0,width:0,height:0},wn=function(e){function t(e){var n;return B(this,t),L(n=w(this,t,[e]),"ssdfFontFamilies",{}),L(n,"msdfFontFamilies",{}),L(n,"fontFamilyArray",[n.ssdfFontFamilies,n.msdfFontFamilies]),L(n,"sdfShader",void 0),L(n,"rendererBounds",void 0),n.sdfShader=n.stage.shManager.loadShader("SdfShader").shader,n.rendererBounds={x1:0,y1:0,x2:n.stage.options.appWidth,y2:n.stage.options.appHeight},n}return T(t,e),I(t,[{key:"getPropertySetters",value:function(){var e=this;return{fontFamily:function(t,n){t.props.fontFamily=n,e.releaseFontFace(t),e.invalidateLayoutCache(t)},fontWeight:function(t,n){t.props.fontWeight=n,e.releaseFontFace(t),e.invalidateLayoutCache(t)},fontStyle:function(t,n){t.props.fontStyle=n,e.releaseFontFace(t),e.invalidateLayoutCache(t)},fontStretch:function(t,n){t.props.fontStretch=n,e.releaseFontFace(t),e.invalidateLayoutCache(t)},fontSize:function(t,n){t.props.fontSize=n,e.invalidateLayoutCache(t)},text:function(t,n){t.props.text=n,e.invalidateLayoutCache(t)},textAlign:function(t,n){t.props.textAlign=n,e.invalidateLayoutCache(t)},color:function(e,t){e.props.color=t},x:function(t,n){t.props.x=n,t.elementBounds.valid&&(e.setElementBoundsX(t),!t.renderWindow.valid&&V(t.elementBounds,e.rendererBounds)&&e.scheduleUpdateState(t))},y:function(t,n){t.props.y=n,t.elementBounds.valid&&(e.setElementBoundsY(t),!t.renderWindow.valid&&V(t.elementBounds,e.rendererBounds)&&e.scheduleUpdateState(t))},contain:function(t,n){t.props.contain=n,e.invalidateLayoutCache(t)},width:function(t,n){t.props.width=n,"none"!==t.props.contain&&e.invalidateLayoutCache(t)},height:function(t,n){t.props.height=n,"both"===t.props.contain&&e.invalidateLayoutCache(t)},offsetY:function(t,n){t.props.offsetY=n,e.invalidateLayoutCache(t)},scrollable:function(t,n){t.props.scrollable=n,e.invalidateLayoutCache(t)},scrollY:function(t,n){t.props.scrollY=n,e.scheduleUpdateState(t)},letterSpacing:function(t,n){t.props.letterSpacing=n,e.invalidateLayoutCache(t)},lineHeight:function(t,n){t.props.lineHeight=n,e.invalidateLayoutCache(t)},maxLines:function(t,n){t.props.maxLines=n,e.invalidateLayoutCache(t)},textBaseline:function(t,n){t.props.textBaseline=n,e.invalidateLayoutCache(t)},verticalAlign:function(t,n){t.props.verticalAlign=n,e.invalidateLayoutCache(t)},overflowSuffix:function(t,n){t.props.overflowSuffix=n,e.invalidateLayoutCache(t)},debug:function(e,t){e.props.debug=t}}}},{key:"canRenderFont",value:function(e){var t=e.fontFamily;return t in this.ssdfFontFamilies||t in this.msdfFontFamilies||"$$SDF_FAILURE_TEST$$"===t}},{key:"isFontFaceSupported",value:function(e){return e instanceof Z}},{key:"addFontFace",value:function(e){_(e instanceof Z);var t=e.fontFamily,n="ssdf"===e.type?this.ssdfFontFamilies:"msdf"===e.type?this.msdfFontFamilies:void 0;if(n){var r=n[t];r||(r=new Set,n[t]=r),r.add(e)}else console.warn("Invalid font face type: ".concat(e.type))}},{key:"createState",value:function(e){return{props:e,status:"initialState",updateScheduled:!1,emitter:new D,lineCache:[],forceFullLayoutCalc:!1,renderWindow:{screen:{x1:0,y1:0,x2:0,y2:0},sdf:{x1:0,y1:0,x2:0,y2:0},firstLineIdx:0,numLines:0,valid:!1},elementBounds:{x1:0,y1:0,x2:0,y2:0,valid:!1},clippingRect:{x:0,y:0,width:0,height:0,valid:!1},bufferNumFloats:0,bufferNumQuads:0,vertexBuffer:void 0,webGlBuffers:null,bufferUploaded:!1,textH:void 0,textW:void 0,distanceRange:0,trFontFace:void 0,isRenderable:!1,debugData:{updateCount:0,layoutCount:0,lastLayoutNumCharacters:0,layoutSum:0,drawSum:0,drawCount:0,bufferSize:0}}}},{key:"updateState",value:function(e){var t=this,n=e.trFontFace,r=e.textH,o=e.lineCache,i=e.debugData,a=e.forceFullLayoutCalc;if(i.updateCount++,"initialState"===e.status&&this.setStatus(e,"loading"),!n){if(n=this.resolveFontFace(e.props),e.trFontFace=n,!n){var s="SdfTextRenderer: Could not resolve font face for family: '".concat(e.props.fontFamily,"'");return console.error(s),void this.setStatus(e,"failed",new Error(s))}n.texture.setRenderableOwner(e,e.isRenderable)}if(n.loaded){_(n.data,"Font face data should be loaded");var l=e.props,u=l.text,c=l.fontSize,d=l.x,f=l.y,h=l.contain,p=l.width,v=l.height,g=l.lineHeight,y=l.verticalAlign,m=l.scrollable,x=l.overflowSuffix,b=l.maxLines,w="both"===h&&m?e.props.scrollY:0,k=e.renderWindow,S=n.data.info.size,A=c/S,C=g/A;e.distanceRange=A*n.data.distanceField.distanceRange;var T=24*u.length,R=e.vertexBuffer;(!R||R.length=I.x2&&f-w+B.y1<=I.y1&&f-w+B.y2>=I.y2)return void this.setStatus(e,"loaded");k.valid=!1,this.setStatus(e,"loading")}var E=e.props,N=E.offsetY,F=E.textAlign;if(!k.valid){if(!V(I,this.rendererBounds))return;vn(k,d,f,w,g,"both"===h?I.y2-I.y1:0,I,A)}var L=function(e,t,n,r,o,i,a,s,l){var u=Math.min(Math.max(a.firstLineIdx,0),s.length),c=0;"middle"===r?c=(t-e)/2:"bottom"===r&&(c=t-e);var d=o/i+u*t+c;if(!(l&&d>=l/i))return{sdfX:0,sdfY:d,lineIndex:u}}(S,C,0,y,N,A,k,o,r);if(L){var M=e.props.letterSpacing,z=pn(L.lineIndex,L.sdfX,L.sdfY,u,F,p,v,c,g,M,R,h,o,k.sdf,n,a,m,x,b);e.bufferUploaded=!1,e.bufferNumFloats=z.bufferNumFloats,e.bufferNumQuads=z.bufferNumQuads,e.vertexBuffer=R,e.renderWindow=k,i.lastLayoutNumCharacters=z.layoutNumCharacters,i.bufferSize=R.byteLength,z.fullyProcessed&&(e.textW=z.maxX*A,e.textH=z.maxY*A),this.setStatus(e,"loaded")}else this.setStatus(e,"loaded")}else n.once("loaded",(function(){t.scheduleUpdateState(e)}))}},{key:"renderQuads",value:function(e,t,n,r){var o,i;if(e.vertexBuffer){var a=this.stage.renderer,s=e.props,l=s.fontSize,u=s.color,c=s.contain,d=s.scrollable,f=s.zIndex,h=s.debug,p="both"===c&&d?e.props.scrollY:0,v=e.textW,g=void 0===v?0:v,y=e.textH,m=void 0===y?0:y,x=e.distanceRange,b=e.vertexBuffer,w=e.bufferUploaded,k=e.trFontFace,S=e.elementBounds,A=e.webGlBuffers;if(!A){var C=a.glw,T=4*Float32Array.BYTES_PER_ELEMENT,R=C.createBuffer();_(R),e.webGlBuffers=new q([{buffer:R,attributes:{a_position:{name:"a_position",size:2,type:C.FLOAT,normalized:!1,stride:T,offset:0},a_textureCoordinate:{name:"a_textureCoordinate",size:2,type:C.FLOAT,normalized:!1,stride:T,offset:2*Float32Array.BYTES_PER_ELEMENT}}}]),e.bufferUploaded=!1,_(e.webGlBuffers),A=e.webGlBuffers}if(!w){var I,B,E=a.glw,N=null!==(I=null===(B=A)||void 0===B?void 0:B.getBuffer("a_textureCoordinate"))&&void 0!==I?I:null;E.arrayBufferData(N,b,E.STATIC_DRAW),e.bufferUploaded=!0}if(_(k),d&&"both"===c){_(S.valid);var F=J(S,bn);n.valid?(e.clippingRect.valid=!0,n=j(n,F,e.clippingRect)):(e.clippingRect.valid=!0,n=$(F,e.clippingRect))}var L=new ee(a.glw,a.options,A,this.sdfShader,{transform:t.data,color:te(u,r),size:l/((null===(o=k.data)||void 0===o?void 0:o.info.size)||0),scrollY:p,distanceRange:x,debug:h.sdfShaderDebug},r,n,{height:m,width:g},0,f),M=null===(i=e.trFontFace)||void 0===i?void 0:i.texture;_(M);var z=this.stage.txManager.getCtxTexture(M);L.addTexture(z),L.length=e.bufferNumFloats,L.numQuads=e.bufferNumQuads,a.addRenderOp(L)}}},{key:"setIsRenderable",value:function(e,n){var r;b(C(t.prototype),"setIsRenderable",this).call(this,e,n),null===(r=e.trFontFace)||void 0===r||r.texture.setRenderableOwner(e,n)}},{key:"destroyState",value:function(e){var n;b(C(t.prototype),"destroyState",this).call(this,e),null===(n=e.trFontFace)||void 0===n||n.texture.setRenderableOwner(e,!1)}},{key:"resolveFontFace",value:function(e){return xn.resolveFontFace(this.fontFamilyArray,e)}},{key:"releaseFontFace",value:function(e){e.trFontFace&&(e.trFontFace.texture.setRenderableOwner(e,!1),e.trFontFace=void 0)}},{key:"invalidateLayoutCache",value:function(e){e.renderWindow.valid=!1,e.elementBounds.valid=!1,e.textH=void 0,e.textW=void 0,e.lineCache=[],this.setStatus(e,"loading"),this.scheduleUpdateState(e)}},{key:"setElementBoundsX",value:function(e){var t=e.props,n=t.x,r=t.contain,o=t.width,i=e.elementBounds;i.x1=n,i.x2="none"!==r?n+o:1/0}},{key:"setElementBoundsY",value:function(e){var t=e.props,n=t.y,r=t.contain,o=t.height,i=e.elementBounds;i.y1=n,i.y2="both"===r?n+o:1/0}}])}(Et);function kn(e,t){return Sn.apply(this,arguments)}function Sn(){return(Sn=x(y().mark((function e(t,n){var r,o,i;return y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,console.log("Loading core extension",t),e.next=4,Rt((function(){return A.import(t)}),void 0);case 4:r=e.sent,e.next=12;break;case 7:return e.prev=7,e.t0=e.catch(0),console.error("The core extension module at '".concat(t,"' could not be loaded.")),console.error(e.t0),e.abrupt("return");case 12:if(r.default){e.next=15;break}return console.error("The core extension module at '".concat(t,"' does not have a default export.")),e.abrupt("return");case 15:if(o=r.default,!(o.prototype instanceof ne)){e.next=29;break}return i=new o,e.prev=18,e.next=21,i.run(n);case 21:e.next=27;break;case 23:e.prev=23,e.t1=e.catch(18),console.error("The core extension at '".concat(t,"' threw an error.")),console.error(e.t1);case 27:e.next=30;break;case 29:console.error("The core extension at '".concat(t,"' does not extend CoreExtension."));case 30:case"end":return e.stop()}}),e,null,[[0,7],[18,23]])})))).apply(this,arguments)}function An(e){for(var t={boolean:!0,string:!0,number:!0},n=Object.keys(e),r=0;r2048&&(console.warn("Custom Data value for ".concat(o," is too long, it will be truncated to 2048 characters")),e[o]=i.substring(0,2048)),t[a]||(console.warn("Custom Data value for ".concat(o," is not a boolean, string, or number, it will be ignored")),delete e[o])}}return e}var Cn,Tn=function(e){function t(e,n,r){var o,i,a,s,l;B(this,t),L(l=w(this,t),"root",null),L(l,"driver",void 0),L(l,"canvas",void 0),L(l,"settings",void 0),L(l,"inspector",null),L(l,"nodes",new Map),L(l,"nextTextureId",1),L(l,"textureTracker",void 0);var u={appWidth:e.appWidth||1920,appHeight:e.appHeight||1080,txMemByteThreshold:e.txMemByteThreshold||124e6,boundsMargin:e.boundsMargin||0,deviceLogicalPixelRatio:e.deviceLogicalPixelRatio||1,devicePhysicalPixelRatio:e.devicePhysicalPixelRatio||window.devicePixelRatio,clearColor:null!==(o=e.clearColor)&&void 0!==o?o:0,coreExtensionModule:e.coreExtensionModule||null,experimental_FinalizationRegistryTextureUsageTracker:null!==(i=e.experimental_FinalizationRegistryTextureUsageTracker)&&void 0!==i&&i,textureCleanupOptions:e.textureCleanupOptions||{},fpsUpdateInterval:e.fpsUpdateInterval||0,numImageWorkers:void 0!==e.numImageWorkers?e.numImageWorkers:2,enableContextSpy:null!==(a=e.enableContextSpy)&&void 0!==a&&a,enableInspector:null!==(s=e.enableInspector)&&void 0!==s&&s};l.settings=u;var c=u.appWidth,d=u.appHeight,f=u.deviceLogicalPixelRatio,h=u.devicePhysicalPixelRatio,p=u.enableInspector,v=function(e){l.driver.releaseTexture(e)},g=u.experimental_FinalizationRegistryTextureUsageTracker&&"function"==typeof FinalizationRegistry;l.textureTracker=g?new St(v):new kt(v,l.settings.textureCleanupOptions);var y=c*f,m=d*f;l.driver=r;var x,b=document.createElement("canvas");if(l.canvas=b,b.width=y*h,b.height=m*h,b.style.width="".concat(y,"px"),b.style.height="".concat(m,"px"),!(x="string"==typeof n?document.getElementById(n):n))throw new Error("Could not find target element");return r.onCreateNode=function(e){l.nodes.set(e.id,e)},r.onBeforeDestroyNode=function(e){l.nodes.delete(e.id)},r.onFpsUpdate=function(e){l.emit("fpsUpdate",e)},r.onFrameTick=function(e){l.emit("frameTick",e)},r.onIdle=function(){l.emit("idle")},x.appendChild(b),p&&!R()&&(l.inspector=new _t(b,u)),l}return T(t,e),I(t,[{key:"init",value:(n=x(y().mark((function e(){return y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.driver.init(this,this.settings,this.canvas);case 2:this.root=this.driver.getRootNode();case 3:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"createNode",value:function(e){return this.inspector?this.inspector.createNode(this.driver,this.resolveNodeDefaults(e)):this.driver.createNode(this.resolveNodeDefaults(e))}},{key:"createTextNode",value:function(e){var t,n,r,o,i,a,s,l,u,c,d,f,h,p,v,g,y,m,x,b=null!==(t=e.fontSize)&&void 0!==t?t:16,w=F(F({},this.resolveNodeDefaults(e)),{},{text:null!==(n=e.text)&&void 0!==n?n:"",textRendererOverride:null!==(r=e.textRendererOverride)&&void 0!==r?r:null,fontSize:b,fontFamily:null!==(o=e.fontFamily)&&void 0!==o?o:"sans-serif",fontStyle:null!==(i=e.fontStyle)&&void 0!==i?i:"normal",fontWeight:null!==(a=e.fontWeight)&&void 0!==a?a:"normal",fontStretch:null!==(s=e.fontStretch)&&void 0!==s?s:"normal",textAlign:null!==(l=e.textAlign)&&void 0!==l?l:"left",contain:null!==(u=e.contain)&&void 0!==u?u:"none",scrollable:null!==(c=e.scrollable)&&void 0!==c&&c,scrollY:null!==(d=e.scrollY)&&void 0!==d?d:0,offsetY:null!==(f=e.offsetY)&&void 0!==f?f:0,letterSpacing:null!==(h=e.letterSpacing)&&void 0!==h?h:0,lineHeight:null!==(p=e.lineHeight)&&void 0!==p?p:b,maxLines:null!==(v=e.maxLines)&&void 0!==v?v:0,textBaseline:null!==(g=e.textBaseline)&&void 0!==g?g:"alphabetic",verticalAlign:null!==(y=e.verticalAlign)&&void 0!==y?y:"top",overflowSuffix:null!==(m=e.overflowSuffix)&&void 0!==m?m:"...",debug:null!==(x=e.debug)&&void 0!==x?x:{}});return this.inspector?this.inspector.createTextNode(this.driver,w):this.driver.createTextNode(w)}},{key:"resolveNodeDefaults",value:function(e){var t,n,r,o,i,a,s,l,u,c,d,f,h,p,v,g,y,m,x,b,w,k,S,A,C,T,_,R,I,B,E,N,F,L,M,z,P,O,D,U,W,j,Y,H,Q,K,X=null!==(t=e.color)&&void 0!==t?t:4294967295,G=null!==(n=null!==(r=null!==(o=e.colorTl)&&void 0!==o?o:e.colorTop)&&void 0!==r?r:e.colorLeft)&&void 0!==n?n:X,V=null!==(i=null!==(a=null!==(s=e.colorTr)&&void 0!==s?s:e.colorTop)&&void 0!==a?a:e.colorRight)&&void 0!==i?i:X,Z=null!==(l=null!==(u=null!==(c=e.colorBl)&&void 0!==c?c:e.colorBottom)&&void 0!==u?u:e.colorLeft)&&void 0!==l?l:X,q=null!==(d=null!==(f=null!==(h=e.colorBr)&&void 0!==h?h:e.colorBottom)&&void 0!==f?f:e.colorRight)&&void 0!==d?d:X,J=An(null!==(p=e.data)&&void 0!==p?p:{});return{x:null!==(v=e.x)&&void 0!==v?v:0,y:null!==(g=e.y)&&void 0!==g?g:0,width:null!==(y=e.width)&&void 0!==y?y:0,height:null!==(m=e.height)&&void 0!==m?m:0,alpha:null!==(x=e.alpha)&&void 0!==x?x:1,clipping:null!==(b=e.clipping)&&void 0!==b&&b,color:X,colorTop:null!==(w=e.colorTop)&&void 0!==w?w:X,colorBottom:null!==(k=e.colorBottom)&&void 0!==k?k:X,colorLeft:null!==(S=e.colorLeft)&&void 0!==S?S:X,colorRight:null!==(A=e.colorRight)&&void 0!==A?A:X,colorBl:Z,colorBr:q,colorTl:G,colorTr:V,zIndex:null!==(C=e.zIndex)&&void 0!==C?C:0,zIndexLocked:null!==(T=e.zIndexLocked)&&void 0!==T?T:0,parent:null!==(_=e.parent)&&void 0!==_?_:null,texture:null!==(R=e.texture)&&void 0!==R?R:null,shader:null!==(I=e.shader)&&void 0!==I?I:null,src:null!==(B=e.src)&&void 0!==B?B:"",scale:null!==(E=e.scale)&&void 0!==E?E:null,scaleX:null!==(N=null!==(F=e.scaleX)&&void 0!==F?F:e.scale)&&void 0!==N?N:1,scaleY:null!==(L=null!==(M=e.scaleY)&&void 0!==M?M:e.scale)&&void 0!==L?L:1,mount:null!==(z=e.mount)&&void 0!==z?z:0,mountX:null!==(P=null!==(O=e.mountX)&&void 0!==O?O:e.mount)&&void 0!==P?P:0,mountY:null!==(D=null!==(U=e.mountY)&&void 0!==U?U:e.mount)&&void 0!==D?D:0,pivot:null!==(W=e.pivot)&&void 0!==W?W:.5,pivotX:null!==(j=null!==(Y=e.pivotX)&&void 0!==Y?Y:e.pivot)&&void 0!==j?j:.5,pivotY:null!==(H=null!==(Q=e.pivotY)&&void 0!==Q?Q:e.pivot)&&void 0!==H?H:.5,rotation:null!==(K=e.rotation)&&void 0!==K?K:0,data:J}}},{key:"destroyNode",value:function(e){return this.inspector&&this.inspector.destroyNode(e),this.driver.destroyNode(e)}},{key:"createTexture",value:function(e,t,n){var r=this.nextTextureId++,o={descType:"texture",txType:e,props:t,options:F(F({},n),{},{id:r})};return this.textureTracker.registerTexture(o),o}},{key:"createShader",value:function(e,t){return{descType:"shader",shType:e,props:t}}},{key:"getNodeById",value:function(e){return this.nodes.get(e)||null}},{key:"toggleFreeze",value:function(){throw new Error("Not implemented")}},{key:"advanceFrame",value:function(){throw new Error("Not implemented")}},{key:"rerender",value:function(){throw new Error("Not implemented")}}]);var n}(D),_n=function(e){function t(e,n,r){var o;return B(this,t),L(o=w(this,t),"node",void 0),L(o,"props",void 0),L(o,"settings",void 0),L(o,"propStartValues",{}),L(o,"restoreValues",{}),L(o,"progress",0),L(o,"delayFor",0),L(o,"timingFunction",void 0),L(o,"propsList",void 0),o.node=e,o.props=n,o.settings=r,o.propStartValues={},o.propsList=Object.keys(n),o.propsList.forEach((function(t){o.propStartValues[t]=e[t]})),o.timingFunction=function(e){return e},r.easing&&"string"==typeof r.easing&&(o.timingFunction=re(r.easing)),o.delayFor=r.delay||0,o}return T(t,e),I(t,[{key:"reset",value:function(){this.progress=0,this.delayFor=this.settings.delay||0,this.update(0)}},{key:"restore",value:function(){var e=this;this.reset(),Object.keys(this.props).forEach((function(t){e.node[t]=e.propStartValues[t]}))}},{key:"reverse",value:function(){var e=this;this.progress=0,Object.keys(this.props).forEach((function(t){var n=e.props[t],r=e.propStartValues[t];e.props[t]=r,e.propStartValues[t]=n})),this.settings.loop||(this.settings.stopMethod=!1)}},{key:"applyEasing",value:function(e,t,n){return(this.timingFunction(e)||e)*(n-t)+t}},{key:"update",value:function(e){var t=this.settings,n=t.duration,r=t.loop,o=t.easing,i=t.stopMethod;if(n)if(this.delayFor>0)this.delayFor-=e;else if(this.delayFor<=0&&0===this.progress&&this.emit("start",{}),this.progress+=e/n,this.progress>1&&(this.progress=r?0:1,i))this.emit("finished",{});else{for(var a=0;a2&&void 0!==arguments[2]?arguments[2]:null;this.props.texture&&this.unloadTexture();var o=this.stage.txManager.loadTexture(e,t,r);this.props.texture=o,this.props.textureOptions=r,this.setUpdateType(Nn.IsRenderable),queueMicrotask((function(){"loaded"===o.state?n.onTextureLoaded(o,o.dimensions):"failed"===o.state?n.onTextureFailed(o,o.error):"freed"===o.state&&n.onTextureFreed(o),o.on("loaded",n.onTextureLoaded),o.on("failed",n.onTextureFailed),o.on("freed",n.onTextureFreed)}))}},{key:"unloadTexture",value:function(){if(this.props.texture){var e=this.props.texture;e.off("loaded",this.onTextureLoaded),e.off("failed",this.onTextureFailed),e.off("freed",this.onTextureFreed),e.setRenderableOwner(this,!1)}this.props.texture=null,this.props.textureOptions=null,this.setUpdateType(Nn.IsRenderable)}},{key:"loadShader",value:function(e,t){var n=this.stage.renderer.getShaderManager();_(n);var r=n.loadShader(e,t),o=r.shader,i=r.props;this.props.shader=o,this.props.shaderProps=i,this.setUpdateType(Nn.IsRenderable)}},{key:"setUpdateType",value:function(e){this.updateType|=e;var t=this.props.parent;!t||t.updateType&Nn.Children||t.setUpdateType(Nn.Children)}},{key:"sortChildren",value:function(){this.children.sort((function(e,t){return e.calcZIndex-t.calcZIndex}))}},{key:"updateScaleRotateTransform",value:function(){this.scaleRotateTransform=In.rotate(this.props.rotation,this.scaleRotateTransform).scale(this.props.scaleX,this.props.scaleY)}},{key:"updateLocalTransform",value:function(){_(this.scaleRotateTransform);var e=this.props.pivotX*this.props.width,t=this.props.pivotY*this.props.height,n=this.props.mountX*this.props.width,r=this.props.mountY*this.props.height;this.localTransform=In.translate(e-n+this.props.x,t-r+this.props.y,this.localTransform).multiply(this.scaleRotateTransform).translate(-e,-t),this.setUpdateType(Nn.Global)}},{key:"update",value:function(e,t){var n=this;this.updateType&Nn.ScaleRotate&&(this.updateScaleRotateTransform(),this.setUpdateType(Nn.Local)),this.updateType&Nn.Local&&(this.updateLocalTransform(),this.setUpdateType(Nn.Global));var r=this.props.parent,o=Nn.None;this.updateType&Nn.Global&&(_(this.localTransform),this.globalTransform=In.copy((null==r?void 0:r.globalTransform)||this.localTransform,this.globalTransform),r&&this.globalTransform.multiply(this.localTransform),this.calculateRenderCoords(),this.updateBoundingRect(),this.setUpdateType(Nn.Clipping|Nn.RenderState|Nn.Children),o|=Nn.Global),this.updateType&Nn.Clipping&&(this.calculateClippingRect(t),this.setUpdateType(Nn.Children),o|=Nn.Clipping),this.updateType&Nn.WorldAlpha&&(this.worldAlpha=r?r.worldAlpha*this.props.alpha:this.props.alpha,this.setUpdateType(Nn.Children|Nn.PremultipliedColors),o|=Nn.WorldAlpha),this.updateType&Nn.PremultipliedColors&&(this.premultipliedColorTl=H(this.props.colorTl,this.worldAlpha,!0),this.props.colorTl===this.props.colorTr&&this.props.colorBl===this.props.colorBr&&this.props.colorTl===this.props.colorBl?this.premultipliedColorTr=this.premultipliedColorBl=this.premultipliedColorBr=this.premultipliedColorTl:(this.premultipliedColorTr=H(this.props.colorTr,this.worldAlpha,!0),this.premultipliedColorBl=H(this.props.colorBl,this.worldAlpha,!0),this.premultipliedColorBr=H(this.props.colorBr,this.worldAlpha,!0))),this.updateType&Nn.RenderState&&(this.updateRenderState(t),this.setUpdateType(Nn.IsRenderable)),this.updateType&Nn.IsRenderable&&this.updateIsRenderable(),r&&this.updateType&Nn.CalculatedZIndex&&(this.calculateZIndex(),r.setUpdateType(Nn.ZIndexSortedChildren)),this.updateType&Nn.Children&&this.children.length&&this.children.forEach((function(t){t.setUpdateType(o),0!==t.updateType&&t.update(e,n.clippingRect)})),this.updateType&Nn.ZIndexSortedChildren&&this.sortChildren(),this.updateType=0}},{key:"checkRenderProps",value:function(){return!!this.props.texture||!(!this.props.width||!this.props.height)&&(!!this.props.shader||(!!this.props.clipping||(0!==this.props.color||(0!==this.props.colorTop||(0!==this.props.colorBottom||(0!==this.props.colorLeft||(0!==this.props.colorRight||(0!==this.props.colorTl||(0!==this.props.colorTr||(0!==this.props.colorBl||0!==this.props.colorBr))))))))))}},{key:"checkRenderBounds",value:function(e){_(this.renderBound);var t=e.width||this.stage.root.width,n=e.height||this.stage.root.height;this.strictBound=M(e.x,e.y,e.x+t,e.y+n,this.strictBound);var r=this.stage.boundsMargin;return this.preloadBound=M(e.x-r[3],e.y-r[0],e.x+t+r[1],e.y+n+r[2],this.preloadBound),ie(this.renderBound,this.strictBound)?Cn.InViewport:ie(this.renderBound,this.preloadBound)?Cn.InBounds:Cn.OutOfBounds}},{key:"updateRenderState",value:function(e){var t=this.checkRenderBounds(e);if(t!==this.renderState){var n=this.renderState;this.renderState=t,n===Cn.InViewport&&this.emit("outOfViewport",{previous:n,current:t});var r=Fn.get(t);_(r),this.emit(r,{previous:n,current:t})}}},{key:"setRenderState",value:function(e){e!==this.renderState&&(this.renderState=e,this.emit(Cn[e]))}},{key:"updateIsRenderable",value:function(){var e;e=!!this.checkRenderProps()&&this.renderState>Cn.OutOfBounds,this.isRenderable!==e&&(this.isRenderable=e,this.onChangeIsRenderable(e))}},{key:"onChangeIsRenderable",value:function(e){var t;null===(t=this.props.texture)||void 0===t||t.setRenderableOwner(this,e)}},{key:"calculateRenderCoords",value:function(){var e=this.width,t=this.height,n=this.globalTransform;_(n);var r=n.tx,o=n.ty,i=n.ta,a=n.tb,s=n.tc,l=n.td;if(0===a&&0===s){var u=r,c=r+e*i,d=o,f=o+t*l;this.renderCoords=En.translate(u,d,c,d,c,f,u,f,this.renderCoords)}else this.renderCoords=En.translate(r,o,r+e*i,o+e*s,r+e*i+t*a,o+e*s+t*l,r+t*a,o+t*l,this.renderCoords)}},{key:"updateBoundingRect",value:function(){var e=this.renderCoords,t=this.globalTransform;_(t),_(e);var n=t.tb,r=t.tc,o=e.x1,i=e.y1,a=e.x3,s=e.y3;if(0===n||0===r)this.renderBound=M(o,i,a,s,this.renderBound);else{var l=e.x2,u=e.x4,c=e.y2,d=e.y4;this.renderBound=M(Math.min(o,l,a,u),Math.min(i,c,s,d),Math.max(o,l,a,u),Math.max(i,c,s,d),this.renderBound)}}},{key:"calculateClippingRect",value:function(e){_(this.globalTransform);var t=this.clippingRect,n=this.props,r=this.globalTransform,o=n.clipping,i=0!==r.tb||0!==r.tc;o&&!i?(t.x=r.tx,t.y=r.ty,t.width=this.width*r.ta,t.height=this.height*r.td,t.valid=!0):t.valid=!1,e.valid&&t.valid?j(e,t,t):e.valid&&($(e,t),t.valid=!0)}},{key:"calculateZIndex",value:function(){var e,t,n=this.props,r=n.zIndex||0,o=(null===(e=n.parent)||void 0===e?void 0:e.zIndex)||0,i=r;null!==(t=n.parent)&&void 0!==t&&t.zIndexLocked&&(i=r0&&void 0!==arguments[0]?arguments[0]:1,t=new Blob(["\n function hasAlphaChannel(mimeType) {\n return (mimeType.indexOf(\"image/png\") !== -1);\n }\n\n async function getImage(src, premultiplyAlpha) {\n return new Promise(function(resolve, reject) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', src, true);\n xhr.responseType = 'blob';\n\n xhr.onload = function() {\n if (xhr.status === 200) {\n var blob = xhr.response;\n var hasAlphaChannel = premultiplyAlpha !== undefined ? premultiplyAlpha : hasAlphaChannel(blob.type);\n\n createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none'\n }).then(function(data) {\n resolve({ data: data, premultiplyAlpha: premultiplyAlpha });\n }).catch(function(error) {\n reject(error);\n });\n } else {\n reject(new Error('Failed to load image: ' + xhr.statusText));\n }\n };\n\n xhr.onerror = function() {\n reject(new Error('Network error occurred while trying to fetch the image.'));\n };\n\n xhr.send();\n });\n }\n\n self.onmessage = async (event) => {\n var src = event.data.src;\n var premultiplyAlpha = event.data.premultiplyAlpha;\n\n getImage(src, premultiplyAlpha)\n .then(function(data) {\n self.postMessage({ src: src, data: data }, [data.data]);\n })\n .catch(function(error) {\n self.postMessage({ src: src, error: error.message });\n });\n };\n ".replace('"use strict";',"")],{type:"application/javascript"}),n=(self.URL?URL:webkitURL).createObjectURL(t),r=[],o=0;o2&&void 0!==arguments[2]?arguments[2]:null,o=this.txConstructors[e];if(!o)throw new Error('Texture type "'.concat(e,'" is not registered'));if(void 0!==(null==r?void 0:r.id)&&this.textureIdCache.has(r.id)&&(n=this.textureIdCache.get(r.id)),!n){var i,a=null==r?void 0:r.id,s=null!==(i=null==r?void 0:r.cacheKey)&&void 0!==i?i:o.makeCacheKey(t);n=s&&this.textureKeyCache.has(s)?this.textureKeyCache.get(s):new o(this,t),a&&this.addTextureIdToCache(a,s,n)}null!=r&&r.preload&&this.getCtxTexture(n).load();return n}},{key:"addTextureIdToCache",value:function(e,t,n){var r=this.textureIdCache,o=this.textureRefCountMap;r.set(e,n),o.has(n)?o.get(n).count++:(o.set(n,{cacheKey:t,count:1}),t&&this.textureKeyCache.set(t,n))}},{key:"removeTextureIdFromCache",value:function(e){var t,n=this.textureIdCache,r=this.textureRefCountMap,o=n.get(e);if(o){if(n.delete(e),r.has(o)){var i=r.get(o);_(i),i.count--,0===i.count&&(r.delete(o),i.cacheKey&&this.textureKeyCache.delete(i.cacheKey))}null===(t=this.ctxTextureCache.get(o))||void 0===t||t.free()}}},{key:"getDebugInfo",value:function(){return{keyCacheSize:this.textureKeyCache.size,idCacheSize:this.textureIdCache.size}}},{key:"getCtxTexture",value:function(e){if(this.ctxTextureCache.has(e))return this.ctxTextureCache.get(e);var t=this.renderer.createCtxTexture(e);return this.ctxTextureCache.set(e,t),t}}])}(),Hn=function(){return I((function e(t){B(this,e),L(this,"memUsed",0),L(this,"textures",new Map),L(this,"threshold",void 0),this.threshold=t,0===t&&(this.setTextureMemUse=function(){})}),[{key:"setTextureMemUse",value:function(e,t){this.textures.has(e)&&(this.memUsed-=this.textures.get(e)),0!==t?(this.memUsed+=t,this.textures.set(e,t),this.memUsed>this.threshold&&this.gc()):this.textures.delete(e)}},{key:"gc",value:function(){this.textures.forEach((function(e,t){t.renderable||t.free()}))}}])}(),Qn=function(e){function t(e){var n;B(this,t),L(n=w(this,t),"options",void 0),L(n,"animationManager",void 0),L(n,"txManager",void 0),L(n,"txMemManager",void 0),L(n,"fontManager",void 0),L(n,"textRenderers",void 0),L(n,"shManager",void 0),L(n,"renderer",void 0),L(n,"root",void 0),L(n,"boundsMargin",void 0),L(n,"deltaTime",0),L(n,"lastFrameTime",0),L(n,"currentFrameTime",0),L(n,"fpsNumFrames",0),L(n,"fpsElapsedTime",0),L(n,"renderRequested",!1),L(n,"contextSpy",null),n.options=e;var r=e.canvas,o=e.clearColor,i=e.rootId,a=e.debug,s=e.appWidth,l=e.appHeight,u=e.boundsMargin,c=e.enableContextSpy,d=e.numImageWorkers,f=e.txMemByteThreshold;n.txManager=new Yn(d),n.txMemManager=new Hn(f),n.shManager=new an,n.animationManager=new On,n.contextSpy=c?new sn:null;var h=[0,0,0,0];u&&(h=Array.isArray(u)?u:[u,u,u,u]),n.boundsMargin=h,null!=a&&a.monitorTextureCache&&setInterval((function(){_(n.txManager);var e=n.txManager.getDebugInfo();console.log("Texture ID Cache Size: ",e.idCacheSize),console.log("Texture Key Cache Size: ",e.keyCacheSize)}),1e3),n.renderer=new le({stage:n,canvas:r,pixelRatio:e.devicePhysicalPixelRatio*e.deviceLogicalPixelRatio,clearColor:null!=o?o:4278190080,bufferMemory:2e6,txManager:n.txManager,txMemManager:n.txMemManager,shManager:n.shManager,contextSpy:n.contextSpy}),n.txManager.renderer=n.renderer,n.textRenderers={canvas:new Pt(n),sdf:new wn(n)},n.fontManager=new xn(n.textRenderers);var p,v,g=new Ln(n,{id:i,x:0,y:0,width:s,height:l,alpha:1,clipping:!1,color:0,colorTop:0,colorBottom:0,colorLeft:0,colorRight:0,colorTl:0,colorTr:0,colorBl:0,colorBr:0,zIndex:0,zIndexLocked:0,scaleX:1,scaleY:1,mountX:0,mountY:0,mount:0,pivot:.5,pivotX:.5,pivotY:.5,rotation:0,parent:null,texture:null,textureOptions:null,shader:null,shaderProps:null});return n.root=g,p=n,v=!1,requestAnimationFrame((function e(){if(p.updateAnimations(),!p.hasSceneUpdates())return p.calculateFps(),setTimeout(e,16.666666666666668),void(v||(p.emit("idle"),v=!0));v=!1,p.drawFrame(),requestAnimationFrame(e)})),n}return T(t,e),I(t,[{key:"updateAnimations",value:function(){var e=this.animationManager;this.root&&(this.lastFrameTime=this.currentFrameTime,this.currentFrameTime=performance?performance.now():Date.now(),this.deltaTime=this.lastFrameTime?this.currentFrameTime-this.lastFrameTime:100/6,this.emit("frameTick",{time:this.currentFrameTime,delta:this.deltaTime}),e.update(this.deltaTime))}},{key:"hasSceneUpdates",value:function(){return!!this.root.updateType||this.renderRequested}},{key:"drawFrame",value:function(){var e=this.renderer,t=this.renderRequested;0!==this.root.updateType&&this.root.update(this.deltaTime,this.root.clippingRect),null==e||e.reset(),this.addQuads(this.root),null==e||e.render(),this.calculateFps(),t&&(this.renderRequested=!1)}},{key:"calculateFps",value:function(){var e=this.options.fpsUpdateInterval;if(e&&(this.fpsNumFrames++,this.fpsElapsedTime+=this.deltaTime,this.fpsElapsedTime>=e)){var t,n,r,o=Math.round(1e3*this.fpsNumFrames/this.fpsElapsedTime);this.fpsNumFrames=0,this.fpsElapsedTime=0,this.emit("fpsUpdate",{fps:o,contextSpyData:null!==(t=null===(n=this.contextSpy)||void 0===n?void 0:n.getData())&&void 0!==t?t:null}),null===(r=this.contextSpy)||void 0===r||r.reset()}}},{key:"addQuads",value:function(e){_(this.renderer&&e.globalTransform),e.isRenderable&&e.renderQuads(this.renderer);for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:null,n=!1;if(t){var r=this.textRenderers[t];r?r.canRenderFont(e)||(console.warn("Cannot use override text renderer '".concat(t,"' for font"),e),t=null,n=!0):(console.warn("Text renderer override '".concat(t,"' not found.")),t=null,n=!0)}if(!t){for(var o=0,i=Object.entries(this.textRenderers);o0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"app",n=new Gn;return Wn=new Tn(e,t,n),jn=Wn.createShader.bind(Wn),Wn}var Zn=function(e){function t(e){var n;return B(this,t),(n=w(this,t))._parent=e,n}return T(t,e),I(t,[{key:"selected",get:function(){return this[this._parent.selected||0]}},{key:"firstChild",get:function(){return this[0]}},{key:"insert",value:function(e,t){if(t){var n=this.indexOf(t);this.splice(n,0,e)}else this.push(e);e.parent=this._parent,this._parent._isDirty=!0}},{key:"remove",value:function(e){var t=this.indexOf(e);t>=0&&this.splice(t,1)}}])}(g(Array));var qn={debug:!1,animationsEnabled:!0,animationSettings:{duration:250,easing:"ease-in-out"},fontSettings:{fontFamily:"Ubuntu",fontSize:100}};function Jn(e){return"function"==typeof e}function $n(e){return Array.isArray(e)}function er(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if($n(e))e.forEach((function(e){er(e,t)}));else if(e)for(var n in e)void 0===t[n]&&(t[n]=e[n]);return t}var tr=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return B(this,t),$n(r)?n=w(this,t,E(r)):n=w(this,t,"string"==typeof r?[r]:E(Object.entries(r).filter((function(e){var t=z(e,2);t[0];return t[1]})).map((function(e){return z(e,1)[0]})))),n.onChange=e,k(n,S(n))}return T(t,e),I(t,[{key:"has",value:function(e){return this.indexOf(e)>=0}},{key:"is",value:function(e){return this.indexOf(e)>=0}},{key:"add",value:function(e){this.push(e),this.onChange()}},{key:"toggle",value:function(e){this.has(e)?this.remove(e):this.add(e)}},{key:"remove",value:function(e){var t=this.indexOf(e);t>=0&&(this.splice(t,1),this.onChange())}}])}(g(Array));var nr=qn.animationSettings;function rr(e){for(var t=[],n=0,r=Object.entries(e);n0&&void 0!==arguments[0]?arguments[0]:"";return{set:function(t){"number"==typeof t&&(t={width:t,color:255}),this.effects=F(F({},this.effects||{}),L({},"border".concat(e),t)),this["_border".concat(e)]=t},get:function(){return this["_border".concat(e)]}}}var ir=["alpha","color","colorTop","colorRight","colorLeft","colorBottom","colorTl","colorTr","colorBl","colorBr","height","fontSize","lineHeight","mount","mountX","mountY","pivot","pivotX","pivotY","rotation","scale","width","worldX","worldY","x","y","zIndex","zIndexLocked"],ar=["clipping","contain","fontFamily","fontStretch","fontStyle","fontWeight","letterSpacing","maxLines","offsetY","overflowSuffix","rtt","scrollable","scrollY","src","text","textAlign","textBaseline","textOverflow","texture","verticalAlign","wordWrap"],sr=function(e){function t(e){var n;B(this,t),(n=w(this,t))._animationQueue=[],n._animationRunning=!1,n.name=e,n.rendered=!1,n.autofocus=!1,n._renderProps={x:0,y:0},n.children=new Zn(n);var r,o=P(ir);try{var i=function(){var e=r.value;Object.defineProperty(n,e,{get:function(){return this.lng&&this.lng[e]||this["_".concat(e)]},set:function(t){this["_".concat(e)]=t,this._sendToLightningAnimatable(e,t)}})};for(o.s();!(r=o.n()).done;)i()}catch(u){o.e(u)}finally{o.f()}var a,s=P(ar);try{var l=function(){var e=a.value;Object.defineProperty(n,e,{get:function(){return this.lng&&this.lng[e]||this["_".concat(e)]},set:function(t){this["_".concat(e)]=t,this._sendToLightning(e,t)}})};for(s.s();!(a=s.n()).done;)l()}catch(u){s.e(u)}finally{s.f()}return Object.defineProperties(n,{borderRadius:{set:function(e){this._borderRadius=e,this.effects=F(F({},this.effects||{}),{radius:{radius:e}})},get:function(){return this._borderRadius}},border:or(),borderLeft:or("Left"),borderRight:or("Right"),borderTop:or("Top"),borderBottom:or("Bottom")}),Object.defineProperties(n,{linearGradient:{set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._linearGradient=e,this.effects=F(F({},this.effects||{}),{linearGradient:e})},get:function(){return this._linearGradient}}}),n}return T(t,e),I(t,[{key:"effects",get:function(){return this._effects},set:function(e){this._effects=e,this.rendered&&(this.shader=rr(e))}},{key:"parent",get:function(){return this._parent},set:function(e){var t;(this._parent=e,this.rendered&&this.lng)&&(this.lng.parent=null!==(t=null==e?void 0:e.lng)&&void 0!==t?t:null)}},{key:"shader",get:function(){return this._shader},set:function(e){$n(e)?this._shader=jn.apply(void 0,E(e)):this._shader=e,this._sendToLightning("shader",this._shader)}},{key:"_sendToLightningAnimatable",value:function(e,t){if(this.lng){if(qn.animationsEnabled&&this.transition&&(!0===this.transition||this.transition[e])){var n=!0===this.transition||!0===this.transition[e]?void 0:this.transition[e];return this.animate(L({},e,t),n).start()}this.lng[e]=t}else this._renderProps[e]=t}},{key:"_sendToLightning",value:function(e,t){this.rendered&&this.lng?this.lng[e]=t:this._renderProps[e]=t}},{key:"animate",value:function(e,t){return _(this.lng,"Node must be rendered before animating"),this.lng.animate(e,t||this.animationSettings)}},{key:"chain",value:function(e,t){return this._animationRunning&&(this._animationQueue=[],this._animationRunning=!1),t?this._animationQueueSettings=t:this._animationQueueSettings||(this._animationQueueSettings=t||this.animationSettings),t=t||this._animationQueueSettings,this._animationQueue.push({props:e,animationSettings:t}),this}},{key:"start",value:(n=x(y().mark((function e(){var t;return y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=this._animationQueue.shift();case 1:if(!t){e.next=8;break}return this._animationRunning=!0,e.next=5,this.animate(t.props,t.animationSettings).start().waitUntilStopped();case 5:t=this._animationQueue.shift(),e.next=1;break;case 8:this._animationRunning=!1,this._animationQueueSettings=void 0;case 10:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"setFocus",value:function(){var e=this;if(this.rendered){if(void 0!==this.forwardFocus)if(Jn(this.forwardFocus)){if(!1!==this.forwardFocus.call(this,this))return}else{var n="number"==typeof this.forwardFocus?this.forwardFocus:null;if(null!==n&&n0}},{key:"getChildById",value:function(e){return this.children.find((function(t){return t.id===e}))}},{key:"searchChildrenById",value:function(e){var n,r=P(this.children);try{for(r.s();!(n=r.n()).done;){var o=n.value;if(o.id===e)return o;if(o instanceof t){var i=o.searchChildrenById(e);if(i)return i}}}catch(a){r.e(a)}finally{r.f()}}},{key:"states",get:function(){return this._states=this._states||new tr(this._stateChanged.bind(this)),this._states},set:function(e){this._states=new tr(this._stateChanged.bind(this),e),this.rendered&&this._stateChanged()}},{key:"animationSettings",get:function(){return this._animationSettings||nr},set:function(e){this._animationSettings=e}},{key:"updateLayout",value:function(e,t){if(this.hasChildren){var n;if(Jn(this.onBeforeLayout)&&this.onBeforeLayout.call(this,e,t),"flex"===this.display)if(function(e){for(var t=[],n=0;n=0;k--){var S=t[k];_(S),S[c]=w-(S[a]||0)-(S[u]||0),w-=(S[a]||0)+p+(S[l]||0)+(S[u]||0),m(S)}else if("center"===v){var A=(f-(y+p*(o-1)))/2;t.forEach((function(e){e[c]=A,A+=(e[a]||0)+p,m(e)}))}else if("spaceBetween"===v){var C=(f-y)/(o-1),T=0;t.forEach((function(e){e[c]=T,T+=(e[a]||0)+C,m(e)}))}else if("spaceEvenly"===v){var R=(f-y)/(o+1),I=R;t.forEach((function(e){e[c]=I,I+=(e[a]||0)+R,m(e)}))}return!1}(this))null===(n=this.parent)||void 0===n||n.updateLayout();Jn(this.onLayout)&&this.onLayout.call(this,e,t)}}},{key:"_stateChanged",value:function(){var e=this;if(this.states,this.forwardStates){var t=this.states.slice();this.children.forEach((function(e){return e.states=t}))}var n=this.states;if(this._undoStyles||this.style&&function(e,t){var n,r=P(t);try{for(r.s();!(n=r.n()).done;)if(n.value in e)return!0}catch(o){r.e(o)}finally{r.f()}return!1}(this.style,n)){this._undoStyles=this._undoStyles||[];var r={};this._undoStyles.forEach((function(t){r[t]=e.style[t]}));var o=n.reduce((function(t,n){var r=e.style[n];return r&&(t=F(F({},t),r)),t}),{});this._undoStyles=Object.keys(o),void 0!==o.transition&&(this.transition=o.transition),Object.assign(this,F(F({},r),o))}}},{key:"render",value:function(){var e=this,t=this.parent;if(t)if(t.rendered)if(this.rendered)console.warn("Node already rendered: ",this);else{t._isDirty&&(t.updateLayout(),t._isDirty=!1),e.updateLayout(),this.states.length&&this._stateChanged();var n=e._renderProps;t.lng&&(n.parent=t.lng),e._effects&&(this.shader=rr(e._effects)),e.isTextNode()?((n=F(F(F({},qn.fontSettings),n),{},{text:e.getText()})).contain&&(n.width||(n.width=(t.width||0)-(n.x||0)-(n.marginRight||0),e._width=n.width,e._autosized=!0),"both"!==n.contain||n.height||n.maxLines||(n.height=(t.height||0)-(n.y||0)-(n.marginBottom||0),e._height=n.height,e._autosized=!0)),e.lng=Wn.createTextNode(n),Jn(e.onLoad)&&e.lng.on("loaded",e.onLoad),e.width&&e.height||(e._autosized=!0,e._resizeOnTextLoad())):(n.texture||(isNaN(n.width)&&(n.width=(t.width||0)-(n.x||0),e._width=n.width,e._autosized=!0),isNaN(n.height)&&(n.height=(t.height||0)-(n.y||0),e._height=n.height,e._autosized=!0),n.color||n.src||(e._color=n.color=0)),e.lng=Wn.createNode(n),e.onFail&&e.lng.on("failed",e.onFail),e.onLoad&&e.lng.on("loaded",e.onLoad)),e.rendered=!0,Jn(this.onCreate)&&this.onCreate.call(this,e),e.lng.div&&(e.lng.div.solid=e),delete this._renderProps,"text"!==e.name&&e.children.forEach((function(e){e.render?e.render():""!==e.text&&console.warn("TextNode outside of : ",e)})),e.autofocus&&e.setFocus()}else console.warn("Parent not rendered yet: ",this);else console.warn("Parent not set - no node created for: ",this)}}]);var n}(g(Object)),lr=function(e){return t=gr("text"),mr(t,e,!1),t;var t},ur=function(e){return t=gr("node"),mr(t,e,!1),t;var t};function cr(e){var t=e.createElement,n=e.createTextNode,r=e.isTextNode,o=e.replaceText,i=e.insertNode,a=e.removeNode,s=e.setProperty,l=e.getParentNode,u=e.getFirstChild,c=e.getNextSibling;function d(e,t,n,r){if(void 0===n||r||(r=[]),"function"!=typeof t)return f(e,t,r,n);Ee((function(r){return f(e,t(),r,n)}),r)}function f(e,t,a,s,l){for(;"function"==typeof a;)a=a();if(t===a)return a;var c=typeof t,d=void 0!==s;if("string"===c||"number"===c)if("number"===c&&(t=t.toString()),d){var m=a[0];m&&r(m)?o(m,t):m=n(t),a=v(e,a,s,m)}else""!==a&&"string"==typeof a?o(u(e),a=t):(v(e,a,s,n(t)),a=t);else if(null==t||"boolean"===c)a=v(e,a,s);else{if("function"===c)return Ee((function(){for(var n=t();"function"==typeof n;)n=n();a=f(e,n,a,s)})),function(){return a};if(Array.isArray(t)){var x=[];if(h(x,t,l))return Ee((function(){return a=f(e,x,a,s,!0)})),function(){return a};if(0===x.length){var b=v(e,a,s);if(d)return a=b}else Array.isArray(a)?0===a.length?g(e,x,s):p(e,a,x):null==a||""===a?g(e,x):p(e,d&&a||[u(e)],x);a=x}else{if(Array.isArray(a)){if(d)return a=v(e,a,s,t);v(e,a,null,t)}else null!=a&&""!==a&&u(e)?y(e,t,u(e)):i(e,t);a=t}}return a}function h(e,t,r){for(var o=!1,i=0,a=t.length;ig-u)for(var w=t[l];u=0;f--){var h=t[f];if(c!==h){var p=l(h)===e;d||f?p&&a(e,h):p?y(e,c,h):i(e,c,r)}else d=!0}else i(e,c,r);return[c]}function g(e,t,n){for(var r=0,o=t.length;r2&&void 0!==arguments[2]?arguments[2]:{};return t||(t={}),(arguments.length>3?arguments[3]:void 0)||Ee((function(){return n.children=f(e,t.children,n.children)})),Ee((function(){return t.ref&&t.ref(e)})),Ee((function(){for(var r in t)if("children"!==r&&"ref"!==r){var o=t[r];o!==n[r]&&(s(e,r,o,n[r]),n[r]=o)}})),n}return{render:function(e,t){var n;return Re((function(r){n=r,d(t,e())})),n},insert:d,spread:function(e,t,n){"function"==typeof t?Ee((function(r){return m(e,t(),r,n)})):m(e,t,void 0,n)},createElement:t,createTextNode:n,insertNode:i,setProp:function(e,t,n,r){return s(e,t,n,r),n},mergeProps:pt,effect:Ee,memo:Fe,createComponent:ut,use:function(e,t,n){return ze((function(){return e(t,n)}))}}}var dr={createElement:function(e){return new sr(e)},createTextNode:function(e){return{name:"TextNode",text:e,parent:void 0}},replaceText:function(e,t){e.text=t;var n=e.parent;_(n),n.text=n.getText()},setProperty:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];e[t]=n},insertNode:function(e,t,n){e.children.insert(t,n),t._queueDelete=!1,t instanceof sr?e.rendered&&t.render():e.isTextNode()&&(e.text=e.getText())},isTextNode:function(e){return e.isTextNode()},removeNode:function(e,t){e.children.remove(t),t._queueDelete=!0,t instanceof sr&&queueMicrotask((function(){return t.destroy()}))},getParentNode:function(e){return e.parent},getFirstChild:function(e){return e.children[0]},getNextSibling:function(e){var t=e.parent.children||[],n=t.indexOf(e)+1;if(n0&&void 0!==arguments[0]?arguments[0]:"";return e=t,Number.isInteger(e)?t:"string"==typeof t?t.startsWith("#")?Number(t.replace("#","0x")+(7===t.length?"ff":"")):t.startsWith("0x")?Number(t):Number("0x"+(6===t.length?t+"ff":t)):0}var Sr="_$DX_DELEGATE";function Ar(e){var t="$$".concat(e.type),n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get:function(){return n||document}});n;){var r=n[t];if(r&&!n.disabled){var o=n["".concat(t,"Data")];if(void 0!==o?r.call(n,o,e):r.call(n,e),e.cancelBubble)return}n=n._$host||n.parentNode||n.host}}var Cr;function Tr(){var e=new Set;var t=!1;return{subscribe:function(t){return e.add(t),function(){return e.delete(t)}},confirm:function(n,r){if(t)return!(t=!1);var o,i={to:n,options:r,defaultPrevented:!1,preventDefault:function(){return i.defaultPrevented=!0}},a=P(e);try{var s=function(){var e=o.value;e.listener(F(F({},i),{},{from:e.location,retry:function(o){o&&(t=!0),e.navigate(n,F(F({},r),{},{resolve:!1}))}}))};for(a.s();!(o=a.n()).done;)s()}catch(l){a.e(l)}finally{a.f()}return!i.defaultPrevented}}}function _r(){window.history.state&&null!=window.history.state._depth||window.history.replaceState(F(F({},window.history.state),{},{_depth:window.history.length-1}),""),Cr=window.history.state._depth}_r();var Rr=/^(?:[a-z0-9]+:)?\/\//i,Ir=/^\/+|(\/)\/+$/g,Br="http://sr";function Er(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.replace(Ir,"$1");return n?t||/^[?#]/.test(n)?n:"/"+n:""}function Nr(e,t,n){if(!Rr.test(t)){var r=Er(e),o=n&&Er(n),i="";return((i=!o||t.startsWith("/")?r:0!==o.toLowerCase().indexOf(r.toLowerCase())?r+o:o)||"/")+Er(t,!i)}}function Fr(e){var t={};return e.searchParams.forEach((function(e,n){t[n]=e})),t}function Lr(e,t,n){var r=z(e.split("/*",2),2),o=r[0],i=r[1],a=o.split("/").filter(Boolean),s=a.length;return function(e){var r=e.split("/").filter(Boolean),o=r.length-s;if(o<0||o>0&&void 0===i&&!t)return null;for(var l={path:s?"":"/",params:{}},u=function(e){return void 0===n?void 0:n[e]},c=0;c and 'use' router primitives can be only used inside a Route.")},jr=function(){return Wr().navigatorFactory()},Yr=function(){return Wr().params};function Hr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=e.component,r=e.load,o=e.children,i=e.info,a=!o||Array.isArray(o)&&!o.length,s={key:e,component:n,load:r,info:i};return Kr(e.path).reduce((function(n,r){var o,i,l=P(Pr(r));try{for(l.s();!(o=l.n()).done;){var u=o.value,c=(i=u,Er(t).replace(/\/*(\*.*)?$/g,"")+Er(i)),d=a?c:c.split("/*",1)[0];d=d.split("/").map((function(e){return e.startsWith(":")||e.startsWith("*")?e:encodeURIComponent(e)})).join("/"),n.push(F(F({},s),{},{originalPath:u,pattern:d,matcher:Lr(d,!a,e.matchFilters)}))}}catch(f){l.e(f)}finally{l.f()}return n}),[])}function Qr(e){var t,n,r,o,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{routes:e,score:1e4*(t=e[e.length-1],n=z(t.pattern.split("/*",2),2),r=n[0],o=n[1],i=r.split("/").filter(Boolean),i.reduce((function(e,t){return e+(t.startsWith(":")?2:3)}),i.length-(void 0===o?0:1)))-a,matcher:function(t){for(var n=[],r=e.length-1;r>=0;r--){var o=e[r],i=o.matcher(t);if(!i)return null;n.unshift(F(F({},i),{},{route:o}))}return n}}}function Kr(e){return Array.isArray(e)?e:[e]}function Xr(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=Kr(e),i=0,a=o.length;i3&&void 0!==arguments[3]?arguments[3]:{},o=z(e.signal,2),i=o[0],a=o[1],s=e.utils,l=void 0===s?{}:s,u=l.parsePath||function(e){return e},c=l.renderPath||function(e){return e},d=l.beforeLeave||Tr(),f=Nr("",r.base||"");if(void 0===f)throw new Error("".concat(f," is not a valid base path"));f&&!i().value&&a({value:f,replace:!0,scroll:!1});var h=z(Ie(!1),2),p=h[0],v=h[1],g=function(){var e=x(y().mark((function e(t){return y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return v(!0),e.prev=1,e.next=4,je(t);case 4:return e.prev=4,v(!1),e.finish(4);case 7:case"end":return e.stop()}}),e,null,[[1,,4,7]])})));return function(t){return e.apply(this,arguments)}}(),m=z(Ie(i().value),2),b=m[0],w=m[1],k=z(Ie(i().state),2),S=k[0],A=k[1],C=function(e,t){var n=new URL(Br),r=Fe((function(t){var r=e();try{return new URL(r,n)}catch(o){return console.error("Invalid path ".concat(r)),t}}),n,{equals:function(e,t){return e.href===t.href}}),o=Fe((function(){return r().pathname})),i=Fe((function(){return r().search}),!0),a=Fe((function(){return r().hash}));return{get pathname(){return o()},get search(){return i()},get hash(){return a()},get state(){return t()},get key(){return""},query:zr(Pe(i,(function(){return Fr(r())})))}}(b,S),T=[],_=Ie([]),R=Fe((function(){return Gr(t(),C.pathname)})),I=zr((function(){for(var e=R(),t={},n=0;n=100)throw new Error("Too many redirects");var f=b();if((c!==f||u!==S())&&d.confirm(c,n)){var h=T.push({value:f,replace:o,scroll:s,state:S()});g((function(){Or="navigate",w(c),A(u),_[1]([])})).then((function(){var e,t;T.length===h&&(Or=void 0,e={value:c,state:u},(t=T[0])&&(e.value===t.value&&e.state===t.state||a(F(F({},e),{},{replace:t.replace,scroll:t.scroll})),T.length=0))}))}}else t&&(l.go?l.go(t):console.warn("Router integration does not support relative routing"))}))}(e,t,n)}},matches:R,beforeLeave:d,preloadRoute:function(e,r){var o=Gr(t(),e.pathname),i=Or;Or="preload";var a=function(){var t=o[s],i=t.route,a=t.params;i.component&&i.component.preload&&i.component.preload();var l=i.load;r&&l&&We(n(),(function(){return l({params:a,location:{pathname:e.pathname,search:e.search,hash:e.hash,query:Fr(e),state:null,key:""},intent:"preload"})}))};for(var s in o)a();Or=i},singleFlight:void 0===r.singleFlight||r.singleFlight,submissions:_}}var Zr=function(e){return function(t){var n,r=t.base,o=Qe((function(){return t.children})),i=Fe((function(){return Xr(o(),t.base||"")})),a=Vr(e,i,(function(){return n}),{base:r,singleFlight:t.singleFlight});return e.create&&e.create(a),vr(Dr.Provider,{value:a,get children(){return vr(qr,{routerState:a,get root(){return t.root},get load(){return t.rootLoad},get children(){return[pr((function(){return(n=Ue())&&null})),vr(Jr,{routerState:a,get branches(){return i()}})]}})}})}};function qr(e){var t=e.routerState.location,n=e.routerState.params,r=Fe((function(){return e.load&&ze((function(){return e.load({params:n,location:t,intent:"preload"})}))}));return vr(yt,{get when(){return e.root},keyed:!0,get fallback(){return e.children},children:function(o){return vr(o,{params:n,location:t,get data(){return r()},get children(){return e.children}})}})}function Jr(e){var t,n=[],r=Fe(Pe(e.routerState.matches,(function(o,i,a){for(var s=i&&o.length===i.length,l=[],u=function(t){var u=i&&i[t],c=o[t];a&&u&&c.route.key===u.route.key?l[t]=a[t]:(s=!1,n[t]&&n[t](),Re((function(o){n[t]=o,l[t]=function(e,t,n,r){var o=e.base,i=e.location,a=e.params,s=r().route,l=s.pattern,u=s.component,c=s.load,d=Fe((function(){return r().path}));u&&u.preload&&u.preload();var f=c?c({params:a,location:i,intent:Or||"initial"}):void 0;return{parent:t,pattern:l,path:d,outlet:function(){return u?ut(u,{params:a,location:i,data:f,get children(){return n()}}):n()},resolvePath:function(e){return Nr(o.path(),e,d())}}}(e.routerState,l[t-1]||e.routerState.base,$r((function(){return r()[t+1]})),(function(){return e.routerState.matches()[t]}))})))},c=0,d=o.length;c0&&void 0!==arguments[0]?arguments[0]:e.get();t=!0,r[1](n(o)),t=!1}))),Zr({signal:r,create:e.create,utils:e.utils})}function no(e,t){var n=function(e){if("#"===e)return null;try{return document.querySelector(e)}catch(t){return null}}("#".concat(e));n?n.scrollIntoView():t&&window.scrollTo(0,0)}var ro=new Map;function oo(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"/_server";return function(r){var o=r.base.path(),i=r.navigatorFactory(r.base),a={};function s(e){if(!(e.defaultPrevented||0!==e.button||e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)){var n=e.composedPath().find((function(e){return e instanceof Node&&"A"===e.nodeName.toUpperCase()}));if(n&&(!t||n.hasAttribute("link"))){var r="http://www.w3.org/2000/svg"===n.namespaceURI,i=r?n.href.baseVal:n.href;if(!(r?n.target.baseVal:n.target)&&(i||n.hasAttribute("state"))){var a=(n.getAttribute("rel")||"").split(/\s+/);if(!(n.hasAttribute("download")||a&&a.includes("external"))){var s=r?new URL(i,document.baseURI):new URL(i);if(!(s.origin!==window.location.origin||o&&s.pathname&&!s.pathname.toLowerCase().startsWith(o.toLowerCase())))return[n,s]}}}}}function l(e){var t=s(e);if(t){var n=z(t,2),o=n[0],a=n[1],l=r.parsePath(a.pathname+a.search+a.hash),u=o.getAttribute("state");e.preventDefault(),i(l,{resolve:!1,replace:o.hasAttribute("replace"),scroll:!o.hasAttribute("noscroll"),state:u&&JSON.parse(u)})}}function u(e){var t=s(e);if(t){var n=z(t,2),o=n[0],i=n[1];a[i.pathname]||r.preloadRoute(i,"false"!==o.getAttribute("preload"))}}function c(e){var t=s(e);if(t){var n=z(t,2),o=n[0],i=n[1];a[i.pathname]||(a[i.pathname]=setTimeout((function(){r.preloadRoute(i,"false"!==o.getAttribute("preload")),delete a[i.pathname]}),200))}}function d(e){var t=s(e);if(t){var n=z(t,2)[1];a[n.pathname]&&(clearTimeout(a[n.pathname]),delete a[n.pathname])}}function f(e){var t=e.submitter&&e.submitter.hasAttribute("formaction")?e.submitter.getAttribute("formaction"):e.target.getAttribute("action");if(t){if(!t.startsWith("https://action/")){var o=new URL(t,Br);if(!(t=r.parsePath(o.pathname+o.search)).startsWith(n))return}if("POST"!==e.target.method.toUpperCase())throw new Error("Only POST forms are supported for Actions");var i=ro.get(t);if(i){e.preventDefault();var a=new FormData(e.target);e.submitter&&e.submitter.name&&a.append(e.submitter.name,e.submitter.value),i.call({r:r,f:e.target},a)}}}!function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.document,n=t[Sr]||(t[Sr]=new Set),r=0,o=e.length;r=0?t.slice(i+1):"",r),_r()},init:function(e){return r=window,o="hashchange",i=function(e,t){var n=!1;return function(){var r=Cr;_r();var o=null==r?null:Cr-r;n?n=!1:o&&t(o)?(n=!0,window.history.go(-o)):e()}}(e,(function(e){return!n.confirm(e&&e<0?e:t())})),r.addEventListener(o,i),function(){return r.removeEventListener(o,i)};var r,o,i},create:oo(e.preload,e.explicitLinks,e.actionBase),utils:{go:function(e){return window.history.go(e)},renderPath:function(e){return"#".concat(e)},parsePath:io,beforeLeave:n}})(e)}var so=De;function lo(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ue(),o=0;return function(){return o++,De((function(){o--,queueMicrotask((function(){!o&&n&&(n(),n=t=void 0)}))})),n||Re((function(r){return t=e(n=r)}),r),t}}var uo=lo((function(){var e,t,n,r,o=z(Ie(null),2),i=o[0],a=o[1];return e=window,t="keydown",n=function(e){a(e),setTimeout((function(){return a(null)}))},e.addEventListener(t,n,r),so(e.removeEventListener.bind(e,t,n,r)),i}));function co(e){return"function"==typeof e}var fo,ho={ArrowLeft:"Left",ArrowRight:"Right",ArrowUp:"Up",ArrowDown:"Down",Enter:"Enter",l:"Last"," ":"Space",Backspace:"Back",Escape:"Escape"},po=z(Ie([]),2),vo=po[0],go=po[1],yo=function(e){var t=uo();if(e)for(var n=function(){var e,t=z(o[r],2),n=t[0],i=t[1];e=i,Array.isArray(e)?i.forEach((function(e){ho[e]=n})):ho[i]=n},r=0,o=Object.entries(e);r2&&void 0!==arguments[2]?arguments[2]:[],r=e,o=[];r;)r.states.has("focus")||(r.states.add("focus"),co(r.onFocus)&&r.onFocus.call(r,e,t)),o.push(r),r=r.parent;return n.forEach((function(n){o.includes(n)||(n.states.remove("focus"),co(n.onBlur)&&n.onBlur.call(n,e,t))})),go(o),o}),{defer:!0})),Ne((function(){var e=t();if(e){var n=ho[e.key]||ho[e.keyCode];ze((function(){var t,r=void 0,o=P(vo());try{for(o.s();!(t=o.n()).done;){var i=t.value;if(r=r||i,n){var a=i["on".concat(n)];if(co(a)&&!0===a.call(i,e,i,r))break}else console.log("Unhandled key event: ".concat(e.key));if(co(i.onKeyPress)&&!0===i.onKeyPress.call(i,e,n,i,r))break}}catch(s){o.e(s)}finally{o.f()}return!1}))}})),vo};function mo(e,t){var n,r,o,i,a=t();if(Array.isArray(a))if(2===a.length)n=i=a[0],r=o=a[1];else if(3===a.length)n=a[0],r=o=a[1],i=a[2];else{var s=z(a,4);n=s[0],o=s[1],i=s[2],r=s[3]}else n=o=i=r=a;e.onBeforeLayout=function(t,a){if(a){e.width=e.children.reduce((function(e,t){return e+(t.width||0)}),0)+r+o;var s=e.children[0];s&&(s.x=r,s.marginLeft=r);var l=0;e.children.forEach((function(e){e.y=n,e.marginTop=n,l=Math.max(l,e.height||0)})),e.height=l+n+i}}}function xo(e){return new Promise((function(t){setTimeout(t,e)}))}function bo(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"en-US",r=window.speechSynthesis;return new Promise((function(o,i){var a=new SpeechSynthesisUtterance(e);a.lang=n,a.onend=function(){o()},a.onerror=function(e){i(e)},t.push(a),r.speak(a)}))}function wo(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=window.speechSynthesis,o=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=[];for(e=0;e0)){e.next=46;break}return e.prev=20,e.next=23,bo(n,a,t);case 23:u=0,e.next=44;break;case 26:if(e.prev=26,e.t0=e.catch(20),!(e.t0 instanceof SpeechSynthesisErrorEvent)){e.next=43;break}if("network"!==e.t0.error){e.next=36;break}return u--,console.warn("Speech synthesis network error. Retries left: ".concat(u)),e.next=34,xo(500*(l-u));case 34:e.next=41;break;case 36:if("canceled"!==e.t0.error&&"interrupted"!==e.t0.error){e.next=40;break}u=0,e.next=41;break;case 40:throw new Error("SpeechSynthesisErrorEvent: ".concat(e.t0.error));case 41:e.next=44;break;case 43:throw e.t0;case 44:e.next=19;break;case 46:e.next=60;break;case 48:if("function"!=typeof n){e.next=55;break}return c=wo(n(),t,!1),i.push(c),e.next=53,c.series;case 53:e.next=60;break;case 55:if(!Array.isArray(n)){e.next=60;break}return d=wo(n,t,!1),i.push(d),e.next=60,d.series;case 60:e.next=1;break;case 62:return e.prev=62,s=!1,e.finish(62);case 65:case"end":return e.stop()}}),e,null,[[0,,62,65],[20,26]])})))(),get active(){return s},append:function(e){o.push(e)},cancel:function(){s&&(n&&r.cancel(),i.forEach((function(e){e.cancel()})),s=!1)}}}function ko(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en-US";return fo&&fo.cancel(),fo=wo(e,t)}var So,Ao,Co=function(e,t){var n,r=function(){return clearTimeout(n)};Ue()&&De(r);return Object.assign((function(){for(var o=arguments.length,i=new Array(o),a=0;a0&&void 0!==arguments[0]?arguments[0]:[];if(Eo.onFocusChange&&Eo.enabled){var t=e.every((function(e){return!e.loading})),n=e.filter((function(e){return!To.includes(e)}));if(So(),t||!Eo.onFocusChange){To=e.slice(0);var r=[],o=n.reduce((function(e,t){return t.announce?(e.push([Io(t),"Announce",t.announce]),r.push(t.announce)):t.title?(e.push([Io(t),"Title",t.title]),r.push(t.title)):e.push([Io(t),"No Announce",""]),e}),[]);return n.reverse().reduce((function(e,t){return t.announceContext?(e.push([Io(t),"Context",t.announceContext]),r.push(t.announceContext)):e.push([Io(t),"No Context",""]),e}),o),Eo.debug&&console.table(o),r.length?Eo.speak(r.reduce((function(e,t){return e.concat(t)}),[])):void 0}Eo.onFocusChange([])}}var Eo={debug:!1,enabled:!0,cancel:function(){Ao&&Ao.cancel()},clearPrevFocus:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;To=To.slice(0,e),So()},speak:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.append,o=void 0!==r&&r,i=n.notification,a=void 0!==i&&i;Eo.onFocusChange&&Eo.enabled&&(Eo.onFocusChange.flush(),o&&Ao&&Ao.active?Ao.append(e):(Eo.cancel(),function(e){if(!_o)Ao=ko(e)}(e)),a&&(_o=!0,null===(t=Ao)||void 0===t||t.series.finally((function(){_o=!1,Eo.refresh()})).catch(console.error)));return Ao},refresh:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;Eo.clearPrevFocus(e),Eo.onFocusChange&&Eo.onFocusChange(ze((function(){return vo()})))},setupTimers:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.focusDebounce,n=void 0===t?400:t,r=e.focusChangeTimeout,o=void 0===r?3e5:r;Eo.onFocusChange=Ro(Bo,n),So=Ro((function(){To=[]}),o)}};var No,Fo,Lo,Mo,zo,Po,Oo,Do,Uo,Wo,jo,Yo,Ho,Qo,Ko,Xo,Go=z(Ie(""),2),Vo=Go[0],Zo=Go[1],qo={name:"Base Lightning TV",alpha:{primary:1,secondary:.7,tertiary:.1,inactive:.5,full:1,none:0,alpha1:.1,alpha2:.3,alpha3:.5,alpha4:.7,alpha5:.9},animation:{duration:{none:0,xfast:.1,fast:.25,normal:.5,slow:.75,xslow:.9},delay:{none:0,xfast:.01,fast:.025,normal:.05,slow:.075,xslow:.09},expressive:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},expressiveEntrance:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},expressiveExit:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},standard:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},standardEntrance:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},standardExit:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},utility:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},utilityEntrance:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25},utilityExit:{timingFunction:"cubic-bezier(0, 0, 1, 1)",delay:0,duration:.25}},asset:{arrowLeft:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAi0lEQVRIDWNgGAWjIfD//38JID5Fk5AAGqwKxPeA+D/VLQCaaQLEr0CGgwBVLQCa5wbEn0EGwwDVLAAaGA3Ev2AGw2iqWAA0rBiI/8EMRaYptgBoWDeygehsci1gIlcjWfqArqZdEMFcBLSEdpGMZAntkimSJbTLaEiW0K6oQLKEdoUdzJJRemiHAAD4n+yzPWCs7QAAAABJRU5ErkJggg==",arrowRight:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAg0lEQVRIDWNgGAWjIYArBP7//38KiCVwyVMsDjQcBO4BsSrFhmEzAGw8hHgFpEywqaFIDMkCEPMzELtRZCC6ZjQLQNxfQByNro5sPhYLQEL/gLiYbEORNeKwACbcDVPLBGMMOhrmVDSapkFE00imaTKlaUajaVFB28Ju0CXrUQfhDAEAEgHss6NhpLQAAAAASUVORK5CYII=",backspaceOutline:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4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D8roJgF0t+qkx6jorgApElwE4aQwxZp6n3YNxsPyzA7yst/4iSdvEMFqaHUCjKZEZ91IgAeolWzotFEiAkoWQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC",check:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAOCAYAAAAi2ky3AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACtSURBVHgBvdPdDcIgEAfwoy8Nb45QN3AGF2s36Ahu4gpuIDoBfSgfpdoTlCbEWEMh6T8hFzjyg5AAkBHOcQe5UWqspRx435sDpMYj6IYQwwVSEiJ2MKVUBWuzLSLl2HL+uxmNCGFO8yaL7RHxve6qRZoAuS4hxac8735elWVx7jrtMKL1o0Gcat9jhExHSukN/kUIFZ7MpDRtzE1isDRkAUtDvrA8ZI597FUf8gWH9P0b4gko9wAAAABJRU5ErkJggg=="},color:{palette:{"blue-20":"0xbecffeff","blue-40":"0x93a9fdff","blue-90":"0x000033ff","grey-05":"0xf8f7faff","grey-40":"0x929096ff","grey-70":"0x48474bff","grey-90":"0x181819ff"},white:"0xffffffff",black:"0x000000ff",grey:"0x929096ff",red:"0xe74c3cff",orange:"0xdc7633ff",yellow:"0xf7dc6fff",green:"0x2ecc71ff",blue:"0x93a9fdff",purple:"0x663399ff",material:"0x181819ff",materialBrand:"0x000033ff",overlay:"0x181819b3",textNeutral:"0xf8f7faff",textNeutralSecondary:"0xf8f7fab3",textNeutralTertiary:"0xf8f7fa1a",textNeutralDisabled:"0xf8f7fa80",textInverse:"0x181819ff",textInverseSecondary:"0x181819b3",textInverseTertiary:"0x1818191a",textInverseDisabled:"0x18181980",textBrand:"0x93a9fdff",textBrandSecondary:"0x93a9fdb3",textBrandTertiary:"0x93a9fd1a",textBrandDisabled:"0x93a9fd80",textPositive:"0x2ecc71ff",textNegative:"0xe74c3cff",textInfo:"0x93a9fdff",textCaution:"0xdc7633ff",fillTransparent:"0xffffff0",fillNeutral:"0xf8f7faff",fillNeutralSecondary:"0xf8f7fab3",fillNeutralTertiary:"0xf8f7fa1a",fillNeutralDisabled:"0xf8f7fa80",fillInverse:"0x181819ff",fillInverseSecondary:"0x181819b3",fillInverseTertiary:"0x1818191a",fillInverseDisabled:"0x18181980",fillBrand:"0x93a9fdff",fillBrandSecondary:"0x93a9fdb3",fillBrandTertiary:"0x93a9fd1a",fillBrandDisabled:"0x93a9fd80",fillPositive:"0x2ecc71ff",fillNegative:"0xe74c3cff",fillInfo:"0x93a9fdff",fillCaution:"0xdc7633ff",strokeNeutral:"0xf8f7faff",strokeNeutralSecondary:"0xf8f7fab3",strokeNeutralTertiary:"0xf8f7fa1a",strokeNeutralDisabled:"0xf8f7fa80",strokeInverse:"0x181819ff",strokeInverseSecondary:"0x181819b3",strokeInverseTertiary:"0x1818191a",strokeInverseDisabled:"0x18181980",strokeBrand:"0x93a9fdff",strokeBrandSecondary:"0x93a9fdb3",strokeBrandTertiary:"0x93a9fd1a",strokeBrandDisabled:"0x93a9fd80",strokePositive:"0x2ecc71ff",strokeNegative:"0xe74c3cff",strokeInfo:"0x93a9fdff",strokeCaution:"0xdc7633ff",interactiveNeutral:"0xffffff1a",interactiveNeutralFocus:"0xffffffff",interactiveNeutralFocusSoft:"0xffffff1a",interactiveInverse:"0x48474b1a",interactiveInverseFocus:"0x48474bff",interactiveInverseFocusSoft:"0x48474b1a",interactiveBrand:"0xbecffe1a",interactiveBrandFocus:"0xbecffeff",interactiveBrandFocusSoft:"0xbecffe1a",shadowNeutral:"0x000000b3",shadowNeutralFocus:"0x000000b3",shadowNeutralFocusSoft:"0x000000b3",shadowNeutralText:"0x000000ff",shadowInverse:"0x000000b3",shadowInverseFocus:"0x000000b3",shadowInverseFocusSoft:"0x000000b3",shadowInverseText:"0x000000ff",shadowBrand:"0x000000b3",shadowBrandFocus:"0x000000b3",shadowBrandFocusSoft:"0x000000b3",shadowBrandText:"0x000000ff"},font:[],layout:{columnCount:10,focusScale:1.2,gutterX:20,gutterY:20,marginX:150,marginY:150,safe:50,screenW:1920,screenH:1080},radius:{none:0,xs:2,sm:4,md:8,lg:16,xl:24},spacer:{none:0,xxs:2,xs:4,sm:8,md:10,lg:20,xl:30,xxl:40,xxxl:50},stroke:{none:0,sm:2,md:4,lg:6,xl:8},typography:{display1:{fontFamily:"Arial",fontSize:75,lineHeight:85,fontWeight:500,verticalAlign:"middle",textBaseline:"bottom"},display2:{fontFamily:"Arial",fontSize:50,lineHeight:60,fontWeight:500,verticalAlign:"middle",textBaseline:"bottom"},headline1:{fontFamily:"Arial",fontSize:35,fontWeight:500,lineHeight:48,verticalAlign:"middle",textBaseline:"bottom"},headline2:{fontFamily:"Arial",fontSize:30,fontWeight:500,lineHeight:40,verticalAlign:"middle",textBaseline:"bottom"},headline3:{fontFamily:"Arial",fontSize:25,fontWeight:500,lineHeight:36,verticalAlign:"middle",textBaseline:"bottom"},body1:{fontFamily:"Arial",fontSize:25,fontWeight:300,lineHeight:40,verticalAlign:"middle",textBaseline:"bottom"},body2:{fontFamily:"Arial",fontSize:22,fontWeight:300,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},body3:{fontFamily:"Arial",fontSize:20,fontWeight:300,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},button1:{fontFamily:"Arial",fontSize:25,fontWeight:500,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},button2:{fontFamily:"Arial",fontSize:20,fontWeight:500,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},callout1:{fontFamily:"Arial",fontSize:20,fontWeight:500,lineHeight:32,verticalAlign:"middle",textBaseline:"bottom"},caption1:{fontFamily:"Arial",fontSize:15,fontWeight:500,lineHeight:24,verticalAlign:"middle",textBaseline:"bottom"},tag1:{fontFamily:"Arial",fontSize:20,fontWeight:500,lineHeight:24,verticalAlign:"middle",textBaseline:"bottom"},footnote1:{fontFamily:"Arial",fontSize:22,fontWeight:300,lineHeight:30,verticalAlign:"middle",textBaseline:"bottom"}},componentConfig:{Keyboard:{base:{keyProps:{delete:{title:null,icon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGohMqUBAAQZ80zUVQAKUEIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypfPsAJJ0NYC92XRHKPB3AAfLv18BuBLAFSR/NKZWswJI0vkA3jCmILsw75sAvIfkR8eo22wAknQSgMvGEGFD8vwxgFeQvGrI+s4CIEnHAPgugHsMWfkNzevDAM4i+Z8h6t88QJLuXOB5yBAVzjxuVeBaAM8ieXNUjzkAdAmA50Yrmv5HKPATACeQ/GNEm6YBkvRyANblZhpHAXsfekpkOGsWIEmPAHA9gDuOo13mWhS4gOSZfdVoEiBJ9wFwA4D7961Y+lUpsK/v7KxVgL4K4ElOCS4l+Uyn7a41k3Q0gMcC2ANgH4CHV1T2OyStx69OzQEk6TwAZztr8lMAx5P8s9N+Y8wk2cTjfQDu66z080h+zml7yKwpgCSdCOByZyX+BuBRJH/otN84M0kWN/s0gOc4Kv8Nko922B1m0gxAkh4I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dYSZNAVQg8rzsLSphl/Hapby2LDZTUaBcq/56ALb1fOVxLkuinULy4loRmwOoQGQX7T7DWZnPk3y203bXmkl6AIA91isDOBGADV3e1HsJbasA1QYZvUKl3fYKPI2knXFQnZoEqPRCNUHG6oqnwyEFLiJ5Wl89mgWoQFQTZOyrwSb7WUztcSRtu0+v1DRABaKPADijV+3SaZUCNgE5geTNEZnmAFBtkDGix6b4Xld2BNvJcaHUPEClF6oNMoZE2eXOtm3q1ZFha1mfWQBUINoL4Kqurbm7vPEj1bOAqx3udW0kk62+swGoQHQ2gPOGFGAD8roJgF0t+qkx6jorgApElwE4aQwxZp6n3YNxsPyzA7yst/4iSdvEMFqaHUCjKZEZ91IgAeolWzotFEiAkoWQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC"}}}}}};function Jo(){var e,t,n=0,r={duration:750,easing:"ease-in-out"},o={alpha:1,color:4294967295};var i=Co((function(o){return o.startsWith("#")?(e.color=o,e.src="",e.alpha=1,n=1,void(t.alpha=0)):(e.color=4294967295,0===n?(e.src=o,void(n=1)):1===n?(t.src=o,n=2,t.alpha=0,t.animate({alpha:1},r).start(),void e.animate({alpha:0},r).start()):void(2===n&&(e.src=o,n=1,e.alpha=0,e.animate({alpha:1},r).start(),t.animate({alpha:0},r).start())))}),400);return Ne(Pe(Vo,(function(e){i(e)}),{defer:!0})),vr(ur,{width:1920,height:1080,zIndex:-5,get children(){return[vr(ur,{ref:function(t){"function"==typeof e?e(t):e=t},style:o}),vr(ur,{ref:function(e){"function"==typeof t?t(e):t=e},style:o,alpha:0}),vr(ur,{src:"./assets/hero-mask-inverted.png",get color(){return kr(qo.color.materialBrand)},width:1920,height:1080})]}})}var $o=["focus","disabled"],ei=["brand","inverse","neutral"];function ti(e){var t=e.themeKeys,n=e.base,r=e.modes,o=e.tones,i=e.themeStyles,a=e.modeKeys,s=void 0===a?$o:a,l=e.toneKeys,u=void 0===l?ei:l,c=arguments.length>1&&void 0!==arguments[1]&&arguments[1],d=function(e){return Object.fromEntries(Object.entries(t).filter((function(t){var n=z(t,2),r=(n[0],n[1]);return e[r]})).map((function(t){var n=z(t,2),r=n[0],o=n[1];return[r,e[o]]})))};return function(e,t,n){var r,o=(r=i,Object.fromEntries(Object.entries(r).map((function(e){var t=z(e,2),n=t[0],r=t[1],o=d(r);return Object.entries(r).filter((function(e){var t=z(e,2),n=t[0];return t[1],s.includes(n)})).forEach((function(e){var t=z(e,2),n=t[0],r=t[1];o[n]=d(r)})),[n,o]}))));c&&console.log(o);var a=function(e,t){return F(F({},e),t.base)}(e,o);c&&console.log(a);var l=function(e,t){var n=s.map((function(n){return[n,F(F({},null==e?void 0:e[n]),null==t?void 0:t[n])]}));return Object.fromEntries(n)}(t,o);c&&console.log(l);var f=function(e,t,n){var r=u.map((function(r){var o,i,a={};return new Set([].concat.apply([],[null!==(o=null==e?void 0:e[r])&&void 0!==o?o:{},null!==(i=null==t?void 0:t[r])&&void 0!==i?i:{}].map(Object.keys))).forEach((function(n){var o,i,l;s.includes(n)||(a[n]=null!==(l=null==(o=null==t?void 0:t[r])?void 0:o[n])&&void 0!==l?l:null==(i=null==e?void 0:e[r])?void 0:i[n])})),s.forEach((function(o){var i,s;a[o]=F(F(F({},n[o]),null==(i=null==e?void 0:e[r])?void 0:i[o]),null==(s=null==t?void 0:t[r])?void 0:s[o])})),[r,a]}));return Object.fromEntries(r)}(n,o,l);return c&&console.log(f),{base:F(F({},a),l),tones:f}}(n,r,o)}function ni(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return function(t,n,r,o){if(0!==t.children.length){var i=t.gap||0,a=t.scroll||"auto",s=function(e){var t,n;"row"===e.flexDirection?(t={position:e.children[e.children.length-1].x,size:e.children[e.children.length-1].width},n=e.width):(t={position:e.children[e.children.length-1].y,size:e.children[e.children.length-1].height},n=e.height);return[t,n]}(t),l=z(s,2),u=l[0],c=l[1],d="row"===t.flexDirection?t.x:t.y,f="row"===t.flexDirection?n.x:n.y,h="row"===t.flexDirection?n.width:n.height,p=r>o?"positive":"negative",v=d;"auto"===a?null!=t.scrollIndex&&t.scrollIndex>=0?t.selected>=t.scrollIndex&&(v="positive"===p?d-h-i:d+h+i):(Math.abs(d)+cf?v=-f+e:"edge"===a&&"positive"===p&&Math.abs(d)+c=r){if(!o){this.selected=void 0;break}this.selected=0}}while(null==(t=this.children[this.selected])?void 0:t.skipFocus)}else if("left"===e||"up"===e)do{if(this.selected=(this.selected||0)%r-1,this.selected<0){if(!o){this.selected=void 0;break}this.selected=r-1}}while(null==(n=this.children[this.selected])?void 0:n.skipFocus);if(void 0===this.selected&&(this.selected=i,this.children[this.selected].states.has("focus")))return!1;var a=this.children[this.selected];if(this.onSelectedChanged&&this.onSelectedChanged.call(this,this,a,this.selected,i),this.plinko&&void 0!==i){var s=this.children[i].selected||0;a.selected=s5&&function(e){e&&(Ga(e),es((function(t){return Math.min(e,t)})),rs((function(t){return Math.max(e,t)})),is+=e,os++,qa(Math.round(is/os)),as())}(n)}))}var ls=function(e){return vr(ur,br(e,{style:Ya,get children(){return[vr(ur,{get children(){return[vr(lr,{style:Ha,children:"FPS:"}),vr(lr,{style:Qa,x:94,get children(){return Xa().toString()}})]}}),vr(ur,{x:160,get children(){return[vr(lr,{style:Ha,children:"AVG:"}),vr(lr,{style:Qa,x:104,get children(){return Za().toString()}})]}}),vr(ur,{x:0,y:40,get children(){return[vr(lr,{style:Ha,children:"MIN:"}),vr(lr,{style:Qa,x:94,get children(){return $a().toString()}})]}}),vr(ur,{x:160,y:40,get children(){return[vr(lr,{style:Ha,children:"MAX:"}),vr(lr,{style:Qa,x:104,get children(){return ns().toString()}})]}})]}}))},us=function(e){yo({Announcer:"a",Menu:"m",Escape:"Escape"});var t=(Eo.setupTimers(),Ne(Pe(vo,Eo.onFocusChange,{defer:!0})),Eo);t.enabled=!1;var n,r,o=jr();return Oe((function(){ss({renderer:Wn})})),vr(ur,{onAnnouncer:function(){return t.enabled=!t.enabled},onLast:function(){return history.back()},onMenu:function(){return o("/")},style:{width:1920,height:1080},onLeft:function(){if(n.states.has("focus"))return!1;r=xt(),n.setFocus()},onRight:function(){return n.states.has("focus")&&r.setFocus()},get children(){return[vr(Jo,{}),vr(ls,{}),pr((function(){return e.children})),vr(ja,{ref:function(e){"function"==typeof n?n(e):n=e}})]}})},cs={Page:{width:1920,height:1080},headlineText:{width:1200,height:240,x:360,y:455,contain:"both",fontSize:66,textAlign:"center"},headlineSubText:{width:960,height:170,x:530,y:655,contain:"both",fontSize:48,textAlign:"center"},itemsContainer:{width:qo.layout.screenW,height:600,y:560,x:0,zIndex:2},Thumbnail:{borderRadius:16,width:185,height:278,scale:1,zIndex:2,transition:{scale:{duration:250,easing:"ease-in-out"}},border:{width:0,color:0},focus:{scale:1.1,border:{color:4294967142,width:8}}},FocusRing:{borderRadius:16,width:194,height:286,y:-5,x:-5,zIndex:-1},FPS:{color:255,height:42,width:140,x:20,y:20,zIndex:100},FPSLabel:{x:10,y:0,fontSize:36,textColor:kr("#ffffff")},FPSValue:{x:90,y:0,fontSize:36,textColor:kr("#ffffff")},showHeadline:{x:70,y:20},headlineBlur:{width:1920,height:150,x:0,y:0,zIndex:14,alpha:.9,color:kr("#000000")},RowTitle:{height:60,width:300,marginTop:20,fontSize:36,color:kr("#f0f0f0"),zIndex:2},Row:{display:"flex",justifyContent:"spaceBetween",height:300},Column:{display:"flex",flexDirection:"column",justifyContent:"flexStart",gap:20,width:qo.layout.screenW-2*qo.layout.marginX,x:qo.layout.marginX+qo.layout.gutterX,y:48,transition:{y:{duration:250,easing:"ease-in-out"}},zIndex:2},Rect:{width:250,height:100,y:10,x:300,color:kr("#0000ff")},peopleBio:F(F({},qo.typography.body1),{},{contain:"both",width:1500,height:400})},ds={width:120,height:40,color:kr("#000000"),borderRadius:8,border:{width:2,color:kr("#3333ff")},scale:1,focus:{scale:1.1,border:{width:5,color:kr("#333333")}},transition:{scale:!0,color:!0}},fs={container:ds,topBar:{color:kr("#00A699"),height:8,y:2,x:-4,width:ds.width+8},text:{fontSize:12,y:12,contain:"width",textAlign:"center",color:kr("#F6F6F9"),height:ds.height,width:ds.width}},hs=386,ps=136,vs=(kr("#715cab"),kr("#5a39a2"),kr("#291d43"),{fontSize:32,contain:"width",textAlign:"center",mountY:-.35,color:kr("#FFFFFF"),height:ps,width:hs,focus:{fontSize:40},disabled:{color:kr("#909090")}});function gs(e){return vr(ur,br(e,{get style(){return cs.Thumbnail}}))}function ys(e){var t=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?n.flat():n[0]),i=n.map((function(t){return new Proxy({get:function(n){return t.includes(n)?e[n]:void 0},has:function(n){return t.includes(n)&&n in e},keys:function(){return t.filter((function(t){return t in e}))}},dt)}));return i.push(new Proxy({get:function(t){return o.has(t)?void 0:e[t]},has:function(t){return!o.has(t)&&t in e},keys:function(){return Object.keys(e).filter((function(e){return!o.has(e)}))}},dt)),i}var a,s={},l=n.map((function(){return{}})),u=P(Object.getOwnPropertyNames(e));try{for(u.s();!(a=u.n()).done;){var c,d=a.value,f=Object.getOwnPropertyDescriptor(e,d),h=!f.get&&!f.set&&f.enumerable&&f.writable&&f.configurable,p=!1,v=0,g=P(n);try{for(g.s();!(c=g.n()).done;)c.value.includes(d)&&(p=!0,h?l[v][d]=f.value:Object.defineProperty(l[v],d,f)),++v}catch(y){g.e(y)}finally{g.f()}p||(h?s[d]=f.value:Object.defineProperty(s,d,f))}}catch(y){u.e(y)}finally{u.f()}return[].concat(E(l),[s])}(e,["items"]),n=z(t,2),r=n[0],o=n[1];return vr(va,br(o,{get style(){return cs.Row},get children(){return vr(gt,{get each(){return r.items},children:function(e){return vr(gs,e)}})}}))}function ms(e){return vr(ur,br(e,{forwardStates:!0,get style(){return fs.container},get children(){return vr(lr,{get style(){return fs.text},get children(){return e.children}})}}))}var xs,bs,ws="https://api.themoviedb.org/3",ks="w185",Ss={headers:{"Content-Type":"application/json",Authorization:"Bearer eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyZDE4YjEwMTA0YjdiZTlkNjFiMWYwYjVlMGEwNzM2OCIsInN1YiI6IjYwZTVjMTdlNGNhNjc2MDA3NTA4Njc3MSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.D_nqH9kd-bhhWzeVsTDPYhHnsUaNAuyAa6YATmKHqsA"}};function As(e){return bs+(arguments.length>1&&void 0!==arguments[1]?arguments[1]:ks)+e}function Cs(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return fetch(ws+e,F(F({},Ss),t)).then((function(e){return e.json()}))}function Ts(){return Cs("/configuration").then((function(e){var t;return xs=e,bs=null===(t=e.images)||void 0===t?void 0:t.secure_base_url,e}))}var _s={get:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return xs?Cs(e,t):Ts().then((function(){return Cs(e,t)}))},loadConfig:Ts};function Rs(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map((function(e){return{src:As(e.poster_path||e.profile_path),tileSrc:As(e.backdrop_path||e.profile_path,"w300"),backdrop:As(e.backdrop_path,"w1280"),href:"/entity/".concat(e.media_type||"people","/").concat(e.id),shortTitle:(t=e.title||e.name,n=30,t.length>n?t.substring(0,n-3)+"...":t),title:e.title||e.name,data:e,entityInfo:{type:e.media_type||"people",id:e.id},heroContent:{title:e.title||e.name,description:e.overview}};var t,n}))}var Is=new Map,Bs=new Map;function Es(e){var t=z(Ie([]),2),n=t[0],r=t[1],o=z(Ie(1),2),i=o[0],a=o[1],s=z(Ie(!1),2),l=s[0],u=s[1],c=z(Le(i,e),1)[0];return Be((function(){var e=c();e&&qe((function(){0===e.length&&u(!0),r((function(t){return[].concat(E(t),E(e))}))}),!1)})),{pages:n,page:i,setPage:a,setPages:r,end:l,setEnd:u}}var Ns=1100,Fs=F(F({},qo.typography.display2),{},{width:Ns,height:58,contain:"both"}),Ls=function(e){return vr(lr,br(e,{style:Fs,get children(){return e.children}}))},Ms=F(F({},qo.typography.body1),{},{width:Ns,height:72,contain:"both"}),zs={fontSize:20,lineHeight:20},Ps=function(e){return vr(lr,br(e,{style:Ms,get children(){return e.children}}))};var Os=function(e){return t=gr("node"),wr(mo,t,(function(){return[8,15,13,15]})),mr(t,br(e,{style:{color:"0x00000099",borderRadius:8,border:{width:3,color:"0xffffffff"}}}),!0),yr(t,vr(lr,{style:zs,get children(){return e.children}})),t;var t},Ds=qo.typography.body2,Us=function(e){return vr(ur,{style:{display:"flex",flexDirection:"row",gap:12,width:Ns,height:48},get children(){return[vr(lr,{style:Ds,get children(){return e.metaText}}),vr(gt,{get each(){return e.badges},children:function(e){return vr(Os,{y:-5,children:e})}}),pr((function(){return t=e.reviews,[vr(yt,{get when(){return(null==t?void 0:t.rtCrit)&&"0"!==(null==t?void 0:t.rtCrit)},get children(){return[vr(ur,{src:"https://upload.wikimedia.org/wikipedia/commons/b/b6/Tomato-Torrent-Icon.png",title:"Rotten Tomatoes Rating",style:{width:30,height:30,marginRight:-6}}),vr(lr,{style:Ds,get children(){return t.rtCrit+"%"}})]}}),vr(yt,{get when(){return(null==t?void 0:t.rtFan)&&"0"!==(null==t?void 0:t.rtFan)},get children(){return[vr(ur,{src:"https://upload.wikimedia.org/wikipedia/commons/thumb/d/da/Rotten_Tomatoes_positive_audience.svg/80px-Rotten_Tomatoes_positive_audience.svg.png",title:"Rotten Tomatoes Rating",style:{width:24,height:30,marginRight:-6}}),vr(lr,{style:Ds,get children(){return t.rtFan+"%"}})]}})];var t}))]}})},Ws=function(e){return vr(ur,br(e,{style:{display:"flex",flexDirection:"column",width:Ns,height:160,gap:16},get children(){return[vr(Ls,{get children(){return e.title}}),vr(Ps,{get children(){return e.description}}),vr(Us,{get metaText(){return e.metaText},get badges(){return e.badges},get reviews(){return e.reviews}})]}}))};function js(e){return e.split("-")[0]}function Ys(e){var t=e.type,n=e.id;return _s.get("/".concat(t,"/").concat(n,"/recommendations")).then((function(e){var n=e.results;return n.length?Rs(n.slice(0,7)):_s.get("/trending/".concat(t,"/week?page=1")).then((function(e){return Rs(e.results.slice(0,7))}))}))}function Hs(e){var t=e.type,n=e.id;return _s.get("/".concat(t,"/").concat(n,"/credits")).then((function(e){return Rs(e.cast.slice(0,7))}))}function Qs(e){var t=e.type,n=e.id,r="movie"===t?{rtCrit:86,rtFan:92}:{};return _s.get("/".concat(t,"/").concat(n)).then((function(e){return F({backgroundImage:As(e.backdrop_path,"original"),heroContent:{title:e.title||e.name,description:e.overview,badges:["HD"],metaText:"movie"===t?(n=e.runtime,o=n%60,Math.floor(n/60)+"h "+(o<10?"0":"")+o+"m - "+e.release_date):"".concat(js(e.first_air_date)," - ").concat(js(e.last_air_date)),reviews:r}},e);var n,o}))}var Ks=function(){var e=Yr(),t=z(Ie(0),2),n=t[0],r=t[1],o=z(Ie(),2),i=o[0];o[1];Le(i,Qs);var a=z(Ie({}),2),s=a[0],l=a[1],u=jr(),c=Me((function(){return 0})),d=Fe((function(){return Es((t=e.filter||"all",function(e){var n="/trending/".concat(t,"/week?page=").concat(e);if(Is.has(n))return Is.get(n);var r=_s.get(n).then((function(e){var n=e.results.filter((function(e){return!e.adult})),r=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:7,n=[],r=0,o=e.length;r=t-2)&&d().setPage((function(e){return e+1}))}function h(){var e=this.children.selected;_(e&&e.href),u(e.href)}return Ne(Pe(xt,(function(e){e.backdrop&&Zo(e.backdrop),e.heroContent&&l(e.heroContent)}),{defer:!0})),vr(yt,{get when(){return d().pages().length},get children(){return[vr(Ws,br({y:360,x:150},s)),vr(ur,{clipping:!0,get style(){return cs.itemsContainer},get children(){return vr(zi,{plinko:!0,announce:"All Trending - Week",get y(){return n()},get style(){return cs.Column},get children(){return vr(gt,{get each(){return d().pages()},children:function(e,t){return vr(ys,{get autofocus(){return c(t())},items:e,onFocus:f,onEnter:h})}})}})}})]}})},Xs=function(){var e=jr(),t=Me((function(){return 0}));function n(){var t=this.children.selected;_(t&&t.id),e("/"+t.id)}var r=[{title:"Flex Row",id:"flex",description:"Flex Row Implementation"},{title:"Flex Column",id:"flexcolumn",description:"Flex Column Implementation"},{title:"Flex Row Vertical Align",id:"flexsize",description:"Flex Row Vertical Align Implementation"},{title:"Flex Column Vertical Align",id:"flexcolumnsize",description:"Flex Column Vertical Align Implementation"},{title:"Buttons",id:"buttons",description:"Demo a few buttons"},{title:"Text",id:"text",description:"Text layout with flexbox"},{title:"Create Elements",id:"create",description:"Testing Show + children + inserting text"}];function o(e){var t=z(Ie(4294967295),2),n=t[0],r=t[1];return vr(ur,br(e,{onFocus:function(){return r(255)},onBlur:function(){return r(4294967295)},style:{width:370,height:320,borderRadius:6,scale:1,color:405488895,transition:{color:!0,scale:!0},focus:{scale:1.1,color:4294967295}},get children(){return vr(ur,{x:30,get children(){return[vr(lr,{y:30,fontSize:84,get color(){return n()},get children(){return e.index}}),vr(lr,{y:140,fontSize:42,width:340,height:42,contain:"both",get color(){return n()},get children(){return e.title}}),vr(lr,{y:200,fontSize:28,width:330,contain:"width",get color(){return n()},get children(){return e.description}})]}})}}))}var i=z(Ie(140),2),a=i[0],s=i[1];function l(e){s(-400*e.selected+140)}return vr(ur,{colorTop:1147903743,colorBottom:743406847,get children(){return[vr(ur,{x:120,get children(){return[vr(ur,{src:"/assets/solidjs.png",width:101,height:90,y:40}),vr(lr,{fontSize:90,x:110,y:40,children:"Examples"}),vr(ur,{y:140,height:1,width:1800,color:3906468351})]}}),vr(va,{onSelectedChanged:l,onEnter:n,transition:{x:{delay:20,duration:300}},get x(){return a()},y:300,width:4400,get style(){return cs.Row},justifyContent:"flexStart",gap:40,get children(){return vr(gt,{each:r,children:function(e,n){return vr(o,br({get autofocus(){return t(n())},get index(){return n()}},e))}})}})]}})},Gs=function(){var e={width:900,height:500,y:350,x:150,gap:25,display:"flex",flexDirection:"column",justifyContent:"flexStart",color:kr("00000000")},t={width:900,height:36,gap:6,display:"flex",flexDirection:"row",justifyContent:"flexStart",color:kr("00000000")},n={fontSize:42},r={width:e.width,fontSize:26,contain:"width"},o={fontSize:26};return Oe((function(){Zo("#000000")})),vr(ur,{autofocus:!0,style:e,get children(){return[vr(lr,{style:n,children:"Title of the Page"}),vr(lr,{style:r,children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer vel tempor tellus. Sed eu leo purus. Vestibulum sollicitudin eget tellus a varius. Phasellus est turpis, volutpat sed blandit sit amet, rutrum sit amet mauris. In dignissim elit orci, a sollicitudin ipsum faucibus et. Quisque vel quam rutrum, faucibus augue sed, scelerisque nunc."}),vr(ur,{style:t,get children(){return[vr(lr,{style:o,children:"Subline Text"}),vr(ur,{width:28,height:28,src:"/assets/rt-popcorn.png"}),vr(lr,{style:o,children:"More Text"})]}})]}})},Vs=function(){var e,t,n={width:900,height:500,y:50,x:150,gap:25,display:"flex",flexDirection:"column",justifyContent:"flexStart",color:kr("00000000")},r={width:900,height:36,gap:6,display:"flex",flexDirection:"row",justifyContent:"flexStart",color:kr("00000000")},o={fontSize:42},i={fontSize:26};Oe((function(){Zo("#000000"),e.animate({x:100},{duration:2e3}).start()}));var a=z(Ie(),2),s=a[0],l=a[1],u=z(Ie(),2),c=u[0];u[1];setTimeout((function(){var e;l("- Inserted -"),null===(e=t.getChildById("child1"))||void 0===e||e.animate({x:600},{duration:2e3}).start()}),2e3);var d={width:400,height:300,color:kr("#0000ff")},f={color:kr("#f54242"),focus:{color:kr("#4287f5")}};function h(e){var t=Qe((function(){return e.children}));return vr(ur,br(e,{get style(){return[f,e.style,[d]]},get children(){return[vr(ur,{id:"child1",width:100,height:100,get color(){return kr("#ff0000")},y:25,get children(){return[pr((function(){return t()})),vr(ur,{id:"subChild",x:150,width:100,height:100,get color(){return kr("#00ff00")}}),vr(lr,{get children(){return e.title}})]}}),vr(ur,{width:100,height:100,get color(){return kr("#ffff00")},y:175,get children(){return t()}})]}}))}var p={borderLeft:{width:8,color:95598118},borderTop:{width:8,color:631422246},borderRight:{width:8,color:95598118},borderBottom:{width:8,color:3316790822}},v={color:kr("#cccccc"),focus:{color:kr("#000000")}},g={color:kr("#ffffff"),focus:{color:kr("#f6f6cc")}};return vr(ur,{style:n,get children(){return[vr(lr,{style:o,children:"Title of the Page"}),vr(ur,{style:r,get children(){return[vr(lr,{get children(){return c()}}),vr(lr,{style:i,get children(){return["Sub ",pr((function(){return s()}))," Text"]}}),vr(yt,{get when(){return s()},get children(){return vr(ur,{width:28,height:28,src:"/assets/rt-popcorn.png"})}}),vr(lr,{style:i,children:"More Text"})]}}),vr(h,{autofocus:!0,ref:function(e){"function"==typeof t?t(e):t=e},style:[g,v],get children(){return vr(lr,{children:"Child Test"})}}),vr(ur,{ref:function(t){"function"==typeof e?e(t):e=t},style:p,width:100,height:100,get color(){return kr("#00ff00")},x:900,y:400,get alpha(){return t=e,console.log("Ref is available: ",t),1;var t}})]}})},Zs=function(){function e(e,t){this.states.toggle("disabled")}var t={display:"flex",justifyContent:"flexStart",width:1500,height:300,color:kr("00000000"),gap:26,y:400};function n(e){return vr(ur,br(e,{forwardStates:!0,get style(){return fs.container},get children(){return vr(lr,{get style(){return fs.text},get children(){return e.children}})}}))}var r=function(e){return t=gr("node"),wr(mo,t,(function(){return[10,15]})),mr(t,br(e,{get style(){return{color:kr("#000000be"),borderRadius:8,border:{width:2,color:kr("#ffffff")}}}}),!0),yr(t,vr(lr,{style:{fontSize:20},get children(){return e.children}})),t;var t};return[vr(va,{x:100,y:200,gap:5,style:t,get children(){return[vr(r,{children:"HD"}),vr(r,{children:"PG13"}),vr(r,{children:"NC17"}),vr(lr,{fontSize:30,children:"I like bananas"}),vr(r,{children:"DOLBY"})]}}),vr(va,{x:100,gap:40,style:t,get children(){return[vr(n,{autofocus:!0,onEnter:e,children:"TV Shows"}),vr(n,{states:{active:!0,disabled:!1},children:"Movies"}),vr(n,{states:"active",children:"Sports"}),vr(n,{states:"disabled",children:"News"})]}})]},qs=function(){var e={display:"flex",justifyContent:"flexStart",width:1600,height:110,color:kr("#4dabf5")},t={fontSize:44,marginTop:25,marginBottom:-20,skipFocus:!0};function n(e){return vr(ur,br(e,{style:{width:200,height:100,y:5,color:392801023}}))}var r=z(Ie(50),2),o=r[0],i=r[1];function a(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),i(150+-1*(this.y||0))}Oe((function(){Zo("#333333")}));var s=50;return vr(zi,{x:160,get y(){return o()},gap:30,height:850,get width(){return e.width},get style(){return cs.Column},get children(){return[vr(lr,{style:t,children:"Flex Start"}),vr(va,{gap:s,style:e,onFocus:a,get children(){return[vr(n,{autofocus:!0}),vr(n,{}),vr(n,{}),vr(n,{}),vr(n,{})]}}),vr(lr,{style:t,children:"Flex Start - Margin Left"}),vr(va,{gap:s,style:e,onFocus:a,get children(){return[vr(n,{marginLeft:100}),vr(n,{}),vr(n,{marginLeft:100}),vr(n,{}),vr(n,{})]}}),vr(lr,{style:t,children:"Flex End"}),vr(va,{gap:s,justifyContent:"flexEnd",style:e,onFocus:a,get children(){return[vr(n,{}),vr(n,{}),vr(n,{}),vr(n,{}),vr(n,{})]}}),vr(lr,{style:t,children:"Flex End - Margin Right"}),vr(va,{gap:s,justifyContent:"flexEnd",style:e,onFocus:a,get children(){return[vr(n,{}),vr(n,{marginRight:100}),vr(n,{}),vr(n,{}),vr(n,{marginRight:100})]}}),vr(lr,{style:t,children:"Center - No Margin Support"}),vr(va,{gap:s,justifyContent:"center",style:e,onFocus:a,get children(){return[vr(n,{}),vr(n,{}),vr(n,{}),vr(n,{}),vr(n,{})]}}),vr(lr,{style:t,children:"Space Between - No Margin Support"}),vr(va,{gap:s,justifyContent:"spaceBetween",style:e,onFocus:a,get children(){return[vr(n,{}),vr(n,{}),vr(n,{}),vr(n,{}),vr(n,{})]}}),vr(lr,{style:t,children:"Space Evenly - No Margin Support"}),vr(va,{gap:s,justifyContent:"spaceEvenly",style:e,onFocus:a,get children(){return[vr(n,{}),vr(n,{}),vr(n,{}),vr(n,{}),vr(n,{})]}})]}})},Js=function(){var e={display:"flex",justifyContent:"flexStart",width:1600,height:110,color:kr("#4dabf5")},t={fontSize:44,marginTop:25,marginBottom:-20,skipFocus:!0};function n(e){return vr(ur,br(e,{style:{width:200,height:100,y:5,color:392801023}}))}function r(){return Math.floor(91*Math.random())+10}var o=z(Ie(50),2),i=o[0],a=o[1];function s(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),a(150+-1*(this.y||0))}Oe((function(){Zo("#333333")}));var l=50;return vr(zi,{x:160,get y(){return i()},gap:30,height:850,get width(){return e.width},get style(){return cs.Column},get children(){return[vr(lr,{style:t,children:"Flex Start - AlignItems: center"}),vr(va,{alignItems:"center",gap:l,style:e,onFocus:s,get children(){return[vr(n,{autofocus:!0,get height(){return r()}}),vr(n,{get height(){return r()}}),vr(n,{get height(){return r()}}),vr(n,{get height(){return r()}}),vr(n,{get height(){return r()}})]}}),vr(lr,{style:t,children:"Flex Start - Margin Left - AlignItems: flexStart"}),vr(va,{gap:l,alignItems:"flexStart",style:e,onFocus:s,get children(){return[vr(n,{marginLeft:100,get height(){return r()}}),vr(n,{get height(){return r()}}),vr(n,{marginLeft:100,get height(){return r()}}),vr(n,{get height(){return r()}}),vr(n,{get height(){return r()}})]}}),vr(lr,{style:t,children:"Flex End - AlignItems: flexEnd"}),vr(va,{gap:l,justifyContent:"flexEnd",alignItems:"flexEnd",style:e,onFocus:s,get children(){return[vr(n,{get height(){return r()}}),vr(n,{get height(){return r()}}),vr(n,{get height(){return r()}}),vr(n,{get height(){return r()}}),vr(n,{get height(){return r()}})]}}),vr(lr,{style:t,children:"Flex End - Margin Right"}),vr(va,{gap:l,justifyContent:"flexEnd",style:e,onFocus:s,get children(){return[vr(n,{get height(){return r()}}),vr(n,{marginRight:100,get height(){return r()}}),vr(n,{get height(){return r()}}),vr(n,{get height(){return r()}}),vr(n,{marginRight:100,get height(){return r()}})]}}),vr(lr,{style:t,children:"Center - No Margin Support"}),vr(va,{gap:l,justifyContent:"center",style:e,onFocus:s,get children(){return[vr(n,{get height(){return r()}}),vr(n,{get height(){return r()}}),vr(n,{get height(){return r()}}),vr(n,{get height(){return r()}}),vr(n,{get height(){return r()}})]}}),vr(lr,{style:t,children:"Space Between - No Margin Support"}),vr(va,{gap:l,justifyContent:"spaceBetween",style:e,onFocus:s,get children(){return[vr(n,{get height(){return r()}}),vr(n,{get height(){return r()}}),vr(n,{get height(){return r()}}),vr(n,{get height(){return r()}}),vr(n,{get height(){return r()}})]}}),vr(lr,{style:t,children:"Space Evenly - No Margin Support"}),vr(va,{gap:l,justifyContent:"spaceEvenly",style:e,onFocus:s,get children(){return[vr(n,{get height(){return r()}}),vr(n,{get height(){return r()}}),vr(n,{get height(){return r()}}),vr(n,{get height(){return r()}}),vr(n,{get height(){return r()}})]}})]}})},$s=function(){var e={display:"flex",justifyContent:"spaceEvenly",width:1920,y:100,height:880,color:kr("00000000")},t={display:"flex",flexDirection:"column",justifyContent:"flexStart",color:kr("#4dabf5"),height:850,width:80};function n(e){var t={width:Math.floor(61*Math.random())+10,height:80,x:5,color:kr("#1769aa")};return vr(ur,br(e,{style:t}))}var r=z(Ie(50),2),o=(r[0],r[1]);function i(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),o(150+-1*(this.y||0))}Oe((function(){Zo("#333333")}));var a=50;return[vr(lr,{style:{fontSize:44,y:20,x:150},children:"Start, MarginTop, End, MarginBottom, Center, Between, Evenly"}),vr(va,{gap:a,style:e,onFocus:i,get children(){return[vr(zi,{gap:30,style:t,alignItems:"center",get children(){return[vr(n,{autofocus:!0}),vr(n,{}),vr(n,{}),vr(n,{}),vr(n,{})]}}),vr(zi,{gap:a,style:t,onFocus:i,alignItems:"flexStart",get children(){return[vr(n,{marginTop:100}),vr(n,{}),vr(n,{marginTop:100}),vr(n,{}),vr(n,{})]}}),vr(zi,{gap:a,alignItems:"flexEnd",justifyContent:"flexEnd",style:t,onFocus:i,get children(){return[vr(n,{}),vr(n,{}),vr(n,{}),vr(n,{}),vr(n,{})]}}),vr(zi,{gap:a,justifyContent:"flexEnd",style:t,onFocus:i,get children(){return[vr(n,{}),vr(n,{marginBottom:100}),vr(n,{}),vr(n,{}),vr(n,{marginBottom:100})]}}),vr(zi,{gap:a,justifyContent:"center",style:t,onFocus:i,get children(){return[vr(n,{}),vr(n,{}),vr(n,{}),vr(n,{}),vr(n,{})]}}),vr(zi,{gap:a,justifyContent:"spaceBetween",style:t,onFocus:i,get children(){return[vr(n,{}),vr(n,{}),vr(n,{}),vr(n,{}),vr(n,{})]}}),vr(zi,{gap:a,justifyContent:"spaceEvenly",style:t,onFocus:i,get children(){return[vr(n,{}),vr(n,{}),vr(n,{}),vr(n,{}),vr(n,{})]}})]}})]},el=function(){var e={display:"flex",justifyContent:"spaceEvenly",width:1920,y:100,height:880,color:kr("00000000")},t={display:"flex",flexDirection:"column",justifyContent:"flexStart",color:kr("#4dabf5"),height:850,width:60};function n(e){var t={width:50,height:80,x:5,color:kr("#1769aa")};return vr(ur,br(e,{style:t}))}var r=z(Ie(50),2),o=(r[0],r[1]);function i(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),o(150+-1*(this.y||0))}Oe((function(){Zo("#333333")}));var a=50;return[vr(lr,{style:{fontSize:44,y:20,x:150},children:"Start, MarginTop, End, MarginBottom, Center, Between, Evenly"}),vr(va,{gap:a,style:e,onFocus:i,get children(){return[vr(zi,{gap:30,style:t,get children(){return[vr(n,{autofocus:!0}),vr(n,{}),vr(n,{}),vr(n,{}),vr(n,{})]}}),vr(zi,{gap:a,style:t,onFocus:i,get children(){return[vr(n,{marginTop:100}),vr(n,{}),vr(n,{marginTop:100}),vr(n,{}),vr(n,{})]}}),vr(zi,{gap:a,justifyContent:"flexEnd",style:t,onFocus:i,get children(){return[vr(n,{}),vr(n,{}),vr(n,{}),vr(n,{}),vr(n,{})]}}),vr(zi,{gap:a,justifyContent:"flexEnd",style:t,onFocus:i,get children(){return[vr(n,{}),vr(n,{marginBottom:100}),vr(n,{}),vr(n,{}),vr(n,{marginBottom:100})]}}),vr(zi,{gap:a,justifyContent:"center",style:t,onFocus:i,get children(){return[vr(n,{}),vr(n,{}),vr(n,{}),vr(n,{}),vr(n,{})]}}),vr(zi,{gap:a,justifyContent:"spaceBetween",style:t,onFocus:i,get children(){return[vr(n,{}),vr(n,{}),vr(n,{}),vr(n,{}),vr(n,{})]}}),vr(zi,{gap:a,justifyContent:"spaceEvenly",style:t,onFocus:i,get children(){return[vr(n,{}),vr(n,{}),vr(n,{}),vr(n,{}),vr(n,{})]}})]}})]},tl=function(){function e(e,t){this.states.toggle("disabled")}var t={display:"flex",justifyContent:"flexStart",width:1500,height:300,color:kr("00000000"),gap:26,y:400,x:100},n={width:386,height:136,color:"0x715cabff",focus:{color:"0x5a39a2ff"},disabled:{color:"0x291d43ff"}},r=["RoundedRectangle",{radius:65}];function o(e){return vr(ur,br(e,{forwardStates:!0,style:n,shader:r,get children(){return vr(lr,{style:vs,get children(){return e.children}})}}))}return vr(va,{style:t,get children(){return[vr(o,{autofocus:!0,onEnter:e,children:"Focused"}),vr(o,{states:{active:!0,disabled:!1},children:"Normal"}),vr(o,{states:"disabled",children:"Disabled"})]}})},nl="https://storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd";function rl(){return(rl=x(y().mark((function e(){var t,n;return y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=document.getElementById("video"),n=new shaka.Player,e.next=4,n.attach(t);case 4:return window.player=n,n.addEventListener("error",ol),e.prev=6,e.next=9,n.load(nl);case 9:console.log("The video has now been loaded!"),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(6),il(e.t0);case 15:case"end":return e.stop()}}),e,null,[[6,12]])})))).apply(this,arguments)}function ol(e){il(e.detail)}function il(e){console.error("Error code",e.code,"object",e)}document.addEventListener("DOMContentLoaded",(function(){shaka.polyfill.installAll(),shaka.Player.isBrowserSupported()?function(){rl.apply(this,arguments)}():console.error("Browser not supported!")}));var al=function(){var e=Yr(),t=jr(),n=z(Le((function(){return F({},e)}),Qs),1)[0],r=z(Le((function(){return F({},e)}),Hs),1)[0],o=z(Le((function(){return F({},e)}),Ys),1)[0],i=z(Ie(0),2),a=i[0],s=i[1];Ne(Pe(n,(function(e){Zo(e.backgroundImage)}),{defer:!0}));var l,u,c,d=600,f={color:kr("#000000"),alpha:0,width:1900,height:890,x:10,y:d,borderRadius:30};function h(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),l.y=d,u.y=d,u.alpha=0}function p(){var e;null===(e=this.children.selected)||void 0===e||e.setFocus(),l.y=200,u.y=160,u.alpha=.9}function v(){var e=this.children.selected;_(e&&e.href),t(e.href)}function g(){var e;(e=document.getElementById("video")).hidden=!0,e.pause(),document.getElementsByTagName("canvas")[0].focus(),bt(c),s(0)}function y(){var e=function(){var e=document.getElementById("video");return e.hidden=!1,setTimeout((function(){return e.play()}),50),e.focus(),e}();bt(e),s(.9)}return vr(yt,{get when(){return n()},keyed:!0,get children(){return[vr(ur,{onUp:function(){return c.setFocus()},onEscape:g,get children(){return[vr(Ws,br({y:360,x:150},(function(){return n().heroContent}))),vr(ms,{autofocus:!0,ref:function(e){"function"==typeof c?c(e):c=e},y:560,x:150,onDown:function(){return l.setFocus()},onEnter:y,children:"Watch Trailer"}),vr(zi,{ref:function(e){"function"==typeof l?l(e):l=e},y:d,x:140,get style(){return cs.Column},zIndex:5,get children(){return vr(yt,{get when(){return pr((function(){return!!o()}))()&&r()},get children(){return[vr(lr,{skipFocus:!0,get style(){return cs.RowTitle},children:"Recommendations"}),vr(ys,{onFocus:h,onEnter:v,get items(){return o()}}),vr(lr,{skipFocus:!0,get style(){return cs.RowTitle},children:"Cast and Crew"}),vr(ys,{onFocus:p,onEnter:v,get items(){return r()}})]}})}}),vr(ur,{ref:function(e){"function"==typeof u?u(e):u=e},style:f,transition:{alpha:!0,y:!0}})]}}),vr(ur,{get alpha(){return a()},get color(){return kr("#000000")},zIndex:200,transition:{alpha:!0}})]}})};function sl(e){var t=e.id;return _s.get("/person/".concat(t,"/combined_credits")).then((function(e){return Rs(e.cast.slice(0,7))}))}function ll(e){var t=e.id;return _s.get("/person/".concat(t)).then((function(e){return F({backgroundImage:As(e.profile_path,"original"),heroContent:{title:e.title||e.name,description:e.biography}},e)}))}var ul=function(){var e=Yr(),t=jr(),n=z(Le((function(){return F({},e)}),ll),1)[0],r=z(Le((function(){return F({},e)}),sl),1)[0];Ne(Pe(n,(function(e){Zo(e.backgroundImage)}),{defer:!0}));var o={color:kr("#000000"),alpha:.8,width:1540,height:440,x:130,y:180,borderRadius:30};function i(){var e=this.children.selected;_(e&&e.href),t(e.href)}return vr(yt,{get when(){return n()},keyed:!0,get children(){return[vr(ur,{x:150,y:200,get style(){return cs.Column},zIndex:3,get children(){return[vr(lr,{get style(){return qo.typography.display2},get children(){return n().name}}),vr(lr,{get style(){return cs.peopleBio},get children(){return n().biography}})]}}),vr(ur,{style:o}),vr(zi,{y:670,x:140,get style(){return cs.Column},get children(){return vr(yt,{get when(){return r()},get children(){return[vr(lr,{skipFocus:!0,get style(){return cs.RowTitle},children:"Credits"}),vr(ys,{autofocus:!0,onEnter:i,get items(){return r()}})]}})}})]}})},cl=function(){return e=gr("node"),xr(e,"style",{width:1920,height:1080,color:868483072}),e;var e},dl=new URL("AppCoreExtensions-legacy-ByBl5Y8-.js",A.meta.url).href;qn.debug=!1,qn.animationsEnabled=!0,qn.fontSettings.fontFamily="Ubuntu",qn.fontSettings.color=kr("#ffffff"),qn.fontSettings.fontSize=100,qn.rendererOptions={coreExtensionModule:dl,fpsUpdateInterval:1e3,enableInspector:!0},hr((function(){return vr(ao,{root:function(e){return vr(us,e)},get children(){return[vr(eo,{path:"",component:Ks}),vr(eo,{path:"examples",component:Xs}),vr(eo,{path:"browse/:filter",component:Ks}),vr(eo,{path:"text",component:Gs}),vr(eo,{path:"buttons",component:Zs}),vr(eo,{path:"flex",component:qs}),vr(eo,{path:"create",component:Vs}),vr(eo,{path:"flexsize",component:Js}),vr(eo,{path:"flexcolumnsize",component:$s}),vr(eo,{path:"flexcolumn",component:el}),vr(eo,{path:"buttonsmaterial",component:tl}),vr(eo,{path:"entity/people/:id",component:ul}),vr(eo,{path:"entity/:type/:id",component:al}),vr(eo,{path:"*all",component:cl})]}})}))}}}))}(); -//# sourceMappingURL=index-legacy-CN18kCrR.js.map diff --git a/assets/index-legacy-CN18kCrR.js.map b/assets/index-legacy-CN18kCrR.js.map deleted file mode 100644 index 2578e3b..0000000 --- a/assets/index-legacy-CN18kCrR.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index-legacy-CN18kCrR.js","sources":["../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/dist/solid.js","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.0_@babel+core@7.24.3_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.3_vite@5.2.6/node_modules/@lightningjs/solid/src/core/activeElement.ts","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/main-api/texture-usage-trackers/TextureUsageTracker.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/main-api/texture-usage-trackers/ManualCountTextureUsageTracker.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/main-api/texture-usage-trackers/FinalizationRegistryTextureUsageTracker.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/main-api/Inspector.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/ShaderEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/TextRenderer.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/LightningTextTextureRenderer.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/CanvasTextRenderer.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/DefaultShader.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/DefaultShaderBatched.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/DynamicShader.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/RoundedRectangle.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/SdfShader.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/RadiusEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/BorderEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/LinearGradientEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/GrayscaleEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/BorderRightEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/BorderTopEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/BorderBottomEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/BorderLeftEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/GlitchEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/FadeOutEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/RadialGradientEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/RadialProgressEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/renderers/webgl/shaders/effects/HolePunchEffect.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/CoreShaderManager.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/lib/ContextSpy.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/lib/textureCompression.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/textures/ImageTexture.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/constants.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/PeekableGenerator.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/getUnicodeCodepoints.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/measureText.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/layoutText.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/setRenderWindow.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/util.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/TrFontManager.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/SdfTextRenderer.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/getStartConditions.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/render-drivers/utils.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/main-api/RendererMain.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/CoreNode.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/animations/CoreAnimation.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/animations/CoreAnimationController.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/lib/Matrix3d.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/lib/RenderCoords.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/render-drivers/main/MainOnlyNode.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/animations/AnimationManager.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/lib/ImageWorker.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/textures/NoiseTexture.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/CoreTextureManager.js","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.0_@babel+core@7.24.3_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.3_vite@5.2.6/node_modules/@lightningjs/solid/src/core/lightningInit.ts","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/TextureMemoryManager.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/Stage.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/platform.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/core/CoreTextNode.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/render-drivers/main/MainOnlyTextNode.js","../../../../node_modules/.pnpm/@lightningjs+renderer@0.8.1/node_modules/@lightningjs/renderer/dist/src/render-drivers/main/MainCoreDriver.js","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.0_@babel+core@7.24.3_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.3_vite@5.2.6/node_modules/@lightningjs/solid/src/core/node/children.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.0_@babel+core@7.24.3_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.3_vite@5.2.6/node_modules/@lightningjs/solid/src/config.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.0_@babel+core@7.24.3_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.3_vite@5.2.6/node_modules/@lightningjs/solid/src/core/utils.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.0_@babel+core@7.24.3_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.3_vite@5.2.6/node_modules/@lightningjs/solid/src/core/node/states.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.0_@babel+core@7.24.3_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.3_vite@5.2.6/node_modules/@lightningjs/solid/src/core/node/index.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.0_@babel+core@7.24.3_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.3_vite@5.2.6/node_modules/@lightningjs/solid/src/core/flex.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.0_@babel+core@7.24.3_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.3_vite@5.2.6/node_modules/@lightningjs/solid/src/components/Text.tsx","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.0_@babel+core@7.24.3_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.3_vite@5.2.6/node_modules/@lightningjs/solid/src/components/View.tsx","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/universal/dist/universal.js","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.0_@babel+core@7.24.3_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.3_vite@5.2.6/node_modules/@lightningjs/solid/src/core/solidUniversal.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.0_@babel+core@7.24.3_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.3_vite@5.2.6/node_modules/@lightningjs/solid/src/core/render.ts","../../../../node_modules/.pnpm/@lightningjs+solid@0.15.0_@babel+core@7.24.3_react-dom@18.2.0_react@18.2.0_solid-js@1.8.16_typescript@5.4.3_vite@5.2.6/node_modules/@lightningjs/solid/src/utils.ts","../../../../node_modules/.pnpm/solid-js@1.8.16/node_modules/solid-js/web/dist/web.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/lifecycle.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/utils.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routing.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/components.jsx","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/createRouter.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/data/action.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/data/events.js","../../../../node_modules/.pnpm/@solidjs+router@0.13.1_solid-js@1.8.16/node_modules/@solidjs/router/dist/routers/HashRouter.js","../../../../node_modules/.pnpm/@solid-primitives+utils@6.2.3_solid-js@1.8.16/node_modules/@solid-primitives/utils/dist/chunk/R5675YMU.js","../../../../node_modules/.pnpm/@solid-primitives+rootless@1.4.5_solid-js@1.8.16/node_modules/@solid-primitives/rootless/dist/index.js","../../../../node_modules/.pnpm/@solid-primitives+keyboard@1.2.8_solid-js@1.8.16/node_modules/@solid-primitives/keyboard/dist/index.js","../../../../node_modules/.pnpm/@solid-primitives+event-listener@2.3.3_solid-js@1.8.16/node_modules/@solid-primitives/event-listener/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.1_@lightningjs+solid@0.15.0_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/utils.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.1_@lightningjs+solid@0.15.0_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/useFocusManager.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.1_@lightningjs+solid@0.15.0_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/speech.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.1_@lightningjs+solid@0.15.0_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/withPadding.js","../../../../node_modules/.pnpm/@solid-primitives+scheduled@1.4.3_solid-js@1.8.16/node_modules/@solid-primitives/scheduled/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.1_@lightningjs+solid@0.15.0_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/announcer.js","../../src/state.ts","../../../../node_modules/.pnpm/@lightningjs+solid-ui@0.6.0_@babel+core@7.24.3_@lightningjs+renderer@0.8.1_@lightningjs+solid_luusdtwj6vhbqnm2jlt3u2tuhm/node_modules/@lightningjs/solid-ui/dist/index.js","../../../../node_modules/.pnpm/@lightningjs+l3-ui-theme-base@0.3.1/node_modules/@lightningjs/l3-ui-theme-base/theme.js","../../src/components/Background.tsx","../../src/components/NavDrawer/NavDrawer.styles.ts","../../src/components/Icon.tsx","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.1_@lightningjs+solid@0.15.0_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/createSpriteMap.js","../../src/components/NavDrawer/NavDrawer.tsx","../../src/components/FPSCounter.tsx","../../src/pages/App.tsx","../../../../node_modules/.pnpm/@lightningjs+solid-primitives@0.6.3_@lightningjs+renderer@0.8.1_@lightningjs+solid@0.15.0_solid-js@1.8.16/node_modules/@lightningjs/solid-primitives/dist/packages/announcer/index.js","../../src/styles.ts","../../src/components/index.tsx","../../src/api/key.ts","../../src/api/index.ts","../../src/api/formatters/ItemFormatter.ts","../../src/api/providers/browse.ts","../../src/components/pagination.ts","../../src/components/ContentBlock.tsx","../../src/api/providers/entity.js","../../src/pages/Browse.tsx","../../src/pages/Portal.tsx","../../src/pages/Text.tsx","../../src/pages/Create.tsx","../../src/pages/Buttons.tsx","../../src/pages/Flex.tsx","../../src/pages/FlexSize.tsx","../../src/pages/FlexColumnSize.tsx","../../src/pages/FlexColumn.tsx","../../src/pages/ButtonsMaterial.tsx","../../src/video.js","../../src/pages/Entity.tsx","../../src/api/providers/people.js","../../src/pages/People.tsx","../../src/pages/NotFound.tsx","../../AppCoreExtensions.js?importChunkUrl","../../src/index.tsx"],"sourcesContent":["let taskIdCounter = 1,\n isCallbackScheduled = false,\n isPerformingWork = false,\n taskQueue = [],\n currentTask = null,\n shouldYieldToHost = null,\n yieldInterval = 5,\n deadline = 0,\n maxYieldInterval = 300,\n scheduleCallback = null,\n scheduledCallback = null;\nconst maxSigned31BitInt = 1073741823;\nfunction setupScheduler() {\n const channel = new MessageChannel(),\n port = channel.port2;\n scheduleCallback = () => port.postMessage(null);\n channel.port1.onmessage = () => {\n if (scheduledCallback !== null) {\n const currentTime = performance.now();\n deadline = currentTime + yieldInterval;\n const hasTimeRemaining = true;\n try {\n const hasMoreWork = scheduledCallback(hasTimeRemaining, currentTime);\n if (!hasMoreWork) {\n scheduledCallback = null;\n } else port.postMessage(null);\n } catch (error) {\n port.postMessage(null);\n throw error;\n }\n }\n };\n if (navigator && navigator.scheduling && navigator.scheduling.isInputPending) {\n const scheduling = navigator.scheduling;\n shouldYieldToHost = () => {\n const currentTime = performance.now();\n if (currentTime >= deadline) {\n if (scheduling.isInputPending()) {\n return true;\n }\n return currentTime >= maxYieldInterval;\n } else {\n return false;\n }\n };\n } else {\n shouldYieldToHost = () => performance.now() >= deadline;\n }\n}\nfunction enqueue(taskQueue, task) {\n function findIndex() {\n let m = 0;\n let n = taskQueue.length - 1;\n while (m <= n) {\n const k = (n + m) >> 1;\n const cmp = task.expirationTime - taskQueue[k].expirationTime;\n if (cmp > 0) m = k + 1;\n else if (cmp < 0) n = k - 1;\n else return k;\n }\n return m;\n }\n taskQueue.splice(findIndex(), 0, task);\n}\nfunction requestCallback(fn, options) {\n if (!scheduleCallback) setupScheduler();\n let startTime = performance.now(),\n timeout = maxSigned31BitInt;\n if (options && options.timeout) timeout = options.timeout;\n const newTask = {\n id: taskIdCounter++,\n fn,\n startTime,\n expirationTime: startTime + timeout\n };\n enqueue(taskQueue, newTask);\n if (!isCallbackScheduled && !isPerformingWork) {\n isCallbackScheduled = true;\n scheduledCallback = flushWork;\n scheduleCallback();\n }\n return newTask;\n}\nfunction cancelCallback(task) {\n task.fn = null;\n}\nfunction flushWork(hasTimeRemaining, initialTime) {\n isCallbackScheduled = false;\n isPerformingWork = true;\n try {\n return workLoop(hasTimeRemaining, initialTime);\n } finally {\n currentTask = null;\n isPerformingWork = false;\n }\n}\nfunction workLoop(hasTimeRemaining, initialTime) {\n let currentTime = initialTime;\n currentTask = taskQueue[0] || null;\n while (currentTask !== null) {\n if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {\n break;\n }\n const callback = currentTask.fn;\n if (callback !== null) {\n currentTask.fn = null;\n const didUserCallbackTimeout = currentTask.expirationTime <= currentTime;\n callback(didUserCallbackTimeout);\n currentTime = performance.now();\n if (currentTask === taskQueue[0]) {\n taskQueue.shift();\n }\n } else taskQueue.shift();\n currentTask = taskQueue[0] || null;\n }\n return currentTask !== null;\n}\n\nconst sharedConfig = {\n context: undefined,\n registry: undefined\n};\nfunction setHydrateContext(context) {\n sharedConfig.context = context;\n}\nfunction nextHydrateContext() {\n return {\n ...sharedConfig.context,\n id: `${sharedConfig.context.id}${sharedConfig.context.count++}-`,\n count: 0\n };\n}\n\nconst equalFn = (a, b) => a === b;\nconst $PROXY = Symbol(\"solid-proxy\");\nconst $TRACK = Symbol(\"solid-track\");\nconst $DEVCOMP = Symbol(\"solid-dev-component\");\nconst signalOptions = {\n equals: equalFn\n};\nlet ERROR = null;\nlet runEffects = runQueue;\nconst STALE = 1;\nconst PENDING = 2;\nconst UNOWNED = {\n owned: null,\n cleanups: null,\n context: null,\n owner: null\n};\nconst NO_INIT = {};\nvar Owner = null;\nlet Transition = null;\nlet Scheduler = null;\nlet ExternalSourceConfig = null;\nlet Listener = null;\nlet Updates = null;\nlet Effects = null;\nlet ExecCount = 0;\nfunction createRoot(fn, detachedOwner) {\n const listener = Listener,\n owner = Owner,\n unowned = fn.length === 0,\n current = detachedOwner === undefined ? owner : detachedOwner,\n root = unowned\n ? UNOWNED\n : {\n owned: null,\n cleanups: null,\n context: current ? current.context : null,\n owner: current\n },\n updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root)));\n Owner = root;\n Listener = null;\n try {\n return runUpdates(updateFn, true);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n}\nfunction createSignal(value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const s = {\n value,\n observers: null,\n observerSlots: null,\n comparator: options.equals || undefined\n };\n const setter = value => {\n if (typeof value === \"function\") {\n if (Transition && Transition.running && Transition.sources.has(s)) value = value(s.tValue);\n else value = value(s.value);\n }\n return writeSignal(s, value);\n };\n return [readSignal.bind(s), setter];\n}\nfunction createComputed(fn, value, options) {\n const c = createComputation(fn, value, true, STALE);\n if (Scheduler && Transition && Transition.running) Updates.push(c);\n else updateComputation(c);\n}\nfunction createRenderEffect(fn, value, options) {\n const c = createComputation(fn, value, false, STALE);\n if (Scheduler && Transition && Transition.running) Updates.push(c);\n else updateComputation(c);\n}\nfunction createEffect(fn, value, options) {\n runEffects = runUserEffects;\n const c = createComputation(fn, value, false, STALE),\n s = SuspenseContext && useContext(SuspenseContext);\n if (s) c.suspense = s;\n if (!options || !options.render) c.user = true;\n Effects ? Effects.push(c) : updateComputation(c);\n}\nfunction createReaction(onInvalidate, options) {\n let fn;\n const c = createComputation(\n () => {\n fn ? fn() : untrack(onInvalidate);\n fn = undefined;\n },\n undefined,\n false,\n 0\n ),\n s = SuspenseContext && useContext(SuspenseContext);\n if (s) c.suspense = s;\n c.user = true;\n return tracking => {\n fn = tracking;\n updateComputation(c);\n };\n}\nfunction createMemo(fn, value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const c = createComputation(fn, value, true, 0);\n c.observers = null;\n c.observerSlots = null;\n c.comparator = options.equals || undefined;\n if (Scheduler && Transition && Transition.running) {\n c.tState = STALE;\n Updates.push(c);\n } else updateComputation(c);\n return readSignal.bind(c);\n}\nfunction isPromise(v) {\n return v && typeof v === \"object\" && \"then\" in v;\n}\nfunction createResource(pSource, pFetcher, pOptions) {\n let source;\n let fetcher;\n let options;\n if ((arguments.length === 2 && typeof pFetcher === \"object\") || arguments.length === 1) {\n source = true;\n fetcher = pSource;\n options = pFetcher || {};\n } else {\n source = pSource;\n fetcher = pFetcher;\n options = pOptions || {};\n }\n let pr = null,\n initP = NO_INIT,\n id = null,\n loadedUnderTransition = false,\n scheduled = false,\n resolved = \"initialValue\" in options,\n dynamic = typeof source === \"function\" && createMemo(source);\n const contexts = new Set(),\n [value, setValue] = (options.storage || createSignal)(options.initialValue),\n [error, setError] = createSignal(undefined),\n [track, trigger] = createSignal(undefined, {\n equals: false\n }),\n [state, setState] = createSignal(resolved ? \"ready\" : \"unresolved\");\n if (sharedConfig.context) {\n id = `${sharedConfig.context.id}${sharedConfig.context.count++}`;\n let v;\n if (options.ssrLoadFrom === \"initial\") initP = options.initialValue;\n else if (sharedConfig.load && (v = sharedConfig.load(id))) initP = v;\n }\n function loadEnd(p, v, error, key) {\n if (pr === p) {\n pr = null;\n key !== undefined && (resolved = true);\n if ((p === initP || v === initP) && options.onHydrated)\n queueMicrotask(() =>\n options.onHydrated(key, {\n value: v\n })\n );\n initP = NO_INIT;\n if (Transition && p && loadedUnderTransition) {\n Transition.promises.delete(p);\n loadedUnderTransition = false;\n runUpdates(() => {\n Transition.running = true;\n completeLoad(v, error);\n }, false);\n } else completeLoad(v, error);\n }\n return v;\n }\n function completeLoad(v, err) {\n runUpdates(() => {\n if (err === undefined) setValue(() => v);\n setState(err !== undefined ? \"errored\" : resolved ? \"ready\" : \"unresolved\");\n setError(err);\n for (const c of contexts.keys()) c.decrement();\n contexts.clear();\n }, false);\n }\n function read() {\n const c = SuspenseContext && useContext(SuspenseContext),\n v = value(),\n err = error();\n if (err !== undefined && !pr) throw err;\n if (Listener && !Listener.user && c) {\n createComputed(() => {\n track();\n if (pr) {\n if (c.resolved && Transition && loadedUnderTransition) Transition.promises.add(pr);\n else if (!contexts.has(c)) {\n c.increment();\n contexts.add(c);\n }\n }\n });\n }\n return v;\n }\n function load(refetching = true) {\n if (refetching !== false && scheduled) return;\n scheduled = false;\n const lookup = dynamic ? dynamic() : source;\n loadedUnderTransition = Transition && Transition.running;\n if (lookup == null || lookup === false) {\n loadEnd(pr, untrack(value));\n return;\n }\n if (Transition && pr) Transition.promises.delete(pr);\n const p =\n initP !== NO_INIT\n ? initP\n : untrack(() =>\n fetcher(lookup, {\n value: value(),\n refetching\n })\n );\n if (!isPromise(p)) {\n loadEnd(pr, p, undefined, lookup);\n return p;\n }\n pr = p;\n if (\"value\" in p) {\n if (p.status === \"success\") loadEnd(pr, p.value, undefined, lookup);\n else loadEnd(pr, undefined, undefined, lookup);\n return p;\n }\n scheduled = true;\n queueMicrotask(() => (scheduled = false));\n runUpdates(() => {\n setState(resolved ? \"refreshing\" : \"pending\");\n trigger();\n }, false);\n return p.then(\n v => loadEnd(p, v, undefined, lookup),\n e => loadEnd(p, undefined, castError(e), lookup)\n );\n }\n Object.defineProperties(read, {\n state: {\n get: () => state()\n },\n error: {\n get: () => error()\n },\n loading: {\n get() {\n const s = state();\n return s === \"pending\" || s === \"refreshing\";\n }\n },\n latest: {\n get() {\n if (!resolved) return read();\n const err = error();\n if (err && !pr) throw err;\n return value();\n }\n }\n });\n if (dynamic) createComputed(() => load(false));\n else load(false);\n return [\n read,\n {\n refetch: load,\n mutate: setValue\n }\n ];\n}\nfunction createDeferred(source, options) {\n let t,\n timeout = options ? options.timeoutMs : undefined;\n const node = createComputation(\n () => {\n if (!t || !t.fn)\n t = requestCallback(\n () => setDeferred(() => node.value),\n timeout !== undefined\n ? {\n timeout\n }\n : undefined\n );\n return source();\n },\n undefined,\n true\n );\n const [deferred, setDeferred] = createSignal(\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,\n options\n );\n updateComputation(node);\n setDeferred(() =>\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value\n );\n return deferred;\n}\nfunction createSelector(source, fn = equalFn, options) {\n const subs = new Map();\n const node = createComputation(\n p => {\n const v = source();\n for (const [key, val] of subs.entries())\n if (fn(key, v) !== fn(key, p)) {\n for (const c of val.values()) {\n c.state = STALE;\n if (c.pure) Updates.push(c);\n else Effects.push(c);\n }\n }\n return v;\n },\n undefined,\n true,\n STALE\n );\n updateComputation(node);\n return key => {\n const listener = Listener;\n if (listener) {\n let l;\n if ((l = subs.get(key))) l.add(listener);\n else subs.set(key, (l = new Set([listener])));\n onCleanup(() => {\n l.delete(listener);\n !l.size && subs.delete(key);\n });\n }\n return fn(\n key,\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value\n );\n };\n}\nfunction batch(fn) {\n return runUpdates(fn, false);\n}\nfunction untrack(fn) {\n if (!ExternalSourceConfig && Listener === null) return fn();\n const listener = Listener;\n Listener = null;\n try {\n if (ExternalSourceConfig) return ExternalSourceConfig.untrack(fn);\n return fn();\n } finally {\n Listener = listener;\n }\n}\nfunction on(deps, fn, options) {\n const isArray = Array.isArray(deps);\n let prevInput;\n let defer = options && options.defer;\n return prevValue => {\n let input;\n if (isArray) {\n input = Array(deps.length);\n for (let i = 0; i < deps.length; i++) input[i] = deps[i]();\n } else input = deps();\n if (defer) {\n defer = false;\n return prevValue;\n }\n const result = untrack(() => fn(input, prevInput, prevValue));\n prevInput = input;\n return result;\n };\n}\nfunction onMount(fn) {\n createEffect(() => untrack(fn));\n}\nfunction onCleanup(fn) {\n if (Owner === null);\n else if (Owner.cleanups === null) Owner.cleanups = [fn];\n else Owner.cleanups.push(fn);\n return fn;\n}\nfunction catchError(fn, handler) {\n ERROR || (ERROR = Symbol(\"error\"));\n Owner = createComputation(undefined, undefined, true);\n Owner.context = {\n ...Owner.context,\n [ERROR]: [handler]\n };\n if (Transition && Transition.running) Transition.sources.add(Owner);\n try {\n return fn();\n } catch (err) {\n handleError(err);\n } finally {\n Owner = Owner.owner;\n }\n}\nfunction getListener() {\n return Listener;\n}\nfunction getOwner() {\n return Owner;\n}\nfunction runWithOwner(o, fn) {\n const prev = Owner;\n const prevListener = Listener;\n Owner = o;\n Listener = null;\n try {\n return runUpdates(fn, true);\n } catch (err) {\n handleError(err);\n } finally {\n Owner = prev;\n Listener = prevListener;\n }\n}\nfunction enableScheduling(scheduler = requestCallback) {\n Scheduler = scheduler;\n}\nfunction startTransition(fn) {\n if (Transition && Transition.running) {\n fn();\n return Transition.done;\n }\n const l = Listener;\n const o = Owner;\n return Promise.resolve().then(() => {\n Listener = l;\n Owner = o;\n let t;\n if (Scheduler || SuspenseContext) {\n t =\n Transition ||\n (Transition = {\n sources: new Set(),\n effects: [],\n promises: new Set(),\n disposed: new Set(),\n queue: new Set(),\n running: true\n });\n t.done || (t.done = new Promise(res => (t.resolve = res)));\n t.running = true;\n }\n runUpdates(fn, false);\n Listener = Owner = null;\n return t ? t.done : undefined;\n });\n}\nconst [transPending, setTransPending] = /*@__PURE__*/ createSignal(false);\nfunction useTransition() {\n return [transPending, startTransition];\n}\nfunction resumeEffects(e) {\n Effects.push.apply(Effects, e);\n e.length = 0;\n}\nfunction createContext(defaultValue, options) {\n const id = Symbol(\"context\");\n return {\n id,\n Provider: createProvider(id),\n defaultValue\n };\n}\nfunction useContext(context) {\n return Owner && Owner.context && Owner.context[context.id] !== undefined\n ? Owner.context[context.id]\n : context.defaultValue;\n}\nfunction children(fn) {\n const children = createMemo(fn);\n const memo = createMemo(() => resolveChildren(children()));\n memo.toArray = () => {\n const c = memo();\n return Array.isArray(c) ? c : c != null ? [c] : [];\n };\n return memo;\n}\nlet SuspenseContext;\nfunction getSuspenseContext() {\n return SuspenseContext || (SuspenseContext = createContext());\n}\nfunction enableExternalSource(factory, untrack = fn => fn()) {\n if (ExternalSourceConfig) {\n const { factory: oldFactory, untrack: oldUntrack } = ExternalSourceConfig;\n ExternalSourceConfig = {\n factory: (fn, trigger) => {\n const oldSource = oldFactory(fn, trigger);\n const source = factory(x => oldSource.track(x), trigger);\n return {\n track: x => source.track(x),\n dispose() {\n source.dispose();\n oldSource.dispose();\n }\n };\n },\n untrack: fn => oldUntrack(() => untrack(fn))\n };\n } else {\n ExternalSourceConfig = {\n factory,\n untrack\n };\n }\n}\nfunction readSignal() {\n const runningTransition = Transition && Transition.running;\n if (this.sources && (runningTransition ? this.tState : this.state)) {\n if ((runningTransition ? this.tState : this.state) === STALE) updateComputation(this);\n else {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(this), false);\n Updates = updates;\n }\n }\n if (Listener) {\n const sSlot = this.observers ? this.observers.length : 0;\n if (!Listener.sources) {\n Listener.sources = [this];\n Listener.sourceSlots = [sSlot];\n } else {\n Listener.sources.push(this);\n Listener.sourceSlots.push(sSlot);\n }\n if (!this.observers) {\n this.observers = [Listener];\n this.observerSlots = [Listener.sources.length - 1];\n } else {\n this.observers.push(Listener);\n this.observerSlots.push(Listener.sources.length - 1);\n }\n }\n if (runningTransition && Transition.sources.has(this)) return this.tValue;\n return this.value;\n}\nfunction writeSignal(node, value, isComp) {\n let current =\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value;\n if (!node.comparator || !node.comparator(current, value)) {\n if (Transition) {\n const TransitionRunning = Transition.running;\n if (TransitionRunning || (!isComp && Transition.sources.has(node))) {\n Transition.sources.add(node);\n node.tValue = value;\n }\n if (!TransitionRunning) node.value = value;\n } else node.value = value;\n if (node.observers && node.observers.length) {\n runUpdates(() => {\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n const TransitionRunning = Transition && Transition.running;\n if (TransitionRunning && Transition.disposed.has(o)) continue;\n if (TransitionRunning ? !o.tState : !o.state) {\n if (o.pure) Updates.push(o);\n else Effects.push(o);\n if (o.observers) markDownstream(o);\n }\n if (!TransitionRunning) o.state = STALE;\n else o.tState = STALE;\n }\n if (Updates.length > 10e5) {\n Updates = [];\n if (false);\n throw new Error();\n }\n }, false);\n }\n }\n return value;\n}\nfunction updateComputation(node) {\n if (!node.fn) return;\n cleanNode(node);\n const time = ExecCount;\n runComputation(\n node,\n Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,\n time\n );\n if (Transition && !Transition.running && Transition.sources.has(node)) {\n queueMicrotask(() => {\n runUpdates(() => {\n Transition && (Transition.running = true);\n Listener = Owner = node;\n runComputation(node, node.tValue, time);\n Listener = Owner = null;\n }, false);\n });\n }\n}\nfunction runComputation(node, value, time) {\n let nextValue;\n const owner = Owner,\n listener = Listener;\n Listener = Owner = node;\n try {\n nextValue = node.fn(value);\n } catch (err) {\n if (node.pure) {\n if (Transition && Transition.running) {\n node.tState = STALE;\n node.tOwned && node.tOwned.forEach(cleanNode);\n node.tOwned = undefined;\n } else {\n node.state = STALE;\n node.owned && node.owned.forEach(cleanNode);\n node.owned = null;\n }\n }\n node.updatedAt = time + 1;\n return handleError(err);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n if (!node.updatedAt || node.updatedAt <= time) {\n if (node.updatedAt != null && \"observers\" in node) {\n writeSignal(node, nextValue, true);\n } else if (Transition && Transition.running && node.pure) {\n Transition.sources.add(node);\n node.tValue = nextValue;\n } else node.value = nextValue;\n node.updatedAt = time;\n }\n}\nfunction createComputation(fn, init, pure, state = STALE, options) {\n const c = {\n fn,\n state: state,\n updatedAt: null,\n owned: null,\n sources: null,\n sourceSlots: null,\n cleanups: null,\n value: init,\n owner: Owner,\n context: Owner ? Owner.context : null,\n pure\n };\n if (Transition && Transition.running) {\n c.state = 0;\n c.tState = state;\n }\n if (Owner === null);\n else if (Owner !== UNOWNED) {\n if (Transition && Transition.running && Owner.pure) {\n if (!Owner.tOwned) Owner.tOwned = [c];\n else Owner.tOwned.push(c);\n } else {\n if (!Owner.owned) Owner.owned = [c];\n else Owner.owned.push(c);\n }\n }\n if (ExternalSourceConfig && c.fn) {\n const [track, trigger] = createSignal(undefined, {\n equals: false\n });\n const ordinary = ExternalSourceConfig.factory(c.fn, trigger);\n onCleanup(() => ordinary.dispose());\n const triggerInTransition = () => startTransition(trigger).then(() => inTransition.dispose());\n const inTransition = ExternalSourceConfig.factory(c.fn, triggerInTransition);\n c.fn = x => {\n track();\n return Transition && Transition.running ? inTransition.track(x) : ordinary.track(x);\n };\n }\n return c;\n}\nfunction runTop(node) {\n const runningTransition = Transition && Transition.running;\n if ((runningTransition ? node.tState : node.state) === 0) return;\n if ((runningTransition ? node.tState : node.state) === PENDING) return lookUpstream(node);\n if (node.suspense && untrack(node.suspense.inFallback)) return node.suspense.effects.push(node);\n const ancestors = [node];\n while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {\n if (runningTransition && Transition.disposed.has(node)) return;\n if (runningTransition ? node.tState : node.state) ancestors.push(node);\n }\n for (let i = ancestors.length - 1; i >= 0; i--) {\n node = ancestors[i];\n if (runningTransition) {\n let top = node,\n prev = ancestors[i + 1];\n while ((top = top.owner) && top !== prev) {\n if (Transition.disposed.has(top)) return;\n }\n }\n if ((runningTransition ? node.tState : node.state) === STALE) {\n updateComputation(node);\n } else if ((runningTransition ? node.tState : node.state) === PENDING) {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(node, ancestors[0]), false);\n Updates = updates;\n }\n }\n}\nfunction runUpdates(fn, init) {\n if (Updates) return fn();\n let wait = false;\n if (!init) Updates = [];\n if (Effects) wait = true;\n else Effects = [];\n ExecCount++;\n try {\n const res = fn();\n completeUpdates(wait);\n return res;\n } catch (err) {\n if (!wait) Effects = null;\n Updates = null;\n handleError(err);\n }\n}\nfunction completeUpdates(wait) {\n if (Updates) {\n if (Scheduler && Transition && Transition.running) scheduleQueue(Updates);\n else runQueue(Updates);\n Updates = null;\n }\n if (wait) return;\n let res;\n if (Transition) {\n if (!Transition.promises.size && !Transition.queue.size) {\n const sources = Transition.sources;\n const disposed = Transition.disposed;\n Effects.push.apply(Effects, Transition.effects);\n res = Transition.resolve;\n for (const e of Effects) {\n \"tState\" in e && (e.state = e.tState);\n delete e.tState;\n }\n Transition = null;\n runUpdates(() => {\n for (const d of disposed) cleanNode(d);\n for (const v of sources) {\n v.value = v.tValue;\n if (v.owned) {\n for (let i = 0, len = v.owned.length; i < len; i++) cleanNode(v.owned[i]);\n }\n if (v.tOwned) v.owned = v.tOwned;\n delete v.tValue;\n delete v.tOwned;\n v.tState = 0;\n }\n setTransPending(false);\n }, false);\n } else if (Transition.running) {\n Transition.running = false;\n Transition.effects.push.apply(Transition.effects, Effects);\n Effects = null;\n setTransPending(true);\n return;\n }\n }\n const e = Effects;\n Effects = null;\n if (e.length) runUpdates(() => runEffects(e), false);\n if (res) res();\n}\nfunction runQueue(queue) {\n for (let i = 0; i < queue.length; i++) runTop(queue[i]);\n}\nfunction scheduleQueue(queue) {\n for (let i = 0; i < queue.length; i++) {\n const item = queue[i];\n const tasks = Transition.queue;\n if (!tasks.has(item)) {\n tasks.add(item);\n Scheduler(() => {\n tasks.delete(item);\n runUpdates(() => {\n Transition.running = true;\n runTop(item);\n }, false);\n Transition && (Transition.running = false);\n });\n }\n }\n}\nfunction runUserEffects(queue) {\n let i,\n userLength = 0;\n for (i = 0; i < queue.length; i++) {\n const e = queue[i];\n if (!e.user) runTop(e);\n else queue[userLength++] = e;\n }\n if (sharedConfig.context) {\n if (sharedConfig.count) {\n sharedConfig.effects || (sharedConfig.effects = []);\n sharedConfig.effects.push(...queue.slice(0, userLength));\n return;\n } else if (sharedConfig.effects) {\n queue = [...sharedConfig.effects, ...queue];\n userLength += sharedConfig.effects.length;\n delete sharedConfig.effects;\n }\n setHydrateContext();\n }\n for (i = 0; i < userLength; i++) runTop(queue[i]);\n}\nfunction lookUpstream(node, ignore) {\n const runningTransition = Transition && Transition.running;\n if (runningTransition) node.tState = 0;\n else node.state = 0;\n for (let i = 0; i < node.sources.length; i += 1) {\n const source = node.sources[i];\n if (source.sources) {\n const state = runningTransition ? source.tState : source.state;\n if (state === STALE) {\n if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))\n runTop(source);\n } else if (state === PENDING) lookUpstream(source, ignore);\n }\n }\n}\nfunction markDownstream(node) {\n const runningTransition = Transition && Transition.running;\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n if (runningTransition ? !o.tState : !o.state) {\n if (runningTransition) o.tState = PENDING;\n else o.state = PENDING;\n if (o.pure) Updates.push(o);\n else Effects.push(o);\n o.observers && markDownstream(o);\n }\n }\n}\nfunction cleanNode(node) {\n let i;\n if (node.sources) {\n while (node.sources.length) {\n const source = node.sources.pop(),\n index = node.sourceSlots.pop(),\n obs = source.observers;\n if (obs && obs.length) {\n const n = obs.pop(),\n s = source.observerSlots.pop();\n if (index < obs.length) {\n n.sourceSlots[s] = index;\n obs[index] = n;\n source.observerSlots[index] = s;\n }\n }\n }\n }\n if (Transition && Transition.running && node.pure) {\n if (node.tOwned) {\n for (i = node.tOwned.length - 1; i >= 0; i--) cleanNode(node.tOwned[i]);\n delete node.tOwned;\n }\n reset(node, true);\n } else if (node.owned) {\n for (i = node.owned.length - 1; i >= 0; i--) cleanNode(node.owned[i]);\n node.owned = null;\n }\n if (node.cleanups) {\n for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i]();\n node.cleanups = null;\n }\n if (Transition && Transition.running) node.tState = 0;\n else node.state = 0;\n}\nfunction reset(node, top) {\n if (!top) {\n node.tState = 0;\n Transition.disposed.add(node);\n }\n if (node.owned) {\n for (let i = 0; i < node.owned.length; i++) reset(node.owned[i]);\n }\n}\nfunction castError(err) {\n if (err instanceof Error) return err;\n return new Error(typeof err === \"string\" ? err : \"Unknown error\", {\n cause: err\n });\n}\nfunction runErrors(err, fns, owner) {\n try {\n for (const f of fns) f(err);\n } catch (e) {\n handleError(e, (owner && owner.owner) || null);\n }\n}\nfunction handleError(err, owner = Owner) {\n const fns = ERROR && owner && owner.context && owner.context[ERROR];\n const error = castError(err);\n if (!fns) throw error;\n if (Effects)\n Effects.push({\n fn() {\n runErrors(error, fns, owner);\n },\n state: STALE\n });\n else runErrors(error, fns, owner);\n}\nfunction resolveChildren(children) {\n if (typeof children === \"function\" && !children.length) return resolveChildren(children());\n if (Array.isArray(children)) {\n const results = [];\n for (let i = 0; i < children.length; i++) {\n const result = resolveChildren(children[i]);\n Array.isArray(result) ? results.push.apply(results, result) : results.push(result);\n }\n return results;\n }\n return children;\n}\nfunction createProvider(id, options) {\n return function provider(props) {\n let res;\n createRenderEffect(\n () =>\n (res = untrack(() => {\n Owner.context = {\n ...Owner.context,\n [id]: props.value\n };\n return children(() => props.children);\n })),\n undefined\n );\n return res;\n };\n}\nfunction onError(fn) {\n ERROR || (ERROR = Symbol(\"error\"));\n if (Owner === null);\n else if (Owner.context === null || !Owner.context[ERROR]) {\n Owner.context = {\n ...Owner.context,\n [ERROR]: [fn]\n };\n mutateContext(Owner, ERROR, [fn]);\n } else Owner.context[ERROR].push(fn);\n}\nfunction mutateContext(o, key, value) {\n if (o.owned) {\n for (let i = 0; i < o.owned.length; i++) {\n if (o.owned[i].context === o.context) mutateContext(o.owned[i], key, value);\n if (!o.owned[i].context) {\n o.owned[i].context = o.context;\n mutateContext(o.owned[i], key, value);\n } else if (!o.owned[i].context[key]) {\n o.owned[i].context[key] = value;\n mutateContext(o.owned[i], key, value);\n }\n }\n }\n}\n\nfunction observable(input) {\n return {\n subscribe(observer) {\n if (!(observer instanceof Object) || observer == null) {\n throw new TypeError(\"Expected the observer to be an object.\");\n }\n const handler =\n typeof observer === \"function\" ? observer : observer.next && observer.next.bind(observer);\n if (!handler) {\n return {\n unsubscribe() {}\n };\n }\n const dispose = createRoot(disposer => {\n createEffect(() => {\n const v = input();\n untrack(() => handler(v));\n });\n return disposer;\n });\n if (getOwner()) onCleanup(dispose);\n return {\n unsubscribe() {\n dispose();\n }\n };\n },\n [Symbol.observable || \"@@observable\"]() {\n return this;\n }\n };\n}\nfunction from(producer) {\n const [s, set] = createSignal(undefined, {\n equals: false\n });\n if (\"subscribe\" in producer) {\n const unsub = producer.subscribe(v => set(() => v));\n onCleanup(() => (\"unsubscribe\" in unsub ? unsub.unsubscribe() : unsub()));\n } else {\n const clean = producer(set);\n onCleanup(clean);\n }\n return s;\n}\n\nconst FALLBACK = Symbol(\"fallback\");\nfunction dispose(d) {\n for (let i = 0; i < d.length; i++) d[i]();\n}\nfunction mapArray(list, mapFn, options = {}) {\n let items = [],\n mapped = [],\n disposers = [],\n len = 0,\n indexes = mapFn.length > 1 ? [] : null;\n onCleanup(() => dispose(disposers));\n return () => {\n let newItems = list() || [],\n i,\n j;\n newItems[$TRACK];\n return untrack(() => {\n let newLen = newItems.length,\n newIndices,\n newIndicesNext,\n temp,\n tempdisposers,\n tempIndexes,\n start,\n end,\n newEnd,\n item;\n if (newLen === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n indexes && (indexes = []);\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot(disposer => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n } else if (len === 0) {\n mapped = new Array(newLen);\n for (j = 0; j < newLen; j++) {\n items[j] = newItems[j];\n mapped[j] = createRoot(mapper);\n }\n len = newLen;\n } else {\n temp = new Array(newLen);\n tempdisposers = new Array(newLen);\n indexes && (tempIndexes = new Array(newLen));\n for (\n start = 0, end = Math.min(len, newLen);\n start < end && items[start] === newItems[start];\n start++\n );\n for (\n end = len - 1, newEnd = newLen - 1;\n end >= start && newEnd >= start && items[end] === newItems[newEnd];\n end--, newEnd--\n ) {\n temp[newEnd] = mapped[end];\n tempdisposers[newEnd] = disposers[end];\n indexes && (tempIndexes[newEnd] = indexes[end]);\n }\n newIndices = new Map();\n newIndicesNext = new Array(newEnd + 1);\n for (j = newEnd; j >= start; j--) {\n item = newItems[j];\n i = newIndices.get(item);\n newIndicesNext[j] = i === undefined ? -1 : i;\n newIndices.set(item, j);\n }\n for (i = start; i <= end; i++) {\n item = items[i];\n j = newIndices.get(item);\n if (j !== undefined && j !== -1) {\n temp[j] = mapped[i];\n tempdisposers[j] = disposers[i];\n indexes && (tempIndexes[j] = indexes[i]);\n j = newIndicesNext[j];\n newIndices.set(item, j);\n } else disposers[i]();\n }\n for (j = start; j < newLen; j++) {\n if (j in temp) {\n mapped[j] = temp[j];\n disposers[j] = tempdisposers[j];\n if (indexes) {\n indexes[j] = tempIndexes[j];\n indexes[j](j);\n }\n } else mapped[j] = createRoot(mapper);\n }\n mapped = mapped.slice(0, (len = newLen));\n items = newItems.slice(0);\n }\n return mapped;\n });\n function mapper(disposer) {\n disposers[j] = disposer;\n if (indexes) {\n const [s, set] = createSignal(j);\n indexes[j] = set;\n return mapFn(newItems[j], s);\n }\n return mapFn(newItems[j]);\n }\n };\n}\nfunction indexArray(list, mapFn, options = {}) {\n let items = [],\n mapped = [],\n disposers = [],\n signals = [],\n len = 0,\n i;\n onCleanup(() => dispose(disposers));\n return () => {\n const newItems = list() || [];\n newItems[$TRACK];\n return untrack(() => {\n if (newItems.length === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n signals = [];\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot(disposer => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n return mapped;\n }\n if (items[0] === FALLBACK) {\n disposers[0]();\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n }\n for (i = 0; i < newItems.length; i++) {\n if (i < items.length && items[i] !== newItems[i]) {\n signals[i](() => newItems[i]);\n } else if (i >= items.length) {\n mapped[i] = createRoot(mapper);\n }\n }\n for (; i < items.length; i++) {\n disposers[i]();\n }\n len = signals.length = disposers.length = newItems.length;\n items = newItems.slice(0);\n return (mapped = mapped.slice(0, len));\n });\n function mapper(disposer) {\n disposers[i] = disposer;\n const [s, set] = createSignal(newItems[i]);\n signals[i] = set;\n return mapFn(s, i);\n }\n };\n}\n\nlet hydrationEnabled = false;\nfunction enableHydration() {\n hydrationEnabled = true;\n}\nfunction createComponent(Comp, props) {\n if (hydrationEnabled) {\n if (sharedConfig.context) {\n const c = sharedConfig.context;\n setHydrateContext(nextHydrateContext());\n const r = untrack(() => Comp(props || {}));\n setHydrateContext(c);\n return r;\n }\n }\n return untrack(() => Comp(props || {}));\n}\nfunction trueFn() {\n return true;\n}\nconst propTraps = {\n get(_, property, receiver) {\n if (property === $PROXY) return receiver;\n return _.get(property);\n },\n has(_, property) {\n if (property === $PROXY) return true;\n return _.has(property);\n },\n set: trueFn,\n deleteProperty: trueFn,\n getOwnPropertyDescriptor(_, property) {\n return {\n configurable: true,\n enumerable: true,\n get() {\n return _.get(property);\n },\n set: trueFn,\n deleteProperty: trueFn\n };\n },\n ownKeys(_) {\n return _.keys();\n }\n};\nfunction resolveSource(s) {\n return !(s = typeof s === \"function\" ? s() : s) ? {} : s;\n}\nfunction resolveSources() {\n for (let i = 0, length = this.length; i < length; ++i) {\n const v = this[i]();\n if (v !== undefined) return v;\n }\n}\nfunction mergeProps(...sources) {\n let proxy = false;\n for (let i = 0; i < sources.length; i++) {\n const s = sources[i];\n proxy = proxy || (!!s && $PROXY in s);\n sources[i] = typeof s === \"function\" ? ((proxy = true), createMemo(s)) : s;\n }\n if (proxy) {\n return new Proxy(\n {\n get(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n const v = resolveSource(sources[i])[property];\n if (v !== undefined) return v;\n }\n },\n has(property) {\n for (let i = sources.length - 1; i >= 0; i--) {\n if (property in resolveSource(sources[i])) return true;\n }\n return false;\n },\n keys() {\n const keys = [];\n for (let i = 0; i < sources.length; i++)\n keys.push(...Object.keys(resolveSource(sources[i])));\n return [...new Set(keys)];\n }\n },\n propTraps\n );\n }\n const sourcesMap = {};\n const defined = Object.create(null);\n for (let i = sources.length - 1; i >= 0; i--) {\n const source = sources[i];\n if (!source) continue;\n const sourceKeys = Object.getOwnPropertyNames(source);\n for (let i = sourceKeys.length - 1; i >= 0; i--) {\n const key = sourceKeys[i];\n if (key === \"__proto__\" || key === \"constructor\") continue;\n const desc = Object.getOwnPropertyDescriptor(source, key);\n if (!defined[key]) {\n defined[key] = desc.get\n ? {\n enumerable: true,\n configurable: true,\n get: resolveSources.bind((sourcesMap[key] = [desc.get.bind(source)]))\n }\n : desc.value !== undefined\n ? desc\n : undefined;\n } else {\n const sources = sourcesMap[key];\n if (sources) {\n if (desc.get) sources.push(desc.get.bind(source));\n else if (desc.value !== undefined) sources.push(() => desc.value);\n }\n }\n }\n }\n const target = {};\n const definedKeys = Object.keys(defined);\n for (let i = definedKeys.length - 1; i >= 0; i--) {\n const key = definedKeys[i],\n desc = defined[key];\n if (desc && desc.get) Object.defineProperty(target, key, desc);\n else target[key] = desc ? desc.value : undefined;\n }\n return target;\n}\nfunction splitProps(props, ...keys) {\n if ($PROXY in props) {\n const blocked = new Set(keys.length > 1 ? keys.flat() : keys[0]);\n const res = keys.map(k => {\n return new Proxy(\n {\n get(property) {\n return k.includes(property) ? props[property] : undefined;\n },\n has(property) {\n return k.includes(property) && property in props;\n },\n keys() {\n return k.filter(property => property in props);\n }\n },\n propTraps\n );\n });\n res.push(\n new Proxy(\n {\n get(property) {\n return blocked.has(property) ? undefined : props[property];\n },\n has(property) {\n return blocked.has(property) ? false : property in props;\n },\n keys() {\n return Object.keys(props).filter(k => !blocked.has(k));\n }\n },\n propTraps\n )\n );\n return res;\n }\n const otherObject = {};\n const objects = keys.map(() => ({}));\n for (const propName of Object.getOwnPropertyNames(props)) {\n const desc = Object.getOwnPropertyDescriptor(props, propName);\n const isDefaultDesc =\n !desc.get && !desc.set && desc.enumerable && desc.writable && desc.configurable;\n let blocked = false;\n let objectIndex = 0;\n for (const k of keys) {\n if (k.includes(propName)) {\n blocked = true;\n isDefaultDesc\n ? (objects[objectIndex][propName] = desc.value)\n : Object.defineProperty(objects[objectIndex], propName, desc);\n }\n ++objectIndex;\n }\n if (!blocked) {\n isDefaultDesc\n ? (otherObject[propName] = desc.value)\n : Object.defineProperty(otherObject, propName, desc);\n }\n }\n return [...objects, otherObject];\n}\nfunction lazy(fn) {\n let comp;\n let p;\n const wrap = props => {\n const ctx = sharedConfig.context;\n if (ctx) {\n const [s, set] = createSignal();\n sharedConfig.count || (sharedConfig.count = 0);\n sharedConfig.count++;\n (p || (p = fn())).then(mod => {\n setHydrateContext(ctx);\n sharedConfig.count--;\n set(() => mod.default);\n setHydrateContext();\n });\n comp = s;\n } else if (!comp) {\n const [s] = createResource(() => (p || (p = fn())).then(mod => mod.default));\n comp = s;\n }\n let Comp;\n return createMemo(\n () =>\n (Comp = comp()) &&\n untrack(() => {\n if (false);\n if (!ctx) return Comp(props);\n const c = sharedConfig.context;\n setHydrateContext(ctx);\n const r = Comp(props);\n setHydrateContext(c);\n return r;\n })\n );\n };\n wrap.preload = () => p || ((p = fn()).then(mod => (comp = () => mod.default)), p);\n return wrap;\n}\nlet counter = 0;\nfunction createUniqueId() {\n const ctx = sharedConfig.context;\n return ctx ? `${ctx.id}${ctx.count++}` : `cl-${counter++}`;\n}\n\nconst narrowedError = name => `Stale read from <${name}>.`;\nfunction For(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(mapArray(() => props.each, props.children, fallback || undefined));\n}\nfunction Index(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(indexArray(() => props.each, props.children, fallback || undefined));\n}\nfunction Show(props) {\n const keyed = props.keyed;\n const condition = createMemo(() => props.when, undefined, {\n equals: (a, b) => (keyed ? a === b : !a === !b)\n });\n return createMemo(\n () => {\n const c = condition();\n if (c) {\n const child = props.children;\n const fn = typeof child === \"function\" && child.length > 0;\n return fn\n ? untrack(() =>\n child(\n keyed\n ? c\n : () => {\n if (!untrack(condition)) throw narrowedError(\"Show\");\n return props.when;\n }\n )\n )\n : child;\n }\n return props.fallback;\n },\n undefined,\n undefined\n );\n}\nfunction Switch(props) {\n let keyed = false;\n const equals = (a, b) => (keyed ? a[1] === b[1] : !a[1] === !b[1]) && a[2] === b[2];\n const conditions = children(() => props.children),\n evalConditions = createMemo(\n () => {\n let conds = conditions();\n if (!Array.isArray(conds)) conds = [conds];\n for (let i = 0; i < conds.length; i++) {\n const c = conds[i].when;\n if (c) {\n keyed = !!conds[i].keyed;\n return [i, c, conds[i]];\n }\n }\n return [-1];\n },\n undefined,\n {\n equals\n }\n );\n return createMemo(\n () => {\n const [index, when, cond] = evalConditions();\n if (index < 0) return props.fallback;\n const c = cond.children;\n const fn = typeof c === \"function\" && c.length > 0;\n return fn\n ? untrack(() =>\n c(\n keyed\n ? when\n : () => {\n if (untrack(evalConditions)[0] !== index) throw narrowedError(\"Match\");\n return cond.when;\n }\n )\n )\n : c;\n },\n undefined,\n undefined\n );\n}\nfunction Match(props) {\n return props;\n}\nlet Errors;\nfunction resetErrorBoundaries() {\n Errors && [...Errors].forEach(fn => fn());\n}\nfunction ErrorBoundary(props) {\n let err;\n if (sharedConfig.context && sharedConfig.load)\n err = sharedConfig.load(sharedConfig.context.id + sharedConfig.context.count);\n const [errored, setErrored] = createSignal(err, undefined);\n Errors || (Errors = new Set());\n Errors.add(setErrored);\n onCleanup(() => Errors.delete(setErrored));\n return createMemo(\n () => {\n let e;\n if ((e = errored())) {\n const f = props.fallback;\n return typeof f === \"function\" && f.length ? untrack(() => f(e, () => setErrored())) : f;\n }\n return catchError(() => props.children, setErrored);\n },\n undefined,\n undefined\n );\n}\n\nconst suspenseListEquals = (a, b) =>\n a.showContent === b.showContent && a.showFallback === b.showFallback;\nconst SuspenseListContext = createContext();\nfunction SuspenseList(props) {\n let [wrapper, setWrapper] = createSignal(() => ({\n inFallback: false\n })),\n show;\n const listContext = useContext(SuspenseListContext);\n const [registry, setRegistry] = createSignal([]);\n if (listContext) {\n show = listContext.register(createMemo(() => wrapper()().inFallback));\n }\n const resolved = createMemo(\n prev => {\n const reveal = props.revealOrder,\n tail = props.tail,\n { showContent = true, showFallback = true } = show ? show() : {},\n reg = registry(),\n reverse = reveal === \"backwards\";\n if (reveal === \"together\") {\n const all = reg.every(inFallback => !inFallback());\n const res = reg.map(() => ({\n showContent: all && showContent,\n showFallback\n }));\n res.inFallback = !all;\n return res;\n }\n let stop = false;\n let inFallback = prev.inFallback;\n const res = [];\n for (let i = 0, len = reg.length; i < len; i++) {\n const n = reverse ? len - i - 1 : i,\n s = reg[n]();\n if (!stop && !s) {\n res[n] = {\n showContent,\n showFallback\n };\n } else {\n const next = !stop;\n if (next) inFallback = true;\n res[n] = {\n showContent: next,\n showFallback: !tail || (next && tail === \"collapsed\") ? showFallback : false\n };\n stop = true;\n }\n }\n if (!stop) inFallback = false;\n res.inFallback = inFallback;\n return res;\n },\n {\n inFallback: false\n }\n );\n setWrapper(() => resolved);\n return createComponent(SuspenseListContext.Provider, {\n value: {\n register: inFallback => {\n let index;\n setRegistry(registry => {\n index = registry.length;\n return [...registry, inFallback];\n });\n return createMemo(() => resolved()[index], undefined, {\n equals: suspenseListEquals\n });\n }\n },\n get children() {\n return props.children;\n }\n });\n}\nfunction Suspense(props) {\n let counter = 0,\n show,\n ctx,\n p,\n flicker,\n error;\n const [inFallback, setFallback] = createSignal(false),\n SuspenseContext = getSuspenseContext(),\n store = {\n increment: () => {\n if (++counter === 1) setFallback(true);\n },\n decrement: () => {\n if (--counter === 0) setFallback(false);\n },\n inFallback,\n effects: [],\n resolved: false\n },\n owner = getOwner();\n if (sharedConfig.context && sharedConfig.load) {\n const key = sharedConfig.context.id + sharedConfig.context.count;\n let ref = sharedConfig.load(key);\n if (ref) {\n if (typeof ref !== \"object\" || ref.status !== \"success\") p = ref;\n else sharedConfig.gather(key);\n }\n if (p && p !== \"$$f\") {\n const [s, set] = createSignal(undefined, {\n equals: false\n });\n flicker = s;\n p.then(\n () => {\n if (sharedConfig.done) return set();\n sharedConfig.gather(key);\n setHydrateContext(ctx);\n set();\n setHydrateContext();\n },\n err => {\n error = err;\n set();\n }\n );\n }\n }\n const listContext = useContext(SuspenseListContext);\n if (listContext) show = listContext.register(store.inFallback);\n let dispose;\n onCleanup(() => dispose && dispose());\n return createComponent(SuspenseContext.Provider, {\n value: store,\n get children() {\n return createMemo(() => {\n if (error) throw error;\n ctx = sharedConfig.context;\n if (flicker) {\n flicker();\n return (flicker = undefined);\n }\n if (ctx && p === \"$$f\") setHydrateContext();\n const rendered = createMemo(() => props.children);\n return createMemo(prev => {\n const inFallback = store.inFallback(),\n { showContent = true, showFallback = true } = show ? show() : {};\n if ((!inFallback || (p && p !== \"$$f\")) && showContent) {\n store.resolved = true;\n dispose && dispose();\n dispose = ctx = p = undefined;\n resumeEffects(store.effects);\n return rendered();\n }\n if (!showFallback) return;\n if (dispose) return prev;\n return createRoot(disposer => {\n dispose = disposer;\n if (ctx) {\n setHydrateContext({\n id: ctx.id + \"f\",\n count: 0\n });\n ctx = undefined;\n }\n return props.fallback;\n }, owner);\n });\n });\n }\n });\n}\n\nconst DEV = undefined;\n\nexport {\n $DEVCOMP,\n $PROXY,\n $TRACK,\n DEV,\n ErrorBoundary,\n For,\n Index,\n Match,\n Show,\n Suspense,\n SuspenseList,\n Switch,\n batch,\n cancelCallback,\n catchError,\n children,\n createComponent,\n createComputed,\n createContext,\n createDeferred,\n createEffect,\n createMemo,\n createReaction,\n createRenderEffect,\n createResource,\n createRoot,\n createSelector,\n createSignal,\n createUniqueId,\n enableExternalSource,\n enableHydration,\n enableScheduling,\n equalFn,\n from,\n getListener,\n getOwner,\n indexArray,\n lazy,\n mapArray,\n mergeProps,\n observable,\n on,\n onCleanup,\n onError,\n onMount,\n requestCallback,\n resetErrorBoundaries,\n runWithOwner,\n sharedConfig,\n splitProps,\n startTransition,\n untrack,\n useContext,\n useTransition\n};\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { createSignal } from 'solid-js';\nimport type { ElementNode } from './node/index.js';\nexport const [activeElement, setActiveElement] = createSignal<\n ElementNode | undefined\n>(undefined);\n","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Texture Usage Tracker for Usage Based Texture Garbage Collection\n */\nexport class TextureUsageTracker {\n releaseCallback;\n constructor(releaseCallback) {\n this.releaseCallback = releaseCallback;\n }\n}\n//# sourceMappingURL=TextureUsageTracker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { TextureUsageTracker } from './TextureUsageTracker.js';\n/**\n * Usage-based Texture Garbage Collection Registry\n */\nexport class ManualCountTextureUsageTracker extends TextureUsageTracker {\n textureMap = new Map();\n zeroReferenceTextureSet = new Set();\n options;\n constructor(releaseCallback, options) {\n super(releaseCallback);\n this.options = {\n textureCleanupIntervalMs: options.textureCleanupIntervalMs ?? 10000,\n textureCleanupAgeThreadholdMs: options.textureCleanupAgeThreadholdMs ?? 60000,\n };\n // Periodically check for textures that are no longer referenced by any\n // Nodes and notify RendererMain to release them.\n setInterval(() => {\n const now = Date.now();\n const thresholdMs = this.options.textureCleanupAgeThreadholdMs;\n for (const textureRefInfo of this.zeroReferenceTextureSet) {\n if (now - textureRefInfo.lastUpdate > thresholdMs) {\n this.releaseCallback(textureRefInfo.id);\n this.textureMap.delete(textureRefInfo.id);\n this.zeroReferenceTextureSet.delete(textureRefInfo);\n }\n }\n }, this.options.textureCleanupIntervalMs);\n }\n registerTexture(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n if (!this.textureMap.has(textureId)) {\n const textureRefInfo = {\n id: textureId,\n nodeRefCount: 0,\n lastUpdate: Date.now(),\n };\n this.textureMap.set(textureId, textureRefInfo);\n this.zeroReferenceTextureSet.add(textureRefInfo);\n }\n }\n incrementTextureRefCount(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n let textureRefInfo = this.textureMap.get(textureId);\n if (!textureRefInfo) {\n // Texture has not been registered yet, so register it now.\n // This may happen if the TextureRef was cleaned up from the registry\n // but was still alive in memory and eventually re-used.\n this.registerTexture(texture);\n textureRefInfo = this.textureMap.get(textureId);\n }\n assertTruthy(textureRefInfo, 'Texture must have been registered');\n if (texture.txType === 'SubTexture') {\n // If this is a SubTexture, then increment the reference count of the\n // parent texture as well.\n this.incrementTextureRefCount(texture.props.texture);\n }\n textureRefInfo.nodeRefCount++;\n textureRefInfo.lastUpdate = Date.now();\n if (this.zeroReferenceTextureSet.has(textureRefInfo)) {\n this.zeroReferenceTextureSet.delete(textureRefInfo);\n }\n }\n decrementTextureRefCount(texture) {\n const textureId = texture.options?.id;\n assertTruthy(textureId, 'Texture must have an id to be registered');\n const textureRefInfo = this.textureMap.get(textureId);\n assertTruthy(textureRefInfo, 'Texture must have been registered');\n textureRefInfo.nodeRefCount--;\n textureRefInfo.lastUpdate = Date.now();\n if (textureRefInfo.nodeRefCount === 0) {\n this.zeroReferenceTextureSet.add(textureRefInfo);\n }\n if (texture.txType === 'SubTexture') {\n // If this is a SubTexture, then decrement the reference count of the\n // parent texture as well.\n this.decrementTextureRefCount(texture.props.texture);\n }\n }\n}\n//# sourceMappingURL=ManualCountTextureUsageTracker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { TextureUsageTracker } from './TextureUsageTracker.js';\nexport class FinalizationRegistryTextureUsageTracker extends TextureUsageTracker {\n registry;\n constructor(releaseCallback) {\n super(releaseCallback);\n this.registry = new FinalizationRegistry(releaseCallback);\n }\n registerTexture(texture) {\n assertTruthy(texture.options?.id, 'Texture must have an ID to be registered');\n this.registry.register(texture, texture.options?.id);\n }\n incrementTextureRefCount() {\n // No-op for FinalizationRegistry\n }\n decrementTextureRefCount() {\n // No-op for FinalizationRegistry\n }\n}\n//# sourceMappingURL=FinalizationRegistryTextureUsageTracker.js.map","import {} from './RendererMain.js';\nimport { isProductionEnvironment } from '../utils.js';\nconst stylePropertyMap = {\n alpha: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'opacity', value: `${v}` };\n },\n x: (x) => {\n return { prop: 'left', value: `${x}px` };\n },\n y: (y) => {\n return { prop: 'top', value: `${y}px` };\n },\n width: (w) => {\n if (w === 0) {\n return null;\n }\n return { prop: 'width', value: `${w}px` };\n },\n height: (h) => {\n if (h === 0) {\n return null;\n }\n return { prop: 'height', value: `${h}px` };\n },\n zIndex: () => 'zIndex',\n fontFamily: () => 'font-family',\n fontSize: () => 'font-size',\n fontStyle: () => 'font-style',\n fontWeight: () => 'font-weight',\n fontStretch: () => 'font-stretch',\n lineHeight: () => 'line-height',\n letterSpacing: () => 'letter-spacing',\n textAlign: () => 'text-align',\n overflowSuffix: () => 'overflow-suffix',\n maxLines: () => 'max-lines',\n contain: () => 'contain',\n verticalAlign: () => 'vertical-align',\n clipping: (v) => {\n if (v === false) {\n return null;\n }\n return { prop: 'overflow', value: v ? 'hidden' : 'visible' };\n },\n rotation: (v) => {\n if (v === 0) {\n return null;\n }\n return { prop: 'transform', value: `rotate(${v}rad)` };\n },\n scale: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scale(${v})` };\n },\n scaleX: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scaleX(${v})` };\n },\n scaleY: (v) => {\n if (v === 1) {\n return null;\n }\n return { prop: 'transform', value: `scaleY(${v})` };\n },\n color: (v) => {\n if (v === 0) {\n return null;\n }\n return { prop: 'color', value: convertColorToRgba(v) };\n },\n};\nconst convertColorToRgba = (color) => {\n const a = (color & 0xff) / 255;\n const b = (color >> 8) & 0xff;\n const g = (color >> 16) & 0xff;\n const r = (color >> 24) & 0xff;\n return `rgba(${r},${g},${b},${a})`;\n};\nconst domPropertyMap = {\n id: 'id',\n};\nconst gradientColorPropertyMap = [\n 'colorTop',\n 'colorBottom',\n 'colorLeft',\n 'colorRight',\n 'colorTl',\n 'colorTr',\n 'colorBl',\n 'colorBr',\n];\nexport class Inspector {\n root = null;\n canvas = null;\n height = 1080;\n width = 1920;\n scaleX = 1;\n scaleY = 1;\n constructor(canvas, settings) {\n if (isProductionEnvironment())\n return;\n if (!settings) {\n throw new Error('settings is required');\n }\n // calc dimensions based on the devicePixelRatio\n this.height = Math.ceil(settings.appHeight ?? 1080 / (settings.deviceLogicalPixelRatio ?? 1));\n this.width = Math.ceil(settings.appWidth ?? 1900 / (settings.deviceLogicalPixelRatio ?? 1));\n this.scaleX = settings.deviceLogicalPixelRatio ?? 1;\n this.scaleY = settings.deviceLogicalPixelRatio ?? 1;\n this.canvas = canvas;\n this.root = document.createElement('div');\n this.setRootPosition();\n document.body.appendChild(this.root);\n //listen for changes on canvas\n const mutationObserver = new MutationObserver(this.setRootPosition.bind(this));\n mutationObserver.observe(canvas, {\n attributes: true,\n childList: false,\n subtree: false,\n });\n // Create a ResizeObserver to watch for changes in the element's size\n const resizeObserver = new ResizeObserver(this.setRootPosition.bind(this));\n resizeObserver.observe(canvas);\n //listen for changes on window\n window.addEventListener('resize', this.setRootPosition.bind(this));\n console.warn('Inspector is enabled, this will impact performance');\n }\n setRootPosition() {\n if (this.root === null || this.canvas === null) {\n return;\n }\n // get the world position of the canvas object, so we can match the inspector to it\n const rect = this.canvas.getBoundingClientRect();\n const top = document.documentElement.scrollTop + rect.top;\n const left = document.documentElement.scrollLeft + rect.left;\n this.root.id = 'root';\n this.root.style.left = `${left}px`;\n this.root.style.top = `${top}px`;\n this.root.style.width = `${this.width}px`;\n this.root.style.height = `${this.height}px`;\n this.root.style.position = 'absolute';\n this.root.style.transformOrigin = '0 0 0';\n this.root.style.transform = `scale(${this.scaleX}, ${this.scaleY})`;\n this.root.style.overflow = 'hidden';\n this.root.style.zIndex = '65534';\n }\n createDiv(node, properties) {\n const div = document.createElement('div');\n div.style.position = 'absolute';\n div.id = node.id.toString();\n // set initial properties\n for (const key in properties) {\n this.updateNodeProperty(div, \n // really typescript? really?\n key, properties[key]);\n }\n return div;\n }\n createNode(driver, properties) {\n const node = driver.createNode(properties);\n const div = this.createDiv(node, properties);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n div.node = node;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n node.div = div;\n return this.createProxy(node, div);\n }\n createTextNode(driver, properties) {\n const node = driver.createTextNode(properties);\n const div = this.createDiv(node, properties);\n return this.createProxy(node, div);\n }\n createProxy(node, div) {\n return new Proxy(node, {\n set: (target, property, value) => {\n this.updateNodeProperty(div, property, value);\n return Reflect.set(target, property, value);\n },\n get: (target, property, receiver) => {\n if (property === 'destroy') {\n this.destroyNode(target);\n }\n if (property === 'animate') {\n return (props, settings) => {\n const anim = target.animate(props, settings);\n // Trap the animate start function so we can update the inspector accordingly\n return new Proxy(anim, {\n get: (target, property, receiver) => {\n if (property === 'start') {\n this.animateNode(div, node, props, settings);\n }\n return Reflect.get(target, property, receiver);\n },\n });\n };\n }\n return Reflect.get(target, property, receiver);\n },\n });\n }\n destroyNode(node) {\n const div = document.getElementById(node.id.toString());\n div?.remove();\n }\n updateNodeProperty(div, property, \n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value) {\n if (this.root === null || value === undefined || value === null) {\n return;\n }\n /**\n * Special case for parent property\n */\n if (property === 'parent') {\n const parentId = value.id;\n // only way to detect if the parent is the root node\n // if you are reading this and have a better way, please let me know\n if (parentId === 1) {\n this.root.appendChild(div);\n return;\n }\n const parent = document.getElementById(parentId.toString());\n parent?.appendChild(div);\n return;\n }\n // special case for text\n if (property === 'text') {\n div.innerHTML = String(value);\n // hide text because we can't render SDF fonts\n // it would look weird and obstruct the WebGL rendering\n div.style.visibility = 'hidden';\n return;\n }\n // special case for images\n // we're not setting any CSS properties to avoid images getting loaded twice\n // as the renderer will handle the loading of the image. Setting it to `data-src`\n if (property === 'src' && value) {\n div.setAttribute(`data-src`, String(value));\n return;\n }\n // special case for color gradients (normal colors are handled by the stylePropertyMap)\n // FIXME the renderer seems to return the same number for all colors\n // if (gradientColorPropertyMap.includes(property as string)) {\n // const color = convertColorToRgba(value as number);\n // div.setAttribute(`data-${property}`, color);\n // return;\n // }\n // CSS mappable attribute\n if (stylePropertyMap[property]) {\n const mappedStyleResponse = stylePropertyMap[property]?.(value);\n if (mappedStyleResponse === null) {\n return;\n }\n if (typeof mappedStyleResponse === 'string') {\n div.style.setProperty(mappedStyleResponse, String(value));\n return;\n }\n if (typeof mappedStyleResponse === 'object') {\n div.style.setProperty(mappedStyleResponse.prop, mappedStyleResponse.value);\n }\n return;\n }\n // DOM properties\n if (domPropertyMap[property]) {\n div.setAttribute(String(stylePropertyMap[property]), String(value));\n return;\n }\n // custom data properties\n if (property === 'data') {\n for (const key in value) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n div.setAttribute(`data-${key}`, String(value[key]));\n }\n return;\n }\n }\n // simple animation handler\n animateNode(div, node, props, settings) {\n const { duration = 1000, delay = 0,\n // easing = 'linear',\n // repeat = 0,\n // loop = false,\n // stopMethod = false,\n } = settings;\n const { x, y, width, height, alpha = 1, rotation = 0, scale = 1, color, } = props;\n // ignoring loops and repeats for now, as that might be a bit too much for the inspector\n function animate() {\n setTimeout(() => {\n div.style.top = `${y}px`;\n div.style.left = `${x}px`;\n div.style.width = `${width}px`;\n div.style.height = `${height}px`;\n div.style.opacity = `${alpha}`;\n div.style.rotate = `${rotation}rad`;\n div.style.scale = `${scale}`;\n div.style.color = convertColorToRgba(color);\n }, duration);\n }\n setTimeout(animate, delay);\n }\n}\n//# sourceMappingURL=Inspector.js.map","export class ShaderEffect {\n priority = 1;\n name = '';\n ref;\n target;\n passParameters = '';\n declaredUniforms = '';\n uniformInfo = {};\n static uniforms = {};\n static methods;\n static onShaderMask;\n static onColorize;\n static onEffectMask;\n static getEffectKey(props) {\n return '';\n }\n static getMethodParameters(uniforms, props) {\n const res = [];\n for (const u in uniforms) {\n const uni = uniforms[u];\n let define = '';\n if (uni.size) {\n define = `[${uni.size(props)}]`;\n }\n res.push(`${uni.type} ${u}${define}`);\n }\n return res.join(',');\n }\n constructor(options) {\n const { ref, target, props = {} } = options;\n this.ref = ref;\n this.target = target;\n const uniformInfo = {};\n const passParameters = [];\n let declaredUniforms = '';\n const uniforms = this.constructor.uniforms || {};\n for (const u in uniforms) {\n const unif = uniforms[u];\n const uniType = unif.type;\n //make unique uniform name\n const uniformName = `${ref}_${u}`;\n let define = '';\n if (unif.size) {\n define = `[${unif.size(props)}]`;\n }\n passParameters.push(uniformName);\n declaredUniforms += `uniform ${uniType} ${uniformName}${define};`;\n uniformInfo[u] = { name: uniformName, uniform: uniforms[u].method };\n }\n this.passParameters = passParameters.join(',');\n this.declaredUniforms = declaredUniforms;\n this.uniformInfo = uniformInfo;\n }\n static resolveDefaults(props) {\n return {};\n }\n static makeEffectKey(props) {\n return false;\n }\n}\n//# sourceMappingURL=ShaderEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst trPropSetterDefaults = {\n x: (state, value) => {\n state.props.x = value;\n },\n y: (state, value) => {\n state.props.y = value;\n },\n width: (state, value) => {\n state.props.width = value;\n },\n height: (state, value) => {\n state.props.height = value;\n },\n color: (state, value) => {\n state.props.color = value;\n },\n zIndex: (state, value) => {\n state.props.zIndex = value;\n },\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n },\n text: (state, value) => {\n state.props.text = value;\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n },\n contain: (state, value) => {\n state.props.contain = value;\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n },\n scrollable: (state, value) => {\n state.props.scrollable = value;\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n },\n debug: (state, value) => {\n state.props.debug = value;\n },\n};\nexport class TextRenderer {\n stage;\n set;\n constructor(stage) {\n this.stage = stage;\n const propSetters = {\n ...trPropSetterDefaults,\n ...this.getPropertySetters(),\n };\n // For each prop setter add a wrapper method that checks if the prop is\n // different before calling the setter\n this.set = Object.freeze(Object.fromEntries(Object.entries(propSetters).map(([key, setter]) => {\n return [\n key,\n (state, value) => {\n if (state.props[key] !== value) {\n setter(state, value);\n // Assume any prop change will require a render\n // This is required because otherwise a paused RAF will result\n // in renders when text props are changed.\n this.stage.requestRender();\n }\n },\n ];\n })));\n }\n setStatus(state, status, error) {\n // Don't emit the same status twice\n if (state.status === status) {\n return;\n }\n state.status = status;\n state.emitter.emit(status, error);\n }\n /**\n * Allows the CoreTextNode to communicate changes to the isRenderable state of\n * the itself.\n *\n * @param state\n * @param renderable\n */\n setIsRenderable(state, renderable) {\n state.isRenderable = renderable;\n }\n /**\n * Destroy/Clean up the state object\n *\n * @remarks\n * Opposite of createState(). Frees any event listeners / resources held by\n * the state that may not reliably get garbage collected.\n *\n * @param state\n */\n destroyState(state) {\n const stateEvents = ['loading', 'loaded', 'failed'];\n // Remove the old event listeners from previous state obj there was one\n stateEvents.forEach((eventName) => {\n state.emitter.off(eventName);\n });\n }\n /**\n * Schedule a state update via queueMicrotask\n *\n * @remarks\n * This method is used to schedule a state update via queueMicrotask. This\n * method should be called whenever a state update is needed, and it will\n * ensure that the state is only updated once per microtask.\n * @param state\n * @returns\n */\n scheduleUpdateState(state) {\n if (state.updateScheduled) {\n return;\n }\n state.updateScheduled = true;\n queueMicrotask(() => {\n state.updateScheduled = false;\n this.updateState(state);\n });\n }\n}\n//# sourceMappingURL=TextRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* eslint-disable @typescript-eslint/no-non-null-assertion */\nimport { getRgbaString } from '../../lib/utils.js';\nconst MAX_TEXTURE_DIMENSION = 2048;\n/**\n * Calculate height for the canvas\n *\n * @param textBaseline\n * @param fontSize\n * @param lineHeight\n * @param numLines\n * @param offsetY\n * @returns\n */\nfunction calcHeight(textBaseline, fontSize, lineHeight, numLines, offsetY) {\n const baselineOffset = textBaseline !== 'bottom' ? 0.5 * fontSize : 0;\n return (lineHeight * (numLines - 1) +\n baselineOffset +\n Math.max(lineHeight, fontSize) +\n (offsetY || 0));\n}\nexport class LightningTextTextureRenderer {\n _canvas;\n _context;\n _settings;\n renderInfo;\n constructor(canvas, context) {\n this._canvas = canvas;\n this._context = context;\n this._settings = this.mergeDefaults({});\n }\n set settings(v) {\n this._settings = this.mergeDefaults(v);\n }\n get settings() {\n return this._settings;\n }\n getPrecision() {\n return this._settings.precision;\n }\n setFontProperties() {\n this._context.font = this._getFontSetting();\n this._context.textBaseline = this._settings.textBaseline;\n }\n _getFontSetting() {\n const ff = [this._settings.fontFace];\n const ffs = [];\n for (let i = 0, n = ff.length; i < n; i++) {\n if (ff[i] === 'serif' || ff[i] === 'sans-serif') {\n ffs.push(ff[i]);\n }\n else {\n ffs.push(`\"${ff[i]}\"`);\n }\n }\n return `${this._settings.fontStyle} ${this._settings.fontSize * this.getPrecision()}px ${ffs.join(',')}`;\n }\n _load() {\n if (true && document.fonts) {\n const fontSetting = this._getFontSetting();\n try {\n if (!document.fonts.check(fontSetting, this._settings.text)) {\n // Use a promise that waits for loading.\n return document.fonts\n .load(fontSetting, this._settings.text)\n .catch((err) => {\n // Just load the fallback font.\n console.warn('[Lightning] Font load error', err, fontSetting);\n })\n .then(() => {\n if (!document.fonts.check(fontSetting, this._settings.text)) {\n console.warn('[Lightning] Font not found', fontSetting);\n }\n });\n }\n }\n catch (e) {\n console.warn(\"[Lightning] Can't check font loading for \" + fontSetting);\n }\n }\n }\n calculateRenderInfo() {\n const renderInfo = {};\n const precision = this.getPrecision();\n const paddingLeft = this._settings.paddingLeft * precision;\n const paddingRight = this._settings.paddingRight * precision;\n const fontSize = this._settings.fontSize * precision;\n let offsetY = this._settings.offsetY === null\n ? null\n : this._settings.offsetY * precision;\n let lineHeight = (this._settings.lineHeight || fontSize) * precision;\n const w = this._settings.w * precision;\n const h = this._settings.h * precision;\n let wordWrapWidth = this._settings.wordWrapWidth * precision;\n const cutSx = this._settings.cutSx * precision;\n const cutEx = this._settings.cutEx * precision;\n const cutSy = this._settings.cutSy * precision;\n const cutEy = this._settings.cutEy * precision;\n const letterSpacing = (this._settings.letterSpacing || 0) * precision;\n const textIndent = this._settings.textIndent * precision;\n // Set font properties.\n this.setFontProperties();\n // Total width.\n let width = w || 2048 / this.getPrecision();\n // Inner width.\n let innerWidth = width - paddingLeft;\n if (innerWidth < 10) {\n width += 10 - innerWidth;\n innerWidth = 10;\n }\n if (!wordWrapWidth) {\n wordWrapWidth = innerWidth;\n }\n // Text overflow\n if (this._settings.textOverflow && !this._settings.wordWrap) {\n let suffix;\n switch (this._settings.textOverflow) {\n case 'clip':\n suffix = '';\n break;\n case 'ellipsis':\n suffix = this._settings.overflowSuffix;\n break;\n default:\n suffix = this._settings.textOverflow;\n }\n this._settings.text = this.wrapWord(this._settings.text, wordWrapWidth - textIndent, suffix);\n }\n // word wrap\n // preserve original text\n let linesInfo;\n if (this._settings.wordWrap) {\n linesInfo = this.wrapText(this._settings.text, wordWrapWidth, letterSpacing, textIndent);\n }\n else {\n linesInfo = { l: this._settings.text.split(/(?:\\r\\n|\\r|\\n)/), n: [] };\n const n = linesInfo.l.length;\n for (let i = 0; i < n - 1; i++) {\n linesInfo.n.push(i);\n }\n }\n let lines = linesInfo.l;\n if (this._settings.maxLines && lines.length > this._settings.maxLines) {\n const usedLines = lines.slice(0, this._settings.maxLines);\n let otherLines = null;\n if (this._settings.overflowSuffix) {\n // Wrap again with max lines suffix enabled.\n const w = this._settings.overflowSuffix\n ? this.measureText(this._settings.overflowSuffix)\n : 0;\n const al = this.wrapText(usedLines[usedLines.length - 1], wordWrapWidth - w, letterSpacing, textIndent);\n usedLines[usedLines.length - 1] = `${al.l[0]}${this._settings.overflowSuffix}`;\n otherLines = [al.l.length > 1 ? al.l[1] : ''];\n }\n else {\n otherLines = [''];\n }\n // Re-assemble the remaining text.\n let i;\n const n = lines.length;\n let j = 0;\n const m = linesInfo.n.length;\n for (i = this._settings.maxLines; i < n; i++) {\n otherLines[j] += `${otherLines[j] ? ' ' : ''}${lines[i]}`;\n if (i + 1 < m && linesInfo.n[i + 1]) {\n j++;\n }\n }\n renderInfo.remainingText = otherLines.join('\\n');\n renderInfo.moreTextLines = true;\n lines = usedLines;\n }\n else {\n renderInfo.moreTextLines = false;\n renderInfo.remainingText = '';\n }\n // calculate text width\n let maxLineWidth = 0;\n const lineWidths = [];\n for (let i = 0; i < lines.length; i++) {\n const lineWidth = this.measureText(lines[i], letterSpacing) + (i === 0 ? textIndent : 0);\n lineWidths.push(lineWidth);\n maxLineWidth = Math.max(maxLineWidth, lineWidth);\n }\n renderInfo.lineWidths = lineWidths;\n if (!w) {\n // Auto-set width to max text length.\n width = maxLineWidth + paddingLeft + paddingRight;\n innerWidth = maxLineWidth;\n }\n // calculate text height\n lineHeight = lineHeight || fontSize;\n let height;\n if (h) {\n height = h;\n }\n else {\n height = calcHeight(this._settings.textBaseline, fontSize, lineHeight, lines.length, offsetY);\n }\n if (offsetY === null) {\n offsetY = fontSize;\n }\n renderInfo.w = width;\n renderInfo.h = height;\n renderInfo.lines = lines;\n renderInfo.precision = precision;\n if (!width) {\n // To prevent canvas errors.\n width = 1;\n }\n if (!height) {\n // To prevent canvas errors.\n height = 1;\n }\n if (cutSx || cutEx) {\n width = Math.min(width, cutEx - cutSx);\n }\n if (cutSy || cutEy) {\n height = Math.min(height, cutEy - cutSy);\n }\n renderInfo.width = width;\n renderInfo.innerWidth = innerWidth;\n renderInfo.height = height;\n renderInfo.fontSize = fontSize;\n renderInfo.cutSx = cutSx;\n renderInfo.cutSy = cutSy;\n renderInfo.cutEx = cutEx;\n renderInfo.cutEy = cutEy;\n renderInfo.lineHeight = lineHeight;\n renderInfo.lineWidths = lineWidths;\n renderInfo.offsetY = offsetY;\n renderInfo.paddingLeft = paddingLeft;\n renderInfo.paddingRight = paddingRight;\n renderInfo.letterSpacing = letterSpacing;\n renderInfo.textIndent = textIndent;\n return renderInfo;\n }\n draw(renderInfo, linesOverride) {\n const precision = this.getPrecision();\n // Allow lines to be overriden for partial rendering.\n const lines = linesOverride?.lines || renderInfo.lines;\n const lineWidths = linesOverride?.lineWidths || renderInfo.lineWidths;\n const height = linesOverride\n ? calcHeight(this._settings.textBaseline, renderInfo.fontSize, renderInfo.lineHeight, linesOverride.lines.length, this._settings.offsetY === null\n ? null\n : this._settings.offsetY * precision)\n : renderInfo.height;\n // Add extra margin to prevent issue with clipped text when scaling.\n this._canvas.width = Math.min(Math.ceil(renderInfo.width + this._settings.textRenderIssueMargin), MAX_TEXTURE_DIMENSION);\n this._canvas.height = Math.min(Math.ceil(height), MAX_TEXTURE_DIMENSION);\n // Canvas context has been reset.\n this.setFontProperties();\n if (renderInfo.fontSize >= 128) {\n // WpeWebKit bug: must force compositing because cairo-traps-compositor will not work with text first.\n this._context.globalAlpha = 0.01;\n this._context.fillRect(0, 0, 0.01, 0.01);\n this._context.globalAlpha = 1.0;\n }\n if (renderInfo.cutSx || renderInfo.cutSy) {\n this._context.translate(-renderInfo.cutSx, -renderInfo.cutSy);\n }\n let linePositionX;\n let linePositionY;\n const drawLines = [];\n // Draw lines line by line.\n for (let i = 0, n = lines.length; i < n; i++) {\n linePositionX = i === 0 ? renderInfo.textIndent : 0;\n // By default, text is aligned to top\n linePositionY = i * renderInfo.lineHeight + renderInfo.offsetY;\n if (this._settings.verticalAlign == 'middle') {\n linePositionY += (renderInfo.lineHeight - renderInfo.fontSize) / 2;\n }\n else if (this._settings.verticalAlign == 'bottom') {\n linePositionY += renderInfo.lineHeight - renderInfo.fontSize;\n }\n if (this._settings.textAlign === 'right') {\n linePositionX += renderInfo.innerWidth - lineWidths[i];\n }\n else if (this._settings.textAlign === 'center') {\n linePositionX += (renderInfo.innerWidth - lineWidths[i]) / 2;\n }\n linePositionX += renderInfo.paddingLeft;\n drawLines.push({\n text: lines[i],\n x: linePositionX,\n y: linePositionY,\n w: lineWidths[i],\n });\n }\n // Highlight.\n if (this._settings.highlight) {\n const color = this._settings.highlightColor;\n const hlHeight = this._settings.highlightHeight * precision || renderInfo.fontSize * 1.5;\n const offset = this._settings.highlightOffset * precision;\n const hlPaddingLeft = this._settings.highlightPaddingLeft !== null\n ? this._settings.highlightPaddingLeft * precision\n : renderInfo.paddingLeft;\n const hlPaddingRight = this._settings.highlightPaddingRight !== null\n ? this._settings.highlightPaddingRight * precision\n : renderInfo.paddingRight;\n this._context.fillStyle = getRgbaString(color);\n for (let i = 0; i < drawLines.length; i++) {\n const drawLine = drawLines[i];\n this._context.fillRect(drawLine.x - hlPaddingLeft, drawLine.y - renderInfo.offsetY + offset, drawLine.w + hlPaddingRight + hlPaddingLeft, hlHeight);\n }\n }\n // Text shadow.\n let prevShadowSettings = null;\n if (this._settings.shadow) {\n prevShadowSettings = [\n this._context.shadowColor,\n this._context.shadowOffsetX,\n this._context.shadowOffsetY,\n this._context.shadowBlur,\n ];\n this._context.shadowColor = getRgbaString(this._settings.shadowColor);\n this._context.shadowOffsetX = this._settings.shadowOffsetX * precision;\n this._context.shadowOffsetY = this._settings.shadowOffsetY * precision;\n this._context.shadowBlur = this._settings.shadowBlur * precision;\n }\n this._context.fillStyle = getRgbaString(this._settings.textColor);\n for (let i = 0, n = drawLines.length; i < n; i++) {\n const drawLine = drawLines[i];\n if (renderInfo.letterSpacing === 0) {\n this._context.fillText(drawLine.text, drawLine.x, drawLine.y);\n }\n else {\n const textSplit = drawLine.text.split('');\n let x = drawLine.x;\n for (let i = 0, j = textSplit.length; i < j; i++) {\n this._context.fillText(textSplit[i], x, drawLine.y);\n x += this.measureText(textSplit[i], renderInfo.letterSpacing);\n }\n }\n }\n if (prevShadowSettings) {\n this._context.shadowColor = prevShadowSettings[0];\n this._context.shadowOffsetX = prevShadowSettings[1];\n this._context.shadowOffsetY = prevShadowSettings[2];\n this._context.shadowBlur = prevShadowSettings[3];\n }\n if (renderInfo.cutSx || renderInfo.cutSy) {\n this._context.translate(renderInfo.cutSx, renderInfo.cutSy);\n }\n this.renderInfo = renderInfo;\n }\n wrapWord(word, wordWrapWidth, suffix) {\n const suffixWidth = this._context.measureText(suffix).width;\n const wordLen = word.length;\n const wordWidth = this._context.measureText(word).width;\n /* If word fits wrapWidth, do nothing */\n if (wordWidth <= wordWrapWidth) {\n return word;\n }\n /* Make initial guess for text cuttoff */\n let cutoffIndex = Math.floor((wordWrapWidth * wordLen) / wordWidth);\n let truncWordWidth = this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n /* In case guess was overestimated, shrink it letter by letter. */\n if (truncWordWidth > wordWrapWidth) {\n while (cutoffIndex > 0) {\n truncWordWidth =\n this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n if (truncWordWidth > wordWrapWidth) {\n cutoffIndex -= 1;\n }\n else {\n break;\n }\n }\n /* In case guess was underestimated, extend it letter by letter. */\n }\n else {\n while (cutoffIndex < wordLen) {\n truncWordWidth =\n this._context.measureText(word.substring(0, cutoffIndex)).width +\n suffixWidth;\n if (truncWordWidth < wordWrapWidth) {\n cutoffIndex += 1;\n }\n else {\n // Finally, when bound is crossed, retract last letter.\n cutoffIndex -= 1;\n break;\n }\n }\n }\n /* If wrapWidth is too short to even contain suffix alone, return empty string */\n return (word.substring(0, cutoffIndex) +\n (wordWrapWidth >= suffixWidth ? suffix : ''));\n }\n /**\n * Applies newlines to a string to have it optimally fit into the horizontal\n * bounds set by the Text object's wordWrapWidth property.\n */\n wrapText(text, wordWrapWidth, letterSpacing, indent = 0) {\n // Greedy wrapping algorithm that will wrap words as the line grows longer.\n // than its horizontal bounds.\n const lines = text.split(/\\r?\\n/g);\n let allLines = [];\n const realNewlines = [];\n for (let i = 0; i < lines.length; i++) {\n const resultLines = [];\n let result = '';\n let spaceLeft = wordWrapWidth - indent;\n const words = lines[i].split(' ');\n for (let j = 0; j < words.length; j++) {\n const wordWidth = this.measureText(words[j], letterSpacing);\n const wordWidthWithSpace = wordWidth + this.measureText(' ', letterSpacing);\n if (j === 0 || wordWidthWithSpace > spaceLeft) {\n // Skip printing the newline if it's the first word of the line that is.\n // greater than the word wrap width.\n if (j > 0) {\n resultLines.push(result);\n result = '';\n }\n result += words[j];\n spaceLeft = wordWrapWidth - wordWidth - (j === 0 ? indent : 0);\n }\n else {\n spaceLeft -= wordWidthWithSpace;\n result += ` ${words[j]}`;\n }\n }\n resultLines.push(result);\n result = '';\n allLines = allLines.concat(resultLines);\n if (i < lines.length - 1) {\n realNewlines.push(allLines.length);\n }\n }\n return { l: allLines, n: realNewlines };\n }\n measureText(word, space = 0) {\n if (!space) {\n return this._context.measureText(word).width;\n }\n return word.split('').reduce((acc, char) => {\n return acc + this._context.measureText(char).width + space;\n }, 0);\n }\n mergeDefaults(settings) {\n return {\n text: '',\n w: 0,\n h: 0,\n fontStyle: 'normal',\n fontSize: 40,\n fontFace: null,\n wordWrap: true,\n wordWrapWidth: 0,\n wordBreak: false,\n textOverflow: '',\n lineHeight: null,\n textBaseline: 'alphabetic',\n textAlign: 'left',\n verticalAlign: 'top',\n offsetY: null,\n maxLines: 0,\n overflowSuffix: '...',\n textColor: [1.0, 1.0, 1.0, 1.0],\n paddingLeft: 0,\n paddingRight: 0,\n shadow: false,\n shadowColor: [0.0, 0.0, 0.0, 1.0],\n shadowOffsetX: 0,\n shadowOffsetY: 0,\n shadowBlur: 5,\n highlight: false,\n highlightHeight: 0,\n highlightColor: [0.0, 0.0, 0.0, 1.0],\n highlightOffset: 0,\n highlightPaddingLeft: 0,\n highlightPaddingRight: 0,\n letterSpacing: 0,\n textIndent: 0,\n cutSx: 0,\n cutEx: 0,\n cutSy: 0,\n cutEy: 0,\n advancedRenderer: false,\n fontBaselineRatio: 0,\n precision: 1,\n textRenderIssueMargin: 0,\n ...settings,\n };\n }\n}\n//# sourceMappingURL=LightningTextTextureRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { EventEmitter } from '../../../common/EventEmitter.js';\nimport { assertTruthy, mergeColorAlphaPremultiplied } from '../../../utils.js';\nimport { intersectRect, intersectBound, getNormalizedRgbaComponents, getNormalizedAlphaComponent, createBound, } from '../../lib/utils.js';\nimport { WebTrFontFace } from '../font-face-types/WebTrFontFace.js';\nimport { LightningTextTextureRenderer, } from './LightningTextTextureRenderer.js';\nimport { TextRenderer, } from './TextRenderer.js';\nconst resolvedGlobal = typeof self === 'undefined' ? globalThis : self;\n/**\n * Global font set regardless of if run in the main thread or a web worker\n */\nconst globalFontSet = (resolvedGlobal.document?.fonts ||\n resolvedGlobal.fonts);\nfunction getFontCssString(props) {\n const { fontFamily, fontStyle, fontWeight, fontStretch, fontSize } = props;\n return [fontStyle, fontWeight, fontStretch, `${fontSize}px`, fontFamily].join(' ');\n}\n/**\n * Ephemeral bounds object used for intersection calculations\n *\n * @remarks\n * Used to avoid creating a new object every time we need to intersect\n * element bounds.\n */\nconst tmpElementBounds = createBound(0, 0, 0, 0);\nexport class CanvasTextRenderer extends TextRenderer {\n canvas;\n context;\n rendererBounds;\n constructor(stage) {\n super(stage);\n if (typeof OffscreenCanvas !== 'undefined') {\n this.canvas = new OffscreenCanvas(0, 0);\n }\n else {\n this.canvas = document.createElement('canvas');\n }\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n let context = this.canvas.getContext('2d');\n if (!context) {\n // A browser may appear to support OffscreenCanvas but not actually support the Canvas '2d' context\n // Here we try getting the context again after falling back to an HTMLCanvasElement.\n // See: https://github.com/lightning-js/renderer/issues/26#issuecomment-1750438486\n this.canvas = document.createElement('canvas');\n context = this.canvas.getContext('2d');\n }\n assertTruthy(context);\n this.context = context;\n this.rendererBounds = {\n x1: 0,\n y1: 0,\n x2: this.stage.options.appWidth,\n y2: this.stage.options.appHeight,\n };\n }\n //#region Overrides\n getPropertySetters() {\n return {\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n state.fontInfo = undefined;\n this.invalidateLayoutCache(state);\n },\n text: (state, value) => {\n state.props.text = value;\n this.invalidateLayoutCache(state);\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n this.invalidateLayoutCache(state);\n },\n color: (state, value) => {\n state.props.color = value;\n this.invalidateLayoutCache(state);\n },\n x: (state, value) => {\n state.props.x = value;\n this.invalidateVisibleWindowCache(state);\n },\n y: (state, value) => {\n state.props.y = value;\n this.invalidateVisibleWindowCache(state);\n },\n contain: (state, value) => {\n state.props.contain = value;\n this.invalidateLayoutCache(state);\n },\n width: (state, value) => {\n state.props.width = value;\n // Only invalidate layout cache if we're containing in the horizontal direction\n if (state.props.contain !== 'none') {\n this.invalidateLayoutCache(state);\n }\n },\n height: (state, value) => {\n state.props.height = value;\n // Only invalidate layout cache if we're containing in the vertical direction\n if (state.props.contain === 'both') {\n this.invalidateLayoutCache(state);\n }\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n this.invalidateLayoutCache(state);\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n this.invalidateLayoutCache(state);\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n this.invalidateLayoutCache(state);\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n this.invalidateLayoutCache(state);\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n this.invalidateLayoutCache(state);\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n this.invalidateLayoutCache(state);\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n this.invalidateLayoutCache(state);\n },\n // debug: (state, value) => {\n // state.props.debug = value;\n // },\n };\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n canRenderFont(props) {\n // The canvas renderer can render any font because it automatically\n // falls back to system fonts. The CanvasTextRenderer should be\n // checked last if other renderers are preferred.\n return true;\n }\n isFontFaceSupported(fontFace) {\n return fontFace instanceof WebTrFontFace;\n }\n addFontFace(fontFace) {\n // Make sure the font face is an Canvas font face (it should have already passed\n // the `isFontFaceSupported` check)\n assertTruthy(fontFace instanceof WebTrFontFace);\n // We simply add the font face to the document\n // @ts-expect-error `add()` method should be available from a FontFaceSet\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n globalFontSet.add(fontFace.fontFace);\n }\n createState(props) {\n return {\n props,\n status: 'initialState',\n updateScheduled: false,\n emitter: new EventEmitter(),\n canvasPages: undefined,\n lightning2TextRenderer: new LightningTextTextureRenderer(this.canvas, this.context),\n renderWindow: undefined,\n visibleWindow: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n valid: false,\n },\n renderInfo: undefined,\n forceFullLayoutCalc: false,\n textW: 0,\n textH: 0,\n fontInfo: undefined,\n fontFaceLoadedHandler: undefined,\n isRenderable: false,\n debugData: {\n updateCount: 0,\n layoutCount: 0,\n drawCount: 0,\n lastLayoutNumCharacters: 0,\n layoutSum: 0,\n drawSum: 0,\n bufferSize: 0,\n },\n };\n }\n updateState(state) {\n // On the first update call we need to set the status to loading\n if (state.status === 'initialState') {\n this.setStatus(state, 'loading');\n }\n // If fontInfo is invalid, we need to establish it\n if (!state.fontInfo) {\n const cssString = getFontCssString(state.props);\n state.fontInfo = {\n cssString: cssString,\n // TODO: For efficiency we would use this here but it's not reliable on WPE -> document.fonts.check(cssString),\n loaded: false,\n };\n // If font is not loaded, set up a handler to update the font info when the font loads\n if (!state.fontInfo.loaded) {\n globalFontSet\n .load(cssString)\n .then(this.onFontLoaded.bind(this, state, cssString))\n .catch(this.onFontLoadError.bind(this, state, cssString));\n return;\n }\n }\n // If we're waiting for a font face to load, don't render anything\n if (!state.fontInfo.loaded) {\n return;\n }\n if (!state.renderInfo) {\n const maxLines = state.props.maxLines;\n const containedMaxLines = state.props.contain === 'both'\n ? Math.floor((state.props.height - state.props.offsetY) /\n state.props.lineHeight)\n : 0;\n const calcMaxLines = containedMaxLines > 0 && maxLines > 0\n ? Math.min(containedMaxLines, maxLines)\n : Math.max(containedMaxLines, maxLines);\n state.lightning2TextRenderer.settings = {\n text: state.props.text,\n textAlign: state.props.textAlign,\n fontFace: state.props.fontFamily,\n fontSize: state.props.fontSize,\n fontStyle: [\n state.props.fontStretch,\n state.props.fontStyle,\n state.props.fontWeight,\n ].join(' '),\n textColor: getNormalizedRgbaComponents(state.props.color),\n offsetY: state.props.fontSize + state.props.offsetY,\n wordWrap: state.props.contain !== 'none',\n wordWrapWidth: state.props.contain === 'none' ? undefined : state.props.width,\n letterSpacing: state.props.letterSpacing,\n lineHeight: state.props.lineHeight,\n maxLines: calcMaxLines,\n textBaseline: state.props.textBaseline,\n verticalAlign: state.props.verticalAlign,\n overflowSuffix: state.props.overflowSuffix,\n };\n // const renderInfoCalculateTime = performance.now();\n state.renderInfo = state.lightning2TextRenderer.calculateRenderInfo();\n // console.log(\n // 'Render info calculated in',\n // performance.now() - renderInfoCalculateTime,\n // 'ms',\n // );\n state.textH = state.renderInfo.lineHeight * state.renderInfo.lines.length;\n state.textW = state.renderInfo.width;\n // Invalidate renderWindow because the renderInfo changed\n state.renderWindow = undefined;\n }\n const { x, y, width, height, scrollY, contain } = state.props;\n const { visibleWindow } = state;\n let { renderWindow, canvasPages } = state;\n if (!visibleWindow.valid) {\n // Figure out whats actually in the bounds of the renderer/canvas (visibleWindow)\n const elementBounds = createBound(x, y, contain !== 'none' ? x + width : Infinity, contain === 'both' ? y + height : Infinity, tmpElementBounds);\n /**\n * Area that is visible on the screen.\n */\n intersectBound(this.rendererBounds, elementBounds, visibleWindow);\n visibleWindow.valid = true;\n }\n const visibleWindowHeight = visibleWindow.y2 - visibleWindow.y1;\n const maxLinesPerCanvasPage = Math.ceil(visibleWindowHeight / state.renderInfo.lineHeight);\n if (visibleWindowHeight === 0) {\n // Nothing to render. Clear any canvasPages and existing renderWindow\n // Return early.\n canvasPages = undefined;\n renderWindow = undefined;\n this.setStatus(state, 'loaded');\n return;\n }\n else if (renderWindow && canvasPages) {\n // Return early if we're still viewing inside the established render window\n // No need to re-render what we've already rendered\n const renderWindowScreenX1 = x + renderWindow.x1;\n const renderWindowScreenY1 = y - scrollY + renderWindow.y1;\n const renderWindowScreenX2 = x + renderWindow.x2;\n const renderWindowScreenY2 = y - scrollY + renderWindow.y2;\n if (renderWindowScreenX1 <= visibleWindow.x1 &&\n renderWindowScreenX2 >= visibleWindow.x2 &&\n renderWindowScreenY1 <= visibleWindow.y1 &&\n renderWindowScreenY2 >= visibleWindow.y2) {\n this.setStatus(state, 'loaded');\n return;\n }\n if (renderWindowScreenY2 < visibleWindow.y2) {\n // We've scrolled up, so we need to render the next page\n renderWindow.y1 += maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n renderWindow.y2 += maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n canvasPages.push(canvasPages.shift());\n canvasPages[2].lineNumStart =\n canvasPages[1].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[2].lineNumEnd =\n canvasPages[2].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[2].valid = false;\n }\n else if (renderWindowScreenY1 > visibleWindow.y1) {\n // We've scrolled down, so we need to render the previous page\n renderWindow.y1 -= maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n renderWindow.y2 -= maxLinesPerCanvasPage * state.renderInfo.lineHeight;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n canvasPages.unshift(canvasPages.pop());\n canvasPages[0].lineNumStart =\n canvasPages[1].lineNumStart - maxLinesPerCanvasPage;\n canvasPages[0].lineNumEnd =\n canvasPages[0].lineNumStart + maxLinesPerCanvasPage;\n canvasPages[0].valid = false;\n }\n }\n else {\n const pageHeight = state.renderInfo.lineHeight * maxLinesPerCanvasPage;\n const page1Block = Math.ceil(scrollY / pageHeight);\n const page1LineStart = page1Block * maxLinesPerCanvasPage;\n const page0LineStart = page1LineStart - maxLinesPerCanvasPage;\n const page2LineStart = page1LineStart + maxLinesPerCanvasPage;\n // We haven't rendered anything yet, so we need to render the first page\n // If canvasPages already exist, let's re-use the textures\n canvasPages = [\n {\n texture: canvasPages?.[0].texture,\n lineNumStart: page0LineStart,\n lineNumEnd: page0LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n {\n texture: canvasPages?.[1].texture,\n lineNumStart: page1LineStart,\n lineNumEnd: page1LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n {\n texture: canvasPages?.[2].texture,\n lineNumStart: page2LineStart,\n lineNumEnd: page2LineStart + maxLinesPerCanvasPage,\n valid: false,\n },\n ];\n state.canvasPages = canvasPages;\n const scrollYNearestPage = page1Block * pageHeight;\n renderWindow = {\n x1: 0,\n y1: scrollYNearestPage - pageHeight,\n x2: width,\n y2: scrollYNearestPage + pageHeight * 2,\n };\n }\n state.renderWindow = renderWindow;\n const pageDrawTime = performance.now();\n for (const pageInfo of canvasPages) {\n if (pageInfo.valid)\n continue;\n if (pageInfo.lineNumStart < 0) {\n pageInfo.texture?.setRenderableOwner(state, false);\n pageInfo.texture = this.stage.txManager.loadTexture('ImageTexture', {\n src: '',\n });\n pageInfo.texture.setRenderableOwner(state, state.isRenderable);\n pageInfo.valid = true;\n continue;\n }\n state.lightning2TextRenderer.draw(state.renderInfo, {\n lines: state.renderInfo.lines.slice(pageInfo.lineNumStart, pageInfo.lineNumEnd),\n lineWidths: state.renderInfo.lineWidths.slice(pageInfo.lineNumStart, pageInfo.lineNumEnd),\n });\n if (!(this.canvas.width === 0 || this.canvas.height === 0)) {\n pageInfo.texture?.setRenderableOwner(state, false);\n pageInfo.texture = this.stage.txManager.loadTexture('ImageTexture', {\n src: this.context.getImageData(0, 0, this.canvas.width, this.canvas.height),\n }, {\n preload: true,\n });\n pageInfo.texture.setRenderableOwner(state, state.isRenderable);\n }\n pageInfo.valid = true;\n }\n // console.log('pageDrawTime', performance.now() - pageDrawTime, 'ms');\n // Report final status\n this.setStatus(state, 'loaded');\n }\n renderQuads(state, transform, clippingRect, alpha) {\n const { stage } = this;\n const { canvasPages, textW = 0, textH = 0, renderWindow } = state;\n if (!canvasPages || !renderWindow)\n return;\n const { x, y, scrollY, contain, width, height /*, debug*/ } = state.props;\n const elementRect = {\n x: x,\n y: y,\n width: contain !== 'none' ? width : textW,\n height: contain === 'both' ? height : textH,\n };\n const visibleRect = intersectRect({\n x: 0,\n y: 0,\n width: stage.options.appWidth,\n height: stage.options.appHeight,\n }, elementRect);\n // if (!debug.disableScissor) {\n // renderer.enableScissor(\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n assertTruthy(canvasPages, 'canvasPages is not defined');\n assertTruthy(renderWindow, 'renderWindow is not defined');\n const renderWindowHeight = renderWindow.y2 - renderWindow.y1;\n const pageSize = renderWindowHeight / 3.0;\n const { zIndex, color } = state.props;\n // Color alpha of text is not properly rendered to the Canvas texture, so we\n // need to apply it here.\n const combinedAlpha = alpha * getNormalizedAlphaComponent(color);\n const quadColor = mergeColorAlphaPremultiplied(0xffffffff, combinedAlpha);\n if (canvasPages[0].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[0].texture?.dimensions?.width || 0,\n height: canvasPages[0].texture?.dimensions?.height || 0,\n texture: canvasPages[0].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n if (canvasPages[1].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[1].texture?.dimensions?.width || 0,\n height: canvasPages[1].texture?.dimensions?.height || 0,\n texture: canvasPages[1].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1 + pageSize,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n if (canvasPages[2].valid) {\n this.stage.renderer.addQuad({\n alpha: combinedAlpha,\n clippingRect,\n colorBl: quadColor,\n colorBr: quadColor,\n colorTl: quadColor,\n colorTr: quadColor,\n width: canvasPages[2].texture?.dimensions?.width || 0,\n height: canvasPages[2].texture?.dimensions?.height || 0,\n texture: canvasPages[2].texture,\n textureOptions: {},\n shader: null,\n shaderProps: null,\n zIndex,\n tx: transform.tx,\n ty: transform.ty - scrollY + renderWindow.y1 + pageSize + pageSize,\n ta: transform.ta,\n tb: transform.tb,\n tc: transform.tc,\n td: transform.td,\n });\n }\n // renderer.disableScissor();\n // if (debug.showElementRect) {\n // this.renderer.drawBorder(\n // Colors.Blue,\n // elementRect.x,\n // elementRect.y,\n // elementRect.w,\n // elementRect.h,\n // );\n // }\n // if (debug.showVisibleRect) {\n // this.renderer.drawBorder(\n // Colors.Green,\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // if (debug.showRenderWindow && renderWindow) {\n // this.renderer.drawBorder(\n // Colors.Red,\n // x + renderWindow.x1,\n // y + renderWindow.y1 - scrollY,\n // x + renderWindow.x2 - (x + renderWindow.x1),\n // y + renderWindow.y2 - scrollY - (y + renderWindow.y1 - scrollY),\n // );\n // }\n }\n setIsRenderable(state, renderable) {\n super.setIsRenderable(state, renderable);\n // Set state object owner from any canvas page textures\n state.canvasPages?.forEach((pageInfo) => {\n pageInfo.texture?.setRenderableOwner(state, renderable);\n });\n }\n destroyState(state) {\n // Remove state object owner from any canvas page textures\n state.canvasPages?.forEach((pageInfo) => {\n pageInfo.texture?.setRenderableOwner(state, false);\n });\n }\n //#endregion Overrides\n /**\n * Invalidate the visible window stored in the state. This will cause a new\n * visible window to be calculated on the next update.\n *\n * @param state\n */\n invalidateVisibleWindowCache(state) {\n state.visibleWindow.valid = false;\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n /**\n * Invalidate the layout cache stored in the state. This will cause the text\n * to be re-layed out on the next update.\n *\n * @remarks\n * This also invalidates the visible window cache.\n *\n * @param state\n */\n invalidateLayoutCache(state) {\n state.renderInfo = undefined;\n state.visibleWindow.valid = false;\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n onFontLoaded(state, cssString) {\n if (cssString !== state.fontInfo?.cssString || !state.fontInfo) {\n return;\n }\n state.fontInfo.loaded = true;\n this.scheduleUpdateState(state);\n }\n onFontLoadError(state, cssString, error) {\n if (cssString !== state.fontInfo?.cssString || !state.fontInfo) {\n return;\n }\n // Font didn't actually load, but we'll log the error and mark it as loaded\n // because the browser can still render with a fallback font.\n state.fontInfo.loaded = true;\n console.error(`CanvasTextRenderer: Error loading font '${state.fontInfo.cssString}'`, error);\n this.scheduleUpdateState(state);\n }\n}\n//# sourceMappingURL=CanvasTextRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\nexport class DefaultShader extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2fv' },\n ],\n });\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `,\n fragment: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate);\n gl_FragColor = vec4(v_color) * texture2D(u_texture, v_textureCoordinate);\n }\n `,\n };\n}\n//# sourceMappingURL=DefaultShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\n// import type { Texture } from '../textures/Texture';\nexport class DefaultShaderBatched extends WebGlCoreShader {\n supportsIndexedTextures = true;\n constructor(renderer) {\n super({\n renderer,\n attributes: [\n 'a_position',\n 'a_textureCoordinate',\n 'a_color',\n 'a_textureIndex',\n ],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_textures[0]', uniform: 'uniform1iv' },\n ],\n });\n }\n bindTextures(texture) {\n const { renderer, glw } = this;\n if (texture.length > renderer.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS) {\n throw new Error(`DefaultShaderBatched: Cannot bind more than ${renderer.system.parameters.MAX_VERTEX_TEXTURE_IMAGE_UNITS} textures`);\n }\n texture.forEach((t, i) => {\n glw.activeTexture(i);\n glw.bindTexture(t.ctxTexture);\n });\n const samplers = Array.from(Array(texture.length).keys());\n this.setUniform('u_textures[0]', samplers);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `,\n fragment: (textureUnits) => `\n #define txUnits ${textureUnits}\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform sampler2D u_image;\n uniform sampler2D u_textures[txUnits];\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n vec4 sampleFromTexture(sampler2D textures[${textureUnits}], int idx, vec2 uv) {\n ${Array.from(Array(textureUnits).keys())\n .map((idx) => `\n ${idx !== 0 ? 'else ' : ''}if (idx == ${idx}) {\n return texture2D(textures[${idx}], uv);\n }\n `)\n .join('')}\n return texture2D(textures[0], uv);\n }\n\n void main(){\n gl_FragColor = vec4(v_color) * sampleFromTexture(u_textures, int(v_textureIndex), v_textureCoordinate);\n }\n `,\n };\n}\n//# sourceMappingURL=DefaultShaderBatched.js.map","import { WebGlCoreShader, } from '../WebGlCoreShader.js';\nimport { ShaderEffect } from './effects/ShaderEffect.js';\nimport memize from 'memize';\nconst effectCache = new Map();\nconst getResolvedEffect = (effects, effectContructors) => {\n const key = JSON.stringify(effects);\n if (effectCache.has(key)) {\n return effectCache.get(key);\n }\n const value = (effects ?? []).map((effect) => ({\n type: effect.type,\n props: effectContructors[effect.type].resolveDefaults((effect.props || {})),\n }));\n effectCache.set(key, value);\n return value;\n};\nexport class DynamicShader extends WebGlCoreShader {\n effects = [];\n constructor(renderer, props, effectContructors) {\n const shader = DynamicShader.createShader(props, effectContructors);\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2fv' },\n { name: 'u_dimensions', uniform: 'uniform2fv' },\n { name: 'u_alpha', uniform: 'uniform1f' },\n ...shader.uniforms,\n ],\n shaderSources: {\n vertex: shader.vertex,\n fragment: shader.fragment,\n },\n });\n this.effects = shader.effects;\n this.calculateProps = memize(this.calculateProps.bind(this));\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n calculateProps(effects) {\n const regEffects = this.renderer.shManager.getRegisteredEffects();\n const results = [];\n effects?.forEach((eff, index) => {\n const effect = this.effects[index];\n const fxClass = regEffects[effect.name];\n const props = eff.props ?? {};\n const uniInfo = effect.uniformInfo;\n Object.keys(props).forEach((p) => {\n const fxProp = fxClass.uniforms[p];\n const propInfo = uniInfo[p];\n let value = fxProp.validator\n ? fxProp.validator(props[p], props)\n : props[p];\n if (Array.isArray(value)) {\n value = new Float32Array(value);\n }\n results.push({ name: propInfo.name, value });\n });\n });\n return results;\n }\n bindProps(props) {\n const results = this.calculateProps(props.effects);\n results.forEach((r) => {\n this.setUniform(r.name, r.value);\n });\n }\n static createShader(props, effectContructors) {\n //counts duplicate effects\n const effectNameCount = {};\n const methods = {};\n let declareUniforms = '';\n const uniforms = [];\n const uFx = [];\n const effects = props.effects.map((effect) => {\n const baseClass = effectContructors[effect.type];\n const key = baseClass.getEffectKey(effect.props || {});\n effectNameCount[key] = effectNameCount[key] ? ++effectNameCount[key] : 1;\n const nr = effectNameCount[key];\n if (nr === 1) {\n uFx.push({ key, type: effect.type, props: effect.props });\n }\n //initialize new effect class;\n const fxClass = new baseClass({\n ref: `${key}${nr === 1 ? '' : nr}`,\n target: key,\n props: effect.props,\n });\n declareUniforms += fxClass.declaredUniforms;\n uniforms.push(...Object.values(fxClass.uniformInfo));\n return fxClass;\n });\n //build source\n let effectMethods = '';\n uFx?.forEach((fx) => {\n const fxClass = effectContructors[fx.type];\n const fxProps = fxClass.resolveDefaults((fx.props ?? {}));\n const remap = [];\n for (const m in fxClass.methods) {\n let cm = m;\n const fxMethod = fxClass.methods[m];\n if (methods[m] && methods[m] !== fxMethod) {\n cm = DynamicShader.resolveMethodDuplicate(m, fxMethod, methods);\n }\n methods[cm] = fxMethod.replace('function', cm);\n remap.push({ m, cm });\n }\n let onShaderMask = fxClass.onShaderMask instanceof Function\n ? fxClass.onShaderMask(fxProps)\n : fxClass.onShaderMask;\n let onColorize = fxClass.onColorize instanceof Function\n ? fxClass.onColorize(fxProps)\n : fxClass.onColorize;\n let onEffectMask = fxClass.onEffectMask instanceof Function\n ? fxClass.onEffectMask(fxProps)\n : fxClass.onEffectMask;\n remap.forEach((r) => {\n const { m, cm } = r;\n const reg = new RegExp(`\\\\$${m}`, 'g');\n if (onShaderMask) {\n onShaderMask = onShaderMask.replace(reg, cm);\n }\n if (onColorize) {\n onColorize = onColorize.replace(reg, cm);\n }\n if (onEffectMask) {\n onEffectMask = onEffectMask.replace(reg, cm);\n }\n });\n const methodParameters = fxClass.getMethodParameters(fxClass.uniforms, fxProps);\n const pm = methodParameters.length > 0 ? `, ${methodParameters}` : '';\n if (onShaderMask) {\n effectMethods += `\n float fx_${fx.key}_onShaderMask(float shaderMask ${pm}) {\n ${onShaderMask}\n }\n `;\n }\n if (onColorize) {\n effectMethods += `\n vec4 fx_${fx.key}_onColorize(float shaderMask, vec4 maskColor, vec4 shaderColor${pm}) {\n ${onColorize}\n }\n `;\n }\n if (onEffectMask) {\n effectMethods += `\n vec4 fx_${fx.key}_onEffectMask(float shaderMask, vec4 maskColor, vec4 shaderColor${pm}) {\n ${onEffectMask}\n }\n `;\n }\n });\n let sharedMethods = '';\n for (const m in methods) {\n sharedMethods += methods[m];\n }\n //fill main functions\n let currentMask = `mix(shaderColor, maskColor, clamp(-(lng_DefaultMask), 0.0, 1.0))`;\n let drawEffects = `\n\n `;\n for (let i = 0; i < effects.length; i++) {\n const current = effects[i];\n const pm = current.passParameters.length > 0 ? `, ${current.passParameters}` : '';\n const currentClass = effectContructors[current.name];\n if (currentClass.onShaderMask) {\n drawEffects += `\n shaderMask = fx_${current.target}_onShaderMask(shaderMask ${pm});\n `;\n }\n if (currentClass.onColorize) {\n drawEffects += `\n maskColor = fx_${current.target}_onColorize(shaderMask, maskColor, shaderColor${pm});\n `;\n }\n if (currentClass.onEffectMask) {\n currentMask = `fx_${current.target}_onEffectMask(shaderMask, maskColor, shaderColor${pm})`;\n }\n const next = effects[i + 1];\n if (next === undefined ||\n effectContructors[next.name].onEffectMask) {\n drawEffects += `\n shaderColor = ${currentMask};\n `;\n }\n }\n return {\n effects,\n uniforms,\n fragment: DynamicShader.fragment(declareUniforms, sharedMethods, effectMethods, drawEffects),\n vertex: DynamicShader.vertex(),\n };\n }\n static resolveMethodDuplicate(key, effectMethod, methodCollection, increment = 0) {\n const m = key + (increment > 0 ? increment : '');\n if (methodCollection[m] && methodCollection[m] !== effectMethod) {\n return this.resolveMethodDuplicate(key, effectMethod, methodCollection, ++increment);\n }\n return m;\n }\n static resolveDefaults(props, effectContructors) {\n return {\n effects: getResolvedEffect(props.effects, effectContructors),\n $dimensions: {\n width: 0,\n height: 0,\n },\n $alpha: 0,\n };\n }\n static makeCacheKey(props, effectContructors) {\n let fx = '';\n props.effects?.forEach((effect) => {\n const baseClass = effectContructors[effect.type];\n const key = baseClass.getEffectKey(effect.props || {});\n fx += `,${key}`;\n });\n return `DynamicShader${fx}`;\n }\n static z$__type__Props;\n static vertex = () => `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_textureCoordinate;\n attribute vec2 a_position;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n varying float v_textureIndex;\n\n void main(){\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n v_textureIndex = a_textureIndex;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `;\n static fragment = (uniforms, methods, effectMethods, drawEffects) => `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n #define PI 3.14159265359\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_alpha;\n uniform float u_radius;\n uniform sampler2D u_texture;\n uniform float u_pixelRatio;\n\n ${uniforms}\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n ${methods}\n\n ${effectMethods}\n\n void main() {\n vec2 p = v_textureCoordinate.xy * u_dimensions - u_dimensions * 0.5;\n vec2 d = abs(p) - (u_dimensions) * 0.5;\n float lng_DefaultMask = min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n\n vec4 shaderColor = vec4(0.0);\n float shaderMask = lng_DefaultMask;\n\n vec4 maskColor = texture2D(u_texture, v_textureCoordinate) * v_color;\n\n shaderColor = mix(shaderColor, maskColor, clamp(-(lng_DefaultMask + 0.5), 0.0, 1.0));\n\n ${drawEffects}\n\n gl_FragColor = shaderColor * u_alpha;\n }\n `;\n}\n//# sourceMappingURL=DynamicShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { WebGlCoreShader, } from '../WebGlCoreShader.js';\n/**\n * Similar to the {@link DefaultShader} but cuts out 4 rounded rectangle corners\n * as defined by the specified corner {@link RoundedRectangleProps.radius}\n */\nexport class RoundedRectangle extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate', 'a_color'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2f' },\n { name: 'u_dimensions', uniform: 'uniform2fv' },\n { name: 'u_radius', uniform: 'uniform1f' },\n ],\n });\n }\n static z$__type__Props;\n static resolveDefaults(props) {\n return {\n radius: props.radius || 10,\n $dimensions: {\n width: 0,\n height: 0,\n },\n };\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n bindProps(props) {\n this.setUniform('u_radius', props.radius);\n }\n canBatchShaderProps(propsA, propsB) {\n return (propsA.radius === propsB.radius &&\n propsA.$dimensions.width === propsB.$dimensions.width &&\n propsA.$dimensions.height === propsB.$dimensions.height);\n }\n static shaderSources = {\n vertex: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n attribute vec4 a_color;\n attribute float a_textureIndex;\n attribute float a_depth;\n\n uniform vec2 u_resolution;\n uniform float u_pixelRatio;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n void main() {\n vec2 normalized = a_position * u_pixelRatio / u_resolution;\n vec2 zero_two = normalized * 2.0;\n vec2 clip_space = zero_two - 1.0;\n\n // pass to fragment\n v_color = a_color;\n v_textureCoordinate = a_textureCoordinate;\n\n // flip y\n gl_Position = vec4(clip_space * vec2(1.0, -1.0), 0, 1);\n }\n `,\n fragment: `\n # ifdef GL_FRAGMENT_PRESICISON_HIGH\n precision highp float;\n # else\n precision mediump float;\n # endif\n\n uniform vec2 u_resolution;\n uniform vec2 u_dimensions;\n uniform float u_radius;\n uniform sampler2D u_texture;\n\n varying vec4 v_color;\n varying vec2 v_textureCoordinate;\n\n float boxDist(vec2 p, vec2 size, float radius){\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n\n float fillMask(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n\n void main() {\n vec4 color = texture2D(u_texture, v_textureCoordinate) * v_color;\n vec2 halfDimensions = u_dimensions * 0.5;\n\n float d = boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions + 0.5, u_radius);\n gl_FragColor = mix(vec4(0.0), color, fillMask(d));\n }\n `,\n };\n}\n//# sourceMappingURL=RoundedRectangle.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../lib/utils.js';\nimport { WebGlCoreShader } from '../WebGlCoreShader.js';\nconst IDENTITY_MATRIX_3x3 = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]);\n/**\n * SdfShader supports multi-channel and single-channel signed distance field textures.\n *\n * @remarks\n * This Shader is used by the {@link SdfTextRenderer}. Do not use thie Shader\n * directly. Instead create a Text Node and assign a SDF font family to it.\n *\n * @internalRemarks\n * The only thing this shader does to support multi-channel SDFs is to\n * add a median function to the fragment shader. If this one function call\n * ends up being a performance bottleneck we can always look at ways to\n * remove it.\n */\nexport class SdfShader extends WebGlCoreShader {\n constructor(renderer) {\n super({\n renderer,\n attributes: ['a_position', 'a_textureCoordinate'],\n uniforms: [\n { name: 'u_resolution', uniform: 'uniform2fv' },\n { name: 'u_transform', uniform: 'uniformMatrix3fv' },\n { name: 'u_scrollY', uniform: 'uniform1f' },\n { name: 'u_pixelRatio', uniform: 'uniform1f' },\n { name: 'u_texture', uniform: 'uniform2f' },\n { name: 'u_color', uniform: 'uniform4fv' },\n { name: 'u_size', uniform: 'uniform1f' },\n { name: 'u_distanceRange', uniform: 'uniform1f' },\n { name: 'u_debug', uniform: 'uniform1i' },\n ],\n });\n }\n bindTextures(textures) {\n const { glw } = this;\n glw.activeTexture(0);\n glw.bindTexture(textures[0].ctxTexture);\n }\n bindProps(props) {\n const resolvedProps = SdfShader.resolveDefaults(props);\n for (const key in resolvedProps) {\n if (key === 'transform') {\n this.setUniform('u_transform', false, resolvedProps[key]);\n }\n else if (key === 'scrollY') {\n this.setUniform('u_scrollY', resolvedProps[key]);\n }\n else if (key === 'color') {\n const components = getNormalizedRgbaComponents(resolvedProps.color);\n this.setUniform('u_color', components);\n }\n else if (key === 'size') {\n this.setUniform('u_size', resolvedProps[key]);\n }\n else if (key === 'distanceRange') {\n this.setUniform('u_distanceRange', resolvedProps[key]);\n }\n else if (key === 'debug') {\n this.setUniform('u_debug', resolvedProps[key] ? 1.0 : 0.0);\n }\n }\n }\n static resolveDefaults(props = {}) {\n return {\n transform: props.transform ?? IDENTITY_MATRIX_3x3,\n scrollY: props.scrollY ?? 0,\n color: props.color ?? 0xffffffff,\n size: props.size ?? 16,\n distanceRange: props.distanceRange ?? 1.0,\n debug: props.debug ?? false,\n };\n }\n static shaderSources = {\n vertex: `\n // an attribute is an input (in) to a vertex shader.\n // It will receive data from a buffer\n attribute vec2 a_position;\n attribute vec2 a_textureCoordinate;\n\n uniform vec2 u_resolution;\n uniform mat3 u_transform;\n uniform float u_scrollY;\n uniform float u_pixelRatio;\n uniform float u_size;\n\n varying vec2 v_texcoord;\n\n void main() {\n vec2 scrolledPosition = a_position * u_size - vec2(0, u_scrollY);\n vec2 transformedPosition = (u_transform * vec3(scrolledPosition, 1)).xy;\n gl_Position = vec4((transformedPosition * u_pixelRatio / u_resolution * 2.0 - 1.0) * vec2(1, -1), 0, 1);\n v_texcoord = a_textureCoordinate;\n }\n `,\n fragment: `\n precision highp float;\n\n uniform vec4 u_color;\n uniform sampler2D u_texture;\n uniform float u_distanceRange;\n uniform float u_pixelRatio;\n uniform int u_debug;\n\n varying vec2 v_texcoord;\n\n float median(float r, float g, float b) {\n return max(min(r, g), min(max(r, g), b));\n }\n\n void main() {\n vec3 sample = texture2D(u_texture, v_texcoord).rgb;\n if (u_debug == 1) {\n gl_FragColor = vec4(sample.r, sample.g, sample.b, 1.0);\n return;\n }\n float scaledDistRange = u_distanceRange * u_pixelRatio;\n float sigDist = scaledDistRange * (median(sample.r, sample.g, sample.b) - 0.5);\n float opacity = clamp(sigDist + 0.5, 0.0, 1.0) * u_color.a;\n\n // Build the final color.\n // IMPORTANT: We must premultiply the color by the alpha value before returning it.\n gl_FragColor = vec4(u_color.r * opacity, u_color.g * opacity, u_color.b * opacity, opacity);\n }\n `,\n };\n}\n//# sourceMappingURL=SdfShader.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Masks the current maskcolor with rounded corners similar to {@link RoundedRectangle}\n */\nexport class RadiusEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radius';\n static getEffectKey() {\n return `radius`;\n }\n static uniforms = {\n radius: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n boxDist: `\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n `,\n };\n static resolveDefaults(props) {\n return {\n radius: props.radius ?? 10,\n };\n }\n static onShaderMask = `\n vec2 halfDimensions = u_dimensions * 0.5;\n float r = radius[0] * step(v_textureCoordinate.x, 0.5) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[1] * step(0.5, v_textureCoordinate.x) * step(v_textureCoordinate.y, 0.5);\n r = r + radius[2] * step(0.5, v_textureCoordinate.x) * step(0.5, v_textureCoordinate.y);\n r = r + radius[3] * step(v_textureCoordinate.x, 0.5) * step(0.5, v_textureCoordinate.y);\n return $boxDist(v_textureCoordinate.xy * u_dimensions - halfDimensions, halfDimensions, r);\n `;\n static onEffectMask = `\n return mix(vec4(0.0), maskColor, $fillMask(shaderMask));\n `;\n}\n//# sourceMappingURL=RadiusEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderEffect renders a border along all edges of an element\n */\nexport class BorderEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'border';\n static getEffectKey() {\n return `border`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static onEffectMask = `\n float mask = clamp(shaderMask + width, 0.0, 1.0) - clamp(shaderMask, 0.0, 1.0);\n return mix(shaderColor, mix(shaderColor, maskColor, maskColor.a), mask);\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Linear Gradient effect over a effect mask\n */\nexport class LinearGradientEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'linearGradient';\n static getEffectKey(props) {\n return `linearGradient${props.colors.length}`;\n }\n static resolveDefaults(props) {\n const colors = props.colors ?? [0xff000000, 0xffffffff];\n let stops = props.stops || [];\n if (stops.length === 0 || stops.length !== colors.length) {\n const colorsL = colors.length;\n let i = 0;\n const tmp = stops;\n for (; i < colorsL; i++) {\n if (stops[i]) {\n tmp[i] = stops[i];\n if (stops[i - 1] === undefined && tmp[i - 2] !== undefined) {\n tmp[i - 1] = tmp[i - 2] + (stops[i] - tmp[i - 2]) / 2;\n }\n }\n else {\n tmp[i] = i * (1 / (colors.length - 1));\n }\n }\n stops = tmp;\n }\n return {\n colors,\n stops,\n angle: props.angle ?? 0,\n };\n }\n static uniforms = {\n angle: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n colors: {\n value: 0xffffffff,\n validator: (rgbas) => {\n const cols = rgbas.map((rgbas) => getNormalizedRgbaComponents(rgbas));\n return cols.reduce((acc, val) => acc.concat(val), []);\n },\n size: (props) => props.colors.length,\n method: 'uniform4fv',\n type: 'vec4',\n },\n stops: {\n value: [],\n size: (props) => props.colors.length,\n method: 'uniform1fv',\n type: 'float',\n },\n };\n static methods = {\n fromLinear: `\n vec4 function(vec4 linearRGB) {\n vec4 higher = vec4(1.055)*pow(linearRGB, vec4(1.0/2.4)) - vec4(0.055);\n vec4 lower = linearRGB * vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n `,\n toLinear: `\n vec4 function(vec4 sRGB) {\n vec4 higher = pow((sRGB + vec4(0.055))/vec4(1.055), vec4(2.4));\n vec4 lower = sRGB/vec4(12.92);\n return mix(higher, lower, 1.0);\n }\n `,\n calcPoint: `\n vec2 function(float d, float angle) {\n return d * vec2(cos(angle), sin(angle)) + (u_dimensions * 0.5);\n }\n `,\n };\n static ColorLoop = (amount) => {\n let loop = '';\n for (let i = 2; i < amount; i++) {\n loop += `colorOut = mix(colorOut, colors[${i}], clamp((dist - stops[${i - 1}]) / (stops[${i}] - stops[${i - 1}]), 0.0, 1.0));`;\n }\n return loop;\n };\n static onColorize = (props) => {\n const colors = props.colors.length || 1;\n return `\n float a = angle - (PI / 180.0 * 90.0);\n float lineDist = abs(u_dimensions.x * cos(a)) + abs(u_dimensions.y * sin(a));\n vec2 f = $calcPoint(lineDist * 0.5, a);\n vec2 t = $calcPoint(lineDist * 0.5, a + PI);\n vec2 gradVec = t - f;\n float dist = dot(v_textureCoordinate.xy * u_dimensions - f, gradVec) / dot(gradVec, gradVec);\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = $fromLinear(mix($toLinear(colors[0]), $toLinear(colors[1]), stopCalc));\n ${this.ColorLoop(colors)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `;\n };\n}\n//# sourceMappingURL=LinearGradientEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Grayscale effect grayscales the color values of the current mask color\n */\nexport class GrayscaleEffect extends ShaderEffect {\n name = 'grayscale';\n static getEffectKey() {\n return `grayscale`;\n }\n static resolveDefaults(props) {\n return {\n amount: props.amount ?? 1,\n };\n }\n static uniforms = {\n amount: {\n value: 1,\n method: 'uniform1f',\n type: 'float',\n },\n };\n static onColorize = `\n float grayness = 0.2 * maskColor.r + 0.6 * maskColor.g + 0.2 * maskColor.b;\n return vec4(amount * vec3(grayness) + (1.0 - amount) * maskColor.rgb, maskColor.a);\n `;\n}\n//# sourceMappingURL=GrayscaleEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the right side of an element\n */\nexport class BorderRightEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderRight';\n static getEffectKey() {\n return `borderRight`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(u_dimensions.x - width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderRightEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the top side of an element\n */\nexport class BorderTopEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderTop';\n static getEffectKey() {\n return `borderTop`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(0.0, width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderTopEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the bottom side of an element\n */\nexport class BorderBottomEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderBottom';\n static getEffectKey() {\n return `borderBottom`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(0.0, u_dimensions.y - width * 0.5);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(u_dimensions.x, width*0.5));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderBottomEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The BorderBottomEffect renders a border on the left of an element\n */\nexport class BorderLeftEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'borderLeft';\n static getEffectKey() {\n return `borderLeft`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n rectDist: `\n float function(vec2 p, vec2 size) {\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0));\n }\n `,\n };\n static onEffectMask = `\n vec2 pos = vec2(width * 0.5, 0.0);\n float mask = $rectDist(v_textureCoordinate.xy * u_dimensions - pos, vec2(width*0.5, u_dimensions.y));\n return mix(shaderColor, maskColor, $fillMask(mask));\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=BorderLeftEffect.js.map","import { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Renders a Glitch effect using the incoming texture\n */\nexport class GlitchEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'glitch';\n static getEffectKey(props) {\n return `glitch`;\n }\n static resolveDefaults(props) {\n return {\n amplitude: props.amplitude ?? 0.2,\n narrowness: props.narrowness ?? 4.0,\n blockiness: props.blockiness ?? 2.0,\n minimizer: props.minimizer ?? 8.0,\n time: props.time ?? Date.now(),\n };\n }\n static uniforms = {\n amplitude: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n narrowness: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n blockiness: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n minimizer: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n time: {\n value: 0,\n method: 'uniform1f',\n validator: (value) => {\n return (Date.now() - value) % 1000;\n },\n type: 'float',\n },\n };\n static methods = {\n rand: `\n float function(vec2 p, float time) {\n float t = floor(time * 20.) / 10.;\n return fract(sin(dot(p, vec2(t * 12.9898, t * 78.233))) * 43758.5453);\n }\n `,\n noise: `\n float function(vec2 uv, float blockiness, float time) {\n vec2 lv = fract(uv);\n vec2 id = floor(uv);\n\n float n1 = rand(id, time);\n float n2 = rand(id+vec2(1,0), time);\n float n3 = rand(id+vec2(0,1), time);\n float n4 = rand(id+vec2(1,1), time);\n vec2 u = smoothstep(0.0, 1.0 + blockiness, lv);\n return mix(mix(n1, n2, u.x), mix(n3, n4, u.x), u.y);\n }\n `,\n fbm: `\n float function(vec2 uv, int count, float blockiness, float complexity, float time) {\n float val = 0.0;\n float amp = 0.5;\n const int MAX_ITERATIONS = 10;\n\n for(int i = 0; i < MAX_ITERATIONS; i++) {\n if(i >= count) {break;}\n val += amp * noise(uv, blockiness, time);\n amp *= 0.5;\n uv *= complexity;\n }\n return val;\n }\n `,\n };\n static onColorize = `\n vec2 uv = v_textureCoordinate.xy;\n float aspect = u_dimensions.x / u_dimensions.y;\n vec2 a = vec2(uv.x * aspect , uv.y);\n vec2 uv2 = vec2(a.x / u_dimensions.x, exp(a.y));\n\n float shift = amplitude * pow($fbm(uv2, 4, blockiness, narrowness, time), minimizer);\n float colR = texture2D(u_texture, vec2(uv.x + shift, uv.y)).r * (1. - shift);\n float colG = texture2D(u_texture, vec2(uv.x - shift, uv.y)).g * (1. - shift);\n float colB = texture2D(u_texture, vec2(uv.x - shift, uv.y)).b * (1. - shift);\n\n vec3 f = vec3(colR, colG, colB);\n return vec4(f, texture2D(u_texture, vec2(uv.x - shift, uv.y)).a);\n `;\n}\n//# sourceMappingURL=GlitchEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\nexport class FadeOutEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'fadeOut';\n static getEffectKey() {\n return `fadeOut`;\n }\n static uniforms = {\n fade: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static resolveDefaults(props) {\n return {\n fade: props.fade ?? 10,\n };\n }\n static onColorize = `\n vec2 point = v_textureCoordinate.xy * u_dimensions.xy;\n vec2 pos1;\n vec2 pos2;\n vec2 d;\n float c;\n vec4 result = maskColor;\n\n\n if(fade[0] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x, point.y + fade[0]);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[1] > 0.0) {\n pos1 = vec2(point.x - u_dimensions.x - fade[1], v_textureCoordinate.y);\n pos2 = vec2(point.x - u_dimensions.x, v_textureCoordinate.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[2] > 0.0) {\n pos1 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y - fade[2]);\n pos2 = vec2(v_textureCoordinate.x, point.y - u_dimensions.y);\n d = pos1 - pos2;\n c = dot(pos2, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n if(fade[3] > 0.0) {\n pos1 = vec2(point.x, point.y);\n pos2 = vec2(point.x + fade[3], point.y);\n d = pos2 - pos1;\n c = dot(pos1, d) / dot(d, d);\n result = mix(vec4(0.0), result, smoothstep(0.0, 1.0, clamp(c, 0.0, 1.0)));\n }\n\n return result;\n `;\n}\n//# sourceMappingURL=FadeOutEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\nexport class RadialGradientEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radialGradient';\n static getEffectKey(props) {\n return `radialGradient${props.colors.length}`;\n }\n static resolveDefaults(props) {\n const colors = props.colors ?? [0xff000000, 0xffffffff];\n let stops = props.stops || [];\n if (stops.length === 0 || stops.length !== colors.length) {\n const colorsL = colors.length;\n let i = 0;\n const tmp = stops;\n for (; i < colorsL; i++) {\n if (stops[i]) {\n tmp[i] = stops[i];\n if (stops[i - 1] === undefined && tmp[i - 2] !== undefined) {\n tmp[i - 1] = tmp[i - 2] + (stops[i] - tmp[i - 2]) / 2;\n }\n }\n else {\n tmp[i] = i * (1 / (colors.length - 1));\n }\n }\n stops = tmp;\n }\n return {\n colors,\n stops,\n width: props.width ?? 0,\n height: props.height ?? props.width ?? 0,\n pivot: props.pivot ?? [0.5, 0.5],\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n height: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n pivot: {\n value: [0.5, 0.5],\n method: 'uniform2fv',\n type: 'vec2',\n },\n colors: {\n value: 0xffffffff,\n validator: (rgbas) => {\n const cols = rgbas.map((rgbas) => getNormalizedRgbaComponents(rgbas));\n return cols.reduce((acc, val) => acc.concat(val), []);\n },\n size: (props) => props.colors.length,\n method: 'uniform4fv',\n type: 'vec4',\n },\n stops: {\n value: [],\n size: (props) => props.colors.length,\n method: 'uniform1fv',\n type: 'float',\n },\n };\n static ColorLoop = (amount) => {\n let loop = '';\n for (let i = 2; i < amount; i++) {\n loop += `colorOut = mix(colorOut, colors[${i}], clamp((dist - stops[${i - 1}]) / (stops[${i}] - stops[${i - 1}]), 0.0, 1.0));`;\n }\n return loop;\n };\n static onColorize = (props) => {\n const colors = props.colors.length || 1;\n return `\n vec2 point = v_textureCoordinate.xy * u_dimensions;\n vec2 projection = vec2(pivot.x * u_dimensions.x, pivot.y * u_dimensions.y);\n\n float dist = length((point - projection) / vec2(width, height));\n\n float stopCalc = (dist - stops[0]) / (stops[1] - stops[0]);\n vec4 colorOut = mix(colors[0], colors[1], stopCalc);\n ${this.ColorLoop(colors)}\n return mix(maskColor, colorOut, clamp(colorOut.a, 0.0, 1.0));\n `;\n };\n}\n//# sourceMappingURL=RadialGradientEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getNormalizedRgbaComponents } from '../../../../lib/utils.js';\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * The RadialProgressEffect renders a border along all edges of an element\n */\nexport class RadialProgressEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'radialProgress';\n static getEffectKey() {\n return `radialProgress`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 10,\n progress: props.progress ?? 0.5,\n offset: props.offset ?? 0,\n range: props.range ?? Math.PI * 2,\n rounded: props.rounded ?? false,\n radius: props.radius ?? 1,\n color: props.color ?? 0xffffffff,\n };\n }\n static uniforms = {\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n progress: {\n value: 0.5,\n method: 'uniform1f',\n type: 'float',\n },\n offset: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n range: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n rounded: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n validator: (value) => {\n return value ? 1 : 0;\n },\n },\n radius: {\n value: 1,\n method: 'uniform1f',\n type: 'float',\n },\n color: {\n value: 0xffffffff,\n validator: (rgba) => getNormalizedRgbaComponents(rgba),\n method: 'uniform4fv',\n type: 'vec4',\n },\n };\n static methods = {\n rotateUV: `\n vec2 function(vec2 uv, float d) {\n float s = sin(d);\n float c = cos(d);\n mat2 rotMatrix = mat2(c, -s, s, c);\n return uv * rotMatrix;\n }\n `,\n drawDot: `\n float function(vec2 uv, vec2 p, float r) {\n uv += p;\n float circle = length(uv) - r;\n return clamp(-circle, 0.0, 1.0);\n }\n `,\n };\n static onEffectMask = `\n float outerRadius = radius * u_dimensions.y * 0.5;\n\n float endAngle = range * progress - 0.0005;\n\n vec2 uv = v_textureCoordinate.xy * u_dimensions.xy - u_dimensions * 0.5;\n\n uv = $rotateUV(uv, -(offset));\n float linewidth = width * u_pixelRatio;\n float circle = length(uv) - (outerRadius - linewidth) ;\n circle = abs(circle) - linewidth;\n circle = clamp(-circle, 0.0, 1.0);\n\n float angle = (atan(uv.x, -uv.y) / 3.14159265359 * 0.5);\n float p = endAngle / (PI * 2.);\n\n circle *= step(fract(angle), fract(p));\n\n circle = rounded < 1. ? circle : max(circle, $drawDot(uv, vec2(0, outerRadius - linewidth), linewidth));\n circle = rounded < 1. ? circle : max(circle, $drawDot($rotateUV(uv, -(endAngle)), vec2(0, outerRadius - linewidth), linewidth));\n\n return mix(shaderColor, maskColor, circle);\n `;\n static onColorize = `\n return color;\n `;\n}\n//# sourceMappingURL=RadialProgressEffect.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ShaderEffect, } from './ShaderEffect.js';\n/**\n * Masks the current maskcolor a holepunch effect with rounded corners similar to {@link RoundedRectangle}\n */\nexport class HolePunchEffect extends ShaderEffect {\n static z$__type__Props;\n name = 'holePunch';\n static getEffectKey() {\n return `holePunch`;\n }\n static uniforms = {\n x: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n y: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n width: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n height: {\n value: 0,\n method: 'uniform1f',\n type: 'float',\n },\n radius: {\n value: 0,\n method: 'uniform4fv',\n type: 'vec4',\n validator: (value) => {\n let r = value;\n if (Array.isArray(r)) {\n if (r.length === 2) {\n r = [r[0], r[1], r[0], r[1]];\n }\n else if (r.length === 3) {\n r = [r[0], r[1], r[2], r[0]];\n }\n else if (r.length !== 4) {\n r = [r[0], r[0], r[0], r[0]];\n }\n }\n else if (typeof r === 'number') {\n r = [r, r, r, r];\n }\n return r;\n },\n },\n };\n static resolveDefaults(props) {\n return {\n x: props.x || 0,\n y: props.y || 0,\n width: props.width || 50,\n height: props.height || 50,\n radius: props.radius ?? 0,\n };\n }\n static methods = {\n fillMask: `\n float function(float dist) {\n return clamp(-dist, 0.0, 1.0);\n }\n `,\n boxDist: `\n float function(vec2 p, vec2 size, float radius) {\n size -= vec2(radius);\n vec2 d = abs(p) - size;\n return min(max(d.x, d.y), 0.0) + length(max(d, 0.0)) - radius;\n }\n `,\n };\n static onShaderMask = `\n vec2 halfDimensions = u_dimensions * 0.5;\n vec2 size = vec2(width, height) * 0.5;\n vec2 basePos = v_textureCoordinate.xy * u_dimensions.xy - vec2(x, y);\n vec2 pos = basePos - size;\n float r = radius[0] * step(pos.x, 0.5) * step(pos.y, 0.5);\n r = r + radius[1] * step(0.5, pos.x) * step(pos.y, 0.5);\n r = r + radius[2] * step(0.5, pos.x) * step(0.5, pos.y);\n r = r + radius[3] * step(pos.x, 0.5) * step(0.5, pos.y);\n return $boxDist(pos, size, r);\n `;\n static onEffectMask = `\n return mix(maskColor, vec4(0.0), $fillMask(shaderMask));\n `;\n}\n//# sourceMappingURL=HolePunchEffect.js.map","import { DefaultShader } from './renderers/webgl/shaders/DefaultShader.js';\nimport { DefaultShaderBatched } from './renderers/webgl/shaders/DefaultShaderBatched.js';\nimport { DynamicShader, } from './renderers/webgl/shaders/DynamicShader.js';\nimport { RoundedRectangle } from './renderers/webgl/shaders/RoundedRectangle.js';\nimport { SdfShader } from './renderers/webgl/shaders/SdfShader.js';\nimport { RadiusEffect } from './renderers/webgl/shaders/effects/RadiusEffect.js';\nimport { BorderEffect } from './renderers/webgl/shaders/effects/BorderEffect.js';\nimport { LinearGradientEffect, } from './renderers/webgl/shaders/effects/LinearGradientEffect.js';\nimport { GrayscaleEffect, } from './renderers/webgl/shaders/effects/GrayscaleEffect.js';\nimport { BorderRightEffect } from './renderers/webgl/shaders/effects/BorderRightEffect.js';\nimport { BorderTopEffect } from './renderers/webgl/shaders/effects/BorderTopEffect.js';\nimport { BorderBottomEffect } from './renderers/webgl/shaders/effects/BorderBottomEffect.js';\nimport { BorderLeftEffect } from './renderers/webgl/shaders/effects/BorderLeftEffect.js';\nimport { GlitchEffect, } from './renderers/webgl/shaders/effects/GlitchEffect.js';\nimport { FadeOutEffect, } from './renderers/webgl/shaders/effects/FadeOutEffect.js';\nimport { RadialGradientEffect, } from './renderers/webgl/shaders/effects/RadialGradientEffect.js';\nimport { RadialProgressEffect, } from './renderers/webgl/shaders/effects/RadialProgressEffect.js';\nimport { HolePunchEffect } from './renderers/webgl/shaders/effects/HolePunchEffect.js';\nexport class CoreShaderManager {\n shCache = new Map();\n shConstructors = {};\n attachedShader = null;\n effectConstructors = {};\n renderer;\n constructor() {\n this.registerShaderType('DefaultShader', DefaultShader);\n this.registerShaderType('DefaultShaderBatched', DefaultShaderBatched);\n this.registerShaderType('RoundedRectangle', RoundedRectangle);\n this.registerShaderType('DynamicShader', DynamicShader);\n this.registerShaderType('SdfShader', SdfShader);\n this.registerEffectType('border', BorderEffect);\n this.registerEffectType('borderBottom', BorderBottomEffect);\n this.registerEffectType('borderLeft', BorderLeftEffect);\n this.registerEffectType('borderRight', BorderRightEffect);\n this.registerEffectType('borderTop', BorderTopEffect);\n this.registerEffectType('fadeOut', FadeOutEffect);\n this.registerEffectType('linearGradient', LinearGradientEffect);\n this.registerEffectType('radialGradient', RadialGradientEffect);\n this.registerEffectType('grayscale', GrayscaleEffect);\n this.registerEffectType('glitch', GlitchEffect);\n this.registerEffectType('radius', RadiusEffect);\n this.registerEffectType('radialProgress', RadialProgressEffect);\n this.registerEffectType('holePunch', HolePunchEffect);\n }\n registerShaderType(shType, shClass) {\n this.shConstructors[shType] = shClass;\n }\n registerEffectType(effectType, effectClass) {\n this.effectConstructors[effectType] = effectClass;\n }\n getRegisteredEffects() {\n return this.effectConstructors;\n }\n getRegisteredShaders() {\n return this.shConstructors;\n }\n loadShader(shType, props) {\n if (!this.renderer) {\n throw new Error(`Renderer is not been defined`);\n }\n const ShaderClass = this.shConstructors[shType];\n if (!ShaderClass) {\n throw new Error(`Shader type \"${shType}\" is not registered`);\n }\n if (shType === 'DynamicShader') {\n return this.loadDynamicShader(props);\n }\n const resolvedProps = ShaderClass.resolveDefaults(props);\n const cacheKey = ShaderClass.makeCacheKey(resolvedProps) || ShaderClass.name;\n if (cacheKey && this.shCache.has(cacheKey)) {\n return {\n shader: this.shCache.get(cacheKey),\n props: resolvedProps,\n };\n }\n // @ts-expect-error ShaderClass WILL accept a Renderer\n const shader = new ShaderClass(this.renderer, props);\n if (cacheKey) {\n this.shCache.set(cacheKey, shader);\n }\n return {\n shader,\n props: resolvedProps,\n };\n }\n loadDynamicShader(props) {\n if (!this.renderer) {\n throw new Error(`Renderer is not been defined`);\n }\n const resolvedProps = DynamicShader.resolveDefaults(props, this.effectConstructors);\n const cacheKey = DynamicShader.makeCacheKey(resolvedProps, this.effectConstructors);\n if (cacheKey && this.shCache.has(cacheKey)) {\n return {\n shader: this.shCache.get(cacheKey),\n props: resolvedProps,\n };\n }\n const shader = new DynamicShader(this.renderer, props, this.effectConstructors);\n if (cacheKey) {\n this.shCache.set(cacheKey, shader);\n }\n return {\n shader: shader,\n props: resolvedProps,\n };\n }\n useShader(shader) {\n if (this.attachedShader === shader) {\n return;\n }\n if (this.attachedShader) {\n this.attachedShader.detach();\n }\n shader.attach();\n this.attachedShader = shader;\n }\n}\n//# sourceMappingURL=CoreShaderManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Class that keeps track of the invocations of Context methods when\n * the `enableContextSpy` renderer option is enabled.\n */\nexport class ContextSpy {\n data = {};\n reset() {\n this.data = {};\n }\n increment(name) {\n if (!this.data[name]) {\n this.data[name] = 0;\n }\n this.data[name]++;\n }\n getData() {\n return { ...this.data };\n }\n}\n//# sourceMappingURL=ContextSpy.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {} from '../textures/Texture.js';\n/**\n * Tests if the given location is a compressed texture container\n * @param url\n * @remarks\n * This function is used to determine if the given image url is a compressed\n * and only supports the following extensions: .ktx and .pvr\n * @returns\n */\nexport function isCompressedTextureContainer(url) {\n return /\\.(ktx|pvr)$/.test(url);\n}\n/**\n * Loads a compressed texture container\n * @param url\n * @returns\n */\nexport const loadCompressedTexture = async (url) => {\n const response = await fetch(url);\n const arrayBuffer = await response.arrayBuffer();\n if (url.indexOf('.ktx') !== -1) {\n return loadKTXData(arrayBuffer);\n }\n return loadPVRData(arrayBuffer);\n};\n/**\n * Loads a KTX texture container and returns the texture data\n * @param buffer\n * @returns\n */\nconst loadKTXData = async (buffer) => {\n const view = new DataView(buffer);\n const littleEndian = view.getUint32(12) === 16909060 ? true : false;\n const mipmaps = [];\n const data = {\n glInternalFormat: view.getUint32(28, littleEndian),\n pixelWidth: view.getUint32(36, littleEndian),\n pixelHeight: view.getUint32(40, littleEndian),\n numberOfMipmapLevels: view.getUint32(56, littleEndian),\n bytesOfKeyValueData: view.getUint32(60, littleEndian),\n };\n let offset = 64;\n // Key Value Pairs of data start at byte offset 64\n // But the only known kvp is the API version, so skipping parsing.\n offset += data.bytesOfKeyValueData;\n for (let i = 0; i < data.numberOfMipmapLevels; i++) {\n const imageSize = view.getUint32(offset);\n offset += 4;\n mipmaps.push(view.buffer.slice(offset, imageSize));\n offset += imageSize;\n }\n return {\n data: {\n glInternalFormat: data.glInternalFormat,\n mipmaps,\n width: data.pixelWidth || 0,\n height: data.pixelHeight || 0,\n type: 'ktx',\n },\n premultiplyAlpha: false,\n };\n};\n/**\n * Loads a PVR texture container and returns the texture data\n * @param buffer\n * @returns\n */\nconst loadPVRData = async (buffer) => {\n // pvr header length in 32 bits\n const pvrHeaderLength = 13;\n // for now only we only support: COMPRESSED_RGB_ETC1_WEBGL\n const pvrFormatEtc1 = 0x8d64;\n const pvrWidth = 7;\n const pvrHeight = 6;\n const pvrMipmapCount = 11;\n const pvrMetadata = 12;\n const arrayBuffer = buffer;\n const header = new Int32Array(arrayBuffer, 0, pvrHeaderLength);\n // @ts-expect-error Object possibly undefined\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n const dataOffset = header[pvrMetadata] + 52;\n const pvrtcData = new Uint8Array(arrayBuffer, dataOffset);\n const mipmaps = [];\n const data = {\n pixelWidth: header[pvrWidth],\n pixelHeight: header[pvrHeight],\n numberOfMipmapLevels: header[pvrMipmapCount] || 0,\n };\n let offset = 0;\n let width = data.pixelWidth || 0;\n let height = data.pixelHeight || 0;\n for (let i = 0; i < data.numberOfMipmapLevels; i++) {\n const level = ((width + 3) >> 2) * ((height + 3) >> 2) * 8;\n const view = new Uint8Array(arrayBuffer, pvrtcData.byteOffset + offset, level);\n mipmaps.push(view);\n offset += level;\n width = width >> 1;\n height = height >> 1;\n }\n return {\n data: {\n glInternalFormat: pvrFormatEtc1,\n mipmaps: mipmaps,\n width: data.pixelWidth || 0,\n height: data.pixelHeight || 0,\n type: 'pvr',\n },\n premultiplyAlpha: false,\n };\n};\n//# sourceMappingURL=textureCompression.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\nimport { isCompressedTextureContainer, loadCompressedTexture, } from '../lib/textureCompression.js';\n/**\n * Texture consisting of an image loaded from a URL\n *\n * @remarks\n * The ImageTexture's {@link ImageTextureProps.src} prop defines the image URL\n * to be downloaded.\n *\n * By default, the texture's alpha values will be premultiplied into its color\n * values which is generally the desired setting before they are sent to the\n * texture's associated {@link Shader}. However, in special cases you may want\n * the Shader to receive straight (non-premultiplied) values. In that case you\n * can disable the default behavior by setting the\n * {@link ImageTextureProps.premultiplyAlpha} prop to `false`.\n */\nexport class ImageTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = ImageTexture.resolveDefaults(props);\n }\n hasAlphaChannel(mimeType) {\n return mimeType.indexOf('image/png') !== -1;\n }\n async getTextureData() {\n const { src, premultiplyAlpha } = this.props;\n if (!src) {\n return {\n data: null,\n };\n }\n if (src instanceof ImageData) {\n return {\n data: src,\n premultiplyAlpha,\n };\n }\n // Handle compressed textures\n if (isCompressedTextureContainer(src)) {\n return loadCompressedTexture(src);\n }\n if (this.txManager.imageWorkerManager) {\n return await this.txManager.imageWorkerManager.getImage(src, premultiplyAlpha);\n }\n else if (this.txManager.hasCreateImageBitmap) {\n const response = await fetch(src);\n const blob = await response.blob();\n const hasAlphaChannel = premultiplyAlpha ?? this.hasAlphaChannel(blob.type);\n return {\n data: await createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none',\n }),\n premultiplyAlpha: hasAlphaChannel,\n };\n }\n else {\n const img = new Image();\n img.src = src;\n await new Promise((resolve, reject) => {\n img.onload = () => resolve();\n img.onerror = () => reject(new Error(`Failed to load image`));\n }).catch((e) => {\n console.error(e);\n });\n return {\n data: img,\n premultiplyAlpha: premultiplyAlpha ?? true,\n };\n }\n }\n static makeCacheKey(props) {\n const resolvedProps = ImageTexture.resolveDefaults(props);\n // ImageTextures sourced by ImageData are non-cacheable\n if (resolvedProps.src instanceof ImageData) {\n return false;\n }\n return `ImageTexture,${resolvedProps.src},${resolvedProps.premultiplyAlpha}`;\n }\n static resolveDefaults(props) {\n return {\n src: props.src ?? '',\n premultiplyAlpha: props.premultiplyAlpha ?? true, // null,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=ImageTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Number of floating point numbers that represent a single glyph in the SDF vertex buffer.\n *\n * @remarks\n * The vertex buffer contains:\n * - 6 vertex positions\n * - 6 texture coordinates\n * - = 12 positions/coordinates per glyph\n *\n * Each vertex position and texture coordinate consist of 2 floating point numbers (x/y).\n * So there are 12 * 2 = 24 floating point numbers that make up a single glyph.\n */\nexport const FLOATS_PER_GLYPH = 24;\n//# sourceMappingURL=constants.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A wrapper Generator class that makes a generator peekable.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class PeekableIterator {\n iterator;\n peekBuffer = [];\n _lastIndex;\n constructor(iterator, indexBase = 0) {\n this.iterator = iterator;\n this.iterator = iterator;\n this._lastIndex = indexBase - 1;\n this.peekBuffer = [];\n }\n next() {\n const nextResult = this.peekBuffer.length > 0\n ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.peekBuffer.pop()\n : this.iterator.next();\n if (nextResult.done) {\n this._lastIndex = -1;\n }\n else {\n this._lastIndex++;\n }\n return nextResult;\n }\n peek() {\n if (this.peekBuffer.length > 0) {\n // We know that the buffer is not empty, so we can safely use the\n // non-null assertion operator\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.peekBuffer[0];\n }\n const result = this.iterator.next();\n this.peekBuffer.push(result);\n return result;\n }\n get lastIndex() {\n return this._lastIndex;\n }\n}\n//# sourceMappingURL=PeekableGenerator.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// Reversible Generator Wrapper Class\n/**\n * Generator function that yields each Unicode code point in the given string.\n */\nexport function* getUnicodeCodepoints(text, start = 0) {\n let i = start;\n while (i < text.length) {\n const codePoint = text.codePointAt(i);\n if (codePoint === undefined) {\n throw new Error('Invalid Unicode code point');\n }\n yield codePoint;\n i += codePoint <= 0xffff ? 1 : 2;\n }\n}\n//# sourceMappingURL=getUnicodeCodepoints.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { PeekableIterator } from './PeekableGenerator.js';\nimport { getUnicodeCodepoints } from './getUnicodeCodepoints.js';\n/**\n * Measures a single-line of text width ignoring any unmapped glyphs including line breaks\n *\n * @param text\n * @param shaperProps\n * @param shaper\n * @returns\n */\nexport function measureText(text, shaperProps, shaper) {\n const glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, 0), 0));\n let width = 0;\n for (const glyph of glyphs) {\n if (glyph.mapped) {\n width += glyph.xAdvance;\n }\n }\n return width;\n}\n//# sourceMappingURL=measureText.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../../../../utils.js';\nimport { PeekableIterator } from './PeekableGenerator.js';\nimport { getUnicodeCodepoints } from './getUnicodeCodepoints.js';\nimport { measureText } from './measureText.js';\nexport function layoutText(curLineIndex, startX, startY, text, textAlign, width, height, fontSize, lineHeight, letterSpacing, \n/**\n * Mutated\n */\nvertexBuffer, contain, \n/**\n * Mutated\n */\nlineCache, rwSdf, trFontFace, forceFullLayoutCalc, scrollable, overflowSuffix, maxLines) {\n assertTruthy(trFontFace, 'Font face must be loaded');\n assertTruthy(trFontFace.loaded, 'Font face must be loaded');\n assertTruthy(trFontFace.data, 'Font face must be loaded');\n assertTruthy(trFontFace.shaper, 'Font face must be loaded');\n // Regardless of fontSize (or other scaling properties), we layout the vertices of each glyph\n // using the fixed coordinate space determined by font size used to produce the atlas.\n // Scaling for display is handled by shader uniforms inexpensively.\n // So we have:\n // - vertex space: the space in which the vertices of each glyph are laid out\n // - screen space: the screen pixel space\n // Input properties such as x, y, w, fontSize, letterSpacing, etc. are all expressed in screen space.\n // We convert these to the vertex space by dividing them the `fontSizeRatio` factor.\n /**\n * See above\n */\n const fontSizeRatio = fontSize / trFontFace.data.info.size;\n /**\n * `lineHeight` in vertex coordinates\n */\n const vertexLineHeight = lineHeight / fontSizeRatio;\n /**\n * `w` in vertex coordinates\n */\n const vertexW = width / fontSizeRatio;\n /**\n * `letterSpacing` in vertex coordinates\n */\n const vertexLSpacing = letterSpacing / fontSizeRatio;\n const startingLineCacheEntry = lineCache[curLineIndex];\n const startingCodepointIndex = startingLineCacheEntry?.codepointIndex || 0;\n const startingMaxX = startingLineCacheEntry?.maxX || 0;\n const startingMaxY = startingLineCacheEntry?.maxY || 0;\n let maxX = startingMaxX;\n let maxY = startingMaxY;\n let curX = startX;\n let curY = startY;\n let bufferOffset = 0;\n /**\n * Buffer offset to last word boundry. This is -1 when we aren't in a word boundry.\n */\n const lastWord = {\n codepointIndex: -1,\n bufferOffset: -1,\n xStart: -1,\n };\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const shaper = trFontFace.shaper;\n const shaperProps = {\n letterSpacing: vertexLSpacing,\n };\n // Get glyphs\n let glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, startingCodepointIndex), startingCodepointIndex));\n let glyphResult;\n let curLineBufferStart = -1;\n const bufferLineInfos = [];\n const vertexTruncateHeight = height / fontSizeRatio;\n const overflowSuffVertexWidth = measureText(overflowSuffix, shaperProps, shaper);\n // Line-by-line layout\n let moreLines = true;\n while (moreLines) {\n const nextLineWillFit = (maxLines === 0 || curLineIndex + 1 < maxLines) &&\n (contain !== 'both' ||\n scrollable ||\n curY + vertexLineHeight + trFontFace.maxCharHeight <=\n vertexTruncateHeight);\n const lineVertexW = nextLineWillFit\n ? vertexW\n : vertexW - overflowSuffVertexWidth;\n /**\n * Vertex X position to the beginning of the last word boundary. This becomes -1 when we start traversing a word.\n */\n let xStartLastWordBoundary = 0;\n const lineIsBelowWindowTop = curY + vertexLineHeight >= rwSdf.y1;\n const lineIsAboveWindowBottom = curY <= rwSdf.y2;\n const lineIsWithinWindow = lineIsBelowWindowTop && lineIsAboveWindowBottom;\n // Layout glyphs in this line\n // Any break statements in this while loop will trigger a line break\n while ((glyphResult = glyphs.next()) && !glyphResult.done) {\n const glyph = glyphResult.value;\n if (curLineIndex === lineCache.length) {\n lineCache.push({\n codepointIndex: glyph.cluster,\n maxY,\n maxX,\n });\n }\n else if (curLineIndex > lineCache.length) {\n throw new Error('Unexpected lineCache length');\n }\n // If we encounter a word boundary (white space or newline) we invalidate\n // the lastWord and set the xStartLastWordBoundary if we haven't already.\n if (glyph.codepoint === 32 || glyph.codepoint === 10) {\n if (lastWord.codepointIndex !== -1) {\n lastWord.codepointIndex = -1;\n xStartLastWordBoundary = curX;\n }\n }\n else if (lastWord.codepointIndex === -1) {\n lastWord.codepointIndex = glyph.cluster;\n lastWord.bufferOffset = bufferOffset;\n lastWord.xStart = xStartLastWordBoundary;\n }\n if (glyph.mapped) {\n // Mapped glyph\n const charEndX = curX + glyph.xOffset + glyph.width;\n // Word wrap check\n if (\n // We are containing the text\n contain !== 'none' &&\n // The current glyph reaches outside the contained width\n charEndX >= lineVertexW &&\n // There is a last word that we can break to the next line\n lastWord.codepointIndex !== -1 &&\n // Prevents infinite loop when a single word is longer than the width\n lastWord.xStart > 0) {\n // The current word is about to go off the edge of the container width\n // Reinitialize the iterator starting at the last word\n // and proceeding to the next line\n if (nextLineWillFit) {\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(text, lastWord.codepointIndex), lastWord.codepointIndex));\n bufferOffset = lastWord.bufferOffset;\n break;\n }\n else {\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(overflowSuffix, 0), 0));\n curX = lastWord.xStart;\n bufferOffset = lastWord.bufferOffset;\n // HACK: For the rest of the line when inserting the overflow suffix,\n // set contain = 'none' to prevent an infinite loop.\n contain = 'none';\n }\n }\n else {\n // This glyph fits, so we can add it to the buffer\n const quadX = curX + glyph.xOffset;\n const quadY = curY + glyph.yOffset;\n // Only add to buffer for rendering if the line is within the render window\n if (lineIsWithinWindow) {\n if (curLineBufferStart === -1) {\n curLineBufferStart = bufferOffset;\n }\n const atlasEntry = trFontFace.getAtlasEntry(glyph.glyphId);\n // Add texture coordinates\n const u = atlasEntry.x / trFontFace.data.common.scaleW;\n const v = atlasEntry.y / trFontFace.data.common.scaleH;\n const uvWidth = atlasEntry.width / trFontFace.data.common.scaleW;\n const uvHeight = atlasEntry.height / trFontFace.data.common.scaleH;\n // TODO: (Performance) We can optimize this by using ELEMENT_ARRAY_BUFFER\n // eliminating the need to duplicate vertices\n // Top-left\n vertexBuffer[bufferOffset++] = quadX;\n vertexBuffer[bufferOffset++] = quadY;\n vertexBuffer[bufferOffset++] = u;\n vertexBuffer[bufferOffset++] = v;\n // Top-right\n vertexBuffer[bufferOffset++] = quadX + glyph.width;\n vertexBuffer[bufferOffset++] = quadY;\n vertexBuffer[bufferOffset++] = u + uvWidth;\n vertexBuffer[bufferOffset++] = v;\n // Bottom-left\n vertexBuffer[bufferOffset++] = quadX;\n vertexBuffer[bufferOffset++] = quadY + glyph.height;\n vertexBuffer[bufferOffset++] = u;\n vertexBuffer[bufferOffset++] = v + uvHeight;\n // Bottom-right\n vertexBuffer[bufferOffset++] = quadX + glyph.width;\n vertexBuffer[bufferOffset++] = quadY + glyph.height;\n vertexBuffer[bufferOffset++] = u + uvWidth;\n vertexBuffer[bufferOffset++] = v + uvHeight;\n }\n maxY = Math.max(maxY, quadY + glyph.height);\n maxX = Math.max(maxX, quadX + glyph.width);\n curX += glyph.xAdvance;\n }\n }\n else {\n // Unmapped character\n // Handle newlines\n if (glyph.codepoint === 10) {\n if (nextLineWillFit) {\n // The whole line fit, so we can break to the next line\n break;\n }\n else {\n // The whole line won't fit, so we need to add the overflow suffix\n glyphs = shaper.shapeText(shaperProps, new PeekableIterator(getUnicodeCodepoints(overflowSuffix, 0), 0));\n // HACK: For the rest of the line when inserting the overflow suffix,\n // set contain = 'none' to prevent an infinite loop.\n contain = 'none';\n }\n }\n }\n }\n // Prepare for the next line...\n if (curLineBufferStart !== -1) {\n bufferLineInfos.push({\n bufferStart: curLineBufferStart,\n bufferEnd: bufferOffset,\n });\n curLineBufferStart = -1;\n }\n curX = 0;\n curY += vertexLineHeight;\n curLineIndex++;\n lastWord.codepointIndex = -1;\n xStartLastWordBoundary = 0;\n // Figure out if there are any more lines to render...\n if (!forceFullLayoutCalc && contain === 'both' && curY > rwSdf.y2) {\n // Stop layout calculation early (for performance purposes) if:\n // - We're not forcing a full layout calculation (for width/height calculation)\n // - ...and we're containing the text vertically+horizontally (contain === 'both')\n // - ...and we have a render window\n // - ...and the next line is below the bottom of the render window\n moreLines = false;\n }\n else if (glyphResult && glyphResult.done) {\n // If we've reached the end of the text, we know we're done\n moreLines = false;\n }\n else if (!nextLineWillFit) {\n // If we're contained vertically+horizontally (contain === 'both')\n // but not scrollable and the next line won't fit, we're done.\n moreLines = false;\n }\n }\n // Use textAlign to determine if we need to adjust the x position of the text\n // in the buffer line by line\n if (textAlign === 'center') {\n const vertexTextW = contain === 'none' ? maxX : vertexW;\n for (let i = 0; i < bufferLineInfos.length; i++) {\n const line = bufferLineInfos[i];\n // - 4 = the x position of a rightmost vertex\n const lineWidth = \n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n vertexBuffer[line.bufferEnd - 4] - vertexBuffer[line.bufferStart];\n const xOffset = (vertexTextW - lineWidth) / 2;\n for (let j = line.bufferStart; j < line.bufferEnd; j += 4) {\n vertexBuffer[j] += xOffset;\n }\n }\n }\n else if (textAlign === 'right') {\n const vertexTextW = contain === 'none' ? maxX : vertexW;\n for (let i = 0; i < bufferLineInfos.length; i++) {\n const line = bufferLineInfos[i];\n const lineWidth = line.bufferEnd === line.bufferStart\n ? 0\n : // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n vertexBuffer[line.bufferEnd - 4] - vertexBuffer[line.bufferStart];\n const xOffset = vertexTextW - lineWidth;\n for (let j = line.bufferStart; j < line.bufferEnd; j += 4) {\n vertexBuffer[j] += xOffset;\n }\n }\n }\n assertTruthy(glyphResult);\n return {\n bufferNumFloats: bufferOffset,\n bufferNumQuads: bufferOffset / 16,\n layoutNumCharacters: glyphResult.done\n ? text.length - startingCodepointIndex\n : glyphResult.value.cluster - startingCodepointIndex + 1,\n fullyProcessed: !!glyphResult.done,\n maxX,\n maxY,\n };\n}\n//# sourceMappingURL=layoutText.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { isBoundPositive } from '../../../../lib/utils.js';\nimport { roundDownToMultiple, roundUpToMultiple } from './util.js';\n/**\n * Create a render window from the given parameters.\n *\n * @remarks\n * The render window is a rectangle that defines the area of the text that\n * should be rendered. It is used to skip rendering parts of the text that\n * are outside of the render window. The render window is relative to the\n * text's top left corner of the overrall text.\n *\n * @param x The x coordinate of the text element's top left corner relative to the screen.\n * @param y The y coordinate of the text element's top left corner relative to the screen.\n * @param scrollY The amount of pixels to scroll the text vertically.\n * @param lineHeight The number of extra lines to render above and below the visible window.\n * @param visibleWindow The visible window of the text element relative to the screen\n * @returns\n */\nexport function setRenderWindow(outRenderWindow, x, y, scrollY, lineHeight, bufferMargin, visibleWindow, fontSizeRatio) {\n const { screen, sdf } = outRenderWindow;\n if (!isBoundPositive(visibleWindow)) {\n screen.x1 = 0;\n screen.y1 = 0;\n screen.x2 = 0;\n screen.y2 = 0;\n sdf.x1 = 0;\n sdf.y1 = 0;\n sdf.x2 = 0;\n sdf.y2 = 0;\n outRenderWindow.numLines = 0;\n outRenderWindow.firstLineIdx = 0;\n }\n else {\n const x1 = visibleWindow.x1 - x;\n const x2 = x1 + (visibleWindow.x2 - visibleWindow.x1);\n const y1Base = visibleWindow.y1 - y + scrollY;\n const y1 = roundDownToMultiple(y1Base - bufferMargin, lineHeight || 1);\n const y2 = roundUpToMultiple(y1Base + (visibleWindow.y2 - visibleWindow.y1) + bufferMargin, lineHeight || 1);\n screen.x1 = x1;\n screen.y1 = y1;\n screen.x2 = x2;\n screen.y2 = y2;\n sdf.x1 = x1 / fontSizeRatio;\n sdf.y1 = y1 / fontSizeRatio;\n sdf.x2 = x2 / fontSizeRatio;\n sdf.y2 = y2 / fontSizeRatio;\n outRenderWindow.numLines = Math.ceil((y2 - y1) / lineHeight);\n outRenderWindow.firstLineIdx = lineHeight ? Math.floor(y1 / lineHeight) : 0;\n }\n outRenderWindow.valid = true;\n}\n//# sourceMappingURL=setRenderWindow.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Round up to the nearest multiple of the given number.\n *\n * @param value\n * @param multiple\n * @returns\n */\nexport function roundUpToMultiple(value, multiple) {\n return Math.ceil(value / multiple) * multiple;\n}\n/**\n * Round down to the nearest multiple of the given number.\n *\n * @param value\n * @param multiple\n * @returns\n */\nexport function roundDownToMultiple(value, multiple) {\n return Math.floor(value / multiple) * multiple;\n}\n//# sourceMappingURL=util.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport memize from 'memize';\nconst weightConversions = {\n normal: 400,\n bold: 700,\n bolder: 900,\n lighter: 100,\n};\nconst fontWeightToNumber = (weight) => {\n if (typeof weight === 'number') {\n return weight;\n }\n return weightConversions[weight] || 400;\n};\nfunction rawResolveFontToUse(familyMapsByPriority, family, weightIn, style, stretch) {\n let weight = fontWeightToNumber(weightIn);\n for (const fontFamiles of familyMapsByPriority) {\n const fontFaces = fontFamiles[family];\n if (!fontFaces) {\n continue;\n }\n if (fontFaces.size === 1) {\n // No Exact match found, find nearest weight match\n console.warn(`TrFontManager: Only one font face found for family: '${family}' - will be used for all weights and styles`);\n return fontFaces.values().next().value;\n }\n const weightMap = new Map();\n for (const fontFace of fontFaces) {\n const fontFamilyWeight = fontWeightToNumber(fontFace.descriptors.weight);\n if (fontFamilyWeight === weight &&\n fontFace.descriptors.style === style &&\n fontFace.descriptors.stretch === stretch) {\n return fontFace;\n }\n weightMap.set(fontFamilyWeight, fontFace);\n }\n // No Exact match found, find nearest weight match\n const msg = `TrFontManager: No exact match: '${family} Weight: ${weight} Style: ${style} Stretch: ${stretch}'`;\n console.error(msg);\n // Follow the CSS font-weight algorithm to find the nearest weight match\n // https://www.w3.org/TR/2018/REC-css-fonts-3-20180920/#font-matching-algorithm\n if (weight === 400 && weightMap.has(500)) {\n return weightMap.get(500);\n }\n if (weight === 500 && weightMap.has(400)) {\n return weightMap.get(400);\n }\n if (weight < 400) {\n while (weight > 0) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight -= 100;\n }\n // reset back for the next loop\n weight = 600;\n }\n while (weight < 1000) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight += 100;\n }\n // finally check lower again\n weight = 500;\n while (weight > 0) {\n if (weightMap.has(weight)) {\n return weightMap.get(weight);\n }\n weight -= 100;\n }\n }\n return;\n}\nconst resolveFontToUse = memize(rawResolveFontToUse);\nexport class TrFontManager {\n textRenderers;\n constructor(textRenderers) {\n this.textRenderers = textRenderers;\n // Intentionally left blank\n }\n addFontFace(font) {\n // All the font face to all of the text renderers that support it\n for (const trId in this.textRenderers) {\n const tr = this.textRenderers[trId];\n if (tr && tr.isFontFaceSupported(font)) {\n tr.addFontFace(font);\n }\n }\n }\n /**\n * Utility method to resolve a single font face from a list of prioritized family maps based on\n * a set of font properties.\n *\n * @remarks\n * These are to be used by a text renderer to resolve a font face if needed.\n *\n * @param familyMapsByPriority\n * @param props\n * @returns\n */\n static resolveFontFace(familyMapsByPriority, props) {\n const { fontFamily, fontWeight, fontStyle, fontStretch } = props;\n return resolveFontToUse(familyMapsByPriority, fontFamily, fontWeight, fontStyle, fontStretch);\n }\n}\n//# sourceMappingURL=TrFontManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createBound, intersectRect, copyRect, boundsOverlap, convertBoundToRect, } from '../../../lib/utils.js';\nimport { TextRenderer, } from '../TextRenderer.js';\nimport { SdfTrFontFace } from '../../font-face-types/SdfTrFontFace/SdfTrFontFace.js';\nimport { FLOATS_PER_GLYPH } from './internal/constants.js';\nimport { getStartConditions } from './internal/getStartConditions.js';\nimport { layoutText } from './internal/layoutText.js';\nimport { setRenderWindow, } from './internal/setRenderWindow.js';\nimport { TrFontManager } from '../../TrFontManager.js';\nimport { assertTruthy, mergeColorAlpha } from '../../../../utils.js';\nimport { WebGlCoreRenderOp } from '../../../renderers/webgl/WebGlCoreRenderOp.js';\nimport { BufferCollection } from '../../../renderers/webgl/internal/BufferCollection.js';\nimport { EventEmitter } from '../../../../common/EventEmitter.js';\n/**\n * Ephemeral rect object used for calculations\n */\nconst tmpRect = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n};\n/**\n * Singleton class for rendering text using signed distance fields.\n *\n * @remarks\n * SdfTextRenderer supports both single-channel and multi-channel signed distance fields.\n */\nexport class SdfTextRenderer extends TextRenderer {\n /**\n * Map of font family names to a set of font faces.\n */\n ssdfFontFamilies = {};\n msdfFontFamilies = {};\n fontFamilyArray = [\n this.ssdfFontFamilies,\n this.msdfFontFamilies,\n ];\n sdfShader;\n rendererBounds;\n constructor(stage) {\n super(stage);\n this.sdfShader = this.stage.shManager.loadShader('SdfShader').shader;\n this.rendererBounds = {\n x1: 0,\n y1: 0,\n x2: this.stage.options.appWidth,\n y2: this.stage.options.appHeight,\n };\n }\n //#region Overrides\n getPropertySetters() {\n return {\n fontFamily: (state, value) => {\n state.props.fontFamily = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontWeight: (state, value) => {\n state.props.fontWeight = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontStyle: (state, value) => {\n state.props.fontStyle = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontStretch: (state, value) => {\n state.props.fontStretch = value;\n this.releaseFontFace(state);\n this.invalidateLayoutCache(state);\n },\n fontSize: (state, value) => {\n state.props.fontSize = value;\n this.invalidateLayoutCache(state);\n },\n text: (state, value) => {\n state.props.text = value;\n this.invalidateLayoutCache(state);\n },\n textAlign: (state, value) => {\n state.props.textAlign = value;\n this.invalidateLayoutCache(state);\n },\n color: (state, value) => {\n state.props.color = value;\n },\n x: (state, value) => {\n state.props.x = value;\n if (state.elementBounds.valid) {\n this.setElementBoundsX(state);\n // Only schedule an update if the text is not already rendered\n // (renderWindow is invalid) and the element possibly overlaps the screen\n // This is to avoid unnecessary updates when we know text is off-screen\n if (!state.renderWindow.valid &&\n boundsOverlap(state.elementBounds, this.rendererBounds)) {\n this.scheduleUpdateState(state);\n }\n }\n },\n y: (state, value) => {\n state.props.y = value;\n if (state.elementBounds.valid) {\n this.setElementBoundsY(state);\n // See x() for explanation\n if (!state.renderWindow.valid &&\n boundsOverlap(state.elementBounds, this.rendererBounds)) {\n this.scheduleUpdateState(state);\n }\n }\n },\n contain: (state, value) => {\n state.props.contain = value;\n this.invalidateLayoutCache(state);\n },\n width: (state, value) => {\n state.props.width = value;\n // Only invalidate layout cache if we're containing in the horizontal direction\n if (state.props.contain !== 'none') {\n this.invalidateLayoutCache(state);\n }\n },\n height: (state, value) => {\n state.props.height = value;\n // Only invalidate layout cache if we're containing in the vertical direction\n if (state.props.contain === 'both') {\n this.invalidateLayoutCache(state);\n }\n },\n offsetY: (state, value) => {\n state.props.offsetY = value;\n this.invalidateLayoutCache(state);\n },\n scrollable: (state, value) => {\n state.props.scrollable = value;\n this.invalidateLayoutCache(state);\n },\n scrollY: (state, value) => {\n state.props.scrollY = value;\n // Scrolling doesn't need to invalidate any caches, but it does need to\n // schedule an update\n this.scheduleUpdateState(state);\n },\n letterSpacing: (state, value) => {\n state.props.letterSpacing = value;\n this.invalidateLayoutCache(state);\n },\n lineHeight: (state, value) => {\n state.props.lineHeight = value;\n this.invalidateLayoutCache(state);\n },\n maxLines: (state, value) => {\n state.props.maxLines = value;\n this.invalidateLayoutCache(state);\n },\n textBaseline: (state, value) => {\n state.props.textBaseline = value;\n this.invalidateLayoutCache(state);\n },\n verticalAlign: (state, value) => {\n state.props.verticalAlign = value;\n this.invalidateLayoutCache(state);\n },\n overflowSuffix: (state, value) => {\n state.props.overflowSuffix = value;\n this.invalidateLayoutCache(state);\n },\n debug: (state, value) => {\n state.props.debug = value;\n },\n };\n }\n canRenderFont(props) {\n // TODO: Support matching on font stretch, weight and style (if/when needed)\n // For now we just match on the font family name\n // '$$SDF_FAILURE_TEST$$' is used to test the 'failure' event coming from text\n const { fontFamily } = props;\n return (fontFamily in this.ssdfFontFamilies ||\n fontFamily in this.msdfFontFamilies ||\n fontFamily === '$$SDF_FAILURE_TEST$$');\n }\n isFontFaceSupported(fontFace) {\n return fontFace instanceof SdfTrFontFace;\n }\n addFontFace(fontFace) {\n // Make sure the font face is an SDF font face (it should have already passed\n // the `isFontFaceSupported` check)\n assertTruthy(fontFace instanceof SdfTrFontFace);\n const familyName = fontFace.fontFamily;\n const fontFamiles = fontFace.type === 'ssdf'\n ? this.ssdfFontFamilies\n : fontFace.type === 'msdf'\n ? this.msdfFontFamilies\n : undefined;\n if (!fontFamiles) {\n console.warn(`Invalid font face type: ${fontFace.type}`);\n return;\n }\n let faceSet = fontFamiles[familyName];\n if (!faceSet) {\n faceSet = new Set();\n fontFamiles[familyName] = faceSet;\n }\n faceSet.add(fontFace);\n }\n createState(props) {\n return {\n props,\n status: 'initialState',\n updateScheduled: false,\n emitter: new EventEmitter(),\n lineCache: [],\n forceFullLayoutCalc: false,\n renderWindow: {\n screen: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n },\n sdf: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n },\n firstLineIdx: 0,\n numLines: 0,\n valid: false,\n },\n elementBounds: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n valid: false,\n },\n clippingRect: {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n valid: false,\n },\n bufferNumFloats: 0,\n bufferNumQuads: 0,\n vertexBuffer: undefined,\n webGlBuffers: null,\n bufferUploaded: false,\n textH: undefined,\n textW: undefined,\n distanceRange: 0,\n trFontFace: undefined,\n isRenderable: false,\n debugData: {\n updateCount: 0,\n layoutCount: 0,\n lastLayoutNumCharacters: 0,\n layoutSum: 0,\n drawSum: 0,\n drawCount: 0,\n bufferSize: 0,\n },\n };\n }\n updateState(state) {\n let { trFontFace } = state;\n const { textH, lineCache, debugData, forceFullLayoutCalc } = state;\n debugData.updateCount++;\n // On the first update call we need to set the status to loading\n if (state.status === 'initialState') {\n this.setStatus(state, 'loading');\n }\n // Resolve font face if we haven't yet\n if (!trFontFace) {\n trFontFace = this.resolveFontFace(state.props);\n state.trFontFace = trFontFace;\n if (!trFontFace) {\n const msg = `SdfTextRenderer: Could not resolve font face for family: '${state.props.fontFamily}'`;\n console.error(msg);\n this.setStatus(state, 'failed', new Error(msg));\n return;\n }\n trFontFace.texture.setRenderableOwner(state, state.isRenderable);\n }\n // If the font hasn't been loaded yet, stop here.\n // Listen for the 'loaded' event and forward fontLoaded event\n if (!trFontFace.loaded) {\n trFontFace.once('loaded', () => {\n this.scheduleUpdateState(state);\n });\n return;\n }\n // If the font is loaded then so should the data\n assertTruthy(trFontFace.data, 'Font face data should be loaded');\n const { text, fontSize, x, y, contain, width, height, lineHeight, verticalAlign, scrollable, overflowSuffix, maxLines, } = state.props;\n // scrollY only has an effect when contain === 'both' and scrollable === true\n const scrollY = contain === 'both' && scrollable ? state.props.scrollY : 0;\n const { renderWindow } = state;\n /**\n * The font size of the SDF font face (the basis for SDF space units)\n */\n const sdfFontSize = trFontFace.data.info.size;\n /**\n * Divide screen space units by this to get the SDF space units\n * Mulitple SDF space units by this to get screen space units\n */\n const fontSizeRatio = fontSize / sdfFontSize;\n // Needed in renderWindow calculation\n const sdfLineHeight = lineHeight / fontSizeRatio;\n state.distanceRange =\n fontSizeRatio * trFontFace.data.distanceField.distanceRange;\n // Allocate buffers if needed\n const neededLength = text.length * FLOATS_PER_GLYPH;\n let vertexBuffer = state.vertexBuffer;\n if (!vertexBuffer || vertexBuffer.length < neededLength) {\n vertexBuffer = new Float32Array(neededLength * 2);\n }\n const elementBounds = state.elementBounds;\n if (!elementBounds.valid) {\n this.setElementBoundsX(state);\n this.setElementBoundsY(state);\n elementBounds.valid = true;\n }\n // Return early if we're still viewing inside the established render window\n // No need to re-render what we've already rendered\n // (Only if there's an established renderWindow and we're not suppressing early exit)\n if (!forceFullLayoutCalc && renderWindow.valid) {\n const rwScreen = renderWindow.screen;\n if (x + rwScreen.x1 <= elementBounds.x1 &&\n x + rwScreen.x2 >= elementBounds.x2 &&\n y - scrollY + rwScreen.y1 <= elementBounds.y1 &&\n y - scrollY + rwScreen.y2 >= elementBounds.y2) {\n this.setStatus(state, 'loaded');\n return;\n }\n // Otherwise invalidate the renderWindow so it can be redone\n renderWindow.valid = false;\n this.setStatus(state, 'loading');\n }\n const { offsetY, textAlign } = state.props;\n // Create a new renderWindow if needed\n if (!renderWindow.valid) {\n const isPossiblyOnScreen = boundsOverlap(elementBounds, this.rendererBounds);\n if (!isPossiblyOnScreen) {\n // If the element is not possibly on screen, we can skip the layout and rendering completely\n return;\n }\n setRenderWindow(renderWindow, x, y, scrollY, lineHeight, contain === 'both' ? elementBounds.y2 - elementBounds.y1 : 0, elementBounds, fontSizeRatio);\n // console.log('newRenderWindow', renderWindow);\n }\n const start = getStartConditions(sdfFontSize, sdfLineHeight, lineHeight, verticalAlign, offsetY, fontSizeRatio, renderWindow, lineCache, textH);\n if (!start) {\n // Nothing to render, return early, but still mark as loaded (since the text is just scrolled\n // out of view)\n this.setStatus(state, 'loaded');\n return;\n }\n const { letterSpacing } = state.props;\n const out2 = layoutText(start.lineIndex, start.sdfX, start.sdfY, text, textAlign, width, height, fontSize, lineHeight, letterSpacing, vertexBuffer, contain, lineCache, renderWindow.sdf, trFontFace, forceFullLayoutCalc, scrollable, overflowSuffix, maxLines);\n state.bufferUploaded = false;\n state.bufferNumFloats = out2.bufferNumFloats;\n state.bufferNumQuads = out2.bufferNumQuads;\n state.vertexBuffer = vertexBuffer;\n state.renderWindow = renderWindow;\n debugData.lastLayoutNumCharacters = out2.layoutNumCharacters;\n debugData.bufferSize = vertexBuffer.byteLength;\n // If we didn't exit early, we know we have completely computed w/h\n if (out2.fullyProcessed) {\n state.textW = out2.maxX * fontSizeRatio;\n state.textH = out2.maxY * fontSizeRatio;\n }\n // if (state.props.debug.printLayoutTime) {\n // debugData.layoutSum += performance.now() - updateStartTime;\n // debugData.layoutCount++;\n // }\n this.setStatus(state, 'loaded');\n }\n renderQuads(state, transform, clippingRect, alpha) {\n if (!state.vertexBuffer) {\n // Nothing to draw\n return;\n }\n const { renderer } = this.stage;\n const { fontSize, color, contain, scrollable, zIndex, debug } = state.props;\n // scrollY only has an effect when contain === 'both' and scrollable === true\n const scrollY = contain === 'both' && scrollable ? state.props.scrollY : 0;\n const { textW = 0, textH = 0, distanceRange, vertexBuffer, bufferUploaded, trFontFace, elementBounds, } = state;\n let { webGlBuffers } = state;\n if (!webGlBuffers) {\n const glw = renderer.glw;\n const stride = 4 * Float32Array.BYTES_PER_ELEMENT;\n const webGlBuffer = glw.createBuffer();\n assertTruthy(webGlBuffer);\n state.webGlBuffers = new BufferCollection([\n {\n buffer: webGlBuffer,\n attributes: {\n a_position: {\n name: 'a_position',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 0, // start at the beginning of the buffer\n },\n a_textureCoordinate: {\n name: 'a_textureCoordinate',\n size: 2,\n type: glw.FLOAT,\n normalized: false,\n stride,\n offset: 2 * Float32Array.BYTES_PER_ELEMENT,\n },\n },\n },\n ]);\n state.bufferUploaded = false;\n assertTruthy(state.webGlBuffers);\n webGlBuffers = state.webGlBuffers;\n }\n if (!bufferUploaded) {\n const glw = renderer.glw;\n const buffer = webGlBuffers?.getBuffer('a_textureCoordinate') ?? null;\n glw.arrayBufferData(buffer, vertexBuffer, glw.STATIC_DRAW);\n state.bufferUploaded = true;\n }\n assertTruthy(trFontFace);\n if (scrollable && contain === 'both') {\n assertTruthy(elementBounds.valid);\n const elementRect = convertBoundToRect(elementBounds, tmpRect);\n if (clippingRect.valid) {\n state.clippingRect.valid = true;\n clippingRect = intersectRect(clippingRect, elementRect, state.clippingRect);\n }\n else {\n state.clippingRect.valid = true;\n clippingRect = copyRect(elementRect, state.clippingRect);\n }\n }\n const renderOp = new WebGlCoreRenderOp(renderer.glw, renderer.options, webGlBuffers, this.sdfShader, {\n transform: transform.data,\n // IMPORTANT: The SDF Shader expects the color NOT to be premultiplied\n // for the best blending results. Which is why we use `mergeColorAlpha`\n // instead of `mergeColorAlphaPremultiplied` here.\n color: mergeColorAlpha(color, alpha),\n size: fontSize / (trFontFace.data?.info.size || 0),\n scrollY,\n distanceRange,\n debug: debug.sdfShaderDebug,\n }, alpha, clippingRect, { height: textH, width: textW }, 0, zIndex);\n const texture = state.trFontFace?.texture;\n assertTruthy(texture);\n const ctxTexture = this.stage.txManager.getCtxTexture(texture);\n renderOp.addTexture(ctxTexture);\n renderOp.length = state.bufferNumFloats;\n renderOp.numQuads = state.bufferNumQuads;\n renderer.addRenderOp(renderOp);\n // if (!debug.disableScissor) {\n // renderer.enableScissor(\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // Draw the arrays\n // gl.drawArrays(\n // gl.TRIANGLES, // Primitive type\n // 0,\n // bufferNumVertices, // Number of verticies\n // );\n // renderer.disableScissor();\n // if (debug.showElementRect) {\n // this.renderer.drawBorder(\n // Colors.Blue,\n // elementRect.x,\n // elementRect.y,\n // elementRect.w,\n // elementRect.h,\n // );\n // }\n // if (debug.showVisibleRect) {\n // this.renderer.drawBorder(\n // Colors.Green,\n // visibleRect.x,\n // visibleRect.y,\n // visibleRect.w,\n // visibleRect.h,\n // );\n // }\n // if (debug.showRenderWindow && renderWindow) {\n // this.renderer.drawBorder(\n // Colors.Red,\n // x + renderWindow.x1,\n // y + renderWindow.y1 - scrollY,\n // x + renderWindow.x2 - (x + renderWindow.x1),\n // y + renderWindow.y2 - scrollY - (y + renderWindow.y1 - scrollY),\n // );\n // }\n // if (debug.printLayoutTime) {\n // debugData.drawSum += performance.now() - drawStartTime;\n // debugData.drawCount++;\n // }\n }\n setIsRenderable(state, renderable) {\n super.setIsRenderable(state, renderable);\n state.trFontFace?.texture.setRenderableOwner(state, renderable);\n }\n destroyState(state) {\n super.destroyState(state);\n // If there's a Font Face assigned we must free the owner relation to its texture\n state.trFontFace?.texture.setRenderableOwner(state, false);\n }\n //#endregion Overrides\n resolveFontFace(props) {\n return TrFontManager.resolveFontFace(this.fontFamilyArray, props);\n }\n /**\n * Release the loaded SDF font face\n *\n * @param state\n */\n releaseFontFace(state) {\n if (state.trFontFace) {\n state.trFontFace.texture.setRenderableOwner(state, false);\n state.trFontFace = undefined;\n }\n }\n /**\n * Invalidate the layout cache stored in the state. This will cause the text\n * to be re-layed out on the next update.\n *\n * @remarks\n * This also invalidates the visible window cache.\n *\n * @param state\n */\n invalidateLayoutCache(state) {\n state.renderWindow.valid = false;\n state.elementBounds.valid = false;\n state.textH = undefined;\n state.textW = undefined;\n state.lineCache = [];\n this.setStatus(state, 'loading');\n this.scheduleUpdateState(state);\n }\n setElementBoundsX(state) {\n const { x, contain, width } = state.props;\n const { elementBounds } = state;\n elementBounds.x1 = x;\n elementBounds.x2 = contain !== 'none' ? x + width : Infinity;\n }\n setElementBoundsY(state) {\n const { y, contain, height } = state.props;\n const { elementBounds } = state;\n elementBounds.y1 = y;\n elementBounds.y2 = contain === 'both' ? y + height : Infinity;\n }\n}\n//# sourceMappingURL=SdfTextRenderer.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Gets the start conditions for the layout loop.\n *\n * @remarks\n * Returns `undefined` if the layout loop should not be run.\n *\n * @param fontSize\n * @param fontSizeRatio\n * @param sdfLineHeight\n * @param renderWindow\n * @param lineCache\n * @param textH\n * @returns\n */\nexport function getStartConditions(sdfFontSize, sdfLineHeight, lineHeight, verticalAlign, offsetY, fontSizeRatio, renderWindow, lineCache, textH) {\n // State variables\n const startLineIndex = Math.min(Math.max(renderWindow.firstLineIdx, 0), lineCache.length);\n // TODO: (fontSize / 6.4286 / fontSizeRatio) Adding this to the startY helps the text line up better with Canvas rendered text\n const sdfStartX = 0;\n let sdfVerticalAlignYOffset = 0;\n if (verticalAlign === 'middle') {\n sdfVerticalAlignYOffset = (sdfLineHeight - sdfFontSize) / 2;\n }\n else if (verticalAlign === 'bottom') {\n sdfVerticalAlignYOffset = sdfLineHeight - sdfFontSize;\n }\n const sdfOffsetY = offsetY / fontSizeRatio;\n const sdfStartY = sdfOffsetY + startLineIndex * sdfLineHeight + sdfVerticalAlignYOffset; // TODO: Figure out what determines the initial y offset of text.\n // Don't attempt to render anything if we know we're starting past the established end of the text\n if (textH && sdfStartY >= textH / fontSizeRatio) {\n return;\n }\n return {\n sdfX: sdfStartX,\n sdfY: sdfStartY,\n lineIndex: startLineIndex,\n };\n}\n//# sourceMappingURL=getStartConditions.js.map","import { CoreExtension } from '../../exports/core-api.js';\n/**\n * Type guard that checks if a Class extends CoreExtension.\n *\n * @param Class\n * @returns\n */\nexport function classExtendsCoreExtension(Class) {\n return Class.prototype instanceof CoreExtension;\n}\nexport async function loadCoreExtension(coreExtensionModule, stage) {\n let module;\n try {\n console.log('Loading core extension', coreExtensionModule);\n module = (await import(coreExtensionModule /* @vite-ignore */));\n }\n catch (e) {\n console.error(`The core extension module at '${coreExtensionModule}' could not be loaded.`);\n console.error(e);\n return;\n }\n if (!module.default) {\n console.error(`The core extension module at '${coreExtensionModule}' does not have a default export.`);\n return;\n }\n const ExtensionClass = module.default;\n if (classExtendsCoreExtension(ExtensionClass)) {\n const coreExtension = new ExtensionClass();\n try {\n await coreExtension.run(stage);\n }\n catch (e) {\n console.error(`The core extension at '${coreExtensionModule}' threw an error.`);\n console.error(e);\n }\n }\n else {\n console.error(`The core extension at '${coreExtensionModule}' does not extend CoreExtension.`);\n }\n}\nexport function santizeCustomDataMap(d) {\n const validTypes = { boolean: true, string: true, number: true };\n const keys = Object.keys(d);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n if (!key) {\n continue;\n }\n const value = d[key];\n const valueType = typeof value;\n // Typescript doesn't understand the above const valueType ¯\\_(ツ)_/¯\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore-next-line\n if (valueType === 'string' && value.length > 2048) {\n console.warn(`Custom Data value for ${key} is too long, it will be truncated to 2048 characters`);\n // same here, see above comment, this can only be a string at this point\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore-next-line\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call\n d[key] = value.substring(0, 2048);\n }\n if (!validTypes[valueType]) {\n console.warn(`Custom Data value for ${key} is not a boolean, string, or number, it will be ignored`);\n delete d[key];\n }\n }\n return d;\n}\n//# sourceMappingURL=utils.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ManualCountTextureUsageTracker, } from './texture-usage-trackers/ManualCountTextureUsageTracker.js';\nimport { FinalizationRegistryTextureUsageTracker } from './texture-usage-trackers/FinalizationRegistryTextureUsageTracker.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { Inspector } from './Inspector.js';\nimport { santizeCustomDataMap } from '../render-drivers/utils.js';\nimport { isProductionEnvironment } from '../utils.js';\n/**\n * The Renderer Main API\n *\n * @remarks\n * This is the primary class used to configure and operate the Renderer.\n *\n * It is used to create and destroy Nodes, as well as Texture and Shader\n * references.\n *\n * Example:\n * ```ts\n * import { RendererMain, MainCoreDriver } from '@lightningjs/renderer';\n *\n * // Initialize the Renderer\n * const renderer = new RendererMain(\n * {\n * appWidth: 1920,\n * appHeight: 1080\n * },\n * 'app',\n * new MainCoreDriver(),\n * );\n * ```\n */\nexport class RendererMain extends EventEmitter {\n root = null;\n driver;\n canvas;\n settings;\n inspector = null;\n nodes = new Map();\n nextTextureId = 1;\n /**\n * Texture Usage Tracker for Usage Based Texture Garbage Collection\n *\n * @remarks\n * For internal use only. DO NOT ACCESS.\n */\n textureTracker;\n /**\n * Constructs a new Renderer instance\n *\n * @param settings Renderer settings\n * @param target Element ID or HTMLElement to insert the canvas into\n * @param driver Core Driver to use\n */\n constructor(settings, target, driver) {\n super();\n const resolvedSettings = {\n appWidth: settings.appWidth || 1920,\n appHeight: settings.appHeight || 1080,\n txMemByteThreshold: settings.txMemByteThreshold || 124e6,\n boundsMargin: settings.boundsMargin || 0,\n deviceLogicalPixelRatio: settings.deviceLogicalPixelRatio || 1,\n devicePhysicalPixelRatio: settings.devicePhysicalPixelRatio || window.devicePixelRatio,\n clearColor: settings.clearColor ?? 0x00000000,\n coreExtensionModule: settings.coreExtensionModule || null,\n experimental_FinalizationRegistryTextureUsageTracker: settings.experimental_FinalizationRegistryTextureUsageTracker ?? false,\n textureCleanupOptions: settings.textureCleanupOptions || {},\n fpsUpdateInterval: settings.fpsUpdateInterval || 0,\n numImageWorkers: settings.numImageWorkers !== undefined ? settings.numImageWorkers : 2,\n enableContextSpy: settings.enableContextSpy ?? false,\n enableInspector: settings.enableInspector ?? false,\n };\n this.settings = resolvedSettings;\n const { appWidth, appHeight, deviceLogicalPixelRatio, devicePhysicalPixelRatio, enableInspector, } = resolvedSettings;\n const releaseCallback = (textureId) => {\n this.driver.releaseTexture(textureId);\n };\n const useFinalizationRegistryTracker = resolvedSettings.experimental_FinalizationRegistryTextureUsageTracker &&\n typeof FinalizationRegistry === 'function';\n this.textureTracker = useFinalizationRegistryTracker\n ? new FinalizationRegistryTextureUsageTracker(releaseCallback)\n : new ManualCountTextureUsageTracker(releaseCallback, this.settings.textureCleanupOptions);\n const deviceLogicalWidth = appWidth * deviceLogicalPixelRatio;\n const deviceLogicalHeight = appHeight * deviceLogicalPixelRatio;\n this.driver = driver;\n const canvas = document.createElement('canvas');\n this.canvas = canvas;\n canvas.width = deviceLogicalWidth * devicePhysicalPixelRatio;\n canvas.height = deviceLogicalHeight * devicePhysicalPixelRatio;\n canvas.style.width = `${deviceLogicalWidth}px`;\n canvas.style.height = `${deviceLogicalHeight}px`;\n let targetEl;\n if (typeof target === 'string') {\n targetEl = document.getElementById(target);\n }\n else {\n targetEl = target;\n }\n if (!targetEl) {\n throw new Error('Could not find target element');\n }\n // Hook up the driver's callbacks\n driver.onCreateNode = (node) => {\n this.nodes.set(node.id, node);\n };\n driver.onBeforeDestroyNode = (node) => {\n this.nodes.delete(node.id);\n };\n driver.onFpsUpdate = (fpsData) => {\n this.emit('fpsUpdate', fpsData);\n };\n driver.onFrameTick = (frameTickData) => {\n this.emit('frameTick', frameTickData);\n };\n driver.onIdle = () => {\n this.emit('idle');\n };\n targetEl.appendChild(canvas);\n if (enableInspector && !isProductionEnvironment()) {\n this.inspector = new Inspector(canvas, resolvedSettings);\n }\n }\n /**\n * Initialize the renderer\n *\n * @remarks\n * This method must be called and resolved asyncronously before any other\n * methods are called.\n */\n async init() {\n await this.driver.init(this, this.settings, this.canvas);\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this.root = this.driver.getRootNode();\n }\n /**\n * Create a new scene graph node\n *\n * @remarks\n * A node is the main graphical building block of the Renderer scene graph. It\n * can be a container for other nodes, or it can be a leaf node that renders a\n * solid color, gradient, image, or specific texture, using a specific shader.\n *\n * To create a text node, see {@link createTextNode}.\n *\n * See {@link INode} for more details.\n *\n * @param props\n * @returns\n */\n createNode(props) {\n if (this.inspector) {\n return this.inspector.createNode(this.driver, this.resolveNodeDefaults(props));\n }\n return this.driver.createNode(this.resolveNodeDefaults(props));\n }\n /**\n * Create a new scene graph text node\n *\n * @remarks\n * A text node is the second graphical building block of the Renderer scene\n * graph. It renders text using a specific text renderer that is automatically\n * chosen based on the font requested and what type of fonts are installed\n * into an app via a CoreExtension.\n *\n * See {@link ITextNode} for more details.\n *\n * @param props\n * @returns\n */\n createTextNode(props) {\n const fontSize = props.fontSize ?? 16;\n const data = {\n ...this.resolveNodeDefaults(props),\n text: props.text ?? '',\n textRendererOverride: props.textRendererOverride ?? null,\n fontSize,\n fontFamily: props.fontFamily ?? 'sans-serif',\n fontStyle: props.fontStyle ?? 'normal',\n fontWeight: props.fontWeight ?? 'normal',\n fontStretch: props.fontStretch ?? 'normal',\n textAlign: props.textAlign ?? 'left',\n contain: props.contain ?? 'none',\n scrollable: props.scrollable ?? false,\n scrollY: props.scrollY ?? 0,\n offsetY: props.offsetY ?? 0,\n letterSpacing: props.letterSpacing ?? 0,\n lineHeight: props.lineHeight ?? fontSize,\n maxLines: props.maxLines ?? 0,\n textBaseline: props.textBaseline ?? 'alphabetic',\n verticalAlign: props.verticalAlign ?? 'top',\n overflowSuffix: props.overflowSuffix ?? '...',\n debug: props.debug ?? {},\n };\n if (this.inspector) {\n return this.inspector.createTextNode(this.driver, data);\n }\n return this.driver.createTextNode(data);\n }\n /**\n * Resolves the default property values for a Node\n *\n * @remarks\n * This method is used internally by the RendererMain to resolve the default\n * property values for a Node. It is exposed publicly so that it can be used\n * by Core Driver implementations.\n *\n * @param props\n * @returns\n */\n resolveNodeDefaults(props) {\n const color = props.color ?? 0xffffffff;\n const colorTl = props.colorTl ?? props.colorTop ?? props.colorLeft ?? color;\n const colorTr = props.colorTr ?? props.colorTop ?? props.colorRight ?? color;\n const colorBl = props.colorBl ?? props.colorBottom ?? props.colorLeft ?? color;\n const colorBr = props.colorBr ?? props.colorBottom ?? props.colorRight ?? color;\n const data = santizeCustomDataMap(props.data ?? {});\n return {\n x: props.x ?? 0,\n y: props.y ?? 0,\n width: props.width ?? 0,\n height: props.height ?? 0,\n alpha: props.alpha ?? 1,\n clipping: props.clipping ?? false,\n color,\n colorTop: props.colorTop ?? color,\n colorBottom: props.colorBottom ?? color,\n colorLeft: props.colorLeft ?? color,\n colorRight: props.colorRight ?? color,\n colorBl,\n colorBr,\n colorTl,\n colorTr,\n zIndex: props.zIndex ?? 0,\n zIndexLocked: props.zIndexLocked ?? 0,\n parent: props.parent ?? null,\n texture: props.texture ?? null,\n shader: props.shader ?? null,\n // Since setting the `src` will trigger a texture load, we need to set it after\n // we set the texture. Otherwise, problems happen.\n src: props.src ?? '',\n scale: props.scale ?? null,\n scaleX: props.scaleX ?? props.scale ?? 1,\n scaleY: props.scaleY ?? props.scale ?? 1,\n mount: props.mount ?? 0,\n mountX: props.mountX ?? props.mount ?? 0,\n mountY: props.mountY ?? props.mount ?? 0,\n pivot: props.pivot ?? 0.5,\n pivotX: props.pivotX ?? props.pivot ?? 0.5,\n pivotY: props.pivotY ?? props.pivot ?? 0.5,\n rotation: props.rotation ?? 0,\n data: data,\n };\n }\n /**\n * Destroy a node\n *\n * @remarks\n * This method destroys a node but does not destroy its children.\n *\n * @param node\n * @returns\n */\n destroyNode(node) {\n if (this.inspector) {\n this.inspector.destroyNode(node);\n }\n return this.driver.destroyNode(node);\n }\n /**\n * Create a new texture reference\n *\n * @remarks\n * This method creates a new reference to a texture. The texture is not\n * loaded until it is used on a node.\n *\n * It can be assigned to a node's `texture` property, or it can be used\n * when creating a SubTexture.\n *\n * @param textureType\n * @param props\n * @param options\n * @returns\n */\n createTexture(textureType, props, options) {\n const id = this.nextTextureId++;\n const desc = {\n descType: 'texture',\n txType: textureType,\n props,\n options: {\n ...options,\n // This ID is used to identify the texture in the CoreTextureManager's\n // ID Texture Map cache.\n id,\n },\n };\n this.textureTracker.registerTexture(desc);\n return desc;\n }\n /**\n * Create a new shader reference\n *\n * @remarks\n * This method creates a new reference to a shader. The shader is not\n * loaded until it is used on a Node.\n *\n * It can be assigned to a Node's `shader` property.\n *\n * @param shaderType\n * @param props\n * @returns\n */\n createShader(shaderType, props) {\n return {\n descType: 'shader',\n shType: shaderType,\n props: props,\n };\n }\n /**\n * Get a Node by its ID\n *\n * @param id\n * @returns\n */\n getNodeById(id) {\n return this.nodes.get(id) || null;\n }\n toggleFreeze() {\n throw new Error('Not implemented');\n }\n advanceFrame() {\n throw new Error('Not implemented');\n }\n /**\n * Re-render the current frame without advancing any running animations.\n *\n * @remarks\n * Any state changes will be reflected in the re-rendered frame. Useful for\n * debugging.\n *\n * May not do anything if the render loop is running on a separate worker.\n */\n rerender() {\n throw new Error('Not implemented');\n }\n}\n//# sourceMappingURL=RendererMain.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy, mergeColorAlphaPremultiplied } from '../utils.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { copyRect, intersectRect, createBound, boundInsideBound, } from './lib/utils.js';\nimport { Matrix3d } from './lib/Matrix3d.js';\nimport { RenderCoords } from './lib/RenderCoords.js';\nexport var CoreNodeRenderState;\n(function (CoreNodeRenderState) {\n CoreNodeRenderState[CoreNodeRenderState[\"Init\"] = 0] = \"Init\";\n CoreNodeRenderState[CoreNodeRenderState[\"OutOfBounds\"] = 2] = \"OutOfBounds\";\n CoreNodeRenderState[CoreNodeRenderState[\"InBounds\"] = 4] = \"InBounds\";\n CoreNodeRenderState[CoreNodeRenderState[\"InViewport\"] = 8] = \"InViewport\";\n})(CoreNodeRenderState || (CoreNodeRenderState = {}));\nconst CoreNodeRenderStateMap = new Map();\nCoreNodeRenderStateMap.set(CoreNodeRenderState.Init, 'init');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.OutOfBounds, 'outOfBounds');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.InBounds, 'inBounds');\nCoreNodeRenderStateMap.set(CoreNodeRenderState.InViewport, 'inViewport');\nexport var UpdateType;\n(function (UpdateType) {\n /**\n * Child updates\n */\n UpdateType[UpdateType[\"Children\"] = 1] = \"Children\";\n /**\n * Scale/Rotate transform update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `scaleRotateTransform`\n */\n UpdateType[UpdateType[\"ScaleRotate\"] = 2] = \"ScaleRotate\";\n /**\n * Translate transform update (x/y/width/height/pivot/mount)\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `localTransform`\n */\n UpdateType[UpdateType[\"Local\"] = 4] = \"Local\";\n /**\n * Global Transform update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `globalTransform`\n * - `renderCoords`\n * - `renderBound`\n */\n UpdateType[UpdateType[\"Global\"] = 8] = \"Global\";\n /**\n * Clipping rect update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `clippingRect`\n */\n UpdateType[UpdateType[\"Clipping\"] = 16] = \"Clipping\";\n /**\n * Calculated ZIndex update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `calcZIndex`\n */\n UpdateType[UpdateType[\"CalculatedZIndex\"] = 32] = \"CalculatedZIndex\";\n /**\n * Z-Index Sorted Children update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `children` (sorts children by their `calcZIndex`)\n */\n UpdateType[UpdateType[\"ZIndexSortedChildren\"] = 64] = \"ZIndexSortedChildren\";\n /**\n * Premultiplied Colors update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `premultipliedColorTl`\n * - `premultipliedColorTr`\n * - `premultipliedColorBl`\n * - `premultipliedColorBr`\n */\n UpdateType[UpdateType[\"PremultipliedColors\"] = 128] = \"PremultipliedColors\";\n /**\n * World Alpha update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `worldAlpha` = `parent.worldAlpha` * `alpha`\n */\n UpdateType[UpdateType[\"WorldAlpha\"] = 256] = \"WorldAlpha\";\n /**\n * Render State update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `renderState`\n */\n UpdateType[UpdateType[\"RenderState\"] = 512] = \"RenderState\";\n /**\n * Is Renderable update\n *\n * @remarks\n * CoreNode Properties Updated:\n * - `isRenderable`\n */\n UpdateType[UpdateType[\"IsRenderable\"] = 1024] = \"IsRenderable\";\n /**\n * None\n */\n UpdateType[UpdateType[\"None\"] = 0] = \"None\";\n /**\n * All\n */\n UpdateType[UpdateType[\"All\"] = 2047] = \"All\";\n})(UpdateType || (UpdateType = {}));\nexport class CoreNode extends EventEmitter {\n stage;\n children = [];\n props;\n updateType = UpdateType.All;\n globalTransform;\n scaleRotateTransform;\n localTransform;\n renderCoords;\n renderBound;\n strictBound;\n preloadBound;\n clippingRect = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n valid: false,\n };\n isRenderable = false;\n renderState = CoreNodeRenderState.Init;\n worldAlpha = 1;\n premultipliedColorTl = 0;\n premultipliedColorTr = 0;\n premultipliedColorBl = 0;\n premultipliedColorBr = 0;\n calcZIndex = 0;\n constructor(stage, props) {\n super();\n this.stage = stage;\n this.props = {\n ...props,\n parent: null,\n };\n // Allow for parent to be processed appropriately\n this.parent = props.parent;\n this.updateScaleRotateTransform();\n }\n //#region Textures\n loadTexture(textureType, props, options = null) {\n // First unload any existing texture\n if (this.props.texture) {\n this.unloadTexture();\n }\n const { txManager } = this.stage;\n const texture = txManager.loadTexture(textureType, props, options);\n this.props.texture = texture;\n this.props.textureOptions = options;\n this.setUpdateType(UpdateType.IsRenderable);\n // If texture is already loaded / failed, trigger loaded event manually\n // so that users get a consistent event experience.\n // We do this in a microtask to allow listeners to be attached in the same\n // synchronous task after calling loadTexture()\n queueMicrotask(() => {\n if (texture.state === 'loaded') {\n this.onTextureLoaded(texture, texture.dimensions);\n }\n else if (texture.state === 'failed') {\n this.onTextureFailed(texture, texture.error);\n }\n else if (texture.state === 'freed') {\n this.onTextureFreed(texture);\n }\n texture.on('loaded', this.onTextureLoaded);\n texture.on('failed', this.onTextureFailed);\n texture.on('freed', this.onTextureFreed);\n });\n }\n unloadTexture() {\n if (this.props.texture) {\n const { texture } = this.props;\n texture.off('loaded', this.onTextureLoaded);\n texture.off('failed', this.onTextureFailed);\n texture.off('freed', this.onTextureFreed);\n texture.setRenderableOwner(this, false);\n }\n this.props.texture = null;\n this.props.textureOptions = null;\n this.setUpdateType(UpdateType.IsRenderable);\n }\n onTextureLoaded = (target, dimensions) => {\n // Texture was loaded. In case the RAF loop has already stopped, we request\n // a render to ensure the texture is rendered.\n this.stage.requestRender();\n this.emit('loaded', {\n type: 'texture',\n dimensions,\n });\n };\n onTextureFailed = (target, error) => {\n this.emit('failed', {\n type: 'texture',\n error,\n });\n };\n onTextureFreed = (target) => {\n this.emit('freed', {\n type: 'texture',\n });\n };\n //#endregion Textures\n loadShader(shaderType, props) {\n const shManager = this.stage.renderer.getShaderManager();\n assertTruthy(shManager);\n const { shader, props: p } = shManager.loadShader(shaderType, props);\n this.props.shader = shader;\n this.props.shaderProps = p;\n this.setUpdateType(UpdateType.IsRenderable);\n }\n /**\n * Change types types is used to determine the scope of the changes being applied\n *\n * @remarks\n * See {@link UpdateType} for more information on each type\n *\n * @param type\n */\n setUpdateType(type) {\n this.updateType |= type;\n // If we're updating this node at all, we need to inform the parent\n // (and all ancestors) that their children need updating as well\n const parent = this.props.parent;\n if (parent && !(parent.updateType & UpdateType.Children)) {\n parent.setUpdateType(UpdateType.Children);\n }\n }\n sortChildren() {\n this.children.sort((a, b) => a.calcZIndex - b.calcZIndex);\n }\n updateScaleRotateTransform() {\n this.scaleRotateTransform = Matrix3d.rotate(this.props.rotation, this.scaleRotateTransform).scale(this.props.scaleX, this.props.scaleY);\n }\n updateLocalTransform() {\n assertTruthy(this.scaleRotateTransform);\n const pivotTranslateX = this.props.pivotX * this.props.width;\n const pivotTranslateY = this.props.pivotY * this.props.height;\n const mountTranslateX = this.props.mountX * this.props.width;\n const mountTranslateY = this.props.mountY * this.props.height;\n this.localTransform = Matrix3d.translate(pivotTranslateX - mountTranslateX + this.props.x, pivotTranslateY - mountTranslateY + this.props.y, this.localTransform)\n .multiply(this.scaleRotateTransform)\n .translate(-pivotTranslateX, -pivotTranslateY);\n this.setUpdateType(UpdateType.Global);\n }\n /**\n * @todo: test for correct calculation flag\n * @param delta\n */\n update(delta, parentClippingRect) {\n if (this.updateType & UpdateType.ScaleRotate) {\n this.updateScaleRotateTransform();\n this.setUpdateType(UpdateType.Local);\n }\n if (this.updateType & UpdateType.Local) {\n this.updateLocalTransform();\n this.setUpdateType(UpdateType.Global);\n }\n const parent = this.props.parent;\n let childUpdateType = UpdateType.None;\n if (this.updateType & UpdateType.Global) {\n assertTruthy(this.localTransform);\n this.globalTransform = Matrix3d.copy(parent?.globalTransform || this.localTransform, this.globalTransform);\n if (parent) {\n this.globalTransform.multiply(this.localTransform);\n }\n this.calculateRenderCoords();\n this.updateBoundingRect();\n this.setUpdateType(UpdateType.Clipping | UpdateType.RenderState | UpdateType.Children);\n childUpdateType |= UpdateType.Global;\n }\n if (this.updateType & UpdateType.Clipping) {\n this.calculateClippingRect(parentClippingRect);\n this.setUpdateType(UpdateType.Children);\n childUpdateType |= UpdateType.Clipping;\n }\n if (this.updateType & UpdateType.WorldAlpha) {\n if (parent) {\n this.worldAlpha = parent.worldAlpha * this.props.alpha;\n }\n else {\n this.worldAlpha = this.props.alpha;\n }\n this.setUpdateType(UpdateType.Children | UpdateType.PremultipliedColors);\n childUpdateType |= UpdateType.WorldAlpha;\n }\n if (this.updateType & UpdateType.PremultipliedColors) {\n this.premultipliedColorTl = mergeColorAlphaPremultiplied(this.props.colorTl, this.worldAlpha, true);\n // If all the colors are the same just sent them all to the same value\n if (this.props.colorTl === this.props.colorTr &&\n this.props.colorBl === this.props.colorBr &&\n this.props.colorTl === this.props.colorBl) {\n this.premultipliedColorTr =\n this.premultipliedColorBl =\n this.premultipliedColorBr =\n this.premultipliedColorTl;\n }\n else {\n this.premultipliedColorTr = mergeColorAlphaPremultiplied(this.props.colorTr, this.worldAlpha, true);\n this.premultipliedColorBl = mergeColorAlphaPremultiplied(this.props.colorBl, this.worldAlpha, true);\n this.premultipliedColorBr = mergeColorAlphaPremultiplied(this.props.colorBr, this.worldAlpha, true);\n }\n }\n if (this.updateType & UpdateType.RenderState) {\n this.updateRenderState(parentClippingRect);\n this.setUpdateType(UpdateType.IsRenderable);\n }\n if (this.updateType & UpdateType.IsRenderable) {\n this.updateIsRenderable();\n }\n // No need to update zIndex if there is no parent\n if (parent && this.updateType & UpdateType.CalculatedZIndex) {\n this.calculateZIndex();\n // Tell parent to re-sort children\n parent.setUpdateType(UpdateType.ZIndexSortedChildren);\n }\n if (this.updateType & UpdateType.Children && this.children.length) {\n this.children.forEach((child) => {\n // Trigger the depenedent update types on the child\n child.setUpdateType(childUpdateType);\n // If child has no updates, skip\n if (child.updateType === 0) {\n return;\n }\n child.update(delta, this.clippingRect);\n });\n }\n // Sorting children MUST happen after children have been updated so\n // that they have the oppotunity to update their calculated zIndex.\n if (this.updateType & UpdateType.ZIndexSortedChildren) {\n // reorder z-index\n this.sortChildren();\n }\n // reset update type\n this.updateType = 0;\n }\n //check if CoreNode is renderable based on props\n checkRenderProps() {\n if (this.props.texture) {\n return true;\n }\n if (!this.props.width || !this.props.height) {\n return false;\n }\n if (this.props.shader) {\n return true;\n }\n if (this.props.clipping) {\n return true;\n }\n if (this.props.color !== 0) {\n return true;\n }\n // Consider removing these checks and just using the color property check above.\n // Maybe add a forceRender prop for nodes that should always render.\n if (this.props.colorTop !== 0) {\n return true;\n }\n if (this.props.colorBottom !== 0) {\n return true;\n }\n if (this.props.colorLeft !== 0) {\n return true;\n }\n if (this.props.colorRight !== 0) {\n return true;\n }\n if (this.props.colorTl !== 0) {\n return true;\n }\n if (this.props.colorTr !== 0) {\n return true;\n }\n if (this.props.colorBl !== 0) {\n return true;\n }\n if (this.props.colorBr !== 0) {\n return true;\n }\n return false;\n }\n checkRenderBounds(parentClippingRect) {\n assertTruthy(this.renderBound);\n const rectW = parentClippingRect.width || this.stage.root.width;\n const rectH = parentClippingRect.height || this.stage.root.height;\n this.strictBound = createBound(parentClippingRect.x, parentClippingRect.y, parentClippingRect.x + rectW, parentClippingRect.y + rectH, this.strictBound);\n const renderM = this.stage.boundsMargin;\n this.preloadBound = createBound(parentClippingRect.x - renderM[3], parentClippingRect.y - renderM[0], parentClippingRect.x + rectW + renderM[1], parentClippingRect.y + rectH + renderM[2], this.preloadBound);\n if (boundInsideBound(this.renderBound, this.strictBound)) {\n return CoreNodeRenderState.InViewport;\n }\n if (boundInsideBound(this.renderBound, this.preloadBound)) {\n return CoreNodeRenderState.InBounds;\n }\n return CoreNodeRenderState.OutOfBounds;\n }\n updateRenderState(parentClippingRect) {\n const renderState = this.checkRenderBounds(parentClippingRect);\n if (renderState !== this.renderState) {\n const previous = this.renderState;\n this.renderState = renderState;\n if (previous === CoreNodeRenderState.InViewport) {\n this.emit('outOfViewport', {\n previous,\n current: renderState,\n });\n }\n const event = CoreNodeRenderStateMap.get(renderState);\n assertTruthy(event);\n this.emit(event, {\n previous,\n current: renderState,\n });\n }\n }\n setRenderState(state) {\n if (state !== this.renderState) {\n this.renderState = state;\n this.emit(CoreNodeRenderState[state]);\n }\n }\n /**\n * This function updates the `isRenderable` property based on certain conditions.\n *\n * @returns\n */\n updateIsRenderable() {\n let newIsRenderable;\n if (!this.checkRenderProps()) {\n newIsRenderable = false;\n }\n else {\n newIsRenderable = this.renderState > CoreNodeRenderState.OutOfBounds;\n }\n if (this.isRenderable !== newIsRenderable) {\n this.isRenderable = newIsRenderable;\n this.onChangeIsRenderable(newIsRenderable);\n }\n }\n onChangeIsRenderable(isRenderable) {\n this.props.texture?.setRenderableOwner(this, isRenderable);\n }\n calculateRenderCoords() {\n const { width, height, globalTransform: transform } = this;\n assertTruthy(transform);\n const { tx, ty, ta, tb, tc, td } = transform;\n if (tb === 0 && tc === 0) {\n const minX = tx;\n const maxX = tx + width * ta;\n const minY = ty;\n const maxY = ty + height * td;\n this.renderCoords = RenderCoords.translate(\n //top-left\n minX, minY, \n //top-right\n maxX, minY, \n //bottom-right\n maxX, maxY, \n //bottom-left\n minX, maxY, this.renderCoords);\n }\n else {\n this.renderCoords = RenderCoords.translate(\n //top-left\n tx, ty, \n //top-right\n tx + width * ta, ty + width * tc, \n //bottom-right\n tx + width * ta + height * tb, ty + width * tc + height * td, \n //bottom-left\n tx + height * tb, ty + height * td, this.renderCoords);\n }\n }\n updateBoundingRect() {\n const { renderCoords, globalTransform: transform } = this;\n assertTruthy(transform);\n assertTruthy(renderCoords);\n const { tb, tc } = transform;\n const { x1, y1, x3, y3 } = renderCoords;\n if (tb === 0 || tc === 0) {\n this.renderBound = createBound(x1, y1, x3, y3, this.renderBound);\n }\n else {\n const { x2, x4, y2, y4 } = renderCoords;\n this.renderBound = createBound(Math.min(x1, x2, x3, x4), Math.min(y1, y2, y3, y4), Math.max(x1, x2, x3, x4), Math.max(y1, y2, y3, y4), this.renderBound);\n }\n }\n /**\n * This function calculates the clipping rectangle for a node.\n *\n * The function then checks if the node is rotated. If the node requires clipping and is not rotated, a new clipping rectangle is created based on the node's global transform and dimensions.\n * If a parent clipping rectangle exists, it is intersected with the node's clipping rectangle (if it exists), or replaces the node's clipping rectangle.\n *\n * Finally, the node's parentClippingRect and clippingRect properties are updated.\n */\n calculateClippingRect(parentClippingRect) {\n assertTruthy(this.globalTransform);\n const { clippingRect, props, globalTransform: gt } = this;\n const { clipping } = props;\n const isRotated = gt.tb !== 0 || gt.tc !== 0;\n if (clipping && !isRotated) {\n clippingRect.x = gt.tx;\n clippingRect.y = gt.ty;\n clippingRect.width = this.width * gt.ta;\n clippingRect.height = this.height * gt.td;\n clippingRect.valid = true;\n }\n else {\n clippingRect.valid = false;\n }\n if (parentClippingRect.valid && clippingRect.valid) {\n // Intersect parent clipping rect with node clipping rect\n intersectRect(parentClippingRect, clippingRect, clippingRect);\n }\n else if (parentClippingRect.valid) {\n // Copy parent clipping rect\n copyRect(parentClippingRect, clippingRect);\n clippingRect.valid = true;\n }\n }\n calculateZIndex() {\n const props = this.props;\n const z = props.zIndex || 0;\n const p = props.parent?.zIndex || 0;\n let zIndex = z;\n if (props.parent?.zIndexLocked) {\n zIndex = z < p ? z : p;\n }\n this.calcZIndex = zIndex;\n }\n /**\n * Destroy the node and cleanup all resources\n */\n destroy() {\n this.unloadTexture();\n this.clippingRect.valid = false;\n this.isRenderable = false;\n delete this.renderCoords;\n delete this.renderBound;\n delete this.strictBound;\n delete this.preloadBound;\n delete this.globalTransform;\n delete this.scaleRotateTransform;\n delete this.localTransform;\n this.props.texture = null;\n this.props.shader = null;\n this.removeAllListeners();\n this.parent = null;\n }\n renderQuads(renderer) {\n const { width, height, texture, textureOptions, shader, shaderProps } = this.props;\n const { premultipliedColorTl, premultipliedColorTr, premultipliedColorBl, premultipliedColorBr, } = this;\n const { zIndex, worldAlpha, globalTransform: gt, clippingRect } = this;\n assertTruthy(gt);\n // add to list of renderables to be sorted before rendering\n renderer.addQuad({\n width,\n height,\n colorTl: premultipliedColorTl,\n colorTr: premultipliedColorTr,\n colorBl: premultipliedColorBl,\n colorBr: premultipliedColorBr,\n texture,\n textureOptions,\n zIndex,\n shader,\n shaderProps,\n alpha: worldAlpha,\n clippingRect,\n tx: gt.tx,\n ty: gt.ty,\n ta: gt.ta,\n tb: gt.tb,\n tc: gt.tc,\n td: gt.td,\n });\n // Calculate absolute X and Y based on all ancestors\n // renderer.addQuad(absX, absY, w, h, color, texture, textureOptions, zIndex);\n }\n //#region Properties\n get id() {\n return this.props.id;\n }\n get x() {\n return this.props.x;\n }\n set x(value) {\n if (this.props.x !== value) {\n this.props.x = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get absX() {\n return (this.props.x +\n (this.props.parent?.absX || this.props.parent?.globalTransform?.tx || 0));\n }\n get absY() {\n return this.props.y + (this.props.parent?.absY ?? 0);\n }\n get y() {\n return this.props.y;\n }\n set y(value) {\n if (this.props.y !== value) {\n this.props.y = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get width() {\n return this.props.width;\n }\n set width(value) {\n if (this.props.width !== value) {\n this.props.width = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get height() {\n return this.props.height;\n }\n set height(value) {\n if (this.props.height !== value) {\n this.props.height = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get scale() {\n // The CoreNode `scale` property is only used by Animations.\n // Unlike INode, `null` should never be possibility for Animations.\n return this.scaleX;\n }\n set scale(value) {\n // The CoreNode `scale` property is only used by Animations.\n // Unlike INode, `null` should never be possibility for Animations.\n this.scaleX = value;\n this.scaleY = value;\n }\n get scaleX() {\n return this.props.scaleX;\n }\n set scaleX(value) {\n if (this.props.scaleX !== value) {\n this.props.scaleX = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get scaleY() {\n return this.props.scaleY;\n }\n set scaleY(value) {\n if (this.props.scaleY !== value) {\n this.props.scaleY = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get mount() {\n return this.props.mount;\n }\n set mount(value) {\n if (this.props.mountX !== value || this.props.mountY !== value) {\n this.props.mountX = value;\n this.props.mountY = value;\n this.props.mount = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get mountX() {\n return this.props.mountX;\n }\n set mountX(value) {\n if (this.props.mountX !== value) {\n this.props.mountX = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get mountY() {\n return this.props.mountY;\n }\n set mountY(value) {\n if (this.props.mountY !== value) {\n this.props.mountY = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivot() {\n return this.props.pivot;\n }\n set pivot(value) {\n if (this.props.pivotX !== value || this.props.pivotY !== value) {\n this.props.pivotX = value;\n this.props.pivotY = value;\n this.props.pivot = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivotX() {\n return this.props.pivotX;\n }\n set pivotX(value) {\n if (this.props.pivotX !== value) {\n this.props.pivotX = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get pivotY() {\n return this.props.pivotY;\n }\n set pivotY(value) {\n if (this.props.pivotY !== value) {\n this.props.pivotY = value;\n this.setUpdateType(UpdateType.Local);\n }\n }\n get rotation() {\n return this.props.rotation;\n }\n set rotation(value) {\n if (this.props.rotation !== value) {\n this.props.rotation = value;\n this.setUpdateType(UpdateType.ScaleRotate);\n }\n }\n get alpha() {\n return this.props.alpha;\n }\n set alpha(value) {\n this.props.alpha = value;\n this.setUpdateType(UpdateType.PremultipliedColors | UpdateType.WorldAlpha);\n }\n get clipping() {\n return this.props.clipping;\n }\n set clipping(value) {\n this.props.clipping = value;\n this.setUpdateType(UpdateType.Clipping);\n }\n get color() {\n return this.props.color;\n }\n set color(value) {\n if (this.props.colorTl !== value ||\n this.props.colorTr !== value ||\n this.props.colorBl !== value ||\n this.props.colorBr !== value) {\n this.colorTl = value;\n this.colorTr = value;\n this.colorBl = value;\n this.colorBr = value;\n }\n this.props.color = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTop() {\n return this.props.colorTop;\n }\n set colorTop(value) {\n if (this.props.colorTl !== value || this.props.colorTr !== value) {\n this.colorTl = value;\n this.colorTr = value;\n }\n this.props.colorTop = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBottom() {\n return this.props.colorBottom;\n }\n set colorBottom(value) {\n if (this.props.colorBl !== value || this.props.colorBr !== value) {\n this.colorBl = value;\n this.colorBr = value;\n }\n this.props.colorBottom = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorLeft() {\n return this.props.colorLeft;\n }\n set colorLeft(value) {\n if (this.props.colorTl !== value || this.props.colorBl !== value) {\n this.colorTl = value;\n this.colorBl = value;\n }\n this.props.colorLeft = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorRight() {\n return this.props.colorRight;\n }\n set colorRight(value) {\n if (this.props.colorTr !== value || this.props.colorBr !== value) {\n this.colorTr = value;\n this.colorBr = value;\n }\n this.props.colorRight = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTl() {\n return this.props.colorTl;\n }\n set colorTl(value) {\n this.props.colorTl = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorTr() {\n return this.props.colorTr;\n }\n set colorTr(value) {\n this.props.colorTr = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBl() {\n return this.props.colorBl;\n }\n set colorBl(value) {\n this.props.colorBl = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n get colorBr() {\n return this.props.colorBr;\n }\n set colorBr(value) {\n this.props.colorBr = value;\n this.setUpdateType(UpdateType.PremultipliedColors);\n }\n // we're only interested in parent zIndex to test\n // if we should use node zIndex is higher then parent zIndex\n get zIndexLocked() {\n return this.props.zIndexLocked || 0;\n }\n set zIndexLocked(value) {\n this.props.zIndexLocked = value;\n this.setUpdateType(UpdateType.CalculatedZIndex | UpdateType.Children);\n this.children.forEach((child) => {\n child.setUpdateType(UpdateType.CalculatedZIndex);\n });\n }\n get zIndex() {\n return this.props.zIndex;\n }\n set zIndex(value) {\n this.props.zIndex = value;\n this.setUpdateType(UpdateType.CalculatedZIndex | UpdateType.Children);\n this.children.forEach((child) => {\n child.setUpdateType(UpdateType.CalculatedZIndex);\n });\n }\n get parent() {\n return this.props.parent;\n }\n set parent(newParent) {\n const oldParent = this.props.parent;\n if (oldParent === newParent) {\n return;\n }\n this.props.parent = newParent;\n if (oldParent) {\n const index = oldParent.children.indexOf(this);\n assertTruthy(index !== -1, \"CoreNode.parent: Node not found in old parent's children!\");\n oldParent.children.splice(index, 1);\n oldParent.setUpdateType(UpdateType.Children | UpdateType.ZIndexSortedChildren);\n }\n if (newParent) {\n newParent.children.push(this);\n // Since this node has a new parent, to be safe, have it do a full update.\n this.setUpdateType(UpdateType.All);\n // Tell parent that it's children need to be updated and sorted.\n newParent.setUpdateType(UpdateType.Children | UpdateType.ZIndexSortedChildren);\n }\n this.updateScaleRotateTransform();\n }\n}\n//# sourceMappingURL=CoreNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getTimingFunction } from '../utils.js';\nimport { mergeColorProgress } from '../../utils.js';\nimport { EventEmitter } from '../../common/EventEmitter.js';\nexport class CoreAnimation extends EventEmitter {\n node;\n props;\n settings;\n propStartValues = {};\n restoreValues = {};\n progress = 0;\n delayFor = 0;\n timingFunction;\n propsList; //fixme - aint got not time for this\n constructor(node, props, settings) {\n super();\n this.node = node;\n this.props = props;\n this.settings = settings;\n this.propStartValues = {};\n this.propsList = Object.keys(props);\n this.propsList.forEach((propName) => {\n this.propStartValues[propName] = node[propName];\n });\n this.timingFunction = (t) => t;\n if (settings.easing && typeof settings.easing === 'string') {\n this.timingFunction = getTimingFunction(settings.easing);\n }\n this.delayFor = settings.delay || 0;\n }\n reset() {\n this.progress = 0;\n this.delayFor = this.settings.delay || 0;\n this.update(0);\n }\n restore() {\n this.reset();\n Object.keys(this.props).forEach((propName) => {\n this.node[propName] = this.propStartValues[propName];\n });\n }\n reverse() {\n this.progress = 0;\n Object.keys(this.props).forEach((propName) => {\n // set the start value to the current value\n const startValue = this.props[propName];\n const endValue = this.propStartValues[propName];\n // swap the start and end values\n this.props[propName] = endValue;\n this.propStartValues[propName] = startValue;\n });\n // restore stop method if we are not looping\n if (!this.settings.loop) {\n this.settings.stopMethod = false;\n }\n }\n applyEasing(p, s, e) {\n return (this.timingFunction(p) || p) * (e - s) + s;\n }\n update(dt) {\n const { duration, loop, easing, stopMethod } = this.settings;\n if (!duration) {\n this.emit('finished', {});\n return;\n }\n if (this.delayFor > 0) {\n this.delayFor -= dt;\n return;\n }\n if (this.delayFor <= 0 && this.progress === 0) {\n this.emit('start', {});\n }\n this.progress += dt / duration;\n if (this.progress > 1) {\n this.progress = loop ? 0 : 1;\n if (stopMethod) {\n // If there's a stop method emit finished so the stop method can be applied.\n // TODO: We should probably reevaluate how stopMethod is implemented as currently\n // stop method 'reset' does not work when looping.\n this.emit('finished', {});\n return;\n }\n }\n for (let i = 0; i < this.propsList.length; i++) {\n const propName = this.propsList[i];\n const propValue = this.props[propName];\n const startValue = this.propStartValues[propName];\n const endValue = propValue;\n if (propName.indexOf('color') !== -1) {\n // check if we have to change the color to begin with\n if (startValue === endValue) {\n this.node[propName] = startValue;\n continue;\n }\n if (easing) {\n const easingProgressValue = this.timingFunction(this.progress) || this.progress;\n const easingColorValue = mergeColorProgress(startValue, endValue, easingProgressValue);\n this.node[propName] = easingColorValue;\n continue;\n }\n this.node[propName] = mergeColorProgress(startValue, endValue, this.progress);\n continue;\n }\n if (easing) {\n this.node[propName] = this.applyEasing(this.progress, startValue, endValue);\n continue;\n }\n this.node[propName] =\n startValue + (endValue - startValue) * this.progress;\n }\n if (this.progress === 1) {\n this.emit('finished', {});\n }\n }\n}\n//# sourceMappingURL=CoreAnimation.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nexport class CoreAnimationController {\n manager;\n animation;\n startedPromise = null;\n /**\n * If this is null, then the animation hasn't started yet.\n */\n startedResolve = null;\n stoppedPromise = null;\n /**\n * If this is null, then the animation is in a finished / stopped state.\n */\n stoppedResolve = null;\n constructor(manager, animation) {\n this.manager = manager;\n this.animation = animation;\n this.state = 'stopped';\n }\n state;\n start() {\n this.makeStartedPromise();\n this.animation.once('start', this.started.bind(this));\n this.makeStoppedPromise();\n this.animation.once('finished', this.finished.bind(this));\n // prevent registering the same animation twice\n if (!this.manager.activeAnimations.has(this.animation)) {\n this.manager.registerAnimation(this.animation);\n }\n this.state = 'running';\n return this;\n }\n stop() {\n this.manager.unregisterAnimation(this.animation);\n if (this.stoppedResolve !== null) {\n this.stoppedResolve();\n this.stoppedResolve = null;\n }\n this.animation.reset();\n this.state = 'stopped';\n return this;\n }\n pause() {\n this.manager.unregisterAnimation(this.animation);\n this.state = 'paused';\n return this;\n }\n restore() {\n this.stoppedResolve = null;\n this.animation.restore();\n return this;\n }\n waitUntilStarted() {\n this.makeStartedPromise();\n const promise = this.startedPromise;\n assertTruthy(promise);\n return promise;\n }\n waitUntilStopped() {\n this.makeStoppedPromise();\n const promise = this.stoppedPromise;\n assertTruthy(promise);\n return promise;\n }\n makeStartedPromise() {\n if (this.startedResolve === null) {\n this.startedPromise = new Promise((resolve) => {\n this.startedResolve = resolve;\n });\n }\n }\n makeStoppedPromise() {\n if (this.stoppedResolve === null) {\n this.stoppedPromise = new Promise((resolve) => {\n this.stoppedResolve = resolve;\n });\n }\n }\n started() {\n assertTruthy(this.startedResolve);\n // resolve promise (and pass current this to continue to the chain)\n this.startedResolve(this);\n this.startedResolve = null;\n }\n finished() {\n assertTruthy(this.stoppedResolve);\n // If the animation is looping, then we need to restart it.\n const { loop, stopMethod } = this.animation.settings;\n if (stopMethod === 'reverse') {\n this.animation.reverse();\n this.start();\n return;\n }\n // resolve promise\n this.stoppedResolve();\n this.stoppedResolve = null;\n if (loop) {\n return;\n }\n // unregister animation\n this.manager.unregisterAnimation(this.animation);\n }\n}\n//# sourceMappingURL=CoreAnimationController.js.map","/* eslint-disable @typescript-eslint/no-non-null-assertion */\n// Matrix3d is a 3x3 matrix in column-major order because that's how WebGL likes it.\n// The matrix is stored in a Float32Array in the following order:\n// | 0 3 6 |\n// | 1 4 7 |\n// | 2 5 8 |\n// The following constants are used to index into the array in a row-major way.\nconst m0 = 0;\nconst m1 = 3;\nconst m2 = 6;\nconst m3 = 1;\nconst m4 = 4;\nconst m5 = 7;\nconst m6 = 2;\nconst m7 = 5;\nconst m8 = 8;\n/**\n * A 3x3 matrix representing a 2D transformation.\n *\n * @remarks\n * The matrix is stored in column-major order in the `data` property which can\n * be passed directly to a WebGL shader uniform.\n *\n * The matrix is stored in a Float32Array in the following index order:\n * | 0 3 6 |\n * | 1 4 7 |\n * | 2 5 8 |\n *\n * Only the first two rows are really used for the transformation. The last row is\n * generally always `[0, 0, 1]` if you only use the 2D transformation methods\n * provided by this class.\n *\n * For convenience, entries in the first two rows can be accessed by the following\n * getter properties:\n * | ta tb tx |\n * | tc td ty |\n * | 0 0 1 |\n */\nexport class Matrix3d {\n data;\n /**\n * Creates a new 3x3 matrix.\n *\n * @param entries Row-major 3x3 matrix\n */\n constructor(entries) {\n if (entries) {\n // Transpose the input matrix so that it's in column-major order.\n this.data = new Float32Array(9);\n this.data[m0] = entries[0];\n this.data[m1] = entries[3];\n this.data[m2] = entries[6];\n this.data[m3] = entries[1];\n this.data[m4] = entries[4];\n this.data[m5] = entries[7];\n this.data[m6] = entries[2];\n this.data[m7] = entries[5];\n this.data[m8] = entries[8];\n }\n else {\n this.data = new Float32Array(9);\n }\n }\n /**\n * Returns a temporary matrix that can be used for calculations.\n *\n * @remarks\n * This is useful for avoiding allocations in tight loops.\n *\n * The matrix is not guaranteed to be the same between calls.\n *\n * @returns\n */\n static get temp() {\n return tempMatrix;\n }\n static multiply(a, b, out) {\n const e0 = a.data[m0] * b.data[m0] +\n a.data[m1] * b.data[m3] +\n a.data[m2] * b.data[m6];\n const e1 = a.data[m0] * b.data[m1] +\n a.data[m1] * b.data[m4] +\n a.data[m2] * b.data[m7];\n const e2 = a.data[m0] * b.data[m2] +\n a.data[m1] * b.data[m5] +\n a.data[m2] * b.data[m8];\n const e3 = a.data[m3] * b.data[m0] +\n a.data[m4] * b.data[m3] +\n a.data[m5] * b.data[m6];\n const e4 = a.data[m3] * b.data[m1] +\n a.data[m4] * b.data[m4] +\n a.data[m5] * b.data[m7];\n const e5 = a.data[m3] * b.data[m2] +\n a.data[m4] * b.data[m5] +\n a.data[m5] * b.data[m8];\n const e6 = a.data[m6] * b.data[m0] +\n a.data[m7] * b.data[m3] +\n a.data[m8] * b.data[m6];\n const e7 = a.data[m6] * b.data[m1] +\n a.data[m7] * b.data[m4] +\n a.data[m8] * b.data[m7];\n const e8 = a.data[m6] * b.data[m2] +\n a.data[m7] * b.data[m5] +\n a.data[m8] * b.data[m8];\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = e0;\n out.data[m1] = e1;\n out.data[m2] = e2;\n out.data[m3] = e3;\n out.data[m4] = e4;\n out.data[m5] = e5;\n out.data[m6] = e6;\n out.data[m7] = e7;\n out.data[m8] = e8;\n return out;\n }\n static identity(out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = 1;\n out.data[m1] = 0;\n out.data[m2] = 0;\n out.data[m3] = 0;\n out.data[m4] = 1;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static translate(x, y, out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = 1;\n out.data[m1] = 0;\n out.data[m2] = x;\n out.data[m3] = 0;\n out.data[m4] = 1;\n out.data[m5] = y;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static scale(sx, sy, out) {\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = sx;\n out.data[m1] = 0;\n out.data[m2] = 0;\n out.data[m3] = 0;\n out.data[m4] = sy;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static rotate(angle, out) {\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n if (!out) {\n out = new Matrix3d();\n }\n out.data[m0] = cos;\n out.data[m1] = -sin;\n out.data[m2] = 0;\n out.data[m3] = sin;\n out.data[m4] = cos;\n out.data[m5] = 0;\n out.data[m6] = 0;\n out.data[m7] = 0;\n out.data[m8] = 1;\n return out;\n }\n static copy(src, dst, transpose) {\n if (!dst) {\n dst = new Matrix3d();\n }\n dst.data[0] = src.data[0];\n dst.data[1] = src.data[1];\n dst.data[2] = src.data[2];\n dst.data[3] = src.data[3];\n dst.data[4] = src.data[4];\n dst.data[5] = src.data[5];\n dst.data[6] = src.data[6];\n dst.data[7] = src.data[7];\n dst.data[8] = src.data[8];\n return dst;\n }\n translate(x, y) {\n this.data[m2] = this.data[m0] * x + this.data[m1] * y + this.data[m2];\n this.data[m5] = this.data[m3] * x + this.data[m4] * y + this.data[m5];\n return this;\n }\n scale(sx, sy) {\n this.data[m0] = this.data[m0] * sx;\n this.data[m1] = this.data[m1] * sy;\n this.data[m3] = this.data[m3] * sx;\n this.data[m4] = this.data[m4] * sy;\n return this;\n }\n rotate(angle) {\n if (angle === 0 || !((angle % Math.PI) * 2)) {\n return this;\n }\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n const e0 = this.data[m0] * cos + this.data[m1] * sin;\n const e1 = this.data[m1] * cos - this.data[m0] * sin;\n const e3 = this.data[m3] * cos + this.data[m4] * sin;\n const e4 = this.data[m4] * cos - this.data[m3] * sin;\n this.data[m0] = e0;\n this.data[m1] = e1;\n this.data[m3] = e3;\n this.data[m4] = e4;\n return this;\n }\n multiply(other) {\n return Matrix3d.multiply(this, other, this);\n }\n get tx() {\n return this.data[m2];\n }\n get ty() {\n return this.data[m5];\n }\n get ta() {\n return this.data[m0];\n }\n get tb() {\n return this.data[m1];\n }\n get tc() {\n return this.data[m3];\n }\n get td() {\n return this.data[m4];\n }\n transformPoint(x, y) {\n return [\n this.data[m0] * x + this.data[m1] * y + this.data[m2],\n this.data[m3] * x + this.data[m4] * y + this.data[m3],\n ];\n }\n}\nconst tempMatrix = new Matrix3d();\n//# sourceMappingURL=Matrix3d.js.map","const rx1 = 0;\nconst rx2 = 2;\nconst rx3 = 4;\nconst rx4 = 6;\nconst ry1 = 1;\nconst ry2 = 3;\nconst ry3 = 5;\nconst ry4 = 7;\nexport class RenderCoords {\n data;\n constructor(entries) {\n this.data = new Float32Array(8);\n if (entries) {\n this.data[rx1] = entries[rx1];\n this.data[rx2] = entries[rx2];\n this.data[rx3] = entries[rx3];\n this.data[rx4] = entries[rx4];\n this.data[ry1] = entries[ry1];\n this.data[ry2] = entries[ry2];\n this.data[ry3] = entries[ry3];\n this.data[ry4] = entries[ry4];\n }\n }\n static translate(x1, y1, x2, y2, x3, y3, x4, y4, out) {\n if (!out) {\n out = new RenderCoords();\n }\n out.data[rx1] = x1;\n out.data[rx2] = x2;\n out.data[rx3] = x3;\n out.data[rx4] = x4;\n out.data[ry1] = y1;\n out.data[ry2] = y2;\n out.data[ry3] = y3;\n out.data[ry4] = y4;\n return out;\n }\n get x1() {\n return this.data[rx1];\n }\n get x2() {\n return this.data[rx2];\n }\n get x3() {\n return this.data[rx3];\n }\n get x4() {\n return this.data[rx4];\n }\n get y1() {\n return this.data[ry1];\n }\n get y2() {\n return this.data[ry2];\n }\n get y3() {\n return this.data[ry3];\n }\n get y4() {\n return this.data[ry4];\n }\n}\n//# sourceMappingURL=RenderCoords.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { CoreAnimation } from '../../core/animations/CoreAnimation.js';\nimport { CoreAnimationController } from '../../core/animations/CoreAnimationController.js';\nimport { CoreNode } from '../../core/CoreNode.js';\nimport { EventEmitter } from '../../common/EventEmitter.js';\nimport { santizeCustomDataMap } from '../utils.js';\nlet nextId = 1;\nexport function getNewId() {\n return nextId++;\n}\nexport class MainOnlyNode extends EventEmitter {\n rendererMain;\n stage;\n id;\n coreNode;\n // Prop stores\n _children = [];\n _src = '';\n _parent = null;\n _texture = null;\n _shader = null;\n _data = {};\n constructor(props, rendererMain, stage, coreNode) {\n super();\n this.rendererMain = rendererMain;\n this.stage = stage;\n this.id = coreNode?.id ?? getNewId();\n this.coreNode =\n coreNode ||\n new CoreNode(this.stage, {\n id: this.id,\n x: props.x,\n y: props.y,\n width: props.width,\n height: props.height,\n alpha: props.alpha,\n clipping: props.clipping,\n color: props.color,\n colorTop: props.colorTop,\n colorBottom: props.colorBottom,\n colorLeft: props.colorLeft,\n colorRight: props.colorRight,\n colorTl: props.colorTl,\n colorTr: props.colorTr,\n colorBl: props.colorBl,\n colorBr: props.colorBr,\n zIndex: props.zIndex,\n zIndexLocked: props.zIndexLocked,\n scaleX: props.scaleX,\n scaleY: props.scaleY,\n mountX: props.mountX,\n mountY: props.mountY,\n mount: props.mount,\n pivot: props.pivot,\n pivotX: props.pivotX,\n pivotY: props.pivotY,\n rotation: props.rotation,\n parent: null,\n shader: null,\n shaderProps: null,\n texture: null,\n textureOptions: null,\n });\n // Forward loaded/failed events\n this.coreNode.on('loaded', this.onTextureLoaded);\n this.coreNode.on('failed', this.onTextureFailed);\n this.coreNode.on('freed', this.onTextureFreed);\n this.coreNode.on('outOfBounds', this.onOutOfBounds);\n this.coreNode.on('inBounds', this.onInBounds);\n this.coreNode.on('outOfViewport', this.onOutOfViewport);\n this.coreNode.on('inViewport', this.onInViewport);\n // Assign properties to this object\n this.parent = props.parent;\n this.shader = props.shader;\n this.texture = props.texture;\n this.src = props.src;\n this._data = props.data;\n }\n get x() {\n return this.coreNode.x;\n }\n set x(value) {\n this.coreNode.x = value;\n }\n get y() {\n return this.coreNode.y;\n }\n set y(value) {\n this.coreNode.y = value;\n }\n get width() {\n return this.coreNode.width;\n }\n set width(value) {\n this.coreNode.width = value;\n }\n get height() {\n return this.coreNode.height;\n }\n set height(value) {\n this.coreNode.height = value;\n }\n get alpha() {\n return this.coreNode.alpha;\n }\n set alpha(value) {\n this.coreNode.alpha = value;\n }\n get clipping() {\n return this.coreNode.clipping;\n }\n set clipping(value) {\n this.coreNode.clipping = value;\n }\n get color() {\n return this.coreNode.color;\n }\n set color(value) {\n this.coreNode.color = value;\n }\n get colorTop() {\n return this.coreNode.colorTop;\n }\n set colorTop(value) {\n this.coreNode.colorTop = value;\n }\n get colorBottom() {\n return this.coreNode.colorBottom;\n }\n set colorBottom(value) {\n this.coreNode.colorBottom = value;\n }\n get colorLeft() {\n return this.coreNode.colorLeft;\n }\n set colorLeft(value) {\n this.coreNode.colorLeft = value;\n }\n get colorRight() {\n return this.coreNode.colorRight;\n }\n set colorRight(value) {\n this.coreNode.colorRight = value;\n }\n get colorTl() {\n return this.coreNode.colorTl;\n }\n set colorTl(value) {\n this.coreNode.colorTl = value;\n }\n get colorTr() {\n return this.coreNode.colorTr;\n }\n set colorTr(value) {\n this.coreNode.colorTr = value;\n }\n get colorBl() {\n return this.coreNode.colorBl;\n }\n set colorBl(value) {\n this.coreNode.colorBl = value;\n }\n get colorBr() {\n return this.coreNode.colorBr;\n }\n set colorBr(value) {\n this.coreNode.colorBr = value;\n }\n get scale() {\n if (this.scaleX !== this.scaleY) {\n return null;\n }\n return this.coreNode.scaleX;\n }\n set scale(value) {\n // We ignore `null` when it's set.\n if (value === null) {\n return;\n }\n this.coreNode.scaleX = value;\n this.coreNode.scaleY = value;\n }\n get scaleX() {\n return this.coreNode.scaleX;\n }\n set scaleX(value) {\n this.coreNode.scaleX = value;\n }\n get scaleY() {\n return this.coreNode.scaleY;\n }\n set scaleY(value) {\n this.coreNode.scaleY = value;\n }\n get mount() {\n return this.coreNode.mount;\n }\n set mount(value) {\n this.coreNode.mount = value;\n }\n get mountX() {\n return this.coreNode.mountX;\n }\n set mountX(value) {\n this.coreNode.mountX = value;\n }\n get mountY() {\n return this.coreNode.mountY;\n }\n set mountY(value) {\n this.coreNode.mountY = value;\n }\n get pivot() {\n return this.coreNode.pivot;\n }\n set pivot(value) {\n this.coreNode.pivot = value;\n }\n get pivotX() {\n return this.coreNode.pivotX;\n }\n set pivotX(value) {\n this.coreNode.pivotX = value;\n }\n get pivotY() {\n return this.coreNode.pivotY;\n }\n set pivotY(value) {\n this.coreNode.pivotY = value;\n }\n get rotation() {\n return this.coreNode.rotation;\n }\n set rotation(value) {\n this.coreNode.rotation = value;\n }\n get parent() {\n return this._parent;\n }\n set parent(newParent) {\n const oldParent = this._parent;\n this._parent = newParent;\n this.coreNode.parent = newParent?.coreNode ?? null;\n if (oldParent) {\n const index = oldParent.children.indexOf(this);\n assertTruthy(index !== -1, \"MainOnlyNode.parent: Node not found in old parent's children!\");\n oldParent.children.splice(index, 1);\n }\n if (newParent) {\n newParent.children.push(this);\n }\n }\n get children() {\n return this._children;\n }\n get zIndex() {\n return this.coreNode.zIndex;\n }\n set zIndex(value) {\n this.coreNode.zIndex = value;\n }\n get zIndexLocked() {\n return this.coreNode.zIndexLocked;\n }\n set zIndexLocked(value) {\n this.coreNode.zIndexLocked = value;\n }\n get src() {\n return this._src;\n }\n set src(imageUrl) {\n if (this._src === imageUrl) {\n return;\n }\n this._src = imageUrl;\n if (!imageUrl) {\n this.texture = null;\n return;\n }\n this.texture = this.rendererMain.createTexture('ImageTexture', {\n src: imageUrl,\n });\n }\n //#region Texture\n get texture() {\n return this._texture;\n }\n set texture(texture) {\n if (this._texture === texture) {\n return;\n }\n if (this._texture) {\n this.rendererMain.textureTracker.decrementTextureRefCount(this._texture);\n }\n if (texture) {\n this.rendererMain.textureTracker.incrementTextureRefCount(texture);\n }\n this._texture = texture;\n if (texture) {\n this.coreNode.loadTexture(texture.txType, texture.props, texture.options);\n }\n else {\n this.coreNode.unloadTexture();\n }\n }\n onTextureLoaded = (target, payload) => {\n this.emit('loaded', payload);\n };\n onTextureFailed = (target, payload) => {\n this.emit('failed', payload);\n };\n onTextureFreed = (target, payload) => {\n this.emit('freed', payload);\n };\n onOutOfBounds = (target, payload) => {\n this.emit('outOfBounds', payload);\n };\n onInBounds = (target, payload) => {\n this.emit('inBounds', payload);\n };\n onOutOfViewport = (target, payload) => {\n this.emit('outOfViewport', payload);\n };\n onInViewport = (target, payload) => {\n this.emit('inViewport', payload);\n };\n //#endregion Texture\n get shader() {\n return this._shader;\n }\n set shader(shader) {\n if (this._shader === shader) {\n return;\n }\n this._shader = shader;\n if (shader) {\n this.coreNode.loadShader(shader.shType, shader.props);\n }\n }\n get data() {\n return this._data;\n }\n set data(d) {\n this._data = santizeCustomDataMap(d);\n }\n destroy() {\n this.emit('beforeDestroy', {});\n //use while loop since setting parent to null removes it from array\n let child = this.children[0];\n while (child) {\n child.destroy();\n child = this.children[0];\n }\n this.coreNode.destroy();\n this.parent = null;\n this.texture = null;\n this.emit('afterDestroy', {});\n this.removeAllListeners();\n }\n flush() {\n // No-op\n }\n animate(props, settings) {\n const animation = new CoreAnimation(this.coreNode, props, settings);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call\n const controller = new CoreAnimationController(this.stage.animationManager, animation);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return controller;\n }\n}\n//# sourceMappingURL=MainOnlyNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreAnimation } from './CoreAnimation.js';\nexport class AnimationManager {\n activeAnimations = new Set();\n registerAnimation(animation) {\n this.activeAnimations.add(animation);\n }\n unregisterAnimation(animation) {\n this.activeAnimations.delete(animation);\n }\n update(dt) {\n this.activeAnimations.forEach((animation) => {\n animation.update(dt);\n });\n }\n}\n//# sourceMappingURL=AnimationManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {} from '../textures/Texture.js';\nexport class ImageWorkerManager {\n imageWorkersEnabled = true;\n messageManager = {};\n workers = [];\n workerIndex = 0;\n constructor(numImageWorkers) {\n this.workers = this.createWorkers(numImageWorkers);\n this.workers.forEach((worker) => {\n worker.onmessage = this.handleMessage.bind(this);\n });\n }\n handleMessage(event) {\n const { src, data, error } = event.data;\n const msg = this.messageManager[src];\n if (msg) {\n const [resolve, reject] = msg;\n delete this.messageManager[src];\n if (error) {\n reject(new Error(error));\n }\n else {\n resolve(data);\n }\n }\n }\n createWorkers(numWorkers = 1) {\n const workerCode = `\n function hasAlphaChannel(mimeType) {\n return (mimeType.indexOf(\"image/png\") !== -1);\n }\n\n async function getImage(src, premultiplyAlpha) {\n return new Promise(function(resolve, reject) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', src, true);\n xhr.responseType = 'blob';\n\n xhr.onload = function() {\n if (xhr.status === 200) {\n var blob = xhr.response;\n var hasAlphaChannel = premultiplyAlpha !== undefined ? premultiplyAlpha : hasAlphaChannel(blob.type);\n\n createImageBitmap(blob, {\n premultiplyAlpha: hasAlphaChannel ? 'premultiply' : 'none',\n colorSpaceConversion: 'none',\n imageOrientation: 'none'\n }).then(function(data) {\n resolve({ data: data, premultiplyAlpha: premultiplyAlpha });\n }).catch(function(error) {\n reject(error);\n });\n } else {\n reject(new Error('Failed to load image: ' + xhr.statusText));\n }\n };\n\n xhr.onerror = function() {\n reject(new Error('Network error occurred while trying to fetch the image.'));\n };\n\n xhr.send();\n });\n }\n\n self.onmessage = async (event) => {\n var src = event.data.src;\n var premultiplyAlpha = event.data.premultiplyAlpha;\n\n getImage(src, premultiplyAlpha)\n .then(function(data) {\n self.postMessage({ src: src, data: data }, [data.data]);\n })\n .catch(function(error) {\n self.postMessage({ src: src, error: error.message });\n });\n };\n `;\n const blob = new Blob([workerCode.replace('\"use strict\";', '')], {\n type: 'application/javascript',\n });\n const blobURL = (self.URL ? URL : webkitURL).createObjectURL(blob);\n const workers = [];\n for (let i = 0; i < numWorkers; i++) {\n workers.push(new Worker(blobURL));\n }\n return workers;\n }\n getNextWorker() {\n const worker = this.workers[this.workerIndex];\n this.workerIndex = (this.workerIndex + 1) % this.workers.length;\n return worker;\n }\n convertUrlToAbsolute(url) {\n const absoluteUrl = new URL(url, self.location.href);\n return absoluteUrl.href;\n }\n getImage(src, premultiplyAlpha) {\n return new Promise((resolve, reject) => {\n try {\n if (this.workers) {\n const absoluteSrcUrl = this.convertUrlToAbsolute(src);\n this.messageManager[absoluteSrcUrl] = [resolve, reject];\n this.getNextWorker().postMessage({\n src: absoluteSrcUrl,\n premultiplyAlpha,\n });\n }\n }\n catch (error) {\n reject(error);\n }\n });\n }\n}\n//# sourceMappingURL=ImageWorker.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Texture } from './Texture.js';\n/**\n * Texture consisting of a random grid of greyscale pixels\n *\n * @remarks\n * The width and height of the NoiseTexture are defined by it's\n * {@link NoiseTextureProps.width} and {@link NoiseTextureProps.height}\n * properties. The {@link NoiseTextureProps.cacheId} prop can be varied in order\n * to bypass cache and get newly randomized texture data.\n */\nexport class NoiseTexture extends Texture {\n props;\n constructor(txManager, props) {\n super(txManager);\n this.props = NoiseTexture.resolveDefaults(props);\n }\n async getTextureData() {\n const { width, height } = this.props;\n const size = width * height * 4;\n const pixelData8 = new Uint8ClampedArray(size);\n for (let i = 0; i < size; i += 4) {\n const v = Math.floor(Math.random() * 256);\n pixelData8[i] = v;\n pixelData8[i + 1] = v;\n pixelData8[i + 2] = v;\n pixelData8[i + 3] = 255;\n }\n return {\n data: new ImageData(pixelData8, width, height),\n };\n }\n static makeCacheKey(props) {\n const resolvedProps = NoiseTexture.resolveDefaults(props);\n return `NoiseTexture,${resolvedProps.width},${resolvedProps.height},${resolvedProps.cacheId}`;\n }\n static resolveDefaults(props) {\n return {\n width: props.width ?? 128,\n height: props.height ?? 128,\n cacheId: props.cacheId ?? 0,\n };\n }\n static z$__type__Props;\n}\n//# sourceMappingURL=NoiseTexture.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../utils.js';\nimport { ImageWorkerManager } from './lib/ImageWorker.js';\nimport { ColorTexture } from './textures/ColorTexture.js';\nimport { ImageTexture } from './textures/ImageTexture.js';\nimport { NoiseTexture } from './textures/NoiseTexture.js';\nimport { SubTexture } from './textures/SubTexture.js';\nexport class CoreTextureManager {\n /**\n * Amount of used memory defined in pixels\n */\n usedMemory = 0;\n txConstructors = {};\n textureKeyCache = new Map();\n textureIdCache = new Map();\n ctxTextureCache = new WeakMap();\n textureRefCountMap = new WeakMap();\n imageWorkerManager = null;\n hasCreateImageBitmap = !!self.createImageBitmap;\n hasWorker = !!self.Worker;\n /**\n * Renderer that this texture manager is associated with\n *\n * @remarks\n * This MUST be set before the texture manager is used. Otherwise errors\n * will occur when using the texture manager.\n */\n renderer;\n constructor(numImageWorkers) {\n // Register default known texture types\n if (this.hasCreateImageBitmap && this.hasWorker) {\n this.imageWorkerManager = new ImageWorkerManager(numImageWorkers);\n }\n if (!this.hasCreateImageBitmap) {\n console.warn('[Lightning] createImageBitmap is not supported on this browser. ImageTexture will be slower.');\n }\n this.registerTextureType('ImageTexture', ImageTexture);\n this.registerTextureType('ColorTexture', ColorTexture);\n this.registerTextureType('NoiseTexture', NoiseTexture);\n this.registerTextureType('SubTexture', SubTexture);\n }\n registerTextureType(textureType, textureClass) {\n this.txConstructors[textureType] = textureClass;\n }\n loadTexture(textureType, props, options = null) {\n const TextureClass = this.txConstructors[textureType];\n if (!TextureClass) {\n throw new Error(`Texture type \"${textureType}\" is not registered`);\n }\n let texture;\n // If an ID is specified, try to get the texture from the ID cache first\n if (options?.id !== undefined && this.textureIdCache.has(options.id)) {\n // console.log('Getting texture by texture desc ID', options.id);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n texture = this.textureIdCache.get(options.id);\n }\n // If the texture is not found in the ID cache, try to get it from the key cache\n if (!texture) {\n const descId = options?.id;\n const cacheKey = options?.cacheKey ?? TextureClass.makeCacheKey(props);\n if (cacheKey && this.textureKeyCache.has(cacheKey)) {\n // console.log('Getting texture by cache key', cacheKey);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n texture = this.textureKeyCache.get(cacheKey);\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any\n texture = new TextureClass(this, props);\n }\n if (descId) {\n this.addTextureIdToCache(descId, cacheKey, texture);\n }\n }\n if (options?.preload) {\n const ctxTx = this.getCtxTexture(texture);\n ctxTx.load();\n }\n return texture;\n }\n /**\n * Add a `Texture` to the texture cache by its texture desc ID and cache key\n *\n * @remarks\n * This is used internally by the `CoreTextureManager` to cache textures\n * when they are created.\n *\n * It handles updating the texture ID cache, texture key cache, and texture\n * reference count map.\n *\n * @param textureDescId\n * @param cacheKey\n * @param texture\n */\n addTextureIdToCache(textureDescId, cacheKey, texture) {\n const { textureIdCache, textureRefCountMap } = this;\n textureIdCache.set(textureDescId, texture);\n if (textureRefCountMap.has(texture)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n textureRefCountMap.get(texture).count++;\n }\n else {\n textureRefCountMap.set(texture, { cacheKey, count: 1 });\n if (cacheKey) {\n this.textureKeyCache.set(cacheKey, texture);\n }\n }\n }\n /**\n * Remove a `Texture` from the texture cache by its texture desc ID\n *\n * @remarks\n * This is called externally by when we know (at least reasonably well) that\n * the `TextureRef` in the Main API space has been is no longer used. This\n * allows us to remove the `Texture` from the Usage Cache so that it can be\n * garbage collected as well.\n *\n * @param textureDescId\n */\n removeTextureIdFromCache(textureDescId) {\n const { textureIdCache, textureRefCountMap } = this;\n const texture = textureIdCache.get(textureDescId);\n if (!texture) {\n // Sometimes a texture is removed from the cache before it ever gets\n // added to the cache. This is fine and not an error.\n return;\n }\n textureIdCache.delete(textureDescId);\n if (textureRefCountMap.has(texture)) {\n const refCountObj = textureRefCountMap.get(texture);\n assertTruthy(refCountObj);\n refCountObj.count--;\n if (refCountObj.count === 0) {\n textureRefCountMap.delete(texture);\n // If the texture is not referenced anywhere else, remove it from the key cache\n // as well.\n // This should allow the `Texture` instance to be garbage collected.\n if (refCountObj.cacheKey) {\n this.textureKeyCache.delete(refCountObj.cacheKey);\n }\n }\n }\n // Free the ctx texture if it exists.\n this.ctxTextureCache.get(texture)?.free();\n }\n /**\n * Get an object containing debug information about the texture manager.\n *\n * @returns\n */\n getDebugInfo() {\n // const textureSet = new Set();\n // for (const texture of this.textureIdCache.values()) {\n // textureSet.add(texture);\n // }\n // for (const texture of this.textureKeyCache.values()) {\n // textureSet.add(texture);\n // }\n // TODO: Output number of bytes used by textures\n return {\n keyCacheSize: this.textureKeyCache.size,\n idCacheSize: this.textureIdCache.size,\n };\n }\n /**\n * Get a CoreContextTexture for the given Texture source.\n *\n * @remarks\n * If the texture source already has an allocated CoreContextTexture, it will be\n * returned from the cache. Otherwise, a new CoreContextTexture will be created\n * and cached.\n *\n * ContextTextures are stored in a WeakMap, so they will be garbage collected\n * when the Texture source is no longer referenced.\n *\n * @param textureSource\n * @returns\n */\n getCtxTexture(textureSource) {\n if (this.ctxTextureCache.has(textureSource)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this.ctxTextureCache.get(textureSource);\n }\n const texture = this.renderer.createCtxTexture(textureSource);\n this.ctxTextureCache.set(textureSource, texture);\n return texture;\n }\n}\n//# sourceMappingURL=CoreTextureManager.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n MainCoreDriver,\n RendererMain,\n type RendererMainSettings,\n} from '@lightningjs/renderer';\n\nexport let renderer: RendererMain;\nexport let createShader: RendererMain['createShader'];\n\nexport interface SolidRendererOptions extends RendererMainSettings {\n threadXCoreWorkerUrl?: string;\n rootId: string | HTMLElement;\n}\n\nexport function startLightningRenderer(\n options: Partial = {},\n rootId: string | HTMLElement = 'app',\n): RendererMain {\n const driver = new MainCoreDriver();\n renderer = new RendererMain(options, rootId, driver);\n createShader = renderer.createShader.bind(renderer);\n return renderer;\n}\n","export class TextureMemoryManager {\n memUsed = 0;\n textures = new Map();\n threshold;\n /**\n * @param byteThreshold Number of texture bytes to trigger garbage collection\n */\n constructor(byteThreshold) {\n this.threshold = byteThreshold;\n // If the threshold is 0, we disable the memory manager by replacing the\n // setTextureMemUse method with a no-op function.\n if (byteThreshold === 0) {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n this.setTextureMemUse = () => { };\n }\n }\n setTextureMemUse(ctxTexture, byteSize) {\n if (this.textures.has(ctxTexture)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.memUsed -= this.textures.get(ctxTexture);\n }\n if (byteSize === 0) {\n this.textures.delete(ctxTexture);\n return;\n }\n else {\n this.memUsed += byteSize;\n this.textures.set(ctxTexture, byteSize);\n }\n if (this.memUsed > this.threshold) {\n this.gc();\n }\n }\n gc() {\n this.textures.forEach((byteSize, ctxTexture) => {\n if (!ctxTexture.renderable) {\n ctxTexture.free();\n }\n });\n }\n}\n//# sourceMappingURL=TextureMemoryManager.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { startLoop, getTimeStamp } from './platform.js';\nimport { WebGlCoreRenderer } from './renderers/webgl/WebGlCoreRenderer.js';\nimport { assertTruthy } from '../utils.js';\nimport { AnimationManager } from './animations/AnimationManager.js';\nimport { CoreNode } from './CoreNode.js';\nimport { CoreTextureManager } from './CoreTextureManager.js';\nimport { TrFontManager } from './text-rendering/TrFontManager.js';\nimport { CoreShaderManager } from './CoreShaderManager.js';\nimport { SdfTextRenderer } from './text-rendering/renderers/SdfTextRenderer/SdfTextRenderer.js';\nimport { CanvasTextRenderer } from './text-rendering/renderers/CanvasTextRenderer.js';\nimport { EventEmitter } from '../common/EventEmitter.js';\nimport { ContextSpy } from './lib/ContextSpy.js';\nimport { TextureMemoryManager } from './TextureMemoryManager.js';\nconst bufferMemory = 2e6;\nconst autoStart = true;\nexport class Stage extends EventEmitter {\n options;\n /// Module Instances\n animationManager;\n txManager;\n txMemManager;\n fontManager;\n textRenderers;\n shManager;\n renderer;\n root;\n boundsMargin;\n /// State\n deltaTime = 0;\n lastFrameTime = 0;\n currentFrameTime = 0;\n fpsNumFrames = 0;\n fpsElapsedTime = 0;\n renderRequested = false;\n /// Debug data\n contextSpy = null;\n /**\n * Stage constructor\n */\n constructor(options) {\n super();\n this.options = options;\n const { canvas, clearColor, rootId, debug, appWidth, appHeight, boundsMargin, enableContextSpy, numImageWorkers, txMemByteThreshold, } = options;\n this.txManager = new CoreTextureManager(numImageWorkers);\n this.txMemManager = new TextureMemoryManager(txMemByteThreshold);\n this.shManager = new CoreShaderManager();\n this.animationManager = new AnimationManager();\n this.contextSpy = enableContextSpy ? new ContextSpy() : null;\n let bm = [0, 0, 0, 0];\n if (boundsMargin) {\n bm = Array.isArray(boundsMargin)\n ? boundsMargin\n : [boundsMargin, boundsMargin, boundsMargin, boundsMargin];\n }\n this.boundsMargin = bm;\n if (debug?.monitorTextureCache) {\n setInterval(() => {\n assertTruthy(this.txManager);\n const debugInfo = this.txManager.getDebugInfo();\n console.log('Texture ID Cache Size: ', debugInfo.idCacheSize);\n console.log('Texture Key Cache Size: ', debugInfo.keyCacheSize);\n }, 1000);\n }\n this.renderer = new WebGlCoreRenderer({\n stage: this,\n canvas,\n pixelRatio: options.devicePhysicalPixelRatio * options.deviceLogicalPixelRatio,\n clearColor: clearColor ?? 0xff000000,\n bufferMemory,\n txManager: this.txManager,\n txMemManager: this.txMemManager,\n shManager: this.shManager,\n contextSpy: this.contextSpy,\n });\n // Must do this after renderer is created\n this.txManager.renderer = this.renderer;\n this.textRenderers = {\n canvas: new CanvasTextRenderer(this),\n sdf: new SdfTextRenderer(this),\n };\n this.fontManager = new TrFontManager(this.textRenderers);\n // create root node\n const rootNode = new CoreNode(this, {\n id: rootId,\n x: 0,\n y: 0,\n width: appWidth,\n height: appHeight,\n alpha: 1,\n clipping: false,\n color: 0x00000000,\n colorTop: 0x00000000,\n colorBottom: 0x00000000,\n colorLeft: 0x00000000,\n colorRight: 0x00000000,\n colorTl: 0x00000000,\n colorTr: 0x00000000,\n colorBl: 0x00000000,\n colorBr: 0x00000000,\n zIndex: 0,\n zIndexLocked: 0,\n scaleX: 1,\n scaleY: 1,\n mountX: 0,\n mountY: 0,\n mount: 0,\n pivot: 0.5,\n pivotX: 0.5,\n pivotY: 0.5,\n rotation: 0,\n parent: null,\n texture: null,\n textureOptions: null,\n shader: null,\n shaderProps: null,\n });\n this.root = rootNode;\n // execute platform start loop\n if (autoStart) {\n startLoop(this);\n }\n }\n /**\n * Update animations\n */\n updateAnimations() {\n const { animationManager } = this;\n if (!this.root) {\n return;\n }\n this.lastFrameTime = this.currentFrameTime;\n this.currentFrameTime = getTimeStamp();\n this.deltaTime = !this.lastFrameTime\n ? 100 / 6\n : this.currentFrameTime - this.lastFrameTime;\n this.emit('frameTick', {\n time: this.currentFrameTime,\n delta: this.deltaTime,\n });\n // step animation\n animationManager.update(this.deltaTime);\n }\n /**\n * Check if the scene has updates\n */\n hasSceneUpdates() {\n return !!this.root.updateType || this.renderRequested;\n }\n /**\n * Start a new frame draw\n */\n drawFrame() {\n const { renderer, renderRequested } = this;\n // Update tree if needed\n if (this.root.updateType !== 0) {\n this.root.update(this.deltaTime, this.root.clippingRect);\n }\n // test if we need to update the scene\n renderer?.reset();\n this.addQuads(this.root);\n renderer?.render();\n this.calculateFps();\n // Reset renderRequested flag if it was set\n if (renderRequested) {\n this.renderRequested = false;\n }\n }\n calculateFps() {\n // If there's an FPS update interval, emit the FPS update event\n // when the specified interval has elapsed.\n const { fpsUpdateInterval } = this.options;\n if (fpsUpdateInterval) {\n this.fpsNumFrames++;\n this.fpsElapsedTime += this.deltaTime;\n if (this.fpsElapsedTime >= fpsUpdateInterval) {\n const fps = Math.round((this.fpsNumFrames * 1000) / this.fpsElapsedTime);\n this.fpsNumFrames = 0;\n this.fpsElapsedTime = 0;\n this.emit('fpsUpdate', {\n fps,\n contextSpyData: this.contextSpy?.getData() ?? null,\n });\n this.contextSpy?.reset();\n }\n }\n }\n addQuads(node) {\n assertTruthy(this.renderer && node.globalTransform);\n if (node.isRenderable) {\n node.renderQuads(this.renderer);\n }\n for (let i = 0; i < node.children.length; i++) {\n const child = node.children[i];\n if (!child) {\n continue;\n }\n if (child?.worldAlpha === 0) {\n continue;\n }\n this.addQuads(child);\n }\n }\n /**\n * Request a render pass without forcing an update\n */\n requestRender() {\n this.renderRequested = true;\n }\n /**\n * Given a font name, and possible renderer override, return the best compatible text renderer.\n *\n * @remarks\n * Will always return at least a canvas renderer if no other suitable renderer can be resolved.\n *\n * @param fontFamily\n * @param textRendererOverride\n * @returns\n */\n resolveTextRenderer(trProps, textRendererOverride = null) {\n let rendererId = textRendererOverride;\n let overrideFallback = false;\n // Check if the override is valid (if one is provided)\n if (rendererId) {\n const possibleRenderer = this.textRenderers[rendererId];\n if (!possibleRenderer) {\n console.warn(`Text renderer override '${rendererId}' not found.`);\n rendererId = null;\n overrideFallback = true;\n }\n else if (!possibleRenderer.canRenderFont(trProps)) {\n console.warn(`Cannot use override text renderer '${rendererId}' for font`, trProps);\n rendererId = null;\n overrideFallback = true;\n }\n }\n if (!rendererId) {\n // Iterate through the text renderers and find the first one that can render the font\n for (const [trId, tr] of Object.entries(this.textRenderers)) {\n if (trId === 'canvas') {\n // Canvas is always a fallback\n continue;\n }\n if (tr.canRenderFont(trProps)) {\n rendererId = trId;\n break;\n }\n }\n if (!rendererId) {\n // If no renderer can be found, use the canvas renderer\n rendererId = 'canvas';\n }\n }\n if (overrideFallback) {\n console.warn(`Falling back to text renderer ${String(rendererId)}`);\n }\n // By now we are guaranteed to have a valid rendererId (at least Canvas);\n const resolvedTextRenderer = this.textRenderers[rendererId];\n assertTruthy(resolvedTextRenderer, 'resolvedTextRenderer undefined');\n // Need to explicitly cast to TextRenderer because TS doesn't like\n // the covariant state argument in the setter method map\n return resolvedTextRenderer;\n }\n}\n//# sourceMappingURL=Stage.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Platform render loop initiator\n */\nexport const startLoop = (stage) => {\n let isIdle = false;\n const runLoop = () => {\n stage.updateAnimations();\n if (!stage.hasSceneUpdates()) {\n // We still need to calculate the fps else it looks like the app is frozen\n stage.calculateFps();\n setTimeout(runLoop, 16.666666666666668);\n if (!isIdle) {\n stage.emit('idle');\n isIdle = true;\n }\n return;\n }\n isIdle = false;\n stage.drawFrame();\n requestAnimationFrame(runLoop);\n };\n requestAnimationFrame(runLoop);\n};\n/**\n * Return unix timestamp\n * @return {number}\n */\nexport const getTimeStamp = () => {\n return performance ? performance.now() : Date.now();\n};\n//# sourceMappingURL=platform.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { CoreNode, UpdateType } from './CoreNode.js';\nimport { assertTruthy } from '../utils.js';\nexport class CoreTextNode extends CoreNode {\n textRenderer;\n trState;\n _textRendererOverride = null;\n constructor(stage, props) {\n super(stage, props);\n this._textRendererOverride = props.textRendererOverride;\n const { resolvedTextRenderer, textRendererState } = this.resolveTextRendererAndState({\n x: this.absX,\n y: this.absY,\n width: props.width,\n height: props.height,\n textAlign: props.textAlign,\n color: props.color,\n zIndex: props.zIndex,\n contain: props.contain,\n scrollable: props.scrollable,\n scrollY: props.scrollY,\n offsetY: props.offsetY,\n letterSpacing: props.letterSpacing,\n debug: props.debug,\n fontFamily: props.fontFamily,\n fontSize: props.fontSize,\n fontStretch: props.fontStretch,\n fontStyle: props.fontStyle,\n fontWeight: props.fontWeight,\n text: props.text,\n lineHeight: props.lineHeight,\n maxLines: props.maxLines,\n textBaseline: props.textBaseline,\n verticalAlign: props.verticalAlign,\n overflowSuffix: props.overflowSuffix,\n });\n this.textRenderer = resolvedTextRenderer;\n this.trState = textRendererState;\n }\n onTextLoaded = () => {\n const { contain } = this;\n const setWidth = this.trState.props.width;\n const setHeight = this.trState.props.height;\n const calcWidth = this.trState.textW || 0;\n const calcHeight = this.trState.textH || 0;\n if (contain === 'both') {\n this.props.width = setWidth;\n this.props.height = setHeight;\n }\n else if (contain === 'width') {\n this.props.width = setWidth;\n this.props.height = calcHeight;\n }\n else if (contain === 'none') {\n this.props.width = calcWidth;\n this.props.height = calcHeight;\n }\n this.updateLocalTransform();\n // Incase the RAF loop has been stopped already before text was loaded,\n // we request a render so it can be drawn.\n this.stage.requestRender();\n this.emit('loaded', {\n type: 'text',\n dimensions: {\n width: this.trState.textW || 0,\n height: this.trState.textH || 0,\n },\n });\n };\n onTextFailed = (target, error) => {\n this.emit('failed', {\n type: 'text',\n error,\n });\n };\n get width() {\n return this.props.width;\n }\n set width(value) {\n this.props.width = value;\n this.textRenderer.set.width(this.trState, value);\n // If not containing, we must update the local transform to account for the\n // new width\n if (this.contain === 'none') {\n this.setUpdateType(UpdateType.Local);\n }\n }\n get height() {\n return this.props.height;\n }\n set height(value) {\n this.props.height = value;\n this.textRenderer.set.height(this.trState, value);\n // If not containing in the horizontal direction, we must update the local\n // transform to account for the new height\n if (this.contain !== 'both') {\n this.setUpdateType(UpdateType.Local);\n }\n }\n get color() {\n return this.trState.props.color;\n }\n set color(value) {\n this.textRenderer.set.color(this.trState, value);\n }\n get text() {\n return this.trState.props.text;\n }\n set text(value) {\n this.textRenderer.set.text(this.trState, value);\n }\n get textRendererOverride() {\n return this._textRendererOverride;\n }\n set textRendererOverride(value) {\n this._textRendererOverride = value;\n this.textRenderer.destroyState(this.trState);\n const { resolvedTextRenderer, textRendererState } = this.resolveTextRendererAndState(this.trState.props);\n this.textRenderer = resolvedTextRenderer;\n this.trState = textRendererState;\n }\n get fontSize() {\n return this.trState.props.fontSize;\n }\n set fontSize(value) {\n this.textRenderer.set.fontSize(this.trState, value);\n }\n get fontFamily() {\n return this.trState.props.fontFamily;\n }\n set fontFamily(value) {\n this.textRenderer.set.fontFamily(this.trState, value);\n }\n get fontStretch() {\n return this.trState.props.fontStretch;\n }\n set fontStretch(value) {\n this.textRenderer.set.fontStretch(this.trState, value);\n }\n get fontStyle() {\n return this.trState.props.fontStyle;\n }\n set fontStyle(value) {\n this.textRenderer.set.fontStyle(this.trState, value);\n }\n get fontWeight() {\n return this.trState.props.fontWeight;\n }\n set fontWeight(value) {\n this.textRenderer.set.fontWeight(this.trState, value);\n }\n get textAlign() {\n return this.trState.props.textAlign;\n }\n set textAlign(value) {\n this.textRenderer.set.textAlign(this.trState, value);\n }\n get contain() {\n return this.trState.props.contain;\n }\n set contain(value) {\n this.textRenderer.set.contain(this.trState, value);\n }\n get scrollable() {\n return this.trState.props.scrollable;\n }\n set scrollable(value) {\n this.textRenderer.set.scrollable(this.trState, value);\n }\n get scrollY() {\n return this.trState.props.scrollY;\n }\n set scrollY(value) {\n this.textRenderer.set.scrollY(this.trState, value);\n }\n get offsetY() {\n return this.trState.props.offsetY;\n }\n set offsetY(value) {\n this.textRenderer.set.offsetY(this.trState, value);\n }\n get letterSpacing() {\n return this.trState.props.letterSpacing;\n }\n set letterSpacing(value) {\n this.textRenderer.set.letterSpacing(this.trState, value);\n }\n get lineHeight() {\n return this.trState.props.lineHeight;\n }\n set lineHeight(value) {\n if (this.textRenderer.set.lineHeight) {\n this.textRenderer.set.lineHeight(this.trState, value);\n }\n }\n get maxLines() {\n return this.trState.props.maxLines;\n }\n set maxLines(value) {\n if (this.textRenderer.set.maxLines) {\n this.textRenderer.set.maxLines(this.trState, value);\n }\n }\n get textBaseline() {\n return this.trState.props.textBaseline;\n }\n set textBaseline(value) {\n if (this.textRenderer.set.textBaseline) {\n this.textRenderer.set.textBaseline(this.trState, value);\n }\n }\n get verticalAlign() {\n return this.trState.props.verticalAlign;\n }\n set verticalAlign(value) {\n if (this.textRenderer.set.verticalAlign) {\n this.textRenderer.set.verticalAlign(this.trState, value);\n }\n }\n get overflowSuffix() {\n return this.trState.props.overflowSuffix;\n }\n set overflowSuffix(value) {\n if (this.textRenderer.set.overflowSuffix) {\n this.textRenderer.set.overflowSuffix(this.trState, value);\n }\n }\n get debug() {\n return this.trState.props.debug;\n }\n set debug(value) {\n this.textRenderer.set.debug(this.trState, value);\n }\n update(delta, parentClippingRect) {\n super.update(delta, parentClippingRect);\n assertTruthy(this.globalTransform);\n // globalTransform is updated in super.update(delta)\n this.textRenderer.set.x(this.trState, this.globalTransform.tx);\n this.textRenderer.set.y(this.trState, this.globalTransform.ty);\n }\n checkRenderProps() {\n if (this.trState.props.text !== '') {\n return true;\n }\n return super.checkRenderProps();\n }\n onChangeIsRenderable(isRenderable) {\n super.onChangeIsRenderable(isRenderable);\n this.textRenderer.setIsRenderable(this.trState, isRenderable);\n }\n renderQuads(renderer) {\n assertTruthy(this.globalTransform);\n this.textRenderer.renderQuads(this.trState, this.globalTransform, this.clippingRect, this.worldAlpha);\n }\n /**\n * Destroy the node and cleanup all resources\n */\n destroy() {\n super.destroy();\n this.textRenderer.destroyState(this.trState);\n }\n /**\n * Resolve a text renderer and a new state based on the current text renderer props provided\n * @param props\n * @returns\n */\n resolveTextRendererAndState(props) {\n const resolvedTextRenderer = this.stage.resolveTextRenderer(props, this._textRendererOverride);\n const textRendererState = resolvedTextRenderer.createState(props);\n textRendererState.emitter.on('loaded', this.onTextLoaded);\n textRendererState.emitter.on('failed', this.onTextFailed);\n resolvedTextRenderer.scheduleUpdateState(textRendererState);\n return {\n resolvedTextRenderer,\n textRendererState,\n };\n }\n}\n//# sourceMappingURL=CoreTextNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { MainOnlyNode, getNewId } from './MainOnlyNode.js';\nimport { CoreTextNode } from '../../core/CoreTextNode.js';\nexport class MainOnlyTextNode extends MainOnlyNode {\n constructor(props, rendererMain, stage) {\n super(props, rendererMain, stage, new CoreTextNode(stage, {\n id: getNewId(),\n x: props.x,\n y: props.y,\n width: props.width,\n height: props.height,\n alpha: props.alpha,\n clipping: props.clipping,\n color: props.color,\n colorTop: props.colorTop,\n colorBottom: props.colorBottom,\n colorLeft: props.colorLeft,\n colorRight: props.colorRight,\n colorTl: props.colorTl,\n colorTr: props.colorTr,\n colorBl: props.colorBl,\n colorBr: props.colorBr,\n zIndex: props.zIndex,\n zIndexLocked: props.zIndexLocked,\n scaleX: props.scaleX,\n scaleY: props.scaleY,\n mountX: props.mountX,\n mountY: props.mountY,\n mount: props.mount,\n pivot: props.pivot,\n pivotX: props.pivotX,\n pivotY: props.pivotY,\n rotation: props.rotation,\n // Text properties\n text: props.text,\n fontSize: props.fontSize,\n fontFamily: props.fontFamily,\n fontWeight: props.fontWeight,\n fontStretch: props.fontStretch,\n fontStyle: props.fontStyle,\n contain: props.contain,\n scrollable: props.scrollable,\n letterSpacing: props.letterSpacing,\n textAlign: props.textAlign,\n scrollY: props.scrollY,\n offsetY: props.offsetY,\n textRendererOverride: props.textRendererOverride,\n lineHeight: props.lineHeight,\n maxLines: props.maxLines,\n textBaseline: props.textBaseline,\n verticalAlign: props.verticalAlign,\n overflowSuffix: props.overflowSuffix,\n debug: props.debug,\n // These properties will get set appropriately in the base MainOnlyNode class\n parent: null,\n texture: null,\n textureOptions: null,\n shader: null,\n shaderProps: null,\n }));\n }\n get text() {\n return this.coreNode.text;\n }\n set text(value) {\n this.coreNode.text = value;\n }\n get textRendererOverride() {\n return this.coreNode.textRendererOverride;\n }\n set textRendererOverride(value) {\n this.coreNode.textRendererOverride = value;\n }\n get fontSize() {\n return this.coreNode.fontSize;\n }\n set fontSize(value) {\n this.coreNode.fontSize = value;\n }\n get fontFamily() {\n return this.coreNode.fontFamily;\n }\n set fontFamily(value) {\n this.coreNode.fontFamily = value;\n }\n get fontWeight() {\n return this.coreNode.fontWeight;\n }\n set fontWeight(value) {\n this.coreNode.fontWeight = value;\n }\n get fontStretch() {\n return this.coreNode.fontStretch;\n }\n set fontStretch(value) {\n this.coreNode.fontStretch = value;\n }\n get fontStyle() {\n return this.coreNode.fontStyle;\n }\n set fontStyle(value) {\n this.coreNode.fontStyle = value;\n }\n get textAlign() {\n return this.coreNode.textAlign;\n }\n set textAlign(value) {\n this.coreNode.textAlign = value;\n }\n get contain() {\n return this.coreNode.contain;\n }\n set contain(value) {\n this.coreNode.contain = value;\n }\n get scrollable() {\n return this.coreNode.scrollable;\n }\n set scrollable(value) {\n this.coreNode.scrollable = value;\n }\n get scrollY() {\n return this.coreNode.scrollY;\n }\n set scrollY(value) {\n this.coreNode.scrollY = value;\n }\n get offsetY() {\n return this.coreNode.offsetY;\n }\n set offsetY(value) {\n this.coreNode.offsetY = value;\n }\n get letterSpacing() {\n return this.coreNode.letterSpacing;\n }\n set letterSpacing(value) {\n this.coreNode.letterSpacing = value;\n }\n get lineHeight() {\n return this.coreNode.lineHeight;\n }\n set lineHeight(value) {\n if (value) {\n this.coreNode.lineHeight = value;\n }\n }\n get maxLines() {\n return this.coreNode.maxLines;\n }\n set maxLines(value) {\n if (value) {\n this.coreNode.maxLines = value;\n }\n }\n get textBaseline() {\n return this.coreNode.textBaseline;\n }\n set textBaseline(value) {\n if (value) {\n this.coreNode.textBaseline = value;\n }\n }\n get verticalAlign() {\n return this.coreNode.verticalAlign;\n }\n set verticalAlign(value) {\n if (value) {\n this.coreNode.verticalAlign = value;\n }\n }\n get overflowSuffix() {\n return this.coreNode.overflowSuffix;\n }\n set overflowSuffix(value) {\n if (value) {\n this.coreNode.overflowSuffix = value;\n }\n }\n get debug() {\n return this.coreNode.debug;\n }\n set debug(value) {\n this.coreNode.debug = value;\n }\n}\n//# sourceMappingURL=MainOnlyTextNode.js.map","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast Cable Communications Management, LLC.\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { assertTruthy } from '../../utils.js';\nimport { MainOnlyNode, getNewId } from './MainOnlyNode.js';\nimport { Stage, } from '../../core/Stage.js';\nimport { MainOnlyTextNode } from './MainOnlyTextNode.js';\nimport { loadCoreExtension } from '../utils.js';\nexport class MainCoreDriver {\n root = null;\n stage = null;\n rendererMain = null;\n async init(rendererMain, rendererSettings, canvas) {\n this.stage = new Stage({\n rootId: getNewId(),\n appWidth: rendererSettings.appWidth,\n appHeight: rendererSettings.appHeight,\n txMemByteThreshold: rendererSettings.txMemByteThreshold,\n boundsMargin: rendererSettings.boundsMargin,\n deviceLogicalPixelRatio: rendererSettings.deviceLogicalPixelRatio,\n devicePhysicalPixelRatio: rendererSettings.devicePhysicalPixelRatio,\n clearColor: rendererSettings.clearColor,\n canvas,\n fpsUpdateInterval: rendererSettings.fpsUpdateInterval,\n enableContextSpy: rendererSettings.enableContextSpy,\n numImageWorkers: rendererSettings.numImageWorkers,\n debug: {\n monitorTextureCache: false,\n },\n });\n this.rendererMain = rendererMain;\n assertTruthy(this.stage.root);\n const node = new MainOnlyNode(rendererMain.resolveNodeDefaults({}), this.rendererMain, this.stage, this.stage.root);\n this.root = node;\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n // Load the Core Extension Module if one was specified.\n if (rendererSettings.coreExtensionModule) {\n await loadCoreExtension(rendererSettings.coreExtensionModule, this.stage);\n }\n // Forward fpsUpdate events from the stage to RendererMain\n this.stage.on('fpsUpdate', ((stage, fpsData) => {\n this.onFpsUpdate(fpsData);\n }));\n this.stage.on('frameTick', ((stage, frameTickData) => {\n this.onFrameTick(frameTickData);\n }));\n this.stage.on('idle', () => {\n this.onIdle();\n });\n }\n createNode(props) {\n assertTruthy(this.rendererMain);\n assertTruthy(this.stage);\n const node = new MainOnlyNode(props, this.rendererMain, this.stage);\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n return node;\n }\n createTextNode(props) {\n assertTruthy(this.rendererMain);\n assertTruthy(this.stage);\n const node = new MainOnlyTextNode(props, this.rendererMain, this.stage);\n node.once('beforeDestroy', this.onBeforeDestroyNode.bind(this, node));\n this.onCreateNode(node);\n return node;\n }\n // TODO: Remove?\n destroyNode(node) {\n node.destroy();\n }\n releaseTexture(id) {\n const { stage } = this;\n assertTruthy(stage);\n stage.txManager.removeTextureIdFromCache(id);\n }\n getRootNode() {\n assertTruthy(this.root);\n return this.root;\n }\n //#region Event Methods\n // The implementations for these event methods are provided by RendererMain\n onCreateNode(node) {\n throw new Error('Method not implemented.');\n }\n onBeforeDestroyNode(node) {\n throw new Error('Method not implemented.');\n }\n onFpsUpdate(fpsData) {\n throw new Error('Method not implemented.');\n }\n onFrameTick(frameTickData) {\n throw new Error('Method not implemented.');\n }\n onIdle() {\n throw new Error('Method not implemented.');\n }\n}\n//# sourceMappingURL=MainCoreDriver.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { ElementNode, SolidNode } from './index.js';\n\n/**\n * Children class\n */\nexport default class Children extends Array {\n _parent: ElementNode;\n\n constructor(node: ElementNode) {\n super();\n this._parent = node;\n }\n\n get selected(): ElementNode | undefined {\n // For selected Elements should always be an ElementNode\n return this[this._parent.selected || 0] as ElementNode | undefined;\n }\n\n get firstChild() {\n return this[0];\n }\n\n insert(node: SolidNode, beforeNode: SolidNode) {\n if (beforeNode) {\n const index = this.indexOf(beforeNode);\n this.splice(index, 0, node);\n } else {\n this.push(node);\n }\n\n node.parent = this._parent;\n this._parent._isDirty = true;\n }\n\n remove(node: SolidNode) {\n const nodeIndexToRemove = this.indexOf(node);\n if (nodeIndexToRemove >= 0) {\n this.splice(nodeIndexToRemove, 1);\n }\n }\n}\n","/*\n * If not stated otherwise in this file or this component's LICENSE file the\n * following copyright and licenses apply:\n *\n * Copyright 2023 Comcast\n *\n * Licensed under the Apache License, Version 2.0 (the License);\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n AnimationSettings,\n RendererMainSettings,\n} from '@lightningjs/renderer';\nimport type { IntrinsicTextNodeStyleProps } from './intrinsicTypes.js';\n\ninterface Config {\n debug: boolean;\n animationSettings: Partial;\n animationsEnabled: boolean;\n fontSettings: Partial;\n rendererOptions?: Partial;\n}\n\nfunction isDevEnv(): boolean {\n return import.meta.env && import.meta.env.DEV;\n}\nexport const isDev = isDevEnv() || false;\n\nexport const config: Config = {\n debug: false,\n animationsEnabled: true,\n animationSettings: {\n duration: 250,\n easing: 'ease-in-out',\n },\n fontSettings: {\n fontFamily: 'Ubuntu',\n fontSize: 100,\n },\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { config, isDev } from '../config.js';\nimport type { SolidNode, SolidStyles } from './node/index.js';\n\nfunction hasDebug(node: any) {\n return isObject(node) && node.debug;\n}\n\nexport function log(msg: string, node: SolidNode, ...args: any[]) {\n if (isDev) {\n if (config.debug || hasDebug(node) || hasDebug(args[0])) {\n console.log(msg, node, ...args);\n }\n }\n}\n\nexport function isFunc(item: unknown): item is (...args: unknown[]) => unknown {\n return typeof item === 'function';\n}\n\nexport function isObject(\n item: unknown,\n): item is Record {\n return typeof item === 'object';\n}\n\nexport function isArray(item: unknown): item is any[] {\n return Array.isArray(item);\n}\n\nexport function isString(item: unknown): item is string {\n return typeof item === 'string';\n}\n\nexport function isNumber(item: unknown): item is number {\n return typeof item === 'number';\n}\n\nexport function isInteger(item: unknown): item is number {\n return Number.isInteger(item);\n}\n\nexport function keyExists(\n obj: Record,\n keys: (string | number | symbol)[],\n) {\n for (const key of keys) {\n if (key in obj) {\n return true;\n }\n }\n return false;\n}\n\nexport function flattenStyles(\n obj: SolidStyles | undefined | (SolidStyles | undefined)[],\n result: Record = {},\n): SolidStyles {\n if (isArray(obj)) {\n obj.forEach((item) => {\n flattenStyles(item, result);\n });\n } else if (obj) {\n // handle the case where the object is not an array\n for (const key in obj) {\n // be careful of 0 values\n if (result[key as keyof SolidStyles] === undefined) {\n result[key as keyof SolidStyles] = obj[key as keyof SolidStyles];\n }\n }\n }\n\n return result;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { isArray, isString } from '../utils.js';\n\nexport type NodeStates =\n | string[]\n | string\n | Record;\n\nexport default class States extends Array {\n private onChange: () => void;\n\n constructor(callback: () => void, initialState: NodeStates = {}) {\n if (isArray(initialState)) {\n super(...initialState);\n } else if (isString(initialState)) {\n super(initialState);\n } else {\n super(\n ...Object.entries(initialState)\n .filter(([_key, value]) => value)\n .map(([key]) => key),\n );\n }\n\n this.onChange = callback;\n return this;\n }\n\n has(state: string) {\n return this.indexOf(state) >= 0;\n }\n\n is(state: string) {\n return this.indexOf(state) >= 0;\n }\n\n add(state: string) {\n this.push(state);\n this.onChange();\n }\n\n toggle(state: string) {\n if (this.has(state)) {\n this.remove(state);\n } else {\n this.add(state);\n }\n }\n\n remove(state: string) {\n const stateIndexToRemove = this.indexOf(state);\n if (stateIndexToRemove >= 0) {\n this.splice(stateIndexToRemove, 1);\n this.onChange();\n }\n }\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { renderer, createShader } from '../lightningInit.js';\nimport {\n type BorderStyleObject,\n type IntrinsicCommonProps,\n type IntrinsicNodeProps,\n type IntrinsicTextProps,\n type NodeStyles,\n type TextStyles,\n} from '../../index.js';\nimport Children from './children.js';\nimport States, { type NodeStates } from './states.js';\nimport calculateFlex from '../flex.js';\nimport {\n log,\n isArray,\n isNumber,\n isFunc,\n keyExists,\n flattenStyles,\n} from '../utils.js';\nimport { config } from '../../config.js';\nimport { setActiveElement } from '../activeElement.js';\nimport type {\n RendererMain,\n INode,\n INodeAnimatableProps,\n INodeWritableProps,\n ShaderRef,\n Dimensions,\n AnimationSettings,\n NodeLoadedPayload,\n} from '@lightningjs/renderer';\nimport { assertTruthy } from '@lightningjs/renderer/utils';\n\nconst { animationSettings: defaultAnimationSettings } = config;\n\nfunction convertEffectsToShader(styleEffects: any) {\n const effects = [];\n\n for (const [type, props] of Object.entries>(\n styleEffects,\n )) {\n effects.push({ type, props });\n }\n return createShader('DynamicShader', { effects: effects as any });\n}\n\nfunction borderAccessor(\n direction: '' | 'Top' | 'Right' | 'Bottom' | 'Left' = '',\n) {\n return {\n set(this: ElementNode, value: number | { width: number; color: number }) {\n // Format: width || { width, color }\n if (isNumber(value)) {\n value = { width: value, color: 0x000000ff };\n }\n this.effects = {\n ...(this.effects || {}),\n ...{ [`border${direction}`]: value },\n };\n this[`_border${direction}`] = value;\n },\n get(this: ElementNode) {\n return this[`_border${direction}`];\n },\n };\n}\n\nconst LightningRendererNumberProps = [\n 'alpha',\n 'color',\n 'colorTop',\n 'colorRight',\n 'colorLeft',\n 'colorBottom',\n 'colorTl',\n 'colorTr',\n 'colorBl',\n 'colorBr',\n 'height',\n 'fontSize',\n 'lineHeight',\n 'mount',\n 'mountX',\n 'mountY',\n 'pivot',\n 'pivotX',\n 'pivotY',\n 'rotation',\n 'scale',\n 'width',\n 'worldX',\n 'worldY',\n 'x',\n 'y',\n 'zIndex',\n 'zIndexLocked',\n];\n\nconst LightningRendererNonAnimatingProps = [\n 'clipping',\n 'contain',\n 'fontFamily',\n 'fontStretch',\n 'fontStyle',\n 'fontWeight',\n 'letterSpacing',\n 'maxLines',\n 'offsetY',\n 'overflowSuffix',\n 'rtt',\n 'scrollable',\n 'scrollY',\n 'src',\n 'text',\n 'textAlign',\n 'textBaseline',\n 'textOverflow',\n 'texture',\n 'verticalAlign',\n 'wordWrap',\n];\n\nexport interface TextNode {\n id?: string;\n name: string;\n text: string;\n parent: ElementNode | undefined;\n zIndex?: number;\n states?: States;\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n marginLeft?: number;\n marginRight?: number;\n marginTop?: number;\n marginBottom?: number;\n _queueDelete?: boolean;\n}\n\nexport type SolidNode = ElementNode | TextNode;\nexport type SolidStyles = NodeStyles | TextStyles;\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\nexport interface ElementNode\n extends Partial>,\n IntrinsicCommonProps {\n [key: string]: unknown;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\nexport class ElementNode extends Object {\n id?: string;\n debug?: boolean;\n name: string;\n lng: INode | undefined;\n renderer?: RendererMain;\n selected?: number;\n rendered: boolean;\n autofocus: boolean;\n _queueDelete?: boolean;\n forwardFocus?:\n | number\n | ((this: ElementNode, elm: ElementNode) => boolean | void);\n\n private _undoStyles?: string[];\n private _renderProps?: IntrinsicNodeProps | IntrinsicTextProps;\n private _effects: any;\n private _parent: ElementNode | undefined;\n private _shader?: ShaderRef;\n private _style?: SolidStyles;\n private _states?: States;\n private _animationSettings?: Partial;\n private _width?: number;\n private _height?: number;\n private _color?: number;\n private _borderRadius?: number;\n private _border?: BorderStyleObject;\n private _borderLeft?: BorderStyleObject;\n private _borderRight?: BorderStyleObject;\n private _borderTop?: BorderStyleObject;\n private _borderBottom?: BorderStyleObject;\n public _autosized?: boolean; // Public but uses _ prefix\n public _isDirty?: boolean; // Public but uses _ prefix\n private _animationQueue: Array<{\n props: Partial;\n animationSettings?: Partial;\n }> = [];\n private _animationQueueSettings: Partial | undefined;\n private _animationRunning: boolean = false;\n children: Children;\n\n constructor(name: string) {\n super();\n this.name = name;\n this.rendered = false;\n this.autofocus = false;\n this._renderProps = { x: 0, y: 0 };\n this.children = new Children(this);\n\n for (const key of LightningRendererNumberProps) {\n Object.defineProperty(this, key, {\n get(): number {\n return (this.lng && this.lng[key]) || this[`_${key}`];\n },\n set(v: number) {\n this[`_${key}`] = v;\n this._sendToLightningAnimatable(key, v);\n },\n });\n }\n\n for (const key of LightningRendererNonAnimatingProps) {\n Object.defineProperty(this, key, {\n get() {\n return (this.lng && this.lng[key]) || this[`_${key}`];\n },\n set(v) {\n this[`_${key}`] = v;\n this._sendToLightning(key, v);\n },\n });\n }\n\n // Add Border Helpers\n Object.defineProperties(this, {\n borderRadius: {\n set(this: ElementNode, radius) {\n this._borderRadius = radius;\n this.effects = {\n ...(this.effects || {}),\n ...{ radius: { radius } },\n };\n },\n get(this: ElementNode) {\n return this._borderRadius;\n },\n },\n border: borderAccessor(),\n borderLeft: borderAccessor('Left'),\n borderRight: borderAccessor('Right'),\n borderTop: borderAccessor('Top'),\n borderBottom: borderAccessor('Bottom'),\n });\n\n Object.defineProperties(this, {\n linearGradient: {\n set(props = {}) {\n this._linearGradient = props;\n this.effects = {\n ...(this.effects || {}),\n ...{ linearGradient: props },\n };\n },\n get() {\n return this._linearGradient;\n },\n },\n });\n }\n\n get effects() {\n return this._effects;\n }\n\n set effects(v) {\n this._effects = v;\n if (this.rendered) {\n this.shader = convertEffectsToShader(v);\n }\n }\n\n get parent() {\n return this._parent;\n }\n\n set parent(p) {\n this._parent = p;\n if (this.rendered && this.lng) {\n this.lng.parent = p?.lng ?? null;\n }\n }\n\n get shader(): ShaderRef | undefined {\n return this._shader;\n }\n\n set shader(v: Parameters | ShaderRef | undefined) {\n if (isArray(v)) {\n this._shader = createShader(...v) as ShaderRef;\n } else {\n this._shader = v;\n }\n this._sendToLightning('shader', this._shader);\n }\n\n _sendToLightningAnimatable(name: string, value: number | string) {\n if (this.lng) {\n if (\n config.animationsEnabled &&\n this.transition &&\n (this.transition === true || this.transition[name])\n ) {\n const animationSettings =\n this.transition === true || this.transition[name] === true\n ? undefined\n : (this.transition[name] as undefined | AnimationSettings);\n\n return this.animate({ [name]: value }, animationSettings).start();\n }\n\n (this.lng[name as keyof INode] as number | string) = value;\n } else {\n this._renderProps![name] = value;\n }\n }\n\n _sendToLightning(name: string, value: unknown) {\n if (this.rendered && this.lng) {\n (this.lng[name as keyof INodeWritableProps] as unknown) = value;\n } else {\n this._renderProps![name] = value;\n }\n }\n\n animate(\n props: Partial,\n animationSettings?: Partial,\n ) {\n assertTruthy(this.lng, 'Node must be rendered before animating');\n return this.lng.animate(props, animationSettings || this.animationSettings);\n }\n\n chain(\n props: Partial,\n animationSettings?: Partial,\n ) {\n if (this._animationRunning) {\n this._animationQueue = [];\n this._animationRunning = false;\n }\n\n if (animationSettings) {\n this._animationQueueSettings = animationSettings;\n } else if (!this._animationQueueSettings) {\n this._animationQueueSettings =\n animationSettings || this.animationSettings;\n }\n animationSettings = animationSettings || this._animationQueueSettings;\n this._animationQueue.push({ props, animationSettings });\n return this;\n }\n\n async start() {\n let animation = this._animationQueue.shift();\n while (animation) {\n this._animationRunning = true;\n await this.animate(animation.props, animation.animationSettings)\n .start()\n .waitUntilStopped();\n animation = this._animationQueue.shift();\n }\n this._animationRunning = false;\n this._animationQueueSettings = undefined;\n }\n\n setFocus() {\n if (this.rendered) {\n // can be 0\n if (this.forwardFocus !== undefined) {\n if (isFunc(this.forwardFocus)) {\n if (this.forwardFocus.call(this, this) !== false) {\n return;\n }\n } else {\n const focusedIndex =\n typeof this.forwardFocus === 'number' ? this.forwardFocus : null;\n if (focusedIndex !== null && focusedIndex < this.children.length) {\n const child = this.children[focusedIndex];\n child instanceof ElementNode && child.setFocus();\n return;\n }\n }\n }\n // Delay setting focus so children can render (useful for Row + Column)\n queueMicrotask(() => setActiveElement(this));\n } else {\n this.autofocus = true;\n }\n }\n\n isTextNode() {\n return this.name === 'text';\n }\n\n _resizeOnTextLoad() {\n this.lng!.on('loaded', (_node: INode, loadedPayload: NodeLoadedPayload) => {\n if (loadedPayload.type === 'text') {\n const { dimensions } = loadedPayload;\n this.parent!.updateLayout(this, dimensions);\n }\n });\n }\n\n getText() {\n return this.children.map((c) => c.text).join('');\n }\n\n destroy() {\n if (this._queueDelete) {\n this.lng?.destroy();\n }\n }\n\n set style(values: SolidStyles | (SolidStyles | undefined)[]) {\n if (isArray(values)) {\n this._style = flattenStyles(values);\n } else {\n this._style = values;\n }\n // Keys set in JSX are more important\n for (const key in this._style) {\n // be careful of 0 values\n if (this[key as keyof SolidStyles] === undefined) {\n this[key as keyof SolidStyles] = this._style[key as keyof SolidStyles];\n }\n }\n }\n\n get style(): SolidStyles {\n return this._style!;\n }\n\n get hasChildren() {\n return this.children.length > 0;\n }\n\n getChildById(id: string) {\n return this.children.find((c) => c.id === id);\n }\n\n searchChildrenById(id: string): SolidNode | undefined {\n // traverse all the childrens children\n for (const child of this.children) {\n if (child.id === id) {\n return child;\n }\n if (child instanceof ElementNode) {\n const found = child.searchChildrenById(id);\n if (found) {\n return found;\n }\n }\n }\n }\n\n set states(states: NodeStates) {\n this._states = new States(this._stateChanged.bind(this), states);\n if (this.rendered) {\n this._stateChanged();\n }\n }\n\n get states(): States {\n this._states = this._states || new States(this._stateChanged.bind(this));\n return this._states;\n }\n\n get animationSettings(): Partial {\n return this._animationSettings || defaultAnimationSettings;\n }\n\n set animationSettings(animationSettings: Partial) {\n this._animationSettings = animationSettings;\n }\n\n updateLayout(child?: ElementNode, dimensions?: Dimensions) {\n if (this.hasChildren) {\n log('Layout: ', this);\n isFunc(this.onBeforeLayout) &&\n this.onBeforeLayout.call(this, child, dimensions);\n\n if (this.display === 'flex') {\n if (calculateFlex(this)) {\n this.parent?.updateLayout();\n }\n }\n\n isFunc(this.onLayout) && this.onLayout.call(this, child, dimensions);\n }\n }\n\n _stateChanged() {\n log('State Changed: ', this, this.states);\n\n if (this.forwardStates) {\n // apply states to children first\n const states = this.states.slice() as States;\n this.children.forEach((c) => (c.states = states));\n }\n\n const states = this.states;\n\n if (this._undoStyles || (this.style && keyExists(this.style, states))) {\n this._undoStyles = this._undoStyles || [];\n const stylesToUndo: { [key: string]: any } = {};\n\n this._undoStyles.forEach((styleKey) => {\n stylesToUndo[styleKey] = this.style[styleKey];\n });\n\n const newStyles = states.reduce((acc, state) => {\n const styles = this.style[state];\n if (styles) {\n acc = {\n ...acc,\n ...styles,\n };\n }\n return acc;\n }, {});\n\n this._undoStyles = Object.keys(newStyles);\n\n // Apply transition first\n if ((newStyles as any).transition !== undefined) {\n this.transition = (newStyles as any).transition;\n }\n\n // Apply the styles\n Object.assign(this, { ...stylesToUndo, ...newStyles });\n }\n }\n\n render() {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const node = this;\n const parent = this.parent;\n\n if (!parent) {\n console.warn('Parent not set - no node created for: ', this);\n return;\n }\n\n if (!parent.rendered) {\n console.warn('Parent not rendered yet: ', this);\n return;\n }\n\n if (this.rendered) {\n console.warn('Node already rendered: ', this);\n return;\n }\n\n // Parent is dirty whenever a node is inserted after initial render\n if (parent._isDirty) {\n parent.updateLayout();\n parent._isDirty = false;\n }\n\n node.updateLayout();\n\n if (this.states.length) {\n this._stateChanged();\n }\n\n let props = node._renderProps as IntrinsicNodeProps | IntrinsicTextProps;\n\n if (parent.lng) {\n props.parent = parent.lng;\n }\n\n if (node._effects) {\n this.shader = convertEffectsToShader(node._effects);\n }\n\n if (node.isTextNode()) {\n props = {\n ...config.fontSettings,\n ...props,\n text: node.getText(),\n };\n\n if (props.contain) {\n if (!props.width) {\n props.width =\n (parent.width || 0) - (props.x || 0) - (props.marginRight || 0);\n node._width = props.width;\n node._autosized = true;\n }\n\n if (props.contain === 'both' && !props.height && !props.maxLines) {\n props.height =\n (parent.height || 0) - (props.y || 0) - (props.marginBottom || 0);\n node._height = props.height;\n node._autosized = true;\n }\n }\n\n log('Rendering: ', this, props);\n node.lng = renderer.createTextNode(props);\n\n if (isFunc(node.onLoad)) {\n node.lng.on('loaded', node.onLoad);\n }\n\n if (!node.width || !node.height) {\n node._autosized = true;\n node._resizeOnTextLoad();\n }\n } else {\n // If its not an image or texture apply some defaults\n if (!props.texture) {\n // Set width and height to parent less offset\n if (isNaN(props.width as number)) {\n props.width = (parent.width || 0) - (props.x || 0);\n node._width = props.width;\n node._autosized = true;\n }\n\n if (isNaN(props.height as number)) {\n props.height = (parent.height || 0) - (props.y || 0);\n node._height = props.height;\n node._autosized = true;\n }\n\n if (!props.color && !props.src) {\n // Default color to transparent - If you later set a src, you'll need\n // to set color '#ffffffff'\n node._color = props.color = 0x00000000;\n }\n }\n\n log('Rendering: ', this, props);\n node.lng = renderer.createNode(props);\n\n if (node.onFail) {\n node.lng.on('failed', node.onFail);\n }\n\n if (node.onLoad) {\n node.lng.on('loaded', node.onLoad);\n }\n }\n\n node.rendered = true;\n isFunc(this.onCreate) && this.onCreate.call(this, node);\n\n // L3 Inspector adds div to the lng object\n //@ts-expect-error - div is not in the typings\n if (node.lng.div) {\n //@ts-expect-error - div is not in the typings\n node.lng.div.solid = node;\n }\n // clean up after first render;\n delete this._renderProps;\n\n if (node.name !== 'text') {\n node.children.forEach((c) => {\n if ((c as ElementNode).render) {\n (c as ElementNode).render();\n } else if (c.text !== '') {\n // Solid Show uses an empty text node as a placeholder\n console.warn('TextNode outside of : ', c);\n }\n });\n }\n\n node.autofocus && node.setFocus();\n }\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { assertTruthy } from '@lightningjs/renderer/utils';\nimport type { ElementNode, SolidNode } from './node/index.js';\n\nexport default function (node: ElementNode): boolean {\n const children = [];\n for (let i = 0; i < node.children.length; i++) {\n const c = node.children[i]!;\n // Filter empty text nodes which are place holders for and elements missing dimensions\n if (c.name === 'TextNode') {\n continue;\n }\n // text node hasnt loaded yet - skip layout\n if (c.name === 'text' && !(c.width || c.height)) {\n return false;\n }\n\n children.push(c);\n }\n\n const numChildren = children.length;\n const direction = node.flexDirection || 'row';\n const isRow = direction === 'row';\n const dimension = isRow ? 'width' : 'height';\n const crossDimension = isRow ? 'height' : 'width';\n const marginOne = isRow ? 'marginLeft' : 'marginTop';\n const marginTwo = isRow ? 'marginRight' : 'marginBottom';\n const prop = isRow ? 'x' : 'y';\n const crossProp = isRow ? 'y' : 'x';\n const containerSize = node[dimension] || 0;\n const containerCrossSize = node[crossDimension] || 0;\n const gap = node.gap || 0;\n const justify = node.justifyContent || 'flexStart';\n const align = node.alignItems;\n let itemSize = 0;\n if (['center', 'spaceBetween', 'spaceEvenly'].includes(justify)) {\n itemSize = children.reduce((prev, c) => prev + (c[dimension] || 0), 0);\n }\n\n // Only align children if container has a cross size\n const crossAlignChild =\n containerCrossSize && align\n ? (c: SolidNode) => {\n if (align === 'flexStart') {\n c[crossProp] = 0;\n } else if (align === 'center') {\n c[crossProp] = (containerCrossSize - (c[crossDimension] || 0)) / 2;\n } else if (align === 'flexEnd') {\n c[crossProp] = containerCrossSize - (c[crossDimension] || 0);\n }\n }\n : (c: SolidNode) => c;\n\n if (justify === 'flexStart') {\n let start = 0;\n children.forEach((c) => {\n c[prop] = start + (c[marginOne] || 0);\n start +=\n (c[dimension] || 0) + gap + (c[marginOne] || 0) + (c[marginTwo] || 0);\n crossAlignChild(c);\n });\n // Update container size\n if (node._autosized) {\n const calculatedSize = start - gap;\n if (calculatedSize !== node[dimension]) {\n node[dimension] = calculatedSize;\n return true;\n }\n }\n } else if (justify === 'flexEnd') {\n let start = containerSize;\n for (let i = numChildren - 1; i >= 0; i--) {\n const c = children[i];\n assertTruthy(c);\n c[prop] = start - (c[dimension] || 0) - (c[marginTwo] || 0);\n start -=\n (c[dimension] || 0) + gap + (c[marginOne] || 0) + (c[marginTwo] || 0);\n crossAlignChild(c);\n }\n } else if (justify === 'center') {\n let start = (containerSize - (itemSize + gap * (numChildren - 1))) / 2;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + gap;\n crossAlignChild(c);\n });\n } else if (justify === 'spaceBetween') {\n const toPad = (containerSize - itemSize) / (numChildren - 1);\n let start = 0;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + toPad;\n crossAlignChild(c);\n });\n } else if (justify === 'spaceEvenly') {\n const toPad = (containerSize - itemSize) / (numChildren + 1);\n let start = toPad;\n children.forEach((c) => {\n c[prop] = start;\n start += (c[dimension] || 0) + toPad;\n crossAlignChild(c);\n });\n }\n\n // Container was not updated\n return false;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { type Component } from \"solid-js\";\nimport type { IntrinsicTextProps } from \"../intrinsicTypes.js\";\n\nexport const Text: Component = (props) => \n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { type Component } from \"solid-js\";\nimport { type IntrinsicNodeProps } from \"../intrinsicTypes.js\";\n\nexport const View: Component = (props) =>\n ;\n","import {\n createRoot,\n createRenderEffect,\n mergeProps,\n createMemo,\n createComponent,\n untrack\n} from \"solid-js\";\n\nfunction createRenderer$1({\n createElement,\n createTextNode,\n isTextNode,\n replaceText,\n insertNode,\n removeNode,\n setProperty,\n getParentNode,\n getFirstChild,\n getNextSibling\n}) {\n function insert(parent, accessor, marker, initial) {\n if (marker !== undefined && !initial) initial = [];\n if (typeof accessor !== \"function\") return insertExpression(parent, accessor, initial, marker);\n createRenderEffect(current => insertExpression(parent, accessor(), current, marker), initial);\n }\n function insertExpression(parent, value, current, marker, unwrapArray) {\n while (typeof current === \"function\") current = current();\n if (value === current) return current;\n const t = typeof value,\n multi = marker !== undefined;\n if (t === \"string\" || t === \"number\") {\n if (t === \"number\") value = value.toString();\n if (multi) {\n let node = current[0];\n if (node && isTextNode(node)) {\n replaceText(node, value);\n } else node = createTextNode(value);\n current = cleanChildren(parent, current, marker, node);\n } else {\n if (current !== \"\" && typeof current === \"string\") {\n replaceText(getFirstChild(parent), (current = value));\n } else {\n cleanChildren(parent, current, marker, createTextNode(value));\n current = value;\n }\n }\n } else if (value == null || t === \"boolean\") {\n current = cleanChildren(parent, current, marker);\n } else if (t === \"function\") {\n createRenderEffect(() => {\n let v = value();\n while (typeof v === \"function\") v = v();\n current = insertExpression(parent, v, current, marker);\n });\n return () => current;\n } else if (Array.isArray(value)) {\n const array = [];\n if (normalizeIncomingArray(array, value, unwrapArray)) {\n createRenderEffect(\n () => (current = insertExpression(parent, array, current, marker, true))\n );\n return () => current;\n }\n if (array.length === 0) {\n const replacement = cleanChildren(parent, current, marker);\n if (multi) return (current = replacement);\n } else {\n if (Array.isArray(current)) {\n if (current.length === 0) {\n appendNodes(parent, array, marker);\n } else reconcileArrays(parent, current, array);\n } else if (current == null || current === \"\") {\n appendNodes(parent, array);\n } else {\n reconcileArrays(parent, (multi && current) || [getFirstChild(parent)], array);\n }\n }\n current = array;\n } else {\n if (Array.isArray(current)) {\n if (multi) return (current = cleanChildren(parent, current, marker, value));\n cleanChildren(parent, current, null, value);\n } else if (current == null || current === \"\" || !getFirstChild(parent)) {\n insertNode(parent, value);\n } else replaceNode(parent, value, getFirstChild(parent));\n current = value;\n }\n return current;\n }\n function normalizeIncomingArray(normalized, array, unwrap) {\n let dynamic = false;\n for (let i = 0, len = array.length; i < len; i++) {\n let item = array[i],\n t;\n if (item == null || item === true || item === false);\n else if (Array.isArray(item)) {\n dynamic = normalizeIncomingArray(normalized, item) || dynamic;\n } else if ((t = typeof item) === \"string\" || t === \"number\") {\n normalized.push(createTextNode(item));\n } else if (t === \"function\") {\n if (unwrap) {\n while (typeof item === \"function\") item = item();\n dynamic =\n normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item]) || dynamic;\n } else {\n normalized.push(item);\n dynamic = true;\n }\n } else normalized.push(item);\n }\n return dynamic;\n }\n function reconcileArrays(parentNode, a, b) {\n let bLength = b.length,\n aEnd = a.length,\n bEnd = bLength,\n aStart = 0,\n bStart = 0,\n after = getNextSibling(a[aEnd - 1]),\n map = null;\n while (aStart < aEnd || bStart < bEnd) {\n if (a[aStart] === b[bStart]) {\n aStart++;\n bStart++;\n continue;\n }\n while (a[aEnd - 1] === b[bEnd - 1]) {\n aEnd--;\n bEnd--;\n }\n if (aEnd === aStart) {\n const node =\n bEnd < bLength ? (bStart ? getNextSibling(b[bStart - 1]) : b[bEnd - bStart]) : after;\n while (bStart < bEnd) insertNode(parentNode, b[bStart++], node);\n } else if (bEnd === bStart) {\n while (aStart < aEnd) {\n if (!map || !map.has(a[aStart])) removeNode(parentNode, a[aStart]);\n aStart++;\n }\n } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {\n const node = getNextSibling(a[--aEnd]);\n insertNode(parentNode, b[bStart++], getNextSibling(a[aStart++]));\n insertNode(parentNode, b[--bEnd], node);\n a[aEnd] = b[bEnd];\n } else {\n if (!map) {\n map = new Map();\n let i = bStart;\n while (i < bEnd) map.set(b[i], i++);\n }\n const index = map.get(a[aStart]);\n if (index != null) {\n if (bStart < index && index < bEnd) {\n let i = aStart,\n sequence = 1,\n t;\n while (++i < aEnd && i < bEnd) {\n if ((t = map.get(a[i])) == null || t !== index + sequence) break;\n sequence++;\n }\n if (sequence > index - bStart) {\n const node = a[aStart];\n while (bStart < index) insertNode(parentNode, b[bStart++], node);\n } else replaceNode(parentNode, b[bStart++], a[aStart++]);\n } else aStart++;\n } else removeNode(parentNode, a[aStart++]);\n }\n }\n }\n function cleanChildren(parent, current, marker, replacement) {\n if (marker === undefined) {\n let removed;\n while ((removed = getFirstChild(parent))) removeNode(parent, removed);\n replacement && insertNode(parent, replacement);\n return \"\";\n }\n const node = replacement || createTextNode(\"\");\n if (current.length) {\n let inserted = false;\n for (let i = current.length - 1; i >= 0; i--) {\n const el = current[i];\n if (node !== el) {\n const isParent = getParentNode(el) === parent;\n if (!inserted && !i)\n isParent ? replaceNode(parent, node, el) : insertNode(parent, node, marker);\n else isParent && removeNode(parent, el);\n } else inserted = true;\n }\n } else insertNode(parent, node, marker);\n return [node];\n }\n function appendNodes(parent, array, marker) {\n for (let i = 0, len = array.length; i < len; i++) insertNode(parent, array[i], marker);\n }\n function replaceNode(parent, newNode, oldNode) {\n insertNode(parent, newNode, oldNode);\n removeNode(parent, oldNode);\n }\n function spreadExpression(node, props, prevProps = {}, skipChildren) {\n props || (props = {});\n if (!skipChildren) {\n createRenderEffect(\n () => (prevProps.children = insertExpression(node, props.children, prevProps.children))\n );\n }\n createRenderEffect(() => props.ref && props.ref(node));\n createRenderEffect(() => {\n for (const prop in props) {\n if (prop === \"children\" || prop === \"ref\") continue;\n const value = props[prop];\n if (value === prevProps[prop]) continue;\n setProperty(node, prop, value, prevProps[prop]);\n prevProps[prop] = value;\n }\n });\n return prevProps;\n }\n return {\n render(code, element) {\n let disposer;\n createRoot(dispose => {\n disposer = dispose;\n insert(element, code());\n });\n return disposer;\n },\n insert,\n spread(node, accessor, skipChildren) {\n if (typeof accessor === \"function\") {\n createRenderEffect(current => spreadExpression(node, accessor(), current, skipChildren));\n } else spreadExpression(node, accessor, undefined, skipChildren);\n },\n createElement,\n createTextNode,\n insertNode,\n setProp(node, name, value, prev) {\n setProperty(node, name, value, prev);\n return value;\n },\n mergeProps,\n effect: createRenderEffect,\n memo: createMemo,\n createComponent,\n use(fn, element, arg) {\n return untrack(() => fn(element, arg));\n }\n };\n}\n\nfunction createRenderer(options) {\n const renderer = createRenderer$1(options);\n renderer.mergeProps = mergeProps;\n return renderer;\n}\n\nexport { createRenderer };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { assertTruthy } from '@lightningjs/renderer/utils';\nimport { log } from './utils.js';\nimport { ElementNode, type SolidNode, type TextNode } from './node/index.js';\nimport type { createRenderer } from 'solid-js/universal';\n\nexport type SolidRendererOptions = Parameters<\n typeof createRenderer\n>[0];\n\nexport default {\n createElement(name: string): ElementNode {\n return new ElementNode(name);\n },\n createTextNode(text: string): TextNode {\n // A text node is just a string - not the node\n return { name: 'TextNode', text, parent: undefined };\n },\n replaceText(node: TextNode, value: string): void {\n log('Replace Text: ', node, value);\n node.text = value;\n const parent = node.parent;\n assertTruthy(parent);\n parent.text = parent.getText();\n },\n setProperty(node: ElementNode, name: string, value: any = true): void {\n node[name] = value;\n },\n insertNode(parent: ElementNode, node: SolidNode, anchor: SolidNode): void {\n log('INSERT: ', parent, node, anchor);\n\n parent.children.insert(node, anchor);\n node._queueDelete = false;\n\n if (node instanceof ElementNode) {\n parent.rendered && node.render();\n } else if (parent.isTextNode()) {\n // TextNodes can be placed outside of nodes when is used as placeholder\n parent.text = parent.getText();\n }\n },\n isTextNode(node: ElementNode): boolean {\n return node.isTextNode();\n },\n removeNode(parent: ElementNode, node: SolidNode): void {\n log('REMOVE: ', parent, node);\n parent.children.remove(node);\n node._queueDelete = true;\n\n if (node instanceof ElementNode) {\n // Solid replacesNodes to move them (via insert and remove),\n // so we need to wait for the next microtask to destroy the node\n // in the event it gets a new parent.\n queueMicrotask(() => node.destroy());\n }\n },\n getParentNode(node: SolidNode): ElementNode | undefined {\n return node.parent;\n },\n getFirstChild(node: ElementNode): SolidNode | undefined {\n return node.children[0];\n },\n getNextSibling(node: SolidNode): SolidNode | undefined {\n const children = node.parent!.children || [];\n const index = children.indexOf(node) + 1;\n if (index < children.length) {\n return children[index];\n }\n return undefined;\n },\n} satisfies SolidRendererOptions;\n","/* eslint-disable @typescript-eslint/unbound-method */\n/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { createRenderer } from 'solid-js/universal';\nimport { config } from '../config.js';\nimport { startLightningRenderer } from './lightningInit.js';\nimport universalLightning from './solidUniversal.js';\nimport { ElementNode, type SolidNode } from './node/index.js';\nimport { splitProps, createMemo, untrack, type JSX } from 'solid-js';\n\nconst solidRenderer = createRenderer(universalLightning);\n\nexport const render = async function (\n code: () => JSX.Element,\n node?: string | HTMLElement | undefined,\n) {\n const renderer = startLightningRenderer(config.rendererOptions, node);\n await renderer.init();\n const rootNode = new ElementNode('App');\n rootNode.lng = renderer.root!;\n rootNode.rendered = true;\n // @ts-expect-error - code is jsx element and not SolidElement yet\n return solidRenderer.render(code, rootNode);\n};\n\nexport const {\n effect,\n memo,\n createComponent,\n createElement,\n createTextNode,\n insertNode,\n insert,\n spread,\n setProp,\n mergeProps,\n use,\n} = solidRenderer;\n\n/**\n * renders an arbitrary custom or native component and passes the other props\n * ```typescript\n * \n * ```\n * @description https://www.solidjs.com/docs/latest/api#dynamic\n */\nexport function Dynamic(\n props: T extends Record ? T : never,\n): SolidNode {\n const [p, others] = splitProps(props, ['component']);\n // eslint-disable-next-line @typescript-eslint/ban-types\n const cached = createMemo(() => p.component);\n return createMemo(() => {\n const component = cached();\n switch (typeof component) {\n case 'function':\n return untrack(() => component(others));\n\n case 'string':\n // eslint-disable-next-line no-case-declarations\n const el = createElement(component);\n spread(el, others);\n return el;\n\n default:\n break;\n }\n }) as unknown as SolidNode;\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { isInteger } from './core/utils.js';\n\n/**\n * Converts a color string to a color number value.\n */\nexport function hexColor(color: string | number = ''): number {\n if (isInteger(color)) {\n return color;\n }\n\n if (typeof color === 'string') {\n // Renderer expects RGBA values\n if (color.startsWith('#')) {\n return Number(\n color.replace('#', '0x') + (color.length === 7 ? 'ff' : ''),\n );\n }\n\n if (color.startsWith('0x')) {\n return Number(color);\n }\n return Number('0x' + (color.length === 6 ? color + 'ff' : color));\n }\n\n return 0x00000000;\n}\n\n/**\n * Converts degrees to radians\n */\nexport function deg2rad(deg: number) {\n return (deg * Math.PI) / 180;\n}\n","import {\n createRoot,\n sharedConfig,\n createRenderEffect,\n untrack,\n enableHydration,\n getOwner,\n createEffect,\n runWithOwner,\n createMemo,\n createSignal,\n onCleanup,\n splitProps\n} from \"solid-js\";\nexport {\n ErrorBoundary,\n For,\n Index,\n Match,\n Show,\n Suspense,\n SuspenseList,\n Switch,\n createComponent,\n createRenderEffect as effect,\n getOwner,\n createMemo as memo,\n mergeProps,\n untrack\n} from \"solid-js\";\n\nconst booleans = [\n \"allowfullscreen\",\n \"async\",\n \"autofocus\",\n \"autoplay\",\n \"checked\",\n \"controls\",\n \"default\",\n \"disabled\",\n \"formnovalidate\",\n \"hidden\",\n \"indeterminate\",\n \"inert\",\n \"ismap\",\n \"loop\",\n \"multiple\",\n \"muted\",\n \"nomodule\",\n \"novalidate\",\n \"open\",\n \"playsinline\",\n \"readonly\",\n \"required\",\n \"reversed\",\n \"seamless\",\n \"selected\"\n];\nconst Properties = /*#__PURE__*/ new Set([\n \"className\",\n \"value\",\n \"readOnly\",\n \"formNoValidate\",\n \"isMap\",\n \"noModule\",\n \"playsInline\",\n ...booleans\n]);\nconst ChildProperties = /*#__PURE__*/ new Set([\n \"innerHTML\",\n \"textContent\",\n \"innerText\",\n \"children\"\n]);\nconst Aliases = /*#__PURE__*/ Object.assign(Object.create(null), {\n className: \"class\",\n htmlFor: \"for\"\n});\nconst PropAliases = /*#__PURE__*/ Object.assign(Object.create(null), {\n class: \"className\",\n formnovalidate: {\n $: \"formNoValidate\",\n BUTTON: 1,\n INPUT: 1\n },\n ismap: {\n $: \"isMap\",\n IMG: 1\n },\n nomodule: {\n $: \"noModule\",\n SCRIPT: 1\n },\n playsinline: {\n $: \"playsInline\",\n VIDEO: 1\n },\n readonly: {\n $: \"readOnly\",\n INPUT: 1,\n TEXTAREA: 1\n }\n});\nfunction getPropAlias(prop, tagName) {\n const a = PropAliases[prop];\n return typeof a === \"object\" ? (a[tagName] ? a[\"$\"] : undefined) : a;\n}\nconst DelegatedEvents = /*#__PURE__*/ new Set([\n \"beforeinput\",\n \"click\",\n \"dblclick\",\n \"contextmenu\",\n \"focusin\",\n \"focusout\",\n \"input\",\n \"keydown\",\n \"keyup\",\n \"mousedown\",\n \"mousemove\",\n \"mouseout\",\n \"mouseover\",\n \"mouseup\",\n \"pointerdown\",\n \"pointermove\",\n \"pointerout\",\n \"pointerover\",\n \"pointerup\",\n \"touchend\",\n \"touchmove\",\n \"touchstart\"\n]);\nconst SVGElements = /*#__PURE__*/ new Set([\n \"altGlyph\",\n \"altGlyphDef\",\n \"altGlyphItem\",\n \"animate\",\n \"animateColor\",\n \"animateMotion\",\n \"animateTransform\",\n \"circle\",\n \"clipPath\",\n \"color-profile\",\n \"cursor\",\n \"defs\",\n \"desc\",\n \"ellipse\",\n \"feBlend\",\n \"feColorMatrix\",\n \"feComponentTransfer\",\n \"feComposite\",\n \"feConvolveMatrix\",\n \"feDiffuseLighting\",\n \"feDisplacementMap\",\n \"feDistantLight\",\n \"feFlood\",\n \"feFuncA\",\n \"feFuncB\",\n \"feFuncG\",\n \"feFuncR\",\n \"feGaussianBlur\",\n \"feImage\",\n \"feMerge\",\n \"feMergeNode\",\n \"feMorphology\",\n \"feOffset\",\n \"fePointLight\",\n \"feSpecularLighting\",\n \"feSpotLight\",\n \"feTile\",\n \"feTurbulence\",\n \"filter\",\n \"font\",\n \"font-face\",\n \"font-face-format\",\n \"font-face-name\",\n \"font-face-src\",\n \"font-face-uri\",\n \"foreignObject\",\n \"g\",\n \"glyph\",\n \"glyphRef\",\n \"hkern\",\n \"image\",\n \"line\",\n \"linearGradient\",\n \"marker\",\n \"mask\",\n \"metadata\",\n \"missing-glyph\",\n \"mpath\",\n \"path\",\n \"pattern\",\n \"polygon\",\n \"polyline\",\n \"radialGradient\",\n \"rect\",\n \"set\",\n \"stop\",\n \"svg\",\n \"switch\",\n \"symbol\",\n \"text\",\n \"textPath\",\n \"tref\",\n \"tspan\",\n \"use\",\n \"view\",\n \"vkern\"\n]);\nconst SVGNamespace = {\n xlink: \"http://www.w3.org/1999/xlink\",\n xml: \"http://www.w3.org/XML/1998/namespace\"\n};\nconst DOMElements = /*#__PURE__*/ new Set([\n \"html\",\n \"base\",\n \"head\",\n \"link\",\n \"meta\",\n \"style\",\n \"title\",\n \"body\",\n \"address\",\n \"article\",\n \"aside\",\n \"footer\",\n \"header\",\n \"main\",\n \"nav\",\n \"section\",\n \"body\",\n \"blockquote\",\n \"dd\",\n \"div\",\n \"dl\",\n \"dt\",\n \"figcaption\",\n \"figure\",\n \"hr\",\n \"li\",\n \"ol\",\n \"p\",\n \"pre\",\n \"ul\",\n \"a\",\n \"abbr\",\n \"b\",\n \"bdi\",\n \"bdo\",\n \"br\",\n \"cite\",\n \"code\",\n \"data\",\n \"dfn\",\n \"em\",\n \"i\",\n \"kbd\",\n \"mark\",\n \"q\",\n \"rp\",\n \"rt\",\n \"ruby\",\n \"s\",\n \"samp\",\n \"small\",\n \"span\",\n \"strong\",\n \"sub\",\n \"sup\",\n \"time\",\n \"u\",\n \"var\",\n \"wbr\",\n \"area\",\n \"audio\",\n \"img\",\n \"map\",\n \"track\",\n \"video\",\n \"embed\",\n \"iframe\",\n \"object\",\n \"param\",\n \"picture\",\n \"portal\",\n \"source\",\n \"svg\",\n \"math\",\n \"canvas\",\n \"noscript\",\n \"script\",\n \"del\",\n \"ins\",\n \"caption\",\n \"col\",\n \"colgroup\",\n \"table\",\n \"tbody\",\n \"td\",\n \"tfoot\",\n \"th\",\n \"thead\",\n \"tr\",\n \"button\",\n \"datalist\",\n \"fieldset\",\n \"form\",\n \"input\",\n \"label\",\n \"legend\",\n \"meter\",\n \"optgroup\",\n \"option\",\n \"output\",\n \"progress\",\n \"select\",\n \"textarea\",\n \"details\",\n \"dialog\",\n \"menu\",\n \"summary\",\n \"details\",\n \"slot\",\n \"template\",\n \"acronym\",\n \"applet\",\n \"basefont\",\n \"bgsound\",\n \"big\",\n \"blink\",\n \"center\",\n \"content\",\n \"dir\",\n \"font\",\n \"frame\",\n \"frameset\",\n \"hgroup\",\n \"image\",\n \"keygen\",\n \"marquee\",\n \"menuitem\",\n \"nobr\",\n \"noembed\",\n \"noframes\",\n \"plaintext\",\n \"rb\",\n \"rtc\",\n \"shadow\",\n \"spacer\",\n \"strike\",\n \"tt\",\n \"xmp\",\n \"a\",\n \"abbr\",\n \"acronym\",\n \"address\",\n \"applet\",\n \"area\",\n \"article\",\n \"aside\",\n \"audio\",\n \"b\",\n \"base\",\n \"basefont\",\n \"bdi\",\n \"bdo\",\n \"bgsound\",\n \"big\",\n \"blink\",\n \"blockquote\",\n \"body\",\n \"br\",\n \"button\",\n \"canvas\",\n \"caption\",\n \"center\",\n \"cite\",\n \"code\",\n \"col\",\n \"colgroup\",\n \"content\",\n \"data\",\n \"datalist\",\n \"dd\",\n \"del\",\n \"details\",\n \"dfn\",\n \"dialog\",\n \"dir\",\n \"div\",\n \"dl\",\n \"dt\",\n \"em\",\n \"embed\",\n \"fieldset\",\n \"figcaption\",\n \"figure\",\n \"font\",\n \"footer\",\n \"form\",\n \"frame\",\n \"frameset\",\n \"head\",\n \"header\",\n \"hgroup\",\n \"hr\",\n \"html\",\n \"i\",\n \"iframe\",\n \"image\",\n \"img\",\n \"input\",\n \"ins\",\n \"kbd\",\n \"keygen\",\n \"label\",\n \"legend\",\n \"li\",\n \"link\",\n \"main\",\n \"map\",\n \"mark\",\n \"marquee\",\n \"menu\",\n \"menuitem\",\n \"meta\",\n \"meter\",\n \"nav\",\n \"nobr\",\n \"noembed\",\n \"noframes\",\n \"noscript\",\n \"object\",\n \"ol\",\n \"optgroup\",\n \"option\",\n \"output\",\n \"p\",\n \"param\",\n \"picture\",\n \"plaintext\",\n \"portal\",\n \"pre\",\n \"progress\",\n \"q\",\n \"rb\",\n \"rp\",\n \"rt\",\n \"rtc\",\n \"ruby\",\n \"s\",\n \"samp\",\n \"script\",\n \"section\",\n \"select\",\n \"shadow\",\n \"slot\",\n \"small\",\n \"source\",\n \"spacer\",\n \"span\",\n \"strike\",\n \"strong\",\n \"style\",\n \"sub\",\n \"summary\",\n \"sup\",\n \"table\",\n \"tbody\",\n \"td\",\n \"template\",\n \"textarea\",\n \"tfoot\",\n \"th\",\n \"thead\",\n \"time\",\n \"title\",\n \"tr\",\n \"track\",\n \"tt\",\n \"u\",\n \"ul\",\n \"var\",\n \"video\",\n \"wbr\",\n \"xmp\",\n \"input\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n \"h6\"\n]);\n\nfunction reconcileArrays(parentNode, a, b) {\n let bLength = b.length,\n aEnd = a.length,\n bEnd = bLength,\n aStart = 0,\n bStart = 0,\n after = a[aEnd - 1].nextSibling,\n map = null;\n while (aStart < aEnd || bStart < bEnd) {\n if (a[aStart] === b[bStart]) {\n aStart++;\n bStart++;\n continue;\n }\n while (a[aEnd - 1] === b[bEnd - 1]) {\n aEnd--;\n bEnd--;\n }\n if (aEnd === aStart) {\n const node = bEnd < bLength ? (bStart ? b[bStart - 1].nextSibling : b[bEnd - bStart]) : after;\n while (bStart < bEnd) parentNode.insertBefore(b[bStart++], node);\n } else if (bEnd === bStart) {\n while (aStart < aEnd) {\n if (!map || !map.has(a[aStart])) a[aStart].remove();\n aStart++;\n }\n } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {\n const node = a[--aEnd].nextSibling;\n parentNode.insertBefore(b[bStart++], a[aStart++].nextSibling);\n parentNode.insertBefore(b[--bEnd], node);\n a[aEnd] = b[bEnd];\n } else {\n if (!map) {\n map = new Map();\n let i = bStart;\n while (i < bEnd) map.set(b[i], i++);\n }\n const index = map.get(a[aStart]);\n if (index != null) {\n if (bStart < index && index < bEnd) {\n let i = aStart,\n sequence = 1,\n t;\n while (++i < aEnd && i < bEnd) {\n if ((t = map.get(a[i])) == null || t !== index + sequence) break;\n sequence++;\n }\n if (sequence > index - bStart) {\n const node = a[aStart];\n while (bStart < index) parentNode.insertBefore(b[bStart++], node);\n } else parentNode.replaceChild(b[bStart++], a[aStart++]);\n } else aStart++;\n } else a[aStart++].remove();\n }\n }\n}\n\nconst $$EVENTS = \"_$DX_DELEGATE\";\nfunction render(code, element, init, options = {}) {\n let disposer;\n createRoot(dispose => {\n disposer = dispose;\n element === document\n ? code()\n : insert(element, code(), element.firstChild ? null : undefined, init);\n }, options.owner);\n return () => {\n disposer();\n element.textContent = \"\";\n };\n}\nfunction template(html, isCE, isSVG) {\n let node;\n const create = () => {\n const t = document.createElement(\"template\");\n t.innerHTML = html;\n return isSVG ? t.content.firstChild.firstChild : t.content.firstChild;\n };\n const fn = isCE\n ? () => untrack(() => document.importNode(node || (node = create()), true))\n : () => (node || (node = create())).cloneNode(true);\n fn.cloneNode = fn;\n return fn;\n}\nfunction delegateEvents(eventNames, document = window.document) {\n const e = document[$$EVENTS] || (document[$$EVENTS] = new Set());\n for (let i = 0, l = eventNames.length; i < l; i++) {\n const name = eventNames[i];\n if (!e.has(name)) {\n e.add(name);\n document.addEventListener(name, eventHandler);\n }\n }\n}\nfunction clearDelegatedEvents(document = window.document) {\n if (document[$$EVENTS]) {\n for (let name of document[$$EVENTS].keys()) document.removeEventListener(name, eventHandler);\n delete document[$$EVENTS];\n }\n}\nfunction setProperty(node, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n node[name] = value;\n}\nfunction setAttribute(node, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttribute(name);\n else node.setAttribute(name, value);\n}\nfunction setAttributeNS(node, namespace, name, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttributeNS(namespace, name);\n else node.setAttributeNS(namespace, name, value);\n}\nfunction className(node, value) {\n if (!!sharedConfig.context && node.isConnected) return;\n if (value == null) node.removeAttribute(\"class\");\n else node.className = value;\n}\nfunction addEventListener(node, name, handler, delegate) {\n if (delegate) {\n if (Array.isArray(handler)) {\n node[`$$${name}`] = handler[0];\n node[`$$${name}Data`] = handler[1];\n } else node[`$$${name}`] = handler;\n } else if (Array.isArray(handler)) {\n const handlerFn = handler[0];\n node.addEventListener(name, (handler[0] = e => handlerFn.call(node, handler[1], e)));\n } else node.addEventListener(name, handler);\n}\nfunction classList(node, value, prev = {}) {\n const classKeys = Object.keys(value || {}),\n prevKeys = Object.keys(prev);\n let i, len;\n for (i = 0, len = prevKeys.length; i < len; i++) {\n const key = prevKeys[i];\n if (!key || key === \"undefined\" || value[key]) continue;\n toggleClassKey(node, key, false);\n delete prev[key];\n }\n for (i = 0, len = classKeys.length; i < len; i++) {\n const key = classKeys[i],\n classValue = !!value[key];\n if (!key || key === \"undefined\" || prev[key] === classValue || !classValue) continue;\n toggleClassKey(node, key, true);\n prev[key] = classValue;\n }\n return prev;\n}\nfunction style(node, value, prev) {\n if (!value) return prev ? setAttribute(node, \"style\") : value;\n const nodeStyle = node.style;\n if (typeof value === \"string\") return (nodeStyle.cssText = value);\n typeof prev === \"string\" && (nodeStyle.cssText = prev = undefined);\n prev || (prev = {});\n value || (value = {});\n let v, s;\n for (s in prev) {\n value[s] == null && nodeStyle.removeProperty(s);\n delete prev[s];\n }\n for (s in value) {\n v = value[s];\n if (v !== prev[s]) {\n nodeStyle.setProperty(s, v);\n prev[s] = v;\n }\n }\n return prev;\n}\nfunction spread(node, props = {}, isSVG, skipChildren) {\n const prevProps = {};\n if (!skipChildren) {\n createRenderEffect(\n () => (prevProps.children = insertExpression(node, props.children, prevProps.children))\n );\n }\n createRenderEffect(() => props.ref && props.ref(node));\n createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));\n return prevProps;\n}\nfunction dynamicProperty(props, key) {\n const src = props[key];\n Object.defineProperty(props, key, {\n get() {\n return src();\n },\n enumerable: true\n });\n return props;\n}\nfunction use(fn, element, arg) {\n return untrack(() => fn(element, arg));\n}\nfunction insert(parent, accessor, marker, initial) {\n if (marker !== undefined && !initial) initial = [];\n if (typeof accessor !== \"function\") return insertExpression(parent, accessor, initial, marker);\n createRenderEffect(current => insertExpression(parent, accessor(), current, marker), initial);\n}\nfunction assign(node, props, isSVG, skipChildren, prevProps = {}, skipRef = false) {\n props || (props = {});\n for (const prop in prevProps) {\n if (!(prop in props)) {\n if (prop === \"children\") continue;\n prevProps[prop] = assignProp(node, prop, null, prevProps[prop], isSVG, skipRef);\n }\n }\n for (const prop in props) {\n if (prop === \"children\") {\n if (!skipChildren) insertExpression(node, props.children);\n continue;\n }\n const value = props[prop];\n prevProps[prop] = assignProp(node, prop, value, prevProps[prop], isSVG, skipRef);\n }\n}\nfunction hydrate$1(code, element, options = {}) {\n sharedConfig.completed = globalThis._$HY.completed;\n sharedConfig.events = globalThis._$HY.events;\n sharedConfig.load = id => globalThis._$HY.r[id];\n sharedConfig.has = id => id in globalThis._$HY.r;\n sharedConfig.gather = root => gatherHydratable(element, root);\n sharedConfig.registry = new Map();\n sharedConfig.context = {\n id: options.renderId || \"\",\n count: 0\n };\n gatherHydratable(element, options.renderId);\n const dispose = render(code, element, [...element.childNodes], options);\n sharedConfig.context = null;\n return dispose;\n}\nfunction getNextElement(template) {\n let node, key;\n if (!sharedConfig.context || !(node = sharedConfig.registry.get((key = getHydrationKey())))) {\n return template();\n }\n if (sharedConfig.completed) sharedConfig.completed.add(node);\n sharedConfig.registry.delete(key);\n return node;\n}\nfunction getNextMatch(el, nodeName) {\n while (el && el.localName !== nodeName) el = el.nextSibling;\n return el;\n}\nfunction getNextMarker(start) {\n let end = start,\n count = 0,\n current = [];\n if (sharedConfig.context) {\n while (end) {\n if (end.nodeType === 8) {\n const v = end.nodeValue;\n if (v === \"$\") count++;\n else if (v === \"/\") {\n if (count === 0) return [end, current];\n count--;\n }\n }\n current.push(end);\n end = end.nextSibling;\n }\n }\n return [end, current];\n}\nfunction runHydrationEvents() {\n if (sharedConfig.events && !sharedConfig.events.queued) {\n queueMicrotask(() => {\n const { completed, events } = sharedConfig;\n events.queued = false;\n while (events.length) {\n const [el, e] = events[0];\n if (!completed.has(el)) return;\n eventHandler(e);\n events.shift();\n }\n });\n sharedConfig.events.queued = true;\n }\n}\nfunction toPropertyName(name) {\n return name.toLowerCase().replace(/-([a-z])/g, (_, w) => w.toUpperCase());\n}\nfunction toggleClassKey(node, key, value) {\n const classNames = key.trim().split(/\\s+/);\n for (let i = 0, nameLen = classNames.length; i < nameLen; i++)\n node.classList.toggle(classNames[i], value);\n}\nfunction assignProp(node, prop, value, prev, isSVG, skipRef) {\n let isCE, isProp, isChildProp, propAlias, forceProp;\n if (prop === \"style\") return style(node, value, prev);\n if (prop === \"classList\") return classList(node, value, prev);\n if (value === prev) return prev;\n if (prop === \"ref\") {\n if (!skipRef) value(node);\n } else if (prop.slice(0, 3) === \"on:\") {\n const e = prop.slice(3);\n prev && node.removeEventListener(e, prev);\n value && node.addEventListener(e, value);\n } else if (prop.slice(0, 10) === \"oncapture:\") {\n const e = prop.slice(10);\n prev && node.removeEventListener(e, prev, true);\n value && node.addEventListener(e, value, true);\n } else if (prop.slice(0, 2) === \"on\") {\n const name = prop.slice(2).toLowerCase();\n const delegate = DelegatedEvents.has(name);\n if (!delegate && prev) {\n const h = Array.isArray(prev) ? prev[0] : prev;\n node.removeEventListener(name, h);\n }\n if (delegate || value) {\n addEventListener(node, name, value, delegate);\n delegate && delegateEvents([name]);\n }\n } else if (prop.slice(0, 5) === \"attr:\") {\n setAttribute(node, prop.slice(5), value);\n } else if (\n (forceProp = prop.slice(0, 5) === \"prop:\") ||\n (isChildProp = ChildProperties.has(prop)) ||\n (!isSVG &&\n ((propAlias = getPropAlias(prop, node.tagName)) || (isProp = Properties.has(prop)))) ||\n (isCE = node.nodeName.includes(\"-\"))\n ) {\n if (forceProp) {\n prop = prop.slice(5);\n isProp = true;\n } else if (!!sharedConfig.context && node.isConnected) return value;\n if (prop === \"class\" || prop === \"className\") className(node, value);\n else if (isCE && !isProp && !isChildProp) node[toPropertyName(prop)] = value;\n else node[propAlias || prop] = value;\n } else {\n const ns = isSVG && prop.indexOf(\":\") > -1 && SVGNamespace[prop.split(\":\")[0]];\n if (ns) setAttributeNS(node, ns, prop, value);\n else setAttribute(node, Aliases[prop] || prop, value);\n }\n return value;\n}\nfunction eventHandler(e) {\n const key = `$$${e.type}`;\n let node = (e.composedPath && e.composedPath()[0]) || e.target;\n if (e.target !== node) {\n Object.defineProperty(e, \"target\", {\n configurable: true,\n value: node\n });\n }\n Object.defineProperty(e, \"currentTarget\", {\n configurable: true,\n get() {\n return node || document;\n }\n });\n if (sharedConfig.registry && !sharedConfig.done) sharedConfig.done = _$HY.done = true;\n while (node) {\n const handler = node[key];\n if (handler && !node.disabled) {\n const data = node[`${key}Data`];\n data !== undefined ? handler.call(node, data, e) : handler.call(node, e);\n if (e.cancelBubble) return;\n }\n node = node._$host || node.parentNode || node.host;\n }\n}\nfunction insertExpression(parent, value, current, marker, unwrapArray) {\n const hydrating = !!sharedConfig.context && parent.isConnected;\n if (hydrating) {\n !current && (current = [...parent.childNodes]);\n let cleaned = [];\n for (let i = 0; i < current.length; i++) {\n const node = current[i];\n if (node.nodeType === 8 && node.data.slice(0, 2) === \"!$\") node.remove();\n else cleaned.push(node);\n }\n current = cleaned;\n }\n while (typeof current === \"function\") current = current();\n if (value === current) return current;\n const t = typeof value,\n multi = marker !== undefined;\n parent = (multi && current[0] && current[0].parentNode) || parent;\n if (t === \"string\" || t === \"number\") {\n if (hydrating) return current;\n if (t === \"number\") value = value.toString();\n if (multi) {\n let node = current[0];\n if (node && node.nodeType === 3) {\n node.data !== value && (node.data = value);\n } else node = document.createTextNode(value);\n current = cleanChildren(parent, current, marker, node);\n } else {\n if (current !== \"\" && typeof current === \"string\") {\n current = parent.firstChild.data = value;\n } else current = parent.textContent = value;\n }\n } else if (value == null || t === \"boolean\") {\n if (hydrating) return current;\n current = cleanChildren(parent, current, marker);\n } else if (t === \"function\") {\n createRenderEffect(() => {\n let v = value();\n while (typeof v === \"function\") v = v();\n current = insertExpression(parent, v, current, marker);\n });\n return () => current;\n } else if (Array.isArray(value)) {\n const array = [];\n const currentArray = current && Array.isArray(current);\n if (normalizeIncomingArray(array, value, current, unwrapArray)) {\n createRenderEffect(() => (current = insertExpression(parent, array, current, marker, true)));\n return () => current;\n }\n if (hydrating) {\n if (!array.length) return current;\n if (marker === undefined) return [...parent.childNodes];\n let node = array[0];\n let nodes = [node];\n while ((node = node.nextSibling) !== marker) nodes.push(node);\n return (current = nodes);\n }\n if (array.length === 0) {\n current = cleanChildren(parent, current, marker);\n if (multi) return current;\n } else if (currentArray) {\n if (current.length === 0) {\n appendNodes(parent, array, marker);\n } else reconcileArrays(parent, current, array);\n } else {\n current && cleanChildren(parent);\n appendNodes(parent, array);\n }\n current = array;\n } else if (value.nodeType) {\n if (hydrating && value.parentNode) return (current = multi ? [value] : value);\n if (Array.isArray(current)) {\n if (multi) return (current = cleanChildren(parent, current, marker, value));\n cleanChildren(parent, current, null, value);\n } else if (current == null || current === \"\" || !parent.firstChild) {\n parent.appendChild(value);\n } else parent.replaceChild(value, parent.firstChild);\n current = value;\n } else;\n return current;\n}\nfunction normalizeIncomingArray(normalized, array, current, unwrap) {\n let dynamic = false;\n for (let i = 0, len = array.length; i < len; i++) {\n let item = array[i],\n prev = current && current[normalized.length],\n t;\n if (item == null || item === true || item === false);\n else if ((t = typeof item) === \"object\" && item.nodeType) {\n normalized.push(item);\n } else if (Array.isArray(item)) {\n dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic;\n } else if (t === \"function\") {\n if (unwrap) {\n while (typeof item === \"function\") item = item();\n dynamic =\n normalizeIncomingArray(\n normalized,\n Array.isArray(item) ? item : [item],\n Array.isArray(prev) ? prev : [prev]\n ) || dynamic;\n } else {\n normalized.push(item);\n dynamic = true;\n }\n } else {\n const value = String(item);\n if (prev && prev.nodeType === 3 && prev.data === value) normalized.push(prev);\n else normalized.push(document.createTextNode(value));\n }\n }\n return dynamic;\n}\nfunction appendNodes(parent, array, marker = null) {\n for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker);\n}\nfunction cleanChildren(parent, current, marker, replacement) {\n if (marker === undefined) return (parent.textContent = \"\");\n const node = replacement || document.createTextNode(\"\");\n if (current.length) {\n let inserted = false;\n for (let i = current.length - 1; i >= 0; i--) {\n const el = current[i];\n if (node !== el) {\n const isParent = el.parentNode === parent;\n if (!inserted && !i)\n isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);\n else isParent && el.remove();\n } else inserted = true;\n }\n } else parent.insertBefore(node, marker);\n return [node];\n}\nfunction gatherHydratable(element, root) {\n const templates = element.querySelectorAll(`*[data-hk]`);\n for (let i = 0; i < templates.length; i++) {\n const node = templates[i];\n const key = node.getAttribute(\"data-hk\");\n if ((!root || key.startsWith(root)) && !sharedConfig.registry.has(key))\n sharedConfig.registry.set(key, node);\n }\n}\nfunction getHydrationKey() {\n const hydrate = sharedConfig.context;\n return `${hydrate.id}${hydrate.count++}`;\n}\nfunction NoHydration(props) {\n return sharedConfig.context ? undefined : props.children;\n}\nfunction Hydration(props) {\n return props.children;\n}\nconst voidFn = () => undefined;\nconst RequestContext = Symbol();\nfunction innerHTML(parent, content) {\n !sharedConfig.context && (parent.innerHTML = content);\n}\n\nfunction throwInBrowser(func) {\n const err = new Error(`${func.name} is not supported in the browser, returning undefined`);\n console.error(err);\n}\nfunction renderToString(fn, options) {\n throwInBrowser(renderToString);\n}\nfunction renderToStringAsync(fn, options) {\n throwInBrowser(renderToStringAsync);\n}\nfunction renderToStream(fn, options) {\n throwInBrowser(renderToStream);\n}\nfunction ssr(template, ...nodes) {}\nfunction ssrElement(name, props, children, needsId) {}\nfunction ssrClassList(value) {}\nfunction ssrStyle(value) {}\nfunction ssrAttribute(key, value) {}\nfunction ssrHydrationKey() {}\nfunction resolveSSRNode(node) {}\nfunction escape(html) {}\nfunction ssrSpread(props, isSVG, skipChildren) {}\n\nconst isServer = false;\nconst isDev = false;\nconst SVG_NAMESPACE = \"http://www.w3.org/2000/svg\";\nfunction createElement(tagName, isSVG = false) {\n return isSVG ? document.createElementNS(SVG_NAMESPACE, tagName) : document.createElement(tagName);\n}\nconst hydrate = (...args) => {\n enableHydration();\n return hydrate$1(...args);\n};\nfunction Portal(props) {\n const { useShadow } = props,\n marker = document.createTextNode(\"\"),\n mount = () => props.mount || document.body,\n owner = getOwner();\n let content;\n let hydrating = !!sharedConfig.context;\n createEffect(\n () => {\n if (hydrating) getOwner().user = hydrating = false;\n content || (content = runWithOwner(owner, () => createMemo(() => props.children)));\n const el = mount();\n if (el instanceof HTMLHeadElement) {\n const [clean, setClean] = createSignal(false);\n const cleanup = () => setClean(true);\n createRoot(dispose => insert(el, () => (!clean() ? content() : dispose()), null));\n onCleanup(cleanup);\n } else {\n const container = createElement(props.isSVG ? \"g\" : \"div\", props.isSVG),\n renderRoot =\n useShadow && container.attachShadow\n ? container.attachShadow({\n mode: \"open\"\n })\n : container;\n Object.defineProperty(container, \"_$host\", {\n get() {\n return marker.parentNode;\n },\n configurable: true\n });\n insert(renderRoot, content);\n el.appendChild(container);\n props.ref && props.ref(container);\n onCleanup(() => el.removeChild(container));\n }\n },\n undefined,\n {\n render: !hydrating\n }\n );\n return marker;\n}\nfunction Dynamic(props) {\n const [p, others] = splitProps(props, [\"component\"]);\n const cached = createMemo(() => p.component);\n return createMemo(() => {\n const component = cached();\n switch (typeof component) {\n case \"function\":\n return untrack(() => component(others));\n case \"string\":\n const isSvg = SVGElements.has(component);\n const el = sharedConfig.context ? getNextElement() : createElement(component, isSvg);\n spread(el, others, isSvg);\n return el;\n }\n });\n}\n\nexport {\n Aliases,\n voidFn as Assets,\n ChildProperties,\n DOMElements,\n DelegatedEvents,\n Dynamic,\n Hydration,\n voidFn as HydrationScript,\n NoHydration,\n Portal,\n Properties,\n RequestContext,\n SVGElements,\n SVGNamespace,\n addEventListener,\n assign,\n classList,\n className,\n clearDelegatedEvents,\n delegateEvents,\n dynamicProperty,\n escape,\n voidFn as generateHydrationScript,\n voidFn as getAssets,\n getHydrationKey,\n getNextElement,\n getNextMarker,\n getNextMatch,\n getPropAlias,\n voidFn as getRequestEvent,\n hydrate,\n innerHTML,\n insert,\n isDev,\n isServer,\n render,\n renderToStream,\n renderToString,\n renderToStringAsync,\n resolveSSRNode,\n runHydrationEvents,\n setAttribute,\n setAttributeNS,\n setProperty,\n spread,\n ssr,\n ssrAttribute,\n ssrClassList,\n ssrElement,\n ssrHydrationKey,\n ssrSpread,\n ssrStyle,\n style,\n template,\n use,\n voidFn as useAssets\n};\n","import { isServer } from \"solid-js/web\";\nexport function createBeforeLeave() {\n let listeners = new Set();\n function subscribe(listener) {\n listeners.add(listener);\n return () => listeners.delete(listener);\n }\n let ignore = false;\n function confirm(to, options) {\n if (ignore)\n return !(ignore = false);\n const e = {\n to,\n options,\n defaultPrevented: false,\n preventDefault: () => (e.defaultPrevented = true)\n };\n for (const l of listeners)\n l.listener({\n ...e,\n from: l.location,\n retry: (force) => {\n force && (ignore = true);\n l.navigate(to, { ...options, resolve: false });\n }\n });\n return !e.defaultPrevented;\n }\n return {\n subscribe,\n confirm\n };\n}\n// The following supports browser initiated blocking (eg back/forward)\nlet depth;\nexport function saveCurrentDepth() {\n if (!window.history.state || window.history.state._depth == null) {\n window.history.replaceState({ ...window.history.state, _depth: window.history.length - 1 }, \"\");\n }\n depth = window.history.state._depth;\n}\nif (!isServer) {\n saveCurrentDepth();\n}\nexport function keepDepth(state) {\n return {\n ...state,\n _depth: window.history.state && window.history.state._depth\n };\n}\nexport function notifyIfNotBlocked(notify, block) {\n let ignore = false;\n return () => {\n const prevDepth = depth;\n saveCurrentDepth();\n const delta = prevDepth == null ? null : depth - prevDepth;\n if (ignore) {\n ignore = false;\n return;\n }\n if (delta && block(delta)) {\n ignore = true;\n window.history.go(-delta);\n }\n else {\n notify();\n }\n };\n}\n","import { createMemo, getOwner, runWithOwner } from \"solid-js\";\nconst hasSchemeRegex = /^(?:[a-z0-9]+:)?\\/\\//i;\nconst trimPathRegex = /^\\/+|(\\/)\\/+$/g;\nexport const mockBase = \"http://sr\";\nexport function normalizePath(path, omitSlash = false) {\n const s = path.replace(trimPathRegex, \"$1\");\n return s ? (omitSlash || /^[?#]/.test(s) ? s : \"/\" + s) : \"\";\n}\nexport function resolvePath(base, path, from) {\n if (hasSchemeRegex.test(path)) {\n return undefined;\n }\n const basePath = normalizePath(base);\n const fromPath = from && normalizePath(from);\n let result = \"\";\n if (!fromPath || path.startsWith(\"/\")) {\n result = basePath;\n }\n else if (fromPath.toLowerCase().indexOf(basePath.toLowerCase()) !== 0) {\n result = basePath + fromPath;\n }\n else {\n result = fromPath;\n }\n return (result || \"/\") + normalizePath(path, !result);\n}\nexport function invariant(value, message) {\n if (value == null) {\n throw new Error(message);\n }\n return value;\n}\nexport function joinPaths(from, to) {\n return normalizePath(from).replace(/\\/*(\\*.*)?$/g, \"\") + normalizePath(to);\n}\nexport function extractSearchParams(url) {\n const params = {};\n url.searchParams.forEach((value, key) => {\n params[key] = value;\n });\n return params;\n}\nexport function createMatcher(path, partial, matchFilters) {\n const [pattern, splat] = path.split(\"/*\", 2);\n const segments = pattern.split(\"/\").filter(Boolean);\n const len = segments.length;\n return (location) => {\n const locSegments = location.split(\"/\").filter(Boolean);\n const lenDiff = locSegments.length - len;\n if (lenDiff < 0 || (lenDiff > 0 && splat === undefined && !partial)) {\n return null;\n }\n const match = {\n path: len ? \"\" : \"/\",\n params: {}\n };\n const matchFilter = (s) => matchFilters === undefined ? undefined : matchFilters[s];\n for (let i = 0; i < len; i++) {\n const segment = segments[i];\n const locSegment = locSegments[i];\n const dynamic = segment[0] === \":\";\n const key = dynamic ? segment.slice(1) : segment;\n if (dynamic && matchSegment(locSegment, matchFilter(key))) {\n match.params[key] = locSegment;\n }\n else if (dynamic || !matchSegment(locSegment, segment)) {\n return null;\n }\n match.path += `/${locSegment}`;\n }\n if (splat) {\n const remainder = lenDiff ? locSegments.slice(-lenDiff).join(\"/\") : \"\";\n if (matchSegment(remainder, matchFilter(splat))) {\n match.params[splat] = remainder;\n }\n else {\n return null;\n }\n }\n return match;\n };\n}\nfunction matchSegment(input, filter) {\n const isEqual = (s) => s.localeCompare(input, undefined, { sensitivity: \"base\" }) === 0;\n if (filter === undefined) {\n return true;\n }\n else if (typeof filter === \"string\") {\n return isEqual(filter);\n }\n else if (typeof filter === \"function\") {\n return filter(input);\n }\n else if (Array.isArray(filter)) {\n return filter.some(isEqual);\n }\n else if (filter instanceof RegExp) {\n return filter.test(input);\n }\n return false;\n}\nexport function scoreRoute(route) {\n const [pattern, splat] = route.pattern.split(\"/*\", 2);\n const segments = pattern.split(\"/\").filter(Boolean);\n return segments.reduce((score, segment) => score + (segment.startsWith(\":\") ? 2 : 3), segments.length - (splat === undefined ? 0 : 1));\n}\nexport function createMemoObject(fn) {\n const map = new Map();\n const owner = getOwner();\n return new Proxy({}, {\n get(_, property) {\n if (!map.has(property)) {\n runWithOwner(owner, () => map.set(property, createMemo(() => fn()[property])));\n }\n return map.get(property)();\n },\n getOwnPropertyDescriptor() {\n return {\n enumerable: true,\n configurable: true\n };\n },\n ownKeys() {\n return Reflect.ownKeys(fn());\n }\n });\n}\nexport function mergeSearchString(search, params) {\n const merged = new URLSearchParams(search);\n Object.entries(params).forEach(([key, value]) => {\n if (value == null || value === \"\") {\n merged.delete(key);\n }\n else {\n merged.set(key, String(value));\n }\n });\n const s = merged.toString();\n return s ? `?${s}` : \"\";\n}\nexport function expandOptionals(pattern) {\n let match = /(\\/?\\:[^\\/]+)\\?/.exec(pattern);\n if (!match)\n return [pattern];\n let prefix = pattern.slice(0, match.index);\n let suffix = pattern.slice(match.index + match[0].length);\n const prefixes = [prefix, (prefix += match[1])];\n // This section handles adjacent optional params. We don't actually want all permuations since\n // that will lead to equivalent routes which have the same number of params. For example\n // `/:a?/:b?/:c`? only has the unique expansion: `/`, `/:a`, `/:a/:b`, `/:a/:b/:c` and we can\n // discard `/:b`, `/:c`, `/:b/:c` by building them up in order and not recursing. This also helps\n // ensure predictability where earlier params have precidence.\n while ((match = /^(\\/\\:[^\\/]+)\\?/.exec(suffix))) {\n prefixes.push((prefix += match[1]));\n suffix = suffix.slice(match[0].length);\n }\n return expandOptionals(suffix).reduce((results, expansion) => [...results, ...prefixes.map(p => p + expansion)], []);\n}\n","import { runWithOwner } from \"solid-js\";\nimport { createComponent, createContext, createMemo, createRenderEffect, createSignal, on, onCleanup, untrack, useContext, startTransition, resetErrorBoundaries } from \"solid-js\";\nimport { isServer, getRequestEvent } from \"solid-js/web\";\nimport { createBeforeLeave } from \"./lifecycle.js\";\nimport { mockBase, createMemoObject, extractSearchParams, invariant, resolvePath, createMatcher, joinPaths, scoreRoute, mergeSearchString, expandOptionals } from \"./utils.js\";\nconst MAX_REDIRECTS = 100;\nexport const RouterContextObj = createContext();\nexport const RouteContextObj = createContext();\nexport const useRouter = () => invariant(useContext(RouterContextObj), \" and 'use' router primitives can be only used inside a Route.\");\nlet TempRoute;\nexport const useRoute = () => TempRoute || useContext(RouteContextObj) || useRouter().base;\nexport const useResolvedPath = (path) => {\n const route = useRoute();\n return createMemo(() => route.resolvePath(path()));\n};\nexport const useHref = (to) => {\n const router = useRouter();\n return createMemo(() => {\n const to_ = to();\n return to_ !== undefined ? router.renderPath(to_) : to_;\n });\n};\nexport const useNavigate = () => useRouter().navigatorFactory();\nexport const useLocation = () => useRouter().location;\nexport const useIsRouting = () => useRouter().isRouting;\nexport const useMatch = (path, matchFilters) => {\n const location = useLocation();\n const matchers = createMemo(() => expandOptionals(path()).map(path => createMatcher(path, undefined, matchFilters)));\n return createMemo(() => {\n for (const matcher of matchers()) {\n const match = matcher(location.pathname);\n if (match)\n return match;\n }\n });\n};\nexport const useParams = () => useRouter().params;\nexport const useSearchParams = () => {\n const location = useLocation();\n const navigate = useNavigate();\n const setSearchParams = (params, options) => {\n const searchString = untrack(() => location.pathname + mergeSearchString(location.search, params) + location.hash);\n navigate(searchString, {\n scroll: false,\n resolve: false,\n ...options\n });\n };\n return [location.query, setSearchParams];\n};\nexport const useBeforeLeave = (listener) => {\n const s = useRouter().beforeLeave.subscribe({\n listener,\n location: useLocation(),\n navigate: useNavigate()\n });\n onCleanup(s);\n};\nexport function createRoutes(routeDef, base = \"\") {\n const { component, load, children, info } = routeDef;\n const isLeaf = !children || (Array.isArray(children) && !children.length);\n const shared = {\n key: routeDef,\n component,\n load,\n info\n };\n return asArray(routeDef.path).reduce((acc, path) => {\n for (const originalPath of expandOptionals(path)) {\n const path = joinPaths(base, originalPath);\n let pattern = isLeaf ? path : path.split(\"/*\", 1)[0];\n pattern = pattern\n .split(\"/\")\n .map((s) => {\n return s.startsWith(\":\") || s.startsWith(\"*\") ? s : encodeURIComponent(s);\n })\n .join(\"/\");\n acc.push({\n ...shared,\n originalPath,\n pattern,\n matcher: createMatcher(pattern, !isLeaf, routeDef.matchFilters)\n });\n }\n return acc;\n }, []);\n}\nexport function createBranch(routes, index = 0) {\n return {\n routes,\n score: scoreRoute(routes[routes.length - 1]) * 10000 - index,\n matcher(location) {\n const matches = [];\n for (let i = routes.length - 1; i >= 0; i--) {\n const route = routes[i];\n const match = route.matcher(location);\n if (!match) {\n return null;\n }\n matches.unshift({\n ...match,\n route\n });\n }\n return matches;\n }\n };\n}\nfunction asArray(value) {\n return Array.isArray(value) ? value : [value];\n}\nexport function createBranches(routeDef, base = \"\", stack = [], branches = []) {\n const routeDefs = asArray(routeDef);\n for (let i = 0, len = routeDefs.length; i < len; i++) {\n const def = routeDefs[i];\n if (def && typeof def === \"object\") {\n if (!def.hasOwnProperty(\"path\"))\n def.path = \"\";\n const routes = createRoutes(def, base);\n for (const route of routes) {\n stack.push(route);\n const isEmptyArray = Array.isArray(def.children) && def.children.length === 0;\n if (def.children && !isEmptyArray) {\n createBranches(def.children, route.pattern, stack, branches);\n }\n else {\n const branch = createBranch([...stack], branches.length);\n branches.push(branch);\n }\n stack.pop();\n }\n }\n }\n // Stack will be empty on final return\n return stack.length ? branches : branches.sort((a, b) => b.score - a.score);\n}\nexport function getRouteMatches(branches, location) {\n for (let i = 0, len = branches.length; i < len; i++) {\n const match = branches[i].matcher(location);\n if (match) {\n return match;\n }\n }\n return [];\n}\nexport function createLocation(path, state) {\n const origin = new URL(mockBase);\n const url = createMemo(prev => {\n const path_ = path();\n try {\n return new URL(path_, origin);\n }\n catch (err) {\n console.error(`Invalid path ${path_}`);\n return prev;\n }\n }, origin, {\n equals: (a, b) => a.href === b.href\n });\n const pathname = createMemo(() => url().pathname);\n const search = createMemo(() => url().search, true);\n const hash = createMemo(() => url().hash);\n const key = () => \"\";\n return {\n get pathname() {\n return pathname();\n },\n get search() {\n return search();\n },\n get hash() {\n return hash();\n },\n get state() {\n return state();\n },\n get key() {\n return key();\n },\n query: createMemoObject(on(search, () => extractSearchParams(url())))\n };\n}\nlet intent;\nexport function getIntent() {\n return intent;\n}\nexport function createRouterContext(integration, branches, getContext, options = {}) {\n const { signal: [source, setSource], utils = {} } = integration;\n const parsePath = utils.parsePath || (p => p);\n const renderPath = utils.renderPath || (p => p);\n const beforeLeave = utils.beforeLeave || createBeforeLeave();\n const basePath = resolvePath(\"\", options.base || \"\");\n if (basePath === undefined) {\n throw new Error(`${basePath} is not a valid base path`);\n }\n else if (basePath && !source().value) {\n setSource({ value: basePath, replace: true, scroll: false });\n }\n const [isRouting, setIsRouting] = createSignal(false);\n const start = async (callback) => {\n setIsRouting(true);\n try {\n await startTransition(callback);\n }\n finally {\n setIsRouting(false);\n }\n };\n const [reference, setReference] = createSignal(source().value);\n const [state, setState] = createSignal(source().state);\n const location = createLocation(reference, state);\n const referrers = [];\n const submissions = createSignal(isServer ? initFromFlash() : []);\n const matches = createMemo(() => getRouteMatches(branches(), location.pathname));\n const params = createMemoObject(() => {\n const m = matches();\n const params = {};\n for (let i = 0; i < m.length; i++) {\n Object.assign(params, m[i].params);\n }\n return params;\n });\n const baseRoute = {\n pattern: basePath,\n path: () => basePath,\n outlet: () => null,\n resolvePath(to) {\n return resolvePath(basePath, to);\n }\n };\n createRenderEffect(() => {\n const { value, state } = source();\n // Untrack this whole block so `start` doesn't cause Solid's Listener to be preserved\n untrack(() => {\n if (value !== reference()) {\n start(() => {\n intent = \"native\";\n setReference(value);\n setState(state);\n resetErrorBoundaries();\n submissions[1]([]);\n }).then(() => {\n intent = undefined;\n });\n }\n });\n });\n return {\n base: baseRoute,\n location,\n params,\n isRouting,\n renderPath,\n parsePath,\n navigatorFactory,\n matches,\n beforeLeave,\n preloadRoute,\n singleFlight: options.singleFlight === undefined ? true : options.singleFlight,\n submissions\n };\n function navigateFromRoute(route, to, options) {\n // Untrack in case someone navigates in an effect - don't want to track `reference` or route paths\n untrack(() => {\n if (typeof to === \"number\") {\n if (!to) {\n // A delta of 0 means stay at the current location, so it is ignored\n }\n else if (utils.go) {\n utils.go(to);\n }\n else {\n console.warn(\"Router integration does not support relative routing\");\n }\n return;\n }\n const { replace, resolve, scroll, state: nextState } = {\n replace: false,\n resolve: true,\n scroll: true,\n ...options\n };\n const resolvedTo = resolve ? route.resolvePath(to) : resolvePath(\"\", to);\n if (resolvedTo === undefined) {\n throw new Error(`Path '${to}' is not a routable path`);\n }\n else if (referrers.length >= MAX_REDIRECTS) {\n throw new Error(\"Too many redirects\");\n }\n const current = reference();\n if (resolvedTo !== current || nextState !== state()) {\n if (isServer) {\n const e = getRequestEvent();\n e && (e.response = { status: 302, headers: new Headers({ Location: resolvedTo }) });\n setSource({ value: resolvedTo, replace, scroll, state: nextState });\n }\n else if (beforeLeave.confirm(resolvedTo, options)) {\n const len = referrers.push({ value: current, replace, scroll, state: state() });\n start(() => {\n intent = \"navigate\";\n setReference(resolvedTo);\n setState(nextState);\n resetErrorBoundaries();\n submissions[1]([]);\n }).then(() => {\n if (referrers.length === len) {\n intent = undefined;\n navigateEnd({\n value: resolvedTo,\n state: nextState\n });\n }\n });\n }\n }\n });\n }\n function navigatorFactory(route) {\n // Workaround for vite issue (https://github.com/vitejs/vite/issues/3803)\n route = route || useContext(RouteContextObj) || baseRoute;\n return (to, options) => navigateFromRoute(route, to, options);\n }\n function navigateEnd(next) {\n const first = referrers[0];\n if (first) {\n if (next.value !== first.value || next.state !== first.state) {\n setSource({\n ...next,\n replace: first.replace,\n scroll: first.scroll\n });\n }\n referrers.length = 0;\n }\n }\n function preloadRoute(url, preloadData) {\n const matches = getRouteMatches(branches(), url.pathname);\n const prevIntent = intent;\n intent = \"preload\";\n for (let match in matches) {\n const { route, params } = matches[match];\n route.component &&\n route.component.preload &&\n route.component.preload();\n const { load } = route;\n preloadData &&\n load &&\n runWithOwner(getContext(), () => load({\n params,\n location: {\n pathname: url.pathname,\n search: url.search,\n hash: url.hash,\n query: extractSearchParams(url),\n state: null,\n key: \"\"\n },\n intent: \"preload\"\n }));\n }\n intent = prevIntent;\n }\n function initFromFlash() {\n const e = getRequestEvent();\n return (e && e.router && e.router.submission\n ? [e.router.submission]\n : []);\n }\n}\nexport function createRouteContext(router, parent, outlet, match) {\n const { base, location, params } = router;\n const { pattern, component, load } = match().route;\n const path = createMemo(() => match().path);\n component &&\n component.preload &&\n component.preload();\n const data = load ? load({ params, location, intent: intent || \"initial\" }) : undefined;\n const route = {\n parent,\n pattern,\n path,\n outlet: () => component\n ? createComponent(component, {\n params,\n location,\n data,\n get children() {\n return outlet();\n }\n })\n : outlet(),\n resolvePath(to) {\n return resolvePath(base.path(), to, path());\n }\n };\n return route;\n}\n","/*@refresh skip*/\nimport { getRequestEvent, isServer } from \"solid-js/web\";\nimport { children, createMemo, createRoot, getOwner, mergeProps, on, Show, untrack } from \"solid-js\";\nimport { createBranches, createRouteContext, createRouterContext, getRouteMatches, RouteContextObj, RouterContextObj } from \"../routing.js\";\nexport const createRouterComponent = (router) => (props) => {\n const { base } = props;\n const routeDefs = children(() => props.children);\n const branches = createMemo(() => createBranches(routeDefs(), props.base || \"\"));\n let context;\n const routerState = createRouterContext(router, branches, () => context, {\n base,\n singleFlight: props.singleFlight\n });\n router.create && router.create(routerState);\n return (\n \n {(context = getOwner()) && null}\n \n \n );\n};\nfunction Root(props) {\n const location = props.routerState.location;\n const params = props.routerState.params;\n const data = createMemo(() => props.load && untrack(() => props.load({ params, location, intent: \"preload\" })));\n return (\n {Root => (\n {props.children}\n )}\n );\n}\nfunction Routes(props) {\n if (isServer) {\n const e = getRequestEvent();\n if (e && e.router && e.router.dataOnly) {\n dataOnly(e, props.routerState, props.branches);\n return;\n }\n e &&\n ((e.router || (e.router = {})).matches ||\n (e.router.matches = props.routerState.matches().map(({ route, path, params }) => ({\n path: route.originalPath,\n pattern: route.pattern,\n match: path,\n params,\n info: route.info\n }))));\n }\n const disposers = [];\n let root;\n const routeStates = createMemo(on(props.routerState.matches, (nextMatches, prevMatches, prev) => {\n let equal = prevMatches && nextMatches.length === prevMatches.length;\n const next = [];\n for (let i = 0, len = nextMatches.length; i < len; i++) {\n const prevMatch = prevMatches && prevMatches[i];\n const nextMatch = nextMatches[i];\n if (prev && prevMatch && nextMatch.route.key === prevMatch.route.key) {\n next[i] = prev[i];\n }\n else {\n equal = false;\n if (disposers[i]) {\n disposers[i]();\n }\n createRoot(dispose => {\n disposers[i] = dispose;\n next[i] = createRouteContext(props.routerState, next[i - 1] || props.routerState.base, createOutlet(() => routeStates()[i + 1]), () => props.routerState.matches()[i]);\n });\n }\n }\n disposers.splice(nextMatches.length).forEach(dispose => dispose());\n if (prev && equal) {\n return prev;\n }\n root = next[0];\n return next;\n }));\n return createOutlet(() => routeStates() && root)();\n}\nconst createOutlet = (child) => {\n return () => (\n {child => {child.outlet()}}\n );\n};\nexport const Route = (props) => {\n const childRoutes = children(() => props.children);\n return mergeProps(props, {\n get children() {\n return childRoutes();\n }\n });\n};\n// for data only mode with single flight mutations\nfunction dataOnly(event, routerState, branches) {\n const url = new URL(event.request.url);\n const prevMatches = getRouteMatches(branches, new URL(event.router.previousUrl || event.request.url).pathname);\n const matches = getRouteMatches(branches, url.pathname);\n for (let match = 0; match < matches.length; match++) {\n if (!prevMatches[match] || matches[match].route !== prevMatches[match].route)\n event.router.dataOnly = true;\n const { route, params } = matches[match];\n route.load &&\n route.load({\n params,\n location: routerState.location,\n intent: \"preload\"\n });\n }\n}\n","import { createSignal, onCleanup } from \"solid-js\";\nimport { createRouterComponent } from \"./components.jsx\";\nfunction intercept([value, setValue], get, set) {\n return [get ? () => get(value()) : value, set ? (v) => setValue(set(v)) : setValue];\n}\nfunction querySelector(selector) {\n if (selector === \"#\") {\n return null;\n }\n // Guard against selector being an invalid CSS selector\n try {\n return document.querySelector(selector);\n }\n catch (e) {\n return null;\n }\n}\nexport function createRouter(config) {\n let ignore = false;\n const wrap = (value) => (typeof value === \"string\" ? { value } : value);\n const signal = intercept(createSignal(wrap(config.get()), { equals: (a, b) => a.value === b.value }), undefined, next => {\n !ignore && config.set(next);\n return next;\n });\n config.init &&\n onCleanup(config.init((value = config.get()) => {\n ignore = true;\n signal[1](wrap(value));\n ignore = false;\n }));\n return createRouterComponent({\n signal,\n create: config.create,\n utils: config.utils\n });\n}\nexport function bindEvent(target, type, handler) {\n target.addEventListener(type, handler);\n return () => target.removeEventListener(type, handler);\n}\nexport function scrollToHash(hash, fallbackTop) {\n const el = querySelector(`#${hash}`);\n if (el) {\n el.scrollIntoView();\n }\n else if (fallbackTop) {\n window.scrollTo(0, 0);\n }\n}\n","import { $TRACK, createMemo, createSignal, onCleanup, getOwner } from \"solid-js\";\nimport { isServer } from \"solid-js/web\";\nimport { useRouter } from \"../routing.js\";\nimport { mockBase } from \"../utils.js\";\nimport { cacheKeyOp, hashKey, revalidate, cache } from \"./cache.js\";\nexport const actions = /* #__PURE__ */ new Map();\nexport function useSubmissions(fn, filter) {\n const router = useRouter();\n const subs = createMemo(() => router.submissions[0]().filter(s => s.url === fn.toString() && (!filter || filter(s.input))));\n return new Proxy([], {\n get(_, property) {\n if (property === $TRACK)\n return subs();\n if (property === \"pending\")\n return subs().some(sub => !sub.result);\n return subs()[property];\n }\n });\n}\nexport function useSubmission(fn, filter) {\n const submissions = useSubmissions(fn, filter);\n return new Proxy({}, {\n get(_, property) {\n return submissions[submissions.length - 1]?.[property];\n }\n });\n}\nexport function useAction(action) {\n const r = useRouter();\n return (...args) => action.apply({ r }, args);\n}\nexport function action(fn, name) {\n function mutate(...variables) {\n const router = this.r;\n const form = this.f;\n const p = (router.singleFlight && fn.withOptions\n ? fn.withOptions({ headers: { \"X-Single-Flight\": \"true\" } })\n : fn)(...variables);\n const [result, setResult] = createSignal();\n let submission;\n function handler(error) {\n return async (res) => {\n const result = await handleResponse(res, error, router.navigatorFactory());\n if (!result)\n return submission.clear();\n setResult(result);\n if (result.error && !form)\n throw result.error;\n return result.data;\n };\n }\n router.submissions[1](s => [\n ...s,\n (submission = {\n input: variables,\n url,\n get result() {\n return result()?.data;\n },\n get error() {\n return result()?.error;\n },\n get pending() {\n return !result();\n },\n clear() {\n router.submissions[1](v => v.filter(i => i.input !== variables));\n },\n retry() {\n setResult(undefined);\n const p = fn(...variables);\n return p.then(handler(), handler(true));\n }\n })\n ]);\n return p.then(handler(), handler(true));\n }\n const url = fn.url ||\n (name && `https://action/${name}`) ||\n (!isServer ? `https://action/${hashString(fn.toString())}` : \"\");\n return toAction(mutate, url);\n}\nfunction toAction(fn, url) {\n fn.toString = () => {\n if (!url)\n throw new Error(\"Client Actions need explicit names if server rendered\");\n return url;\n };\n fn.with = function (...args) {\n const newFn = function (...passedArgs) {\n return fn.call(this, ...args, ...passedArgs);\n };\n const uri = new URL(url, mockBase);\n uri.searchParams.set(\"args\", hashKey(args));\n return toAction(newFn, (uri.origin === \"https://action\" ? uri.origin : \"\") + uri.pathname + uri.search);\n };\n fn.url = url;\n if (!isServer) {\n actions.set(url, fn);\n getOwner() && onCleanup(() => actions.delete(url));\n }\n return fn;\n}\nconst hashString = (s) => s.split(\"\").reduce((a, b) => ((a << 5) - a + b.charCodeAt(0)) | 0, 0);\nasync function handleResponse(response, error, navigate) {\n let data;\n let keys;\n let invalidateKeys;\n if (response instanceof Response) {\n if (response.headers.has(\"X-Revalidate\"))\n keys = invalidateKeys = response.headers.get(\"X-Revalidate\").split(\",\");\n if (response.customBody) {\n data = await response.customBody();\n if (response.headers.has(\"X-Single-Flight\")) {\n keys || (keys = []);\n invalidateKeys || (invalidateKeys = []);\n Object.keys(data).forEach(key => {\n if (key === \"_$value\")\n return;\n keys.push(key);\n cache.set(key, data[key]);\n });\n data = data._$value;\n }\n }\n if (response.headers.has(\"Location\")) {\n const locationUrl = response.headers.get(\"Location\") || \"/\";\n if (locationUrl.startsWith(\"http\")) {\n window.location.href = locationUrl;\n }\n else {\n navigate(locationUrl);\n }\n }\n }\n else if (error)\n return { error: response };\n else\n data = response;\n // invalidate\n cacheKeyOp(invalidateKeys, entry => (entry[0] = 0));\n // trigger revalidation\n await revalidate(keys, false);\n return data != null ? { data } : undefined;\n}\n","import { delegateEvents } from \"solid-js/web\";\nimport { onCleanup } from \"solid-js\";\nimport { actions } from \"./action.js\";\nimport { mockBase } from \"../utils.js\";\nexport function setupNativeEvents(preload = true, explicitLinks = false, actionBase = \"/_server\") {\n return (router) => {\n const basePath = router.base.path();\n const navigateFromRoute = router.navigatorFactory(router.base);\n let preloadTimeout = {};\n function isSvg(el) {\n return el.namespaceURI === \"http://www.w3.org/2000/svg\";\n }\n function handleAnchor(evt) {\n if (evt.defaultPrevented ||\n evt.button !== 0 ||\n evt.metaKey ||\n evt.altKey ||\n evt.ctrlKey ||\n evt.shiftKey)\n return;\n const a = evt\n .composedPath()\n .find(el => el instanceof Node && el.nodeName.toUpperCase() === \"A\");\n if (!a || (explicitLinks && !a.hasAttribute(\"link\")))\n return;\n const svg = isSvg(a);\n const href = svg ? a.href.baseVal : a.href;\n const target = svg ? a.target.baseVal : a.target;\n if (target || (!href && !a.hasAttribute(\"state\")))\n return;\n const rel = (a.getAttribute(\"rel\") || \"\").split(/\\s+/);\n if (a.hasAttribute(\"download\") || (rel && rel.includes(\"external\")))\n return;\n const url = svg ? new URL(href, document.baseURI) : new URL(href);\n if (url.origin !== window.location.origin ||\n (basePath && url.pathname && !url.pathname.toLowerCase().startsWith(basePath.toLowerCase())))\n return;\n return [a, url];\n }\n function handleAnchorClick(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n const to = router.parsePath(url.pathname + url.search + url.hash);\n const state = a.getAttribute(\"state\");\n evt.preventDefault();\n navigateFromRoute(to, {\n resolve: false,\n replace: a.hasAttribute(\"replace\"),\n scroll: !a.hasAttribute(\"noscroll\"),\n state: state && JSON.parse(state)\n });\n }\n function handleAnchorPreload(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n if (!preloadTimeout[url.pathname])\n router.preloadRoute(url, a.getAttribute(\"preload\") !== \"false\");\n }\n function handleAnchorIn(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [a, url] = res;\n if (preloadTimeout[url.pathname])\n return;\n preloadTimeout[url.pathname] = setTimeout(() => {\n router.preloadRoute(url, a.getAttribute(\"preload\") !== \"false\");\n delete preloadTimeout[url.pathname];\n }, 200);\n }\n function handleAnchorOut(evt) {\n const res = handleAnchor(evt);\n if (!res)\n return;\n const [, url] = res;\n if (preloadTimeout[url.pathname]) {\n clearTimeout(preloadTimeout[url.pathname]);\n delete preloadTimeout[url.pathname];\n }\n }\n function handleFormSubmit(evt) {\n let actionRef = evt.submitter && evt.submitter.hasAttribute(\"formaction\")\n ? evt.submitter.getAttribute(\"formaction\")\n : evt.target.getAttribute(\"action\");\n if (!actionRef)\n return;\n if (!actionRef.startsWith(\"https://action/\")) {\n // normalize server actions\n const url = new URL(actionRef, mockBase);\n actionRef = router.parsePath(url.pathname + url.search);\n if (!actionRef.startsWith(actionBase))\n return;\n }\n if (evt.target.method.toUpperCase() !== \"POST\")\n throw new Error(\"Only POST forms are supported for Actions\");\n const handler = actions.get(actionRef);\n if (handler) {\n evt.preventDefault();\n const data = new FormData(evt.target);\n if (evt.submitter && evt.submitter.name)\n data.append(evt.submitter.name, evt.submitter.value);\n handler.call({ r: router, f: evt.target }, data);\n }\n }\n // ensure delegated event run first\n delegateEvents([\"click\", \"submit\"]);\n document.addEventListener(\"click\", handleAnchorClick);\n if (preload) {\n document.addEventListener(\"mouseover\", handleAnchorIn);\n document.addEventListener(\"mouseout\", handleAnchorOut);\n document.addEventListener(\"focusin\", handleAnchorPreload);\n document.addEventListener(\"touchstart\", handleAnchorPreload);\n }\n document.addEventListener(\"submit\", handleFormSubmit);\n onCleanup(() => {\n document.removeEventListener(\"click\", handleAnchorClick);\n if (preload) {\n document.removeEventListener(\"mouseover\", handleAnchorIn);\n document.removeEventListener(\"mouseout\", handleAnchorOut);\n document.removeEventListener(\"focusin\", handleAnchorPreload);\n document.removeEventListener(\"touchstart\", handleAnchorPreload);\n }\n document.removeEventListener(\"submit\", handleFormSubmit);\n });\n };\n}\n","import { setupNativeEvents } from \"../data/events.js\";\nimport { createRouter, scrollToHash, bindEvent } from \"./createRouter.js\";\nimport { createBeforeLeave, keepDepth, notifyIfNotBlocked, saveCurrentDepth } from \"../lifecycle.js\";\nexport function hashParser(str) {\n const to = str.replace(/^.*?#/, \"\");\n // Hash-only hrefs like `#foo` from plain anchors will come in as `/#foo` whereas a link to\n // `/foo` will be `/#/foo`. Check if the to starts with a `/` and if not append it as a hash\n // to the current path so we can handle these in-page anchors correctly.\n if (!to.startsWith(\"/\")) {\n const [, path = \"/\"] = window.location.hash.split(\"#\", 2);\n return `${path}#${to}`;\n }\n return to;\n}\nexport function HashRouter(props) {\n const getSource = () => window.location.hash.slice(1);\n const beforeLeave = createBeforeLeave();\n return createRouter({\n get: getSource,\n set({ value, replace, scroll, state }) {\n if (replace) {\n window.history.replaceState(keepDepth(state), \"\", \"#\" + value);\n }\n else {\n window.location.hash = value;\n }\n const hashIndex = value.indexOf(\"#\");\n const hash = hashIndex >= 0 ? value.slice(hashIndex + 1) : \"\";\n scrollToHash(hash, scroll);\n saveCurrentDepth();\n },\n init: notify => bindEvent(window, \"hashchange\", notifyIfNotBlocked(notify, delta => !beforeLeave.confirm(delta && delta < 0 ? delta : getSource()))),\n create: setupNativeEvents(props.preload, props.explicitLinks, props.actionBase),\n utils: {\n go: delta => window.history.go(delta),\n renderPath: path => `#${path}`,\n parsePath: hashParser,\n beforeLeave\n }\n })(props);\n}\n","import { DEV, equalFn, untrack, getOwner, onCleanup, createSignal, sharedConfig, onMount } from 'solid-js';\nimport { isServer } from 'solid-js/web';\nexport { isServer } from 'solid-js/web';\n\n// src/index.ts\nvar isClient = !isServer;\nvar isDev = isClient && !!DEV;\nvar isProd = !isDev;\nvar noop = () => void 0;\nvar trueFn = () => true;\nvar falseFn = () => false;\nvar defaultEquals = equalFn;\nvar EQUALS_FALSE_OPTIONS = { equals: false };\nvar INTERNAL_OPTIONS = { internal: true };\nvar ofClass = (v, c) => v instanceof c || v && v.constructor === c;\nfunction isObject(value) {\n return value !== null && (typeof value === \"object\" || typeof value === \"function\");\n}\nvar isNonNullable = (i) => i != null;\nvar filterNonNullable = (arr) => arr.filter(isNonNullable);\nvar compare = (a, b) => a < b ? -1 : a > b ? 1 : 0;\nvar arrayEquals = (a, b) => a === b || a.length === b.length && a.every((e, i) => e === b[i]);\nfunction chain(callbacks) {\n return (...args) => {\n for (const callback of callbacks)\n callback && callback(...args);\n };\n}\nfunction reverseChain(callbacks) {\n return (...args) => {\n for (let i = callbacks.length - 1; i >= 0; i--) {\n const callback = callbacks[i];\n callback && callback(...args);\n }\n };\n}\nvar clamp = (n, min, max) => Math.min(Math.max(n, min), max);\nvar access = (v) => typeof v === \"function\" && !v.length ? v() : v;\nvar asArray = (value) => Array.isArray(value) ? value : value ? [value] : [];\nvar accessArray = (list) => list.map((v) => access(v));\nvar withAccess = (value, fn) => {\n const _value = access(value);\n typeof _value != null && fn(_value);\n};\nvar asAccessor = (v) => typeof v === \"function\" ? v : () => v;\nfunction accessWith(valueOrFn, ...args) {\n return typeof valueOrFn === \"function\" ? valueOrFn(...args) : valueOrFn;\n}\nfunction defer(deps, fn, initialValue) {\n const isArray = Array.isArray(deps);\n let prevInput;\n let shouldDefer = true;\n return (prevValue) => {\n let input;\n if (isArray) {\n input = Array(deps.length);\n for (let i = 0; i < deps.length; i++)\n input[i] = deps[i]();\n } else\n input = deps();\n if (shouldDefer) {\n shouldDefer = false;\n prevInput = input;\n return initialValue;\n }\n const result = untrack(() => fn(input, prevInput, prevValue));\n prevInput = input;\n return result;\n };\n}\nvar entries = Object.entries;\nvar keys = Object.keys;\nvar tryOnCleanup = isDev ? (fn) => getOwner() ? onCleanup(fn) : fn : onCleanup;\nvar createCallbackStack = () => {\n let stack = [];\n const clear = () => stack = [];\n return {\n push: (...callbacks) => stack.push(...callbacks),\n execute(arg0, arg1, arg2, arg3) {\n stack.forEach((cb) => cb(arg0, arg1, arg2, arg3));\n clear();\n },\n clear\n };\n};\nfunction createMicrotask(fn) {\n let calls = 0;\n let args;\n onCleanup(() => calls = 0);\n return (...a) => {\n args = a, calls++;\n queueMicrotask(() => --calls === 0 && fn(...args));\n };\n}\nfunction createHydratableSignal(serverValue, update, options) {\n if (isServer) {\n return createSignal(serverValue, options);\n }\n if (sharedConfig.context) {\n const [state, setState] = createSignal(serverValue, options);\n onMount(() => setState(() => update()));\n return [state, setState];\n }\n return createSignal(update(), options);\n}\nvar createHydrateSignal = createHydratableSignal;\nfunction handleDiffArray(current, prev, handleAdded, handleRemoved) {\n const currLength = current.length;\n const prevLength = prev.length;\n let i = 0;\n if (!prevLength) {\n for (; i < currLength; i++)\n handleAdded(current[i]);\n return;\n }\n if (!currLength) {\n for (; i < prevLength; i++)\n handleRemoved(prev[i]);\n return;\n }\n for (; i < prevLength; i++) {\n if (prev[i] !== current[i])\n break;\n }\n let prevEl;\n let currEl;\n prev = prev.slice(i);\n current = current.slice(i);\n for (prevEl of prev) {\n if (!current.includes(prevEl))\n handleRemoved(prevEl);\n }\n for (currEl of current) {\n if (!prev.includes(currEl))\n handleAdded(currEl);\n }\n}\n\nexport { EQUALS_FALSE_OPTIONS, INTERNAL_OPTIONS, access, accessArray, accessWith, arrayEquals, asAccessor, asArray, chain, clamp, compare, createCallbackStack, createHydratableSignal, createHydrateSignal, createMicrotask, defaultEquals, defer, entries, falseFn, filterNonNullable, handleDiffArray, isClient, isDev, isNonNullable, isObject, isProd, keys, noop, ofClass, reverseChain, trueFn, tryOnCleanup, withAccess };\n","import { getOwner, createRoot, runWithOwner, onCleanup, sharedConfig, createSignal, batch } from 'solid-js';\nimport { isServer } from 'solid-js/web';\nimport { asArray, access, trueFn, noop, createMicrotask } from '@solid-primitives/utils';\n\n// src/index.ts\nfunction createSubRoot(fn, ...owners) {\n if (owners.length === 0)\n owners = [getOwner()];\n return createRoot((dispose) => {\n asArray(access(owners)).forEach(\n (owner) => owner && runWithOwner(owner, onCleanup.bind(void 0, dispose))\n );\n return fn(dispose);\n }, owners[0]);\n}\nvar createBranch = createSubRoot;\nvar createCallback = (callback, owner = getOwner()) => owner ? (...args) => runWithOwner(owner, () => callback(...args)) : callback;\nfunction createDisposable(fn, ...owners) {\n return createSubRoot(\n (dispose) => {\n fn(dispose);\n return dispose;\n },\n ...owners\n );\n}\nfunction createSingletonRoot(factory, detachedOwner = getOwner()) {\n let listeners = 0, value, disposeRoot;\n return () => {\n listeners++;\n onCleanup(() => {\n listeners--;\n queueMicrotask(() => {\n if (!listeners && disposeRoot) {\n disposeRoot();\n disposeRoot = value = void 0;\n }\n });\n });\n if (!disposeRoot) {\n createRoot((dispose) => value = factory(disposeRoot = dispose), detachedOwner);\n }\n return value;\n };\n}\nvar createSharedRoot = createSingletonRoot;\nfunction createHydratableSingletonRoot(factory) {\n const owner = getOwner();\n const singleton = createSingletonRoot(factory, owner);\n return () => isServer || sharedConfig.context ? createRoot(factory, owner) : singleton();\n}\nfunction createRootPool(factory, options = {}) {\n if (isServer) {\n const owner2 = getOwner();\n return (args) => createRoot((dispose) => factory(() => args, trueFn, dispose), owner2);\n }\n let length = 0;\n const { limit = 100 } = options, pool = new Array(limit), owner = getOwner(), mapRoot = factory.length > 1 ? (dispose, [args, set]) => {\n const [active, setA] = createSignal(true);\n const root = {\n dispose,\n set,\n setA,\n active,\n v: factory(args, active, () => disposeRoot(root))\n };\n return root;\n } : (dispose, [args, set]) => ({\n dispose,\n set,\n setA: trueFn,\n active: trueFn,\n v: factory(args, trueFn, noop)\n }), limitPool = createMicrotask(() => {\n if (length > limit) {\n for (let i = limit; i < length; i++) {\n pool[i].dispose();\n pool[i] = void 0;\n }\n length = limit;\n }\n }), cleanupRoot = (root) => {\n if (root.dispose !== noop) {\n pool[length++] = root;\n root.setA(false);\n limitPool();\n }\n }, disposeRoot = (root) => {\n root.dispose();\n root.dispose = noop;\n if (root.active())\n root.setA(false);\n else {\n pool[pool.indexOf(root)] = pool[--length];\n pool[length] = void 0;\n }\n };\n onCleanup(() => {\n for (let i = 0; i < length; i++)\n pool[i].dispose();\n length = 0;\n });\n return (arg) => {\n let root;\n if (length) {\n root = pool[--length];\n pool[length] = void 0;\n batch(() => {\n root.set(() => arg);\n root.setA(true);\n });\n } else\n root = createRoot((dispose) => mapRoot(dispose, createSignal(arg)), owner);\n onCleanup(() => cleanupRoot(root));\n return root.v;\n };\n}\n\nexport { createBranch, createCallback, createDisposable, createHydratableSingletonRoot, createRootPool, createSharedRoot, createSingletonRoot, createSubRoot };\n","import { makeEventListener } from '@solid-primitives/event-listener';\nimport { createSingletonRoot } from '@solid-primitives/rootless';\nimport { arrayEquals } from '@solid-primitives/utils';\nimport { createSignal, untrack, createMemo, createEffect, on } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/index.ts\nfunction equalsKeyHoldSequence(sequence, model) {\n for (let i = sequence.length - 1; i >= 0; i--) {\n const _model = model.slice(0, i + 1);\n if (!arrayEquals(sequence[i], _model))\n return false;\n }\n return true;\n}\nvar useKeyDownEvent = /* @__PURE__ */ createSingletonRoot(\n () => {\n if (isServer) {\n return () => null;\n }\n const [event, setEvent] = createSignal(null);\n makeEventListener(window, \"keydown\", (e) => {\n setEvent(e);\n setTimeout(() => setEvent(null));\n });\n return event;\n }\n);\nvar useKeyDownList = /* @__PURE__ */ createSingletonRoot(() => {\n if (isServer) {\n const keys = () => [];\n keys[0] = keys;\n keys[1] = { event: () => null };\n keys[Symbol.iterator] = function* () {\n yield keys[0];\n yield keys[1];\n };\n return keys;\n }\n const [pressedKeys, setPressedKeys] = createSignal([]), reset = () => setPressedKeys([]), event = useKeyDownEvent();\n makeEventListener(window, \"keydown\", (e) => {\n if (e.repeat || typeof e.key !== \"string\")\n return;\n const key = e.key.toUpperCase(), currentKeys = pressedKeys();\n if (currentKeys.includes(key))\n return;\n const keys = [...currentKeys, key];\n if (currentKeys.length === 0 && key !== \"ALT\" && key !== \"CONTROL\" && key !== \"META\" && key !== \"SHIFT\") {\n if (e.shiftKey)\n keys.unshift(\"SHIFT\");\n if (e.altKey)\n keys.unshift(\"ALT\");\n if (e.ctrlKey)\n keys.unshift(\"CONTROL\");\n if (e.metaKey)\n keys.unshift(\"META\");\n }\n setPressedKeys(keys);\n });\n makeEventListener(window, \"keyup\", (e) => {\n if (typeof e.key !== \"string\")\n return;\n const key = e.key.toUpperCase();\n setPressedKeys((prev) => prev.filter((_key) => _key !== key));\n });\n makeEventListener(window, \"blur\", reset);\n makeEventListener(window, \"contextmenu\", (e) => {\n e.defaultPrevented || reset();\n });\n pressedKeys[0] = pressedKeys;\n pressedKeys[1] = { event };\n pressedKeys[Symbol.iterator] = function* () {\n yield pressedKeys[0];\n yield pressedKeys[1];\n };\n return pressedKeys;\n});\nvar useCurrentlyHeldKey = /* @__PURE__ */ createSingletonRoot(\n () => {\n if (isServer) {\n return () => null;\n }\n const keys = useKeyDownList();\n let prevKeys = untrack(keys);\n return createMemo(() => {\n const _keys = keys();\n const prev = prevKeys;\n prevKeys = _keys;\n if (prev.length === 0 && _keys.length === 1)\n return _keys[0];\n return null;\n });\n }\n);\nvar useKeyDownSequence = /* @__PURE__ */ createSingletonRoot(() => {\n if (isServer) {\n return () => [];\n }\n const keys = useKeyDownList();\n return createMemo((prev) => {\n if (keys().length === 0)\n return [];\n return [...prev, keys()];\n }, []);\n});\nfunction createKeyHold(key, options = {}) {\n if (isServer) {\n return () => false;\n }\n key = key.toUpperCase();\n const { preventDefault = true } = options, event = useKeyDownEvent(), heldKey = useCurrentlyHeldKey();\n return createMemo(() => heldKey() === key && (preventDefault && event()?.preventDefault(), true));\n}\nfunction createShortcut(keys, callback, options = {}) {\n if (isServer || !keys.length) {\n return;\n }\n keys = keys.map((key) => key.toUpperCase());\n const { preventDefault = true } = options, event = useKeyDownEvent(), sequence = useKeyDownSequence();\n let reset = false;\n const handleSequenceWithReset = (sequence2) => {\n if (!sequence2.length)\n return reset = false;\n if (reset)\n return;\n const e = event();\n if (sequence2.length < keys.length) {\n if (equalsKeyHoldSequence(sequence2, keys.slice(0, sequence2.length))) {\n preventDefault && e && e.preventDefault();\n } else {\n reset = true;\n }\n } else {\n reset = true;\n if (equalsKeyHoldSequence(sequence2, keys)) {\n preventDefault && e && e.preventDefault();\n callback(e);\n }\n }\n };\n const handleSequenceWithoutReset = (sequence2) => {\n const last = sequence2.at(-1);\n if (!last)\n return;\n const e = event();\n if (preventDefault && last.length < keys.length) {\n if (arrayEquals(last, keys.slice(0, keys.length - 1))) {\n e && e.preventDefault();\n }\n return;\n }\n if (arrayEquals(last, keys)) {\n const prev = sequence2.at(-2);\n if (!prev || arrayEquals(prev, keys.slice(0, keys.length - 1))) {\n preventDefault && e && e.preventDefault();\n callback(e);\n }\n }\n };\n createEffect(\n on(sequence, options.requireReset ? handleSequenceWithReset : handleSequenceWithoutReset)\n );\n}\n\nexport { createKeyHold, createShortcut, useCurrentlyHeldKey, useKeyDownEvent, useKeyDownList, useKeyDownSequence };\n","import { tryOnCleanup, entries, createCallbackStack, asArray, access, keys } from '@solid-primitives/utils';\nimport { createEffect, createRenderEffect, createSignal, onCleanup } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/eventListener.ts\nfunction makeEventListener(target, type, handler, options) {\n target.addEventListener(type, handler, options);\n return tryOnCleanup(target.removeEventListener.bind(target, type, handler, options));\n}\nfunction createEventListener(targets, type, handler, options) {\n if (isServer)\n return;\n const attachListeners = () => {\n asArray(access(targets)).forEach((el) => {\n if (el)\n asArray(access(type)).forEach((type2) => makeEventListener(el, type2, handler, options));\n });\n };\n if (typeof targets === \"function\")\n createEffect(attachListeners);\n else\n createRenderEffect(attachListeners);\n}\nfunction createEventSignal(target, type, options) {\n if (isServer) {\n return () => void 0;\n }\n const [lastEvent, setLastEvent] = createSignal();\n createEventListener(target, type, setLastEvent, options);\n return lastEvent;\n}\nvar eventListener = (target, props) => {\n createEffect(() => {\n const [type, handler, options] = props();\n makeEventListener(target, type, handler, options);\n });\n};\nfunction createEventListenerMap(targets, handlersMap, options) {\n if (isServer) {\n return;\n }\n for (const [eventName, handler] of entries(handlersMap)) {\n if (handler)\n createEventListener(targets, eventName, handler, options);\n }\n}\nvar attachPropListeners = (target, props) => {\n keys(props).forEach((attr) => {\n if (attr.startsWith(\"on\") && typeof props[attr] === \"function\")\n makeEventListener(target, attr.substring(2).toLowerCase(), props[attr]);\n });\n};\nvar WindowEventListener = (props) => {\n if (isServer)\n return null;\n attachPropListeners(window, props);\n};\nvar DocumentEventListener = (props) => {\n if (isServer)\n return null;\n attachPropListeners(document, props);\n};\nfunction makeEventListenerStack(target, options) {\n if (isServer) {\n return [() => () => void 0, () => void 0];\n }\n const { push, execute } = createCallbackStack();\n return [\n (type, handler, overwriteOptions) => {\n const clear = makeEventListener(target, type, handler, overwriteOptions ?? options);\n push(clear);\n return clear;\n },\n onCleanup(execute)\n ];\n}\n\n// src/callbackWrappers.ts\nvar preventDefault = (callback) => (e) => {\n e.preventDefault();\n callback(e);\n};\nvar stopPropagation = (callback) => (e) => {\n e.stopPropagation();\n callback(e);\n};\nvar stopImmediatePropagation = (callback) => (e) => {\n e.stopImmediatePropagation();\n callback(e);\n};\n\nexport { DocumentEventListener, WindowEventListener, createEventListener, createEventListenerMap, createEventSignal, eventListener, makeEventListener, makeEventListenerStack, preventDefault, stopImmediatePropagation, stopPropagation };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nexport function isFunc(item) {\n return typeof item === 'function';\n}\nexport function isObject(item) {\n return typeof item === 'object';\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function isArray(item) {\n return Array.isArray(item);\n}\nexport function isString(item) {\n return typeof item === 'string';\n}\nexport function isNumber(item) {\n return typeof item === 'number';\n}\nexport function isInteger(item) {\n return Number.isInteger(item);\n}\nexport function keyExists(obj, keys) {\n for (const key of keys) {\n if (key in obj) {\n return true;\n }\n }\n return false;\n}\n/**\n * Asserts a condition is truthy, otherwise throws an error\n *\n * @remarks\n * Useful at the top of functions to ensure certain conditions, arguments and\n * properties are set/met before continuing. When using this function,\n * TypeScript will narrow away falsy types from the condition.\n *\n * @param condition\n * @param message\n * @returns\n */\nexport function assertTruthy(condition, message) {\n if (!condition) {\n throw new Error(message || 'Assertion failed');\n }\n}\n//# sourceMappingURL=utils.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { createEffect, on, createSignal, untrack, } from 'solid-js';\nimport { useKeyDownEvent } from '@solid-primitives/keyboard';\nimport { activeElement, ElementNode } from '@lightningjs/solid';\nimport { isFunc, isArray } from './utils.js';\nconst keyMapEntries = {\n ArrowLeft: 'Left',\n ArrowRight: 'Right',\n ArrowUp: 'Up',\n ArrowDown: 'Down',\n Enter: 'Enter',\n l: 'Last',\n ' ': 'Space',\n Backspace: 'Back',\n Escape: 'Escape',\n};\nconst [focusPath, setFocusPath] = createSignal([]);\nexport { focusPath };\nexport const useFocusManager = (userKeyMap) => {\n const keypressEvent = useKeyDownEvent();\n if (userKeyMap) {\n // Flatten the userKeyMap to a hash\n for (const [key, value] of Object.entries(userKeyMap)) {\n if (isArray(value)) {\n value.forEach((v) => {\n keyMapEntries[v] = key;\n });\n }\n else {\n keyMapEntries[value] = key;\n }\n }\n }\n createEffect(on(activeElement, (currentFocusedElm, prevFocusedElm, prevFocusPath = []) => {\n const newFocusedElms = [];\n let current = currentFocusedElm;\n const fp = [];\n while (current) {\n if (!current.states.has('focus')) {\n current.states.add('focus');\n isFunc(current.onFocus) &&\n current.onFocus.call(current, currentFocusedElm, prevFocusedElm);\n newFocusedElms.push(current);\n }\n fp.push(current);\n current = current.parent;\n }\n prevFocusPath.forEach((elm) => {\n if (!fp.includes(elm)) {\n elm.states.remove('focus');\n isFunc(elm.onBlur) &&\n elm.onBlur.call(elm, currentFocusedElm, prevFocusedElm);\n }\n });\n setFocusPath(fp);\n return fp;\n }, { defer: true }));\n createEffect(() => {\n const e = keypressEvent();\n if (e) {\n // Search keyMap for the value of the pressed key or keyCode if value undefined\n const mappedKeyEvent = keyMapEntries[e.key] || keyMapEntries[e.keyCode];\n untrack(() => {\n const fp = focusPath();\n let finalFocusElm = undefined;\n for (const elm of fp) {\n finalFocusElm = finalFocusElm || elm;\n if (mappedKeyEvent) {\n const onKeyHandler = elm[`on${mappedKeyEvent}`];\n if (isFunc(onKeyHandler)) {\n if (onKeyHandler.call(elm, e, elm, finalFocusElm) === true) {\n break;\n }\n }\n }\n else {\n console.log(`Unhandled key event: ${e.key}`);\n }\n if (isFunc(elm.onKeyPress)) {\n if (elm.onKeyPress.call(elm, e, mappedKeyEvent, elm, finalFocusElm) === true) {\n break;\n }\n }\n }\n return false;\n });\n }\n });\n return focusPath;\n};\n//# sourceMappingURL=useFocusManager.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n/* global SpeechSynthesisErrorEvent */\nfunction flattenStrings(series = []) {\n const flattenedSeries = [];\n let i;\n for (i = 0; i < series.length; i++) {\n const s = series[i];\n if (typeof s === 'string' && !s.includes('PAUSE-')) {\n flattenedSeries.push(series[i]);\n }\n else {\n break;\n }\n }\n // add a \"word boundary\" to ensure the Announcer doesn't automatically try to\n // interpret strings that look like dates but are not actually dates\n // for example, if \"Rising Sun\" and \"1993\" are meant to be two separate lines,\n // when read together, \"Sun 1993\" is interpretted as \"Sunday 1993\"\n return [flattenedSeries.join(',\\b ')].concat(series.slice(i));\n}\nfunction delay(pause) {\n return new Promise((resolve) => {\n setTimeout(resolve, pause);\n });\n}\n/**\n * Speak a string\n *\n * @param phrase Phrase to speak\n * @param utterances An array which the new SpeechSynthesisUtterance instance representing this utterance will be appended\n * @param lang Language to speak in\n * @return {Promise} Promise resolved when the utterance has finished speaking, and rejected if there's an error\n */\nfunction speak(phrase, utterances, lang = 'en-US') {\n const synth = window.speechSynthesis;\n return new Promise((resolve, reject) => {\n const utterance = new SpeechSynthesisUtterance(phrase);\n utterance.lang = lang;\n utterance.onend = () => {\n resolve();\n };\n utterance.onerror = (e) => {\n reject(e);\n };\n utterances.push(utterance);\n synth.speak(utterance);\n });\n}\nfunction speakSeries(series, lang, root = true) {\n const synth = window.speechSynthesis;\n const remainingPhrases = flattenStrings(Array.isArray(series) ? series : [series]);\n const nestedSeriesResults = [];\n /*\n We hold this array of SpeechSynthesisUtterances in order to prevent them from being\n garbage collected prematurely on STB hardware which can cause the 'onend' events of\n utterances to not fire consistently.\n */\n const utterances = [];\n let active = true;\n const seriesChain = (async () => {\n try {\n while (active && remainingPhrases.length) {\n const phrase = await Promise.resolve(remainingPhrases.shift());\n if (!active) {\n // Exit\n // Need to check this after the await in case it was cancelled in between\n break;\n }\n else if (typeof phrase === 'string' && phrase.includes('PAUSE-')) {\n // Pause it\n let pause = Number(phrase.split('PAUSE-')[1]) * 1000;\n if (isNaN(pause)) {\n pause = 0;\n }\n await delay(pause);\n }\n else if (typeof phrase === 'string' && phrase.length) {\n // Speak it\n const totalRetries = 3;\n let retriesLeft = totalRetries;\n while (active && retriesLeft > 0) {\n try {\n await speak(phrase, utterances, lang);\n retriesLeft = 0;\n }\n catch (e) {\n // eslint-disable-next-line no-undef\n if (e instanceof SpeechSynthesisErrorEvent) {\n if (e.error === 'network') {\n retriesLeft--;\n console.warn(`Speech synthesis network error. Retries left: ${retriesLeft}`);\n await delay(500 * (totalRetries - retriesLeft));\n }\n else if (e.error === 'canceled' ||\n e.error === 'interrupted') {\n // Cancel or interrupt error (ignore)\n retriesLeft = 0;\n }\n else {\n throw new Error(`SpeechSynthesisErrorEvent: ${e.error}`);\n }\n }\n else {\n throw e;\n }\n }\n }\n }\n else if (typeof phrase === 'function') {\n const seriesResult = speakSeries(phrase(), lang, false);\n nestedSeriesResults.push(seriesResult);\n await seriesResult.series;\n }\n else if (Array.isArray(phrase)) {\n // Speak it (recursively)\n const seriesResult = speakSeries(phrase, lang, false);\n nestedSeriesResults.push(seriesResult);\n await seriesResult.series;\n }\n }\n }\n finally {\n active = false;\n }\n })();\n return {\n series: seriesChain,\n get active() {\n return active;\n },\n append: (toSpeak) => {\n remainingPhrases.push(toSpeak);\n },\n cancel: () => {\n if (!active) {\n return;\n }\n if (root) {\n synth.cancel();\n }\n nestedSeriesResults.forEach((nestedSeriesResults) => {\n nestedSeriesResults.cancel();\n });\n active = false;\n },\n };\n}\nlet currentSeries;\nexport default function (toSpeak, lang = 'en-US') {\n currentSeries && currentSeries.cancel();\n currentSeries = speakSeries(toSpeak, lang);\n return currentSeries;\n}\n//# sourceMappingURL=speech.js.map","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { ElementNode } from '@lightningjs/solid';\n// To use with TS import withPadding and then put withPadding; on the next line to prevent tree shaking\nexport function withPadding(el, padding) {\n const pad = padding();\n let top, left, right, bottom;\n if (Array.isArray(pad)) {\n // top right bottom left\n if (pad.length === 2) {\n top = bottom = pad[0];\n left = right = pad[1];\n }\n else if (pad.length === 3) {\n top = pad[0];\n left = right = pad[1];\n bottom = pad[2];\n }\n else {\n [top, right, bottom, left] = pad;\n }\n }\n else {\n top = right = bottom = left = pad;\n }\n el.onBeforeLayout = (node, size) => {\n if (size) {\n el.width =\n el.children.reduce((acc, c) => {\n return acc + (c.width || 0);\n }, 0) +\n left +\n right;\n const firstChild = el.children[0];\n if (firstChild) {\n // set padding or marginLeft for flex\n firstChild.x = left;\n firstChild.marginLeft = left;\n }\n let maxHeight = 0;\n el.children.forEach((c) => {\n c.y = top;\n c.marginTop = top;\n maxHeight = Math.max(maxHeight, c.height || 0);\n });\n el.height = maxHeight + top + bottom;\n }\n };\n}\n//# sourceMappingURL=withPadding.js.map","import { getOwner, onCleanup, createSignal, getListener } from 'solid-js';\nimport { isServer } from 'solid-js/web';\n\n// src/index.ts\nvar debounce = (callback, wait) => {\n if (isServer) {\n return Object.assign(() => void 0, { clear: () => void 0 });\n }\n let timeoutId;\n const clear = () => clearTimeout(timeoutId);\n if (getOwner())\n onCleanup(clear);\n const debounced = (...args) => {\n if (timeoutId !== void 0)\n clear();\n timeoutId = setTimeout(() => callback(...args), wait);\n };\n return Object.assign(debounced, { clear });\n};\nvar throttle = (callback, wait) => {\n if (isServer) {\n return Object.assign(() => void 0, { clear: () => void 0 });\n }\n let isThrottled = false, timeoutId, lastArgs;\n const throttled = (...args) => {\n lastArgs = args;\n if (isThrottled)\n return;\n isThrottled = true;\n timeoutId = setTimeout(() => {\n callback(...lastArgs);\n isThrottled = false;\n }, wait);\n };\n const clear = () => {\n clearTimeout(timeoutId);\n isThrottled = false;\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(throttled, { clear });\n};\nvar scheduleIdle = isServer ? () => Object.assign(() => void 0, { clear: () => void 0 }) : (\n // requestIdleCallback is not supported in Safari\n window.requestIdleCallback ? (callback, maxWait) => {\n let isDeferred = false, id, lastArgs;\n const deferred = (...args) => {\n lastArgs = args;\n if (isDeferred)\n return;\n isDeferred = true;\n id = requestIdleCallback(\n () => {\n callback(...lastArgs);\n isDeferred = false;\n },\n { timeout: maxWait }\n );\n };\n const clear = () => {\n cancelIdleCallback(id);\n isDeferred = false;\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(deferred, { clear });\n } : (\n // fallback to setTimeout (throttle)\n (callback) => throttle(callback)\n )\n);\nfunction leading(schedule, callback, wait) {\n if (isServer) {\n let called = false;\n const scheduled2 = (...args) => {\n if (called)\n return;\n called = true;\n callback(...args);\n };\n return Object.assign(scheduled2, { clear: () => void 0 });\n }\n let isScheduled = false;\n const scheduled = schedule(() => isScheduled = false, wait);\n const func = (...args) => {\n if (!isScheduled)\n callback(...args);\n isScheduled = true;\n scheduled();\n };\n const clear = () => {\n isScheduled = false;\n scheduled.clear();\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(func, { clear });\n}\nfunction leadingAndTrailing(schedule, callback, wait) {\n if (isServer) {\n let called = false;\n const scheduled2 = (...args) => {\n if (called)\n return;\n called = true;\n callback(...args);\n };\n return Object.assign(scheduled2, { clear: () => void 0 });\n }\n let State;\n ((State2) => {\n State2[State2[\"Ready\"] = 0] = \"Ready\";\n State2[State2[\"Leading\"] = 1] = \"Leading\";\n State2[State2[\"Trailing\"] = 2] = \"Trailing\";\n })(State || (State = {}));\n let state = 0 /* Ready */;\n const scheduled = schedule((args) => {\n state === 2 /* Trailing */ && callback(...args);\n state = 0 /* Ready */;\n }, wait);\n const fn = (...args) => {\n if (state !== 2 /* Trailing */) {\n if (state === 0 /* Ready */)\n callback(...args);\n state += 1;\n }\n scheduled(args);\n };\n const clear = () => {\n state = 0 /* Ready */;\n scheduled.clear();\n };\n if (getOwner())\n onCleanup(clear);\n return Object.assign(fn, { clear });\n}\nfunction createScheduled(schedule) {\n let listeners = 0;\n let isDirty = false;\n const [track, dirty] = createSignal(void 0, { equals: false });\n const call = schedule(() => {\n isDirty = true;\n dirty();\n });\n return () => {\n if (!isDirty)\n call(), track();\n if (isDirty) {\n isDirty = !!listeners;\n return true;\n }\n if (getListener()) {\n listeners++;\n onCleanup(() => listeners--);\n }\n return false;\n };\n}\n\nexport { createScheduled, debounce, leading, leadingAndTrailing, scheduleIdle, throttle };\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { untrack } from 'solid-js';\nimport SpeechEngine, {} from './speech.js';\nimport { debounce } from '@solid-primitives/scheduled';\nimport { focusPath } from '../useFocusManager.js';\nlet resetFocusPathTimer;\nlet prevFocusPath = [];\nlet currentlySpeaking;\nlet voiceOutDisabled = false;\nconst fiveMinutes = 300000;\nfunction debounceWithFlush(callback, time) {\n const trigger = debounce(callback, time);\n let scopedValue;\n const debounced = (newValue) => {\n scopedValue = newValue;\n trigger(newValue);\n };\n debounced.flush = () => {\n trigger.clear();\n callback(scopedValue);\n };\n debounced.clear = trigger.clear;\n return debounced;\n}\nfunction getElmName(elm) {\n return elm.id || elm.name;\n}\nfunction onFocusChangeCore(focusPath = []) {\n if (!Announcer.onFocusChange || !Announcer.enabled) {\n return;\n }\n const loaded = focusPath.every((elm) => !elm.loading);\n const focusDiff = focusPath.filter((elm) => !prevFocusPath.includes(elm));\n resetFocusPathTimer();\n if (!loaded && Announcer.onFocusChange) {\n Announcer.onFocusChange([]);\n return;\n }\n prevFocusPath = focusPath.slice(0);\n const toAnnounceText = [];\n const toAnnounce = focusDiff.reduce((acc, elm) => {\n if (elm.announce) {\n acc.push([getElmName(elm), 'Announce', elm.announce]);\n toAnnounceText.push(elm.announce);\n }\n else if (elm.title) {\n acc.push([getElmName(elm), 'Title', elm.title]);\n toAnnounceText.push(elm.title);\n }\n else {\n acc.push([getElmName(elm), 'No Announce', '']);\n }\n return acc;\n }, []);\n focusDiff.reverse().reduce((acc, elm) => {\n if (elm.announceContext) {\n acc.push([getElmName(elm), 'Context', elm.announceContext]);\n toAnnounceText.push(elm.announceContext);\n }\n else {\n acc.push([getElmName(elm), 'No Context', '']);\n }\n return acc;\n }, toAnnounce);\n if (Announcer.debug) {\n console.table(toAnnounce);\n }\n if (toAnnounceText.length) {\n return Announcer.speak(toAnnounceText.reduce((acc, val) => acc.concat(val), []));\n }\n}\nfunction textToSpeech(toSpeak) {\n if (voiceOutDisabled) {\n return;\n }\n return (currentlySpeaking = SpeechEngine(toSpeak));\n}\nexport const Announcer = {\n debug: false,\n enabled: true,\n cancel: function () {\n currentlySpeaking && currentlySpeaking.cancel();\n },\n clearPrevFocus: function (depth = 0) {\n prevFocusPath = prevFocusPath.slice(0, depth);\n resetFocusPathTimer();\n },\n speak: function (text, { append = false, notification = false } = {}) {\n if (Announcer.onFocusChange && Announcer.enabled) {\n Announcer.onFocusChange.flush();\n if (append && currentlySpeaking && currentlySpeaking.active) {\n currentlySpeaking.append(text);\n }\n else {\n Announcer.cancel();\n textToSpeech(text);\n }\n if (notification) {\n voiceOutDisabled = true;\n currentlySpeaking?.series\n .finally(() => {\n voiceOutDisabled = false;\n Announcer.refresh();\n })\n .catch(console.error);\n }\n }\n return currentlySpeaking;\n },\n refresh: function (depth = 0) {\n Announcer.clearPrevFocus(depth);\n Announcer.onFocusChange &&\n Announcer.onFocusChange(untrack(() => focusPath()));\n },\n setupTimers: function ({ focusDebounce = 400, focusChangeTimeout = fiveMinutes, } = {}) {\n Announcer.onFocusChange = debounceWithFlush(onFocusChangeCore, focusDebounce);\n resetFocusPathTimer = debounceWithFlush(() => {\n // Reset focus path for full announce\n prevFocusPath = [];\n }, focusChangeTimeout);\n },\n};\n//# sourceMappingURL=announcer.js.map","import { createSignal } from \"solid-js\";\nexport const [globalBackground, setGlobalBackground] = createSignal('');\n","var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;\nimport { ElementNode, createComponent, View, mergeProps, createElement, use, spread, insert, Show, Text as Text$7, memo, For as For$1 } from \"@lightningjs/solid\";\nimport theme from \"theme\";\nimport { withPadding } from \"@lightningjs/solid-primitives\";\nconst equalFn = (a, b) => a === b;\nconst $TRACK = Symbol(\"solid-track\");\nconst signalOptions = {\n equals: equalFn\n};\nlet runEffects = runQueue;\nconst STALE = 1;\nconst PENDING = 2;\nconst UNOWNED = {\n owned: null,\n cleanups: null,\n context: null,\n owner: null\n};\nvar Owner = null;\nlet Transition = null;\nlet ExternalSourceConfig = null;\nlet Listener = null;\nlet Updates = null;\nlet Effects = null;\nlet ExecCount = 0;\nfunction createRoot(fn, detachedOwner) {\n const listener = Listener, owner = Owner, unowned = fn.length === 0, current = detachedOwner === void 0 ? owner : detachedOwner, root = unowned ? UNOWNED : {\n owned: null,\n cleanups: null,\n context: current ? current.context : null,\n owner: current\n }, updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root)));\n Owner = root;\n Listener = null;\n try {\n return runUpdates(updateFn, true);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n}\nfunction createSignal(value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const s = {\n value,\n observers: null,\n observerSlots: null,\n comparator: options.equals || void 0\n };\n const setter = (value2) => {\n if (typeof value2 === \"function\") {\n value2 = value2(s.value);\n }\n return writeSignal(s, value2);\n };\n return [readSignal.bind(s), setter];\n}\nfunction createMemo(fn, value, options) {\n options = options ? Object.assign({}, signalOptions, options) : signalOptions;\n const c = createComputation(fn, value, true, 0);\n c.observers = null;\n c.observerSlots = null;\n c.comparator = options.equals || void 0;\n updateComputation(c);\n return readSignal.bind(c);\n}\nfunction untrack(fn) {\n if (Listener === null)\n return fn();\n const listener = Listener;\n Listener = null;\n try {\n if (ExternalSourceConfig)\n ;\n return fn();\n } finally {\n Listener = listener;\n }\n}\nfunction onCleanup(fn) {\n if (Owner === null)\n ;\n else if (Owner.cleanups === null)\n Owner.cleanups = [fn];\n else\n Owner.cleanups.push(fn);\n return fn;\n}\nfunction readSignal() {\n if (this.sources && this.state) {\n if (this.state === STALE)\n updateComputation(this);\n else {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(this), false);\n Updates = updates;\n }\n }\n if (Listener) {\n const sSlot = this.observers ? this.observers.length : 0;\n if (!Listener.sources) {\n Listener.sources = [this];\n Listener.sourceSlots = [sSlot];\n } else {\n Listener.sources.push(this);\n Listener.sourceSlots.push(sSlot);\n }\n if (!this.observers) {\n this.observers = [Listener];\n this.observerSlots = [Listener.sources.length - 1];\n } else {\n this.observers.push(Listener);\n this.observerSlots.push(Listener.sources.length - 1);\n }\n }\n return this.value;\n}\nfunction writeSignal(node, value, isComp) {\n let current = node.value;\n if (!node.comparator || !node.comparator(current, value)) {\n node.value = value;\n if (node.observers && node.observers.length) {\n runUpdates(() => {\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n const TransitionRunning = Transition && Transition.running;\n if (TransitionRunning && Transition.disposed.has(o))\n ;\n if (TransitionRunning ? !o.tState : !o.state) {\n if (o.pure)\n Updates.push(o);\n else\n Effects.push(o);\n if (o.observers)\n markDownstream(o);\n }\n if (!TransitionRunning)\n o.state = STALE;\n }\n if (Updates.length > 1e6) {\n Updates = [];\n if (false)\n ;\n throw new Error();\n }\n }, false);\n }\n }\n return value;\n}\nfunction updateComputation(node) {\n if (!node.fn)\n return;\n cleanNode(node);\n const time = ExecCount;\n runComputation(\n node,\n node.value,\n time\n );\n}\nfunction runComputation(node, value, time) {\n let nextValue;\n const owner = Owner, listener = Listener;\n Listener = Owner = node;\n try {\n nextValue = node.fn(value);\n } catch (err) {\n if (node.pure) {\n {\n node.state = STALE;\n node.owned && node.owned.forEach(cleanNode);\n node.owned = null;\n }\n }\n node.updatedAt = time + 1;\n return handleError(err);\n } finally {\n Listener = listener;\n Owner = owner;\n }\n if (!node.updatedAt || node.updatedAt <= time) {\n if (node.updatedAt != null && \"observers\" in node) {\n writeSignal(node, nextValue);\n } else\n node.value = nextValue;\n node.updatedAt = time;\n }\n}\nfunction createComputation(fn, init, pure, state = STALE, options) {\n const c = {\n fn,\n state,\n updatedAt: null,\n owned: null,\n sources: null,\n sourceSlots: null,\n cleanups: null,\n value: init,\n owner: Owner,\n context: Owner ? Owner.context : null,\n pure\n };\n if (Owner === null)\n ;\n else if (Owner !== UNOWNED) {\n {\n if (!Owner.owned)\n Owner.owned = [c];\n else\n Owner.owned.push(c);\n }\n }\n return c;\n}\nfunction runTop(node) {\n if (node.state === 0)\n return;\n if (node.state === PENDING)\n return lookUpstream(node);\n if (node.suspense && untrack(node.suspense.inFallback))\n return node.suspense.effects.push(node);\n const ancestors = [node];\n while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {\n if (node.state)\n ancestors.push(node);\n }\n for (let i = ancestors.length - 1; i >= 0; i--) {\n node = ancestors[i];\n if (node.state === STALE) {\n updateComputation(node);\n } else if (node.state === PENDING) {\n const updates = Updates;\n Updates = null;\n runUpdates(() => lookUpstream(node, ancestors[0]), false);\n Updates = updates;\n }\n }\n}\nfunction runUpdates(fn, init) {\n if (Updates)\n return fn();\n let wait = false;\n if (!init)\n Updates = [];\n if (Effects)\n wait = true;\n else\n Effects = [];\n ExecCount++;\n try {\n const res = fn();\n completeUpdates(wait);\n return res;\n } catch (err) {\n if (!wait)\n Effects = null;\n Updates = null;\n handleError(err);\n }\n}\nfunction completeUpdates(wait) {\n if (Updates) {\n runQueue(Updates);\n Updates = null;\n }\n if (wait)\n return;\n const e = Effects;\n Effects = null;\n if (e.length)\n runUpdates(() => runEffects(e), false);\n}\nfunction runQueue(queue) {\n for (let i = 0; i < queue.length; i++)\n runTop(queue[i]);\n}\nfunction lookUpstream(node, ignore) {\n node.state = 0;\n for (let i = 0; i < node.sources.length; i += 1) {\n const source = node.sources[i];\n if (source.sources) {\n const state = source.state;\n if (state === STALE) {\n if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))\n runTop(source);\n } else if (state === PENDING)\n lookUpstream(source, ignore);\n }\n }\n}\nfunction markDownstream(node) {\n for (let i = 0; i < node.observers.length; i += 1) {\n const o = node.observers[i];\n if (!o.state) {\n o.state = PENDING;\n if (o.pure)\n Updates.push(o);\n else\n Effects.push(o);\n o.observers && markDownstream(o);\n }\n }\n}\nfunction cleanNode(node) {\n let i;\n if (node.sources) {\n while (node.sources.length) {\n const source = node.sources.pop(), index = node.sourceSlots.pop(), obs = source.observers;\n if (obs && obs.length) {\n const n = obs.pop(), s = source.observerSlots.pop();\n if (index < obs.length) {\n n.sourceSlots[s] = index;\n obs[index] = n;\n source.observerSlots[index] = s;\n }\n }\n }\n }\n if (node.owned) {\n for (i = node.owned.length - 1; i >= 0; i--)\n cleanNode(node.owned[i]);\n node.owned = null;\n }\n if (node.cleanups) {\n for (i = node.cleanups.length - 1; i >= 0; i--)\n node.cleanups[i]();\n node.cleanups = null;\n }\n node.state = 0;\n}\nfunction castError(err) {\n if (err instanceof Error)\n return err;\n return new Error(typeof err === \"string\" ? err : \"Unknown error\", {\n cause: err\n });\n}\nfunction handleError(err, owner = Owner) {\n const error = castError(err);\n throw error;\n}\nconst FALLBACK = Symbol(\"fallback\");\nfunction dispose(d) {\n for (let i = 0; i < d.length; i++)\n d[i]();\n}\nfunction mapArray(list, mapFn, options = {}) {\n let items = [], mapped = [], disposers = [], len = 0, indexes = mapFn.length > 1 ? [] : null;\n onCleanup(() => dispose(disposers));\n return () => {\n let newItems = list() || [], i, j;\n newItems[$TRACK];\n return untrack(() => {\n let newLen = newItems.length, newIndices, newIndicesNext, temp, tempdisposers, tempIndexes, start, end, newEnd, item;\n if (newLen === 0) {\n if (len !== 0) {\n dispose(disposers);\n disposers = [];\n items = [];\n mapped = [];\n len = 0;\n indexes && (indexes = []);\n }\n if (options.fallback) {\n items = [FALLBACK];\n mapped[0] = createRoot((disposer) => {\n disposers[0] = disposer;\n return options.fallback();\n });\n len = 1;\n }\n } else if (len === 0) {\n mapped = new Array(newLen);\n for (j = 0; j < newLen; j++) {\n items[j] = newItems[j];\n mapped[j] = createRoot(mapper);\n }\n len = newLen;\n } else {\n temp = new Array(newLen);\n tempdisposers = new Array(newLen);\n indexes && (tempIndexes = new Array(newLen));\n for (start = 0, end = Math.min(len, newLen); start < end && items[start] === newItems[start]; start++)\n ;\n for (end = len - 1, newEnd = newLen - 1; end >= start && newEnd >= start && items[end] === newItems[newEnd]; end--, newEnd--) {\n temp[newEnd] = mapped[end];\n tempdisposers[newEnd] = disposers[end];\n indexes && (tempIndexes[newEnd] = indexes[end]);\n }\n newIndices = /* @__PURE__ */ new Map();\n newIndicesNext = new Array(newEnd + 1);\n for (j = newEnd; j >= start; j--) {\n item = newItems[j];\n i = newIndices.get(item);\n newIndicesNext[j] = i === void 0 ? -1 : i;\n newIndices.set(item, j);\n }\n for (i = start; i <= end; i++) {\n item = items[i];\n j = newIndices.get(item);\n if (j !== void 0 && j !== -1) {\n temp[j] = mapped[i];\n tempdisposers[j] = disposers[i];\n indexes && (tempIndexes[j] = indexes[i]);\n j = newIndicesNext[j];\n newIndices.set(item, j);\n } else\n disposers[i]();\n }\n for (j = start; j < newLen; j++) {\n if (j in temp) {\n mapped[j] = temp[j];\n disposers[j] = tempdisposers[j];\n if (indexes) {\n indexes[j] = tempIndexes[j];\n indexes[j](j);\n }\n } else\n mapped[j] = createRoot(mapper);\n }\n mapped = mapped.slice(0, len = newLen);\n items = newItems.slice(0);\n }\n return mapped;\n });\n function mapper(disposer) {\n disposers[j] = disposer;\n if (indexes) {\n const [s, set] = createSignal(j);\n indexes[j] = set;\n return mapFn(newItems[j], s);\n }\n return mapFn(newItems[j]);\n }\n };\n}\nfunction For(props) {\n const fallback = \"fallback\" in props && {\n fallback: () => props.fallback\n };\n return createMemo(mapArray(() => props.each, props.children, fallback || void 0));\n}\nconst defaultModeKeys = [\"focus\", \"disabled\"];\nconst defaultToneKeys = [\"brand\", \"inverse\", \"neutral\"];\nfunction makeComponentStyles({ themeKeys, base, modes, tones, themeStyles: themeStyles2, modeKeys = defaultModeKeys, toneKeys = defaultToneKeys }, debug = false) {\n const makeToneStyles = (tones2, themeComponentStyles, modeStyles) => {\n const toneStyles = toneKeys.map((tone) => {\n const styles2 = {};\n const styleList = new Set(\n [].concat.apply([], [(tones2 == null ? void 0 : tones2[tone]) ?? {}, (themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) ?? {}].map(Object.keys))\n );\n styleList.forEach((styleKey) => {\n var _a2, _b2;\n if (!modeKeys.includes(styleKey)) {\n styles2[styleKey] = ((_a2 = themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) == null ? void 0 : _a2[styleKey]) ?? ((_b2 = tones2 == null ? void 0 : tones2[tone]) == null ? void 0 : _b2[styleKey]);\n }\n });\n modeKeys.forEach((mode) => {\n var _a2, _b2;\n styles2[mode] = {\n ...modeStyles[mode],\n // fallbacks from base.mode\n ...(_a2 = tones2 == null ? void 0 : tones2[tone]) == null ? void 0 : _a2[mode],\n // component configured tone.mode\n ...(_b2 = themeComponentStyles == null ? void 0 : themeComponentStyles[tone]) == null ? void 0 : _b2[mode]\n // theme configure tone.mode\n };\n });\n return [tone, styles2];\n });\n return Object.fromEntries(toneStyles);\n };\n const makeModeStyles = (modes2, themeComponentStyles) => {\n const modeStyles = modeKeys.map((mode) => {\n return [mode, { ...modes2 == null ? void 0 : modes2[mode], ...themeComponentStyles == null ? void 0 : themeComponentStyles[mode] }];\n });\n const modeObject = Object.fromEntries(modeStyles);\n return modeObject;\n };\n const makeBaseStyles = (base2, themeComponentStyles) => {\n const baseStyles = {\n ...base2,\n ...themeComponentStyles.base\n };\n return baseStyles;\n };\n const mapThemeKeysToSolid = (stylesToMap) => Object.fromEntries(\n Object.entries(themeKeys).filter(([_, themeKey]) => stylesToMap[themeKey]).map(([solidKey, themeKey]) => [solidKey, stylesToMap[themeKey]])\n );\n const convertComponentConfig = (themeStyles3) => {\n const convertedThemeStyles = Object.fromEntries(\n // iterate through each variant\n Object.entries(themeStyles3).map(([variantName, styles2]) => {\n const convertedStyles = mapThemeKeysToSolid(styles2);\n Object.entries(styles2).filter(([styleName, _]) => modeKeys.includes(styleName)).forEach(([modeName, modeStyles]) => {\n convertedStyles[modeName] = mapThemeKeysToSolid(modeStyles);\n });\n return [variantName, convertedStyles];\n })\n );\n return convertedThemeStyles;\n };\n const generateSolidStylesFromLookupObject = (base2, modes2, tones2) => {\n const themeComponentStyles = convertComponentConfig(themeStyles2);\n debug && console.log(themeComponentStyles);\n const baseStyles = makeBaseStyles(base2, themeComponentStyles);\n debug && console.log(baseStyles);\n const modeStyles = makeModeStyles(modes2, themeComponentStyles);\n debug && console.log(modeStyles);\n const toneStyles = makeToneStyles(tones2, themeComponentStyles, modeStyles);\n debug && console.log(toneStyles);\n return {\n base: {\n ...baseStyles,\n ...modeStyles\n },\n tones: toneStyles\n };\n };\n return generateSolidStylesFromLookupObject(base, modes, tones);\n}\nfunction withScrolling(adjustment = 0) {\n return (componentRef, selectedElement, selected, lastSelected) => {\n if (componentRef.children.length === 0) {\n return;\n }\n const gap = componentRef.gap || 0;\n const scroll = componentRef.scroll || \"auto\";\n const [lastItem, windowVal] = updateLastIndex(componentRef);\n const currentVal = componentRef.flexDirection === \"row\" ? componentRef.x : componentRef.y;\n const newVal = componentRef.flexDirection === \"row\" ? selectedElement.x : selectedElement.y;\n const size2 = componentRef.flexDirection === \"row\" ? selectedElement.width : selectedElement.height;\n const direct = selected > lastSelected ? \"positive\" : \"negative\";\n let next = currentVal;\n if (scroll === \"auto\") {\n if (componentRef.scrollIndex != void 0 && componentRef.scrollIndex >= 0) {\n if (componentRef.selected >= componentRef.scrollIndex) {\n if (direct === \"positive\") {\n next = currentVal - size2 - gap;\n } else {\n next = currentVal + size2 + gap;\n }\n }\n } else if (Math.abs(currentVal) + windowVal < lastItem.position + lastItem.size || newVal < Math.abs(currentVal)) {\n next = -newVal + adjustment;\n }\n } else if (scroll === \"always\" || scroll === \"edge\" && direct === \"negative\" && Math.abs(currentVal) > newVal) {\n next = -newVal + adjustment;\n } else if (scroll === \"edge\" && direct === \"positive\" && Math.abs(currentVal) + windowVal < newVal + size2) {\n next = currentVal - size2 - gap;\n }\n if (componentRef.flexDirection === \"row\" && componentRef.x !== next) {\n componentRef.x = next;\n } else if (componentRef.flexDirection === \"column\" && componentRef.y !== next) {\n componentRef.y = next;\n }\n };\n}\nfunction updateLastIndex(items) {\n let lastItem, windowVal;\n if (items.flexDirection === \"row\") {\n lastItem = {\n position: items.children[items.children.length - 1].x,\n size: items.children[items.children.length - 1].width\n };\n windowVal = items.width;\n } else {\n lastItem = {\n position: items.children[items.children.length - 1].y,\n size: items.children[items.children.length - 1].height\n };\n windowVal = items.height;\n }\n return [lastItem, windowVal];\n}\nconst useItemLayout = (itemLayout) => {\n if (itemLayout) {\n const width = (theme.layout.screenW - theme.layout.marginX * 2) / itemLayout.upCount - theme.layout.gutterX;\n const height = width / itemLayout.ratioX * itemLayout.ratioY;\n return { width, height };\n }\n return {};\n};\nconst chainFunctions = (...args) => {\n const onlyFunctions = args.filter((func) => typeof func === \"function\");\n if (onlyFunctions.length === 0) {\n return void 0;\n }\n return function(...innerArgs) {\n for (const func of onlyFunctions) {\n if (func.apply(this, innerArgs) === true) {\n return true;\n }\n }\n };\n};\nfunction assertTruthy(condition, message) {\n return;\n}\nfunction onGridFocus() {\n if (!this || this.selected === void 0 || this.children.length === 0)\n return false;\n let child = this.children[this.selected];\n while (child == null ? void 0 : child.skipFocus) {\n this.selected++;\n child = this.children[this.selected];\n }\n if (!(child instanceof ElementNode))\n return false;\n child.setFocus();\n}\nfunction handleNavigation(direction) {\n return function() {\n var _a2, _b2;\n const numChildren = this.children.length;\n const wrap = this.wrap;\n const lastSelected = this.selected || 0;\n if (numChildren === 0) {\n return false;\n }\n if (direction === \"right\" || direction === \"down\") {\n do {\n this.selected = (this.selected || 0) % numChildren + 1;\n if (this.selected >= numChildren) {\n if (!wrap) {\n this.selected = void 0;\n break;\n }\n this.selected = 0;\n }\n } while ((_a2 = this.children[this.selected]) == null ? void 0 : _a2.skipFocus);\n } else if (direction === \"left\" || direction === \"up\") {\n do {\n this.selected = (this.selected || 0) % numChildren - 1;\n if (this.selected < 0) {\n if (!wrap) {\n this.selected = void 0;\n break;\n }\n this.selected = numChildren - 1;\n }\n } while ((_b2 = this.children[this.selected]) == null ? void 0 : _b2.skipFocus);\n }\n if (this.selected === void 0) {\n this.selected = lastSelected;\n if (this.children[this.selected].states.has(\"focus\")) {\n return false;\n }\n }\n const active = this.children[this.selected];\n this.onSelectedChanged && this.onSelectedChanged.call(this, this, active, this.selected, lastSelected);\n if (this.plinko && lastSelected !== void 0) {\n const lastSelectedChild = this.children[lastSelected];\n const num = lastSelectedChild.selected || 0;\n active.selected = num < active.children.length ? num : active.children.length - 1;\n }\n active.setFocus();\n return true;\n };\n}\nfunction scrollToIndex(componentRef, selectedIndex) {\n if (!componentRef || componentRef.selected === void 0 || componentRef.children.length === 0 || componentRef.children.length <= selectedIndex || componentRef.selected === selectedIndex) {\n return false;\n }\n componentRef.selected = selectedIndex;\n if (componentRef.flexDirection === \"row\") {\n componentRef.x = -componentRef.children[selectedIndex].x;\n } else if (componentRef.flexDirection === \"column\") {\n componentRef.y = -componentRef.children[selectedIndex].y;\n }\n}\nconst { Artwork: { defaultTone: defaultTone$e, ...themeStyles$d } = { styles: {} } } = (_a = theme) == null ? void 0 : _a.componentConfig;\nconst container$e = {\n themeKeys: {\n fillColor: \"fillColor\",\n borderRadius: \"borderRadius\",\n scale: \"imageScale\",\n pivotX: \"imageScalePivotX\",\n pivotY: \"imageScalePivotY\"\n },\n base: {\n borderRadius: theme.radius.md,\n fallbackSrc: void 0,\n fillColor: theme.color.overlay,\n gradientColor: theme.color.material,\n pivotX: 0.5,\n pivotY: 0.5,\n scale: void 0\n },\n themeStyles: themeStyles$d\n};\nconst Container$e = makeComponentStyles(container$e);\nconst styles$e = {\n tone: defaultTone$e || \"neutral\",\n Container: Container$e\n};\nconst formatArtwork = (props) => {\n let src = props.src ? props.src : props.fallbackSrc;\n if (src && props.srcCallback && typeof props.srcCallback === \"function\") {\n src = props.srcCallback({\n closestAspectRatio: void 0,\n aspectRatio: void 0,\n src,\n width: props.width,\n height: props.height\n });\n }\n return src;\n};\nconst Artwork = (props) => {\n const formattedArtwork = createMemo(() => formatArtwork(props));\n return createComponent(View, mergeProps(props, {\n get color() {\n var _a2;\n return Boolean(formattedArtwork()) ? void 0 : props.color ?? ((_a2 = styles$e.Container.tones[props.tone ?? styles$e.tone]) == null ? void 0 : _a2.fillColor) ?? styles$e.Container.base.fillColor;\n },\n get style() {\n return [...[props.style].flat(), styles$e.Container.tones[props.tone || styles$e.tone], styles$e.Container.base];\n },\n get src() {\n return formattedArtwork();\n }\n }));\n};\nconst { Icon: { defaultTone: defaultTone$d, ...themeStyles$c } = { styles: {} } } = (_b = theme) == null ? void 0 : _b.componentConfig;\nconst container$d = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n width: 100,\n height: 100,\n color: theme.color.fillInverse\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand\n }\n },\n themeStyles: themeStyles$c\n};\nconst Container$d = makeComponentStyles(container$d);\nconst styles$d = {\n tone: defaultTone$d || \"neutral\",\n Container: Container$d\n};\nconst Icon$3 = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$d.Container.tones) == null ? void 0 : _a2[props.tone || styles$d.tone],\n styles$d.Container.base\n ];\n },\n forwardStates: true\n }));\n};\nconst { Badge: { defaultTone: defaultTone$c, ...themeStyles$b } = { styles: {} } } = (_c = theme) == null ? void 0 : _c.componentConfig;\nconst container$c = {\n themeKeys: {\n color: \"backgroundColor\"\n },\n base: {\n color: theme.color.fillInverseSecondary,\n borderRadius: theme.radius.sm,\n // borderRadius must be applied _before_ border to prevent the node from breaking\n border: {\n color: theme.color.strokeInverse,\n width: theme.stroke.sm\n },\n display: \"flex\",\n justifyContent: \"spaceEvenly\",\n padding: [\n theme.spacer.md - theme.stroke.sm,\n theme.spacer.xs + theme.stroke.sm,\n theme.spacer.md + theme.stroke.sm,\n theme.spacer.md + theme.stroke.sm\n ]\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutralSecondary,\n borderRadius: theme.radius.sm,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: theme.stroke.sm\n }\n },\n brand: {\n color: theme.color.fillBrand,\n borderRadius: theme.radius.sm,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: theme.stroke.sm\n }\n }\n },\n themeStyles: themeStyles$b\n};\nconst text$6 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.tag1,\n color: theme.color.textNeutral\n },\n tones: {\n inverse: {\n color: theme.color.textInverse\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$b\n};\nconst icon$2 = {\n themeKeys: {\n color: \"iconColor\"\n },\n base: {\n color: theme.color.textNeutral\n },\n tones: {\n inverse: {\n color: theme.color.textInverse\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$b\n};\nconst Container$c = makeComponentStyles(container$c);\nconst Icon$2 = makeComponentStyles(icon$2);\nconst Text$6 = makeComponentStyles(text$6);\nconst styles$c = {\n tone: defaultTone$c || \"neutral\",\n Container: Container$c,\n Icon: Icon$2,\n Text: Text$6\n};\nconst Badge = (props) => {\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2, _b2;\n return props.padding ?? ((_b2 = (_a2 = styles$c.Container) == null ? void 0 : _a2.tones[props.tone ?? styles$c.tone]) == null ? void 0 : _b2.padding) ?? styles$c.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$c.Container.tones[props.tone || styles$c.tone],\n styles$c.Container.base\n ];\n },\n \"forwardStates\": true\n }), true);\n insert(_el$, createComponent(Show, {\n get when() {\n return Boolean(props.icon && props.iconAlign !== \"right\");\n },\n get children() {\n return createComponent(Icon$3, mergeProps(() => props.icon, {\n get style() {\n return [styles$c.Icon.tones[props.tone ?? styles$c.tone], styles$c.Icon.base];\n }\n }));\n }\n }), null);\n insert(_el$, createComponent(Text$7, {\n get style() {\n return [styles$c.Text.tones[props.tone ?? styles$c.tone], styles$c.Text.base];\n },\n get tone() {\n return props.tone || styles$c.tone;\n },\n get children() {\n return props.title;\n }\n }), null);\n insert(_el$, createComponent(Show, {\n get when() {\n return Boolean(props.icon && props.iconAlign === \"right\");\n },\n get children() {\n return createComponent(Icon$3, mergeProps(() => props.icon, {\n get style() {\n var _a2;\n return [\n (_a2 = styles$c.Icon.tones) == null ? void 0 : _a2[props.tone ?? styles$c.tone],\n //\n styles$c.Icon.base\n ];\n }\n }));\n }\n }), null);\n return _el$;\n })();\n};\nconst { Button: { defaultTone: defaultTone$b, ...themeStyles$a } = { styles: {} } } = (_d = theme) == null ? void 0 : _d.componentConfig;\nconst container$b = {\n themeKeys: {\n textAlign: \"textAlign\",\n borderRadius: \"radius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\"\n },\n base: {\n height: theme.typography.button1.lineHeight + theme.spacer.xl * 2,\n display: \"flex\",\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n color: theme.color.interactiveNeutral,\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm,\n contentColor: theme.color.fillNeutral\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse\n },\n brand: {\n color: theme.color.interactiveBrand,\n focus: {\n color: theme.color.fillNeutral\n }\n }\n },\n themeStyles: themeStyles$a\n};\nconst content = {\n themeKeys: {\n color: \"contentColor\"\n },\n base: {\n color: theme.color.textNeutral\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.fillBrand\n }\n }\n },\n themeStyles: themeStyles$a\n};\nconst text$5 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.button1\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.fillBrand\n }\n }\n },\n themeStyles: themeStyles$a\n};\nconst Container$b = makeComponentStyles(container$b);\nconst Content = makeComponentStyles(content);\nconst Text$5 = makeComponentStyles(text$5);\nconst styles$b = {\n tone: defaultTone$b || \"neutral\",\n Container: Container$b,\n Content,\n Text: Text$5\n};\nconst Button = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$b.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$b.tone],\n styles$b.Container.base\n ];\n },\n forwardStates: true,\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n ...[(_a2 = props.style) == null ? void 0 : _a2.Text].flat(),\n //\n styles$b.Text.tones[props.tone ?? styles$b.tone],\n styles$b.Text.base\n ];\n },\n get children() {\n return props.children;\n }\n });\n }\n }));\n};\nconst ButtonContainer = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$b.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$b.tone],\n styles$b.Container.base\n ];\n },\n forwardStates: true\n }));\n};\nconst { Checkbox: { defaultTone: defaultTone$a, ...themeStyles$9 } = { styles: {} } } = (_e = theme) == null ? void 0 : _e.componentConfig;\nconst strokeWidth = theme.stroke.sm;\nconst size = theme.spacer.xxl;\nconst container$a = {\n themeKeys: {\n color: \"color\",\n borderRadius: \"borderRadius\",\n border: \"border\",\n justifyContent: \"justifyContent\"\n },\n base: {\n width: size,\n height: size,\n display: \"flex\",\n justifyContent: \"center\",\n color: theme.color.fillNeutral,\n alignItems: \"center\",\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverse,\n width: strokeWidth\n }\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n tones: {\n brand: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutralSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillBrand\n }\n },\n neutral: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillInverseSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeNeutralSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutral\n }\n },\n inverse: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: strokeWidth\n },\n color: theme.color.fillNeutralSecondary,\n checked: {\n borderRadius: size / 4,\n border: {\n color: theme.color.strokeInverseSecondary,\n width: strokeWidth\n },\n color: theme.color.fillInverse\n }\n }\n },\n modeKeys: [\"focus\", \"disabled\", \"checked\"],\n themeStyles: themeStyles$9\n};\nconst icon$1 = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n width: theme.spacer.lg,\n height: theme.spacer.lg,\n src: theme.asset.check\n },\n tones: {\n neutral: {\n color: theme.color.fillInverse\n },\n inverse: {\n color: theme.color.fillNeutral\n },\n brand: {\n color: theme.color.fillInverse\n }\n },\n themeStyles: themeStyles$9\n};\nconst Container$a = makeComponentStyles(container$a);\nconst Icon$1 = makeComponentStyles(icon$1);\nconst styles$a = {\n tone: defaultTone$a || \"neutral\",\n Container: Container$a,\n Icon: Icon$1\n};\nconst check = \"/assets/images/check-icon.png\";\nconst Checkbox = (props) => {\n return createComponent(View, mergeProps({\n forwardStates: true\n }, props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$a.Container.tones[props.tone ?? styles$a.tone],\n styles$a.Container.base\n ];\n },\n get states() {\n return {\n checked: props.checked\n };\n },\n get children() {\n return memo(() => !!props.checked)() ? props.children || createComponent(Icon$3, {\n src: check,\n get style() {\n var _a2;\n return [\n ...[(_a2 = props.style) == null ? void 0 : _a2.Icon].flat(),\n //\n styles$a.Icon.tones[props.tone || styles$a.tone],\n styles$a.Icon.base\n ];\n }\n }) : \"\";\n }\n }));\n};\nconst { Column: { defaultTone: defaultTone$9, ...themeStyles$8 } = { styles: {} } } = (_f = theme) == null ? void 0 : _f.componentConfig;\nconst container$9 = {\n themeKeys: {\n gap: \"itemSpacing\",\n scrollIndex: \"scrollIndex\",\n itemTransition: \"itemTransition\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"flexStart\",\n flexDirection: \"column\",\n gap: theme.layout.gutterY,\n itemTransition: {\n ...theme.animation.standardEntrance,\n duration: theme.animation.duration.fast\n }\n },\n themeStyles: themeStyles$8\n};\nconst Container$9 = makeComponentStyles(container$9);\nconst styles$9 = {\n tone: defaultTone$9 || \"neutral\",\n Container: Container$9\n};\nconst Column = (props) => {\n const onUp = handleNavigation(\"up\");\n const onDown = handleNavigation(\"down\");\n return createComponent(View, mergeProps(props, {\n get onUp() {\n return chainFunctions(props.onUp, onUp);\n },\n get onDown() {\n return chainFunctions(props.onDown, onDown);\n },\n get selected() {\n return props.selected || 0;\n },\n forwardFocus: onGridFocus,\n get onSelectedChanged() {\n return chainFunctions(props.onSelectedChanged, props.scroll !== \"none\" ? withScrolling(props.y) : void 0);\n },\n get style() {\n return [...[props.style].flat(), styles$9.Container.tones[props.tone ?? styles$9.tone], styles$9.Container.base];\n }\n }));\n};\nconst { Label: { defaultTone: defaultTone$8, ...themeStyles$7 } = { styles: {} } } = (_g = theme) == null ? void 0 : _g.componentConfig;\nconst container$8 = {\n themeKeys: {\n color: \"backgroundColor\",\n borderRadius: \"radius\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"center\",\n color: theme.color.textNeutral,\n padding: [theme.spacer.md, theme.spacer.lg],\n // TODO themed padding values\n borderRadius: [theme.radius.md, theme.radius.md, theme.radius.md, theme.radius.none],\n height: theme.typography.caption1.lineHeight + theme.spacer.md,\n neutral: {\n backgroundColor: theme.color.fillNeutral\n }\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand,\n focus: {\n color: theme.color.orange\n }\n }\n },\n themeStyles: themeStyles$7\n};\nconst text$4 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.caption1,\n color: theme.color.textInverse\n },\n tones: {\n inverse: {\n color: theme.color.textNeutral\n },\n brand: {\n color: theme.color.textNeutral\n }\n },\n themeStyles: themeStyles$7\n};\nconst Container$8 = makeComponentStyles(container$8);\nconst Text$4 = makeComponentStyles(text$4);\nconst styles$8 = {\n tone: defaultTone$8 || \"neutral\",\n Container: Container$8,\n Text: Text$4\n};\nconst Label = (props) => {\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2;\n return props.padding ?? ((_a2 = styles$8.Container.tones[props.tone ?? styles$8.tone]) == null ? void 0 : _a2.padding) ?? styles$8.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n get style() {\n return [\n ...[props.style].flat(),\n //\n styles$8.Container.tones[props.tone || styles$8.tone],\n styles$8.Container.base\n ];\n },\n \"forwardStates\": true\n }), true);\n insert(_el$, createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$8.Text.tones[props.tone || styles$8.tone],\n styles$8.Text.base\n ];\n },\n get children() {\n return props.title;\n }\n }));\n return _el$;\n })();\n};\nconst { Rating: { styles: themeStyles$6, defaultTone: defaultTone$7 } = { styles: {}, defaultTone: \"neutral\" } } = (_h = theme) == null ? void 0 : _h.componentConfig;\nconst container$7 = {\n themeKeys: {\n justifyContent: \"justifyContent\",\n itemSpacing: \"itemSpacing\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n itemSpacing: theme.spacer.sm\n },\n toneModes: {},\n themeStyles: themeStyles$6\n};\nconst text$3 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n color: theme.color.textNeutral,\n ...theme.typography.body2\n },\n toneModes: {},\n themeStyles: themeStyles$6\n};\nconst icon = {\n themeKeys: {\n color: \"color\"\n },\n base: {\n height: theme.typography.body2.lineHeight,\n width: theme.typography.body2.lineHeight,\n color: theme.color.fillNeutral,\n marginRight: theme.spacer.sm\n },\n toneModes: {},\n themeStyles: themeStyles$6\n};\nconst Container$7 = makeComponentStyles(container$7);\nconst Icon = makeComponentStyles(icon);\nconst Text$3 = makeComponentStyles(text$3);\nconst styles$7 = {\n tone: defaultTone$7,\n Container: Container$7,\n Text: Text$3,\n Icon\n};\nconst Rating = (props) => {\n const formatTitle = (title) => {\n if (typeof title !== \"string\" && typeof title !== \"number\" || !String(title).trim().length) {\n return;\n }\n let formatted = title;\n if (!Number.isNaN(title) && Number(title) >= 0 && Number(title) <= 100) {\n formatted += \"%\";\n }\n return formatted;\n };\n const formattedTitle = createMemo(() => formatTitle(props.title));\n return createComponent(View, mergeProps(props, {\n forwardStates: true,\n get style() {\n return [...[props.style].flat(), styles$7.Container.tones[props.tone || styles$7.tone], styles$7.Container.base];\n },\n get children() {\n return [createComponent(Show, {\n get when() {\n return props.src;\n },\n get children() {\n return createComponent(Icon$3, {\n forwardStates: true,\n get src() {\n return props.src;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Icon,\n //\n styles$7.Icon.tones[props.tone || styles$7.tone],\n styles$7.Icon.base\n ];\n }\n });\n }\n }), createComponent(Show, {\n get when() {\n return formattedTitle();\n },\n get children() {\n return createComponent(Text$7, {\n get marginRight() {\n return props.marginRight;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$7.Text.tones[props.tone || styles$7.tone],\n styles$7.Text.base\n ];\n },\n get children() {\n return formattedTitle();\n }\n });\n }\n })];\n }\n }));\n};\nconst { Details: { defaultTone: defaultTone$6, ...themeStyles$5 } = { styles: {} } } = (_i = theme) == null ? void 0 : _i.componentConfig;\nconst container$6 = {\n themeKeys: {\n alignItems: \"alignItems\",\n contentSpacing: \"contentSpacing\",\n badgeContentSpacing: \"badgeContentSpacing\",\n ratingContentSpacing: \"ratingContentSpacing\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n contentSpacing: theme.spacer.lg,\n badgeContentSpacing: theme.spacer.sm,\n ratingContentSpacing: theme.spacer.lg\n },\n themeStyles: themeStyles$5\n};\nconst text$2 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n ...theme.typography.body2,\n marginRight: theme.spacer.lg,\n color: theme.color.textNeutral\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverse,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutral,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$5\n};\nconst Container$6 = makeComponentStyles(container$6);\nconst Text$2 = makeComponentStyles(text$2);\nconst styles$6 = {\n tone: defaultTone$6 || \"neutral\",\n Container: Container$6,\n Text: Text$2\n};\nconst Details = (props) => {\n return createComponent(View, mergeProps({\n get style() {\n return [...[props.style].flat(), styles$6.Container.tones[props.tone || styles$6.tone], styles$6.Container.base];\n },\n forwardStates: true,\n onBeforeLayout: (node, dimensions) => {\n var _a2;\n if ((dimensions == null ? void 0 : dimensions.height) && node.parent) {\n node.parent.height = dimensions.height;\n (_a2 = node.parent) == null ? void 0 : _a2.updateLayout();\n }\n }\n }, props, {\n get children() {\n return [createComponent(Show, {\n get when() {\n return props.title;\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$6.Text.tones[props.tone || styles$6.tone],\n styles$6.Text.base\n ];\n },\n get children() {\n return props.title;\n }\n });\n }\n }), createComponent(For$1, {\n get each() {\n return props.badges;\n },\n children: (badge, idx) => createComponent(Badge, mergeProps(badge, {\n get marginRight() {\n var _a2, _b2, _c2, _d2, _e2, _f2, _g2;\n return ((_a2 = props.badges) == null ? void 0 : _a2.length) && idx() === props.badges.length - 1 ? ((_c2 = (_b2 = props.style) == null ? void 0 : _b2.Container) == null ? void 0 : _c2.contentSpacing) ?? ((_d2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _d2.contentSpacing) ?? styles$6.Container.base.contentSpacing : ((_f2 = (_e2 = props.style) == null ? void 0 : _e2.Container) == null ? void 0 : _f2.badgeContentSpacing) ?? ((_g2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _g2.badgeContentSpacing) ?? styles$6.Container.base.badgeContentSpacing;\n }\n }))\n }), createComponent(For$1, {\n get each() {\n return props.ratings;\n },\n children: (rating, idx) => createComponent(Rating, mergeProps(rating, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$6.Text.tones[props.tone || styles$6.tone],\n styles$6.Text.base\n ];\n },\n forwardStates: true,\n get marginRight() {\n var _a2, _b2, _c2, _d2;\n return ((_a2 = props.ratings) == null ? void 0 : _a2.length) && idx() === props.ratings.length - 1 ? 0 : ((_c2 = (_b2 = props.style) == null ? void 0 : _b2.Container) == null ? void 0 : _c2.ratingContentSpacing) ?? ((_d2 = styles$6.Container.tones[props.tone ?? styles$6.tone]) == null ? void 0 : _d2.ratingContentSpacing) ?? styles$6.Container.base.ratingContentSpacing;\n }\n }))\n })];\n }\n }));\n};\nconst { Metadata: { defaultTone: defaultTone$5, ...themeStyles$4 } = { styles: {} } } = (_j = theme) == null ? void 0 : _j.componentConfig;\nconst container$5 = {\n themeKeys: {\n justifyContent: \"justifyContent\",\n alpha: \"alpha\"\n },\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n alpha: theme.alpha.primary\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n themeStyles: themeStyles$4\n};\nconst titleText = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n maxLines: 1,\n contain: \"width\",\n ...theme.typography.headline3,\n color: theme.color.textNeutral\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverse,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutral,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$4\n};\nconst descriptionText = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n contain: \"width\",\n maxLines: 2,\n ...theme.typography.body2,\n color: theme.color.textNeutralSecondary\n },\n tones: {\n neutral: {\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n inverse: {\n color: theme.color.textInverseSecondary,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n brand: {\n color: theme.color.textNeutralSecondary,\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n }\n },\n themeStyles: themeStyles$4\n};\nconst Container$5 = makeComponentStyles(container$5);\nconst DescriptionText = makeComponentStyles(descriptionText);\nconst TitleText = makeComponentStyles(titleText);\nconst styles$5 = {\n tone: defaultTone$5 || \"neutral\",\n Container: Container$5,\n TitleText,\n DescriptionText\n};\nconst Metadata = (props) => {\n return createComponent(View, mergeProps(props, {\n get style() {\n return [...[props.style].flat(), styles$5.Container.tones[props.tone || styles$5.tone], styles$5.Container.base];\n },\n forwardStates: true,\n get children() {\n return [createComponent(Text$7, {\n get width() {\n return props.width;\n },\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.TitleText,\n //\n styles$5.TitleText.tones[props.tone || styles$5.tone],\n styles$5.TitleText.base\n ];\n },\n get children() {\n return props.title;\n }\n }), createComponent(Show, {\n get when() {\n return props.description;\n },\n get children() {\n return createComponent(Text$7, {\n get width() {\n return props.width;\n },\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.DescriptionText, styles$5.DescriptionText.tones[props.tone || styles$5.tone], styles$5.DescriptionText.base];\n },\n get children() {\n return props.description;\n }\n });\n }\n }), createComponent(Details, mergeProps({\n get width() {\n return props.width;\n }\n }, () => props.details, {\n get tone() {\n return props.tone ?? styles$5.tone;\n }\n }))];\n }\n }));\n};\nconst { ProgressBar: { defaultTone: defaultTone$4, ...themeStyles$3 } = { styles: {} } } = (_k = theme) == null ? void 0 : _k.componentConfig;\nconst container$4 = {\n themeKeys: {\n color: \"barColor\",\n borderRadius: \"borderRadius\"\n },\n base: {\n height: theme.spacer.md,\n color: theme.color.fillNeutralTertiary,\n borderRadius: theme.radius.xs\n },\n tones: {\n inverse: {\n color: theme.color.fillInverseTertiary\n }\n },\n themeStyles: themeStyles$3\n};\nconst progress = {\n themeKeys: {\n color: \"progressColor\",\n borderRadius: \"borderRadius\"\n },\n base: {\n borderRadius: theme.radius.xs,\n color: theme.color.fillNeutral\n },\n tones: {\n inverse: {\n color: theme.color.fillInverse\n },\n brand: {\n color: theme.color.fillBrand\n }\n },\n themeStyles: themeStyles$3\n};\nconst Container$4 = makeComponentStyles(container$4);\nconst ProgressBar$1 = makeComponentStyles(progress);\nconst styles$4 = {\n tone: defaultTone$4 || \"neutral\",\n Container: Container$4,\n ProgressBar: ProgressBar$1\n};\nconst ProgressBar = (props) => {\n return createComponent(View, mergeProps(props, {\n forwardStates: true,\n get style() {\n return [...[props.style].flat(), styles$4.Container.tones[props.tone || styles$4.tone], styles$4.Container.base];\n },\n get children() {\n return createComponent(View, {\n forwardStates: true,\n get animationSettings() {\n return props.animationSettings;\n },\n get width() {\n return props.width * props.progress;\n },\n get color() {\n return props.progressColor;\n },\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.ProgressBar, styles$4.ProgressBar.tones[props.tone || styles$4.tone], styles$4.ProgressBar.base];\n }\n });\n }\n }));\n};\nconst { Row: { defaultTone: defaultTone$3, ...themeStyles$2 } = { styles: {} } } = (_l = theme) == null ? void 0 : _l.componentConfig;\nconst container$3 = {\n themeKeys: {\n gap: \"itemSpacing\",\n scrollIndex: \"scrollIndex\",\n itemTransition: \"itemTransition\"\n },\n base: {\n display: \"flex\",\n justifyContent: \"flexStart\",\n flexDirection: \"row\",\n gap: theme.layout.gutterX,\n width: theme.layout.screenW,\n itemTransition: {\n ...theme.animation.standardEntrance,\n duration: theme.animation.duration.fast\n }\n },\n themeStyles: themeStyles$2\n};\nconst Container$3 = makeComponentStyles(container$3);\nconst styles$3 = {\n tone: defaultTone$3,\n Container: Container$3\n};\nconst Row = (props) => {\n const onLeft = handleNavigation(\"left\");\n const onRight = handleNavigation(\"right\");\n return createComponent(View, mergeProps(props, {\n get selected() {\n return props.selected || 0;\n },\n get onLeft() {\n return chainFunctions(props.onLeft, onLeft);\n },\n get onRight() {\n return chainFunctions(props.onRight, onRight);\n },\n forwardFocus: onGridFocus,\n get onSelectedChanged() {\n return chainFunctions(props.onSelectedChanged, props.scroll !== \"none\" ? withScrolling(props.x) : void 0);\n },\n get tone() {\n return props.tone ?? styles$3.tone;\n },\n get style() {\n return [...[props.style].flat(), styles$3.Container.tones[props.tone || styles$3.tone], styles$3.Container.base];\n },\n get states() {\n return props.tone ?? styles$3.tone;\n }\n }));\n};\nconst { Keyboard: { defaultTone: defaultTone$2, ...themeStyles$1 } = { styles: {} } } = (_m = theme) == null ? void 0 : _m.componentConfig;\nconst container$2 = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n screenW: \"screenW\",\n marginX: \"marginX\"\n },\n base: {\n keySpacing: theme.spacer.md,\n screenW: theme.layout.screenW,\n marginX: theme.layout.marginX,\n height: 100\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$1\n};\nconst key = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n textAlign: \"textAlign\",\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\",\n baseWidth: \"baseWidth\",\n sizes: \"sizes\",\n contentColor: \"contentColor\"\n // what is this used for\n },\n base: {\n keySpacing: theme.spacer.md,\n height: theme.spacer.md * 9,\n paddingX: theme.spacer.md,\n sizes: {\n sm: 1,\n md: 2,\n lg: 3,\n xl: 4,\n xxl: 5\n },\n contentColor: theme.color.fillNeutral,\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n baseWidth: theme.spacer.md * 7,\n color: theme.color.interactiveNeutral,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled,\n contentColor: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse,\n focus: {\n color: theme.color.interactiveInverseFocus,\n contentColor: theme.color.fillNeutral\n }\n },\n brand: {\n focus: {\n contentColor: theme.color.fillNeutral\n }\n }\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$1\n};\nconst text$1 = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.headline2\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n focus: {\n color: theme.color.textNeutral\n }\n }\n },\n // @ts-expect-error see TODO\n themeStyles: themeStyles$1\n};\nconst Container$2 = makeComponentStyles(container$2);\nconst Key$1 = makeComponentStyles(key);\nconst Text$1 = makeComponentStyles(text$1);\nconst styles$2 = {\n tone: defaultTone$2,\n Container: Container$2,\n Key: Key$1,\n // TODO why was this wrapped in {}?\n Text: Text$1\n};\nconst { Key: { defaultTone: defaultTone$1, ...themeStyles } = { styles: {} } } = (_n = theme) == null ? void 0 : _n.componentConfig;\nconst container$1 = {\n themeKeys: {\n keySpacing: \"keySpacing\",\n textAlign: \"textAlign\",\n borderRadius: \"borderRadius\",\n color: \"backgroundColor\",\n justifyContent: \"justifyContent\",\n baseWidth: \"baseWidth\",\n sizes: \"sizes\",\n contentColor: \"contentColor\"\n },\n base: {\n keySpacing: theme.spacer.md,\n height: theme.spacer.md * 9,\n paddingX: theme.spacer.md,\n contentColor: theme.color.fillNeutral,\n sizes: {\n sm: 1,\n md: 2,\n lg: 3,\n xl: 4,\n xxl: 5\n },\n padding: [theme.spacer.xxxl, theme.spacer.xl],\n baseWidth: theme.spacer.md * 7,\n color: theme.color.interactiveNeutral,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n borderRadius: theme.radius.sm\n },\n modes: {\n focus: {\n color: theme.color.interactiveNeutralFocus,\n contentColor: theme.color.fillInverse\n },\n disabled: {\n color: theme.color.fillNeutralDisabled,\n contentColor: theme.color.fillNeutralDisabled\n }\n },\n tones: {\n inverse: {\n color: theme.color.interactiveInverse,\n focus: {\n color: theme.color.interactiveInverseFocus,\n contentColor: theme.color.fillNeutral\n }\n },\n brand: {\n focus: {\n contentColor: theme.color.fillNeutral\n }\n }\n },\n themeStyles\n};\nconst text = {\n themeKeys: {\n color: \"textColor\"\n },\n base: {\n textAlign: \"left\",\n color: theme.color.textNeutral,\n ...theme.typography.headline2\n },\n modes: {\n focus: {\n color: theme.color.textInverse\n },\n disabled: {\n color: theme.color.textNeutralDisabled\n }\n },\n tones: {\n inverse: {\n focus: {\n color: theme.color.textNeutral\n }\n }\n },\n themeStyles\n};\nconst Container$1 = makeComponentStyles(container$1);\nconst Text = makeComponentStyles(text);\nconst styles$1 = {\n tone: defaultTone$1 || \"neutral\",\n Container: Container$1,\n Text\n};\nconst Key = (props) => {\n const style1 = (props == null ? void 0 : props.style) ?? styles$1;\n return createComponent(ButtonContainer, mergeProps(props, {\n get style() {\n var _a2;\n return [\n ...[props.style].flat(),\n //\n (_a2 = styles$1.Container.tones) == null ? void 0 : _a2[props.tone ?? styles$1.tone],\n styles$1.Container.base\n ];\n },\n forwardStates: true,\n get width() {\n var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2;\n return (((_d2 = (_c2 = (_b2 = (_a2 = style1.Container) == null ? void 0 : _a2.tones) == null ? void 0 : _b2[props.tone ?? styles$1.tone]) == null ? void 0 : _c2.sizes) == null ? void 0 : _d2[props.size || \"sm\"]) ?? style1.Container.base.sizes[props.size || \"sm\"]) * (((_g2 = (_f2 = (_e2 = style1.Container) == null ? void 0 : _e2.tones) == null ? void 0 : _f2[props.tone ?? styles$1.tone]) == null ? void 0 : _g2.baseWidth) ?? style1.Container.base.baseWidth) + (((_i2 = (_h2 = style1.Container.tones) == null ? void 0 : _h2[props.tone ?? styles$1.tone]) == null ? void 0 : _i2.keySpacing) ?? style1.Container.base.keySpacing) * (((_l2 = (_k2 = (_j2 = style1.Container.tones) == null ? void 0 : _j2[props.tone ?? styles$1.tone]) == null ? void 0 : _k2.sizes) == null ? void 0 : _l2[props.size || \"sm\"]) ?? style1.Container.base.sizes[props.size || \"sm\"] - 1);\n },\n get children() {\n return createComponent(Text$7, {\n get style() {\n var _a2;\n return [\n (_a2 = props.style) == null ? void 0 : _a2.Text,\n //\n styles$1.Text.tones[props.tone ?? styles$1.tone],\n styles$1.Text.base\n ];\n },\n get children() {\n return props.title ? props.title : \"\";\n }\n });\n }\n }));\n};\nconst KeyboardSimple = (props) => {\n return createComponent(Column, {\n get autofocus() {\n return props.autofocus;\n },\n plinko: true,\n get itemSpacing() {\n var _a2;\n return props.keySpacing ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.keySpacing) ?? styles$2.Container.base.keySpacing;\n },\n get justifyContent() {\n return props.centerKeyboard && props.centerKeyboard ? \"center\" : \"flexStart\";\n },\n get children() {\n return createComponent(For, {\n get each() {\n return props.formats;\n },\n children: (row) => createComponent(Row, {\n get justifyContent() {\n return props.centerKeys && props.centerKeys ? \"center\" : \"flexStart\";\n },\n get itemSpacing() {\n var _a2;\n return props.keySpacing ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.keySpacing) ?? styles$2.Container.base.keySpacing;\n },\n get height() {\n var _a2;\n return (props == null ? void 0 : props.height) ?? ((_a2 = styles$2.Container.tones[props.tone ?? styles$2.tone]) == null ? void 0 : _a2.height) ?? styles$2.Container.base.height;\n },\n get wrap() {\n return props.rowWrap;\n },\n get children() {\n return createComponent(For, {\n each: row,\n children: (key2) => createComponent(Key, mergeProps({\n get style() {\n var _a2;\n return (_a2 = props.style) == null ? void 0 : _a2.Key;\n }\n }, typeof key2 === \"string\" ? {} : key2, {\n get title() {\n return key2.title || key2.icon ? key2.title : key2;\n }\n }))\n });\n }\n })\n });\n }\n });\n};\nconst Keyboard = (props) => {\n return createComponent(KeyboardSimple, mergeProps(props, {\n get style() {\n return [...[props.style].flat(), styles$2.Container.tones[props.tone ?? styles$2.tone], styles$2.Container.base];\n }\n }));\n};\nconst { Tile: { defaultTone, ...tileThemeStyles } = { styles: {} } } = (_o = theme) == null ? void 0 : _o.componentConfig;\nconst { Surface: { defaultSurfaceTone, ...surfaceThemeStyles } = { styles: {} } } = (_p = theme) == null ? void 0 : _p.componentConfig;\nconst container = {\n themeKeys: {\n alpha: \"alpha\",\n paddingYProgress: \"paddingYProgress\"\n },\n base: {\n width: 400,\n height: 240,\n padding: [40, 10],\n // TODO support separate paddingX and paddingY values from theme, possibly formatter\n paddingYProgress: theme.spacer.xl,\n paddingYBetweenContent: theme.spacer.md,\n borderRadius: theme.radius.md,\n alpha: theme.alpha.primary\n },\n modes: {\n disabled: {\n alpha: theme.alpha.inactive\n }\n },\n themeStyles: {\n ...surfaceThemeStyles,\n ...tileThemeStyles\n }\n};\nconst insetBottom = {\n themeKeys: {},\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n mountY: 1\n },\n themeStyles: tileThemeStyles\n};\nconst standardBottom = {\n themeKeys: {},\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\"\n },\n themeStyles: tileThemeStyles\n};\nconst logoContainer = {\n themeKeys: {},\n base: {\n width: theme.spacer.lg * 5,\n height: theme.spacer.xxl + theme.spacer.md\n },\n themeStyles: tileThemeStyles\n};\nconst Container = makeComponentStyles(container);\nconst InsetBottom = makeComponentStyles(insetBottom);\nconst StandardBottom = makeComponentStyles(standardBottom);\nconst LogoContainer = makeComponentStyles(logoContainer);\nconst styles = {\n tone: defaultTone || defaultSurfaceTone || \"neutral\",\n Container,\n InsetBottom,\n StandardBottom,\n LogoContainer\n};\nconst Tile = (props) => {\n const [isFocused, setIsFocused] = createSignal(false);\n return (() => {\n var _el$ = createElement(\"node\");\n use(withPadding, _el$, () => {\n var _a2;\n return props.padding ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.padding) ?? styles.Container.base.padding;\n });\n spread(_el$, mergeProps(props, {\n \"onFocus\": () => setIsFocused(true),\n \"onBlur\": () => setIsFocused(false),\n get style() {\n return [...[props.style].flat(), styles.Container.tones[props.tone ?? styles.tone], styles.Container.base];\n }\n }), true);\n insert(_el$, createComponent(Artwork, mergeProps(() => props.artwork, {\n get tone() {\n return props.tone ?? styles.tone;\n },\n get width() {\n var _a2;\n return props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width;\n },\n get height() {\n var _a2;\n return props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height;\n }\n })), null);\n insert(_el$, createComponent(Show, {\n get when() {\n return props.persistentMetadata || isFocused();\n },\n get children() {\n return [createComponent(View, {\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[1]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[1]) ?? styles.Container.base.padding[1];\n },\n get children() {\n return props.topLeft;\n }\n }), createComponent(View, {\n get x() {\n var _a2, _b2, _c2;\n return ((props == null ? void 0 : props.width) ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[0]) ?? ((_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0]);\n },\n get y() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[1]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[1]) ?? styles.Container.base.padding[1];\n },\n mountX: 1,\n get children() {\n return props.topRight;\n }\n }), createComponent(View, {\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.InsetBottom, styles.InsetBottom.tones[props.tone ?? styles.tone], styles.InsetBottom.base];\n },\n get width() {\n var _a2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - styles.Container.base.padding[0] * 2;\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2, _d2, _e2, _f2;\n return (props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) - (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]) - (((_e2 = props.progressBar) == null ? void 0 : _e2.progress) > 0 ? props.paddingYProgress ?? ((_f2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _f2.paddingYProgress) ?? styles.Container.base.paddingYProgress : 0);\n },\n get children() {\n return props.inset;\n }\n }), createComponent(View, {\n get style() {\n var _a2;\n return [(_a2 = props.style) == null ? void 0 : _a2.StandardBottom, styles.StandardBottom.tones[props.tone ?? styles.tone], styles.StandardBottom.base];\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2, _d2;\n return Number(props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) + (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]);\n },\n get width() {\n var _a2, _b2, _c2, _d2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[1]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[1]) ?? styles.Container.base.padding[1]) * 2;\n },\n get children() {\n return props.bottom;\n }\n })];\n }\n }), null);\n insert(_el$, createComponent(Show, {\n get when() {\n var _a2;\n return ((_a2 = props.progressBar) == null ? void 0 : _a2.progress) ? props.progressBar.progress > 0 : 0;\n },\n get children() {\n return createComponent(ProgressBar, mergeProps(() => props.progressBar, {\n get width() {\n var _a2, _b2, _c2, _d2;\n return (props.width ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.width) ?? styles.Container.base.width) - (((_b2 = props.padding) == null ? void 0 : _b2[0]) ?? ((_d2 = (_c2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _c2.padding) == null ? void 0 : _d2[0]) ?? styles.Container.base.padding[0]) * 2;\n },\n get x() {\n var _a2, _b2, _c2;\n return ((_a2 = props.padding) == null ? void 0 : _a2[0]) ?? ((_c2 = (_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.padding) == null ? void 0 : _c2[0]) ?? styles.Container.base.padding[0];\n },\n get y() {\n var _a2, _b2, _c2;\n return (props.height ?? props.height ?? ((_a2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _a2.height) ?? styles.Container.base.height) - (props.paddingYProgress ?? ((_b2 = styles.Container.tones[props.tone ?? styles.tone]) == null ? void 0 : _b2.paddingYProgress) ?? styles.Container.base.paddingYProgress) - (((_c2 = props == null ? void 0 : props.progressBar) == null ? void 0 : _c2.height) || 0);\n }\n }));\n }\n }), null);\n return _el$;\n })();\n};\nexport {\n Artwork,\n Badge,\n Button,\n ButtonContainer,\n Checkbox,\n Column,\n Icon$3 as Icon,\n Keyboard,\n Label,\n Metadata,\n ProgressBar,\n Row,\n Tile,\n styles$e as artworkStyles,\n assertTruthy,\n styles$c as badgeStyles,\n styles$b as buttonStyles,\n chainFunctions,\n styles$a as checkboxStyles,\n styles$9 as columnStyles,\n handleNavigation,\n styles$d as iconStyles,\n styles$2 as keyboardStyles,\n styles$8 as labelStyles,\n makeComponentStyles,\n styles$5 as metadataStyles,\n onGridFocus,\n styles$4 as progressBarStyles,\n styles$3 as rowStyles,\n scrollToIndex,\n styles as tileStyles,\n useItemLayout,\n withScrolling\n};\n//# sourceMappingURL=index.js.map\n","export default {\n name: 'Base Lightning TV',\n alpha: {\n primary: 1,\n secondary: 0.7,\n tertiary: 0.1,\n inactive: 0.5,\n full: 1,\n none: 0,\n alpha1: 0.1,\n alpha2: 0.3,\n alpha3: 0.5,\n alpha4: 0.7,\n alpha5: 0.9\n },\n animation: {\n duration: {\n none: 0,\n xfast: 0.1,\n fast: 0.25,\n normal: 0.5,\n slow: 0.75,\n xslow: 0.9\n },\n delay: {\n none: 0,\n xfast: 0.01,\n fast: 0.025,\n normal: 0.05,\n slow: 0.075,\n xslow: 0.09\n },\n expressive: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n expressiveEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n expressiveExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standard: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standardEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n standardExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utility: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utilityEntrance: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n },\n utilityExit: {\n timingFunction: 'cubic-bezier(0, 0, 1, 1)',\n delay: 0,\n duration: 0.25\n }\n },\n asset: {\n arrowLeft:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAAAi0lEQVRIDWNgGAWjIfD//38JID5Fk5AAGqwKxPeA+D/VLQCaaQLEr0CGgwBVLQCa5wbEn0EGwwDVLAAaGA3Ev2AGw2iqWAA0rBiI/8EMRaYptgBoWDeygehsci1gIlcjWfqArqZdEMFcBLSEdpGMZAntkimSJbTLaEiW0K6oQLKEdoUdzJJRemiHAAD4n+yzPWCs7QAAAABJRU5ErkJggg==',\n arrowRight:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQA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\n },\n color: {\n palette: {\n 'blue-20': '0xbecffeff',\n 'blue-40': '0x93a9fdff',\n 'blue-90': '0x000033ff',\n 'grey-05': '0xf8f7faff',\n 'grey-40': '0x929096ff',\n 'grey-70': '0x48474bff',\n 'grey-90': '0x181819ff'\n },\n white: '0xffffffff',\n black: '0x000000ff',\n grey: '0x929096ff',\n red: '0xe74c3cff',\n orange: '0xdc7633ff',\n yellow: '0xf7dc6fff',\n green: '0x2ecc71ff',\n blue: '0x93a9fdff',\n purple: '0x663399ff',\n material: '0x181819ff',\n materialBrand: '0x000033ff',\n overlay: '0x181819b3',\n textNeutral: '0xf8f7faff',\n textNeutralSecondary: '0xf8f7fab3',\n textNeutralTertiary: '0xf8f7fa1a',\n textNeutralDisabled: '0xf8f7fa80',\n textInverse: '0x181819ff',\n textInverseSecondary: '0x181819b3',\n textInverseTertiary: '0x1818191a',\n textInverseDisabled: '0x18181980',\n textBrand: '0x93a9fdff',\n textBrandSecondary: '0x93a9fdb3',\n textBrandTertiary: '0x93a9fd1a',\n textBrandDisabled: '0x93a9fd80',\n textPositive: '0x2ecc71ff',\n textNegative: '0xe74c3cff',\n textInfo: '0x93a9fdff',\n textCaution: '0xdc7633ff',\n fillTransparent: '0xffffff0',\n fillNeutral: '0xf8f7faff',\n fillNeutralSecondary: '0xf8f7fab3',\n fillNeutralTertiary: '0xf8f7fa1a',\n fillNeutralDisabled: '0xf8f7fa80',\n fillInverse: '0x181819ff',\n fillInverseSecondary: '0x181819b3',\n fillInverseTertiary: '0x1818191a',\n fillInverseDisabled: '0x18181980',\n fillBrand: '0x93a9fdff',\n fillBrandSecondary: '0x93a9fdb3',\n fillBrandTertiary: '0x93a9fd1a',\n fillBrandDisabled: '0x93a9fd80',\n fillPositive: '0x2ecc71ff',\n fillNegative: '0xe74c3cff',\n fillInfo: '0x93a9fdff',\n fillCaution: '0xdc7633ff',\n strokeNeutral: '0xf8f7faff',\n strokeNeutralSecondary: '0xf8f7fab3',\n strokeNeutralTertiary: '0xf8f7fa1a',\n strokeNeutralDisabled: '0xf8f7fa80',\n strokeInverse: '0x181819ff',\n strokeInverseSecondary: '0x181819b3',\n strokeInverseTertiary: '0x1818191a',\n strokeInverseDisabled: '0x18181980',\n strokeBrand: '0x93a9fdff',\n strokeBrandSecondary: '0x93a9fdb3',\n strokeBrandTertiary: '0x93a9fd1a',\n strokeBrandDisabled: '0x93a9fd80',\n strokePositive: '0x2ecc71ff',\n strokeNegative: '0xe74c3cff',\n strokeInfo: '0x93a9fdff',\n strokeCaution: '0xdc7633ff',\n interactiveNeutral: '0xffffff1a',\n interactiveNeutralFocus: '0xffffffff',\n interactiveNeutralFocusSoft: '0xffffff1a',\n interactiveInverse: '0x48474b1a',\n interactiveInverseFocus: '0x48474bff',\n interactiveInverseFocusSoft: '0x48474b1a',\n interactiveBrand: '0xbecffe1a',\n interactiveBrandFocus: '0xbecffeff',\n interactiveBrandFocusSoft: '0xbecffe1a',\n shadowNeutral: '0x000000b3',\n shadowNeutralFocus: '0x000000b3',\n shadowNeutralFocusSoft: '0x000000b3',\n shadowNeutralText: '0x000000ff',\n shadowInverse: '0x000000b3',\n shadowInverseFocus: '0x000000b3',\n shadowInverseFocusSoft: '0x000000b3',\n shadowInverseText: '0x000000ff',\n shadowBrand: '0x000000b3',\n shadowBrandFocus: '0x000000b3',\n shadowBrandFocusSoft: '0x000000b3',\n shadowBrandText: '0x000000ff'\n },\n font: [],\n layout: {\n columnCount: 10,\n focusScale: 1.2,\n gutterX: 20,\n gutterY: 20,\n marginX: 150,\n marginY: 150,\n safe: 50,\n screenW: 1920,\n screenH: 1080\n },\n radius: { none: 0, xs: 2, sm: 4, md: 8, lg: 16, xl: 24 },\n spacer: {\n none: 0,\n xxs: 2,\n xs: 4,\n sm: 8,\n md: 10,\n lg: 20,\n xl: 30,\n xxl: 40,\n xxxl: 50\n },\n stroke: { none: 0, sm: 2, md: 4, lg: 6, xl: 8 },\n typography: {\n display1: {\n fontFamily: 'Arial',\n fontSize: 75,\n lineHeight: 85,\n fontWeight: 500,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n display2: {\n fontFamily: 'Arial',\n fontSize: 50,\n lineHeight: 60,\n fontWeight: 500,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline1: {\n fontFamily: 'Arial',\n fontSize: 35,\n fontWeight: 500,\n lineHeight: 48,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline2: {\n fontFamily: 'Arial',\n fontSize: 30,\n fontWeight: 500,\n lineHeight: 40,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n headline3: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 500,\n lineHeight: 36,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body1: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 300,\n lineHeight: 40,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body2: {\n fontFamily: 'Arial',\n fontSize: 22,\n fontWeight: 300,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n body3: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 300,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n button1: {\n fontFamily: 'Arial',\n fontSize: 25,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n button2: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n callout1: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 32,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n caption1: {\n fontFamily: 'Arial',\n fontSize: 15,\n fontWeight: 500,\n lineHeight: 24,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n tag1: {\n fontFamily: 'Arial',\n fontSize: 20,\n fontWeight: 500,\n lineHeight: 24,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n },\n footnote1: {\n fontFamily: 'Arial',\n fontSize: 22,\n fontWeight: 300,\n lineHeight: 30,\n verticalAlign: 'middle',\n textBaseline: 'bottom'\n }\n },\n componentConfig: {\n Keyboard: {\n base: {\n keyProps: {\n delete: {\n title: null,\n icon: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAAAXNSR0IArs4c6QAACmpJREFUeF7tnVmoZUcVhv/feY4gBEVEH/KgCCZxCK2itNo4xQQH+kUN0TjEiDGKKBqnaExwBjUaR6KY+NQgiQkOMSYhYEScIopGJOqDE2hHjfP0y4p1Oqdv33v2qr32Prv2Paug6Ye7Vu2qv75TtWvtGohMqUBAAQZ80zUVQAKUEIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypXMClAyEFEiAQvKlcwKUDIQUSIBC8qVzApQMhBRIgELypfPsAJJ0NYC92XRHKPB3AAfLv18BuBLAFSR/NKZWswJI0vkA3jCmILsw75sAvIfkR8eo22wAknQSgMvGEGFD8vwxgFeQvGrI+s4CIEnHAPgugHsMWfkNzevDAM4i+Z8h6t88QJLuXOB5yBAVzjxuVeBaAM8ieXNUjzkAdAmA50Yrmv5HKPATACeQ/GNEm6YBkvRyANblZhpHAXsfekpkOGsWIEmPAHA9gDuOo13mWhS4gOSZfdVoEiBJ9wFwA4D7961Y+lUpsK/v7KxVgL4K4ElOCS4l+Uyn7a41k3Q0gMcC2ANgH4CHV1T2OyStx69OzQEk6TwAZztr8lMAx5P8s9N+Y8wk2cTjfQDu66z080h+zml7yKwpgCSdCOByZyX+BuBRJH/otN84M0kWN/s0gOc4Kv8Nko922B1m0gxAkh4I4AcVwcL9JA/UVnjT7CXdHYD9yEzfVUkAjib5uxqNmgC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LkuinULy4loRmwOoQGQX7T7DWZnPk3y203bXmkl6AIA91isDOBGADV3e1HsJbasA1QYZvUKl3fYKPI2knXFQnZoEqPRCNUHG6oqnwyEFLiJ5Wl89mgWoQFQTZOyrwSb7WUztcSRtu0+v1DRABaKPADijV+3SaZUCNgE5geTNEZnmAFBtkDGix6b4Xld2BNvJcaHUPEClF6oNMoZE2eXOtm3q1ZFha1mfWQBUINoL4Kqurbm7vPEj1bOAqx3udW0kk62+swGoQHQ2gPOGFGAD8roJgF0t+qkx6jorgApElwE4aQwxZp6n3YNxsPyzA7yst/4iSdvEMFqaHUCjKZEZ91IgAeolWzotFEiAkoWQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnROgJKBkAIJUEi+dE6AkoGQAglQSL50ToCSgZACCVBIvnT+H0jPT81J3xWWAAAAAElFTkSuQmCC'\n }\n }\n }\n }\n }\n};\n","import { type AnimationSettings } from \"@lightningjs/renderer\";\nimport { globalBackground } from \"../state.js\";\nimport { type IntrinsicNodeStyleProps, View, hexColor } from \"@lightningjs/solid\";\nimport { createEffect, on } from \"solid-js\";\nimport { debounce } from '@solid-primitives/scheduled';\nimport theme from 'theme';\n\nexport default function Background() {\n let bg1, bg2;\n let active = 0;\n const alpha = 1;\n const animationSettings = { duration: 750, easing: 'ease-in-out' } satisfies Partial;\n const bgStyles = { alpha, color: 0xffffffff } satisfies IntrinsicNodeStyleProps;\n\n function changeBackgrounds(img: string) {\n if (img.startsWith('#')) {\n bg1.color = img;\n bg1.src = '';\n bg1.alpha = 1;\n active = 1;\n bg2.alpha = 0;\n return;\n } else {\n bg1.color = 0xffffffff;\n }\n\n if (active === 0) {\n bg1.src = img;\n active = 1;\n return;\n }\n\n if (active === 1) {\n bg2.src = img;\n active = 2;\n bg2.alpha = 0;\n bg2.animate({ alpha }, animationSettings).start();\n bg1.animate({ alpha: 0 }, animationSettings).start();\n return;\n }\n\n if (active === 2) {\n bg1.src = img;\n active = 1;\n bg1.alpha = 0;\n bg1.animate({ alpha }, animationSettings).start();\n bg2.animate({ alpha: 0 }, animationSettings).start();\n }\n }\n\n const delayedBackgrounds = debounce(changeBackgrounds, 400);\n\n createEffect(on(globalBackground, (img: string) => {\n delayedBackgrounds(img);\n }, { defer: true}))\n\n return (<>\n \n \n \n \n \n );\n}\n","import { IntrinsicNodeStyleProps, hexColor } from '@lightningjs/solid';\nimport theme from 'theme';\n\nexport default {\n Column: {\n flexDirection: 'column',\n display: 'flex',\n width: 320,\n height: 600,\n y: 360,\n gap: 20,\n zIndex: 101,\n transition: { x: {\n duration: 250,\n easing: 'ease-in-out'\n }},\n x: 8,\n focus: {\n x: theme.layout.marginX\n },\n } satisfies IntrinsicNodeStyleProps,\n Gradient: {\n zIndex: 99,\n color: hexColor('#000000'),\n src: './assets/sidenav.png',\n alpha: 0,\n width: 1200,\n height: 1080,\n focus: {\n alpha: 1\n },\n transition: { alpha: true }\n } satisfies IntrinsicNodeStyleProps,\n NavButton: {\n zIndex: 102,\n height: 70,\n width: 100,\n borderRadius: 8,\n focus: {\n color: hexColor(theme.color.material),\n },\n active: {\n width: 328,\n height: 70,\n },\n } satisfies IntrinsicNodeStyleProps,\n};\n","import { For, IntrinsicNodeProps, View } from '@lightningjs/solid';\nimport { createSpriteMap } from '@lightningjs/solid-primitives';\n// Icons from https://uxwing.com/\n\nconst basePath = import.meta.env.BASE_URL;\n\nconst icons = [\n { name: 'experiment', width: 81, height: 100, x: 0, y: 0 },\n { name: 'trending', width: 100, height: 56, x: 81, y: 0 },\n { name: 'tv', width: 100, height: 68, x: 181, y: 0 },\n { name: 'movie', width: 94, height: 100, x: 282, y: 0 },\n];\n\ninterface IconProps extends IntrinsicNodeProps {\n name: string;\n}\n\nfunction Icon(props: IconProps) {\n const sprite = createSpriteMap(basePath + 'assets/icons_white.png', icons);\n\n return (\n \n );\n}\n\nexport default Icon;\nexport function PreviewIcons() {\n return (\n <>\n \n \n {(icon, i) => }\n \n \n );\n}\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { renderer } from '@lightningjs/solid';\nimport {} from '@lightningjs/renderer';\nexport function createSpriteMap(src, subTextures) {\n const spriteMapTexture = renderer.createTexture('ImageTexture', {\n src,\n });\n return subTextures.reduce((acc, t) => {\n const { x, y, width, height } = t;\n acc[t.name] = renderer.createTexture('SubTexture', {\n texture: spriteMapTexture,\n x,\n y,\n width,\n height,\n });\n return acc;\n }, {});\n}\n//# sourceMappingURL=createSpriteMap.js.map","import { useNavigate } from '@solidjs/router';\nimport { View, Text, IntrinsicNodeProps, ElementNode } from '@lightningjs/solid';\nimport { Column } from '@lightningjs/solid-ui';\nimport styles from './NavDrawer.styles';\nimport Icon from '../Icon';\nimport theme from 'theme';\n\ninterface NavButtonProps extends IntrinsicNodeProps {\n icon: string;\n children: string;\n}\n\nfunction NavButton(props: NavButtonProps) {\n return (\n \n \n \n \n \n {props.children}\n \n \n );\n}\n\nexport default function NavDrawer(props) {\n let backdrop;\n const navigate = useNavigate();\n\n function onFocus(this: ElementNode) {\n backdrop.states.add('focus');\n this.children.forEach((c) => c.states!.add('active'));\n this.children.selected!.setFocus();\n }\n\n function onBlur(this: ElementNode) {\n backdrop.states.remove('focus');\n this.selected = 0;\n this.children.forEach((c) => c.states!.remove('active'));\n }\n\n return (\n <>\n \n navigate('/browse/all')} icon='trending'>Trending\n navigate('/browse/movie')}>Movies\n navigate('/browse/tv')}>TV\n navigate('/examples')}>Examples\n \n \n \n );\n}\n","import { View, Text, hexColor } from '@lightningjs/solid';\nimport { createSignal } from 'solid-js';\nimport { debounce } from '@solid-primitives/scheduled';\n\nconst fpsStyle = {\n color: 0x000000ff,\n height: 90,\n width: 330,\n x: 1500,\n y: 20,\n alpha: 0.8,\n zIndex: 100,\n}\n\nconst fpsLabel = {\n x: 10,\n fontSize: 36,\n textColor: hexColor('#ffffff')\n}\n\nconst fpsValue = {\n fontSize: 36,\n textColor: hexColor('#ffffff')\n}\n\nconst [fps, setFps] = createSignal(0);\nconst [avgFps, setAvgFps] = createSignal(0);\nconst [minFps, setMinFps] = createSignal(99);\nconst [maxFps, setMaxFps] = createSignal(0);\n\nlet count = 0;\nlet totalFps = 0;\n\n\nconst resetCounter = debounce(() => {\n // clear fps\n totalFps = 0;\n count = 0;\n setMinFps(99);\n}, 10000);\n\n// Clear min fps after 10 seconds to avoid showing a low fps\n// setTimeout(() => setMinFps(99), 9999);\n\nconst calcFps = (fps: number) => {\n if (!fps) return;\n\n setFps(fps);\n setMinFps(prev => Math.min(fps, prev));\n setMaxFps(prev => Math.max(fps, prev));\n\n totalFps += fps\n count++;\n\n setAvgFps( Math.round(totalFps / count) );\n\n resetCounter();\n}\n\nexport function setupFPS(root) {\n root.renderer.on('fpsUpdate', (target, fpsData) => {\n const fps = typeof fpsData === 'number' ? fpsData : fpsData.fps;\n if (fps > 5) {\n calcFps(fps);\n }\n });\n}\n\nexport const FPSCounter = (props) => {\n return \n \n FPS:\n {fps().toString()}\n \n\n \n AVG:\n {avgFps().toString()}\n \n\n \n MIN:\n {minFps().toString()}\n \n \n \n MAX:\n {maxFps().toString()}\n \n \n}\n","import { useNavigate } from \"@solidjs/router\";\nimport { View, activeElement, hexColor, renderer } from \"@lightningjs/solid\";\nimport { useFocusManager, useAnnouncer } from \"@lightningjs/solid-primitives\";\nimport Background from \"../components/Background\";\nimport NavDrawer from \"../components/NavDrawer/NavDrawer\";\nimport { FocusRing } from \"../components\";\nimport { FPSCounter, setupFPS } from \"../components/FPSCounter\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\nimport { onMount } from \"solid-js\";\n\ndeclare module \"@lightningjs/solid-primitives\" {\n // Augment the FocusManager KeyMap interface with our custom keys\n interface KeyMap {\n Announcer: string;\n Menu: string;\n Escape: string;\n }\n}\n\ndeclare module \"@lightningjs/solid\" {\n interface ElementNode {\n heroContent?: boolean;\n backdrop?: any;\n entityInfo?: any;\n href?: string;\n }\n}\n\nconst App = (props) => {\n useFocusManager({\n Announcer: \"a\",\n Menu: \"m\",\n Escape: \"Escape\",\n });\n const announcer = useAnnouncer();\n announcer.enabled = false;\n const navigate = useNavigate();\n\n let focusRingRef, navDrawer, lastFocused, happy;\n\n onMount(() => {\n setupFPS({ renderer });\n });\n\n return (\n (announcer.enabled = !announcer.enabled)}\n onLast={() => history.back()}\n onMenu={() => navigate(\"/\")}\n style={{ width: 1920, height: 1080 }}\n onLeft={() => {\n if (navDrawer.states.has(\"focus\")) {\n return false;\n }\n lastFocused = activeElement();\n navDrawer.setFocus();\n }}\n onRight={() => navDrawer.states.has(\"focus\") && lastFocused.setFocus()}\n >\n \n \n\n {props.children}\n\n \n {/* */}\n \n );\n};\n\nexport default App;\n","/*\n * Copyright 2023 Comcast Cable Communications Management, LLC\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { createEffect, on } from 'solid-js';\nimport { Announcer } from './announcer.js';\nimport { focusPath } from '../useFocusManager.js';\nexport const useAnnouncer = () => {\n Announcer.setupTimers();\n createEffect(on(focusPath, Announcer.onFocusChange, { defer: true }));\n return Announcer;\n};\n//# sourceMappingURL=index.js.map","import { IntrinsicNodeStyleProps, IntrinsicTextNodeStyleProps, hexColor } from '@lightningjs/solid';\nimport theme from 'theme';\n\n// Augment existing intrinsic style prop interfaces to include our own\n// app-specific states\ndeclare module '@lightningjs/solid' {\n interface IntrinsicNodeStyleProps {\n // TODO: Refactor states to use a $ prefix\n active?: IntrinsicNodeStyleProps;\n disabled?: IntrinsicNodeStyleProps;\n }\n\n interface IntrinsicTextNodeStyleProps {\n // TODO: Refactor states to use a $ prefix\n active?: IntrinsicTextNodeStyleProps;\n disabled?: IntrinsicTextNodeStyleProps;\n }\n}\n\nexport default {\n Page: {\n width: 1920, height: 1080\n } satisfies IntrinsicNodeStyleProps,\n headlineText: {\n width: 1200, height: 240,\n x: 360,\n // lineHeight: 170, // TODO: Add back when lineHeight is supported\n y: 455, contain: 'both',\n fontSize: 66,\n textAlign: 'center'\n } satisfies IntrinsicTextNodeStyleProps,\n headlineSubText: {\n width: 960,\n height: 170,\n // lineHeight: 170, // TODO: Add back when lineHeight is supported\n x: 530,\n y: 655, contain: 'both',\n fontSize: 48,\n textAlign: 'center'\n } satisfies IntrinsicTextNodeStyleProps,\n itemsContainer: {\n width: theme.layout.screenW,\n height: 600,\n y: 560,\n x: 0,\n zIndex: 2,\n } satisfies IntrinsicNodeStyleProps,\n Thumbnail: {\n borderRadius: 16,\n width: 185, height: 278, scale: 1, zIndex: 2,\n transition: { scale: { duration: 250, easing: 'ease-in-out' } },\n border: { width: 0, color: 0x00000000 },\n focus: { scale: 1.1, border: { color: 0xffffff66, width: 8 } }\n } satisfies IntrinsicNodeStyleProps,\n FocusRing: {\n borderRadius: 16,\n width: 194, height: 286, y: -5, x: -5, zIndex: -1,\n } satisfies IntrinsicNodeStyleProps,\n FPS: {\n color: 0x000000ff,\n height: 42,\n width: 140,\n x: 20,\n y: 20,\n zIndex: 100,\n } as const,\n FPSLabel: {\n x: 10,\n y: 0,\n fontSize: 36,\n textColor: hexColor('#ffffff')\n },\n FPSValue: {\n x: 90,\n y: 0,\n fontSize: 36,\n textColor: hexColor('#ffffff')\n },\n showHeadline: { x: 70, y: 20 } satisfies IntrinsicNodeStyleProps,\n headlineBlur: {\n width: 1920,\n height: 150,\n x: 0,\n y: 0,\n zIndex: 14,\n alpha: 0.9,\n color: hexColor('#000000')\n } satisfies IntrinsicNodeStyleProps,\n RowTitle: {\n height: 60,\n width: 300,\n marginTop: 20,\n fontSize: 36,\n color: hexColor('#f0f0f0'),\n zIndex: 2\n } satisfies IntrinsicTextNodeStyleProps,\n Row: {\n display: 'flex',\n justifyContent: 'spaceBetween',\n height: 300,\n } satisfies IntrinsicNodeStyleProps,\n Column: {\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'flexStart',\n gap: 20,\n width: theme.layout.screenW - (2 * theme.layout.marginX),\n x: theme.layout.marginX + theme.layout.gutterX,\n y: 48,\n transition: { y: { duration: 250, easing: 'ease-in-out' } },\n zIndex: 2\n } satisfies IntrinsicNodeStyleProps,\n Rect: {\n width: 250,\n height: 100,\n y: 10,\n x: 300,\n color: hexColor('#0000ff')\n } satisfies IntrinsicNodeStyleProps,\n peopleBio: {\n ...theme.typography.body1,\n contain: 'both',\n width: 1500,\n height: 400\n } satisfies IntrinsicTextNodeStyleProps,\n};\n\nconst Button = {\n width: 120,\n height: 40,\n color: hexColor('#000000'),\n borderRadius: 8,\n border: { width: 2, color: hexColor('#3333ff') },\n scale: 1,\n focus: {\n scale: 1.1,\n border: { width: 5, color: hexColor('#333333') },\n },\n transition: { scale: true, color: true },\n} satisfies IntrinsicNodeStyleProps;\n\nconst TopBar = {\n color: hexColor('#00A699'),\n height: 8,\n y: 2,\n x: -4,\n width: Button.width + 8\n} satisfies IntrinsicNodeStyleProps;\n\nconst ButtonText = {\n fontSize: 12,\n y: 12,\n // lineHeight: Button.height, // TODO: Add back when lineHeight is supported\n contain: 'width',\n textAlign: 'center',\n color: hexColor('#F6F6F9'),\n height: Button.height,\n width: Button.width\n} satisfies IntrinsicTextNodeStyleProps;\n\nexport const buttonStyles = {\n container: Button,\n topBar: TopBar,\n text: ButtonText\n} satisfies Record;\n\n\nexport const MaterialButton = {\n width: 386,\n height: 136,\n color: hexColor('#715cab'),\n focus: {\n color: hexColor('#5a39a2'),\n },\n disabled: {\n color: hexColor('#291d43'),\n }\n} satisfies IntrinsicNodeStyleProps;\n\nexport const MaterialButtonText = {\n fontSize: 32,\n contain: 'width',\n textAlign: 'center',\n mountY: -0.35,\n color: hexColor('#FFFFFF'),\n height: MaterialButton.height,\n width: MaterialButton.width,\n // lineHeight: MaterialButton.height, // TODO: Add back when lineHeight is supported\n focus: {\n fontSize: 40\n },\n disabled: {\n color: hexColor('#909090'),\n }\n} satisfies IntrinsicTextNodeStyleProps;\n","import { IntrinsicNodeProps, View, Text } from '@lightningjs/solid';\nimport { Row } from '@lightningjs/solid-ui';\nimport { For, splitProps } from 'solid-js';\nimport styles, { buttonStyles } from '../styles';\nimport { type Tile } from '../api/formatters/ItemFormatter';\n\nexport function Thumbnail(props: IntrinsicNodeProps) {\n return \n}\n\nexport function FocusRing(props: IntrinsicNodeProps) {\n return \n}\n\nexport interface TileRowProps extends IntrinsicNodeProps {\n items: Tile[];\n}\n\nexport function TileRow(props: TileRowProps) {\n const [local, others] = splitProps(props, [\"items\"]);\n\n return \n \n {(item) => }\n \n \n\n}\n\nexport function Button(props) {\n return (\n \n {props.children}\n \n );\n}","export default 'eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyZDE4YjEwMTA0YjdiZTlkNjFiMWYwYjVlMGEwNzM2OCIsInN1YiI6IjYwZTVjMTdlNGNhNjc2MDA3NTA4Njc3MSIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.D_nqH9kd-bhhWzeVsTDPYhHnsUaNAuyAa6YATmKHqsA';\n","import API_KEY_V4 from './key';\nconst API_BASE = 'https://api.themoviedb.org/3';\nlet tmdbConfig;\nlet baseImageUrl;\nconst basePosterSize = 'w185';\n\nconst defaultFetchParams = {\n headers: {\n 'Content-Type': 'application/json',\n Authorization: 'Bearer ' + API_KEY_V4,\n },\n};\n\nexport function getImageUrl(path: string, posterSize: string = basePosterSize) {\n return baseImageUrl + posterSize + path;\n}\n\nfunction get(path: string, params: RequestInit = {}) {\n if (tmdbConfig) {\n return _get(path, params);\n } else {\n return loadConfig().then(() => _get(path, params))\n }\n}\n\nfunction _get(path: string, params: RequestInit = {}) {\n return fetch(API_BASE + path, {\n ...defaultFetchParams,\n ...params,\n }).then((r) => r.json());\n}\n\nfunction loadConfig() {\n return _get('/configuration').then((data) => {\n tmdbConfig = data;\n baseImageUrl = data.images?.secure_base_url;\n return data;\n });\n}\n\nexport default {\n get,\n loadConfig,\n};\n","import { getImageUrl } from '../index';\n\nfunction truncateString(str: string, maxLength: number): string {\n if (str.length > maxLength) {\n return str.substring(0, maxLength - 3) + '...';\n }\n return str;\n}\n\nexport function chunkArray(array: string[], size = 7) {\n let result: string[][] = [];\n for (let i = 0, j = array.length; i < j; i += size) {\n result.push(array.slice(i, i + size));\n }\n return result;\n}\n\nexport interface Tile {\n src: string;\n tileSrc: string;\n backdrop: string;\n href: string;\n shortTitle: string;\n title: string;\n data: unknown;\n entityInfo: {\n type: string;\n id: string;\n };\n heroContent: {\n title: string;\n description: string;\n };\n}\n\n// TODO: Remove `any` type\nexport function convertItemsToTiles(items: any[] = []): Tile[] {\n return items.map((item) => ({\n src: getImageUrl(item.poster_path || item.profile_path),\n tileSrc: getImageUrl(item.backdrop_path || item.profile_path, 'w300'),\n backdrop: getImageUrl(item.backdrop_path, 'w1280'),\n href: `/entity/${item.media_type || 'people'}/${item.id}`,\n shortTitle: truncateString(item.title || item.name, 30),\n title: item.title || item.name,\n data: item,\n entityInfo: {\n type: item.media_type || 'people',\n id: item.id\n },\n heroContent: {\n title: item.title || item.name,\n description: item.overview\n }\n }));\n}\n","import api from '..';\nimport { convertItemsToTiles, chunkArray } from '../formatters/ItemFormatter';\n\nlet cache = new Map();\nconst leftoverTiles = new Map();\n\nexport default function (filter: string) {\n return (pageIndex: number): Promise => {\n const url = `/trending/${filter}/week?page=${pageIndex}`;\n if (cache.has(url)) {\n return cache.get(url);\n }\n\n let result = api.get(url).then((trending) => {\n let results = trending.results.filter((r) => !r.adult);\n let tiles = (leftoverTiles.has(filter) ? leftoverTiles.get(filter) : []).concat(convertItemsToTiles(results));\n let chunks = chunkArray(tiles);\n if (chunks[chunks.length - 1].length < 7) {\n leftoverTiles.set(filter, chunks.pop());\n } else {\n leftoverTiles.delete(filter);\n }\n return chunks;\n });\n\n cache.set(url, result);\n return result;\n }\n}\n","import { createSignal, createComputed, batch, createResource } from \"solid-js\";\n\nexport function createInfiniteScroll(fetcher: (page: number) => Promise) {\n const [pages, setPages] = createSignal([]);\n const [page, setPage] = createSignal(1);\n const [end, setEnd] = createSignal(false);\n\n const [contents] = createResource(page, fetcher);\n\n createComputed(() => {\n const content = contents();\n if (!content)\n return;\n batch(() => {\n if (content.length === 0)\n setEnd(true);\n setPages((p) => [...p, ...content]);\n });\n });\n\n return {\n pages,\n page,\n setPage,\n setPages,\n end,\n setEnd\n };\n}\n","import { View, Text, Show, IntrinsicNodeStyleProps, For } from '@lightningjs/solid';\nimport { withPadding } from '@lightningjs/solid-primitives';\nimport theme from 'theme';\nwithPadding;\n\nconst blockWidth = 1100;\nconst HeadlineStyles = {\n ...theme.typography.display2,\n width: blockWidth,\n height: 58,\n contain: 'both',\n};\nconst Headline = (props) => (\n \n {props.children}\n \n);\n\nconst DescriptionStyles = {\n ...theme.typography.body1,\n width: blockWidth,\n height: 72,\n contain: 'both',\n};\n\nconst BadgeStyle = {\n fontSize: 20,\n lineHeight: 20,\n};\n\nconst Description = (props) => (\n \n {props.children}\n \n);\n\nfunction getReviews(reviews) {\n return (\n <>\n \n \n {reviews.rtCrit + '%'}\n \n \n \n {reviews.rtFan + '%'}\n \n \n );\n}\n\nconst Badge = (props) => {\n return (\n \n {props.children}\n \n );\n};\n\nconst MetaTextStyle = theme.typography.body2;\n\nconst Metadata = (props) => (\n \n {props.metaText}\n {(item) => {item}}\n {getReviews(props.reviews)}\n \n);\n\nconst ContentBlock = (props) => {\n const style = {\n display: 'flex',\n flexDirection: 'column',\n width: blockWidth,\n height: 160,\n gap: 16,\n };\n return \n {props.title}\n {props.description}\n \n ;\n};\n\nexport default ContentBlock;\n","import api, { getImageUrl } from '..';\nimport { convertItemsToTiles } from '../formatters/ItemFormatter';\n\nexport function minutesToHMM(minutes) {\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return hours + 'h ' + (remainingMinutes < 10 ? '0' : '') + remainingMinutes + 'm';\n}\n\nfunction justYear(dateString) {\n const parts = dateString.split(\"-\");\n return parts[0];\n}\n\nexport function getRecommendations({type, id}) {\n return api.get(`/${type}/${id}/recommendations`).then(\n ({ results }) => {\n if (results.length) {\n return convertItemsToTiles(results.slice(0, 7));\n }\n return api.get(`/trending/${type}/week?page=1`).then(\n ({ results }) => convertItemsToTiles(results.slice(0, 7)));\n }\n );\n}\n\nexport function getCredits({type, id}) {\n return api.get(`/${type}/${id}/credits`).then(\n ({ cast }) => convertItemsToTiles(cast.slice(0, 7))\n );\n}\n\nexport function getInfo({type, id}) {\n let rt = type === 'movie' ? {\n rtCrit: 86,\n rtFan: 92\n } : {};\n\n return api.get(`/${type}/${id}`).then(\n (data) => ({\n backgroundImage: getImageUrl(data.backdrop_path, 'original'),\n heroContent: {\n title: data.title || data.name,\n description: data.overview,\n badges: ['HD'],\n metaText: type === 'movie' ?\n minutesToHMM(data.runtime) + ' - ' + data.release_date : `${justYear(data.first_air_date)} - ${justYear(data.last_air_date)}`,\n reviews: rt,\n },\n ...data\n }));\n}\n","import { createEffect, createMemo, on, createSignal,\n Show, createResource, createSelector, For } from \"solid-js\";\nimport { ElementNode, View, activeElement } from '@lightningjs/solid';\nimport { Column } from '@lightningjs/solid-ui';\nimport { useNavigate, useParams } from \"@solidjs/router\";\nimport { TileRow } from '../components';\nimport styles from '../styles';\nimport { setGlobalBackground } from \"../state\";\nimport browseProvider from '../api/providers/browse';\nimport { createInfiniteScroll } from '../components/pagination';\nimport ContentBlock from \"../components/ContentBlock\";\nimport * as entityProvider from '../api/providers/entity';\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\n\nconst Browse = () => {\n const params = useParams();\n const [columnY, setcolumnY] = createSignal(0);\n const [entityInfo, setEntityInfo] = createSignal();\n const [entityData] = createResource(entityInfo, entityProvider.getInfo);\n const [heroContent, setHeroContent] = createSignal({});\n const navigate = useNavigate();\n const isFirst = createSelector(() => {\n return 0;\n });\n\n const provider = createMemo(() => {\n return createInfiniteScroll(browseProvider(params.filter || 'all'));\n });\n\n createEffect(on(activeElement, (elm) => {\n if (elm.backdrop) {\n setGlobalBackground(elm.backdrop);\n }\n // if (elm.entityInfo) {\n // setEntityInfo(elm.entityInfo);\n // }\n if (elm.heroContent) {\n setHeroContent(elm.heroContent);\n }\n }, { defer: true}))\n\n function onRowFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setcolumnY((this.y || 0) * -1 + 24);\n let numPages = provider().pages().length;\n\n if (numPages === 0 || this.parent.selected && this.parent.selected >= numPages - 2) {\n provider().setPage(p => p + 1);\n }\n }\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href)\n };\n\n return (\n \n \n \n \n \n {(items, i) =>\n \n }\n \n \n \n \n );\n};\n\nexport default Browse;\n","import { createSignal, createSelector, For } from \"solid-js\";\nimport { ElementNode, View, Text, activeElement } from \"@lightningjs/solid\";\nimport { Row } from \"@lightningjs/solid-ui\";\nimport { useNavigate } from \"@solidjs/router\";\nimport styles from \"../styles\";\nimport { assertTruthy } from \"@lightningjs/renderer/utils\";\n\nconst Portal = () => {\n const navigate = useNavigate();\n const isFirst = createSelector(() => {\n return 0;\n });\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.id);\n navigate(\"/\" + entity.id);\n }\n\n const demos = [\n {\n title: \"Flex Row\",\n id: \"flex\",\n description: \"Flex Row Implementation\",\n },\n {\n title: \"Flex Column\",\n id: \"flexcolumn\",\n description: \"Flex Column Implementation\",\n },\n {\n title: \"Flex Row Vertical Align\",\n id: \"flexsize\",\n description: \"Flex Row Vertical Align Implementation\",\n },\n {\n title: \"Flex Column Vertical Align\",\n id: \"flexcolumnsize\",\n description: \"Flex Column Vertical Align Implementation\",\n },\n {\n title: \"Buttons\",\n id: \"buttons\",\n description: \"Demo a few buttons\",\n },\n {\n title: \"Text\",\n id: \"text\",\n description: \"Text layout with flexbox\",\n },\n {\n title: \"Create Elements\",\n id: \"create\",\n description: \"Testing Show + children + inserting text\",\n },\n ];\n\n function DemoTile(props) {\n const Container = {\n width: 370,\n height: 320,\n borderRadius: 6,\n scale: 1,\n color: 0x182b44ff,\n transition: { color: true, scale: true },\n focus: {\n scale: 1.1,\n color: 0xffffffff,\n },\n };\n const [color, setColor] = createSignal(0xffffffff);\n\n return (\n setColor(0x000000ff)}\n onBlur={() => setColor(0xffffffff)}\n style={Container}\n >\n \n \n {props.index}\n \n \n {props.title}\n \n \n {props.description}\n \n \n \n );\n }\n\n const [rowX, setRowX] = createSignal(140);\n\n function moveRow(row) {\n setRowX(row.selected * -400 + 140);\n }\n\n return (\n \n \n \n \n Examples\n \n \n \n \n \n {(demo, i) => (\n \n )}\n \n \n \n );\n};\n\nexport default Portal;\n","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst TextPage = () => {\n const OverviewContainer = {\n width: 900,\n height: 500,\n y: 350,\n x: 150,\n gap: 25,\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const SublineContainer = {\n width: 900,\n height: 36,\n gap: 6,\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const Title = {\n fontSize: 42,\n };\n\n const Overview = {\n width: OverviewContainer.width,\n fontSize: 26,\n contain: \"width\",\n } satisfies IntrinsicTextNodeStyleProps;\n\n const Subline = {\n fontSize: 26,\n };\n\n onMount(() => {\n setGlobalBackground(\"#000000\");\n });\n\n return (\n \n Title of the Page\n \n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer vel\n tempor tellus. Sed eu leo purus. Vestibulum sollicitudin eget tellus a\n varius. Phasellus est turpis, volutpat sed blandit sit amet, rutrum sit\n amet mauris. In dignissim elit orci, a sollicitudin ipsum faucibus et.\n Quisque vel quam rutrum, faucibus augue sed, scelerisque nunc.\n \n \n Subline Text\n \n More Text\n \n \n );\n};\n\nexport default TextPage;\n","import {\n IntrinsicNodeStyleProps,\n IntrinsicTextNodeStyleProps,\n Text,\n View,\n hexColor,\n} from \"@lightningjs/solid\";\nimport { Show, children, createSignal, onMount } from \"solid-js\";\nimport { setGlobalBackground } from \"../state\";\n\nconst CreatePage = () => {\n const OverviewContainer = {\n width: 900,\n height: 500,\n y: 50,\n x: 150,\n gap: 25,\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const SublineContainer = {\n width: 900,\n height: 36,\n gap: 6,\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"flexStart\",\n color: hexColor(\"00000000\"),\n } satisfies IntrinsicNodeStyleProps;\n\n const Title = {\n fontSize: 42,\n };\n\n const Subline = {\n fontSize: 26,\n };\n\n let myBox, childRef;\n onMount(() => {\n setGlobalBackground(\"#000000\");\n myBox.animate({ x: 100 }, { duration: 2000 }).start();\n });\n\n const [insertTest, setInsertTest] = createSignal();\n const [emptyTest, setEmptyTest] = createSignal();\n\n setTimeout(() => {\n setInsertTest(\"- Inserted -\");\n childRef\n .getChildById(\"child1\")\n //.searchChildrenById('subChild') - more expensive version of getChildById\n ?.animate({ x: 600 }, { duration: 2000 })\n .start();\n }, 2000);\n\n const styleChild = {\n width: 400,\n height: 300,\n // Solid blue\n color: hexColor(\"#0000ff\"),\n } as const;\n\n const someOtherStyle = {\n // pretty red\n color: hexColor(\"#f54242\"),\n focus: {\n // pretty blue\n color: hexColor(\"#4287f5\"),\n },\n };\n\n function ChildTest(props) {\n // This causes a parent not rendered error since we're rendering it twice in the template\n const resolved = children(() => props.children);\n return (\n \n \n {resolved()}\n \n {props.title}\n \n \n {resolved()}\n \n \n );\n }\n\n const borderStyles = {\n borderLeft: {\n width: 8,\n color: 0x05b2b626,\n },\n borderTop: {\n width: 8,\n color: 0x25a2bd26,\n },\n borderRight: {\n width: 8,\n color: 0x05b2b626,\n },\n borderBottom: {\n width: 8,\n color: 0xc5b23626,\n },\n } as const;\n\n const childTestPassedStyles = {\n // grey color\n color: hexColor(\"#cccccc\"),\n focus: {\n // black\n color: hexColor(\"#000000\"),\n },\n };\n\n const childTestPassedStyles2 = {\n // white color\n color: hexColor(\"#ffffff\"),\n focus: {\n // white something...\n color: hexColor(\"#f6f6cc\"),\n },\n };\n\n function hasFocus(elm) {\n console.log(\"Ref is available: \", elm);\n return true;\n }\n\n return (\n \n Title of the Page\n \n {emptyTest()}\n Sub {insertTest()} Text\n \n \n \n More Text\n \n \n Child Test\n \n \n \n );\n};\n\nexport default CreatePage;\n","import { View, Text, ElementNode, IntrinsicNodeProps, hexColor, IntrinsicNodeStyleProps } from '@lightningjs/solid';\nimport { withPadding } from '@lightningjs/solid-primitives';\nimport { Row } from '@lightningjs/solid-ui';\nimport { buttonStyles } from '../styles';\nwithPadding;\n\nconst ButtonsPage = () => {\n function onEnter(this: ElementNode, event, elm) {\n this.states.toggle('disabled');\n }\n\n const RowStyles = {\n display: 'flex',\n justifyContent: 'flexStart',\n width: 1500,\n height: 300,\n color: hexColor('00000000'),\n gap: 26,\n y: 400\n } satisfies IntrinsicNodeStyleProps;\n\n function Button(props) {\n return (\n \n {props.children}\n \n );\n }\n\n const Badge = (props: IntrinsicNodeProps) => {\n return \n \n {props.children as string}\n \n ;\n };\n return (\n <>\n \n HD\n PG13\n NC17\n I like bananas\n DOLBY\n \n\n \n \n \n \n \n \n \n );\n};\n\nexport default ButtonsPage;\n","import { ElementNode, IntrinsicNodeStyleProps, Text, View, hexColor } from '@lightningjs/solid';\nimport { Column, Row } from '@lightningjs/solid-ui';\nimport { createSignal, onMount } from 'solid-js';\nimport styles from '../styles';\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexPage = () => {\n const RowStyles = {\n display: 'flex',\n justifyContent: 'flexStart',\n width: 1600,\n height: 110,\n color: hexColor('#4dabf5'),\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n marginTop: 25,\n marginBottom: -20,\n skipFocus: true,\n }\n\n function Block(props) {\n const styles = {\n width: 200,\n height: 100,\n y: 5,\n color: 0x1769aaff,\n }\n\n return ;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground('#333333');\n })\n\n const gap = 50;\n\n return (\n <>\n \n Flex Start\n \n \n \n \n \n \n \n Flex Start - Margin Left\n \n \n \n \n \n \n \n Flex End\n \n \n \n \n \n \n \n\n Flex End - Margin Right\n \n \n \n \n \n \n \n\n Center - No Margin Support\n \n \n \n \n \n \n \n\n Space Between - No Margin Support\n \n \n \n \n \n \n \n\n Space Evenly - No Margin Support\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexPage;\n","import { ElementNode, IntrinsicNodeStyleProps, Text, View, hexColor } from '@lightningjs/solid';\nimport { Column, Row } from '@lightningjs/solid-ui';\nimport { createSignal, onMount } from 'solid-js';\nimport styles from '../styles';\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexSizePage = () => {\n const RowStyles = {\n display: 'flex',\n justifyContent: 'flexStart',\n width: 1600,\n height: 110,\n color: hexColor('#4dabf5'),\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n marginTop: 25,\n marginBottom: -20,\n skipFocus: true,\n }\n\n function Block(props) {\n const styles = {\n width: 200,\n height: 100,\n y: 5,\n color: 0x1769aaff,\n }\n\n return ;\n }\n\n function randSize() {\n // size 21 to 100\n return Math.floor(Math.random() * 91) + 10;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground('#333333');\n })\n\n const gap = 50;\n\n return (\n <>\n \n Flex Start - AlignItems: center\n \n \n \n \n \n \n \n Flex Start - Margin Left - AlignItems: flexStart\n \n \n \n \n \n \n \n Flex End - AlignItems: flexEnd\n \n \n \n \n \n \n \n\n Flex End - Margin Right\n \n \n \n \n \n \n \n\n Center - No Margin Support\n \n \n \n \n \n \n \n\n Space Between - No Margin Support\n \n \n \n \n \n \n \n\n Space Evenly - No Margin Support\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexSizePage;\n","import { ElementNode, IntrinsicNodeStyleProps, Text, View, hexColor } from '@lightningjs/solid';\nimport { Column, Row } from '@lightningjs/solid-ui';\nimport { createSignal, onMount } from 'solid-js';\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexColumnPage = () => {\n const RowStyles = {\n display: 'flex',\n justifyContent: 'spaceEvenly',\n width: 1920,\n y: 100,\n height: 880,\n color: hexColor('00000000'),\n } satisfies IntrinsicNodeStyleProps;\n\n const ColumnStyles = {\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'flexStart',\n color: hexColor('#4dabf5'),\n height: 850,\n width: 80\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n y: 20,\n x: 150,\n }\n\n function Block(props) {\n const styles = {\n width: randSize(),\n height: 80,\n x: 5,\n color: hexColor('#1769aa'),\n }\n\n return ;\n }\n\n function randSize() {\n // size 10 to 70\n return Math.floor(Math.random() * 61) + 10;\n }\n\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground('#333333');\n })\n\n const gap = 50;\n\n return (\n <>\n Start, MarginTop, End, MarginBottom, Center, Between, Evenly\n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexColumnPage;\n","import { ElementNode, IntrinsicNodeStyleProps, Text, View, hexColor } from '@lightningjs/solid';\nimport { Column, Row } from '@lightningjs/solid-ui';\nimport { createSignal, onMount } from 'solid-js';\nimport { setGlobalBackground } from \"../state\";\n\nconst FlexColumnPage = () => {\n const RowStyles = {\n display: 'flex',\n justifyContent: 'spaceEvenly',\n width: 1920,\n y: 100,\n height: 880,\n color: hexColor('00000000'),\n } satisfies IntrinsicNodeStyleProps;\n\n const ColumnStyles = {\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'flexStart',\n color: hexColor('#4dabf5'),\n height: 850,\n width: 60\n } satisfies IntrinsicNodeStyleProps;\n\n const rowTitle = {\n fontSize: 44,\n y: 20,\n x: 150,\n }\n\n function Block(props) {\n const styles = {\n width: 50,\n height: 80,\n x: 5,\n color: hexColor('#1769aa'),\n }\n\n return ;\n }\n\n const [columnY, setColumnY] = createSignal(50);\n function onFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n setColumnY(150 + (this.y || 0) * -1);\n }\n\n onMount(() => {\n setGlobalBackground('#333333');\n })\n\n const gap = 50;\n\n return (\n <>\n Start, MarginTop, End, MarginBottom, Center, Between, Evenly\n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default FlexColumnPage;\n","import { ElementNode, IntrinsicNodeStyleProps, Text, View, hexColor } from '@lightningjs/solid';\nimport { Row } from '@lightningjs/solid-ui';\n\nimport { MaterialButtonText } from '../styles';\n\nconst MaterialButtonsPage = () => {\n function onEnter(this: ElementNode, event, elm) {\n this.states.toggle('disabled');\n }\n\n const RowStyles = {\n display: 'flex',\n justifyContent: 'flexStart',\n width: 1500,\n height: 300,\n color: hexColor('00000000'),\n gap: 26,\n y: 400,\n x: 100\n } satisfies IntrinsicNodeStyleProps;\n\n const MaterialButton = {\n width: 386,\n height: 136,\n color: '0x715cabff',\n focus: {\n color: '0x5a39a2ff',\n },\n disabled: {\n color: '0x291d43ff',\n }\n };\n const RoundedRectangle = ['RoundedRectangle', { radius: 65 }];\n function Button(props) {\n return (\n \n {props.children}\n \n );\n }\n\n return (\n \n \n \n \n \n );\n};\n\nexport default MaterialButtonsPage;\n","// Documentation from Shaka player:\n// https://shaka-player-demo.appspot.com/docs/api/tutorial-basic-usage.html\n\nconst manifestUri =\n 'https://storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd';\n\nfunction initApp() {\n // Install built-in polyfills to patch browser incompatibilities.\n shaka.polyfill.installAll();\n\n // Check to see if the browser supports the basic APIs Shaka needs.\n if (shaka.Player.isBrowserSupported()) {\n // Everything looks good!\n initPlayer();\n } else {\n // This browser does not have the minimum set of APIs we need.\n console.error('Browser not supported!');\n }\n}\n\nasync function initPlayer() {\n // Create a Player instance.\n const video = document.getElementById('video');\n const player = new shaka.Player();\n await player.attach(video);\n\n // Attach player to the window to make it easy to access in the JS console.\n window.player = player;\n\n // Listen for error events.\n player.addEventListener('error', onErrorEvent);\n\n // Try to load a manifest.\n // This is an asynchronous process.\n try {\n await player.load(manifestUri);\n // This runs if the asynchronous load is successful.\n console.log('The video has now been loaded!');\n } catch (e) {\n // onError is executed if the asynchronous load fails.\n onError(e);\n }\n}\n\nfunction onErrorEvent(event) {\n // Extract the shaka.util.Error object from the event.\n onError(event.detail);\n}\n\nfunction onError(error) {\n // Log the error.\n console.error('Error code', error.code, 'object', error);\n}\n\nexport function playVideo() {\n const video = document.getElementById('video');\n video.hidden = false;\n // Needs delay from hidden to play in Chrome\n setTimeout(() => video.play(), 50);\n video.focus();\n return video;\n}\n\nexport function closeVideo() {\n const video = document.getElementById('video');\n video.hidden = true;\n video.pause();\n return video;\n}\n\ndocument.addEventListener('DOMContentLoaded', initApp);","import { ElementNode, Text, View, Show, hexColor, setActiveElement } from '@lightningjs/solid';\nimport { Column } from '@lightningjs/solid-ui';\nimport { useParams } from \"@solidjs/router\";\nimport { createEffect, createResource, on, createSignal } from \"solid-js\";\nimport { TileRow, Button } from '../components';\nimport { setGlobalBackground } from \"../state\";\nimport ContentBlock from \"../components/ContentBlock\";\nimport { useNavigate } from \"@solidjs/router\";\nimport styles from '../styles';\nimport * as provider from '../api/providers/entity';\nimport { assertTruthy } from '@lightningjs/renderer/utils';\nimport type { Tile } from '../api/formatters/ItemFormatter';\nimport { playVideo, closeVideo } from '../video';\n\nconst Entity = () => {\n const params = useParams();\n const navigate = useNavigate();\n\n const [data] = createResource(() => ({...params}), provider.getInfo);\n const [credits] = createResource(() => ({...params}), provider.getCredits);\n const [recommendations] = createResource(() => ({...params}), provider.getRecommendations);\n const [backdropAlpha, setBackdropAlpha] = createSignal(0);\n\n createEffect(on(data, (data) => {\n setGlobalBackground(data.backgroundImage);\n }, { defer: true}))\n\n const columnY = 600;\n\n const Backdrop = {\n color: hexColor('#000000'),\n alpha: 0,\n width: 1900,\n height: 890,\n x: 10,\n y: columnY,\n borderRadius: 30,\n }\n\n function onRowFocus(this: ElementNode) {\n this.children.selected?.setFocus();\n columnRef.y = columnY;\n backdropRef.y = columnY;\n backdropRef.alpha = 0;\n }\n\n function onRowFocusAnimate(this: ElementNode) {\n this.children.selected?.setFocus();\n columnRef.y = 200;\n backdropRef.y = 160;\n backdropRef.alpha = 0.9;\n }\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n };\n\n function onEscape() {\n closeVideo();\n // Set focus back to lightning app\n document.getElementsByTagName('canvas')[0].focus();\n setActiveElement(trailerButton);\n setBackdropAlpha(0);\n }\n\n function onEnterTrailer() {\n const video = playVideo();\n setActiveElement(video);\n setBackdropAlpha(0.9);\n }\n\n let columnRef, backdropRef, trailerButton;\n\n return (\n \n trailerButton.setFocus()} onEscape={onEscape}>\n \n \n \n \n Recommendations\n \n Cast and Crew\n \n \n \n \n \n \n \n );\n};\n\nexport default Entity;\n","import api, { getImageUrl } from '..';\nimport { convertItemsToTiles } from '../formatters/ItemFormatter';\n\nexport function minutesToHMM(minutes) {\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return hours + 'h ' + (remainingMinutes < 10 ? '0' : '') + remainingMinutes + 'm';\n}\n\nfunction justYear(dateString) {\n const parts = dateString.split(\"-\");\n return parts[0];\n}\n\nexport function getCredits({id}) {\n return api.get(`/person/${id}/combined_credits`).then(\n ({ cast }) => convertItemsToTiles(cast.slice(0, 7))\n );\n}\n\nexport function getInfo({id}) {\n return api.get(`/person/${id}`).then(\n (data) => ({\n backgroundImage: getImageUrl(data.profile_path, 'original'),\n heroContent: {\n title: data.title || data.name,\n description: data.biography,\n },\n ...data\n }));\n}\n","import { ElementNode, Text, View, Show, hexColor } from '@lightningjs/solid';\nimport { Column } from '@lightningjs/solid-ui';\nimport { useParams } from \"@solidjs/router\";\nimport { createEffect, createResource, on } from \"solid-js\";\nimport { TileRow } from '../components';\nimport { setGlobalBackground } from \"../state\";\nimport { useNavigate } from \"@solidjs/router\";\nimport theme from 'theme';\nimport styles from '../styles';\nimport * as provider from '../api/providers/people';\nimport { assertTruthy } from '@lightningjs/renderer/utils';\n\nconst People = () => {\n const params = useParams();\n const navigate = useNavigate();\n\n const [data] = createResource(() => ({...params}), provider.getInfo);\n const [credits] = createResource(() => ({...params}), provider.getCredits);\n\n createEffect(on(data, (data) => {\n setGlobalBackground(data.backgroundImage);\n }, { defer: true}))\n\n const Backdrop = {\n color: hexColor('#000000'),\n alpha: 0.8,\n width: 1540,\n height: 440,\n x: 130,\n y: 180,\n borderRadius: 30,\n }\n\n function onEnter(this: ElementNode) {\n let entity = this.children.selected;\n assertTruthy(entity && entity.href);\n navigate(entity.href);\n };\n\n return (\n \n \n {data().name}\n {data().biography}\n \n \n \n \n Credits\n \n \n \n \n );\n};\n\nexport default People;\n","const NotFound = () => {\n return (\n \n );\n};\n\nexport default NotFound;\n","export default import.meta.ROLLUP_FILE_URL_DM04K3OB;","import {\n render,\n Config,\n SolidNode,\n SolidRendererOptions,\n hexColor,\n ElementNode,\n} from \"@lightningjs/solid\";\nimport { HashRouter, Route } from \"@solidjs/router\";\nimport { createSignal } from \"solid-js\";\nimport App from \"./pages/App\";\nimport Browse from \"./pages/Browse\";\nimport Portal from \"./pages/Portal\";\nimport TextPage from \"./pages/Text\";\nimport CreatePage from \"./pages/Create\";\nimport ButtonsPage from \"./pages/Buttons\";\nimport FlexPage from \"./pages/Flex\";\nimport FlexSizePage from \"./pages/FlexSize\";\nimport FlexColumnSizePage from \"./pages/FlexColumnSize\";\nimport FlexColumnPage from \"./pages/FlexColumn\";\nimport ButtonsMaterialPage from \"./pages/ButtonsMaterial\";\nimport Entity from \"./pages/Entity\";\nimport People from \"./pages/People\";\nimport NotFound from \"./pages/NotFound\";\nimport coreExtensionModuleUrl from \"./AppCoreExtensions.js?importChunkUrl\";\n\nconst logFps = true;\nConfig.debug = false;\nConfig.animationsEnabled = true;\nConfig.fontSettings.fontFamily = \"Ubuntu\";\nConfig.fontSettings.color = hexColor(\"#ffffff\");\nConfig.fontSettings.fontSize = 100;\nConfig.rendererOptions = {\n coreExtensionModule: coreExtensionModuleUrl,\n fpsUpdateInterval: logFps ? 1000 : 0,\n enableInspector: true,\n // deviceLogicalPixelRatio: 1\n};\n\nrender(() => (\n }>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n));\n"],"names":["SuspenseContext","equalFn","a","b","$PROXY","Symbol","$TRACK","signalOptions","equals","runEffects","runQueue","STALE","PENDING","UNOWNED","owned","cleanups","context","owner","NO_INIT","Owner","Transition","Listener","Updates","Effects","ExecCount","createRoot","fn","detachedOwner","listener","unowned","length","current","undefined","root","updateFn","untrack","cleanNode","runUpdates","createSignal","value","options","s","observers","observerSlots","comparator","Object","assign","readSignal","bind","writeSignal","createComputed","updateComputation","createComputation","createRenderEffect","createEffect","runUserEffects","c","render","user","push","createMemo","createResource","pSource","pFetcher","pOptions","source","fetcher","arguments","pr","initP","scheduled","resolved","dynamic","contexts","Set","_ref2","_slicedToArray","storage","initialValue","setValue","_createSignal2","error","setError","_createSignal3","_createSignal4","track","trigger","_createSignal6","state","setState","loadEnd","p","v","key","onHydrated","queueMicrotask","err","_step4","_iterator4","_createForOfIteratorHelper","keys","n","done","decrement","e","f","clear","completeLoad","read","has","increment","add","load","refetching","lookup","status","then","castError","defineProperties","get","loading","latest","refetch","mutate","createSelector","subs","Map","node","_step5","_iterator5","entries","_step5$value","val","_step6","_iterator6","values","pure","l","set","onCleanup","delete","size","on","deps","prevInput","isArray","Array","defer","prevValue","input","i","result","onMount","getOwner","runWithOwner","o","prev","prevListener","handleError","startTransition","Promise","resolve","createContext","defaultValue","id","Provider","createProvider","useContext","children","memo","resolveChildren","toArray","_this","this","sources","updates","lookUpstream","sSlot","sourceSlots","isComp","TransitionRunning","running","disposed","tState","markDownstream","Error","time","nextValue","forEach","updatedAt","runComputation","init","runTop","suspense","inFallback","effects","ancestors","wait","res","completeUpdates","queue","userLength","ignore","pop","index","obs","cause","results","apply","props","_objectSpread","_defineProperty","FALLBACK","dispose","d","createComponent","Comp","trueFn","propTraps","_","property","receiver","deleteProperty","getOwnPropertyDescriptor","configurable","enumerable","ownKeys","resolveSource","resolveSources","mergeProps","_len","_key3","proxy","Proxy","_toConsumableArray","sourcesMap","defined","create","sourceKeys","getOwnPropertyNames","_loop","desc","target","definedKeys","defineProperty","narrowedError","name","concat","For","fallback","list","mapFn","items","mapped","disposers","len","indexes","j","newItems","newIndices","newIndicesNext","temp","tempdisposers","tempIndexes","start","end","newEnd","item","newLen","disposer","mapper","Math","min","slice","_createSignal8","mapArray","each","Show","keyed","condition","when","child","_createSignal10","activeElement","setActiveElement","TextureUsageTracker","_createClass","releaseCallback","_classCallCheck","ManualCountTextureUsageTracker","_TextureUsageTracker2","_options$textureClean","_options$textureClean2","_this2","_callSuper","textureCleanupIntervalMs","textureCleanupAgeThreadholdMs","setInterval","_step9","now","Date","thresholdMs","_iterator9","zeroReferenceTextureSet","textureRefInfo","lastUpdate","textureMap","_inherits","texture","_texture$options","textureId","assertTruthy","nodeRefCount","_texture$options2","registerTexture","txType","incrementTextureRefCount","_texture$options3","decrementTextureRefCount","FinalizationRegistryTextureUsageTracker","_TextureUsageTracker3","_this3","registry","FinalizationRegistry","_texture$options4","_texture$options5","register","stylePropertyMap","alpha","prop","x","y","width","w","height","h","zIndex","fontFamily","fontSize","fontStyle","fontWeight","fontStretch","lineHeight","letterSpacing","textAlign","overflowSuffix","maxLines","contain","verticalAlign","clipping","rotation","scale","scaleX","scaleY","color","convertColorToRgba","g","domPropertyMap","Inspector","canvas","settings","_settings$appHeight","_settings$deviceLogic","_settings$appWidth","_settings$deviceLogic2","_settings$deviceLogic3","_settings$deviceLogic4","isProductionEnvironment","ceil","appHeight","deviceLogicalPixelRatio","appWidth","document","createElement","setRootPosition","body","appendChild","MutationObserver","observe","attributes","childList","subtree","ResizeObserver","window","addEventListener","console","warn","rect","getBoundingClientRect","top","documentElement","scrollTop","left","scrollLeft","style","position","transformOrigin","transform","overflow","properties","div","toString","updateNodeProperty","driver","createNode","createDiv","createProxy","createTextNode","_this4","Reflect","destroyNode","anim","animate","animateNode","getElementById","remove","innerHTML","String","visibility","setAttribute","_stylePropertyMap$pro","mappedStyleResponse","call","setProperty","parentId","parent","_settings$duration","duration","_settings$delay","delay","_props$alpha","_props$rotation","_props$scale","setTimeout","opacity","rotate","ShaderEffect","ref","_options$props","uniformInfo","passParameters","declaredUniforms","uniforms","constructor","u","unif","uniType","type","uniformName","define","uniform","method","join","uni","trPropSetterDefaults","text","offsetY","scrollable","scrollY","textBaseline","debug","TextRenderer","stage","_this5","propSetters","getPropertySetters","freeze","fromEntries","map","_ref3","_ref4","setter","requestRender","emitter","emit","renderable","isRenderable","eventName","off","_this6","updateScheduled","updateState","calcHeight","numLines","max","LightningTextTextureRenderer","_canvas","_context","_settings","mergeDefaults","precision","font","_getFontSetting","ff","fontFace","ffs","getPrecision","_this7","fonts","fontSetting","check","catch","renderInfo","paddingLeft","paddingRight","wordWrapWidth","cutSx","cutEx","cutSy","cutEy","textIndent","setFontProperties","linesInfo","innerWidth","textOverflow","wordWrap","suffix","wrapWord","wrapText","split","lines","usedLines","otherLines","measureText","al","m","remainingText","moreTextLines","maxLineWidth","lineWidths","lineWidth","linesOverride","linePositionX","linePositionY","textRenderIssueMargin","globalAlpha","fillRect","translate","drawLines","highlight","highlightColor","hlHeight","highlightHeight","offset","highlightOffset","hlPaddingLeft","highlightPaddingLeft","hlPaddingRight","highlightPaddingRight","fillStyle","getRgbaString","drawLine","prevShadowSettings","shadow","shadowColor","shadowOffsetX","shadowOffsetY","shadowBlur","textColor","fillText","textSplit","word","suffixWidth","wordLen","wordWidth","cutoffIndex","floor","truncWordWidth","substring","indent","allLines","realNewlines","resultLines","spaceLeft","words","wordWidthWithSpace","_this8","space","reduce","acc","char","wordBreak","advancedRenderer","fontBaselineRatio","resolvedGlobal","self","globalThis","globalFontSet","_resolvedGlobal$docum","tmpElementBounds","createBound","CanvasTextRenderer","_TextRenderer2","_this9","OffscreenCanvas","getContext","rendererBounds","x1","y1","x2","y2","_this10","fontInfo","invalidateLayoutCache","invalidateVisibleWindowCache","WebTrFontFace","EventEmitter","canvasPages","lightning2TextRenderer","renderWindow","visibleWindow","valid","forceFullLayoutCalc","textW","textH","fontFaceLoadedHandler","debugData","updateCount","layoutCount","drawCount","lastLayoutNumCharacters","layoutSum","drawSum","bufferSize","setStatus","cssString","loaded","onFontLoaded","onFontLoadError","containedMaxLines","calcMaxLines","getNormalizedRgbaComponents","calculateRenderInfo","_state$props","elementBounds","Infinity","intersectBound","visibleWindowHeight","maxLinesPerCanvasPage","renderWindowScreenX1","renderWindowScreenY1","renderWindowScreenX2","renderWindowScreenY2","shift","lineNumStart","lineNumEnd","unshift","_canvasPages","_canvasPages2","_canvasPages3","pageHeight","page1Block","page1LineStart","page0LineStart","page2LineStart","scrollYNearestPage","performance","_step10","_iterator10","pageInfo","_pageInfo$texture","setRenderableOwner","txManager","loadTexture","src","_pageInfo$texture2","draw","getImageData","preload","clippingRect","_state$textW","_state$textH","_state$props2","elementRect","intersectRect","_canvasPages$0$textur","_canvasPages$0$textur2","_canvasPages$1$textur","_canvasPages$1$textur2","_canvasPages$2$textur","_canvasPages$2$textur2","pageSize","_state$props3","combinedAlpha","getNormalizedAlphaComponent","quadColor","mergeColorAlphaPremultiplied","renderer","addQuad","colorBl","colorBr","colorTl","colorTr","dimensions","textureOptions","shader","shaderProps","tx","ty","ta","tb","tc","td","_state$canvasPages","_get2","_getPrototypeOf","prototype","_pageInfo$texture3","_state$canvasPages2","_pageInfo$texture4","scheduleUpdateState","_state$fontInfo","_state$fontInfo2","DefaultShader","_WebGlCoreShader","textures","glw","activeTexture","bindTexture","ctxTexture","WebGlCoreShader","vertex","fragment","DefaultShaderBatched","_WebGlCoreShader2","_this11","system","parameters","MAX_VERTEX_TEXTURE_IMAGE_UNITS","t","samplers","from","setUniform","textureUnits","idx","effectCache","getResolvedEffect","effectContructors","JSON","stringify","effect","resolveDefaults","DynamicShader","_WebGlCoreShader3","_this12","createShader","shaderSources","calculateProps","memize","_this13","regEffects","shManager","getRegisteredEffects","eff","_eff$props","fxClass","uniInfo","fxProp","propInfo","validator","Float32Array","_this14","r","effectNameCount","methods","declareUniforms","uFx","baseClass","getEffectKey","nr","effectMethods","fx","_fx$props","fxProps","remap","cm","fxMethod","resolveMethodDuplicate","replace","onShaderMask","Function","onColorize","onEffectMask","reg","RegExp","methodParameters","getMethodParameters","pm","sharedMethods","currentMask","drawEffects","currentClass","next","effectMethod","methodCollection","$dimensions","$alpha","_props$effects","RoundedRectangle","_WebGlCoreShader4","radius","propsA","propsB","IDENTITY_MATRIX_3x3","SdfShader","_WebGlCoreShader5","resolvedProps","components","_props$transform","_props$scrollY","_props$color","_props$size","_props$distanceRange","_props$debug","distanceRange","RadiusEffect","_ShaderEffect2","_this15","_len3","args","_key9","_props$radius","fillMask","boxDist","BorderEffect","_ShaderEffect3","_this16","_len4","_key10","_props$width","_props$color2","rgba","LinearGradientEffect","_ShaderEffect4","_this17","_len5","_key11","colors","_props$colors","_props$angle","stops","colorsL","tmp","angle","_LinearGradientEffect","rgbas","fromLinear","toLinear","calcPoint","amount","loop","ColorLoop","GrayscaleEffect","_ShaderEffect5","_this18","_len6","_key12","_props$amount","BorderRightEffect","_ShaderEffect6","_this19","_len7","_key13","_props$width2","_props$color3","rectDist","BorderTopEffect","_ShaderEffect7","_this20","_len8","_key14","_props$width3","_props$color4","BorderBottomEffect","_ShaderEffect8","_this21","_len9","_key15","_props$width4","_props$color5","BorderLeftEffect","_ShaderEffect9","_this22","_len10","_key16","_props$width5","_props$color6","GlitchEffect","_ShaderEffect10","_this23","_len11","_key17","_props$amplitude","_props$narrowness","_props$blockiness","_props$minimizer","_props$time","amplitude","narrowness","blockiness","minimizer","rand","noise","fbm","FadeOutEffect","_ShaderEffect11","_this24","_len12","_key18","_props$fade","fade","RadialGradientEffect","_ShaderEffect12","_this25","_len13","_key19","_props$colors2","_props$width6","_ref5","_props$height","_props$pivot","pivot","_RadialGradientEffect","RadialProgressEffect","_ShaderEffect13","_this26","_len14","_key20","_props$width7","_props$progress","_props$offset","_props$range","_props$rounded","_props$radius2","_props$color7","progress","range","PI","rounded","rotateUV","drawDot","HolePunchEffect","_ShaderEffect14","_this27","_len15","_key21","_props$radius3","CoreShaderManager","registerShaderType","registerEffectType","shType","shClass","shConstructors","effectType","effectClass","effectConstructors","ShaderClass","loadDynamicShader","cacheKey","makeCacheKey","shCache","attachedShader","detach","attach","ContextSpy","data","loadCompressedTexture","_ref6","_asyncToGenerator","_regeneratorRuntime","mark","_callee","url","response","arrayBuffer","wrap","fetch","sent","indexOf","abrupt","loadKTXData","loadPVRData","stop","_x2","_ref7","_callee2","buffer","view","littleEndian","mipmaps","imageSize","_context2","DataView","getUint32","glInternalFormat","pixelWidth","pixelHeight","numberOfMipmapLevels","bytesOfKeyValueData","premultiplyAlpha","_x3","_ref8","_callee3","pvrHeaderLength","header","dataOffset","pvrtcData","level","_context3","Int32Array","Uint8Array","byteOffset","_x4","ImageTexture","_Texture","_this28","mimeType","_getTextureData","_callee4","_this$props","blob","hasAlphaChannel","img","_context4","ImageData","isCompressedTextureContainer","test","imageWorkerManager","getImage","hasCreateImageBitmap","createImageBitmap","colorSpaceConversion","imageOrientation","t0","t1","Image","reject","onload","onerror","getTextureData","_props$src","_props$premultiplyAlp","Texture","PeekableIterator","iterator","indexBase","_lastIndex","peekBuffer","nextResult","getUnicodeCodepoints","_callee5","codePoint","_callee5$","_context5","codePointAt","layoutText","curLineIndex","startX","startY","vertexBuffer","lineCache","rwSdf","trFontFace","shaper","glyphResult","fontSizeRatio","info","vertexLineHeight","vertexW","vertexLSpacing","startingLineCacheEntry","startingCodepointIndex","codepointIndex","maxX","maxY","curX","curY","bufferOffset","lastWord","xStart","shaperProps","glyphs","shapeText","curLineBufferStart","bufferLineInfos","vertexTruncateHeight","overflowSuffVertexWidth","_step11","_iterator11","glyph","xAdvance","moreLines","nextLineWillFit","maxCharHeight","lineVertexW","xStartLastWordBoundary","lineIsBelowWindowTop","lineIsAboveWindowBottom","lineIsWithinWindow","cluster","codepoint","charEndX","xOffset","quadX","quadY","yOffset","atlasEntry","getAtlasEntry","glyphId","common","scaleW","scaleH","uvWidth","uvHeight","bufferStart","bufferEnd","vertexTextW","line","bufferNumFloats","bufferNumQuads","layoutNumCharacters","fullyProcessed","setRenderWindow","outRenderWindow","bufferMargin","multiple","screen","sdf","isBoundPositive","y1Base","roundUpToMultiple","firstLineIdx","weightConversions","normal","bold","bolder","lighter","fontWeightToNumber","weight","resolveFontToUse","familyMapsByPriority","family","weightIn","stretch","_step12","_iterator12","fontFaces","_step13","weightMap","_iterator13","fontFamilyWeight","descriptors","msg","TrFontManager","textRenderers","trId","tr","isFontFaceSupported","addFontFace","tmpRect","SdfTextRenderer","_TextRenderer3","_this29","ssdfFontFamilies","msdfFontFamilies","sdfShader","loadShader","_this30","releaseFontFace","setElementBoundsX","boundsOverlap","setElementBoundsY","SdfTrFontFace","familyName","fontFamiles","faceSet","webGlBuffers","bufferUploaded","_this31","resolveFontFace","_state$props4","sdfFontSize","sdfLineHeight","distanceField","neededLength","rwScreen","_state$props5","startLineIndex","sdfVerticalAlignYOffset","sdfStartY","sdfX","sdfY","lineIndex","getStartConditions","out2","byteLength","once","_trFontFace$data","_state$trFontFace","_state$props6","_state$textW2","_state$textH2","stride","BYTES_PER_ELEMENT","webGlBuffer","createBuffer","BufferCollection","a_position","FLOAT","normalized","a_textureCoordinate","_webGlBuffers$getBuff","_webGlBuffers","getBuffer","arrayBufferData","STATIC_DRAW","convertBoundToRect","copyRect","renderOp","WebGlCoreRenderOp","mergeColorAlpha","sdfShaderDebug","getCtxTexture","addTexture","numQuads","addRenderOp","_state$trFontFace2","_state$trFontFace3","fontFamilyArray","_state$props7","_state$props8","loadCoreExtension","_x5","_x6","_loadCoreExtension","_callee13","coreExtensionModule","module$1","ExtensionClass","coreExtension","_context13","log","__vitePreload","module","__VITE_IS_MODERN__","default","CoreExtension","run","santizeCustomDataMap","validTypes","boolean","string","number","valueType","CoreNodeRenderState","RendererMain","_EventEmitter","_settings$clearColor","_settings$experimenta","_settings$enableConte","_settings$enableInspe","_this32","resolvedSettings","txMemByteThreshold","boundsMargin","devicePhysicalPixelRatio","devicePixelRatio","clearColor","experimental_FinalizationRegistryTextureUsageTracker","textureCleanupOptions","fpsUpdateInterval","numImageWorkers","enableContextSpy","enableInspector","releaseTexture","useFinalizationRegistryTracker","textureTracker","deviceLogicalWidth","deviceLogicalHeight","targetEl","onCreateNode","nodes","onBeforeDestroyNode","onFpsUpdate","fpsData","onFrameTick","frameTickData","onIdle","inspector","_init","_callee6","_callee6$","_context6","getRootNode","resolveNodeDefaults","_props$fontSize","_props$text","_props$textRendererOv","_props$fontFamily","_props$fontStyle","_props$fontWeight","_props$fontStretch","_props$textAlign","_props$contain","_props$scrollable","_props$scrollY2","_props$offsetY","_props$letterSpacing","_props$lineHeight","_props$maxLines","_props$textBaseline","_props$verticalAlign","_props$overflowSuffix","_props$debug2","textRendererOverride","_props$color8","_ref9","_ref10","_props$colorTl","_ref11","_ref12","_props$colorTr","_ref13","_ref14","_props$colorBl","_ref15","_ref16","_props$colorBr","_props$data","_props$x","_props$y","_props$width8","_props$height2","_props$alpha2","_props$clipping","_props$colorTop","_props$colorBottom","_props$colorLeft","_props$colorRight","_props$zIndex","_props$zIndexLocked","_props$parent","_props$texture","_props$shader","_props$src2","_props$scale2","_ref17","_props$scaleX","_ref18","_props$scaleY","_props$mount","_ref19","_props$mountX","_ref20","_props$mountY","_props$pivot2","_ref21","_props$pivotX","_ref22","_props$pivotY","_props$rotation2","colorTop","colorLeft","colorRight","colorBottom","zIndexLocked","mount","mountX","mountY","pivotX","pivotY","textureType","nextTextureId","descType","shaderType","CoreAnimation","_EventEmitter2","_this33","propStartValues","propsList","propName","timingFunction","easing","getTimingFunction","delayFor","update","_this34","reset","_this35","startValue","endValue","stopMethod","dt","_this$settings","propValue","applyEasing","easingProgressValue","easingColorValue","mergeColorProgress","CoreAnimationController","manager","animation","makeStartedPromise","started","makeStoppedPromise","finished","activeAnimations","registerAnimation","unregisterAnimation","stoppedResolve","restore","promise","startedPromise","stoppedPromise","_this36","startedResolve","_this37","_this$animation$setti","reverse","Matrix3d","sx","sy","cos","sin","e0","e1","e3","e4","other","multiply","tempMatrix","out","e2","e5","e6","e7","e8","dst","transpose","RenderCoords","x3","y3","x4","y4","UpdateType","CoreNodeRenderStateMap","Init","OutOfBounds","InBounds","InViewport","CoreNode","_EventEmitter3","_this38","All","updateScaleRotateTransform","_this39","unloadTexture","setUpdateType","IsRenderable","onTextureLoaded","onTextureFailed","onTextureFreed","getShaderManager","_shManager$loadShader","updateType","Children","sort","calcZIndex","scaleRotateTransform","pivotTranslateX","pivotTranslateY","mountTranslateX","mountTranslateY","localTransform","Global","delta","parentClippingRect","_this40","ScaleRotate","Local","updateLocalTransform","childUpdateType","None","globalTransform","copy","calculateRenderCoords","updateBoundingRect","Clipping","RenderState","calculateClippingRect","WorldAlpha","worldAlpha","PremultipliedColors","premultipliedColorTl","premultipliedColorTr","premultipliedColorBl","premultipliedColorBr","updateRenderState","updateIsRenderable","CalculatedZIndex","calculateZIndex","ZIndexSortedChildren","sortChildren","renderBound","rectW","rectH","strictBound","renderM","preloadBound","boundInsideBound","renderState","checkRenderBounds","previous","event","newIsRenderable","checkRenderProps","onChangeIsRenderable","_this$props$texture","minX","minY","renderCoords","gt","isRotated","_props$parent2","_props$parent3","z","removeAllListeners","_this$props2","_this$props$parent","_this$props$parent2","absX","_this$props$parent$ab","_this$props$parent3","absY","newParent","oldParent","splice","nextId","getNewId","MainOnlyNode","_EventEmitter4","rendererMain","coreNode","_coreNode$id","_this41","payload","onOutOfBounds","onInBounds","onOutOfViewport","onInViewport","_data","_parent","_newParent$coreNode","_children","_src","imageUrl","createTexture","_texture","_shader","destroy","animationManager","AnimationManager","ImageWorkerManager","_this42","workers","createWorkers","worker","onmessage","handleMessage","_event$data","messageManager","_msg","numWorkers","Blob","blobURL","URL","webkitURL","createObjectURL","Worker","workerIndex","location","href","_this43","absoluteSrcUrl","convertUrlToAbsolute","getNextWorker","postMessage","NoiseTexture","_Texture2","_this44","_getTextureData2","_callee7","_this$props3","pixelData8","_context7","Uint8ClampedArray","random","cacheId","_props$width9","_props$height3","_props$cacheId","CoreTextureManager","WeakMap","hasWorker","registerTextureType","ColorTexture","SubTexture","textureClass","txConstructors","TextureClass","textureIdCache","_options$cacheKey","descId","textureKeyCache","addTextureIdToCache","textureDescId","textureRefCountMap","count","_this$ctxTextureCache","refCountObj","ctxTextureCache","free","keyCacheSize","idCacheSize","textureSource","createCtxTexture","TextureMemoryManager","byteThreshold","threshold","setTextureMemUse","byteSize","memUsed","gc","Stage","_EventEmitter5","_this45","rootId","txMemManager","contextSpy","bm","monitorTextureCache","debugInfo","getDebugInfo","WebGlCoreRenderer","pixelRatio","bufferMemory","fontManager","isIdle","rootNode","requestAnimationFrame","runLoop","updateAnimations","hasSceneUpdates","calculateFps","drawFrame","lastFrameTime","currentFrameTime","deltaTime","renderRequested","addQuads","fpsNumFrames","fpsElapsedTime","_this$contextSpy$getD","_this$contextSpy","_this$contextSpy2","fps","round","contextSpyData","getData","renderQuads","trProps","rendererId","overrideFallback","possibleRenderer","canRenderFont","_i14","_Object$entries","_Object$entries$_i","resolvedTextRenderer","CoreTextNode","_CoreNode2","_this46","setWidth","trState","setHeight","calcWidth","_textRendererOverride","_this46$resolveTextRe","resolveTextRendererAndState","textRendererState","textRenderer","destroyState","_this$resolveTextRend","setIsRenderable","resolveTextRenderer","createState","onTextLoaded","onTextFailed","MainOnlyTextNode","_MainOnlyNode2","MainCoreDriver","_init2","_callee8","rendererSettings","_this48","_context8","_x7","_x8","_x9","removeTextureIdFromCache","startLightningRenderer","_this49","_Array","selected","beforeNode","_isDirty","nodeIndexToRemove","_wrapNativeSuper","config","animationsEnabled","animationSettings","fontSettings","isFunc","flattenStyles","obj","States","callback","_this50","initialState","filter","_ref23","_ref24","_ref25","onChange","_possibleConstructorReturn","_assertThisInitialized","_Array2","stateIndexToRemove","defaultAnimationSettings","convertEffectsToShader","styleEffects","_i16","_Object$entries2","_Object$entries2$_i","borderAccessor","direction","LightningRendererNumberProps","LightningRendererNonAnimatingProps","ElementNode","_this51","_animationQueue","_animationRunning","rendered","autofocus","_renderProps","_step15","_iterator15","_loop2","lng","_sendToLightningAnimatable","_iterator16","_step16","_loop3","_sendToLightning","borderRadius","_borderRadius","border","borderLeft","borderRight","borderTop","borderBottom","linearGradient","_linearGradient","_Object","_effects","_p$lng","transition","_animationQueueSettings","_start5","_callee9","_context9","waitUntilStopped","_this52","forwardFocus","focusedIndex","setFocus","_this53","_node","loadedPayload","updateLayout","_this$lng","_queueDelete","_style","find","_iterator17","_step17","found","searchChildrenById","_states","_stateChanged","states","_animationSettings","hasChildren","_this$parent","onBeforeLayout","display","numChildren","isRow","flexDirection","dimension","crossDimension","marginOne","marginTwo","crossProp","containerSize","containerCrossSize","gap","justify","justifyContent","align","alignItems","itemSize","includes","crossAlignChild","_autosized","calculatedSize","toPad","calculateFlex","onLayout","_this54","forwardStates","_undoStyles","_step14","_iterator14","keyExists","stylesToUndo","styleKey","newStyles","styles","isTextNode","getText","marginRight","_width","marginBottom","_height","onLoad","_resizeOnTextLoad","isNaN","_color","onFail","onCreate","solid","Text","_el$","_$createElement","View","createRenderer$1","_ref27","replaceText","insertNode","removeNode","getParentNode","getFirstChild","getNextSibling","insert","accessor","marker","initial","insertExpression","unwrapArray","multi","cleanChildren","array","normalizeIncomingArray","replacement","appendNodes","reconcileArrays","replaceNode","unwrap","parentNode","bLength","aEnd","bEnd","aStart","bStart","after","sequence","removed","inserted","el","isParent","newNode","oldNode","spreadExpression","prevProps","code","element","spread","skipChildren","setProp","use","arg","universalLightning","anchor","solidRenderer","createRenderer","_ref28","_callee10","_context10","rendererOptions","_x10","_x11","hexColor","Number","isInteger","startsWith","$$EVENTS","eventHandler","composedPath","handler","disabled","cancelBubble","_$host","host","depth","createBeforeLeave","listeners","subscribe","confirm","to","_step18","defaultPrevented","preventDefault","_iterator18","_loop4","retry","force","navigate","saveCurrentDepth","history","_depth","replaceState","hasSchemeRegex","trimPathRegex","mockBase","normalizePath","path","omitSlash","resolvePath","base","basePath","fromPath","toLowerCase","extractSearchParams","params","searchParams","createMatcher","partial","matchFilters","_path$split2","pattern","splat","segments","Boolean","locSegments","lenDiff","match","matchFilter","segment","locSegment","matchSegment","remainder","isEqual","localeCompare","sensitivity","some","createMemoObject","expandOptionals","exec","prefix","prefixes","expansion","intent","RouterContextObj","RouteContextObj","useRouter","message","invariant","useNavigate","navigatorFactory","useParams","createRoutes","routeDef","component","isLeaf","shared","asArray","_iterator19","_step19","originalPath","encodeURIComponent","matcher","createBranch","routes","route","_route$pattern$split2","score","matches","createBranches","stack","branches","routeDefs","def","hasOwnProperty","_step20","_iterator20","isEmptyArray","branch","getRouteMatches","createRouterContext","integration","_integration$signal","signal","setSource","_integration$utils","utils","parsePath","renderPath","beforeLeave","scroll","_createSignal12","isRouting","setIsRouting","_ref29","_callee11","_callee11$","_context11","finish","_x12","_createSignal14","reference","setReference","_createSignal16","origin","path_","pathname","search","hash","query","createLocation","referrers","submissions","baseRoute","outlet","_source","_replace$resolve$scro","nextState","resolvedTo","first","go","navigateFromRoute","preloadRoute","preloadData","prevIntent","_loop5","_matches$match","singleFlight","createRouterComponent","router","routerState","_$createComponent","Root","rootLoad","_$memo","Routes","routeStates","nextMatches","prevMatches","equal","_loop6","prevMatch","nextMatch","_match$route","createRouteContext","createOutlet","Route","childRoutes","createRouter","_ref30","_ref31","intercept","scrollToHash","fallbackTop","selector","querySelector","scrollIntoView","scrollTo","actions","setupNativeEvents","explicitLinks","actionBase","preloadTimeout","handleAnchor","evt","button","metaKey","altKey","ctrlKey","shiftKey","Node","nodeName","toUpperCase","hasAttribute","svg","namespaceURI","baseVal","rel","getAttribute","baseURI","handleAnchorClick","_res","parse","handleAnchorPreload","_res2","handleAnchorIn","_res3","handleAnchorOut","clearTimeout","handleFormSubmit","actionRef","submitter","FormData","append","eventNames","delegateEvents","removeEventListener","hashParser","str","_window$location$hash3","HashRouter","getSource","_ref32","keepDepth","hashIndex","notify","block","prevDepth","notifyIfNotBlocked","tryOnCleanup","createSingletonRoot","factory","disposeRoot","useKeyDownEvent","_createSignal18","setEvent","makeEventListener","currentSeries","keyMapEntries","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter","Backspace","Escape","_createSignal20","focusPath","setFocusPath","useFocusManager","userKeyMap","keypressEvent","_loop7","_Object$entries3$_i","_Object$entries3","_i18","currentFocusedElm","prevFocusedElm","prevFocusPath","fp","onFocus","elm","onBlur","mappedKeyEvent","keyCode","_step21","finalFocusElm","_iterator21","onKeyHandler","onKeyPress","withPadding","padding","right","bottom","pad","_pad","firstChild","marginLeft","maxHeight","marginTop","pause","speak","phrase","utterances","lang","synth","speechSynthesis","utterance","SpeechSynthesisUtterance","onend","speakSeries","series","remainingPhrases","flattenedSeries","flattenStrings","nestedSeriesResults","active","_callee12","totalRetries","retriesLeft","seriesResult","_seriesResult","_callee12$","_context12","SpeechSynthesisErrorEvent","toSpeak","cancel","SpeechEngine","resetFocusPathTimer","currentlySpeaking","debounce","timeoutId","_len17","_key28","voiceOutDisabled","debounceWithFlush","scopedValue","debounced","newValue","flush","getElmName","onFocusChangeCore","Announcer","onFocusChange","enabled","every","focusDiff","toAnnounceText","toAnnounce","announce","title","announceContext","table","clearPrevFocus","_currentlySpeaking","_ref34","_ref34$append","_ref34$notification","notification","textToSpeech","finally","refresh","setupTimers","_ref35","_ref35$focusDebounce","focusDebounce","_ref35$focusChangeTim","focusChangeTimeout","_a","_b","_c","_d","_e","_f","_g","_h","_i","_j","_k","_l","_m","_n","_o","_p","_createSignal22","globalBackground","setGlobalBackground","theme","primary","secondary","tertiary","inactive","full","none","alpha1","alpha2","alpha3","alpha4","alpha5","xfast","fast","slow","xslow","expressive","expressiveEntrance","expressiveExit","standard","standardEntrance","standardExit","utility","utilityEntrance","utilityExit","asset","arrowLeft","arrowRight","backspaceOutline","palette","white","black","grey","red","orange","yellow","green","blue","purple","material","materialBrand","overlay","textNeutral","textNeutralSecondary","textNeutralTertiary","textNeutralDisabled","textInverse","textInverseSecondary","textInverseTertiary","textInverseDisabled","textBrand","textBrandSecondary","textBrandTertiary","textBrandDisabled","textPositive","textNegative","textInfo","textCaution","fillTransparent","fillNeutral","fillNeutralSecondary","fillNeutralTertiary","fillNeutralDisabled","fillInverse","fillInverseSecondary","fillInverseTertiary","fillInverseDisabled","fillBrand","fillBrandSecondary","fillBrandTertiary","fillBrandDisabled","fillPositive","fillNegative","fillInfo","fillCaution","strokeNeutral","strokeNeutralSecondary","strokeNeutralTertiary","strokeNeutralDisabled","strokeInverse","strokeInverseSecondary","strokeInverseTertiary","strokeInverseDisabled","strokeBrand","strokeBrandSecondary","strokeBrandTertiary","strokeBrandDisabled","strokePositive","strokeNegative","strokeInfo","strokeCaution","interactiveNeutral","interactiveNeutralFocus","interactiveNeutralFocusSoft","interactiveInverse","interactiveInverseFocus","interactiveInverseFocusSoft","interactiveBrand","interactiveBrandFocus","interactiveBrandFocusSoft","shadowNeutral","shadowNeutralFocus","shadowNeutralFocusSoft","shadowNeutralText","shadowInverse","shadowInverseFocus","shadowInverseFocusSoft","shadowInverseText","shadowBrand","shadowBrandFocus","shadowBrandFocusSoft","shadowBrandText","layout","columnCount","focusScale","gutterX","gutterY","marginX","marginY","safe","screenW","screenH","xs","sm","md","lg","xl","spacer","xxs","xxl","xxxl","stroke","typography","display1","display2","headline1","headline2","headline3","body1","body2","body3","button1","button2","callout1","caption1","tag1","footnote1","componentConfig","Keyboard","keyProps","icon","Background","bg1","bg2","bgStyles","delayedBackgrounds","r$","defaultModeKeys","defaultToneKeys","makeComponentStyles","_ref36","themeKeys","modes","tones","themeStyles2","themeStyles","_ref36$modeKeys","modeKeys","_ref36$toneKeys","toneKeys","mapThemeKeysToSolid","stylesToMap","_ref40","_ref41","themeKey","_ref42","_ref43","solidKey","base2","modes2","tones2","themeStyles3","themeComponentStyles","_ref44","_ref45","variantName","styles2","convertedStyles","_ref46","_ref47","styleName","_ref48","_ref49","modeName","modeStyles","baseStyles","makeBaseStyles","mode","makeModeStyles","toneStyles","tone","_ref37","_ref38","_a2","_b2","_ref39","makeToneStyles","generateSolidStylesFromLookupObject","withScrolling","adjustment","componentRef","selectedElement","lastSelected","_updateLastIndex","lastItem","windowVal","updateLastIndex","_updateLastIndex2","currentVal","newVal","size2","direct","scrollIndex","abs","chainFunctions","_len18","_key29","onlyFunctions","func","_len19","innerArgs","_key30","_step22","_iterator22","onGridFocus","skipFocus","handleNavigation","onSelectedChanged","plinko","num","_ref50$Artwork","Artwork","_ref50$Artwork2","themeStyles$d","defaultTone","_objectWithoutProperties","_excluded","fillColor","fallbackSrc","gradientColor","_ref51$Icon","Icon","_ref51$Icon2","themeStyles$c","_excluded2","inverse","brand","_ref52$Badge","Badge","_ref52$Badge2","themeStyles$b","_excluded3","container$c","text$6","icon$2","_ref53$Button","Button","_ref53$Button2","themeStyles$a","_excluded4","container$b","contentColor","focus","content","text$5","_ref54$Checkbox","Checkbox","_ref54$Checkbox2","themeStyles$9","_excluded5","strokeWidth","container$a","checked","neutral","icon$1","_ref55$Column","Column","_ref55$Column2","defaultTone$9","themeStyles$8","_excluded6","styles$9","Container","itemTransition","onUp","onDown","_props$tone","flat","_ref56$Label","Label","_ref56$Label2","themeStyles$7","_excluded7","container$8","backgroundColor","text$4","_ref57$Rating","Rating","_ref57$Rating2","themeStyles$6","container$7","itemSpacing","toneModes","text$3","_ref58$Details","Details","_ref58$Details2","themeStyles$5","_excluded8","container$6","contentSpacing","badgeContentSpacing","ratingContentSpacing","text$2","_ref59$Metadata","Metadata","_ref59$Metadata2","themeStyles$4","_excluded9","container$5","titleText","descriptionText","_ref60$ProgressBar","ProgressBar","_ref60$ProgressBar2","themeStyles$3","_excluded10","container$4","_ref61$Row","Row","_ref61$Row2","defaultTone$3","themeStyles$2","_excluded11","styles$3","onLeft","onRight","_props$tone2","_props$tone3","_ref62$Keyboard","_ref62$Keyboard2","themeStyles$1","_excluded12","container$2","keySpacing","baseWidth","sizes","paddingX","text$1","_ref63$Key","Key","_ref63$Key2","_excluded13","container$1","_ref64$Tile","Tile","_ref64$Tile2","tileThemeStyles","_excluded14","_ref65$Surface","Surface","_ref65$Surface2","surfaceThemeStyles","defaultSurfaceTone","_excluded15","container","paddingYProgress","paddingYBetweenContent","insetBottom","standardBottom","logoContainer","styles$1","Gradient","NavButton","import","icons","subTextures","spriteMapTexture","sprite","_$mergeProps","NavDrawer","backdrop","onEnter","fpsStyle","fpsLabel","fpsValue","_createSignal24","setFps","_createSignal26","avgFps","setAvgFps","_createSignal28","minFps","setMinFps","_createSignal30","maxFps","setMaxFps","totalFps","resetCounter","setupFPS","calcFps","FPSCounter","App","Menu","announcer","navDrawer","lastFocused","onAnnouncer","onLast","back","onMenu","Page","headlineText","headlineSubText","itemsContainer","Thumbnail","FocusRing","FPS","FPSLabel","FPSValue","showHeadline","headlineBlur","RowTitle","Rect","peopleBio","buttonStyles","topBar","MaterialButton","MaterialButtonText","TileRow","_splitProps","_len2","_key5","blocked","k","_step7","otherObject","objects","_iterator7","_step8","isDefaultDesc","writable","objectIndex","_iterator8","splitProps","_splitProps2","local","others","tmdbConfig","baseImageUrl","API_BASE","basePosterSize","defaultFetchParams","headers","Authorization","getImageUrl","_get","json","loadConfig","_data$images","images","secure_base_url","api","convertItemsToTiles","poster_path","profile_path","tileSrc","backdrop_path","media_type","shortTitle","maxLength","entityInfo","heroContent","description","overview","cache","leftoverTiles","createInfiniteScroll","_createSignal32","pages","setPages","_createSignal34","page","setPage","_createSignal36","setEnd","contents","blockWidth","HeadlineStyles","Headline","DescriptionStyles","BadgeStyle","Description","MetaTextStyle","metaText","badges","getReviews","reviews","rtCrit","rtFan","ContentBlock","justYear","dateString","getRecommendations","_ref66","_ref67","_ref68","getCredits","_ref69","_ref70","cast","getInfo","_ref71","rt","backgroundImage","minutes","runtime","remainingMinutes","minutesToHMM","release_date","first_air_date","last_air_date","Browse","_createSignal38","columnY","setcolumnY","_createSignal40","entityProvider","_createSignal42","setHeroContent","isFirst","provider","pageIndex","trending","adult","chunks","chunkArray","onRowFocus","_this$children$select","numPages","entity","Portal","demos","DemoTile","_createSignal44","setColor","_createSignal46","rowX","setRowX","moveRow","row","demo","TextPage","OverviewContainer","SublineContainer","Title","Overview","Subline","CreatePage","myBox","childRef","_createSignal48","insertTest","setInsertTest","_createSignal50","emptyTest","setEmptyTest","_childRef$getChildByI","getChildById","styleChild","someOtherStyle","ChildTest","borderStyles","childTestPassedStyles","childTestPassedStyles2","hasFocus","ButtonsPage","toggle","RowStyles","_$use","FlexPage","rowTitle","Block","_createSignal52","setColumnY","_this$children$select2","FlexSizePage","randSize","_createSignal54","_this$children$select3","FlexColumnPage","ColumnStyles","_createSignal56","_this$children$select4","_createSignal58","_this$children$select5","MaterialButtonsPage","manifestUri","_initPlayer","_callee14","video","player","_callee14$","_context14","shaka","Player","onErrorEvent","onError","detail","polyfill","installAll","isBrowserSupported","initPlayer","Entity","credits","recommendations","_createSignal60","backdropAlpha","setBackdropAlpha","columnRef","backdropRef","trailerButton","Backdrop","_this$children$select6","onRowFocusAnimate","_this$children$select7","onEscape","hidden","getElementsByTagName","onEnterTrailer","play","playVideo","_ref72","_ref73","_ref74","biography","People","NotFound","_$setProp","coreExtensionModuleUrl","meta","Config","FlexColumnSizePage","ButtonsMaterialPage"],"mappings":"6ibAqIA,IAgeIA,GAheEC,GAAU,SAACC,EAAGC,UAAMD,IAAMC,CAAC,EAC3BC,GAASC,OAAO,eAChBC,GAASD,OAAO,eAEhBE,GAAgB,CACpBC,OAAQP,IAGNQ,GAAaC,GACXC,GAAQ,EACRC,GAAU,EACVC,GAAU,CACdC,MAAO,KACPC,SAAU,KACVC,QAAS,KACTC,MAAO,MAEHC,GAAU,CAAA,EACZC,GAAQ,KACRC,GAAa,KAGbC,GAAW,KACXC,GAAU,KACVC,GAAU,KACVC,GAAY,EAChB,SAASC,GAAWC,EAAIC,GACtB,IAAMC,EAAWP,GACfJ,EAAQE,GACRU,EAAwB,IAAdH,EAAGI,OACbC,OA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KAAUhxB,GACzCe,GAAK,CAAC3I,KAAI,WAAY+C,UAAWy3B,KAAY5yB,GAC7Ce,GAAK,CAAC3I,KAAI,iBAAkB+C,UAAWi7B,KAAkBp2B,GACzDe,GAAK,CAAC3I,KAAI,aAAc+C,UAAW63B,KAAchzB,GACjDe,GAAK,CAAC3I,KAAI,kBAAmB+C,UAAWk7B,KAAmBr2B,GAC3De,GAAK,CAAC3I,KAAI,oBAAqB+C,UAAW26B,KAAM91B,GAChDe,GAAK,CAAC3I,KAAI,mBAAoB+C,UAAWo5B,KAAMv0B,GAC/Ce,GAAK,CAAC3I,KAAI,OAAQ+C,UAAW46B,KAAQ,GAEzC","x_google_ignoreList":[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,93,94,98,102]} \ No newline at end of file diff --git a/assets/polyfills-legacy-B4v4JMRe.js b/assets/polyfills-legacy-B4v4JMRe.js deleted file mode 100644 index fb7fc0e..0000000 --- a/assets/polyfills-legacy-B4v4JMRe.js +++ /dev/null @@ -1,11 +0,0 @@ -!function(){"use strict";var t="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||"undefined"!=typeof global&&global||{},e="URLSearchParams"in t,r="Symbol"in t&&"iterator"in Symbol,n="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),o="FormData"in t,i="ArrayBuffer"in t;if(i)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(t){return t&&a.indexOf(Object.prototype.toString.call(t))>-1};function s(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw new TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function c(t){return"string"!=typeof t&&(t=String(t)),t}function f(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return r&&(e[Symbol.iterator]=function(){return e}),e}function h(t){this.map={},t instanceof h?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){if(2!=t.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function l(t){if(!t._noBody)return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function p(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function d(t){var e=new FileReader,r=p(e);return e.readAsArrayBuffer(t),r}function v(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function y(){return this.bodyUsed=!1,this._initBody=function(t){var r;this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:n&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:o&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:e&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():i&&n&&((r=t)&&DataView.prototype.isPrototypeOf(r))?(this._bodyArrayBuffer=v(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):i&&(ArrayBuffer.prototype.isPrototypeOf(t)||u(t))?this._bodyArrayBuffer=v(t):this._bodyText=t=Object.prototype.toString.call(t):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):e&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},n&&(this.blob=function(){var t=l(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var t=l(this);return t||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(n)return this.blob().then(d);throw new Error("could not read as ArrayBuffer")},this.text=function(){var t=l(this);if(t)return t;if(this._bodyBlob)return function(t){var e=new FileReader,r=p(e),n=/charset=([A-Za-z0-9_-]+)/.exec(t.type),o=n?n[1]:"utf-8";return e.readAsText(t,o),r}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n-1?e:t}(r.method||this.method||"GET"),this.mode=r.mode||this.mode||null,this.signal=r.signal||this.signal||function(){if("AbortController"in t)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(n),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==r.cache&&"no-cache"!==r.cache)){var o=/([?&])_=[^&]*/;if(o.test(this.url))this.url=this.url.replace(o,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function m(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(o))}})),e}function w(t,e){if(!(this instanceof w))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===e.statusText?"":""+e.statusText,this.headers=new h(e.headers),this.url=e.url||"",this._initBody(t)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},y.call(b.prototype),y.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},w.error=function(){var t=new w(null,{status:200,statusText:""});return t.ok=!1,t.status=0,t.type="error",t};var A=[301,302,303,307,308];w.redirect=function(t,e){if(-1===A.indexOf(e))throw new RangeError("Invalid status code");return new w(null,{status:e,headers:{location:t}})};var S=t.DOMException;try{new S}catch(Qq){(S=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack}).prototype=Object.create(Error.prototype),S.prototype.constructor=S}function x(e,r){return new Promise((function(o,a){var u=new b(e,r);if(u.signal&&u.signal.aborted)return a(new S("Aborted","AbortError"));var f=new XMLHttpRequest;function l(){f.abort()}if(f.onload=function(){var t,e,r={statusText:f.statusText,headers:(t=f.getAllResponseHeaders()||"",e=new h,t.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(t){return 0===t.indexOf("\n")?t.substr(1,t.length):t})).forEach((function(t){var r=t.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();try{e.append(n,o)}catch(i){console.warn("Response "+i.message)}}})),e)};0===u.url.indexOf("file://")&&(f.status<200||f.status>599)?r.status=200:r.status=f.status,r.url="responseURL"in f?f.responseURL:r.headers.get("X-Request-URL");var n="response"in f?f.response:f.responseText;setTimeout((function(){o(new w(n,r))}),0)},f.onerror=function(){setTimeout((function(){a(new TypeError("Network request failed"))}),0)},f.ontimeout=function(){setTimeout((function(){a(new TypeError("Network request timed out"))}),0)},f.onabort=function(){setTimeout((function(){a(new S("Aborted","AbortError"))}),0)},f.open(u.method,function(e){try{return""===e&&t.location.href?t.location.href:e}catch(r){return e}}(u.url),!0),"include"===u.credentials?f.withCredentials=!0:"omit"===u.credentials&&(f.withCredentials=!1),"responseType"in f&&(n?f.responseType="blob":i&&(f.responseType="arraybuffer")),r&&"object"==typeof r.headers&&!(r.headers instanceof h||t.Headers&&r.headers instanceof t.Headers)){var p=[];Object.getOwnPropertyNames(r.headers).forEach((function(t){p.push(s(t)),f.setRequestHeader(t,c(r.headers[t]))})),u.headers.forEach((function(t,e){-1===p.indexOf(e)&&f.setRequestHeader(e,t)}))}else u.headers.forEach((function(t,e){f.setRequestHeader(e,t)}));u.signal&&(u.signal.addEventListener("abort",l),f.onreadystatechange=function(){4===f.readyState&&u.signal.removeEventListener("abort",l)}),f.send(void 0===u._bodyInit?null:u._bodyInit)}))}x.polyfill=!0,t.fetch||(t.fetch=x,t.Headers=h,t.Request=b,t.Response=w) -/** - * es6-proxy-polyfill - * @version 2.1.1 - * @author Ambit-Tsai - * @license Apache-2.0 - * @see {@link https://github.com/ambit-tsai/es6-proxy-polyfill#readme} - */;Object.defineProperty;var E=Object.defineProperties;function O(t){return"function"==typeof t&&/\[native code\]/.test(t.toString())}E&&O(E),O(Object.setPrototypeOf)?Object.setPrototypeOf:Object.__proto__;var T="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},R=function(t){return t&&t.Math===Math&&t},I=R("object"==typeof globalThis&&globalThis)||R("object"==typeof window&&window)||R("object"==typeof self&&self)||R("object"==typeof T&&T)||R("object"==typeof T&&T)||function(){return this}()||Function("return this")(),P={},j=function(t){try{return!!t()}catch(e){return!0}},k=!j((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})),L=!j((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),U=L,C=Function.prototype.call,_=U?C.bind(C):function(){return C.apply(C,arguments)},M={},B={}.propertyIsEnumerable,F=Object.getOwnPropertyDescriptor,N=F&&!B.call({1:2},1);M.f=N?function(t){var e=F(this,t);return!!e&&e.enumerable}:B;var D,z,H=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},q=L,W=Function.prototype,$=W.call,G=q&&W.bind.bind($,$),V=q?G:function(t){return function(){return $.apply(t,arguments)}},Y=V,J=Y({}.toString),K=Y("".slice),X=function(t){return K(J(t),8,-1)},Q=j,Z=X,tt=Object,et=V("".split),rt=Q((function(){return!tt("z").propertyIsEnumerable(0)}))?function(t){return"String"===Z(t)?et(t,""):tt(t)}:tt,nt=function(t){return null==t},ot=nt,it=TypeError,at=function(t){if(ot(t))throw new it("Can't call method on "+t);return t},ut=rt,st=at,ct=function(t){return ut(st(t))},ft="object"==typeof document&&document.all,ht=void 0===ft&&void 0!==ft?function(t){return"function"==typeof t||t===ft}:function(t){return"function"==typeof t},lt=ht,pt=function(t){return"object"==typeof t?null!==t:lt(t)},dt=I,vt=ht,yt=function(t,e){return arguments.length<2?(r=dt[t],vt(r)?r:void 0):dt[t]&&dt[t][e];var r},gt=V({}.isPrototypeOf),bt="undefined"!=typeof navigator&&String(navigator.userAgent)||"",mt=I,wt=bt,At=mt.process,St=mt.Deno,xt=At&&At.versions||St&&St.version,Et=xt&&xt.v8;Et&&(z=(D=Et.split("."))[0]>0&&D[0]<4?1:+(D[0]+D[1])),!z&&wt&&(!(D=wt.match(/Edge\/(\d+)/))||D[1]>=74)&&(D=wt.match(/Chrome\/(\d+)/))&&(z=+D[1]);var Ot=z,Tt=Ot,Rt=j,It=I.String,Pt=!!Object.getOwnPropertySymbols&&!Rt((function(){var t=Symbol("symbol detection");return!It(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&Tt&&Tt<41})),jt=Pt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,kt=yt,Lt=ht,Ut=gt,Ct=Object,_t=jt?function(t){return"symbol"==typeof t}:function(t){var e=kt("Symbol");return Lt(e)&&Ut(e.prototype,Ct(t))},Mt=String,Bt=function(t){try{return Mt(t)}catch(e){return"Object"}},Ft=ht,Nt=Bt,Dt=TypeError,zt=function(t){if(Ft(t))return t;throw new Dt(Nt(t)+" is not a function")},Ht=zt,qt=nt,Wt=function(t,e){var r=t[e];return qt(r)?void 0:Ht(r)},$t=_,Gt=ht,Vt=pt,Yt=TypeError,Jt=function(t,e){var r,n;if("string"===e&&Gt(r=t.toString)&&!Vt(n=$t(r,t)))return n;if(Gt(r=t.valueOf)&&!Vt(n=$t(r,t)))return n;if("string"!==e&&Gt(r=t.toString)&&!Vt(n=$t(r,t)))return n;throw new Yt("Can't convert object to primitive value")},Kt={exports:{}},Xt=I,Qt=Object.defineProperty,Zt=function(t,e){try{Qt(Xt,t,{value:e,configurable:!0,writable:!0})}catch(r){Xt[t]=e}return e},te=I,ee=Zt,re="__core-js_shared__",ne=Kt.exports=te[re]||ee(re,{});(ne.versions||(ne.versions=[])).push({version:"3.36.1",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.36.1/LICENSE",source:"https://github.com/zloirock/core-js"});var oe=Kt.exports,ie=oe,ae=function(t,e){return ie[t]||(ie[t]=e||{})},ue=at,se=Object,ce=function(t){return se(ue(t))},fe=ce,he=V({}.hasOwnProperty),le=Object.hasOwn||function(t,e){return he(fe(t),e)},pe=V,de=0,ve=Math.random(),ye=pe(1..toString),ge=function(t){return"Symbol("+(void 0===t?"":t)+")_"+ye(++de+ve,36)},be=ae,me=le,we=ge,Ae=Pt,Se=jt,xe=I.Symbol,Ee=be("wks"),Oe=Se?xe.for||xe:xe&&xe.withoutSetter||we,Te=function(t){return me(Ee,t)||(Ee[t]=Ae&&me(xe,t)?xe[t]:Oe("Symbol."+t)),Ee[t]},Re=_,Ie=pt,Pe=_t,je=Wt,ke=Jt,Le=TypeError,Ue=Te("toPrimitive"),Ce=function(t,e){if(!Ie(t)||Pe(t))return t;var r,n=je(t,Ue);if(n){if(void 0===e&&(e="default"),r=Re(n,t,e),!Ie(r)||Pe(r))return r;throw new Le("Can't convert object to primitive value")}return void 0===e&&(e="number"),ke(t,e)},_e=Ce,Me=_t,Be=function(t){var e=_e(t,"string");return Me(e)?e:e+""},Fe=pt,Ne=I.document,De=Fe(Ne)&&Fe(Ne.createElement),ze=function(t){return De?Ne.createElement(t):{}},He=ze,qe=!k&&!j((function(){return 7!==Object.defineProperty(He("div"),"a",{get:function(){return 7}}).a})),We=k,$e=_,Ge=M,Ve=H,Ye=ct,Je=Be,Ke=le,Xe=qe,Qe=Object.getOwnPropertyDescriptor;P.f=We?Qe:function(t,e){if(t=Ye(t),e=Je(e),Xe)try{return Qe(t,e)}catch(r){}if(Ke(t,e))return Ve(!$e(Ge.f,t,e),t[e])};var Ze={},tr=k&&j((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),er=pt,rr=String,nr=TypeError,or=function(t){if(er(t))return t;throw new nr(rr(t)+" is not an object")},ir=k,ar=qe,ur=tr,sr=or,cr=Be,fr=TypeError,hr=Object.defineProperty,lr=Object.getOwnPropertyDescriptor,pr="enumerable",dr="configurable",vr="writable";Ze.f=ir?ur?function(t,e,r){if(sr(t),e=cr(e),sr(r),"function"==typeof t&&"prototype"===e&&"value"in r&&vr in r&&!r[vr]){var n=lr(t,e);n&&n[vr]&&(t[e]=r.value,r={configurable:dr in r?r[dr]:n[dr],enumerable:pr in r?r[pr]:n[pr],writable:!1})}return hr(t,e,r)}:hr:function(t,e,r){if(sr(t),e=cr(e),sr(r),ar)try{return hr(t,e,r)}catch(n){}if("get"in r||"set"in r)throw new fr("Accessors not supported");return"value"in r&&(t[e]=r.value),t};var yr=Ze,gr=H,br=k?function(t,e,r){return yr.f(t,e,gr(1,r))}:function(t,e,r){return t[e]=r,t},mr={exports:{}},wr=k,Ar=le,Sr=Function.prototype,xr=wr&&Object.getOwnPropertyDescriptor,Er=Ar(Sr,"name"),Or={EXISTS:Er,PROPER:Er&&"something"===function(){}.name,CONFIGURABLE:Er&&(!wr||wr&&xr(Sr,"name").configurable)},Tr=ht,Rr=oe,Ir=V(Function.toString);Tr(Rr.inspectSource)||(Rr.inspectSource=function(t){return Ir(t)});var Pr,jr,kr,Lr=Rr.inspectSource,Ur=ht,Cr=I.WeakMap,_r=Ur(Cr)&&/native code/.test(String(Cr)),Mr=ge,Br=ae("keys"),Fr=function(t){return Br[t]||(Br[t]=Mr(t))},Nr={},Dr=_r,zr=I,Hr=pt,qr=br,Wr=le,$r=oe,Gr=Fr,Vr=Nr,Yr="Object already initialized",Jr=zr.TypeError,Kr=zr.WeakMap;if(Dr||$r.state){var Xr=$r.state||($r.state=new Kr);Xr.get=Xr.get,Xr.has=Xr.has,Xr.set=Xr.set,Pr=function(t,e){if(Xr.has(t))throw new Jr(Yr);return e.facade=t,Xr.set(t,e),e},jr=function(t){return Xr.get(t)||{}},kr=function(t){return Xr.has(t)}}else{var Qr=Gr("state");Vr[Qr]=!0,Pr=function(t,e){if(Wr(t,Qr))throw new Jr(Yr);return e.facade=t,qr(t,Qr,e),e},jr=function(t){return Wr(t,Qr)?t[Qr]:{}},kr=function(t){return Wr(t,Qr)}}var Zr={set:Pr,get:jr,has:kr,enforce:function(t){return kr(t)?jr(t):Pr(t,{})},getterFor:function(t){return function(e){var r;if(!Hr(e)||(r=jr(e)).type!==t)throw new Jr("Incompatible receiver, "+t+" required");return r}}},tn=V,en=j,rn=ht,nn=le,on=k,an=Or.CONFIGURABLE,un=Lr,sn=Zr.enforce,cn=Zr.get,fn=String,hn=Object.defineProperty,ln=tn("".slice),pn=tn("".replace),dn=tn([].join),vn=on&&!en((function(){return 8!==hn((function(){}),"length",{value:8}).length})),yn=String(String).split("String"),gn=mr.exports=function(t,e,r){"Symbol("===ln(fn(e),0,7)&&(e="["+pn(fn(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!nn(t,"name")||an&&t.name!==e)&&(on?hn(t,"name",{value:e,configurable:!0}):t.name=e),vn&&r&&nn(r,"arity")&&t.length!==r.arity&&hn(t,"length",{value:r.arity});try{r&&nn(r,"constructor")&&r.constructor?on&&hn(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(o){}var n=sn(t);return nn(n,"source")||(n.source=dn(yn,"string"==typeof e?e:"")),t};Function.prototype.toString=gn((function(){return rn(this)&&cn(this).source||un(this)}),"toString");var bn=mr.exports,mn=ht,wn=Ze,An=bn,Sn=Zt,xn=function(t,e,r,n){n||(n={});var o=n.enumerable,i=void 0!==n.name?n.name:e;if(mn(r)&&An(r,i,n),n.global)o?t[e]=r:Sn(e,r);else{try{n.unsafe?t[e]&&(o=!0):delete t[e]}catch(a){}o?t[e]=r:wn.f(t,e,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t},En={},On=Math.ceil,Tn=Math.floor,Rn=Math.trunc||function(t){var e=+t;return(e>0?Tn:On)(e)},In=function(t){var e=+t;return e!=e||0===e?0:Rn(e)},Pn=In,jn=Math.max,kn=Math.min,Ln=function(t,e){var r=Pn(t);return r<0?jn(r+e,0):kn(r,e)},Un=In,Cn=Math.min,_n=function(t){var e=Un(t);return e>0?Cn(e,9007199254740991):0},Mn=_n,Bn=function(t){return Mn(t.length)},Fn=ct,Nn=Ln,Dn=Bn,zn=function(t){return function(e,r,n){var o=Fn(e),i=Dn(o);if(0===i)return!t&&-1;var a,u=Nn(n,i);if(t&&r!=r){for(;i>u;)if((a=o[u++])!=a)return!0}else for(;i>u;u++)if((t||u in o)&&o[u]===r)return t||u||0;return!t&&-1}},Hn={includes:zn(!0),indexOf:zn(!1)},qn=le,Wn=ct,$n=Hn.indexOf,Gn=Nr,Vn=V([].push),Yn=function(t,e){var r,n=Wn(t),o=0,i=[];for(r in n)!qn(Gn,r)&&qn(n,r)&&Vn(i,r);for(;e.length>o;)qn(n,r=e[o++])&&(~$n(i,r)||Vn(i,r));return i},Jn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Kn=Yn,Xn=Jn.concat("length","prototype");En.f=Object.getOwnPropertyNames||function(t){return Kn(t,Xn)};var Qn={};Qn.f=Object.getOwnPropertySymbols;var Zn=yt,to=En,eo=Qn,ro=or,no=V([].concat),oo=Zn("Reflect","ownKeys")||function(t){var e=to.f(ro(t)),r=eo.f;return r?no(e,r(t)):e},io=le,ao=oo,uo=P,so=Ze,co=function(t,e,r){for(var n=ao(e),o=so.f,i=uo.f,a=0;aa;)Go.f(t,r=o[a++],n[r]);return t};var Ko,Xo=yt("document","documentElement"),Qo=or,Zo=Do,ti=Jn,ei=Nr,ri=Xo,ni=ze,oi="prototype",ii="script",ai=Fr("IE_PROTO"),ui=function(){},si=function(t){return"<"+ii+">"+t+""},ci=function(t){t.write(si("")),t.close();var e=t.parentWindow.Object;return t=null,e},fi=function(){try{Ko=new ActiveXObject("htmlfile")}catch(o){}var t,e,r;fi="undefined"!=typeof document?document.domain&&Ko?ci(Ko):(e=ni("iframe"),r="java"+ii+":",e.style.display="none",ri.appendChild(e),e.src=String(r),(t=e.contentWindow.document).open(),t.write(si("document.F=Object")),t.close(),t.F):ci(Ko);for(var n=ti.length;n--;)delete fi[oi][ti[n]];return fi()};ei[ai]=!0;var hi=Object.create||function(t,e){var r;return null!==t?(ui[oi]=Qo(t),r=new ui,ui[oi]=null,r[ai]=t):r=fi(),void 0===e?r:Zo.f(r,e)},li={},pi=V([].slice),di=X,vi=ct,yi=En.f,gi=pi,bi="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];li.f=function(t){return bi&&"Window"===di(t)?function(t){try{return yi(t)}catch(e){return gi(bi)}}(t):yi(vi(t))};var mi=bn,wi=Ze,Ai=function(t,e,r){return r.get&&mi(r.get,e,{getter:!0}),r.set&&mi(r.set,e,{setter:!0}),wi.f(t,e,r)},Si={},xi=Te;Si.f=xi;var Ei=I,Oi=Ei,Ti=le,Ri=Si,Ii=Ze.f,Pi=function(t){var e=Oi.Symbol||(Oi.Symbol={});Ti(e,t)||Ii(e,t,{value:Ri.f(t)})},ji=_,ki=yt,Li=Te,Ui=xn,Ci=function(){var t=ki("Symbol"),e=t&&t.prototype,r=e&&e.valueOf,n=Li("toPrimitive");e&&!e[n]&&Ui(e,n,(function(t){return ji(r,this)}),{arity:1})},_i=Ze.f,Mi=le,Bi=Te("toStringTag"),Fi=function(t,e,r){t&&!r&&(t=t.prototype),t&&!Mi(t,Bi)&&_i(t,Bi,{configurable:!0,value:e})},Ni=X,Di=V,zi=function(t){if("Function"===Ni(t))return Di(t)},Hi=zt,qi=L,Wi=zi(zi.bind),$i=function(t,e){return Hi(t),void 0===e?t:qi?Wi(t,e):function(){return t.apply(e,arguments)}},Gi=X,Vi=Array.isArray||function(t){return"Array"===Gi(t)},Yi=V,Ji=j,Ki=ht,Xi=Mo,Qi=Lr,Zi=function(){},ta=yt("Reflect","construct"),ea=/^\s*(?:class|function)\b/,ra=Yi(ea.exec),na=!ea.test(Zi),oa=function(t){if(!Ki(t))return!1;try{return ta(Zi,[],t),!0}catch(e){return!1}},ia=function(t){if(!Ki(t))return!1;switch(Xi(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return na||!!ra(ea,Qi(t))}catch(e){return!0}};ia.sham=!0;var aa=!ta||Ji((function(){var t;return oa(oa.call)||!oa(Object)||!oa((function(){t=!0}))||t}))?ia:oa,ua=Vi,sa=aa,ca=pt,fa=Te("species"),ha=Array,la=function(t){var e;return ua(t)&&(e=t.constructor,(sa(e)&&(e===ha||ua(e.prototype))||ca(e)&&null===(e=e[fa]))&&(e=void 0)),void 0===e?ha:e},pa=function(t,e){return new(la(t))(0===e?0:e)},da=$i,va=rt,ya=ce,ga=Bn,ba=pa,ma=V([].push),wa=function(t){var e=1===t,r=2===t,n=3===t,o=4===t,i=6===t,a=7===t,u=5===t||i;return function(s,c,f,h){for(var l,p,d=ya(s),v=va(d),y=ga(v),g=da(c,f),b=0,m=h||ba,w=e?m(s,y):r||a?m(s,0):void 0;y>b;b++)if((u||b in v)&&(p=g(l=v[b],b,d),t))if(e)w[b]=p;else if(p)switch(t){case 3:return!0;case 5:return l;case 6:return b;case 2:ma(w,l)}else switch(t){case 4:return!1;case 7:ma(w,l)}return i?-1:n||o?o:w}},Aa={forEach:wa(0),map:wa(1),filter:wa(2),some:wa(3),every:wa(4),find:wa(5),findIndex:wa(6),filterReject:wa(7)},Sa=Ro,xa=I,Ea=_,Oa=V,Ta=k,Ra=Pt,Ia=j,Pa=le,ja=gt,ka=or,La=ct,Ua=Be,Ca=No,_a=H,Ma=hi,Ba=qo,Fa=En,Na=li,Da=Qn,za=P,Ha=Ze,qa=Do,Wa=M,$a=xn,Ga=Ai,Va=ae,Ya=Nr,Ja=ge,Ka=Te,Xa=Si,Qa=Pi,Za=Ci,tu=Fi,eu=Zr,ru=Aa.forEach,nu=Fr("hidden"),ou="Symbol",iu="prototype",au=eu.set,uu=eu.getterFor(ou),su=Object[iu],cu=xa.Symbol,fu=cu&&cu[iu],hu=xa.RangeError,lu=xa.TypeError,pu=xa.QObject,du=za.f,vu=Ha.f,yu=Na.f,gu=Wa.f,bu=Oa([].push),mu=Va("symbols"),wu=Va("op-symbols"),Au=Va("wks"),Su=!pu||!pu[iu]||!pu[iu].findChild,xu=function(t,e,r){var n=du(su,e);n&&delete su[e],vu(t,e,r),n&&t!==su&&vu(su,e,n)},Eu=Ta&&Ia((function(){return 7!==Ma(vu({},"a",{get:function(){return vu(this,"a",{value:7}).a}})).a}))?xu:vu,Ou=function(t,e){var r=mu[t]=Ma(fu);return au(r,{type:ou,tag:t,description:e}),Ta||(r.description=e),r},Tu=function(t,e,r){t===su&&Tu(wu,e,r),ka(t);var n=Ua(e);return ka(r),Pa(mu,n)?(r.enumerable?(Pa(t,nu)&&t[nu][n]&&(t[nu][n]=!1),r=Ma(r,{enumerable:_a(0,!1)})):(Pa(t,nu)||vu(t,nu,_a(1,Ma(null))),t[nu][n]=!0),Eu(t,n,r)):vu(t,n,r)},Ru=function(t,e){ka(t);var r=La(e),n=Ba(r).concat(ku(r));return ru(n,(function(e){Ta&&!Ea(Iu,r,e)||Tu(t,e,r[e])})),t},Iu=function(t){var e=Ua(t),r=Ea(gu,this,e);return!(this===su&&Pa(mu,e)&&!Pa(wu,e))&&(!(r||!Pa(this,e)||!Pa(mu,e)||Pa(this,nu)&&this[nu][e])||r)},Pu=function(t,e){var r=La(t),n=Ua(e);if(r!==su||!Pa(mu,n)||Pa(wu,n)){var o=du(r,n);return!o||!Pa(mu,n)||Pa(r,nu)&&r[nu][n]||(o.enumerable=!0),o}},ju=function(t){var e=yu(La(t)),r=[];return ru(e,(function(t){Pa(mu,t)||Pa(Ya,t)||bu(r,t)})),r},ku=function(t){var e=t===su,r=yu(e?wu:La(t)),n=[];return ru(r,(function(t){!Pa(mu,t)||e&&!Pa(su,t)||bu(n,mu[t])})),n};Ra||(cu=function(){if(ja(fu,this))throw new lu("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?Ca(arguments[0]):void 0,e=Ja(t),r=function(t){var n=void 0===this?xa:this;n===su&&Ea(r,wu,t),Pa(n,nu)&&Pa(n[nu],e)&&(n[nu][e]=!1);var o=_a(1,t);try{Eu(n,e,o)}catch(i){if(!(i instanceof hu))throw i;xu(n,e,o)}};return Ta&&Su&&Eu(su,e,{configurable:!0,set:r}),Ou(e,t)},$a(fu=cu[iu],"toString",(function(){return uu(this).tag})),$a(cu,"withoutSetter",(function(t){return Ou(Ja(t),t)})),Wa.f=Iu,Ha.f=Tu,qa.f=Ru,za.f=Pu,Fa.f=Na.f=ju,Da.f=ku,Xa.f=function(t){return Ou(Ka(t),t)},Ta&&(Ga(fu,"description",{configurable:!0,get:function(){return uu(this).description}}),$a(su,"propertyIsEnumerable",Iu,{unsafe:!0}))),Sa({global:!0,constructor:!0,wrap:!0,forced:!Ra,sham:!Ra},{Symbol:cu}),ru(Ba(Au),(function(t){Qa(t)})),Sa({target:ou,stat:!0,forced:!Ra},{useSetter:function(){Su=!0},useSimple:function(){Su=!1}}),Sa({target:"Object",stat:!0,forced:!Ra,sham:!Ta},{create:function(t,e){return void 0===e?Ma(t):Ru(Ma(t),e)},defineProperty:Tu,defineProperties:Ru,getOwnPropertyDescriptor:Pu}),Sa({target:"Object",stat:!0,forced:!Ra},{getOwnPropertyNames:ju}),Za(),tu(cu,ou),Ya[nu]=!0;var Lu=Pt&&!!Symbol.for&&!!Symbol.keyFor,Uu=Ro,Cu=yt,_u=le,Mu=No,Bu=ae,Fu=Lu,Nu=Bu("string-to-symbol-registry"),Du=Bu("symbol-to-string-registry");Uu({target:"Symbol",stat:!0,forced:!Fu},{for:function(t){var e=Mu(t);if(_u(Nu,e))return Nu[e];var r=Cu("Symbol")(e);return Nu[e]=r,Du[r]=e,r}});var zu=Ro,Hu=le,qu=_t,Wu=Bt,$u=Lu,Gu=ae("symbol-to-string-registry");zu({target:"Symbol",stat:!0,forced:!$u},{keyFor:function(t){if(!qu(t))throw new TypeError(Wu(t)+" is not a symbol");if(Hu(Gu,t))return Gu[t]}});var Vu=L,Yu=Function.prototype,Ju=Yu.apply,Ku=Yu.call,Xu="object"==typeof Reflect&&Reflect.apply||(Vu?Ku.bind(Ju):function(){return Ku.apply(Ju,arguments)}),Qu=Vi,Zu=ht,ts=X,es=No,rs=V([].push),ns=Ro,os=yt,is=Xu,as=_,us=V,ss=j,cs=ht,fs=_t,hs=pi,ls=function(t){if(Zu(t))return t;if(Qu(t)){for(var e=t.length,r=[],n=0;ni&&Nc(o,arguments[i]),o}));h.prototype=c,"Error"!==u?Cc?Cc(h,f):_c(h,f,{name:!0}):zc&&o in s&&(Mc(h,s,o),Mc(h,s,"prepareStackTrace")),_c(h,s);try{c.name!==u&&Lc(c,"name",u),c.constructor=h}catch(l){}return h}},$c="WebAssembly",Gc=I[$c],Vc=7!==new Error("e",{cause:7}).cause,Yc=function(t,e){var r={};r[t]=Wc(t,e,Vc),Hc({global:!0,constructor:!0,arity:1,forced:Vc},r)},Jc=function(t,e){if(Gc&&Gc[t]){var r={};r[t]=Wc($c+"."+t,e,Vc),Hc({target:$c,stat:!0,constructor:!0,arity:1,forced:Vc},r)}};Yc("Error",(function(t){return function(e){return qc(t,this,arguments)}})),Yc("EvalError",(function(t){return function(e){return qc(t,this,arguments)}})),Yc("RangeError",(function(t){return function(e){return qc(t,this,arguments)}})),Yc("ReferenceError",(function(t){return function(e){return qc(t,this,arguments)}})),Yc("SyntaxError",(function(t){return function(e){return qc(t,this,arguments)}})),Yc("TypeError",(function(t){return function(e){return qc(t,this,arguments)}})),Yc("URIError",(function(t){return function(e){return qc(t,this,arguments)}})),Jc("CompileError",(function(t){return function(e){return qc(t,this,arguments)}})),Jc("LinkError",(function(t){return function(e){return qc(t,this,arguments)}})),Jc("RuntimeError",(function(t){return function(e){return qc(t,this,arguments)}}));var Kc=Te,Xc=hi,Qc=Ze.f,Zc=Kc("unscopables"),tf=Array.prototype;void 0===tf[Zc]&&Qc(tf,Zc,{configurable:!0,value:Xc(null)});var ef,rf,nf,of=function(t){tf[Zc][t]=!0},af={},uf=!j((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),sf=le,cf=ht,ff=ce,hf=uf,lf=Fr("IE_PROTO"),pf=Object,df=pf.prototype,vf=hf?pf.getPrototypeOf:function(t){var e=ff(t);if(sf(e,lf))return e[lf];var r=e.constructor;return cf(r)&&e instanceof r?r.prototype:e instanceof pf?df:null},yf=j,gf=ht,bf=pt,mf=vf,wf=xn,Af=Te("iterator"),Sf=!1;[].keys&&("next"in(nf=[].keys())?(rf=mf(mf(nf)))!==Object.prototype&&(ef=rf):Sf=!0);var xf=!bf(ef)||yf((function(){var t={};return ef[Af].call(t)!==t}));xf&&(ef={}),gf(ef[Af])||wf(ef,Af,(function(){return this}));var Ef={IteratorPrototype:ef,BUGGY_SAFARI_ITERATORS:Sf},Of=Ef.IteratorPrototype,Tf=hi,Rf=H,If=Fi,Pf=af,jf=function(){return this},kf=function(t,e,r,n){var o=e+" Iterator";return t.prototype=Tf(Of,{next:Rf(+!n,r)}),If(t,o,!1),Pf[o]=jf,t},Lf=Ro,Uf=_,Cf=ht,_f=kf,Mf=vf,Bf=cc,Ff=Fi,Nf=br,Df=xn,zf=af,Hf=Or.PROPER,qf=Or.CONFIGURABLE,Wf=Ef.IteratorPrototype,$f=Ef.BUGGY_SAFARI_ITERATORS,Gf=Te("iterator"),Vf="keys",Yf="values",Jf="entries",Kf=function(){return this},Xf=function(t,e,r,n,o,i,a){_f(r,e,n);var u,s,c,f=function(t){if(t===o&&v)return v;if(!$f&&t&&t in p)return p[t];switch(t){case Vf:case Yf:case Jf:return function(){return new r(this,t)}}return function(){return new r(this)}},h=e+" Iterator",l=!1,p=t.prototype,d=p[Gf]||p["@@iterator"]||o&&p[o],v=!$f&&d||f(o),y="Array"===e&&p.entries||d;if(y&&(u=Mf(y.call(new t)))!==Object.prototype&&u.next&&(Mf(u)!==Wf&&(Bf?Bf(u,Wf):Cf(u[Gf])||Df(u,Gf,Kf)),Ff(u,h,!0)),Hf&&o===Yf&&d&&d.name!==Yf&&(qf?Nf(p,"name",Yf):(l=!0,v=function(){return Uf(d,this)})),o)if(s={values:f(Yf),keys:i?v:f(Vf),entries:f(Jf)},a)for(c in s)($f||l||!(c in p))&&Df(p,c,s[c]);else Lf({target:e,proto:!0,forced:$f||l},s);return p[Gf]!==v&&Df(p,Gf,v,{name:o}),zf[e]=v,s},Qf=function(t,e){return{value:t,done:e}},Zf=ct,th=of,eh=af,rh=Zr,nh=Ze.f,oh=Xf,ih=Qf,ah=k,uh="Array Iterator",sh=rh.set,ch=rh.getterFor(uh),fh=oh(Array,"Array",(function(t,e){sh(this,{type:uh,target:Zf(t),index:0,kind:e})}),(function(){var t=ch(this),e=t.target,r=t.index++;if(!e||r>=e.length)return t.target=void 0,ih(void 0,!0);switch(t.kind){case"keys":return ih(r,!1);case"values":return ih(e[r],!1)}return ih([r,e[r]],!1)}),"values"),hh=eh.Arguments=eh.Array;if(th("keys"),th("values"),th("entries"),ah&&"values"!==hh.name)try{nh(hh,"name",{value:"values"})}catch(Zq){}var lh=k,ph=Vi,dh=TypeError,vh=Object.getOwnPropertyDescriptor,yh=lh&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(Zq){return Zq instanceof TypeError}}()?function(t,e){if(ph(t)&&!vh(t,"length").writable)throw new dh("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e},gh=TypeError,bh=function(t){if(t>9007199254740991)throw gh("Maximum allowed index exceeded");return t},mh=ce,wh=Bn,Ah=yh,Sh=bh;Ro({target:"Array",proto:!0,arity:1,forced:j((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(Zq){return Zq instanceof TypeError}}()},{push:function(t){var e=mh(this),r=wh(e),n=arguments.length;Sh(r+n);for(var o=0;o=51||!Rh((function(){var e=[];return(e.constructor={})[Ph]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},kh=Ro,Lh=Vi,Uh=aa,Ch=pt,_h=Ln,Mh=Bn,Bh=ct,Fh=Th,Nh=Te,Dh=pi,zh=jh("slice"),Hh=Nh("species"),qh=Array,Wh=Math.max;kh({target:"Array",proto:!0,forced:!zh},{slice:function(t,e){var r,n,o,i=Bh(this),a=Mh(i),u=_h(t,a),s=_h(void 0===e?a:e,a);if(Lh(i)&&(r=i.constructor,(Uh(r)&&(r===qh||Lh(r.prototype))||Ch(r)&&null===(r=r[Hh]))&&(r=void 0),r===qh||void 0===r))return Dh(i,u,s);for(n=new(void 0===r?qh:r)(Wh(s-u,0)),o=0;u2)if(c=El(c),43===(e=jl(c,0))||45===e){if(88===(r=jl(c,2))||120===r)return NaN}else if(48===e){switch(jl(c,1)){case 66:case 98:n=2,o=49;break;case 79:case 111:n=8,o=55;break;default:return+c}for(a=(i=Pl(c,2)).length,u=0;uo)return NaN;return parseInt(i,n)}return+c},Ll=pl(Ol,!Tl(" 0o1")||!Tl("0b1")||Tl("+0x1")),Ul=function(t){var e,r=arguments.length<1?0:Tl(function(t){var e=bl(t,"number");return"bigint"==typeof e?e:kl(e)}(t));return yl(Rl,e=this)&&ml((function(){xl(e)}))?vl(Object(r),this,Ul):r};Ul.prototype=Rl,Ll&&(Rl.constructor=Ul),sl({global:!0,constructor:!0,wrap:!0,forced:Ll},{Number:Ul});Ll&&function(t,e){for(var r,n=cl?wl(e):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),o=0;n.length>o;o++)dl(e,r=n[o])&&!dl(t,r)&&Sl(t,r,Al(e,r))}(hl[Ol],Tl);var Cl=ce,_l=vf,Ml=uf;Ro({target:"Object",stat:!0,forced:j((function(){_l(1)})),sham:!Ml},{getPrototypeOf:function(t){return _l(Cl(t))}});var Bl=Mo,Fl=Po?{}.toString:function(){return"[object "+Bl(this)+"]"};Po||xn(Object.prototype,"toString",Fl,{unsafe:!0});var Nl,Dl,zl,Hl,ql="process"===X(I.process),Wl=yt,$l=Ai,Gl=k,Vl=Te("species"),Yl=function(t){var e=Wl(t);Gl&&e&&!e[Vl]&&$l(e,Vl,{configurable:!0,get:function(){return this}})},Jl=gt,Kl=TypeError,Xl=function(t,e){if(Jl(e,t))return t;throw new Kl("Incorrect invocation")},Ql=aa,Zl=Bt,tp=TypeError,ep=function(t){if(Ql(t))return t;throw new tp(Zl(t)+" is not a constructor")},rp=or,np=ep,op=nt,ip=Te("species"),ap=function(t,e){var r,n=rp(t).constructor;return void 0===n||op(r=rp(n)[ip])?e:np(r)},up=TypeError,sp=function(t,e){if(ti;i++)if((u=g(t[i]))&&oy(fy,u))return u;return new cy(!1)}n=iy(t,o)}for(s=l?t.next:n.next;!(c=Zv(s,n)).done;){try{u=g(c.value)}catch(Zq){uy(n,"throw",Zq)}if("object"==typeof u&&u&&oy(fy,u))return u}return new cy(!1)},ly=Te("iterator"),py=!1;try{var dy=0,vy={next:function(){return{done:!!dy++}},return:function(){py=!0}};vy[ly]=function(){return this},Array.from(vy,(function(){throw 2}))}catch(Zq){}var yy=function(t,e){try{if(!e&&!py)return!1}catch(Zq){return!1}var r=!1;try{var n={};n[ly]=function(){return{next:function(){return{done:r=!0}}}},t(n)}catch(Zq){}return r},gy=dd,by=jd.CONSTRUCTOR||!yy((function(t){gy.all(t).then(void 0,(function(){}))})),my=_,wy=zt,Ay=kd,Sy=pd,xy=hy;Ro({target:"Promise",stat:!0,forced:by},{all:function(t){var e=this,r=Ay.f(e),n=r.resolve,o=r.reject,i=Sy((function(){var r=wy(e.resolve),i=[],a=0,u=1;xy(t,(function(t){var s=a++,c=!1;u++,my(r,e,t).then((function(t){c||(c=!0,i[s]=t,--u||n(i))}),o)})),--u||n(i)}));return i.error&&o(i.value),r.promise}});var Ey=Ro,Oy=jd.CONSTRUCTOR,Ty=dd,Ry=yt,Iy=ht,Py=xn,jy=Ty&&Ty.prototype;if(Ey({target:"Promise",proto:!0,forced:Oy,real:!0},{catch:function(t){return this.then(void 0,t)}}),Iy(Ty)){var ky=Ry("Promise").prototype.catch;jy.catch!==ky&&Py(jy,"catch",ky,{unsafe:!0})}var Ly=_,Uy=zt,Cy=kd,_y=pd,My=hy;Ro({target:"Promise",stat:!0,forced:by},{race:function(t){var e=this,r=Cy.f(e),n=r.reject,o=_y((function(){var o=Uy(e.resolve);My(t,(function(t){Ly(o,e,t).then(r.resolve,n)}))}));return o.error&&n(o.value),r.promise}});var By=kd;Ro({target:"Promise",stat:!0,forced:jd.CONSTRUCTOR},{reject:function(t){var e=By.f(this);return(0,e.reject)(t),e.promise}});var Fy=or,Ny=pt,Dy=kd,zy=function(t,e){if(Fy(t),Ny(e)&&e.constructor===t)return e;var r=Dy.f(t);return(0,r.resolve)(e),r.promise},Hy=Ro,qy=jd.CONSTRUCTOR,Wy=zy;yt("Promise"),Hy({target:"Promise",stat:!0,forced:qy},{resolve:function(t){return Wy(this,t)}});var $y=V,Gy=zt,Vy=pt,Yy=le,Jy=pi,Ky=L,Xy=Function,Qy=$y([].concat),Zy=$y([].join),tg={},eg=Ky?Xy.bind:function(t){var e=Gy(this),r=e.prototype,n=Jy(arguments,1),o=function(){var r=Qy(n,Jy(arguments));return this instanceof o?function(t,e,r){if(!Yy(tg,e)){for(var n=[],o=0;o=u?t?"":void 0:(n=Ag(i,a))<55296||n>56319||a+1===u||(o=Ag(i,a+1))<56320||o>57343?t?wg(i,a):n:t?Sg(i,a,a+2):o-56320+(n-55296<<10)+65536}},Eg={codeAt:xg(!1),charAt:xg(!0)},Og=Eg.charAt,Tg=No,Rg=Zr,Ig=Xf,Pg=Qf,jg="String Iterator",kg=Rg.set,Lg=Rg.getterFor(jg);Ig(String,"String",(function(t){kg(this,{type:jg,string:Tg(t),index:0})}),(function(){var t,e=Lg(this),r=e.string,n=e.index;return n>=r.length?Pg(void 0,!0):(t=Og(r,n),e.index+=t.length,Pg(t,!1))}));var Ug=Ro,Cg=I,_g=Xl,Mg=or,Bg=ht,Fg=vf,Ng=Ai,Dg=Th,zg=j,Hg=le,qg=Ef.IteratorPrototype,Wg=k,$g="constructor",Gg="Iterator",Vg=Te("toStringTag"),Yg=TypeError,Jg=Cg[Gg],Kg=!Bg(Jg)||Jg.prototype!==qg||!zg((function(){Jg({})})),Xg=function(){if(_g(this,qg),Fg(this)===qg)throw new Yg("Abstract class Iterator not directly constructable")},Qg=function(t,e){Wg?Ng(qg,t,{configurable:!0,get:function(){return e},set:function(e){if(Mg(this),this===qg)throw new Yg("You can't redefine this property");Hg(this,t)?this[t]=e:Dg(this,t,e)}}):qg[t]=e};Hg(qg,Vg)||Qg(Vg,Gg),!Kg&&Hg(qg,$g)&&qg[$g]!==Object||Qg($g,Xg),Xg.prototype=qg,Ug({global:!0,constructor:!0,forced:Kg},{Iterator:Xg});var Zg=function(t){return{iterator:t,next:t.next,done:!1}},tb=hy,eb=zt,rb=or,nb=Zg;Ro({target:"Iterator",proto:!0,real:!0},{forEach:function(t){rb(this),eb(t);var e=nb(this),r=0;tb(e,(function(e){t(e,r++)}),{IS_RECORD:!0})}});var ob={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},ib=ze("span").classList,ab=ib&&ib.constructor&&ib.constructor.prototype,ub=ab===Object.prototype?void 0:ab,sb=j,cb=function(t,e){var r=[][t];return!!r&&sb((function(){r.call(null,e||function(){return 1},1)}))},fb=Aa.forEach,hb=cb("forEach")?[].forEach:function(t){return fb(this,t,arguments.length>1?arguments[1]:void 0)},lb=I,pb=ob,db=ub,vb=hb,yb=br,gb=function(t){if(t&&t.forEach!==vb)try{yb(t,"forEach",vb)}catch(Zq){t.forEach=vb}};for(var bb in pb)pb[bb]&&gb(lb[bb]&&lb[bb].prototype);gb(db);var mb=I,wb=ob,Ab=ub,Sb=fh,xb=br,Eb=Fi,Ob=Te("iterator"),Tb=Sb.values,Rb=function(t,e){if(t){if(t[Ob]!==Tb)try{xb(t,Ob,Tb)}catch(Zq){t[Ob]=Tb}if(Eb(t,e,!0),wb[e])for(var r in Sb)if(t[r]!==Sb[r])try{xb(t,r,Sb[r])}catch(Zq){t[r]=Sb[r]}}};for(var Ib in wb)Rb(mb[Ib]&&mb[Ib].prototype,Ib);Rb(Ab,"DOMTokenList");var Pb=Ro,jb=j,kb=Vi,Lb=pt,Ub=ce,Cb=Bn,_b=bh,Mb=Th,Bb=pa,Fb=jh,Nb=Ot,Db=Te("isConcatSpreadable"),zb=Nb>=51||!jb((function(){var t=[];return t[Db]=!1,t.concat()[0]!==t})),Hb=function(t){if(!Lb(t))return!1;var e=t[Db];return void 0!==e?!!e:kb(t)};Pb({target:"Array",proto:!0,arity:1,forced:!zb||!Fb("concat")},{concat:function(t){var e,r,n,o,i,a=Ub(this),u=Bb(a,0),s=0;for(e=-1,n=arguments.length;e1?arguments[1]:void 0,r),i=n>2?arguments[2]:void 0,a=void 0===i?r:Wb(i,r);a>o;)e[o++]=t;return e},Vb=of;Ro({target:"Array",proto:!0},{fill:Gb}),Vb("fill");var Yb=Aa.filter;Ro({target:"Array",proto:!0,forced:!jh("filter")},{filter:function(t){return Yb(this,t,arguments.length>1?arguments[1]:void 0)}});var Jb=Ro,Kb=Aa.find,Xb=of,Qb="find",Zb=!0;Qb in[]&&Array(1)[Qb]((function(){Zb=!1})),Jb({target:"Array",proto:!0,forced:Zb},{find:function(t){return Kb(this,t,arguments.length>1?arguments[1]:void 0)}}),Xb(Qb);var tm=Ro,em=Aa.findIndex,rm=of,nm="findIndex",om=!0;nm in[]&&Array(1)[nm]((function(){om=!1})),tm({target:"Array",proto:!0,forced:om},{findIndex:function(t){return em(this,t,arguments.length>1?arguments[1]:void 0)}}),rm(nm);var im=or,am=Xv,um=function(t,e,r,n){try{return n?e(im(r)[0],r[1]):e(r)}catch(Zq){am(t,"throw",Zq)}},sm=$i,cm=_,fm=ce,hm=um,lm=Cv,pm=aa,dm=Bn,vm=Th,ym=Vv,gm=Dv,bm=Array,mm=function(t){var e=fm(t),r=pm(this),n=arguments.length,o=n>1?arguments[1]:void 0,i=void 0!==o;i&&(o=sm(o,n>2?arguments[2]:void 0));var a,u,s,c,f,h,l=gm(e),p=0;if(!l||this===bm&&lm(l))for(a=dm(e),u=r?new this(a):bm(a);a>p;p++)h=i?o(e[p],p):e[p],vm(u,p,h);else for(u=r?new this:[],f=(c=ym(e,l)).next;!(s=cm(f,c)).done;p++)h=i?hm(c,o,[s.value,p],!0):s.value,vm(u,p,h);return u.length=p,u},wm=mm;Ro({target:"Array",stat:!0,forced:!yy((function(t){Array.from(t)}))},{from:wm});var Am=Ro,Sm=Hn.indexOf,xm=cb,Em=zi([].indexOf),Om=!!Em&&1/Em([1],1,-0)<0;Am({target:"Array",proto:!0,forced:Om||!xm("indexOf")},{indexOf:function(t){var e=arguments.length>1?arguments[1]:void 0;return Om?Em(this,t,e)||0:Sm(this,t,e)}});var Tm=Aa.map;Ro({target:"Array",proto:!0,forced:!jh("map")},{map:function(t){return Tm(this,t,arguments.length>1?arguments[1]:void 0)}});var Rm=Bt,Im=TypeError,Pm=function(t,e){if(!delete t[e])throw new Im("Cannot delete property "+Rm(e)+" of "+Rm(t))},jm=Ro,km=ce,Lm=Ln,Um=In,Cm=Bn,_m=yh,Mm=bh,Bm=pa,Fm=Th,Nm=Pm,Dm=jh("splice"),zm=Math.max,Hm=Math.min;jm({target:"Array",proto:!0,forced:!Dm},{splice:function(t,e){var r,n,o,i,a,u,s=km(this),c=Cm(s),f=Lm(t,c),h=arguments.length;for(0===h?r=n=0:1===h?(r=0,n=c-f):(r=h-2,n=Hm(zm(Um(e),0),c-f)),Mm(c+r-n),o=Bm(s,n),i=0;ic-n+r;i--)Nm(s,i-1)}else if(r>n)for(i=c-n;i>f;i--)u=i+r-1,(a=i+n-1)in s?s[u]=s[a]:Nm(s,u);for(i=0;i92||lw&&cw>94||fw&&cw>97)return!1;var t=new ArrayBuffer(8),e=pw(t,{transfer:[t]});return 0!==t.byteLength||8!==e.byteLength})),vw=I,yw=function(t){try{if(uw)return Function('return require("'+t+'")')()}catch(Zq){}},gw=dw,bw=vw.structuredClone,mw=vw.ArrayBuffer,ww=vw.MessageChannel,Aw=!1;if(gw)Aw=function(t){bw(t,{transfer:[t]})};else if(mw)try{ww||(Zm=yw("worker_threads"))&&(ww=Zm.MessageChannel),ww&&(tw=new ww,ew=new mw(2),rw=function(t){tw.port1.postMessage(null,[t])},2===ew.byteLength&&(rw(ew),0===ew.byteLength&&(Aw=rw)))}catch(Zq){}var Sw=I,xw=V,Ew=tc,Ow=aw,Tw=Ym,Rw=$m,Iw=Aw,Pw=dw,jw=Sw.structuredClone,kw=Sw.ArrayBuffer,Lw=Sw.DataView,Uw=Sw.TypeError,Cw=Math.min,_w=kw.prototype,Mw=Lw.prototype,Bw=xw(_w.slice),Fw=Ew(_w,"resizable","get"),Nw=Ew(_w,"maxByteLength","get"),Dw=xw(Mw.getInt8),zw=xw(Mw.setInt8),Hw=(Pw||Iw)&&function(t,e,r){var n,o=Rw(t),i=void 0===e?o:Ow(e),a=!Fw||!Fw(t);if(Tw(t))throw new Uw("ArrayBuffer is detached");if(Pw&&(t=jw(t,{transfer:[t]}),o===i&&(r||a)))return t;if(o>=i&&(!r||a))n=Bw(t,0,i);else{var u=r&&!a&&Nw?{maxByteLength:Nw(t)}:void 0;n=new kw(i,u);for(var s=new Lw(t),c=new Lw(n),f=Cw(i,o),h=0;h1?arguments[1]:void 0);e=e?e.next:r.first;)for(n(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!s(this,t)}}),MA(i,r?{get:function(t){var e=s(this,t);return e&&e.value},set:function(t,e){return u(this,0===t?0:t,e)}}:{add:function(t){return u(this,t=0===t?0:t,t)}}),WA&&_A(i,"size",{configurable:!0,get:function(){return a(this).size}}),o},setStrong:function(t,e,r){var n=e+" Iterator",o=VA(e),i=VA(n);zA(t,e,(function(t,e){GA(this,{type:n,target:t,state:o(t),kind:e,last:void 0})}),(function(){for(var t=i(this),e=t.kind,r=t.last;r&&r.removed;)r=r.previous;return t.target&&(t.last=r=r?r.next:t.state.first)?HA("keys"===e?r.key:"values"===e?r.value:[r.key,r.value],!1):(t.target=void 0,HA(void 0,!0))}),r?"entries":"values",!r,!0),qA(e)}};kA("Map",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),YA);var JA=Ro,KA=Math.hypot,XA=Math.abs,QA=Math.sqrt;JA({target:"Math",stat:!0,arity:2,forced:!!KA&&KA(1/0,NaN)!==1/0},{hypot:function(t,e){for(var r,n,o=0,i=0,a=arguments.length,u=0;i0?(n=r/u)*n:r;return u===1/0?1/0:u*QA(o)}});var ZA=Ro,tS=j,eS=ct,rS=P.f,nS=k;ZA({target:"Object",stat:!0,forced:!nS||tS((function(){rS(1)})),sham:!nS},{getOwnPropertyDescriptor:function(t,e){return rS(eS(t),e)}});var oS=oo,iS=ct,aS=P,uS=Th;Ro({target:"Object",stat:!0,sham:!k},{getOwnPropertyDescriptors:function(t){for(var e,r,n=iS(t),o=aS.f,i=oS(n),a={},u=0;i.length>u;)void 0!==(r=o(n,e=i[u++]))&&uS(a,e,r);return a}});var sS=ce,cS=qo;Ro({target:"Object",stat:!0,forced:j((function(){cS(1)}))},{keys:function(t){return cS(sS(t))}});var fS=or,hS=function(){var t=fS(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.unicodeSets&&(e+="v"),t.sticky&&(e+="y"),e},lS=j,pS=I.RegExp,dS=lS((function(){var t=pS("a","y");return t.lastIndex=2,null!==t.exec("abcd")})),vS=dS||lS((function(){return!pS("a","y").sticky})),yS=dS||lS((function(){var t=pS("^r","gy");return t.lastIndex=2,null!==t.exec("str")})),gS={BROKEN_CARET:yS,MISSED_STICKY:vS,UNSUPPORTED_Y:dS},bS=j,mS=I.RegExp,wS=bS((function(){var t=mS(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)})),AS=j,SS=I.RegExp,xS=AS((function(){var t=SS("(?b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$c")})),ES=_,OS=V,TS=No,RS=hS,IS=gS,PS=hi,jS=Zr.get,kS=wS,LS=xS,US=ae("native-string-replace",String.prototype.replace),CS=RegExp.prototype.exec,_S=CS,MS=OS("".charAt),BS=OS("".indexOf),FS=OS("".replace),NS=OS("".slice),DS=function(){var t=/a/,e=/b*/g;return ES(CS,t,"a"),ES(CS,e,"a"),0!==t.lastIndex||0!==e.lastIndex}(),zS=IS.BROKEN_CARET,HS=void 0!==/()??/.exec("")[1];(DS||HS||zS||kS||LS)&&(_S=function(t){var e,r,n,o,i,a,u,s=this,c=jS(s),f=TS(t),h=c.raw;if(h)return h.lastIndex=s.lastIndex,e=ES(_S,h,f),s.lastIndex=h.lastIndex,e;var l=c.groups,p=zS&&s.sticky,d=ES(RS,s),v=s.source,y=0,g=f;if(p&&(d=FS(d,"y",""),-1===BS(d,"g")&&(d+="g"),g=NS(f,s.lastIndex),s.lastIndex>0&&(!s.multiline||s.multiline&&"\n"!==MS(f,s.lastIndex-1))&&(v="(?: "+v+")",g=" "+g,y++),r=new RegExp("^(?:"+v+")",d)),HS&&(r=new RegExp("^"+v+"$(?!\\s)",d)),DS&&(n=s.lastIndex),o=ES(CS,p?r:s,g),p?o?(o.input=NS(o.input,y),o[0]=NS(o[0],y),o.index=s.lastIndex,s.lastIndex+=o[0].length):s.lastIndex=0:DS&&o&&(s.lastIndex=s.global?o.index+o[0].length:n),HS&&o&&o.length>1&&ES(US,o[0],r,(function(){for(i=1;i]*>)/g,Cx=/\$([$&'`]|\d{1,2})/g,_x=_,Mx=or,Bx=ht,Fx=X,Nx=qS,Dx=TypeError,zx=function(t,e){var r=t.exec;if(Bx(r)){var n=_x(r,t,e);return null!==n&&Mx(n),n}if("RegExp"===Fx(t))return _x(Nx,t,e);throw new Dx("RegExp#exec called on incompatible receiver")},Hx=Xu,qx=_,Wx=V,$x=Ex,Gx=j,Vx=or,Yx=ht,Jx=nt,Kx=In,Xx=_n,Qx=No,Zx=at,tE=Tx,eE=Wt,rE=function(t,e,r,n,o,i){var a=r+t.length,u=n.length,s=Cx;return void 0!==o&&(o=Ix(o),s=Ux),kx(i,s,(function(i,s){var c;switch(jx(s,0)){case"$":return"$";case"&":return t;case"`":return Lx(e,0,r);case"'":return Lx(e,a);case"<":c=o[Lx(s,1,-1)];break;default:var f=+s;if(0===f)return i;if(f>u){var h=Px(f/10);return 0===h?i:h<=u?void 0===n[h-1]?jx(s,1):n[h-1]+jx(s,1):i}c=n[f-1]}return void 0===c?"":c}))},nE=zx,oE=Te("replace"),iE=Math.max,aE=Math.min,uE=Wx([].concat),sE=Wx([].push),cE=Wx("".indexOf),fE=Wx("".slice),hE="$0"==="a".replace(/./,"$0"),lE=!!/./[oE]&&""===/./[oE]("a","$0"),pE=!Gx((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$")}));$x("replace",(function(t,e,r){var n=lE?"$":"$0";return[function(t,r){var n=Zx(this),o=Jx(t)?void 0:eE(t,oE);return o?qx(o,t,n,r):qx(e,Qx(n),t,r)},function(t,o){var i=Vx(this),a=Qx(t);if("string"==typeof o&&-1===cE(o,n)&&-1===cE(o,"$<")){var u=r(e,i,a,o);if(u.done)return u.value}var s=Yx(o);s||(o=Qx(o));var c,f=i.global;f&&(c=i.unicode,i.lastIndex=0);for(var h,l=[];null!==(h=nE(i,a))&&(sE(l,h),f);){""===Qx(h[0])&&(i.lastIndex=tE(a,Xx(i.lastIndex),c))}for(var p,d="",v=0,y=0;y=v&&(d+=fE(a,v,m)+g,v=m+b.length)}return d+fE(a,v)}]}),!pE||!hE||lE);var dE,vE,yE,gE={exports:{}},bE="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,mE=bE,wE=k,AE=I,SE=ht,xE=pt,EE=le,OE=Mo,TE=Bt,RE=br,IE=xn,PE=Ai,jE=gt,kE=vf,LE=cc,UE=Te,CE=ge,_E=Zr.enforce,ME=Zr.get,BE=AE.Int8Array,FE=BE&&BE.prototype,NE=AE.Uint8ClampedArray,DE=NE&&NE.prototype,zE=BE&&kE(BE),HE=FE&&kE(FE),qE=Object.prototype,WE=AE.TypeError,$E=UE("toStringTag"),GE=CE("TYPED_ARRAY_TAG"),VE="TypedArrayConstructor",YE=mE&&!!LE&&"Opera"!==OE(AE.opera),JE=!1,KE={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},XE={BigInt64Array:8,BigUint64Array:8},QE=function(t){var e=kE(t);if(xE(e)){var r=ME(e);return r&&EE(r,VE)?r[VE]:QE(e)}},ZE=function(t){if(!xE(t))return!1;var e=OE(t);return EE(KE,e)||EE(XE,e)};for(dE in KE)(yE=(vE=AE[dE])&&vE.prototype)?_E(yE)[VE]=vE:YE=!1;for(dE in XE)(yE=(vE=AE[dE])&&vE.prototype)&&(_E(yE)[VE]=vE);if((!YE||!SE(zE)||zE===Function.prototype)&&(zE=function(){throw new WE("Incorrect invocation")},YE))for(dE in KE)AE[dE]&&LE(AE[dE],zE);if((!YE||!HE||HE===qE)&&(HE=zE.prototype,YE))for(dE in KE)AE[dE]&&LE(AE[dE].prototype,HE);if(YE&&kE(DE)!==HE&&LE(DE,HE),wE&&!EE(HE,$E))for(dE in JE=!0,PE(HE,$E,{configurable:!0,get:function(){return xE(this)?this[GE]:void 0}}),KE)AE[dE]&&RE(AE[dE],GE,dE);var tO={NATIVE_ARRAY_BUFFER_VIEWS:YE,TYPED_ARRAY_TAG:JE&&GE,aTypedArray:function(t){if(ZE(t))return t;throw new WE("Target is not a typed array")},aTypedArrayConstructor:function(t){if(SE(t)&&(!LE||jE(zE,t)))return t;throw new WE(TE(t)+" is not a typed array constructor")},exportTypedArrayMethod:function(t,e,r,n){if(wE){if(r)for(var o in KE){var i=AE[o];if(i&&EE(i.prototype,t))try{delete i.prototype[t]}catch(Zq){try{i.prototype[t]=e}catch(a){}}}HE[t]&&!r||IE(HE,t,r?e:YE&&FE[t]||e,n)}},exportTypedArrayStaticMethod:function(t,e,r){var n,o;if(wE){if(LE){if(r)for(n in KE)if((o=AE[n])&&EE(o,t))try{delete o[t]}catch(Zq){}if(zE[t]&&!r)return;try{return IE(zE,t,r?e:YE&&zE[t]||e)}catch(Zq){}}for(n in KE)!(o=AE[n])||o[t]&&!r||IE(o,t,e)}},getTypedArrayConstructor:QE,isView:function(t){if(!xE(t))return!1;var e=OE(t);return"DataView"===e||EE(KE,e)||EE(XE,e)},isTypedArray:ZE,TypedArray:zE,TypedArrayPrototype:HE},eO=I,rO=j,nO=yy,oO=tO.NATIVE_ARRAY_BUFFER_VIEWS,iO=eO.ArrayBuffer,aO=eO.Int8Array,uO=!oO||!rO((function(){aO(1)}))||!rO((function(){new aO(-1)}))||!nO((function(t){new aO,new aO(null),new aO(1.5),new aO(t)}),!0)||rO((function(){return 1!==new aO(new iO(2),1,void 0).length})),sO=Math.sign||function(t){var e=+t;return 0===e||e!=e?e:e<0?-1:1},cO=Math.abs,fO=2220446049250313e-31,hO=1/fO,lO=function(t,e,r,n){var o=+t,i=cO(o),a=sO(o);if(ir||s!=s?a*(1/0):a*s},pO=Math.fround||function(t){return lO(t,1.1920928955078125e-7,34028234663852886e22,11754943508222875e-54)},dO=Array,vO=Math.abs,yO=Math.pow,gO=Math.floor,bO=Math.log,mO=Math.LN2,wO={pack:function(t,e,r){var n,o,i,a=dO(r),u=8*r-e-1,s=(1<>1,f=23===e?yO(2,-24)-yO(2,-77):0,h=t<0||0===t&&1/t<0?1:0,l=0;for((t=vO(t))!=t||t===1/0?(o=t!=t?1:0,n=s):(n=gO(bO(t)/mO),t*(i=yO(2,-n))<1&&(n--,i*=2),(t+=n+c>=1?f/i:f*yO(2,1-c))*i>=2&&(n++,i/=2),n+c>=s?(o=0,n=s):n+c>=1?(o=(t*i-1)*yO(2,e),n+=c):(o=t*yO(2,c-1)*yO(2,e),n=0));e>=8;)a[l++]=255&o,o/=256,e-=8;for(n=n<0;)a[l++]=255&n,n/=256,u-=8;return a[--l]|=128*h,a},unpack:function(t,e){var r,n=t.length,o=8*n-e-1,i=(1<>1,u=o-7,s=n-1,c=t[s--],f=127&c;for(c>>=7;u>0;)f=256*f+t[s--],u-=8;for(r=f&(1<<-u)-1,f>>=-u,u+=e;u>0;)r=256*r+t[s--],u-=8;if(0===f)f=1-a;else{if(f===i)return r?NaN:c?-1/0:1/0;r+=yO(2,e),f-=a}return(c?-1:1)*r*yO(2,f-e)}},AO=I,SO=V,xO=k,EO=bE,OO=br,TO=Ai,RO=UA,IO=j,PO=Xl,jO=In,kO=_n,LO=aw,UO=pO,CO=wO,_O=vf,MO=cc,BO=Gb,FO=pi,NO=vc,DO=co,zO=Fi,HO=Zr,qO=Or.PROPER,WO=Or.CONFIGURABLE,$O="ArrayBuffer",GO="DataView",VO="prototype",YO="Wrong index",JO=HO.getterFor($O),KO=HO.getterFor(GO),XO=HO.set,QO=AO[$O],ZO=QO,tT=ZO&&ZO[VO],eT=AO[GO],rT=eT&&eT[VO],nT=Object.prototype,oT=AO.Array,iT=AO.RangeError,aT=SO(BO),uT=SO([].reverse),sT=CO.pack,cT=CO.unpack,fT=function(t){return[255&t]},hT=function(t){return[255&t,t>>8&255]},lT=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},pT=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},dT=function(t){return sT(UO(t),23,4)},vT=function(t){return sT(t,52,8)},yT=function(t,e,r){TO(t[VO],e,{configurable:!0,get:function(){return r(this)[e]}})},gT=function(t,e,r,n){var o=KO(t),i=LO(r),a=!!n;if(i+e>o.byteLength)throw new iT(YO);var u=o.bytes,s=i+o.byteOffset,c=FO(u,s,s+e);return a?c:uT(c)},bT=function(t,e,r,n,o,i){var a=KO(t),u=LO(r),s=n(+o),c=!!i;if(u+e>a.byteLength)throw new iT(YO);for(var f=a.bytes,h=u+a.byteOffset,l=0;l>24)},setUint8:function(t,e){AT(this,t,e<<24>>24)}},{unsafe:!0})}else tT=(ZO=function(t){PO(this,tT);var e=LO(t);XO(this,{type:$O,bytes:aT(oT(e),0),byteLength:e}),xO||(this.byteLength=e,this.detached=!1)})[VO],eT=function(t,e,r){PO(this,rT),PO(t,tT);var n=JO(t),o=n.byteLength,i=jO(e);if(i<0||i>o)throw new iT("Wrong offset");if(i+(r=void 0===r?o-i:kO(r))>o)throw new iT("Wrong length");XO(this,{type:GO,buffer:t,byteLength:r,byteOffset:i,bytes:n.bytes}),xO||(this.buffer=t,this.byteLength=r,this.byteOffset=i)},rT=eT[VO],xO&&(yT(ZO,"byteLength",JO),yT(eT,"buffer",KO),yT(eT,"byteLength",KO),yT(eT,"byteOffset",KO)),RO(rT,{getInt8:function(t){return gT(this,1,t)[0]<<24>>24},getUint8:function(t){return gT(this,1,t)[0]},getInt16:function(t){var e=gT(this,2,t,arguments.length>1&&arguments[1]);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=gT(this,2,t,arguments.length>1&&arguments[1]);return e[1]<<8|e[0]},getInt32:function(t){return pT(gT(this,4,t,arguments.length>1&&arguments[1]))},getUint32:function(t){return pT(gT(this,4,t,arguments.length>1&&arguments[1]))>>>0},getFloat32:function(t){return cT(gT(this,4,t,arguments.length>1&&arguments[1]),23)},getFloat64:function(t){return cT(gT(this,8,t,arguments.length>1&&arguments[1]),52)},setInt8:function(t,e){bT(this,1,t,fT,e)},setUint8:function(t,e){bT(this,1,t,fT,e)},setInt16:function(t,e){bT(this,2,t,hT,e,arguments.length>2&&arguments[2])},setUint16:function(t,e){bT(this,2,t,hT,e,arguments.length>2&&arguments[2])},setInt32:function(t,e){bT(this,4,t,lT,e,arguments.length>2&&arguments[2])},setUint32:function(t,e){bT(this,4,t,lT,e,arguments.length>2&&arguments[2])},setFloat32:function(t,e){bT(this,4,t,dT,e,arguments.length>2&&arguments[2])},setFloat64:function(t,e){bT(this,8,t,vT,e,arguments.length>2&&arguments[2])}});zO(ZO,$O),zO(eT,GO);var ST={ArrayBuffer:ZO,DataView:eT},xT=pt,ET=Math.floor,OT=Number.isInteger||function(t){return!xT(t)&&isFinite(t)&&ET(t)===t},TT=In,RT=RangeError,IT=function(t){var e=TT(t);if(e<0)throw new RT("The argument can't be less than 0");return e},PT=RangeError,jT=function(t,e){var r=IT(t);if(r%e)throw new PT("Wrong offset");return r},kT=Math.round,LT=Mo,UT=function(t){var e=LT(t);return"BigInt64Array"===e||"BigUint64Array"===e},CT=Ce,_T=TypeError,MT=function(t){var e=CT(t,"number");if("number"==typeof e)throw new _T("Can't convert number to bigint");return BigInt(e)},BT=$i,FT=_,NT=ep,DT=ce,zT=Bn,HT=Vv,qT=Dv,WT=Cv,$T=UT,GT=tO.aTypedArrayConstructor,VT=MT,YT=Bn,JT=function(t,e,r){for(var n=0,o=arguments.length>2?r:YT(e),i=new t(o);o>n;)i[n]=e[n++];return i},KT=Ro,XT=I,QT=_,ZT=k,tR=uO,eR=tO,rR=ST,nR=Xl,oR=H,iR=br,aR=OT,uR=_n,sR=aw,cR=jT,fR=function(t){var e=kT(t);return e<0?0:e>255?255:255&e},hR=Be,lR=le,pR=Mo,dR=pt,vR=_t,yR=hi,gR=gt,bR=cc,mR=En.f,wR=function(t){var e,r,n,o,i,a,u,s,c=NT(this),f=DT(t),h=arguments.length,l=h>1?arguments[1]:void 0,p=void 0!==l,d=qT(f);if(d&&!WT(d))for(s=(u=HT(f,d)).next,f=[];!(a=FT(s,u)).done;)f.push(a.value);for(p&&h>2&&(l=BT(l,arguments[2])),r=zT(f),n=new(GT(c))(r),o=$T(n),e=0;r>e;e++)i=p?l(f[e],e):f[e],n[e]=o?VT(i):+i;return n},AR=Aa.forEach,SR=Yl,xR=Ai,ER=Ze,OR=P,TR=JT,RR=vc,IR=Zr.get,PR=Zr.set,jR=Zr.enforce,kR=ER.f,LR=OR.f,UR=XT.RangeError,CR=rR.ArrayBuffer,_R=CR.prototype,MR=rR.DataView,BR=eR.NATIVE_ARRAY_BUFFER_VIEWS,FR=eR.TYPED_ARRAY_TAG,NR=eR.TypedArray,DR=eR.TypedArrayPrototype,zR=eR.isTypedArray,HR="BYTES_PER_ELEMENT",qR="Wrong length",WR=function(t,e){xR(t,e,{configurable:!0,get:function(){return IR(this)[e]}})},$R=function(t){var e;return gR(_R,t)||"ArrayBuffer"===(e=pR(t))||"SharedArrayBuffer"===e},GR=function(t,e){return zR(t)&&!vR(e)&&e in t&&aR(+e)&&e>=0},VR=function(t,e){return e=hR(e),GR(t,e)?oR(2,t[e]):LR(t,e)},YR=function(t,e,r){return e=hR(e),!(GR(t,e)&&dR(r)&&lR(r,"value"))||lR(r,"get")||lR(r,"set")||r.configurable||lR(r,"writable")&&!r.writable||lR(r,"enumerable")&&!r.enumerable?kR(t,e,r):(t[e]=r.value,t)};ZT?(BR||(OR.f=VR,ER.f=YR,WR(DR,"buffer"),WR(DR,"byteOffset"),WR(DR,"byteLength"),WR(DR,"length")),KT({target:"Object",stat:!0,forced:!BR},{getOwnPropertyDescriptor:VR,defineProperty:YR}),gE.exports=function(t,e,r){var n=t.match(/\d+/)[0]/8,o=t+(r?"Clamped":"")+"Array",i="get"+t,a="set"+t,u=XT[o],s=u,c=s&&s.prototype,f={},h=function(t,e){kR(t,e,{get:function(){return function(t,e){var r=IR(t);return r.view[i](e*n+r.byteOffset,!0)}(this,e)},set:function(t){return function(t,e,o){var i=IR(t);i.view[a](e*n+i.byteOffset,r?fR(o):o,!0)}(this,e,t)},enumerable:!0})};BR?tR&&(s=e((function(t,e,r,o){return nR(t,c),RR(dR(e)?$R(e)?void 0!==o?new u(e,cR(r,n),o):void 0!==r?new u(e,cR(r,n)):new u(e):zR(e)?TR(s,e):QT(wR,s,e):new u(sR(e)),t,s)})),bR&&bR(s,NR),AR(mR(u),(function(t){t in s||iR(s,t,u[t])})),s.prototype=c):(s=e((function(t,e,r,o){nR(t,c);var i,a,u,f=0,l=0;if(dR(e)){if(!$R(e))return zR(e)?TR(s,e):QT(wR,s,e);i=e,l=cR(r,n);var p=e.byteLength;if(void 0===o){if(p%n)throw new UR(qR);if((a=p-l)<0)throw new UR(qR)}else if((a=uR(o)*n)+l>p)throw new UR(qR);u=a/n}else u=sR(e),i=new CR(a=u*n);for(PR(t,{buffer:i,byteOffset:l,byteLength:a,length:u,view:new MR(i)});f=0?n:r+n;return o<0||o>=r?void 0:e[o]}));var ZR=ce,tI=Ln,eI=Bn,rI=Pm,nI=Math.min,oI=[].copyWithin||function(t,e){var r=ZR(this),n=eI(r),o=tI(t,n),i=tI(e,n),a=arguments.length>2?arguments[2]:void 0,u=nI((void 0===a?n:tI(a,n))-i,n-o),s=1;for(i0;)i in r?r[o]=r[i]:rI(r,o),o+=s,i+=s;return r},iI=tO,aI=V(oI),uI=iI.aTypedArray;(0,iI.exportTypedArrayMethod)("copyWithin",(function(t,e){return aI(uI(this),t,e,arguments.length>2?arguments[2]:void 0)}));var sI=Aa.every,cI=tO.aTypedArray;(0,tO.exportTypedArrayMethod)("every",(function(t){return sI(cI(this),t,arguments.length>1?arguments[1]:void 0)}));var fI=Gb,hI=MT,lI=Mo,pI=_,dI=j,vI=tO.aTypedArray,yI=tO.exportTypedArrayMethod,gI=V("".slice);yI("fill",(function(t){var e=arguments.length;vI(this);var r="Big"===gI(lI(this),0,3)?hI(t):+t;return pI(fI,this,r,e>1?arguments[1]:void 0,e>2?arguments[2]:void 0)}),dI((function(){var t=0;return new Int8Array(2).fill({valueOf:function(){return t++}}),1!==t})));var bI=ap,mI=tO.aTypedArrayConstructor,wI=tO.getTypedArrayConstructor,AI=function(t){return mI(bI(t,wI(t)))},SI=JT,xI=AI,EI=Aa.filter,OI=function(t,e){return SI(xI(t),e)},TI=tO.aTypedArray;(0,tO.exportTypedArrayMethod)("filter",(function(t){var e=EI(TI(this),t,arguments.length>1?arguments[1]:void 0);return OI(this,e)}));var RI=Aa.find,II=tO.aTypedArray;(0,tO.exportTypedArrayMethod)("find",(function(t){return RI(II(this),t,arguments.length>1?arguments[1]:void 0)}));var PI=Aa.findIndex,jI=tO.aTypedArray;(0,tO.exportTypedArrayMethod)("findIndex",(function(t){return PI(jI(this),t,arguments.length>1?arguments[1]:void 0)}));var kI=$i,LI=rt,UI=ce,CI=Bn,_I=function(t){var e=1===t;return function(r,n,o){for(var i,a=UI(r),u=LI(a),s=CI(u),c=kI(n,o);s-- >0;)if(c(i=u[s],s,a))switch(t){case 0:return i;case 1:return s}return e?-1:void 0}},MI={findLast:_I(0),findLastIndex:_I(1)},BI=MI.findLast,FI=tO.aTypedArray;(0,tO.exportTypedArrayMethod)("findLast",(function(t){return BI(FI(this),t,arguments.length>1?arguments[1]:void 0)}));var NI=MI.findLastIndex,DI=tO.aTypedArray;(0,tO.exportTypedArrayMethod)("findLastIndex",(function(t){return NI(DI(this),t,arguments.length>1?arguments[1]:void 0)}));var zI=Aa.forEach,HI=tO.aTypedArray;(0,tO.exportTypedArrayMethod)("forEach",(function(t){zI(HI(this),t,arguments.length>1?arguments[1]:void 0)}));var qI=Hn.includes,WI=tO.aTypedArray;(0,tO.exportTypedArrayMethod)("includes",(function(t){return qI(WI(this),t,arguments.length>1?arguments[1]:void 0)}));var $I=Hn.indexOf,GI=tO.aTypedArray;(0,tO.exportTypedArrayMethod)("indexOf",(function(t){return $I(GI(this),t,arguments.length>1?arguments[1]:void 0)}));var VI=I,YI=j,JI=V,KI=tO,XI=fh,QI=Te("iterator"),ZI=VI.Uint8Array,tP=JI(XI.values),eP=JI(XI.keys),rP=JI(XI.entries),nP=KI.aTypedArray,oP=KI.exportTypedArrayMethod,iP=ZI&&ZI.prototype,aP=!YI((function(){iP[QI].call([1])})),uP=!!iP&&iP.values&&iP[QI]===iP.values&&"values"===iP.values.name,sP=function(){return tP(nP(this))};oP("entries",(function(){return rP(nP(this))}),aP),oP("keys",(function(){return eP(nP(this))}),aP),oP("values",sP,aP||!uP,{name:"values"}),oP(QI,sP,aP||!uP,{name:"values"});var cP=tO.aTypedArray,fP=tO.exportTypedArrayMethod,hP=V([].join);fP("join",(function(t){return hP(cP(this),t)}));var lP=Xu,pP=ct,dP=In,vP=Bn,yP=cb,gP=Math.min,bP=[].lastIndexOf,mP=!!bP&&1/[1].lastIndexOf(1,-0)<0,wP=yP("lastIndexOf"),AP=mP||!wP?function(t){if(mP)return lP(bP,this,arguments)||0;var e=pP(this),r=vP(e);if(0===r)return-1;var n=r-1;for(arguments.length>1&&(n=gP(n,dP(arguments[1]))),n<0&&(n=r+n);n>=0;n--)if(n in e&&e[n]===t)return n||0;return-1}:bP,SP=Xu,xP=AP,EP=tO.aTypedArray;(0,tO.exportTypedArrayMethod)("lastIndexOf",(function(t){var e=arguments.length;return SP(xP,EP(this),e>1?[t,arguments[1]]:[t])}));var OP=Aa.map,TP=AI,RP=tO.aTypedArray;(0,tO.exportTypedArrayMethod)("map",(function(t){return OP(RP(this),t,arguments.length>1?arguments[1]:void 0,(function(t,e){return new(TP(t))(e)}))}));var IP=zt,PP=ce,jP=rt,kP=Bn,LP=TypeError,UP="Reduce of empty array with no initial value",CP=function(t){return function(e,r,n,o){var i=PP(e),a=jP(i),u=kP(i);if(IP(r),0===u&&n<2)throw new LP(UP);var s=t?u-1:0,c=t?-1:1;if(n<2)for(;;){if(s in a){o=a[s],s+=c;break}if(s+=c,t?s<0:u<=s)throw new LP(UP)}for(;t?s>=0:u>s;s+=c)s in a&&(o=r(o,a[s],s,i));return o}},_P={left:CP(!1),right:CP(!0)},MP=_P.left,BP=tO.aTypedArray;(0,tO.exportTypedArrayMethod)("reduce",(function(t){var e=arguments.length;return MP(BP(this),t,e,e>1?arguments[1]:void 0)}));var FP=_P.right,NP=tO.aTypedArray;(0,tO.exportTypedArrayMethod)("reduceRight",(function(t){var e=arguments.length;return FP(NP(this),t,e,e>1?arguments[1]:void 0)}));var DP=tO.aTypedArray,zP=tO.exportTypedArrayMethod,HP=Math.floor;zP("reverse",(function(){for(var t,e=this,r=DP(e).length,n=HP(r/2),o=0;o1?arguments[1]:void 0,1),r=YP(t);if(rj)return WP(ZP,this,r,e);var n=this.length,o=GP(r),i=0;if(o+e>n)throw new KP("Wrong length");for(;io;)a[o]=r[o++];return a}),j((function(){new Int8Array(1).slice()})));var uj=Aa.some,sj=tO.aTypedArray;(0,tO.exportTypedArrayMethod)("some",(function(t){return uj(sj(this),t,arguments.length>1?arguments[1]:void 0)}));var cj=pi,fj=Math.floor,hj=function(t,e){var r=t.length;if(r<8)for(var n,o,i=1;i0;)t[o]=t[--o];o!==i++&&(t[o]=n)}else for(var a=fj(r/2),u=hj(cj(t,0,a),e),s=hj(cj(t,a),e),c=u.length,f=s.length,h=0,l=0;h0&&1/r<0?1:-1:e>r}}(t))}),!kj||jj);var Lj=Xu,Uj=tO,Cj=j,_j=pi,Mj=I.Int8Array,Bj=Uj.aTypedArray,Fj=Uj.exportTypedArrayMethod,Nj=[].toLocaleString,Dj=!!Mj&&Cj((function(){Nj.call(new Mj(1))}));Fj("toLocaleString",(function(){return Lj(Nj,Dj?_j(Bj(this)):Bj(this),_j(arguments))}),Cj((function(){return[1,2].toLocaleString()!==new Mj([1,2]).toLocaleString()}))||!Cj((function(){Mj.prototype.toLocaleString.call([1,2])})));var zj=Bn,Hj=function(t,e){for(var r=zj(t),n=new e(r),o=0;o=o||a<0)throw new uk("Incorrect index");for(var u=new e(o),s=0;sr.size?NU(r.getIterator(),(function(t){HU(e,t)&&zU(n,t)})):FU(e,(function(t){r.includes(t)&&zU(n,t)})),n};Ro({target:"Set",proto:!0,real:!0,forced:!UU("intersection")||qU((function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))}))},{intersection:WU});var $U=KL,GU=YL.has,VU=hU,YU=SU,JU=aU,KU=QL,XU=Xv,QU=function(t){var e=$U(this),r=YU(t);if(VU(e)<=r.size)return!1!==JU(e,(function(t){if(r.includes(t))return!1}),!0);var n=r.getIterator();return!1!==KU(n,(function(t){if(GU(e,t))return XU(n,"normal",!1)}))};Ro({target:"Set",proto:!0,real:!0,forced:!UU("isDisjointFrom")},{isDisjointFrom:QU});var ZU=KL,tC=hU,eC=aU,rC=SU,nC=function(t){var e=ZU(this),r=rC(t);return!(tC(e)>r.size)&&!1!==eC(e,(function(t){if(!r.includes(t))return!1}),!0)};Ro({target:"Set",proto:!0,real:!0,forced:!UU("isSubsetOf")},{isSubsetOf:nC});var oC=KL,iC=YL.has,aC=hU,uC=SU,sC=QL,cC=Xv,fC=function(t){var e=oC(this),r=uC(t);if(aC(e)0&&DC(s)?(c=zC(s),f=WC(t,e,s,c,f,i-1)-1):(HC(f+1),t[f]=s),f++),h++;return f},$C=WC,GC=ce,VC=Bn,YC=In,JC=pa;Ro({target:"Array",proto:!0},{flat:function(){var t=arguments.length?arguments[0]:void 0,e=GC(this),r=VC(e),n=JC(e,0);return n.length=$C(n,e,e,r,0,void 0===t?1:YC(t)),n}});var KC=Hn.includes,XC=of;Ro({target:"Array",proto:!0,forced:j((function(){return!Array(1).includes()}))},{includes:function(t){return KC(this,t,arguments.length>1?arguments[1]:void 0)}}),XC("includes");var QC=_P.left;Ro({target:"Array",proto:!0,forced:!ql&&Ot>79&&Ot<83||!cb("reduce")},{reduce:function(t){var e=arguments.length;return QC(this,t,e,e>1?arguments[1]:void 0)}});var ZC=Ro,t_=V,e_=zt,r_=ce,n_=Bn,o_=Pm,i_=No,a_=j,u_=lj,s_=cb,c_=dj,f_=vj,h_=Ot,l_=gj,p_=[],d_=t_(p_.sort),v_=t_(p_.push),y_=a_((function(){p_.sort(void 0)})),g_=a_((function(){p_.sort(null)})),b_=s_("sort"),m_=!a_((function(){if(h_)return h_<70;if(!(c_&&c_>3)){if(f_)return!0;if(l_)return l_<603;var t,e,r,n,o="";for(t=65;t<76;t++){switch(e=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(n=0;n<47;n++)p_.push({k:e+n,v:r})}for(p_.sort((function(t,e){return e.v-t.v})),n=0;ni_(r)?1:-1}}(t)),r=n_(o),n=0;no;)for(var u,s=C_(arguments[o++]),c=i?B_(j_(s),i(s)):j_(s),f=c.length,h=0;f>h;)u=c[h++],T_&&!I_(a,s,u)||(r[u]=s[u]);return r}:__,N_=F_;Ro({target:"Object",stat:!0,arity:2,forced:Object.assign!==N_},{assign:N_});var D_=k,z_=j,H_=V,q_=vf,W_=qo,$_=ct,G_=H_(M.f),V_=H_([].push),Y_=D_&&z_((function(){var t=Object.create(null);return t[2]=2,!G_(t,2)})),J_=function(t){return function(e){for(var r,n=$_(e),o=W_(n),i=Y_&&null===q_(n),a=o.length,u=0,s=[];a>u;)r=o[u++],D_&&!(i?r in n:G_(n,r))||V_(s,t?[r,n[r]]:n[r]);return s}},K_={entries:J_(!0),values:J_(!1)},X_=K_.entries;Ro({target:"Object",stat:!0},{entries:function(t){return X_(t)}});var Q_=Ro,Z_=Zw,tM=j,eM=pt,rM=vA.onFreeze,nM=Object.freeze;Q_({target:"Object",stat:!0,forced:tM((function(){nM(1)})),sham:!Z_},{freeze:function(t){return nM&&eM(t)?nM(rM(t)):t}});var oM=hy,iM=Th;Ro({target:"Object",stat:!0},{fromEntries:function(t){var e={};return oM(t,(function(t,r){iM(e,t,r)}),{AS_ENTRIES:!0}),e}});var aM=Ro,uM=j,sM=li.f;aM({target:"Object",stat:!0,forced:uM((function(){return!Object.getOwnPropertyNames(1)}))},{getOwnPropertyNames:sM});var cM=K_.values;Ro({target:"Object",stat:!0},{values:function(t){return cM(t)}});var fM=Ro,hM=dd,lM=j,pM=yt,dM=ht,vM=ap,yM=zy,gM=xn,bM=hM&&hM.prototype;if(fM({target:"Promise",proto:!0,real:!0,forced:!!hM&&lM((function(){bM.finally.call({then:function(){}},(function(){}))}))},{finally:function(t){var e=vM(this,pM("Promise")),r=dM(t);return this.then(r?function(r){return yM(e,t()).then((function(){return r}))}:t,r?function(r){return yM(e,t()).then((function(){throw r}))}:t)}}),dM(hM)){var mM=pM("Promise").prototype.finally;bM.finally!==mM&&gM(bM,"finally",mM,{unsafe:!0})}var wM=le,AM=function(t){return void 0!==t&&(wM(t,"value")||wM(t,"writable"))},SM=_,xM=pt,EM=or,OM=AM,TM=P,RM=vf;Ro({target:"Reflect",stat:!0},{get:function t(e,r){var n,o,i=arguments.length<3?e:arguments[2];return EM(e)===i?e[r]:(n=TM.f(e,r))?OM(n)?n.value:void 0===n.get?void 0:SM(n.get,i):xM(o=RM(e))?t(o,r,i):void 0}}),Ro({target:"Reflect",stat:!0},{ownKeys:oo});var IM=Ro,PM=_,jM=or,kM=pt,LM=AM,UM=Ze,CM=P,_M=vf,MM=H;var BM=j((function(){var t=function(){},e=UM.f(new t,"a",{configurable:!0});return!1!==Reflect.set(t.prototype,"a",1,e)}));IM({target:"Reflect",stat:!0,forced:BM},{set:function t(e,r,n){var o,i,a,u=arguments.length<4?e:arguments[3],s=CM.f(jM(e),r);if(!s){if(kM(i=_M(e)))return t(i,r,n,u);s=MM(0)}if(LM(s)){if(!1===s.writable||!kM(u))return!1;if(o=CM.f(u,r)){if(o.get||o.set||!1===o.writable)return!1;o.value=n,UM.f(u,r,o)}else UM.f(u,r,MM(0,n))}else{if(void 0===(a=s.set))return!1;PM(a,u,n)}return!0}});var FM=pt,NM=X,DM=Te("match"),zM=function(t){var e;return FM(t)&&(void 0!==(e=t[DM])?!!e:"RegExp"===NM(t))},HM=k,qM=I,WM=V,$M=mo,GM=vc,VM=br,YM=hi,JM=En.f,KM=gt,XM=zM,QM=No,ZM=ox,tB=gS,eB=hc,rB=xn,nB=j,oB=le,iB=Zr.enforce,aB=Yl,uB=wS,sB=xS,cB=Te("match"),fB=qM.RegExp,hB=fB.prototype,lB=qM.SyntaxError,pB=WM(hB.exec),dB=WM("".charAt),vB=WM("".replace),yB=WM("".indexOf),gB=WM("".slice),bB=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,mB=/a/g,wB=/a/g,AB=new fB(mB)!==mB,SB=tB.MISSED_STICKY,xB=tB.UNSUPPORTED_Y,EB=HM&&(!AB||SB||uB||sB||nB((function(){return wB[cB]=!1,fB(mB)!==mB||fB(wB)===wB||"/a/i"!==String(fB(mB,"i"))})));if($M("RegExp",EB)){for(var OB=function(t,e){var r,n,o,i,a,u,s=KM(hB,this),c=XM(t),f=void 0===e,h=[],l=t;if(!s&&c&&f&&t.constructor===OB)return t;if((c||KM(hB,t))&&(t=t.source,f&&(e=ZM(l))),t=void 0===t?"":QM(t),e=void 0===e?"":QM(e),l=t,uB&&"dotAll"in mB&&(n=!!e&&yB(e,"s")>-1)&&(e=vB(e,/s/g,"")),r=e,SB&&"sticky"in mB&&(o=!!e&&yB(e,"y")>-1)&&xB&&(e=vB(e,/y/g,"")),sB&&(i=function(t){for(var e,r=t.length,n=0,o="",i=[],a=YM(null),u=!1,s=!1,c=0,f="";n<=r;n++){if("\\"===(e=dB(t,n)))e+=dB(t,++n);else if("]"===e)u=!1;else if(!u)switch(!0){case"["===e:u=!0;break;case"("===e:pB(bB,gB(t,n+1))&&(n+=2,s=!0),o+=e,c++;continue;case">"===e&&s:if(""===f||oB(a,f))throw new lB("Invalid capture group name");a[f]=!0,i[i.length]=[f,c],s=!1,f="";continue}s?f+=e:o+=e}return[o,i]}(t),t=i[0],h=i[1]),a=GM(fB(t,e),s?this:hB,OB),(n||o||h.length)&&(u=iB(a),n&&(u.dotAll=!0,u.raw=OB(function(t){for(var e,r=t.length,n=0,o="",i=!1;n<=r;n++)"\\"!==(e=dB(t,n))?i||"."!==e?("["===e?i=!0:"]"===e&&(i=!1),o+=e):o+="[\\s\\S]":o+=e+dB(t,++n);return o}(t),r)),o&&(u.sticky=!0),h.length&&(u.groups=h)),t!==l)try{VM(a,"source",""===l?"(?:)":l)}catch(Zq){}return a},TB=JM(fB),RB=0;TB.length>RB;)eB(OB,fB,TB[RB++]);hB.constructor=OB,OB.prototype=hB,rB(qM,"RegExp",OB,{constructor:!0})}aB("RegExp");var IB=k,PB=wS,jB=X,kB=Ai,LB=Zr.get,UB=RegExp.prototype,CB=TypeError;IB&&PB&&kB(UB,"dotAll",{configurable:!0,get:function(){if(this!==UB){if("RegExp"===jB(this))return!!LB(this).dotAll;throw new CB("Incompatible receiver, RegExp required")}}});var _B=k,MB=gS.MISSED_STICKY,BB=X,FB=Ai,NB=Zr.get,DB=RegExp.prototype,zB=TypeError;_B&&MB&&FB(DB,"sticky",{configurable:!0,get:function(){if(this!==DB){if("RegExp"===BB(this))return!!NB(this).sticky;throw new zB("Incompatible receiver, RegExp required")}}});var HB=Eg.codeAt;Ro({target:"String",proto:!0},{codePointAt:function(t){return HB(this,t)}});var qB=zM,WB=TypeError,$B=function(t){if(qB(t))throw new WB("The method doesn't accept regular expressions");return t},GB=Te("match"),VB=function(t){var e=/./;try{"/./"[t](e)}catch(r){try{return e[GB]=!1,"/./"[t](e)}catch(n){}}return!1},YB=Ro,JB=zi,KB=P.f,XB=_n,QB=No,ZB=$B,tF=at,eF=VB,rF=JB("".slice),nF=Math.min,oF=eF("endsWith"),iF=!oF&&!!function(){var t=KB(String.prototype,"endsWith");return t&&!t.writable}();YB({target:"String",proto:!0,forced:!iF&&!oF},{endsWith:function(t){var e=QB(tF(this));ZB(t);var r=arguments.length>1?arguments[1]:void 0,n=e.length,o=void 0===r?n:nF(XB(r),n),i=QB(t);return rF(e,o-i.length,o)===i}});var aF=Ro,uF=$B,sF=at,cF=No,fF=VB,hF=V("".indexOf);aF({target:"String",proto:!0,forced:!fF("includes")},{includes:function(t){return!!~hF(cF(sF(this)),cF(uF(t)),arguments.length>1?arguments[1]:void 0)}});var lF=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e},pF=_,dF=or,vF=nt,yF=at,gF=lF,bF=No,mF=Wt,wF=zx;Ex("search",(function(t,e,r){return[function(e){var r=yF(this),n=vF(e)?void 0:mF(e,t);return n?pF(n,e,r):new RegExp(e)[t](bF(r))},function(t){var n=dF(this),o=bF(t),i=r(e,n,o);if(i.done)return i.value;var a=n.lastIndex;gF(a,0)||(n.lastIndex=0);var u=wF(n,o);return gF(n.lastIndex,a)||(n.lastIndex=a),null===u?-1:u.index}]}));var AF=_,SF=V,xF=Ex,EF=or,OF=nt,TF=at,RF=ap,IF=Tx,PF=_n,jF=No,kF=Wt,LF=zx,UF=j,CF=gS.UNSUPPORTED_Y,_F=Math.min,MF=SF([].push),BF=SF("".slice),FF=!UF((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var r="ab".split(t);return 2!==r.length||"a"!==r[0]||"b"!==r[1]})),NF="c"==="abbc".split(/(b)*/)[1]||4!=="test".split(/(?:)/,-1).length||2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length;xF("split",(function(t,e,r){var n="0".split(void 0,0).length?function(t,r){return void 0===t&&0===r?[]:AF(e,this,t,r)}:e;return[function(e,r){var o=TF(this),i=OF(e)?void 0:kF(e,t);return i?AF(i,e,o,r):AF(n,jF(o),e,r)},function(t,o){var i=EF(this),a=jF(t);if(!NF){var u=r(n,i,a,o,n!==e);if(u.done)return u.value}var s=RF(i,RegExp),c=i.unicode,f=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(CF?"g":"y"),h=new s(CF?"^(?:"+i.source+")":i,f),l=void 0===o?4294967295:o>>>0;if(0===l)return[];if(0===a.length)return null===LF(h,a)?[a]:[];for(var p=0,d=0,v=[];d1?arguments[1]:void 0,e.length)),n=WF(t);return YF(e,r,r+n.length)===n}}),JR("Int32",(function(t){return function(e,r,n){return t(this,e,r,n)}}));var QF=hy,ZF=zt,tN=or,eN=Zg,rN=TypeError;Ro({target:"Iterator",proto:!0,real:!0},{reduce:function(t){tN(this),ZF(t);var e=eN(this),r=arguments.length<2,n=r?void 0:arguments[1],o=0;if(QF(e,(function(e){r?(r=!1,n=e):n=t(n,e,o),o++}),{IS_RECORD:!0}),r)throw new rN("Reduce of empty iterator with no initial value");return n}});var nN=hy,oN=zt,iN=or,aN=Zg;Ro({target:"Iterator",proto:!0,real:!0},{some:function(t){iN(this),oN(t);var e=aN(this),r=0;return nN(e,(function(e,n){if(t(e,r++))return n()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}});var uN=or,sN=hy,cN=Zg,fN=[].push;Ro({target:"Iterator",proto:!0,real:!0},{toArray:function(){var t=[];return sN(cN(uN(this)),fN,{that:t,IS_RECORD:!0}),t}});var hN=V,lN=le,pN=SyntaxError,dN=parseInt,vN=String.fromCharCode,yN=hN("".charAt),gN=hN("".slice),bN=hN(/./.exec),mN={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":"\n","\\r":"\r","\\t":"\t"},wN=/^[\da-f]{4}$/i,AN=/^[\u0000-\u001F]$/,SN=Ro,xN=k,EN=I,ON=yt,TN=V,RN=_,IN=ht,PN=pt,jN=Vi,kN=le,LN=No,UN=Bn,CN=Th,_N=j,MN=function(t,e){for(var r=!0,n="";e>1,t+=vD(t/e);t>455;)t=vD(t/35),n+=36;return vD(n+36*t/(t+38))},OD=function(t){var e=[];t=function(t){for(var e=[],r=0,n=t.length;r=55296&&o<=56319&&r=i&&nvD((cD-a)/h))throw new pD(lD);for(a+=(f-i)*h,i=f,r=0;rcD)throw new pD(lD);if(n===i){for(var l=a,p=36;;){var d=p<=u?1:p>=u+26?26:p-u;if(l=e.length)return t.target=void 0,XD(void 0,!0);var n=e[r];switch(t.kind){case"keys":return XD(n.key,!1);case"values":return XD(n.value,!1)}return XD([n.key,n.value],!1)}),!0),Uz=function(t){this.entries=[],this.url=null,void 0!==t&&($D(t)?this.parseObject(t):this.parseQuery("string"==typeof t?"?"===vz(t,0)?Sz(t,1):t:GD(t)))};Uz.prototype={type:ez,bindURL:function(t){this.url=t,this.update()},parseObject:function(t){var e,r,n,o,i,a,u,s=this.entries,c=KD(t);if(c)for(r=(e=JD(t,c)).next;!(n=PD(r,e)).done;){if(i=(o=JD(WD(n.value))).next,(a=PD(i,o)).done||(u=PD(i,o)).done||!PD(i,o).done)throw new lz("Expected sequence with length 2");gz(s,{key:GD(a.value),value:GD(u.value)})}else for(var f in t)zD(t,f)&&gz(s,{key:f,value:GD(t[f])})},parseQuery:function(t){if(t)for(var e,r,n=this.entries,o=Az(t,"&"),i=0;i0?arguments[0]:void 0));kD||(this.size=t.entries.length)},_z=Cz.prototype;if(_D(_z,{append:function(t,e){var r=oz(this);QD(arguments.length,2),gz(r.entries,{key:GD(t),value:GD(e)}),kD||this.length++,r.updateURL()},delete:function(t){for(var e=oz(this),r=QD(arguments.length,1),n=e.entries,o=GD(t),i=r<2?void 0:arguments[1],a=void 0===i?i:GD(i),u=0;ue.key?1:-1})),t.updateURL()},forEach:function(t){for(var e,r=oz(this).entries,n=HD(t,arguments.length>1?arguments[1]:void 0),o=0;o1?Fz(arguments[1]):{})}}),DD(uz)){var Nz=function(t){return ND(this,cz),new uz(t,arguments.length>1?Fz(arguments[1]):{})};cz.constructor=Nz,Nz.prototype=cz,TD({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:Nz})}}var Dz,zz=Ro,Hz=k,qz=uD,Wz=I,$z=$i,Gz=V,Vz=xn,Yz=Ai,Jz=Xl,Kz=le,Xz=F_,Qz=mm,Zz=pi,tH=Eg.codeAt,eH=function(t){var e,r,n=[],o=AD(wD(SD(t),hD,"."),".");for(e=0;e?@[\\\]^|]/,NH=/[\0\t\n\r #/:<>?@[\\\]^|]/,DH=/^[\u0000-\u0020]+/,zH=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,HH=/[\t\n\r]/g,qH=function(t){var e,r,n,o;if("number"==typeof t){for(e=[],r=0;r<4;r++)RH(e,t%256),t=dH(t/256);return bH(e,".")}if("object"==typeof t){for(e="",n=function(t){for(var e=null,r=1,n=null,o=0,i=0;i<8;i++)0!==t[i]?(o>r&&(e=n,r=o),n=null,o=0):(null===n&&(n=i),++o);return o>r&&(e=n,r=o),e}(t),r=0;r<8;r++)o&&0===t[r]||(o&&(o=!1),n===r?(e+=r?":":"::",o=!0):(e+=mH(t[r],16),r<7&&(e+=":")));return"["+e+"]"}return t},WH={},$H=Xz({},WH,{" ":1,'"':1,"<":1,">":1,"`":1}),GH=Xz({},$H,{"#":1,"?":1,"{":1,"}":1}),VH=Xz({},GH,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),YH=function(t,e){var r=tH(t,0);return r>32&&r<127&&!Kz(e,t)?t:encodeURIComponent(t)},JH={ftp:21,file:null,http:80,https:443,ws:80,wss:443},KH=function(t,e){var r;return 2===t.length&&gH(kH,yH(t,0))&&(":"===(r=yH(t,1))||!e&&"|"===r)},XH=function(t){var e;return t.length>1&&KH(OH(t,0,2))&&(2===t.length||"/"===(e=yH(t,2))||"\\"===e||"?"===e||"#"===e)},QH=function(t){return"."===t||"%2e"===TH(t)},ZH={},tq={},eq={},rq={},nq={},oq={},iq={},aq={},uq={},sq={},cq={},fq={},hq={},lq={},pq={},dq={},vq={},yq={},gq={},bq={},mq={},wq=function(t,e,r){var n,o,i,a=rH(t);if(e){if(o=this.parse(a))throw new lH(o);this.searchParams=null}else{if(void 0!==r&&(n=new wq(r,!0)),o=this.parse(a,null,n))throw new lH(o);(i=fH(new cH)).bindURL(this),this.searchParams=i}};wq.prototype={type:"URL",parse:function(t,e,r){var n,o,i,a,u,s=this,c=e||ZH,f=0,h="",l=!1,p=!1,d=!1;for(t=rH(t),e||(s.scheme="",s.username="",s.password="",s.host=null,s.port=null,s.path=[],s.query=null,s.fragment=null,s.cannotBeABaseURL=!1,t=SH(t,DH,""),t=SH(t,zH,"$1")),t=SH(t,HH,""),n=Qz(t);f<=n.length;){switch(o=n[f],c){case ZH:if(!o||!gH(kH,o)){if(e)return IH;c=eq;continue}h+=TH(o),c=tq;break;case tq:if(o&&(gH(LH,o)||"+"===o||"-"===o||"."===o))h+=TH(o);else{if(":"!==o){if(e)return IH;h="",c=eq,f=0;continue}if(e&&(s.isSpecial()!==Kz(JH,h)||"file"===h&&(s.includesCredentials()||null!==s.port)||"file"===s.scheme&&!s.host))return;if(s.scheme=h,e)return void(s.isSpecial()&&JH[s.scheme]===s.port&&(s.port=null));h="","file"===s.scheme?c=lq:s.isSpecial()&&r&&r.scheme===s.scheme?c=rq:s.isSpecial()?c=aq:"/"===n[f+1]?(c=nq,f++):(s.cannotBeABaseURL=!0,AH(s.path,""),c=gq)}break;case eq:if(!r||r.cannotBeABaseURL&&"#"!==o)return IH;if(r.cannotBeABaseURL&&"#"===o){s.scheme=r.scheme,s.path=Zz(r.path),s.query=r.query,s.fragment="",s.cannotBeABaseURL=!0,c=mq;break}c="file"===r.scheme?lq:oq;continue;case rq:if("/"!==o||"/"!==n[f+1]){c=oq;continue}c=uq,f++;break;case nq:if("/"===o){c=sq;break}c=yq;continue;case oq:if(s.scheme=r.scheme,o===Dz)s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,s.path=Zz(r.path),s.query=r.query;else if("/"===o||"\\"===o&&s.isSpecial())c=iq;else if("?"===o)s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,s.path=Zz(r.path),s.query="",c=bq;else{if("#"!==o){s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,s.path=Zz(r.path),s.path.length--,c=yq;continue}s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,s.path=Zz(r.path),s.query=r.query,s.fragment="",c=mq}break;case iq:if(!s.isSpecial()||"/"!==o&&"\\"!==o){if("/"!==o){s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,c=yq;continue}c=sq}else c=uq;break;case aq:if(c=uq,"/"!==o||"/"!==yH(h,f+1))continue;f++;break;case uq:if("/"!==o&&"\\"!==o){c=sq;continue}break;case sq:if("@"===o){l&&(h="%40"+h),l=!0,i=Qz(h);for(var v=0;v65535)return jH;s.port=s.isSpecial()&&b===JH[s.scheme]?null:b,h=""}if(e)return;c=vq;continue}return jH}h+=o;break;case lq:if(s.scheme="file","/"===o||"\\"===o)c=pq;else{if(!r||"file"!==r.scheme){c=yq;continue}switch(o){case Dz:s.host=r.host,s.path=Zz(r.path),s.query=r.query;break;case"?":s.host=r.host,s.path=Zz(r.path),s.query="",c=bq;break;case"#":s.host=r.host,s.path=Zz(r.path),s.query=r.query,s.fragment="",c=mq;break;default:XH(bH(Zz(n,f),""))||(s.host=r.host,s.path=Zz(r.path),s.shortenPath()),c=yq;continue}}break;case pq:if("/"===o||"\\"===o){c=dq;break}r&&"file"===r.scheme&&!XH(bH(Zz(n,f),""))&&(KH(r.path[0],!0)?AH(s.path,r.path[0]):s.host=r.host),c=yq;continue;case dq:if(o===Dz||"/"===o||"\\"===o||"?"===o||"#"===o){if(!e&&KH(h))c=yq;else if(""===h){if(s.host="",e)return;c=vq}else{if(a=s.parseHost(h))return a;if("localhost"===s.host&&(s.host=""),e)return;h="",c=vq}continue}h+=o;break;case vq:if(s.isSpecial()){if(c=yq,"/"!==o&&"\\"!==o)continue}else if(e||"?"!==o)if(e||"#"!==o){if(o!==Dz&&(c=yq,"/"!==o))continue}else s.fragment="",c=mq;else s.query="",c=bq;break;case yq:if(o===Dz||"/"===o||"\\"===o&&s.isSpecial()||!e&&("?"===o||"#"===o)){if(".."===(u=TH(u=h))||"%2e."===u||".%2e"===u||"%2e%2e"===u?(s.shortenPath(),"/"===o||"\\"===o&&s.isSpecial()||AH(s.path,"")):QH(h)?"/"===o||"\\"===o&&s.isSpecial()||AH(s.path,""):("file"===s.scheme&&!s.path.length&&KH(h)&&(s.host&&(s.host=""),h=yH(h,0)+":"),AH(s.path,h)),h="","file"===s.scheme&&(o===Dz||"?"===o||"#"===o))for(;s.path.length>1&&""===s.path[0];)xH(s.path);"?"===o?(s.query="",c=bq):"#"===o&&(s.fragment="",c=mq)}else h+=YH(o,GH);break;case gq:"?"===o?(s.query="",c=bq):"#"===o?(s.fragment="",c=mq):o!==Dz&&(s.path[0]+=YH(o,WH));break;case bq:e||"#"!==o?o!==Dz&&("'"===o&&s.isSpecial()?s.query+="%27":s.query+="#"===o?"%23":YH(o,WH)):(s.fragment="",c=mq);break;case mq:o!==Dz&&(s.fragment+=YH(o,$H))}f++}},parseHost:function(t){var e,r,n;if("["===yH(t,0)){if("]"!==yH(t,t.length-1))return PH;if(e=function(t){var e,r,n,o,i,a,u,s=[0,0,0,0,0,0,0,0],c=0,f=null,h=0,l=function(){return yH(t,h)};if(":"===l()){if(":"!==yH(t,1))return;h+=2,f=++c}for(;l();){if(8===c)return;if(":"!==l()){for(e=r=0;r<4&&gH(BH,l());)e=16*e+pH(l(),16),h++,r++;if("."===l()){if(0===r)return;if(h-=r,c>6)return;for(n=0;l();){if(o=null,n>0){if(!("."===l()&&n<4))return;h++}if(!gH(UH,l()))return;for(;gH(UH,l());){if(i=pH(l(),10),null===o)o=i;else{if(0===o)return;o=10*o+i}if(o>255)return;h++}s[c]=256*s[c]+o,2!=++n&&4!==n||c++}if(4!==n)return;break}if(":"===l()){if(h++,!l())return}else if(l())return;s[c++]=e}else{if(null!==f)return;h++,f=++c}}if(null!==f)for(a=c-f,c=7;0!==c&&a>0;)u=s[c],s[c--]=s[f+a-1],s[f+--a]=u;else if(8!==c)return;return s}(OH(t,1,-1)),!e)return PH;this.host=e}else if(this.isSpecial()){if(t=eH(t),gH(FH,t))return PH;if(e=function(t){var e,r,n,o,i,a,u,s=EH(t,".");if(s.length&&""===s[s.length-1]&&s.length--,(e=s.length)>4)return t;for(r=[],n=0;n1&&"0"===yH(o,0)&&(i=gH(CH,o)?16:8,o=OH(o,8===i?1:2)),""===o)a=0;else{if(!gH(10===i?MH:8===i?_H:BH,o))return t;a=pH(o,i)}AH(r,a)}for(n=0;n=vH(256,5-e))return null}else if(a>255)return null;for(u=wH(r),n=0;n1?arguments[1]:void 0,n=uH(e,new wq(t,!1,r));Hz||(e.href=n.serialize(),e.origin=n.getOrigin(),e.protocol=n.getProtocol(),e.username=n.getUsername(),e.password=n.getPassword(),e.host=n.getHost(),e.hostname=n.getHostname(),e.port=n.getPort(),e.pathname=n.getPathname(),e.search=n.getSearch(),e.searchParams=n.getSearchParams(),e.hash=n.getHash())},Sq=Aq.prototype,xq=function(t,e){return{get:function(){return sH(this)[t]()},set:e&&function(t){return sH(this)[e](t)},configurable:!0,enumerable:!0}};if(Hz&&(Yz(Sq,"href",xq("serialize","setHref")),Yz(Sq,"origin",xq("getOrigin")),Yz(Sq,"protocol",xq("getProtocol","setProtocol")),Yz(Sq,"username",xq("getUsername","setUsername")),Yz(Sq,"password",xq("getPassword","setPassword")),Yz(Sq,"host",xq("getHost","setHost")),Yz(Sq,"hostname",xq("getHostname","setHostname")),Yz(Sq,"port",xq("getPort","setPort")),Yz(Sq,"pathname",xq("getPathname","setPathname")),Yz(Sq,"search",xq("getSearch","setSearch")),Yz(Sq,"searchParams",xq("getSearchParams")),Yz(Sq,"hash",xq("getHash","setHash"))),Vz(Sq,"toJSON",(function(){return sH(this).serialize()}),{enumerable:!0}),Vz(Sq,"toString",(function(){return sH(this).serialize()}),{enumerable:!0}),hH){var Eq=hH.createObjectURL,Oq=hH.revokeObjectURL;Eq&&Vz(Aq,"createObjectURL",$z(Eq,hH)),Oq&&Vz(Aq,"revokeObjectURL",$z(Oq,hH))}nH(Aq,"URL"),zz({global:!0,constructor:!0,forced:!qz,sham:!Hz},{URL:Aq});var Tq=_;Ro({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return Tq(URL.prototype.toString,this)}});var Rq=xn,Iq=V,Pq=No,jq=sp,kq=URLSearchParams,Lq=kq.prototype,Uq=Iq(Lq.append),Cq=Iq(Lq.delete),_q=Iq(Lq.forEach),Mq=Iq([].push),Bq=new kq("a=1&a=2&b=3");Bq.delete("a",1),Bq.delete("b",void 0),Bq+""!="a=2"&&Rq(Lq,"delete",(function(t){var e=arguments.length,r=e<2?void 0:arguments[1];if(e&&void 0===r)return Cq(this,t);var n=[];_q(this,(function(t,e){Mq(n,{key:e,value:t})})),jq(e,1);for(var o,i=Pq(t),a=Pq(r),u=0,s=0,c=!1,f=n.length;ur.length&&"/"!==n[n.length-1]))return n+t.slice(r.length);u("W2",r,n)}}function u(e,r,n){console.warn(t(e,[n,r].join(", ")))}function s(t,e,r){for(var n=t.scopes,o=r&&i(r,n);o;){var u=a(e,n[o]);if(u)return u;o=i(o.slice(0,o.lastIndexOf("/")),n)}return a(e,t.imports)||-1!==e.indexOf(":")&&e}function c(){this[O]={}}function f(e,r,n,o){var i=e[O][r];if(i)return i;var a=[],u=Object.create(null);E&&Object.defineProperty(u,E,{value:"Module"});var s=Promise.resolve().then((function(){return e.instantiate(r,n,o)})).then((function(n){if(!n)throw Error(t(2,r));var o=n[1]((function(t,e){i.h=!0;var r=!1;if("string"==typeof t)t in u&&u[t]===e||(u[t]=e,r=!0);else{for(var n in t)e=t[n],n in u&&u[n]===e||(u[n]=e,r=!0);t&&t.__esModule&&(u.__esModule=t.__esModule)}if(r)for(var o=0;o-1){var r=document.createEvent("Event");r.initEvent("error",!1,!1),e.dispatchEvent(r)}return Promise.reject(t)}))}else if("systemjs-importmap"===e.type){e.sp=!0;var n=e.src?(System.fetch||fetch)(e.src,{integrity:e.integrity,passThrough:!0}).then((function(t){if(!t.ok)throw Error(t.status);return t.text()})).catch((function(r){return r.message=t("W4",e.src)+"\n"+r.message,console.warn(r),"function"==typeof e.onerror&&e.onerror(),"{}"})):e.innerHTML;k=k.then((function(){return n})).then((function(r){!function(e,r,n){var i={};try{i=JSON.parse(r)}catch(a){console.warn(Error(t("W5")))}o(i,n,e)}(L,r,e.src||v)}))}}))}var v,y="undefined"!=typeof Symbol,g="undefined"!=typeof self,b="undefined"!=typeof document,m=g?self:T;if(b){var w=document.querySelector("base[href]");w&&(v=w.href)}if(!v&&"undefined"!=typeof location){var A=(v=location.href.split("#")[0].split("?")[0]).lastIndexOf("/");-1!==A&&(v=v.slice(0,A+1))}var S,x=/\\/g,E=y&&Symbol.toStringTag,O=y?Symbol():"@",R=c.prototype;R.import=function(t,e,r){var n=this;return e&&"object"==typeof e&&(r=e,e=void 0),Promise.resolve(n.prepareImport()).then((function(){return n.resolve(t,e,r)})).then((function(t){var e=f(n,t,void 0,r);return e.C||l(n,e)}))},R.createContext=function(t){var e=this;return{url:t,resolve:function(r,n){return Promise.resolve(e.resolve(r,n||t))}}},R.register=function(t,e,r){S=[t,e,r]},R.getRegister=function(){var t=S;return S=void 0,t};var I=Object.freeze(Object.create(null));m.System=new c;var P,j,k=Promise.resolve(),L={imports:{},scopes:{},depcache:{},integrity:{}},U=b;if(R.prepareImport=function(t){return(U||t)&&(d(),U=!1),k},b&&(d(),window.addEventListener("DOMContentLoaded",d)),R.addImportMap=function(t,e){o(t,e||v,L)},b){window.addEventListener("error",(function(t){_=t.filename,M=t.error}));var C=location.origin}R.createScript=function(t){var e=document.createElement("script");e.async=!0,t.indexOf(C+"/")&&(e.crossOrigin="anonymous");var r=L.integrity[t];return r&&(e.integrity=r),e.src=t,e};var _,M,B={},F=R.register;R.register=function(t,e){if(b&&"loading"===document.readyState&&"string"!=typeof t){var r=document.querySelectorAll("script[src]"),n=r[r.length-1];if(n){P=t;var o=this;j=setTimeout((function(){B[n.src]=[t,e],o.import(n.src)}))}}else P=void 0;return F.call(this,t,e)},R.instantiate=function(e,r){var n=B[e];if(n)return delete B[e],n;var o=this;return Promise.resolve(R.createScript(e)).then((function(n){return new Promise((function(i,a){n.addEventListener("error",(function(){a(Error(t(3,[e,r].join(", "))))})),n.addEventListener("load",(function(){if(document.head.removeChild(n),_===e)a(M);else{var t=o.getRegister(e);t&&t[0]===P&&clearTimeout(j),i(t)}})),document.head.appendChild(n)}))}))},R.shouldFetch=function(){return!1},"undefined"!=typeof fetch&&(R.fetch=fetch);var N=R.instantiate,D=/^(text|application)\/(x-)?javascript(;|$)/;R.instantiate=function(e,r,n){var o=this;return this.shouldFetch(e,r,n)?this.fetch(e,{credentials:"same-origin",integrity:L.integrity[e],meta:n}).then((function(n){if(!n.ok)throw Error(t(7,[n.status,n.statusText,e,r].join(", ")));var i=n.headers.get("content-type");if(!i||!D.test(i))throw Error(t(4,i));return n.text().then((function(t){return t.indexOf("//# sourceURL=")<0&&(t+="\n//# sourceURL="+e),(0,eval)(t),o.getRegister(e)}))})):N.apply(this,arguments)},R.resolve=function(r,n){return s(L,e(r,n=n||v)||r,n)||function(e,r){throw Error(t(8,[e,r].join(", ")))}(r,n)};var z=R.instantiate;R.instantiate=function(t,e,r){var n=L.depcache[t];if(n)for(var o=0;o0&&v[0]<4?1:+(v[0]+v[1])),!d&&Y&&(!(v=Y.match(/Edge\/(\d+)/))||v[1]>=74)&&(v=Y.match(/Chrome\/(\d+)/))&&(d=+v[1]);var Z=d,tt=Z,et=i,rt=r.String,nt=!!Object.getOwnPropertySymbols&&!et((function(){var t=Symbol("symbol detection");return!rt(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&tt&&tt<41})),it=nt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,ot=W,at=D,ut=$,ct=Object,st=it?function(t){return"symbol"==typeof t}:function(t){var e=ot("Symbol");return at(e)&&ut(e.prototype,ct(t))},ft=String,ht=function(t){try{return ft(t)}catch(e){return"Object"}},lt=D,pt=ht,vt=TypeError,dt=function(t){if(lt(t))return t;throw new vt(pt(t)+" is not a function")},gt=dt,yt=j,mt=function(t,e){var r=t[e];return yt(r)?void 0:gt(r)},wt=s,bt=D,St=z,xt=TypeError,Et={exports:{}},At=r,Ot=Object.defineProperty,Rt=function(t,e){try{Ot(At,t,{value:e,configurable:!0,writable:!0})}catch(r){At[t]=e}return e},Tt=r,It=Rt,Pt="__core-js_shared__",kt=Et.exports=Tt[Pt]||It(Pt,{});(kt.versions||(kt.versions=[])).push({version:"3.36.1",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.36.1/LICENSE",source:"https://github.com/zloirock/core-js"});var jt=Et.exports,Lt=jt,Ut=function(t,e){return Lt[t]||(Lt[t]=e||{})},Ct=C,Mt=Object,Ft=function(t){return Mt(Ct(t))},Bt=Ft,_t=S({}.hasOwnProperty),Dt=Object.hasOwn||function(t,e){return _t(Bt(t),e)},Nt=S,zt=0,qt=Math.random(),Ht=Nt(1..toString),Wt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+Ht(++zt+qt,36)},$t=Ut,Gt=Dt,Vt=Wt,Yt=nt,Jt=it,Kt=r.Symbol,Xt=$t("wks"),Qt=Jt?Kt.for||Kt:Kt&&Kt.withoutSetter||Vt,Zt=function(t){return Gt(Xt,t)||(Xt[t]=Yt&&Gt(Kt,t)?Kt[t]:Qt("Symbol."+t)),Xt[t]},te=s,ee=z,re=st,ne=mt,ie=function(t,e){var r,n;if("string"===e&&bt(r=t.toString)&&!St(n=wt(r,t)))return n;if(bt(r=t.valueOf)&&!St(n=wt(r,t)))return n;if("string"!==e&&bt(r=t.toString)&&!St(n=wt(r,t)))return n;throw new xt("Can't convert object to primitive value")},oe=TypeError,ae=Zt("toPrimitive"),ue=function(t,e){if(!ee(t)||re(t))return t;var r,n=ne(t,ae);if(n){if(void 0===e&&(e="default"),r=te(n,t,e),!ee(r)||re(r))return r;throw new oe("Can't convert object to primitive value")}return void 0===e&&(e="number"),ie(t,e)},ce=ue,se=st,fe=function(t){var e=ce(t,"string");return se(e)?e:e+""},he=z,le=r.document,pe=he(le)&&he(le.createElement),ve=function(t){return pe?le.createElement(t):{}},de=ve,ge=!o&&!i((function(){return 7!==Object.defineProperty(de("div"),"a",{get:function(){return 7}}).a})),ye=o,me=s,we=f,be=g,Se=B,xe=fe,Ee=Dt,Ae=ge,Oe=Object.getOwnPropertyDescriptor;n.f=ye?Oe:function(t,e){if(t=Se(t),e=xe(e),Ae)try{return Oe(t,e)}catch(r){}if(Ee(t,e))return be(!me(we.f,t,e),t[e])};var Re={},Te=o&&i((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Ie=z,Pe=String,ke=TypeError,je=function(t){if(Ie(t))return t;throw new ke(Pe(t)+" is not an object")},Le=o,Ue=ge,Ce=Te,Me=je,Fe=fe,Be=TypeError,_e=Object.defineProperty,De=Object.getOwnPropertyDescriptor,Ne="enumerable",ze="configurable",qe="writable";Re.f=Le?Ce?function(t,e,r){if(Me(t),e=Fe(e),Me(r),"function"==typeof t&&"prototype"===e&&"value"in r&&qe in r&&!r[qe]){var n=De(t,e);n&&n[qe]&&(t[e]=r.value,r={configurable:ze in r?r[ze]:n[ze],enumerable:Ne in r?r[Ne]:n[Ne],writable:!1})}return _e(t,e,r)}:_e:function(t,e,r){if(Me(t),e=Fe(e),Me(r),Ue)try{return _e(t,e,r)}catch(n){}if("get"in r||"set"in r)throw new Be("Accessors not supported");return"value"in r&&(t[e]=r.value),t};var He=Re,We=g,$e=o?function(t,e,r){return He.f(t,e,We(1,r))}:function(t,e,r){return t[e]=r,t},Ge={exports:{}},Ve=o,Ye=Dt,Je=Function.prototype,Ke=Ve&&Object.getOwnPropertyDescriptor,Xe=Ye(Je,"name"),Qe={EXISTS:Xe,PROPER:Xe&&"something"===function(){}.name,CONFIGURABLE:Xe&&(!Ve||Ve&&Ke(Je,"name").configurable)},Ze=D,tr=jt,er=S(Function.toString);Ze(tr.inspectSource)||(tr.inspectSource=function(t){return er(t)});var rr,nr,ir,or=tr.inspectSource,ar=D,ur=r.WeakMap,cr=ar(ur)&&/native code/.test(String(ur)),sr=Wt,fr=Ut("keys"),hr=function(t){return fr[t]||(fr[t]=sr(t))},lr={},pr=cr,vr=r,dr=z,gr=$e,yr=Dt,mr=jt,wr=hr,br=lr,Sr="Object already initialized",xr=vr.TypeError,Er=vr.WeakMap;if(pr||mr.state){var Ar=mr.state||(mr.state=new Er);Ar.get=Ar.get,Ar.has=Ar.has,Ar.set=Ar.set,rr=function(t,e){if(Ar.has(t))throw new xr(Sr);return e.facade=t,Ar.set(t,e),e},nr=function(t){return Ar.get(t)||{}},ir=function(t){return Ar.has(t)}}else{var Or=wr("state");br[Or]=!0,rr=function(t,e){if(yr(t,Or))throw new xr(Sr);return e.facade=t,gr(t,Or,e),e},nr=function(t){return yr(t,Or)?t[Or]:{}},ir=function(t){return yr(t,Or)}}var Rr={set:rr,get:nr,has:ir,enforce:function(t){return ir(t)?nr(t):rr(t,{})},getterFor:function(t){return function(e){var r;if(!dr(e)||(r=nr(e)).type!==t)throw new xr("Incompatible receiver, "+t+" required");return r}}},Tr=S,Ir=i,Pr=D,kr=Dt,jr=o,Lr=Qe.CONFIGURABLE,Ur=or,Cr=Rr.enforce,Mr=Rr.get,Fr=String,Br=Object.defineProperty,_r=Tr("".slice),Dr=Tr("".replace),Nr=Tr([].join),zr=jr&&!Ir((function(){return 8!==Br((function(){}),"length",{value:8}).length})),qr=String(String).split("String"),Hr=Ge.exports=function(t,e,r){"Symbol("===_r(Fr(e),0,7)&&(e="["+Dr(Fr(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!kr(t,"name")||Lr&&t.name!==e)&&(jr?Br(t,"name",{value:e,configurable:!0}):t.name=e),zr&&r&&kr(r,"arity")&&t.length!==r.arity&&Br(t,"length",{value:r.arity});try{r&&kr(r,"constructor")&&r.constructor?jr&&Br(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(i){}var n=Cr(t);return kr(n,"source")||(n.source=Nr(qr,"string"==typeof e?e:"")),t};Function.prototype.toString=Hr((function(){return Pr(this)&&Mr(this).source||Ur(this)}),"toString");var Wr=Ge.exports,$r=D,Gr=Re,Vr=Wr,Yr=Rt,Jr=function(t,e,r,n){n||(n={});var i=n.enumerable,o=void 0!==n.name?n.name:e;if($r(r)&&Vr(r,o,n),n.global)i?t[e]=r:Yr(e,r);else{try{n.unsafe?t[e]&&(i=!0):delete t[e]}catch(a){}i?t[e]=r:Gr.f(t,e,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t},Kr={},Xr=Math.ceil,Qr=Math.floor,Zr=Math.trunc||function(t){var e=+t;return(e>0?Qr:Xr)(e)},tn=function(t){var e=+t;return e!=e||0===e?0:Zr(e)},en=tn,rn=Math.max,nn=Math.min,on=function(t,e){var r=en(t);return r<0?rn(r+e,0):nn(r,e)},an=tn,un=Math.min,cn=function(t){var e=an(t);return e>0?un(e,9007199254740991):0},sn=cn,fn=function(t){return sn(t.length)},hn=B,ln=on,pn=fn,vn=function(t){return function(e,r,n){var i=hn(e),o=pn(i);if(0===o)return!t&&-1;var a,u=ln(n,o);if(t&&r!=r){for(;o>u;)if((a=i[u++])!=a)return!0}else for(;o>u;u++)if((t||u in i)&&i[u]===r)return t||u||0;return!t&&-1}},dn={includes:vn(!0),indexOf:vn(!1)},gn=Dt,yn=B,mn=dn.indexOf,wn=lr,bn=S([].push),Sn=function(t,e){var r,n=yn(t),i=0,o=[];for(r in n)!gn(wn,r)&&gn(n,r)&&bn(o,r);for(;e.length>i;)gn(n,r=e[i++])&&(~mn(o,r)||bn(o,r));return o},xn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],En=Sn,An=xn.concat("length","prototype");Kr.f=Object.getOwnPropertyNames||function(t){return En(t,An)};var On={};On.f=Object.getOwnPropertySymbols;var Rn=W,Tn=Kr,In=On,Pn=je,kn=S([].concat),jn=Rn("Reflect","ownKeys")||function(t){var e=Tn.f(Pn(t)),r=In.f;return r?kn(e,r(t)):e},Ln=Dt,Un=jn,Cn=n,Mn=Re,Fn=function(t,e,r){for(var n=Un(e),i=Mn.f,o=Cn.f,a=0;ao&&Co(i,arguments[o]),i}));h.prototype=s,"Error"!==u?Po?Po(h,f):ko(h,f,{name:!0}):Fo&&i in c&&(jo(h,c,i),jo(h,c,"prepareStackTrace")),ko(h,c);try{s.name!==u&&To(s,"name",u),s.constructor=h}catch(l){}return h}},No="WebAssembly",zo=r[No],qo=7!==new Error("e",{cause:7}).cause,Ho=function(t,e){var r={};r[t]=Do(t,e,qo),Bo({global:!0,constructor:!0,arity:1,forced:qo},r)},Wo=function(t,e){if(zo&&zo[t]){var r={};r[t]=Do(No+"."+t,e,qo),Bo({target:No,stat:!0,constructor:!0,arity:1,forced:qo},r)}};Ho("Error",(function(t){return function(e){return _o(t,this,arguments)}})),Ho("EvalError",(function(t){return function(e){return _o(t,this,arguments)}})),Ho("RangeError",(function(t){return function(e){return _o(t,this,arguments)}})),Ho("ReferenceError",(function(t){return function(e){return _o(t,this,arguments)}})),Ho("SyntaxError",(function(t){return function(e){return _o(t,this,arguments)}})),Ho("TypeError",(function(t){return function(e){return _o(t,this,arguments)}})),Ho("URIError",(function(t){return function(e){return _o(t,this,arguments)}})),Wo("CompileError",(function(t){return function(e){return _o(t,this,arguments)}})),Wo("LinkError",(function(t){return function(e){return _o(t,this,arguments)}})),Wo("RuntimeError",(function(t){return function(e){return _o(t,this,arguments)}}));var $o={},Go=Sn,Vo=xn,Yo=Object.keys||function(t){return Go(t,Vo)},Jo=o,Ko=Te,Xo=Re,Qo=je,Zo=B,ta=Yo;$o.f=Jo&&!Ko?Object.defineProperties:function(t,e){Qo(t);for(var r,n=Zo(e),i=ta(e),o=i.length,a=0;o>a;)Xo.f(t,r=i[a++],n[r]);return t};var ea,ra=W("document","documentElement"),na=je,ia=$o,oa=xn,aa=lr,ua=ra,ca=ve,sa="prototype",fa="script",ha=hr("IE_PROTO"),la=function(){},pa=function(t){return"<"+fa+">"+t+""},va=function(t){t.write(pa("")),t.close();var e=t.parentWindow.Object;return t=null,e},da=function(){try{ea=new ActiveXObject("htmlfile")}catch(i){}var t,e,r;da="undefined"!=typeof document?document.domain&&ea?va(ea):(e=ca("iframe"),r="java"+fa+":",e.style.display="none",ua.appendChild(e),e.src=String(r),(t=e.contentWindow.document).open(),t.write(pa("document.F=Object")),t.close(),t.F):va(ea);for(var n=oa.length;n--;)delete da[sa][oa[n]];return da()};aa[ha]=!0;var ga=Object.create||function(t,e){var r;return null!==t?(la[sa]=na(t),r=new la,la[sa]=null,r[ha]=t):r=da(),void 0===e?r:ia.f(r,e)},ya=Zt,ma=ga,wa=Re.f,ba=ya("unscopables"),Sa=Array.prototype;void 0===Sa[ba]&&wa(Sa,ba,{configurable:!0,value:ma(null)});var xa,Ea,Aa,Oa=function(t){Sa[ba][t]=!0},Ra={},Ta=!i((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),Ia=Dt,Pa=D,ka=Ft,ja=Ta,La=hr("IE_PROTO"),Ua=Object,Ca=Ua.prototype,Ma=ja?Ua.getPrototypeOf:function(t){var e=ka(t);if(Ia(e,La))return e[La];var r=e.constructor;return Pa(r)&&e instanceof r?r.prototype:e instanceof Ua?Ca:null},Fa=i,Ba=D,_a=z,Da=Ma,Na=Jr,za=Zt("iterator"),qa=!1;[].keys&&("next"in(Aa=[].keys())?(Ea=Da(Da(Aa)))!==Object.prototype&&(xa=Ea):qa=!0);var Ha=!_a(xa)||Fa((function(){var t={};return xa[za].call(t)!==t}));Ha&&(xa={}),Ba(xa[za])||Na(xa,za,(function(){return this}));var Wa={IteratorPrototype:xa,BUGGY_SAFARI_ITERATORS:qa},$a=Re.f,Ga=Dt,Va=Zt("toStringTag"),Ya=function(t,e,r){t&&!r&&(t=t.prototype),t&&!Ga(t,Va)&&$a(t,Va,{configurable:!0,value:e})},Ja=Wa.IteratorPrototype,Ka=ga,Xa=g,Qa=Ya,Za=Ra,tu=function(){return this},eu=function(t,e,r,n){var i=e+" Iterator";return t.prototype=Ka(Ja,{next:Xa(+!n,r)}),Qa(t,i,!1),Za[i]=tu,t},ru=Zn,nu=s,iu=D,ou=eu,au=Ma,uu=no,cu=Ya,su=$e,fu=Jr,hu=Ra,lu=Qe.PROPER,pu=Qe.CONFIGURABLE,vu=Wa.IteratorPrototype,du=Wa.BUGGY_SAFARI_ITERATORS,gu=Zt("iterator"),yu="keys",mu="values",wu="entries",bu=function(){return this},Su=function(t,e,r,n,i,o,a){ou(r,e,n);var u,c,s,f=function(t){if(t===i&&d)return d;if(!du&&t&&t in p)return p[t];switch(t){case yu:case mu:case wu:return function(){return new r(this,t)}}return function(){return new r(this)}},h=e+" Iterator",l=!1,p=t.prototype,v=p[gu]||p["@@iterator"]||i&&p[i],d=!du&&v||f(i),g="Array"===e&&p.entries||v;if(g&&(u=au(g.call(new t)))!==Object.prototype&&u.next&&(au(u)!==vu&&(uu?uu(u,vu):iu(u[gu])||fu(u,gu,bu)),cu(u,h,!0)),lu&&i===mu&&v&&v.name!==mu&&(pu?su(p,"name",mu):(l=!0,d=function(){return nu(v,this)})),i)if(c={values:f(mu),keys:o?d:f(yu),entries:f(wu)},a)for(s in c)(du||l||!(s in p))&&fu(p,s,c[s]);else ru({target:e,proto:!0,forced:du||l},c);return p[gu]!==d&&fu(p,gu,d,{name:i}),hu[e]=d,c},xu=function(t,e){return{value:t,done:e}},Eu=B,Au=Oa,Ou=Ra,Ru=Rr,Tu=Re.f,Iu=Su,Pu=xu,ku=o,ju="Array Iterator",Lu=Ru.set,Uu=Ru.getterFor(ju),Cu=Iu(Array,"Array",(function(t,e){Lu(this,{type:ju,target:Eu(t),index:0,kind:e})}),(function(){var t=Uu(this),e=t.target,r=t.index++;if(!e||r>=e.length)return t.target=void 0,Pu(void 0,!0);switch(t.kind){case"keys":return Pu(r,!1);case"values":return Pu(e[r],!1)}return Pu([r,e[r]],!1)}),"values"),Mu=Ou.Arguments=Ou.Array;if(Au("keys"),Au("values"),Au("entries"),ku&&"values"!==Mu.name)try{Tu(Mu,"name",{value:"values"})}catch(o_){}var Fu=O,Bu=Array.isArray||function(t){return"Array"===Fu(t)},_u=o,Du=Bu,Nu=TypeError,zu=Object.getOwnPropertyDescriptor,qu=_u&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(o_){return o_ instanceof TypeError}}()?function(t,e){if(Du(t)&&!zu(t,"length").writable)throw new Nu("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e},Hu=TypeError,Wu=function(t){if(t>9007199254740991)throw Hu("Maximum allowed index exceeded");return t},$u=Ft,Gu=fn,Vu=qu,Yu=Wu;Zn({target:"Array",proto:!0,arity:1,forced:i((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(o_){return o_ instanceof TypeError}}()},{push:function(t){var e=$u(this),r=Gu(e),n=arguments.length;Yu(r+n);for(var i=0;i=51||!lc((function(){var e=[];return(e.constructor={})[vc]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},gc=S([].slice),yc=Zn,mc=Bu,wc=uc,bc=z,Sc=on,xc=fn,Ec=B,Ac=hc,Oc=Zt,Rc=gc,Tc=dc("slice"),Ic=Oc("species"),Pc=Array,kc=Math.max;yc({target:"Array",proto:!0,forced:!Tc},{slice:function(t,e){var r,n,i,o=Ec(this),a=xc(o),u=Sc(t,a),c=Sc(void 0===e?a:e,a);if(mc(o)&&(r=o.constructor,(wc(r)&&(r===Pc||mc(r.prototype))||bc(r)&&null===(r=r[Ic]))&&(r=void 0),r===Pc||void 0===r))return Rc(o,u,c);for(n=new(void 0===r?Pc:r)(kc(c-u,0)),i=0;uo;o++)if((u=y(t[o]))&&il(fl,u))return u;return new sl(!1)}n=ol(t,i)}for(c=l?t.next:n.next;!(s=Zh(c,n)).done;){try{u=y(s.value)}catch(o_){ul(n,"throw",o_)}if("object"==typeof u&&u&&il(fl,u))return u}return new sl(!1)},ll=Zt("iterator"),pl=!1;try{var vl=0,dl={next:function(){return{done:!!vl++}},return:function(){pl=!0}};dl[ll]=function(){return this},Array.from(dl,(function(){throw 2}))}catch(o_){}var gl=function(t,e){try{if(!e&&!pl)return!1}catch(o_){return!1}var r=!1;try{var n={};n[ll]=function(){return{next:function(){return{done:r=!0}}}},t(n)}catch(o_){}return r},yl=vf,ml=kf.CONSTRUCTOR||!gl((function(t){yl.all(t).then(void 0,(function(){}))})),wl=s,bl=dt,Sl=jf,xl=pf,El=hl;Zn({target:"Promise",stat:!0,forced:ml},{all:function(t){var e=this,r=Sl.f(e),n=r.resolve,i=r.reject,o=xl((function(){var r=bl(e.resolve),o=[],a=0,u=1;El(t,(function(t){var c=a++,s=!1;u++,wl(r,e,t).then((function(t){s||(s=!0,o[c]=t,--u||n(o))}),i)})),--u||n(o)}));return o.error&&i(o.value),r.promise}});var Al=Zn,Ol=kf.CONSTRUCTOR,Rl=vf,Tl=W,Il=D,Pl=Jr,kl=Rl&&Rl.prototype;if(Al({target:"Promise",proto:!0,forced:Ol,real:!0},{catch:function(t){return this.then(void 0,t)}}),Il(Rl)){var jl=Tl("Promise").prototype.catch;kl.catch!==jl&&Pl(kl,"catch",jl,{unsafe:!0})}var Ll=s,Ul=dt,Cl=jf,Ml=pf,Fl=hl;Zn({target:"Promise",stat:!0,forced:ml},{race:function(t){var e=this,r=Cl.f(e),n=r.reject,i=Ml((function(){var i=Ul(e.resolve);Fl(t,(function(t){Ll(i,e,t).then(r.resolve,n)}))}));return i.error&&n(i.value),r.promise}});var Bl=jf;Zn({target:"Promise",stat:!0,forced:kf.CONSTRUCTOR},{reject:function(t){var e=Bl.f(this);return(0,e.reject)(t),e.promise}});var _l=je,Dl=z,Nl=jf,zl=function(t,e){if(_l(t),Dl(e)&&e.constructor===t)return e;var r=Nl.f(t);return(0,r.resolve)(e),r.promise},ql=Zn,Hl=kf.CONSTRUCTOR,Wl=zl;W("Promise"),ql({target:"Promise",stat:!0,forced:Hl},{resolve:function(t){return Wl(this,t)}});var $l=Zn,Gl=r,Vl=Hc,Yl=je,Jl=D,Kl=Ma,Xl=pi,Ql=hc,Zl=i,tp=Dt,ep=Wa.IteratorPrototype,rp=o,np="constructor",ip="Iterator",op=Zt("toStringTag"),ap=TypeError,up=Gl[ip],cp=!Jl(up)||up.prototype!==ep||!Zl((function(){up({})})),sp=function(){if(Vl(this,ep),Kl(this)===ep)throw new ap("Abstract class Iterator not directly constructable")},fp=function(t,e){rp?Xl(ep,t,{configurable:!0,get:function(){return e},set:function(e){if(Yl(this),this===ep)throw new ap("You can't redefine this property");tp(this,t)?this[t]=e:Ql(this,t,e)}}):ep[t]=e};tp(ep,op)||fp(op,ip),!cp&&tp(ep,np)&&ep[np]!==Object||fp(np,sp),sp.prototype=ep,$l({global:!0,constructor:!0,forced:cp},{Iterator:sp});var hp=function(t){return{iterator:t,next:t.next,done:!1}},lp=hl,pp=dt,vp=je,dp=hp;Zn({target:"Iterator",proto:!0,real:!0},{forEach:function(t){vp(this),pp(t);var e=dp(this),r=0;lp(e,(function(e){t(e,r++)}),{IS_RECORD:!0})}});var gp={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},yp=ve("span").classList,mp=yp&&yp.constructor&&yp.constructor.prototype,wp=mp===Object.prototype?void 0:mp,bp=Bu,Sp=uc,xp=z,Ep=Zt("species"),Ap=Array,Op=function(t){var e;return bp(t)&&(e=t.constructor,(Sp(e)&&(e===Ap||bp(e.prototype))||xp(e)&&null===(e=e[Ep]))&&(e=void 0)),void 0===e?Ap:e},Rp=function(t,e){return new(Op(t))(0===e?0:e)},Tp=os,Ip=k,Pp=Ft,kp=fn,jp=Rp,Lp=S([].push),Up=function(t){var e=1===t,r=2===t,n=3===t,i=4===t,o=6===t,a=7===t,u=5===t||o;return function(c,s,f,h){for(var l,p,v=Pp(c),d=Ip(v),g=kp(d),y=Tp(s,f),m=0,w=h||jp,b=e?w(c,g):r||a?w(c,0):void 0;g>m;m++)if((u||m in d)&&(p=y(l=d[m],m,v),t))if(e)b[m]=p;else if(p)switch(t){case 3:return!0;case 5:return l;case 6:return m;case 2:Lp(b,l)}else switch(t){case 4:return!1;case 7:Lp(b,l)}return o?-1:n||i?i:b}},Cp={forEach:Up(0),map:Up(1),filter:Up(2),some:Up(3),every:Up(4),find:Up(5),findIndex:Up(6),filterReject:Up(7)},Mp=i,Fp=function(t,e){var r=[][t];return!!r&&Mp((function(){r.call(null,e||function(){return 1},1)}))},Bp=Cp.forEach,_p=Fp("forEach")?[].forEach:function(t){return Bp(this,t,arguments.length>1?arguments[1]:void 0)},Dp=r,Np=gp,zp=wp,qp=_p,Hp=$e,Wp=function(t){if(t&&t.forEach!==qp)try{Hp(t,"forEach",qp)}catch(o_){t.forEach=qp}};for(var $p in Np)Np[$p]&&Wp(Dp[$p]&&Dp[$p].prototype);Wp(zp);var Gp=r,Vp=gp,Yp=wp,Jp=Cu,Kp=$e,Xp=Ya,Qp=Zt("iterator"),Zp=Jp.values,tv=function(t,e){if(t){if(t[Qp]!==Zp)try{Kp(t,Qp,Zp)}catch(o_){t[Qp]=Zp}if(Xp(t,e,!0),Vp[e])for(var r in Jp)if(t[r]!==Jp[r])try{Kp(t,r,Jp[r])}catch(o_){t[r]=Jp[r]}}};for(var ev in Vp)tv(Gp[ev]&&Gp[ev].prototype,ev);tv(Yp,"DOMTokenList");var rv=Cp.filter;Zn({target:"Array",proto:!0,forced:!dc("filter")},{filter:function(t){return rv(this,t,arguments.length>1?arguments[1]:void 0)}});var nv=Zn,iv=dn.indexOf,ov=Fp,av=es([].indexOf),uv=!!av&&1/av([1],1,-0)<0;nv({target:"Array",proto:!0,forced:uv||!ov("indexOf")},{indexOf:function(t){var e=arguments.length>1?arguments[1]:void 0;return uv?av(this,t,e)||0:iv(this,t,e)}});var cv=Cp.map;Zn({target:"Array",proto:!0,forced:!dc("map")},{map:function(t){return cv(this,t,arguments.length>1?arguments[1]:void 0)}});var sv=ht,fv=TypeError,hv=function(t,e){if(!delete t[e])throw new fv("Cannot delete property "+sv(e)+" of "+sv(t))},lv=Zn,pv=Ft,vv=on,dv=tn,gv=fn,yv=qu,mv=Wu,wv=Rp,bv=hc,Sv=hv,xv=dc("splice"),Ev=Math.max,Av=Math.min;lv({target:"Array",proto:!0,forced:!xv},{splice:function(t,e){var r,n,i,o,a,u,c=pv(this),s=gv(c),f=vv(t,s),h=arguments.length;for(0===h?r=n=0:1===h?(r=0,n=s-f):(r=h-2,n=Av(Ev(dv(e),0),s-f)),mv(s+r-n),i=wv(c,n),o=0;os-n+r;o--)Sv(c,o-1)}else if(r>n)for(o=s-n;o>f;o--)u=o+r-1,(a=o+n-1)in c?c[u]=c[a]:Sv(c,u);for(o=0;o92||Yv&&$v>94||Gv&&$v>97)return!1;var t=new ArrayBuffer(8),e=Jv(t,{transfer:[t]});return 0!==t.byteLength||8!==e.byteLength})),Xv=r,Qv=function(t){try{if(Hv)return Function('return require("'+t+'")')()}catch(o_){}},Zv=Kv,td=Xv.structuredClone,ed=Xv.ArrayBuffer,rd=Xv.MessageChannel,nd=!1;if(Zv)nd=function(t){td(t,{transfer:[t]})};else if(ed)try{rd||(Mv=Qv("worker_threads"))&&(rd=Mv.MessageChannel),rd&&(Fv=new rd,Bv=new ed(2),_v=function(t){Fv.port1.postMessage(null,[t])},2===Bv.byteLength&&(_v(Bv),0===Bv.byteLength&&(nd=_v)))}catch(o_){}var id=r,od=S,ad=Yi,ud=qv,cd=kv,sd=Tv,fd=nd,hd=Kv,ld=id.structuredClone,pd=id.ArrayBuffer,vd=id.DataView,dd=id.TypeError,gd=Math.min,yd=pd.prototype,md=vd.prototype,wd=od(yd.slice),bd=ad(yd,"resizable","get"),Sd=ad(yd,"maxByteLength","get"),xd=od(md.getInt8),Ed=od(md.setInt8),Ad=(hd||fd)&&function(t,e,r){var n,i=sd(t),o=void 0===e?i:ud(e),a=!bd||!bd(t);if(cd(t))throw new dd("ArrayBuffer is detached");if(hd&&(t=ld(t,{transfer:[t]}),i===o&&(r||a)))return t;if(i>=o&&(!r||a))n=wd(t,0,o);else{var u=r&&!a&&Sd?{maxByteLength:Sd(t)}:void 0;n=new pd(o,u);for(var c=new vd(t),s=new vd(n),f=gd(o,i),h=0;h1?arguments[1]:void 0);e=e?e.next:r.first;)for(n(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!c(this,t)}}),Ag(o,r?{get:function(t){var e=c(this,t);return e&&e.value},set:function(t,e){return u(this,0===t?0:t,e)}}:{add:function(t){return u(this,t=0===t?0:t,t)}}),Lg&&Eg(o,"size",{configurable:!0,get:function(){return a(this).size}}),i},setStrong:function(t,e,r){var n=e+" Iterator",i=Mg(e),o=Mg(n);Pg(t,e,(function(t,e){Cg(this,{type:n,target:t,state:i(t),kind:e,last:void 0})}),(function(){for(var t=o(this),e=t.kind,r=t.last;r&&r.removed;)r=r.previous;return t.target&&(t.last=r=r?r.next:t.state.first)?kg("keys"===e?r.key:"values"===e?r.value:[r.key,r.value],!1):(t.target=void 0,kg(void 0,!0))}),r?"entries":"values",!r,!0),jg(e)}};wg("Map",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),Fg);var Bg=Zn,_g=Math.hypot,Dg=Math.abs,Ng=Math.sqrt;Bg({target:"Math",stat:!0,arity:2,forced:!!_g&&_g(1/0,NaN)!==1/0},{hypot:function(t,e){for(var r,n,i=0,o=0,a=arguments.length,u=0;o0?(n=r/u)*n:r;return u===1/0?1/0:u*Ng(i)}});var zg=jn,qg=B,Hg=n,Wg=hc;Zn({target:"Object",stat:!0,sham:!o},{getOwnPropertyDescriptors:function(t){for(var e,r,n=qg(t),i=Hg.f,o=zg(n),a={},u=0;o.length>u;)void 0!==(r=i(n,e=o[u++]))&&Wg(a,e,r);return a}});var $g=je,Gg=function(){var t=$g(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.unicodeSets&&(e+="v"),t.sticky&&(e+="y"),e},Vg=i,Yg=r.RegExp,Jg=Vg((function(){var t=Yg("a","y");return t.lastIndex=2,null!==t.exec("abcd")})),Kg=Jg||Vg((function(){return!Yg("a","y").sticky})),Xg=Jg||Vg((function(){var t=Yg("^r","gy");return t.lastIndex=2,null!==t.exec("str")})),Qg={BROKEN_CARET:Xg,MISSED_STICKY:Kg,UNSUPPORTED_Y:Jg},Zg=i,ty=r.RegExp,ey=Zg((function(){var t=ty(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)})),ry=i,ny=r.RegExp,iy=ry((function(){var t=ny("(?b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$c")})),oy=s,ay=S,uy=fi,cy=Gg,sy=Qg,fy=ga,hy=Rr.get,ly=ey,py=iy,vy=Ut("native-string-replace",String.prototype.replace),dy=RegExp.prototype.exec,gy=dy,yy=ay("".charAt),my=ay("".indexOf),wy=ay("".replace),by=ay("".slice),Sy=function(){var t=/a/,e=/b*/g;return oy(dy,t,"a"),oy(dy,e,"a"),0!==t.lastIndex||0!==e.lastIndex}(),xy=sy.BROKEN_CARET,Ey=void 0!==/()??/.exec("")[1];(Sy||Ey||xy||ly||py)&&(gy=function(t){var e,r,n,i,o,a,u,c=this,s=hy(c),f=uy(t),h=s.raw;if(h)return h.lastIndex=c.lastIndex,e=oy(gy,h,f),c.lastIndex=h.lastIndex,e;var l=s.groups,p=xy&&c.sticky,v=oy(cy,c),d=c.source,g=0,y=f;if(p&&(v=wy(v,"y",""),-1===my(v,"g")&&(v+="g"),y=by(f,c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==yy(f,c.lastIndex-1))&&(d="(?: "+d+")",y=" "+y,g++),r=new RegExp("^(?:"+d+")",v)),Ey&&(r=new RegExp("^"+d+"$(?!\\s)",v)),Sy&&(n=c.lastIndex),i=oy(dy,p?r:c,y),p?i?(i.input=by(i.input,g),i[0]=by(i[0],g),i.index=c.lastIndex,c.lastIndex+=i[0].length):c.lastIndex=0:Sy&&i&&(c.lastIndex=c.global?i.index+i[0].length:n),Ey&&i&&i.length>1&&oy(vy,i[0],r,(function(){for(o=1;o=u?t?"":void 0:(n=Dy(o,a))<55296||n>56319||a+1===u||(i=Dy(o,a+1))<56320||i>57343?t?_y(o,a):n:t?Ny(o,a,a+2):i-56320+(n-55296<<10)+65536}},qy={codeAt:zy(!1),charAt:zy(!0)},Hy=qy.charAt,Wy=function(t,e,r){return e+(r?Hy(t,e).length:1)},$y=S,Gy=Ft,Vy=Math.floor,Yy=$y("".charAt),Jy=$y("".replace),Ky=$y("".slice),Xy=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Qy=/\$([$&'`]|\d{1,2})/g,Zy=s,tm=je,em=D,rm=O,nm=Ay,im=TypeError,om=function(t,e){var r=t.exec;if(em(r)){var n=Zy(r,t,e);return null!==n&&tm(n),n}if("RegExp"===rm(t))return Zy(nm,t,e);throw new im("RegExp#exec called on incompatible receiver")},am=$i,um=s,cm=S,sm=Uy,fm=i,hm=je,lm=D,pm=j,vm=tn,dm=cn,gm=fi,ym=C,mm=Wy,wm=mt,bm=function(t,e,r,n,i,o){var a=r+t.length,u=n.length,c=Qy;return void 0!==i&&(i=Gy(i),c=Xy),Jy(o,c,(function(o,c){var s;switch(Yy(c,0)){case"$":return"$";case"&":return t;case"`":return Ky(e,0,r);case"'":return Ky(e,a);case"<":s=i[Ky(c,1,-1)];break;default:var f=+c;if(0===f)return o;if(f>u){var h=Vy(f/10);return 0===h?o:h<=u?void 0===n[h-1]?Yy(c,1):n[h-1]+Yy(c,1):o}s=n[f-1]}return void 0===s?"":s}))},Sm=om,xm=Zt("replace"),Em=Math.max,Am=Math.min,Om=cm([].concat),Rm=cm([].push),Tm=cm("".indexOf),Im=cm("".slice),Pm="$0"==="a".replace(/./,"$0"),km=!!/./[xm]&&""===/./[xm]("a","$0"),jm=!fm((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$")}));sm("replace",(function(t,e,r){var n=km?"$":"$0";return[function(t,r){var n=ym(this),i=pm(t)?void 0:wm(t,xm);return i?um(i,t,n,r):um(e,gm(n),t,r)},function(t,i){var o=hm(this),a=gm(t);if("string"==typeof i&&-1===Tm(i,n)&&-1===Tm(i,"$<")){var u=r(e,o,a,i);if(u.done)return u.value}var c=lm(i);c||(i=gm(i));var s,f=o.global;f&&(s=o.unicode,o.lastIndex=0);for(var h,l=[];null!==(h=Sm(o,a))&&(Rm(l,h),f);){""===gm(h[0])&&(o.lastIndex=mm(a,dm(o.lastIndex),s))}for(var p,v="",d=0,g=0;g=d&&(v+=Im(a,d,w)+y,d=w+m.length)}return v+Im(a,d)}]}),!jm||!Pm||km);var Lm,Um,Cm,Mm={exports:{}},Fm="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,Bm=Fm,_m=o,Dm=r,Nm=D,zm=z,qm=Dt,Hm=ui,Wm=ht,$m=$e,Gm=Jr,Vm=pi,Ym=$,Jm=Ma,Km=no,Xm=Zt,Qm=Wt,Zm=Rr.enforce,tw=Rr.get,ew=Dm.Int8Array,rw=ew&&ew.prototype,nw=Dm.Uint8ClampedArray,iw=nw&&nw.prototype,ow=ew&&Jm(ew),aw=rw&&Jm(rw),uw=Object.prototype,cw=Dm.TypeError,sw=Xm("toStringTag"),fw=Qm("TYPED_ARRAY_TAG"),hw="TypedArrayConstructor",lw=Bm&&!!Km&&"Opera"!==Hm(Dm.opera),pw=!1,vw={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},dw={BigInt64Array:8,BigUint64Array:8},gw=function(t){var e=Jm(t);if(zm(e)){var r=tw(e);return r&&qm(r,hw)?r[hw]:gw(e)}},yw=function(t){if(!zm(t))return!1;var e=Hm(t);return qm(vw,e)||qm(dw,e)};for(Lm in vw)(Cm=(Um=Dm[Lm])&&Um.prototype)?Zm(Cm)[hw]=Um:lw=!1;for(Lm in dw)(Cm=(Um=Dm[Lm])&&Um.prototype)&&(Zm(Cm)[hw]=Um);if((!lw||!Nm(ow)||ow===Function.prototype)&&(ow=function(){throw new cw("Incorrect invocation")},lw))for(Lm in vw)Dm[Lm]&&Km(Dm[Lm],ow);if((!lw||!aw||aw===uw)&&(aw=ow.prototype,lw))for(Lm in vw)Dm[Lm]&&Km(Dm[Lm].prototype,aw);if(lw&&Jm(iw)!==aw&&Km(iw,aw),_m&&!qm(aw,sw))for(Lm in pw=!0,Vm(aw,sw,{configurable:!0,get:function(){return zm(this)?this[fw]:void 0}}),vw)Dm[Lm]&&$m(Dm[Lm],fw,Lm);var mw={NATIVE_ARRAY_BUFFER_VIEWS:lw,TYPED_ARRAY_TAG:pw&&fw,aTypedArray:function(t){if(yw(t))return t;throw new cw("Target is not a typed array")},aTypedArrayConstructor:function(t){if(Nm(t)&&(!Km||Ym(ow,t)))return t;throw new cw(Wm(t)+" is not a typed array constructor")},exportTypedArrayMethod:function(t,e,r,n){if(_m){if(r)for(var i in vw){var o=Dm[i];if(o&&qm(o.prototype,t))try{delete o.prototype[t]}catch(o_){try{o.prototype[t]=e}catch(a){}}}aw[t]&&!r||Gm(aw,t,r?e:lw&&rw[t]||e,n)}},exportTypedArrayStaticMethod:function(t,e,r){var n,i;if(_m){if(Km){if(r)for(n in vw)if((i=Dm[n])&&qm(i,t))try{delete i[t]}catch(o_){}if(ow[t]&&!r)return;try{return Gm(ow,t,r?e:lw&&ow[t]||e)}catch(o_){}}for(n in vw)!(i=Dm[n])||i[t]&&!r||Gm(i,t,e)}},getTypedArrayConstructor:gw,isView:function(t){if(!zm(t))return!1;var e=Hm(t);return"DataView"===e||qm(vw,e)||qm(dw,e)},isTypedArray:yw,TypedArray:ow,TypedArrayPrototype:aw},ww=r,bw=i,Sw=gl,xw=mw.NATIVE_ARRAY_BUFFER_VIEWS,Ew=ww.ArrayBuffer,Aw=ww.Int8Array,Ow=!xw||!bw((function(){Aw(1)}))||!bw((function(){new Aw(-1)}))||!Sw((function(t){new Aw,new Aw(null),new Aw(1.5),new Aw(t)}),!0)||bw((function(){return 1!==new Aw(new Ew(2),1,void 0).length})),Rw=Math.sign||function(t){var e=+t;return 0===e||e!=e?e:e<0?-1:1},Tw=Math.abs,Iw=2220446049250313e-31,Pw=1/Iw,kw=function(t,e,r,n){var i=+t,o=Tw(i),a=Rw(i);if(or||c!=c?a*(1/0):a*c},jw=Math.fround||function(t){return kw(t,1.1920928955078125e-7,34028234663852886e22,11754943508222875e-54)},Lw=Array,Uw=Math.abs,Cw=Math.pow,Mw=Math.floor,Fw=Math.log,Bw=Math.LN2,_w={pack:function(t,e,r){var n,i,o,a=Lw(r),u=8*r-e-1,c=(1<>1,f=23===e?Cw(2,-24)-Cw(2,-77):0,h=t<0||0===t&&1/t<0?1:0,l=0;for((t=Uw(t))!=t||t===1/0?(i=t!=t?1:0,n=c):(n=Mw(Fw(t)/Bw),t*(o=Cw(2,-n))<1&&(n--,o*=2),(t+=n+s>=1?f/o:f*Cw(2,1-s))*o>=2&&(n++,o/=2),n+s>=c?(i=0,n=c):n+s>=1?(i=(t*o-1)*Cw(2,e),n+=s):(i=t*Cw(2,s-1)*Cw(2,e),n=0));e>=8;)a[l++]=255&i,i/=256,e-=8;for(n=n<0;)a[l++]=255&n,n/=256,u-=8;return a[--l]|=128*h,a},unpack:function(t,e){var r,n=t.length,i=8*n-e-1,o=(1<>1,u=i-7,c=n-1,s=t[c--],f=127&s;for(s>>=7;u>0;)f=256*f+t[c--],u-=8;for(r=f&(1<<-u)-1,f>>=-u,u+=e;u>0;)r=256*r+t[c--],u-=8;if(0===f)f=1-a;else{if(f===o)return r?NaN:s?-1/0:1/0;r+=Cw(2,e),f-=a}return(s?-1:1)*r*Cw(2,f-e)}},Dw=Ft,Nw=on,zw=fn,qw=function(t){for(var e=Dw(this),r=zw(e),n=arguments.length,i=Nw(n>1?arguments[1]:void 0,r),o=n>2?arguments[2]:void 0,a=void 0===o?r:Nw(o,r);a>i;)e[i++]=t;return e},Hw=r,Ww=S,$w=o,Gw=Fm,Vw=$e,Yw=pi,Jw=Sg,Kw=i,Xw=Hc,Qw=tn,Zw=cn,tb=qv,eb=jw,rb=_w,nb=Ma,ib=no,ob=qw,ab=gc,ub=so,cb=Fn,sb=Ya,fb=Rr,hb=Qe.PROPER,lb=Qe.CONFIGURABLE,pb="ArrayBuffer",vb="DataView",db="prototype",gb="Wrong index",yb=fb.getterFor(pb),mb=fb.getterFor(vb),wb=fb.set,bb=Hw[pb],Sb=bb,xb=Sb&&Sb[db],Eb=Hw[vb],Ab=Eb&&Eb[db],Ob=Object.prototype,Rb=Hw.Array,Tb=Hw.RangeError,Ib=Ww(ob),Pb=Ww([].reverse),kb=rb.pack,jb=rb.unpack,Lb=function(t){return[255&t]},Ub=function(t){return[255&t,t>>8&255]},Cb=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},Mb=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},Fb=function(t){return kb(eb(t),23,4)},Bb=function(t){return kb(t,52,8)},_b=function(t,e,r){Yw(t[db],e,{configurable:!0,get:function(){return r(this)[e]}})},Db=function(t,e,r,n){var i=mb(t),o=tb(r),a=!!n;if(o+e>i.byteLength)throw new Tb(gb);var u=i.bytes,c=o+i.byteOffset,s=ab(u,c,c+e);return a?s:Pb(s)},Nb=function(t,e,r,n,i,o){var a=mb(t),u=tb(r),c=n(+i),s=!!o;if(u+e>a.byteLength)throw new Tb(gb);for(var f=a.bytes,h=u+a.byteOffset,l=0;l>24)},setUint8:function(t,e){Hb(this,t,e<<24>>24)}},{unsafe:!0})}else xb=(Sb=function(t){Xw(this,xb);var e=tb(t);wb(this,{type:pb,bytes:Ib(Rb(e),0),byteLength:e}),$w||(this.byteLength=e,this.detached=!1)})[db],Eb=function(t,e,r){Xw(this,Ab),Xw(t,xb);var n=yb(t),i=n.byteLength,o=Qw(e);if(o<0||o>i)throw new Tb("Wrong offset");if(o+(r=void 0===r?i-o:Zw(r))>i)throw new Tb("Wrong length");wb(this,{type:vb,buffer:t,byteLength:r,byteOffset:o,bytes:n.bytes}),$w||(this.buffer=t,this.byteLength=r,this.byteOffset=o)},Ab=Eb[db],$w&&(_b(Sb,"byteLength",yb),_b(Eb,"buffer",mb),_b(Eb,"byteLength",mb),_b(Eb,"byteOffset",mb)),Jw(Ab,{getInt8:function(t){return Db(this,1,t)[0]<<24>>24},getUint8:function(t){return Db(this,1,t)[0]},getInt16:function(t){var e=Db(this,2,t,arguments.length>1&&arguments[1]);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=Db(this,2,t,arguments.length>1&&arguments[1]);return e[1]<<8|e[0]},getInt32:function(t){return Mb(Db(this,4,t,arguments.length>1&&arguments[1]))},getUint32:function(t){return Mb(Db(this,4,t,arguments.length>1&&arguments[1]))>>>0},getFloat32:function(t){return jb(Db(this,4,t,arguments.length>1&&arguments[1]),23)},getFloat64:function(t){return jb(Db(this,8,t,arguments.length>1&&arguments[1]),52)},setInt8:function(t,e){Nb(this,1,t,Lb,e)},setUint8:function(t,e){Nb(this,1,t,Lb,e)},setInt16:function(t,e){Nb(this,2,t,Ub,e,arguments.length>2&&arguments[2])},setUint16:function(t,e){Nb(this,2,t,Ub,e,arguments.length>2&&arguments[2])},setInt32:function(t,e){Nb(this,4,t,Cb,e,arguments.length>2&&arguments[2])},setUint32:function(t,e){Nb(this,4,t,Cb,e,arguments.length>2&&arguments[2])},setFloat32:function(t,e){Nb(this,4,t,Fb,e,arguments.length>2&&arguments[2])},setFloat64:function(t,e){Nb(this,8,t,Bb,e,arguments.length>2&&arguments[2])}});sb(Sb,pb),sb(Eb,vb);var Wb={ArrayBuffer:Sb,DataView:Eb},$b=z,Gb=Math.floor,Vb=Number.isInteger||function(t){return!$b(t)&&isFinite(t)&&Gb(t)===t},Yb=tn,Jb=RangeError,Kb=function(t){var e=Yb(t);if(e<0)throw new Jb("The argument can't be less than 0");return e},Xb=RangeError,Qb=function(t,e){var r=Kb(t);if(r%e)throw new Xb("Wrong offset");return r},Zb=Math.round,tS=ui,eS=function(t){var e=tS(t);return"BigInt64Array"===e||"BigUint64Array"===e},rS=ue,nS=TypeError,iS=function(t){var e=rS(t,"number");if("number"==typeof e)throw new nS("Can't convert number to bigint");return BigInt(e)},oS=os,aS=s,uS=Vc,cS=Ft,sS=fn,fS=Vh,hS=Nh,lS=Ch,pS=eS,vS=mw.aTypedArrayConstructor,dS=iS,gS=fn,yS=function(t,e,r){for(var n=0,i=arguments.length>2?r:gS(e),o=new t(i);i>n;)o[n]=e[n++];return o},mS=Zn,wS=r,bS=s,SS=o,xS=Ow,ES=mw,AS=Wb,OS=Hc,RS=g,TS=$e,IS=Vb,PS=cn,kS=qv,jS=Qb,LS=function(t){var e=Zb(t);return e<0?0:e>255?255:255&e},US=fe,CS=Dt,MS=ui,FS=z,BS=st,_S=ga,DS=$,NS=no,zS=Kr.f,qS=function(t){var e,r,n,i,o,a,u,c,s=uS(this),f=cS(t),h=arguments.length,l=h>1?arguments[1]:void 0,p=void 0!==l,v=hS(f);if(v&&!lS(v))for(c=(u=fS(f,v)).next,f=[];!(a=aS(c,u)).done;)f.push(a.value);for(p&&h>2&&(l=oS(l,arguments[2])),r=sS(f),n=new(vS(s))(r),i=pS(n),e=0;r>e;e++)o=p?l(f[e],e):f[e],n[e]=i?dS(o):+o;return n},HS=Cp.forEach,WS=Nc,$S=pi,GS=Re,VS=n,YS=yS,JS=so,KS=Rr.get,XS=Rr.set,QS=Rr.enforce,ZS=GS.f,tx=VS.f,ex=wS.RangeError,rx=AS.ArrayBuffer,nx=rx.prototype,ix=AS.DataView,ox=ES.NATIVE_ARRAY_BUFFER_VIEWS,ax=ES.TYPED_ARRAY_TAG,ux=ES.TypedArray,cx=ES.TypedArrayPrototype,sx=ES.isTypedArray,fx="BYTES_PER_ELEMENT",hx="Wrong length",lx=function(t,e){$S(t,e,{configurable:!0,get:function(){return KS(this)[e]}})},px=function(t){var e;return DS(nx,t)||"ArrayBuffer"===(e=MS(t))||"SharedArrayBuffer"===e},vx=function(t,e){return sx(t)&&!BS(e)&&e in t&&IS(+e)&&e>=0},dx=function(t,e){return e=US(e),vx(t,e)?RS(2,t[e]):tx(t,e)},gx=function(t,e,r){return e=US(e),!(vx(t,e)&&FS(r)&&CS(r,"value"))||CS(r,"get")||CS(r,"set")||r.configurable||CS(r,"writable")&&!r.writable||CS(r,"enumerable")&&!r.enumerable?ZS(t,e,r):(t[e]=r.value,t)};SS?(ox||(VS.f=dx,GS.f=gx,lx(cx,"buffer"),lx(cx,"byteOffset"),lx(cx,"byteLength"),lx(cx,"length")),mS({target:"Object",stat:!0,forced:!ox},{getOwnPropertyDescriptor:dx,defineProperty:gx}),Mm.exports=function(t,e,r){var n=t.match(/\d+/)[0]/8,i=t+(r?"Clamped":"")+"Array",o="get"+t,a="set"+t,u=wS[i],c=u,s=c&&c.prototype,f={},h=function(t,e){ZS(t,e,{get:function(){return function(t,e){var r=KS(t);return r.view[o](e*n+r.byteOffset,!0)}(this,e)},set:function(t){return function(t,e,i){var o=KS(t);o.view[a](e*n+o.byteOffset,r?LS(i):i,!0)}(this,e,t)},enumerable:!0})};ox?xS&&(c=e((function(t,e,r,i){return OS(t,s),JS(FS(e)?px(e)?void 0!==i?new u(e,jS(r,n),i):void 0!==r?new u(e,jS(r,n)):new u(e):sx(e)?YS(c,e):bS(qS,c,e):new u(kS(e)),t,c)})),NS&&NS(c,ux),HS(zS(u),(function(t){t in c||TS(c,t,u[t])})),c.prototype=s):(c=e((function(t,e,r,i){OS(t,s);var o,a,u,f=0,l=0;if(FS(e)){if(!px(e))return sx(e)?YS(c,e):bS(qS,c,e);o=e,l=jS(r,n);var p=e.byteLength;if(void 0===i){if(p%n)throw new ex(hx);if((a=p-l)<0)throw new ex(hx)}else if((a=PS(i)*n)+l>p)throw new ex(hx);u=a/n}else u=kS(e),o=new rx(a=u*n);for(XS(t,{buffer:o,byteOffset:l,byteLength:a,length:u,view:new ix(o)});f=0?n:r+n;return i<0||i>=r?void 0:e[i]}));var Sx=qw,xx=iS,Ex=ui,Ax=s,Ox=i,Rx=mw.aTypedArray,Tx=mw.exportTypedArrayMethod,Ix=S("".slice);Tx("fill",(function(t){var e=arguments.length;Rx(this);var r="Big"===Ix(Ex(this),0,3)?xx(t):+t;return Ax(Sx,this,r,e>1?arguments[1]:void 0,e>2?arguments[2]:void 0)}),Ox((function(){var t=0;return new Int8Array(2).fill({valueOf:function(){return t++}}),1!==t})));var Px=os,kx=k,jx=Ft,Lx=fn,Ux=function(t){var e=1===t;return function(r,n,i){for(var o,a=jx(r),u=kx(a),c=Lx(u),s=Px(n,i);c-- >0;)if(s(o=u[c],c,a))switch(t){case 0:return o;case 1:return c}return e?-1:void 0}},Cx={findLast:Ux(0),findLastIndex:Ux(1)},Mx=Cx.findLast,Fx=mw.aTypedArray;(0,mw.exportTypedArrayMethod)("findLast",(function(t){return Mx(Fx(this),t,arguments.length>1?arguments[1]:void 0)}));var Bx=Cx.findLastIndex,_x=mw.aTypedArray;(0,mw.exportTypedArrayMethod)("findLastIndex",(function(t){return Bx(_x(this),t,arguments.length>1?arguments[1]:void 0)}));var Dx=r,Nx=i,zx=S,qx=mw,Hx=Cu,Wx=Zt("iterator"),$x=Dx.Uint8Array,Gx=zx(Hx.values),Vx=zx(Hx.keys),Yx=zx(Hx.entries),Jx=qx.aTypedArray,Kx=qx.exportTypedArrayMethod,Xx=$x&&$x.prototype,Qx=!Nx((function(){Xx[Wx].call([1])})),Zx=!!Xx&&Xx.values&&Xx[Wx]===Xx.values&&"values"===Xx.values.name,tE=function(){return Gx(Jx(this))};Kx("entries",(function(){return Yx(Jx(this))}),Qx),Kx("keys",(function(){return Vx(Jx(this))}),Qx),Kx("values",tE,Qx||!Zx,{name:"values"}),Kx(Wx,tE,Qx||!Zx,{name:"values"});var eE=r,rE=s,nE=mw,iE=fn,oE=Qb,aE=Ft,uE=i,cE=eE.RangeError,sE=eE.Int8Array,fE=sE&&sE.prototype,hE=fE&&fE.set,lE=nE.aTypedArray,pE=nE.exportTypedArrayMethod,vE=!uE((function(){var t=new Uint8ClampedArray(2);return rE(hE,t,{length:1,0:3},1),3!==t[1]})),dE=vE&&nE.NATIVE_ARRAY_BUFFER_VIEWS&&uE((function(){var t=new sE(2);return t.set(1),t.set("2",1),0!==t[0]||2!==t[1]}));pE("set",(function(t){lE(this);var e=oE(arguments.length>1?arguments[1]:void 0,1),r=aE(t);if(vE)return rE(hE,this,r,e);var n=this.length,i=iE(r),o=0;if(i+e>n)throw new cE("Wrong length");for(;o0;)t[i]=t[--i];i!==o++&&(t[i]=n)}else for(var a=yE(r/2),u=mE(gE(t,0,a),e),c=mE(gE(t,a),e),s=u.length,f=c.length,h=0,l=0;h0&&1/r<0?1:-1:e>r}}(t))}),!_E||BE);var DE=fn,NE=function(t,e){for(var r=DE(t),n=new e(r),i=0;i=i||a<0)throw new oA("Incorrect index");for(var u=new e(i),c=0;cr.size?NR(r.getIterator(),(function(t){HR(e,t)&&qR(n,t)})):DR(e,(function(t){r.includes(t)&&qR(n,t)})),n};Zn({target:"Set",proto:!0,real:!0,forced:!CR("intersection")||WR((function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))}))},{intersection:$R});var GR=XO,VR=JO.has,YR=lR,JR=ER,KR=uR,XR=ZO,QR=Xh,ZR=function(t){var e=GR(this),r=JR(t);if(YR(e)<=r.size)return!1!==KR(e,(function(t){if(r.includes(t))return!1}),!0);var n=r.getIterator();return!1!==XR(n,(function(t){if(VR(e,t))return QR(n,"normal",!1)}))};Zn({target:"Set",proto:!0,real:!0,forced:!CR("isDisjointFrom")},{isDisjointFrom:ZR});var tT=XO,eT=lR,rT=uR,nT=ER,iT=function(t){var e=tT(this),r=nT(t);return!(eT(e)>r.size)&&!1!==rT(e,(function(t){if(!r.includes(t))return!1}),!0)};Zn({target:"Set",proto:!0,real:!0,forced:!CR("isSubsetOf")},{isSubsetOf:iT});var oT=XO,aT=JO.has,uT=lR,cT=ER,sT=ZO,fT=Xh,hT=function(t){var e=oT(this),r=cT(t);if(uT(e)=51||!NT((function(){var t=[];return t[KT]=!1,t.concat()[0]!==t})),QT=function(t){if(!qT(t))return!1;var e=t[KT];return void 0!==e?!!e:zT(t)};DT({target:"Array",proto:!0,arity:1,forced:!XT||!YT("concat")},{concat:function(t){var e,r,n,i,o,a=HT(this),u=VT(a,0),c=0;for(e=-1,n=arguments.length;e0&&ZT(c)?(s=tI(c),f=nI(t,e,c,s,f,o-1)-1):(eI(f+1),t[f]=c),f++),h++;return f},iI=nI,oI=Ft,aI=fn,uI=tn,cI=Rp;Zn({target:"Array",proto:!0},{flat:function(){var t=arguments.length?arguments[0]:void 0,e=oI(this),r=aI(e),n=cI(e,0);return n.length=iI(n,e,e,r,0,void 0===t?1:uI(t)),n}});var sI=os,fI=s,hI=Ft,lI=PO,pI=Ch,vI=uc,dI=fn,gI=hc,yI=Vh,mI=Nh,wI=Array,bI=function(t){var e=hI(t),r=vI(this),n=arguments.length,i=n>1?arguments[1]:void 0,o=void 0!==i;o&&(i=sI(i,n>2?arguments[2]:void 0));var a,u,c,s,f,h,l=mI(e),p=0;if(!l||this===wI&&pI(l))for(a=dI(e),u=r?new this(a):wI(a);a>p;p++)h=o?i(e[p],p):e[p],gI(u,p,h);else for(u=r?new this:[],f=(s=yI(e,l)).next;!(c=fI(f,s)).done;p++)h=o?lI(s,i,[c.value,p],!0):c.value,gI(u,p,h);return u.length=p,u},SI=bI;Zn({target:"Array",stat:!0,forced:!gl((function(t){Array.from(t)}))},{from:SI});var xI=dn.includes,EI=Oa;Zn({target:"Array",proto:!0,forced:i((function(){return!Array(1).includes()}))},{includes:function(t){return xI(this,t,arguments.length>1?arguments[1]:void 0)}}),EI("includes");var AI=dt,OI=Ft,RI=k,TI=fn,II=TypeError,PI="Reduce of empty array with no initial value",kI=function(t){return function(e,r,n,i){var o=OI(e),a=RI(o),u=TI(o);if(AI(r),0===u&&n<2)throw new II(PI);var c=t?u-1:0,s=t?-1:1;if(n<2)for(;;){if(c in a){i=a[c],c+=s;break}if(c+=s,t?c<0:u<=c)throw new II(PI)}for(;t?c>=0:u>c;c+=s)c in a&&(i=r(i,a[c],c,o));return i}},jI={left:kI(!1),right:kI(!0)}.left;Zn({target:"Array",proto:!0,forced:!Mc&&Z>79&&Z<83||!Fp("reduce")},{reduce:function(t){var e=arguments.length;return jI(this,t,e,e>1?arguments[1]:void 0)}});var LI=Zn,UI=S,CI=dt,MI=Ft,FI=fn,BI=hv,_I=fi,DI=i,NI=wE,zI=Fp,qI=SE,HI=xE,WI=Z,$I=AE,GI=[],VI=UI(GI.sort),YI=UI(GI.push),JI=DI((function(){GI.sort(void 0)})),KI=DI((function(){GI.sort(null)})),XI=zI("sort"),QI=!DI((function(){if(WI)return WI<70;if(!(qI&&qI>3)){if(HI)return!0;if($I)return $I<603;var t,e,r,n,i="";for(t=65;t<76;t++){switch(e=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(n=0;n<47;n++)GI.push({k:e+n,v:r})}for(GI.sort((function(t,e){return e.v-t.v})),n=0;n_I(r)?1:-1}}(t)),r=FI(i),n=0;nu;)r=i[u++],MP&&!(o?r in n:zP(n,r))||qP(c,t?[r,n[r]]:n[r]);return c}},$P={entries:WP(!0),values:WP(!1)},GP=$P.entries;Zn({target:"Object",stat:!0},{entries:function(t){return GP(t)}});var VP=hl,YP=hc;Zn({target:"Object",stat:!0},{fromEntries:function(t){var e={};return VP(t,(function(t,r){YP(e,t,r)}),{AS_ENTRIES:!0}),e}});var JP=$P.values;Zn({target:"Object",stat:!0},{values:function(t){return JP(t)}});var KP=Zn,XP=vf,QP=i,ZP=W,tk=D,ek=Qc,rk=zl,nk=Jr,ik=XP&&XP.prototype;if(KP({target:"Promise",proto:!0,real:!0,forced:!!XP&&QP((function(){ik.finally.call({then:function(){}},(function(){}))}))},{finally:function(t){var e=ek(this,ZP("Promise")),r=tk(t);return this.then(r?function(r){return rk(e,t()).then((function(){return r}))}:t,r?function(r){return rk(e,t()).then((function(){throw r}))}:t)}}),tk(XP)){var ok=ZP("Promise").prototype.finally;ik.finally!==ok&&nk(ik,"finally",ok,{unsafe:!0})}var ak=z,uk=O,ck=Zt("match"),sk=function(t){var e;return ak(t)&&(void 0!==(e=t[ck])?!!e:"RegExp"===uk(t))},fk=s,hk=Dt,lk=$,pk=Gg,vk=RegExp.prototype,dk=function(t){var e=t.flags;return void 0!==e||"flags"in vk||hk(t,"flags")||!lk(vk,t)?e:fk(pk,t)},gk=o,yk=r,mk=S,wk=$n,bk=so,Sk=$e,xk=ga,Ek=Kr.f,Ak=$,Ok=sk,Rk=fi,Tk=dk,Ik=Qg,Pk=oo,kk=Jr,jk=i,Lk=Dt,Uk=Rr.enforce,Ck=Nc,Mk=ey,Fk=iy,Bk=Zt("match"),_k=yk.RegExp,Dk=_k.prototype,Nk=yk.SyntaxError,zk=mk(Dk.exec),qk=mk("".charAt),Hk=mk("".replace),Wk=mk("".indexOf),$k=mk("".slice),Gk=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,Vk=/a/g,Yk=/a/g,Jk=new _k(Vk)!==Vk,Kk=Ik.MISSED_STICKY,Xk=Ik.UNSUPPORTED_Y,Qk=gk&&(!Jk||Kk||Mk||Fk||jk((function(){return Yk[Bk]=!1,_k(Vk)!==Vk||_k(Yk)===Yk||"/a/i"!==String(_k(Vk,"i"))})));if(wk("RegExp",Qk)){for(var Zk=function(t,e){var r,n,i,o,a,u,c=Ak(Dk,this),s=Ok(t),f=void 0===e,h=[],l=t;if(!c&&s&&f&&t.constructor===Zk)return t;if((s||Ak(Dk,t))&&(t=t.source,f&&(e=Tk(l))),t=void 0===t?"":Rk(t),e=void 0===e?"":Rk(e),l=t,Mk&&"dotAll"in Vk&&(n=!!e&&Wk(e,"s")>-1)&&(e=Hk(e,/s/g,"")),r=e,Kk&&"sticky"in Vk&&(i=!!e&&Wk(e,"y")>-1)&&Xk&&(e=Hk(e,/y/g,"")),Fk&&(o=function(t){for(var e,r=t.length,n=0,i="",o=[],a=xk(null),u=!1,c=!1,s=0,f="";n<=r;n++){if("\\"===(e=qk(t,n)))e+=qk(t,++n);else if("]"===e)u=!1;else if(!u)switch(!0){case"["===e:u=!0;break;case"("===e:zk(Gk,$k(t,n+1))&&(n+=2,c=!0),i+=e,s++;continue;case">"===e&&c:if(""===f||Lk(a,f))throw new Nk("Invalid capture group name");a[f]=!0,o[o.length]=[f,s],c=!1,f="";continue}c?f+=e:i+=e}return[i,o]}(t),t=o[0],h=o[1]),a=bk(_k(t,e),c?this:Dk,Zk),(n||i||h.length)&&(u=Uk(a),n&&(u.dotAll=!0,u.raw=Zk(function(t){for(var e,r=t.length,n=0,i="",o=!1;n<=r;n++)"\\"!==(e=qk(t,n))?o||"."!==e?("["===e?o=!0:"]"===e&&(o=!1),i+=e):i+="[\\s\\S]":i+=e+qk(t,++n);return i}(t),r)),i&&(u.sticky=!0),h.length&&(u.groups=h)),t!==l)try{Sk(a,"source",""===l?"(?:)":l)}catch(o_){}return a},tj=Ek(_k),ej=0;tj.length>ej;)Pk(Zk,_k,tj[ej++]);Dk.constructor=Zk,Zk.prototype=Dk,kk(yk,"RegExp",Zk,{constructor:!0})}Ck("RegExp");var rj=o,nj=ey,ij=O,oj=pi,aj=Rr.get,uj=RegExp.prototype,cj=TypeError;rj&&nj&&oj(uj,"dotAll",{configurable:!0,get:function(){if(this!==uj){if("RegExp"===ij(this))return!!aj(this).dotAll;throw new cj("Incompatible receiver, RegExp required")}}});var sj,fj,hj=Zn,lj=s,pj=D,vj=je,dj=fi,gj=(sj=!1,(fj=/[ac]/).exec=function(){return sj=!0,/./.exec.apply(this,arguments)},!0===fj.test("abc")&&sj),yj=/./.test;hj({target:"RegExp",proto:!0,forced:!gj},{test:function(t){var e=vj(this),r=dj(t),n=e.exec;if(!pj(n))return lj(yj,e,r);var i=lj(n,e,r);return null!==i&&(vj(i),!0)}});var mj=Qe.PROPER,wj=Jr,bj=je,Sj=fi,xj=i,Ej=dk,Aj="toString",Oj=RegExp.prototype,Rj=Oj[Aj],Tj=xj((function(){return"/a/b"!==Rj.call({source:"a",flags:"b"})})),Ij=mj&&Rj.name!==Aj;(Tj||Ij)&&wj(Oj,Aj,(function(){var t=bj(this);return"/"+Sj(t.source)+"/"+Sj(Ej(t))}),{unsafe:!0});var Pj=sk,kj=TypeError,jj=function(t){if(Pj(t))throw new kj("The method doesn't accept regular expressions");return t},Lj=Zt("match"),Uj=function(t){var e=/./;try{"/./"[t](e)}catch(r){try{return e[Lj]=!1,"/./"[t](e)}catch(n){}}return!1},Cj=Zn,Mj=es,Fj=n.f,Bj=cn,_j=fi,Dj=jj,Nj=C,zj=Uj,qj=Mj("".slice),Hj=Math.min,Wj=zj("endsWith"),$j=!Wj&&!!function(){var t=Fj(String.prototype,"endsWith");return t&&!t.writable}();Cj({target:"String",proto:!0,forced:!$j&&!Wj},{endsWith:function(t){var e=_j(Nj(this));Dj(t);var r=arguments.length>1?arguments[1]:void 0,n=e.length,i=void 0===r?n:Hj(Bj(r),n),o=_j(t);return qj(e,i-o.length,i)===o}});var Gj=Zn,Vj=jj,Yj=C,Jj=fi,Kj=Uj,Xj=S("".indexOf);Gj({target:"String",proto:!0,forced:!Kj("includes")},{includes:function(t){return!!~Xj(Jj(Yj(this)),Jj(Vj(t)),arguments.length>1?arguments[1]:void 0)}});var Qj=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e},Zj=s,tL=je,eL=j,rL=C,nL=Qj,iL=fi,oL=mt,aL=om;Uy("search",(function(t,e,r){return[function(e){var r=rL(this),n=eL(e)?void 0:oL(e,t);return n?Zj(n,e,r):new RegExp(e)[t](iL(r))},function(t){var n=tL(this),i=iL(t),o=r(e,n,i);if(o.done)return o.value;var a=n.lastIndex;nL(a,0)||(n.lastIndex=0);var u=aL(n,i);return nL(n.lastIndex,a)||(n.lastIndex=a),null===u?-1:u.index}]}));var uL=s,cL=S,sL=Uy,fL=je,hL=j,lL=C,pL=Qc,vL=Wy,dL=cn,gL=fi,yL=mt,mL=om,wL=i,bL=Qg.UNSUPPORTED_Y,SL=Math.min,xL=cL([].push),EL=cL("".slice),AL=!wL((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var r="ab".split(t);return 2!==r.length||"a"!==r[0]||"b"!==r[1]})),OL="c"==="abbc".split(/(b)*/)[1]||4!=="test".split(/(?:)/,-1).length||2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length;sL("split",(function(t,e,r){var n="0".split(void 0,0).length?function(t,r){return void 0===t&&0===r?[]:uL(e,this,t,r)}:e;return[function(e,r){var i=lL(this),o=hL(e)?void 0:yL(e,t);return o?uL(o,e,i,r):uL(n,gL(i),e,r)},function(t,i){var o=fL(this),a=gL(t);if(!OL){var u=r(n,o,a,i,n!==e);if(u.done)return u.value}var c=pL(o,RegExp),s=o.unicode,f=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(bL?"g":"y"),h=new c(bL?"^(?:"+o.source+")":o,f),l=void 0===i?4294967295:i>>>0;if(0===l)return[];if(0===a.length)return null===mL(h,a)?[a]:[];for(var p=0,v=0,d=[];v1?arguments[1]:void 0,e.length)),n=kL(t);return CL(e,r,r+n.length)===n}}),yx("Int32",(function(t){return function(e,r,n){return t(this,e,r,n)}}));var _L=hl,DL=dt,NL=je,zL=hp,qL=TypeError;Zn({target:"Iterator",proto:!0,real:!0},{reduce:function(t){NL(this),DL(t);var e=zL(this),r=arguments.length<2,n=r?void 0:arguments[1],i=0;if(_L(e,(function(e){r?(r=!1,n=e):n=t(n,e,i),i++}),{IS_RECORD:!0}),r)throw new qL("Reduce of empty iterator with no initial value");return n}});var HL=hl,WL=dt,$L=je,GL=hp;Zn({target:"Iterator",proto:!0,real:!0},{some:function(t){$L(this),WL(t);var e=GL(this),r=0;return HL(e,(function(e,n){if(t(e,r++))return n()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}});var VL=je,YL=hl,JL=hp,KL=[].push;Zn({target:"Iterator",proto:!0,real:!0},{toArray:function(){var t=[];return YL(JL(VL(this)),KL,{that:t,IS_RECORD:!0}),t}});var XL=S,QL=Dt,ZL=SyntaxError,tU=parseInt,eU=String.fromCharCode,rU=XL("".charAt),nU=XL("".slice),iU=XL(/./.exec),oU={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":"\n","\\r":"\r","\\t":"\t"},aU=/^[\da-f]{4}$/i,uU=/^[\u0000-\u001F]$/,cU=Zn,sU=o,fU=r,hU=W,lU=S,pU=s,vU=D,dU=z,gU=Bu,yU=Dt,mU=fi,wU=fn,bU=hc,SU=i,xU=function(t,e){for(var r=!0,n="";e=r.length?YU(void 0,!0):(t=WU(r,n),e.index+=t.length,YU(t,!1))}));var QU=i,ZU=o,tC=Zt("iterator"),eC=!QU((function(){var t=new URL("b?a=1&b=2&c=3","http://a"),e=t.searchParams,r=new URLSearchParams("a=1&a=2&b=3"),n="";return t.pathname="c%20d",e.forEach((function(t,r){e.delete("b"),n+=r+t})),r.delete("a",2),r.delete("b",void 0),!e.size&&!ZU||!e.sort||"http://a/c%20d?a=1&c=3"!==t.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[tC]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host})),rC=o,nC=S,iC=s,oC=i,aC=Yo,uC=On,cC=f,sC=Ft,fC=k,hC=Object.assign,lC=Object.defineProperty,pC=nC([].concat),vC=!hC||oC((function(){if(rC&&1!==hC({b:1},hC(lC({},"a",{enumerable:!0,get:function(){lC(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},r=Symbol("assign detection"),n="abcdefghijklmnopqrst";return t[r]=7,n.split("").forEach((function(t){e[t]=t})),7!==hC({},t)[r]||aC(hC({},e)).join("")!==n}))?function(t,e){for(var r=sC(t),n=arguments.length,i=1,o=uC.f,a=cC.f;n>i;)for(var u,c=fC(arguments[i++]),s=o?pC(aC(c),o(c)):aC(c),f=s.length,h=0;f>h;)u=s[h++],rC&&!iC(a,c,u)||(r[u]=c[u]);return r}:hC,dC=S,gC=2147483647,yC=/[^\0-\u007E]/,mC=/[.\u3002\uFF0E\uFF61]/g,wC="Overflow: input needs wider integers to process",bC=RangeError,SC=dC(mC.exec),xC=Math.floor,EC=String.fromCharCode,AC=dC("".charCodeAt),OC=dC([].join),RC=dC([].push),TC=dC("".replace),IC=dC("".split),PC=dC("".toLowerCase),kC=function(t){return t+22+75*(t<26)},jC=function(t,e,r){var n=0;for(t=r?xC(t/700):t>>1,t+=xC(t/e);t>455;)t=xC(t/35),n+=36;return xC(n+36*t/(t+38))},LC=function(t){var e=[];t=function(t){for(var e=[],r=0,n=t.length;r=55296&&i<=56319&&r=o&&nxC((gC-a)/h))throw new bC(wC);for(a+=(f-o)*h,o=f,r=0;rgC)throw new bC(wC);if(n===o){for(var l=a,p=36;;){var v=p<=u?1:p>=u+26?26:p-u;if(l=e.length)return t.target=void 0,iM(void 0,!0);var n=e[r];switch(t.kind){case"keys":return iM(n.key,!1);case"values":return iM(n.value,!1)}return iM([n.key,n.value],!1)}),!0),NM=function(t){this.entries=[],this.url=null,void 0!==t&&(QC(t)?this.parseObject(t):this.parseQuery("string"==typeof t?"?"===xM(t,0)?PM(t,1):t:ZC(t)))};NM.prototype={type:cM,bindURL:function(t){this.url=t,this.update()},parseObject:function(t){var e,r,n,i,o,a,u,c=this.entries,s=nM(t);if(s)for(r=(e=rM(t,s)).next;!(n=FC(r,e)).done;){if(o=(i=rM(XC(n.value))).next,(a=FC(o,i)).done||(u=FC(o,i)).done||!FC(o,i).done)throw new wM("Expected sequence with length 2");AM(c,{key:ZC(a.value),value:ZC(u.value)})}else for(var f in t)YC(t,f)&&AM(c,{key:f,value:ZC(t[f])})},parseQuery:function(t){if(t)for(var e,r,n=this.entries,i=IM(t,"&"),o=0;o0?arguments[0]:void 0));_C||(this.size=t.entries.length)},qM=zM.prototype;if(qC(qM,{append:function(t,e){var r=hM(this);oM(arguments.length,2),AM(r.entries,{key:ZC(t),value:ZC(e)}),_C||this.length++,r.updateURL()},delete:function(t){for(var e=hM(this),r=oM(arguments.length,1),n=e.entries,i=ZC(t),o=r<2?void 0:arguments[1],a=void 0===o?o:ZC(o),u=0;ue.key?1:-1})),t.updateURL()},forEach:function(t){for(var e,r=hM(this).entries,n=JC(t,arguments.length>1?arguments[1]:void 0),i=0;i1?$M(arguments[1]):{})}}),VC(vM)){var GM=function(t){return GC(this,gM),new vM(t,arguments.length>1?$M(arguments[1]):{})};gM.constructor=GM,GM.prototype=gM,UC({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:GM})}}var VM,YM=Zn,JM=o,KM=eC,XM=r,QM=os,ZM=S,tF=Jr,eF=pi,rF=Hc,nF=Dt,iF=vC,oF=bI,aF=gc,uF=qy.codeAt,cF=function(t){var e,r,n=[],i=IC(TC(PC(t),mC,"."),".");for(e=0;e?@[\\\]^|]/,GF=/[\0\t\n\r #/:<>?@[\\\]^|]/,VF=/^[\u0000-\u0020]+/,YF=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,JF=/[\t\n\r]/g,KF=function(t){var e,r,n,i;if("number"==typeof t){for(e=[],r=0;r<4;r++)CF(e,t%256),t=SF(t/256);return OF(e,".")}if("object"==typeof t){for(e="",n=function(t){for(var e=null,r=1,n=null,i=0,o=0;o<8;o++)0!==t[o]?(i>r&&(e=n,r=i),n=null,i=0):(null===n&&(n=o),++i);return i>r&&(e=n,r=i),e}(t),r=0;r<8;r++)i&&0===t[r]||(i&&(i=!1),n===r?(e+=r?":":"::",i=!0):(e+=RF(t[r],16),r<7&&(e+=":")));return"["+e+"]"}return t},XF={},QF=iF({},XF,{" ":1,'"':1,"<":1,">":1,"`":1}),ZF=iF({},QF,{"#":1,"?":1,"{":1,"}":1}),tB=iF({},ZF,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),eB=function(t,e){var r=uF(t,0);return r>32&&r<127&&!nF(e,t)?t:encodeURIComponent(t)},rB={ftp:21,file:null,http:80,https:443,ws:80,wss:443},nB=function(t,e){var r;return 2===t.length&&AF(_F,EF(t,0))&&(":"===(r=EF(t,1))||!e&&"|"===r)},iB=function(t){var e;return t.length>1&&nB(LF(t,0,2))&&(2===t.length||"/"===(e=EF(t,2))||"\\"===e||"?"===e||"#"===e)},oB=function(t){return"."===t||"%2e"===UF(t)},aB={},uB={},cB={},sB={},fB={},hB={},lB={},pB={},vB={},dB={},gB={},yB={},mB={},wB={},bB={},SB={},xB={},EB={},AB={},OB={},RB={},TB=function(t,e,r){var n,i,o,a=sF(t);if(e){if(i=this.parse(a))throw new wF(i);this.searchParams=null}else{if(void 0!==r&&(n=new TB(r,!0)),i=this.parse(a,null,n))throw new wF(i);(o=yF(new gF)).bindURL(this),this.searchParams=o}};TB.prototype={type:"URL",parse:function(t,e,r){var n,i,o,a,u,c=this,s=e||aB,f=0,h="",l=!1,p=!1,v=!1;for(t=sF(t),e||(c.scheme="",c.username="",c.password="",c.host=null,c.port=null,c.path=[],c.query=null,c.fragment=null,c.cannotBeABaseURL=!1,t=PF(t,VF,""),t=PF(t,YF,"$1")),t=PF(t,JF,""),n=oF(t);f<=n.length;){switch(i=n[f],s){case aB:if(!i||!AF(_F,i)){if(e)return MF;s=cB;continue}h+=UF(i),s=uB;break;case uB:if(i&&(AF(DF,i)||"+"===i||"-"===i||"."===i))h+=UF(i);else{if(":"!==i){if(e)return MF;h="",s=cB,f=0;continue}if(e&&(c.isSpecial()!==nF(rB,h)||"file"===h&&(c.includesCredentials()||null!==c.port)||"file"===c.scheme&&!c.host))return;if(c.scheme=h,e)return void(c.isSpecial()&&rB[c.scheme]===c.port&&(c.port=null));h="","file"===c.scheme?s=wB:c.isSpecial()&&r&&r.scheme===c.scheme?s=sB:c.isSpecial()?s=pB:"/"===n[f+1]?(s=fB,f++):(c.cannotBeABaseURL=!0,IF(c.path,""),s=AB)}break;case cB:if(!r||r.cannotBeABaseURL&&"#"!==i)return MF;if(r.cannotBeABaseURL&&"#"===i){c.scheme=r.scheme,c.path=aF(r.path),c.query=r.query,c.fragment="",c.cannotBeABaseURL=!0,s=RB;break}s="file"===r.scheme?wB:hB;continue;case sB:if("/"!==i||"/"!==n[f+1]){s=hB;continue}s=vB,f++;break;case fB:if("/"===i){s=dB;break}s=EB;continue;case hB:if(c.scheme=r.scheme,i===VM)c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=aF(r.path),c.query=r.query;else if("/"===i||"\\"===i&&c.isSpecial())s=lB;else if("?"===i)c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=aF(r.path),c.query="",s=OB;else{if("#"!==i){c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=aF(r.path),c.path.length--,s=EB;continue}c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=aF(r.path),c.query=r.query,c.fragment="",s=RB}break;case lB:if(!c.isSpecial()||"/"!==i&&"\\"!==i){if("/"!==i){c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,s=EB;continue}s=dB}else s=vB;break;case pB:if(s=vB,"/"!==i||"/"!==EF(h,f+1))continue;f++;break;case vB:if("/"!==i&&"\\"!==i){s=dB;continue}break;case dB:if("@"===i){l&&(h="%40"+h),l=!0,o=oF(h);for(var d=0;d65535)return BF;c.port=c.isSpecial()&&m===rB[c.scheme]?null:m,h=""}if(e)return;s=xB;continue}return BF}h+=i;break;case wB:if(c.scheme="file","/"===i||"\\"===i)s=bB;else{if(!r||"file"!==r.scheme){s=EB;continue}switch(i){case VM:c.host=r.host,c.path=aF(r.path),c.query=r.query;break;case"?":c.host=r.host,c.path=aF(r.path),c.query="",s=OB;break;case"#":c.host=r.host,c.path=aF(r.path),c.query=r.query,c.fragment="",s=RB;break;default:iB(OF(aF(n,f),""))||(c.host=r.host,c.path=aF(r.path),c.shortenPath()),s=EB;continue}}break;case bB:if("/"===i||"\\"===i){s=SB;break}r&&"file"===r.scheme&&!iB(OF(aF(n,f),""))&&(nB(r.path[0],!0)?IF(c.path,r.path[0]):c.host=r.host),s=EB;continue;case SB:if(i===VM||"/"===i||"\\"===i||"?"===i||"#"===i){if(!e&&nB(h))s=EB;else if(""===h){if(c.host="",e)return;s=xB}else{if(a=c.parseHost(h))return a;if("localhost"===c.host&&(c.host=""),e)return;h="",s=xB}continue}h+=i;break;case xB:if(c.isSpecial()){if(s=EB,"/"!==i&&"\\"!==i)continue}else if(e||"?"!==i)if(e||"#"!==i){if(i!==VM&&(s=EB,"/"!==i))continue}else c.fragment="",s=RB;else c.query="",s=OB;break;case EB:if(i===VM||"/"===i||"\\"===i&&c.isSpecial()||!e&&("?"===i||"#"===i)){if(".."===(u=UF(u=h))||"%2e."===u||".%2e"===u||"%2e%2e"===u?(c.shortenPath(),"/"===i||"\\"===i&&c.isSpecial()||IF(c.path,"")):oB(h)?"/"===i||"\\"===i&&c.isSpecial()||IF(c.path,""):("file"===c.scheme&&!c.path.length&&nB(h)&&(c.host&&(c.host=""),h=EF(h,0)+":"),IF(c.path,h)),h="","file"===c.scheme&&(i===VM||"?"===i||"#"===i))for(;c.path.length>1&&""===c.path[0];)kF(c.path);"?"===i?(c.query="",s=OB):"#"===i&&(c.fragment="",s=RB)}else h+=eB(i,ZF);break;case AB:"?"===i?(c.query="",s=OB):"#"===i?(c.fragment="",s=RB):i!==VM&&(c.path[0]+=eB(i,XF));break;case OB:e||"#"!==i?i!==VM&&("'"===i&&c.isSpecial()?c.query+="%27":c.query+="#"===i?"%23":eB(i,XF)):(c.fragment="",s=RB);break;case RB:i!==VM&&(c.fragment+=eB(i,QF))}f++}},parseHost:function(t){var e,r,n;if("["===EF(t,0)){if("]"!==EF(t,t.length-1))return FF;if(e=function(t){var e,r,n,i,o,a,u,c=[0,0,0,0,0,0,0,0],s=0,f=null,h=0,l=function(){return EF(t,h)};if(":"===l()){if(":"!==EF(t,1))return;h+=2,f=++s}for(;l();){if(8===s)return;if(":"!==l()){for(e=r=0;r<4&&AF(WF,l());)e=16*e+bF(l(),16),h++,r++;if("."===l()){if(0===r)return;if(h-=r,s>6)return;for(n=0;l();){if(i=null,n>0){if(!("."===l()&&n<4))return;h++}if(!AF(NF,l()))return;for(;AF(NF,l());){if(o=bF(l(),10),null===i)i=o;else{if(0===i)return;i=10*i+o}if(i>255)return;h++}c[s]=256*c[s]+i,2!=++n&&4!==n||s++}if(4!==n)return;break}if(":"===l()){if(h++,!l())return}else if(l())return;c[s++]=e}else{if(null!==f)return;h++,f=++s}}if(null!==f)for(a=s-f,s=7;0!==s&&a>0;)u=c[s],c[s--]=c[f+a-1],c[f+--a]=u;else if(8!==s)return;return c}(LF(t,1,-1)),!e)return FF;this.host=e}else if(this.isSpecial()){if(t=cF(t),AF($F,t))return FF;if(e=function(t){var e,r,n,i,o,a,u,c=jF(t,".");if(c.length&&""===c[c.length-1]&&c.length--,(e=c.length)>4)return t;for(r=[],n=0;n1&&"0"===EF(i,0)&&(o=AF(zF,i)?16:8,i=LF(i,8===o?1:2)),""===i)a=0;else{if(!AF(10===o?HF:8===o?qF:WF,i))return t;a=bF(i,o)}IF(r,a)}for(n=0;n=xF(256,5-e))return null}else if(a>255)return null;for(u=TF(r),n=0;n1?arguments[1]:void 0,n=vF(e,new TB(t,!1,r));JM||(e.href=n.serialize(),e.origin=n.getOrigin(),e.protocol=n.getProtocol(),e.username=n.getUsername(),e.password=n.getPassword(),e.host=n.getHost(),e.hostname=n.getHostname(),e.port=n.getPort(),e.pathname=n.getPathname(),e.search=n.getSearch(),e.searchParams=n.getSearchParams(),e.hash=n.getHash())},PB=IB.prototype,kB=function(t,e){return{get:function(){return dF(this)[t]()},set:e&&function(t){return dF(this)[e](t)},configurable:!0,enumerable:!0}};if(JM&&(eF(PB,"href",kB("serialize","setHref")),eF(PB,"origin",kB("getOrigin")),eF(PB,"protocol",kB("getProtocol","setProtocol")),eF(PB,"username",kB("getUsername","setUsername")),eF(PB,"password",kB("getPassword","setPassword")),eF(PB,"host",kB("getHost","setHost")),eF(PB,"hostname",kB("getHostname","setHostname")),eF(PB,"port",kB("getPort","setPort")),eF(PB,"pathname",kB("getPathname","setPathname")),eF(PB,"search",kB("getSearch","setSearch")),eF(PB,"searchParams",kB("getSearchParams")),eF(PB,"hash",kB("getHash","setHash"))),tF(PB,"toJSON",(function(){return dF(this).serialize()}),{enumerable:!0}),tF(PB,"toString",(function(){return dF(this).serialize()}),{enumerable:!0}),mF){var jB=mF.createObjectURL,LB=mF.revokeObjectURL;jB&&tF(IB,"createObjectURL",QM(jB,mF)),LB&&tF(IB,"revokeObjectURL",QM(LB,mF))}fF(IB,"URL"),YM({global:!0,constructor:!0,forced:!KM,sham:!JM},{URL:IB});var UB=s;Zn({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return UB(URL.prototype.toString,this)}});var CB=Jr,MB=S,FB=fi,BB=us,_B=URLSearchParams,DB=_B.prototype,NB=MB(DB.append),zB=MB(DB.delete),qB=MB(DB.forEach),HB=MB([].push),WB=new _B("a=1&a=2&b=3");WB.delete("a",1),WB.delete("b",void 0),WB+""!="a=2"&&CB(DB,"delete",(function(t){var e=arguments.length,r=e<2?void 0:arguments[1];if(e&&void 0===r)return zB(this,t);var n=[];qB(this,(function(t,e){HB(n,{key:e,value:t})})),BB(e,1);for(var i,o=FB(t),a=FB(r),u=0,c=0,s=!1,f=n.length;ur.length&&"/"!==n[n.length-1]))return n+t.slice(r.length);c("W2",r,n)}}function c(t,r,n){console.warn(e(t,[n,r].join(", ")))}function s(t,e,r){for(var n=t.scopes,i=r&&a(r,n);i;){var o=u(e,n[i]);if(o)return o;i=a(i.slice(0,i.lastIndexOf("/")),n)}return u(e,t.imports)||-1!==e.indexOf(":")&&e}function f(){this[R]={}}function h(t,r,n,i){var o=t[R][r];if(o)return o;var a=[],u=Object.create(null);O&&Object.defineProperty(u,O,{value:"Module"});var c=Promise.resolve().then((function(){return t.instantiate(r,n,i)})).then((function(n){if(!n)throw Error(e(2,r));var i=n[1]((function(t,e){o.h=!0;var r=!1;if("string"==typeof t)t in u&&u[t]===e||(u[t]=e,r=!0);else{for(var n in t)e=t[n],n in u&&u[n]===e||(u[n]=e,r=!0);t&&t.__esModule&&(u.__esModule=t.__esModule)}if(r)for(var i=0;i-1){var r=document.createEvent("Event");r.initEvent("error",!1,!1),t.dispatchEvent(r)}return Promise.reject(e)}))}else if("systemjs-importmap"===t.type){t.sp=!0;var r=t.src?(System.fetch||fetch)(t.src,{integrity:t.integrity,passThrough:!0}).then((function(t){if(!t.ok)throw Error(t.status);return t.text()})).catch((function(r){return r.message=e("W4",t.src)+"\n"+r.message,console.warn(r),"function"==typeof t.onerror&&t.onerror(),"{}"})):t.innerHTML;j=j.then((function(){return r})).then((function(r){!function(t,r,n){var i={};try{i=JSON.parse(r)}catch(u){console.warn(Error(e("W5")))}o(i,n,t)}(L,r,t.src||g)}))}}))}var g,y="undefined"!=typeof Symbol,m="undefined"!=typeof self,w="undefined"!=typeof document,b=m?self:t;if(w){var S=document.querySelector("base[href]");S&&(g=S.href)}if(!g&&"undefined"!=typeof location){var x=(g=location.href.split("#")[0].split("?")[0]).lastIndexOf("/");-1!==x&&(g=g.slice(0,x+1))}var E,A=/\\/g,O=y&&Symbol.toStringTag,R=y?Symbol():"@",T=f.prototype;T.import=function(t,e,r){var n=this;return e&&"object"==typeof e&&(r=e,e=void 0),Promise.resolve(n.prepareImport()).then((function(){return n.resolve(t,e,r)})).then((function(t){var e=h(n,t,void 0,r);return e.C||p(n,e)}))},T.createContext=function(t){var e=this;return{url:t,resolve:function(r,n){return Promise.resolve(e.resolve(r,n||t))}}},T.register=function(t,e,r){E=[t,e,r]},T.getRegister=function(){var t=E;return E=void 0,t};var I=Object.freeze(Object.create(null));b.System=new f;var P,k,j=Promise.resolve(),L={imports:{},scopes:{},depcache:{},integrity:{}},U=w;if(T.prepareImport=function(t){return(U||t)&&(d(),U=!1),j},w&&(d(),window.addEventListener("DOMContentLoaded",d)),T.addImportMap=function(t,e){o(t,e||g,L)},w){window.addEventListener("error",(function(t){M=t.filename,F=t.error}));var C=location.origin}T.createScript=function(t){var e=document.createElement("script");e.async=!0,t.indexOf(C+"/")&&(e.crossOrigin="anonymous");var r=L.integrity[t];return r&&(e.integrity=r),e.src=t,e};var M,F,B={},_=T.register;T.register=function(t,e){if(w&&"loading"===document.readyState&&"string"!=typeof t){var r=document.querySelectorAll("script[src]"),n=r[r.length-1];if(n){P=t;var i=this;k=setTimeout((function(){B[n.src]=[t,e],i.import(n.src)}))}}else P=void 0;return _.call(this,t,e)},T.instantiate=function(t,r){var n=B[t];if(n)return delete B[t],n;var i=this;return Promise.resolve(T.createScript(t)).then((function(n){return new Promise((function(o,a){n.addEventListener("error",(function(){a(Error(e(3,[t,r].join(", "))))})),n.addEventListener("load",(function(){if(document.head.removeChild(n),M===t)a(F);else{var e=i.getRegister(t);e&&e[0]===P&&clearTimeout(k),o(e)}})),document.head.appendChild(n)}))}))},T.shouldFetch=function(){return!1},"undefined"!=typeof fetch&&(T.fetch=fetch);var D=T.instantiate,N=/^(text|application)\/(x-)?javascript(;|$)/;T.instantiate=function(t,r,n){var i=this;return this.shouldFetch(t,r,n)?this.fetch(t,{credentials:"same-origin",integrity:L.integrity[t],meta:n}).then((function(n){if(!n.ok)throw Error(e(7,[n.status,n.statusText,t,r].join(", ")));var o=n.headers.get("content-type");if(!o||!N.test(o))throw Error(e(4,o));return n.text().then((function(e){return e.indexOf("//# sourceURL=")<0&&(e+="\n//# sourceURL="+t),(0,eval)(e),i.getRegister(t)}))})):D.apply(this,arguments)},T.resolve=function(t,n){return s(L,r(t,n=n||g)||t,n)||function(t,r){throw Error(e(8,[t,r].join(", ")))}(t,n)};var z=T.instantiate;T.instantiate=function(t,e,r){var n=L.depcache[t];if(n)for(var i=0;i + + + Solid Demo + + + + + + + + - - Solid Demo - - - - - - - - - - -
- - - - - - - + +
+ + + + + +