nodality 1.0.194 → 1.0.195
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/animator.cjs.js +1 -1
- package/dist/animator.esm.js +1 -1
- package/dist/audionew.cjs.js +1 -1
- package/dist/audionew.esm.js +1 -1
- package/dist/beta-desktop-bar.cjs.js +1 -1
- package/dist/beta-desktop-bar.esm.js +1 -1
- package/dist/beta-mobile-bar.cjs.js +1 -1
- package/dist/beta-mobile-bar.esm.js +1 -1
- package/dist/bundle.umd.js +1 -1
- package/dist/button.cjs.js +1 -1
- package/dist/button.esm.js +1 -1
- package/dist/center.cjs.js +1 -1
- package/dist/center.esm.js +1 -1
- package/dist/checkbox.cjs.js +1 -1
- package/dist/checkbox.esm.js +1 -1
- package/dist/code.cjs.js +1 -1
- package/dist/code.esm.js +1 -1
- package/dist/container.cjs.js +1 -1
- package/dist/container.esm.js +1 -1
- package/dist/designer.cjs.js +1 -1
- package/dist/designer.esm.js +1 -1
- package/dist/dropdown.cjs.js +1 -1
- package/dist/dropdown.esm.js +1 -1
- package/dist/element-mapper.cjs.js +1 -1
- package/dist/element-mapper.esm.js +1 -1
- package/dist/finalresult.esm.js +1 -1
- package/dist/flex-card.cjs.js +1 -1
- package/dist/flex-card.esm.js +1 -1
- package/dist/flex-grid.cjs.js +1 -1
- package/dist/flex-grid.esm.js +1 -1
- package/dist/flex-row.cjs.js +1 -1
- package/dist/flex-row.esm.js +1 -1
- package/dist/floating-input.cjs.js +1 -1
- package/dist/floating-input.esm.js +1 -1
- package/dist/free.cjs.js +1 -1
- package/dist/free.esm.js +1 -1
- package/dist/image-picker.cjs.js +1 -1
- package/dist/image-picker.esm.js +1 -1
- package/dist/image.cjs.js +1 -1
- package/dist/image.esm.js +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/link-getter.cjs.js +1 -1
- package/dist/link-getter.esm.js +1 -1
- package/dist/link.cjs.js +1 -1
- package/dist/link.esm.js +1 -1
- package/dist/multiswitcher.cjs.js +1 -1
- package/dist/multiswitcher.esm.js +1 -1
- package/dist/new-nav-bar.cjs.js +1 -1
- package/dist/new-nav-bar.esm.js +1 -1
- package/dist/picker.cjs.js +1 -1
- package/dist/picker.esm.js +1 -1
- package/dist/side-nav-bar.cjs.js +1 -1
- package/dist/side-nav-bar.esm.js +1 -1
- package/dist/simple-bar.cjs.js +1 -1
- package/dist/simple-bar.esm.js +1 -1
- package/dist/slider-2025.cjs.js +1 -1
- package/dist/slider-2025.esm.js +1 -1
- package/dist/table.cjs.js +1 -1
- package/dist/table.esm.js +1 -1
- package/dist/text-field.cjs.js +1 -1
- package/dist/text-field.esm.js +1 -1
- package/dist/text.cjs.js +1 -1
- package/dist/text.esm.js +1 -1
- package/dist/ulist.cjs.js +1 -1
- package/dist/ulist.esm.js +1 -1
- package/dist/video.cjs.js +1 -1
- package/dist/video.esm.js +1 -1
- package/dist/zoom-card.cjs.js +1 -1
- package/dist/zoom-card.esm.js +1 -1
- package/layout/animator.js +1 -1
- package/layout/audio.js +1 -1
- package/layout/audionew.js +1 -1
- package/layout/base-2.js +1 -1
- package/layout/base.js +1 -1
- package/layout/beta-desktop-bar.js +1 -1
- package/layout/beta-mobile-bar.js +1 -1
- package/layout/box.js +1 -1
- package/layout/button.js +1 -1
- package/layout/cards.js +1 -1
- package/layout/center.js +1 -1
- package/layout/checkbox.js +1 -1
- package/layout/circle.js +1 -1
- package/layout/clean-row.js +1 -1
- package/layout/code.js +1 -1
- package/layout/container.js +1 -1
- package/layout/custom.js +1 -1
- package/layout/div-image.js +1 -1
- package/layout/dropdown-2025.js +1 -1
- package/layout/dropdown.js +1 -1
- package/layout/empty-element.js +1 -1
- package/layout/external-stylesheet.js +1 -1
- package/layout/flex-card.js +1 -1
- package/layout/flex-grid.js +1 -1
- package/layout/flex-row.js +1 -1
- package/layout/footer.js +1 -1
- package/layout/form-components/custom.js +1 -1
- package/layout/form-components/data-list.js +1 -1
- package/layout/form-components/floating-input.js +1 -1
- package/layout/form-components/form-all.js +1 -1
- package/layout/form-components/form.js +1 -1
- package/layout/form-components/image-picker.js +1 -1
- package/layout/form-components/picker.js +1 -1
- package/layout/form-components/radio.js +1 -1
- package/layout/form-components/radiogroup.js +1 -1
- package/layout/form-components/range.js +1 -1
- package/layout/free.js +1 -1
- package/layout/grid-new.js +1 -1
- package/layout/grid-switcher.js +1 -1
- package/layout/grid.js +1 -1
- package/layout/group.js +1 -1
- package/layout/header.js +1 -1
- package/layout/horizontal-scroller.js +1 -1
- package/layout/image-old.js +1 -1
- package/layout/image.js +1 -1
- package/layout/index.js +1 -1
- package/layout/label.js +1 -1
- package/layout/link.js +1 -1
- package/layout/list-OLD.js +1 -1
- package/layout/list.js +1 -1
- package/layout/meta-adder.js +1 -1
- package/layout/modal-2025.js +1 -1
- package/layout/modernwrap.js +1 -1
- package/layout/multiswitcher.js +1 -1
- package/layout/multiswitcherBeta.js +1 -1
- package/layout/nav-bar.js +1 -1
- package/layout/nav-factor/custom-div.js +1 -1
- package/layout/navBar-OLD.js +1 -1
- package/layout/new-flat-adder.js +1 -1
- package/layout/new-nav-bar.js +1 -1
- package/layout/offset-container.js +1 -1
- package/layout/polygon.js +1 -1
- package/layout/prerender-site.js +1 -1
- package/layout/prerender.js +1 -1
- package/layout/progress.js +1 -1
- package/layout/row.js +1 -1
- package/layout/saved-new-nav-bar.js +1 -1
- package/layout/scroll-video.js +1 -1
- package/layout/side-bar.js +1 -1
- package/layout/side-nav-bar.js +1 -1
- package/layout/simple-bar.js +1 -1
- package/layout/slider-2025.js +1 -1
- package/layout/spacer.js +1 -1
- package/layout/stack.js +1 -1
- package/layout/styler.js +1 -1
- package/layout/svg.js +1 -1
- package/layout/switcher.js +1 -1
- package/layout/table.js +1 -1
- package/layout/text-field.js +1 -1
- package/layout/text.js +1 -1
- package/layout/ulist.js +1 -1
- package/layout/video.js +1 -1
- package/layout/without-new.js +1 -1
- package/layout/wrap.js +1 -1
- package/layout/zoom-card.js +1 -1
- package/lib/card-getter.js +1 -1
- package/lib/data.js +1 -1
- package/lib/designer.js +1 -1
- package/lib/element-mapper.js +1 -1
- package/lib/keyframe-animation.js +1 -1
- package/lib/link-getter.js +1 -1
- package/lib/raster-ops.js +22 -8
- package/lib/scroll-video.js +1 -1
- package/lib/seo.js +1 -1
- package/lib/stacker.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/transform-anim.js +1 -1
- package/package.json +1 -1
package/dist/text.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e={};function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}e.d=(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},e.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var n="nodality.theme.mode",r="nodality:theme",o={mode:function(){try{var e=localStorage.getItem(n);if("light"===e||"dark"===e)return e}catch(e){}return"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}(),tokens:{light:{},dark:{}},defaults:{light:{color:"#111"},dark:{}},setDefaults:function(e){return e&&"object"===t(e)&&(e.light&&(this.defaults.light=Object.assign({},this.defaults.light,e.light)),e.dark&&(this.defaults.dark=Object.assign({},this.defaults.dark,e.dark)),this._broadcast()),this},setTokens:function(e){return e&&"object"===t(e)&&(e.light&&Object.assign(this.tokens.light,e.light),e.dark&&Object.assign(this.tokens.dark,e.dark)),this},get current(){return this.tokens[this.mode]||{}},set:function(e){if("light"!==e&&"dark"!==e)return this;if(e===this.mode)return this;this.mode=e;try{localStorage.setItem(n,e)}catch(e){}return this._broadcast(),this},toggle:function(){return this.set("dark"===this.mode?"light":"dark")},subscribe:function(e){if("undefined"==typeof document)return function(){};var t=function(t){return e(t.detail.mode,t.detail.tokens)};document.addEventListener(r,t);try{e(this.mode,this.current)}catch(e){}return function(){return document.removeEventListener(r,t)}},_broadcast:function(){"undefined"!=typeof document&&document.dispatchEvent(new CustomEvent(r,{detail:{mode:this.mode,tokens:this.current}}))}};function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(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 s(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||c(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 l(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=c(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=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 c(e,t){if(e){if("string"==typeof e)return u(e,t);var n={}.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)?u(e,t):void 0}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var f={static:function(e){return{x:.5*e.w,y:.5*e.h,amt:1}},mouse:function(e){return{x:e.mouseX,y:e.mouseY,amt:1}},hover:function(e){return{x:e.mouseX,y:e.mouseY,amt:e.hover}},scroll:function(e){return{x:.5*e.w,y:e.h*e.scroll,amt:1}},time:function(e){return{x:e.w*(.5+.34*Math.cos(.6*e.t)),y:e.h*(.5+.34*Math.sin(.8*e.t)),amt:1}}},d=Object.keys(f),h={hexalize:{stage:"cell",decl:function(e){return"uniform float ".concat(e,"size;")},code:function(e){return"\n {\n vec2 hp = warped / ".concat(e,"size;\n vec2 hr = vec2(1.0, 1.7320508), hh = hr * 0.5;\n vec2 ha = mod(hp, hr) - hh, hb = mod(hp - hh, hr) - hh;\n vec2 gv = dot(ha, ha) < dot(hb, hb) ? ha : hb;\n center = (hp - gv) * ").concat(e,"size;\n gv = abs(gv);\n edge = max(edge, smoothstep(0.44, 0.5,\n max(dot(gv, normalize(vec2(1.0, 1.7320508))), gv.x)));\n }")},uniforms:function(e,t){return{size:["1f",(e.size||24)*t]}}},offset:{stage:"warp",defaultDriver:"mouse",decl:function(e){return"uniform float ".concat(e,"strength; uniform float ").concat(e,"radius;\n uniform vec2 ").concat(e,"dpos; uniform float ").concat(e,"damt;")},code:function(e){return"\n {\n float d = length(warped - ".concat(e,"dpos);\n float fall = 1.0 - smoothstep(0.0, ").concat(e,"radius, d);\n vec2 dir = d > 0.5 ? (warped - ").concat(e,"dpos) / d : vec2(0.0);\n warped -= dir * ").concat(e,"strength * fall * ").concat(e,"damt;\n }")},uniforms:function(e,t){return{strength:["1f",(e.strength||20)*t],radius:["1f",(e.radius||260)*t]}}},duotone:{stage:"color",decl:function(e){return"uniform vec3 ".concat(e,"a; uniform vec3 ").concat(e,"b; uniform float ").concat(e,"radius;\n uniform vec2 ").concat(e,"dpos; uniform float ").concat(e,"damt;")},code:function(e,t){return"\n {\n float lum = dot(col, vec3(0.299, 0.587, 0.114));\n vec3 duo = mix(".concat(e,"a, ").concat(e,"b, lum);\n ").concat(t.by?"float mask = (1.0 - smoothstep(".concat(e,"radius * 0.35, ").concat(e,"radius,\n length(center - ").concat(e,"dpos))) * ").concat(e,"damt;"):"float mask = 1.0;","\n col = mix(col, duo, mask);\n }")},uniforms:function(e,t){var n=e.colors||["#104B87","#E8FF00"];return{a:["3fv",m(n[0])],b:["3fv",m(n[1])],radius:["1f",(e.radius||220)*t]}}},edges:{stage:"color",decl:function(e){return"uniform vec3 ".concat(e,"color; uniform float ").concat(e,"strength;")},code:function(e){return"\n {\n edgeCol = ".concat(e,"color;\n edgeCov = max(edgeCov, edge * ").concat(e,"strength);\n }")},uniforms:function(e){return{color:["3fv",m(e.color||"#FFFFFF")],strength:["1f",null!=e.strength?e.strength:1]}}},halftone:{stage:"color",decl:function(e){return"\n uniform float ".concat(e,"size;\n uniform float ").concat(e,"angle;\n uniform vec3 ").concat(e,"ink;\n uniform vec3 ").concat(e,"paper;\n uniform float ").concat(e,"soft;\n uniform float ").concat(e,"radius;\n uniform vec2 ").concat(e,"dpos;\n uniform float ").concat(e,"damt;")},code:function(e,t){return"\n {\n float lum = dot(col, vec3(0.299, 0.587, 0.114));\n float sz = ".concat(e,"size;").concat(t.by?"\n float fd = 1.0 - smoothstep(0.0, ".concat(e,"radius, length(frag - ").concat(e,"dpos));\n sz *= 1.0 + fd * ").concat(e,"damt * 1.8;"):"","\n // Screen angle: rotating the grid is what stops the dots\n // reading as a horizontal/vertical texture.\n float ca = cos(").concat(e,"angle), sa = sin(").concat(e,"angle);\n vec2 rp = vec2(ca * frag.x - sa * frag.y,\n sa * frag.x + ca * frag.y) / max(sz, 1.0);\n vec2 cell = fract(rp) - 0.5;\n // Dot radius from tone: darker tone prints a bigger dot.\n // sqrt because ink coverage goes as area, not radius.\n float rr = sqrt(clamp(1.0 - lum, 0.0, 1.0)) * 0.55;\n float dm = smoothstep(rr, rr - ").concat(e,"soft, length(cell));\n col = mix(").concat(e,"paper, ").concat(e,"ink, dm);\n }")},uniforms:function(e,t){return{size:["1f",(e.size||6)*t],angle:["1f",(null!=e.angle?e.angle:15)*Math.PI/180],ink:["3fv",m(e.ink||"#0B1B2B")],paper:["3fv",m(e.paper||"#FFFFFF")],soft:["1f",null!=e.softness?e.softness:.08],radius:["1f",(e.radius||220)*t]}}},aberration:{stage:"displace",chroma:!0,decl:function(e){return"\n uniform float ".concat(e,"amount;\n uniform float ").concat(e,"radius;\n uniform vec2 ").concat(e,"dpos;\n uniform float ").concat(e,"damt;")},code:function(e,t){return"\n {\n vec2 ctr = ".concat(t.by?"".concat(e,"dpos"):"u_res * 0.5",";\n vec2 dv = sampleP - ctr;\n float dl = length(dv);\n vec2 dir = dl > 0.5 ? dv / dl : vec2(0.0);\n ").concat(t.by?"float amt = ".concat(e,"amount * ").concat(e,"damt *\n (1.0 - smoothstep(0.0, ").concat(e,"radius, dl));"):"float amt = ".concat(e,"amount * (dl / max(length(u_res) * 0.5, 1.0));"),"\n chroma += dir * amt;\n }")},uniforms:function(e,t){return{amount:["1f",(null!=e.amount?e.amount:6)*t],radius:["1f",(e.radius||240)*t]}}},mask:{stage:"field",producesField:!0,defaultDriver:"static",decl:function(e){return"\n uniform vec2 ".concat(e,"dpos;\n uniform float ").concat(e,"damt;\n uniform float ").concat(e,"radius;\n uniform vec2 ").concat(e,"at;\n uniform vec2 ").concat(e,"remap;\n uniform float ").concat(e,"invert;")},code:function(e,t){var n=t.from||"radial",r=t.at?"(".concat(e,"at * u_res)"):"".concat(e,"dpos"),o="vertical"===n?"frag.y / max(u_res.y, 1.0)":"horizontal"===n?"frag.x / max(u_res.x, 1.0)":"1.0 - smoothstep(0.0, ".concat(e,"radius, length(frag - ").concat(r,"))");return"\n {\n float m = ".concat(o,";\n m = clamp((m - ").concat(e,"remap.x) / max(").concat(e,"remap.y - ").concat(e,"remap.x, 1e-4), 0.0, 1.0);\n m = mix(m, 1.0 - m, ").concat(e,"invert);\n ").concat(y(t.as||"mask")," *= m * ").concat(e,"damt;\n }")},uniforms:function(e,t){return{radius:["1f",(null!=e.radius?e.radius:260)*t],at:["2fv",e.at||[.5,.5]],remap:["2fv",e.remap||[0,1]],invert:["1f",e.invert?1:0]}}},noise:{stage:"field",producesField:!0,decl:function(e){return"\n uniform float ".concat(e,"scale;\n uniform float ").concat(e,"speed;\n uniform vec2 ").concat(e,"remap;\n uniform float ").concat(e,"amp;\n float ").concat(e,"h(vec2 v) {\n return fract(sin(dot(v, vec2(41.113, 289.717))) * 43758.545);\n }\n float ").concat(e,"n(vec2 v) {\n vec2 i = floor(v), f = v - i;\n f = f * f * (3.0 - 2.0 * f);\n return mix(mix(").concat(e,"h(i), ").concat(e,"h(i + vec2(1.0, 0.0)), f.x),\n mix(").concat(e,"h(i + vec2(0.0, 1.0)), ").concat(e,"h(i + vec2(1.0, 1.0)), f.x), f.y);\n }")},code:function(e,t){return"\n {\n vec2 np = frag / max(u_res.y, 1.0) * ".concat(e,"scale;\n // Two octaves: enough structure to read as turbulence\n // without the cost of a full fBm.\n float n = ").concat(e,"n(np + u_time * ").concat(e,"speed) * 0.65 +\n ").concat(e,"n(np * 2.7 - u_time * ").concat(e,"speed * 0.6) * 0.35;\n n = clamp((n - ").concat(e,"remap.x) / max(").concat(e,"remap.y - ").concat(e,"remap.x, 1e-4), 0.0, 1.0);\n ").concat(y(t.as||"mask")," *= mix(1.0, n, ").concat(e,"amp);\n }")},uniforms:function(e){return{scale:["1f",null!=e.scale?e.scale:3],speed:["1f",null!=e.speed?e.speed:.3],remap:["2fv",e.remap||[0,1]],amp:["1f",null!=e.amount?e.amount:1]}}},copy:{stage:"color",defaultDriver:"static",decl:function(e){return"\n uniform vec2 ".concat(e,"dpos;\n uniform float ").concat(e,"damt;\n uniform float ").concat(e,"radius;\n uniform float ").concat(e,"scale;\n uniform float ").concat(e,"rotate;\n uniform float ").concat(e,"fade;\n uniform float ").concat(e,"amount;")},code:function(e,t){for(var n=Array.isArray(t.points)&&t.points.length>0,r=n?t.points.length:Math.max(1,Math.min(24,Math.round(t.count||5))),o="",i=function(i){var a,s=n?"vec2(".concat((+t.points[i][0]).toFixed(5),", ").concat((+t.points[i][1]).toFixed(5),") * u_res"):(a=i/r*Math.PI*2,"".concat(e,"dpos + vec2(").concat(Math.cos(a).toFixed(5),", ")+"".concat(Math.sin(a).toFixed(5),") * ").concat(e,"radius"));o+="\n {\n float ang = ".concat(e,"rotate * ").concat((i+1).toFixed(1),";\n float cs = cos(ang), sn = sin(ang);\n // Inverse transform: to draw a stamp scaled by s about a\n // centre c, fetch from the source at (frag - c) / s.\n vec2 d = mat2(cs, -sn, sn, cs) * (frag - (").concat(s,"));\n vec2 q = d / max(").concat(e,"scale, 1e-3) + u_res * 0.5;\n vec2 quv = vec2(q.x / u_res.x, 1.0 - q.y / u_res.y);\n vec2 inside = step(vec2(0.0), quv) * step(quv, vec2(1.0));\n vec4 s = texture2D(u_tex, clamp(quv, 0.0, 1.0));\n float w = s.a * inside.x * inside.y * ").concat(e,"amount * ").concat(e,"damt\n * pow(").concat(e,"fade, ").concat(i.toFixed(1),");\n // Straight-alpha OVER, newest stamp on top.\n float na = w + ovA * (1.0 - w);\n ovCol = (s.rgb * w + ovCol * ovA * (1.0 - w)) / max(na, 1e-4);\n ovA = na;\n }")},a=0;a<r;a++)i(a);return o},uniforms:function(e,t){return{radius:["1f",(null!=e.radius?e.radius:110)*t],scale:["1f",null!=e.scale?e.scale:.5],rotate:["1f",null!=e.rotate?e.rotate:0],fade:["1f",null!=e.fade?e.fade:1],amount:["1f",null!=e.amount?e.amount:1]}}},merge:{stage:"color",decl:function(e){return"uniform float ".concat(e,"mix;")},code:function(){return""},uniforms:function(e){return{mix:["1f",null!=e.mix?e.mix:1]}}},echo:{stage:"color",decl:function(e){return"\n uniform sampler2D ".concat(e,"hist;\n uniform float ").concat(e,"strength;\n uniform vec3 ").concat(e,"tint;\n uniform float ").concat(e,"tintAmt;")},code:function(e){return"\n {\n // Sampled in screen space: the trail records where things\n // WERE, which is not where a warp op would fetch them from.\n vec2 huv = vec2(frag.x / u_res.x, 1.0 - frag.y / u_res.y);\n vec4 h = texture2D(".concat(e,"hist, clamp(huv, 0.001, 0.999));\n float ha = clamp(h.a * ").concat(e,"strength, 0.0, 1.0);\n vec3 hc = mix(h.rgb, ").concat(e,"tint, ").concat(e,"tintAmt);\n // Straight-alpha OVER into the border layer so an edges op\n // in the same chain still composites correctly.\n float na = ha + edgeCov * (1.0 - ha);\n edgeCol = (hc * ha + edgeCol * edgeCov * (1.0 - ha)) / max(na, 1e-4);\n edgeCov = na;\n }")},uniforms:function(e){return{strength:["1f",null!=e.strength?e.strength:.85],tint:["3fv",m(e.tint||"#7FD4FF")],tintAmt:["1f",e.tint?null!=e.tintAmount?e.tintAmount:.5:0]}},solver:{resolutions:function(e,t,n){return{frame:[t,n]}},targets:{history:{double:!0,res:"frame",fmt:"rgba",smooth:!0}},samplers:{hist:"history"},programs:{accumulate:"\nprecision highp float;\nuniform sampler2D u_content;\nuniform sampler2D u_hist;\nuniform vec2 u_texel;\nuniform float u_decay;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n vec4 c = texture2D(u_content, uv);\n vec4 h = texture2D(u_hist, uv) * u_decay;\n gl_FragColor = max(c, h);\n}"},splatColor:function(){return[0,0,0]},step:function(e,t,n){var r=Math.min(n.dt,1/30),o=Math.pow(null!=t.decay?t.decay:.92,60*r);e.use("accumulate"),e.f2("u_texel",1/e.canvasW,1/e.canvasH),e.f1("u_decay",o),e.smp("u_content",e.content,0),e.smp("u_hist",e.read("history"),1),e.blit(e.write("history")),e.swap("history")}}},stir:{stage:["warp","color"],decl:function(e){return"\n uniform sampler2D ".concat(e,"vel;\n uniform sampler2D ").concat(e,"dye;\n uniform float ").concat(e,"strength;\n uniform float ").concat(e,"dyemix;\n uniform float ").concat(e,"intensity;\n uniform float ").concat(e,"sheen;\n uniform vec3 ").concat(e,"tint;")},code:function(e,t,n){return"warp"===n?"\n {\n // frag/warped are top-down pixels, the field is bottom-up\n // [0,1]: flip y going in, and flip the y of the vector coming\n // out so the content drags WITH the pointer.\n vec2 fuv = vec2(warped.x / u_res.x, 1.0 - warped.y / u_res.y);\n vec2 v = texture2D(".concat(e,"vel, clamp(fuv, 0.001, 0.999)).xy;\n warped += vec2(v.x, -v.y) * ").concat(e,"strength;\n }"):"\n {\n // Sampled at the CONTINUOUS warped position, never at the\n // cell centre: a cell op upstream (hexalize) snaps the cell\n // centre to one point per tile, which would quantise the\n // liquid into flat per-hex patches instead of smooth swirls.\n vec2 suv = vec2(warped.x / u_res.x, 1.0 - warped.y / u_res.y);\n vec3 dc = texture2D(".concat(e,"dye, clamp(suv, 0.001, 0.999)).rgb;\n float mag = length(dc);\n // Colour is carried IN the dye field and advected with it, so\n // a ribbon keeps its hue while the flow folds it. Deriving\n // colour from the local flow direction instead would make\n // neighbouring pixels jump hue and read as confetti.\n vec3 liquid = mag > 1e-4 ? clamp(dc / mag * 1.25, 0.0, 1.0) : ").concat(e,"tint;\n float amt = clamp((1.0 - exp(-mag * ").concat(e,"intensity)) * ").concat(e,"dyemix, 0.0, 1.0);\n // Straight-alpha OVER so a later overlay op (blobs) still\n // composites correctly on top of the liquid.\n float na = amt + ovA * (1.0 - amt);\n ovCol = (liquid * amt + ovCol * ovA * (1.0 - amt)) / max(na, 1e-4);\n ovA = na;\n\n // Faint sheen on the content itself where the flow is fast.\n float sp = length(texture2D(").concat(e,"vel, clamp(suv, 0.001, 0.999)).xy);\n col = mix(col, ").concat(e,"tint, (1.0 - exp(-sp * 0.7)) * ").concat(e,"sheen);\n }")},uniforms:function(e,t){return{strength:["1f",(null!=e.strength?e.strength:26)*t],sheen:["1f",null!=e.sheen?e.sheen:.15],tint:["3fv",m(e.tint||"#7FD4FF")],dyemix:["1f",null!=e.dye?e.dye:.85],intensity:["1f",null!=e.intensity?e.intensity:1.6]}},solver:{resolutions:function(e){return{sim:Math.max(32,Math.min(e.resolution||128,512)),dye:Math.max(64,Math.min(e.dyeResolution||512,1024))}},targets:{velocity:{double:!0,res:"sim",fmt:"rg",smooth:!0},dye:{double:!0,res:"dye",fmt:"rgba",smooth:!0},pressure:{double:!0,res:"sim",fmt:"r",smooth:!1},divergence:{double:!1,res:"sim",fmt:"r",smooth:!1},vorticity:{double:!1,res:"sim",fmt:"r",smooth:!1}},samplers:{vel:"velocity",dye:"dye"},programs:{splat:"\nprecision highp float;\nuniform sampler2D u_src;\nuniform vec2 u_texel;\nuniform vec2 u_point;\nuniform vec3 u_amount;\nuniform float u_radius;\nuniform float u_aspect;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n vec2 d = uv - u_point;\n if (u_aspect >= 1.0) d.y /= u_aspect; else d.x *= u_aspect;\n float g = exp(-dot(d, d) / max(u_radius * u_radius, 1e-6));\n gl_FragColor = vec4(texture2D(u_src, uv).xyz + u_amount * g, 1.0);\n}",advect:"\nprecision highp float;\nuniform sampler2D u_vel;\nuniform sampler2D u_src;\nuniform vec2 u_texel;\nuniform float u_dt;\nuniform float u_diss;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n vec2 back = uv - texture2D(u_vel, uv).xy * u_dt;\n gl_FragColor = vec4(texture2D(u_src, clamp(back, 0.0, 1.0)).xyz * u_diss, 1.0);\n}",curl:"\nprecision highp float;\nuniform sampler2D u_vel;\nuniform vec2 u_texel;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n float r = texture2D(u_vel, uv + vec2(u_texel.x, 0.0)).y;\n float l = texture2D(u_vel, uv - vec2(u_texel.x, 0.0)).y;\n float t = texture2D(u_vel, uv + vec2(0.0, u_texel.y)).x;\n float b = texture2D(u_vel, uv - vec2(0.0, u_texel.y)).x;\n gl_FragColor = vec4(0.5 * ((r - l) - (t - b)), 0.0, 0.0, 1.0);\n}",confine:"\nprecision highp float;\nuniform sampler2D u_vel;\nuniform sampler2D u_curl;\nuniform vec2 u_texel;\nuniform float u_eps;\nuniform float u_dt;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n float r = texture2D(u_curl, uv + vec2(u_texel.x, 0.0)).x;\n float l = texture2D(u_curl, uv - vec2(u_texel.x, 0.0)).x;\n float t = texture2D(u_curl, uv + vec2(0.0, u_texel.y)).x;\n float b = texture2D(u_curl, uv - vec2(0.0, u_texel.y)).x;\n float c = texture2D(u_curl, uv).x;\n vec2 grad = 0.5 * vec2(abs(r) - abs(l), abs(t) - abs(b));\n vec2 n = grad / (length(grad) + 1e-5);\n vec2 force = u_eps * c * vec2(n.y, -n.x);\n vec2 v = texture2D(u_vel, uv).xy + force * u_dt;\n gl_FragColor = vec4(clamp(v, -64.0, 64.0), 0.0, 1.0);\n}",divergence:"\nprecision highp float;\nuniform sampler2D u_vel;\nuniform vec2 u_texel;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n float r = texture2D(u_vel, uv + vec2(u_texel.x, 0.0)).x;\n float l = texture2D(u_vel, uv - vec2(u_texel.x, 0.0)).x;\n float t = texture2D(u_vel, uv + vec2(0.0, u_texel.y)).y;\n float b = texture2D(u_vel, uv - vec2(0.0, u_texel.y)).y;\n vec2 c = texture2D(u_vel, uv).xy;\n if (uv.x - u_texel.x < 0.0) l = -c.x;\n if (uv.x + u_texel.x > 1.0) r = -c.x;\n if (uv.y - u_texel.y < 0.0) b = -c.y;\n if (uv.y + u_texel.y > 1.0) t = -c.y;\n gl_FragColor = vec4(0.5 * ((r - l) + (t - b)), 0.0, 0.0, 1.0);\n}",jacobi:"\nprecision highp float;\nuniform sampler2D u_p;\nuniform sampler2D u_div;\nuniform vec2 u_texel;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n float r = texture2D(u_p, uv + vec2(u_texel.x, 0.0)).x;\n float l = texture2D(u_p, uv - vec2(u_texel.x, 0.0)).x;\n float t = texture2D(u_p, uv + vec2(0.0, u_texel.y)).x;\n float b = texture2D(u_p, uv - vec2(0.0, u_texel.y)).x;\n float d = texture2D(u_div, uv).x;\n gl_FragColor = vec4((r + l + t + b - d) * 0.25, 0.0, 0.0, 1.0);\n}",subtract:"\nprecision highp float;\nuniform sampler2D u_p;\nuniform sampler2D u_vel;\nuniform vec2 u_texel;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n float r = texture2D(u_p, uv + vec2(u_texel.x, 0.0)).x;\n float l = texture2D(u_p, uv - vec2(u_texel.x, 0.0)).x;\n float t = texture2D(u_p, uv + vec2(0.0, u_texel.y)).x;\n float b = texture2D(u_p, uv - vec2(0.0, u_texel.y)).x;\n vec2 v = texture2D(u_vel, uv).xy - 0.5 * vec2(r - l, t - b);\n gl_FragColor = vec4(v, 0.0, 1.0);\n}",decay:"\nprecision highp float;\nuniform sampler2D u_tex;\nuniform vec2 u_texel;\nuniform float u_value;\nvoid main() {\n gl_FragColor = texture2D(u_tex, gl_FragCoord.xy * u_texel) * u_value;\n}"},splatColor:function(e,t,n){var r=null!=e.dyeAmount?e.dyeAmount:.6;if(!e.rainbow){var o=m(e.tint||"#7FD4FF");return[o[0]*r,o[1]*r,o[2]*r]}var i=Math.atan2(n,t);return[(.5+.5*Math.cos(i))*r,(.5+.5*Math.cos(i+2.0944))*r,(.5+.5*Math.cos(i+4.1888))*r]},step:function(e,t,n){var r=Math.min(n.dt,1/30),o=1/e.res.sim,i=1/e.res.dye,a=function(e,t){return Math.pow(e,60*t)};if(n.moving){var s=null!=t.force?t.force:1;e.use("splat"),e.f1("u_radius",null!=t.radius?t.radius:.1),e.f1("u_aspect",n.aspect),e.f2("u_point",n.px,n.py),e.f2("u_texel",o,o),e.smp("u_src",e.read("velocity"),0),e.f3("u_amount",n.dx*s,n.dy*s,0),e.blit(e.write("velocity")),e.swap("velocity"),e.f2("u_texel",i,i),e.smp("u_src",e.read("dye"),0),e.f3("u_amount",n.col[0],n.col[1],n.col[2]),e.blit(e.write("dye")),e.swap("dye")}e.use("curl"),e.f2("u_texel",o,o),e.smp("u_vel",e.read("velocity"),0),e.blit(e.single("vorticity")),e.use("confine"),e.f2("u_texel",o,o),e.f1("u_eps",null!=t.curl?t.curl:2.2),e.f1("u_dt",r),e.smp("u_vel",e.read("velocity"),0),e.smp("u_curl",e.single("vorticity"),1),e.blit(e.write("velocity")),e.swap("velocity"),e.use("divergence"),e.f2("u_texel",o,o),e.smp("u_vel",e.read("velocity"),0),e.blit(e.single("divergence")),e.use("decay"),e.f2("u_texel",o,o),e.f1("u_value",a(null!=t.pressure?t.pressure:.8,r)),e.smp("u_tex",e.read("pressure"),0),e.blit(e.write("pressure")),e.swap("pressure"),e.use("jacobi"),e.f2("u_texel",o,o),e.smp("u_div",e.single("divergence"),1);for(var l=Math.max(1,Math.min(t.pressureIterations||6,40)),c=0;c<l;c++)e.smp("u_p",e.read("pressure"),0),e.blit(e.write("pressure")),e.swap("pressure");e.use("subtract"),e.f2("u_texel",o,o),e.smp("u_p",e.read("pressure"),0),e.smp("u_vel",e.read("velocity"),1),e.blit(e.write("velocity")),e.swap("velocity"),e.use("advect"),e.f1("u_dt",r),e.f2("u_texel",o,o),e.smp("u_vel",e.read("velocity"),0),e.smp("u_src",e.read("velocity"),0),e.f1("u_diss",a(null!=t.decay?t.decay:.985,r)),e.blit(e.write("velocity")),e.swap("velocity"),e.f2("u_texel",i,i),e.smp("u_vel",e.read("velocity"),0),e.smp("u_src",e.read("dye"),1),e.f1("u_diss",a(null!=t.dyeFade?t.dyeFade:.97,r)),e.blit(e.write("dye")),e.swap("dye")}}},blobs:{stage:"color",overlay:!0,mips:!0,decl:function(e){return"\n uniform vec3 ".concat(e,"blobs[").concat(12,"];\n uniform int ").concat(e,"count;\n uniform vec3 ").concat(e,"tint;\n uniform float ").concat(e,"refract;\n uniform float ").concat(e,"rim;\n uniform float ").concat(e,"alpha;\n uniform float ").concat(e,"irid;\n uniform float ").concat(e,"disp;\n uniform float ").concat(e,"frost;\n float ").concat(e,"hash(vec3 v) {\n return fract(sin(dot(v, vec3(21.9898, 63.233, 41.719))) * 41739.317);\n }\n float ").concat(e,"noise(vec3 v) {\n vec3 f = floor(v);\n vec3 r = v - f;\n r = r * r * (3.0 - 2.0 * r);\n float c000 = ").concat(e,"hash(f);\n float c100 = ").concat(e,"hash(f + vec3(1.0, 0.0, 0.0));\n float c010 = ").concat(e,"hash(f + vec3(0.0, 1.0, 0.0));\n float c110 = ").concat(e,"hash(f + vec3(1.0, 1.0, 0.0));\n float c001 = ").concat(e,"hash(f + vec3(0.0, 0.0, 1.0));\n float c101 = ").concat(e,"hash(f + vec3(1.0, 0.0, 1.0));\n float c011 = ").concat(e,"hash(f + vec3(0.0, 1.0, 1.0));\n float c111 = ").concat(e,"hash(f + vec3(1.0, 1.0, 1.0));\n return mix(\n mix(mix(c000, c100, r.x), mix(c010, c110, r.x), r.y),\n mix(mix(c001, c101, r.x), mix(c011, c111, r.x), r.y), r.z);\n }")},code:function(e){return"\n {\n float field = 0.0;\n vec2 grad = vec2(0.0);\n for (int bi = 0; bi < ".concat(12,"; bi++) {\n if (bi >= ").concat(e,"count) break;\n vec2 bd = frag - ").concat(e,"blobs[bi].xy;\n float br = ").concat(e,"blobs[bi].z;\n float dd = max(dot(bd, bd), 1.0);\n field += (br * br) / dd;\n grad += (-2.0 * (br * br) / (dd * dd)) * bd;\n }\n float bmask = smoothstep(0.6, 1.0, field);\n if (bmask > 0.003) {\n float gmag = length(grad);\n vec2 g2 = gmag > 1e-6 ? -grad / gmag : vec2(0.0);\n // Pseudo-3D surface normal from the 2D field. For a\n // metaball field (sum of r^2/d^2), 1/sqrt(field) IS the\n // normalized radial position: 0 at the centre, 1 at the\n // surface. That yields a true hemisphere profile — the\n // curvature (and therefore refraction) varies smoothly\n // across the WHOLE disc, not just an edge annulus.\n float s = clamp(inversesqrt(max(field, 1e-4)), 0.0, 1.0);\n vec3 n = normalize(vec3(g2 * s, sqrt(max(1.0 - s * s, 0.004))));\n vec3 rd = vec3(0.0, 0.0, -1.0);\n\n // Dispersion: refract each channel with a slightly\n // different index (water-glass ~1.33). Near the rim the\n // exit direction flattens (|z| -> 0), so the sampling\n // offsets stretch — producing the smooth concentric\n // colour-fringed bands of a thick lens.\n float ca = 0.03 * ").concat(e,"disp;\n vec3 tR = refract(rd, n, 1.0 / (1.33 - ca));\n vec3 tG = refract(rd, n, 1.0 / 1.33);\n vec3 tB = refract(rd, n, 1.0 / (1.33 + ca));\n vec2 oR = tR.xy * (").concat(e,"refract / max(abs(tR.z), 0.3));\n vec2 oG = tG.xy * (").concat(e,"refract / max(abs(tG.z), 0.3));\n vec2 oB = tB.xy * (").concat(e,"refract / max(abs(tB.z), 0.3));\n\n // Blur grows with how far the ray was bent (mip bias), so\n // strongly-refracted regions smear smoothly instead of\n // showing sharp displaced copies. frost adds a base blur.\n float lod = ").concat(e,"frost * 5.0 + log2(1.0 + length(oG) * 0.035);\n vec2 px = 1.0 / u_res;\n vec4 sG = texture2D(u_tex, clamp(uv + oG * px, 0.002, 0.998), lod);\n vec3 refr;\n refr.r = texture2D(u_tex, clamp(uv + oR * px, 0.002, 0.998), lod).r;\n refr.g = sG.g;\n refr.b = texture2D(u_tex, clamp(uv + oB * px, 0.002, 0.998), lod).b;\n // Blend in (approximately) linear light for clean fringes.\n refr = pow(max(refr, 0.0), vec3(2.2));\n\n vec3 tintLin = pow(").concat(e,"tint, vec3(2.2));\n vec3 bodyLin = mix(tintLin * 0.35, refr, sG.a);\n\n // Glass darkens toward the silhouette (absorption), the\n // opposite of an additive glow ring.\n float edge = pow(1.0 - clamp(n.z, 0.0, 1.0), 1.5);\n bodyLin *= 1.0 - 0.35 * ").concat(e,"rim * edge;\n vec3 body = pow(max(bodyLin, 0.0), vec3(1.0 / 2.2));\n\n // Sparse iridescent glints: two drifting value-noise\n // fields sampled on the reflection direction, one warm\n // one cool, sharpened hard so only sparkles survive.\n vec3 rf = reflect(rd, n);\n float nA = ").concat(e,"noise(rf * 2.3 + u_time * 0.5);\n float nB = ").concat(e,"noise(rf * 2.3 - u_time * 0.5);\n vec3 glint = pow(max(vec3(0.30, 0.52, 0.86) * nA +\n vec3(0.80, 0.56, 0.34) * nB, 0.0), vec3(6.0));\n body += glint * ").concat(e,"irid;\n\n // Small hard specular from a fixed key light.\n vec3 L = normalize(vec3(-0.5, 0.7, 0.6));\n float spec = pow(max(dot(reflect(-L, n), vec3(0.0, 0.0, 1.0)), 0.0), 60.0);\n body += spec * 0.35;\n\n ovCol = body;\n ovA = max(ovA, bmask * ").concat(e,"alpha);\n }\n }")},uniforms:function(e,t){return{tint:["3fv",m(e.color||"#EAF4EE")],refract:["1f",(null!=e.refract?e.refract:70)*t],rim:["1f",null!=e.rim?e.rim:.6],alpha:["1f",null!=e.alpha?e.alpha:1],irid:["1f",null!=e.iridescence?e.iridescence:.8],disp:["1f",null!=e.dispersion?e.dispersion:1],frost:["1f",null!=e.frost?e.frost:.25]}},init:function(e,t,n,r){for(var o=(e.radius||46)*t,i=Math.max(1,Math.min(null!=e.trail?e.trail:7,12)),a=[],s=0,l=0;l<i;l++){var c=Math.pow(.86,l);a.push(c),s+=c*c}for(var u=Math.sqrt(s),f=a.map(function(e){return o*e/u}),d=a.map(function(e,t){return.85*o*Math.pow(.955,t)}),h=function(e,t){return e+Math.random()*(t-e)},m=Math.max(0,Math.min((e.count||1)-1,12-i)),p=[],v=0;v<m;v++){var y=h(0,2*Math.PI),g=h(30,80)*t;p.push({x:h(o,n-o),y:h(o,r-o),r:o*h(.45,.8),vx:Math.cos(y)*g,vy:Math.sin(y)*g,phase:h(0,2*Math.PI)})}for(var x={x:.5*n,y:.55*r},b=[],w=0;w<i;w++)b.push({x:x.x,y:x.y});return{head:x,chain:b,nTrail:i,drifters:p,trailIdleR:f,trailMoveR:d,stretch:0,seg:.9*o}},tick:function(e,t){var n=Math.min(t.dt,.05),r=t.w,o=t.h,i=1-Math.exp(9*-n);e.head.x+=(t.mouseX-e.head.x)*i,e.head.y+=(t.mouseY-e.head.y)*i;var a=e.chain;a[0].x=e.head.x,a[0].y=e.head.y;for(var s=1-Math.exp(16*-n),c=1;c<a.length;c++){var u=a[c-1],f=a[c],d=u.x-f.x,h=u.y-f.y,m=Math.hypot(d,h)||1e-4,p=e.seg;m>p&&(f.x+=d*(1-p/m),f.y+=h*(1-p/m)),f.x+=(u.x-f.x)*s,f.y+=(u.y-f.y)*s}var v=a[a.length-1],y=Math.hypot(v.x-e.head.x,v.y-e.head.y),g=Math.max(1,e.seg*(e.nTrail-1)),x=Math.min(1,y/g);e.stretch+=(x-e.stretch)*(1-Math.exp(8*-n));var b,w=l(e.drifters);try{for(w.s();!(b=w.n()).done;){var k=b.value;k.x+=k.vx*n,k.y+=k.vy*n,k.x<k.r?(k.x=k.r,k.vx=Math.abs(k.vx)):k.x>r-k.r&&(k.x=r-k.r,k.vx=-Math.abs(k.vx)),k.y<k.r?(k.y=k.r,k.vy=Math.abs(k.vy)):k.y>o-k.r&&(k.y=o-k.r,k.vy=-Math.abs(k.vy)),k.phase+=1.6*n}}catch(e){w.e(e)}finally{w.f()}for(var _=new Float32Array(36),S=e.stretch,E=0;E<e.nTrail;E++){var T=a[E];_[3*E]=T.x,_[3*E+1]=T.y,_[3*E+2]=e.trailIdleR[E]+(e.trailMoveR[E]-e.trailIdleR[E])*S}return e.drifters.forEach(function(t,n){var r=e.nTrail+n;_[3*r]=t.x,_[3*r+1]=t.y,_[3*r+2]=t.r*(1+.12*Math.sin(t.phase))}),[{name:"blobs",kind:"3fv",value:_},{name:"count",kind:"1i",value:e.nTrail+e.drifters.length}]}}};function m(e){return[1,3,5].map(function(t){return parseInt(e.slice(t,t+2),16)/255})}Object.keys(h).concat("switch");var p="attribute vec2 a; void main(){ gl_Position = vec4(a, 0.0, 1.0); }",v={warp:["warped"],cell:["center","edge"],displace:["sampleP","chroma"],color:["col","edgeCol","edgeCov","ovCol","ovA"]},y=function(e){return"fld_".concat(String(e).replace(/[^A-Za-z0-9_]/g,""))},g=function(e){return!0===e.masked?"mask":"string"==typeof e.masked?e.masked:null},x=function(e){return"edge"===e||"edgeCov"===e||"ovA"===e?"float":"col"===e||"edgeCol"===e||"ovCol"===e?"vec3":"vec2"},b={over:function(e,t){return t},add:function(e,t){return"min(".concat(e," + ").concat(t,", vec3(1.0))")},screen:function(e,t){return"1.0 - (1.0 - ".concat(e,") * (1.0 - ").concat(t,")")},multiply:function(e,t){return"".concat(e," * ").concat(t)},difference:function(e,t){return"abs(".concat(e," - ").concat(t,")")},lighten:function(e,t){return"max(".concat(e,", ").concat(t,")")},darken:function(e,t){return"min(".concat(e,", ").concat(t,")")}};function w(e,t){var n,r=[],o=l(e||[]);try{for(o.s();!(n=o.n()).done;){var i=n.value;if(i&&i.op){var a={node:i,i:t.length};t.push(i),"merge"===i.op&&(a.a=w(i.a,t),a.b=w(i.b,t)),r.push(a)}}}catch(e){o.e(e)}finally{o.f()}return r}function k(e,t){var n,r=l(e);try{var o=function(){var e=n.value,r=e.node;if("merge"===r.op)return function(e,t){var n="u".concat(e.i,"_"),r=b[e.node.mode]||b.over,o={field:"",warp:"",cell:"",displace:"",color:""},i={field:"",warp:"",cell:"",displace:"",color:""};k(e.a||[],o),k(e.b||[],i),t.field+=o.field+i.field;for(var a=function(){var e=l[s];if(!o[e]&&!i[e])return 1;var a=v[e],c=" {\n";a.forEach(function(e,t){c+=" ".concat(x(e)," pre").concat(t," = ").concat(e,";\n")}),c+=o[e],a.forEach(function(e,t){c+=" ".concat(x(e)," bra").concat(t," = ").concat(e,";\n")}),a.forEach(function(e,t){c+=" ".concat(e," = pre").concat(t,";\n")}),c+=i[e],a.forEach(function(e,t){var o="vec3"===x(e)?r("bra".concat(t),e):e;c+=" ".concat(e," = mix(bra").concat(t,", ").concat(o,", ").concat(n,"mix);\n")}),c+=" }\n",t[e]+=c},s=0,l=["warp","cell","displace","color"];s<l.length;s++)a()}(e,t),0;var o=h[r.op];if(!o)return 0;var i="u".concat(e.i,"_"),a=Array.isArray(o.stage)?o.stage:[o.stage],s=g(r);a.forEach(function(e){var n=o.code(i,r,e)+"\n";if(s&&v[e]){var a=v[e],l=a.map(function(e,t){return" ".concat(x(e)," msv").concat(t," = ").concat(e,";")}).join("\n"),c=a.map(function(e,t){return" ".concat(e," = mix(msv").concat(t,", ").concat(e,", ").concat(y(s),");")}).join("\n");n=" {\n".concat(l,"\n").concat(n,"\n").concat(c,"\n }\n")}t["field"===e||"warp"===e||"cell"===e||"displace"===e?e:"color"]+=n})};for(r.s();!(n=r.n()).done;)o()}catch(e){r.e(e)}finally{r.f()}}var _=/\d(?:vw|vh|vmin|vmax|dvw|dvh|svw|svh|lvw|lvh)\b/i;var S={coarse:"(pointer: coarse)",fine:"(pointer: fine)",hover:"(hover: hover)","no-hover":"(hover: none)","reduced-motion":"(prefers-reduced-motion: reduce)",dark:"(prefers-color-scheme: dark)",light:"(prefers-color-scheme: light)"};function E(e){if("function"==typeof e)try{return!!e()}catch(e){return!1}if("boolean"==typeof e)return e;if("string"!=typeof e||""===e)return!1;var t=S[e]||e;if("undefined"==typeof window||"function"!=typeof window.matchMedia)return!1;try{return window.matchMedia(t).matches}catch(e){return!1}}function T(e,t){if(!Array.isArray(e))return[];if((t||0)>8)return[];var n,r=[],o=l(e);try{for(o.s();!(n=o.n()).done;){var i=n.value;if(i&&"switch"===i.op){var a,s=l(T((E(i.when)?i.use:i.else)||[],(t||0)+1));try{for(s.s();!(a=s.n()).done;){var c=a.value;r.push(c)}}catch(e){s.e(e)}finally{s.f()}}else r.push(i)}}catch(e){o.e(e)}finally{o.f()}return r}var A=new Set(["IMG","VIDEO","CANVAS","IFRAME","INPUT","EMBED","OBJECT","TEXTAREA","SELECT","BR","HR","AREA","SOURCE","TRACK","WBR"]),C=["objectFit","objectPosition","borderRadius","imageRendering","filter"];function R(e,t){if(!e||"undefined"==typeof document||"undefined"==typeof window)return null;if(!t||0===t.length)return null;if(t.some(function(e){return e&&"switch"===e.op})&&0===(t=T(t,0)).length)return null;var n=[],r=w(t,n);if(t=n,"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return null;if(A.has(e.tagName)){var o=e.parentElement&&e.parentElement.hasAttribute&&e.parentElement.hasAttribute("data-nodality-raster-host")?e.parentElement:null;if(e=o||function(e){if(!e.parentNode)return null;var t,n={},r=l(C);try{for(r.s();!(t=r.n()).done;){var o=t.value;e.style[o]&&(n[o]=e.style[o])}}catch(e){r.e(e)}finally{r.f()}var i=document.createElement("div");return i.setAttribute("data-nodality-raster-host",e.tagName.toLowerCase()),i.style.cssText=e.style.cssText,e.parentNode.insertBefore(i,e),i.appendChild(e),e.removeAttribute("style"),Object.assign(e.style,n),e.style.display="block",e.style.width="100%",e.style.height="100%","static"===("function"==typeof getComputedStyle?getComputedStyle(i).position:"static")&&(i.style.position="relative"),i.style.width||(i.style.width="100%"),i.style.height||(i.style.height="100%"),i}(e),!e)return null}if(e.querySelector&&e.querySelector(":scope > canvas[data-nodality-raster]"))return null;var c=function(){var t=e.getBoundingClientRect();return{width:Math.max(t.width,e.scrollWidth||0),height:Math.max(t.height,e.scrollHeight||0)}},u=c();if(u.width<2||u.height<2)return null;var m=Math.min(window.devicePixelRatio||1,2),v=t.some(function(e){return(h[e.op]||{}).overlay}),x=t.every(function(e){return(h[e.op]||{}).overlay}),b=!x&&!t.some(function(e){return!1===e.live}),S="undefined"!=typeof WebGL2RenderingContext&&"texElementImage2D"in WebGL2RenderingContext.prototype||"undefined"!=typeof WebGLRenderingContext&&"texElementImage2D"in WebGLRenderingContext.prototype,E=b&&S;b&&!E&&console.info("[nodality] HTML-in-Canvas API not available - raster ops fall back to snapshot capture.");var R=document.createElement("canvas");E&&R.setAttribute("layoutsubtree","");var M={alpha:!0,premultipliedAlpha:!1},D=R.getContext("webgl2",M)||R.getContext("webgl",M);if(!D)return null;var F="undefined"!=typeof WebGL2RenderingContext&&D instanceof WebGL2RenderingContext,L=F&&t.some(function(e){return(h[e.op]||{}).mips});E&&!("texElementImage2D"in D)&&(console.info("[nodality] texElementImage2D missing on the created context - snapshot fallback."),R.removeAttribute("layoutsubtree"),E=!1),"static"===window.getComputedStyle(e).position&&(e.style.position="relative"),R.width=Math.round(u.width*m),R.height=Math.round(u.height*m),R.setAttribute("data-nodality-raster",E?"live":"snapshot"),console.info("[nodality] raster backend:",E?"html-in-canvas (live)":"snapshot");var z=e;if(E){var I=document.createElement("div");for(I.style.cssText="display:block;width:".concat(u.width,"px;height:").concat(u.height,"px;");e.firstChild;)I.appendChild(e.firstChild);R.appendChild(I),z=I,R.style.cssText="display:block;width:".concat(u.width,"px;height:").concat(u.height,"px;")}else if(R.style.cssText="position:absolute;top:0;left:0;"+"width:".concat(u.width,"px;height:").concat(u.height,"px;")+"pointer-events:none;z-index:2147483000;",x)R.setAttribute("aria-hidden","true");else{R.setAttribute("role","img");var O=(e.textContent||"").replace(/\s+/g," ").trim();O&&R.setAttribute("aria-label",O.slice(0,300))}e.appendChild(R);var P=function(e,t){var n=D.createShader(e);if(D.shaderSource(n,t),D.compileShader(n),!D.getShaderParameter(n,D.COMPILE_STATUS))throw new Error("[nodality] raster shader: "+D.getShaderInfoLog(n));return n},W=D.createProgram();D.attachShader(W,P(D.VERTEX_SHADER,p)),D.attachShader(W,P(D.FRAGMENT_SHADER,function(e,t){var n="",r=new Set;t.forEach(function(e){var t=h[e.op];t&&t.producesField&&r.add(e.as||"mask");var n=g(e);n&&r.add(n)});var o=s(r).map(function(e){return" float ".concat(y(e)," = 1.0;")}).join("\n");t.forEach(function(e,t){var r=h[e.op];r&&(n+=r.decl("u".concat(t,"_"),e)+"\n")});var i={field:"",warp:"",cell:"",displace:"",color:""};k(e,i);var a=i.field,l=i.warp,c=i.cell,u=i.displace,f=i.color,d=t,m=d.some(function(e){return"edges"===e.op})?"":" col *= 1.0 - edge * 0.55;",p=d.some(function(e){return(h[e.op]||{}).chroma})?"\n vec2 cpx = vec2(chroma.x, -chroma.y) / u_res;\n col.r = texture2D(u_tex, clamp(uv + cpx, 0.001, 0.999)).r;\n col.b = texture2D(u_tex, clamp(uv - cpx, 0.001, 0.999)).b;":"";return"\nprecision highp float;\nuniform sampler2D u_tex;\nuniform vec2 u_res;\nuniform vec2 u_mouse;\nuniform float u_time;\n".concat(n,"\nvoid main() {\n vec2 frag = vec2(gl_FragCoord.x, u_res.y - gl_FragCoord.y);\n").concat(o,"\n").concat(a,"\n vec2 warped = frag;\n").concat(l,"\n vec2 center = warped;\n float edge = 0.0;\n").concat(c,"\n vec2 sampleP = warped;\n vec2 chroma = vec2(0.0);\n").concat(u,"\n vec2 uv = vec2(sampleP.x / u_res.x, 1.0 - sampleP.y / u_res.y);\n vec4 tex = texture2D(u_tex, clamp(uv, 0.001, 0.999));\n vec3 col = tex.rgb;").concat(p,"\n vec3 edgeCol = vec3(1.0);\n float edgeCov = 0.0;\n vec3 ovCol = vec3(0.0);\n float ovA = 0.0;\n").concat(f,"\n").concat(m,"\n // content OVER border\n float baseA = tex.a + edgeCov * (1.0 - tex.a);\n vec3 baseRGB = (col * tex.a + edgeCol * edgeCov * (1.0 - tex.a)) / max(baseA, 1e-4);\n // overlay OVER (content+border)\n float outA = ovA + baseA * (1.0 - ovA);\n vec3 outRGB = (ovCol * ovA + baseRGB * baseA * (1.0 - ovA)) / max(outA, 1e-4);\n gl_FragColor = vec4(outRGB, outA);\n}")}(r,t))),D.bindAttribLocation(W,0,"a"),D.linkProgram(W),D.useProgram(W),D.bindBuffer(D.ARRAY_BUFFER,D.createBuffer()),D.bufferData(D.ARRAY_BUFFER,new Float32Array([-1,-1,3,-1,-1,3]),D.STATIC_DRAW),D.enableVertexAttribArray(0),D.vertexAttribPointer(0,2,D.FLOAT,!1,0,0);var j=function(e){return D.getUniformLocation(W,e)},B=function(e,t,n){"1f"===t?D.uniform1f(e,n):"1i"===t?D.uniform1i(e,n):"2fv"===t?D.uniform2fv(e,n):"3fv"===t&&D.uniform3fv(e,n)};t.forEach(function(e,t){var n=h[e.op];if(n&&n.uniforms){var r=n.uniforms(e,m);for(var o in r)B(j("u".concat(t,"_").concat(o)),r[o][0],r[o][1])}});var N=[];t.forEach(function(e,t){var n=h[e.op];n&&"function"==typeof n.init&&N.push({i:t,def:n,state:n.init(e,m,R.width,R.height)})});var U="undefined"!=typeof performance?performance.now():0,G=[];t.forEach(function(e,t){var n=h[e.op];if(n&&n.solver){var r=function(e,t){var n=h[e.op];if(!F||!D.getExtension("EXT_color_buffer_float"))return console.info("[nodality] '"+e.op+"' needs WebGL2 float render targets - op skipped."),null;D.getExtension("OES_texture_float_linear");var r=n.solver.resolutions(e,R.width,R.height),o={r:[D.R16F,D.RED],rg:[D.RG16F,D.RG],rgba:[D.RGBA16F,D.RGBA]},i=[],s=function(e,t,n,r){var s=a(o[n],2),l=s[0],c=s[1],u=D.createTexture();D.bindTexture(D.TEXTURE_2D,u);var f=r?D.LINEAR:D.NEAREST;D.texParameteri(D.TEXTURE_2D,D.TEXTURE_MIN_FILTER,f),D.texParameteri(D.TEXTURE_2D,D.TEXTURE_MAG_FILTER,f),D.texParameteri(D.TEXTURE_2D,D.TEXTURE_WRAP_S,D.CLAMP_TO_EDGE),D.texParameteri(D.TEXTURE_2D,D.TEXTURE_WRAP_T,D.CLAMP_TO_EDGE),D.texImage2D(D.TEXTURE_2D,0,l,e,t,0,c,D.HALF_FLOAT,null);var d=D.createFramebuffer();D.bindFramebuffer(D.FRAMEBUFFER,d),D.framebufferTexture2D(D.FRAMEBUFFER,D.COLOR_ATTACHMENT0,D.TEXTURE_2D,u,0);var h=D.checkFramebufferStatus(D.FRAMEBUFFER)===D.FRAMEBUFFER_COMPLETE;D.viewport(0,0,e,t),D.clearColor(0,0,0,1),D.clear(D.COLOR_BUFFER_BIT);var m={tex:u,fbo:d,w:e,h:t,ok:h};return i.push(m),m},l={},c=!0;for(var u in n.solver.targets){var f=n.solver.targets[u],d=r[f.res],m=a(Array.isArray(d)?d:[d,d],2),v=m[0],y=m[1];f.double?(l[u]={a:s(v,y,f.fmt,f.smooth),b:s(v,y,f.fmt,f.smooth)},c=c&&l[u].a.ok&&l[u].b.ok):(l[u]={a:s(v,y,f.fmt,f.smooth)},c=c&&l[u].a.ok)}D.bindFramebuffer(D.FRAMEBUFFER,null);var g=function(){return i.forEach(function(e){D.deleteFramebuffer(e.fbo),D.deleteTexture(e.tex)})};if(!c)return console.info("[nodality] '"+e.op+"' float targets incomplete - op skipped."),g(),null;var x={};try{for(var b in n.solver.programs){var w=D.createProgram();if(D.attachShader(w,P(D.VERTEX_SHADER,p)),D.attachShader(w,P(D.FRAGMENT_SHADER,n.solver.programs[b])),D.bindAttribLocation(w,0,"a"),D.linkProgram(w),!D.getProgramParameter(w,D.LINK_STATUS))throw new Error(b+": "+D.getProgramInfoLog(w));x[b]={prog:w,loc:{}}}}catch(t){for(var k in console.warn("[nodality] '"+e.op+"' solver programs failed:",t),g(),x)D.deleteProgram(x[k].prog);return null}return D.useProgram(W),{i:t,node:e,def:n,res:r,targets:l,progs:x,cleanup:g,prevX:.5,prevY:.5,primed:!1}}(e,t);r&&G.push(r)}});var X=function(e,t){var n=null,r={res:e.res,use:function(t){n=e.progs[t],D.useProgram(n.prog)},u:function(e){return e in n.loc||(n.loc[e]=D.getUniformLocation(n.prog,e)),n.loc[e]},f1:function(e,t){D.uniform1f(r.u(e),t)},f2:function(e,t,n){D.uniform2f(r.u(e),t,n)},f3:function(e,t,n,o){D.uniform3f(r.u(e),t,n,o)},smp:function(e,t,n){D.activeTexture(D.TEXTURE0+n),D.bindTexture(D.TEXTURE_2D,t.tex),D.uniform1i(r.u(e),n)},read:function(t){return e.targets[t].a},write:function(t){return e.targets[t].b},single:function(t){return e.targets[t].a},content:{tex:H},canvasW:R.width,canvasH:R.height,swap:function(t){var n=e.targets[t],r=n.a;n.a=n.b,n.b=r},blit:function(e){D.bindFramebuffer(D.FRAMEBUFFER,e.fbo),D.viewport(0,0,e.w,e.h),D.drawArrays(D.TRIANGLES,0,3)}},o=oe[0]/R.width,i=1-oe[1]/R.height,a=0,s=0;e.primed&&ie&&(a=(o-e.prevX)/Math.max(t,.001),s=(i-e.prevY)/Math.max(t,.001)),e.prevX=o,e.prevY=i,e.primed=!0;var l=ie&&Math.abs(a)+Math.abs(s)>.001;e.def.solver.step(r,e.node,{dt:t,px:o,py:i,dx:a,dy:s,moving:l,aspect:R.width/Math.max(R.height,1),col:e.def.solver.splatColor(e.node,a,s)})},H=D.createTexture();D.bindTexture(D.TEXTURE_2D,H),D.texParameteri(D.TEXTURE_2D,D.TEXTURE_MIN_FILTER,L?D.LINEAR_MIPMAP_LINEAR:D.LINEAR),D.texParameteri(D.TEXTURE_2D,D.TEXTURE_WRAP_S,D.CLAMP_TO_EDGE),D.texParameteri(D.TEXTURE_2D,D.TEXTURE_WRAP_T,D.CLAMP_TO_EDGE),D.pixelStorei(D.UNPACK_FLIP_Y_WEBGL,!0);var q=function(){L&&D.generateMipmap(D.TEXTURE_2D)},Y=!1,V=!1,$=E?"live":"snapshot",K=!1,Q={color:"transparent","-webkit-text-fill-color":"transparent","-webkit-text-stroke-color":"transparent","background-color":"transparent","background-image":"none","border-color":"transparent","box-shadow":"none","text-shadow":"none"},J=null,Z=function(){if(e.style.visibility="",J){var t,n=l(J);try{for(n.s();!(t=n.n()).done;){var r=a(t.value,2),o=r[0],i=r[1];for(var s in Q)i[s]?o.style.setProperty(s,i[s]):o.style.removeProperty(s);i.op?o.style.setProperty("opacity",i.op):o.style.removeProperty("opacity")}}catch(e){n.e(e)}finally{n.f()}J=null,e.style.isolation="",R.style.zIndex=""}},ee=function(){if(v){var t=function(){var t="IMG"===e.tagName?e:e.querySelector?e.querySelector("img"):null;return t&&t.complete&&t.naturalWidth>0?t:null}();if(t)try{return D.bindTexture(D.TEXTURE_2D,H),D.texImage2D(D.TEXTURE_2D,0,D.RGBA,D.RGBA,D.UNSIGNED_BYTE,t),q(),Y=!0,Promise.resolve()}catch(e){}else if(!K){var n="IMG"===e.tagName?e:e.querySelector&&e.querySelector("img");n&&(K=!0,n.addEventListener("load",function(){V||ee()},{once:!0}))}}R.style.display="none",Z();var r=function(e,t,n,r){var o=function(e){if(!e)return null;var t="IMG"===e.tagName?e:e.children&&1===e.children.length&&"IMG"===e.children[0].tagName?e.children[0]:null;if(!t||!t.complete||!t.naturalWidth)return null;try{if(new URL(t.currentSrc||t.src,location.href).origin!==location.origin)return null}catch(e){return null}return t}(e);return o?Promise.resolve(o):new Promise(function(o,i){var a=(new XMLSerializer).serializeToString(function(e,t){for(var n=[e].concat(s(e.querySelectorAll("*"))),r=[t].concat(s(t.querySelectorAll("*"))),o=0;o<n.length&&o<r.length;o++){var i=r[o].style;if(i&&0!==i.length)for(var a=null,l=0,c=Array.from(i);l<c.length;l++){var u=c[l];if(_.test(i.getPropertyValue(u))){var f=(a=a||window.getComputedStyle(n[o])).getPropertyValue(u);f&&i.setProperty(u,f,i.getPropertyPriority(u))}}}return t}(e,e.cloneNode(!0))),l='<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(t*r,'" height="').concat(n*r,'" viewBox="0 0 ').concat(t," ").concat(n,'">')+'<foreignObject width="100%" height="100%">'+'<div xmlns="http://www.w3.org/1999/xhtml">'.concat(a,"</div>")+"</foreignObject></svg>",c=new Image;c.onload=function(){return o(c)},c.onerror=i,c.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(l)})}(e,u.width,u.height,m).then(function(t){V||(D.bindTexture(D.TEXTURE_2D,H),D.texImage2D(D.TEXTURE_2D,0,D.RGBA,D.RGBA,D.UNSIGNED_BYTE,t),q(),Y=!0,x||function(){if(!J){J=[];for(var t=0,n=[e].concat(s(e.querySelectorAll("*")));t<n.length;t++){var r=n[t];if(r!==R&&"CANVAS"!==r.tagName){var o={op:r.style.getPropertyValue("opacity")};for(var i in Q)o[i]=r.style.getPropertyValue(i);for(var a in J.push([r,o]),Q)r.style.setProperty(a,Q[a],"important");r!==e&&r.matches&&r.matches("img,svg,video,picture,iframe")&&r.style.setProperty("opacity","0","important")}}e.style.isolation="isolate",R.style.zIndex="-1"}}(),R.style.visibility="visible")}).catch(function(e){Z(),console.warn("[nodality] raster snapshot failed:",e)});return R.style.display="",r},te=-1,ne=function(){if(!V&&"live"===$){D.bindTexture(D.TEXTURE_2D,H);var e,t=D.RGBA8||32856,n=[[D.TEXTURE_2D,t,z],[D.TEXTURE_2D,0,D.RGBA,D.RGBA,D.UNSIGNED_BYTE,z],[D.TEXTURE_2D,0,t,z],[D.TEXTURE_2D,0,z]];if(te>=0)e=[te];else{e=[0,1,2,3];var r={3:0,6:1,4:2}[D.texElementImage2D.length];null!=r&&(e.splice(e.indexOf(r),1),e.unshift(r))}var o,i=[],a=l(e);try{for(a.s();!(o=a.n()).done;){var s=o.value;try{return D.texElementImage2D.apply(D,n[s]),q(),te<0&&(te=s,console.info("[nodality] texElementImage2D signature discovered: form",s,"(declared arity "+D.texElementImage2D.length+")")),void(Y=!0)}catch(e){i.push("form"+s+" -> "+(e&&e.name?e.name:"?")+": "+(e&&e.message?e.message:e))}}}catch(e){a.e(e)}finally{a.f()}re("texElementImage2D rejected all known signatures (arity "+D.texElementImage2D.length+"): "+i.join(" | "))}},re=function(t){if(!V&&"live"===$){for($="snapshot",console.warn("[nodality] live raster backend failed ("+t+") - falling back to snapshot."),R.removeEventListener("paint",ne);z.firstChild;)e.appendChild(z.firstChild);z.parentNode===R&&R.removeChild(z),R.removeAttribute("layoutsubtree"),R.style.cssText="position:absolute;top:0;left:0;"+"width:".concat(u.width,"px;height:").concat(u.height,"px;")+"pointer-events:none;z-index:2147483000;",R.setAttribute("aria-hidden","true"),R.setAttribute("data-nodality-raster","snapshot-fallback"),ee()}};E&&(R.addEventListener("paint",ne),setTimeout(function(){V||"live"!==$||Y||re("no paint event within 1500ms")},1500));var oe=[.5*R.width,.5*R.height],ie=!1,ae=function(e){var t=R.getBoundingClientRect(),n=e.touches?e.touches[0]:e,r=[(n.clientX-t.left)*m,(n.clientY-t.top)*m];r[0]===oe[0]&&r[1]===oe[1]||(ie=!0),oe=r};e.addEventListener("mousemove",ae,{passive:!0}),e.addEventListener("touchmove",ae,{passive:!0});var se=0,le=0,ce=function(){se=1},ue=function(){se=0};e.addEventListener("mouseenter",ce,{passive:!0}),e.addEventListener("mouseleave",ue,{passive:!0});var fe=[];t.forEach(function(e,t){var n=h[e.op]||{},r=e.by||n.defaultDriver;r&&f[r]?fe.push({i:t,fn:f[r]}):e.by&&console.warn("[nodality] unknown driver '"+e.by+"' on op '"+e.op+"' - known drivers: "+d.join(", "))});var de=function(){if("undefined"==typeof window)return.5;var t=e.getBoundingClientRect(),n=window.innerHeight||1;return Math.max(0,Math.min(1,(n-t.top)/(n+t.height)))},he=0,me=!0,pe=function(){if(!V){if(me&&Y){for(var e="undefined"!=typeof performance?performance.now():U+16,t=Math.max(0,(e-U)/1e3),n=0,r=G;n<r.length;n++){var o=r[n];X(o,t)}if(ie=!1,D.bindFramebuffer(D.FRAMEBUFFER,null),D.useProgram(W),D.viewport(0,0,R.width,R.height),D.clearColor(0,0,0,0),D.clear(D.COLOR_BUFFER_BIT),D.uniform2f(j("u_res"),R.width,R.height),D.uniform2f(j("u_mouse"),oe[0],oe[1]),D.uniform1f(j("u_time"),e/1e3),fe.length>0){le+=(se-le)*(1-Math.exp(8*-t));for(var i={mouseX:oe[0],mouseY:oe[1],w:R.width,h:R.height,t:e/1e3,hover:le,scroll:de()},a=0,s=fe;a<s.length;a++){var c=s[a],u=c.fn(i);D.uniform2f(j("u".concat(c.i,"_dpos")),u.x,u.y),D.uniform1f(j("u".concat(c.i,"_damt")),u.amt)}}if(N.length>0)for(var f={w:R.width,h:R.height,mouseX:oe[0],mouseY:oe[1],dt:t,t:e/1e3},d=0,h=N;d<h.length;d++){var m,p=h[d],v=l(p.def.tick(p.state,f));try{for(v.s();!(m=v.n()).done;){var y=m.value;B(j("u".concat(p.i,"_").concat(y.name)),y.kind,y.value)}}catch(e){v.e(e)}finally{v.f()}}D.activeTexture(D.TEXTURE0),D.bindTexture(D.TEXTURE_2D,H),D.uniform1i(j("u_tex"),0);for(var g=1,x=0,b=G;x<b.length;x++){var w=b[x],k=w.def.solver.samplers;for(var _ in k)D.activeTexture(D.TEXTURE0+g),D.bindTexture(D.TEXTURE_2D,w.targets[k[_]].a.tex),D.uniform1i(j("u".concat(w.i,"_").concat(_)),g),g++}D.activeTexture(D.TEXTURE0),U=e,D.drawArrays(D.TRIANGLES,0,3)}he=requestAnimationFrame(pe)}},ve=null;"undefined"!=typeof IntersectionObserver&&(ve=new IntersectionObserver(function(e){var t=a(e,1)[0];me=t.isIntersecting})).observe(e);var ye=null,ge=0,xe=function(){if(!V){var e=c();if(!(e.width<2||e.height<2)){var t=Math.round(e.width*m),n=Math.round(e.height*m);u.width=e.width,u.height=e.height,R.style.width=e.width+"px",R.style.height=e.height+"px";var r=R.width!==t||R.height!==n;r&&(R.width=t,R.height=n),"snapshot"===$?ee():r&&ne()}}};"undefined"!=typeof ResizeObserver&&(ye=new ResizeObserver(function(){!function(){if(!V){var e=c();e.width<2||e.height<2||Math.round(e.width)===Math.round(u.width)&&Math.round(e.height)===Math.round(u.height)||(u.width=e.width,u.height=e.height,R.style.width=e.width+"px",R.style.height=e.height+"px")}}(),clearTimeout(ge),ge=setTimeout(xe,150)})).observe(e);var be=0,we=function(){clearTimeout(be),be=setTimeout(function(){if(!V)if("snapshot"!==$){var t=e.clientWidth||e.parentElement&&e.parentElement.clientWidth||u.width;R.style.width=t+"px",setTimeout(function(){if(!V&&"live"===$){var e=Math.max(2,Math.round(z.getBoundingClientRect().height))||u.height;u.width=t,u.height=e,R.style.height=e+"px",R.width=Math.round(t*m),R.height=Math.round(e*m),ne()}},50)}else xe()},150)};return"undefined"!=typeof window&&window.addEventListener("resize",we),"live"===$?he=requestAnimationFrame(pe):(ee().then(function(){he=requestAnimationFrame(pe)}),"undefined"!=typeof document&&document.fonts&&"object"===i(document.fonts.ready)&&Promise.resolve(document.fonts.ready).then(xe).catch(function(){})),{canvas:R,refresh:function(){return"live"===$?ne():ee()},destroy:function(){V=!0,cancelAnimationFrame(he),clearTimeout(ge),clearTimeout(be),ve&&ve.disconnect(),ye&&ye.disconnect(),"undefined"!=typeof window&&window.removeEventListener("resize",we),e.removeEventListener("mousemove",ae),e.removeEventListener("touchmove",ae),e.removeEventListener("mouseenter",ce),e.removeEventListener("mouseleave",ue),R.removeEventListener("paint",ne);for(var t=0,n=G;t<n.length;t++){var r=n[t];for(var o in r.cleanup(),r.progs)D.deleteProgram(r.progs[o].prog)}for(G.length=0;z!==e&&z.firstChild;)e.appendChild(z.firstChild);Z(),e.style.visibility="",R.remove()}}}function M(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=F(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=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 D(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||F(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 F(e,t){if(e){if("string"==typeof e)return L(e,t);var n={}.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)?L(e,t):void 0}}function L(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function z(e){return z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},z(e)}function I(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,O(r.key),r)}}function O(e){var t=function(e){if("object"!=z(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=z(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==z(t)?t:t+""}var P=function(){return e=function e(){var t,n,r,i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t=this,r=function(e){if(e.transform||e.op){var t=e.op;e.transform||(t=e.op),t.duration||(t.duration="3s-ease-in-out"),i.setDefault=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0px";return 0===e.length?t+" ":e};var n=function(){var n="",r="",o="",a="",s="",l="",c="",u="",f="";if(0!==t.values.length){t.values.forEach(function(e){e.startsWith("tx:")&&(n=e.replace("tx:","")),e.startsWith("ty:")&&(r=e.replace("ty:","")),e.startsWith("tz:")?o=e.replace("tz:",""):e.startsWith("scale(")?a=e:e.startsWith("skew(")?s=e:e.startsWith("rotate(")?l=function(e){var t=e.match(/rotate\(([^)]+)\)/);if(!t)return e;var n=t[1].split(",").map(function(e){return e.trim()});return 1===n.length?"rotate(".concat(n[0],")"):2===n.length?"rotateX(".concat(n[0],") rotateY(").concat(n[1],")"):3===n.length?"rotateX(".concat(n[0],") rotateY(").concat(n[1],") rotate(").concat(n[2],")"):e}(e):e.startsWith("perspective(")?c=e:e.startsWith("matrix(")?u=e:e.startsWith("opacity:")&&(f=e.replace("opacity:",""))}),n=i.setDefault(n),r=i.setDefault(r),o=i.setDefault(o);var d="";if("0px"!=r&&"0px"!=n&&"0px"!=o?d+="translate3d(".concat(n,", ").concat(r,", ").concat(o,")"):"0px"==r&&"0px"==n||(d+="translate(".concat(n,", ").concat(r,")")),a&&(d+=" ".concat(a)),l&&(d+=" ".concat(l)),s&&(d+=" ".concat(s)),c&&(d+=" ".concat(c)),u&&(d+=" ".concat(u)),d){if(e.op.duration){var h=e.op.duration.replace(/^(\d+)(s)-/,function(e,t,n){return t/2+n+" "}),m="transform ".concat(h,", opacity ").concat(h);i.res.style.transition=m}else i.res.style.transition="transform 3s ease-in-out, opacity 3s ease-in-out";e.op.static&&(i.res.style.transition=""),(i.blastTarget||i.res).style.transform=d,i.res.style.opacity=f}else alert("OPE")}};t.on?i.res.addEventListener(t.on,function(){t.delay?setTimeout(function(){n()},t.delay):n()}):window.addEventListener("load",function(){t.delay?setTimeout(function(){n()},t.delay):n()});var r=function(){var e="";t.values.forEach(function(t){t.startsWith("tx:")?e+="translateX(0) ":t.startsWith("ty:")?e+="translateY(0) ":t.startsWith("tz:")?e+="translateZ(0) ":t.startsWith("scale(")?e+="scale(1) ":t.startsWith("skew(")?e+="skew(0, 0) ":t.startsWith("rotate(")?e+="rotate(0) ":t.startsWith("perspective(")?e+="perspective(0) ":t.startsWith("matrix(")&&(e+="matrix(1, 0, 0, 1, 0, 0) "),i.res.style.opacity="1"}),e&&(i.res.style.transform=e.trim())};if(t.on)i.res.addEventListener("mouseout",function(){t.keep||r()});else{var o=1e3*parseFloat(t.duration),a=t.closeAfter?t.closeAfter:0;setTimeout(function(){t.keep||r()},o/2+a)}t.hardCSS&&(i.res.style.transform=t.hardCSS)}else alert("THIS FIRE WITH GRADIENT (invalid block")},(n=O(n="reactOnTransform"))in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,this.state={isExpanded:!1,isMovedUp:!1,isMovedDown:!1},this.openedElements=new WeakMap,"undefined"!=typeof document&&(this._themeUnsub=o.subscribe(function(e){return i._applyTheme(e)}),Promise.resolve().then(function(){return i._applyTheme(o.mode)}))},t=[{key:"rasterize",value:function(e){var t=this;if(e&&0!==e.length&&!this._rasterHandle&&"undefined"!=typeof document&&"undefined"!=typeof setTimeout){var n=0,r=function(){if(!t._rasterHandle){if(t.res&&t.res.isConnected){try{t._rasterHandle=R(t.res,e)}catch(e){return void console.warn("[nodality] raster pipeline skipped:",e)}if(t._rasterHandle)return}++n<80&&setTimeout(r,50)}};setTimeout(r,0)}}},{key:"isHidden",value:function(e){e&&(this.res.style.display="none")}},{key:"theme",value:function(e){var t=this;return e&&"object"===z(e)?(this._themeMap=e,this._applyTheme(o.mode),this._themeUnsub||(this._themeUnsub=o.subscribe(function(e){return t._applyTheme(e)})),this):this}},{key:"destroy",value:function(){return"function"==typeof this._themeUnsub&&(this._themeUnsub(),this._themeUnsub=null),this.res&&this.res.parentNode&&this.res.parentNode.removeChild(this.res),this}},{key:"_applyTheme",value:function(e){if(!this._noTheme&&this.res)if(this._themeMap){var t=this._themeMap[e];if(!t)return;for(var n in t)this.res.style[n]=t[n]}else{var r=o.defaults&&o.defaults[e];if(r)for(var i in this._themeOriginal||(this._themeOriginal={}),r)i in this._themeOriginal||(this._themeOriginal[i]=this.res.style[i]||""),this._themeOriginal[i]||(this.res.style[i]=r[i])}}},{key:"keySet",value:function(e){if(this.temporaryVal=1,Array.isArray(e)){for(var t=0;t<e.length;t++)e[t]&&null!=e[t].key&&(this.res.style[e[t].key]=e[t].value);return this}return this.res.style[e.key]=e.value,this}},{key:"commonMethods",value:function(e){var t={exact:"fontSize",cursor:"cursor",width:"width",maxWidth:"maxWidth",height:"height",maxHeight:"maxHeight",radius:"borderRadius",lineHeight:"lineHeight",background:"background",font:"fontFamily",opacity:"opacity",gap:"gap",minHeight:"minHeight",position:"position",inset:"inset",top:"top",right:"right",bottom:"bottom",left:"left",zIndex:"zIndex",flex:"flex",flexShrink:"flexShrink",flexGrow:"flexGrow",flexBasis:"flexBasis",flexWrap:"flexWrap",alignSelf:"alignSelf",display:"display",gridTemplateColumns:"gridTemplateColumns",gridTemplateRows:"gridTemplateRows",rowGap:"rowGap",columnGap:"columnGap",letterSpacing:"letterSpacing",textTransform:"textTransform",whiteSpace:"whiteSpace",overflowWrap:"overflowWrap",wordBreak:"wordBreak",wordWrap:"wordWrap",boxShadow:"boxShadow",backdropFilter:"backdropFilter",WebkitBackdropFilter:"WebkitBackdropFilter",overflow:"overflow",overflowX:"overflowX",overflowY:"overflowY",WebkitOverflowScrolling:"WebkitOverflowScrolling",WebkitTapHighlightColor:"WebkitTapHighlightColor",minWidth:"minWidth",boxSizing:"boxSizing",pointerEvents:"pointerEvents",userSelect:"userSelect",WebkitUserSelect:"WebkitUserSelect",textAlign:"textAlign",transition:"transition"};for(var n in t)null!=e[n]&&(this.res.style[t[n]]=e[n]);return"string"==typeof e.transform&&(this.res.style.transform=e.transform),e.pad&&this.pad(e.pad),e.mar&&this.mar(e.mar),e.respad&&this.respad(e.respad),e.resmar&&this.resmar(e.resmar),e.hover&&this.hover(e.hover),e.size&&this.fluidCopy(e.size),e.resprop&&this.resprop(e.resprop,e),e.keySet&&this.keySet(e.keySet),e.noTheme&&(this._noTheme=!0),e.theme&&this.theme(e.theme),e.hide&&this.isHidden(e.hide),e.raster&&this.rasterize(e.raster),e.transform&&"object"===z(e.transform)&&this.reactOnTransform(e.transform),void 0!==e.opacity&&(this.res.style.opacity=e.opacity),e.bold?this.res.style.fontWeight="bold":null!=e.weight&&(this.res.style.fontWeight=e.weight),this}},{key:"hover",value:function(e){var t=this;if(e.border){var n=e.border.width;this.res.style.border=n?"".concat(n,"px solid transparent"):"1px solid transparent"}var r=this.options&&this.options.borderObj;return r&&(this.res.style.border="".concat(r.width,"px solid ").concat(r.color)),this.prevColor=this.res.style.backgroundColor,this.foreColor=this.res.style.color,this.prevBorder=this.res.style.border,this.prevBoxShadow=this.res.style.boxShadow,e.animation&&(this.res.style.transition="".concat(e.animation),this.res.style.transionProperty="background, color, transform"),this.prevTransform=this.res.style.transform,this.res.onmouseout=function(){t.res.style.backgroundColor="".concat(t.prevColor),t.res.style.color="".concat(t.foreColor),t.res.style.border=t.prevBorder,null==e.scale&&null==e.transform||(t.res.style.transform=t.prevTransform||""),null!=e.boxShadow&&(t.res.style.boxShadow=t.prevBoxShadow||"")},this.res.onmouseover=function(){if(t.res.style.color=e.color,t.res.style.backgroundColor=e.background,e.border){var n,r=e.border.width,o=null!==(n=e.border.color)&&void 0!==n?n:"#2ECC71";t.res.style.border=r?"".concat(r,"px solid ").concat(o):"1px solid #2ECC71"}if(null!=e.scale||null!=e.transform){var i=t.prevTransform?"".concat(t.prevTransform," "):"",a=[];null!=e.transform&&a.push(e.transform),null!=e.scale&&a.push("scale(".concat(e.scale,")")),t.res.style.transform="".concat(i).concat(a.join(" "))}null!=e.boxShadow&&(t.res.style.boxShadow=e.boxShadow)},this}},{key:"onScroll",value:function(e){var t=this,n=function(e){if(null==e)return{num:0,unit:"px"};var t=String(e).match(/^(-?[\d.]+)(.*)$/);return t?{num:parseFloat(t[1]),unit:t[2]||"px"}:{num:0,unit:"px"}},r=function(e){var n=e&&null!=e.tx?e.tx:"0px",r=e&&null!=e.ty?e.ty:"0px";t.res.style.transform="translate3d(".concat(n,", ").concat(r,", 0)")};"opacity"===e.value?this.res.style.opacity=e.valMin:"scale"===e.value?this.res.style.transform="scale(".concat(e.valMin,")"):"trn"===e.value&&r(e.valMin);var o=function(){if("trn"!==e.value){var o=t.smartRange(window.scrollY,{min:e.from,max:e.to},{min:e.valMin,max:e.valMax});"opacity"===e.value?t.res.style.opacity=o:"scale"===e.value&&(t.res.style.transform="scale(".concat(o,")"))}else{for(var i={},a=["tx","ty"],s=0;s<a.length;s++){var l=a[s],c=e.valMin&&null!=e.valMin[l],u=e.valMax&&null!=e.valMax[l];if(c||u){var f=n(c?e.valMin[l]:u?e.valMax[l]:"0px"),d=n(u?e.valMax[l]:c?e.valMin[l]:"0px"),h=t.smartRange(window.scrollY,{min:e.from,max:e.to},{min:f.num,max:d.num});i[l]="".concat(h).concat(f.unit)}}r(i)}};window.addEventListener("scroll",o),0===e.from&&o()}},{key:"setAny",value:function(e){this[Object.keys(e)[0]]=[Object.values(e)[0]]}},{key:"setID",value:function(e){this.id=e}},{key:"setPrevText",value:function(e){this.prevText=e}},{key:"getCSS",value:function(){return this.css}},{key:"getPX",value:function(e){return{xs:"0px",sm:"576px",md:"768px",lg:"992px",xl:"1200px",xxl:"1400px",mxxl:"1800px"}[e]||"Invalid breakpoint"}},{key:"_setupResponsiveManager",value:function(){var e=this;this._responsiveTasks=this._responsiveTasks||[];var t=function(){e._responsiveTasks.forEach(function(e){e()})};this._responsiveHandler||(this._responsiveHandler=t,window.addEventListener("resize",t)),setTimeout(function(){t()},0)}},{key:"resprop",value:function(e,t){var n=this;this.options=t;var r={default:[0,1e5],xs:[0,575],sm:[576,767],md:[768,991],lg:[992,1199],xl:[1200,1399],xxl:[1400,1e5]},o=["resprop","breakpoint","value","values","range"],i={flexDir:"flexDirection",dir:"flexDirection",justify:"justifyContent",align:"alignItems",wrap:"flexWrap",bg:"background",radius:"borderRadius",z:"zIndex"},a=function(e){var t=i[e]||e;return"undefined"==typeof console||"function"==typeof n[e]||t in n.res.style||console.warn('[nodality] resprop: "'.concat(e,'" is not a CSS property or component method — ignored.')+(i[e]?"":" Did you mean one of: ".concat(Object.keys(i).join(", "),"?"))),t};e.forEach(function(e){void 0!==r[e.breakpoint]?e.range=r[e.breakpoint]:Array.isArray(e.breakpoint)&&2===e.breakpoint.length?e.range=[parseInt(e.breakpoint[0],10),parseInt(e.breakpoint[1],10)]:e.range=[0,parseInt(e.breakpoint,10)]}),e.sort(function(e,t){return e.range[1]-t.range[1]});var s=e.find(function(e){return"default"===e.breakpoint});for(var l in s||(s={breakpoint:"default",range:r.default},e.unshift(s)),this.prevStyles={},this.res.style)this.res.style.hasOwnProperty(l)&&isNaN(parseInt(l))&&(this.prevStyles[l]=this.res.style[l]);var c=new Set;e.forEach(function(e){Object.keys(e).forEach(function(e){o.includes(e)||"range"===e||c.add(e)})}),c.forEach(function(e){void 0===s[e]&&(s[e]=n.options[e]||"initial")}),this._responsiveTasks=this._responsiveTasks||[],this._responsiveTasks.push(function(){for(var t=window.innerWidth,r=s,i=0;i<e.length;i++){var l=e[i],u=D(l.range,2),f=u[0],d=u[1];if("default"!==l.breakpoint&&t>=f&&t<=d){r=l;break}}for(var h in c.forEach(function(e){if("keySet"===e){var t=s[e];t&&t.key&&(n.res.style[t.key]=t.value)}else n.res.style[a(e)]=s[e]}),r)if("exact"===h&&n.set(r),!o.includes(h)&&"range"!==h){var m=r[h];"keySet"===h&&m&&m.key?n.res.style[m.key]=m.value:"function"==typeof n[h]?n[h](m):n.res.style[a(h)]=m}}),this._setupResponsiveManager()}},{key:"respad",value:function(e){var t=this,n={default:[0,1e5],xs:[0,575],sm:[576,767],md:[768,991],lg:[992,1199],xl:[1200,1399],xxl:[1400,1e5]};e.forEach(function(e){void 0!==n[e.breakpoint]?e.range=n[e.breakpoint]:Array.isArray(e.breakpoint)&&2===e.breakpoint.length?e.range=[parseInt(e.breakpoint[0],10),parseInt(e.breakpoint[1],10)]:e.range=[parseInt(e.breakpoint,10),1e5]}),e.sort(function(e,t){return e.range[0]-t.range[0]});var r=e.find(function(e){return"default"===e.breakpoint});r||(r={breakpoint:"default",range:n.default},e.unshift(r)),void 0===r.values&&(r.values=this.options&&this.options.pad||null),this._responsiveTasks=this._responsiveTasks||[],this._responsiveTasks.push(function(){for(var n=window.innerWidth,o=r,i=0;i<e.length;i++){var a=e[i],s=D(a.range,2),l=s[0],c=s[1];if("default"!==a.breakpoint&&n>=l&&n<=c){o=a;break}}var u=void 0!==o.values?o.values:r.values;null!=u&&t.pad(u)}),this._setupResponsiveManager()}},{key:"_applyResponsive",value:function(e,t){var n={default:[0,1e5],xs:[0,575],sm:[576,767],md:[768,991],lg:[992,1199],xl:[1200,1399],xxl:[1400,1e5]};e.forEach(function(e){if(void 0!==n[e.breakpoint])e.range=n[e.breakpoint];else{var t=parseInt(e.breakpoint,10);e.range=[t,1e5]}}),e.sort(function(e,t){return e.range[0]-t.range[0]});var r=e.find(function(e){return"default"===e.breakpoint})||{breakpoint:"default",range:n.default},o=function(){for(var n=window.innerWidth,o=r,i=0;i<e.length;i++){var a=e[i],s=D(a.range,2),l=s[0],c=s[1];if("default"!==a.breakpoint&&n>=l&&n<=c){o=a;break}}t(o)};this._responsiveHandler&&window.removeEventListener("resize",this._responsiveHandler),this._responsiveHandler=o,window.addEventListener("resize",o),setTimeout(function(){o()},0)}},{key:"resmar",value:function(e){var t=this,n={default:[0,1e5],xs:[0,575],sm:[576,767],md:[768,991],lg:[992,1199],xl:[1200,1399],xxl:[1400,1e5]};e.forEach(function(e){void 0!==n[e.breakpoint]?e.range=n[e.breakpoint]:Array.isArray(e.breakpoint)&&2===e.breakpoint.length?e.range=[parseInt(e.breakpoint[0],10),parseInt(e.breakpoint[1],10)]:e.range=[parseInt(e.breakpoint,10),1e5]}),e.sort(function(e,t){return e.range[0]-t.range[0]});var r=e.find(function(e){return"default"===e.breakpoint});r||(r={breakpoint:"default",range:n.default},e.unshift(r)),void 0===r.values&&(r.values=this.options&&(this.options.mar||this.options.pad)||null),this._responsiveTasks=this._responsiveTasks||[],this._responsiveTasks.push(function(){for(var n=window.innerWidth,o=r,i=0;i<e.length;i++){var a=e[i],s=D(a.range,2),l=s[0],c=s[1];if("default"!==a.breakpoint&&n>=l&&n<=c){o=a;break}}var u=void 0!==o.values?o.values:r.values;null!=u&&t.mar(u)}),this._setupResponsiveManager()}},{key:"isNumber",value:function(e){return"number"==typeof e&&!isNaN(e)}},{key:"pad",value:function(e){for(var t=0;t<e.length;t++)for(var n=Object.keys(e[t]),r=0;r<n.length;r++)for(var o=n[r],i=e[t][o],a=0;a<o.length;a++)switch(o[a]){case"a":this.res.style.padding=this.isNumber(i)?"".concat(i,"px"):i;break;case"t":this.res.style.paddingTop=this.isNumber(i)?"".concat(i,"px"):i;break;case"l":this.res.style.paddingLeft=this.isNumber(i)?"".concat(i,"px"):i;break;case"r":this.res.style.paddingRight=this.isNumber(i)?"".concat(i,"px"):i;break;case"b":this.res.style.paddingBottom=this.isNumber(i)?"".concat(i,"px"):i}return this}},{key:"as",value:function(e){return this.res.style.alignSelf=e,this}},{key:"mar",value:function(e){if("center"===e)return this.res.style.marginLeft="auto",this.res.style.marginRight="auto",this;for(var t=0;t<e.length;t++)for(var n=Object.keys(e[t]),r=0;r<n.length;r++){for(var o=n[r],i=e[t][o],a=0;a<o.length;a++)switch(o[a]){case"a":"auto"===i?(this.res.style.marginLeft="auto",this.res.style.marginRight="auto"):this.res.style.margin=this.isNumber(i)?"".concat(i,"px"):i;break;case"t":this.res.style.marginTop=this.isNumber(i)?"".concat(i,"px"):i;break;case"l":this.res.style.marginLeft=this.isNumber(i)?"".concat(i,"px"):i;break;case"r":this.res.style.marginRight=this.isNumber(i)?"".concat(i,"px"):i;break;case"b":this.res.style.marginBottom=this.isNumber(i)?"".concat(i,"px"):i}"center"===o&&!0===i&&(this.res.style.marginLeft="auto",this.res.style.marginRight="auto"),"auto"===i&&(o.includes("l")||o.includes("r"))&&(o.includes("l")&&(this.res.style.marginLeft="auto"),o.includes("r")&&(this.res.style.marginRight="auto"))}return this}},{key:"smartRange",value:function(e,t,n){e<t.min&&(e=t.min),e>t.max&&(e=t.max);var r=(e-t.min)/(t.max-t.min);t.min>t.max&&(r=(e-t.max)/(t.min-t.max));var o=(n.min-n.max)*r-n.min;if(o=Math.abs(o),n.min<n.max){var i=(n.max+Math.abs(n.min))*r;o=n.min+i}return o}},{key:"gpos",value:function(e){return this.res.style.gridColumn=e.col,this.res.style.gridRow=e.row,this}},{key:"fluidCopy",value:function(e){if(e instanceof Object){this.prevStylex=this.res.style,this.res=document.createElement("h1"),this.res.style.cssText=this.prevStylex.cssText;var t=document.createTextNode(this.text);return this.res.appendChild(t),this.res.style.fontSize=e.exact,this}if("S1"===e){this.prevStylex=this.res.style,this.res=document.createElement("h1"),this.res.style.cssText=this.prevStylex.cssText;var n=document.createTextNode(this.text);this.res.appendChild(n),this.res.style.fontSize="calc(1.625rem + 5.075vw)"}if("S2"===e){this.prevStylex=this.res.style,this.res=document.createElement("h2"),this.res.style.cssText=this.prevStylex.cssText;var r=document.createTextNode(this.text);this.res.appendChild(r),this.res.style.fontSize="calc(1.500rem + 4.3vw)"}if("S3"===e){this.prevStylex=this.res.style,this.res=document.createElement("h3"),this.res.style.cssText=this.prevStylex.cssText;var o=document.createTextNode(this.text);this.res.appendChild(o),this.res.style.fontSize="calc(1.375rem + 3.525vw)"}if("S4"===e){this.prevStylex=this.res.style,this.res=document.createElement("h4"),this.res.style.cssText=this.prevStylex.cssText;var i=document.createTextNode(this.text);this.res.appendChild(i),this.res.style.fontSize="calc(1.250rem + 2.75vw)"}if("S5"===e){this.prevStylex=this.res.style,this.res=document.createElement("h5"),this.res.style.cssText=this.prevStylex.cssText;var a=document.createTextNode(this.text);this.res.appendChild(a),this.res.style.fontSize="calc(1.125rem + 1.975vw)"}return"S6"===e&&(this.res.style.fontSize="calc(1rem + 0.5vw)"),this}},{key:"setIndex",value:function(e){this.index=e}},{key:"borderObj",value:function(e){var t,n=null!==(t=e.type)&&void 0!==t?t:"solid";return this.res.style.border="".concat(e.width," ").concat(n," ").concat(e.color),void 0!==e.radius&&(this.res.style.borderRadius=e.radius),this}},{key:"setPref",value:function(e){this.preffersId=e}},{key:"setClass",value:function(e){this.class=e}},{key:"setTags",value:function(e){this.openTag=e.open,this.closeTag=e.close}},{key:"chainReact",value:function(e,t,n){var r=this;this.ap=!1,this.cta=0,this.once=!1;var o,i=M(e);try{for(i.s();!(o=i.n()).done;){var a=o.value;a.range||(a.range=["0px","999999px"])}}catch(e){i.e(e)}finally{i.f()}e.sort(function(e,t){return parseInt(e.range[0])-parseInt(t.range[0])});var s=function(o){var i=window.visualViewport.width,a=[],s=[];r.resCopy=r.res,r.storedQueries=e.map(function(e){return e.target}).filter(function(e){return null!=e});var l,c=M(e);try{for(c.s();!(l=c.n()).done;){var u=l.value;r.counterIndex++;var f=D(u.range,2),d=f[0],h=f[1],m=parseInt(d),p=parseInt(h),v=!0;if(u.target){v=!1;for(var y=0;y<u.target.length;y++)u.target[y]===t&&(v=!0)}i>=m&&i<=p&&v&&(a.push(u.log),s.push(u),u.op&&u.op.margin&&(r.useMargin=u.op.margin))}}catch(e){c.e(e)}finally{c.f()}if(n&&!n.includes("background")&&(r.res.style.background="",r.res.style.backgroundColor=""),r.res.style.textShadow="",n&&!n.includes("border")&&(r.res.style.border=""),n&&!n.includes("margin")&&(r.res.style.margin=""),r.res.style["-webkit-text-fill-color"]="",r.res.style["-webkit-text-stroke-color"]="",r.res.style["-webkit-text-stroke-width"]="",r.res.style.filter="",r.options.background&&(r.res.style.background=r.options.background),a.includes("gradient"),(a.includes("gradient")||a.includes("shadow"))&&(r.res.style.position="relative"),a.includes("blast")){var g,x=s.filter(function(e){return"blast"===e.log})[0].op.color,b=null!==(g=s.filter(function(e){return"blast"===e.log})[0].op.width)&&void 0!==g?g:"1px";"FlexRowLayoutElement"===r.getType()||"LayoutWrapperElement"===r.getType()?(r.res.style.border="".concat("number"==typeof b?b+"px":b," solid orange"),r.res.style.display="inline-block","FlexRowLayoutElement"===r.getType()&&(r.res.style.display="flex"),r.res.style.boxSizing="border-box",r.res.style.transformOrigin="center",r.blastTarget=r.res):(r.text,r.res.style["-webkit-text-fill-color"]="transparent",r.res.style["-webkit-text-stroke-color"]=x,r.res.style["-webkit-text-stroke-width"]="".concat(b))}if(a.includes("filter")){var w=s.filter(function(e){return"filter"===e.log})[0].op.filter;r.res.style.filter=w}if(a.includes("background")&&(r.res.style.backgroundColor="green"),a.includes("gradient")&&("LayoutWrapperElement"!==r.getType()&&"FlexRowLayoutElement"!==r.getType()&&(r.res.style["-webkit-text-fill-color"]="transparent"),r.res.style.background=r.globalGradient,"LayoutWrapperElement"!==r.getType()&&"FlexRowLayoutElement"!==r.getType()&&(r.res.style["background-clip"]="text")),a.includes("shadow")){var k,_,S,E,T=r.options.shadow.op,A=null!==(k=T.steps)&&void 0!==k?k:1,C=null!==(_=T.colors)&&void 0!==_?_:["gray"],R=null!==(S=T.movements)&&void 0!==S?S:["3px","3px"],F=null!==(E=T.radius)&&void 0!==E?E:"3px";if(1===R.length&&(R=[R[0],R[0]]),"FlexRowLayoutElement"===r.getType()||"LayoutWrapperElement"===r.getType()){for(var L=[],z=0;z<A;z++){var I,O=null!==(I=C[z])&&void 0!==I?I:C[0],P=R[0],W=R[1];L.push("".concat(P," ").concat(W," ").concat(F," ").concat(O))}r.res.style.boxShadow=L.join(", ")}else{for(var j=[],B=0;B<A;B++){var N,U=null!==(N=C[B])&&void 0!==N?N:C[0],G=R[0],X=R[1];j.push("drop-shadow(".concat(G," ").concat(X," ").concat(F," ").concat(U,")"))}r.res.style.filter=j.join(" ")}}if(a.includes("margin"))for(y=0;y<e.length;y++)if(e[y].op){var H=e[y].op.offsets;H&&void 0!==r.index&&(r.res.style.margin=H[Number(r.index)]+"px")}if(a.includes("spana")||a.includes("span")){var q=document.createElement("div");if(q.setAttribute("id","oroa"),Object.assign(q.style,{position:"absolute",inset:"0",background:"linear-gradient(90deg, rgb(52,152,219), rgb(26,188,156))",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",pointerEvents:"none"}),r.res&&r.res.querySelector("span"))return;r.res=r.resCopy,r.res.textContent="",r.options.span&&(Array.isArray(r.options.span)?r.options.span:[r.options.span]).forEach(function(e){if(e.op&&"span"===e.op.name&&Array.isArray(e.op.parts)){var t=0,n=r.prevText||"";if(e.op.parts.forEach(function(e){var o=e.text,i=e.style||{};if(t<n.length){var a=n.indexOf(o,t);if(a>t){var s=n.substring(t,a);r.res.appendChild(new r.constructor(s).setup({type:"span",id:i.id,animation:i.animation}).set({}).render())}t=a+o.length}var l=new r.constructor(o).setup({type:"span",id:i.id,animation:i.animation}).set(i).render();r.res.appendChild(l)}),t<n.length){var o=n.substring(t);r.res.appendChild(new r.constructor(o).setup({type:"span"}).set({}).render())}}})}else{var Y=new r.constructor(r.prevText).set({}).render();r.prevText&&r.prevText.length>0&&o&&r.res.appendChild(Y)}if(a.includes("animation")){if(r.options.animation&&!r.hasAnimated&&!r.options.animation.op.fireAt){r.hasAnimated=!0;var V=r.options.animation.op;window.addEventListener("sidebar:open",function(){r.res.animate(V.keyframesOpen,V.openOptions)}),window.addEventListener("sidebar:closed",function(){r.res.animate(V.keyframesClose,V.closeOptions)}),r.res.animate(V.keyframesClose,{duration:0,fill:"forwards"}),r.openTag&&r.closeTag&&(window.addEventListener(r.openTag,function(){r.res.animate(V.keyframesOpen,V.openOptions)}),window.addEventListener(r.closeTag,function(){r.res.animate(V.keyframesClose,V.closeOptions)}))}if(r.options.animation&&r.options.animation.op.fireAt&&r.options.animation.op.fireAt.endsWith("px")){var $=r.options.animation.op;r.res.animate($.keyframesClose,{duration:0,fill:"forwards"});var K=function(){window.scrollY>parseFloat($.fireAt)&&(r.res.animate($.keyframesOpen,$.openOptions),window.removeEventListener("scroll",K))};window.addEventListener("scroll",K)}if(r.options.animation&&"inview"===r.options.animation.op.fireAt){var Q=r.options.animation.op;r.res.animate(Q.keyframesClose,{duration:0,fill:"forwards"});var J=!1;new IntersectionObserver(function(e,t){e.forEach(function(e){e.isIntersecting&&!J&&(J=!0,r.res.animate(Q.keyframesOpen,Q.openOptions),t.disconnect())})}).observe(r.res)}}};this.options.animation||window.addEventListener("resize",function(){return s()}),s()}},{key:"maxWidth",value:function(e){return this.res.style.maxWidth=e,this}},{key:"removeQuotesFromFirstWord",value:function(e){return e.replace(/"([^"]+)":/g,"$1:")}},{key:"arrayMargin",value:function(e,t){return e.includes("left")&&(this.res.style.marginLeft=t),e.includes("right")&&(this.res.style.marginRight=t),e.includes("top")&&(this.res.style.marginTop=t),e.includes("bottom")&&(this.res.style.marginBottom=t),e.includes("all")&&(this.res.style.margin=t),t||(this.res.style.marginBottom=e),this}}],t&&I(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function W(e){return W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},W(e)}function j(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||B(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 B(e,t){if(e){if("string"==typeof e)return N(e,t);var n={}.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)?N(e,t):void 0}}function N(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function U(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,G(r.key),r)}}function G(e){var t=function(e){if("object"!=W(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=W(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==W(t)?t:t+""}function X(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(X=function(){return!!e})()}function H(e,t,n,r){var o=q(Y(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof o?function(e){return o.apply(n,e)}:o}function q(){return q="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Y(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}},q.apply(null,arguments)}function Y(e){return Y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Y(e)}function V(e,t){return V=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},V(e,t)}var $=function(){function e(t,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(e,t,n){return t=Y(t),function(e,t){if(t&&("object"==W(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,X()?Reflect.construct(t,n||[],Y(e).constructor):t.apply(e,n))}(this,e)).text=t,r.res=null,r.setup(n),r.code=[],r.elCSS=[],r.html=[],r.react=[],r.code.push('new Text("'.concat(r.text,'")')),r}return function(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&&V(e,t)}(e,P),t=e,n=[{key:"flexOne",value:function(){return this.res.style.flex="1",this}},{key:"setGridWithoutCode",value:function(){return this.res.style.border="1px solid white",this}},{key:"setArea",value:function(e){return this.res.style.gridArea=e,this}},{key:"toCodea",value:function(){return this.excludeFromCodeTrue&&(this.code=[""]),this.code}},{key:"toCode",value:function(){if(this.excludeFromCodeTrue)return[""];var e=Object.fromEntries(Object.entries(this.options).filter(function(e){var t=j(e,2);return t[0],null!==t[1]})),t=JSON.stringify(e,null,4).replace(/"([^"]+)":/g,"$1:");return['new Text("'.concat(this.text,'").set(').concat(t,")")]}},{key:"toCSS",value:function(){return this.css}},{key:"toHTMLA",value:function(){return this.html}},{key:"toElCSS",value:function(){return this.elCSS=this.elCSS.map(function(e){return" "+e}),this.preffersId?this.elCSS.unshift(this.res.id+" { \n"):this.elCSS.unshift("."+this.class+" { \n"),this.elCSS.push(" } \n \n"),this.elCSS}},{key:"getType",value:function(){return"S1"===this.options.fluidc?"HTMLHeaderElement":"HTMLParagraphElement"}},{key:"gradientOptions",value:function(e){var t=this;if(0===e.length)return this;var n=e.filter(function(e){return"gradient"===e.op.name})[0];if(void 0===n)return this;var r=n.op;if(n.point){var o=function(){window.matchMedia("(min-width: ".concat(n.range[0],") and (max-width: ").concat(n.range[1],")")).matches&&(t.prevBackground=t.res.style.color.toString(),t.res.style.background=r.gradient,t.res.style.WebkitBackgroundClip="text")};o(),window.addEventListener("resize",o)}}},{key:"strokeOptions",value:function(e){var t=this;if(0===e.length)return this;var n=e.filter(function(e){return"blast"===e.op.name})[0];if(void 0===n)return this;var r=n.op;if(n.point){var o=function(){window.matchMedia("(min-width: ".concat(n.range[0],") and (max-width: ").concat(n.range[1],")")).matches&&(r.color?t.res.style["-webkit-text-stroke"]="".concat(r.width?r.width:"1px"," ").concat(r.color):t.res.style["-webkit-text-stroke"]="1px orange",t.res.style["-webkit-text-fill-color"]="transparent")};o(),window.addEventListener("resize",o)}else r.color&&(this.res.style["-webkit-text-stroke"]="".concat(r.width?r.width:"1px"," ").concat(r.color)),this.res.style["-webkit-text-fill-color"]="transparent"}},{key:"stroke",value:function(){return this.res.style["-webkit-text-stroke"]="3px orange",this}},{key:"fill",value:function(){return this.res.style["-webkit-text-fill-color"]="transparent",this}},{key:"rowCol",value:function(e,t){return this.res.style.gridRow=e,this.res.style.gridColumn=t,this}},{key:"setGridRow",value:function(e){return this.res.style.gridRow=e,this}},{key:"setGridCol",value:function(e){return this.res.style.gridColumn=e,this}},{key:"toHTML",value:function(){return this.res}},{key:"onTap",value:function(e){return this.res.addEventListener("click",e),this}},{key:"setClass",value:function(e){return this.res.setAttribute("class",e),this}},{key:"setRandom",value:function(){for(var e="LAYOUT-",t=90;t>0;--t)e+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return e+=(new Date).getTime(),this.res.setAttribute("class",e),this}},{key:"styled",value:function(e){return this.set(e),this}},{key:"removeQuotesFromFirstWord",value:function(e){return e.replace(/"([^"]+)":/g,"$1:")}},{key:"looksLikeMarkdown",value:function(e){return/(\*\*.*\*\*|\*.*\*|`[^`]+`|\[.*?\]\(.*?\)|^# )/m.test(e)}},{key:"parseMarkdown",value:function(e){var t=e;return(t=(t=(t=(t=(t=(t=(t=t.replace(/^### (.*$)/gim,"<h3>$1</h3>")).replace(/^## (.*$)/gim,"<h2>$1</h2>")).replace(/^# (.*$)/gim,"<h1>$1</h1>")).replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>")).replace(/\*(.*?)\*/g,"<em>$1</em>")).replace(/`([^`]+)`/g,"<code>$1</code>")).replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2">$1</a>')).replace(/\n/g,"<br>")}},{key:"set",value:function(t){return this.resCopy=this.res,this.options=t,H(e,"setPrevText",this,3)([this.text]),t.raster&&this.rasterize(t.raster),this.commonMethods(t),t.left&&(this.res.style.left=t.left),t.flex&&(this.res.style.display="flex"),(t.left||t.top)&&(this.res.style.position="absolute"),t.maxWidth&&(this.res.style.maxWidth=t.maxWidth),t.cursor&&(this.res.style.cursor="hand"),t.gpos&&this.gpos(t.gpos),t.vtn&&(this.res.style.viewTransitionName=t.vtn),t.index&&H(e,"setIndex",this,3)([t.index]),t.index&&(this.index=t.index),t.preffersId&&(this.preffersId=t.preffersId),H(e,"setPref",this,3)([t.preffersId]),t.removeDecoration&&(this.res.style.textDecoration="none"),t.block&&(this.res.style.display="block"),t.area&&this.setArea(t.area),t.icon&&this.addIcon(t.icon),t.color&&this.color(t.color),t.color&&this.elCSS.push("color: ".concat(t.color,"; \n")),t.class&&this.setClass(t.class),t.size&&this.fluidCopy(t.size),t.fluidc&&this.fluidCopy(t.fluidc),this.options.id&&this.res.setAttribute("id",this.options.id),H(e,"setID",this,3)([this.options.id]),t.initLetter&&this.initLetter(t.initLetter),t.onTap&&this.onTap(t.onTap),"S6"===t.fluidc?t.fluidc&&this.elCSS.push("font-size: calc(1.1rem + 2.075vw); \n"):t.fluidc&&this.elCSS.push("font-size: calc(1.625rem + 5.075vw); \n"),this.options.class&&this.res.setAttribute("class",this.options.class),H(e,"setClass",this,3)([this.options.class]),t.clampc&&this.clampCopy(t.clampc),t.arrpad&&this.arrayPadding(t.arrpad.sides,t.arrpad.value),t.absolute&&(this.res.style.position="absolute"),t.arrayMargin&&this.arrayMargin(t.arrayMargin.sides,t.arrayMargin.value),t.em&&this.em(t.em),t.fluid&&this.fluid(t.fluid),t.fluidc&&this.elCSS.push("font-family: ".concat(t.font,"; \n")),t.align&&(this.res.style.textAlign=t.align),t.padding&&this.padding(t.padding),t.breakWord&&(this.res.style.wordWrap="break-word"),t.center&&(this.res.style.marginRight="auto"),t.center&&(this.res.style.marginLeft="auto"),t.italic&&this.italic(),t.responsive&&this.responsive(),t.border&&(this.res.style.border="".concat(t.border)),t.onScroll&&this.onScroll(t.onScroll),t.keySet&&this.keySet(t.keySet),this.callReact(t),this}},{key:"callReact",value:function(t){var n=[],r=t.transform&&"object"===W(t.transform);if(t.stroke||t.gradient||t.span||t.backgroundOp||t.layout||t.shadow||t.animation||t.filtera||r){t.gradient&&(this.globalGradient=t.gradient.op.gradient,"radial"===t.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)")),t.stroke&&H(e,"setAny",this,3)([{globalBlast:"".concat(t.stroke.op.width," ").concat(t.stroke.op.color)}]),t.span&&(t.span.prevText=this.text);var o=[t.stroke,t.gradient,t.animation,t.span,t.backgroundOp,t.layout,t.marginOp,t.shadow,t.animation,t.filtera,r?t.transform:void 0];o=o.filter(function(e){return null!=e});for(var i=0;i<o.length;i++)n.push({range:o[i].range,log:o[i].op.name,target:o[i].target,op:o[i].op});var a=[];t.borderObj&&a.push("border"),t.background&&a.push("background"),t.mar&&a.push("margin"),t.animation&&a.push("animation"),t.span&&a.push("span"),this.chainReact(n,this.options.id,a)}}},{key:"excludeFromCode",value:function(){return this.excludeFromCodeTrue=!0,this}},{key:"addIcon",value:function(e){var t=document.createElement("img");return t.style.width="20px",t.style.marginLeft="10px",t.style.height="auto",t.setAttribute("src",e.url),this.res.appendChild(t),this}},{key:"checkForAnimation",value:function(e){e.sort(function(e,t){return parseInt(e.range[0])-parseInt(t.range[0])});var t,n=window.innerWidth,r=function(e){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=B(e))){t&&(e=t);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}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 o,i=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw o}}}}(e);try{for(r.s();!(t=r.n()).done;){var o=t.value,i=j(o.range,2),a=i[0],s=i[1],l=parseInt(a),c=parseInt(s);n>=l&&n<=c&&"animation"===o.log&&this.res.animate([{opacity:0,transform:"translateY(100px)"},{opacity:1,transform:"translateY(0)"}],{duration:1e3,easing:"ease"})}}catch(e){r.e(e)}finally{r.f()}}},{key:"resetSmall",value:function(){this.res.style["-webkit-text-stroke"]="",this.res.style["-webkit-text-fill-color"]=""}},{key:"resetGradient",value:function(){return this.res.style.WebkitBackgroundClip="text",this.res.style.background="transparent",this}},{key:"resetStroke",value:function(){this.res.style["-webkit-text-stroke"]="",this.res.style["-webkit-text-fill-color"]=""}},{key:"innerStroke",value:function(e){e.color?this.res.style["-webkit-text-stroke"]="".concat(e.width?e.width:"1px"," ").concat(e.color):this.res.style["-webkit-text-stroke"]="1px orange",this.res.style["-webkit-text-fill-color"]="transparent"}},{key:"innerGradient",value:function(e){this.res.style.background="linear-gradient(45deg, #ff0000, #00ff00)",this.res.style["-webkit-background-clip"]="text"}},{key:"arrayMargin",value:function(e,t){return t||(this.res.style.marginLeft="".concat(e[0],"px"),this.res.style.marginTop="".concat(e[1],"px"),this.res.style.marginRight="".concat(e[2],"px"),this.res.style.marginBottom="".concat(e[3],"px")),e.includes("left")&&(this.res.style.marginLeft=t),e.includes("right")&&(this.res.style.marginRight=t),e.includes("top")&&(this.res.style.marginTop=t),e.includes("bottom")&&(this.res.style.marginBottom=t),t||(this.res.style.marginBottom=e),this}},{key:"clampExperiment",value:function(){return this.res.style.fontSize="clamp(1rem, calc(1rem * 10rem), 3rem)",this}},{key:"between",value:function(e){return"S1"===e&&(this.res.style.fontSize="clamp(2rem, 8vw, 2.5rem)"),"S2"===e&&(this.res.style.fontSize="clamp(4rem, 8vw, 5rem)"),"S3"===e&&(this.res.style.fontSize="clamp(2rem, 5vw, 2.5rem)"),"S4"===e&&(this.res.style.fontSize="clamp(1.5rem, 2vw, 1.6rem)"),"S5"===e&&(this.res.style.fontSize="clamp(1.2rem, 2vw, 1.3rem)"),"S6"===e&&(this.res.style.fontSize="clamp(1rem, 2vw, 1.3rem)"),this}},{key:"betweenCopy",value:function(e){return"S1"===e&&(this.res.style.fontSize="clamp(2rem, 8vw, 2.5rem)"),"S2"===e&&(this.res.style.fontSize="clamp(4rem, 8vw, 5rem)"),"S3"===e&&(this.res.style.fontSize="clamp(2rem, 5vw, 2.5rem)"),"S4"===e&&(this.res.style.fontSize="clamp(1.5rem, 2vw, 1.6rem)"),"S5"===e&&(this.res.style.fontSize="clamp(1.2rem, 2vw, 1.3rem)"),"S6"===e&&(this.res.style.fontSize="clamp(1rem, 2vw, 1.3rem)"),this}},{key:"stringGen",value:function(e){for(var t="",n=0;n<e;n++)t+="abcdefghijklmnopqrstuvwxyz".charAt(Math.floor(26*Math.random()));return t}},{key:"initLetter",value:function(e){var t=document.createElement("style");document.body.appendChild(t),Math.random();var n=this.stringGen(1e3);return this.res.setAttribute("id",n),document.styleSheets[0].insertRule("#".concat(n,"::first-letter { color: green; font-size: 3em; padding: 0.1em }"),0),this}},{key:"constant",value:function(e){return"S1"===e&&this.jumbotron(),"S2"===e&&this.large(),"S3"===e&&this.medium(),this}},{key:"minusMargin",value:function(){return this.res.style.marginRight="-3.1em",this}},{key:"fluid",value:function(e){if("S1"===e){this.res=document.createElement("h1");var t=document.createTextNode(this.text);this.res.appendChild(t),this.res.style.fontSize="calc(1.625rem + 4.3vw)"}if("S2"===e){this.res=document.createElement("h2");var n=document.createTextNode(this.text);this.res.appendChild(n),this.res.style.fontSize="calc(1.525rem + 3.525vw)"}if("S3"===e){this.res=document.createElement("h3");var r=document.createTextNode(this.text);this.res.appendChild(r),this.res.style.fontSize="calc(1.375rem + 2.75vw)"}if("S4"===e){this.res=document.createElement("h4");var o=document.createTextNode(this.text);this.res.appendChild(o),this.res.style.fontSize="calc(1.275rem + 1.975vw)"}return"S5"===e&&(this.res.style.fontSize="calc(1.1rem + 1.2vw)"),this}},{key:"getClampValue",value:function(e){return"S7"===e?"clamp(1.45rem, 2vw + 1.5rem, 1.69rem)":"S6"===e?"clamp(2.25rem, 2vw+1.5rem, 3.25rem)":"S5"===e?"clamp(2.75rem, 2vw + 1.5rem, 3.25rem)":"S4"===e?"clamp(3.5rem, 2vw + 1.5rem, 3.25rem)":"S3"===e?"clamp(4.25rem, 2vw + 1.5rem, 3.25rem)":"S2"===e?"clamp(5rem, 2vw + 1.5rem, 3.25rem)":"S1"===e?"clamp(6rem, 2vw + 1.5rem, 3.25rem)":void 0}},{key:"clampCopy",value:function(e){return this.res.style.fontSize=this.getClampValue(e),this}},{key:"toReactComponent",value:function(){return this.react.push("function Godzilla() { \n"),this.react.push('return <h1 class="'.concat(this.options.class,'">').concat(this.text,"</h1> \n")),this.react.push("} \n \n"),this.react}},{key:"myself",value:function(e){var t=this,n=function(){window.matchMedia("(max-device-width: 415px)").matches?t.res.style.fontSize=e.desktop:t.res.style.fontSize=e.phone};return n(),window.addEventListener("resize",n),this}},{key:"jumbotron",value:function(){var e=this,t=function(){window.matchMedia("(max-device-width: 415px)").matches?e.res.style.fontSize="8rem":e.res.style.fontSize="6rem"};return t(),window.addEventListener("resize",t),this}},{key:"large",value:function(){var e=this,t=function(){window.matchMedia("(max-device-width: 415px)").matches?e.res.style.fontSize="7rem":e.res.style.fontSize="5rem"};return t(),window.addEventListener("resize",t),this}},{key:"frame",value:function(e){return this.res.style.width=e.width,this.res.style.height=e.height,this}},{key:"vw",value:function(e,t,n){}},{key:"responsive",value:function(e){var t=this;this.set=!1,this.setB=!1;var n=function(){window.innerWidth<e.minw?(t.setB=!1,t.set||(t.res.style.color="#3498db",t.res.style.fontSize="".concat(e.baseVW/100*window.innerWidth,"px"),t.set=!0)):window.innerWidth>e.maxw?(t.set=!1,t.setB||(t.res.style.color="orange",t.res.style.fontSize="".concat(e.baseVW/100*e.maxw,"px"),t.setB=!0)):(t.set=!1,t.setB=!1,t.res.style.color="black",t.res.style.fontSize="".concat(e.baseVW,"vw"))};return n(),window.addEventListener("resize",n),this}},{key:"xlarge",value:function(){var e=this,t=function(){window.matchMedia("(max-device-width: 415px)").matches?e.res.style.fontSize="6.5rem":e.res.style.fontSize="8.5rem"};return t(),window.addEventListener("resize",t),this}},{key:"medium",value:function(){var e=this,t=function(){window.matchMedia("(max-device-width: 415px)").matches?e.res.style.fontSize="2.25rem":e.res.style.fontSize="1.5em"};return t(),window.addEventListener("resize",t),this}},{key:"auto",value:function(){var e=this,t=function(){window.matchMedia("(max-device-width: 415px)").matches?e.res.style.fontSize="2rem":e.res.style.fontSize="1rem"};return t(),window.addEventListener("resize",t),this}},{key:"small",value:function(){var e=this,t=function(){window.matchMedia("(max-device-width: 415px)").matches?e.res.style.fontSize="1.5em":e.res.style.fontSize="1em"};return t(),window.addEventListener("resize",t),this}},{key:"sizes",value:function(e){var t=this;this.res.style.fontSize="".concat(e[0].size,"rem");var n=function(){for(var n=0;n<e.length;n++)e[n].width&&window.matchMedia("(min-width: ".concat(e[n].width,"px)")).matches&&(t.res.style.fontSize="".concat(e[n].size));window.matchMedia("(max-device-width: 415px)").matches&&(t.res.style.fontSize="".concat(e[e.length-1].mobile))};return n(),window.addEventListener("resize",n),this}},{key:"setup",value:function(e){var t;e?((t=document.createElement(e.type)).setAttribute("id",e.id),"span"===e.type&&e.animation&&(t.style.position="relative",t.style.display="block")):t=document.createElement("p");var n=document.createTextNode(this.text);return t.appendChild(n),this.res=t,this.res.style.padding=0,this.res.style.margin=0,this}},{key:"hide",value:function(){return this.res.style.visibility="hidden",this}},{key:"font",value:function(e){return this.res.style.fontFamily=e,this}},{key:"center",value:function(){return this.res.style.textAlign="center",this}},{key:"em",value:function(e){return this.res.style.fontSize="".concat(e,"em"),this}},{key:"color",value:function(e){return this.res.style.color=e,this}},{key:"align",value:function(e){return this.res.style.textAlign="".concat(e),this}},{key:"weight",value:function(e){return this.res.style.fontWeight=e,this}},{key:"bold",value:function(){return this.res.style.fontWeight="bold",this}},{key:"italic",value:function(){return this.res.style.fontStyle="italic",this}},{key:"width",value:function(e,t){return this.res.style.width=e,t&&(this.res.style.marginLeft="auto",this.res.style.marginRight="auto"),this}},{key:"offset",value:function(e){return this.res.style.gridRow=2,this.res.style.gridColumn=2,this.res.style.marginLeft="-60px",this}},{key:"border",value:function(e,t){return this.res.style.border="".concat(t,"px solid ").concat(e),this}},{key:"padding",value:function(e,t,n,r){return(e||t||n||r)&&(this.res.style.paddingLeft=e,this.res.style.paddingTop=t,this.res.style.paddingRight=n,this.res.style.paddingBottom=r),t||n||r||(this.res.style.padding=e),this}},{key:"arrayPadding",value:function(e,t){return e.includes("left")&&(this.res.style.paddingLeft=t),e.includes("right")&&(this.res.style.paddingRight=t),e.includes("top")&&(this.res.style.paddingTop=t),e.includes("bottom")&&(this.res.style.paddingBottom=t),t||(this.res.style.paddingBottom=e),this}},{key:"margin",value:function(e,t){return"top"==e?this.res.style.marginTop=t:"bottom"==e?this.res.style.marginBottom=t:"left"==e?this.res.style.marginLeft=t:"right"==e&&(this.res.style.marginRight=t),this}},{key:"headline",value:function(){return this.em(4),this.font("Arial"),this.bold(),this}},{key:"caption",value:function(){return this.bold(),this.res.style.fontFamily="Arial",this.color("gray"),this.padding("top",20),this.res.style.fontSize="1em",window.matchMedia("(max-device-width: 415px)").matches?this.res.style.fontSize="2em":this.res.style.fontSize="1em",this}},{key:"updating",value:function(e,t){var n=this.res,r=this.text;return Object.defineProperty(e,t,{set:function(e){var t=document.createTextNode(r.replace("$",e));n.replaceChild(t,n.childNodes[0])}}),this}},{key:"style",value:function(e){return this.res.style.color=e.styles.color,this.res.style.fontWeight=e.styles.fontWeight,this.res.style.paddingLeft=e.styles.padding[0],this.res.style.paddingTop=e.styles.padding[1],this.res.style.paddingRight=e.styles.padding[2],this.res.style.paddingBottom=e.styles.padding[3],this.res.style.marginLeft=e.styles.margin[0],this.res.style.paddingTop=e.styles.margin[1],this.res.style.paddingRight=e.styles.margin[2],this.res.style.paddingBottom=e.styles.margin[3],this.res.style.opacity=e.styles.opacity,this}},{key:"applyStyle",value:function(e,t){return window.matchMedia("(max-width: ".concat(e,"px)")).matches&&Object.assign(this.res.style,t.styles),this}},{key:"nextApply",value:function(e){for(var t=this,n=[],r=(this.res.style,function(r){n[0].matches?Object.assign(t.res.style,e[0].styles):n[1].matches?Object.assign(t.res.style,e[1].styles):Object.assign(t.res.style,e[e.length-1].styles)}),o=0;o<e.length;o++){var i=e[o],a=window.matchMedia("(min-width: ".concat(i.min,"px) and (max-width: ").concat(i.max,"px)"));n.push(a),n[o].addListener(r)}return r(),this}},{key:"apply",value:function(e){var t=this,n=this.res.styles,r=function(){for(var r=0;r<e.length;r++){var o=e[r];o.min&&o.max?window.matchMedia("(min-width: ".concat(o.min,"px) and (max-width: ").concat(o.max,"px)")).matches?Object.assign(t.res.style,o.styles):(alert("YES min max, but does not match"),Object.assign(t.res.style,n)):window.matchMedia("(max-width: ".concat(o.max,"px)")).matches?Object.assign(t.res.style,o.styles):(alert("NO min max, and does not match"),Object.assign(t.res.style,n))}};return r(),window.addEventListener("resize",r),this}},{key:"render",value:function(e){if(!e)return this.options&&!this.options.span&&(this.res.textContent=this.text),this.looksLikeMarkdown(this.text)&&(this.res.innerHTML=this.parseMarkdown(this.text)),this.res;this.options&&this.options.id&&this.res.setAttribute("id",this.options.id),this.options&&!this.options.span&&(this.res.textContent=this.text),this.looksLikeMarkdown(this.text)&&(this.res.innerHTML=this.parseMarkdown(this.text)),document.querySelector(e).appendChild(this.res)}}],n&&U(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n}();export{$ as Text};
|
|
1
|
+
var e={};function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}e.d=(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},e.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var n="nodality.theme.mode",r="nodality:theme",o={mode:function(){try{var e=localStorage.getItem(n);if("light"===e||"dark"===e)return e}catch(e){}return"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}(),tokens:{light:{},dark:{}},defaults:{light:{color:"#111"},dark:{}},setDefaults:function(e){return e&&"object"===t(e)&&(e.light&&(this.defaults.light=Object.assign({},this.defaults.light,e.light)),e.dark&&(this.defaults.dark=Object.assign({},this.defaults.dark,e.dark)),this._broadcast()),this},setTokens:function(e){return e&&"object"===t(e)&&(e.light&&Object.assign(this.tokens.light,e.light),e.dark&&Object.assign(this.tokens.dark,e.dark)),this},get current(){return this.tokens[this.mode]||{}},set:function(e){if("light"!==e&&"dark"!==e)return this;if(e===this.mode)return this;this.mode=e;try{localStorage.setItem(n,e)}catch(e){}return this._broadcast(),this},toggle:function(){return this.set("dark"===this.mode?"light":"dark")},subscribe:function(e){if("undefined"==typeof document)return function(){};var t=function(t){return e(t.detail.mode,t.detail.tokens)};document.addEventListener(r,t);try{e(this.mode,this.current)}catch(e){}return function(){return document.removeEventListener(r,t)}},_broadcast:function(){"undefined"!=typeof document&&document.dispatchEvent(new CustomEvent(r,{detail:{mode:this.mode,tokens:this.current}}))}};function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(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 s(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||c(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 l(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=c(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=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 c(e,t){if(e){if("string"==typeof e)return u(e,t);var n={}.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)?u(e,t):void 0}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var f={static:function(e){return{x:.5*e.w,y:.5*e.h,amt:1}},mouse:function(e){return{x:e.mouseX,y:e.mouseY,amt:1}},hover:function(e){return{x:e.mouseX,y:e.mouseY,amt:e.hover}},scroll:function(e){return{x:.5*e.w,y:e.h*e.scroll,amt:1}},time:function(e){return{x:e.w*(.5+.34*Math.cos(.6*e.t)),y:e.h*(.5+.34*Math.sin(.8*e.t)),amt:1}}},d=Object.keys(f),h={hexalize:{stage:"cell",decl:function(e){return"uniform float ".concat(e,"size;")},code:function(e){return"\n {\n vec2 hp = warped / ".concat(e,"size;\n vec2 hr = vec2(1.0, 1.7320508), hh = hr * 0.5;\n vec2 ha = mod(hp, hr) - hh, hb = mod(hp - hh, hr) - hh;\n vec2 gv = dot(ha, ha) < dot(hb, hb) ? ha : hb;\n center = (hp - gv) * ").concat(e,"size;\n gv = abs(gv);\n edge = max(edge, smoothstep(0.44, 0.5,\n max(dot(gv, normalize(vec2(1.0, 1.7320508))), gv.x)));\n }")},uniforms:function(e,t){return{size:["1f",(e.size||24)*t]}}},offset:{stage:"warp",defaultDriver:"mouse",decl:function(e){return"uniform float ".concat(e,"strength; uniform float ").concat(e,"radius;\n uniform vec2 ").concat(e,"dpos; uniform float ").concat(e,"damt;")},code:function(e){return"\n {\n float d = length(warped - ".concat(e,"dpos);\n float fall = 1.0 - smoothstep(0.0, ").concat(e,"radius, d);\n vec2 dir = d > 0.5 ? (warped - ").concat(e,"dpos) / d : vec2(0.0);\n warped -= dir * ").concat(e,"strength * fall * ").concat(e,"damt;\n }")},uniforms:function(e,t){return{strength:["1f",(e.strength||20)*t],radius:["1f",(e.radius||260)*t]}}},duotone:{stage:"color",decl:function(e){return"uniform vec3 ".concat(e,"a; uniform vec3 ").concat(e,"b; uniform float ").concat(e,"radius;\n uniform vec2 ").concat(e,"dpos; uniform float ").concat(e,"damt;")},code:function(e,t){return"\n {\n float lum = dot(col, vec3(0.299, 0.587, 0.114));\n vec3 duo = mix(".concat(e,"a, ").concat(e,"b, lum);\n ").concat(t.by?"float mask = (1.0 - smoothstep(".concat(e,"radius * 0.35, ").concat(e,"radius,\n length(center - ").concat(e,"dpos))) * ").concat(e,"damt;"):"float mask = 1.0;","\n col = mix(col, duo, mask);\n }")},uniforms:function(e,t){var n=e.colors||["#104B87","#E8FF00"];return{a:["3fv",m(n[0])],b:["3fv",m(n[1])],radius:["1f",(e.radius||220)*t]}}},edges:{stage:"color",decl:function(e){return"uniform vec3 ".concat(e,"color; uniform float ").concat(e,"strength;")},code:function(e){return"\n {\n edgeCol = ".concat(e,"color;\n edgeCov = max(edgeCov, edge * ").concat(e,"strength);\n }")},uniforms:function(e){return{color:["3fv",m(e.color||"#FFFFFF")],strength:["1f",null!=e.strength?e.strength:1]}}},halftone:{stage:"color",decl:function(e){return"\n uniform float ".concat(e,"size;\n uniform float ").concat(e,"angle;\n uniform vec3 ").concat(e,"ink;\n uniform vec3 ").concat(e,"paper;\n uniform float ").concat(e,"soft;\n uniform float ").concat(e,"radius;\n uniform vec2 ").concat(e,"dpos;\n uniform float ").concat(e,"damt;")},code:function(e,t){return"\n {\n float lum = dot(col, vec3(0.299, 0.587, 0.114));\n float sz = ".concat(e,"size;").concat(t.by?"\n float fd = 1.0 - smoothstep(0.0, ".concat(e,"radius, length(frag - ").concat(e,"dpos));\n sz *= 1.0 + fd * ").concat(e,"damt * 1.8;"):"","\n // Screen angle: rotating the grid is what stops the dots\n // reading as a horizontal/vertical texture.\n float ca = cos(").concat(e,"angle), sa = sin(").concat(e,"angle);\n vec2 rp = vec2(ca * frag.x - sa * frag.y,\n sa * frag.x + ca * frag.y) / max(sz, 1.0);\n vec2 cell = fract(rp) - 0.5;\n // Dot radius from tone: darker tone prints a bigger dot.\n // sqrt because ink coverage goes as area, not radius.\n float rr = sqrt(clamp(1.0 - lum, 0.0, 1.0)) * 0.55;\n float dm = smoothstep(rr, rr - ").concat(e,"soft, length(cell));\n col = mix(").concat(e,"paper, ").concat(e,"ink, dm);\n }")},uniforms:function(e,t){return{size:["1f",(e.size||6)*t],angle:["1f",(null!=e.angle?e.angle:15)*Math.PI/180],ink:["3fv",m(e.ink||"#0B1B2B")],paper:["3fv",m(e.paper||"#FFFFFF")],soft:["1f",null!=e.softness?e.softness:.08],radius:["1f",(e.radius||220)*t]}}},aberration:{stage:"displace",chroma:!0,decl:function(e){return"\n uniform float ".concat(e,"amount;\n uniform float ").concat(e,"radius;\n uniform vec2 ").concat(e,"dpos;\n uniform float ").concat(e,"damt;")},code:function(e,t){return"\n {\n vec2 ctr = ".concat(t.by?"".concat(e,"dpos"):"u_res * 0.5",";\n vec2 dv = sampleP - ctr;\n float dl = length(dv);\n vec2 dir = dl > 0.5 ? dv / dl : vec2(0.0);\n ").concat(t.by?"float amt = ".concat(e,"amount * ").concat(e,"damt *\n (1.0 - smoothstep(0.0, ").concat(e,"radius, dl));"):"float amt = ".concat(e,"amount * (dl / max(length(u_res) * 0.5, 1.0));"),"\n chroma += dir * amt;\n }")},uniforms:function(e,t){return{amount:["1f",(null!=e.amount?e.amount:6)*t],radius:["1f",(e.radius||240)*t]}}},mask:{stage:"field",producesField:!0,defaultDriver:"static",decl:function(e){return"\n uniform vec2 ".concat(e,"dpos;\n uniform float ").concat(e,"damt;\n uniform float ").concat(e,"radius;\n uniform vec2 ").concat(e,"at;\n uniform vec2 ").concat(e,"remap;\n uniform float ").concat(e,"invert;")},code:function(e,t){var n=t.from||"radial",r=t.at?"(".concat(e,"at * u_res)"):"".concat(e,"dpos"),o="vertical"===n?"frag.y / max(u_res.y, 1.0)":"horizontal"===n?"frag.x / max(u_res.x, 1.0)":"1.0 - smoothstep(0.0, ".concat(e,"radius, length(frag - ").concat(r,"))");return"\n {\n float m = ".concat(o,";\n m = clamp((m - ").concat(e,"remap.x) / max(").concat(e,"remap.y - ").concat(e,"remap.x, 1e-4), 0.0, 1.0);\n m = mix(m, 1.0 - m, ").concat(e,"invert);\n ").concat(y(t.as||"mask")," *= m * ").concat(e,"damt;\n }")},uniforms:function(e,t){return{radius:["1f",(null!=e.radius?e.radius:260)*t],at:["2fv",e.at||[.5,.5]],remap:["2fv",e.remap||[0,1]],invert:["1f",e.invert?1:0]}}},noise:{stage:"field",producesField:!0,decl:function(e){return"\n uniform float ".concat(e,"scale;\n uniform float ").concat(e,"speed;\n uniform vec2 ").concat(e,"remap;\n uniform float ").concat(e,"amp;\n float ").concat(e,"h(vec2 v) {\n return fract(sin(dot(v, vec2(41.113, 289.717))) * 43758.545);\n }\n float ").concat(e,"n(vec2 v) {\n vec2 i = floor(v), f = v - i;\n f = f * f * (3.0 - 2.0 * f);\n return mix(mix(").concat(e,"h(i), ").concat(e,"h(i + vec2(1.0, 0.0)), f.x),\n mix(").concat(e,"h(i + vec2(0.0, 1.0)), ").concat(e,"h(i + vec2(1.0, 1.0)), f.x), f.y);\n }")},code:function(e,t){return"\n {\n vec2 np = frag / max(u_res.y, 1.0) * ".concat(e,"scale;\n // Two octaves: enough structure to read as turbulence\n // without the cost of a full fBm.\n float n = ").concat(e,"n(np + u_time * ").concat(e,"speed) * 0.65 +\n ").concat(e,"n(np * 2.7 - u_time * ").concat(e,"speed * 0.6) * 0.35;\n n = clamp((n - ").concat(e,"remap.x) / max(").concat(e,"remap.y - ").concat(e,"remap.x, 1e-4), 0.0, 1.0);\n ").concat(y(t.as||"mask")," *= mix(1.0, n, ").concat(e,"amp);\n }")},uniforms:function(e){return{scale:["1f",null!=e.scale?e.scale:3],speed:["1f",null!=e.speed?e.speed:.3],remap:["2fv",e.remap||[0,1]],amp:["1f",null!=e.amount?e.amount:1]}}},copy:{stage:"color",defaultDriver:"static",decl:function(e){return"\n uniform vec2 ".concat(e,"dpos;\n uniform float ").concat(e,"damt;\n uniform float ").concat(e,"radius;\n uniform float ").concat(e,"scale;\n uniform float ").concat(e,"rotate;\n uniform float ").concat(e,"fade;\n uniform float ").concat(e,"amount;")},code:function(e,t){for(var n=Array.isArray(t.points)&&t.points.length>0,r=n?t.points.length:Math.max(1,Math.min(24,Math.round(t.count||5))),o="",i=function(i){var a,s=n?"vec2(".concat((+t.points[i][0]).toFixed(5),", ").concat((+t.points[i][1]).toFixed(5),") * u_res"):(a=i/r*Math.PI*2,"".concat(e,"dpos + vec2(").concat(Math.cos(a).toFixed(5),", ")+"".concat(Math.sin(a).toFixed(5),") * ").concat(e,"radius"));o+="\n {\n float ang = ".concat(e,"rotate * ").concat((i+1).toFixed(1),";\n float cs = cos(ang), sn = sin(ang);\n // Inverse transform: to draw a stamp scaled by s about a\n // centre c, fetch from the source at (frag - c) / s.\n vec2 d = mat2(cs, -sn, sn, cs) * (frag - (").concat(s,"));\n vec2 q = d / max(").concat(e,"scale, 1e-3) + u_res * 0.5;\n vec2 quv = vec2(q.x / u_res.x, 1.0 - q.y / u_res.y);\n vec2 inside = step(vec2(0.0), quv) * step(quv, vec2(1.0));\n vec4 s = texture2D(u_tex, clamp(quv, 0.0, 1.0));\n float w = s.a * inside.x * inside.y * ").concat(e,"amount * ").concat(e,"damt\n * pow(").concat(e,"fade, ").concat(i.toFixed(1),");\n // Straight-alpha OVER, newest stamp on top.\n float na = w + ovA * (1.0 - w);\n ovCol = (s.rgb * w + ovCol * ovA * (1.0 - w)) / max(na, 1e-4);\n ovA = na;\n }")},a=0;a<r;a++)i(a);return o},uniforms:function(e,t){return{radius:["1f",(null!=e.radius?e.radius:110)*t],scale:["1f",null!=e.scale?e.scale:.5],rotate:["1f",null!=e.rotate?e.rotate:0],fade:["1f",null!=e.fade?e.fade:1],amount:["1f",null!=e.amount?e.amount:1]}}},merge:{stage:"color",decl:function(e){return"uniform float ".concat(e,"mix;")},code:function(){return""},uniforms:function(e){return{mix:["1f",null!=e.mix?e.mix:1]}}},echo:{stage:"color",decl:function(e){return"\n uniform sampler2D ".concat(e,"hist;\n uniform float ").concat(e,"strength;\n uniform vec3 ").concat(e,"tint;\n uniform float ").concat(e,"tintAmt;")},code:function(e){return"\n {\n // Sampled in screen space: the trail records where things\n // WERE, which is not where a warp op would fetch them from.\n vec2 huv = vec2(frag.x / u_res.x, 1.0 - frag.y / u_res.y);\n vec4 h = texture2D(".concat(e,"hist, clamp(huv, 0.001, 0.999));\n float ha = clamp(h.a * ").concat(e,"strength, 0.0, 1.0);\n vec3 hc = mix(h.rgb, ").concat(e,"tint, ").concat(e,"tintAmt);\n // Straight-alpha OVER into the border layer so an edges op\n // in the same chain still composites correctly.\n float na = ha + edgeCov * (1.0 - ha);\n edgeCol = (hc * ha + edgeCol * edgeCov * (1.0 - ha)) / max(na, 1e-4);\n edgeCov = na;\n }")},uniforms:function(e){return{strength:["1f",null!=e.strength?e.strength:.85],tint:["3fv",m(e.tint||"#7FD4FF")],tintAmt:["1f",e.tint?null!=e.tintAmount?e.tintAmount:.5:0]}},solver:{resolutions:function(e,t,n){return{frame:[t,n]}},targets:{history:{double:!0,res:"frame",fmt:"rgba",smooth:!0}},samplers:{hist:"history"},programs:{accumulate:"\nprecision highp float;\nuniform sampler2D u_content;\nuniform sampler2D u_hist;\nuniform vec2 u_texel;\nuniform float u_decay;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n vec4 c = texture2D(u_content, uv);\n vec4 h = texture2D(u_hist, uv) * u_decay;\n gl_FragColor = max(c, h);\n}"},splatColor:function(){return[0,0,0]},step:function(e,t,n){var r=Math.min(n.dt,1/30),o=Math.pow(null!=t.decay?t.decay:.92,60*r);e.use("accumulate"),e.f2("u_texel",1/e.canvasW,1/e.canvasH),e.f1("u_decay",o),e.smp("u_content",e.content,0),e.smp("u_hist",e.read("history"),1),e.blit(e.write("history")),e.swap("history")}}},stir:{stage:["warp","color"],decl:function(e){return"\n uniform sampler2D ".concat(e,"vel;\n uniform sampler2D ").concat(e,"dye;\n uniform float ").concat(e,"strength;\n uniform float ").concat(e,"dyemix;\n uniform float ").concat(e,"intensity;\n uniform float ").concat(e,"sheen;\n uniform vec3 ").concat(e,"tint;")},code:function(e,t,n){return"warp"===n?"\n {\n // frag/warped are top-down pixels, the field is bottom-up\n // [0,1]: flip y going in, and flip the y of the vector coming\n // out so the content drags WITH the pointer.\n vec2 fuv = vec2(warped.x / u_res.x, 1.0 - warped.y / u_res.y);\n vec2 v = texture2D(".concat(e,"vel, clamp(fuv, 0.001, 0.999)).xy;\n warped += vec2(v.x, -v.y) * ").concat(e,"strength;\n }"):"\n {\n // Sampled at the CONTINUOUS warped position, never at the\n // cell centre: a cell op upstream (hexalize) snaps the cell\n // centre to one point per tile, which would quantise the\n // liquid into flat per-hex patches instead of smooth swirls.\n vec2 suv = vec2(warped.x / u_res.x, 1.0 - warped.y / u_res.y);\n vec3 dc = texture2D(".concat(e,"dye, clamp(suv, 0.001, 0.999)).rgb;\n float mag = length(dc);\n // Colour is carried IN the dye field and advected with it, so\n // a ribbon keeps its hue while the flow folds it. Deriving\n // colour from the local flow direction instead would make\n // neighbouring pixels jump hue and read as confetti.\n vec3 liquid = mag > 1e-4 ? clamp(dc / mag * 1.25, 0.0, 1.0) : ").concat(e,"tint;\n float amt = clamp((1.0 - exp(-mag * ").concat(e,"intensity)) * ").concat(e,"dyemix, 0.0, 1.0);\n // Straight-alpha OVER so a later overlay op (blobs) still\n // composites correctly on top of the liquid.\n float na = amt + ovA * (1.0 - amt);\n ovCol = (liquid * amt + ovCol * ovA * (1.0 - amt)) / max(na, 1e-4);\n ovA = na;\n\n // Faint sheen on the content itself where the flow is fast.\n float sp = length(texture2D(").concat(e,"vel, clamp(suv, 0.001, 0.999)).xy);\n col = mix(col, ").concat(e,"tint, (1.0 - exp(-sp * 0.7)) * ").concat(e,"sheen);\n }")},uniforms:function(e,t){return{strength:["1f",(null!=e.strength?e.strength:26)*t],sheen:["1f",null!=e.sheen?e.sheen:.15],tint:["3fv",m(e.tint||"#7FD4FF")],dyemix:["1f",null!=e.dye?e.dye:.85],intensity:["1f",null!=e.intensity?e.intensity:1.6]}},solver:{resolutions:function(e){return{sim:Math.max(32,Math.min(e.resolution||128,512)),dye:Math.max(64,Math.min(e.dyeResolution||512,1024))}},targets:{velocity:{double:!0,res:"sim",fmt:"rg",smooth:!0},dye:{double:!0,res:"dye",fmt:"rgba",smooth:!0},pressure:{double:!0,res:"sim",fmt:"r",smooth:!1},divergence:{double:!1,res:"sim",fmt:"r",smooth:!1},vorticity:{double:!1,res:"sim",fmt:"r",smooth:!1}},samplers:{vel:"velocity",dye:"dye"},programs:{splat:"\nprecision highp float;\nuniform sampler2D u_src;\nuniform vec2 u_texel;\nuniform vec2 u_point;\nuniform vec3 u_amount;\nuniform float u_radius;\nuniform float u_aspect;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n vec2 d = uv - u_point;\n if (u_aspect >= 1.0) d.y /= u_aspect; else d.x *= u_aspect;\n float g = exp(-dot(d, d) / max(u_radius * u_radius, 1e-6));\n gl_FragColor = vec4(texture2D(u_src, uv).xyz + u_amount * g, 1.0);\n}",advect:"\nprecision highp float;\nuniform sampler2D u_vel;\nuniform sampler2D u_src;\nuniform vec2 u_texel;\nuniform float u_dt;\nuniform float u_diss;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n vec2 back = uv - texture2D(u_vel, uv).xy * u_dt;\n gl_FragColor = vec4(texture2D(u_src, clamp(back, 0.0, 1.0)).xyz * u_diss, 1.0);\n}",curl:"\nprecision highp float;\nuniform sampler2D u_vel;\nuniform vec2 u_texel;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n float r = texture2D(u_vel, uv + vec2(u_texel.x, 0.0)).y;\n float l = texture2D(u_vel, uv - vec2(u_texel.x, 0.0)).y;\n float t = texture2D(u_vel, uv + vec2(0.0, u_texel.y)).x;\n float b = texture2D(u_vel, uv - vec2(0.0, u_texel.y)).x;\n gl_FragColor = vec4(0.5 * ((r - l) - (t - b)), 0.0, 0.0, 1.0);\n}",confine:"\nprecision highp float;\nuniform sampler2D u_vel;\nuniform sampler2D u_curl;\nuniform vec2 u_texel;\nuniform float u_eps;\nuniform float u_dt;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n float r = texture2D(u_curl, uv + vec2(u_texel.x, 0.0)).x;\n float l = texture2D(u_curl, uv - vec2(u_texel.x, 0.0)).x;\n float t = texture2D(u_curl, uv + vec2(0.0, u_texel.y)).x;\n float b = texture2D(u_curl, uv - vec2(0.0, u_texel.y)).x;\n float c = texture2D(u_curl, uv).x;\n vec2 grad = 0.5 * vec2(abs(r) - abs(l), abs(t) - abs(b));\n vec2 n = grad / (length(grad) + 1e-5);\n vec2 force = u_eps * c * vec2(n.y, -n.x);\n vec2 v = texture2D(u_vel, uv).xy + force * u_dt;\n gl_FragColor = vec4(clamp(v, -64.0, 64.0), 0.0, 1.0);\n}",divergence:"\nprecision highp float;\nuniform sampler2D u_vel;\nuniform vec2 u_texel;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n float r = texture2D(u_vel, uv + vec2(u_texel.x, 0.0)).x;\n float l = texture2D(u_vel, uv - vec2(u_texel.x, 0.0)).x;\n float t = texture2D(u_vel, uv + vec2(0.0, u_texel.y)).y;\n float b = texture2D(u_vel, uv - vec2(0.0, u_texel.y)).y;\n vec2 c = texture2D(u_vel, uv).xy;\n if (uv.x - u_texel.x < 0.0) l = -c.x;\n if (uv.x + u_texel.x > 1.0) r = -c.x;\n if (uv.y - u_texel.y < 0.0) b = -c.y;\n if (uv.y + u_texel.y > 1.0) t = -c.y;\n gl_FragColor = vec4(0.5 * ((r - l) + (t - b)), 0.0, 0.0, 1.0);\n}",jacobi:"\nprecision highp float;\nuniform sampler2D u_p;\nuniform sampler2D u_div;\nuniform vec2 u_texel;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n float r = texture2D(u_p, uv + vec2(u_texel.x, 0.0)).x;\n float l = texture2D(u_p, uv - vec2(u_texel.x, 0.0)).x;\n float t = texture2D(u_p, uv + vec2(0.0, u_texel.y)).x;\n float b = texture2D(u_p, uv - vec2(0.0, u_texel.y)).x;\n float d = texture2D(u_div, uv).x;\n gl_FragColor = vec4((r + l + t + b - d) * 0.25, 0.0, 0.0, 1.0);\n}",subtract:"\nprecision highp float;\nuniform sampler2D u_p;\nuniform sampler2D u_vel;\nuniform vec2 u_texel;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n float r = texture2D(u_p, uv + vec2(u_texel.x, 0.0)).x;\n float l = texture2D(u_p, uv - vec2(u_texel.x, 0.0)).x;\n float t = texture2D(u_p, uv + vec2(0.0, u_texel.y)).x;\n float b = texture2D(u_p, uv - vec2(0.0, u_texel.y)).x;\n vec2 v = texture2D(u_vel, uv).xy - 0.5 * vec2(r - l, t - b);\n gl_FragColor = vec4(v, 0.0, 1.0);\n}",decay:"\nprecision highp float;\nuniform sampler2D u_tex;\nuniform vec2 u_texel;\nuniform float u_value;\nvoid main() {\n gl_FragColor = texture2D(u_tex, gl_FragCoord.xy * u_texel) * u_value;\n}"},splatColor:function(e,t,n){var r=null!=e.dyeAmount?e.dyeAmount:.6;if(!e.rainbow){var o=m(e.tint||"#7FD4FF");return[o[0]*r,o[1]*r,o[2]*r]}var i=Math.atan2(n,t);return[(.5+.5*Math.cos(i))*r,(.5+.5*Math.cos(i+2.0944))*r,(.5+.5*Math.cos(i+4.1888))*r]},step:function(e,t,n){var r=Math.min(n.dt,1/30),o=1/e.res.sim,i=1/e.res.dye,a=function(e,t){return Math.pow(e,60*t)};if(n.moving){var s=null!=t.force?t.force:1;e.use("splat"),e.f1("u_radius",null!=t.radius?t.radius:.1),e.f1("u_aspect",n.aspect),e.f2("u_point",n.px,n.py),e.f2("u_texel",o,o),e.smp("u_src",e.read("velocity"),0),e.f3("u_amount",n.dx*s,n.dy*s,0),e.blit(e.write("velocity")),e.swap("velocity"),e.f2("u_texel",i,i),e.smp("u_src",e.read("dye"),0),e.f3("u_amount",n.col[0],n.col[1],n.col[2]),e.blit(e.write("dye")),e.swap("dye")}e.use("curl"),e.f2("u_texel",o,o),e.smp("u_vel",e.read("velocity"),0),e.blit(e.single("vorticity")),e.use("confine"),e.f2("u_texel",o,o),e.f1("u_eps",null!=t.curl?t.curl:2.2),e.f1("u_dt",r),e.smp("u_vel",e.read("velocity"),0),e.smp("u_curl",e.single("vorticity"),1),e.blit(e.write("velocity")),e.swap("velocity"),e.use("divergence"),e.f2("u_texel",o,o),e.smp("u_vel",e.read("velocity"),0),e.blit(e.single("divergence")),e.use("decay"),e.f2("u_texel",o,o),e.f1("u_value",a(null!=t.pressure?t.pressure:.8,r)),e.smp("u_tex",e.read("pressure"),0),e.blit(e.write("pressure")),e.swap("pressure"),e.use("jacobi"),e.f2("u_texel",o,o),e.smp("u_div",e.single("divergence"),1);for(var l=Math.max(1,Math.min(t.pressureIterations||6,40)),c=0;c<l;c++)e.smp("u_p",e.read("pressure"),0),e.blit(e.write("pressure")),e.swap("pressure");e.use("subtract"),e.f2("u_texel",o,o),e.smp("u_p",e.read("pressure"),0),e.smp("u_vel",e.read("velocity"),1),e.blit(e.write("velocity")),e.swap("velocity"),e.use("advect"),e.f1("u_dt",r),e.f2("u_texel",o,o),e.smp("u_vel",e.read("velocity"),0),e.smp("u_src",e.read("velocity"),0),e.f1("u_diss",a(null!=t.decay?t.decay:.985,r)),e.blit(e.write("velocity")),e.swap("velocity"),e.f2("u_texel",i,i),e.smp("u_vel",e.read("velocity"),0),e.smp("u_src",e.read("dye"),1),e.f1("u_diss",a(null!=t.dyeFade?t.dyeFade:.97,r)),e.blit(e.write("dye")),e.swap("dye")}}},blobs:{stage:"color",overlay:!0,mips:!0,decl:function(e){return"\n uniform vec3 ".concat(e,"blobs[").concat(12,"];\n uniform int ").concat(e,"count;\n uniform vec3 ").concat(e,"tint;\n uniform float ").concat(e,"refract;\n uniform float ").concat(e,"rim;\n uniform float ").concat(e,"alpha;\n uniform float ").concat(e,"irid;\n uniform float ").concat(e,"disp;\n uniform float ").concat(e,"frost;\n float ").concat(e,"hash(vec3 v) {\n return fract(sin(dot(v, vec3(21.9898, 63.233, 41.719))) * 41739.317);\n }\n float ").concat(e,"noise(vec3 v) {\n vec3 f = floor(v);\n vec3 r = v - f;\n r = r * r * (3.0 - 2.0 * r);\n float c000 = ").concat(e,"hash(f);\n float c100 = ").concat(e,"hash(f + vec3(1.0, 0.0, 0.0));\n float c010 = ").concat(e,"hash(f + vec3(0.0, 1.0, 0.0));\n float c110 = ").concat(e,"hash(f + vec3(1.0, 1.0, 0.0));\n float c001 = ").concat(e,"hash(f + vec3(0.0, 0.0, 1.0));\n float c101 = ").concat(e,"hash(f + vec3(1.0, 0.0, 1.0));\n float c011 = ").concat(e,"hash(f + vec3(0.0, 1.0, 1.0));\n float c111 = ").concat(e,"hash(f + vec3(1.0, 1.0, 1.0));\n return mix(\n mix(mix(c000, c100, r.x), mix(c010, c110, r.x), r.y),\n mix(mix(c001, c101, r.x), mix(c011, c111, r.x), r.y), r.z);\n }")},code:function(e){return"\n {\n float field = 0.0;\n vec2 grad = vec2(0.0);\n for (int bi = 0; bi < ".concat(12,"; bi++) {\n if (bi >= ").concat(e,"count) break;\n vec2 bd = frag - ").concat(e,"blobs[bi].xy;\n float br = ").concat(e,"blobs[bi].z;\n float dd = max(dot(bd, bd), 1.0);\n field += (br * br) / dd;\n grad += (-2.0 * (br * br) / (dd * dd)) * bd;\n }\n float bmask = smoothstep(0.6, 1.0, field);\n if (bmask > 0.003) {\n float gmag = length(grad);\n vec2 g2 = gmag > 1e-6 ? -grad / gmag : vec2(0.0);\n // Pseudo-3D surface normal from the 2D field. For a\n // metaball field (sum of r^2/d^2), 1/sqrt(field) IS the\n // normalized radial position: 0 at the centre, 1 at the\n // surface. That yields a true hemisphere profile — the\n // curvature (and therefore refraction) varies smoothly\n // across the WHOLE disc, not just an edge annulus.\n float s = clamp(inversesqrt(max(field, 1e-4)), 0.0, 1.0);\n vec3 n = normalize(vec3(g2 * s, sqrt(max(1.0 - s * s, 0.004))));\n vec3 rd = vec3(0.0, 0.0, -1.0);\n\n // Dispersion: refract each channel with a slightly\n // different index (water-glass ~1.33). Near the rim the\n // exit direction flattens (|z| -> 0), so the sampling\n // offsets stretch — producing the smooth concentric\n // colour-fringed bands of a thick lens.\n float ca = 0.03 * ").concat(e,"disp;\n vec3 tR = refract(rd, n, 1.0 / (1.33 - ca));\n vec3 tG = refract(rd, n, 1.0 / 1.33);\n vec3 tB = refract(rd, n, 1.0 / (1.33 + ca));\n vec2 oR = tR.xy * (").concat(e,"refract / max(abs(tR.z), 0.3));\n vec2 oG = tG.xy * (").concat(e,"refract / max(abs(tG.z), 0.3));\n vec2 oB = tB.xy * (").concat(e,"refract / max(abs(tB.z), 0.3));\n\n // Blur grows with how far the ray was bent (mip bias), so\n // strongly-refracted regions smear smoothly instead of\n // showing sharp displaced copies. frost adds a base blur.\n float lod = ").concat(e,"frost * 5.0 + log2(1.0 + length(oG) * 0.035);\n vec2 px = 1.0 / u_res;\n vec4 sG = texture2D(u_tex, clamp(uv + oG * px, 0.002, 0.998), lod);\n vec3 refr;\n refr.r = texture2D(u_tex, clamp(uv + oR * px, 0.002, 0.998), lod).r;\n refr.g = sG.g;\n refr.b = texture2D(u_tex, clamp(uv + oB * px, 0.002, 0.998), lod).b;\n // Blend in (approximately) linear light for clean fringes.\n refr = pow(max(refr, 0.0), vec3(2.2));\n\n vec3 tintLin = pow(").concat(e,"tint, vec3(2.2));\n vec3 bodyLin = mix(tintLin * 0.35, refr, sG.a);\n\n // Glass darkens toward the silhouette (absorption), the\n // opposite of an additive glow ring.\n float edge = pow(1.0 - clamp(n.z, 0.0, 1.0), 1.5);\n bodyLin *= 1.0 - 0.35 * ").concat(e,"rim * edge;\n vec3 body = pow(max(bodyLin, 0.0), vec3(1.0 / 2.2));\n\n // Sparse iridescent glints: two drifting value-noise\n // fields sampled on the reflection direction, one warm\n // one cool, sharpened hard so only sparkles survive.\n vec3 rf = reflect(rd, n);\n float nA = ").concat(e,"noise(rf * 2.3 + u_time * 0.5);\n float nB = ").concat(e,"noise(rf * 2.3 - u_time * 0.5);\n vec3 glint = pow(max(vec3(0.30, 0.52, 0.86) * nA +\n vec3(0.80, 0.56, 0.34) * nB, 0.0), vec3(6.0));\n body += glint * ").concat(e,"irid;\n\n // Small hard specular from a fixed key light.\n vec3 L = normalize(vec3(-0.5, 0.7, 0.6));\n float spec = pow(max(dot(reflect(-L, n), vec3(0.0, 0.0, 1.0)), 0.0), 60.0);\n body += spec * 0.35;\n\n ovCol = body;\n ovA = max(ovA, bmask * ").concat(e,"alpha);\n }\n }")},uniforms:function(e,t){return{tint:["3fv",m(e.color||"#EAF4EE")],refract:["1f",(null!=e.refract?e.refract:70)*t],rim:["1f",null!=e.rim?e.rim:.6],alpha:["1f",null!=e.alpha?e.alpha:1],irid:["1f",null!=e.iridescence?e.iridescence:.8],disp:["1f",null!=e.dispersion?e.dispersion:1],frost:["1f",null!=e.frost?e.frost:.25]}},init:function(e,t,n,r){for(var o=(e.radius||46)*t,i=Math.max(1,Math.min(null!=e.trail?e.trail:7,12)),a=[],s=0,l=0;l<i;l++){var c=Math.pow(.86,l);a.push(c),s+=c*c}for(var u=Math.sqrt(s),f=a.map(function(e){return o*e/u}),d=a.map(function(e,t){return.85*o*Math.pow(.955,t)}),h=function(e,t){return e+Math.random()*(t-e)},m=Math.max(0,Math.min((e.count||1)-1,12-i)),p=[],v=0;v<m;v++){var y=h(0,2*Math.PI),g=h(30,80)*t;p.push({x:h(o,n-o),y:h(o,r-o),r:o*h(.45,.8),vx:Math.cos(y)*g,vy:Math.sin(y)*g,phase:h(0,2*Math.PI)})}for(var x={x:.5*n,y:.55*r},b=[],w=0;w<i;w++)b.push({x:x.x,y:x.y});return{head:x,chain:b,nTrail:i,drifters:p,trailIdleR:f,trailMoveR:d,stretch:0,seg:.9*o}},tick:function(e,t){var n=Math.min(t.dt,.05),r=t.w,o=t.h,i=1-Math.exp(9*-n);e.head.x+=(t.mouseX-e.head.x)*i,e.head.y+=(t.mouseY-e.head.y)*i;var a=e.chain;a[0].x=e.head.x,a[0].y=e.head.y;for(var s=1-Math.exp(16*-n),c=1;c<a.length;c++){var u=a[c-1],f=a[c],d=u.x-f.x,h=u.y-f.y,m=Math.hypot(d,h)||1e-4,p=e.seg;m>p&&(f.x+=d*(1-p/m),f.y+=h*(1-p/m)),f.x+=(u.x-f.x)*s,f.y+=(u.y-f.y)*s}var v=a[a.length-1],y=Math.hypot(v.x-e.head.x,v.y-e.head.y),g=Math.max(1,e.seg*(e.nTrail-1)),x=Math.min(1,y/g);e.stretch+=(x-e.stretch)*(1-Math.exp(8*-n));var b,w=l(e.drifters);try{for(w.s();!(b=w.n()).done;){var k=b.value;k.x+=k.vx*n,k.y+=k.vy*n,k.x<k.r?(k.x=k.r,k.vx=Math.abs(k.vx)):k.x>r-k.r&&(k.x=r-k.r,k.vx=-Math.abs(k.vx)),k.y<k.r?(k.y=k.r,k.vy=Math.abs(k.vy)):k.y>o-k.r&&(k.y=o-k.r,k.vy=-Math.abs(k.vy)),k.phase+=1.6*n}}catch(e){w.e(e)}finally{w.f()}for(var _=new Float32Array(36),S=e.stretch,E=0;E<e.nTrail;E++){var T=a[E];_[3*E]=T.x,_[3*E+1]=T.y,_[3*E+2]=e.trailIdleR[E]+(e.trailMoveR[E]-e.trailIdleR[E])*S}return e.drifters.forEach(function(t,n){var r=e.nTrail+n;_[3*r]=t.x,_[3*r+1]=t.y,_[3*r+2]=t.r*(1+.12*Math.sin(t.phase))}),[{name:"blobs",kind:"3fv",value:_},{name:"count",kind:"1i",value:e.nTrail+e.drifters.length}]}}};function m(e){return[1,3,5].map(function(t){return parseInt(e.slice(t,t+2),16)/255})}Object.keys(h).concat("switch");var p="attribute vec2 a; void main(){ gl_Position = vec4(a, 0.0, 1.0); }",v={warp:["warped"],cell:["center","edge"],displace:["sampleP","chroma"],color:["col","edgeCol","edgeCov","ovCol","ovA"]},y=function(e){return"fld_".concat(String(e).replace(/[^A-Za-z0-9_]/g,""))},g=function(e){return!0===e.masked?"mask":"string"==typeof e.masked?e.masked:null},x=function(e){return"edge"===e||"edgeCov"===e||"ovA"===e?"float":"col"===e||"edgeCol"===e||"ovCol"===e?"vec3":"vec2"},b={over:function(e,t){return t},add:function(e,t){return"min(".concat(e," + ").concat(t,", vec3(1.0))")},screen:function(e,t){return"1.0 - (1.0 - ".concat(e,") * (1.0 - ").concat(t,")")},multiply:function(e,t){return"".concat(e," * ").concat(t)},difference:function(e,t){return"abs(".concat(e," - ").concat(t,")")},lighten:function(e,t){return"max(".concat(e,", ").concat(t,")")},darken:function(e,t){return"min(".concat(e,", ").concat(t,")")}};function w(e,t){var n,r=[],o=l(e||[]);try{for(o.s();!(n=o.n()).done;){var i=n.value;if(i&&i.op){var a={node:i,i:t.length};t.push(i),"merge"===i.op&&(a.a=w(i.a,t),a.b=w(i.b,t)),r.push(a)}}}catch(e){o.e(e)}finally{o.f()}return r}function k(e,t){var n,r=l(e);try{var o=function(){var e=n.value,r=e.node;if("merge"===r.op)return function(e,t){var n="u".concat(e.i,"_"),r=b[e.node.mode]||b.over,o={field:"",warp:"",cell:"",displace:"",color:""},i={field:"",warp:"",cell:"",displace:"",color:""};k(e.a||[],o),k(e.b||[],i),t.field+=o.field+i.field;for(var a=function(){var e=l[s];if(!o[e]&&!i[e])return 1;var a=v[e],c=" {\n";a.forEach(function(e,t){c+=" ".concat(x(e)," pre").concat(t," = ").concat(e,";\n")}),c+=o[e],a.forEach(function(e,t){c+=" ".concat(x(e)," bra").concat(t," = ").concat(e,";\n")}),a.forEach(function(e,t){c+=" ".concat(e," = pre").concat(t,";\n")}),c+=i[e],a.forEach(function(e,t){var o="vec3"===x(e)?r("bra".concat(t),e):e;c+=" ".concat(e," = mix(bra").concat(t,", ").concat(o,", ").concat(n,"mix);\n")}),c+=" }\n",t[e]+=c},s=0,l=["warp","cell","displace","color"];s<l.length;s++)a()}(e,t),0;var o=h[r.op];if(!o)return 0;var i="u".concat(e.i,"_"),a=Array.isArray(o.stage)?o.stage:[o.stage],s=g(r);a.forEach(function(e){var n=o.code(i,r,e)+"\n";if(s&&v[e]){var a=v[e],l=a.map(function(e,t){return" ".concat(x(e)," msv").concat(t," = ").concat(e,";")}).join("\n"),c=a.map(function(e,t){return" ".concat(e," = mix(msv").concat(t,", ").concat(e,", ").concat(y(s),");")}).join("\n");n=" {\n".concat(l,"\n").concat(n,"\n").concat(c,"\n }\n")}t["field"===e||"warp"===e||"cell"===e||"displace"===e?e:"color"]+=n})};for(r.s();!(n=r.n()).done;)o()}catch(e){r.e(e)}finally{r.f()}}var _=/\d(?:vw|vh|vmin|vmax|dvw|dvh|svw|svh|lvw|lvh)\b/i;var S={coarse:"(pointer: coarse)",fine:"(pointer: fine)",hover:"(hover: hover)","no-hover":"(hover: none)","reduced-motion":"(prefers-reduced-motion: reduce)",dark:"(prefers-color-scheme: dark)",light:"(prefers-color-scheme: light)"};function E(e){if("function"==typeof e)try{return!!e()}catch(e){return!1}if("boolean"==typeof e)return e;if("string"!=typeof e||""===e)return!1;var t=S[e]||e;if("undefined"==typeof window||"function"!=typeof window.matchMedia)return!1;try{return window.matchMedia(t).matches}catch(e){return!1}}function T(e,t){if(!Array.isArray(e))return[];if((t||0)>8)return[];var n,r=[],o=l(e);try{for(o.s();!(n=o.n()).done;){var i=n.value;if(i&&"switch"===i.op){var a,s=l(T((E(i.when)?i.use:i.else)||[],(t||0)+1));try{for(s.s();!(a=s.n()).done;){var c=a.value;r.push(c)}}catch(e){s.e(e)}finally{s.f()}}else r.push(i)}}catch(e){o.e(e)}finally{o.f()}return r}var A=new Set(["IMG","VIDEO","CANVAS","IFRAME","INPUT","EMBED","OBJECT","TEXTAREA","SELECT","BR","HR","AREA","SOURCE","TRACK","WBR"]),C=["objectFit","objectPosition","borderRadius","imageRendering","filter"];function R(e,t){if(!e||"undefined"==typeof document||"undefined"==typeof window)return null;if(!t||0===t.length)return null;if(t.some(function(e){return e&&"switch"===e.op})&&0===(t=T(t,0)).length)return null;var n=[],r=w(t,n);if(t=n,"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return null;if(A.has(e.tagName)){var o=e.parentElement&&e.parentElement.hasAttribute&&e.parentElement.hasAttribute("data-nodality-raster-host")?e.parentElement:null;if(e=o||function(e){if(!e.parentNode)return null;var t,n={},r=l(C);try{for(r.s();!(t=r.n()).done;){var o=t.value;e.style[o]&&(n[o]=e.style[o])}}catch(e){r.e(e)}finally{r.f()}var i=document.createElement("div");return i.setAttribute("data-nodality-raster-host",e.tagName.toLowerCase()),i.style.cssText=e.style.cssText,e.parentNode.insertBefore(i,e),i.appendChild(e),e.removeAttribute("style"),Object.assign(e.style,n),e.style.display="block",e.style.width="100%",e.style.height="100%","static"===("function"==typeof getComputedStyle?getComputedStyle(i).position:"static")&&(i.style.position="relative"),i.style.width||(i.style.width="100%"),i.style.height||(i.style.height="100%"),i}(e),!e)return null}if(e.querySelector&&e.querySelector(":scope > canvas[data-nodality-raster]"))return null;var c=function(){var t=e.getBoundingClientRect();return{width:t.width>=2?t.width:e.scrollWidth||0,height:t.height>=2?t.height:e.scrollHeight||0}},u=c();if(u.width<2||u.height<2)return null;var m=Math.min(window.devicePixelRatio||1,2),v=t.some(function(e){return(h[e.op]||{}).overlay}),x=t.every(function(e){return(h[e.op]||{}).overlay}),b=!x&&!t.some(function(e){return!1===e.live}),S="undefined"!=typeof WebGL2RenderingContext&&"texElementImage2D"in WebGL2RenderingContext.prototype||"undefined"!=typeof WebGLRenderingContext&&"texElementImage2D"in WebGLRenderingContext.prototype,E=b&&S;b&&!E&&console.info("[nodality] HTML-in-Canvas API not available - raster ops fall back to snapshot capture.");var R=document.createElement("canvas");E&&R.setAttribute("layoutsubtree","");var M={alpha:!0,premultipliedAlpha:!1},D=R.getContext("webgl2",M)||R.getContext("webgl",M);if(!D)return null;var F="undefined"!=typeof WebGL2RenderingContext&&D instanceof WebGL2RenderingContext,L=F&&t.some(function(e){return(h[e.op]||{}).mips});E&&!("texElementImage2D"in D)&&(console.info("[nodality] texElementImage2D missing on the created context - snapshot fallback."),R.removeAttribute("layoutsubtree"),E=!1),"static"===window.getComputedStyle(e).position&&(e.style.position="relative"),R.width=Math.round(u.width*m),R.height=Math.round(u.height*m),R.setAttribute("data-nodality-raster",E?"live":"snapshot"),console.info("[nodality] raster backend:",E?"html-in-canvas (live)":"snapshot");var z=e;if(E){var I=document.createElement("div");for(I.style.cssText="display:block;width:".concat(u.width,"px;height:").concat(u.height,"px;");e.firstChild;)I.appendChild(e.firstChild);R.appendChild(I),z=I,R.style.cssText="display:block;width:".concat(u.width,"px;height:").concat(u.height,"px;")}else if(R.style.cssText="position:absolute;top:0;left:0;"+"width:".concat(u.width,"px;height:").concat(u.height,"px;")+"pointer-events:none;z-index:2147483000;",x)R.setAttribute("aria-hidden","true");else{R.setAttribute("role","img");var O=(e.textContent||"").replace(/\s+/g," ").trim();O&&R.setAttribute("aria-label",O.slice(0,300))}e.appendChild(R);var P=function(e,t){var n=D.createShader(e);if(D.shaderSource(n,t),D.compileShader(n),!D.getShaderParameter(n,D.COMPILE_STATUS))throw new Error("[nodality] raster shader: "+D.getShaderInfoLog(n));return n},W=D.createProgram();D.attachShader(W,P(D.VERTEX_SHADER,p)),D.attachShader(W,P(D.FRAGMENT_SHADER,function(e,t){var n="",r=new Set;t.forEach(function(e){var t=h[e.op];t&&t.producesField&&r.add(e.as||"mask");var n=g(e);n&&r.add(n)});var o=s(r).map(function(e){return" float ".concat(y(e)," = 1.0;")}).join("\n");t.forEach(function(e,t){var r=h[e.op];r&&(n+=r.decl("u".concat(t,"_"),e)+"\n")});var i={field:"",warp:"",cell:"",displace:"",color:""};k(e,i);var a=i.field,l=i.warp,c=i.cell,u=i.displace,f=i.color,d=t,m=d.some(function(e){return"edges"===e.op})?"":" col *= 1.0 - edge * 0.55;",p=d.some(function(e){return(h[e.op]||{}).chroma})?"\n vec2 cpx = vec2(chroma.x, -chroma.y) / u_res;\n col.r = texture2D(u_tex, clamp(uv + cpx, 0.001, 0.999)).r;\n col.b = texture2D(u_tex, clamp(uv - cpx, 0.001, 0.999)).b;":"";return"\nprecision highp float;\nuniform sampler2D u_tex;\nuniform vec2 u_res;\nuniform vec2 u_mouse;\nuniform float u_time;\n".concat(n,"\nvoid main() {\n vec2 frag = vec2(gl_FragCoord.x, u_res.y - gl_FragCoord.y);\n").concat(o,"\n").concat(a,"\n vec2 warped = frag;\n").concat(l,"\n vec2 center = warped;\n float edge = 0.0;\n").concat(c,"\n vec2 sampleP = warped;\n vec2 chroma = vec2(0.0);\n").concat(u,"\n vec2 uv = vec2(sampleP.x / u_res.x, 1.0 - sampleP.y / u_res.y);\n vec4 tex = texture2D(u_tex, clamp(uv, 0.001, 0.999));\n vec3 col = tex.rgb;").concat(p,"\n vec3 edgeCol = vec3(1.0);\n float edgeCov = 0.0;\n vec3 ovCol = vec3(0.0);\n float ovA = 0.0;\n").concat(f,"\n").concat(m,"\n // content OVER border\n float baseA = tex.a + edgeCov * (1.0 - tex.a);\n vec3 baseRGB = (col * tex.a + edgeCol * edgeCov * (1.0 - tex.a)) / max(baseA, 1e-4);\n // overlay OVER (content+border)\n float outA = ovA + baseA * (1.0 - ovA);\n vec3 outRGB = (ovCol * ovA + baseRGB * baseA * (1.0 - ovA)) / max(outA, 1e-4);\n gl_FragColor = vec4(outRGB, outA);\n}")}(r,t))),D.bindAttribLocation(W,0,"a"),D.linkProgram(W),D.useProgram(W),D.bindBuffer(D.ARRAY_BUFFER,D.createBuffer()),D.bufferData(D.ARRAY_BUFFER,new Float32Array([-1,-1,3,-1,-1,3]),D.STATIC_DRAW),D.enableVertexAttribArray(0),D.vertexAttribPointer(0,2,D.FLOAT,!1,0,0);var j=function(e){return D.getUniformLocation(W,e)},B=function(e,t,n){"1f"===t?D.uniform1f(e,n):"1i"===t?D.uniform1i(e,n):"2fv"===t?D.uniform2fv(e,n):"3fv"===t&&D.uniform3fv(e,n)};t.forEach(function(e,t){var n=h[e.op];if(n&&n.uniforms){var r=n.uniforms(e,m);for(var o in r)B(j("u".concat(t,"_").concat(o)),r[o][0],r[o][1])}});var N=[];t.forEach(function(e,t){var n=h[e.op];n&&"function"==typeof n.init&&N.push({i:t,def:n,state:n.init(e,m,R.width,R.height)})});var U="undefined"!=typeof performance?performance.now():0,G=[];t.forEach(function(e,t){var n=h[e.op];if(n&&n.solver){var r=function(e,t){var n=h[e.op];if(!F||!D.getExtension("EXT_color_buffer_float"))return console.info("[nodality] '"+e.op+"' needs WebGL2 float render targets - op skipped."),null;D.getExtension("OES_texture_float_linear");var r=n.solver.resolutions(e,R.width,R.height),o={r:[D.R16F,D.RED],rg:[D.RG16F,D.RG],rgba:[D.RGBA16F,D.RGBA]},i=[],s=function(e,t,n,r){var s=a(o[n],2),l=s[0],c=s[1],u=D.createTexture();D.bindTexture(D.TEXTURE_2D,u);var f=r?D.LINEAR:D.NEAREST;D.texParameteri(D.TEXTURE_2D,D.TEXTURE_MIN_FILTER,f),D.texParameteri(D.TEXTURE_2D,D.TEXTURE_MAG_FILTER,f),D.texParameteri(D.TEXTURE_2D,D.TEXTURE_WRAP_S,D.CLAMP_TO_EDGE),D.texParameteri(D.TEXTURE_2D,D.TEXTURE_WRAP_T,D.CLAMP_TO_EDGE),D.texImage2D(D.TEXTURE_2D,0,l,e,t,0,c,D.HALF_FLOAT,null);var d=D.createFramebuffer();D.bindFramebuffer(D.FRAMEBUFFER,d),D.framebufferTexture2D(D.FRAMEBUFFER,D.COLOR_ATTACHMENT0,D.TEXTURE_2D,u,0);var h=D.checkFramebufferStatus(D.FRAMEBUFFER)===D.FRAMEBUFFER_COMPLETE;D.viewport(0,0,e,t),D.clearColor(0,0,0,1),D.clear(D.COLOR_BUFFER_BIT);var m={tex:u,fbo:d,w:e,h:t,ok:h};return i.push(m),m},l={},c=!0;for(var u in n.solver.targets){var f=n.solver.targets[u],d=r[f.res],m=a(Array.isArray(d)?d:[d,d],2),v=m[0],y=m[1];f.double?(l[u]={a:s(v,y,f.fmt,f.smooth),b:s(v,y,f.fmt,f.smooth)},c=c&&l[u].a.ok&&l[u].b.ok):(l[u]={a:s(v,y,f.fmt,f.smooth)},c=c&&l[u].a.ok)}D.bindFramebuffer(D.FRAMEBUFFER,null);var g=function(){return i.forEach(function(e){D.deleteFramebuffer(e.fbo),D.deleteTexture(e.tex)})};if(!c)return console.info("[nodality] '"+e.op+"' float targets incomplete - op skipped."),g(),null;var x={};try{for(var b in n.solver.programs){var w=D.createProgram();if(D.attachShader(w,P(D.VERTEX_SHADER,p)),D.attachShader(w,P(D.FRAGMENT_SHADER,n.solver.programs[b])),D.bindAttribLocation(w,0,"a"),D.linkProgram(w),!D.getProgramParameter(w,D.LINK_STATUS))throw new Error(b+": "+D.getProgramInfoLog(w));x[b]={prog:w,loc:{}}}}catch(t){for(var k in console.warn("[nodality] '"+e.op+"' solver programs failed:",t),g(),x)D.deleteProgram(x[k].prog);return null}return D.useProgram(W),{i:t,node:e,def:n,res:r,targets:l,progs:x,cleanup:g,prevX:.5,prevY:.5,primed:!1}}(e,t);r&&G.push(r)}});var X=function(e,t){var n=null,r={res:e.res,use:function(t){n=e.progs[t],D.useProgram(n.prog)},u:function(e){return e in n.loc||(n.loc[e]=D.getUniformLocation(n.prog,e)),n.loc[e]},f1:function(e,t){D.uniform1f(r.u(e),t)},f2:function(e,t,n){D.uniform2f(r.u(e),t,n)},f3:function(e,t,n,o){D.uniform3f(r.u(e),t,n,o)},smp:function(e,t,n){D.activeTexture(D.TEXTURE0+n),D.bindTexture(D.TEXTURE_2D,t.tex),D.uniform1i(r.u(e),n)},read:function(t){return e.targets[t].a},write:function(t){return e.targets[t].b},single:function(t){return e.targets[t].a},content:{tex:H},canvasW:R.width,canvasH:R.height,swap:function(t){var n=e.targets[t],r=n.a;n.a=n.b,n.b=r},blit:function(e){D.bindFramebuffer(D.FRAMEBUFFER,e.fbo),D.viewport(0,0,e.w,e.h),D.drawArrays(D.TRIANGLES,0,3)}},o=oe[0]/R.width,i=1-oe[1]/R.height,a=0,s=0;e.primed&&ie&&(a=(o-e.prevX)/Math.max(t,.001),s=(i-e.prevY)/Math.max(t,.001)),e.prevX=o,e.prevY=i,e.primed=!0;var l=ie&&Math.abs(a)+Math.abs(s)>.001;e.def.solver.step(r,e.node,{dt:t,px:o,py:i,dx:a,dy:s,moving:l,aspect:R.width/Math.max(R.height,1),col:e.def.solver.splatColor(e.node,a,s)})},H=D.createTexture();D.bindTexture(D.TEXTURE_2D,H),D.texParameteri(D.TEXTURE_2D,D.TEXTURE_MIN_FILTER,L?D.LINEAR_MIPMAP_LINEAR:D.LINEAR),D.texParameteri(D.TEXTURE_2D,D.TEXTURE_WRAP_S,D.CLAMP_TO_EDGE),D.texParameteri(D.TEXTURE_2D,D.TEXTURE_WRAP_T,D.CLAMP_TO_EDGE),D.pixelStorei(D.UNPACK_FLIP_Y_WEBGL,!0);var q=function(){L&&D.generateMipmap(D.TEXTURE_2D)},Y=!1,V=!1,$=E?"live":"snapshot",K=!1,Q={color:"transparent","-webkit-text-fill-color":"transparent","-webkit-text-stroke-color":"transparent","background-color":"transparent","background-image":"none","border-color":"transparent","box-shadow":"none","text-shadow":"none"},J=null,Z=function(){if(e.style.visibility="",J){var t,n=l(J);try{for(n.s();!(t=n.n()).done;){var r=a(t.value,2),o=r[0],i=r[1];for(var s in Q)i[s]?o.style.setProperty(s,i[s]):o.style.removeProperty(s);i.op?o.style.setProperty("opacity",i.op):o.style.removeProperty("opacity")}}catch(e){n.e(e)}finally{n.f()}J=null,e.style.isolation="",R.style.zIndex=""}},ee=function(){if(v){var t=function(){var t="IMG"===e.tagName?e:e.querySelector?e.querySelector("img"):null;return t&&t.complete&&t.naturalWidth>0?t:null}();if(t)try{return D.bindTexture(D.TEXTURE_2D,H),D.texImage2D(D.TEXTURE_2D,0,D.RGBA,D.RGBA,D.UNSIGNED_BYTE,t),q(),Y=!0,Promise.resolve()}catch(e){}else if(!K){var n="IMG"===e.tagName?e:e.querySelector&&e.querySelector("img");n&&(K=!0,n.addEventListener("load",function(){V||ee()},{once:!0}))}}R.style.display="none",Z();var r=function(e,t,n,r){var o=function(e){if(!e)return null;var t=null;if("IMG"===e.tagName)t=e;else if(e.children){var n=Array.prototype.filter.call(e.children,function(e){return!e.hasAttribute||!e.hasAttribute("data-nodality-raster")});1===n.length&&"IMG"===n[0].tagName&&(t=n[0])}if(!t||!t.complete||!t.naturalWidth)return null;try{if(new URL(t.currentSrc||t.src,location.href).origin!==location.origin)return null}catch(e){return null}return t}(e);return o?Promise.resolve(o):new Promise(function(o,i){var a=(new XMLSerializer).serializeToString(function(e,t){for(var n=[e].concat(s(e.querySelectorAll("*"))),r=[t].concat(s(t.querySelectorAll("*"))),o=0;o<n.length&&o<r.length;o++){var i=r[o].style;if(i&&0!==i.length)for(var a=null,l=0,c=Array.from(i);l<c.length;l++){var u=c[l];if(_.test(i.getPropertyValue(u))){var f=(a=a||window.getComputedStyle(n[o])).getPropertyValue(u);f&&i.setProperty(u,f,i.getPropertyPriority(u))}}}return t}(e,e.cloneNode(!0))),l='<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(t*r,'" height="').concat(n*r,'" viewBox="0 0 ').concat(t," ").concat(n,'">')+'<foreignObject width="100%" height="100%">'+'<div xmlns="http://www.w3.org/1999/xhtml">'.concat(a,"</div>")+"</foreignObject></svg>",c=new Image;c.onload=function(){return o(c)},c.onerror=i,c.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(l)})}(e,u.width,u.height,m).then(function(t){V||(D.bindTexture(D.TEXTURE_2D,H),D.texImage2D(D.TEXTURE_2D,0,D.RGBA,D.RGBA,D.UNSIGNED_BYTE,t),q(),Y=!0,x||function(){if(!J){J=[];for(var t=0,n=[e].concat(s(e.querySelectorAll("*")));t<n.length;t++){var r=n[t];if(r!==R&&"CANVAS"!==r.tagName){var o={op:r.style.getPropertyValue("opacity")};for(var i in Q)o[i]=r.style.getPropertyValue(i);for(var a in J.push([r,o]),Q)r.style.setProperty(a,Q[a],"important");r!==e&&r.matches&&r.matches("img,svg,video,picture,iframe")&&r.style.setProperty("opacity","0","important")}}e.style.isolation="isolate",R.style.zIndex="-1"}}(),R.style.visibility="visible")}).catch(function(e){Z(),console.warn("[nodality] raster snapshot failed:",e)});return R.style.display="",r},te=-1,ne=function(){if(!V&&"live"===$){D.bindTexture(D.TEXTURE_2D,H);var e,t=D.RGBA8||32856,n=[[D.TEXTURE_2D,t,z],[D.TEXTURE_2D,0,D.RGBA,D.RGBA,D.UNSIGNED_BYTE,z],[D.TEXTURE_2D,0,t,z],[D.TEXTURE_2D,0,z]];if(te>=0)e=[te];else{e=[0,1,2,3];var r={3:0,6:1,4:2}[D.texElementImage2D.length];null!=r&&(e.splice(e.indexOf(r),1),e.unshift(r))}var o,i=[],a=l(e);try{for(a.s();!(o=a.n()).done;){var s=o.value;try{return D.texElementImage2D.apply(D,n[s]),q(),te<0&&(te=s,console.info("[nodality] texElementImage2D signature discovered: form",s,"(declared arity "+D.texElementImage2D.length+")")),void(Y=!0)}catch(e){i.push("form"+s+" -> "+(e&&e.name?e.name:"?")+": "+(e&&e.message?e.message:e))}}}catch(e){a.e(e)}finally{a.f()}re("texElementImage2D rejected all known signatures (arity "+D.texElementImage2D.length+"): "+i.join(" | "))}},re=function(t){if(!V&&"live"===$){for($="snapshot",console.warn("[nodality] live raster backend failed ("+t+") - falling back to snapshot."),R.removeEventListener("paint",ne);z.firstChild;)e.appendChild(z.firstChild);z.parentNode===R&&R.removeChild(z),R.removeAttribute("layoutsubtree"),R.style.cssText="position:absolute;top:0;left:0;"+"width:".concat(u.width,"px;height:").concat(u.height,"px;")+"pointer-events:none;z-index:2147483000;",R.setAttribute("aria-hidden","true"),R.setAttribute("data-nodality-raster","snapshot-fallback"),ee()}};E&&(R.addEventListener("paint",ne),setTimeout(function(){V||"live"!==$||Y||re("no paint event within 1500ms")},1500));var oe=[.5*R.width,.5*R.height],ie=!1,ae=function(e){var t=R.getBoundingClientRect(),n=e.touches?e.touches[0]:e,r=[(n.clientX-t.left)*m,(n.clientY-t.top)*m];r[0]===oe[0]&&r[1]===oe[1]||(ie=!0),oe=r};e.addEventListener("mousemove",ae,{passive:!0}),e.addEventListener("touchmove",ae,{passive:!0});var se=0,le=0,ce=function(){se=1},ue=function(){se=0};e.addEventListener("mouseenter",ce,{passive:!0}),e.addEventListener("mouseleave",ue,{passive:!0});var fe=[];t.forEach(function(e,t){var n=h[e.op]||{},r=e.by||n.defaultDriver;r&&f[r]?fe.push({i:t,fn:f[r]}):e.by&&console.warn("[nodality] unknown driver '"+e.by+"' on op '"+e.op+"' - known drivers: "+d.join(", "))});var de=function(){if("undefined"==typeof window)return.5;var t=e.getBoundingClientRect(),n=window.innerHeight||1;return Math.max(0,Math.min(1,(n-t.top)/(n+t.height)))},he=0,me=!0,pe=function(){if(!V){if(me&&Y){for(var e="undefined"!=typeof performance?performance.now():U+16,t=Math.max(0,(e-U)/1e3),n=0,r=G;n<r.length;n++){var o=r[n];X(o,t)}if(ie=!1,D.bindFramebuffer(D.FRAMEBUFFER,null),D.useProgram(W),D.viewport(0,0,R.width,R.height),D.clearColor(0,0,0,0),D.clear(D.COLOR_BUFFER_BIT),D.uniform2f(j("u_res"),R.width,R.height),D.uniform2f(j("u_mouse"),oe[0],oe[1]),D.uniform1f(j("u_time"),e/1e3),fe.length>0){le+=(se-le)*(1-Math.exp(8*-t));for(var i={mouseX:oe[0],mouseY:oe[1],w:R.width,h:R.height,t:e/1e3,hover:le,scroll:de()},a=0,s=fe;a<s.length;a++){var c=s[a],u=c.fn(i);D.uniform2f(j("u".concat(c.i,"_dpos")),u.x,u.y),D.uniform1f(j("u".concat(c.i,"_damt")),u.amt)}}if(N.length>0)for(var f={w:R.width,h:R.height,mouseX:oe[0],mouseY:oe[1],dt:t,t:e/1e3},d=0,h=N;d<h.length;d++){var m,p=h[d],v=l(p.def.tick(p.state,f));try{for(v.s();!(m=v.n()).done;){var y=m.value;B(j("u".concat(p.i,"_").concat(y.name)),y.kind,y.value)}}catch(e){v.e(e)}finally{v.f()}}D.activeTexture(D.TEXTURE0),D.bindTexture(D.TEXTURE_2D,H),D.uniform1i(j("u_tex"),0);for(var g=1,x=0,b=G;x<b.length;x++){var w=b[x],k=w.def.solver.samplers;for(var _ in k)D.activeTexture(D.TEXTURE0+g),D.bindTexture(D.TEXTURE_2D,w.targets[k[_]].a.tex),D.uniform1i(j("u".concat(w.i,"_").concat(_)),g),g++}D.activeTexture(D.TEXTURE0),U=e,D.drawArrays(D.TRIANGLES,0,3)}he=requestAnimationFrame(pe)}},ve=null;"undefined"!=typeof IntersectionObserver&&(ve=new IntersectionObserver(function(e){var t=a(e,1)[0];me=t.isIntersecting})).observe(e);var ye=null,ge=0,xe=function(){if(!V){var e=c();if(!(e.width<2||e.height<2)){var t=Math.round(e.width*m),n=Math.round(e.height*m);u.width=e.width,u.height=e.height,R.style.width=e.width+"px",R.style.height=e.height+"px";var r=R.width!==t||R.height!==n;r&&(R.width=t,R.height=n),"snapshot"===$?ee():r&&ne()}}};"undefined"!=typeof ResizeObserver&&(ye=new ResizeObserver(function(){!function(){if(!V){var e=c();e.width<2||e.height<2||Math.round(e.width)===Math.round(u.width)&&Math.round(e.height)===Math.round(u.height)||(u.width=e.width,u.height=e.height,R.style.width=e.width+"px",R.style.height=e.height+"px")}}(),clearTimeout(ge),ge=setTimeout(xe,150)})).observe(e);var be=0,we=function(){clearTimeout(be),be=setTimeout(function(){if(!V)if("snapshot"!==$){var t=e.clientWidth||e.parentElement&&e.parentElement.clientWidth||u.width;R.style.width=t+"px",setTimeout(function(){if(!V&&"live"===$){var e=Math.max(2,Math.round(z.getBoundingClientRect().height))||u.height;u.width=t,u.height=e,R.style.height=e+"px",R.width=Math.round(t*m),R.height=Math.round(e*m),ne()}},50)}else xe()},150)};return"undefined"!=typeof window&&window.addEventListener("resize",we),"live"===$?he=requestAnimationFrame(pe):(ee().then(function(){he=requestAnimationFrame(pe)}),"undefined"!=typeof document&&document.fonts&&"object"===i(document.fonts.ready)&&Promise.resolve(document.fonts.ready).then(xe).catch(function(){})),{canvas:R,refresh:function(){return"live"===$?ne():ee()},destroy:function(){V=!0,cancelAnimationFrame(he),clearTimeout(ge),clearTimeout(be),ve&&ve.disconnect(),ye&&ye.disconnect(),"undefined"!=typeof window&&window.removeEventListener("resize",we),e.removeEventListener("mousemove",ae),e.removeEventListener("touchmove",ae),e.removeEventListener("mouseenter",ce),e.removeEventListener("mouseleave",ue),R.removeEventListener("paint",ne);for(var t=0,n=G;t<n.length;t++){var r=n[t];for(var o in r.cleanup(),r.progs)D.deleteProgram(r.progs[o].prog)}for(G.length=0;z!==e&&z.firstChild;)e.appendChild(z.firstChild);Z(),e.style.visibility="",R.remove()}}}function M(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=F(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=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 D(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||F(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 F(e,t){if(e){if("string"==typeof e)return L(e,t);var n={}.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)?L(e,t):void 0}}function L(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function z(e){return z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},z(e)}function I(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,O(r.key),r)}}function O(e){var t=function(e){if("object"!=z(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=z(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==z(t)?t:t+""}var P=function(){return e=function e(){var t,n,r,i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t=this,r=function(e){if(e.transform||e.op){var t=e.op;e.transform||(t=e.op),t.duration||(t.duration="3s-ease-in-out"),i.setDefault=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0px";return 0===e.length?t+" ":e};var n=function(){var n="",r="",o="",a="",s="",l="",c="",u="",f="";if(0!==t.values.length){t.values.forEach(function(e){e.startsWith("tx:")&&(n=e.replace("tx:","")),e.startsWith("ty:")&&(r=e.replace("ty:","")),e.startsWith("tz:")?o=e.replace("tz:",""):e.startsWith("scale(")?a=e:e.startsWith("skew(")?s=e:e.startsWith("rotate(")?l=function(e){var t=e.match(/rotate\(([^)]+)\)/);if(!t)return e;var n=t[1].split(",").map(function(e){return e.trim()});return 1===n.length?"rotate(".concat(n[0],")"):2===n.length?"rotateX(".concat(n[0],") rotateY(").concat(n[1],")"):3===n.length?"rotateX(".concat(n[0],") rotateY(").concat(n[1],") rotate(").concat(n[2],")"):e}(e):e.startsWith("perspective(")?c=e:e.startsWith("matrix(")?u=e:e.startsWith("opacity:")&&(f=e.replace("opacity:",""))}),n=i.setDefault(n),r=i.setDefault(r),o=i.setDefault(o);var d="";if("0px"!=r&&"0px"!=n&&"0px"!=o?d+="translate3d(".concat(n,", ").concat(r,", ").concat(o,")"):"0px"==r&&"0px"==n||(d+="translate(".concat(n,", ").concat(r,")")),a&&(d+=" ".concat(a)),l&&(d+=" ".concat(l)),s&&(d+=" ".concat(s)),c&&(d+=" ".concat(c)),u&&(d+=" ".concat(u)),d){if(e.op.duration){var h=e.op.duration.replace(/^(\d+)(s)-/,function(e,t,n){return t/2+n+" "}),m="transform ".concat(h,", opacity ").concat(h);i.res.style.transition=m}else i.res.style.transition="transform 3s ease-in-out, opacity 3s ease-in-out";e.op.static&&(i.res.style.transition=""),(i.blastTarget||i.res).style.transform=d,i.res.style.opacity=f}else alert("OPE")}};t.on?i.res.addEventListener(t.on,function(){t.delay?setTimeout(function(){n()},t.delay):n()}):window.addEventListener("load",function(){t.delay?setTimeout(function(){n()},t.delay):n()});var r=function(){var e="";t.values.forEach(function(t){t.startsWith("tx:")?e+="translateX(0) ":t.startsWith("ty:")?e+="translateY(0) ":t.startsWith("tz:")?e+="translateZ(0) ":t.startsWith("scale(")?e+="scale(1) ":t.startsWith("skew(")?e+="skew(0, 0) ":t.startsWith("rotate(")?e+="rotate(0) ":t.startsWith("perspective(")?e+="perspective(0) ":t.startsWith("matrix(")&&(e+="matrix(1, 0, 0, 1, 0, 0) "),i.res.style.opacity="1"}),e&&(i.res.style.transform=e.trim())};if(t.on)i.res.addEventListener("mouseout",function(){t.keep||r()});else{var o=1e3*parseFloat(t.duration),a=t.closeAfter?t.closeAfter:0;setTimeout(function(){t.keep||r()},o/2+a)}t.hardCSS&&(i.res.style.transform=t.hardCSS)}else alert("THIS FIRE WITH GRADIENT (invalid block")},(n=O(n="reactOnTransform"))in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,this.state={isExpanded:!1,isMovedUp:!1,isMovedDown:!1},this.openedElements=new WeakMap,"undefined"!=typeof document&&(this._themeUnsub=o.subscribe(function(e){return i._applyTheme(e)}),Promise.resolve().then(function(){return i._applyTheme(o.mode)}))},t=[{key:"rasterize",value:function(e){var t=this;if(e&&0!==e.length&&!this._rasterHandle&&"undefined"!=typeof document&&"undefined"!=typeof setTimeout){var n=0,r=function(){if(!t._rasterHandle){if(t.res&&t.res.isConnected){try{t._rasterHandle=R(t.res,e)}catch(e){return void console.warn("[nodality] raster pipeline skipped:",e)}if(t._rasterHandle)return}++n<80&&setTimeout(r,50)}};setTimeout(r,0)}}},{key:"isHidden",value:function(e){e&&(this.res.style.display="none")}},{key:"theme",value:function(e){var t=this;return e&&"object"===z(e)?(this._themeMap=e,this._applyTheme(o.mode),this._themeUnsub||(this._themeUnsub=o.subscribe(function(e){return t._applyTheme(e)})),this):this}},{key:"destroy",value:function(){return"function"==typeof this._themeUnsub&&(this._themeUnsub(),this._themeUnsub=null),this.res&&this.res.parentNode&&this.res.parentNode.removeChild(this.res),this}},{key:"_applyTheme",value:function(e){if(!this._noTheme&&this.res)if(this._themeMap){var t=this._themeMap[e];if(!t)return;for(var n in t)this.res.style[n]=t[n]}else{var r=o.defaults&&o.defaults[e];if(r)for(var i in this._themeOriginal||(this._themeOriginal={}),r)i in this._themeOriginal||(this._themeOriginal[i]=this.res.style[i]||""),this._themeOriginal[i]||(this.res.style[i]=r[i])}}},{key:"keySet",value:function(e){if(this.temporaryVal=1,Array.isArray(e)){for(var t=0;t<e.length;t++)e[t]&&null!=e[t].key&&(this.res.style[e[t].key]=e[t].value);return this}return this.res.style[e.key]=e.value,this}},{key:"commonMethods",value:function(e){var t={exact:"fontSize",cursor:"cursor",width:"width",maxWidth:"maxWidth",height:"height",maxHeight:"maxHeight",radius:"borderRadius",lineHeight:"lineHeight",background:"background",font:"fontFamily",opacity:"opacity",gap:"gap",minHeight:"minHeight",position:"position",inset:"inset",top:"top",right:"right",bottom:"bottom",left:"left",zIndex:"zIndex",flex:"flex",flexShrink:"flexShrink",flexGrow:"flexGrow",flexBasis:"flexBasis",flexWrap:"flexWrap",alignSelf:"alignSelf",display:"display",gridTemplateColumns:"gridTemplateColumns",gridTemplateRows:"gridTemplateRows",rowGap:"rowGap",columnGap:"columnGap",letterSpacing:"letterSpacing",textTransform:"textTransform",whiteSpace:"whiteSpace",overflowWrap:"overflowWrap",wordBreak:"wordBreak",wordWrap:"wordWrap",boxShadow:"boxShadow",backdropFilter:"backdropFilter",WebkitBackdropFilter:"WebkitBackdropFilter",overflow:"overflow",overflowX:"overflowX",overflowY:"overflowY",WebkitOverflowScrolling:"WebkitOverflowScrolling",WebkitTapHighlightColor:"WebkitTapHighlightColor",minWidth:"minWidth",boxSizing:"boxSizing",pointerEvents:"pointerEvents",userSelect:"userSelect",WebkitUserSelect:"WebkitUserSelect",textAlign:"textAlign",transition:"transition"};for(var n in t)null!=e[n]&&(this.res.style[t[n]]=e[n]);return"string"==typeof e.transform&&(this.res.style.transform=e.transform),e.pad&&this.pad(e.pad),e.mar&&this.mar(e.mar),e.respad&&this.respad(e.respad),e.resmar&&this.resmar(e.resmar),e.hover&&this.hover(e.hover),e.size&&this.fluidCopy(e.size),e.resprop&&this.resprop(e.resprop,e),e.keySet&&this.keySet(e.keySet),e.noTheme&&(this._noTheme=!0),e.theme&&this.theme(e.theme),e.hide&&this.isHidden(e.hide),e.raster&&this.rasterize(e.raster),e.transform&&"object"===z(e.transform)&&this.reactOnTransform(e.transform),void 0!==e.opacity&&(this.res.style.opacity=e.opacity),e.bold?this.res.style.fontWeight="bold":null!=e.weight&&(this.res.style.fontWeight=e.weight),this}},{key:"hover",value:function(e){var t=this;if(e.border){var n=e.border.width;this.res.style.border=n?"".concat(n,"px solid transparent"):"1px solid transparent"}var r=this.options&&this.options.borderObj;return r&&(this.res.style.border="".concat(r.width,"px solid ").concat(r.color)),this.prevColor=this.res.style.backgroundColor,this.foreColor=this.res.style.color,this.prevBorder=this.res.style.border,this.prevBoxShadow=this.res.style.boxShadow,e.animation&&(this.res.style.transition="".concat(e.animation),this.res.style.transionProperty="background, color, transform"),this.prevTransform=this.res.style.transform,this.res.onmouseout=function(){t.res.style.backgroundColor="".concat(t.prevColor),t.res.style.color="".concat(t.foreColor),t.res.style.border=t.prevBorder,null==e.scale&&null==e.transform||(t.res.style.transform=t.prevTransform||""),null!=e.boxShadow&&(t.res.style.boxShadow=t.prevBoxShadow||"")},this.res.onmouseover=function(){if(t.res.style.color=e.color,t.res.style.backgroundColor=e.background,e.border){var n,r=e.border.width,o=null!==(n=e.border.color)&&void 0!==n?n:"#2ECC71";t.res.style.border=r?"".concat(r,"px solid ").concat(o):"1px solid #2ECC71"}if(null!=e.scale||null!=e.transform){var i=t.prevTransform?"".concat(t.prevTransform," "):"",a=[];null!=e.transform&&a.push(e.transform),null!=e.scale&&a.push("scale(".concat(e.scale,")")),t.res.style.transform="".concat(i).concat(a.join(" "))}null!=e.boxShadow&&(t.res.style.boxShadow=e.boxShadow)},this}},{key:"onScroll",value:function(e){var t=this,n=function(e){if(null==e)return{num:0,unit:"px"};var t=String(e).match(/^(-?[\d.]+)(.*)$/);return t?{num:parseFloat(t[1]),unit:t[2]||"px"}:{num:0,unit:"px"}},r=function(e){var n=e&&null!=e.tx?e.tx:"0px",r=e&&null!=e.ty?e.ty:"0px";t.res.style.transform="translate3d(".concat(n,", ").concat(r,", 0)")};"opacity"===e.value?this.res.style.opacity=e.valMin:"scale"===e.value?this.res.style.transform="scale(".concat(e.valMin,")"):"trn"===e.value&&r(e.valMin);var o=function(){if("trn"!==e.value){var o=t.smartRange(window.scrollY,{min:e.from,max:e.to},{min:e.valMin,max:e.valMax});"opacity"===e.value?t.res.style.opacity=o:"scale"===e.value&&(t.res.style.transform="scale(".concat(o,")"))}else{for(var i={},a=["tx","ty"],s=0;s<a.length;s++){var l=a[s],c=e.valMin&&null!=e.valMin[l],u=e.valMax&&null!=e.valMax[l];if(c||u){var f=n(c?e.valMin[l]:u?e.valMax[l]:"0px"),d=n(u?e.valMax[l]:c?e.valMin[l]:"0px"),h=t.smartRange(window.scrollY,{min:e.from,max:e.to},{min:f.num,max:d.num});i[l]="".concat(h).concat(f.unit)}}r(i)}};window.addEventListener("scroll",o),0===e.from&&o()}},{key:"setAny",value:function(e){this[Object.keys(e)[0]]=[Object.values(e)[0]]}},{key:"setID",value:function(e){this.id=e}},{key:"setPrevText",value:function(e){this.prevText=e}},{key:"getCSS",value:function(){return this.css}},{key:"getPX",value:function(e){return{xs:"0px",sm:"576px",md:"768px",lg:"992px",xl:"1200px",xxl:"1400px",mxxl:"1800px"}[e]||"Invalid breakpoint"}},{key:"_setupResponsiveManager",value:function(){var e=this;this._responsiveTasks=this._responsiveTasks||[];var t=function(){e._responsiveTasks.forEach(function(e){e()})};this._responsiveHandler||(this._responsiveHandler=t,window.addEventListener("resize",t)),setTimeout(function(){t()},0)}},{key:"resprop",value:function(e,t){var n=this;this.options=t;var r={default:[0,1e5],xs:[0,575],sm:[576,767],md:[768,991],lg:[992,1199],xl:[1200,1399],xxl:[1400,1e5]},o=["resprop","breakpoint","value","values","range"],i={flexDir:"flexDirection",dir:"flexDirection",justify:"justifyContent",align:"alignItems",wrap:"flexWrap",bg:"background",radius:"borderRadius",z:"zIndex"},a=function(e){var t=i[e]||e;return"undefined"==typeof console||"function"==typeof n[e]||t in n.res.style||console.warn('[nodality] resprop: "'.concat(e,'" is not a CSS property or component method — ignored.')+(i[e]?"":" Did you mean one of: ".concat(Object.keys(i).join(", "),"?"))),t};e.forEach(function(e){void 0!==r[e.breakpoint]?e.range=r[e.breakpoint]:Array.isArray(e.breakpoint)&&2===e.breakpoint.length?e.range=[parseInt(e.breakpoint[0],10),parseInt(e.breakpoint[1],10)]:e.range=[0,parseInt(e.breakpoint,10)]}),e.sort(function(e,t){return e.range[1]-t.range[1]});var s=e.find(function(e){return"default"===e.breakpoint});for(var l in s||(s={breakpoint:"default",range:r.default},e.unshift(s)),this.prevStyles={},this.res.style)this.res.style.hasOwnProperty(l)&&isNaN(parseInt(l))&&(this.prevStyles[l]=this.res.style[l]);var c=new Set;e.forEach(function(e){Object.keys(e).forEach(function(e){o.includes(e)||"range"===e||c.add(e)})}),c.forEach(function(e){void 0===s[e]&&(s[e]=n.options[e]||"initial")}),this._responsiveTasks=this._responsiveTasks||[],this._responsiveTasks.push(function(){for(var t=window.innerWidth,r=s,i=0;i<e.length;i++){var l=e[i],u=D(l.range,2),f=u[0],d=u[1];if("default"!==l.breakpoint&&t>=f&&t<=d){r=l;break}}for(var h in c.forEach(function(e){if("keySet"===e){var t=s[e];t&&t.key&&(n.res.style[t.key]=t.value)}else n.res.style[a(e)]=s[e]}),r)if("exact"===h&&n.set(r),!o.includes(h)&&"range"!==h){var m=r[h];"keySet"===h&&m&&m.key?n.res.style[m.key]=m.value:"function"==typeof n[h]?n[h](m):n.res.style[a(h)]=m}}),this._setupResponsiveManager()}},{key:"respad",value:function(e){var t=this,n={default:[0,1e5],xs:[0,575],sm:[576,767],md:[768,991],lg:[992,1199],xl:[1200,1399],xxl:[1400,1e5]};e.forEach(function(e){void 0!==n[e.breakpoint]?e.range=n[e.breakpoint]:Array.isArray(e.breakpoint)&&2===e.breakpoint.length?e.range=[parseInt(e.breakpoint[0],10),parseInt(e.breakpoint[1],10)]:e.range=[parseInt(e.breakpoint,10),1e5]}),e.sort(function(e,t){return e.range[0]-t.range[0]});var r=e.find(function(e){return"default"===e.breakpoint});r||(r={breakpoint:"default",range:n.default},e.unshift(r)),void 0===r.values&&(r.values=this.options&&this.options.pad||null),this._responsiveTasks=this._responsiveTasks||[],this._responsiveTasks.push(function(){for(var n=window.innerWidth,o=r,i=0;i<e.length;i++){var a=e[i],s=D(a.range,2),l=s[0],c=s[1];if("default"!==a.breakpoint&&n>=l&&n<=c){o=a;break}}var u=void 0!==o.values?o.values:r.values;null!=u&&t.pad(u)}),this._setupResponsiveManager()}},{key:"_applyResponsive",value:function(e,t){var n={default:[0,1e5],xs:[0,575],sm:[576,767],md:[768,991],lg:[992,1199],xl:[1200,1399],xxl:[1400,1e5]};e.forEach(function(e){if(void 0!==n[e.breakpoint])e.range=n[e.breakpoint];else{var t=parseInt(e.breakpoint,10);e.range=[t,1e5]}}),e.sort(function(e,t){return e.range[0]-t.range[0]});var r=e.find(function(e){return"default"===e.breakpoint})||{breakpoint:"default",range:n.default},o=function(){for(var n=window.innerWidth,o=r,i=0;i<e.length;i++){var a=e[i],s=D(a.range,2),l=s[0],c=s[1];if("default"!==a.breakpoint&&n>=l&&n<=c){o=a;break}}t(o)};this._responsiveHandler&&window.removeEventListener("resize",this._responsiveHandler),this._responsiveHandler=o,window.addEventListener("resize",o),setTimeout(function(){o()},0)}},{key:"resmar",value:function(e){var t=this,n={default:[0,1e5],xs:[0,575],sm:[576,767],md:[768,991],lg:[992,1199],xl:[1200,1399],xxl:[1400,1e5]};e.forEach(function(e){void 0!==n[e.breakpoint]?e.range=n[e.breakpoint]:Array.isArray(e.breakpoint)&&2===e.breakpoint.length?e.range=[parseInt(e.breakpoint[0],10),parseInt(e.breakpoint[1],10)]:e.range=[parseInt(e.breakpoint,10),1e5]}),e.sort(function(e,t){return e.range[0]-t.range[0]});var r=e.find(function(e){return"default"===e.breakpoint});r||(r={breakpoint:"default",range:n.default},e.unshift(r)),void 0===r.values&&(r.values=this.options&&(this.options.mar||this.options.pad)||null),this._responsiveTasks=this._responsiveTasks||[],this._responsiveTasks.push(function(){for(var n=window.innerWidth,o=r,i=0;i<e.length;i++){var a=e[i],s=D(a.range,2),l=s[0],c=s[1];if("default"!==a.breakpoint&&n>=l&&n<=c){o=a;break}}var u=void 0!==o.values?o.values:r.values;null!=u&&t.mar(u)}),this._setupResponsiveManager()}},{key:"isNumber",value:function(e){return"number"==typeof e&&!isNaN(e)}},{key:"pad",value:function(e){for(var t=0;t<e.length;t++)for(var n=Object.keys(e[t]),r=0;r<n.length;r++)for(var o=n[r],i=e[t][o],a=0;a<o.length;a++)switch(o[a]){case"a":this.res.style.padding=this.isNumber(i)?"".concat(i,"px"):i;break;case"t":this.res.style.paddingTop=this.isNumber(i)?"".concat(i,"px"):i;break;case"l":this.res.style.paddingLeft=this.isNumber(i)?"".concat(i,"px"):i;break;case"r":this.res.style.paddingRight=this.isNumber(i)?"".concat(i,"px"):i;break;case"b":this.res.style.paddingBottom=this.isNumber(i)?"".concat(i,"px"):i}return this}},{key:"as",value:function(e){return this.res.style.alignSelf=e,this}},{key:"mar",value:function(e){if("center"===e)return this.res.style.marginLeft="auto",this.res.style.marginRight="auto",this;for(var t=0;t<e.length;t++)for(var n=Object.keys(e[t]),r=0;r<n.length;r++){for(var o=n[r],i=e[t][o],a=0;a<o.length;a++)switch(o[a]){case"a":"auto"===i?(this.res.style.marginLeft="auto",this.res.style.marginRight="auto"):this.res.style.margin=this.isNumber(i)?"".concat(i,"px"):i;break;case"t":this.res.style.marginTop=this.isNumber(i)?"".concat(i,"px"):i;break;case"l":this.res.style.marginLeft=this.isNumber(i)?"".concat(i,"px"):i;break;case"r":this.res.style.marginRight=this.isNumber(i)?"".concat(i,"px"):i;break;case"b":this.res.style.marginBottom=this.isNumber(i)?"".concat(i,"px"):i}"center"===o&&!0===i&&(this.res.style.marginLeft="auto",this.res.style.marginRight="auto"),"auto"===i&&(o.includes("l")||o.includes("r"))&&(o.includes("l")&&(this.res.style.marginLeft="auto"),o.includes("r")&&(this.res.style.marginRight="auto"))}return this}},{key:"smartRange",value:function(e,t,n){e<t.min&&(e=t.min),e>t.max&&(e=t.max);var r=(e-t.min)/(t.max-t.min);t.min>t.max&&(r=(e-t.max)/(t.min-t.max));var o=(n.min-n.max)*r-n.min;if(o=Math.abs(o),n.min<n.max){var i=(n.max+Math.abs(n.min))*r;o=n.min+i}return o}},{key:"gpos",value:function(e){return this.res.style.gridColumn=e.col,this.res.style.gridRow=e.row,this}},{key:"fluidCopy",value:function(e){if(e instanceof Object){this.prevStylex=this.res.style,this.res=document.createElement("h1"),this.res.style.cssText=this.prevStylex.cssText;var t=document.createTextNode(this.text);return this.res.appendChild(t),this.res.style.fontSize=e.exact,this}if("S1"===e){this.prevStylex=this.res.style,this.res=document.createElement("h1"),this.res.style.cssText=this.prevStylex.cssText;var n=document.createTextNode(this.text);this.res.appendChild(n),this.res.style.fontSize="calc(1.625rem + 5.075vw)"}if("S2"===e){this.prevStylex=this.res.style,this.res=document.createElement("h2"),this.res.style.cssText=this.prevStylex.cssText;var r=document.createTextNode(this.text);this.res.appendChild(r),this.res.style.fontSize="calc(1.500rem + 4.3vw)"}if("S3"===e){this.prevStylex=this.res.style,this.res=document.createElement("h3"),this.res.style.cssText=this.prevStylex.cssText;var o=document.createTextNode(this.text);this.res.appendChild(o),this.res.style.fontSize="calc(1.375rem + 3.525vw)"}if("S4"===e){this.prevStylex=this.res.style,this.res=document.createElement("h4"),this.res.style.cssText=this.prevStylex.cssText;var i=document.createTextNode(this.text);this.res.appendChild(i),this.res.style.fontSize="calc(1.250rem + 2.75vw)"}if("S5"===e){this.prevStylex=this.res.style,this.res=document.createElement("h5"),this.res.style.cssText=this.prevStylex.cssText;var a=document.createTextNode(this.text);this.res.appendChild(a),this.res.style.fontSize="calc(1.125rem + 1.975vw)"}return"S6"===e&&(this.res.style.fontSize="calc(1rem + 0.5vw)"),this}},{key:"setIndex",value:function(e){this.index=e}},{key:"borderObj",value:function(e){var t,n=null!==(t=e.type)&&void 0!==t?t:"solid";return this.res.style.border="".concat(e.width," ").concat(n," ").concat(e.color),void 0!==e.radius&&(this.res.style.borderRadius=e.radius),this}},{key:"setPref",value:function(e){this.preffersId=e}},{key:"setClass",value:function(e){this.class=e}},{key:"setTags",value:function(e){this.openTag=e.open,this.closeTag=e.close}},{key:"chainReact",value:function(e,t,n){var r=this;this.ap=!1,this.cta=0,this.once=!1;var o,i=M(e);try{for(i.s();!(o=i.n()).done;){var a=o.value;a.range||(a.range=["0px","999999px"])}}catch(e){i.e(e)}finally{i.f()}e.sort(function(e,t){return parseInt(e.range[0])-parseInt(t.range[0])});var s=function(o){var i=window.visualViewport.width,a=[],s=[];r.resCopy=r.res,r.storedQueries=e.map(function(e){return e.target}).filter(function(e){return null!=e});var l,c=M(e);try{for(c.s();!(l=c.n()).done;){var u=l.value;r.counterIndex++;var f=D(u.range,2),d=f[0],h=f[1],m=parseInt(d),p=parseInt(h),v=!0;if(u.target){v=!1;for(var y=0;y<u.target.length;y++)u.target[y]===t&&(v=!0)}i>=m&&i<=p&&v&&(a.push(u.log),s.push(u),u.op&&u.op.margin&&(r.useMargin=u.op.margin))}}catch(e){c.e(e)}finally{c.f()}if(n&&!n.includes("background")&&(r.res.style.background="",r.res.style.backgroundColor=""),r.res.style.textShadow="",n&&!n.includes("border")&&(r.res.style.border=""),n&&!n.includes("margin")&&(r.res.style.margin=""),r.res.style["-webkit-text-fill-color"]="",r.res.style["-webkit-text-stroke-color"]="",r.res.style["-webkit-text-stroke-width"]="",r.res.style.filter="",r.options.background&&(r.res.style.background=r.options.background),a.includes("gradient"),(a.includes("gradient")||a.includes("shadow"))&&(r.res.style.position="relative"),a.includes("blast")){var g,x=s.filter(function(e){return"blast"===e.log})[0].op.color,b=null!==(g=s.filter(function(e){return"blast"===e.log})[0].op.width)&&void 0!==g?g:"1px";"FlexRowLayoutElement"===r.getType()||"LayoutWrapperElement"===r.getType()?(r.res.style.border="".concat("number"==typeof b?b+"px":b," solid orange"),r.res.style.display="inline-block","FlexRowLayoutElement"===r.getType()&&(r.res.style.display="flex"),r.res.style.boxSizing="border-box",r.res.style.transformOrigin="center",r.blastTarget=r.res):(r.text,r.res.style["-webkit-text-fill-color"]="transparent",r.res.style["-webkit-text-stroke-color"]=x,r.res.style["-webkit-text-stroke-width"]="".concat(b))}if(a.includes("filter")){var w=s.filter(function(e){return"filter"===e.log})[0].op.filter;r.res.style.filter=w}if(a.includes("background")&&(r.res.style.backgroundColor="green"),a.includes("gradient")&&("LayoutWrapperElement"!==r.getType()&&"FlexRowLayoutElement"!==r.getType()&&(r.res.style["-webkit-text-fill-color"]="transparent"),r.res.style.background=r.globalGradient,"LayoutWrapperElement"!==r.getType()&&"FlexRowLayoutElement"!==r.getType()&&(r.res.style["background-clip"]="text")),a.includes("shadow")){var k,_,S,E,T=r.options.shadow.op,A=null!==(k=T.steps)&&void 0!==k?k:1,C=null!==(_=T.colors)&&void 0!==_?_:["gray"],R=null!==(S=T.movements)&&void 0!==S?S:["3px","3px"],F=null!==(E=T.radius)&&void 0!==E?E:"3px";if(1===R.length&&(R=[R[0],R[0]]),"FlexRowLayoutElement"===r.getType()||"LayoutWrapperElement"===r.getType()){for(var L=[],z=0;z<A;z++){var I,O=null!==(I=C[z])&&void 0!==I?I:C[0],P=R[0],W=R[1];L.push("".concat(P," ").concat(W," ").concat(F," ").concat(O))}r.res.style.boxShadow=L.join(", ")}else{for(var j=[],B=0;B<A;B++){var N,U=null!==(N=C[B])&&void 0!==N?N:C[0],G=R[0],X=R[1];j.push("drop-shadow(".concat(G," ").concat(X," ").concat(F," ").concat(U,")"))}r.res.style.filter=j.join(" ")}}if(a.includes("margin"))for(y=0;y<e.length;y++)if(e[y].op){var H=e[y].op.offsets;H&&void 0!==r.index&&(r.res.style.margin=H[Number(r.index)]+"px")}if(a.includes("spana")||a.includes("span")){var q=document.createElement("div");if(q.setAttribute("id","oroa"),Object.assign(q.style,{position:"absolute",inset:"0",background:"linear-gradient(90deg, rgb(52,152,219), rgb(26,188,156))",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",pointerEvents:"none"}),r.res&&r.res.querySelector("span"))return;r.res=r.resCopy,r.res.textContent="",r.options.span&&(Array.isArray(r.options.span)?r.options.span:[r.options.span]).forEach(function(e){if(e.op&&"span"===e.op.name&&Array.isArray(e.op.parts)){var t=0,n=r.prevText||"";if(e.op.parts.forEach(function(e){var o=e.text,i=e.style||{};if(t<n.length){var a=n.indexOf(o,t);if(a>t){var s=n.substring(t,a);r.res.appendChild(new r.constructor(s).setup({type:"span",id:i.id,animation:i.animation}).set({}).render())}t=a+o.length}var l=new r.constructor(o).setup({type:"span",id:i.id,animation:i.animation}).set(i).render();r.res.appendChild(l)}),t<n.length){var o=n.substring(t);r.res.appendChild(new r.constructor(o).setup({type:"span"}).set({}).render())}}})}else{var Y=new r.constructor(r.prevText).set({}).render();r.prevText&&r.prevText.length>0&&o&&r.res.appendChild(Y)}if(a.includes("animation")){if(r.options.animation&&!r.hasAnimated&&!r.options.animation.op.fireAt){r.hasAnimated=!0;var V=r.options.animation.op;window.addEventListener("sidebar:open",function(){r.res.animate(V.keyframesOpen,V.openOptions)}),window.addEventListener("sidebar:closed",function(){r.res.animate(V.keyframesClose,V.closeOptions)}),r.res.animate(V.keyframesClose,{duration:0,fill:"forwards"}),r.openTag&&r.closeTag&&(window.addEventListener(r.openTag,function(){r.res.animate(V.keyframesOpen,V.openOptions)}),window.addEventListener(r.closeTag,function(){r.res.animate(V.keyframesClose,V.closeOptions)}))}if(r.options.animation&&r.options.animation.op.fireAt&&r.options.animation.op.fireAt.endsWith("px")){var $=r.options.animation.op;r.res.animate($.keyframesClose,{duration:0,fill:"forwards"});var K=function(){window.scrollY>parseFloat($.fireAt)&&(r.res.animate($.keyframesOpen,$.openOptions),window.removeEventListener("scroll",K))};window.addEventListener("scroll",K)}if(r.options.animation&&"inview"===r.options.animation.op.fireAt){var Q=r.options.animation.op;r.res.animate(Q.keyframesClose,{duration:0,fill:"forwards"});var J=!1;new IntersectionObserver(function(e,t){e.forEach(function(e){e.isIntersecting&&!J&&(J=!0,r.res.animate(Q.keyframesOpen,Q.openOptions),t.disconnect())})}).observe(r.res)}}};this.options.animation||window.addEventListener("resize",function(){return s()}),s()}},{key:"maxWidth",value:function(e){return this.res.style.maxWidth=e,this}},{key:"removeQuotesFromFirstWord",value:function(e){return e.replace(/"([^"]+)":/g,"$1:")}},{key:"arrayMargin",value:function(e,t){return e.includes("left")&&(this.res.style.marginLeft=t),e.includes("right")&&(this.res.style.marginRight=t),e.includes("top")&&(this.res.style.marginTop=t),e.includes("bottom")&&(this.res.style.marginBottom=t),e.includes("all")&&(this.res.style.margin=t),t||(this.res.style.marginBottom=e),this}}],t&&I(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function W(e){return W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},W(e)}function j(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||B(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 B(e,t){if(e){if("string"==typeof e)return N(e,t);var n={}.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)?N(e,t):void 0}}function N(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function U(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,G(r.key),r)}}function G(e){var t=function(e){if("object"!=W(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=W(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==W(t)?t:t+""}function X(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(X=function(){return!!e})()}function H(e,t,n,r){var o=q(Y(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof o?function(e){return o.apply(n,e)}:o}function q(){return q="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Y(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}},q.apply(null,arguments)}function Y(e){return Y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Y(e)}function V(e,t){return V=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},V(e,t)}var $=function(){function e(t,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(e,t,n){return t=Y(t),function(e,t){if(t&&("object"==W(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,X()?Reflect.construct(t,n||[],Y(e).constructor):t.apply(e,n))}(this,e)).text=t,r.res=null,r.setup(n),r.code=[],r.elCSS=[],r.html=[],r.react=[],r.code.push('new Text("'.concat(r.text,'")')),r}return function(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&&V(e,t)}(e,P),t=e,n=[{key:"flexOne",value:function(){return this.res.style.flex="1",this}},{key:"setGridWithoutCode",value:function(){return this.res.style.border="1px solid white",this}},{key:"setArea",value:function(e){return this.res.style.gridArea=e,this}},{key:"toCodea",value:function(){return this.excludeFromCodeTrue&&(this.code=[""]),this.code}},{key:"toCode",value:function(){if(this.excludeFromCodeTrue)return[""];var e=Object.fromEntries(Object.entries(this.options).filter(function(e){var t=j(e,2);return t[0],null!==t[1]})),t=JSON.stringify(e,null,4).replace(/"([^"]+)":/g,"$1:");return['new Text("'.concat(this.text,'").set(').concat(t,")")]}},{key:"toCSS",value:function(){return this.css}},{key:"toHTMLA",value:function(){return this.html}},{key:"toElCSS",value:function(){return this.elCSS=this.elCSS.map(function(e){return" "+e}),this.preffersId?this.elCSS.unshift(this.res.id+" { \n"):this.elCSS.unshift("."+this.class+" { \n"),this.elCSS.push(" } \n \n"),this.elCSS}},{key:"getType",value:function(){return"S1"===this.options.fluidc?"HTMLHeaderElement":"HTMLParagraphElement"}},{key:"gradientOptions",value:function(e){var t=this;if(0===e.length)return this;var n=e.filter(function(e){return"gradient"===e.op.name})[0];if(void 0===n)return this;var r=n.op;if(n.point){var o=function(){window.matchMedia("(min-width: ".concat(n.range[0],") and (max-width: ").concat(n.range[1],")")).matches&&(t.prevBackground=t.res.style.color.toString(),t.res.style.background=r.gradient,t.res.style.WebkitBackgroundClip="text")};o(),window.addEventListener("resize",o)}}},{key:"strokeOptions",value:function(e){var t=this;if(0===e.length)return this;var n=e.filter(function(e){return"blast"===e.op.name})[0];if(void 0===n)return this;var r=n.op;if(n.point){var o=function(){window.matchMedia("(min-width: ".concat(n.range[0],") and (max-width: ").concat(n.range[1],")")).matches&&(r.color?t.res.style["-webkit-text-stroke"]="".concat(r.width?r.width:"1px"," ").concat(r.color):t.res.style["-webkit-text-stroke"]="1px orange",t.res.style["-webkit-text-fill-color"]="transparent")};o(),window.addEventListener("resize",o)}else r.color&&(this.res.style["-webkit-text-stroke"]="".concat(r.width?r.width:"1px"," ").concat(r.color)),this.res.style["-webkit-text-fill-color"]="transparent"}},{key:"stroke",value:function(){return this.res.style["-webkit-text-stroke"]="3px orange",this}},{key:"fill",value:function(){return this.res.style["-webkit-text-fill-color"]="transparent",this}},{key:"rowCol",value:function(e,t){return this.res.style.gridRow=e,this.res.style.gridColumn=t,this}},{key:"setGridRow",value:function(e){return this.res.style.gridRow=e,this}},{key:"setGridCol",value:function(e){return this.res.style.gridColumn=e,this}},{key:"toHTML",value:function(){return this.res}},{key:"onTap",value:function(e){return this.res.addEventListener("click",e),this}},{key:"setClass",value:function(e){return this.res.setAttribute("class",e),this}},{key:"setRandom",value:function(){for(var e="LAYOUT-",t=90;t>0;--t)e+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return e+=(new Date).getTime(),this.res.setAttribute("class",e),this}},{key:"styled",value:function(e){return this.set(e),this}},{key:"removeQuotesFromFirstWord",value:function(e){return e.replace(/"([^"]+)":/g,"$1:")}},{key:"looksLikeMarkdown",value:function(e){return/(\*\*.*\*\*|\*.*\*|`[^`]+`|\[.*?\]\(.*?\)|^# )/m.test(e)}},{key:"parseMarkdown",value:function(e){var t=e;return(t=(t=(t=(t=(t=(t=(t=t.replace(/^### (.*$)/gim,"<h3>$1</h3>")).replace(/^## (.*$)/gim,"<h2>$1</h2>")).replace(/^# (.*$)/gim,"<h1>$1</h1>")).replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>")).replace(/\*(.*?)\*/g,"<em>$1</em>")).replace(/`([^`]+)`/g,"<code>$1</code>")).replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2">$1</a>')).replace(/\n/g,"<br>")}},{key:"set",value:function(t){return this.resCopy=this.res,this.options=t,H(e,"setPrevText",this,3)([this.text]),t.raster&&this.rasterize(t.raster),this.commonMethods(t),t.left&&(this.res.style.left=t.left),t.flex&&(this.res.style.display="flex"),(t.left||t.top)&&(this.res.style.position="absolute"),t.maxWidth&&(this.res.style.maxWidth=t.maxWidth),t.cursor&&(this.res.style.cursor="hand"),t.gpos&&this.gpos(t.gpos),t.vtn&&(this.res.style.viewTransitionName=t.vtn),t.index&&H(e,"setIndex",this,3)([t.index]),t.index&&(this.index=t.index),t.preffersId&&(this.preffersId=t.preffersId),H(e,"setPref",this,3)([t.preffersId]),t.removeDecoration&&(this.res.style.textDecoration="none"),t.block&&(this.res.style.display="block"),t.area&&this.setArea(t.area),t.icon&&this.addIcon(t.icon),t.color&&this.color(t.color),t.color&&this.elCSS.push("color: ".concat(t.color,"; \n")),t.class&&this.setClass(t.class),t.size&&this.fluidCopy(t.size),t.fluidc&&this.fluidCopy(t.fluidc),this.options.id&&this.res.setAttribute("id",this.options.id),H(e,"setID",this,3)([this.options.id]),t.initLetter&&this.initLetter(t.initLetter),t.onTap&&this.onTap(t.onTap),"S6"===t.fluidc?t.fluidc&&this.elCSS.push("font-size: calc(1.1rem + 2.075vw); \n"):t.fluidc&&this.elCSS.push("font-size: calc(1.625rem + 5.075vw); \n"),this.options.class&&this.res.setAttribute("class",this.options.class),H(e,"setClass",this,3)([this.options.class]),t.clampc&&this.clampCopy(t.clampc),t.arrpad&&this.arrayPadding(t.arrpad.sides,t.arrpad.value),t.absolute&&(this.res.style.position="absolute"),t.arrayMargin&&this.arrayMargin(t.arrayMargin.sides,t.arrayMargin.value),t.em&&this.em(t.em),t.fluid&&this.fluid(t.fluid),t.fluidc&&this.elCSS.push("font-family: ".concat(t.font,"; \n")),t.align&&(this.res.style.textAlign=t.align),t.padding&&this.padding(t.padding),t.breakWord&&(this.res.style.wordWrap="break-word"),t.center&&(this.res.style.marginRight="auto"),t.center&&(this.res.style.marginLeft="auto"),t.italic&&this.italic(),t.responsive&&this.responsive(),t.border&&(this.res.style.border="".concat(t.border)),t.onScroll&&this.onScroll(t.onScroll),t.keySet&&this.keySet(t.keySet),this.callReact(t),this}},{key:"callReact",value:function(t){var n=[],r=t.transform&&"object"===W(t.transform);if(t.stroke||t.gradient||t.span||t.backgroundOp||t.layout||t.shadow||t.animation||t.filtera||r){t.gradient&&(this.globalGradient=t.gradient.op.gradient,"radial"===t.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)")),t.stroke&&H(e,"setAny",this,3)([{globalBlast:"".concat(t.stroke.op.width," ").concat(t.stroke.op.color)}]),t.span&&(t.span.prevText=this.text);var o=[t.stroke,t.gradient,t.animation,t.span,t.backgroundOp,t.layout,t.marginOp,t.shadow,t.animation,t.filtera,r?t.transform:void 0];o=o.filter(function(e){return null!=e});for(var i=0;i<o.length;i++)n.push({range:o[i].range,log:o[i].op.name,target:o[i].target,op:o[i].op});var a=[];t.borderObj&&a.push("border"),t.background&&a.push("background"),t.mar&&a.push("margin"),t.animation&&a.push("animation"),t.span&&a.push("span"),this.chainReact(n,this.options.id,a)}}},{key:"excludeFromCode",value:function(){return this.excludeFromCodeTrue=!0,this}},{key:"addIcon",value:function(e){var t=document.createElement("img");return t.style.width="20px",t.style.marginLeft="10px",t.style.height="auto",t.setAttribute("src",e.url),this.res.appendChild(t),this}},{key:"checkForAnimation",value:function(e){e.sort(function(e,t){return parseInt(e.range[0])-parseInt(t.range[0])});var t,n=window.innerWidth,r=function(e){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=B(e))){t&&(e=t);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}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 o,i=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw o}}}}(e);try{for(r.s();!(t=r.n()).done;){var o=t.value,i=j(o.range,2),a=i[0],s=i[1],l=parseInt(a),c=parseInt(s);n>=l&&n<=c&&"animation"===o.log&&this.res.animate([{opacity:0,transform:"translateY(100px)"},{opacity:1,transform:"translateY(0)"}],{duration:1e3,easing:"ease"})}}catch(e){r.e(e)}finally{r.f()}}},{key:"resetSmall",value:function(){this.res.style["-webkit-text-stroke"]="",this.res.style["-webkit-text-fill-color"]=""}},{key:"resetGradient",value:function(){return this.res.style.WebkitBackgroundClip="text",this.res.style.background="transparent",this}},{key:"resetStroke",value:function(){this.res.style["-webkit-text-stroke"]="",this.res.style["-webkit-text-fill-color"]=""}},{key:"innerStroke",value:function(e){e.color?this.res.style["-webkit-text-stroke"]="".concat(e.width?e.width:"1px"," ").concat(e.color):this.res.style["-webkit-text-stroke"]="1px orange",this.res.style["-webkit-text-fill-color"]="transparent"}},{key:"innerGradient",value:function(e){this.res.style.background="linear-gradient(45deg, #ff0000, #00ff00)",this.res.style["-webkit-background-clip"]="text"}},{key:"arrayMargin",value:function(e,t){return t||(this.res.style.marginLeft="".concat(e[0],"px"),this.res.style.marginTop="".concat(e[1],"px"),this.res.style.marginRight="".concat(e[2],"px"),this.res.style.marginBottom="".concat(e[3],"px")),e.includes("left")&&(this.res.style.marginLeft=t),e.includes("right")&&(this.res.style.marginRight=t),e.includes("top")&&(this.res.style.marginTop=t),e.includes("bottom")&&(this.res.style.marginBottom=t),t||(this.res.style.marginBottom=e),this}},{key:"clampExperiment",value:function(){return this.res.style.fontSize="clamp(1rem, calc(1rem * 10rem), 3rem)",this}},{key:"between",value:function(e){return"S1"===e&&(this.res.style.fontSize="clamp(2rem, 8vw, 2.5rem)"),"S2"===e&&(this.res.style.fontSize="clamp(4rem, 8vw, 5rem)"),"S3"===e&&(this.res.style.fontSize="clamp(2rem, 5vw, 2.5rem)"),"S4"===e&&(this.res.style.fontSize="clamp(1.5rem, 2vw, 1.6rem)"),"S5"===e&&(this.res.style.fontSize="clamp(1.2rem, 2vw, 1.3rem)"),"S6"===e&&(this.res.style.fontSize="clamp(1rem, 2vw, 1.3rem)"),this}},{key:"betweenCopy",value:function(e){return"S1"===e&&(this.res.style.fontSize="clamp(2rem, 8vw, 2.5rem)"),"S2"===e&&(this.res.style.fontSize="clamp(4rem, 8vw, 5rem)"),"S3"===e&&(this.res.style.fontSize="clamp(2rem, 5vw, 2.5rem)"),"S4"===e&&(this.res.style.fontSize="clamp(1.5rem, 2vw, 1.6rem)"),"S5"===e&&(this.res.style.fontSize="clamp(1.2rem, 2vw, 1.3rem)"),"S6"===e&&(this.res.style.fontSize="clamp(1rem, 2vw, 1.3rem)"),this}},{key:"stringGen",value:function(e){for(var t="",n=0;n<e;n++)t+="abcdefghijklmnopqrstuvwxyz".charAt(Math.floor(26*Math.random()));return t}},{key:"initLetter",value:function(e){var t=document.createElement("style");document.body.appendChild(t),Math.random();var n=this.stringGen(1e3);return this.res.setAttribute("id",n),document.styleSheets[0].insertRule("#".concat(n,"::first-letter { color: green; font-size: 3em; padding: 0.1em }"),0),this}},{key:"constant",value:function(e){return"S1"===e&&this.jumbotron(),"S2"===e&&this.large(),"S3"===e&&this.medium(),this}},{key:"minusMargin",value:function(){return this.res.style.marginRight="-3.1em",this}},{key:"fluid",value:function(e){if("S1"===e){this.res=document.createElement("h1");var t=document.createTextNode(this.text);this.res.appendChild(t),this.res.style.fontSize="calc(1.625rem + 4.3vw)"}if("S2"===e){this.res=document.createElement("h2");var n=document.createTextNode(this.text);this.res.appendChild(n),this.res.style.fontSize="calc(1.525rem + 3.525vw)"}if("S3"===e){this.res=document.createElement("h3");var r=document.createTextNode(this.text);this.res.appendChild(r),this.res.style.fontSize="calc(1.375rem + 2.75vw)"}if("S4"===e){this.res=document.createElement("h4");var o=document.createTextNode(this.text);this.res.appendChild(o),this.res.style.fontSize="calc(1.275rem + 1.975vw)"}return"S5"===e&&(this.res.style.fontSize="calc(1.1rem + 1.2vw)"),this}},{key:"getClampValue",value:function(e){return"S7"===e?"clamp(1.45rem, 2vw + 1.5rem, 1.69rem)":"S6"===e?"clamp(2.25rem, 2vw+1.5rem, 3.25rem)":"S5"===e?"clamp(2.75rem, 2vw + 1.5rem, 3.25rem)":"S4"===e?"clamp(3.5rem, 2vw + 1.5rem, 3.25rem)":"S3"===e?"clamp(4.25rem, 2vw + 1.5rem, 3.25rem)":"S2"===e?"clamp(5rem, 2vw + 1.5rem, 3.25rem)":"S1"===e?"clamp(6rem, 2vw + 1.5rem, 3.25rem)":void 0}},{key:"clampCopy",value:function(e){return this.res.style.fontSize=this.getClampValue(e),this}},{key:"toReactComponent",value:function(){return this.react.push("function Godzilla() { \n"),this.react.push('return <h1 class="'.concat(this.options.class,'">').concat(this.text,"</h1> \n")),this.react.push("} \n \n"),this.react}},{key:"myself",value:function(e){var t=this,n=function(){window.matchMedia("(max-device-width: 415px)").matches?t.res.style.fontSize=e.desktop:t.res.style.fontSize=e.phone};return n(),window.addEventListener("resize",n),this}},{key:"jumbotron",value:function(){var e=this,t=function(){window.matchMedia("(max-device-width: 415px)").matches?e.res.style.fontSize="8rem":e.res.style.fontSize="6rem"};return t(),window.addEventListener("resize",t),this}},{key:"large",value:function(){var e=this,t=function(){window.matchMedia("(max-device-width: 415px)").matches?e.res.style.fontSize="7rem":e.res.style.fontSize="5rem"};return t(),window.addEventListener("resize",t),this}},{key:"frame",value:function(e){return this.res.style.width=e.width,this.res.style.height=e.height,this}},{key:"vw",value:function(e,t,n){}},{key:"responsive",value:function(e){var t=this;this.set=!1,this.setB=!1;var n=function(){window.innerWidth<e.minw?(t.setB=!1,t.set||(t.res.style.color="#3498db",t.res.style.fontSize="".concat(e.baseVW/100*window.innerWidth,"px"),t.set=!0)):window.innerWidth>e.maxw?(t.set=!1,t.setB||(t.res.style.color="orange",t.res.style.fontSize="".concat(e.baseVW/100*e.maxw,"px"),t.setB=!0)):(t.set=!1,t.setB=!1,t.res.style.color="black",t.res.style.fontSize="".concat(e.baseVW,"vw"))};return n(),window.addEventListener("resize",n),this}},{key:"xlarge",value:function(){var e=this,t=function(){window.matchMedia("(max-device-width: 415px)").matches?e.res.style.fontSize="6.5rem":e.res.style.fontSize="8.5rem"};return t(),window.addEventListener("resize",t),this}},{key:"medium",value:function(){var e=this,t=function(){window.matchMedia("(max-device-width: 415px)").matches?e.res.style.fontSize="2.25rem":e.res.style.fontSize="1.5em"};return t(),window.addEventListener("resize",t),this}},{key:"auto",value:function(){var e=this,t=function(){window.matchMedia("(max-device-width: 415px)").matches?e.res.style.fontSize="2rem":e.res.style.fontSize="1rem"};return t(),window.addEventListener("resize",t),this}},{key:"small",value:function(){var e=this,t=function(){window.matchMedia("(max-device-width: 415px)").matches?e.res.style.fontSize="1.5em":e.res.style.fontSize="1em"};return t(),window.addEventListener("resize",t),this}},{key:"sizes",value:function(e){var t=this;this.res.style.fontSize="".concat(e[0].size,"rem");var n=function(){for(var n=0;n<e.length;n++)e[n].width&&window.matchMedia("(min-width: ".concat(e[n].width,"px)")).matches&&(t.res.style.fontSize="".concat(e[n].size));window.matchMedia("(max-device-width: 415px)").matches&&(t.res.style.fontSize="".concat(e[e.length-1].mobile))};return n(),window.addEventListener("resize",n),this}},{key:"setup",value:function(e){var t;e?((t=document.createElement(e.type)).setAttribute("id",e.id),"span"===e.type&&e.animation&&(t.style.position="relative",t.style.display="block")):t=document.createElement("p");var n=document.createTextNode(this.text);return t.appendChild(n),this.res=t,this.res.style.padding=0,this.res.style.margin=0,this}},{key:"hide",value:function(){return this.res.style.visibility="hidden",this}},{key:"font",value:function(e){return this.res.style.fontFamily=e,this}},{key:"center",value:function(){return this.res.style.textAlign="center",this}},{key:"em",value:function(e){return this.res.style.fontSize="".concat(e,"em"),this}},{key:"color",value:function(e){return this.res.style.color=e,this}},{key:"align",value:function(e){return this.res.style.textAlign="".concat(e),this}},{key:"weight",value:function(e){return this.res.style.fontWeight=e,this}},{key:"bold",value:function(){return this.res.style.fontWeight="bold",this}},{key:"italic",value:function(){return this.res.style.fontStyle="italic",this}},{key:"width",value:function(e,t){return this.res.style.width=e,t&&(this.res.style.marginLeft="auto",this.res.style.marginRight="auto"),this}},{key:"offset",value:function(e){return this.res.style.gridRow=2,this.res.style.gridColumn=2,this.res.style.marginLeft="-60px",this}},{key:"border",value:function(e,t){return this.res.style.border="".concat(t,"px solid ").concat(e),this}},{key:"padding",value:function(e,t,n,r){return(e||t||n||r)&&(this.res.style.paddingLeft=e,this.res.style.paddingTop=t,this.res.style.paddingRight=n,this.res.style.paddingBottom=r),t||n||r||(this.res.style.padding=e),this}},{key:"arrayPadding",value:function(e,t){return e.includes("left")&&(this.res.style.paddingLeft=t),e.includes("right")&&(this.res.style.paddingRight=t),e.includes("top")&&(this.res.style.paddingTop=t),e.includes("bottom")&&(this.res.style.paddingBottom=t),t||(this.res.style.paddingBottom=e),this}},{key:"margin",value:function(e,t){return"top"==e?this.res.style.marginTop=t:"bottom"==e?this.res.style.marginBottom=t:"left"==e?this.res.style.marginLeft=t:"right"==e&&(this.res.style.marginRight=t),this}},{key:"headline",value:function(){return this.em(4),this.font("Arial"),this.bold(),this}},{key:"caption",value:function(){return this.bold(),this.res.style.fontFamily="Arial",this.color("gray"),this.padding("top",20),this.res.style.fontSize="1em",window.matchMedia("(max-device-width: 415px)").matches?this.res.style.fontSize="2em":this.res.style.fontSize="1em",this}},{key:"updating",value:function(e,t){var n=this.res,r=this.text;return Object.defineProperty(e,t,{set:function(e){var t=document.createTextNode(r.replace("$",e));n.replaceChild(t,n.childNodes[0])}}),this}},{key:"style",value:function(e){return this.res.style.color=e.styles.color,this.res.style.fontWeight=e.styles.fontWeight,this.res.style.paddingLeft=e.styles.padding[0],this.res.style.paddingTop=e.styles.padding[1],this.res.style.paddingRight=e.styles.padding[2],this.res.style.paddingBottom=e.styles.padding[3],this.res.style.marginLeft=e.styles.margin[0],this.res.style.paddingTop=e.styles.margin[1],this.res.style.paddingRight=e.styles.margin[2],this.res.style.paddingBottom=e.styles.margin[3],this.res.style.opacity=e.styles.opacity,this}},{key:"applyStyle",value:function(e,t){return window.matchMedia("(max-width: ".concat(e,"px)")).matches&&Object.assign(this.res.style,t.styles),this}},{key:"nextApply",value:function(e){for(var t=this,n=[],r=(this.res.style,function(r){n[0].matches?Object.assign(t.res.style,e[0].styles):n[1].matches?Object.assign(t.res.style,e[1].styles):Object.assign(t.res.style,e[e.length-1].styles)}),o=0;o<e.length;o++){var i=e[o],a=window.matchMedia("(min-width: ".concat(i.min,"px) and (max-width: ").concat(i.max,"px)"));n.push(a),n[o].addListener(r)}return r(),this}},{key:"apply",value:function(e){var t=this,n=this.res.styles,r=function(){for(var r=0;r<e.length;r++){var o=e[r];o.min&&o.max?window.matchMedia("(min-width: ".concat(o.min,"px) and (max-width: ").concat(o.max,"px)")).matches?Object.assign(t.res.style,o.styles):(alert("YES min max, but does not match"),Object.assign(t.res.style,n)):window.matchMedia("(max-width: ".concat(o.max,"px)")).matches?Object.assign(t.res.style,o.styles):(alert("NO min max, and does not match"),Object.assign(t.res.style,n))}};return r(),window.addEventListener("resize",r),this}},{key:"render",value:function(e){if(!e)return this.options&&!this.options.span&&(this.res.textContent=this.text),this.looksLikeMarkdown(this.text)&&(this.res.innerHTML=this.parseMarkdown(this.text)),this.res;this.options&&this.options.id&&this.res.setAttribute("id",this.options.id),this.options&&!this.options.span&&(this.res.textContent=this.text),this.looksLikeMarkdown(this.text)&&(this.res.innerHTML=this.parseMarkdown(this.text)),document.querySelector(e).appendChild(this.res)}}],n&&U(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n}();export{$ as Text};
|