nodality 1.0.201 → 1.0.203
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 +2 -1
- package/dist/animator.cjs.js.LICENSE.txt +5 -0
- package/dist/animator.esm.js +2 -1
- package/dist/animator.esm.js.LICENSE.txt +5 -0
- package/dist/audionew.cjs.js +2 -1
- package/dist/audionew.cjs.js.LICENSE.txt +5 -0
- package/dist/audionew.esm.js +2 -1
- package/dist/audionew.esm.js.LICENSE.txt +5 -0
- package/dist/base.cjs.js +1 -0
- package/dist/base.cjs.js.LICENSE.txt +5 -0
- package/dist/base.esm.js +1 -0
- package/dist/base.esm.js.LICENSE.txt +5 -0
- package/dist/beta-desktop-bar.cjs.js +2 -1
- package/dist/beta-desktop-bar.cjs.js.LICENSE.txt +5 -0
- package/dist/beta-desktop-bar.esm.js +2 -1
- package/dist/beta-desktop-bar.esm.js.LICENSE.txt +5 -0
- package/dist/beta-mobile-bar.cjs.js +2 -1
- package/dist/beta-mobile-bar.cjs.js.LICENSE.txt +5 -0
- package/dist/beta-mobile-bar.esm.js +2 -1
- package/dist/beta-mobile-bar.esm.js.LICENSE.txt +5 -0
- package/dist/bundle.umd.js +1 -1
- package/dist/bundle.umd.js.LICENSE.txt +3 -29
- package/dist/button.cjs.js +2 -1
- package/dist/button.cjs.js.LICENSE.txt +5 -0
- package/dist/button.esm.js +2 -1
- package/dist/button.esm.js.LICENSE.txt +5 -0
- package/dist/card-getter.cjs.js +1 -0
- package/dist/card-getter.cjs.js.LICENSE.txt +5 -0
- package/dist/card-getter.esm.js +1 -0
- package/dist/card-getter.esm.js.LICENSE.txt +5 -0
- package/dist/center.cjs.js +2 -1
- package/dist/center.cjs.js.LICENSE.txt +5 -0
- package/dist/center.esm.js +2 -1
- package/dist/center.esm.js.LICENSE.txt +5 -0
- package/dist/checkbox.cjs.js +2 -1
- package/dist/checkbox.cjs.js.LICENSE.txt +5 -0
- package/dist/checkbox.esm.js +2 -1
- package/dist/checkbox.esm.js.LICENSE.txt +5 -0
- package/dist/code.cjs.js +2 -1
- package/dist/code.cjs.js.LICENSE.txt +5 -0
- package/dist/code.esm.js +2 -1
- package/dist/code.esm.js.LICENSE.txt +5 -0
- package/dist/container.cjs.js +2 -1
- package/dist/container.cjs.js.LICENSE.txt +5 -0
- package/dist/container.esm.js +2 -1
- package/dist/container.esm.js.LICENSE.txt +5 -0
- package/dist/data-list.cjs.js +1 -0
- package/dist/data-list.cjs.js.LICENSE.txt +5 -0
- package/dist/data-list.esm.js +1 -0
- package/dist/data-list.esm.js.LICENSE.txt +5 -0
- package/dist/designer.cjs.js +2 -1
- package/dist/designer.cjs.js.LICENSE.txt +5 -0
- package/dist/designer.esm.js +2 -1
- package/dist/designer.esm.js.LICENSE.txt +5 -0
- package/dist/dropdown.cjs.js +2 -1
- package/dist/dropdown.cjs.js.LICENSE.txt +5 -0
- package/dist/dropdown.esm.js +2 -1
- package/dist/dropdown.esm.js.LICENSE.txt +5 -0
- package/dist/element-mapper.cjs.js +2 -1
- package/dist/element-mapper.cjs.js.LICENSE.txt +5 -0
- package/dist/element-mapper.esm.js +2 -1
- package/dist/element-mapper.esm.js.LICENSE.txt +5 -0
- package/dist/finalresult.esm.js +1 -1
- package/dist/finalresult.esm.js.LICENSE.txt +3 -56
- package/dist/flex-card.cjs.js +2 -1
- package/dist/flex-card.cjs.js.LICENSE.txt +5 -0
- package/dist/flex-card.esm.js +2 -1
- package/dist/flex-card.esm.js.LICENSE.txt +5 -0
- package/dist/flex-grid.cjs.js +2 -1
- package/dist/flex-grid.cjs.js.LICENSE.txt +5 -0
- package/dist/flex-grid.esm.js +2 -1
- package/dist/flex-grid.esm.js.LICENSE.txt +5 -0
- package/dist/flex-row.cjs.js +2 -1
- package/dist/flex-row.cjs.js.LICENSE.txt +5 -0
- package/dist/flex-row.esm.js +2 -1
- package/dist/flex-row.esm.js.LICENSE.txt +5 -0
- package/dist/floating-input.cjs.js +2 -1
- package/dist/floating-input.cjs.js.LICENSE.txt +5 -0
- package/dist/floating-input.esm.js +2 -1
- package/dist/floating-input.esm.js.LICENSE.txt +5 -0
- package/dist/free.cjs.js +2 -1
- package/dist/free.cjs.js.LICENSE.txt +5 -0
- package/dist/free.esm.js +2 -1
- package/dist/free.esm.js.LICENSE.txt +5 -0
- package/dist/horizontal-scroller.cjs.js +1 -0
- package/dist/horizontal-scroller.cjs.js.LICENSE.txt +5 -0
- package/dist/horizontal-scroller.esm.js +1 -0
- package/dist/horizontal-scroller.esm.js.LICENSE.txt +5 -0
- package/dist/image-picker.cjs.js +2 -1
- package/dist/image-picker.cjs.js.LICENSE.txt +5 -0
- package/dist/image-picker.esm.js +2 -1
- package/dist/image-picker.esm.js.LICENSE.txt +5 -0
- package/dist/image.cjs.js +2 -1
- package/dist/image.cjs.js.LICENSE.txt +5 -0
- package/dist/image.esm.js +2 -1
- package/dist/image.esm.js.LICENSE.txt +5 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.LICENSE.txt +3 -56
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.LICENSE.txt +3 -56
- package/dist/keyframe-animation.cjs.js +1 -0
- package/dist/keyframe-animation.cjs.js.LICENSE.txt +5 -0
- package/dist/keyframe-animation.esm.js +1 -0
- package/dist/keyframe-animation.esm.js.LICENSE.txt +5 -0
- package/dist/link-getter.cjs.js +2 -1
- package/dist/link-getter.cjs.js.LICENSE.txt +5 -0
- package/dist/link-getter.esm.js +2 -1
- package/dist/link-getter.esm.js.LICENSE.txt +5 -0
- package/dist/link.cjs.js +2 -1
- package/dist/link.cjs.js.LICENSE.txt +5 -0
- package/dist/link.esm.js +2 -1
- package/dist/link.esm.js.LICENSE.txt +5 -0
- package/dist/meta-adder.cjs.js +1 -0
- package/dist/meta-adder.cjs.js.LICENSE.txt +5 -0
- package/dist/meta-adder.esm.js +1 -0
- package/dist/meta-adder.esm.js.LICENSE.txt +5 -0
- package/dist/modal-2025.cjs.js +1 -0
- package/dist/modal-2025.cjs.js.LICENSE.txt +5 -0
- package/dist/modal-2025.esm.js +1 -0
- package/dist/modal-2025.esm.js.LICENSE.txt +5 -0
- package/dist/multiswitcher.cjs.js +2 -1
- package/dist/multiswitcher.cjs.js.LICENSE.txt +5 -0
- package/dist/multiswitcher.esm.js +2 -1
- package/dist/multiswitcher.esm.js.LICENSE.txt +5 -0
- package/dist/new-nav-bar.cjs.js +2 -1
- package/dist/new-nav-bar.cjs.js.LICENSE.txt +5 -0
- package/dist/new-nav-bar.esm.js +2 -1
- package/dist/new-nav-bar.esm.js.LICENSE.txt +5 -0
- package/dist/picker.cjs.js +2 -1
- package/dist/picker.cjs.js.LICENSE.txt +5 -0
- package/dist/picker.esm.js +2 -1
- package/dist/picker.esm.js.LICENSE.txt +5 -0
- package/dist/progress.cjs.js +1 -0
- package/dist/progress.cjs.js.LICENSE.txt +5 -0
- package/dist/progress.esm.js +1 -0
- package/dist/progress.esm.js.LICENSE.txt +5 -0
- package/dist/radio.cjs.js +1 -0
- package/dist/radio.cjs.js.LICENSE.txt +5 -0
- package/dist/radio.esm.js +1 -0
- package/dist/radio.esm.js.LICENSE.txt +5 -0
- package/dist/range.cjs.js +1 -0
- package/dist/range.cjs.js.LICENSE.txt +5 -0
- package/dist/range.esm.js +1 -0
- package/dist/range.esm.js.LICENSE.txt +5 -0
- package/dist/scroll-video.cjs.js +1 -0
- package/dist/scroll-video.cjs.js.LICENSE.txt +5 -0
- package/dist/scroll-video.esm.js +1 -0
- package/dist/scroll-video.esm.js.LICENSE.txt +5 -0
- package/dist/side-bar.cjs.js +1 -0
- package/dist/side-bar.cjs.js.LICENSE.txt +5 -0
- package/dist/side-bar.esm.js +1 -0
- package/dist/side-bar.esm.js.LICENSE.txt +5 -0
- package/dist/side-nav-bar.cjs.js +2 -1
- package/dist/side-nav-bar.cjs.js.LICENSE.txt +5 -0
- package/dist/side-nav-bar.esm.js +2 -1
- package/dist/side-nav-bar.esm.js.LICENSE.txt +5 -0
- package/dist/simple-bar.cjs.js +2 -1
- package/dist/simple-bar.cjs.js.LICENSE.txt +5 -0
- package/dist/simple-bar.esm.js +2 -1
- package/dist/simple-bar.esm.js.LICENSE.txt +5 -0
- package/dist/slider-2025.cjs.js +2 -1
- package/dist/slider-2025.cjs.js.LICENSE.txt +5 -0
- package/dist/slider-2025.esm.js +2 -1
- package/dist/slider-2025.esm.js.LICENSE.txt +5 -0
- package/dist/spacer.cjs.js +1 -0
- package/dist/spacer.cjs.js.LICENSE.txt +5 -0
- package/dist/spacer.esm.js +1 -0
- package/dist/spacer.esm.js.LICENSE.txt +5 -0
- package/dist/stack.cjs.js +1 -0
- package/dist/stack.cjs.js.LICENSE.txt +5 -0
- package/dist/stack.esm.js +1 -0
- package/dist/stack.esm.js.LICENSE.txt +5 -0
- package/dist/stacker.cjs.js +1 -0
- package/dist/stacker.cjs.js.LICENSE.txt +5 -0
- package/dist/stacker.esm.js +1 -0
- package/dist/stacker.esm.js.LICENSE.txt +5 -0
- package/dist/table.cjs.js +2 -1
- package/dist/table.cjs.js.LICENSE.txt +5 -0
- package/dist/table.esm.js +2 -1
- package/dist/table.esm.js.LICENSE.txt +5 -0
- package/dist/text-field.cjs.js +2 -1
- package/dist/text-field.cjs.js.LICENSE.txt +5 -0
- package/dist/text-field.esm.js +2 -1
- package/dist/text-field.esm.js.LICENSE.txt +5 -0
- package/dist/text.cjs.js +2 -1
- package/dist/text.cjs.js.LICENSE.txt +5 -0
- package/dist/text.esm.js +2 -1
- package/dist/text.esm.js.LICENSE.txt +5 -0
- package/dist/theme.cjs.js +1 -0
- package/dist/theme.cjs.js.LICENSE.txt +5 -0
- package/dist/theme.esm.js +1 -0
- package/dist/theme.esm.js.LICENSE.txt +5 -0
- package/dist/transform-anim.cjs.js +1 -0
- package/dist/transform-anim.cjs.js.LICENSE.txt +5 -0
- package/dist/transform-anim.esm.js +1 -0
- package/dist/transform-anim.esm.js.LICENSE.txt +5 -0
- package/dist/ulist.cjs.js +2 -1
- package/dist/ulist.cjs.js.LICENSE.txt +5 -0
- package/dist/ulist.esm.js +2 -1
- package/dist/ulist.esm.js.LICENSE.txt +5 -0
- package/dist/video.cjs.js +2 -1
- package/dist/video.cjs.js.LICENSE.txt +5 -0
- package/dist/video.esm.js +2 -1
- package/dist/video.esm.js.LICENSE.txt +5 -0
- package/dist/wrap.cjs.js +1 -0
- package/dist/wrap.cjs.js.LICENSE.txt +5 -0
- package/dist/wrap.esm.js +1 -0
- package/dist/wrap.esm.js.LICENSE.txt +5 -0
- package/dist/zoom-card.cjs.js +2 -1
- package/dist/zoom-card.cjs.js.LICENSE.txt +5 -0
- package/dist/zoom-card.esm.js +2 -1
- package/dist/zoom-card.esm.js.LICENSE.txt +5 -0
- package/layout/animator.js +7 -3
- 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 -2
- package/layout/form-components/form-all.js +1 -1
- package/layout/form-components/form.js +1 -2
- 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 -3
- 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 +9 -3
- package/lib/designer.js +1 -1
- package/lib/element-mapper.js +1 -1
- package/lib/keyframe-animation.js +1 -2
- package/lib/link-getter.js +1 -1
- package/lib/raster-ops.js +1 -1
- package/lib/scroll-video.js +1 -3
- package/lib/seo.js +1 -1
- package/lib/stacker.js +1 -3
- package/lib/theme.js +1 -1
- package/lib/transform-anim.js +1 -4
- package/package.json +3 -3
|
@@ -1 +1,2 @@
|
|
|
1
|
-
var t={};function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}t.d=(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var n="nodality.theme.mode",r="nodality:theme",i={mode:function(){try{var t=localStorage.getItem(n);if("light"===t||"dark"===t)return t}catch(t){}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(t){return t&&"object"===e(t)&&(t.light&&(this.defaults.light=Object.assign({},this.defaults.light,t.light)),t.dark&&(this.defaults.dark=Object.assign({},this.defaults.dark,t.dark)),this._broadcast()),this},setTokens:function(t){return t&&"object"===e(t)&&(t.light&&Object.assign(this.tokens.light,t.light),t.dark&&Object.assign(this.tokens.dark,t.dark)),this},get current(){return this.tokens[this.mode]||{}},set:function(t){if("light"!==t&&"dark"!==t)return this;if(t===this.mode)return this;this.mode=t;try{localStorage.setItem(n,t)}catch(t){}return this._broadcast(),this},toggle:function(){return this.set("dark"===this.mode?"light":"dark")},subscribe:function(t){if("undefined"==typeof document)return function(){};var e=function(e){return t(e.detail.mode,e.detail.tokens)};document.addEventListener(r,e);try{t(this.mode,this.current)}catch(t){}return function(){return document.removeEventListener(r,e)}},_broadcast:function(){"undefined"!=typeof document&&document.dispatchEvent(new CustomEvent(r,{detail:{mode:this.mode,tokens:this.current}}))}};function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function a(t){return function(t){if(Array.isArray(t))return u(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||c(t)||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 s(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=c(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function l(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(t,e)||c(t,e)||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 c(t,e){if(t){if("string"==typeof t)return u(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(t,e):void 0}}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var d={static:function(t){return{x:.5*t.w,y:.5*t.h,amt:1}},mouse:function(t){return{x:t.mouseX,y:t.mouseY,amt:1}},hover:function(t){return{x:t.mouseX,y:t.mouseY,amt:t.hover}},scroll:function(t){return{x:.5*t.w,y:t.h*t.scroll,amt:1}},time:function(t){return{x:t.w*(.5+.34*Math.cos(.6*t.t)),y:t.h*(.5+.34*Math.sin(.8*t.t)),amt:1}}},f=Object.keys(d),h={hexalize:{stage:"cell",decl:function(t){return"\n uniform float ".concat(t,"size;\n uniform float ").concat(t,"lift;\n uniform float ").concat(t,"radius;\n uniform vec2 ").concat(t,"dpos;\n uniform float ").concat(t,"damt;")},code:function(t,e){return e.lift?"\n {\n vec2 hp = warped / ".concat(t,"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 vec2 ").concat(t,"AX = normalize(vec2(1.0, 1.7320508));\n vec2 ").concat(t,"c0 = hp - gv;\n // Seed with the owning cell. Its own hexagon always covers the\n // fragment at any scale >= 1, so there is always a winner.\n vec2 ").concat(t,"bestC = ").concat(t,"c0;\n float ").concat(t,"bestF = (1.0 - smoothstep(0.0, ").concat(t,"radius,\n length(").concat(t,"c0 * ").concat(t,"size - ").concat(t,"dpos))) * ").concat(t,"damt;\n float ").concat(t,"bestS = 1.0 + ").concat(t,"lift * ").concat(t,"bestF;\n").concat([[1,0],[-1,0],[.5,.8660254],[-.5,.8660254],[.5,-.8660254],[-.5,-.8660254]].map(function(e){var n,r,i=l(e,2);return n=i[0],r=i[1],"\n {\n vec2 c = ".concat(t,"c0 + vec2(").concat(n.toFixed(7),", ").concat(r.toFixed(7),");\n float f = 1.0 - smoothstep(0.0, ").concat(t,"radius,\n length(c * ").concat(t,"size - ").concat(t,"dpos));\n f *= ").concat(t,"damt;\n float s = 1.0 + ").concat(t,"lift * f;\n vec2 q = hp - c;\n float hd = max(dot(abs(q), ").concat(t,"AX), abs(q).x);\n // Covered by this cell's grown hexagon, and nearer than\n // whatever we have so far.\n if (hd <= 0.5 * s && s > ").concat(t,"bestS) {\n ").concat(t,"bestS = s; ").concat(t,"bestC = c; ").concat(t,"bestF = f;\n }\n }")}).join(""),"\n center = ").concat(t,"bestC * ").concat(t,"size;\n // Divide by the winner's scale: the border test then reaches\n // 0.5 further out (a bigger hexagon) and the sample moves in\n // toward the centre (its content magnified to match), both by\n // the same factor, so proportions are preserved exactly.\n gv = (hp - ").concat(t,"bestC) / max(").concat(t,"bestS, 1e-3);\n warped = center + gv * ").concat(t,'size;\n gv = abs(gv);\n // Border strength follows the SAME falloff as the scale, so a\n // cell that has not been raised draws no border at all. Away\n // from the pointer bestF is 0, which means scale 1, sampling\n // untouched and edge 0 — bit-identical to the source image, so\n // nothing reveals that an effect is attached until the pointer\n // arrives. Pair with by:"hover" for a fully flush resting\n // state; by:"mouse" holds amt at 1 and so keeps a permanent\n // hotspot wherever the pointer last was.\n edge = max(edge, smoothstep(0.44, 0.5,\n max(dot(gv, ').concat(t,"AX), gv.x)) * ").concat(t,"bestF);\n }"):"\n {\n vec2 hp = warped / ".concat(t,"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(t,"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(t,e){return{size:["1f",(t.size||24)*e],lift:["1f",null!=t.lift?t.lift:0],radius:["1f",(t.radius||200)*e]}}},offset:{stage:"warp",defaultDriver:"mouse",decl:function(t){return"uniform float ".concat(t,"strength; uniform float ").concat(t,"radius;\n uniform vec2 ").concat(t,"dpos; uniform float ").concat(t,"damt;")},code:function(t){return"\n {\n float d = length(warped - ".concat(t,"dpos);\n float fall = 1.0 - smoothstep(0.0, ").concat(t,"radius, d);\n vec2 dir = d > 0.5 ? (warped - ").concat(t,"dpos) / d : vec2(0.0);\n warped -= dir * ").concat(t,"strength * fall * ").concat(t,"damt;\n }")},uniforms:function(t,e){return{strength:["1f",(t.strength||20)*e],radius:["1f",(t.radius||260)*e]}}},duotone:{stage:"color",decl:function(t){return"uniform vec3 ".concat(t,"a; uniform vec3 ").concat(t,"b; uniform float ").concat(t,"radius;\n uniform vec2 ").concat(t,"dpos; uniform float ").concat(t,"damt;")},code:function(t,e){return"\n {\n float lum = dot(col, vec3(0.299, 0.587, 0.114));\n vec3 duo = mix(".concat(t,"a, ").concat(t,"b, lum);\n ").concat(e.by?"float mask = (1.0 - smoothstep(".concat(t,"radius * 0.35, ").concat(t,"radius,\n length(center - ").concat(t,"dpos))) * ").concat(t,"damt;"):"float mask = 1.0;","\n col = mix(col, duo, mask);\n }")},uniforms:function(t,e){var n=t.colors||["#104B87","#E8FF00"];return{a:["3fv",p(n[0])],b:["3fv",p(n[1])],radius:["1f",(t.radius||220)*e]}}},edges:{stage:"color",decl:function(t){return"uniform vec3 ".concat(t,"color; uniform float ").concat(t,"strength;")},code:function(t){return"\n {\n edgeCol = ".concat(t,"color;\n edgeCov = max(edgeCov, edge * ").concat(t,"strength);\n }")},uniforms:function(t){return{color:["3fv",p(t.color||"#FFFFFF")],strength:["1f",null!=t.strength?t.strength:1]}}},halftone:{stage:"color",decl:function(t){return"\n uniform float ".concat(t,"size;\n uniform float ").concat(t,"angle;\n uniform vec3 ").concat(t,"ink;\n uniform vec3 ").concat(t,"paper;\n uniform float ").concat(t,"soft;\n uniform float ").concat(t,"radius;\n uniform vec2 ").concat(t,"dpos;\n uniform float ").concat(t,"damt;")},code:function(t,e){return"\n {\n float lum = dot(col, vec3(0.299, 0.587, 0.114));\n float sz = ".concat(t,"size;").concat(e.by?"\n float fd = 1.0 - smoothstep(0.0, ".concat(t,"radius, length(frag - ").concat(t,"dpos));\n sz *= 1.0 + fd * ").concat(t,"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(t,"angle), sa = sin(").concat(t,"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(t,"soft, length(cell));\n col = mix(").concat(t,"paper, ").concat(t,"ink, dm);\n }")},uniforms:function(t,e){return{size:["1f",(t.size||6)*e],angle:["1f",(null!=t.angle?t.angle:15)*Math.PI/180],ink:["3fv",p(t.ink||"#0B1B2B")],paper:["3fv",p(t.paper||"#FFFFFF")],soft:["1f",null!=t.softness?t.softness:.08],radius:["1f",(t.radius||220)*e]}}},dither:{stage:"color",decl:function(t){return"\n uniform float ".concat(t,"levels;\n uniform float ").concat(t,"size;\n uniform float ").concat(t,"amount;\n uniform vec3 ").concat(t,"ink;\n uniform vec3 ").concat(t,"paper;\n uniform vec2 ").concat(t,"dpos;\n uniform float ").concat(t,"damt;\n uniform float ").concat(t,"radius;\n // Bayer matrices by recursive bit-interleave rather than a\n // 64-entry table: WebGL1 has no constant array indexing, and\n // the nesting is exactly the recursive definition of the\n // ordered-dither matrix.\n float ").concat(t,"b2(vec2 a) {\n a = floor(a);\n return fract(a.x * 0.5 + a.y * a.y * 0.75);\n }\n float ").concat(t,"b4(vec2 a) { return ").concat(t,"b2(0.5 * a) * 0.25 + ").concat(t,"b2(a); }\n float ").concat(t,"b8(vec2 a) { return ").concat(t,"b4(0.5 * a) * 0.25 + ").concat(t,"b2(a); }")},code:function(t,e){return"\n {\n float sz = max(".concat(t,"size, 1e-3);").concat(e.by?"\n float fd = 1.0 - smoothstep(0.0, ".concat(t,"radius, length(frag - ").concat(t,"dpos));\n sz *= 1.0 + fd * ").concat(t,"damt * 1.8;"):"","\n // Centre the threshold on zero so dithering does not lift or\n // crush the overall exposure, only redistributes it.\n float t = ").concat(t,"b8(frag / sz) - 0.5;\n float lv = max(").concat(t,"levels, 1.0);\n ").concat(e.mono?"\n float lum = dot(col, vec3(0.299, 0.587, 0.114));\n float q = step(0.5, lum + t);\n vec3 dq = mix(".concat(t,"ink, ").concat(t,"paper, q);"):"\n // Per channel: scale to level index, offset by the threshold,\n // round, scale back. The +t before rounding is what turns a\n // hard band edge into an interleaved pattern of the two\n // neighbouring levels.\n vec3 dq = floor(col * lv + 0.5 + t) / lv;","\n col = mix(col, clamp(dq, 0.0, 1.0), clamp(").concat(t,"amount, 0.0, 1.0));\n }")},uniforms:function(t,e){return{levels:["1f",null!=t.levels?t.levels:6],size:["1f",(null!=t.size?t.size:1)*e],amount:["1f",null!=t.amount?t.amount:1],ink:["3fv",p(t.ink||"#0B1B2B")],paper:["3fv",p(t.paper||"#FFFFFF")],radius:["1f",(t.radius||220)*e]}}},aberration:{stage:"displace",chroma:!0,decl:function(t){return"\n uniform float ".concat(t,"amount;\n uniform float ").concat(t,"radius;\n uniform vec2 ").concat(t,"dpos;\n uniform float ").concat(t,"damt;")},code:function(t,e){return"\n {\n vec2 ctr = ".concat(e.by?"".concat(t,"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(e.by?"float amt = ".concat(t,"amount * ").concat(t,"damt *\n (1.0 - smoothstep(0.0, ").concat(t,"radius, dl));"):"float amt = ".concat(t,"amount * (dl / max(length(u_res) * 0.5, 1.0));"),"\n chroma += dir * amt;\n }")},uniforms:function(t,e){return{amount:["1f",(null!=t.amount?t.amount:6)*e],radius:["1f",(t.radius||240)*e]}}},mask:{stage:"field",producesField:!0,defaultDriver:"static",decl:function(t){return"\n uniform vec2 ".concat(t,"dpos;\n uniform float ").concat(t,"damt;\n uniform float ").concat(t,"radius;\n uniform vec2 ").concat(t,"at;\n uniform vec2 ").concat(t,"remap;\n uniform float ").concat(t,"invert;")},code:function(t,e){var n=e.from||"radial",r=e.at?"(".concat(t,"at * u_res)"):"".concat(t,"dpos"),i="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(t,"radius, length(frag - ").concat(r,"))");return"\n {\n float m = ".concat(i,";\n m = clamp((m - ").concat(t,"remap.x) / max(").concat(t,"remap.y - ").concat(t,"remap.x, 1e-4), 0.0, 1.0);\n m = mix(m, 1.0 - m, ").concat(t,"invert);\n ").concat(g(e.as||"mask")," *= m * ").concat(t,"damt;\n }")},uniforms:function(t,e){return{radius:["1f",(null!=t.radius?t.radius:260)*e],at:["2fv",t.at||[.5,.5]],remap:["2fv",t.remap||[0,1]],invert:["1f",t.invert?1:0]}}},noise:{stage:"field",producesField:!0,decl:function(t){return"\n uniform float ".concat(t,"scale;\n uniform float ").concat(t,"speed;\n uniform vec2 ").concat(t,"remap;\n uniform float ").concat(t,"amp;\n float ").concat(t,"h(vec2 v) {\n return fract(sin(dot(v, vec2(41.113, 289.717))) * 43758.545);\n }\n float ").concat(t,"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(t,"h(i), ").concat(t,"h(i + vec2(1.0, 0.0)), f.x),\n mix(").concat(t,"h(i + vec2(0.0, 1.0)), ").concat(t,"h(i + vec2(1.0, 1.0)), f.x), f.y);\n }")},code:function(t,e){return"\n {\n vec2 np = frag / max(u_res.y, 1.0) * ".concat(t,"scale;\n // Two octaves: enough structure to read as turbulence\n // without the cost of a full fBm.\n float n = ").concat(t,"n(np + u_time * ").concat(t,"speed) * 0.65 +\n ").concat(t,"n(np * 2.7 - u_time * ").concat(t,"speed * 0.6) * 0.35;\n n = clamp((n - ").concat(t,"remap.x) / max(").concat(t,"remap.y - ").concat(t,"remap.x, 1e-4), 0.0, 1.0);\n ").concat(g(e.as||"mask")," *= mix(1.0, n, ").concat(t,"amp);\n }")},uniforms:function(t){return{scale:["1f",null!=t.scale?t.scale:3],speed:["1f",null!=t.speed?t.speed:.3],remap:["2fv",t.remap||[0,1]],amp:["1f",null!=t.amount?t.amount:1]}}},copy:{stage:"color",defaultDriver:"static",decl:function(t){return"\n uniform vec2 ".concat(t,"dpos;\n uniform float ").concat(t,"damt;\n uniform float ").concat(t,"radius;\n uniform float ").concat(t,"scale;\n uniform float ").concat(t,"rotate;\n uniform float ").concat(t,"fade;\n uniform float ").concat(t,"amount;")},code:function(t,e){for(var n=Array.isArray(e.points)&&e.points.length>0,r=n?e.points.length:Math.max(1,Math.min(24,Math.round(e.count||5))),i="",o=function(o){var a,s=n?"vec2(".concat((+e.points[o][0]).toFixed(5),", ").concat((+e.points[o][1]).toFixed(5),") * u_res"):(a=o/r*Math.PI*2,"".concat(t,"dpos + vec2(").concat(Math.cos(a).toFixed(5),", ")+"".concat(Math.sin(a).toFixed(5),") * ").concat(t,"radius"));i+="\n {\n float ang = ".concat(t,"rotate * ").concat((o+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(t,"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(t,"amount * ").concat(t,"damt\n * pow(").concat(t,"fade, ").concat(o.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++)o(a);return i},uniforms:function(t,e){return{radius:["1f",(null!=t.radius?t.radius:110)*e],scale:["1f",null!=t.scale?t.scale:.5],rotate:["1f",null!=t.rotate?t.rotate:0],fade:["1f",null!=t.fade?t.fade:1],amount:["1f",null!=t.amount?t.amount:1]}}},merge:{stage:"color",decl:function(t){return"uniform float ".concat(t,"mix;")},code:function(){return""},uniforms:function(t){return{mix:["1f",null!=t.mix?t.mix:1]}}},echo:{stage:"color",decl:function(t){return"\n uniform sampler2D ".concat(t,"hist;\n uniform float ").concat(t,"strength;\n uniform vec3 ").concat(t,"tint;\n uniform float ").concat(t,"tintAmt;")},code:function(t){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(t,"hist, clamp(huv, 0.001, 0.999));\n float ha = clamp(h.a * ").concat(t,"strength, 0.0, 1.0);\n vec3 hc = mix(h.rgb, ").concat(t,"tint, ").concat(t,"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(t){return{strength:["1f",null!=t.strength?t.strength:.85],tint:["3fv",p(t.tint||"#7FD4FF")],tintAmt:["1f",t.tint?null!=t.tintAmount?t.tintAmount:.5:0]}},solver:{resolutions:function(t,e,n){return{frame:[e,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(t,e,n){var r=Math.min(n.dt,1/30),i=Math.pow(null!=e.decay?e.decay:.92,60*r);t.use("accumulate"),t.f2("u_texel",1/t.canvasW,1/t.canvasH),t.f1("u_decay",i),t.smp("u_content",t.content,0),t.smp("u_hist",t.read("history"),1),t.blit(t.write("history")),t.swap("history")}}},stir:{stage:["warp","color"],decl:function(t){return"\n uniform sampler2D ".concat(t,"vel;\n uniform sampler2D ").concat(t,"dye;\n uniform float ").concat(t,"strength;\n uniform float ").concat(t,"dyemix;\n uniform float ").concat(t,"intensity;\n uniform float ").concat(t,"sheen;\n uniform vec3 ").concat(t,"tint;")},code:function(t,e,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(t,"vel, clamp(fuv, 0.001, 0.999)).xy;\n warped += vec2(v.x, -v.y) * ").concat(t,"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(t,"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(t,"tint;\n float amt = clamp((1.0 - exp(-mag * ").concat(t,"intensity)) * ").concat(t,"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(t,"vel, clamp(suv, 0.001, 0.999)).xy);\n col = mix(col, ").concat(t,"tint, (1.0 - exp(-sp * 0.7)) * ").concat(t,"sheen);\n }")},uniforms:function(t,e){return{strength:["1f",(null!=t.strength?t.strength:26)*e],sheen:["1f",null!=t.sheen?t.sheen:.15],tint:["3fv",p(t.tint||"#7FD4FF")],dyemix:["1f",null!=t.dye?t.dye:.85],intensity:["1f",null!=t.intensity?t.intensity:1.6]}},solver:{resolutions:function(t){return{sim:Math.max(32,Math.min(t.resolution||128,512)),dye:Math.max(64,Math.min(t.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(t,e,n){var r=null!=t.dyeAmount?t.dyeAmount:.6;if(!t.rainbow){var i=p(t.tint||"#7FD4FF");return[i[0]*r,i[1]*r,i[2]*r]}var o=Math.atan2(n,e);return[(.5+.5*Math.cos(o))*r,(.5+.5*Math.cos(o+2.0944))*r,(.5+.5*Math.cos(o+4.1888))*r]},step:function(t,e,n){var r=Math.min(n.dt,1/30),i=1/t.res.sim,o=1/t.res.dye,a=function(t,e){return Math.pow(t,60*e)};if(n.moving){var s=null!=e.force?e.force:1;t.use("splat"),t.f1("u_radius",null!=e.radius?e.radius:.1),t.f1("u_aspect",n.aspect),t.f2("u_point",n.px,n.py),t.f2("u_texel",i,i),t.smp("u_src",t.read("velocity"),0),t.f3("u_amount",n.dx*s,n.dy*s,0),t.blit(t.write("velocity")),t.swap("velocity"),t.f2("u_texel",o,o),t.smp("u_src",t.read("dye"),0),t.f3("u_amount",n.col[0],n.col[1],n.col[2]),t.blit(t.write("dye")),t.swap("dye")}t.use("curl"),t.f2("u_texel",i,i),t.smp("u_vel",t.read("velocity"),0),t.blit(t.single("vorticity")),t.use("confine"),t.f2("u_texel",i,i),t.f1("u_eps",null!=e.curl?e.curl:2.2),t.f1("u_dt",r),t.smp("u_vel",t.read("velocity"),0),t.smp("u_curl",t.single("vorticity"),1),t.blit(t.write("velocity")),t.swap("velocity"),t.use("divergence"),t.f2("u_texel",i,i),t.smp("u_vel",t.read("velocity"),0),t.blit(t.single("divergence")),t.use("decay"),t.f2("u_texel",i,i),t.f1("u_value",a(null!=e.pressure?e.pressure:.8,r)),t.smp("u_tex",t.read("pressure"),0),t.blit(t.write("pressure")),t.swap("pressure"),t.use("jacobi"),t.f2("u_texel",i,i),t.smp("u_div",t.single("divergence"),1);for(var l=Math.max(1,Math.min(e.pressureIterations||6,40)),c=0;c<l;c++)t.smp("u_p",t.read("pressure"),0),t.blit(t.write("pressure")),t.swap("pressure");t.use("subtract"),t.f2("u_texel",i,i),t.smp("u_p",t.read("pressure"),0),t.smp("u_vel",t.read("velocity"),1),t.blit(t.write("velocity")),t.swap("velocity"),t.use("advect"),t.f1("u_dt",r),t.f2("u_texel",i,i),t.smp("u_vel",t.read("velocity"),0),t.smp("u_src",t.read("velocity"),0),t.f1("u_diss",a(null!=e.decay?e.decay:.985,r)),t.blit(t.write("velocity")),t.swap("velocity"),t.f2("u_texel",o,o),t.smp("u_vel",t.read("velocity"),0),t.smp("u_src",t.read("dye"),1),t.f1("u_diss",a(null!=e.dyeFade?e.dyeFade:.97,r)),t.blit(t.write("dye")),t.swap("dye")}}},blobs:{stage:"color",overlay:!0,mips:!0,decl:function(t){return"\n uniform vec3 ".concat(t,"blobs[").concat(12,"];\n uniform int ").concat(t,"count;\n uniform vec3 ").concat(t,"tint;\n uniform float ").concat(t,"refract;\n uniform float ").concat(t,"rim;\n uniform float ").concat(t,"alpha;\n uniform float ").concat(t,"irid;\n uniform float ").concat(t,"disp;\n uniform float ").concat(t,"frost;\n float ").concat(t,"hash(vec3 v) {\n return fract(sin(dot(v, vec3(21.9898, 63.233, 41.719))) * 41739.317);\n }\n float ").concat(t,"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(t,"hash(f);\n float c100 = ").concat(t,"hash(f + vec3(1.0, 0.0, 0.0));\n float c010 = ").concat(t,"hash(f + vec3(0.0, 1.0, 0.0));\n float c110 = ").concat(t,"hash(f + vec3(1.0, 1.0, 0.0));\n float c001 = ").concat(t,"hash(f + vec3(0.0, 0.0, 1.0));\n float c101 = ").concat(t,"hash(f + vec3(1.0, 0.0, 1.0));\n float c011 = ").concat(t,"hash(f + vec3(0.0, 1.0, 1.0));\n float c111 = ").concat(t,"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(t){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(t,"count) break;\n vec2 bd = frag - ").concat(t,"blobs[bi].xy;\n float br = ").concat(t,"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(t,"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(t,"refract / max(abs(tR.z), 0.3));\n vec2 oG = tG.xy * (").concat(t,"refract / max(abs(tG.z), 0.3));\n vec2 oB = tB.xy * (").concat(t,"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(t,"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(t,"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(t,"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(t,"noise(rf * 2.3 + u_time * 0.5);\n float nB = ").concat(t,"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(t,"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(t,"alpha);\n }\n }")},uniforms:function(t,e){return{tint:["3fv",p(t.color||"#EAF4EE")],refract:["1f",(null!=t.refract?t.refract:70)*e],rim:["1f",null!=t.rim?t.rim:.6],alpha:["1f",null!=t.alpha?t.alpha:1],irid:["1f",null!=t.iridescence?t.iridescence:.8],disp:["1f",null!=t.dispersion?t.dispersion:1],frost:["1f",null!=t.frost?t.frost:.25]}},init:function(t,e,n,r){for(var i=(t.radius||46)*e,o=Math.max(1,Math.min(null!=t.trail?t.trail:7,12)),a=[],s=0,l=0;l<o;l++){var c=Math.pow(.86,l);a.push(c),s+=c*c}for(var u=Math.sqrt(s),d=a.map(function(t){return i*t/u}),f=a.map(function(t,e){return.85*i*Math.pow(.955,e)}),h=function(t,e){return t+Math.random()*(e-t)},p=Math.max(0,Math.min((t.count||1)-1,12-o)),y=[],m=0;m<p;m++){var v=h(0,2*Math.PI),g=h(30,80)*e;y.push({x:h(i,n-i),y:h(i,r-i),r:i*h(.45,.8),vx:Math.cos(v)*g,vy:Math.sin(v)*g,phase:h(0,2*Math.PI)})}for(var b={x:.5*n,y:.55*r},w=[],x=0;x<o;x++)w.push({x:b.x,y:b.y});return{head:b,chain:w,nTrail:o,drifters:y,trailIdleR:d,trailMoveR:f,stretch:0,seg:.9*i}},tick:function(t,e){var n=Math.min(e.dt,.05),r=e.w,i=e.h,o=1-Math.exp(9*-n);t.head.x+=(e.mouseX-t.head.x)*o,t.head.y+=(e.mouseY-t.head.y)*o;var a=t.chain;a[0].x=t.head.x,a[0].y=t.head.y;for(var l=1-Math.exp(16*-n),c=1;c<a.length;c++){var u=a[c-1],d=a[c],f=u.x-d.x,h=u.y-d.y,p=Math.hypot(f,h)||1e-4,y=t.seg;p>y&&(d.x+=f*(1-y/p),d.y+=h*(1-y/p)),d.x+=(u.x-d.x)*l,d.y+=(u.y-d.y)*l}var m=a[a.length-1],v=Math.hypot(m.x-t.head.x,m.y-t.head.y),g=Math.max(1,t.seg*(t.nTrail-1)),b=Math.min(1,v/g);t.stretch+=(b-t.stretch)*(1-Math.exp(8*-n));var w,x=s(t.drifters);try{for(x.s();!(w=x.n()).done;){var k=w.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>i-k.r&&(k.y=i-k.r,k.vy=-Math.abs(k.vy)),k.phase+=1.6*n}}catch(t){x.e(t)}finally{x.f()}for(var S=new Float32Array(36),O=t.stretch,j=0;j<t.nTrail;j++){var C=a[j];S[3*j]=C.x,S[3*j+1]=C.y,S[3*j+2]=t.trailIdleR[j]+(t.trailMoveR[j]-t.trailIdleR[j])*O}return t.drifters.forEach(function(e,n){var r=t.nTrail+n;S[3*r]=e.x,S[3*r+1]=e.y,S[3*r+2]=e.r*(1+.12*Math.sin(e.phase))}),[{name:"blobs",kind:"3fv",value:S},{name:"count",kind:"1i",value:t.nTrail+t.drifters.length}]}}};function p(t){return[1,3,5].map(function(e){return parseInt(t.slice(e,e+2),16)/255})}var y=Object.keys(h).concat("switch"),m="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"]},g=function(t){return"fld_".concat(String(t).replace(/[^A-Za-z0-9_]/g,""))},b=function(t){return!0===t.masked?"mask":"string"==typeof t.masked?t.masked:null},w=function(t){return"edge"===t||"edgeCov"===t||"ovA"===t?"float":"col"===t||"edgeCol"===t||"ovCol"===t?"vec3":"vec2"},x={over:function(t,e){return e},add:function(t,e){return"min(".concat(t," + ").concat(e,", vec3(1.0))")},screen:function(t,e){return"1.0 - (1.0 - ".concat(t,") * (1.0 - ").concat(e,")")},multiply:function(t,e){return"".concat(t," * ").concat(e)},difference:function(t,e){return"abs(".concat(t," - ").concat(e,")")},lighten:function(t,e){return"max(".concat(t,", ").concat(e,")")},darken:function(t,e){return"min(".concat(t,", ").concat(e,")")}};function k(t,e){var n,r=[],i=s(t||[]);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(o&&o.op){var a={node:o,i:e.length};e.push(o),"merge"===o.op&&(a.a=k(o.a,e),a.b=k(o.b,e)),r.push(a)}}}catch(t){i.e(t)}finally{i.f()}return r}function S(t,e){var n,r=s(t);try{var i=function(){var t=n.value,r=t.node;if("merge"===r.op)return function(t,e){var n="u".concat(t.i,"_"),r=x[t.node.mode]||x.over,i={field:"",warp:"",cell:"",displace:"",color:""},o={field:"",warp:"",cell:"",displace:"",color:""};S(t.a||[],i),S(t.b||[],o),e.field+=i.field+o.field;for(var a=function(){var t=l[s];if(!i[t]&&!o[t])return 1;var a=v[t],c=" {\n";a.forEach(function(t,e){c+=" ".concat(w(t)," pre").concat(e," = ").concat(t,";\n")}),c+=i[t],a.forEach(function(t,e){c+=" ".concat(w(t)," bra").concat(e," = ").concat(t,";\n")}),a.forEach(function(t,e){c+=" ".concat(t," = pre").concat(e,";\n")}),c+=o[t],a.forEach(function(t,e){var i="vec3"===w(t)?r("bra".concat(e),t):t;c+=" ".concat(t," = mix(bra").concat(e,", ").concat(i,", ").concat(n,"mix);\n")}),c+=" }\n",e[t]+=c},s=0,l=["warp","cell","displace","color"];s<l.length;s++)a()}(t,e),0;var i=h[r.op];if(!i)return 0;var o="u".concat(t.i,"_"),a=Array.isArray(i.stage)?i.stage:[i.stage],s=b(r);a.forEach(function(t){var n=i.code(o,r,t)+"\n";if(s&&v[t]){var a=v[t],l=a.map(function(t,e){return" ".concat(w(t)," msv").concat(e," = ").concat(t,";")}).join("\n"),c=a.map(function(t,e){return" ".concat(t," = mix(msv").concat(e,", ").concat(t,", ").concat(g(s),");")}).join("\n");n=" {\n".concat(l,"\n").concat(n,"\n").concat(c,"\n }\n")}e["field"===t||"warp"===t||"cell"===t||"displace"===t?t:"color"]+=n})};for(r.s();!(n=r.n()).done;)i()}catch(t){r.e(t)}finally{r.f()}}var O=/\d(?:vw|vh|vmin|vmax|dvw|dvh|svw|svh|lvw|lvh)\b/i;var j={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 C(t){if("function"==typeof t)try{return!!t()}catch(t){return!1}if("boolean"==typeof t)return t;if("string"!=typeof t||""===t)return!1;var e=j[t]||t;if("undefined"==typeof window||"function"!=typeof window.matchMedia)return!1;try{return window.matchMedia(e).matches}catch(t){return!1}}function E(t,e){if(!Array.isArray(t))return[];if((e||0)>8)return[];var n,r=[],i=s(t);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(o&&"switch"===o.op){var a,l=s(E((C(o.when)?o.use:o.else)||[],(e||0)+1));try{for(l.s();!(a=l.n()).done;){var c=a.value;r.push(c)}}catch(t){l.e(t)}finally{l.f()}}else r.push(o)}}catch(t){i.e(t)}finally{i.f()}return r}var T=new Set(["IMG","VIDEO","CANVAS","IFRAME","INPUT","EMBED","OBJECT","TEXTAREA","SELECT","BR","HR","AREA","SOURCE","TRACK","WBR"]),_=["objectFit","objectPosition","borderRadius","imageRendering","filter"];function P(t,e){if(!t||"undefined"==typeof document||"undefined"==typeof window)return null;if(!e||0===e.length)return null;if(e.some(function(t){return t&&"switch"===t.op})&&0===(e=E(e,0)).length)return null;var n=[],r=k(e,n);if(e=n,"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return null;if(T.has(t.tagName)){var i=t.parentElement&&t.parentElement.hasAttribute&&t.parentElement.hasAttribute("data-nodality-raster-host")?t.parentElement:null;if(t=i||function(t){if(!t.parentNode)return null;var e,n={},r=s(_);try{for(r.s();!(e=r.n()).done;){var i=e.value;t.style[i]&&(n[i]=t.style[i])}}catch(t){r.e(t)}finally{r.f()}var o=document.createElement("div");return o.setAttribute("data-nodality-raster-host",t.tagName.toLowerCase()),o.style.cssText=t.style.cssText,t.parentNode.insertBefore(o,t),o.appendChild(t),t.removeAttribute("style"),Object.assign(t.style,n),t.style.display="block",t.style.width="100%",t.style.height="100%","static"===("function"==typeof getComputedStyle?getComputedStyle(o).position:"static")&&(o.style.position="relative"),o.style.width||(o.style.width="100%"),o.style.height||(o.style.height="100%"),o}(t),!t)return null}if(t.querySelector&&t.querySelector(":scope > canvas[data-nodality-raster]"))return null;var c=function(){var e=t.getBoundingClientRect();return{width:e.width>=2?e.width:t.scrollWidth||0,height:e.height>=2?e.height:t.scrollHeight||0}},u=c();if(u.width<2||u.height<2)return null;var p=Math.min(window.devicePixelRatio||1,2),y=e.some(function(t){return(h[t.op]||{}).overlay}),v=e.every(function(t){return(h[t.op]||{}).overlay}),w=!v&&!e.some(function(t){return!1===t.live}),x="undefined"!=typeof WebGL2RenderingContext&&"texElementImage2D"in WebGL2RenderingContext.prototype||"undefined"!=typeof WebGLRenderingContext&&"texElementImage2D"in WebGLRenderingContext.prototype,j=w&&x;w&&!j&&console.info("[nodality] HTML-in-Canvas API not available - raster ops fall back to snapshot capture.");var C=document.createElement("canvas");j&&C.setAttribute("layoutsubtree","");var P={alpha:!0,premultipliedAlpha:!1},A=C.getContext("webgl2",P)||C.getContext("webgl",P);if(!A)return null;var R="undefined"!=typeof WebGL2RenderingContext&&A instanceof WebGL2RenderingContext,M=R&&e.some(function(t){return(h[t.op]||{}).mips});j&&!("texElementImage2D"in A)&&(console.info("[nodality] texElementImage2D missing on the created context - snapshot fallback."),C.removeAttribute("layoutsubtree"),j=!1),"static"===window.getComputedStyle(t).position&&(t.style.position="relative"),C.width=Math.round(u.width*p),C.height=Math.round(u.height*p),C.setAttribute("data-nodality-raster",j?"live":"snapshot"),console.info("[nodality] raster backend:",j?"html-in-canvas (live)":"snapshot");var L=t;if(j){var z=document.createElement("div"),I=getComputedStyle(t),F="flex"===I.display||"inline-flex"===I.display;for(z.style.cssText="display:".concat(F?"flex":"block",";")+"width:".concat(u.width,"px;height:").concat(u.height,"px;"),F&&(z.style.flexDirection=I.flexDirection,z.style.alignItems=I.alignItems,z.style.justifyContent=I.justifyContent,z.style.gap=I.gap);t.firstChild;)z.appendChild(t.firstChild);C.appendChild(z),L=z,C.style.cssText="display:block;width:".concat(u.width,"px;height:").concat(u.height,"px;")}else if(C.style.cssText="position:absolute;top:0;left:0;"+"width:".concat(u.width,"px;height:").concat(u.height,"px;")+"pointer-events:none;z-index:2147483000;",v)C.setAttribute("aria-hidden","true");else{C.setAttribute("role","img");var W=(t.textContent||"").replace(/\s+/g," ").trim();W&&C.setAttribute("aria-label",W.slice(0,300))}t.appendChild(C);var D=function(t,e){var n=A.createShader(t);if(A.shaderSource(n,e),A.compileShader(n),!A.getShaderParameter(n,A.COMPILE_STATUS))throw new Error("[nodality] raster shader: "+A.getShaderInfoLog(n));return n},B=A.createProgram();A.attachShader(B,D(A.VERTEX_SHADER,m)),A.attachShader(B,D(A.FRAGMENT_SHADER,function(t,e){var n="",r=new Set;e.forEach(function(t){var e=h[t.op];e&&e.producesField&&r.add(t.as||"mask");var n=b(t);n&&r.add(n)});var i=a(r).map(function(t){return" float ".concat(g(t)," = 1.0;")}).join("\n");e.forEach(function(t,e){var r=h[t.op];r&&(n+=r.decl("u".concat(e,"_"),t)+"\n")});var o={field:"",warp:"",cell:"",displace:"",color:""};S(t,o);var s=o.field,l=o.warp,c=o.cell,u=o.displace,d=o.color,f=e,p=f.some(function(t){return"edges"===t.op})?"":" col *= 1.0 - edge * 0.55;",y=f.some(function(t){return(h[t.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(i,"\n").concat(s,"\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(y,"\n vec3 edgeCol = vec3(1.0);\n float edgeCov = 0.0;\n vec3 ovCol = vec3(0.0);\n float ovA = 0.0;\n").concat(d,"\n").concat(p,"\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,e))),A.bindAttribLocation(B,0,"a"),A.linkProgram(B),A.useProgram(B),A.bindBuffer(A.ARRAY_BUFFER,A.createBuffer()),A.bufferData(A.ARRAY_BUFFER,new Float32Array([-1,-1,3,-1,-1,3]),A.STATIC_DRAW),A.enableVertexAttribArray(0),A.vertexAttribPointer(0,2,A.FLOAT,!1,0,0);var N=function(t){return A.getUniformLocation(B,t)},H=function(t,e,n){"1f"===e?A.uniform1f(t,n):"1i"===e?A.uniform1i(t,n):"2fv"===e?A.uniform2fv(t,n):"3fv"===e&&A.uniform3fv(t,n)};e.forEach(function(t,e){var n=h[t.op];if(n&&n.uniforms){var r=n.uniforms(t,p);for(var i in r)H(N("u".concat(e,"_").concat(i)),r[i][0],r[i][1])}});var G=[];e.forEach(function(t,e){var n=h[t.op];n&&"function"==typeof n.init&&G.push({i:e,def:n,state:n.init(t,p,C.width,C.height)})});var U="undefined"!=typeof performance?performance.now():0,q=[];e.forEach(function(t,e){var n=h[t.op];if(n&&n.solver){var r=function(t,e){var n=h[t.op];if(!R||!A.getExtension("EXT_color_buffer_float"))return console.info("[nodality] '"+t.op+"' needs WebGL2 float render targets - op skipped."),null;A.getExtension("OES_texture_float_linear");var r=n.solver.resolutions(t,C.width,C.height),i={r:[A.R16F,A.RED],rg:[A.RG16F,A.RG],rgba:[A.RGBA16F,A.RGBA]},o=[],a=function(t,e,n,r){var a=l(i[n],2),s=a[0],c=a[1],u=A.createTexture();A.bindTexture(A.TEXTURE_2D,u);var d=r?A.LINEAR:A.NEAREST;A.texParameteri(A.TEXTURE_2D,A.TEXTURE_MIN_FILTER,d),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_MAG_FILTER,d),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_WRAP_S,A.CLAMP_TO_EDGE),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_WRAP_T,A.CLAMP_TO_EDGE),A.texImage2D(A.TEXTURE_2D,0,s,t,e,0,c,A.HALF_FLOAT,null);var f=A.createFramebuffer();A.bindFramebuffer(A.FRAMEBUFFER,f),A.framebufferTexture2D(A.FRAMEBUFFER,A.COLOR_ATTACHMENT0,A.TEXTURE_2D,u,0);var h=A.checkFramebufferStatus(A.FRAMEBUFFER)===A.FRAMEBUFFER_COMPLETE;A.viewport(0,0,t,e),A.clearColor(0,0,0,1),A.clear(A.COLOR_BUFFER_BIT);var p={tex:u,fbo:f,w:t,h:e,ok:h};return o.push(p),p},s={},c=!0;for(var u in n.solver.targets){var d=n.solver.targets[u],f=r[d.res],p=l(Array.isArray(f)?f:[f,f],2),y=p[0],v=p[1];d.double?(s[u]={a:a(y,v,d.fmt,d.smooth),b:a(y,v,d.fmt,d.smooth)},c=c&&s[u].a.ok&&s[u].b.ok):(s[u]={a:a(y,v,d.fmt,d.smooth)},c=c&&s[u].a.ok)}A.bindFramebuffer(A.FRAMEBUFFER,null);var g=function(){return o.forEach(function(t){A.deleteFramebuffer(t.fbo),A.deleteTexture(t.tex)})};if(!c)return console.info("[nodality] '"+t.op+"' float targets incomplete - op skipped."),g(),null;var b={};try{for(var w in n.solver.programs){var x=A.createProgram();if(A.attachShader(x,D(A.VERTEX_SHADER,m)),A.attachShader(x,D(A.FRAGMENT_SHADER,n.solver.programs[w])),A.bindAttribLocation(x,0,"a"),A.linkProgram(x),!A.getProgramParameter(x,A.LINK_STATUS))throw new Error(w+": "+A.getProgramInfoLog(x));b[w]={prog:x,loc:{}}}}catch(e){for(var k in console.warn("[nodality] '"+t.op+"' solver programs failed:",e),g(),b)A.deleteProgram(b[k].prog);return null}return A.useProgram(B),{i:e,node:t,def:n,res:r,targets:s,progs:b,cleanup:g,prevX:.5,prevY:.5,primed:!1}}(t,e);r&&q.push(r)}});var J=function(t,e){var n=null,r={res:t.res,use:function(e){n=t.progs[e],A.useProgram(n.prog)},u:function(t){return t in n.loc||(n.loc[t]=A.getUniformLocation(n.prog,t)),n.loc[t]},f1:function(t,e){A.uniform1f(r.u(t),e)},f2:function(t,e,n){A.uniform2f(r.u(t),e,n)},f3:function(t,e,n,i){A.uniform3f(r.u(t),e,n,i)},smp:function(t,e,n){A.activeTexture(A.TEXTURE0+n),A.bindTexture(A.TEXTURE_2D,e.tex),A.uniform1i(r.u(t),n)},read:function(e){return t.targets[e].a},write:function(e){return t.targets[e].b},single:function(e){return t.targets[e].a},content:{tex:X},canvasW:C.width,canvasH:C.height,swap:function(e){var n=t.targets[e],r=n.a;n.a=n.b,n.b=r},blit:function(t){A.bindFramebuffer(A.FRAMEBUFFER,t.fbo),A.viewport(0,0,t.w,t.h),A.drawArrays(A.TRIANGLES,0,3)}},i=at[0]/C.width,o=1-at[1]/C.height,a=0,s=0;t.primed&&st&&(a=(i-t.prevX)/Math.max(e,.001),s=(o-t.prevY)/Math.max(e,.001)),t.prevX=i,t.prevY=o,t.primed=!0;var l=st&&Math.abs(a)+Math.abs(s)>.001;t.def.solver.step(r,t.node,{dt:e,px:i,py:o,dx:a,dy:s,moving:l,aspect:C.width/Math.max(C.height,1),col:t.def.solver.splatColor(t.node,a,s)})},X=A.createTexture();A.bindTexture(A.TEXTURE_2D,X),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_MIN_FILTER,M?A.LINEAR_MIPMAP_LINEAR:A.LINEAR),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_WRAP_S,A.CLAMP_TO_EDGE),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_WRAP_T,A.CLAMP_TO_EDGE),A.pixelStorei(A.UNPACK_FLIP_Y_WEBGL,!0);var $=function(){M&&A.generateMipmap(A.TEXTURE_2D)},V=!1,Y=!1,Q=j?"live":"snapshot",K=!1,Z={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"},tt=null,et=function(){if(t.style.visibility="",tt){var e,n=s(tt);try{for(n.s();!(e=n.n()).done;){var r=l(e.value,2),i=r[0],o=r[1];for(var a in Z)o[a]?i.style.setProperty(a,o[a]):i.style.removeProperty(a);o.op?i.style.setProperty("opacity",o.op):i.style.removeProperty("opacity")}}catch(t){n.e(t)}finally{n.f()}tt=null,t.style.isolation="",C.style.zIndex=""}},nt=function(){if(y){var e=function(){var e="IMG"===t.tagName?t:t.querySelector?t.querySelector("img"):null;return e&&e.complete&&e.naturalWidth>0?e:null}();if(e)try{return A.bindTexture(A.TEXTURE_2D,X),A.texImage2D(A.TEXTURE_2D,0,A.RGBA,A.RGBA,A.UNSIGNED_BYTE,e),$(),V=!0,Promise.resolve()}catch(t){}else if(!K){var n="IMG"===t.tagName?t:t.querySelector&&t.querySelector("img");n&&(K=!0,n.addEventListener("load",function(){Y||nt()},{once:!0}))}}C.style.display="none",et();var r=function(t,e,n,r){var i=function(t){if(!t)return null;var e=null;if("IMG"===t.tagName)e=t;else if(t.children){var n=Array.prototype.filter.call(t.children,function(t){return!t.hasAttribute||!t.hasAttribute("data-nodality-raster")});1===n.length&&"IMG"===n[0].tagName&&(e=n[0])}if(!e||!e.complete||!e.naturalWidth)return null;try{if(new URL(e.currentSrc||e.src,location.href).origin!==location.origin)return null}catch(t){return null}return e}(t);return i?Promise.resolve(function(t,e,n,r){var i=Math.max(1,Math.round(e*r)),o=Math.max(1,Math.round(n*r)),a=t.naturalWidth,s=t.naturalHeight;if(!a||!s)return t;var l="fill",c="50% 50%";if("function"==typeof getComputedStyle){var u=getComputedStyle(t);l=u.objectFit||"fill",c=u.objectPosition||"50% 50%"}if("fill"===l)return t;var d=i/a,f=o/s,h="cover"===l?Math.max(d,f):"contain"===l?Math.min(d,f):"none"===l?1:"scale-down"===l?Math.min(1,Math.min(d,f)):Math.max(d,f),p=a*h,y=s*h,m=String(c).trim().split(/\s+/),v=function(t,e){if(null==t)return.5;if(t.endsWith("%"))return parseFloat(t)/100;if("left"===t||"top"===t)return 0;if("right"===t||"bottom"===t)return 1;if("center"===t)return.5;var n=parseFloat(t);return isNaN(n)?.5:n/(0===e?Math.max(i-p,1):Math.max(o-y,1))},g=v(m[0],0),b=v(m.length>1?m[1]:m[0],1),w=document.createElement("canvas");w.width=i,w.height=o;var x=w.getContext("2d");return x?(x.drawImage(t,(i-p)*g,(o-y)*b,p,y),w):t}(i,e,n,r)):new Promise(function(i,o){var s=(new XMLSerializer).serializeToString(function(t,e){for(var n=[t].concat(a(t.querySelectorAll("*"))),r=[e].concat(a(e.querySelectorAll("*"))),i=0;i<n.length&&i<r.length;i++){var o=r[i].style;if(o&&0!==o.length)for(var s=null,l=0,c=Array.from(o);l<c.length;l++){var u=c[l];if(O.test(o.getPropertyValue(u))){var d=(s=s||window.getComputedStyle(n[i])).getPropertyValue(u);d&&o.setProperty(u,d,o.getPropertyPriority(u))}}}return e}(t,t.cloneNode(!0))),l='<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(e*r,'" height="').concat(n*r,'" viewBox="0 0 ').concat(e," ").concat(n,'">')+'<foreignObject width="100%" height="100%">'+'<div xmlns="http://www.w3.org/1999/xhtml">'.concat(s,"</div>")+"</foreignObject></svg>",c=new Image;c.onload=function(){return i(c)},c.onerror=o,c.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(l)})}(t,u.width,u.height,p).then(function(e){Y||(A.bindTexture(A.TEXTURE_2D,X),A.texImage2D(A.TEXTURE_2D,0,A.RGBA,A.RGBA,A.UNSIGNED_BYTE,e),$(),V=!0,v||function(){if(!tt){tt=[];for(var e=0,n=[t].concat(a(t.querySelectorAll("*")));e<n.length;e++){var r=n[e];if(r!==C&&"CANVAS"!==r.tagName){var i={op:r.style.getPropertyValue("opacity")};for(var o in Z)i[o]=r.style.getPropertyValue(o);for(var s in tt.push([r,i]),Z)r.style.setProperty(s,Z[s],"important");r!==t&&r.matches&&r.matches("img,svg,video,picture,iframe")&&r.style.setProperty("opacity","0","important")}}t.style.isolation="isolate",C.style.zIndex="-1"}}(),C.style.visibility="visible")}).catch(function(t){et(),console.warn("[nodality] raster snapshot failed:",t)});return C.style.display="",r},rt=-1,it=function(){if(!Y&&"live"===Q){A.bindTexture(A.TEXTURE_2D,X);var t,e=A.RGBA8||32856,n=[[A.TEXTURE_2D,e,L],[A.TEXTURE_2D,0,A.RGBA,A.RGBA,A.UNSIGNED_BYTE,L],[A.TEXTURE_2D,0,e,L],[A.TEXTURE_2D,0,L]];if(rt>=0)t=[rt];else{t=[0,1,2,3];var r={3:0,6:1,4:2}[A.texElementImage2D.length];null!=r&&(t.splice(t.indexOf(r),1),t.unshift(r))}var i,o=[],a=s(t);try{for(a.s();!(i=a.n()).done;){var l=i.value;try{return A.texElementImage2D.apply(A,n[l]),$(),rt<0&&(rt=l,console.info("[nodality] texElementImage2D signature discovered: form",l,"(declared arity "+A.texElementImage2D.length+")")),void(V=!0)}catch(t){o.push("form"+l+" -> "+(t&&t.name?t.name:"?")+": "+(t&&t.message?t.message:t))}}}catch(t){a.e(t)}finally{a.f()}ot("texElementImage2D rejected all known signatures (arity "+A.texElementImage2D.length+"): "+o.join(" | "))}},ot=function(e){if(!Y&&"live"===Q){for(Q="snapshot",console.warn("[nodality] live raster backend failed ("+e+") - falling back to snapshot."),C.removeEventListener("paint",it);L.firstChild;)t.appendChild(L.firstChild);L.parentNode===C&&C.removeChild(L),C.removeAttribute("layoutsubtree"),C.style.cssText="position:absolute;top:0;left:0;"+"width:".concat(u.width,"px;height:").concat(u.height,"px;")+"pointer-events:none;z-index:2147483000;",C.setAttribute("aria-hidden","true"),C.setAttribute("data-nodality-raster","snapshot-fallback"),nt()}};j&&(C.addEventListener("paint",it),setTimeout(function(){Y||"live"!==Q||V||ot("no paint event within 1500ms")},1500));var at=[.5*C.width,.5*C.height],st=!1,lt=function(t){var e=C.getBoundingClientRect(),n=t.touches?t.touches[0]:t,r=[(n.clientX-e.left)*p,(n.clientY-e.top)*p];r[0]===at[0]&&r[1]===at[1]||(st=!0),at=r};t.addEventListener("mousemove",lt,{passive:!0}),t.addEventListener("touchmove",lt,{passive:!0});var ct=0,ut=0,dt=function(){ct=1},ft=function(){ct=0};t.addEventListener("mouseenter",dt,{passive:!0}),t.addEventListener("mouseleave",ft,{passive:!0});var ht=[];e.forEach(function(t,e){var n=h[t.op]||{},r=t.by||n.defaultDriver;r&&d[r]?ht.push({i:e,fn:d[r]}):t.by&&console.warn("[nodality] unknown driver '"+t.by+"' on op '"+t.op+"' - known drivers: "+f.join(", "))});var pt=function(){if("undefined"==typeof window)return.5;var e=t.getBoundingClientRect(),n=window.innerHeight||1;return Math.max(0,Math.min(1,(n-e.top)/(n+e.height)))},yt=0,mt=!0,vt=function(){if(!Y){if(mt&&V){for(var t="undefined"!=typeof performance?performance.now():U+16,e=Math.max(0,(t-U)/1e3),n=0,r=q;n<r.length;n++){var i=r[n];J(i,e)}if(st=!1,A.bindFramebuffer(A.FRAMEBUFFER,null),A.useProgram(B),A.viewport(0,0,C.width,C.height),A.clearColor(0,0,0,0),A.clear(A.COLOR_BUFFER_BIT),A.uniform2f(N("u_res"),C.width,C.height),A.uniform2f(N("u_mouse"),at[0],at[1]),A.uniform1f(N("u_time"),t/1e3),ht.length>0){ut+=(ct-ut)*(1-Math.exp(8*-e));for(var o={mouseX:at[0],mouseY:at[1],w:C.width,h:C.height,t:t/1e3,hover:ut,scroll:pt()},a=0,l=ht;a<l.length;a++){var c=l[a],u=c.fn(o);A.uniform2f(N("u".concat(c.i,"_dpos")),u.x,u.y),A.uniform1f(N("u".concat(c.i,"_damt")),u.amt)}}if(G.length>0)for(var d={w:C.width,h:C.height,mouseX:at[0],mouseY:at[1],dt:e,t:t/1e3},f=0,h=G;f<h.length;f++){var p,y=h[f],m=s(y.def.tick(y.state,d));try{for(m.s();!(p=m.n()).done;){var v=p.value;H(N("u".concat(y.i,"_").concat(v.name)),v.kind,v.value)}}catch(t){m.e(t)}finally{m.f()}}A.activeTexture(A.TEXTURE0),A.bindTexture(A.TEXTURE_2D,X),A.uniform1i(N("u_tex"),0);for(var g=1,b=0,w=q;b<w.length;b++){var x=w[b],k=x.def.solver.samplers;for(var S in k)A.activeTexture(A.TEXTURE0+g),A.bindTexture(A.TEXTURE_2D,x.targets[k[S]].a.tex),A.uniform1i(N("u".concat(x.i,"_").concat(S)),g),g++}A.activeTexture(A.TEXTURE0),U=t,A.drawArrays(A.TRIANGLES,0,3)}yt=requestAnimationFrame(vt)}},gt=null;"undefined"!=typeof IntersectionObserver&&(gt=new IntersectionObserver(function(t){var e=l(t,1)[0];mt=e.isIntersecting})).observe(t);var bt=null,wt=0,xt=function(){if(!Y){var t=c();if(!(t.width<2||t.height<2)){var e=Math.round(t.width*p),n=Math.round(t.height*p);u.width=t.width,u.height=t.height,C.style.width=t.width+"px",C.style.height=t.height+"px";var r=C.width!==e||C.height!==n;r&&(C.width=e,C.height=n),"snapshot"===Q?nt():r&&it()}}};"undefined"!=typeof ResizeObserver&&(bt=new ResizeObserver(function(){!function(){if(!Y){var t=c();t.width<2||t.height<2||Math.round(t.width)===Math.round(u.width)&&Math.round(t.height)===Math.round(u.height)||(u.width=t.width,u.height=t.height,C.style.width=t.width+"px",C.style.height=t.height+"px")}}(),clearTimeout(wt),wt=setTimeout(xt,150)})).observe(t);var kt=0,St=function(){clearTimeout(kt),kt=setTimeout(function(){if(!Y)if("snapshot"!==Q){var e=t.clientWidth||t.parentElement&&t.parentElement.clientWidth||u.width;C.style.width=e+"px",setTimeout(function(){if(!Y&&"live"===Q){var t=Math.max(2,Math.round(L.getBoundingClientRect().height))||u.height;u.width=e,u.height=t,C.style.height=t+"px",C.width=Math.round(e*p),C.height=Math.round(t*p),it()}},50)}else xt()},150)};return"undefined"!=typeof window&&window.addEventListener("resize",St),"live"===Q?yt=requestAnimationFrame(vt):(nt().then(function(){yt=requestAnimationFrame(vt)}),"undefined"!=typeof document&&document.fonts&&"object"===o(document.fonts.ready)&&Promise.resolve(document.fonts.ready).then(xt).catch(function(){})),{canvas:C,refresh:function(){return"live"===Q?it():nt()},destroy:function(){Y=!0,cancelAnimationFrame(yt),clearTimeout(wt),clearTimeout(kt),gt&>.disconnect(),bt&&bt.disconnect(),"undefined"!=typeof window&&window.removeEventListener("resize",St),t.removeEventListener("mousemove",lt),t.removeEventListener("touchmove",lt),t.removeEventListener("mouseenter",dt),t.removeEventListener("mouseleave",ft),C.removeEventListener("paint",it);for(var e=0,n=q;e<n.length;e++){var r=n[e];for(var i in r.cleanup(),r.progs)A.deleteProgram(r.progs[i].prog)}for(q.length=0;L!==t&&L.firstChild;)t.appendChild(L.firstChild);et(),t.style.visibility="",C.remove()}}}function A(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(t,e)||M(t,e)||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 R(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=M(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function M(t,e){if(t){if("string"==typeof t)return L(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?L(t,e):void 0}}function L(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function z(t){return z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},z(t)}function I(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,F(r.key),r)}}function F(t){var e=function(t){if("object"!=z(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=z(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==z(e)?e:e+""}var W=function(){function t(){var e,n,r,o=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,r=function(t){if(t.transform||t.op){var e=t.op;t.transform||(e=t.op),e.duration||(e.duration="3s-ease-in-out"),o.setDefault=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0px";return 0===t.length?e+" ":t};var n=function(){var n="",r="",i="",a="",s="",l="",c="",u="",d="";if(0!==e.values.length){e.values.forEach(function(t){t.startsWith("tx:")&&(n=t.replace("tx:","")),t.startsWith("ty:")&&(r=t.replace("ty:","")),t.startsWith("tz:")?i=t.replace("tz:",""):t.startsWith("scale(")?a=t:t.startsWith("skew(")?s=t:t.startsWith("rotate(")?l=function(t){var e=t.match(/rotate\(([^)]+)\)/);if(!e)return t;var n=e[1].split(",").map(function(t){return t.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],")"):t}(t):t.startsWith("perspective(")?c=t:t.startsWith("matrix(")?u=t:t.startsWith("opacity:")&&(d=t.replace("opacity:",""))}),n=o.setDefault(n),r=o.setDefault(r),i=o.setDefault(i);var f="";if("0px"!=r&&"0px"!=n&&"0px"!=i?f+="translate3d(".concat(n,", ").concat(r,", ").concat(i,")"):"0px"==r&&"0px"==n||(f+="translate(".concat(n,", ").concat(r,")")),a&&(f+=" ".concat(a)),l&&(f+=" ".concat(l)),s&&(f+=" ".concat(s)),c&&(f+=" ".concat(c)),u&&(f+=" ".concat(u)),f){if(t.op.duration){var h=t.op.duration.replace(/^(\d+)(s)-/,function(t,e,n){return e/2+n+" "}),p="transform ".concat(h,", opacity ").concat(h);o.res.style.transition=p}else o.res.style.transition="transform 3s ease-in-out, opacity 3s ease-in-out";t.op.static&&(o.res.style.transition=""),(o.blastTarget||o.res).style.transform=f,o.res.style.opacity=d}else console.warn("[nodality] transform produced no geometric value - check `values`")}};e.on?o.res.addEventListener(e.on,function(){e.delay?setTimeout(function(){n()},e.delay):n()}):o._on(window,"load",function(){e.delay?setTimeout(function(){n()},e.delay):n()});var r=function(){var t="";e.values.forEach(function(e){e.startsWith("tx:")?t+="translateX(0) ":e.startsWith("ty:")?t+="translateY(0) ":e.startsWith("tz:")?t+="translateZ(0) ":e.startsWith("scale(")?t+="scale(1) ":e.startsWith("skew(")?t+="skew(0, 0) ":e.startsWith("rotate(")?t+="rotate(0) ":e.startsWith("perspective(")?t+="perspective(0) ":e.startsWith("matrix(")&&(t+="matrix(1, 0, 0, 1, 0, 0) "),o.res.style.opacity="1"}),t&&(o.res.style.transform=t.trim())};if(e.on)o.res.addEventListener("mouseout",function(){e.keep||r()});else{var i=1e3*parseFloat(e.duration),a=e.closeAfter?e.closeAfter:0;setTimeout(function(){e.keep||r()},i/2+a)}e.hardCSS&&(o.res.style.transform=e.hardCSS)}else console.warn("[nodality] reactOnTransform: unrecognised transform descriptor - ignored")},(n=F(n="reactOnTransform"))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,this.state={isExpanded:!1,isMovedUp:!1,isMovedDown:!1},this.openedElements=new WeakMap,"undefined"!=typeof document&&(this._themeUnsub=i.subscribe(function(t){return o._applyTheme(t)}),Promise.resolve().then(function(){return o._applyTheme(i.mode)}))}return e=t,n=[{key:"rasterize",value:function(t){var e=this;if(t&&0!==t.length&&!this._rasterHandle&&!this._rasterCancelled&&"undefined"!=typeof document&&"undefined"!=typeof setTimeout){var n=0,r=function(){if(!e._rasterHandle&&!e._rasterCancelled){if(e.res&&e.res.isConnected){try{e._rasterHandle=P(e.res,t)}catch(t){return void console.warn("[nodality] raster pipeline skipped:",t)}if(e._rasterHandle)return}++n<80&&(e._rasterTimer=setTimeout(r,50))}};this._rasterTimer=setTimeout(r,0),this._track(function(){return clearTimeout(e._rasterTimer)})}}},{key:"isHidden",value:function(t){t&&(this.res.style.display="none")}},{key:"theme",value:function(t){var e=this;return t&&"object"===z(t)?(this._themeMap=t,this._applyTheme(i.mode),this._themeUnsub||(this._themeUnsub=i.subscribe(function(t){return e._applyTheme(t)})),this):this}},{key:"_track",value:function(t){return"function"!=typeof t||(this._disposables||(this._disposables=[])).push(t),t}},{key:"_on",value:function(t,e,n,r){return t&&"function"==typeof t.addEventListener?(t.addEventListener(e,n,r),this._track(function(){return t.removeEventListener(e,n,r)}),n):n}},{key:"destroy",value:function(){if("function"==typeof this._themeUnsub&&(this._themeUnsub(),this._themeUnsub=null),this._rasterHandle&&"function"==typeof this._rasterHandle.destroy)try{this._rasterHandle.destroy()}catch(t){}if(this._rasterHandle=null,this._rasterCancelled=!0,this._disposables){var t,e=R(this._disposables);try{for(e.s();!(t=e.n()).done;){var n=t.value;try{n()}catch(t){}}}catch(t){e.e(t)}finally{e.f()}this._disposables.length=0}return this._responsiveTasks=null,this._responsiveHandler=null,this.res&&this.res.parentNode&&this.res.parentNode.removeChild(this.res),this}},{key:"_applyTheme",value:function(t){if(!this._noTheme&&this.res)if(this._themeMap){var e=this._themeMap[t];if(!e)return;for(var n in e)this.res.style[n]=e[n]}else{var r=i.defaults&&i.defaults[t];if(r)for(var o in this._themeOriginal||(this._themeOriginal={}),r)o in this._themeOriginal||(this._themeOriginal[o]=this.res.style[o]||""),this._themeOriginal[o]||(this.res.style[o]=r[o])}}},{key:"keySet",value:function(t){if(this.temporaryVal=1,Array.isArray(t)){for(var e=0;e<t.length;e++)t[e]&&null!=t[e].key&&(this.res.style[t[e].key]=t[e].value);return this}return this.res.style[t.key]=t.value,this}},{key:"commonMethods",value:function(t){var e={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 e)null!=t[n]&&(this.res.style[e[n]]=t[n]);return"string"==typeof t.transform&&(this.res.style.transform=t.transform),t.pad&&this.pad(t.pad),t.mar&&this.mar(t.mar),t.respad&&this.respad(t.respad),t.resmar&&this.resmar(t.resmar),t.hover&&this.hover(t.hover),t.size&&this.fluidCopy(t.size),t.resprop&&this.resprop(t.resprop,t),t.keySet&&this.keySet(t.keySet),t.noTheme&&(this._noTheme=!0),t.theme&&this.theme(t.theme),t.hide&&this.isHidden(t.hide),t.raster&&this.rasterize(t.raster),t.transform&&"object"===z(t.transform)&&this.reactOnTransform(t.transform),void 0!==t.opacity&&(this.res.style.opacity=t.opacity),t.bold?this.res.style.fontWeight="bold":null!=t.weight&&(this.res.style.fontWeight=t.weight),this}},{key:"hover",value:function(t){var e=this;if(t.border){var n=t.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,t.animation&&(this.res.style.transition="".concat(t.animation),this.res.style.transitionProperty="background-color, color, border, box-shadow, transform"),this.prevTransform=this.res.style.transform,this.res.onmouseout=function(){e.res.style.backgroundColor="".concat(e.prevColor),e.res.style.color="".concat(e.foreColor),e.res.style.border=e.prevBorder,null==t.scale&&null==t.transform||(e.res.style.transform=e.prevTransform||""),null!=t.boxShadow&&(e.res.style.boxShadow=e.prevBoxShadow||"")},this.res.onmouseover=function(){if(e.res.style.color=t.color,e.res.style.backgroundColor=t.background,t.border){var n,r=t.border.width,i=null!==(n=t.border.color)&&void 0!==n?n:"#2ECC71";e.res.style.border=r?"".concat(r,"px solid ").concat(i):"1px solid #2ECC71"}if(null!=t.scale||null!=t.transform){var o=e.prevTransform?"".concat(e.prevTransform," "):"",a=[];null!=t.transform&&a.push(t.transform),null!=t.scale&&a.push("scale(".concat(t.scale,")")),e.res.style.transform="".concat(o).concat(a.join(" "))}null!=t.boxShadow&&(e.res.style.boxShadow=t.boxShadow)},this}},{key:"onScroll",value:function(t){var e=this,n=function(t){if(null==t)return{num:0,unit:"px"};var e=String(t).match(/^(-?[\d.]+)(.*)$/);return e?{num:parseFloat(e[1]),unit:e[2]||"px"}:{num:0,unit:"px"}},r=function(t){var n=t&&null!=t.tx?t.tx:"0px",r=t&&null!=t.ty?t.ty:"0px";e.res.style.transform="translate3d(".concat(n,", ").concat(r,", 0)")};"opacity"===t.value?this.res.style.opacity=t.valMin:"scale"===t.value?this.res.style.transform="scale(".concat(t.valMin,")"):"trn"===t.value&&r(t.valMin);var i=function(){if("trn"!==t.value){var i=e.smartRange(window.scrollY,{min:t.from,max:t.to},{min:t.valMin,max:t.valMax});"opacity"===t.value?e.res.style.opacity=i:"scale"===t.value&&(e.res.style.transform="scale(".concat(i,")"))}else{for(var o={},a=["tx","ty"],s=0;s<a.length;s++){var l=a[s],c=t.valMin&&null!=t.valMin[l],u=t.valMax&&null!=t.valMax[l];if(c||u){var d=n(c?t.valMin[l]:u?t.valMax[l]:"0px"),f=n(u?t.valMax[l]:c?t.valMin[l]:"0px"),h=e.smartRange(window.scrollY,{min:t.from,max:t.to},{min:d.num,max:f.num});o[l]="".concat(h).concat(d.unit)}}r(o)}};this._on(window,"scroll",i),0===t.from&&i()}},{key:"setAny",value:function(t){this[Object.keys(t)[0]]=[Object.values(t)[0]]}},{key:"setID",value:function(t){this.id=t}},{key:"setPrevText",value:function(t){this.prevText=t}},{key:"getCSS",value:function(){return this.css}},{key:"getPX",value:function(t){return{xs:"0px",sm:"576px",md:"768px",lg:"992px",xl:"1200px",xxl:"1400px",mxxl:"1800px"}[t]||"Invalid breakpoint"}},{key:"_setupResponsiveManager",value:function(){var t=this;this._responsiveTasks=this._responsiveTasks||[];var e=function(){t._responsiveTasks.forEach(function(t){t()})};this._responsiveHandler||(this._responsiveHandler=e,this._on(window,"resize",e)),setTimeout(function(){e()},0)}},{key:"resprop",value:function(e,n){var r=this;this.options=n;var i={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"],a={flexDir:"flexDirection",dir:"flexDirection",justify:"justifyContent",align:"alignItems",wrap:"flexWrap",bg:"background",radius:"borderRadius",z:"zIndex"},s=function(t){var e=a[t]||t;return"undefined"==typeof console||"function"==typeof r[t]||e in r.res.style||console.warn('[nodality] resprop: "'.concat(t,'" is not a CSS property or component method — ignored.')+(a[t]?"":" Did you mean one of: ".concat(Object.keys(a).join(", "),"?"))),e};e.forEach(function(t){void 0!==i[t.breakpoint]?t.range=i[t.breakpoint]:Array.isArray(t.breakpoint)&&2===t.breakpoint.length?t.range=[parseInt(t.breakpoint[0],10),parseInt(t.breakpoint[1],10)]:t.range=[0,parseInt(t.breakpoint,10)]}),e.sort(function(t,e){return t.range[1]-e.range[1]});var l=e.find(function(t){return"default"===t.breakpoint});l||(l={breakpoint:"default",range:i.default},e.unshift(l));var c=new Set;e.forEach(function(t){Object.keys(t).forEach(function(t){o.includes(t)||"range"===t||c.add(t)})}),c.forEach(function(t){void 0===l[t]&&(l[t]=r.options[t]||"initial")}),this._responsiveTasks=this._responsiveTasks||[],this._responsiveTasks.push(function(){for(var n=t.viewportWidth(),i=l,a=0;a<e.length;a++){var u=e[a],d=A(u.range,2),f=d[0],h=d[1];if("default"!==u.breakpoint&&n>=f&&n<=h){i=u;break}}for(var p in c.forEach(function(t){if("keySet"===t){var e=l[t];e&&e.key&&(r.res.style[e.key]=e.value)}else r.res.style[s(t)]=l[t]}),i)if("exact"!==p){if(!o.includes(p)&&"range"!==p){var y=i[p];"keySet"===p&&y&&y.key?r.res.style[y.key]=y.value:"function"==typeof r[p]?r[p](y):r.res.style[s(p)]=y}}else r.res.style.fontSize=i[p]}),this._setupResponsiveManager()}},{key:"respad",value:function(e){var n=this,r={default:[0,1e5],xs:[0,575],sm:[576,767],md:[768,991],lg:[992,1199],xl:[1200,1399],xxl:[1400,1e5]};e.forEach(function(t){void 0!==r[t.breakpoint]?t.range=r[t.breakpoint]:Array.isArray(t.breakpoint)&&2===t.breakpoint.length?t.range=[parseInt(t.breakpoint[0],10),parseInt(t.breakpoint[1],10)]:t.range=[parseInt(t.breakpoint,10),1e5]}),e.sort(function(t,e){return t.range[0]-e.range[0]});var i=e.find(function(t){return"default"===t.breakpoint});i||(i={breakpoint:"default",range:r.default},e.unshift(i)),void 0===i.values&&(i.values=this.options&&this.options.pad||null),this._responsiveTasks=this._responsiveTasks||[],this._responsiveTasks.push(function(){for(var r=t.viewportWidth(),o=i,a=0;a<e.length;a++){var s=e[a],l=A(s.range,2),c=l[0],u=l[1];if("default"!==s.breakpoint&&r>=c&&r<=u){o=s;break}}var d=void 0!==o.values?o.values:i.values;null!=d&&n.pad(d)}),this._setupResponsiveManager()}},{key:"_applyResponsive",value:function(t,e){var n={default:[0,1e5],xs:[0,575],sm:[576,767],md:[768,991],lg:[992,1199],xl:[1200,1399],xxl:[1400,1e5]};t.forEach(function(t){if(void 0!==n[t.breakpoint])t.range=n[t.breakpoint];else{var e=parseInt(t.breakpoint,10);t.range=[e,1e5]}}),t.sort(function(t,e){return t.range[0]-e.range[0]});var r=t.find(function(t){return"default"===t.breakpoint})||{breakpoint:"default",range:n.default},i=function(){for(var n=window.innerWidth,i=r,o=0;o<t.length;o++){var a=t[o],s=A(a.range,2),l=s[0],c=s[1];if("default"!==a.breakpoint&&n>=l&&n<=c){i=a;break}}e(i)};this._responsiveHandler&&window.removeEventListener("resize",this._responsiveHandler),this._responsiveHandler=i,this._on(window,"resize",i),setTimeout(function(){i()},0)}},{key:"resmar",value:function(e){var n=this,r={default:[0,1e5],xs:[0,575],sm:[576,767],md:[768,991],lg:[992,1199],xl:[1200,1399],xxl:[1400,1e5]};e.forEach(function(t){void 0!==r[t.breakpoint]?t.range=r[t.breakpoint]:Array.isArray(t.breakpoint)&&2===t.breakpoint.length?t.range=[parseInt(t.breakpoint[0],10),parseInt(t.breakpoint[1],10)]:t.range=[parseInt(t.breakpoint,10),1e5]}),e.sort(function(t,e){return t.range[0]-e.range[0]});var i=e.find(function(t){return"default"===t.breakpoint});i||(i={breakpoint:"default",range:r.default},e.unshift(i)),void 0===i.values&&(i.values=this.options&&(this.options.mar||this.options.pad)||null),this._responsiveTasks=this._responsiveTasks||[],this._responsiveTasks.push(function(){for(var r=t.viewportWidth(),o=i,a=0;a<e.length;a++){var s=e[a],l=A(s.range,2),c=l[0],u=l[1];if("default"!==s.breakpoint&&r>=c&&r<=u){o=s;break}}var d=void 0!==o.values?o.values:i.values;null!=d&&n.mar(d)}),this._setupResponsiveManager()}},{key:"isNumber",value:function(t){return"number"==typeof t&&!isNaN(t)}},{key:"pad",value:function(t){for(var e=0;e<t.length;e++)for(var n=Object.keys(t[e]),r=0;r<n.length;r++)for(var i=n[r],o=t[e][i],a=0;a<i.length;a++)switch(i[a]){case"a":this.res.style.padding=this.isNumber(o)?"".concat(o,"px"):o;break;case"t":this.res.style.paddingTop=this.isNumber(o)?"".concat(o,"px"):o;break;case"l":this.res.style.paddingLeft=this.isNumber(o)?"".concat(o,"px"):o;break;case"r":this.res.style.paddingRight=this.isNumber(o)?"".concat(o,"px"):o;break;case"b":this.res.style.paddingBottom=this.isNumber(o)?"".concat(o,"px"):o}return this}},{key:"as",value:function(t){return this.res.style.alignSelf=t,this}},{key:"mar",value:function(t){if("center"===t)return this.res.style.marginLeft="auto",this.res.style.marginRight="auto",this;for(var e=0;e<t.length;e++)for(var n=Object.keys(t[e]),r=0;r<n.length;r++){for(var i=n[r],o=t[e][i],a=0;a<i.length;a++)switch(i[a]){case"a":"auto"===o?(this.res.style.marginLeft="auto",this.res.style.marginRight="auto"):this.res.style.margin=this.isNumber(o)?"".concat(o,"px"):o;break;case"t":this.res.style.marginTop=this.isNumber(o)?"".concat(o,"px"):o;break;case"l":this.res.style.marginLeft=this.isNumber(o)?"".concat(o,"px"):o;break;case"r":this.res.style.marginRight=this.isNumber(o)?"".concat(o,"px"):o;break;case"b":this.res.style.marginBottom=this.isNumber(o)?"".concat(o,"px"):o}"center"===i&&!0===o&&(this.res.style.marginLeft="auto",this.res.style.marginRight="auto"),"auto"===o&&(i.includes("l")||i.includes("r"))&&(i.includes("l")&&(this.res.style.marginLeft="auto"),i.includes("r")&&(this.res.style.marginRight="auto"))}return this}},{key:"smartRange",value:function(t,e,n){t<e.min&&(t=e.min),t>e.max&&(t=e.max);var r=(t-e.min)/(e.max-e.min);return e.min>e.max&&(r=(t-e.max)/(e.min-e.max)),n.min+(n.max-n.min)*r}},{key:"gpos",value:function(t){return this.res.style.gridColumn=t.col,this.res.style.gridRow=t.row,this}},{key:"fluidCopy",value:function(t){if(t instanceof Object){this.prevStylex=this.res.style,this.res=document.createElement("h1"),this.res.style.cssText=this.prevStylex.cssText;var e=document.createTextNode(this.text);return this.res.appendChild(e),this.res.style.fontSize=t.exact,this}if("S1"===t){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"===t){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"===t){this.prevStylex=this.res.style,this.res=document.createElement("h3"),this.res.style.cssText=this.prevStylex.cssText;var i=document.createTextNode(this.text);this.res.appendChild(i),this.res.style.fontSize="calc(1.375rem + 3.525vw)"}if("S4"===t){this.prevStylex=this.res.style,this.res=document.createElement("h4"),this.res.style.cssText=this.prevStylex.cssText;var o=document.createTextNode(this.text);this.res.appendChild(o),this.res.style.fontSize="calc(1.250rem + 2.75vw)"}if("S5"===t){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"===t&&(this.res.style.fontSize="calc(1rem + 0.5vw)"),this}},{key:"setIndex",value:function(t){this.index=t}},{key:"borderObj",value:function(t){var e,n=null!==(e=t.type)&&void 0!==e?e:"solid";return this.res.style.border="".concat(t.width," ").concat(n," ").concat(t.color),void 0!==t.radius&&(this.res.style.borderRadius=t.radius),this}},{key:"setPref",value:function(t){this.preffersId=t}},{key:"setClass",value:function(t){this.class=t}},{key:"setTags",value:function(t){this.openTag=t.open,this.closeTag=t.close}},{key:"chainReact",value:function(e,n,r){var i=this;this.ap=!1,this.cta=0,this.once=!1;var o,a=R(e);try{for(a.s();!(o=a.n()).done;){var s=o.value;s.range||(s.range=["0px","999999px"])}}catch(t){a.e(t)}finally{a.f()}e.sort(function(t,e){return parseInt(t.range[0])-parseInt(e.range[0])});var l=function(o){var a=t.viewportWidth(),s=[],l=[];i.resCopy=i.res,i.storedQueries=e.map(function(t){return t.target}).filter(function(t){return null!=t});var c,u=R(e);try{for(u.s();!(c=u.n()).done;){var d=c.value;i.counterIndex++;var f=A(d.range,2),h=f[0],p=f[1],y=parseInt(h),m=parseInt(p),v=!0;if(d.target){v=!1;for(var g=0;g<d.target.length;g++)d.target[g]===n&&(v=!0)}a>=y&&a<=m&&v&&(s.push(d.log),l.push(d),d.op&&d.op.margin&&(i.useMargin=d.op.margin))}}catch(t){u.e(t)}finally{u.f()}if(r&&!r.includes("background")&&(i.res.style.background="",i.res.style.backgroundColor=""),i.res.style.textShadow="",r&&!r.includes("border")&&(i.res.style.border=""),r&&!r.includes("margin")&&(i.res.style.margin=""),i.res.style["-webkit-text-fill-color"]="",i.res.style["-webkit-text-stroke-color"]="",i.res.style["-webkit-text-stroke-width"]="",i.res.style.filter="",i.options.background&&(i.res.style.background=i.options.background),s.includes("gradient"),(s.includes("gradient")||s.includes("shadow"))&&(i.res.style.position="relative"),s.includes("blast")){var b,w=l.filter(function(t){return"blast"===t.log})[0].op.color,x=null!==(b=l.filter(function(t){return"blast"===t.log})[0].op.width)&&void 0!==b?b:"1px";"FlexRowLayoutElement"===i.getType()||"LayoutWrapperElement"===i.getType()?(i.res.style.border="".concat("number"==typeof x?x+"px":x," solid orange"),i.res.style.display="inline-block","FlexRowLayoutElement"===i.getType()&&(i.res.style.display="flex"),i.res.style.boxSizing="border-box",i.res.style.transformOrigin="center",i.blastTarget=i.res):(i.text,i.res.style["-webkit-text-fill-color"]="transparent",i.res.style["-webkit-text-stroke-color"]=w,i.res.style["-webkit-text-stroke-width"]="".concat(x))}if(s.includes("filter")){var k=l.filter(function(t){return"filter"===t.log})[0].op.filter;i.res.style.filter=k}if(s.includes("background")&&(i.res.style.backgroundColor="green"),s.includes("gradient")&&("LayoutWrapperElement"!==i.getType()&&"FlexRowLayoutElement"!==i.getType()&&(i.res.style["-webkit-text-fill-color"]="transparent"),i.res.style.background=i.globalGradient,"LayoutWrapperElement"!==i.getType()&&"FlexRowLayoutElement"!==i.getType()&&(i.res.style["background-clip"]="text")),s.includes("shadow")){var S,O,j,C,E=i.options.shadow.op,T=null!==(S=E.steps)&&void 0!==S?S:1,_=null!==(O=E.colors)&&void 0!==O?O:["gray"],P=null!==(j=E.movements)&&void 0!==j?j:["3px","3px"],M=null!==(C=E.radius)&&void 0!==C?C:"3px";if(1===P.length&&(P=[P[0],P[0]]),"FlexRowLayoutElement"===i.getType()||"LayoutWrapperElement"===i.getType()){for(var L=[],z=0;z<T;z++){var I,F=null!==(I=_[z])&&void 0!==I?I:_[0],W=P[0],D=P[1];L.push("".concat(W," ").concat(D," ").concat(M," ").concat(F))}i.res.style.boxShadow=L.join(", ")}else{for(var B=[],N=0;N<T;N++){var H,G=null!==(H=_[N])&&void 0!==H?H:_[0],U=P[0],q=P[1];B.push("drop-shadow(".concat(U," ").concat(q," ").concat(M," ").concat(G,")"))}i.res.style.filter=B.join(" ")}}if(s.includes("margin"))for(g=0;g<e.length;g++)if(e[g].op){var J=e[g].op.offsets;J&&void 0!==i.index&&(i.res.style.margin=J[Number(i.index)]+"px")}if(s.includes("spana")||s.includes("span")){var X=document.createElement("div");if(X.setAttribute("id","oroa"),Object.assign(X.style,{position:"absolute",inset:"0",background:"linear-gradient(90deg, rgb(52,152,219), rgb(26,188,156))",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",pointerEvents:"none"}),i.res&&i.res.querySelector("span"))return;i.res=i.resCopy,i.res.textContent="",i.options.span&&(Array.isArray(i.options.span)?i.options.span:[i.options.span]).forEach(function(t){if(t.op&&"span"===t.op.name&&Array.isArray(t.op.parts)){var e=0,n=i.prevText||"";if(t.op.parts.forEach(function(t){var r=t.text,o=t.style||{};if(e<n.length){var a=n.indexOf(r,e);if(a>e){var s=n.substring(e,a);i.res.appendChild(new i.constructor(s).setup({type:"span",id:o.id,animation:o.animation}).set({}).render())}e=a+r.length}var l=new i.constructor(r).setup({type:"span",id:o.id,animation:o.animation}).set(o).render();i.res.appendChild(l)}),e<n.length){var r=n.substring(e);i.res.appendChild(new i.constructor(r).setup({type:"span"}).set({}).render())}}})}else{var $=new i.constructor(i.prevText).set({}).render();i.prevText&&i.prevText.length>0&&o&&i.res.appendChild($)}if(s.includes("animation")){if(i.options.animation&&!i.hasAnimated&&!i.options.animation.op.fireAt){i.hasAnimated=!0;var V=i.options.animation.op;i._on(window,"sidebar:open",function(){i.res.animate(V.keyframesOpen,V.openOptions)}),i._on(window,"sidebar:closed",function(){i.res.animate(V.keyframesClose,V.closeOptions)}),i.res.animate(V.keyframesClose,{duration:0,fill:"forwards"}),i.openTag&&i.closeTag&&(i._on(window,i.openTag,function(){i.res.animate(V.keyframesOpen,V.openOptions)}),i._on(window,i.closeTag,function(){i.res.animate(V.keyframesClose,V.closeOptions)}))}if(i.options.animation&&i.options.animation.op.fireAt&&i.options.animation.op.fireAt.endsWith("px")){var Y=i.options.animation.op;i.res.animate(Y.keyframesClose,{duration:0,fill:"forwards"});var Q=function(){window.scrollY>parseFloat(Y.fireAt)&&(i.res.animate(Y.keyframesOpen,Y.openOptions),window.removeEventListener("scroll",Q))};i._on(window,"scroll",Q)}if(i.options.animation&&"inview"===i.options.animation.op.fireAt){var K=i.options.animation.op;i.res.animate(K.keyframesClose,{duration:0,fill:"forwards"});var Z=!1,tt=new IntersectionObserver(function(t,e){t.forEach(function(t){t.isIntersecting&&!Z&&(Z=!0,i.res.animate(K.keyframesOpen,K.openOptions),e.disconnect())})});tt.observe(i.res),i._track(function(){return tt.disconnect()})}}};this.options.animation||this._on(window,"resize",function(){return l()}),l()}},{key:"maxWidth",value:function(t){return this.res.style.maxWidth=t,this}},{key:"removeQuotesFromFirstWord",value:function(t){return t.replace(/"([^"]+)":/g,"$1:")}},{key:"arrayMargin",value:function(t,e){return t.includes("left")&&(this.res.style.marginLeft=e),t.includes("right")&&(this.res.style.marginRight=e),t.includes("top")&&(this.res.style.marginTop=e),t.includes("bottom")&&(this.res.style.marginBottom=e),t.includes("all")&&(this.res.style.margin=e),e||(this.res.style.marginBottom=t),this}}],r=[{key:"viewportWidth",value:function(){if("undefined"==typeof window)return 0;var t=window.visualViewport;return t&&"number"==typeof t.width?t.width:window.innerWidth}}],n&&I(e.prototype,n),r&&I(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n,r}();function D(t){return D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},D(t)}function B(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(t,e)||N(t,e)||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 N(t,e){if(t){if("string"==typeof t)return H(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?H(t,e):void 0}}function H(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function G(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,U(r.key),r)}}function U(t){var e=function(t){if("object"!=D(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=D(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==D(e)?e:e+""}function q(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(q=function(){return!!t})()}function J(t,e,n,r){var i=X($(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof i?function(t){return i.apply(n,t)}:i}function X(){return X="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=$(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},X.apply(null,arguments)}function $(t){return $=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},$(t)}function V(t,e){return V=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},V(t,e)}var Y=function(){function t(e,n){var r,i,o,a;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(i=this,o=t,o=$(o),r=function(t,e){if(e&&("object"==D(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(i,q()?Reflect.construct(o,a||[],$(i).constructor):o.apply(i,a))).text=e,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(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&V(t,e)}(t,W),e=t,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(t){return this.res.style.gridArea=t,this}},{key:"toCodea",value:function(){return this.excludeFromCodeTrue&&(this.code=[""]),this.code}},{key:"toCode",value:function(){if(this.excludeFromCodeTrue)return[""];var t=Object.fromEntries(Object.entries(this.options).filter(function(t){var e=B(t,2);return e[0],null!==e[1]})),e=JSON.stringify(t,null,4).replace(/"([^"]+)":/g,"$1:");return['new Text("'.concat(this.text,'").set(').concat(e,")")]}},{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(t){return" "+t}),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(t){var e=this;if(0===t.length)return this;var n=t.filter(function(t){return"gradient"===t.op.name})[0];if(void 0===n)return this;var r=n.op;if(n.point){var i=function(){window.matchMedia("(min-width: ".concat(n.range[0],") and (max-width: ").concat(n.range[1],")")).matches&&(e.prevBackground=e.res.style.color.toString(),e.res.style.background=r.gradient,e.res.style.WebkitBackgroundClip="text")};i(),window.addEventListener("resize",i)}}},{key:"strokeOptions",value:function(t){var e=this;if(0===t.length)return this;var n=t.filter(function(t){return"blast"===t.op.name})[0];if(void 0===n)return this;var r=n.op;if(n.point){var i=function(){window.matchMedia("(min-width: ".concat(n.range[0],") and (max-width: ").concat(n.range[1],")")).matches&&(r.color?e.res.style["-webkit-text-stroke"]="".concat(r.width?r.width:"1px"," ").concat(r.color):e.res.style["-webkit-text-stroke"]="1px orange",e.res.style["-webkit-text-fill-color"]="transparent")};i(),window.addEventListener("resize",i)}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(t,e){return this.res.style.gridRow=t,this.res.style.gridColumn=e,this}},{key:"setGridRow",value:function(t){return this.res.style.gridRow=t,this}},{key:"setGridCol",value:function(t){return this.res.style.gridColumn=t,this}},{key:"toHTML",value:function(){return this.res}},{key:"onTap",value:function(t){return this.res.addEventListener("click",t),this}},{key:"setClass",value:function(t){return this.res.setAttribute("class",t),this}},{key:"setRandom",value:function(){for(var t="LAYOUT-",e=90;e>0;--e)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return t+=(new Date).getTime(),this.res.setAttribute("class",t),this}},{key:"styled",value:function(t){return this.set(t),this}},{key:"removeQuotesFromFirstWord",value:function(t){return t.replace(/"([^"]+)":/g,"$1:")}},{key:"looksLikeMarkdown",value:function(t){return/(\*\*.*\*\*|\*.*\*|`[^`]+`|\[.*?\]\(.*?\)|^# )/m.test(t)}},{key:"parseMarkdown",value:function(t){var e=t;return(e=(e=(e=(e=(e=(e=(e=e.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(e){return this.resCopy=this.res,this.options=e,J(t,"setPrevText",this,3)([this.text]),e.raster&&this.rasterize(e.raster),this.commonMethods(e),e.left&&(this.res.style.left=e.left),e.flex&&(this.res.style.display="flex"),(e.left||e.top)&&(this.res.style.position="absolute"),e.maxWidth&&(this.res.style.maxWidth=e.maxWidth),e.cursor&&(this.res.style.cursor="hand"),e.gpos&&this.gpos(e.gpos),e.vtn&&(this.res.style.viewTransitionName=e.vtn),e.index&&J(t,"setIndex",this,3)([e.index]),e.index&&(this.index=e.index),e.preffersId&&(this.preffersId=e.preffersId),J(t,"setPref",this,3)([e.preffersId]),e.removeDecoration&&(this.res.style.textDecoration="none"),e.block&&(this.res.style.display="block"),e.area&&this.setArea(e.area),e.icon&&this.addIcon(e.icon),e.color&&this.color(e.color),e.color&&this.elCSS.push("color: ".concat(e.color,"; \n")),e.class&&this.setClass(e.class),e.size&&this.fluidCopy(e.size),e.fluidc&&this.fluidCopy(e.fluidc),this.options.id&&this.res.setAttribute("id",this.options.id),J(t,"setID",this,3)([this.options.id]),e.initLetter&&this.initLetter(e.initLetter),e.onTap&&this.onTap(e.onTap),"S6"===e.fluidc?e.fluidc&&this.elCSS.push("font-size: calc(1.1rem + 2.075vw); \n"):e.fluidc&&this.elCSS.push("font-size: calc(1.625rem + 5.075vw); \n"),this.options.class&&this.res.setAttribute("class",this.options.class),J(t,"setClass",this,3)([this.options.class]),e.clampc&&this.clampCopy(e.clampc),e.arrpad&&this.arrayPadding(e.arrpad.sides,e.arrpad.value),e.absolute&&(this.res.style.position="absolute"),e.arrayMargin&&this.arrayMargin(e.arrayMargin.sides,e.arrayMargin.value),e.em&&this.em(e.em),e.fluid&&this.fluid(e.fluid),e.fluidc&&this.elCSS.push("font-family: ".concat(e.font,"; \n")),e.align&&(this.res.style.textAlign=e.align),e.padding&&this.padding(e.padding),e.breakWord&&(this.res.style.wordWrap="break-word"),e.center&&(this.res.style.marginRight="auto"),e.center&&(this.res.style.marginLeft="auto"),e.italic&&this.italic(),e.responsive&&this.responsive(),e.border&&(this.res.style.border="".concat(e.border)),e.onScroll&&this.onScroll(e.onScroll),e.keySet&&this.keySet(e.keySet),this.callReact(e),this}},{key:"callReact",value:function(e){var n=[],r=e.transform&&"object"===D(e.transform);if(e.stroke||e.gradient||e.span||e.backgroundOp||e.layout||e.shadow||e.animation||e.filtera||r){e.gradient&&(this.globalGradient=e.gradient.op.gradient,"radial"===e.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)")),e.stroke&&J(t,"setAny",this,3)([{globalBlast:"".concat(e.stroke.op.width," ").concat(e.stroke.op.color)}]),e.span&&(e.span.prevText=this.text);var i=[e.stroke,e.gradient,e.animation,e.span,e.backgroundOp,e.layout,e.marginOp,e.shadow,e.animation,e.filtera,r?e.transform:void 0];i=i.filter(function(t){return null!=t});for(var o=0;o<i.length;o++)n.push({range:i[o].range,log:i[o].op.name,target:i[o].target,op:i[o].op});var a=[];e.borderObj&&a.push("border"),e.background&&a.push("background"),e.mar&&a.push("margin"),e.animation&&a.push("animation"),e.span&&a.push("span"),this.chainReact(n,this.options.id,a)}}},{key:"excludeFromCode",value:function(){return this.excludeFromCodeTrue=!0,this}},{key:"addIcon",value:function(t){var e=document.createElement("img");return e.style.width="20px",e.style.marginLeft="10px",e.style.height="auto",e.setAttribute("src",t.url),this.res.appendChild(e),this}},{key:"checkForAnimation",value:function(t){t.sort(function(t,e){return parseInt(t.range[0])-parseInt(e.range[0])});var e,n=window.innerWidth,r=function(t){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=N(t))){e&&(t=e);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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 i,o=!0,a=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return o=t.done,t},e:function(t){a=!0,i=t},f:function(){try{o||null==e.return||e.return()}finally{if(a)throw i}}}}(t);try{for(r.s();!(e=r.n()).done;){var i=e.value,o=B(i.range,2),a=o[0],s=o[1],l=parseInt(a),c=parseInt(s);n>=l&&n<=c&&"animation"===i.log&&this.res.animate([{opacity:0,transform:"translateY(100px)"},{opacity:1,transform:"translateY(0)"}],{duration:1e3,easing:"ease"})}}catch(t){r.e(t)}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(t){t.color?this.res.style["-webkit-text-stroke"]="".concat(t.width?t.width:"1px"," ").concat(t.color):this.res.style["-webkit-text-stroke"]="1px orange",this.res.style["-webkit-text-fill-color"]="transparent"}},{key:"innerGradient",value:function(t){this.res.style.background="linear-gradient(45deg, #ff0000, #00ff00)",this.res.style["-webkit-background-clip"]="text"}},{key:"arrayMargin",value:function(t,e){return e||(this.res.style.marginLeft="".concat(t[0],"px"),this.res.style.marginTop="".concat(t[1],"px"),this.res.style.marginRight="".concat(t[2],"px"),this.res.style.marginBottom="".concat(t[3],"px")),t.includes("left")&&(this.res.style.marginLeft=e),t.includes("right")&&(this.res.style.marginRight=e),t.includes("top")&&(this.res.style.marginTop=e),t.includes("bottom")&&(this.res.style.marginBottom=e),e||(this.res.style.marginBottom=t),this}},{key:"clampExperiment",value:function(){return this.res.style.fontSize="clamp(1rem, calc(1rem * 10rem), 3rem)",this}},{key:"between",value:function(t){return"S1"===t&&(this.res.style.fontSize="clamp(2rem, 8vw, 2.5rem)"),"S2"===t&&(this.res.style.fontSize="clamp(4rem, 8vw, 5rem)"),"S3"===t&&(this.res.style.fontSize="clamp(2rem, 5vw, 2.5rem)"),"S4"===t&&(this.res.style.fontSize="clamp(1.5rem, 2vw, 1.6rem)"),"S5"===t&&(this.res.style.fontSize="clamp(1.2rem, 2vw, 1.3rem)"),"S6"===t&&(this.res.style.fontSize="clamp(1rem, 2vw, 1.3rem)"),this}},{key:"betweenCopy",value:function(t){return"S1"===t&&(this.res.style.fontSize="clamp(2rem, 8vw, 2.5rem)"),"S2"===t&&(this.res.style.fontSize="clamp(4rem, 8vw, 5rem)"),"S3"===t&&(this.res.style.fontSize="clamp(2rem, 5vw, 2.5rem)"),"S4"===t&&(this.res.style.fontSize="clamp(1.5rem, 2vw, 1.6rem)"),"S5"===t&&(this.res.style.fontSize="clamp(1.2rem, 2vw, 1.3rem)"),"S6"===t&&(this.res.style.fontSize="clamp(1rem, 2vw, 1.3rem)"),this}},{key:"stringGen",value:function(t){for(var e="",n=0;n<t;n++)e+="abcdefghijklmnopqrstuvwxyz".charAt(Math.floor(26*Math.random()));return e}},{key:"initLetter",value:function(t){var e=document.createElement("style");document.body.appendChild(e),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(t){return"S1"===t&&this.jumbotron(),"S2"===t&&this.large(),"S3"===t&&this.medium(),this}},{key:"minusMargin",value:function(){return this.res.style.marginRight="-3.1em",this}},{key:"fluid",value:function(t){if("S1"===t){this.res=document.createElement("h1");var e=document.createTextNode(this.text);this.res.appendChild(e),this.res.style.fontSize="calc(1.625rem + 4.3vw)"}if("S2"===t){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"===t){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"===t){this.res=document.createElement("h4");var i=document.createTextNode(this.text);this.res.appendChild(i),this.res.style.fontSize="calc(1.275rem + 1.975vw)"}return"S5"===t&&(this.res.style.fontSize="calc(1.1rem + 1.2vw)"),this}},{key:"getClampValue",value:function(t){return"S7"===t?"clamp(1.45rem, 2vw + 1.5rem, 1.69rem)":"S6"===t?"clamp(2.25rem, 2vw+1.5rem, 3.25rem)":"S5"===t?"clamp(2.75rem, 2vw + 1.5rem, 3.25rem)":"S4"===t?"clamp(3.5rem, 2vw + 1.5rem, 3.25rem)":"S3"===t?"clamp(4.25rem, 2vw + 1.5rem, 3.25rem)":"S2"===t?"clamp(5rem, 2vw + 1.5rem, 3.25rem)":"S1"===t?"clamp(6rem, 2vw + 1.5rem, 3.25rem)":void 0}},{key:"clampCopy",value:function(t){return this.res.style.fontSize=this.getClampValue(t),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(t){var e=this,n=function(){window.matchMedia("(max-device-width: 415px)").matches?e.res.style.fontSize=t.desktop:e.res.style.fontSize=t.phone};return n(),window.addEventListener("resize",n),this}},{key:"jumbotron",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.res.style.fontSize="8rem":t.res.style.fontSize="6rem"};return e(),window.addEventListener("resize",e),this}},{key:"large",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.res.style.fontSize="7rem":t.res.style.fontSize="5rem"};return e(),window.addEventListener("resize",e),this}},{key:"frame",value:function(t){return this.res.style.width=t.width,this.res.style.height=t.height,this}},{key:"vw",value:function(t,e,n){}},{key:"responsive",value:function(t){var e=this;this.set=!1,this.setB=!1;var n=function(){window.innerWidth<t.minw?(e.setB=!1,e.set||(e.res.style.color="#3498db",e.res.style.fontSize="".concat(t.baseVW/100*window.innerWidth,"px"),e.set=!0)):window.innerWidth>t.maxw?(e.set=!1,e.setB||(e.res.style.color="orange",e.res.style.fontSize="".concat(t.baseVW/100*t.maxw,"px"),e.setB=!0)):(e.set=!1,e.setB=!1,e.res.style.color="black",e.res.style.fontSize="".concat(t.baseVW,"vw"))};return n(),window.addEventListener("resize",n),this}},{key:"xlarge",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.res.style.fontSize="6.5rem":t.res.style.fontSize="8.5rem"};return e(),window.addEventListener("resize",e),this}},{key:"medium",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.res.style.fontSize="2.25rem":t.res.style.fontSize="1.5em"};return e(),window.addEventListener("resize",e),this}},{key:"auto",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.res.style.fontSize="2rem":t.res.style.fontSize="1rem"};return e(),window.addEventListener("resize",e),this}},{key:"small",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.res.style.fontSize="1.5em":t.res.style.fontSize="1em"};return e(),window.addEventListener("resize",e),this}},{key:"sizes",value:function(t){var e=this;this.res.style.fontSize="".concat(t[0].size,"rem");var n=function(){for(var n=0;n<t.length;n++)t[n].width&&window.matchMedia("(min-width: ".concat(t[n].width,"px)")).matches&&(e.res.style.fontSize="".concat(t[n].size));window.matchMedia("(max-device-width: 415px)").matches&&(e.res.style.fontSize="".concat(t[t.length-1].mobile))};return n(),window.addEventListener("resize",n),this}},{key:"setup",value:function(t){var e;t?((e=document.createElement(t.type)).setAttribute("id",t.id),"span"===t.type&&t.animation&&(e.style.position="relative",e.style.display="block")):e=document.createElement("p");var n=document.createTextNode(this.text);return e.appendChild(n),this.res=e,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(t){return this.res.style.fontFamily=t,this}},{key:"center",value:function(){return this.res.style.textAlign="center",this}},{key:"em",value:function(t){return this.res.style.fontSize="".concat(t,"em"),this}},{key:"color",value:function(t){return this.res.style.color=t,this}},{key:"align",value:function(t){return this.res.style.textAlign="".concat(t),this}},{key:"weight",value:function(t){return this.res.style.fontWeight=t,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(t,e){return this.res.style.width=t,e&&(this.res.style.marginLeft="auto",this.res.style.marginRight="auto"),this}},{key:"offset",value:function(t){return this.res.style.gridRow=2,this.res.style.gridColumn=2,this.res.style.marginLeft="-60px",this}},{key:"border",value:function(t,e){return this.res.style.border="".concat(e,"px solid ").concat(t),this}},{key:"padding",value:function(t,e,n,r){return(t||e||n||r)&&(this.res.style.paddingLeft=t,this.res.style.paddingTop=e,this.res.style.paddingRight=n,this.res.style.paddingBottom=r),e||n||r||(this.res.style.padding=t),this}},{key:"arrayPadding",value:function(t,e){return t.includes("left")&&(this.res.style.paddingLeft=e),t.includes("right")&&(this.res.style.paddingRight=e),t.includes("top")&&(this.res.style.paddingTop=e),t.includes("bottom")&&(this.res.style.paddingBottom=e),e||(this.res.style.paddingBottom=t),this}},{key:"margin",value:function(t,e){return"top"==t?this.res.style.marginTop=e:"bottom"==t?this.res.style.marginBottom=e:"left"==t?this.res.style.marginLeft=e:"right"==t&&(this.res.style.marginRight=e),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(t,e){var n=this.res,r=this.text;return Object.defineProperty(t,e,{set:function(t){var e=document.createTextNode(r.replace("$",t));n.replaceChild(e,n.childNodes[0])}}),this}},{key:"style",value:function(t){return this.res.style.color=t.styles.color,this.res.style.fontWeight=t.styles.fontWeight,this.res.style.paddingLeft=t.styles.padding[0],this.res.style.paddingTop=t.styles.padding[1],this.res.style.paddingRight=t.styles.padding[2],this.res.style.paddingBottom=t.styles.padding[3],this.res.style.marginLeft=t.styles.margin[0],this.res.style.paddingTop=t.styles.margin[1],this.res.style.paddingRight=t.styles.margin[2],this.res.style.paddingBottom=t.styles.margin[3],this.res.style.opacity=t.styles.opacity,this}},{key:"applyStyle",value:function(t,e){return window.matchMedia("(max-width: ".concat(t,"px)")).matches&&Object.assign(this.res.style,e.styles),this}},{key:"nextApply",value:function(t){for(var e=this,n=[],r=(this.res.style,function(r){n[0].matches?Object.assign(e.res.style,t[0].styles):n[1].matches?Object.assign(e.res.style,t[1].styles):Object.assign(e.res.style,t[t.length-1].styles)}),i=0;i<t.length;i++){var o=t[i],a=window.matchMedia("(min-width: ".concat(o.min,"px) and (max-width: ").concat(o.max,"px)"));n.push(a),n[i].addListener(r)}return r(),this}},{key:"apply",value:function(t){var e=this,n=this.res.styles,r=function(){for(var r=0;r<t.length;r++){var i=t[r];i.min&&i.max?window.matchMedia("(min-width: ".concat(i.min,"px) and (max-width: ").concat(i.max,"px)")).matches?Object.assign(e.res.style,i.styles):Object.assign(e.res.style,n):window.matchMedia("(max-width: ".concat(i.max,"px)")).matches?Object.assign(e.res.style,i.styles):Object.assign(e.res.style,n)}};return r(),window.addEventListener("resize",r),this}},{key:"render",value:function(t){if(!t)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(t).appendChild(this.res)}}],n&&G(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function Q(t){return Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Q(t)}function K(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Z(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,tt(r.key),r)}}function tt(t){var e=function(t){if("object"!=Q(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Q(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Q(e)?e:e+""}function et(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(et=function(){return!!t})()}function nt(t,e,n,r){var i=rt(it(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof i?function(t){return i.apply(n,t)}:i}function rt(){return rt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=it(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},rt.apply(null,arguments)}function it(t){return it=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},it(t)}function ot(t,e){return ot=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ot(t,e)}var at=function(){function t(e,n,r,i){var o,a,s,l;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(a=this,s=t,s=it(s),o=function(t,e){if(e&&("object"==Q(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(a,et()?Reflect.construct(s,l||[],it(a).constructor):s.apply(a,l))).url=e,o.res=null,o.code=[],o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ot(t,e)}(t,W),e=t,n=[{key:"removeQuotesFromFirstWord",value:function(t){return t.replace(/"([^"]+)":/g,"$1:")}},{key:"setType",value:function(t){t.url;var e=t.type,n=t.mode;if(this.code=[],"exact"===e){var r='new Image("'.concat(this.url,'", "exact")');this.code.push(r)}else if("uncover"===e){var i='new Image("'.concat(this.url,'", "uncover")');this.code.push(i)}else this.code.push("new Image('".concat(this.url,"')"));return this.image(this.url,n,e),this}},{key:"flexOne",value:function(){return this.res.style.flex="1",this}},{key:"hand",value:function(){return this.res.style.cursor="hand",this}},{key:"setGridWithoutCode",value:function(){return this.res.style.border="1px solid white",this}},{key:"maxWidth",value:function(t){return this.res.style.maxWidth=t,this}},{key:"getHeight",value:function(){return this.res.height}},{key:"getWidth",value:function(){return this.res.width}},{key:"getType",value:function(){return"HTMLImageElement"}},{key:"toCode",value:function(){var t=this.options;this.res.style.border&&(t.border=this.res.style.border);var e=Object.fromEntries(Object.entries(t).filter(function(t){var e,n,r=(n=2,function(t){if(Array.isArray(t))return t}(e=t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,n)||function(t,e){if(t){if("string"==typeof t)return K(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?K(t,e):void 0}}(e,n)||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.")}());return r[0],null!==r[1]}));return["new Image().set(".concat(JSON.stringify(e,null,2).replace(/"(\w+)"\s*:/g,"$1:"),")")]}},{key:"formatObj",value:function(t){return JSON.stringify(t,null,2).replace(/"(\w+)"\s*:/g,"$1:")}},{key:"set",value:function(e){var n="";this.options=e;var r=e;r.onTap&&this.onTap(r.onTap);var i=e.isFull;if(i?this.image(e.url,"exact",i,"a"):this.setup(),e.url&&this.res.setAttribute("src",e.url),"IMG"===this.res.tagName&&(e.srcset&&this.res.setAttribute("srcset",e.srcset),e.sizes&&this.res.setAttribute("sizes",e.sizes),void 0!==e.alt&&this.res.setAttribute("alt",e.alt),e.loading&&this.res.setAttribute("loading",e.loading),e.decoding&&this.res.setAttribute("decoding",e.decoding),e.fetchPriority&&this.res.setAttribute("fetchpriority",e.fetchPriority)),e.id&&this.res.setAttribute("id",e.id),e.id&&(n+=' id: "'.concat(e.id,'", \n')),this.id=e.id,"exact"===i?'new Image("'.concat(this.url,'", "exact")'):"uncover"===i&&'new Image("'.concat(this.url,'", "uncover")'),this.commonMethods(r),e.vtn&&(this.res.style.viewTransitionName=e.vtn),this.vtn=e.vtn,e.minHeight&&(this.res.style.minHeight=e.minHeight),e.index&&nt(t,"setIndex",this,3)([e.index]),e.index&&(this.index=e.index),e.index&&(n+='\n index: "'.concat(e.index,'",')),e.resprop&&this.resprop(e.resprop),e.centerSelf&&(this.res.style.marginRight="auto",this.res.style.marginLeft="auto"),e.fitContent&&(this.res.style.width="100%",this.res.style.height="100%",this.res.style.marginRight="auto",this.res.style.marginTop="auto",this.res.style.objectFit="cover"),e.objectFit&&(this.res.style.objectFit=e.objectFit),e.objectFit&&(n+='\n objectFit: "'.concat(e.objectFit,'",')),e.objectPosition&&(this.res.style.objectPosition=e.objectPosition),e.objectPosition&&(n+='\n objectPosition: "'.concat(e.objectPosition,'",')),e.as&&this.as(e.as),e.onScroll&&this.onScroll(e.onScroll),e.class&&this.res.setAttribute("class",e.class),e.gpos&&(this.gposObject=e.gpos),e.gpos&&(this.res.style.gridColumn=e.gpos.col,this.res.style.gridRow=e.gpos.row,n+="\n gpos: ".concat(this.removeQuotesFromFirstWord(JSON.stringify(e.gpos)),", ")),e.filtera){var o;o=Array.isArray(e.filtera)?r.filtera.filter(function(t){return"filter"===t.op.name})[0]:e.filtera;var a=this.removeQuotesFromFirstWord(JSON.stringify(o));n+="\n filtera: ".concat(a,", \n")}if(e.keySet&&this.keySet(e.keySet),e.stype&&this.setType(e.stype),e.isBackground&&(this.isBackground=e.isBackground),e.zIndex&&(n+='\n zIndex: "'.concat(e.zIndex,'", \n')),e.area&&this.setArea(e.area),e.area&&(n+='area: "'.concat(e.area,'", \n')),e.opacity&&(this.res.style.opacity=e.opacity),e.width&&(this.res.style.width=e.width),e.width&&(n+='width: "'.concat(e.width,'", ')),e.maxWidth&&(this.res.style.maxWidth=e.maxWidth),e.maxWidth&&(n+='maxWidth: "'.concat(e.maxWidth,'", ')),e.height&&(this.res.style.height=e.height),e.height&&(n+='height: "'.concat(e.height,'", ')),e.multimargin&&this.makeMultiMargin(e.multimargin),e.multimargin&&(n+="multimargin: [ \n"),e.arrayMargin&&this.arrayMargin(e.arrayMargin.sides,e.arrayMargin.value),e.multimargin){for(var s=0;s<e.multimargin.length;s++){var l=e.multimargin[s];n+='{side: "'.concat(l.side,'", value: "').concat(l.value,'"}, \n')}n+="], \n"}if(e.maxWidth&&this.maxWidth(e.maxWidth),e.maxWidth&&(n+='maxWidth: "'.concat(e.maxWidth,'", \n')),e.radius&&this.cornerRadius(e.radius),e.radius&&(n+='radius: "'.concat(e.radius,'", \n')),e.marginOp){var c=this.removeQuotesFromFirstWord(JSON.stringify(e.marginOp));n+="\n marginOp: ".concat(c,",")}if(e.clipPath&&this.clipPath(e.clipPath),e.clipPath&&(n+='clipPath: "'.concat(e.clipPath,'", \n')),r.stroke||r.gradient||r.span||r.backgroundOp||r.layout||r.marginOp||r.shadow||r.filtera||r.animation){r.gradient,r.gradient&&(this.globalGradient=r.gradient.op.gradient),r.stroke&&nt(t,"setAny",this,3)([{globalBlast:"".concat(r.stroke.op.width," ").concat(r.stroke.op.color)}]);var u=[r.stroke,r.gradient,r.animation,r.span,r.backgroundOp,r.layout,r.marginOp,r.shadow,r.filtera,r.animation];u=u.filter(function(t){return null!=t});var d=[];for(s=0;s<u.length;s++)d.push({range:u[s].range,log:u[s].op.name,target:u[s].target,op:u[s].op});this.chainReact(d,this.options.id)}if(r.shadow){var f=r.shadow,h=this.removeQuotesFromFirstWord(JSON.stringify(f));n+="\n shadow: ".concat(h,",")}if(r.animation){var p=r.animation,y=this.removeQuotesFromFirstWord(JSON.stringify(p));n+="\n animation: ".concat(y,",")}var m="\n .set({".concat(n,"}) \n \n");return Object.keys(e).length>0?this.code.push(m):this.code.push(","),this}},{key:"setFilter",value:function(t){var e=[],n=[t];n=n.filter(function(t){return null!=t});for(var r=0;r<n.length;r++)e.push({range:n[r].range,log:n[r].op.name,target:n[r].target})}},{key:"makeMultiMargin",value:function(t){for(var e=0;e<t.length;e++)"left"===t[e].side&&(this.res.style.marginLeft=t[e].value),"right"===t[e].side&&(this.res.style.marginRight=t[e].value),"top"===t[e].side&&(this.res.style.marginTop=t[e].value),"bottom"===t[e].side&&(this.res.style.marginBottom=t[e].value);return this}},{key:"setID",value:function(t){return this.res.setAttribute("id",t),this}},{key:"square",value:function(){return this.res.style.width="30%",this.res.style.paddingBottom="30%",this}},{key:"opacity",value:function(t){return this.res.style.opacity="".concat(t),this}},{key:"rowCol",value:function(t,e){return this.res.style.gridRow=t,this.res.style.gridColumn=e,this}},{key:"setArea",value:function(t){return this.res.style.gridArea=t,this}},{key:"setGridRow",value:function(t){return this.res.style.gridRow=t,this}},{key:"setGridCol",value:function(t){return this.res.style.gridColumn=t,this}},{key:"setGrid",value:function(){return this.res.style.gridRow="span 2",this.res.style.gridColumn="span 3",this}},{key:"transform",value:function(t){return this.res.style.transform=t,this}},{key:"offset",value:function(){return this.res.style.marginLeft="-60px",this}},{key:"offseta",value:function(){return this.res.style.marginLeft="90px",this.res.style.marginTop="-30px",this}},{key:"borderAround",value:function(t){return this.res.style.border=t,this}},{key:"setClass",value:function(t){return this.res.setAttribute("class",t),this}},{key:"scale",value:function(t){var e=this;return this.res.style.width,this.res.style.transition="0.5s all",this.res.addEventListener("mouseover",function(){e.res.style.width,e.res.style.transform="scale(1.04)"}),this.res.addEventListener("mouseout",function(){e.res.style.width,e.res.style.transform="scale(1.0)"}),this}},{key:"onTap",value:function(t){return this.res.addEventListener("click",t),this}},{key:"border",value:function(t){return this.res.style.borderTopLeftRadius="16px",this.res.style.borderTopRightRadius="16px",this}},{key:"allRound",value:function(t){return this.res.style.borderRadius=t,this}},{key:"mobileWidth",value:function(){return window.matchMedia("(max-device-width: 415px)").matches&&(this.res.style.width="120%"),this}},{key:"image",value:function(t,e,n,r,i){var o=window.matchMedia("(max-device-width: 415px)"),a=document.createElement("div");return a.style.viewTransitionName=r,a.style.width="100%",a.style.height=this.options.height?this.options.height:"400px",i&&(a.style.gridColumn=i.gridColumn,a.style.gridRow=i.gridRow),o.matches&&(a.style.height="500"),a.style.backgroundImage="url(".concat(t,")"),a.style.backgroundPosition="center center",a.style.backgroundRepeat="no-repeat",a.style.backgroundSize="cover","uncover"===n&&(a.style.backgroundSize="contain"),"contain"===e&&(a.style.backgroundSize="contain"),this.res=a,this}},{key:"arrayPadding",value:function(t,e){return t.includes("left")&&(this.res.style.paddingLeft=e),t.includes("right")&&(this.res.style.paddingRight=e),t.includes("top")&&(this.res.style.paddingTop=e),t.includes("bottom")&&(this.res.style.paddingBottom=e),this}},{key:"arrayMargin",value:function(t,e){return t.includes("left")&&(this.res.style.marginLeft=e),t.includes("right")&&(this.res.style.marginRight=e),t.includes("top")&&(this.res.style.marginTop=e),t.includes("bottom")&&(this.res.style.marginBottom=e),this}},{key:"setup",value:function(){var t=document.createElement("img");return t.style.width="100%",t.src=this.url,this.res=t,this}},{key:"autoW",value:function(){return this.res.style.width="initial",this}},{key:"float",value:function(t){return this.res.style.float="".concat(t),this}},{key:"fillAvailable",value:function(){return this.res.style.height="-webkit-fill-available",this}},{key:"grayscale",value:function(t){return this.res.style.filter="grayscale(".concat(t,"%)"),this}},{key:"flex",value:function(t){return this.res.style.flex=1,this}},{key:"height",value:function(t){return this.res.style.height=t,this.res.style.width="auto",this}},{key:"expand",value:function(t){var e=this,n=function(){var n,r;if(window.matchMedia("(min-width: ".concat(t.at,")")).matches){e.res.style.width="".concat(t.width);var i=window.innerWidth/2-(r=n=t.width,(n.includes("%")||n.includes("px"))&&(r=r.substr(0,2)),(n.includes("%")?Number(r/100*window.innerWidth):n.includes("px")?Number(r):void 0)/2);e.res.style.marginLeft="".concat(i,"px")}else e.res.style.width="100%",e.res.style.marginLeft="0px";window.matchMedia("(max-device-width: 415px)").matches&&(e.res.style.width="100%",e.res.style.marginLeft="0px")};return n(),window.addEventListener("resize",n),this}},{key:"width",value:function(t){return this.res.style.width=t,this.res.style.height="auto",this}},{key:"toBack",value:function(){return this.res.style.zIndex="-1",this}},{key:"margin",value:function(t,e,n,r){return(t||e||n||r)&&(this.res.style.marginLeft=t,this.res.style.marginTop=e,this.res.style.marginRight=n,this.res.style.marginBottom=r),e||n||r||0===e&&0===n&&0===r||(this.res.style.margin=t),this}},{key:"padding",value:function(t){return this.res.style.padding=t,this}},{key:"size",value:function(t,e){return t&&e?(this.res.style.width=t,this.res.style.height=e):(this.res.style.width=t,this.res.style.height=t),this}},{key:"frame",value:function(t){var e=t.width,n=t.height;return e&&n?(this.res.style.width=e,this.res.style.height=n):(this.res.style.width=e,this.res.style.height=e),this}},{key:"RSize",value:function(t,e,n){var r=window.matchMedia("(max-device-width: 420px)");return t&&e?(this.res.style.width=r.matches?t*n:t,this.res.style.height=r.matches?e*n:e):(this.res.style.width=r.matches?t*n:t,this.res.style.height=r.matches?t*n:t),this}},{key:"shadow",value:function(t){return"mild"===t.type?this.res.style.boxShadow="0px 3px 15px rgba(0,0,0,0.2)":this.res.style.boxShadow="".concat(t.x,"px ").concat(t.y,"px ").concat(t.radius,"px ").concat(t.color),this}},{key:"clipShape",value:function(t){return this.res.style.borderRadius="50%",this}},{key:"cornerRadius",value:function(t){return this.res.style.borderRadius=t,this}},{key:"clipPath",value:function(t){this.res.style.clipPath='path("'.concat(t,'")');var e=document.createElementNS("http://www.w3.org/2000/svg","svg");return e.style.display="block",e.style.width="100%",e.style.height="100%",e.style.overflow="visible",this}},{key:"render",value:function(t){var e=this.res;if(!t)return e;document.querySelector(t).appendChild(e)}}],n&&Z(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function st(t){return st="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},st(t)}function lt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function ct(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ut(r.key),r)}}function ut(t){var e=function(t){if("object"!=st(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=st(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==st(e)?e:e+""}function dt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(dt=function(){return!!t})()}function ft(t,e,n,r){var i=ht(pt(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof i?function(t){return i.apply(n,t)}:i}function ht(){return ht="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=pt(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},ht.apply(null,arguments)}function pt(t){return pt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},pt(t)}function yt(t,e){return yt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},yt(t,e)}var mt=function(){function t(e,n,r){var i,o,a,s;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(o=this,a=t,a=pt(a),i=function(t,e){if(e&&("object"==st(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(o,dt()?Reflect.construct(a,s||[],pt(o).constructor):a.apply(o,s))).link=n,i.text=e,i.code=[],i.css=[],i.elCSS=[],i.html=[],i.res=null,i.stopEM=r,i.setup(),i.inlineBlock(),i.res.addEventListener("click",function(t){var e=i.link||i.res.getAttribute("href");if(e){var n=new URL(e,window.location.href).href,r=/^https?:\/\//i.test(n),o=n.startsWith("#"),a=/^[a-zA-Z]+:/.test(n);r||o||n.endsWith(".html")||a||(t.preventDefault(),"navigation"in window?navigation.navigate(n):(history.pushState({},"",n),document.dispatchEvent(new PopStateEvent("popstate"))))}}),i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&yt(t,e)}(t,W),e=t,n=[{key:"toCSS",value:function(){return this.css}},{key:"toHTMLA",value:function(){return this.html}},{key:"toElCSS",value:function(){return 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"HTMLAnchorElement"}},{key:"toCode",value:function(){if(this.excludeFromCodeTrue)return[""];var t=Object.fromEntries(Object.entries(this.options).filter(function(t){var e,n,r=(n=2,function(t){if(Array.isArray(t))return t}(e=t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,n)||function(t,e){if(t){if("string"==typeof t)return lt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?lt(t,e):void 0}}(e,n)||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.")}());return r[0],null!==r[1]})),e=JSON.stringify(t,null,4).replace(/"([^"]+)":/g,"$1:");return["new Link().set(".concat(e,")")]}},{key:"setArea",value:function(t){return this.res.style.gridArea=t,this}},{key:"setup",value:function(){var t=document.createElement("a");t.setAttribute("href",this.link),t.style.textDecoration="none",t.style.color="black",t.style.fontFamily="Arial";var e=document.createTextNode(this.text);return t.appendChild(e),this.res=t,!1===this.stopEM&&this.em(1),this}},{key:"appendImageAsChild",value:function(t,e){var n=document.createElement("a");t.options.vtn&&(n.style.viewTransitionName=t.options.vtn),n.setAttribute("href",t.options.url);var r=document.createElement("img");return t.options&&(r.style.width=t.options.size,t.options.radius&&(r.style.borderRadius=t.options.radius),r.setAttribute("src",t.options.img),t.options.pad&&(this.res.style.padding=t.options.pad),t.options.padRight&&(this.res.style.paddingRight=t.options.padRight),n.appendChild(r)),this.res=n,e&&(this.res.style.marginLeft=e),this}},{key:"addIcon",value:function(t){var e=document.createElement("img");return e.style.width="20px",e.style.height="auto",e.style.marginLeft=t.padding?t.padding:"10px",e.setAttribute("src",t.url),this.res.appendChild(e),this}},{key:"removeQuotesFromFirstWord",value:function(t){if(t)return t.replace(/"([^"]+)":/g,"$1:")}},{key:"onTap",value:function(t){return this.res.addEventListener("click",t),this}},{key:"set",value:function(e){this.elCSS.push("text-decoration: none; \n"),this.options=e;var n="";e.onTap&&this.onTap(e.onTap),e.tags&&ft(t,"setTags",this,3)([e.tags]),e.id&&this.res.setAttribute("id",e.id),e.id&&ft(t,"setID",this,3)([e.id]),this.commonMethods(e),e.flex&&(this.res.style.display="flex"),e.fixMobileTap&&this.fixMobileTap(e.fixMobileTap);var r=this.removeQuotesFromFirstWord(JSON.stringify(e.pad));if(e.pad&&(n+="\n pad: ".concat(r,",")),e.preffersId&&(this.preffersId=e.preffersId),null!=e.preffersId&&(n+="\n preffersId: ".concat(e.preffersId,",")),e.class&&ft(t,"setClass",this,3)([e.class]),e.class&&(n+='\n class: "'.concat(e.class,'",')),e.borderObj){this.res.style.border="".concat(e.borderObj.width," solid ").concat(e.borderObj.color),this.res.style.borderRadius="".concat(e.borderObj.radius);var i=this.removeQuotesFromFirstWord(JSON.stringify(e.borderObj));n+="\n borderObj: ".concat(i,",")}if(!1===this.options.preffersId?this.html.push('<a class="'.concat(e.class,'" href="#hello">').concat(e.text,"</a> \n \n")):e.id&&this.html.push('<a id="'.concat(e.id.substr(1),'" href="#hello">').concat(e.text,"</a> \n \n")),null!=e.blastData){var o=this.removeQuotesFromFirstWord(JSON.stringify(e.blastData));ft(t,"setAny",this,3)([{globalBlast:"1px ".concat(e.blastData.color)}]),e.blastData&&(n+="\n blastData: ".concat(o,","))}e.nowrap&&(this.res.style.whiteSpace="nowrap"),e.font&&this.font(e.font),e.font&&(n+='\n font: "'.concat(e.font,'",')),e.font&&this.elCSS.push('font-family: "'.concat(e.font,'"; \n')),e.fluidc&&this.fluidCopy(e.fluidc),e.fluidc&&(n+='\n fluidc: "'.concat(e.fluidc,'",')),e.clampc&&this.clampCopy(e.clampc),this.options.id&&(n+='\n id: "'.concat(this.options.id,'",')),e.align&&this.leftAlign(e.align),e.align&&(n+='\n align: "'.concat(e.align,'",')),e.type&&(this.res.style.display="block"),e.color&&this.color(e.color),e.color&&(n+='\n color: "'.concat(e.color,'",')),e.color&&this.elCSS.push('color: "'.concat(e.color,'"; \n')),e.background&&this.background(e.background);var a=this.removeQuotesFromFirstWord(JSON.stringify(e.background));e.background&&(n+="\n background: ".concat(a,",")),e.hover&&this.hover(e.hover);var s=this.removeQuotesFromFirstWord(JSON.stringify(e.hover));if(e.hover&&(n+="\n hover: ".concat(s,",")),e.blast&&(this.blastData=e.blast),e.bold&&(n+="\n bold: ".concat(e.bold,",")),e.block&&this.toBlock(),e.block&&(n+="\n block: ".concat(e.block,",")),e.radius&&(n+='\n radius: "'.concat(e.radius,'",')),e.width&&(n+='\n width: "'.concat(e.width,'",')),e.arrayPadding){var l=e.arrayPadding.sides.map(function(t){return'"'.concat(t,'"')}).join(", ");e.arrayPadding&&this.arrayPadding(e.arrayPadding.sides,e.arrayPadding.value),e.arrayPadding&&(n+="\n arrayPadding: {sides: [".concat(l,'], value: "').concat(e.arrayPadding.value,'"},'))}if(e.arrayMargin&&this.arrayMargin(e.arrayMargin.sides,e.arrayMargin.value),e.arrayMargin&&(n+="\n arrayMargin: {sides: [".concat(e.arrayMargin.sides.map(function(t){return'"'.concat(t,'", ')}),'], value: "').concat(e.arrayMargin.value,'"},')),e.maxWidth&&this.maxWidth(e.maxWidth),e.url&&this.res.setAttribute("href",e.url),n+='\n url: "'.concat(e.url,'",'),e.text&&(this.res.textContent=e.text),n+='\n text: "'.concat(e.text,'",'),e.data){e.data&&this.appendImageAsChild(e.data,"20px");var c=this.removeQuotesFromFirstWord(JSON.stringify(e.data));e.data&&(n+="\n data: ".concat(c))}if(e.icon){this.addIcon(e.icon);var u=this.removeQuotesFromFirstWord(JSON.stringify(e.icon));n+="\n icon: ".concat(u,",")}if(e.shadow){var d=e.shadow,f=this.removeQuotesFromFirstWord(JSON.stringify(d));n+="\n shadow: ".concat(f,",")}if(e.stroke){var h=this.removeQuotesFromFirstWord(JSON.stringify(e.stroke));e.stroke&&(n+="\n stroke: ".concat(h,","))}if(e.backgroundOp){var p=this.removeQuotesFromFirstWord(JSON.stringify(e.backgroundOp));n+="\n backgroundOp: ".concat(p,",")}if(e.marginOp){var y=this.removeQuotesFromFirstWord(JSON.stringify(e.marginOp));n+="\n marginOp: ".concat(y,",")}if(e.gradient){var m=this.removeQuotesFromFirstWord(JSON.stringify(e.gradient));n+="\n gradient: ".concat(m,",")}if(e.animation){var v=this.removeQuotesFromFirstWord(JSON.stringify(e.animation));n+="\n animation: ".concat(v,",")}if(e.transform){var g=this.removeQuotesFromFirstWord(JSON.stringify(e.transform));n+="\n transform: ".concat(g,",")}if(e.blast){var b=this.removeQuotesFromFirstWord(JSON.stringify(e.blast));n+="\n blast: ".concat(b,",")}var w="new Link().set({".concat(n,"}) \n");this.code.push(w),e.color&&this.color(e.color),e.rounded&&this.round(),e.new&&(this.res.setAttribute("target","_blank"),this.res.setAttribute("rel","noopener noreferrer")),e.transform&&this.reactOnTransform(e.transform);var x=[],k=[e.border,e.blast,e.gradient,e.animation,e.span,e.shadow,e.backgroundOp,e.animation,e.transform];if((k=k.filter(function(t){return null!=t})).length>0){e.gradient&&(this.globalGradient=e.gradient.op.gradient,"radial"===e.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)")),e.stroke&&ft(t,"setAny",this,3)([{globalBlast:"".concat(e.stroke.op.width," ").concat(e.stroke.op.color)}]);for(var S=0;S<k.length;S++)x.push({range:k[S].range,log:k[S].op.name,target:k[S].target,op:k[S].op});var O=[];e.borderObj&&O.push("border"),e.background&&O.push("background"),e.mar&&O.push("margin"),e.animation&&O.push("animation"),this.chainReact(x,e.id,O,e.isNavA),this.res.style.zIndex=1}return this}},{key:"fixMobileTap",value:function(t){this.res.style.pointerEvents="auto",this.res.style.touchAction="manipulation",this.res.style.cursor="pointer",this.res.style.zIndex="1",this.res.style.position="relative"}},{key:"color",value:function(t){return this.res.style.color=t,this}},{key:"maxWidth",value:function(t){return this.res.style.maxWidth=t,this}},{key:"background",value:function(t){return this.res.style.backgroundColor=t,this}},{key:"leftAlign",value:function(t){return this.res.style.textAlign=t,this}},{key:"arrayPadding",value:function(t,e){return e||(this.res.style.marginLeft="".concat(t[0],"px"),this.res.style.marginTop="".concat(t[1],"px"),this.res.style.marginRight="".concat(t[2],"px"),this.res.style.marginBottom="".concat(t[3],"px")),"all"===t[0]&&(this.res.style.paddingLeft=e,this.res.style.paddingTop=e,this.res.style.paddingRight=e,this.res.style.paddingBottom=e),t.includes("left")&&(this.res.style.paddingLeft=e),t.includes("right")&&(this.res.style.paddingRight=e),t.includes("top")&&(this.res.style.paddingTop=e),t.includes("bottom")&&(this.res.style.paddingBottom=e),e||(this.res.style.paddingBottom=t),this}},{key:"arrayMargin",value:function(t,e){return t.includes("left")&&(this.res.style.marginLeft=e),t.includes("right")&&(this.res.style.marginRight=e),t.includes("top")&&(this.res.style.marginTop=e),t.includes("bottom")&&(this.res.style.marginBottom=e),t.includes("all")&&(this.res.style.margin=e),e||(this.res.style.marginBottom=t),this}},{key:"getClampValue",value:function(t){return"S6"===t?"clamp(2.25rem, 2vw+1.5rem, 3.25rem)":"S5"===t?"clamp(2.75rem, 2vw + 1.5rem, 3.25rem)":"S4"===t?"clamp(3.5rem, 2vw + 1.5rem, 3.25rem)":"S3"===t?"clamp(4.25rem, 2vw + 1.5rem, 3.25rem)":"S2"===t?"clamp(5rem, 2vw + 1.5rem, 3.25rem)":"S1"===t?"clamp(6rem, 2vw + 1.5rem, 3.25rem)":void 0}},{key:"clampCopy",value:function(t){return this.res.style.fontSize=this.getClampValue(t),this}},{key:"fluidCopy",value:function(t){return"S1"===t&&(this.res.style.fontSize="calc(1.625rem + 5.075vw)"),"S2"===t&&(this.res.style.fontSize="calc(1.500rem + 4.3vw)"),"S3"===t&&(this.res.style.fontSize="calc(1.375rem + 3.525vw)"),"S4"===t&&(this.res.style.fontSize="calc(1.250rem + 2.75vw)"),"S5"===t&&(this.res.style.fontSize="calc(1.125rem + 1.975vw)"),"S6"===t&&(this.res.style.fontSize="calc(1rem + 0.5vw)"),this}},{key:"inlineBlock",value:function(){return this.res.style.display="inline-block",this}},{key:"toBlock",value:function(){return this.res.style.display="block",this}},{key:"myself",value:function(t){var e=this,n=function(){window.matchMedia("(max-device-width: 415px)").matches?e.res.style.fontSize=t.desktop:e.res.style.fontSize=t.phone};return n(),window.addEventListener("resize",n),this}},{key:"style",value:function(t){return this.res.style.color=t.styles.color,this.res.style.fontWeight=t.styles.fontWeight,this.res.style.paddingLeft=t.styles.padding[0],this.res.style.paddingTop=t.styles.padding[1],this.res.style.paddingRight=t.styles.padding[2],this.res.style.paddingBottom=t.styles.padding[3],this}},{key:"round",value:function(){return this.res.style.borderRadius="0.5rem",this.options.rounded&&(this.res.children[0].style.borderRadius="0.5rem"),this}},{key:"newWindow",value:function(){return this.res.target="_new",this}},{key:"radius",value:function(t){return this.res.style.borderRadius="".concat(t),this}},{key:"transition",value:function(t){return this.res.style.transition="".concat(t,"s ease-in-out"),this.res.style.transionProperty="background, color",this}},{key:"width",value:function(t){return this.res.style.width=t,this}},{key:"italic",value:function(){return this.res.style.fontStyle="italic",this}},{key:"padding",value:function(t,e,n,r){return t&&e&&n&&r?(this.res.style.paddingLeft=t,this.res.style.paddingTop=e,this.res.style.paddingRight=n,this.res.style.paddingBottom=r):this.res.style.padding=t,this}},{key:"medium",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.res.style.fontSize="2rem":t.res.style.fontSize="1.5em"};return e(),window.addEventListener("resize",e),this}},{key:"opacity",value:function(t){return this.res.style.opacity=t,this}},{key:"margin",value:function(t,e,n,r){return this.res.style.marginTop=t,this.res.style.marginLeft=e,this.res.style.marginRight=n,this.res.style.marginBottom=r,this}},{key:"em",value:function(t){var e=this,n=window.matchMedia("(max-device-width: 415px)"),r=function(){n.matches?e.res.style.fontSize="2em":e.res.style.fontSize="1em"};return r(),window.addEventListener("resize",r),this}},{key:"font",value:function(t){return this.res.style.fontFamily=t,this}},{key:"render",value:function(t){return t?(document.querySelector(t).appendChild(this.res),this):this.res}}],n&&ct(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function vt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return gt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gt(t,e):void 0}}(t,e)||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 gt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function bt(t){return bt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bt(t)}function wt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,xt(r.key),r)}}function xt(t){var e=function(t){if("object"!=bt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=bt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==bt(e)?e:e+""}function kt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(kt=function(){return!!t})()}function St(){return St="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Ot(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},St.apply(null,arguments)}function Ot(t){return Ot=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ot(t)}function jt(t,e){return jt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},jt(t,e)}var Ct=function(){function t(e,n){var r,i,o,a;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(i=this,o=t,o=Ot(o),r=function(t,e){if(e&&("object"==bt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(i,kt()?Reflect.construct(o,a||[],Ot(i).constructor):o.apply(i,a))).code=[],r.saveEl=n,r.frs=e,r.res=null,r.setup(),r.responsive(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&jt(t,e)}(t,W),e=t,n=[{key:"getType",value:function(){return"FlexRowLayoutElement"}},{key:"set",value:function(t){this.options=t;var e=t;return e.onTap&&this.onTap(e.onTap),e.id&&this.res.setAttribute("id",e.id),e.position&&(this.res.style.position=e.position),void 0!==e.top&&(this.res.style.top=e.top),t.id&&this.res.setAttribute("id",t.id),this.commonMethods(e),t.padding&&this.padding(t.padding),t.background&&(this.res.style.backgroundColor="#ecf0f1",this.res.style.cornerRadius="#3rem"),t.alignTo&&(this.res.style.justifyContent=t.alignTo),t.background&&(this.res.style.backgroundColor=t.background),t.justify&&(this.res.style.justifyContent=t.justify),t.border&&("top"===t.border[0]&&(this.res.style.borderTop="".concat(t.border[1]," solid white")),"all"===t.border[0]&&(this.res.style.border="".concat(t.border[1]," solid orange"))),t.borderObj&&(this.borderObj(t.borderObj),JSON.stringify(t.borderObj)),t.width&&(this.res.style.width=t.width),t.height&&(this.res.style.height=t.height),t.gap&&(this.res.style.gap=t.gap),t.align&&(JSON.stringify(t.align),this.res.style.alignItems="flex-start",this.res.style.alignItems="flex-start"),t.wrap&&this.wrap(),t.alignIts&&(JSON.stringify(t.alignIts),this.res.style.alignItems="flex-start"),t.owrap&&this.onlyWrap(),null!=t.owrap&&!1===t.owrap&&(this.res.style.flexWrap="nowrap",this.res.style.background="yellow"),t.toColumn&&this.toColumn(t.toColumn),t.column&&this.makeCol(),t.colat&&t.colat&&this.toColumnAt(t.colat),t.arrayPadding&&this.arrayPadding(t.arrayPadding.sides,t.arrayPadding.value),t.arrayMargin&&this.arrayMargin(t.arrayMargin.sides,t.arrayMargin.value),this.arrayMarginValue=t.arrayMargin,t.multipad&&this.makeMultiPad(t.multipad),t.align&&this.makeJustify(t.justify),t.justify&&this.makeAlign(t.justify),"flex-start"===t.justifo&&(this.res.style.justifyContent="flex-start"),t.radius&&(this.res.style.borderRadius=t.radius),t.aligns&&this.aligns(t.aligns),this.callReact(e),!0===t.center&&(this.res.style.marginLeft="auto",this.res.style.marginRight="auto"),this}},{key:"callReact",value:function(e){this.options=e;var n,r,i=[],o=e.transform&&"object"===bt(e.transform);if(e.stroke||e.gradient||e.span||e.backgroundOp||e.layout||e.shadow||e.animation||e.filtera||o){e.gradient&&(this.globalGradient=e.gradient.op.gradient,"radial"===e.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)")),e.stroke&&(n=this,"function"==typeof(r=St(Ot(t.prototype),"setAny",n))?function(t){return r.apply(n,t)}:r)([{globalBlast:"".concat(e.stroke.op.width," ").concat(e.stroke.op.color)}]),e.span&&(e.span.prevText=this.text);var a=[e.stroke,e.gradient,e.animation,e.span,e.backgroundOp,e.layout,e.marginOp,e.shadow,e.animation,e.filtera,o?e.transform:void 0];a=a.filter(function(t){return null!=t});for(var s=0;s<a.length;s++)i.push({range:a[s].range,log:a[s].op.name,target:a[s].target,op:a[s].op});var l=[];e.borderObj&&l.push("border"),e.background&&l.push("background"),e.mar&&l.push("margin"),e.animation&&l.push("animation"),e.span&&l.push("span"),this.chainReact(i,e.id,l)}}},{key:"setArea",value:function(t){return this.res.style.gridArea=t,this}},{key:"toColumnAt",value:function(t){var e=this;if(!this.columnAlways){var n=function(){var n=window.matchMedia("(max-width: ".concat(t,")")),r=window.matchMedia("(max-device-width: 415px)");n.matches||r.matches?e.res.style.flexDirection="column":e.res.style.flexDirection="row"};n(),window.addEventListener("resize",n)}return this}},{key:"onlyWrap",value:function(){return this.res.style.flexWrap="wrap",this}},{key:"wrap",value:function(){return this.res.style.flexWrap="wrap",this.res.style.justifyContent="space-between",this}},{key:"aligns",value:function(t){return"start"===t&&(this.res.style.alignItems="flex-start"),"end"===t&&(this.res.style.alignItems="flex-end"),"center"===t&&(this.res.style.alignItems="center"),this}},{key:"toColumn",value:function(){return this.res.style.flexDirection="column",this}},{key:"toCode",value:function(){for(var t={},e=0,n=Object.entries(this.options||{});e<n.length;e++){var r=vt(n[e],2),i=r[0],o=r[1];null!=o&&""!==o&&(t[i]=o)}var a=JSON.stringify(t,null,4).replace(/"([^"]+)":/g,"$1:").replace(/"([^"]*)"/g,function(t,e){return e.includes("\n")?"`"+e.replace(/`/g,"\\`")+"`":'"'.concat(e,'"')}),s=(this.items||[]).map(function(t){return null!=t&&t.toCode?t.toCode():"/* element */"}).join(",\n ");return[["new FlexRow().set(".concat(a,")"),s?".items([\n ".concat(s,"\n])"):""].join("")]}},{key:"arrayPadding",value:function(t,e){return t.includes("left")&&(this.res.style.paddingLeft=e),t.includes("right")&&(this.res.style.paddingRight=e),t.includes("top")&&(this.res.style.paddingTop=e),t.includes("bottom")&&(this.res.style.paddingBottom=e),this}},{key:"borderAround",value:function(t){return this.res.style.border=t,this}},{key:"cornerRadius",value:function(t){return this.res.style.borderRadius=t,this}},{key:"makeJustify",value:function(t){return"start"===t&&(this.res.style.justifyContent="flex-start"),this}},{key:"makeAlign",value:function(t){return"center"===t?this.res.style.alignItems="center":this.res.style.justifyContent=t,this}},{key:"makeCol",value:function(){return this.res.style.flexDirection="column",this}},{key:"makeMultiPad",value:function(t){for(var e=0;e<t.length;e++)"left"===t[e].side&&(this.res.style.paddingLeft=t[e].value),"right"===t[e].side&&(this.res.style.paddingRight=t[e].value);return this}},{key:"padding",value:function(t){return this.res.style.padding=t,this}},{key:"center",value:function(){return this}},{key:"setClass",value:function(t){return this.res.setAttribute("class",t),this}},{key:"toCenter",value:function(t){return this.res.style.marginLeft="auto",this.res.style.marginRight="auto",this.res.setAttribute("class",t),this}},{key:"setup",value:function(){var t=document.createElement("div");return t.style.display="flex",t.style.justifyContent="space-around",t.style.alignItems="center",this.res=t,this}},{key:"noSpaceAround",value:function(){return this.res.style.justifyContent="",this}},{key:"itemAlignCenter",value:function(){return this.res.style.justifyContent="center",this.res.style.alignItems="center",this}},{key:"arrayMargin",value:function(t,e){return e||(this.res.style.marginLeft="".concat(t[0],"px"),this.res.style.marginTop="".concat(t[1],"px"),this.res.style.marginRight="".concat(t[2],"px"),this.res.style.marginBottom="".concat(t[3],"px")),t.includes("left")&&(this.res.style.marginLeft="".concat(e,"px")),t.includes("right")&&(this.res.style.marginRight="".concat(e,"px")),t.includes("top")&&(this.res.style.marginTop="".concat(e,"px")),t.includes("bottom")&&(this.res.style.marginBottom="".concat(e,"px")),this}},{key:"frame",value:function(t){return this.res.style.width=t.width,this.res.style.height=t.height,window.matchMedia("(max-device-width: 415px)").matches&&t.mobile&&(this.res.style.width=t.mobile),this}},{key:"background",value:function(t){return this.res.style.background=t,this}},{key:"radius",value:function(t){return this.res.style.borderRadius="".concat(t,"px"),this}},{key:"shadow",value:function(t,e,n){return this.res.style.boxShadow="0px 1px 10px 0px rgb(145 145 145)",this}},{key:"onTap",value:function(t){return this.res.addEventListener("click",t),this}},{key:"items",value:function(t){this.els=t,this.items=t;for(var e=0;e<t.length;e++){if(null!=t[e])if(t[e].render instanceof Function){var n=t[e].render();this.res.appendChild(n)}else this.res.appendChild(t[e]);if(null!=t[e]&&t[e].render instanceof Function){var r=t[e].render();this.res.appendChild(r),void 0!==t[e].toCode&&this.code.push(t[e].toCode().flatMap(function(t){return t}))}}return this}},{key:"adjustRatiosForLayout",value:function(){var t=this;return null==this.els[1].getWidth||null==this.els[1].getHeight||(window.addEventListener("resize",function(){t.resizeValues()}),this.resizeValues()),this}},{key:"resizeValues",value:function(){var t=.7*window.innerWidth*(this.els[1].getHeight()/this.els[1].getWidth());this.res.children[0].style.height="".concat(t,"px"),this.res.children[0].style.width="30%",this.res.children[1].style.width="70%"}},{key:"responsive",value:function(t){var e=this,n=window.matchMedia("(max-device-width: 415px)");return window.innerWidth<t||n.matches?this.res.style.gridTemplateColumns="1fr":this.res.style.gridTemplateColumns="1fr 1fr",window.addEventListener("resize",function(){window.innerWidth<t||n.matches?e.res.style.gridTemplateColumns="1fr":e.res.style.gridTemplateColumns="1fr 1fr"}),this}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}],n&&wt(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function Et(t){return Et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Et(t)}function Tt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,_t(r.key),r)}}function _t(t){var e=function(t){if("object"!=Et(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Et(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Et(e)?e:e+""}var Pt=function(){return t=function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.obj=e||{},this.items=n||[]},(e=[{key:"render",value:function(){var t=document.createElement("div");t.style.display="flex",t.style.width="100%",t.style.justifyContent="space-around",t.setAttribute("id","innerItemsWrapper");var e=window.matchMedia("(max-device-width: 415px)"),n=window.matchMedia("(max-width: 600px)");(e.matches||n.matches)&&(t.style.marginTop="3rem");for(var r=0;r<this.items.length;r++){var i=this.items[r];t.appendChild(i.render())}var o=document.createElement("div");return o.style.width=this.obj.isSide?"333px":"100%",o.style.background=this.obj.background||"white",o.style.display="flex",o.style.justifyContent="center",o.style.alignItems="center",o.style.height="100%",o.setAttribute("id","outerItemsWrapper"),o.appendChild(t),this.obj.customStyle&&(t.style.width="auto",t.style.top="0rem",t.style.borderRadius="1rem",t.style.background=this.obj.background||"white",t.style.margin="1rem",t.style.position="absolute",t.style.opacity=.8),o}}])&&Tt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function At(t){return At="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},At(t)}function Rt(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Mt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Mt(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Mt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Lt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,zt(r.key),r)}}function zt(t){var e=function(t){if("object"!=At(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=At(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==At(e)?e:e+""}function It(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(It=function(){return!!t})()}function Ft(t){return Ft=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ft(t)}function Wt(t,e){return Wt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Wt(t,e)}window.CustomDivRenderer=Pt;var Dt=function(){function t(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,n=Ft(n=t),function(t,e){if(e&&("object"==At(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(e,It()?Reflect.construct(n,r||[],Ft(e).constructor):n.apply(e,r));var e,n,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Wt(t,e)}(t,W),e=t,(n=[{key:"setup",value:function(t){return this.obj=t,this.setTags(this.obj.tags),this.animate=void 0===this.obj.animate||this.obj.animate,this.res=this.createSideNav(t),this.res.style.position="relative",this.res.style.zIndex=3,this.closed=!0,this}},{key:"toggleSideNav",value:function(t){var e=this;this.closed=!this.closed;var n=this.res.children[0];if(this.closed)if(n.style.overflowX="hidden",t.style.opacity=1,this.animate){this.ope=n.animate([{transform:"translateX(0)"},{transform:"translateX(100%)"}],{duration:300,fill:"forwards"}),this.ope.finished.then(function(){var t=new CustomEvent(e.obj.tags.close);window.dispatchEvent(t)});var r,i=-1,o=Rt(n.children);try{for(o.s();!(r=o.n()).done;){var a=r.value;if(i+=1,this.masterEL[i]){var s,l=Rt(a.children);try{for(l.s();!(s=l.n()).done;){var c=s.value,u=this.masterEL[i].options.animation;u&&this.mappedIDS.includes(c.id)&&c.animate(u.op.keyframesClose,u.op.closeOptions)}}catch(t){l.e(t)}finally{l.f()}}}}catch(t){o.e(t)}finally{o.f()}}else n.style.display="none";else{n.style.overflowX="none";var d,f=-1,h=Rt(n.children);try{for(h.s();!(d=h.n()).done;){var p=d.value;f+=1;var y,m=Rt(p.children);try{for(m.s();!(y=m.n()).done;){var v=y.value;if(this.mappedIDS.includes(v.id)&&void 0!==this.masterEL[0]){var g=this.masterEL[f].options.animation;if(g){var b=g.op.openOptions;b.delay||(b.delay=1),b.duration||(b.duration=300),v.animate(g.op.keyframesOpen,b)}}}}catch(t){m.e(t)}finally{m.f()}}}catch(t){h.e(t)}finally{h.f()}t.style.opacity=0,this.animate?(n.style.display="flex",this.opeClose=n.animate([{transform:"translateX(100%)"},{transform:"translateX(0)"}],{duration:300,fill:"forwards"}),this.opeClose.finished.then(function(){var t=new CustomEvent(e.obj.tags.open);window.dispatchEvent(t)})):n.style.display="flex"}}},{key:"createToggleButton",value:function(t){var e=document.createElement("button");return e.innerText="☰",e.style.padding="10px 20px",e.style.backgroundColor="transparent",e.style.color=null!=t?t:"#3498db",e.style.border="none",e.style.borderRadius="5px",e.style.cursor="pointer",e.style.zIndex=1,e.style.fontSize="1.6rem",this.obj.fixed&&(e.style.position="fixed"),e}},{key:"createCloseButton",value:function(t){var e=document.createElement("button");return e.innerText="×",e.style.fontSize="1.6rem",e.style.padding="10px 20px",e.style.backgroundColor="transparent",e.style.color=null!=t?t:"black",e.style.border="none",e.style.borderRadius="5px",e.style.cursor="pointer",e.style.zIndex=1,e.style.alignSelf="flex-end",e}},{key:"createSideNav",value:function(t){var e=this,n=document.createElement("div");n.style.display="flex",n.style.justifyContent="flex-end";var r=document.createElement("div");r.style.display="none",r.style.background=this.obj.background||"#1abc9c",r.style.height="100%",window.matchMedia("(max-device-width: 415px)").matches?r.style.width="100%":r.style.width=this.obj.width||"400px",r.style.position="fixed",r.style.right=0,this.animate&&(r.style.transform="translateX(100%)"),r.style.flexDirection="column",r.style.justifyContent="flex-start";var i=this.createToggleButton(this.obj.hamColour.opened),o=this.createCloseButton(this.obj.hamColour.closed);return i.addEventListener("click",function(){return e.toggleSideNav(i)}),o.addEventListener("click",function(){return e.toggleSideNav(i)}),r.appendChild(o),n.appendChild(r),n.appendChild(i),n}},{key:"items",value:function(t){this.masterEL=t.items.filter(function(t){return void 0!==t.link});var e=t.items.filter(function(t){return void 0===t.items}).map(function(t){return t.id});if(this.mappedIDS=e,this.item=t,this.res.children[0].appendChild(t.render()),void 0!==this.masterEL[0]){var n=this.masterEL[0].options.animation;if(n){var r,i=Rt(this.res.children[0].children);try{for(i.s();!(r=i.n()).done;){var o,a=Rt(r.value.children);try{for(a.s();!(o=a.n()).done;){var s=o.value;this.mappedIDS.includes(s.id)&&(n.op.closeOptions.delay=0,s.animate(n.op.keyframesClose,n.op.closeOptions))}}catch(t){a.e(t)}finally{a.f()}}}catch(t){i.e(t)}finally{i.f()}}}return this}},{key:"toCode",value:function(){var t="new SideNav().setup(".concat(this.formatObj(this.obj),")");if(this.item){var e=this.item.toCode?this.item.toCode().join(""):this.formatObj(this.item);e=e.replace(/,\s*(\.set\(|\.add\()/g,"\n $1"),t+=".items(".concat(e,")")}return t}},{key:"formatObj",value:function(t){return JSON.stringify(t,null,2).replace(/"(\w+)"\s*:/g,"$1:")}},{key:"render",value:function(t){return t&&document.querySelector(t).appendChild(this.res),this.res}}])&&Lt(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function Bt(t){return Bt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bt(t)}function Nt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Ht(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Gt(r.key),r)}}function Gt(t){var e=function(t){if("object"!=Bt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Bt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Bt(e)?e:e+""}function Ut(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ut=function(){return!!t})()}function qt(t){return qt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},qt(t)}function Jt(t,e){return Jt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Jt(t,e)}var Xt=function(){function t(){var e,n,r,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(n=this,r=t,r=qt(r),e=function(t,e){if(e&&("object"==Bt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(n,Ut()?Reflect.construct(r,i||[],qt(n).constructor):r.apply(n,i))).res=document.createElement("div"),e.res.style.display="grid",e.attributes={},e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Jt(t,e)}(t,W),e=t,n=[{key:"set",value:function(t){return this.options=t,this.attributes=t,this.templateCols=t.templateCols,t.templateCols&&(this.res.style.gridTemplateColumns="repeat(".concat(t.templateCols.cols,", 1fr)"),this.res.style.gridTemplateRows="repeat(".concat(t.templateCols.cols,", 1fr)")),this.res.style.height=t.height?t.height:"600px",t.positions&&(this.storedPositions=t.positions),this}},{key:"generateGridPositions",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:50,i=document.createElement("div");i.classList.add("container"),i.style.display="grid",i.style.gridTemplateColumns="repeat(".concat(r,", 1fr)"),i.style.gridTemplateRows="repeat(".concat(n,", 1fr)"),i.style.width="100%",i.style.height="100vh";var o=t.map(function(t,e){return{row:Math.floor(n/2)+e,col:Math.floor(r/2)+e}});return t.forEach(function(i,a){var s=o[a],l=s.row,c=s.col,u=function(e){var n=0,r=0;return t.forEach(function(t,i){var a=t.weight,s=t.direction,l=o[e],c=o[i],u=l.col-c.col,d=l.row-c.row,f=a*(1/(Math.sqrt(u*u+d*d)+1));switch(s){case"L":n-=f;break;case"R":n+=f;break;case"U":r-=f;break;case"B":r+=f}}),{forceX:n,forceY:r}}(a),d=u.forceX,f=u.forceY;c=Math.max(1,Math.min(r,c+Math.round(d))),l=Math.max(1,Math.min(n,l+Math.round(f)));var h=e.items.filter(function(t){return t.id===i.attract.slice(1)})[0].render();h.style.gridRowStart=l,h.style.gridColumnStart=c,h.style.display="flex",h.style.alignItems="center",h.style.justifyContent="center",h.style.fontWeight="bold",e.res.appendChild(h)}),this}},{key:"add",value:function(t){this.items=t;var e,n=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Nt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Nt(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;this.res.appendChild(r.render())}}catch(t){n.e(t)}finally{n.f()}return this.storedPositions&&this.generateGridPositions(this.storedPositions),this}},{key:"toCode",value:function(){if(this.excludeFromCodeTrue)return[""];var t=JSON.stringify(this.options,null,4).replace(/"([^"]+)":/g,"$1:"),e="";return e+=".add([\n",e+=this.items.map(function(t){return t.toCode().join("").trim()}).join(",\n"),e+="\n])",["new Free().set(".concat(t,")").concat(e)]}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}],n&&Ht(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function $t(t){return $t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$t(t)}function Vt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Yt(r.key),r)}}function Yt(t){var e=function(t){if("object"!=$t(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=$t(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==$t(e)?e:e+""}function Qt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Qt=function(){return!!t})()}function Kt(t){return Kt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Kt(t)}function Zt(t,e){return Zt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Zt(t,e)}var te=function(){function t(e){var n,r,i,o;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(r=this,i=t,i=Kt(i),n=function(t,e){if(e&&("object"==$t(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(r,Qt()?Reflect.construct(i,o||[],Kt(r).constructor):i.apply(r,o))).url=e,n.res=null,n.setup(),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Zt(t,e)}(t,W),e=t,(n=[{key:"setup",value:function(){this.res=document.createElement("audio"),this.res.setAttribute("src",this.url),this.res.setAttribute("controls","controls")}},{key:"size",value:function(t){return this.res.style.width=t,this}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}])&&Vt(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function ee(t){return ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ee(t)}function ne(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,re(r.key),r)}}function re(t){var e=function(t){if("object"!=ee(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ee(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ee(e)?e:e+""}function ie(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ie=function(){return!!t})()}function oe(){return oe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=ae(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},oe.apply(null,arguments)}function ae(t){return ae=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ae(t)}function se(t,e){return se=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},se(t,e)}var le=function(){function t(){var e,n,r,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(n=this,r=t,r=ae(r),e=function(t,e){if(e&&("object"==ee(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(n,ie()?Reflect.construct(r,i||[],ae(n).constructor):r.apply(n,i))).res=document.createElement("code"),e.pre=document.createElement("pre"),e.res.style.background="#18232e",e.res.style.display="block",e.res.style.width="auto",e.res.style.height="auto",e.res.style.borderRadius="1rem",e.pre.appendChild(e.res),e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&se(t,e)}(t,W),e=t,n=[{key:"getType",value:function(){return"LayoutWrapperElement"}},{key:"toCode",value:function(){var t=this.options;Object.keys(t).forEach(function(e){return void 0===t[e]&&delete t[e]});var e=JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:").replace(/"([^"]+)"/g,function(t,e){return e.includes("\n")||e.includes("'")||e.includes('"')?"`"+e.replace(/`/g,"\\`")+"`":'"'.concat(e,'"')});return"new Code().set(".concat(e,")")}},{key:"callReact",value:function(e){this.options=e;var n,r,i=[],o=e.transform&&"object"===ee(e.transform);if(e.stroke||e.gradient||e.span||e.backgroundOp||e.layout||e.shadow||e.animation||e.filtera||o){e.gradient&&(this.globalGradient=e.gradient.op.gradient,"radial"===e.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)")),e.stroke&&(n=this,"function"==typeof(r=oe(ae(t.prototype),"setAny",n))?function(t){return r.apply(n,t)}:r)([{globalBlast:"".concat(e.stroke.op.width," ").concat(e.stroke.op.color)}]),e.span&&(e.span.prevText=this.text);var a=[e.stroke,e.gradient,e.animation,e.span,e.backgroundOp,e.layout,e.marginOp,e.shadow,e.animation,e.filtera,o?e.transform:void 0];a=a.filter(function(t){return null!=t});for(var s=0;s<a.length;s++)i.push({range:a[s].range,log:a[s].op.name,target:a[s].target,op:a[s].op});var l=[];e.borderObj&&l.push("border"),e.background&&l.push("background"),e.mar&&l.push("margin"),e.animation&&l.push("animation"),e.span&&l.push("span"),this.chainReact(i,e.id,l)}}},{key:"set",value:function(t){return t.code&&(this.pre.children[0].innerHTML=t.code),t.class&&this.pre.children[0].setAttribute("class","".concat(t.class)),t.pad&&this.pad(t.pad),t.mar&&this.mar(t.mar),t.respad&&this.respad(t.respad),t.resmar&&this.resmar(t.resmar),t.resprop&&this.resprop(t.resprop),t.width&&(this.res.style.width=t.width),t.background&&(this.res.style.background=t.background),t.color&&(this.res.style.color=t.color),t.borderRadius&&(this.res.style.background=t.borderRadius),t.borderObj&&(this.res.style.border="".concat(t.borderObj.width," solid ").concat(t.borderObj.color),this.res.style.borderRadius="".concat(t.borderObj.radius)),this.callReact(t),this}},{key:"render",value:function(t){return t&&document.querySelector(t).appendChild(this.pre),this.res}}],n&&ne(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function ce(t){return ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ce(t)}function ue(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,de(r.key),r)}}function de(t){var e=function(t){if("object"!=ce(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ce(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ce(e)?e:e+""}var fe=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.res=null,this.st=e},(e=[{key:"setup",value:function(){var t=document.createElement("div");return t.style.display="grid",this.res=t,this.st&&this.sticky(),this}},{key:"set",value:function(t){return this.setup(),t.height&&(this.res.style.height=t.height),t.sticky&&this.sticky(),this}},{key:"sticky",value:function(){return this.res.style.position="sticky",this.res.style.top=0,this}},{key:"add",value:function(t){this.children=t;for(var e=0;e<t.length;e++){var n=t[e].render();n.style.gridColumn=1,n.style.gridRow=1,this.res.appendChild(n)}return this}},{key:"toCode",value:function(){var t="new Stack().set({})";if(this.children.length>0){var e=this.children.map(function(t){return t.toCode()}).join(",\n");t+=".add([\n \n ".concat(e," \n \n])")}return[t]}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector("body").style.margin=0,document.querySelector("body").style.padding=0,document.querySelector(t).appendChild(this.res)}}])&&ue(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function he(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=ye(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function pe(t){return pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pe(t)}function ye(t,e){if(t){if("string"==typeof t)return me(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?me(t,e):void 0}}function me(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function ve(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ge(r.key),r)}}function ge(t){var e=function(t){if("object"!=pe(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=pe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==pe(e)?e:e+""}function be(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(be=function(){return!!t})()}function we(){return we="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=xe(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},we.apply(null,arguments)}function xe(t){return xe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},xe(t)}function ke(t,e){return ke=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ke(t,e)}var Se=function(){function t(e){var n,r,i,o;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(r=this,i=t,i=xe(i),n=function(t,e){if(e&&("object"==pe(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(r,be()?Reflect.construct(i,o||[],xe(r).constructor):i.apply(r,o))).res=null,n.setup(e),n.code=[],n.isLast=!1,n.constrObj=e,n.code.push("\n new Wrapper() \n"),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ke(t,e)}(t,W),e=t,n=[{key:"isLasta",value:function(){return this.isLast=!0,this}},{key:"toCode",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.code=[],this.excludeFromCodeTrue)return[""];var n=" ".repeat(e),r="".concat(n,'new Wrapper("').concat(this.constrObj,'")');if(this.constrObj||(r="".concat(n,"new Wrapper()")),Object.keys(this.obj).length){var i=Object.fromEntries(Object.entries(this.obj).filter(function(t){var e,n,r=(n=2,function(t){if(Array.isArray(t))return t}(e=t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,n)||ye(e,n)||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.")}());return r[0],null!==r[1]})),o=JSON.stringify(i,null,2).replace(/"([^"]+)":/g,"$1:");r+="\n".concat(n," .set(").concat(o,")")}return null!==(t=this.items)&&void 0!==t&&t.length&&(r+="\n".concat(n," .add([\n")+this.items.map(function(t){return t.toCode(e+4)}).join(",\n")+"\n".concat(n," ])")),[r+="\n".concat(n)]}},{key:"getType",value:function(){return"LayoutWrapperElement"}},{key:"setArea",value:function(t){return this.res.style.gridArea=t,this}},{key:"removeQuotesFromFirstWord",value:function(t){return t.replace(/"([^"]+)":/g,"$1:")}},{key:"clicked",value:function(t){return this.res.addEventListener("click",t),this}},{key:"onTap",value:function(t){return this.res.addEventListener("click",t),this}},{key:"gpos",value:function(t){return this.res.style.gridColumn=t.col,this.res.style.gridRow=t.row,this}},{key:"set",value:function(e){this.obj=e,this.commonMethods(e),e.onTap&&this.onTap(e.onTap);var n=".set({";e.isHidden&&this.isHidden(e.isHidden),e.scale&&(this.res.style.scale=e.scale),e.scale&&(n+="scale: ".concat(e.scale)),e.keySet&&this.keySet(e.keySet),e.resprop&&this.resprop(e.resprop),e.position&&(this.res.style.position=e.position),void 0!==e.top&&(this.res.style.top=e.top),e.pad&&this.pad(e.pad),e.mar&&this.mar(e.mar),e.arrpad&&(n+="pad: {sides: [".concat(e.arrpad.sides.map(function(t){return'"'.concat(t,'"')}).join(", "),'], value: "').concat(e.arrpad.value,'"}, ')),e.gpos&&this.gpos(e.gpos);var r,i,o=[],a=e.transform&&"object"===pe(e.transform);if(e.stroke||e.gradient||e.span||e.backgroundOp||e.layout||e.shadow||e.animation||e.filtera||a){e.gradient&&(this.globalGradient=e.gradient.op.gradient,"radial"===e.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)")),e.stroke&&(r=this,"function"==typeof(i=we(xe(t.prototype),"setAny",r))?function(t){return i.apply(r,t)}:i)([{globalBlast:"".concat(e.stroke.op.width," ").concat(e.stroke.op.color)}]),e.span&&(e.span.prevText=this.text);var s=[e.stroke,e.gradient,e.animation,e.span,e.backgroundOp,e.layout,e.marginOp,e.shadow,e.animation,e.filtera,a?e.transform:void 0];s=s.filter(function(t){return null!=t});for(var l=0;l<s.length;l++)o.push({range:s[l].range,log:s[l].op.name,target:s[l].target,op:s[l].op});var c=[];e.borderObj&&c.push("border"),e.background&&c.push("background"),e.mar&&c.push("margin"),e.animation&&c.push("animation"),e.span&&c.push("span"),a&&c.push("transform"),e.gradient&&c.push("gradient"),e.blast,this.options=e,this.chainReact(o,this.options.id,c)}if(e.centerColumn&&(this.res.style.display="flex",this.res.style.flexDirection="column",this.res.style.alignItems="center",e.centerColumn&&(n+="centerColumn: ".concat(e.centerColumn,","))),e.mboth&&(this.res.style.marginRight="auto")&&(this.res.style.marginLeft="auto"),e.mar&&this.mar(e.mar),e.sticky&&this.sticky(),e.transition&&(this.res.style.transition=e.transition),e.class&&this.res.setAttribute("class",e.class),e.ga&&(this.res.style.gridArea=e.ga),e.opacity&&(0==e.opacity&&(this.res.style.opacity=0),e.opacity&&(this.res.style.opacity=e.opacity)),e.maxHeight&&(this.res.style.maxHeight=e.maxHeight),e.id&&this.res.setAttribute("id",e.id),e.arrpad&&this.arrayPadding(e.arrpad.sides,e.arrpad.value),e.arrpad&&(n+="arrpad: {sides: [".concat(e.arrpad.sides.map(function(t){return'"'.concat(t,'"')}).join(", "),'], value: "').concat(e.arrpad.value,'"}, ')),e.arrayMargin&&this.arrayMargin(e.arrayMargin.sides,e.arrayMargin.value),e.arrayMargin&&(n+='\n arrayMargin: {sides: ["'.concat(e.arrayMargin.sides,'"], value: "').concat(e.arrayMargin.value,'"},')),e.center&&this.toCenter(e.center),e.center&&(n+='center: "'.concat(e.center,'",')),e.simpleCenter&&this.simpleCenter(),e.simpleCenter&&(n+='center: "'.concat(e.simpleCenter,'",')),e.filter&&(this.res.style.backdropFilter="blur(3px)"),e.radius&&this.corner(e.radius),e.radius&&(n+='\n radius: "'.concat(e.radius,'",')),e.border&&this.border(e.border),e.simpleBorder&&(this.res.style.border=e.simpleBorder),e.width&&this.width(e.width),e.width&&(n+='\n width: "'.concat(e.width,'",')),e.overflow&&(n+='\n overflow: "'.concat(e.overflow,'",')),e.height&&this.heightNoAuto(e.height),e.height&&(n+='\n height: "'.concat(e.height,'",')),e.align&&this.flexAlign(e.align),e.align&&(n+='\n align: "'.concat(e.align,'",')),e.borderObj&&(this.res.style.border="".concat(e.borderObj.width," solid ").concat(e.borderObj.color),void 0!==e.borderObj.radius&&(this.res.style.borderRadius=e.borderObj.radius)),e.borderObja&&(this.res.style.border="".concat(e.borderObja.width," solid ").concat(e.borderObja.color),void 0!==e.borderObja.radius&&(this.res.style.borderRadius=e.borderObja.radius)),e.font&&this.font(e.font),e.font&&(n+='font: "'.concat(e.font,'",')),e.maxWidth&&this.maxWidth(e.maxWidth),e.flexCenter&&this.flexc(e.flexCenter),e.multipad&&this.makeMultiPad(e.multipad),e.multimargin&&this.makeMultiMargin(e.multimargin),e.color&&this.color(e.color),e.background&&this.background(e.background),e.background&&(n+='background: "'.concat(e.background,'",')),e.weight&&this.weight(e.weight),e.paddings&&this.paddingo(e.paddings),e.area&&this.setArea(e.area),e.area&&(n+='area: "'.concat(e.area,'"')),e.column&&this.makeCol(),e.column&&(n+='\n column: "'.concat(e.column,'",')),e.alignIts&&(this.res.style.background="gray"),e.alignIts&&(this.res.style.alignItems="flex-start"),e.alignIts&&(this.res.style.justifyItems="flex-start"),e.customAlign&&(this.res.style.alignItems=e.customAlign),e.customJustify&&(this.res.style.justifyItems=e.customJustify),e.disp&&(this.res.style.display=e.disp),e.flexDir&&(this.res.style.flexDirection=e.flexDir),e.flexDir&&(this.res.style.display="flex"),e.flexDir&&(n+='\n flexDir: "'.concat(e.flexDir,'",')),e.zIndex&&(this.res.style.zIndex=e.zIndex),e.transform&&"object"===pe(e.transform)&&this.reactOnTransform(e.transform),e.name&&(this.name=e.name),e.responsive&&this.rsp(e.responsive),e.stretch){e.stretch&&this.stretch(e.stretch);var u=this.removeQuotesFromFirstWord(JSON.stringify(e.stretch));n+="\n stretch: ".concat(u,",")}for(var d in e)if("margin"===d){var f=e[d];if(Array.isArray(f)&&f.length>0){var h,p=he(f);try{for(p.s();!(h=p.n()).done;){var y=h.value;y.hasOwnProperty("top")&&(this.res.style.marginTop=y.top),y.hasOwnProperty("right")&&(this.res.style.marginRight=y.right),y.hasOwnProperty("bottom")&&(this.res.style.marginBottom=y.bottom),y.hasOwnProperty("left")&&(this.res.style.marginLeft=y.left)}}catch(t){p.e(t)}finally{p.f()}}}return 8===(n+="})\n").length&&(n=""),this.code.push(n),this}},{key:"rsp",value:function(t){var e=this;this.res.style.display="flex";var n=t.sequence.split("-"),r=function(){var r=t.ranges;"0px"!==r[0]&&r.unshift("0px");for(var i=0;i<r.length-1;i++)(window.matchMedia("(min-width: ".concat(r[i],") and (max-width: ").concat(r[i+1],")")).matches||window.matchMedia("(min-width: ".concat(r[r.length-1],")")).matches)&&("row"===n[i]&&(e.res.style.flexDirection="row",e.res.style.border="3px solid green"),"col"===n[i]&&(e.res.style.flexDirection="column",e.res.style.border="3px solid purple"));return e};window.addEventListener("resize",r),r()}},{key:"sticky",value:function(){return this.res.style.position="sticky",this.res.style.top=0,this}},{key:"toSticky",value:function(){return this.res.style.position="sticky",this.res.style.top="0",this}},{key:"stretch",value:function(t){var e=this,n=function(){window.matchMedia("(max-width: ".concat(t.at,")")).matches?e.res.style.width="auto":window.matchMedia("(max-device-width: 415px)").matches?e.res.style.width="100%":e.res.style.width=t.backTo};n(),window.addEventListener("resize",n)}},{key:"makeCol",value:function(){return this.res.style.display="flex",this.res.style.flexDirection="column",this.res.style.alignItems="flex-start",this}},{key:"paddingo",value:function(t){return this.res.style.padding=t,this}},{key:"toCenter",value:function(t){return this.res.style.display="flex",this.res.style.flexDirection="column",this.res.style.justifyContent="center","both"===t&&(this.res.style.alignItems="center"),this}},{key:"simpleCenter",value:function(){return this.res.style.justifyContent="center",this.res.style.justifyItems="center",this.res.style.alignContent="center",this.res.style.alignItems="center",this}},{key:"color",value:function(t){return this.res.style.color=t,this}},{key:"weight",value:function(t){return this.res.style.fontWeight=t,this}},{key:"makeMultiPad",value:function(t){for(var e=0;e<t.length;e++)"left"===t[e].side&&(this.res.style.paddingLeft=t[e].value),"right"===t[e].side&&(this.res.style.paddingRight=t[e].value);return this}},{key:"makeMultiMargin",value:function(t){this.res.style.zIndex="1";for(var e=0;e<t.length;e++)"left"===t[e].side&&(this.res.style.marginLeft=t[e].value),"right"===t[e].side&&(this.res.style.marginRight=t[e].value),"top"===t[e].side&&(this.res.style.marginTop=t[e].value),"bottom"===t[e].side&&(this.res.style.marginBottom=t[e].value);return this}},{key:"flexc",value:function(t){return this.res.style.display="flex",this.res.style.flexDirection="column",this.res.style.justifyContent="center",this}},{key:"maxWidth",value:function(t){return this.res.style.maxWidth=t,this}},{key:"font",value:function(t){return this.res.style.fontFamily=t,this}},{key:"flexAlign",value:function(t){return this.res.style.display="flex",this.res.style.justifyContent="flex-start",this.res.style.alignItems="flex-start","center"===t?(this.res.style.display="flex",this.res.style.flexDirection="column",this.res.style.alignItems="center",this):this}},{key:"width",value:function(t){return this.res.style.width=t,this}},{key:"heightNoAuto",value:function(t){return this.res.style.height=t,this}},{key:"border",value:function(t){return this.res.style.borderRadius="".concat(t.radius,"px"),this.res.style.padding="0.25em",this.res.style.border="".concat(t.width,"px solid ").concat(t.color),this}},{key:"toCol",value:function(){return this.res.style.display="flex",this.res.style.flexDirection="column",this.res.style.justifyContent="center",this.res.style.alignItems="center",this}},{key:"add",value:function(t){this.items=t,this.code.push(".add([ \n");var e=t.map(function(e,n){return e.toCode().flatMap(function(t){return t}).join("")+(n<t.length-1?",":"")}).join("");this.code.push(e);for(var n=0;n<t.length;n++)if(void 0!==t[n]&&void 0!==t[n].toCode){var r=t[n].render();this.res.appendChild(r)}return this.code.push("])"),this}},{key:"arrayPadding",value:function(t,e){return t.includes("left")&&(this.res.style.paddingLeft=e),t.includes("right")&&(this.res.style.paddingRight=e),t.includes("top")&&(this.res.style.paddingTop=e),t.includes("bottom")&&(this.res.style.paddingBottom=e),this}},{key:"arrayMargin",value:function(t,e){return e||(this.res.style.marginLeft="".concat(t[0],"px"),this.res.style.marginTop="".concat(t[1],"px"),this.res.style.marginRight="".concat(t[2],"px"),this.res.style.marginBottom="".concat(t[3],"px")),t.includes("left")&&(this.res.style.marginLeft=e),t.includes("right")&&(this.res.style.marginRight=e),t.includes("top")&&(this.res.style.marginTop=e),t.includes("bottom")&&(this.res.style.marginBottom=e),this}},{key:"setWidth",value:function(t){this.res.style.width="100vw"}},{key:"setHeight",value:function(t){return this.res.style.height="".concat(t),this}},{key:"setup",value:function(t){var e=null;return t?(t.isLink&&(e=document.createElement("a")),"aside"===t&&(e=document.createElement("aside")),"article"===t&&(e=document.createElement("article")),"main"===t&&(e=document.createElement("main")),"section"===t&&(e=document.createElement("section")),"header"===t&&(e=document.createElement("header")),"footer"===t&&(e=document.createElement("footer"))):e=document.createElement("div"),t&&t.isLink&&(e.style.textDecoration="none",e.setAttribute("href",t.child)),this.res=e,this.res.style.margin=0,this.res.style.padding=0,t&&!0===t.hideOverflow&&(this.res.style.overflow="hidden",this.res.style.overflowY="scroll"),t&&!0===t.center&&(this.res.style.display="flex",this.res.style.flexDirection="column",this.res.style.justifyContent="center",this.res.style.alignItems="center"),t&&"left"===t.align&&(this.res.style.alignItems="flex-start"),t&&"right"===t.align&&(this.res.style.alignItems="flex-end"),t&&t.height&&(this.res.style.height=t.height),t&&t.width&&(this.res.style.width=t.width,this.res.style.marginLeft="auto",this.res.style.marginRight="auto",window.matchMedia("(max-device-width: 415px)").matches&&(this.res.style.width="95%")),this}},{key:"height",value:function(t){return this.res.style.width="auto",this.res.style.height="".concat(t),this}},{key:"size",value:function(t,e){return this.w=t,this.h=e,this.w?this.res.style.width=this.w:this.res.style.width=window.innerWidth,this.h?this.res.style.height=this.h:this.res.style.height=window.innerHeight,this}},{key:"background",value:function(t){return this.res.style.background=t,this}},{key:"corner",value:function(t){return this.res.style.borderRadius=t,this}},{key:"padding",value:function(t,e,n,r){return this.res.style.paddingLeft=t,this.res.style.paddingTop=e,this.res.style.paddingRight=n,this.res.style.paddingBottom=r,this}},{key:"margin",value:function(t,e,n,r){return this.res.style.marginLeft=t,this.res.style.marginTop=e,this.res.style.marginRight=n,this.res.style.marginBottom=r,this}},{key:"itemWidth",value:function(t){for(var e=0;e<this.res.childNodes.length;e++)this.res.childNodes[e].style.width=t;return this}},{key:"apply",value:function(t){var e=this,n=function(){for(var n=0;n<t.length;n++){var r=t[n],i=window.matchMedia("(max-width: ".concat(r.width,"px)"));r.device&&(i=window.matchMedia("(max-device-width: ".concat(r.width,"px)"))),i.matches&&Object.assign(e.res.style,r.styles)}},r=window.matchMedia("(max-width: ".concat(t[0].width,"px)"));return t[0].device&&(r=window.matchMedia("(max-device-width: ".concat(t[0].width,"px)"))),r.matches||Object.assign(this.res.style,t[0].styles),n(),window.addEventListener("resize",n),this}},{key:"mount",value:function(t){document.querySelector(t).appendChild(this.res)}},{key:"render",value:function(t){return t?(document.querySelector("#mount"),document.querySelector(t).appendChild(this.res),this):this.res}}],n&&ve(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function Oe(t){return Oe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oe(t)}function je(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Ce(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ce(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Ce(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Ee(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Te(r.key),r)}}function Te(t){var e=function(t){if("object"!=Oe(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Oe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Oe(e)?e:e+""}function _e(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_e=function(){return!!t})()}function Pe(){return Pe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Ae(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},Pe.apply(null,arguments)}function Ae(t){return Ae=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ae(t)}function Re(t,e){return Re=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Re(t,e)}var Me=function(){function t(){var e,n,r,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(n=this,r=t,r=Ae(r),e=function(t,e){if(e&&("object"==Oe(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(n,_e()?Reflect.construct(r,i||[],Ae(n).constructor):r.apply(n,i))).res=document.createElement("table"),e.res.style.borderCollapse="separate",e.res.style.borderSpacing="0",e.res.style.overflow="hidden",e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Re(t,e)}(t,W),e=t,n=[{key:"add",value:function(t){this.data=t,this.datas=t;var e=Object.keys(t[0]);return this.generateTable(this.res,t),this.generateTableHead(this.res,e),this}},{key:"style",value:function(t){return t.font&&(this.res.style.fontFamily=t.font),this}},{key:"getType",value:function(){return"LayoutWrapperElement"}},{key:"set",value:function(t){return t.cellPadding&&this.cellPadding(t.cellPadding),t.cellAlign&&this.cellAlign(t.cellAlign),t.style&&this.style(t.style),t.headStyle&&this.headStyle(t.headStyle),t.border&&this.border(t.border),t.center&&this.center(t.center),t.borderRadius&&this.borderRadius(t.borderRadius),t.gradient&&(this.res.style.background=t.gradient.op.gradient,this.res.style.backgroundClip="padding-box"),this.obj=t,this.options=t,this.callReact(t),this}},{key:"callReact",value:function(e){var n,r,i=[];if(e.stroke||e.gradient||e.span||e.backgroundOp||e.layout||e.shadow||e.animation||e.filtera||e.transform){e.gradient&&(this.globalGradient=e.gradient.op.gradient,"radial"===e.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)")),e.stroke&&(n=this,"function"==typeof(r=Pe(Ae(t.prototype),"setAny",n))?function(t){return r.apply(n,t)}:r)([{globalBlast:"".concat(e.stroke.op.width," ").concat(e.stroke.op.color)}]),e.span&&(e.span.prevText=this.text);var o=[e.stroke,e.gradient,e.animation,e.span,e.backgroundOp,e.layout,e.marginOp,e.shadow,e.animation,e.filtera,e.transform];o=o.filter(function(t){return null!=t});for(var a=0;a<o.length;a++)i.push({range:o[a].range,log:o[a].op.name,target:o[a].target,op:o[a].op});var s=[];e.borderObj&&s.push("border"),e.background&&s.push("background"),e.mar&&s.push("margin"),e.animation&&s.push("animation"),e.span&&s.push("span"),s.push("border"),this.chainReact(i,this.options.id,s)}}},{key:"toCode",value:function(){var t=JSON.stringify(this.data,null,2),e=JSON.stringify(this.obj,null,2);return t=t.replace(/"(\w+)"\s*:/g,"$1:"),e=e.replace(/"(\w+)"\s*:/g,"$1:"),["new Table()\n .add(".concat(t,")\n .set(").concat(e,")")]}},{key:"borderRadius",value:function(t){return this.res.style.borderRadius="".concat(4*t,"px"),this.res.style.overflow="hidden",this}},{key:"center",value:function(){return this.res.style.marginLeft="auto",this.res.style.marginRight="auto",this}},{key:"cellPadding",value:function(t){var e,n=je(this.res.rows);try{for(n.s();!(e=n.n()).done;){var r,i=je(e.value.cells);try{for(i.s();!(r=i.n()).done;)r.value.style.padding=t}catch(t){i.e(t)}finally{i.f()}}}catch(t){n.e(t)}finally{n.f()}return this}},{key:"cellAlign",value:function(t){var e,n=je(this.res.rows);try{for(n.s();!(e=n.n()).done;){var r,i=je(e.value.cells);try{for(i.s();!(r=i.n()).done;)r.value.style.textAlign=t}catch(t){i.e(t)}finally{i.f()}}}catch(t){n.e(t)}finally{n.f()}return this}},{key:"headStyle",value:function(t){var e=this.res.rows[0];return e&&(e.style.color=t.color,t.background&&(e.style.backgroundColor=t.background)),this}},{key:"border",value:function(t){var e;this.res.style.borderCollapse="separate",this.res.style.borderSpacing="0",this.res.style.border=t,this.res.style.borderRadius="12px";var n,r=je(this.res.rows);try{for(r.s();!(n=r.n()).done;){var i,o=je(n.value.cells);try{for(o.s();!(i=o.n()).done;)i.value.style.border="none"}catch(t){o.e(t)}finally{o.f()}}}catch(t){r.e(t)}finally{r.f()}for(var a=0;a<this.res.rows.length-1;a++){var s,l=je(this.res.rows[a].cells);try{for(l.s();!(s=l.n()).done;)s.value.style.borderBottom=t}catch(t){l.e(t)}finally{l.f()}}var c,u=(null===(e=this.res.rows[0])||void 0===e?void 0:e.cells.length)||0,d=je(this.res.rows);try{for(d.s();!(c=d.n()).done;)for(var f=c.value,h=0;h<u-1;h++)f.cells[h].style.borderRight=t}catch(t){d.e(t)}finally{d.f()}return this}},{key:"generateTableHead",value:function(t,e){var n,r=t.createTHead().insertRow(),i=je(e);try{for(i.s();!(n=i.n()).done;){var o=n.value,a=document.createElement("th");a.textContent=o,r.appendChild(a)}}catch(t){i.e(t)}finally{i.f()}}},{key:"generateTable",value:function(t,e){var n,r=je(e);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=t.insertRow();for(var a in i)o.insertCell().textContent=i[a]}}catch(t){r.e(t)}finally{r.f()}}},{key:"render",value:function(t){var e=document.createElement("div");if(e.style.overflowX="auto",e.appendChild(this.res),!t)return e;document.querySelector(t).appendChild(e)}}],n&&Ee(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function Le(t){return Le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Le(t)}function ze(t,e){if(t){if("string"==typeof t)return Ie(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ie(t,e):void 0}}function Ie(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Fe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,We(r.key),r)}}function We(t){var e=function(t){if("object"!=Le(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Le(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Le(e)?e:e+""}function De(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(De=function(){return!!t})()}function Be(t){return Be=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Be(t)}function Ne(t,e){return Ne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ne(t,e)}var He=function(){function t(){var e,n,r,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(n=this,r=t,r=Be(r),e=function(t,e){if(e&&("object"==Le(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(n,De()?Reflect.construct(r,i||[],Be(n).constructor):r.apply(n,i))).res=document.createElement("div"),e.res.style.position="relative",e.toggleWrap=document.createElement("div"),e.toggleWrap.style.zIndex=9999,e.toggleWrap.style.borderRadius="0.3rem",e.toggleWrap.style.cursor="pointer",e.toggleWrap.style.display="flex",e.toggleWrap.style.alignItems="center",e.toggleWrap.style.justifyContent="center",e.res.appendChild(e.toggleWrap),e.contentWrap=document.createElement("div"),e.contentWrap.style.position="fixed",e.contentWrap.style.background="#ecf0f1",e.contentWrap.style.borderRadius="0.3rem",e.contentWrap.style.boxShadow="0 2px 5px rgba(0, 0, 0, 0.15)",e.contentWrap.style.width="250px",e.contentWrap.style.display="none",e.contentWrap.style.zIndex=99999,document.addEventListener("DOMContentLoaded",function(){document.body.appendChild(e.contentWrap)}),document.body&&document.body.appendChild(e.contentWrap),e.styles={},e.children=[],e.isExpanded=!1,e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ne(t,e)}(t,W),e=t,n=[{key:"set",value:function(t){var e=this;this.options=t,t.title&&(this.toggleWrap.textContent=t.title),t.width&&(this.toggleWrap.style.width=t.width),t.contentWidth&&(this.contentWrap.style.width=t.contentWidth),t.background&&(this.contentWrap.style.backgroundColor=t.background),t.radius&&(this.contentWrap.style.borderRadius=t.radius);var n=function(){var t=e.toggleWrap.getBoundingClientRect(),n=e.contentWrap.style.display,r=e.contentWrap.style.visibility;"none"===n&&(e.contentWrap.style.visibility="hidden",e.contentWrap.style.display="block");var i=e.contentWrap.getBoundingClientRect();"none"===n&&(e.contentWrap.style.display=n,e.contentWrap.style.visibility=r||"");var o=window.innerWidth,a=t.left+t.width/2-i.width/2;a<8&&(a=8),a+i.width>o-8&&(a=o-8-i.width),a<8&&(a=8),e.contentWrap.style.top=t.bottom+4+"px",e.contentWrap.style.left=a+"px"};this._positionContent=n;var r=function(){"none"!==e.contentWrap.style.display&&n()};if(window.addEventListener("resize",r),window.addEventListener("scroll",r,!0),t.behaviour){var i=t.behaviour;if("mouseover"===i||"mouseenter"===i){var o,a=function(){clearTimeout(o),e.contentWrap.style.display="block",n()},s=function(){o=setTimeout(function(){e.contentWrap.style.display="none"},200)};this.toggleWrap.addEventListener("mouseenter",a),this.toggleWrap.addEventListener("mouseleave",s),this.contentWrap.addEventListener("mouseenter",a),this.contentWrap.addEventListener("mouseleave",s),this.toggleWrap.addEventListener("click",function(t){t.stopPropagation(),"block"===e.contentWrap.style.display?e.contentWrap.style.display="none":(e.contentWrap.style.display="block",n())}),document.addEventListener("click",function(t){"block"!==e.contentWrap.style.display||e.contentWrap.contains(t.target)||e.toggleWrap.contains(t.target)||(e.contentWrap.style.display="none")})}else"click"===i?this.res.addEventListener("click",function(){e.toggle(),"block"===e.contentWrap.style.display&&n()}):this.res.addEventListener(i,function(){e.contentWrap.style.display="block",n()})}else this.res.addEventListener("click",function(){e.toggle(),"block"===e.contentWrap.style.display&&n()});return t.mar&&this.mar(t.mar),t.pad&&this.pad(t.pad),t.respad&&this.respad(t.respad),t.resmar&&this.resmar(t.resmar),this}},{key:"add",value:function(t){var e,n,r=this;if(!Array.isArray(t))throw new Error("The 'add' method expects an array of children.");if(t.forEach(function(t,e){if(0!==e){if(!(t.res instanceof HTMLElement))throw new Error("Each child must have a valid 'element' property that is an HTMLElement.");r.contentWrap.appendChild(t.res)}}),!this.options||!this.options.title){var i=t[0];i&&i.res&&this.toggleWrap.appendChild(i.res)}return(e=this.children).push.apply(e,function(t){if(Array.isArray(t))return Ie(t)}(n=t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(n)||ze(n)||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.")}()),this}},{key:"toggle",value:function(){this.isExpanded=!this.isExpanded,this.contentWrap.style.display=this.isExpanded?"block":"none"}},{key:"toCode",value:function(){var t=this,e=this.options?Object.entries(this.options).map(function(t){var e,n,r=(n=2,function(t){if(Array.isArray(t))return t}(e=t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,n)||ze(e,n)||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.")}()),i=r[0],o=r[1];return"string"==typeof o?"".concat(i,': "').concat(o,'"'):"object"===Le(o)?"".concat(i,": ").concat(JSON.stringify(o)):"".concat(i,": ").concat(o)}).join(",\n "):"",n=this.children.map(function(e,n){return e.toCode().flatMap(function(t){return t}).join("")+(n<t.children.length-1?",":"")}).join("");return["new Dropdown().set({\n ".concat(e,"\n}).add([\n ").concat(n,"\n])")]}},{key:"render",value:function(t){return t&&document.querySelector(t).appendChild(this.res),this.res}}],n&&Fe(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function Ge(t){return Ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ge(t)}function Ue(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,qe(r.key),r)}}function qe(t){var e=function(t){if("object"!=Ge(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ge(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ge(e)?e:e+""}function Je(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Je=function(){return!!t})()}function Xe(t){return Xe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Xe(t)}function $e(t,e){return $e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},$e(t,e)}var Ve=function(){function t(e){var n,r,i,o;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(r=this,i=t,i=Xe(i),n=function(t,e){if(e&&("object"==Ge(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(r,Je()?Reflect.construct(i,o||[],Xe(r).constructor):i.apply(r,o))).text=e,n.res=null,n.valid=!1,n.setup(),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&$e(t,e)}(t,W),e=t,n=[{key:"setup",value:function(){var t=document.createElement("input");return this.res=t,this.res.style.padding=0,this.res.style.margin=0,this.res.style.padding=".4rem .75rem",this.res.style.fontSize="1rem",window.matchMedia("(max-device-width: 415px)").matches&&(this.res.style.width="100%"),this}},{key:"set",value:function(t){var e;return this.options=t,this.res.setAttribute("type",null!==(e=t.type)&&void 0!==e?e:"text"),t.placeholder&&(this.res.placeholder=t.placeholder),t.arrayPadding&&this.arrayPadding(t.arrayPadding.sides,t.arrayPadding.value),t.arrayMargin&&this.arrayMargin(t.arrayMargin.sides,t.arrayMargin.value),t.pad&&this.pad(t.pad),t.mar&&this.mar(t.mar),t.maxWidth&&(this.res.style.maxWidth=t.maxWidth),t.exact&&(this.res.style.fontSize=t.exact),t.radius&&this.round(t.radius),t.color&&(this.res.style.color=t.color),t.background&&(this.res.style.background=t.background),t.font&&(this.res.style.fontFamily=t.font),t.weight&&(this.res.style.fontWeight=t.weight),t.bold&&(this.res.style.fontWeight="bold"),t.theme&&this.theme(t.theme),this.commonMethods(t),this}},{key:"arrayPadding",value:function(t,e){return t.includes("left")&&(this.res.style.paddingLeft=e),t.includes("right")&&(this.res.style.paddingRight=e),t.includes("top")&&(this.res.style.paddingTop=e),t.includes("bottom")&&(this.res.style.paddingBottom=e),t.includes("all")&&(this.res.style.padding=e),this}},{key:"toCode",value:function(){var t=JSON.stringify(this.options,null,4);return["new TextField().set(".concat(t,")")]}},{key:"arrayMargin",value:function(t,e){return t.includes("left")&&(this.res.style.marginLeft=e),t.includes("right")&&(this.res.style.marginRight=e),t.includes("top")&&(this.res.style.marginTop=e),t.includes("bottom")&&(this.res.style.marginBottom=e),t.includes("all")&&(this.res.style.margin=e),this}},{key:"setValid",value:function(t,e){return this.res.style.border=t?"6px solid green":"6px solid red",0===e.length&&(this.res.style.border="none"),this}},{key:"auto",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.res.style.fontSize="3rem":t.res.style.fontSize="1rem"};return e(),window.addEventListener("resize",e),this}},{key:"listen",value:function(t){var e=this;return this.res.addEventListener("input",function(t){return e.process(t)}),this}},{key:"value",value:function(t){return this.res.setAttribute("value",t),this}},{key:"password",value:function(){return this.res.setAttribute("type","password"),this}},{key:"number",value:function(){return this.res.setAttribute("type","number"),this}},{key:"week",value:function(){return this.res.setAttribute("type","week"),this}},{key:"process",value:function(t){return this.res.value}},{key:"font",value:function(t){return this.res.style.fontFamily=t,this}},{key:"size",value:function(t){return this.res.style.fontSize=t,this}},{key:"em",value:function(t){return this.res.style.fontSize="".concat(t,"em"),this}},{key:"color",value:function(t){return this.res.style.color=t,this}},{key:"weight",value:function(t){return this.res.style.fontWeight=t,this}},{key:"bold",value:function(){return this.res.style.fontWeight="bold",this}},{key:"italic",value:function(){return this.res.style.fontStyle="italic",this}},{key:"padding",value:function(t,e,n,r){return t?this.res.style.padding="".concat(t,"px"):t&&e&&n&&r&&(this.res.style.paddingLeft=t,this.res.style.paddingTop=e,this.res.style.paddingRight=n,this.res.style.paddingBottom="".concat(r,"px")),this}},{key:"margin",value:function(t,e,n,r){return this.res.style.marginLeft=t,this.res.style.marginTop=e,this.res.style.marginLeft=n,this.res.style.marginBottom="".concat(r,"px"),this}},{key:"placeholder",value:function(t){return this.res.setAttribute("placeholder",t),this}},{key:"border",value:function(t,e){return this.res.style.border="".concat(e,"px solid ").concat(t),this}},{key:"width",value:function(t){return this.res.style.width=t,this}},{key:"round",value:function(t){return this.res.style.borderRadius="".concat(t,"px"),this}},{key:"onChange",value:function(t){var e=this;return this.res.value,this.res.addEventListener("input",function(n){t(e.res.value)}),this}},{key:"render",value:function(t){return t?(document.querySelector(t).appendChild(this.res),this.res):this.res}}],n&&Ue(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function Ye(t){return Ye="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ye(t)}function Qe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ke(r.key),r)}}function Ke(t){var e=function(t){if("object"!=Ye(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ye(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ye(e)?e:e+""}function Ze(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ze=function(){return!!t})()}function tn(t){return tn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},tn(t)}function en(t,e){return en=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},en(t,e)}var nn=function(){function t(){var e,n,r,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(n=this,r=t,r=tn(r),e=function(t,e){if(e&&("object"==Ye(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(n,Ze()?Reflect.construct(r,i||[],tn(n).constructor):r.apply(n,i))).navbar=document.createElement("nav"),e.navbar.classList.add("desktop-navbar"),e.navbarHeader=document.createElement("div"),e.navbarHeader.classList.add("navbar-header"),e.brand=document.createElement("div"),e.brand.classList.add("navbar-brand"),e.navContent=document.createElement("div"),e.navContent.classList.add("navbar-content"),e.navContent.style.width="100%",e.navContent.style.alignItems="center",e.navbarHeader.appendChild(e.brand),e.navbarHeader.appendChild(e.navContent),e.navbar.appendChild(e.navbarHeader),e.res=e.navbar,e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&en(t,e)}(t,W),e=t,(n=[{key:"set",value:function(t){return this.obj=t,this.setStyles(t),t.background&&(this.res.style.backgroundColor=t.background),t.brand&&this.setBrand(t.brand),t.radius&&(this.res.style.borderRadius=t.radius),t.pad&&this.pad(t.pad),t.respad&&this.respad(t.respad),t.resmar&&this.resmar(t.resmar),t.mar&&this.mar(t.mar),t.maxHeight&&(this.res.style.maxHeight=t.maxHeight),t.hamburgerColour&&(this.hamburgerColour=t.hamburgerColour),this}},{key:"setStyles",value:function(){var t;this.navbar.style.display="flex",this.navbar.style.flexDirection="column",this.navbar.style.padding="1rem",this.navbar.style.backgroundColor=null!==(t=this.obj.background)&&void 0!==t?t:"#333",this.navbarHeader.style.display="flex",this.navbarHeader.style.alignItems="center",this.navbarHeader.style.justifyContent="space-between",this.navbarHeader.style.width="100%",this.brand.style.fontSize="1.5rem",this.navContent.style.display="flex",this.navContent.style.gap="1rem"}},{key:"setBrand",value:function(t){return this.brand.innerHTML="",this.brand.appendChild(t),this}},{key:"add",value:function(t){this.items=t;for(var e=0;e<t.length;e++)t[e],this.navContent.appendChild(t[e].render());return this}},{key:"toCode",value:function(){var t=this.items.map(function(t){return t.toCode()}).flatMap(function(t){return t});return"new DesktopBar().set(".concat(this.removeQuotesFromFirstWord(JSON.stringify(this.obj)),").add([\n ").concat(t.join(","),"\n\n \n \n\n ])")}},{key:"render",value:function(t){return t&&document.querySelector(t).appendChild(this.navbar),this.navbar}}])&&Qe(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function rn(t){return rn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rn(t)}function on(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,an(r.key),r)}}function an(t){var e=function(t){if("object"!=rn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=rn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==rn(e)?e:e+""}function sn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(sn=function(){return!!t})()}function ln(){return ln="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=cn(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},ln.apply(null,arguments)}function cn(t){return cn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},cn(t)}function un(t,e){return un=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},un(t,e)}var dn=function(){function t(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,n=cn(n=t),function(t,e){if(e&&("object"==rn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(e,sn()?Reflect.construct(n,r||[],cn(e).constructor):n.apply(e,r));var e,n,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&un(t,e)}(t,W),e=t,n=[{key:"removeQuotesFromBoth",value:function(t){if(t)return t.replace(/"([^"]+)":\s*"([^"]+)"/g,"$1: $2")}},{key:"removeQuotesFromFirstWord",value:function(t){if(t)return t.replace(/"([^"]+)":/g,"$1:")}},{key:"toCode",value:function(){var t=this.items.map(function(t){return t.toCode()}).flatMap(function(t){return t}),e=(this.removeQuotesFromFirstWord(JSON.stringify(this.obj)),'\nbackground: "'.concat(this.obj.background,'",\nbrand: ').concat(this.obj.brand.toCode(),",\nmar: ").concat(JSON.stringify(this.obj.mar),",\npad: ").concat(JSON.stringify(this.obj.pad),",\nresmar: ").concat(JSON.stringify(this.obj.resmar),",\nrespad: ").concat(JSON.stringify(this.obj.respad),",\nradius: ").concat(JSON.stringify(this.obj.radius),",\n"));return"new MobileBar().set({".concat(e,"}).add([\n ").concat(t.join(","),"\n\n ])")}},{key:"set",value:function(e){return this.obj=e,this.obj=e,this.makeNavbar(e),e.mar&&(n=this,"function"==typeof(r=ln(cn(t.prototype),"mar",n))?function(t){return r.apply(n,t)}:r)([e.mar]),e.maxHeight&&(this.res.style.maxHeight=e.maxHeight),e.radius&&(this.res.style.borderRadius=e.radius),e.hamburgerColour&&(this.hamburgerColour=e.hamburgerColour),this.setStyles(e),this;var n,r}},{key:"makeNavbar",value:function(t){var e=this,n=t.brand;this.navbar=document.createElement("nav"),this.navbar.classList.add("mobile-navbar"),this.navbarHeader=document.createElement("div"),this.navbarHeader.classList.add("navbar-header"),this.brand=document.createElement("div"),this.brand.classList.add("navbar-brand"),t.brand&&"function"==typeof n.render&&(console.log("Appending brand:",n.render()),this.brand.appendChild(n.render())),this.toggleButton=document.createElement("button"),this.toggleButton.classList.add("navbar-toggle"),this.toggleButton.innerHTML="☰",this.navContent=document.createElement("div"),this.navContent.classList.add("navbar-content"),this.navbarHeader.appendChild(this.brand),this.navbarHeader.appendChild(this.toggleButton),this.navbar.appendChild(this.navbarHeader),this.navbar.appendChild(this.navContent),this.isMobileNavOpen=!1,this.toggleButton.addEventListener("click",function(){e.toggleMobileNav()}),this.res=this.navbar}},{key:"setStyles",value:function(t){var e,n;this.navbar.style.display="flex",this.navbar.style.flexDirection="column",this.navbar.style.padding="1rem",this.navbar.style.backgroundColor=null!==(e=t.background)&&void 0!==e?e:"orange",this.navbarHeader.style.display="flex",this.navbarHeader.style.alignItems="center",this.navbarHeader.style.justifyContent="space-between",this.navbarHeader.style.width="100%",this.brand.style.fontSize="1.5rem",this.toggleButton.style.background="none",this.toggleButton.style.border="none",this.toggleButton.style.color=null!==(n=this.hamburgerColour)&&void 0!==n?n:"#34495e",this.toggleButton.style.fontSize="1.5rem",this.toggleButton.style.cursor="pointer",this.navContent.style.display="none"}},{key:"add",value:function(t){this.items=t;for(var e=0;e<t.length;e++){var n=t[e];this.navContent.appendChild(n.render())}return this}},{key:"toggleMobileNav",value:function(){this.isMobileNavOpen=!this.isMobileNavOpen,this.navContent.style.display=this.isMobileNavOpen?"flex":"none",this.isMobileNavOpen?(this.navContent.style.flexDirection="column",this.navContent.style.gap="0.5rem",this.navContent.style.padding="1rem"):(this.navContent.style.flexDirection="",this.navContent.style.gap="",this.navContent.style.backgroundColor="",this.navContent.style.padding="")}},{key:"render",value:function(t){return t&&document.querySelector(t).appendChild(this.navbar),this.navbar}}],n&&on(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function fn(t){return fn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fn(t)}function hn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function pn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?hn(Object(n),!0).forEach(function(e){yn(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):hn(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function yn(t,e,n){return(e=vn(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function mn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,vn(r.key),r)}}function vn(t){var e=function(t){if("object"!=fn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=fn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==fn(e)?e:e+""}function gn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(gn=function(){return!!t})()}function bn(t){return bn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},bn(t)}function wn(t,e){return wn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},wn(t,e)}var xn=function(){function t(){var e,n,r,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(n=this,r=t,r=bn(r),e=function(t,e){if(e&&("object"==fn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(n,gn()?Reflect.construct(r,i||[],bn(n).constructor):r.apply(n,i))).breakpoints=[],e.container=null,e.currentView=null,e.internalDiv=null,e.resizeListener=null,e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&wn(t,e)}(t,W),e=t,n=[{key:"set",value:function(t){var e=t.breakpoints;if(this.options={breakpoints:e},!Array.isArray(e))throw new Error("Breakpoints should be an array of objects with 'at' and 'view' properties.");return this.breakpoints=e.map(function(t){if("string"!=typeof t.at||!(t.view.render()instanceof HTMLElement))throw new Error("Each breakpoint must have 'at' as a string and 'view' as an HTMLElement.");return pn(pn({},t),{},{at:parseInt(t.at,10)})}),this.breakpoints.sort(function(t,e){return t.at-e.at}),this}},{key:"toCode",value:function(){JSON.stringify(this.options.breakpoints.map(function(t){return t.view.toCode()}).flat(),null,4),JSON.stringify(this.options.breakpoints.map(function(t){return t.at}),null,4),JSON.stringify(this.options.breakpoints,null,4);for(var t="",e=0;e<this.options.breakpoints.length;e++)t+='{ at: "'.concat(this.options.breakpoints[e].at,'", view: ').concat(this.options.breakpoints[e].view.toCode()," }, \n");return["new Switcher().set({\n breakpoints: [\n ".concat(t,"\n ]\n })")]}},{key:"render",value:function(t){return this.internalDiv=document.createElement("div"),this.applyView(),this.resizeListener=this.applyView.bind(this),window.addEventListener("resize",this.resizeListener),void 0!==t&&document.querySelector(t).appendChild(this.internalDiv),this.internalDiv}},{key:"createRanges",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:99999,n=[],r=0;r<t.length;r++)n.push({from:t[r],to:r<t.length-1?t[r+1]-1:e});return n}},{key:"addRanges",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:99999;return t.map(function(t,r){var i=e[r],o=r<e.length-1?e[r+1]-1:n;return pn(pn({},t),{},{range:{from:i,to:o}})})}},{key:"applyView",value:function(){var t=this,e=(window.innerWidth,this.breakpoints.map(function(t){return t.at})),n=this.breakpoints.map(function(t){return t.at});this.createRanges(n),this.addRanges(this.breakpoints,e).forEach(function(e){var n="(min-width: ".concat(e.range.from,"px) and (max-width: ").concat(e.range.to,"px)");window.matchMedia(n).matches&&t.currentView!==e.view.render()&&(t.internalDiv.innerHTML="",t.internalDiv.appendChild(e.view.render()),t.currentView=e.view.render())})}},{key:"destroy",value:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null),this.internalDiv&&this.container&&this.container.removeChild(this.internalDiv),this.container=null,this.currentView=null,this.internalDiv=null}}],n&&mn(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function kn(t){return kn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kn(t)}function Sn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,On(r.key),r)}}function On(t){var e=function(t){if("object"!=kn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=kn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==kn(e)?e:e+""}var jn=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=document.createElement("div");return n.style.flex="1",this.res=n,this.res.setAttribute("class","innerHider"),this},(e=[{key:"toCode",value:function(){return["new Spacer(".concat(this.hide,")")]}},{key:"render",value:function(){return this.res}}])&&Sn(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Cn(t){return Cn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cn(t)}function En(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Tn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,_n(r.key),r)}}function _n(t){var e=function(t){if("object"!=Cn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Cn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Cn(e)?e:e+""}function Pn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Pn=function(){return!!t})()}function An(t){return An=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},An(t)}function Rn(t,e){return Rn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Rn(t,e)}var Mn=function(){function t(){var e,n,r,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(n=this,r=t,r=An(r),e=function(t,e){if(e&&("object"==Cn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(n,Pn()?Reflect.construct(r,i||[],An(n).constructor):r.apply(n,i))).el=null,e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Rn(t,e)}(t,W),e=t,n=[{key:"set",value:function(t){var e,n;this.options=t;var r=document.createElement("div");r.style.display="flex",r.style.alignItems="center";var i=document.createElement("input");i.type="checkbox",i.style.position="relative",i.style.marginRight="0.5rem";var o=t.size||"24px";i.style.width=o,i.style.height=o,t.customStyle&&(i.style.appearance="none"),i.style.border="2px solid #ccc",i.style.borderRadius="4px",i.style.backgroundColor=t.backgroundColor||"white",i.style.cursor="pointer",i.style.transition="background-color 0.2s ease, border-color 0.2s ease",i.style.display="inline-block",i.style.setProperty("--checked-bg-color",t.checkedBackgroundColor||"#4CAF50"),i.style.setProperty("--checkmark-color","white"),i.style.setProperty("--checkmark-clip-path",null!==(e=this.options.clipPath)&&void 0!==e?e:"polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%)");var a=document.createElement("style");a.textContent='\n input[type="checkbox"] {\n appearance: none;\n -webkit-appearance: none; /* For Safari */\n width: var(--size, 24px);\n height: var(--size, 24px);\n border: 2px solid #ccc;\n border-radius: 4px;\n background-color: white;\n position: relative;\n cursor: pointer;\n transition: background-color 0.2s ease, border-color 0.2s ease;\n }\n\n input[type="checkbox"]:checked {\n background-color: var(--checked-bg-color, #4CAF50);\n border-color: var(--checked-bg-color, #4CAF50);\n }\n\n input[type="checkbox"]::after {\n content: \'\';\n position: absolute;\n width: 50%;\n height: 50%;\n top: 25%;\n left: 25%;\n transform: scale(0);\n background-color: var(--checkmark-color, white);\n clip-path: var(--checkmark-clip-path);\n -webkit-clip-path: var(--checkmark-clip-path);\n transition: transform 0.2s ease;\n }\n\n input[type="checkbox"]:checked::after {\n transform: scale(1);\n }\n',t.customStyle&&document.head.appendChild(a),t.mar&&this.mar(t.mar),t.pad&&this.pad(t.pad),t.respad&&this.respad(t.respad),t.resmar&&this.resmar(t.resmar),i.addEventListener("change",function(){i.checked?(i.style.backgroundColor=t.checkedBackgroundColor||"#4CAF50",i.style.borderColor=t.checkedBackgroundColor||"#4CAF50"):(i.style.backgroundColor=t.backgroundColor||"white",i.style.borderColor="#ccc")}),t.name&&i.setAttribute("name",t.name),r.appendChild(i);var s=document.createElement("div");if("function"==typeof(null===(n=t.label)||void 0===n?void 0:n.render))s.appendChild(t.label.render());else{var l=document.createTextNode(t.title||"Label");s.appendChild(l)}return s.style.opacity=.8,s.style.transition="opacity ease 0.2s, transform ease 0.2s",r.appendChild(s),this.el=r,this}},{key:"getValue",value:function(){return this.el.children[0].checked}},{key:"toCode",value:function(){var t=Object.entries(this.options).map(function(t){var e,n,r=(n=2,function(t){if(Array.isArray(t))return t}(e=t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,n)||function(t,e){if(t){if("string"==typeof t)return En(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?En(t,e):void 0}}(e,n)||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.")}()),i=r[0],o=r[1];return"string"==typeof o?"".concat(i,': "').concat(o,'"'):"object"===Cn(o)&&null!==o?"function"==typeof o.toCode?"".concat(i,": ").concat(o.toCode()[0]):"".concat(i,": ").concat(JSON.stringify(o,null,4)):"".concat(i,": ").concat(o)}).join(",\n ");return["new Checkbox().set({\n ".concat(t,"\n})")]}},{key:"margin",value:function(t){return this.el.style.margin=t,this}},{key:"render",value:function(t){if(!t)return this.el;document.querySelector(t).appendChild(this.el)}}],n&&Tn(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function Ln(t){return Ln="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ln(t)}function zn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,In(r.key),r)}}function In(t){var e=function(t){if("object"!=Ln(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ln(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ln(e)?e:e+""}function Fn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Fn=function(){return!!t})()}function Wn(t){return Wn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Wn(t)}function Dn(t,e){return Dn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Dn(t,e)}window.Checkbox=Mn;var Bn=function(){function t(e){var n,r,i,o;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(r=this,i=t,i=Wn(i),n=function(t,e){if(e&&("object"==Ln(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(r,Fn()?Reflect.construct(i,o||[],Wn(r).constructor):i.apply(r,o))).url=e,n.res=null,n.setup(),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Dn(t,e)}(t,W),e=t,(n=[{key:"setup",value:function(){this.res=document.createElement("video"),this.res.setAttribute("src",this.url),this.res.setAttribute("controls","controls")}},{key:"set",value:function(t){return this.options=t,t.radius&&(this.res.style.borderRadius=t.radius),t.width&&(this.res.style.width="".concat(t.width)),t.opacity&&(this.res.style.opacity=t.opacity),this}},{key:"size",value:function(t){return this.res.style.width=t,this}},{key:"toCode",value:function(){var t=JSON.stringify(this.options,null,4);return['new Video("'.concat(this.url,'").set(').concat(t,")")]}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}])&&zn(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function Nn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Hn(t){return Hn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hn(t)}function Gn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Un(r.key),r)}}function Un(t){var e=function(t){if("object"!=Hn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Hn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Hn(e)?e:e+""}function qn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(qn=function(){return!!t})()}function Jn(){return Jn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Xn(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},Jn.apply(null,arguments)}function Xn(t){return Xn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Xn(t)}function $n(t,e){return $n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},$n(t,e)}var Vn=function(){function t(){var e,n,r,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(n=this,r=t,r=Xn(r),e=function(t,e){if(e&&("object"==Hn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(n,qn()?Reflect.construct(r,i||[],Xn(n).constructor):r.apply(n,i))).res=null,e.items=[],e.setup(),e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&$n(t,e)}(t,W),e=t,n=[{key:"set",value:function(t){return this.options=t,t.pad&&this.pad(t.pad),t.mar&&this.mar(t.mar),this.commonMethods(t),this.callReact(t),this}},{key:"callReact",value:function(e){var n,r,i=[],o=e.transform&&"object"===Hn(e.transform);if(e.stroke||e.gradient||e.span||e.backgroundOp||e.layout||e.shadow||e.animation||e.filtera||o){e.gradient&&(this.globalGradient=e.gradient.op.gradient,"radial"===e.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)")),e.stroke&&(n=this,"function"==typeof(r=Jn(Xn(t.prototype),"setAny",n))?function(t){return r.apply(n,t)}:r)([{globalBlast:"".concat(e.stroke.op.width," ").concat(e.stroke.op.color)}]),e.span&&(e.span.prevText=this.text);var a=[e.stroke,e.gradient,e.animation,e.span,e.backgroundOp,e.layout,e.marginOp,e.shadow,e.animation,e.filtera,o?e.transform:void 0];a=a.filter(function(t){return null!=t});for(var s=0;s<a.length;s++)i.push({range:a[s].range,log:a[s].op.name,target:a[s].target,op:a[s].op});var l=[];e.borderObj&&l.push("border"),e.background&&l.push("background"),e.mar&&l.push("margin"),e.animation&&l.push("animation"),e.span&&l.push("span"),this.chainReact(i,this.options.id,l)}}},{key:"setup",value:function(){var t=document.createElement("ul");return this.res=t,this.res.style.padding=0,this.res.style.margin=0,this}},{key:"setItems",value:function(t){this.items=t;var e,n=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Nn(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Nn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;if("string"==typeof r){var i=document.createElement("li");i.textContent=r,this.res.appendChild(i)}else{var o=r.render();this.res.appendChild(o)}}}catch(t){n.e(t)}finally{n.f()}return this}},{key:"font",value:function(t){return this.res.style.fontFamily=t,this}},{key:"size",value:function(t){return this.res.style.fontSize=t,this}},{key:"em",value:function(t){return this.res.style.fontSize="".concat(t,"em"),this}},{key:"color",value:function(t){return this.res.style.color=t,this}},{key:"align",value:function(t){return this.res.style.textAlign="".concat(t),this}},{key:"weight",value:function(t){return this.res.style.fontWeight=t,this}},{key:"bold",value:function(){return this.res.style.fontWeight="bold",this}},{key:"italic",value:function(){return this.res.style.fontStyle="italic",this}},{key:"margin",value:function(t){return this.res.style.margin=t,this}},{key:"border",value:function(t,e){return this.res.style.border="".concat(t,"px solid ").concat(e),this}},{key:"padding",value:function(t,e,n,r){return this.res.style.paddingTop=t,this.res.style.paddingLeft=e,this.res.style.paddingRight=n,this.res.style.paddingBottom=r,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.res.style.color="#3498db",this}},{key:"toCode",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.code=[],this.excludeFromCodeTrue)return[""];var e=" ".repeat(t),n="".concat(e,"new UList()");return this.items&&this.items.length&&(n+="\n".concat(e," .setItems([\n")+this.items.map(function(e){return"string"==typeof e?"".concat(" ".repeat(t+4),'"').concat(e,'"'):e.toCode(t+4)}).join(",\n")+"\n".concat(e," ])")),[n+="\n".concat(e)]}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}],n&&Gn(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function Yn(t){return Yn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yn(t)}function Qn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Kn(r.key),r)}}function Kn(t){var e=function(t){if("object"!=Yn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Yn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Yn(e)?e:e+""}function Zn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Zn=function(){return!!t})()}function tr(t){return tr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},tr(t)}function er(t,e){return er=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},er(t,e)}var nr=function(){function t(e,n){var r,i,o,a;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(i=this,o=t,o=tr(o),r=function(t,e){if(e&&("object"==Yn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(i,Zn()?Reflect.construct(o,a||[],tr(i).constructor):o.apply(i,a))).text=e,r.res=null,r.val=n,r.setup(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&er(t,e)}(t,W),e=t,n=[{key:"setup",value:function(t){return this}},{key:"set",value:function(t){this.options=t;var e=document.createElement("button");if(e.style.background="transparent",e.style.border="none",t.img)e.append(t.img.render());else if(t.svg)if("string"==typeof t.svg){var n=(new DOMParser).parseFromString(t.svg,"image/svg+xml").documentElement;e.appendChild(n)}else t.svg instanceof SVGElement&&e.appendChild(t.svg);else if(t.url&&!t.img){var r,i,o=document.createElement("img");o.setAttribute("src",t.url),o.style.width=(null===(r=t.frame)||void 0===r?void 0:r.width)||"50px",o.style.height=(null===(i=t.frame)||void 0===i?void 0:i.height)||"50px",e.appendChild(o)}else{var a=document.createTextNode(this.text.replace("$",this.val));e.appendChild(a)}return this.res=e,this.commonMethods(t),t&&"submit"===t.type&&e.setAttribute("type",t.type),this.border("none"),this.res.style.display="block",t.background&&this.background(t.background),t.padding&&this.padding(t.padding),t.margin&&this.margin(t.margin),t.respad&&this.respad(t.respad),t.resmar&&this.resmar(t.resmar),t.centered&&(this.res.style.marginRight="auto",this.res.style.marginLeft="auto",this.res.style.backgroundColor="black"),t.border&&this.border(t.border),t.radius&&this.borderRadius(t.radius),t.class&&this.setClass(t.class),t.color&&this.color(t.color),t.auto&&this.auto(),t.weight&&(this.res.style.fontWeight=t.weight),t.fluidc&&this.fluidButtonCopy(t.fluidc),t.fluidc&&'\n fluidc: "'.concat(t.fluidc,'",'),t.onTap&&this.onTap(t.onTap),t.frame&&this.frame(t.frame),t.frame&&'\n frame: "'.concat(t.frame,'",'),t.arrpad&&this.arrayPadding(t.arrpad.sides,t.arrpad.value),t.arrpad&&'\n arrpad: {sides: ["'.concat(t.arrpad.sides,'"], value: "').concat(t.arrpad.value,'"},'),t.arrayMargin&&this.arrayMargin(t.arrayMargin.sides,t.arrayMargin.value),t.arrayMargin&&'\n arrayMargin: {sides: ["'.concat(t.arrayMargin.sides,'"], value: "').concat(t.arrayMargin.value,'"},'),t.keySet&&this.keySet(t.keySet),t.align&&(this.res.style.textAlign=t.align),t.weight&&(this.res.style.fontWeight=t.weight),t.bold&&(this.res.style.fontWeight="bold"),t.width&&(this.res.style.width=t.width),t.exact&&(this.res.style.fontSize=t.exact),this}},{key:"arrayPadding",value:function(t,e){return t.includes("left")&&(this.res.style.paddingLeft=e),t.includes("right")&&(this.res.style.paddingRight=e),t.includes("top")&&(this.res.style.paddingTop=e),t.includes("bottom")&&(this.res.style.paddingBottom=e),t.includes("all")&&(this.res.style.padding=e),e||(this.res.style.paddingBottom=t),this}},{key:"arrayMargin",value:function(t,e){return e||(this.res.style.marginLeft="".concat(t[0],"px"),this.res.style.marginTop="".concat(t[1],"px"),this.res.style.marginRight="".concat(t[2],"px"),this.res.style.marginBottom="".concat(t[3],"px")),t.includes("left")&&(this.res.style.marginLeft=e),t.includes("right")&&(this.res.style.marginRight=e),t.includes("top")&&(this.res.style.marginTop=e),t.includes("bottom")&&(this.res.style.marginBottom=e),t.includes("all")&&(this.res.style.margin=e),e||(this.res.style.marginBottom=t),this}},{key:"fluidButtonCopy",value:function(t){if(t instanceof Object){this.prevStylex=this.res.style,this.res=document.createElement("button"),this.res.style.cssText=this.prevStylex.cssText;var e=document.createTextNode(this.text);return this.res.appendChild(e),this.res.style.fontSize=t.exact,this}if("S1"===t){this.prevStylex=this.res.style,this.res=document.createElement("button"),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"===t){this.prevStylex=this.res.style,this.res=document.createElement("button"),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"===t){this.prevStylex=this.res.style,this.res=document.createElement("button"),this.res.style.cssText=this.prevStylex.cssText;var i=document.createTextNode(this.text);this.res.appendChild(i),this.res.style.fontSize="calc(1.375rem + 3.525vw)"}if("S4"===t){this.prevStylex=this.res.style,this.res=document.createElement("button"),this.res.style.cssText=this.prevStylex.cssText;var o=document.createTextNode(this.text);this.res.appendChild(o),this.res.style.fontSize="calc(1.250rem + 2.75vw)"}if("S5"===t){this.prevStylex=this.res.style,this.res=document.createElement("button"),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"===t&&(this.res.style.fontSize="calc(1rem + 0.5vw)"),this}},{key:"setClass",value:function(t){return this.res.setAttribute("class",t),this}},{key:"color",value:function(t){return this.res.style.color=t,this}},{key:"background",value:function(t){return this.res.style.background=t,this}},{key:"width",value:function(t){return this.res.style.width=t,this}},{key:"borderRadius",value:function(t){return this.res.style.borderRadius=t,this}},{key:"padding",value:function(t,e,n,r){return t&&e&&n&&r?(this.res.style.paddingLeft=t,this.res.style.paddingTop=e,this.res.style.paddingRight=n,this.res.style.paddingBottom=r):this.res.style.padding=t,this}},{key:"margin",value:function(t,e,n,r){return t&&e&&n&&r?(this.res.style.marginLeft=t,this.res.style.marginTop=e,this.res.style.marginRight=n,this.res.style.marginBottom=r):this.res.style.margin=t,this}},{key:"auto",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.res.style.fontSize="2.2rem":t.res.style.fontSize="1rem"};return e(),window.addEventListener("resize",e),this}},{key:"large",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.res.style.fontSize="6rem":t.res.style.fontSize="3rem"};return e(),window.addEventListener("resize",e),this}},{key:"border",value:function(t,e){return"none"===t&&(this.res.style.border="none"),this.res.style.border="".concat(t," solid ").concat(e,"px"),this}},{key:"frame",value:function(t){return this.res.style.width=t.width,this.res.style.height=t.height,this}},{key:"updating",value:function(t,e){var n=this.res,r=this.text;return Object.defineProperty(t,e,{set:function(t){var e=document.createTextNode(r.replace("$",t));n.replaceChild(e,n.childNodes[0])}}),this}},{key:"onTap",value:function(t){return this.res.addEventListener("click",t),this}},{key:"toCode",value:function(){var t=JSON.stringify(this.options,function(t,e){return"function"==typeof e?e.toString():e},4).replace(/"(\w+)":/g,"$1:").replace(/"(\(\)\s*=>\s*{[^}]*})"/g,"$1").replace(/\\n/g,"").replace(/\\"/g,'"');return['new Button("'.concat(this.text,'").set(').concat(t,")")]}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}],n&&Qn(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function rr(t){return rr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rr(t)}function ir(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,or(r.key),r)}}function or(t){var e=function(t){if("object"!=rr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=rr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==rr(e)?e:e+""}function ar(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ar=function(){return!!t})()}function sr(t){return sr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},sr(t)}function lr(t,e){return lr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},lr(t,e)}var cr=function(){function t(){var e,n,r,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(n=this,r=t,r=sr(r),e=function(t,e){if(e&&("object"==rr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(n,ar()?Reflect.construct(r,i||[],sr(n).constructor):r.apply(n,i))).el=null,e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&lr(t,e)}(t,W),e=t,(n=[{key:"set",value:function(t){this.options=t;var e=document.createElement("div"),n=document.createElement("label");n.style.position="relative",n.style.display="block";var r=document.createTextNode(t.title);n.appendChild(r),n.style.opacity=0;var i=document.createElement("input");return"textarea"===t.type&&(i=document.createElement("textarea")),i.style.position="relative",i.placeholder=t.title,i.style.fontSize="1rem",i.style.padding=".4rem .75rem",e.appendChild(n),e.appendChild(i),this.res=e,t.mar&&this.mar(t.mar),t.pad&&this.pad(t.pad),i.addEventListener("focus",function(){n.style.transition="transform ease 0.2s",n.style.transform="scale(0.80)",n.style.textTransform="uppercase",n.style.transformOrigin="left top",n.style.fontWeight="bold",i.placeholder="",n.style.opacity="1.0",t.font&&(n.style.fontFamily=t.font),t.color&&(n.style.color=t.color),t.exact&&(n.style.fontSize=t.exact)}),i.addEventListener("focusout",function(){n.style.transform="scale(1.0)",i.placeholder=t.title,n.style.opacity="0.0"}),t.name&&i.setAttribute("name",t.name),window.matchMedia("(max-device-width: 415px)").matches&&(i.style.width="100%",e.style.width="100%"),i.style.fontSize="1rem",this.el=e,this}},{key:"getValue",value:function(){return this.el.children[1].value}},{key:"toCode",value:function(){var t=JSON.stringify(this.options,null,4);return t=t.replace(/"(\w+)"(?=\s*:)/g,"$1"),["new FloatingInput().set(".concat(t,")")]}},{key:"margin",value:function(t){return this.el.style.margin=t,this}},{key:"render",value:function(t){if(!t)return this.el;document.querySelector(t).appendChild(this.el)}}])&&ir(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function ur(t){return ur="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ur(t)}function dr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,fr(r.key),r)}}function fr(t){var e=function(t){if("object"!=ur(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ur(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ur(e)?e:e+""}window.FloatingInput=cr;var hr=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.el=null,this.minLabel=null,this.maxLabel=null,this.currentLabel=null},(e=[{key:"padding",value:function(t){return this.el.style.padding=t,this}},{key:"toCode",value:function(){var t=JSON.stringify(this.options,null,4);return["new Range().set(".concat(t,")")]}},{key:"set",value:function(t){var e,n,r=this;this.options=t;var i=document.createElement("input");if(i.setAttribute("id","slider"),i.setAttribute("type","range"),i.setAttribute("min",t.min),i.setAttribute("max",t.max),i.setAttribute("value",t.min),i.style.width=null!==(e=t.width)&&void 0!==e?e:"100%",!t.plain){var o,a;i.style.setProperty("-webkit-appearance","none"),i.style.appearance="none",i.style.height="9px",i.style.background=null!==(o=t.style.trackColor)&&void 0!==o?o:"orange",i.style.borderRadius="5px";var s="\n #slider::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 25px;\n height: 25px;\n border-radius: 50%;\n background: ".concat(null!==(a=t.style.thumbColor)&&void 0!==a?a:"4CAF50",";\n cursor: pointer;\n }\n "),l=document.createElement("style");l.appendChild(document.createTextNode(s)),document.head.appendChild(l)}var c=document.createElement("div");c.style.display="flex",c.style.flexDirection="column",c.style.alignItems="center",c.style.width="100%";var u=document.createElement("div");if(u.style.display="flex",u.style.justifyContent="space-between",u.style.width=null!==(n=t.width)&&void 0!==n?n:"100%",this.minLabel=document.createElement("span"),this.minLabel.textContent=t.min,this.maxLabel=document.createElement("span"),this.maxLabel.textContent=t.max,this.currentLabel=document.createElement("span"),this.currentLabel.textContent=i.value,t.font&&(this.currentLabel.style.fontFamily=t.font),t.font&&(this.minLabel.style.fontFamily=t.font),t.font&&(this.maxLabel.style.fontFamily=t.font),t.plain||(u.appendChild(this.minLabel),u.appendChild(this.currentLabel),u.appendChild(this.maxLabel)),i.addEventListener("input",function(){r.currentLabel.textContent=i.value}),window.matchMedia("(max-device-width: 415px)").matches)if(t.plain)i.style.width="80%";else{var d,f;i.style.height="20px",i.style.background=null!==(d=t.style.trackColor)&&void 0!==d?d:"1abc9C",i.style.borderRadius="10px",i.style.fontSize="3rem",i.style.width="80%";var h="\n #slider::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 25px;\n height: 25px;\n border-radius: 50%;\n background: ".concat(null!==(f=t.style.thumbColor)&&void 0!==f?f:"blue",";\n cursor: pointer;\n }\n "),p=document.createElement("style");p.appendChild(document.createTextNode(h)),document.head.appendChild(p)}return c.appendChild(u),c.appendChild(i),this.el=c,this}},{key:"value",value:function(){return this.el.querySelector("#slider").value}},{key:"render",value:function(t){if(!t)return this.el;document.querySelector(t).appendChild(this.el)}}])&&dr(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function pr(t){return pr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pr(t)}function yr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,mr(r.key),r)}}function mr(t){var e=function(t){if("object"!=pr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=pr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==pr(e)?e:e+""}window.Range=hr;var vr=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.el=null,this.radioCount=0},(e=[{key:"set",value:function(t){this.options=t,this.radioCount=t.items.length;for(var e=document.createElement("div"),n=t.items,r=0;r<n.length;r++){var i=document.createElement("label");n.font&&(i.style.font=n.font),n.color&&(i.style.color=n.color),n.exact&&(i.style.fontSize=n.exact);var o=document.createTextNode(n[r]);i.appendChild(o),i.setAttribute("for",n[r]);var a=document.createElement("input");a.setAttribute("type","radio"),a.setAttribute("id","S".concat(r)),a.setAttribute("value",n[r].split(" ").join("")),a.style.appearance="none",a.style.width="20px",a.style.height="20px",a.style.border=this.options.tint?"2px solid ".concat(this.options.tint):"2px solid #007BFF",a.style.borderRadius="50%",a.style.outline="none",a.style.cursor="pointer",a.style.transition="0.3s",this.options.font&&(i.style.fontFamily=this.options.font),t.multiple?a.setAttribute("name",n[r].split(" ").join("")):a.setAttribute("name",t.name),e.appendChild(a),e.appendChild(i),e.innerHTML+="</br>"}return this.el=e,this.responsive(),this}},{key:"padding",value:function(t){return this.el.style.padding=t,this}},{key:"getCheckedValues",value:function(){for(var t=[],e=0;e<this.radioCount;e++)if(document.querySelector("#S".concat(e)).checked){var n=document.querySelector("#S".concat(e));t.push(n.value)}return t}},{key:"toCode",value:function(){var t=JSON.stringify(this.options,null,4);return t=t.replace(/"(\w+)"(?=\s*:)/g,"$1"),["new RadioGroup().set(".concat(t,")")]}},{key:"responsive",value:function(){return window.matchMedia("(max-device-width: 415px)").matches&&(this.el.style.fontSize="1.7em"),this}},{key:"render",value:function(t){var e=this;if(!t){for(var n=function(){var t=e.el.children[r];"[object HTMLInputElement]"===t.toString()&&t.addEventListener("change",function(){if(t.checked){t.style.backgroundColor=e.options.tint?e.options.tint:"#007BFF",t.style.boxShadow=e.options.tint?"0 0 0 2px ".concat(e.options.tint," inset"):"0 0 0 2px #0056b3 inset";for(var n=0;n<e.el.children.length;n++){var r=e.el.children[n];"INPUT"===r.tagName&&"radio"===r.type&&!1===e.options.multiple&&r!==t&&(r.style.backgroundColor="transparent",r.style.boxShadow="none")}}else t.style.backgroundColor="transparent",t.style.boxShadow="none"})},r=0;r<this.el.children.length;r++)n();return this.el}document.querySelector(t).appendChild(this.el)}}])&&yr(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function gr(t){return gr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gr(t)}function br(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,wr(r.key),r)}}function wr(t){var e=function(t){if("object"!=gr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=gr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==gr(e)?e:e+""}function xr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(xr=function(){return!!t})()}function kr(t){return kr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},kr(t)}function Sr(t,e){return Sr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Sr(t,e)}window.RadioGroup=vr;var Or=function(){function t(){var e,n,r,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(n=this,r=t,r=kr(r),e=function(t,e){if(e&&("object"==gr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(n,xr()?Reflect.construct(r,i||[],kr(n).constructor):r.apply(n,i))).el=null,e.file=null,e.selected="",e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Sr(t,e)}(t,W),e=t,(n=[{key:"setup",value:function(t,e){document.createElement("div");var n=document.createElement("select");n.setAttribute("type","file"),n.setAttribute("name",e),n.addEventListener("change",function(){n.options[n.selectedIndex].value});for(var r=0;r<t.length;r++)n.appendChild(this.addNode(t[r][0],t[r][1]));return this.el=n,this.res=n,this}},{key:"set",value:function(t){return this.options=t,t.items&&this.setup(t.items,t.name),t.arrayPadding&&this.arrayPadding(t.arrayPadding.sides,t.arrayPadding.value),t.arrayMargin&&this.arrayMargin(t.arrayMargin.sides,t.arrayMargin.value),t.pad&&this.pad(t.pad),t.mar&&this.mar(t.mar),t.radius&&(this.el.style.borderRadius=t.radius),t.background&&(this.el.style.background=t.background),this.commonMethods(t),this}},{key:"arrayPadding",value:function(t,e){return t.includes("left")&&(this.el.style.paddingLeft=e),t.includes("right")&&(this.el.style.paddingRight=e),t.includes("top")&&(this.el.style.paddingTop=e),t.includes("bottom")&&(this.el.style.paddingBottom=e),t.includes("all")&&(this.el.style.padding=e),this}},{key:"arrayMargin",value:function(t,e){return t.includes("left")&&(this.el.style.marginLeft=e),t.includes("right")&&(this.el.style.marginRight=e),t.includes("top")&&(this.el.style.marginTop=e),t.includes("bottom")&&(this.el.style.marginBottom=e),t.includes("all")&&(this.el.style.margin=e),this}},{key:"addNode",value:function(t,e){var n=document.createElement("option");n.setAttribute("value",t);var r=document.createTextNode(e);return n.appendChild(r),n}},{key:"padding",value:function(t){return this.el.style.padding=t,this}},{key:"font",value:function(t){return this.el.style.fontFamily=t,this}},{key:"margin",value:function(t){return this.el.style.margin=t,this}},{key:"toCode",value:function(){var t=JSON.stringify(this.options,null,4);return t=t.replace(/"(\w+)"(?=\s*:)/g,"$1"),["new Picker().set(".concat(t,")")]}},{key:"rounded",value:function(t){return this.el.style.borderRadius="4px",this}},{key:"auto",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.el.style.fontSize="3rem":t.el.style.fontSize="1rem"};return e(),window.addEventListener("resize",e),this}},{key:"render",value:function(t){if(!t)return this.el;document.querySelector(t).appendChild(this.el)}}])&&br(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function jr(t){return jr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jr(t)}function Cr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Er(r.key),r)}}function Er(t){var e=function(t){if("object"!=jr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=jr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==jr(e)?e:e+""}function Tr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Tr=function(){return!!t})()}function _r(t){return _r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_r(t)}function Pr(t,e){return Pr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Pr(t,e)}window.Picker=Or;var Ar=function(){function t(){var e,n,r,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(n=this,r=t,r=_r(r),e=function(t,e){if(e&&("object"==jr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(n,Tr()?Reflect.construct(r,i||[],_r(n).constructor):r.apply(n,i))).el=null,e.file=null,e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Pr(t,e)}(t,W),e=t,(n=[{key:"set",value:function(t){var e=this;this.options=t,this.okayColor=t.okayColor,window.matchMedia("(max-device-width: 415px)");var n=document.createElement("div");n.style.paddingBottom="1em",n.style.display="flex",document.createElement("div");var r=document.createElement("input");r.setAttribute("type","text"),r.style.display="none",r.style.margin="0.5em";var i=document.createElement("input");i.setAttribute("type","file"),i.setAttribute("name",t.name),t.accept&&(i.accept=t.accept),i.setAttribute("id",t.id),i.style.visibility="hidden",i.style.display="none",window.matchMedia("(max-device-width: 415px)").matches&&(i.style.fontSize="1rem");var o=document.createElement("label");return o.setAttribute("for",t.id),o.innerText=t.title,o.style.marginRight=12,o.style.padding="0.5em",t.color&&(o.style.color=t.color),t.background&&(o.style.background=t.background,o.style.padding="10"),i.addEventListener("change",function(){r.style.display="block",t.hideField&&(r.style.display="none"),o.innerText="Change",e.file=i.files[0],e.onLoad(e.file),Rr[t.index]=e.file,r.setAttribute("value",e.file.name),r.setAttribute("readonly","true"),e.getLoaded(),e.highlight()}),n.appendChild(i),n.appendChild(o),n.appendChild(r),this.el=n,t.font&&this.font(t.font),t.radius&&this.borderRadius(t.radius),this}},{key:"borderRadius",value:function(t){return this.el.style.borderRadius=t,this}},{key:"addClass",value:function(t){return this.el.setAttribute("class",t),this}},{key:"font",value:function(t){return this.el.style.fontFamily=t,this}},{key:"bold",value:function(){return this.el.style.fontWeight="bold",this}},{key:"rounded",value:function(){return this.el.children[1].style.borderRadius="8px",this}},{key:"highlight",value:function(){return null===this.file?(this.hasFile=!1,this.el.children[1].style.background="red"):(this.hasFile=!0,this.okayColor?this.el.children[1].style.background=this.okayColor:this.el.children[1].style.background="#1abc9c"),this}},{key:"auto",value:function(){var t=function(){window.matchMedia("(max-device-width: 415px)").matches};return t(),window.addEventListener("resize",t),this}},{key:"onLoad",value:function(t){return this.returnObject(this.file),this}},{key:"getLoaded",value:function(){return this.file}},{key:"returnObject",value:function(t){return t}},{key:"loadCall",value:function(t){return this.func=t,this.func(this.file),this}},{key:"toCode",value:function(){var t=JSON.stringify(this.options,null,4);return t=t.replace(/"(\w+)"(?=\s*:)/g,"$1"),["new FilePickera().set(".concat(t,")")]}},{key:"render",value:function(t){return t?(document.querySelector(t).appendChild(this.el),this):this.el}}])&&Cr(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}(),Rr=[];function Mr(t,e){return Mr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Mr(t,e)}function Lr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Lr=function(){return!!t})()}function zr(t){return zr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zr(t)}function Ir(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Fr(r.key),r)}}function Fr(t){var e=function(t){if("object"!=zr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=zr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==zr(e)?e:e+""}var Wr=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.res=null,this.currentItem=""},(e=[{key:"set",value:function(t){var e=this,n=t;this.options=t;var r=document.createElement("input");r.setAttribute("list","dlCities"),r.setAttribute("id","my");var i=t.data,o=0,a=i.length,s=document.createElement("datalist");for(s.id="dlCities",o=0;o<a;o+=1){var l=document.createElement("option");l.value=i[o],s.appendChild(l)}return r.appendChild(s),r.addEventListener("change",function(){var t=document.querySelector("#my").value;e.currentItem=t}),r.setAttribute("placeholder","Type value"),r.style.padding=".4rem .75rem",r.style.fontSize="1rem",this.res=r,this.responsive(),n.arrayPadding&&this.arrayPadding(n.arrayPadding.sides,n.arrayPadding.value),n.arrayMargin&&this.arrayMargin(n.arrayMargin.sides,n.arrayMargin.value),n.pad&&this.pad(n.pad),n.mar&&this.mar(n.mar),this}},{key:"toCode",value:function(){var t=JSON.stringify(this.options,null,4);return["new DataList().set(".concat(t,")")]}},{key:"getValue",value:function(){return this.res.value}},{key:"arrayPadding",value:function(t,e){return t.includes("left")&&(this.res.style.paddingLeft=e),t.includes("right")&&(this.res.style.paddingRight=e),t.includes("top")&&(this.res.style.paddingTop=e),t.includes("bottom")&&(this.res.style.paddingBottom=e),t.includes("all")&&(this.res.style.padding=e),this}},{key:"arrayMargin",value:function(t,e){return t.includes("left")&&(this.res.style.marginLeft=e),t.includes("right")&&(this.res.style.marginRight=e),t.includes("top")&&(this.res.style.marginTop=e),t.includes("bottom")&&(this.res.style.marginBottom=e),t.includes("all")&&(this.res.style.margin=e),this}},{key:"margin",value:function(t){return this.res.style.margin=t,this}},{key:"responsive",value:function(){return window.matchMedia("(max-device-width: 415px)").matches&&(this.res.style.width="100%"),this}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}])&&Ir(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}(),Dr=Wr;function Br(t){return Br="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Br(t)}function Nr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Hr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Gr(r.key),r)}}function Gr(t){var e=function(t){if("object"!=Br(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Br(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Br(e)?e:e+""}Wr=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(t,e,n){if(Lr())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var i=new(t.bind.apply(t,r));return n&&Mr(i,n.prototype),i}(Dr,e)},window.DataList=Wr;var Ur=function(){return t=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"POST";!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.action=e,this.method=n,this.elements=[],this.formElement=document.createElement("form"),this.formElement.action=this.action,this.formElement.method=this.method},e=[{key:"add",value:function(t){var e=this;return this.elements=t,t.forEach(function(t){if(!t||"function"!=typeof t.render)throw new Error("Each element in the array must have a render method that returns an HTML DOM element.");e.formElement.appendChild(t.render())}),this}},{key:"toCode",value:function(){var t=this.elements.map(function(t){return t.toCode()}),e=Object.entries(this.obj).map(function(t){var e,n,r=(n=2,function(t){if(Array.isArray(t))return t}(e=t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,n)||function(t,e){if(t){if("string"==typeof t)return Nr(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Nr(t,e):void 0}}(e,n)||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.")}()),i=r[0],o=r[1],a="string"==typeof o?'"'.concat(o,'"'):o;return"".concat(i,": ").concat(a)}).join(", ");return["new Form().set({".concat(e,"}).add([ \n ").concat(t.join(", \n"),"])")]}},{key:"set",value:function(t){return this.obj=t,t.action&&this.setAction(t.action),t.method&&this.setMethod(t.method),this}},{key:"setAction",value:function(t){this.action=t,this.formElement.action=this.action}},{key:"setMethod",value:function(t){this.method=t,this.formElement.method=this.method}},{key:"render",value:function(t){return t&&document.querySelector(t).appendChild(this.formElement),this.formElement}}],e&&Hr(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function qr(t){return qr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qr(t)}function Jr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Xr(r.key),r)}}function Xr(t){var e=function(t){if("object"!=qr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=qr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==qr(e)?e:e+""}var $r=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},(e=[{key:"style",value:function(t){for(var e=t.bst,n=t.el,r=t.re,i=(t.options,[]),o=0;o<e.length;o++)e[o].target&&(n.id,e[o].target[0]);for(o=0;o<e.length;o++){var a=!0;e[o].target&&(a=!1,n.id===e[o].target[0]&&(a=!0));var s=e[o].op.ops.split("-");a&&s.includes("air")&&(r.borderObj={color:"#1abc9c",radius:"0rem",width:"3px"},r.color="#1abc9c",r.background="transparent"),a&&s.includes("round")&&(s.includes("air")?r.borderObj={width:"4px",radius:"0.7rem",color:"#1abc9c"}:r.borderObj={width:"0px",radius:"0.7rem",color:"#1abc9c"}),a&&s.includes("full")&&(r.background="#3498db",r.borderObj&&r.borderObj.radius&&(r.borderObj.radius="0.3rem"),r.color="white"),a&&s.includes("pill")&&(r.background="#3498db",r.borderObj.radius="9999px",r.color="white"),a&&s.includes("hover")&&(r.hover={color:"#1abc9c",background:"orange"}),i.push((new mt).set(r))}return i}}])&&Jr(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Vr(t){return Vr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vr(t)}function Yr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function Qr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Yr(Object(n),!0).forEach(function(e){Kr(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Yr(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function Kr(t,e,n){return(e=ti(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Zr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ti(r.key),r)}}function ti(t){var e=function(t){if("object"!=Vr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Vr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Vr(e)?e:e+""}function ei(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ei=function(){return!!t})()}function ni(){return ni="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=ri(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},ni.apply(null,arguments)}function ri(t){return ri=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ri(t)}function ii(t,e){return ii=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ii(t,e)}var oi=function(){function t(){var e,n,r,i,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(n=this,r=t,r=ri(r),e=function(t,e){if(e&&("object"==Vr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(n,ei()?Reflect.construct(r,i||[],ri(n).constructor):r.apply(n,i))).res=null,e.options={},e.code=[],e.elCSS=[],e.html=[],e.react=[],e.setup(o),e.code.push("new Polygon(".concat(JSON.stringify(o),")")),e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ii(t,e)}(t,W),e=t,n=[{key:"setup",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=document.createElement("div");return t.id&&e.setAttribute("id",t.id),this.res=e,this.res.style.padding=0,this.res.style.margin=0,this.res.style.display=t.inline?"inline-block":"block",this}},{key:"toCode",value:function(){var t=this.options||{},e=JSON.stringify(t,null,2);return e=e.replace(/"([^"]+)":/g,"$1:"),"new Polygon().set(".concat(e,")")}},{key:"getType",value:function(){return"LayoutWrapperElement"}},{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=Qr(Qr({},this.options),e),e.id&&(this.res.id=e.id),e.class&&(this.res.className=e.class),e.sides&&this.sides(e.sides),e.size&&this.size(e.size.width||e.size,e.size.height),e.color&&this.color(e.color),e.border&&this.border(e.border),e.margin&&this.margin(e.margin),e.padding&&this.padding(e.padding),e.background&&this.background(e.background),e.center&&this.center();var n=e;this.obj=e;var r,i,o=[];if(n.stroke||n.gradient||n.backgroundOp||n.layout||n.marginOp||n.shadow||n.animation||n.filtera||n.transform){var a;n.gradient&&(this.globalGradient=n.gradient.op.gradient),n.stroke&&(null===(r=this,a="function"==typeof(i=ni(ri(t.prototype),"setAny",r))?function(t){return i.apply(r,t)}:i)||void 0===a||a([{globalBlast:"".concat(n.stroke.op.width," ").concat(n.stroke.op.color)}]));for(var s=[n.stroke,n.gradient,n.animation,n.backgroundOp,n.layout,n.marginOp,n.shadow,n.animation,n.filtera,n.transform].filter(function(t){return null!=t}),l=0;l<s.length;l++)o.push({range:s[l].range,log:s[l].op.name,target:s[l].target,op:s[l].op});var c=[];n.border&&c.push("border"),n.background&&c.push("background"),(n.mar||n.margin)&&c.push("margin"),n.animation&&c.push("animation"),"radial"===n.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)"),this.chainReact(o,this.options.id,c)}return this}},{key:"size",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return this.res.style.width="number"==typeof t?t+"px":t,this.res.style.height="number"==typeof e?e+"px":e,this}},{key:"sides",value:function(e){return e<3&&(e=3),this.res.style.clipPath=t.makePolygon(e),this}},{key:"center",value:function(){return this.res.style.marginLeft="auto",this.res.style.marginRight="auto",this}},{key:"color",value:function(t){return this.res.style.background=t,this}},{key:"border",value:function(t){return this.res.style.border="string"==typeof t?t:"".concat((null==t?void 0:t.width)||"1px"," solid ").concat((null==t?void 0:t.color)||"black"),this}},{key:"margin",value:function(t){return this.res.style.margin="number"==typeof t?t+"px":t,this}},{key:"padding",value:function(t){return this.res.style.padding="number"==typeof t?t+"px":t,this}},{key:"background",value:function(t){return this.res.style.background=t,this}},{key:"render",value:function(t){return"string"==typeof t?document.querySelector(t).appendChild(this.res):t instanceof HTMLElement&&t.appendChild(this.res),this}}],r=[{key:"makePolygon",value:function(t){for(var e=2*Math.PI/t,n=[],r=0;r<t;r++){var i=50+50*Math.cos(r*e-Math.PI/2),o=50+50*Math.sin(r*e-Math.PI/2);n.push("".concat(i,"% ").concat(o,"%"))}return"polygon(".concat(n.join(","),")")}}],n&&Zr(e.prototype,n),r&&Zr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n,r}();function ai(t){return ai="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ai(t)}function si(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function li(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ci(r.key),r)}}function ci(t){var e=function(t){if("object"!=ai(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ai(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ai(e)?e:e+""}function ui(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ui=function(){return!!t})()}function di(){return di="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=fi(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},di.apply(null,arguments)}function fi(t){return fi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},fi(t)}function hi(t,e){return hi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},hi(t,e)}var pi=function(){function t(){var e,n,r,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(n=this,r=t,r=fi(r),e=function(t,e){if(e&&("object"==ai(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(n,ui()?Reflect.construct(r,i||[],fi(n).constructor):r.apply(n,i))).res=null,e.options={},e.code=[],e.elCSS=[],e.html=[],e.react=[],e.setup(),e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&hi(t,e)}(t,W),e=t,n=[{key:"setup",value:function(){var t=document.createElement("div");return this.res=t,this.res.style.padding=0,this.res.style.margin=0,this.res.style.borderRadius="50%",this}},{key:"toCode",value:function(){if(this.excludeFromCodeTrue)return[""];var t=Object.fromEntries(Object.entries(this.options||{}).filter(function(t){return null!=(e=t,n=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,n)||function(t,e){if(t){if("string"==typeof t)return si(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?si(t,e):void 0}}(e,n)||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.")}())[1];var e,n})),e=JSON.stringify(t,null,4).replace(/"([^"]+)":/g,"$1:");return["new Circle().set(".concat(e,")")]}},{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(t){return this.res.style.gridArea=t,this}},{key:"rowCol",value:function(t,e){return this.res.style.gridRow=t,this.res.style.gridColumn=e,this}},{key:"setGridRow",value:function(t){return this.res.style.gridRow=t,this}},{key:"setGridCol",value:function(t){return this.res.style.gridColumn=t,this}},{key:"diameter",value:function(t){return this.res.style.width=this.res.style.height="number"==typeof t?t+"px":t,this.res.style.borderRadius="50%",this}},{key:"size",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return this.res.style.width="number"==typeof t?t+"px":t,this.res.style.height="number"==typeof e?e+"px":e,this.res.style.borderRadius="50%",this}},{key:"center",value:function(){return this.res.style.marginLeft=this.res.style.marginRight="auto",this}},{key:"color",value:function(t){return this.res.style.backgroundColor=t,this}},{key:"border",value:function(t){return this.res.style.border="string"==typeof t?t:"".concat((null==t?void 0:t.width)||1,"px solid ").concat((null==t?void 0:t.color)||"black"),this}},{key:"radius",value:function(t){return this.res.style.borderRadius="number"==typeof t?t+"px":t,this}},{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=e,e.top&&(this.res.style.top=e.top),e.left&&(this.res.style.left=e.left),(e.top||e.left)&&(this.res.style.position="absolute"),e.diameter&&this.diameter(e.diameter),e.size&&this.size(e.size.w||e.size,e.size.h||e.size),e.width&&(this.res.style.width=e.width),e.height&&(this.res.style.height=e.height),e.radius&&this.radius(e.radius),e.id&&this.res.setAttribute("id",e.id),e.class&&this.res.setAttribute("class",e.class),e.zIndex&&(this.res.style.zIndex=e.zIndex),e.pad&&(this.res.style.padding=e.pad),e.mar&&(this.res.style.margin=e.mar),e.background&&(this.res.style.background=e.background),e.color&&this.color(e.color),e.border&&this.border(e.border),e.shadow&&(this.res.style.boxShadow=e.shadow),e.cursor&&(this.res.style.cursor=!0===e.cursor?"pointer":e.cursor);var n,r,i=[];if(e.stroke||e.gradient||e.backgroundOp||e.layout||e.marginOp||e.shadow||e.animation||e.filtera||e.transform){var o;e.gradient&&(this.globalGradient=e.gradient.op.gradient),"radial"===e.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)"),e.stroke&&(null===(n=this,o="function"==typeof(r=di(fi(t.prototype),"setAny",n))?function(t){return r.apply(n,t)}:r)||void 0===o||o([{globalBlast:"".concat(e.stroke.op.width," ").concat(e.stroke.op.color)}]));for(var a=[e.stroke,e.gradient,e.animation,e.backgroundOp,e.layout,e.marginOp,e.shadow,e.animation,e.filtera,e.transform].filter(function(t){return null!=t}),s=0;s<a.length;s++)i.push({range:a[s].range,log:a[s].op.name,target:a[s].target,op:a[s].op});var l=[];e.border&&l.push("border"),e.background&&l.push("background"),(e.mar||e.margin)&&l.push("margin"),e.animation&&l.push("animation"),this.chainReact(i,this.options.id,l)}return this}},{key:"getType",value:function(){return"LayoutWrapperElement"}},{key:"excludeFromCode",value:function(){return this.excludeFromCodeTrue=!0,this}},{key:"setClass",value:function(t){return this.res.setAttribute("class",t),this}},{key:"onTap",value:function(t){return this.res.addEventListener("click",t),this}},{key:"render",value:function(t){var e;return t&&(null===(e=document.querySelector(t))||void 0===e||e.appendChild(this.res)),this.res}}],n&&li(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function yi(t){return yi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yi(t)}function mi(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function vi(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?mi(Object(n),!0).forEach(function(e){gi(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):mi(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function gi(t,e,n){return(e=wi(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,wi(r.key),r)}}function wi(t){var e=function(t){if("object"!=yi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=yi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==yi(e)?e:e+""}var xi=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},(e=[{key:"mapType",value:function(t){return["h1","h2","h3","h4","h5","h6","p"].includes(t.el.type)?this.mapText(t):"img"===t.el.type?this.mapImage(t):"a"===t.el.type?this.mapLink(t):"cards"===t.el.type?this.mapGrid(t):"free"===t.el.type?this.mapFree(t):"nav"===t.el.type?this.protoNav(t):"sideNav"===t.el.type?this.sideNav(t):"row"===t.el.type?this.mapRow(t):"dropdown"===t.el.type?this.dropdown(t):"radio"===t.el.type?this.radio(t):"input"===t.el.type?this.input(t):"labelInput"===t.el.type?this.floatInput(t):"filePicker"===t.el.type?this.filePicker(t):"picker"===t.el.type?this.picker(t):"video"===t.el.type?this.video(t):"audio"===t.el.type?this.audio(t):"multiswitcher"===t.el.type?this.multiswitcher(t):"button"===t.el.type?this.button(t):"form"===t.el.type?this.form(t):"checkbox"===t.el.type?this.checkbox(t):"stack"===t.el.type?this.stack(t):"simple"===t.el.type?this.simple(t):"copy"===t.el.type?this.mapCopy(t):"wrap"===t.el.type?this.mapWrap(t):"circle"===t.el.type?this.mapCircle(t):"polygon"===t.el.type?this.mapPolygon(t):"code"===t.el.type?this.mapCode(t):"table"===t.el.type?this.mapTable(t):"ulist"===t.el.type?this.mapUList(t):void 0}},{key:"mapTable",value:function(t){var e=t.el;return(new Me).add([{abbr:"AUIUI/AK9PT",name:"Pokročilé mobilní technologie",grade:"A",date:"09.01.2024"},{abbr:"AUIUI/AK9PT",name:"Pokročilé mobilní technologie",grade:"A",date:"09.01.2024"},{abbr:"AUIUI/AK9PT",name:"Pokročilé mobilní technologie",grade:"A",date:"09.01.2024"}]).set({cellPadding:"0.3em",cellAlign:"center",style:{font:"Arial"},headStyle:{color:"white",background:"#ff6d22"},border:"2px solid black",center:!0,borderRadius:2.2,stroke:this.filtero("blast",e.id,t.customOptions),gradient:this.filtero("gradient",e.id,t.customOptions),animation:this.filtero("animation",e.id,t.customOptions),shadow:this.filtero("shadow",e.id,t.customOptions),span:this.filtero("span",e.id,t.customOptions),backgroundOp:this.filtero("background",e.id,t.customOptions),marginOp:this.filtero("margin",e.id,t.customOptions),transform:this.filtero("transform",e.id,t.customOptions),filtera:this.filtero("filter",e.id,t.customOptions),raster:this.filteroRaster(e.id,t.customOptions)})}},{key:"mapRow",value:function(t){var e=t.el;return(new Ct).set({stroke:this.filtero("blast",e.id,t.customOptions),gradient:this.filtero("gradient",e.id,t.customOptions),animation:this.filtero("animation",e.id,t.customOptions),shadow:this.filtero("shadow",e.id,t.customOptions),span:this.filtero("span",e.id,t.customOptions),backgroundOp:this.filtero("background",e.id,t.customOptions),marginOp:this.filtero("margin",e.id,t.customOptions),transform:this.filtero("transform",e.id,t.customOptions),filtera:this.filtero("filter",e.id,t.customOptions),raster:this.filteroRaster(e.id,t.customOptions)}).items([new Y("This").set({size:"S3"}),new Y("is").set({size:"S3",text:"Hello"}),new Y("row.").set({size:"S3",text:"Hello"})])}},{key:"mapCode",value:function(t){var e=t.el;return(new le).set({stroke:this.filtero("blast",e.id,t.customOptions),gradient:this.filtero("gradient",e.id,t.customOptions),animation:this.filtero("animation",e.id,t.customOptions),shadow:this.filtero("shadow",e.id,t.customOptions),span:this.filtero("span",e.id,t.customOptions),backgroundOp:this.filtero("background",e.id,t.customOptions),marginOp:this.filtero("margin",e.id,t.customOptions),transform:this.filtero("transform",e.id,t.customOptions),filtera:this.filtero("filter",e.id,t.customOptions),raster:this.filteroRaster(e.id,t.customOptions),pad:[{l:30}],mar:[{a:30}],class:"language-js",code:'new Text("Modality").set({ font: "Arial" })'})}},{key:"mapCopy",value:function(t){var e,n=t.customOptions.filter(function(t){return"copy"===t.op})[0],r=null!==(e=null==n?void 0:n.count)&&void 0!==e?e:3,i=300;return'new Wrapper()\n.set({\n width: "'.concat(i,'px",\n height: "').concat(i,'px",\n display: "flex",\n justifyContent: "center",\n alignItems: "center",\n position: "absolute",\n id: "#first",\n scale: 0.3,\n ').concat(null!=n&&n.animation?'\nanimation: {\n op: {\n name: "animation",\n color: "green",\n width: "1px",\n fireAt: "inview",\n keyframesOpen: [\n {\n transform: "rotate(360deg)",\n opacity: 0\n },\n {\n transform: "rotate(0deg)",\n opacity: 1\n }\n ],\n keyframesClose: [\n {\n transform: "rotate(0deg)",\n opacity: 1\n },\n {\n transform: "rotate(0deg)",\n opacity: 0\n }\n ],\n openOptions: {\n duration: 300,\n fill: "forwards",\n delay: 1000\n },\n closeOptions: {\n duration: 1,\n fill: "forwards",\n delay: 1000\n }\n },\n target: [\n "#first"\n ]\n },\n ':"","\n})\n.add(\n Array.from({ length: ").concat(r,' }).map((_, i) => {\n\n const bbox = {width: "').concat(i,'px", height: "').concat(i,'px"};\n\n const elHeight = bbox.height;\n\n const cx = ').concat(150,";\n const cy = ").concat(150,";\n\n const R = ").concat(150,";\n\n const n = ").concat(r,';\n\n // Evenly spaced angles, starting at top (-90°)\n const angle = (i / n) * Math.PI * 2 - Math.PI/2;\n const dist = R + parseFloat(elHeight)/2;\n\n const x = cx + dist * Math.cos(angle);\n const y = cy + dist * Math.sin(angle);\n\n let rot = angle * 180 / Math.PI + 90;\n rot = (rot % 360 + 360) % 360;\n rot = (rot % 360 + 360) % 360;\n\n return new Text("Hello").set({\n size: "S1",\n color: "green",\n font: "Arial",\n left: `${x}px`,\n top: `${y}px`,\n transform: {\n op: {\n name: "transform",\n transform: {\n static: true,\n keep: true,\n values: [\n "tx:-50%",\n "ty:-50%",\n `rotate(${rot}deg)`\n ]\n }\n }\n }\n })\n\n \n })\n)')}},{key:"button",value:function(){return new nr("Submit").set({fluidc:"S6",color:"white",background:"#1abc9c",arrpad:{sides:["all"],value:".3rem"},radius:".3rem",onTap:function(){console.log("[nodality] demo button tapped")},keySet:{key:"border",value:"3px solid green"}})}},{key:"multiswitcher",value:function(){return(new xn).set({breakpoints:[{at:"0px",view:new Y("First").set({})},{at:"700px",view:new Y("Nice").set({})},{at:"800px",view:new Y("Best").set({})}]})}},{key:"video",value:function(){return new Bn("https://www.w3schools.com/html/mov_bbb.mp4").set({})}},{key:"audio",value:function(){return new te("rouska.mp3").set({background:"#1abc9c"})}},{key:"radio",value:function(t){return(new vr).set({items:["Male","Female","Other"],multiple:!0})}},{key:"input",value:function(t){return(new Ve).set({type:"text",placeholder:"Enter swimming time",arrayMargin:{sides:["all"],value:"1rem"}})}},{key:"floatInput",value:function(t){return(new cr).set({title:"Your name",type:"input"})}},{key:"filePicker",value:function(t){return(new Ar).set({id:"A",title:"Add profile picture",background:"#3498DB",color:"white",font:"Arial",radius:"3rem",accept:"application/pdf"})}},{key:"picker",value:function(t){return(new Or).set({items:[["none","select a car---"],["tesla","Tesla"],["audi","Audi"]],font:"Arial",arrayPadding:{sides:["all"],value:"0.5rem"},rounded:!0})}},{key:"dropdown",value:function(t){t.el.items||(t.el.items=["Flower","Car","Maseratti"]);var e=t.el.items.map(function(t){return(new mt).set({pad:[{a:10}],font:"Arial",bold:!0,link:"https://www.apple.com",text:t,icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/32/32339.png"},hover:{color:"wheat",animation:.3}})});return(new He).set({behaviour:"click",pad:[{a:"1rem"}],mar:[{a:"1rem"}],border:"1px solid black",width:"180px",radius:"1rem"}).add([new Y(t.el.items[0]).set({font:"Arial",fluidc:"S6",weight:"bold",align:"center",cursor:"hand",icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/60/60995.png"},pad:[{l:10,r:10}]}),(new Se).set({border:"1px solid green",background:"#1abc9c",radius:"0.7rem",socenter:!0}).add(e.slice(1))])}},{key:"protoNav",value:function(t){t.customOptions;var e=[{title:"Fire",link:"@e"},{title:"and",link:"@e"},{title:"smoke",link:"@e"}],n=e.map(function(t,e){return new mt('"'.concat(t.title,'"')).set({fluidc:"S6",text:t.title,link:t.link,font:"Arial",pad:[{a:40}],bold:!0,hover:{color:"wheat",animation:.3}})}),r=e.map(function(t,e){return new mt('"'.concat(t.title,'"')).set({fluidc:"S6",text:t.title,link:t.link,font:"Arial",pad:[{a:40}],bold:!0,hover:{color:"wheat",animation:.3},animation:{range:["0px","1900px"],op:{name:"animation",color:"green",width:"1px",keyframesOpen:[{transform:"translate(100%, ".concat(10*e,"%)"),opacity:0},{transform:"translate(0%)",opacity:1}],keyframesClose:[{transform:"translate(0%)",opacity:1},{transform:"translate(100%, ".concat(10*e,"%)"),opacity:0}],openOptions:{duration:300,fill:"forwards",delay:1e3},closeOptions:{duration:1,fill:"forwards",delay:1e3}}}})});if(t.el.dropdown){var i=(new He).set({behaviour:"mouseover",pad:[{a:40}],padding:"10px",border:"1px solid black"}).add([new Y("First").set({cursor:"hand",icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/60/60995.png"},fluidc:"S6",pad:[{l:20,r:10}],font:"Arial",align:"center",weight:"bold"}),(new Se).set({centerColumn:!0,radius:"0.7rem",background:"#1abc9c",makeResponsiveBehaviour:"undefined"}).add([(new mt).set({pad:[{a:10}],font:"Arial",hover:{color:"wheat",animation:.3},bold:!0,link:"https://www.apple.com",text:"Second",icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/32/32339.png"}}),(new mt).set({pad:[{a:10}],font:"Arial",hover:{color:"wheat",animation:.3},bold:!0,link:"https://www.apple.com",text:"Third",icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/32/32339.png"}})])]);r.push(i),n.push(i)}return t.el.animation,(new xn).set({breakpoints:[{at:"0px",view:(new dn).set({background:"#ecf0f1",mar:[{a:21}],brand:new Y("Company").set({size:"S6",font:"Helvetica"}),hamburgerColour:"#3498db",radius:"1rem"}).add([(new mt).set({text:"About",url:"#a"}),(new He).set({behaviour:"mouseover",pad:[{a:40}],mar:[{lr:"auto"}],breakpoint:"1200px",padding:"10px",border:"1px solid black",height:"auto"}).add([new Y("More").set({cursor:"hand",icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/60/60995.png"},fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"}),new Y("Our story").set({cursor:"hand",fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"}),new Y("Team").set({cursor:"hand",fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"})]),new mt("B").set({text:"About",url:"#b"}),new mt("C").set({text:"Contact",url:"https://www.abcnews.com"})])},{at:"1200px",view:(new nn).set({background:"#ecf0f1",mar:[{a:21}],maxHeight:"100px",radius:"1rem"}).add([new Y("Company").set({size:"S6",font:"Helvetica"}),new jn(!0),(new He).set({behaviour:"mouseover",pad:[{a:40}],padding:"10px",border:"1px solid black",radius:"30px",width:"130px"}).add([new Y("More").set({cursor:"hand",icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/60/60995.png"},fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"}),(new Se).set({flexDir:"column",mar:[{t:"10px"}],radius:".3rem"}).add([new mt("").set({text:"Who we are",url:"jk",cursor:"hand",fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"}),new mt("").set({text:"Info",url:"#u",cursor:"hand",fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"}),new mt("").set({text:"About",url:"#u",cursor:"hand",fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"})])]),(new mt).set({text:"About",url:"#a"}),(new mt).set({text:"Services",url:"#a"}),(new mt).set({text:"Contact",url:"#a"})])}]})}},{key:"sideNav",value:function(t){t.customOptions;var e=[{title:"Home",link:"@e"},{title:"Projects",link:"@e"},{title:"Services",link:"@e"}],n=e.map(function(t,e){return new mt('"'.concat(t.title,'"')).set({fluidc:"S4",text:t.title,link:t.link,isNavA:!0,url:"#e",id:"#"+t.title.toLowerCase(),font:"Arial",pad:[{a:20}],bold:!0,tags:{open:"sidebar:open",close:"sidebar:closed"},align:"left",hover:{color:"wheat",animation:.3}})}),r=(new He).set({behaviour:"mouseover",pad:[{a:40}],padding:"10px",animation:{range:["0px","1900px"],op:{name:"animation",color:"green",width:"1px",keyframesOpen:[{transform:"translate(100%, ".concat(10,"%)"),opacity:0},{transform:"translate(0%)",opacity:1}],keyframesClose:[{transform:"translate(0%)",opacity:1},{transform:"translate(100%, ".concat(10,"%)"),opacity:0}],openOptions:{duration:300,fill:"forwards",delay:1e3},closeOptions:{duration:1,fill:"forwards",delay:1e3}}}}).add([new Y("More").set({cursor:"hand",icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/60/60995.png"},fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"}),(new Se).set({centerColumn:!0,radius:"0.7rem",background:"#1abc9c",makeResponsiveBehaviour:"undefined"}).add([(new mt).set({pad:[{a:10}],font:"Arial",hover:{color:"wheat",animation:.3},bold:!0,link:"https://www.apple.com",text:"Second",icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/32/32339.png"}}),(new mt).set({pad:[{a:10}],font:"Arial",hover:{color:"wheat",animation:.3},bold:!0,link:"https://www.apple.com",text:"Third",icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/32/32339.png"}})])]),i=e.map(function(t,e){return new mt('"'.concat(t.title,'"')).set({fluidc:"S4",text:t.title,link:t.link,isNavA:!0,url:"#myURL",id:"#"+t.title.toLowerCase(),font:"Arial",pad:[{a:20}],bold:!0,tags:{open:"sidebar:open",close:"sidebar:closed"},align:"left",hover:{color:"wheat",animation:.3},animation:{range:["0px","1900px"],op:{name:"animation",color:"green",width:"1px",keyframesOpen:[{transform:"translate(100%, ".concat(10*e,"%)"),opacity:0},{transform:"translate(0%)",opacity:1}],keyframesClose:[{transform:"translate(0%)",opacity:1},{transform:"translate(100%, ".concat(10*e,"%)"),opacity:0}],openOptions:{duration:300,fill:"forwards",delay:1e3},closeOptions:{duration:1,fill:"forwards",delay:1e3}}}})});t.el.dropdown&&(i.push(r),n.push(r));var o=(new Se).set({column:!0}).add([new Y("Sidebar").set({size:"S6",font:"Arial",id:"#olod",italic:!0,animation:{range:["0px","1900px"],op:{name:"animation",color:"green",width:"1px"}},pad:[{l:20},{t:20}]}),t.el.animation?i[0]:n[0],t.el.animation?i[1]:n[1],t.el.animation?i[2]:n[2],t.el.animation&&t.el.dropdown?i[3]:new Y("").set({}).excludeFromCode(),new Y("Company, 2025").set({pad:[{a:20}],animation:{range:["0px","1900px"],op:{name:"animation",color:"green",width:"1px"}}})]),a=(new Se).set({column:!0}).add([new Y("Off canvas").set({fluidc:"S6",font:"Arial",id:"#olod",italic:!0,animation:t.el.animation?{range:["0px","1900px"],op:{name:"animation",color:"green",width:"1px"}}:null,pad:[{l:40},{t:20}]})]);return(new Dt).setup({animate:!0,radius:"1rem",isSide:!0,background:"#ecf0f1",hamColour:{opened:"#1abc9c",closed:"#e67e22"},mobileSize:"1.2em",fixed:!0,tags:{open:"sidebar:open",close:"sidebar:closed"}}).items(t.el.offcanvas?a:o)}},{key:"mapFree",value:function(t){var e=t.customOptions.filter(function(t){return"slayout"===t.op.name||"layout"===t.op.name})[0],n=null,r={cols:6,rows:6};return"text-above-image"!==e.op.value&&"image-above-text"!==e.op.value||(n=null,r=null),"img-overlay-text"===e.op.value&&(n={text:{row:"1 / span 2",col:"3 / span 2"},image:{row:"2 / span 3",col:"3 / 3"}}),"img-leftof-text"===e.op.value&&(n={text:{row:"1",col:"1 / 3"},image:{row:"1",col:"3 / 4"}}),(new Xt).set({id:"#3",templateCols:r,height:"600px"}).add([new Y("I am free").set({border:"3px solid green",font:"Arial",size:"S1",color:"#1abc9c",gpos:null!=n?n.text:null,zIndex:1}),(new at).set({url:"https://upload.wikimedia.org/wikipedia/commons/a/ac/MSC_World_Europa_-_Saint-Nazaire_-_June_2022.jpg",width:"400px",height:"auto",gpos:null!=n?n.image:null})])}},{key:"mapCircle",value:function(t){var e=t.el;return(new pi).set({diameter:108,background:"#1abc9c",stroke:this.filtero("blast",e.id,t.customOptions),gradient:this.filtero("gradient",e.id,t.customOptions),animation:this.filtero("animation",e.id,t.customOptions),shadow:this.filtero("shadow",e.id,t.customOptions),span:this.filtero("span",e.id,t.customOptions),backgroundOp:this.filtero("background",e.id,t.customOptions),marginOp:this.filtero("margin",e.id,t.customOptions),transform:this.filtero("transform",e.id,t.customOptions),filtera:this.filtero("filter",e.id,t.customOptions),raster:this.filteroRaster(e.id,t.customOptions)})}},{key:"mapPolygon",value:function(t){var e,n=t.el,r=null!==(e=t.el.sides)&&void 0!==e?e:7;return new oi({id:"hex"}).set({sides:r,size:300,background:"#1abc9c",gradient:this.filtero("gradient",n.id,t.customOptions),animation:this.filtero("animation",n.id,t.customOptions),shadow:this.filtero("shadow",n.id,t.customOptions),span:this.filtero("span",n.id,t.customOptions),backgroundOp:this.filtero("background",n.id,t.customOptions),marginOp:this.filtero("margin",n.id,t.customOptions),transform:this.filtero("transform",n.id,t.customOptions),filtera:this.filtero("filter",n.id,t.customOptions),raster:this.filteroRaster(n.id,t.customOptions)})}},{key:"mapText",value:function(t){var e,n=t.el;return new Y(n.text||n.value).set({id:n.id,class:n.class,color:n.color,size:this.getElType(n.type),font:null!==(e=n.font)&&void 0!==e?e:"Arial",stroke:this.filtero("blast",n.id,t.customOptions),gradient:this.filtero("gradient",n.id,t.customOptions),animation:this.filtero("animation",n.id,t.customOptions),shadow:this.filtero("shadow",n.id,t.customOptions),span:this.filtero("span",n.id,t.customOptions),backgroundOp:this.filtero("background",n.id,t.customOptions),marginOp:this.filtero("margin",n.id,t.customOptions),transform:this.filtero("transform",n.id,t.customOptions),filtera:this.filtero("filter",n.id,t.customOptions),raster:this.filteroRaster(n.id,t.customOptions),resprop:n.resprop?[{breakpoint:"1400px",background:"orange",width:"200px",height:"200px"},{breakpoint:"900px",background:"green",height:"100px",width:"100px"}]:null})}},{key:"mapImage",value:function(t){var e=t.el;return new at(e.url).set(vi(vi({},e),{},{isFull:e.isFull,animation:this.filtero("animation",e.id,t.customOptions),shadow:this.filtero("shadow",e.id,t.customOptions),marginOp:this.filtero("margin",e.id,t.customOptions),filtera:this.filtero("filter",e.id,t.customOptions),raster:this.filteroRaster(e.id,t.customOptions)}))}},{key:"mapLink",value:function(t){var e=t.customOptions.filter(function(t){return"link-style"===t.op.name}),n=t.el;return t.el.id&&(n.id=t.el.id),t.el.link&&t.el.text&&(n.url=t.el.link,n.text=t.el.text),n.animation=this.filtero("animation",t.el.id,t.customOptions),n.class=t.el.class,n.width=t.el.width,n.font="Arial",n.fluidc=t.el.fluidc,n.transform=this.filtero("transform",t.el.id,t.customOptions),n.shadow=this.filtero("shadow",t.el.id,t.customOptions),n.gradient=this.filtero("gradient",t.el.id,t.customOptions),n.blast=this.filtero("blast",t.el.id,t.customOptions),n.backgroundOp=this.filtero("background",t.el.id,t.customOptions),n.pad=[{a:10}],e.length>0?$r.style({el:t.el,re:n,bst:e,options:t.customOptions})[e.length-1]:(new mt).set(n)}},{key:"mapGrid",value:function(t){var e=t.el,n=(t.customOptions.find(function(t){return"card-style"===t.op.name}),this.filtero("gradient",e.id,t.customOptions)),r=this.filtero("animation",e.id,t.customOptions),i=this.filtero("shadow",e.id,t.customOptions),o=this.filtero("margin",e.id,t.customOptions),a=this.filtero("filter",e.id,t.customOptions),s=this.filtero("blast",e.id,t.customOptions),l='\n new Card()\n .set({\n width: "300px", \n height: "700px",\n radius: "0.7rem", \n mar: { sides: ["all"], value: "0.8rem" }\n '.concat(void 0!==n?",\n gradient: ".concat(JSON.stringify(n)):"").concat(void 0!==r?",\n animation: ".concat(JSON.stringify(r)):"").concat(void 0!==i?",\n shadow: ".concat(JSON.stringify(i)):"").concat(void 0!==o?",\n marginOp: ".concat(JSON.stringify(o)):"").concat(void 0!==a?",\n filtera: ".concat(JSON.stringify(a)):"").concat(void 0!==s?",\n blast: ".concat(JSON.stringify(s)):"",'\n })\n .items([\n new Image(item.img).set({isFull: true, url: item.img}),\n new Text(item.title).set({ size: "S5", color: "orange" }),\n new Link("Link").set({\n text: item.title, \n url: item.link, \n background: "#3498db", \n pad: [{ lr: "0.5rem", tb: "1rem" }], \n radius: "0.4rem", \n color: "white",\n mar: [{"a": 21}]\n })\n ])'),c=t.el.backgroundCard?'\n new ZoomCard()\n .set({\n url: item.img, \n font: "Arial", \n mar: { sides: ["all"], value: "0.8rem" }, \n inpad: "1rem", \n useBrightness: true\n })\n .items([\n new Text(item.title).set({ fluidc: "S6", color: "orange" }),\n new Link("Link").set({\n text: item.title, \n url: item.link, \n background: "#3498db", \n pad: [{ lr: "0.5rem", tb: "1rem" }], \n radius: "0.4rem", \n color: "white"\n })\n ])':l;return' new FlexGrid()\n .set({\n colat: "700px",\n wrap: true,\n align: "center",\n gap: "1rem"\n '.concat(void 0!==n?",\n gradient: ".concat(JSON.stringify(n)):"").concat(void 0!==r?",\n animation: ".concat(JSON.stringify(r)):"").concat(void 0!==i?",\n shadow: ".concat(JSON.stringify(i)):"").concat(void 0!==o?",\n marginOp: ".concat(JSON.stringify(o)):"").concat(void 0!==a?",\n filtera: ".concat(JSON.stringify(a)):"").concat(void 0!==s?",\n blast: ".concat(JSON.stringify(s)):"",'\n })\n .items(\n [\n { img: "https://upload.wikimedia.org/wikipedia/commons/3/3a/Starship_S20.jpg", title: "Starship", link: "#ship" },\n { img: "https://upload.wikimedia.org/wikipedia/commons/1/16/Apollo_11_Launch_-_GPN-2000-000630.jpg", title: "Saturn V", link: "#saturn" },\n { img: "https://upload.wikimedia.org/wikipedia/commons/d/d6/STS120LaunchHiRes-edit1.jpg", title: "Shuttle", link: "#shuttle" }\n ].map(item => \n ').concat(c,"\n )\n )\n ")}},{key:"checkbox",value:function(t){return(new Mn).set({name:"acceptTerms",label:new Y("Check it out!").set({size:"S6",color:"#1abc9c",font:"Arial"}),mar:"10px"})}},{key:"stack",value:function(t){return(new fe).set({}).add([(new at).set({url:"https://pbs.twimg.com/media/DwYvbCBVAAEKY_R.jpg"}),new Y("Samuel Suresh").set({color:"#00ae56",font:"SF Pro Display",fluidc:"S2",pad:{sides:["top","left"],value:20}})])}},{key:"form",value:function(t){return(new Ur).set({action:"file.php"}).add([(new cr).set({title:"Your name",type:"input",name:"name"}),(new cr).set({title:"Your email",type:"input",name:"email",color:"#3498db",font:"Arial",mar:[{a:"1rem"}]}),(new vr).set({name:"gender",items:["Male","Female","Other"],multiple:!1,tint:"#1abc9c",font:"Arial",exact:"3rem"}),(new Or).set({name:"car",items:[["none","select a car---"],["tesla","Tesla"],["audi","Audi"]],font:"Arial",arrayPadding:{sides:["all"],value:"0.5rem"},radius:"1rem",background:"#1abc9c"}),(new Ar).set({id:"A",name:"image",title:"Add profile picture",background:"#3498DB",color:"white",font:"Arial",radius:"3rem"}),new nr("Submit form").set({type:"submit",background:"#3498db",color:"white",weight:"bold",radius:"1rem",pad:[{a:"1rem"}],mar:[{b:"1rem"}]})])}},{key:"simple",value:function(t){return'new AreaSwitcher()\n .set({ gap: "10px", height: "700px" })\n .react([\n {\n at: "0", // Default size\n color: "red",\n template: [\n "aaaaaa",\n "bbbbbb",\n "cccccc",\n "dddddd",\n "eeeeee",\n ],\n },\n {\n at: "768", // Medium screen size\n color: "blue",\n template: [\n "aa bbb",\n "aa bbb",\n "cc ddd",\n "ee ddd",\n ],\n },\n {\n at: "1024", // Large screen size\n color: "green",\n template: [\n "aaa bbb",\n "ccc ddd",\n "eee ddd",\n ],\n },\n ])\n .add([\n new Text("Hello A").set({size: "S1"}),\n new Text("Hello B").set({size: "S1"}),\n new Text("Hello C").set({size: "S1"}),\n new Text("Hello D").set({size: "S1"}),\n new Text("Hello E").set({size: "S1"})\n ])'}},{key:"mapWrap",value:function(t){var e,n,r=t.el,i=null!==(e=t.el.kind)&&void 0!==e?e:"";return new Se(i).set({id:r.id,class:r.class,color:r.color,size:this.getElType(r.type),font:null!==(n=r.font)&&void 0!==n?n:"Arial",keySet:r.keySet,stroke:this.filtero("blast",r.id,t.customOptions),gradient:this.filtero("gradient",r.id,t.customOptions),animation:this.filtero("animation",r.id,t.customOptions),shadow:this.filtero("shadow",r.id,t.customOptions),transform:this.filtero("transform",r.id,t.customOptions),filtera:this.filtero("filter",r.id,t.customOptions),raster:this.filteroRaster(r.id,t.customOptions)}).add([new Y("Hello").set({}),new Y("Hello").set({}),new Y("Hello").set({})])}},{key:"mapUList",value:function(t){var e,n,r=t.el,i=null!==(e=t.el.kind)&&void 0!==e?e:"";return new Vn(i).set({id:r.id,class:r.class,color:r.color,size:this.getElType(r.type),font:null!==(n=r.font)&&void 0!==n?n:"Arial",keySet:r.keySet,stroke:this.filtero("blast",r.id,t.customOptions),gradient:this.filtero("gradient",r.id,t.customOptions),animation:this.filtero("animation",r.id,t.customOptions),shadow:this.filtero("shadow",r.id,t.customOptions),transform:this.filtero("transform",r.id,t.customOptions),filtera:this.filtero("filter",r.id,t.customOptions),raster:this.filteroRaster(r.id,t.customOptions)}).setItems([new Y("First").set({}),new Y("Second").set({}),new Y("Third").set({})])}},{key:"getElType",value:function(t){return"p"===t?"S6":"S".concat(t.substr(1))}},{key:"filtero",value:function(t,e,n){return n.filter(function(e){return e.op.name===t}).filter(function(t){return!t.target||t.target.includes(e)})[0]}},{key:"filteroRaster",value:function(t,e){var n=(e||[]).filter(function(e){return e&&"string"==typeof e.op&&y.includes(e.op)&&(!e.target||t&&e.target.includes(t))});return n.length>0?n:void 0}}])&&bi(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();export{xi as ElementMapper};
|
|
1
|
+
/*! For license information please see element-mapper.esm.js.LICENSE.txt */
|
|
2
|
+
var t={};function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}t.d=(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var n="nodality.theme.mode",r="nodality:theme",i={mode:function(){try{var t=localStorage.getItem(n);if("light"===t||"dark"===t)return t}catch(t){}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(t){return t&&"object"===e(t)&&(t.light&&(this.defaults.light=Object.assign({},this.defaults.light,t.light)),t.dark&&(this.defaults.dark=Object.assign({},this.defaults.dark,t.dark)),this._broadcast()),this},setTokens:function(t){return t&&"object"===e(t)&&(t.light&&Object.assign(this.tokens.light,t.light),t.dark&&Object.assign(this.tokens.dark,t.dark)),this},get current(){return this.tokens[this.mode]||{}},set:function(t){if("light"!==t&&"dark"!==t)return this;if(t===this.mode)return this;this.mode=t;try{localStorage.setItem(n,t)}catch(t){}return this._broadcast(),this},toggle:function(){return this.set("dark"===this.mode?"light":"dark")},subscribe:function(t){if("undefined"==typeof document)return function(){};var e=function(e){return t(e.detail.mode,e.detail.tokens)};document.addEventListener(r,e);try{t(this.mode,this.current)}catch(t){}return function(){return document.removeEventListener(r,e)}},_broadcast:function(){"undefined"!=typeof document&&document.dispatchEvent(new CustomEvent(r,{detail:{mode:this.mode,tokens:this.current}}))}};function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function a(t){return function(t){if(Array.isArray(t))return u(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||c(t)||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 s(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=c(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function l(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(t,e)||c(t,e)||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 c(t,e){if(t){if("string"==typeof t)return u(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(t,e):void 0}}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var d={static:function(t){return{x:.5*t.w,y:.5*t.h,amt:1}},mouse:function(t){return{x:t.mouseX,y:t.mouseY,amt:1}},hover:function(t){return{x:t.mouseX,y:t.mouseY,amt:t.hover}},scroll:function(t){return{x:.5*t.w,y:t.h*t.scroll,amt:1}},time:function(t){return{x:t.w*(.5+.34*Math.cos(.6*t.t)),y:t.h*(.5+.34*Math.sin(.8*t.t)),amt:1}}},f=Object.keys(d),h={hexalize:{stage:"cell",decl:function(t){return"\n uniform float ".concat(t,"size;\n uniform float ").concat(t,"lift;\n uniform float ").concat(t,"radius;\n uniform vec2 ").concat(t,"dpos;\n uniform float ").concat(t,"damt;")},code:function(t,e){return e.lift?"\n {\n vec2 hp = warped / ".concat(t,"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 vec2 ").concat(t,"AX = normalize(vec2(1.0, 1.7320508));\n vec2 ").concat(t,"c0 = hp - gv;\n // Seed with the owning cell. Its own hexagon always covers the\n // fragment at any scale >= 1, so there is always a winner.\n vec2 ").concat(t,"bestC = ").concat(t,"c0;\n float ").concat(t,"bestF = (1.0 - smoothstep(0.0, ").concat(t,"radius,\n length(").concat(t,"c0 * ").concat(t,"size - ").concat(t,"dpos))) * ").concat(t,"damt;\n float ").concat(t,"bestS = 1.0 + ").concat(t,"lift * ").concat(t,"bestF;\n").concat([[1,0],[-1,0],[.5,.8660254],[-.5,.8660254],[.5,-.8660254],[-.5,-.8660254]].map(function(e){var n,r,i=l(e,2);return n=i[0],r=i[1],"\n {\n vec2 c = ".concat(t,"c0 + vec2(").concat(n.toFixed(7),", ").concat(r.toFixed(7),");\n float f = 1.0 - smoothstep(0.0, ").concat(t,"radius,\n length(c * ").concat(t,"size - ").concat(t,"dpos));\n f *= ").concat(t,"damt;\n float s = 1.0 + ").concat(t,"lift * f;\n vec2 q = hp - c;\n float hd = max(dot(abs(q), ").concat(t,"AX), abs(q).x);\n // Covered by this cell's grown hexagon, and nearer than\n // whatever we have so far.\n if (hd <= 0.5 * s && s > ").concat(t,"bestS) {\n ").concat(t,"bestS = s; ").concat(t,"bestC = c; ").concat(t,"bestF = f;\n }\n }")}).join(""),"\n center = ").concat(t,"bestC * ").concat(t,"size;\n // Divide by the winner's scale: the border test then reaches\n // 0.5 further out (a bigger hexagon) and the sample moves in\n // toward the centre (its content magnified to match), both by\n // the same factor, so proportions are preserved exactly.\n gv = (hp - ").concat(t,"bestC) / max(").concat(t,"bestS, 1e-3);\n warped = center + gv * ").concat(t,'size;\n gv = abs(gv);\n // Border strength follows the SAME falloff as the scale, so a\n // cell that has not been raised draws no border at all. Away\n // from the pointer bestF is 0, which means scale 1, sampling\n // untouched and edge 0 — bit-identical to the source image, so\n // nothing reveals that an effect is attached until the pointer\n // arrives. Pair with by:"hover" for a fully flush resting\n // state; by:"mouse" holds amt at 1 and so keeps a permanent\n // hotspot wherever the pointer last was.\n edge = max(edge, smoothstep(0.44, 0.5,\n max(dot(gv, ').concat(t,"AX), gv.x)) * ").concat(t,"bestF);\n }"):"\n {\n vec2 hp = warped / ".concat(t,"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(t,"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(t,e){return{size:["1f",(t.size||24)*e],lift:["1f",null!=t.lift?t.lift:0],radius:["1f",(t.radius||200)*e]}}},offset:{stage:"warp",defaultDriver:"mouse",decl:function(t){return"uniform float ".concat(t,"strength; uniform float ").concat(t,"radius;\n uniform vec2 ").concat(t,"dpos; uniform float ").concat(t,"damt;")},code:function(t){return"\n {\n float d = length(warped - ".concat(t,"dpos);\n float fall = 1.0 - smoothstep(0.0, ").concat(t,"radius, d);\n vec2 dir = d > 0.5 ? (warped - ").concat(t,"dpos) / d : vec2(0.0);\n warped -= dir * ").concat(t,"strength * fall * ").concat(t,"damt;\n }")},uniforms:function(t,e){return{strength:["1f",(t.strength||20)*e],radius:["1f",(t.radius||260)*e]}}},duotone:{stage:"color",decl:function(t){return"uniform vec3 ".concat(t,"a; uniform vec3 ").concat(t,"b; uniform float ").concat(t,"radius;\n uniform vec2 ").concat(t,"dpos; uniform float ").concat(t,"damt;")},code:function(t,e){return"\n {\n float lum = dot(col, vec3(0.299, 0.587, 0.114));\n vec3 duo = mix(".concat(t,"a, ").concat(t,"b, lum);\n ").concat(e.by?"float mask = (1.0 - smoothstep(".concat(t,"radius * 0.35, ").concat(t,"radius,\n length(center - ").concat(t,"dpos))) * ").concat(t,"damt;"):"float mask = 1.0;","\n col = mix(col, duo, mask);\n }")},uniforms:function(t,e){var n=t.colors||["#104B87","#E8FF00"];return{a:["3fv",p(n[0])],b:["3fv",p(n[1])],radius:["1f",(t.radius||220)*e]}}},edges:{stage:"color",decl:function(t){return"uniform vec3 ".concat(t,"color; uniform float ").concat(t,"strength;")},code:function(t){return"\n {\n edgeCol = ".concat(t,"color;\n edgeCov = max(edgeCov, edge * ").concat(t,"strength);\n }")},uniforms:function(t){return{color:["3fv",p(t.color||"#FFFFFF")],strength:["1f",null!=t.strength?t.strength:1]}}},halftone:{stage:"color",decl:function(t){return"\n uniform float ".concat(t,"size;\n uniform float ").concat(t,"angle;\n uniform vec3 ").concat(t,"ink;\n uniform vec3 ").concat(t,"paper;\n uniform float ").concat(t,"soft;\n uniform float ").concat(t,"radius;\n uniform vec2 ").concat(t,"dpos;\n uniform float ").concat(t,"damt;")},code:function(t,e){return"\n {\n float lum = dot(col, vec3(0.299, 0.587, 0.114));\n float sz = ".concat(t,"size;").concat(e.by?"\n float fd = 1.0 - smoothstep(0.0, ".concat(t,"radius, length(frag - ").concat(t,"dpos));\n sz *= 1.0 + fd * ").concat(t,"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(t,"angle), sa = sin(").concat(t,"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(t,"soft, length(cell));\n col = mix(").concat(t,"paper, ").concat(t,"ink, dm);\n }")},uniforms:function(t,e){return{size:["1f",(t.size||6)*e],angle:["1f",(null!=t.angle?t.angle:15)*Math.PI/180],ink:["3fv",p(t.ink||"#0B1B2B")],paper:["3fv",p(t.paper||"#FFFFFF")],soft:["1f",null!=t.softness?t.softness:.08],radius:["1f",(t.radius||220)*e]}}},dither:{stage:"color",decl:function(t){return"\n uniform float ".concat(t,"levels;\n uniform float ").concat(t,"size;\n uniform float ").concat(t,"amount;\n uniform vec3 ").concat(t,"ink;\n uniform vec3 ").concat(t,"paper;\n uniform vec2 ").concat(t,"dpos;\n uniform float ").concat(t,"damt;\n uniform float ").concat(t,"radius;\n // Bayer matrices by recursive bit-interleave rather than a\n // 64-entry table: WebGL1 has no constant array indexing, and\n // the nesting is exactly the recursive definition of the\n // ordered-dither matrix.\n float ").concat(t,"b2(vec2 a) {\n a = floor(a);\n return fract(a.x * 0.5 + a.y * a.y * 0.75);\n }\n float ").concat(t,"b4(vec2 a) { return ").concat(t,"b2(0.5 * a) * 0.25 + ").concat(t,"b2(a); }\n float ").concat(t,"b8(vec2 a) { return ").concat(t,"b4(0.5 * a) * 0.25 + ").concat(t,"b2(a); }")},code:function(t,e){return"\n {\n float sz = max(".concat(t,"size, 1e-3);").concat(e.by?"\n float fd = 1.0 - smoothstep(0.0, ".concat(t,"radius, length(frag - ").concat(t,"dpos));\n sz *= 1.0 + fd * ").concat(t,"damt * 1.8;"):"","\n // Centre the threshold on zero so dithering does not lift or\n // crush the overall exposure, only redistributes it.\n float t = ").concat(t,"b8(frag / sz) - 0.5;\n float lv = max(").concat(t,"levels, 1.0);\n ").concat(e.mono?"\n float lum = dot(col, vec3(0.299, 0.587, 0.114));\n float q = step(0.5, lum + t);\n vec3 dq = mix(".concat(t,"ink, ").concat(t,"paper, q);"):"\n // Per channel: scale to level index, offset by the threshold,\n // round, scale back. The +t before rounding is what turns a\n // hard band edge into an interleaved pattern of the two\n // neighbouring levels.\n vec3 dq = floor(col * lv + 0.5 + t) / lv;","\n col = mix(col, clamp(dq, 0.0, 1.0), clamp(").concat(t,"amount, 0.0, 1.0));\n }")},uniforms:function(t,e){return{levels:["1f",null!=t.levels?t.levels:6],size:["1f",(null!=t.size?t.size:1)*e],amount:["1f",null!=t.amount?t.amount:1],ink:["3fv",p(t.ink||"#0B1B2B")],paper:["3fv",p(t.paper||"#FFFFFF")],radius:["1f",(t.radius||220)*e]}}},aberration:{stage:"displace",chroma:!0,decl:function(t){return"\n uniform float ".concat(t,"amount;\n uniform float ").concat(t,"radius;\n uniform vec2 ").concat(t,"dpos;\n uniform float ").concat(t,"damt;")},code:function(t,e){return"\n {\n vec2 ctr = ".concat(e.by?"".concat(t,"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(e.by?"float amt = ".concat(t,"amount * ").concat(t,"damt *\n (1.0 - smoothstep(0.0, ").concat(t,"radius, dl));"):"float amt = ".concat(t,"amount * (dl / max(length(u_res) * 0.5, 1.0));"),"\n chroma += dir * amt;\n }")},uniforms:function(t,e){return{amount:["1f",(null!=t.amount?t.amount:6)*e],radius:["1f",(t.radius||240)*e]}}},mask:{stage:"field",producesField:!0,defaultDriver:"static",decl:function(t){return"\n uniform vec2 ".concat(t,"dpos;\n uniform float ").concat(t,"damt;\n uniform float ").concat(t,"radius;\n uniform vec2 ").concat(t,"at;\n uniform vec2 ").concat(t,"remap;\n uniform float ").concat(t,"invert;")},code:function(t,e){var n=e.from||"radial",r=e.at?"(".concat(t,"at * u_res)"):"".concat(t,"dpos"),i="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(t,"radius, length(frag - ").concat(r,"))");return"\n {\n float m = ".concat(i,";\n m = clamp((m - ").concat(t,"remap.x) / max(").concat(t,"remap.y - ").concat(t,"remap.x, 1e-4), 0.0, 1.0);\n m = mix(m, 1.0 - m, ").concat(t,"invert);\n ").concat(g(e.as||"mask")," *= m * ").concat(t,"damt;\n }")},uniforms:function(t,e){return{radius:["1f",(null!=t.radius?t.radius:260)*e],at:["2fv",t.at||[.5,.5]],remap:["2fv",t.remap||[0,1]],invert:["1f",t.invert?1:0]}}},noise:{stage:"field",producesField:!0,decl:function(t){return"\n uniform float ".concat(t,"scale;\n uniform float ").concat(t,"speed;\n uniform vec2 ").concat(t,"remap;\n uniform float ").concat(t,"amp;\n float ").concat(t,"h(vec2 v) {\n return fract(sin(dot(v, vec2(41.113, 289.717))) * 43758.545);\n }\n float ").concat(t,"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(t,"h(i), ").concat(t,"h(i + vec2(1.0, 0.0)), f.x),\n mix(").concat(t,"h(i + vec2(0.0, 1.0)), ").concat(t,"h(i + vec2(1.0, 1.0)), f.x), f.y);\n }")},code:function(t,e){return"\n {\n vec2 np = frag / max(u_res.y, 1.0) * ".concat(t,"scale;\n // Two octaves: enough structure to read as turbulence\n // without the cost of a full fBm.\n float n = ").concat(t,"n(np + u_time * ").concat(t,"speed) * 0.65 +\n ").concat(t,"n(np * 2.7 - u_time * ").concat(t,"speed * 0.6) * 0.35;\n n = clamp((n - ").concat(t,"remap.x) / max(").concat(t,"remap.y - ").concat(t,"remap.x, 1e-4), 0.0, 1.0);\n ").concat(g(e.as||"mask")," *= mix(1.0, n, ").concat(t,"amp);\n }")},uniforms:function(t){return{scale:["1f",null!=t.scale?t.scale:3],speed:["1f",null!=t.speed?t.speed:.3],remap:["2fv",t.remap||[0,1]],amp:["1f",null!=t.amount?t.amount:1]}}},copy:{stage:"color",defaultDriver:"static",decl:function(t){return"\n uniform vec2 ".concat(t,"dpos;\n uniform float ").concat(t,"damt;\n uniform float ").concat(t,"radius;\n uniform float ").concat(t,"scale;\n uniform float ").concat(t,"rotate;\n uniform float ").concat(t,"fade;\n uniform float ").concat(t,"amount;")},code:function(t,e){for(var n=Array.isArray(e.points)&&e.points.length>0,r=n?e.points.length:Math.max(1,Math.min(24,Math.round(e.count||5))),i="",o=function(o){var a,s=n?"vec2(".concat((+e.points[o][0]).toFixed(5),", ").concat((+e.points[o][1]).toFixed(5),") * u_res"):(a=o/r*Math.PI*2,"".concat(t,"dpos + vec2(").concat(Math.cos(a).toFixed(5),", ")+"".concat(Math.sin(a).toFixed(5),") * ").concat(t,"radius"));i+="\n {\n float ang = ".concat(t,"rotate * ").concat((o+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(t,"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(t,"amount * ").concat(t,"damt\n * pow(").concat(t,"fade, ").concat(o.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++)o(a);return i},uniforms:function(t,e){return{radius:["1f",(null!=t.radius?t.radius:110)*e],scale:["1f",null!=t.scale?t.scale:.5],rotate:["1f",null!=t.rotate?t.rotate:0],fade:["1f",null!=t.fade?t.fade:1],amount:["1f",null!=t.amount?t.amount:1]}}},merge:{stage:"color",decl:function(t){return"uniform float ".concat(t,"mix;")},code:function(){return""},uniforms:function(t){return{mix:["1f",null!=t.mix?t.mix:1]}}},echo:{stage:"color",decl:function(t){return"\n uniform sampler2D ".concat(t,"hist;\n uniform float ").concat(t,"strength;\n uniform vec3 ").concat(t,"tint;\n uniform float ").concat(t,"tintAmt;")},code:function(t){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(t,"hist, clamp(huv, 0.001, 0.999));\n float ha = clamp(h.a * ").concat(t,"strength, 0.0, 1.0);\n vec3 hc = mix(h.rgb, ").concat(t,"tint, ").concat(t,"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(t){return{strength:["1f",null!=t.strength?t.strength:.85],tint:["3fv",p(t.tint||"#7FD4FF")],tintAmt:["1f",t.tint?null!=t.tintAmount?t.tintAmount:.5:0]}},solver:{resolutions:function(t,e,n){return{frame:[e,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(t,e,n){var r=Math.min(n.dt,1/30),i=Math.pow(null!=e.decay?e.decay:.92,60*r);t.use("accumulate"),t.f2("u_texel",1/t.canvasW,1/t.canvasH),t.f1("u_decay",i),t.smp("u_content",t.content,0),t.smp("u_hist",t.read("history"),1),t.blit(t.write("history")),t.swap("history")}}},stir:{stage:["warp","color"],decl:function(t){return"\n uniform sampler2D ".concat(t,"vel;\n uniform sampler2D ").concat(t,"dye;\n uniform float ").concat(t,"strength;\n uniform float ").concat(t,"dyemix;\n uniform float ").concat(t,"intensity;\n uniform float ").concat(t,"sheen;\n uniform vec3 ").concat(t,"tint;")},code:function(t,e,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(t,"vel, clamp(fuv, 0.001, 0.999)).xy;\n warped += vec2(v.x, -v.y) * ").concat(t,"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(t,"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(t,"tint;\n float amt = clamp((1.0 - exp(-mag * ").concat(t,"intensity)) * ").concat(t,"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(t,"vel, clamp(suv, 0.001, 0.999)).xy);\n col = mix(col, ").concat(t,"tint, (1.0 - exp(-sp * 0.7)) * ").concat(t,"sheen);\n }")},uniforms:function(t,e){return{strength:["1f",(null!=t.strength?t.strength:26)*e],sheen:["1f",null!=t.sheen?t.sheen:.15],tint:["3fv",p(t.tint||"#7FD4FF")],dyemix:["1f",null!=t.dye?t.dye:.85],intensity:["1f",null!=t.intensity?t.intensity:1.6]}},solver:{resolutions:function(t){return{sim:Math.max(32,Math.min(t.resolution||128,512)),dye:Math.max(64,Math.min(t.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(t,e,n){var r=null!=t.dyeAmount?t.dyeAmount:.6;if(!t.rainbow){var i=p(t.tint||"#7FD4FF");return[i[0]*r,i[1]*r,i[2]*r]}var o=Math.atan2(n,e);return[(.5+.5*Math.cos(o))*r,(.5+.5*Math.cos(o+2.0944))*r,(.5+.5*Math.cos(o+4.1888))*r]},step:function(t,e,n){var r=Math.min(n.dt,1/30),i=1/t.res.sim,o=1/t.res.dye,a=function(t,e){return Math.pow(t,60*e)};if(n.moving){var s=null!=e.force?e.force:1;t.use("splat"),t.f1("u_radius",null!=e.radius?e.radius:.1),t.f1("u_aspect",n.aspect),t.f2("u_point",n.px,n.py),t.f2("u_texel",i,i),t.smp("u_src",t.read("velocity"),0),t.f3("u_amount",n.dx*s,n.dy*s,0),t.blit(t.write("velocity")),t.swap("velocity"),t.f2("u_texel",o,o),t.smp("u_src",t.read("dye"),0),t.f3("u_amount",n.col[0],n.col[1],n.col[2]),t.blit(t.write("dye")),t.swap("dye")}t.use("curl"),t.f2("u_texel",i,i),t.smp("u_vel",t.read("velocity"),0),t.blit(t.single("vorticity")),t.use("confine"),t.f2("u_texel",i,i),t.f1("u_eps",null!=e.curl?e.curl:2.2),t.f1("u_dt",r),t.smp("u_vel",t.read("velocity"),0),t.smp("u_curl",t.single("vorticity"),1),t.blit(t.write("velocity")),t.swap("velocity"),t.use("divergence"),t.f2("u_texel",i,i),t.smp("u_vel",t.read("velocity"),0),t.blit(t.single("divergence")),t.use("decay"),t.f2("u_texel",i,i),t.f1("u_value",a(null!=e.pressure?e.pressure:.8,r)),t.smp("u_tex",t.read("pressure"),0),t.blit(t.write("pressure")),t.swap("pressure"),t.use("jacobi"),t.f2("u_texel",i,i),t.smp("u_div",t.single("divergence"),1);for(var l=Math.max(1,Math.min(e.pressureIterations||6,40)),c=0;c<l;c++)t.smp("u_p",t.read("pressure"),0),t.blit(t.write("pressure")),t.swap("pressure");t.use("subtract"),t.f2("u_texel",i,i),t.smp("u_p",t.read("pressure"),0),t.smp("u_vel",t.read("velocity"),1),t.blit(t.write("velocity")),t.swap("velocity"),t.use("advect"),t.f1("u_dt",r),t.f2("u_texel",i,i),t.smp("u_vel",t.read("velocity"),0),t.smp("u_src",t.read("velocity"),0),t.f1("u_diss",a(null!=e.decay?e.decay:.985,r)),t.blit(t.write("velocity")),t.swap("velocity"),t.f2("u_texel",o,o),t.smp("u_vel",t.read("velocity"),0),t.smp("u_src",t.read("dye"),1),t.f1("u_diss",a(null!=e.dyeFade?e.dyeFade:.97,r)),t.blit(t.write("dye")),t.swap("dye")}}},blobs:{stage:"color",overlay:!0,mips:!0,decl:function(t){return"\n uniform vec3 ".concat(t,"blobs[").concat(12,"];\n uniform int ").concat(t,"count;\n uniform vec3 ").concat(t,"tint;\n uniform float ").concat(t,"refract;\n uniform float ").concat(t,"rim;\n uniform float ").concat(t,"alpha;\n uniform float ").concat(t,"irid;\n uniform float ").concat(t,"disp;\n uniform float ").concat(t,"frost;\n float ").concat(t,"hash(vec3 v) {\n return fract(sin(dot(v, vec3(21.9898, 63.233, 41.719))) * 41739.317);\n }\n float ").concat(t,"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(t,"hash(f);\n float c100 = ").concat(t,"hash(f + vec3(1.0, 0.0, 0.0));\n float c010 = ").concat(t,"hash(f + vec3(0.0, 1.0, 0.0));\n float c110 = ").concat(t,"hash(f + vec3(1.0, 1.0, 0.0));\n float c001 = ").concat(t,"hash(f + vec3(0.0, 0.0, 1.0));\n float c101 = ").concat(t,"hash(f + vec3(1.0, 0.0, 1.0));\n float c011 = ").concat(t,"hash(f + vec3(0.0, 1.0, 1.0));\n float c111 = ").concat(t,"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(t){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(t,"count) break;\n vec2 bd = frag - ").concat(t,"blobs[bi].xy;\n float br = ").concat(t,"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(t,"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(t,"refract / max(abs(tR.z), 0.3));\n vec2 oG = tG.xy * (").concat(t,"refract / max(abs(tG.z), 0.3));\n vec2 oB = tB.xy * (").concat(t,"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(t,"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(t,"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(t,"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(t,"noise(rf * 2.3 + u_time * 0.5);\n float nB = ").concat(t,"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(t,"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(t,"alpha);\n }\n }")},uniforms:function(t,e){return{tint:["3fv",p(t.color||"#EAF4EE")],refract:["1f",(null!=t.refract?t.refract:70)*e],rim:["1f",null!=t.rim?t.rim:.6],alpha:["1f",null!=t.alpha?t.alpha:1],irid:["1f",null!=t.iridescence?t.iridescence:.8],disp:["1f",null!=t.dispersion?t.dispersion:1],frost:["1f",null!=t.frost?t.frost:.25]}},init:function(t,e,n,r){for(var i=(t.radius||46)*e,o=Math.max(1,Math.min(null!=t.trail?t.trail:7,12)),a=[],s=0,l=0;l<o;l++){var c=Math.pow(.86,l);a.push(c),s+=c*c}for(var u=Math.sqrt(s),d=a.map(function(t){return i*t/u}),f=a.map(function(t,e){return.85*i*Math.pow(.955,e)}),h=function(t,e){return t+Math.random()*(e-t)},p=Math.max(0,Math.min((t.count||1)-1,12-o)),y=[],m=0;m<p;m++){var v=h(0,2*Math.PI),g=h(30,80)*e;y.push({x:h(i,n-i),y:h(i,r-i),r:i*h(.45,.8),vx:Math.cos(v)*g,vy:Math.sin(v)*g,phase:h(0,2*Math.PI)})}for(var b={x:.5*n,y:.55*r},w=[],x=0;x<o;x++)w.push({x:b.x,y:b.y});return{head:b,chain:w,nTrail:o,drifters:y,trailIdleR:d,trailMoveR:f,stretch:0,seg:.9*i}},tick:function(t,e){var n=Math.min(e.dt,.05),r=e.w,i=e.h,o=1-Math.exp(9*-n);t.head.x+=(e.mouseX-t.head.x)*o,t.head.y+=(e.mouseY-t.head.y)*o;var a=t.chain;a[0].x=t.head.x,a[0].y=t.head.y;for(var l=1-Math.exp(16*-n),c=1;c<a.length;c++){var u=a[c-1],d=a[c],f=u.x-d.x,h=u.y-d.y,p=Math.hypot(f,h)||1e-4,y=t.seg;p>y&&(d.x+=f*(1-y/p),d.y+=h*(1-y/p)),d.x+=(u.x-d.x)*l,d.y+=(u.y-d.y)*l}var m=a[a.length-1],v=Math.hypot(m.x-t.head.x,m.y-t.head.y),g=Math.max(1,t.seg*(t.nTrail-1)),b=Math.min(1,v/g);t.stretch+=(b-t.stretch)*(1-Math.exp(8*-n));var w,x=s(t.drifters);try{for(x.s();!(w=x.n()).done;){var k=w.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>i-k.r&&(k.y=i-k.r,k.vy=-Math.abs(k.vy)),k.phase+=1.6*n}}catch(t){x.e(t)}finally{x.f()}for(var S=new Float32Array(36),O=t.stretch,j=0;j<t.nTrail;j++){var C=a[j];S[3*j]=C.x,S[3*j+1]=C.y,S[3*j+2]=t.trailIdleR[j]+(t.trailMoveR[j]-t.trailIdleR[j])*O}return t.drifters.forEach(function(e,n){var r=t.nTrail+n;S[3*r]=e.x,S[3*r+1]=e.y,S[3*r+2]=e.r*(1+.12*Math.sin(e.phase))}),[{name:"blobs",kind:"3fv",value:S},{name:"count",kind:"1i",value:t.nTrail+t.drifters.length}]}}};function p(t){return[1,3,5].map(function(e){return parseInt(t.slice(e,e+2),16)/255})}var y=Object.keys(h).concat("switch"),m="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"]},g=function(t){return"fld_".concat(String(t).replace(/[^A-Za-z0-9_]/g,""))},b=function(t){return!0===t.masked?"mask":"string"==typeof t.masked?t.masked:null},w=function(t){return"edge"===t||"edgeCov"===t||"ovA"===t?"float":"col"===t||"edgeCol"===t||"ovCol"===t?"vec3":"vec2"},x={over:function(t,e){return e},add:function(t,e){return"min(".concat(t," + ").concat(e,", vec3(1.0))")},screen:function(t,e){return"1.0 - (1.0 - ".concat(t,") * (1.0 - ").concat(e,")")},multiply:function(t,e){return"".concat(t," * ").concat(e)},difference:function(t,e){return"abs(".concat(t," - ").concat(e,")")},lighten:function(t,e){return"max(".concat(t,", ").concat(e,")")},darken:function(t,e){return"min(".concat(t,", ").concat(e,")")}};function k(t,e){var n,r=[],i=s(t||[]);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(o&&o.op){var a={node:o,i:e.length};e.push(o),"merge"===o.op&&(a.a=k(o.a,e),a.b=k(o.b,e)),r.push(a)}}}catch(t){i.e(t)}finally{i.f()}return r}function S(t,e){var n,r=s(t);try{var i=function(){var t=n.value,r=t.node;if("merge"===r.op)return function(t,e){var n="u".concat(t.i,"_"),r=x[t.node.mode]||x.over,i={field:"",warp:"",cell:"",displace:"",color:""},o={field:"",warp:"",cell:"",displace:"",color:""};S(t.a||[],i),S(t.b||[],o),e.field+=i.field+o.field;for(var a=function(){var t=l[s];if(!i[t]&&!o[t])return 1;var a=v[t],c=" {\n";a.forEach(function(t,e){c+=" ".concat(w(t)," pre").concat(e," = ").concat(t,";\n")}),c+=i[t],a.forEach(function(t,e){c+=" ".concat(w(t)," bra").concat(e," = ").concat(t,";\n")}),a.forEach(function(t,e){c+=" ".concat(t," = pre").concat(e,";\n")}),c+=o[t],a.forEach(function(t,e){var i="vec3"===w(t)?r("bra".concat(e),t):t;c+=" ".concat(t," = mix(bra").concat(e,", ").concat(i,", ").concat(n,"mix);\n")}),c+=" }\n",e[t]+=c},s=0,l=["warp","cell","displace","color"];s<l.length;s++)a()}(t,e),0;var i=h[r.op];if(!i)return 0;var o="u".concat(t.i,"_"),a=Array.isArray(i.stage)?i.stage:[i.stage],s=b(r);a.forEach(function(t){var n=i.code(o,r,t)+"\n";if(s&&v[t]){var a=v[t],l=a.map(function(t,e){return" ".concat(w(t)," msv").concat(e," = ").concat(t,";")}).join("\n"),c=a.map(function(t,e){return" ".concat(t," = mix(msv").concat(e,", ").concat(t,", ").concat(g(s),");")}).join("\n");n=" {\n".concat(l,"\n").concat(n,"\n").concat(c,"\n }\n")}e["field"===t||"warp"===t||"cell"===t||"displace"===t?t:"color"]+=n})};for(r.s();!(n=r.n()).done;)i()}catch(t){r.e(t)}finally{r.f()}}var O=/\d(?:vw|vh|vmin|vmax|dvw|dvh|svw|svh|lvw|lvh)\b/i;var j={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 C(t){if("function"==typeof t)try{return!!t()}catch(t){return!1}if("boolean"==typeof t)return t;if("string"!=typeof t||""===t)return!1;var e=j[t]||t;if("undefined"==typeof window||"function"!=typeof window.matchMedia)return!1;try{return window.matchMedia(e).matches}catch(t){return!1}}function E(t,e){if(!Array.isArray(t))return[];if((e||0)>8)return[];var n,r=[],i=s(t);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(o&&"switch"===o.op){var a,l=s(E((C(o.when)?o.use:o.else)||[],(e||0)+1));try{for(l.s();!(a=l.n()).done;){var c=a.value;r.push(c)}}catch(t){l.e(t)}finally{l.f()}}else r.push(o)}}catch(t){i.e(t)}finally{i.f()}return r}var T=new Set(["IMG","VIDEO","CANVAS","IFRAME","INPUT","EMBED","OBJECT","TEXTAREA","SELECT","BR","HR","AREA","SOURCE","TRACK","WBR"]),_=["objectFit","objectPosition","borderRadius","imageRendering","filter"];function P(t,e){if(!t||"undefined"==typeof document||"undefined"==typeof window)return null;if(!e||0===e.length)return null;if(e.some(function(t){return t&&"switch"===t.op})&&0===(e=E(e,0)).length)return null;var n=[],r=k(e,n);if(e=n,"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return null;if(T.has(t.tagName)){var i=t.parentElement&&t.parentElement.hasAttribute&&t.parentElement.hasAttribute("data-nodality-raster-host")?t.parentElement:null;if(t=i||function(t){if(!t.parentNode)return null;var e,n={},r=s(_);try{for(r.s();!(e=r.n()).done;){var i=e.value;t.style[i]&&(n[i]=t.style[i])}}catch(t){r.e(t)}finally{r.f()}var o=document.createElement("div");return o.setAttribute("data-nodality-raster-host",t.tagName.toLowerCase()),o.style.cssText=t.style.cssText,t.parentNode.insertBefore(o,t),o.appendChild(t),t.removeAttribute("style"),Object.assign(t.style,n),t.style.display="block",t.style.width="100%",t.style.height="100%","static"===("function"==typeof getComputedStyle?getComputedStyle(o).position:"static")&&(o.style.position="relative"),o.style.width||(o.style.width="100%"),o.style.height||(o.style.height="100%"),o}(t),!t)return null}if(t.querySelector&&t.querySelector(":scope > canvas[data-nodality-raster]"))return null;var c=function(){var e=t.getBoundingClientRect();return{width:e.width>=2?e.width:t.scrollWidth||0,height:e.height>=2?e.height:t.scrollHeight||0}},u=c();if(u.width<2||u.height<2)return null;var p=Math.min(window.devicePixelRatio||1,2),y=e.some(function(t){return(h[t.op]||{}).overlay}),v=e.every(function(t){return(h[t.op]||{}).overlay}),w=!v&&!e.some(function(t){return!1===t.live}),x="undefined"!=typeof WebGL2RenderingContext&&"texElementImage2D"in WebGL2RenderingContext.prototype||"undefined"!=typeof WebGLRenderingContext&&"texElementImage2D"in WebGLRenderingContext.prototype,j=w&&x;w&&!j&&console.info("[nodality] HTML-in-Canvas API not available - raster ops fall back to snapshot capture.");var C=document.createElement("canvas");j&&C.setAttribute("layoutsubtree","");var P={alpha:!0,premultipliedAlpha:!1},A=C.getContext("webgl2",P)||C.getContext("webgl",P);if(!A)return null;var R="undefined"!=typeof WebGL2RenderingContext&&A instanceof WebGL2RenderingContext,M=R&&e.some(function(t){return(h[t.op]||{}).mips});j&&!("texElementImage2D"in A)&&(console.info("[nodality] texElementImage2D missing on the created context - snapshot fallback."),C.removeAttribute("layoutsubtree"),j=!1),"static"===window.getComputedStyle(t).position&&(t.style.position="relative"),C.width=Math.round(u.width*p),C.height=Math.round(u.height*p),C.setAttribute("data-nodality-raster",j?"live":"snapshot"),console.info("[nodality] raster backend:",j?"html-in-canvas (live)":"snapshot");var L=t;if(j){var z=document.createElement("div"),I=getComputedStyle(t),F="flex"===I.display||"inline-flex"===I.display;for(z.style.cssText="display:".concat(F?"flex":"block",";")+"width:".concat(u.width,"px;height:").concat(u.height,"px;"),F&&(z.style.flexDirection=I.flexDirection,z.style.alignItems=I.alignItems,z.style.justifyContent=I.justifyContent,z.style.gap=I.gap);t.firstChild;)z.appendChild(t.firstChild);C.appendChild(z),L=z,C.style.cssText="display:block;width:".concat(u.width,"px;height:").concat(u.height,"px;")}else if(C.style.cssText="position:absolute;top:0;left:0;"+"width:".concat(u.width,"px;height:").concat(u.height,"px;")+"pointer-events:none;z-index:2147483000;",v)C.setAttribute("aria-hidden","true");else{C.setAttribute("role","img");var W=(t.textContent||"").replace(/\s+/g," ").trim();W&&C.setAttribute("aria-label",W.slice(0,300))}t.appendChild(C);var D=function(t,e){var n=A.createShader(t);if(A.shaderSource(n,e),A.compileShader(n),!A.getShaderParameter(n,A.COMPILE_STATUS))throw new Error("[nodality] raster shader: "+A.getShaderInfoLog(n));return n},B=A.createProgram();A.attachShader(B,D(A.VERTEX_SHADER,m)),A.attachShader(B,D(A.FRAGMENT_SHADER,function(t,e){var n="",r=new Set;e.forEach(function(t){var e=h[t.op];e&&e.producesField&&r.add(t.as||"mask");var n=b(t);n&&r.add(n)});var i=a(r).map(function(t){return" float ".concat(g(t)," = 1.0;")}).join("\n");e.forEach(function(t,e){var r=h[t.op];r&&(n+=r.decl("u".concat(e,"_"),t)+"\n")});var o={field:"",warp:"",cell:"",displace:"",color:""};S(t,o);var s=o.field,l=o.warp,c=o.cell,u=o.displace,d=o.color,f=e,p=f.some(function(t){return"edges"===t.op})?"":" col *= 1.0 - edge * 0.55;",y=f.some(function(t){return(h[t.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(i,"\n").concat(s,"\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(y,"\n vec3 edgeCol = vec3(1.0);\n float edgeCov = 0.0;\n vec3 ovCol = vec3(0.0);\n float ovA = 0.0;\n").concat(d,"\n").concat(p,"\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,e))),A.bindAttribLocation(B,0,"a"),A.linkProgram(B),A.useProgram(B),A.bindBuffer(A.ARRAY_BUFFER,A.createBuffer()),A.bufferData(A.ARRAY_BUFFER,new Float32Array([-1,-1,3,-1,-1,3]),A.STATIC_DRAW),A.enableVertexAttribArray(0),A.vertexAttribPointer(0,2,A.FLOAT,!1,0,0);var N=function(t){return A.getUniformLocation(B,t)},H=function(t,e,n){"1f"===e?A.uniform1f(t,n):"1i"===e?A.uniform1i(t,n):"2fv"===e?A.uniform2fv(t,n):"3fv"===e&&A.uniform3fv(t,n)};e.forEach(function(t,e){var n=h[t.op];if(n&&n.uniforms){var r=n.uniforms(t,p);for(var i in r)H(N("u".concat(e,"_").concat(i)),r[i][0],r[i][1])}});var G=[];e.forEach(function(t,e){var n=h[t.op];n&&"function"==typeof n.init&&G.push({i:e,def:n,state:n.init(t,p,C.width,C.height)})});var U="undefined"!=typeof performance?performance.now():0,q=[];e.forEach(function(t,e){var n=h[t.op];if(n&&n.solver){var r=function(t,e){var n=h[t.op];if(!R||!A.getExtension("EXT_color_buffer_float"))return console.info("[nodality] '"+t.op+"' needs WebGL2 float render targets - op skipped."),null;A.getExtension("OES_texture_float_linear");var r=n.solver.resolutions(t,C.width,C.height),i={r:[A.R16F,A.RED],rg:[A.RG16F,A.RG],rgba:[A.RGBA16F,A.RGBA]},o=[],a=function(t,e,n,r){var a=l(i[n],2),s=a[0],c=a[1],u=A.createTexture();A.bindTexture(A.TEXTURE_2D,u);var d=r?A.LINEAR:A.NEAREST;A.texParameteri(A.TEXTURE_2D,A.TEXTURE_MIN_FILTER,d),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_MAG_FILTER,d),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_WRAP_S,A.CLAMP_TO_EDGE),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_WRAP_T,A.CLAMP_TO_EDGE),A.texImage2D(A.TEXTURE_2D,0,s,t,e,0,c,A.HALF_FLOAT,null);var f=A.createFramebuffer();A.bindFramebuffer(A.FRAMEBUFFER,f),A.framebufferTexture2D(A.FRAMEBUFFER,A.COLOR_ATTACHMENT0,A.TEXTURE_2D,u,0);var h=A.checkFramebufferStatus(A.FRAMEBUFFER)===A.FRAMEBUFFER_COMPLETE;A.viewport(0,0,t,e),A.clearColor(0,0,0,1),A.clear(A.COLOR_BUFFER_BIT);var p={tex:u,fbo:f,w:t,h:e,ok:h};return o.push(p),p},s={},c=!0;for(var u in n.solver.targets){var d=n.solver.targets[u],f=r[d.res],p=l(Array.isArray(f)?f:[f,f],2),y=p[0],v=p[1];d.double?(s[u]={a:a(y,v,d.fmt,d.smooth),b:a(y,v,d.fmt,d.smooth)},c=c&&s[u].a.ok&&s[u].b.ok):(s[u]={a:a(y,v,d.fmt,d.smooth)},c=c&&s[u].a.ok)}A.bindFramebuffer(A.FRAMEBUFFER,null);var g=function(){return o.forEach(function(t){A.deleteFramebuffer(t.fbo),A.deleteTexture(t.tex)})};if(!c)return console.info("[nodality] '"+t.op+"' float targets incomplete - op skipped."),g(),null;var b={};try{for(var w in n.solver.programs){var x=A.createProgram();if(A.attachShader(x,D(A.VERTEX_SHADER,m)),A.attachShader(x,D(A.FRAGMENT_SHADER,n.solver.programs[w])),A.bindAttribLocation(x,0,"a"),A.linkProgram(x),!A.getProgramParameter(x,A.LINK_STATUS))throw new Error(w+": "+A.getProgramInfoLog(x));b[w]={prog:x,loc:{}}}}catch(e){for(var k in console.warn("[nodality] '"+t.op+"' solver programs failed:",e),g(),b)A.deleteProgram(b[k].prog);return null}return A.useProgram(B),{i:e,node:t,def:n,res:r,targets:s,progs:b,cleanup:g,prevX:.5,prevY:.5,primed:!1}}(t,e);r&&q.push(r)}});var J=function(t,e){var n=null,r={res:t.res,use:function(e){n=t.progs[e],A.useProgram(n.prog)},u:function(t){return t in n.loc||(n.loc[t]=A.getUniformLocation(n.prog,t)),n.loc[t]},f1:function(t,e){A.uniform1f(r.u(t),e)},f2:function(t,e,n){A.uniform2f(r.u(t),e,n)},f3:function(t,e,n,i){A.uniform3f(r.u(t),e,n,i)},smp:function(t,e,n){A.activeTexture(A.TEXTURE0+n),A.bindTexture(A.TEXTURE_2D,e.tex),A.uniform1i(r.u(t),n)},read:function(e){return t.targets[e].a},write:function(e){return t.targets[e].b},single:function(e){return t.targets[e].a},content:{tex:X},canvasW:C.width,canvasH:C.height,swap:function(e){var n=t.targets[e],r=n.a;n.a=n.b,n.b=r},blit:function(t){A.bindFramebuffer(A.FRAMEBUFFER,t.fbo),A.viewport(0,0,t.w,t.h),A.drawArrays(A.TRIANGLES,0,3)}},i=at[0]/C.width,o=1-at[1]/C.height,a=0,s=0;t.primed&&st&&(a=(i-t.prevX)/Math.max(e,.001),s=(o-t.prevY)/Math.max(e,.001)),t.prevX=i,t.prevY=o,t.primed=!0;var l=st&&Math.abs(a)+Math.abs(s)>.001;t.def.solver.step(r,t.node,{dt:e,px:i,py:o,dx:a,dy:s,moving:l,aspect:C.width/Math.max(C.height,1),col:t.def.solver.splatColor(t.node,a,s)})},X=A.createTexture();A.bindTexture(A.TEXTURE_2D,X),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_MIN_FILTER,M?A.LINEAR_MIPMAP_LINEAR:A.LINEAR),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_WRAP_S,A.CLAMP_TO_EDGE),A.texParameteri(A.TEXTURE_2D,A.TEXTURE_WRAP_T,A.CLAMP_TO_EDGE),A.pixelStorei(A.UNPACK_FLIP_Y_WEBGL,!0);var $=function(){M&&A.generateMipmap(A.TEXTURE_2D)},V=!1,Y=!1,Q=j?"live":"snapshot",K=!1,Z={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"},tt=null,et=function(){if(t.style.visibility="",tt){var e,n=s(tt);try{for(n.s();!(e=n.n()).done;){var r=l(e.value,2),i=r[0],o=r[1];for(var a in Z)o[a]?i.style.setProperty(a,o[a]):i.style.removeProperty(a);o.op?i.style.setProperty("opacity",o.op):i.style.removeProperty("opacity")}}catch(t){n.e(t)}finally{n.f()}tt=null,t.style.isolation="",C.style.zIndex=""}},nt=function(){if(y){var e=function(){var e="IMG"===t.tagName?t:t.querySelector?t.querySelector("img"):null;return e&&e.complete&&e.naturalWidth>0?e:null}();if(e)try{return A.bindTexture(A.TEXTURE_2D,X),A.texImage2D(A.TEXTURE_2D,0,A.RGBA,A.RGBA,A.UNSIGNED_BYTE,e),$(),V=!0,Promise.resolve()}catch(t){}else if(!K){var n="IMG"===t.tagName?t:t.querySelector&&t.querySelector("img");n&&(K=!0,n.addEventListener("load",function(){Y||nt()},{once:!0}))}}C.style.display="none",et();var r=function(t,e,n,r){var i=function(t){if(!t)return null;var e=null;if("IMG"===t.tagName)e=t;else if(t.children){var n=Array.prototype.filter.call(t.children,function(t){return!t.hasAttribute||!t.hasAttribute("data-nodality-raster")});1===n.length&&"IMG"===n[0].tagName&&(e=n[0])}if(!e||!e.complete||!e.naturalWidth)return null;try{if(new URL(e.currentSrc||e.src,location.href).origin!==location.origin)return null}catch(t){return null}return e}(t);return i?Promise.resolve(function(t,e,n,r){var i=Math.max(1,Math.round(e*r)),o=Math.max(1,Math.round(n*r)),a=t.naturalWidth,s=t.naturalHeight;if(!a||!s)return t;var l="fill",c="50% 50%";if("function"==typeof getComputedStyle){var u=getComputedStyle(t);l=u.objectFit||"fill",c=u.objectPosition||"50% 50%"}if("fill"===l)return t;var d=i/a,f=o/s,h="cover"===l?Math.max(d,f):"contain"===l?Math.min(d,f):"none"===l?1:"scale-down"===l?Math.min(1,Math.min(d,f)):Math.max(d,f),p=a*h,y=s*h,m=String(c).trim().split(/\s+/),v=function(t,e){if(null==t)return.5;if(t.endsWith("%"))return parseFloat(t)/100;if("left"===t||"top"===t)return 0;if("right"===t||"bottom"===t)return 1;if("center"===t)return.5;var n=parseFloat(t);return isNaN(n)?.5:n/(0===e?Math.max(i-p,1):Math.max(o-y,1))},g=v(m[0],0),b=v(m.length>1?m[1]:m[0],1),w=document.createElement("canvas");w.width=i,w.height=o;var x=w.getContext("2d");return x?(x.drawImage(t,(i-p)*g,(o-y)*b,p,y),w):t}(i,e,n,r)):new Promise(function(i,o){var s=(new XMLSerializer).serializeToString(function(t,e){for(var n=[t].concat(a(t.querySelectorAll("*"))),r=[e].concat(a(e.querySelectorAll("*"))),i=0;i<n.length&&i<r.length;i++){var o=r[i].style;if(o&&0!==o.length)for(var s=null,l=0,c=Array.from(o);l<c.length;l++){var u=c[l];if(O.test(o.getPropertyValue(u))){var d=(s=s||window.getComputedStyle(n[i])).getPropertyValue(u);d&&o.setProperty(u,d,o.getPropertyPriority(u))}}}return e}(t,t.cloneNode(!0))),l='<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(e*r,'" height="').concat(n*r,'" viewBox="0 0 ').concat(e," ").concat(n,'">')+'<foreignObject width="100%" height="100%">'+'<div xmlns="http://www.w3.org/1999/xhtml">'.concat(s,"</div>")+"</foreignObject></svg>",c=new Image;c.onload=function(){return i(c)},c.onerror=o,c.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(l)})}(t,u.width,u.height,p).then(function(e){Y||(A.bindTexture(A.TEXTURE_2D,X),A.texImage2D(A.TEXTURE_2D,0,A.RGBA,A.RGBA,A.UNSIGNED_BYTE,e),$(),V=!0,v||function(){if(!tt){tt=[];for(var e=0,n=[t].concat(a(t.querySelectorAll("*")));e<n.length;e++){var r=n[e];if(r!==C&&"CANVAS"!==r.tagName){var i={op:r.style.getPropertyValue("opacity")};for(var o in Z)i[o]=r.style.getPropertyValue(o);for(var s in tt.push([r,i]),Z)r.style.setProperty(s,Z[s],"important");r!==t&&r.matches&&r.matches("img,svg,video,picture,iframe")&&r.style.setProperty("opacity","0","important")}}t.style.isolation="isolate",C.style.zIndex="-1"}}(),C.style.visibility="visible")}).catch(function(t){et(),console.warn("[nodality] raster snapshot failed:",t)});return C.style.display="",r},rt=-1,it=function(){if(!Y&&"live"===Q){A.bindTexture(A.TEXTURE_2D,X);var t,e=A.RGBA8||32856,n=[[A.TEXTURE_2D,e,L],[A.TEXTURE_2D,0,A.RGBA,A.RGBA,A.UNSIGNED_BYTE,L],[A.TEXTURE_2D,0,e,L],[A.TEXTURE_2D,0,L]];if(rt>=0)t=[rt];else{t=[0,1,2,3];var r={3:0,6:1,4:2}[A.texElementImage2D.length];null!=r&&(t.splice(t.indexOf(r),1),t.unshift(r))}var i,o=[],a=s(t);try{for(a.s();!(i=a.n()).done;){var l=i.value;try{return A.texElementImage2D.apply(A,n[l]),$(),rt<0&&(rt=l,console.info("[nodality] texElementImage2D signature discovered: form",l,"(declared arity "+A.texElementImage2D.length+")")),void(V=!0)}catch(t){o.push("form"+l+" -> "+(t&&t.name?t.name:"?")+": "+(t&&t.message?t.message:t))}}}catch(t){a.e(t)}finally{a.f()}ot("texElementImage2D rejected all known signatures (arity "+A.texElementImage2D.length+"): "+o.join(" | "))}},ot=function(e){if(!Y&&"live"===Q){for(Q="snapshot",console.warn("[nodality] live raster backend failed ("+e+") - falling back to snapshot."),C.removeEventListener("paint",it);L.firstChild;)t.appendChild(L.firstChild);L.parentNode===C&&C.removeChild(L),C.removeAttribute("layoutsubtree"),C.style.cssText="position:absolute;top:0;left:0;"+"width:".concat(u.width,"px;height:").concat(u.height,"px;")+"pointer-events:none;z-index:2147483000;",C.setAttribute("aria-hidden","true"),C.setAttribute("data-nodality-raster","snapshot-fallback"),nt()}};j&&(C.addEventListener("paint",it),setTimeout(function(){Y||"live"!==Q||V||ot("no paint event within 1500ms")},1500));var at=[.5*C.width,.5*C.height],st=!1,lt=function(t){var e=C.getBoundingClientRect(),n=t.touches?t.touches[0]:t,r=[(n.clientX-e.left)*p,(n.clientY-e.top)*p];r[0]===at[0]&&r[1]===at[1]||(st=!0),at=r};t.addEventListener("mousemove",lt,{passive:!0}),t.addEventListener("touchmove",lt,{passive:!0});var ct=0,ut=0,dt=function(){ct=1},ft=function(){ct=0};t.addEventListener("mouseenter",dt,{passive:!0}),t.addEventListener("mouseleave",ft,{passive:!0});var ht=[];e.forEach(function(t,e){var n=h[t.op]||{},r=t.by||n.defaultDriver;r&&d[r]?ht.push({i:e,fn:d[r]}):t.by&&console.warn("[nodality] unknown driver '"+t.by+"' on op '"+t.op+"' - known drivers: "+f.join(", "))});var pt=function(){if("undefined"==typeof window)return.5;var e=t.getBoundingClientRect(),n=window.innerHeight||1;return Math.max(0,Math.min(1,(n-e.top)/(n+e.height)))},yt=0,mt=!0,vt=function(){if(!Y){if(mt&&V){for(var t="undefined"!=typeof performance?performance.now():U+16,e=Math.max(0,(t-U)/1e3),n=0,r=q;n<r.length;n++){var i=r[n];J(i,e)}if(st=!1,A.bindFramebuffer(A.FRAMEBUFFER,null),A.useProgram(B),A.viewport(0,0,C.width,C.height),A.clearColor(0,0,0,0),A.clear(A.COLOR_BUFFER_BIT),A.uniform2f(N("u_res"),C.width,C.height),A.uniform2f(N("u_mouse"),at[0],at[1]),A.uniform1f(N("u_time"),t/1e3),ht.length>0){ut+=(ct-ut)*(1-Math.exp(8*-e));for(var o={mouseX:at[0],mouseY:at[1],w:C.width,h:C.height,t:t/1e3,hover:ut,scroll:pt()},a=0,l=ht;a<l.length;a++){var c=l[a],u=c.fn(o);A.uniform2f(N("u".concat(c.i,"_dpos")),u.x,u.y),A.uniform1f(N("u".concat(c.i,"_damt")),u.amt)}}if(G.length>0)for(var d={w:C.width,h:C.height,mouseX:at[0],mouseY:at[1],dt:e,t:t/1e3},f=0,h=G;f<h.length;f++){var p,y=h[f],m=s(y.def.tick(y.state,d));try{for(m.s();!(p=m.n()).done;){var v=p.value;H(N("u".concat(y.i,"_").concat(v.name)),v.kind,v.value)}}catch(t){m.e(t)}finally{m.f()}}A.activeTexture(A.TEXTURE0),A.bindTexture(A.TEXTURE_2D,X),A.uniform1i(N("u_tex"),0);for(var g=1,b=0,w=q;b<w.length;b++){var x=w[b],k=x.def.solver.samplers;for(var S in k)A.activeTexture(A.TEXTURE0+g),A.bindTexture(A.TEXTURE_2D,x.targets[k[S]].a.tex),A.uniform1i(N("u".concat(x.i,"_").concat(S)),g),g++}A.activeTexture(A.TEXTURE0),U=t,A.drawArrays(A.TRIANGLES,0,3)}yt=requestAnimationFrame(vt)}},gt=null;"undefined"!=typeof IntersectionObserver&&(gt=new IntersectionObserver(function(t){var e=l(t,1)[0];mt=e.isIntersecting})).observe(t);var bt=null,wt=0,xt=function(){if(!Y){var t=c();if(!(t.width<2||t.height<2)){var e=Math.round(t.width*p),n=Math.round(t.height*p);u.width=t.width,u.height=t.height,C.style.width=t.width+"px",C.style.height=t.height+"px";var r=C.width!==e||C.height!==n;r&&(C.width=e,C.height=n),"snapshot"===Q?nt():r&&it()}}};"undefined"!=typeof ResizeObserver&&(bt=new ResizeObserver(function(){!function(){if(!Y){var t=c();t.width<2||t.height<2||Math.round(t.width)===Math.round(u.width)&&Math.round(t.height)===Math.round(u.height)||(u.width=t.width,u.height=t.height,C.style.width=t.width+"px",C.style.height=t.height+"px")}}(),clearTimeout(wt),wt=setTimeout(xt,150)})).observe(t);var kt=0,St=function(){clearTimeout(kt),kt=setTimeout(function(){if(!Y)if("snapshot"!==Q){var e=t.clientWidth||t.parentElement&&t.parentElement.clientWidth||u.width;C.style.width=e+"px",setTimeout(function(){if(!Y&&"live"===Q){var t=Math.max(2,Math.round(L.getBoundingClientRect().height))||u.height;u.width=e,u.height=t,C.style.height=t+"px",C.width=Math.round(e*p),C.height=Math.round(t*p),it()}},50)}else xt()},150)};return"undefined"!=typeof window&&window.addEventListener("resize",St),"live"===Q?yt=requestAnimationFrame(vt):(nt().then(function(){yt=requestAnimationFrame(vt)}),"undefined"!=typeof document&&document.fonts&&"object"===o(document.fonts.ready)&&Promise.resolve(document.fonts.ready).then(xt).catch(function(){})),{canvas:C,refresh:function(){return"live"===Q?it():nt()},destroy:function(){Y=!0,cancelAnimationFrame(yt),clearTimeout(wt),clearTimeout(kt),gt&>.disconnect(),bt&&bt.disconnect(),"undefined"!=typeof window&&window.removeEventListener("resize",St),t.removeEventListener("mousemove",lt),t.removeEventListener("touchmove",lt),t.removeEventListener("mouseenter",dt),t.removeEventListener("mouseleave",ft),C.removeEventListener("paint",it);for(var e=0,n=q;e<n.length;e++){var r=n[e];for(var i in r.cleanup(),r.progs)A.deleteProgram(r.progs[i].prog)}for(q.length=0;L!==t&&L.firstChild;)t.appendChild(L.firstChild);et(),t.style.visibility="",C.remove()}}}function A(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(t,e)||M(t,e)||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 R(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=M(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function M(t,e){if(t){if("string"==typeof t)return L(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?L(t,e):void 0}}function L(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function z(t){return z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},z(t)}function I(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,F(r.key),r)}}function F(t){var e=function(t){if("object"!=z(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=z(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==z(e)?e:e+""}var W=function(){function t(){var e,n,r,o=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,r=function(t){if(t.transform||t.op){var e=t.op;t.transform||(e=t.op),e.duration||(e.duration="3s-ease-in-out"),o.setDefault=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0px";return 0===t.length?e+" ":t};var n=function(){var n="",r="",i="",a="",s="",l="",c="",u="",d="";if(0!==e.values.length){e.values.forEach(function(t){t.startsWith("tx:")&&(n=t.replace("tx:","")),t.startsWith("ty:")&&(r=t.replace("ty:","")),t.startsWith("tz:")?i=t.replace("tz:",""):t.startsWith("scale(")?a=t:t.startsWith("skew(")?s=t:t.startsWith("rotate(")?l=function(t){var e=t.match(/rotate\(([^)]+)\)/);if(!e)return t;var n=e[1].split(",").map(function(t){return t.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],")"):t}(t):t.startsWith("perspective(")?c=t:t.startsWith("matrix(")?u=t:t.startsWith("opacity:")&&(d=t.replace("opacity:",""))}),n=o.setDefault(n),r=o.setDefault(r),i=o.setDefault(i);var f="";if("0px"!=r&&"0px"!=n&&"0px"!=i?f+="translate3d(".concat(n,", ").concat(r,", ").concat(i,")"):"0px"==r&&"0px"==n||(f+="translate(".concat(n,", ").concat(r,")")),a&&(f+=" ".concat(a)),l&&(f+=" ".concat(l)),s&&(f+=" ".concat(s)),c&&(f+=" ".concat(c)),u&&(f+=" ".concat(u)),f){if(t.op.duration){var h=t.op.duration.replace(/^(\d+)(s)-/,function(t,e,n){return e/2+n+" "}),p="transform ".concat(h,", opacity ").concat(h);o.res.style.transition=p}else o.res.style.transition="transform 3s ease-in-out, opacity 3s ease-in-out";t.op.static&&(o.res.style.transition=""),(o.blastTarget||o.res).style.transform=f,o.res.style.opacity=d}else console.warn("[nodality] transform produced no geometric value - check `values`")}};e.on?o.res.addEventListener(e.on,function(){e.delay?setTimeout(function(){n()},e.delay):n()}):o._on(window,"load",function(){e.delay?setTimeout(function(){n()},e.delay):n()});var r=function(){var t="";e.values.forEach(function(e){e.startsWith("tx:")?t+="translateX(0) ":e.startsWith("ty:")?t+="translateY(0) ":e.startsWith("tz:")?t+="translateZ(0) ":e.startsWith("scale(")?t+="scale(1) ":e.startsWith("skew(")?t+="skew(0, 0) ":e.startsWith("rotate(")?t+="rotate(0) ":e.startsWith("perspective(")?t+="perspective(0) ":e.startsWith("matrix(")&&(t+="matrix(1, 0, 0, 1, 0, 0) "),o.res.style.opacity="1"}),t&&(o.res.style.transform=t.trim())};if(e.on)o.res.addEventListener("mouseout",function(){e.keep||r()});else{var i=1e3*parseFloat(e.duration),a=e.closeAfter?e.closeAfter:0;setTimeout(function(){e.keep||r()},i/2+a)}e.hardCSS&&(o.res.style.transform=e.hardCSS)}else console.warn("[nodality] reactOnTransform: unrecognised transform descriptor - ignored")},(n=F(n="reactOnTransform"))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,this.state={isExpanded:!1,isMovedUp:!1,isMovedDown:!1},this.openedElements=new WeakMap,"undefined"!=typeof document&&(this._themeUnsub=i.subscribe(function(t){return o._applyTheme(t)}),Promise.resolve().then(function(){return o._applyTheme(i.mode)}))}return e=t,n=[{key:"rasterize",value:function(t){var e=this;if(t&&0!==t.length&&!this._rasterHandle&&!this._rasterCancelled&&"undefined"!=typeof document&&"undefined"!=typeof setTimeout){var n=0,r=function(){if(!e._rasterHandle&&!e._rasterCancelled){if(e.res&&e.res.isConnected){try{e._rasterHandle=P(e.res,t)}catch(t){return void console.warn("[nodality] raster pipeline skipped:",t)}if(e._rasterHandle)return}++n<80&&(e._rasterTimer=setTimeout(r,50))}};this._rasterTimer=setTimeout(r,0),this._track(function(){return clearTimeout(e._rasterTimer)})}}},{key:"isHidden",value:function(t){t&&(this.res.style.display="none")}},{key:"theme",value:function(t){var e=this;return t&&"object"===z(t)?(this._themeMap=t,this._applyTheme(i.mode),this._themeUnsub||(this._themeUnsub=i.subscribe(function(t){return e._applyTheme(t)})),this):this}},{key:"_track",value:function(t){return"function"!=typeof t||(this._disposables||(this._disposables=[])).push(t),t}},{key:"_on",value:function(t,e,n,r){return t&&"function"==typeof t.addEventListener?(t.addEventListener(e,n,r),this._track(function(){return t.removeEventListener(e,n,r)}),n):n}},{key:"destroy",value:function(){if("function"==typeof this._themeUnsub&&(this._themeUnsub(),this._themeUnsub=null),this._rasterHandle&&"function"==typeof this._rasterHandle.destroy)try{this._rasterHandle.destroy()}catch(t){}if(this._rasterHandle=null,this._rasterCancelled=!0,this._disposables){var t,e=R(this._disposables);try{for(e.s();!(t=e.n()).done;){var n=t.value;try{n()}catch(t){}}}catch(t){e.e(t)}finally{e.f()}this._disposables.length=0}return this._responsiveTasks=null,this._responsiveHandler=null,this.res&&this.res.parentNode&&this.res.parentNode.removeChild(this.res),this}},{key:"_applyTheme",value:function(t){if(!this._noTheme&&this.res)if(this._themeMap){var e=this._themeMap[t];if(!e)return;for(var n in e)this.res.style[n]=e[n]}else{var r=i.defaults&&i.defaults[t];if(r)for(var o in this._themeOriginal||(this._themeOriginal={}),r)o in this._themeOriginal||(this._themeOriginal[o]=this.res.style[o]||""),this._themeOriginal[o]||(this.res.style[o]=r[o])}}},{key:"keySet",value:function(t){if(this.temporaryVal=1,Array.isArray(t)){for(var e=0;e<t.length;e++)t[e]&&null!=t[e].key&&(this.res.style[t[e].key]=t[e].value);return this}return this.res.style[t.key]=t.value,this}},{key:"commonMethods",value:function(t){var e={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 e)null!=t[n]&&(this.res.style[e[n]]=t[n]);return"string"==typeof t.transform&&(this.res.style.transform=t.transform),t.pad&&this.pad(t.pad),t.mar&&this.mar(t.mar),t.respad&&this.respad(t.respad),t.resmar&&this.resmar(t.resmar),t.hover&&this.hover(t.hover),t.size&&this.fluidCopy(t.size),t.resprop&&this.resprop(t.resprop,t),t.keySet&&this.keySet(t.keySet),t.noTheme&&(this._noTheme=!0),t.theme&&this.theme(t.theme),t.hide&&this.isHidden(t.hide),t.raster&&this.rasterize(t.raster),t.transform&&"object"===z(t.transform)&&this.reactOnTransform(t.transform),void 0!==t.opacity&&(this.res.style.opacity=t.opacity),t.bold?this.res.style.fontWeight="bold":null!=t.weight&&(this.res.style.fontWeight=t.weight),this}},{key:"hover",value:function(t){var e=this;if(t.border){var n=t.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,t.animation&&(this.res.style.transition="".concat(t.animation),this.res.style.transitionProperty="background-color, color, border, box-shadow, transform"),this.prevTransform=this.res.style.transform,this.res.onmouseout=function(){e.res.style.backgroundColor="".concat(e.prevColor),e.res.style.color="".concat(e.foreColor),e.res.style.border=e.prevBorder,null==t.scale&&null==t.transform||(e.res.style.transform=e.prevTransform||""),null!=t.boxShadow&&(e.res.style.boxShadow=e.prevBoxShadow||"")},this.res.onmouseover=function(){if(e.res.style.color=t.color,e.res.style.backgroundColor=t.background,t.border){var n,r=t.border.width,i=null!==(n=t.border.color)&&void 0!==n?n:"#2ECC71";e.res.style.border=r?"".concat(r,"px solid ").concat(i):"1px solid #2ECC71"}if(null!=t.scale||null!=t.transform){var o=e.prevTransform?"".concat(e.prevTransform," "):"",a=[];null!=t.transform&&a.push(t.transform),null!=t.scale&&a.push("scale(".concat(t.scale,")")),e.res.style.transform="".concat(o).concat(a.join(" "))}null!=t.boxShadow&&(e.res.style.boxShadow=t.boxShadow)},this}},{key:"onScroll",value:function(t){var e=this,n=function(t){if(null==t)return{num:0,unit:"px"};var e=String(t).match(/^(-?[\d.]+)(.*)$/);return e?{num:parseFloat(e[1]),unit:e[2]||"px"}:{num:0,unit:"px"}},r=function(t){var n=t&&null!=t.tx?t.tx:"0px",r=t&&null!=t.ty?t.ty:"0px";e.res.style.transform="translate3d(".concat(n,", ").concat(r,", 0)")};"opacity"===t.value?this.res.style.opacity=t.valMin:"scale"===t.value?this.res.style.transform="scale(".concat(t.valMin,")"):"trn"===t.value&&r(t.valMin);var i=function(){if("trn"!==t.value){var i=e.smartRange(window.scrollY,{min:t.from,max:t.to},{min:t.valMin,max:t.valMax});"opacity"===t.value?e.res.style.opacity=i:"scale"===t.value&&(e.res.style.transform="scale(".concat(i,")"))}else{for(var o={},a=["tx","ty"],s=0;s<a.length;s++){var l=a[s],c=t.valMin&&null!=t.valMin[l],u=t.valMax&&null!=t.valMax[l];if(c||u){var d=n(c?t.valMin[l]:u?t.valMax[l]:"0px"),f=n(u?t.valMax[l]:c?t.valMin[l]:"0px"),h=e.smartRange(window.scrollY,{min:t.from,max:t.to},{min:d.num,max:f.num});o[l]="".concat(h).concat(d.unit)}}r(o)}};this._on(window,"scroll",i),0===t.from&&i()}},{key:"setAny",value:function(t){this[Object.keys(t)[0]]=[Object.values(t)[0]]}},{key:"setID",value:function(t){this.id=t}},{key:"setPrevText",value:function(t){this.prevText=t}},{key:"getCSS",value:function(){return this.css}},{key:"getPX",value:function(t){return{xs:"0px",sm:"576px",md:"768px",lg:"992px",xl:"1200px",xxl:"1400px",mxxl:"1800px"}[t]||"Invalid breakpoint"}},{key:"_setupResponsiveManager",value:function(){var t=this;this._responsiveTasks=this._responsiveTasks||[];var e=function(){t._responsiveTasks.forEach(function(t){t()})};this._responsiveHandler||(this._responsiveHandler=e,this._on(window,"resize",e)),setTimeout(function(){e()},0)}},{key:"resprop",value:function(e,n){var r=this;this.options=n;var i={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"],a={flexDir:"flexDirection",dir:"flexDirection",justify:"justifyContent",align:"alignItems",wrap:"flexWrap",bg:"background",radius:"borderRadius",z:"zIndex",exact:"fontSize"},s=function(t){var e=a[t]||t;return"undefined"==typeof console||"function"==typeof r[t]||e in r.res.style||console.warn('[nodality] resprop: "'.concat(t,'" is not a CSS property or component method — ignored.')+(a[t]?"":" Did you mean one of: ".concat(Object.keys(a).join(", "),"?"))),e};e.forEach(function(t){void 0!==i[t.breakpoint]?t.range=i[t.breakpoint]:Array.isArray(t.breakpoint)&&2===t.breakpoint.length?t.range=[parseInt(t.breakpoint[0],10),parseInt(t.breakpoint[1],10)]:t.range=[0,parseInt(t.breakpoint,10)]}),e.sort(function(t,e){return t.range[1]-e.range[1]});var l=e.find(function(t){return"default"===t.breakpoint});l||(l={breakpoint:"default",range:i.default},e.unshift(l));var c=new Set;e.forEach(function(t){Object.keys(t).forEach(function(t){o.includes(t)||"range"===t||c.add(t)})}),c.forEach(function(t){void 0===l[t]&&(l[t]=r.options[t]||"initial")}),this._responsiveTasks=this._responsiveTasks||[],this._responsiveTasks.push(function(){for(var n=t.viewportWidth(),i=l,a=0;a<e.length;a++){var u=e[a],d=A(u.range,2),f=d[0],h=d[1];if("default"!==u.breakpoint&&n>=f&&n<=h){i=u;break}}for(var p in c.forEach(function(t){if("keySet"===t){var e=l[t];e&&e.key&&(r.res.style[e.key]=e.value)}else r.res.style[s(t)]=l[t]}),i)if("exact"!==p){if(!o.includes(p)&&"range"!==p){var y=i[p];"keySet"===p&&y&&y.key?r.res.style[y.key]=y.value:"function"==typeof r[p]?r[p](y):r.res.style[s(p)]=y}}else r.res.style.fontSize=i[p]}),this._setupResponsiveManager()}},{key:"respad",value:function(e){var n=this,r={default:[0,1e5],xs:[0,575],sm:[576,767],md:[768,991],lg:[992,1199],xl:[1200,1399],xxl:[1400,1e5]};e.forEach(function(t){void 0!==r[t.breakpoint]?t.range=r[t.breakpoint]:Array.isArray(t.breakpoint)&&2===t.breakpoint.length?t.range=[parseInt(t.breakpoint[0],10),parseInt(t.breakpoint[1],10)]:t.range=[parseInt(t.breakpoint,10),1e5]}),e.sort(function(t,e){return t.range[0]-e.range[0]});var i=e.find(function(t){return"default"===t.breakpoint});i||(i={breakpoint:"default",range:r.default},e.unshift(i)),void 0===i.values&&(i.values=this.options&&this.options.pad||null),this._responsiveTasks=this._responsiveTasks||[],this._responsiveTasks.push(function(){for(var r=t.viewportWidth(),o=i,a=0;a<e.length;a++){var s=e[a],l=A(s.range,2),c=l[0],u=l[1];if("default"!==s.breakpoint&&r>=c&&r<=u){o=s;break}}var d=void 0!==o.values?o.values:i.values;null!=d&&n.pad(d)}),this._setupResponsiveManager()}},{key:"_applyResponsive",value:function(t,e){var n={default:[0,1e5],xs:[0,575],sm:[576,767],md:[768,991],lg:[992,1199],xl:[1200,1399],xxl:[1400,1e5]};t.forEach(function(t){if(void 0!==n[t.breakpoint])t.range=n[t.breakpoint];else{var e=parseInt(t.breakpoint,10);t.range=[e,1e5]}}),t.sort(function(t,e){return t.range[0]-e.range[0]});var r=t.find(function(t){return"default"===t.breakpoint})||{breakpoint:"default",range:n.default},i=function(){for(var n=window.innerWidth,i=r,o=0;o<t.length;o++){var a=t[o],s=A(a.range,2),l=s[0],c=s[1];if("default"!==a.breakpoint&&n>=l&&n<=c){i=a;break}}e(i)};this._responsiveHandler&&window.removeEventListener("resize",this._responsiveHandler),this._responsiveHandler=i,this._on(window,"resize",i),setTimeout(function(){i()},0)}},{key:"resmar",value:function(e){var n=this,r={default:[0,1e5],xs:[0,575],sm:[576,767],md:[768,991],lg:[992,1199],xl:[1200,1399],xxl:[1400,1e5]};e.forEach(function(t){void 0!==r[t.breakpoint]?t.range=r[t.breakpoint]:Array.isArray(t.breakpoint)&&2===t.breakpoint.length?t.range=[parseInt(t.breakpoint[0],10),parseInt(t.breakpoint[1],10)]:t.range=[parseInt(t.breakpoint,10),1e5]}),e.sort(function(t,e){return t.range[0]-e.range[0]});var i=e.find(function(t){return"default"===t.breakpoint});i||(i={breakpoint:"default",range:r.default},e.unshift(i)),void 0===i.values&&(i.values=this.options&&(this.options.mar||this.options.pad)||null),this._responsiveTasks=this._responsiveTasks||[],this._responsiveTasks.push(function(){for(var r=t.viewportWidth(),o=i,a=0;a<e.length;a++){var s=e[a],l=A(s.range,2),c=l[0],u=l[1];if("default"!==s.breakpoint&&r>=c&&r<=u){o=s;break}}var d=void 0!==o.values?o.values:i.values;null!=d&&n.mar(d)}),this._setupResponsiveManager()}},{key:"isNumber",value:function(t){return"number"==typeof t&&!isNaN(t)}},{key:"pad",value:function(t){for(var e=0;e<t.length;e++)for(var n=Object.keys(t[e]),r=0;r<n.length;r++)for(var i=n[r],o=t[e][i],a=0;a<i.length;a++)switch(i[a]){case"a":this.res.style.padding=this.isNumber(o)?"".concat(o,"px"):o;break;case"t":this.res.style.paddingTop=this.isNumber(o)?"".concat(o,"px"):o;break;case"l":this.res.style.paddingLeft=this.isNumber(o)?"".concat(o,"px"):o;break;case"r":this.res.style.paddingRight=this.isNumber(o)?"".concat(o,"px"):o;break;case"b":this.res.style.paddingBottom=this.isNumber(o)?"".concat(o,"px"):o}return this}},{key:"as",value:function(t){return this.res.style.alignSelf=t,this}},{key:"mar",value:function(t){if("center"===t)return this.res.style.marginLeft="auto",this.res.style.marginRight="auto",this;for(var e=0;e<t.length;e++)for(var n=Object.keys(t[e]),r=0;r<n.length;r++){for(var i=n[r],o=t[e][i],a=0;a<i.length;a++)switch(i[a]){case"a":"auto"===o?(this.res.style.marginLeft="auto",this.res.style.marginRight="auto"):this.res.style.margin=this.isNumber(o)?"".concat(o,"px"):o;break;case"t":this.res.style.marginTop=this.isNumber(o)?"".concat(o,"px"):o;break;case"l":this.res.style.marginLeft=this.isNumber(o)?"".concat(o,"px"):o;break;case"r":this.res.style.marginRight=this.isNumber(o)?"".concat(o,"px"):o;break;case"b":this.res.style.marginBottom=this.isNumber(o)?"".concat(o,"px"):o}"center"===i&&!0===o&&(this.res.style.marginLeft="auto",this.res.style.marginRight="auto"),"auto"===o&&(i.includes("l")||i.includes("r"))&&(i.includes("l")&&(this.res.style.marginLeft="auto"),i.includes("r")&&(this.res.style.marginRight="auto"))}return this}},{key:"smartRange",value:function(t,e,n){t<e.min&&(t=e.min),t>e.max&&(t=e.max);var r=(t-e.min)/(e.max-e.min);return e.min>e.max&&(r=(t-e.max)/(e.min-e.max)),n.min+(n.max-n.min)*r}},{key:"gpos",value:function(t){return this.res.style.gridColumn=t.col,this.res.style.gridRow=t.row,this}},{key:"fluidCopy",value:function(t){if(t instanceof Object){this.prevStylex=this.res.style,this.res=document.createElement("h1"),this.res.style.cssText=this.prevStylex.cssText;var e=document.createTextNode(this.text);return this.res.appendChild(e),this.res.style.fontSize=t.exact,this}if("S1"===t){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"===t){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"===t){this.prevStylex=this.res.style,this.res=document.createElement("h3"),this.res.style.cssText=this.prevStylex.cssText;var i=document.createTextNode(this.text);this.res.appendChild(i),this.res.style.fontSize="calc(1.375rem + 3.525vw)"}if("S4"===t){this.prevStylex=this.res.style,this.res=document.createElement("h4"),this.res.style.cssText=this.prevStylex.cssText;var o=document.createTextNode(this.text);this.res.appendChild(o),this.res.style.fontSize="calc(1.250rem + 2.75vw)"}if("S5"===t){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"===t&&(this.res.style.fontSize="calc(1rem + 0.5vw)"),this}},{key:"setIndex",value:function(t){this.index=t}},{key:"borderObj",value:function(t){var e,n=null!==(e=t.type)&&void 0!==e?e:"solid";return this.res.style.border="".concat(t.width," ").concat(n," ").concat(t.color),void 0!==t.radius&&(this.res.style.borderRadius=t.radius),this}},{key:"setPref",value:function(t){this.preffersId=t}},{key:"setClass",value:function(t){this.class=t}},{key:"setTags",value:function(t){this.openTag=t.open,this.closeTag=t.close}},{key:"chainReact",value:function(e,n,r){var i=this;this.ap=!1,this.cta=0,this.once=!1;var o,a=R(e);try{for(a.s();!(o=a.n()).done;){var s=o.value;s.range||(s.range=["0px","999999px"])}}catch(t){a.e(t)}finally{a.f()}e.sort(function(t,e){return parseInt(t.range[0])-parseInt(e.range[0])});var l=function(o){var a=t.viewportWidth(),s=[],l=[];i.resCopy=i.res,i.storedQueries=e.map(function(t){return t.target}).filter(function(t){return null!=t});var c,u=R(e);try{for(u.s();!(c=u.n()).done;){var d=c.value;i.counterIndex++;var f=A(d.range,2),h=f[0],p=f[1],y=parseInt(h),m=parseInt(p),v=!0;if(d.target){v=!1;for(var g=0;g<d.target.length;g++)d.target[g]===n&&(v=!0)}a>=y&&a<=m&&v&&(s.push(d.log),l.push(d),d.op&&d.op.margin&&(i.useMargin=d.op.margin))}}catch(t){u.e(t)}finally{u.f()}if(r&&!r.includes("background")&&(i.res.style.background="",i.res.style.backgroundColor=""),i.res.style.textShadow="",r&&!r.includes("border")&&(i.res.style.border=""),r&&!r.includes("margin")&&(i.res.style.margin=""),i.res.style["-webkit-text-fill-color"]="",i.res.style["-webkit-text-stroke-color"]="",i.res.style["-webkit-text-stroke-width"]="",i.res.style.filter="",i.options.background&&(i.res.style.background=i.options.background),s.includes("gradient"),(s.includes("gradient")||s.includes("shadow"))&&(i.res.style.position="relative"),s.includes("blast")){var b,w=l.filter(function(t){return"blast"===t.log})[0].op.color,x=null!==(b=l.filter(function(t){return"blast"===t.log})[0].op.width)&&void 0!==b?b:"1px";"FlexRowLayoutElement"===i.getType()||"LayoutWrapperElement"===i.getType()?(i.res.style.border="".concat("number"==typeof x?x+"px":x," solid orange"),i.res.style.display="inline-block","FlexRowLayoutElement"===i.getType()&&(i.res.style.display="flex"),i.res.style.boxSizing="border-box",i.res.style.transformOrigin="center",i.blastTarget=i.res):(i.text,i.res.style["-webkit-text-fill-color"]="transparent",i.res.style["-webkit-text-stroke-color"]=w,i.res.style["-webkit-text-stroke-width"]="".concat(x))}if(s.includes("filter")){var k=l.filter(function(t){return"filter"===t.log})[0].op.filter;i.res.style.filter=k}if(s.includes("background")&&(i.res.style.backgroundColor="green"),s.includes("gradient")&&("LayoutWrapperElement"!==i.getType()&&"FlexRowLayoutElement"!==i.getType()&&(i.res.style["-webkit-text-fill-color"]="transparent"),i.res.style.background=i.globalGradient,"LayoutWrapperElement"!==i.getType()&&"FlexRowLayoutElement"!==i.getType()&&(i.res.style["background-clip"]="text")),s.includes("shadow")){var S,O,j,C,E=i.options.shadow.op,T=null!==(S=E.steps)&&void 0!==S?S:1,_=null!==(O=E.colors)&&void 0!==O?O:["gray"],P=null!==(j=E.movements)&&void 0!==j?j:["3px","3px"],M=null!==(C=E.radius)&&void 0!==C?C:"3px";if(1===P.length&&(P=[P[0],P[0]]),"FlexRowLayoutElement"===i.getType()||"LayoutWrapperElement"===i.getType()){for(var L=[],z=0;z<T;z++){var I,F=null!==(I=_[z])&&void 0!==I?I:_[0],W=P[0],D=P[1];L.push("".concat(W," ").concat(D," ").concat(M," ").concat(F))}i.res.style.boxShadow=L.join(", ")}else{for(var B=[],N=0;N<T;N++){var H,G=null!==(H=_[N])&&void 0!==H?H:_[0],U=P[0],q=P[1];B.push("drop-shadow(".concat(U," ").concat(q," ").concat(M," ").concat(G,")"))}i.res.style.filter=B.join(" ")}}if(s.includes("margin"))for(g=0;g<e.length;g++)if(e[g].op){var J=e[g].op.offsets;J&&void 0!==i.index&&(i.res.style.margin=J[Number(i.index)]+"px")}if(s.includes("spana")||s.includes("span")){var X=document.createElement("div");if(X.setAttribute("id","oroa"),Object.assign(X.style,{position:"absolute",inset:"0",background:"linear-gradient(90deg, rgb(52,152,219), rgb(26,188,156))",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",pointerEvents:"none"}),i.res&&i.res.querySelector("span"))return;i.res=i.resCopy,i.res.textContent="",i.options.span&&(Array.isArray(i.options.span)?i.options.span:[i.options.span]).forEach(function(t){if(t.op&&"span"===t.op.name&&Array.isArray(t.op.parts)){var e=0,n=i.prevText||"";if(t.op.parts.forEach(function(t){var r=t.text,o=t.style||{};if(e<n.length){var a=n.indexOf(r,e);if(a>e){var s=n.substring(e,a);i.res.appendChild(new i.constructor(s).setup({type:"span",id:o.id,animation:o.animation}).set({}).render())}e=a+r.length}var l=new i.constructor(r).setup({type:"span",id:o.id,animation:o.animation}).set(o).render();i.res.appendChild(l)}),e<n.length){var r=n.substring(e);i.res.appendChild(new i.constructor(r).setup({type:"span"}).set({}).render())}}})}else{var $=new i.constructor(i.prevText).set({}).render();i.prevText&&i.prevText.length>0&&o&&i.res.appendChild($)}if(s.includes("animation")){if(i.options.animation&&!i.hasAnimated&&!i.options.animation.op.fireAt){i.hasAnimated=!0;var V=i.options.animation.op;i._on(window,"sidebar:open",function(){i.res.animate(V.keyframesOpen,V.openOptions)}),i._on(window,"sidebar:closed",function(){i.res.animate(V.keyframesClose,V.closeOptions)}),i.res.animate(V.keyframesClose,{duration:0,fill:"forwards"}),i.openTag&&i.closeTag&&(i._on(window,i.openTag,function(){i.res.animate(V.keyframesOpen,V.openOptions)}),i._on(window,i.closeTag,function(){i.res.animate(V.keyframesClose,V.closeOptions)}))}if(i.options.animation&&i.options.animation.op.fireAt&&i.options.animation.op.fireAt.endsWith("px")){var Y=i.options.animation.op;i.res.animate(Y.keyframesClose,{duration:0,fill:"forwards"});var Q=function(){window.scrollY>parseFloat(Y.fireAt)&&(i.res.animate(Y.keyframesOpen,Y.openOptions),window.removeEventListener("scroll",Q))};i._on(window,"scroll",Q)}if(i.options.animation&&"inview"===i.options.animation.op.fireAt){var K=i.options.animation.op;i.res.animate(K.keyframesClose,{duration:0,fill:"forwards"});var Z=!1,tt=new IntersectionObserver(function(t,e){t.forEach(function(t){t.isIntersecting&&!Z&&(Z=!0,i.res.animate(K.keyframesOpen,K.openOptions),e.disconnect())})});tt.observe(i.res),i._track(function(){return tt.disconnect()})}}};this.options.animation||this._on(window,"resize",function(){return l()}),l()}},{key:"maxWidth",value:function(t){return this.res.style.maxWidth=t,this}},{key:"removeQuotesFromFirstWord",value:function(t){return t.replace(/"([^"]+)":/g,"$1:")}},{key:"arrayMargin",value:function(t,e){return t.includes("left")&&(this.res.style.marginLeft=e),t.includes("right")&&(this.res.style.marginRight=e),t.includes("top")&&(this.res.style.marginTop=e),t.includes("bottom")&&(this.res.style.marginBottom=e),t.includes("all")&&(this.res.style.margin=e),e||(this.res.style.marginBottom=t),this}}],r=[{key:"viewportWidth",value:function(){if("undefined"==typeof window)return 0;var t=window.visualViewport;return t&&"number"==typeof t.width?t.width:window.innerWidth}}],n&&I(e.prototype,n),r&&I(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n,r}();function D(t){return D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},D(t)}function B(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(t,e)||N(t,e)||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 N(t,e){if(t){if("string"==typeof t)return H(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?H(t,e):void 0}}function H(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function G(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,U(r.key),r)}}function U(t){var e=function(t){if("object"!=D(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=D(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==D(e)?e:e+""}function q(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(q=function(){return!!t})()}function J(t,e,n,r){var i=X($(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof i?function(t){return i.apply(n,t)}:i}function X(){return X="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=$(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},X.apply(null,arguments)}function $(t){return $=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},$(t)}function V(t,e){return V=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},V(t,e)}var Y=function(){function t(e,n){var r,i,o,a;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(i=this,o=t,o=$(o),r=function(t,e){if(e&&("object"==D(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(i,q()?Reflect.construct(o,a||[],$(i).constructor):o.apply(i,a))).text=e,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(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&V(t,e)}(t,W),e=t,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(t){return this.res.style.gridArea=t,this}},{key:"toCodea",value:function(){return this.excludeFromCodeTrue&&(this.code=[""]),this.code}},{key:"toCode",value:function(){if(this.excludeFromCodeTrue)return[""];var t=Object.fromEntries(Object.entries(this.options).filter(function(t){var e=B(t,2);return e[0],null!==e[1]})),e=JSON.stringify(t,null,4).replace(/"([^"]+)":/g,"$1:");return['new Text("'.concat(this.text,'").set(').concat(e,")")]}},{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(t){return" "+t}),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(t){var e=this;if(0===t.length)return this;var n=t.filter(function(t){return"gradient"===t.op.name})[0];if(void 0===n)return this;var r=n.op;if(n.point){var i=function(){window.matchMedia("(min-width: ".concat(n.range[0],") and (max-width: ").concat(n.range[1],")")).matches&&(e.prevBackground=e.res.style.color.toString(),e.res.style.background=r.gradient,e.res.style.WebkitBackgroundClip="text")};i(),window.addEventListener("resize",i)}}},{key:"strokeOptions",value:function(t){var e=this;if(0===t.length)return this;var n=t.filter(function(t){return"blast"===t.op.name})[0];if(void 0===n)return this;var r=n.op;if(n.point){var i=function(){window.matchMedia("(min-width: ".concat(n.range[0],") and (max-width: ").concat(n.range[1],")")).matches&&(r.color?e.res.style["-webkit-text-stroke"]="".concat(r.width?r.width:"1px"," ").concat(r.color):e.res.style["-webkit-text-stroke"]="1px orange",e.res.style["-webkit-text-fill-color"]="transparent")};i(),window.addEventListener("resize",i)}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(t,e){return this.res.style.gridRow=t,this.res.style.gridColumn=e,this}},{key:"setGridRow",value:function(t){return this.res.style.gridRow=t,this}},{key:"setGridCol",value:function(t){return this.res.style.gridColumn=t,this}},{key:"toHTML",value:function(){return this.res}},{key:"onTap",value:function(t){return this.res.addEventListener("click",t),this}},{key:"setClass",value:function(t){return this.res.setAttribute("class",t),this}},{key:"setRandom",value:function(){for(var t="LAYOUT-",e=90;e>0;--e)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return t+=(new Date).getTime(),this.res.setAttribute("class",t),this}},{key:"styled",value:function(t){return this.set(t),this}},{key:"removeQuotesFromFirstWord",value:function(t){return t.replace(/"([^"]+)":/g,"$1:")}},{key:"looksLikeMarkdown",value:function(t){return/(\*\*.*\*\*|\*.*\*|`[^`]+`|\[.*?\]\(.*?\)|^# )/m.test(t)}},{key:"parseMarkdown",value:function(t){var e=t;return(e=(e=(e=(e=(e=(e=(e=e.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(e){return this.resCopy=this.res,this.options=e,J(t,"setPrevText",this,3)([this.text]),e.raster&&this.rasterize(e.raster),this.commonMethods(e),e.left&&(this.res.style.left=e.left),e.flex&&(this.res.style.display="flex"),(e.left||e.top)&&(this.res.style.position="absolute"),e.maxWidth&&(this.res.style.maxWidth=e.maxWidth),e.cursor&&(this.res.style.cursor="hand"),e.gpos&&this.gpos(e.gpos),e.vtn&&(this.res.style.viewTransitionName=e.vtn),e.index&&J(t,"setIndex",this,3)([e.index]),e.index&&(this.index=e.index),e.preffersId&&(this.preffersId=e.preffersId),J(t,"setPref",this,3)([e.preffersId]),e.removeDecoration&&(this.res.style.textDecoration="none"),e.block&&(this.res.style.display="block"),e.area&&this.setArea(e.area),e.icon&&this.addIcon(e.icon),e.color&&this.color(e.color),e.color&&this.elCSS.push("color: ".concat(e.color,"; \n")),e.class&&this.setClass(e.class),e.size&&this.fluidCopy(e.size),e.fluidc&&this.fluidCopy(e.fluidc),this.options.id&&this.res.setAttribute("id",this.options.id),J(t,"setID",this,3)([this.options.id]),e.initLetter&&this.initLetter(e.initLetter),e.onTap&&this.onTap(e.onTap),"S6"===e.fluidc?e.fluidc&&this.elCSS.push("font-size: calc(1.1rem + 2.075vw); \n"):e.fluidc&&this.elCSS.push("font-size: calc(1.625rem + 5.075vw); \n"),this.options.class&&this.res.setAttribute("class",this.options.class),J(t,"setClass",this,3)([this.options.class]),e.clampc&&this.clampCopy(e.clampc),e.arrpad&&this.arrayPadding(e.arrpad.sides,e.arrpad.value),e.absolute&&(this.res.style.position="absolute"),e.arrayMargin&&this.arrayMargin(e.arrayMargin.sides,e.arrayMargin.value),e.em&&this.em(e.em),e.fluid&&this.fluid(e.fluid),e.fluidc&&this.elCSS.push("font-family: ".concat(e.font,"; \n")),e.align&&(this.res.style.textAlign=e.align),e.padding&&this.padding(e.padding),e.breakWord&&(this.res.style.wordWrap="break-word"),e.center&&(this.res.style.marginRight="auto"),e.center&&(this.res.style.marginLeft="auto"),e.italic&&this.italic(),e.responsive&&this.responsive(),e.border&&(this.res.style.border="".concat(e.border)),e.onScroll&&this.onScroll(e.onScroll),e.keySet&&this.keySet(e.keySet),this.callReact(e),this}},{key:"callReact",value:function(e){var n=[],r=e.transform&&"object"===D(e.transform);if(e.stroke||e.gradient||e.span||e.backgroundOp||e.layout||e.shadow||e.animation||e.filtera||r){e.gradient&&(this.globalGradient=e.gradient.op.gradient,"radial"===e.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)")),e.stroke&&J(t,"setAny",this,3)([{globalBlast:"".concat(e.stroke.op.width," ").concat(e.stroke.op.color)}]),e.span&&(e.span.prevText=this.text);var i=[e.stroke,e.gradient,e.animation,e.span,e.backgroundOp,e.layout,e.marginOp,e.shadow,e.animation,e.filtera,r?e.transform:void 0];i=i.filter(function(t){return null!=t});for(var o=0;o<i.length;o++)n.push({range:i[o].range,log:i[o].op.name,target:i[o].target,op:i[o].op});var a=[];e.borderObj&&a.push("border"),e.background&&a.push("background"),e.mar&&a.push("margin"),e.animation&&a.push("animation"),e.span&&a.push("span"),this.chainReact(n,this.options.id,a)}}},{key:"excludeFromCode",value:function(){return this.excludeFromCodeTrue=!0,this}},{key:"addIcon",value:function(t){var e=document.createElement("img");return e.style.width="20px",e.style.marginLeft="10px",e.style.height="auto",e.setAttribute("src",t.url),this.res.appendChild(e),this}},{key:"checkForAnimation",value:function(t){t.sort(function(t,e){return parseInt(t.range[0])-parseInt(e.range[0])});var e,n=window.innerWidth,r=function(t){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=N(t))){e&&(t=e);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},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 i,o=!0,a=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return o=t.done,t},e:function(t){a=!0,i=t},f:function(){try{o||null==e.return||e.return()}finally{if(a)throw i}}}}(t);try{for(r.s();!(e=r.n()).done;){var i=e.value,o=B(i.range,2),a=o[0],s=o[1],l=parseInt(a),c=parseInt(s);n>=l&&n<=c&&"animation"===i.log&&this.res.animate([{opacity:0,transform:"translateY(100px)"},{opacity:1,transform:"translateY(0)"}],{duration:1e3,easing:"ease"})}}catch(t){r.e(t)}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(t){t.color?this.res.style["-webkit-text-stroke"]="".concat(t.width?t.width:"1px"," ").concat(t.color):this.res.style["-webkit-text-stroke"]="1px orange",this.res.style["-webkit-text-fill-color"]="transparent"}},{key:"innerGradient",value:function(t){this.res.style.background="linear-gradient(45deg, #ff0000, #00ff00)",this.res.style["-webkit-background-clip"]="text"}},{key:"arrayMargin",value:function(t,e){return e||(this.res.style.marginLeft="".concat(t[0],"px"),this.res.style.marginTop="".concat(t[1],"px"),this.res.style.marginRight="".concat(t[2],"px"),this.res.style.marginBottom="".concat(t[3],"px")),t.includes("left")&&(this.res.style.marginLeft=e),t.includes("right")&&(this.res.style.marginRight=e),t.includes("top")&&(this.res.style.marginTop=e),t.includes("bottom")&&(this.res.style.marginBottom=e),e||(this.res.style.marginBottom=t),this}},{key:"clampExperiment",value:function(){return this.res.style.fontSize="clamp(1rem, calc(1rem * 10rem), 3rem)",this}},{key:"between",value:function(t){return"S1"===t&&(this.res.style.fontSize="clamp(2rem, 8vw, 2.5rem)"),"S2"===t&&(this.res.style.fontSize="clamp(4rem, 8vw, 5rem)"),"S3"===t&&(this.res.style.fontSize="clamp(2rem, 5vw, 2.5rem)"),"S4"===t&&(this.res.style.fontSize="clamp(1.5rem, 2vw, 1.6rem)"),"S5"===t&&(this.res.style.fontSize="clamp(1.2rem, 2vw, 1.3rem)"),"S6"===t&&(this.res.style.fontSize="clamp(1rem, 2vw, 1.3rem)"),this}},{key:"betweenCopy",value:function(t){return"S1"===t&&(this.res.style.fontSize="clamp(2rem, 8vw, 2.5rem)"),"S2"===t&&(this.res.style.fontSize="clamp(4rem, 8vw, 5rem)"),"S3"===t&&(this.res.style.fontSize="clamp(2rem, 5vw, 2.5rem)"),"S4"===t&&(this.res.style.fontSize="clamp(1.5rem, 2vw, 1.6rem)"),"S5"===t&&(this.res.style.fontSize="clamp(1.2rem, 2vw, 1.3rem)"),"S6"===t&&(this.res.style.fontSize="clamp(1rem, 2vw, 1.3rem)"),this}},{key:"stringGen",value:function(t){for(var e="",n=0;n<t;n++)e+="abcdefghijklmnopqrstuvwxyz".charAt(Math.floor(26*Math.random()));return e}},{key:"initLetter",value:function(t){var e=document.createElement("style");document.body.appendChild(e),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(t){return"S1"===t&&this.jumbotron(),"S2"===t&&this.large(),"S3"===t&&this.medium(),this}},{key:"minusMargin",value:function(){return this.res.style.marginRight="-3.1em",this}},{key:"fluid",value:function(t){if("S1"===t){this.res=document.createElement("h1");var e=document.createTextNode(this.text);this.res.appendChild(e),this.res.style.fontSize="calc(1.625rem + 4.3vw)"}if("S2"===t){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"===t){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"===t){this.res=document.createElement("h4");var i=document.createTextNode(this.text);this.res.appendChild(i),this.res.style.fontSize="calc(1.275rem + 1.975vw)"}return"S5"===t&&(this.res.style.fontSize="calc(1.1rem + 1.2vw)"),this}},{key:"getClampValue",value:function(t){return"S7"===t?"clamp(1.45rem, 2vw + 1.5rem, 1.69rem)":"S6"===t?"clamp(2.25rem, 2vw+1.5rem, 3.25rem)":"S5"===t?"clamp(2.75rem, 2vw + 1.5rem, 3.25rem)":"S4"===t?"clamp(3.5rem, 2vw + 1.5rem, 3.25rem)":"S3"===t?"clamp(4.25rem, 2vw + 1.5rem, 3.25rem)":"S2"===t?"clamp(5rem, 2vw + 1.5rem, 3.25rem)":"S1"===t?"clamp(6rem, 2vw + 1.5rem, 3.25rem)":void 0}},{key:"clampCopy",value:function(t){return this.res.style.fontSize=this.getClampValue(t),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(t){var e=this,n=function(){window.matchMedia("(max-device-width: 415px)").matches?e.res.style.fontSize=t.desktop:e.res.style.fontSize=t.phone};return n(),window.addEventListener("resize",n),this}},{key:"jumbotron",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.res.style.fontSize="8rem":t.res.style.fontSize="6rem"};return e(),window.addEventListener("resize",e),this}},{key:"large",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.res.style.fontSize="7rem":t.res.style.fontSize="5rem"};return e(),window.addEventListener("resize",e),this}},{key:"frame",value:function(t){return this.res.style.width=t.width,this.res.style.height=t.height,this}},{key:"vw",value:function(t,e,n){}},{key:"responsive",value:function(t){var e=this;this.set=!1,this.setB=!1;var n=function(){window.innerWidth<t.minw?(e.setB=!1,e.set||(e.res.style.color="#3498db",e.res.style.fontSize="".concat(t.baseVW/100*window.innerWidth,"px"),e.set=!0)):window.innerWidth>t.maxw?(e.set=!1,e.setB||(e.res.style.color="orange",e.res.style.fontSize="".concat(t.baseVW/100*t.maxw,"px"),e.setB=!0)):(e.set=!1,e.setB=!1,e.res.style.color="black",e.res.style.fontSize="".concat(t.baseVW,"vw"))};return n(),window.addEventListener("resize",n),this}},{key:"xlarge",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.res.style.fontSize="6.5rem":t.res.style.fontSize="8.5rem"};return e(),window.addEventListener("resize",e),this}},{key:"medium",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.res.style.fontSize="2.25rem":t.res.style.fontSize="1.5em"};return e(),window.addEventListener("resize",e),this}},{key:"auto",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.res.style.fontSize="2rem":t.res.style.fontSize="1rem"};return e(),window.addEventListener("resize",e),this}},{key:"small",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.res.style.fontSize="1.5em":t.res.style.fontSize="1em"};return e(),window.addEventListener("resize",e),this}},{key:"sizes",value:function(t){var e=this;this.res.style.fontSize="".concat(t[0].size,"rem");var n=function(){for(var n=0;n<t.length;n++)t[n].width&&window.matchMedia("(min-width: ".concat(t[n].width,"px)")).matches&&(e.res.style.fontSize="".concat(t[n].size));window.matchMedia("(max-device-width: 415px)").matches&&(e.res.style.fontSize="".concat(t[t.length-1].mobile))};return n(),window.addEventListener("resize",n),this}},{key:"setup",value:function(t){var e;t?((e=document.createElement(t.type)).setAttribute("id",t.id),"span"===t.type&&t.animation&&(e.style.position="relative",e.style.display="block")):e=document.createElement("p");var n=document.createTextNode(this.text);return e.appendChild(n),this.res=e,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(t){return this.res.style.fontFamily=t,this}},{key:"center",value:function(){return this.res.style.textAlign="center",this}},{key:"em",value:function(t){return this.res.style.fontSize="".concat(t,"em"),this}},{key:"color",value:function(t){return this.res.style.color=t,this}},{key:"align",value:function(t){return this.res.style.textAlign="".concat(t),this}},{key:"weight",value:function(t){return this.res.style.fontWeight=t,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(t,e){return this.res.style.width=t,e&&(this.res.style.marginLeft="auto",this.res.style.marginRight="auto"),this}},{key:"offset",value:function(t){return this.res.style.gridRow=2,this.res.style.gridColumn=2,this.res.style.marginLeft="-60px",this}},{key:"border",value:function(t,e){return this.res.style.border="".concat(e,"px solid ").concat(t),this}},{key:"padding",value:function(t,e,n,r){return(t||e||n||r)&&(this.res.style.paddingLeft=t,this.res.style.paddingTop=e,this.res.style.paddingRight=n,this.res.style.paddingBottom=r),e||n||r||(this.res.style.padding=t),this}},{key:"arrayPadding",value:function(t,e){return t.includes("left")&&(this.res.style.paddingLeft=e),t.includes("right")&&(this.res.style.paddingRight=e),t.includes("top")&&(this.res.style.paddingTop=e),t.includes("bottom")&&(this.res.style.paddingBottom=e),e||(this.res.style.paddingBottom=t),this}},{key:"margin",value:function(t,e){return"top"==t?this.res.style.marginTop=e:"bottom"==t?this.res.style.marginBottom=e:"left"==t?this.res.style.marginLeft=e:"right"==t&&(this.res.style.marginRight=e),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(t,e){var n=this.res,r=this.text;return Object.defineProperty(t,e,{set:function(t){var e=document.createTextNode(r.replace("$",t));n.replaceChild(e,n.childNodes[0])}}),this}},{key:"style",value:function(t){return this.res.style.color=t.styles.color,this.res.style.fontWeight=t.styles.fontWeight,this.res.style.paddingLeft=t.styles.padding[0],this.res.style.paddingTop=t.styles.padding[1],this.res.style.paddingRight=t.styles.padding[2],this.res.style.paddingBottom=t.styles.padding[3],this.res.style.marginLeft=t.styles.margin[0],this.res.style.paddingTop=t.styles.margin[1],this.res.style.paddingRight=t.styles.margin[2],this.res.style.paddingBottom=t.styles.margin[3],this.res.style.opacity=t.styles.opacity,this}},{key:"applyStyle",value:function(t,e){return window.matchMedia("(max-width: ".concat(t,"px)")).matches&&Object.assign(this.res.style,e.styles),this}},{key:"nextApply",value:function(t){for(var e=this,n=[],r=(this.res.style,function(r){n[0].matches?Object.assign(e.res.style,t[0].styles):n[1].matches?Object.assign(e.res.style,t[1].styles):Object.assign(e.res.style,t[t.length-1].styles)}),i=0;i<t.length;i++){var o=t[i],a=window.matchMedia("(min-width: ".concat(o.min,"px) and (max-width: ").concat(o.max,"px)"));n.push(a),n[i].addListener(r)}return r(),this}},{key:"apply",value:function(t){var e=this,n=this.res.styles,r=function(){for(var r=0;r<t.length;r++){var i=t[r];i.min&&i.max?window.matchMedia("(min-width: ".concat(i.min,"px) and (max-width: ").concat(i.max,"px)")).matches?Object.assign(e.res.style,i.styles):Object.assign(e.res.style,n):window.matchMedia("(max-width: ".concat(i.max,"px)")).matches?Object.assign(e.res.style,i.styles):Object.assign(e.res.style,n)}};return r(),window.addEventListener("resize",r),this}},{key:"render",value:function(t){if(!t)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(t).appendChild(this.res)}}],n&&G(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function Q(t){return Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Q(t)}function K(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Z(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,tt(r.key),r)}}function tt(t){var e=function(t){if("object"!=Q(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Q(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Q(e)?e:e+""}function et(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(et=function(){return!!t})()}function nt(t,e,n,r){var i=rt(it(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof i?function(t){return i.apply(n,t)}:i}function rt(){return rt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=it(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},rt.apply(null,arguments)}function it(t){return it=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},it(t)}function ot(t,e){return ot=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ot(t,e)}var at=function(){function t(e,n,r,i){var o,a,s,l;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(a=this,s=t,s=it(s),o=function(t,e){if(e&&("object"==Q(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(a,et()?Reflect.construct(s,l||[],it(a).constructor):s.apply(a,l))).url=e,o.res=null,o.code=[],o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ot(t,e)}(t,W),e=t,n=[{key:"removeQuotesFromFirstWord",value:function(t){return t.replace(/"([^"]+)":/g,"$1:")}},{key:"setType",value:function(t){t.url;var e=t.type,n=t.mode;if(this.code=[],"exact"===e){var r='new Image("'.concat(this.url,'", "exact")');this.code.push(r)}else if("uncover"===e){var i='new Image("'.concat(this.url,'", "uncover")');this.code.push(i)}else this.code.push("new Image('".concat(this.url,"')"));return this.image(this.url,n,e),this}},{key:"flexOne",value:function(){return this.res.style.flex="1",this}},{key:"hand",value:function(){return this.res.style.cursor="hand",this}},{key:"setGridWithoutCode",value:function(){return this.res.style.border="1px solid white",this}},{key:"maxWidth",value:function(t){return this.res.style.maxWidth=t,this}},{key:"getHeight",value:function(){return this.res.height}},{key:"getWidth",value:function(){return this.res.width}},{key:"getType",value:function(){return"HTMLImageElement"}},{key:"toCode",value:function(){var t=this.options;this.res.style.border&&(t.border=this.res.style.border);var e=Object.fromEntries(Object.entries(t).filter(function(t){var e,n,r=(n=2,function(t){if(Array.isArray(t))return t}(e=t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,n)||function(t,e){if(t){if("string"==typeof t)return K(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?K(t,e):void 0}}(e,n)||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.")}());return r[0],null!==r[1]}));return["new Image().set(".concat(JSON.stringify(e,null,2).replace(/"(\w+)"\s*:/g,"$1:"),")")]}},{key:"formatObj",value:function(t){return JSON.stringify(t,null,2).replace(/"(\w+)"\s*:/g,"$1:")}},{key:"set",value:function(e){var n="";this.options=e;var r=e;r.onTap&&this.onTap(r.onTap);var i=e.isFull;if(i?this.image(e.url,"exact",i,"a"):this.setup(),e.url&&this.res.setAttribute("src",e.url),"IMG"===this.res.tagName&&(e.srcset&&this.res.setAttribute("srcset",e.srcset),e.sizes&&this.res.setAttribute("sizes",e.sizes),void 0!==e.alt&&this.res.setAttribute("alt",e.alt),e.loading&&this.res.setAttribute("loading",e.loading),e.decoding&&this.res.setAttribute("decoding",e.decoding),e.fetchPriority&&this.res.setAttribute("fetchpriority",e.fetchPriority)),e.id&&this.res.setAttribute("id",e.id),e.id&&(n+=' id: "'.concat(e.id,'", \n')),this.id=e.id,"exact"===i?'new Image("'.concat(this.url,'", "exact")'):"uncover"===i&&'new Image("'.concat(this.url,'", "uncover")'),this.commonMethods(r),e.vtn&&(this.res.style.viewTransitionName=e.vtn),this.vtn=e.vtn,e.minHeight&&(this.res.style.minHeight=e.minHeight),e.index&&nt(t,"setIndex",this,3)([e.index]),e.index&&(this.index=e.index),e.index&&(n+='\n index: "'.concat(e.index,'",')),e.resprop&&this.resprop(e.resprop),e.centerSelf&&(this.res.style.marginRight="auto",this.res.style.marginLeft="auto"),e.fitContent&&(this.res.style.width="100%",this.res.style.height="100%",this.res.style.marginRight="auto",this.res.style.marginTop="auto",this.res.style.objectFit="cover"),e.objectFit&&(this.res.style.objectFit=e.objectFit),e.objectFit&&(n+='\n objectFit: "'.concat(e.objectFit,'",')),e.objectPosition&&(this.res.style.objectPosition=e.objectPosition),e.objectPosition&&(n+='\n objectPosition: "'.concat(e.objectPosition,'",')),e.as&&this.as(e.as),e.onScroll&&this.onScroll(e.onScroll),e.class&&this.res.setAttribute("class",e.class),e.gpos&&(this.gposObject=e.gpos),e.gpos&&(this.res.style.gridColumn=e.gpos.col,this.res.style.gridRow=e.gpos.row,n+="\n gpos: ".concat(this.removeQuotesFromFirstWord(JSON.stringify(e.gpos)),", ")),e.filtera){var o;o=Array.isArray(e.filtera)?r.filtera.filter(function(t){return"filter"===t.op.name})[0]:e.filtera;var a=this.removeQuotesFromFirstWord(JSON.stringify(o));n+="\n filtera: ".concat(a,", \n")}if(e.keySet&&this.keySet(e.keySet),e.stype&&this.setType(e.stype),e.isBackground&&(this.isBackground=e.isBackground),e.zIndex&&(n+='\n zIndex: "'.concat(e.zIndex,'", \n')),e.area&&this.setArea(e.area),e.area&&(n+='area: "'.concat(e.area,'", \n')),e.opacity&&(this.res.style.opacity=e.opacity),e.width&&(this.res.style.width=e.width),e.width&&(n+='width: "'.concat(e.width,'", ')),e.maxWidth&&(this.res.style.maxWidth=e.maxWidth),e.maxWidth&&(n+='maxWidth: "'.concat(e.maxWidth,'", ')),e.height&&(this.res.style.height=e.height),e.height&&(n+='height: "'.concat(e.height,'", ')),e.multimargin&&this.makeMultiMargin(e.multimargin),e.multimargin&&(n+="multimargin: [ \n"),e.arrayMargin&&this.arrayMargin(e.arrayMargin.sides,e.arrayMargin.value),e.multimargin){for(var s=0;s<e.multimargin.length;s++){var l=e.multimargin[s];n+='{side: "'.concat(l.side,'", value: "').concat(l.value,'"}, \n')}n+="], \n"}if(e.maxWidth&&this.maxWidth(e.maxWidth),e.maxWidth&&(n+='maxWidth: "'.concat(e.maxWidth,'", \n')),e.radius&&this.cornerRadius(e.radius),e.radius&&(n+='radius: "'.concat(e.radius,'", \n')),e.marginOp){var c=this.removeQuotesFromFirstWord(JSON.stringify(e.marginOp));n+="\n marginOp: ".concat(c,",")}if(e.clipPath&&this.clipPath(e.clipPath),e.clipPath&&(n+='clipPath: "'.concat(e.clipPath,'", \n')),r.stroke||r.gradient||r.span||r.backgroundOp||r.layout||r.marginOp||r.shadow||r.filtera||r.animation){r.gradient,r.gradient&&(this.globalGradient=r.gradient.op.gradient),r.stroke&&nt(t,"setAny",this,3)([{globalBlast:"".concat(r.stroke.op.width," ").concat(r.stroke.op.color)}]);var u=[r.stroke,r.gradient,r.animation,r.span,r.backgroundOp,r.layout,r.marginOp,r.shadow,r.filtera,r.animation];u=u.filter(function(t){return null!=t});var d=[];for(s=0;s<u.length;s++)d.push({range:u[s].range,log:u[s].op.name,target:u[s].target,op:u[s].op});this.chainReact(d,this.options.id)}if(r.shadow){var f=r.shadow,h=this.removeQuotesFromFirstWord(JSON.stringify(f));n+="\n shadow: ".concat(h,",")}if(r.animation){var p=r.animation,y=this.removeQuotesFromFirstWord(JSON.stringify(p));n+="\n animation: ".concat(y,",")}var m="\n .set({".concat(n,"}) \n \n");return Object.keys(e).length>0?this.code.push(m):this.code.push(","),this}},{key:"setFilter",value:function(t){var e=[],n=[t];n=n.filter(function(t){return null!=t});for(var r=0;r<n.length;r++)e.push({range:n[r].range,log:n[r].op.name,target:n[r].target})}},{key:"makeMultiMargin",value:function(t){for(var e=0;e<t.length;e++)"left"===t[e].side&&(this.res.style.marginLeft=t[e].value),"right"===t[e].side&&(this.res.style.marginRight=t[e].value),"top"===t[e].side&&(this.res.style.marginTop=t[e].value),"bottom"===t[e].side&&(this.res.style.marginBottom=t[e].value);return this}},{key:"setID",value:function(t){return this.res.setAttribute("id",t),this}},{key:"square",value:function(){return this.res.style.width="30%",this.res.style.paddingBottom="30%",this}},{key:"opacity",value:function(t){return this.res.style.opacity="".concat(t),this}},{key:"rowCol",value:function(t,e){return this.res.style.gridRow=t,this.res.style.gridColumn=e,this}},{key:"setArea",value:function(t){return this.res.style.gridArea=t,this}},{key:"setGridRow",value:function(t){return this.res.style.gridRow=t,this}},{key:"setGridCol",value:function(t){return this.res.style.gridColumn=t,this}},{key:"setGrid",value:function(){return this.res.style.gridRow="span 2",this.res.style.gridColumn="span 3",this}},{key:"transform",value:function(t){return this.res.style.transform=t,this}},{key:"offset",value:function(){return this.res.style.marginLeft="-60px",this}},{key:"offseta",value:function(){return this.res.style.marginLeft="90px",this.res.style.marginTop="-30px",this}},{key:"borderAround",value:function(t){return this.res.style.border=t,this}},{key:"setClass",value:function(t){return this.res.setAttribute("class",t),this}},{key:"scale",value:function(t){var e=this;return this.res.style.width,this.res.style.transition="0.5s all",this.res.addEventListener("mouseover",function(){e.res.style.width,e.res.style.transform="scale(1.04)"}),this.res.addEventListener("mouseout",function(){e.res.style.width,e.res.style.transform="scale(1.0)"}),this}},{key:"onTap",value:function(t){return this.res.addEventListener("click",t),this}},{key:"border",value:function(t){return this.res.style.borderTopLeftRadius="16px",this.res.style.borderTopRightRadius="16px",this}},{key:"allRound",value:function(t){return this.res.style.borderRadius=t,this}},{key:"mobileWidth",value:function(){return window.matchMedia("(max-device-width: 415px)").matches&&(this.res.style.width="120%"),this}},{key:"image",value:function(t,e,n,r,i){var o=window.matchMedia("(max-device-width: 415px)"),a=document.createElement("div");return a.style.viewTransitionName=r,a.style.width="100%",a.style.height=this.options.height?this.options.height:"400px",i&&(a.style.gridColumn=i.gridColumn,a.style.gridRow=i.gridRow),o.matches&&(a.style.height="500"),a.style.backgroundImage="url(".concat(t,")"),a.style.backgroundPosition="center center",a.style.backgroundRepeat="no-repeat",a.style.backgroundSize="cover","uncover"===n&&(a.style.backgroundSize="contain"),"contain"===e&&(a.style.backgroundSize="contain"),this.res=a,this}},{key:"arrayPadding",value:function(t,e){return t.includes("left")&&(this.res.style.paddingLeft=e),t.includes("right")&&(this.res.style.paddingRight=e),t.includes("top")&&(this.res.style.paddingTop=e),t.includes("bottom")&&(this.res.style.paddingBottom=e),this}},{key:"arrayMargin",value:function(t,e){return t.includes("left")&&(this.res.style.marginLeft=e),t.includes("right")&&(this.res.style.marginRight=e),t.includes("top")&&(this.res.style.marginTop=e),t.includes("bottom")&&(this.res.style.marginBottom=e),this}},{key:"setup",value:function(){var t=document.createElement("img");return t.style.width="100%",t.src=this.url,this.res=t,this}},{key:"autoW",value:function(){return this.res.style.width="initial",this}},{key:"float",value:function(t){return this.res.style.float="".concat(t),this}},{key:"fillAvailable",value:function(){return this.res.style.height="-webkit-fill-available",this}},{key:"grayscale",value:function(t){return this.res.style.filter="grayscale(".concat(t,"%)"),this}},{key:"flex",value:function(t){return this.res.style.flex=1,this}},{key:"height",value:function(t){return this.res.style.height=t,this.res.style.width="auto",this}},{key:"expand",value:function(t){var e=this,n=function(){var n,r;if(window.matchMedia("(min-width: ".concat(t.at,")")).matches){e.res.style.width="".concat(t.width);var i=window.innerWidth/2-(r=n=t.width,(n.includes("%")||n.includes("px"))&&(r=r.substr(0,2)),(n.includes("%")?Number(r/100*window.innerWidth):n.includes("px")?Number(r):void 0)/2);e.res.style.marginLeft="".concat(i,"px")}else e.res.style.width="100%",e.res.style.marginLeft="0px";window.matchMedia("(max-device-width: 415px)").matches&&(e.res.style.width="100%",e.res.style.marginLeft="0px")};return n(),window.addEventListener("resize",n),this}},{key:"width",value:function(t){return this.res.style.width=t,this.res.style.height="auto",this}},{key:"toBack",value:function(){return this.res.style.zIndex="-1",this}},{key:"margin",value:function(t,e,n,r){return(t||e||n||r)&&(this.res.style.marginLeft=t,this.res.style.marginTop=e,this.res.style.marginRight=n,this.res.style.marginBottom=r),e||n||r||0===e&&0===n&&0===r||(this.res.style.margin=t),this}},{key:"padding",value:function(t){return this.res.style.padding=t,this}},{key:"size",value:function(t,e){return t&&e?(this.res.style.width=t,this.res.style.height=e):(this.res.style.width=t,this.res.style.height=t),this}},{key:"frame",value:function(t){var e=t.width,n=t.height;return e&&n?(this.res.style.width=e,this.res.style.height=n):(this.res.style.width=e,this.res.style.height=e),this}},{key:"RSize",value:function(t,e,n){var r=window.matchMedia("(max-device-width: 420px)");return t&&e?(this.res.style.width=r.matches?t*n:t,this.res.style.height=r.matches?e*n:e):(this.res.style.width=r.matches?t*n:t,this.res.style.height=r.matches?t*n:t),this}},{key:"shadow",value:function(t){return"mild"===t.type?this.res.style.boxShadow="0px 3px 15px rgba(0,0,0,0.2)":this.res.style.boxShadow="".concat(t.x,"px ").concat(t.y,"px ").concat(t.radius,"px ").concat(t.color),this}},{key:"clipShape",value:function(t){return this.res.style.borderRadius="50%",this}},{key:"cornerRadius",value:function(t){return this.res.style.borderRadius=t,this}},{key:"clipPath",value:function(t){this.res.style.clipPath='path("'.concat(t,'")');var e=document.createElementNS("http://www.w3.org/2000/svg","svg");return e.style.display="block",e.style.width="100%",e.style.height="100%",e.style.overflow="visible",this}},{key:"render",value:function(t){var e=this.res;if(!t)return e;document.querySelector(t).appendChild(e)}}],n&&Z(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function st(t){return st="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},st(t)}function lt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function ct(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ut(r.key),r)}}function ut(t){var e=function(t){if("object"!=st(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=st(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==st(e)?e:e+""}function dt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(dt=function(){return!!t})()}function ft(t,e,n,r){var i=ht(pt(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof i?function(t){return i.apply(n,t)}:i}function ht(){return ht="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=pt(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},ht.apply(null,arguments)}function pt(t){return pt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},pt(t)}function yt(t,e){return yt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},yt(t,e)}var mt=function(){function t(e,n,r){var i,o,a,s;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(o=this,a=t,a=pt(a),i=function(t,e){if(e&&("object"==st(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(o,dt()?Reflect.construct(a,s||[],pt(o).constructor):a.apply(o,s))).link=n,i.text=e,i.code=[],i.css=[],i.elCSS=[],i.html=[],i.res=null,i.stopEM=r,i.setup(),i.inlineBlock(),i.res.addEventListener("click",function(t){var e=i.link||i.res.getAttribute("href");if(e){var n=new URL(e,window.location.href).href,r=/^https?:\/\//i.test(n),o=n.startsWith("#"),a=/^[a-zA-Z]+:/.test(n);r||o||n.endsWith(".html")||a||(t.preventDefault(),"navigation"in window?navigation.navigate(n):(history.pushState({},"",n),document.dispatchEvent(new PopStateEvent("popstate"))))}}),i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&yt(t,e)}(t,W),e=t,n=[{key:"toCSS",value:function(){return this.css}},{key:"toHTMLA",value:function(){return this.html}},{key:"toElCSS",value:function(){return 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"HTMLAnchorElement"}},{key:"toCode",value:function(){if(this.excludeFromCodeTrue)return[""];var t=Object.fromEntries(Object.entries(this.options).filter(function(t){var e,n,r=(n=2,function(t){if(Array.isArray(t))return t}(e=t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,n)||function(t,e){if(t){if("string"==typeof t)return lt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?lt(t,e):void 0}}(e,n)||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.")}());return r[0],null!==r[1]})),e=JSON.stringify(t,null,4).replace(/"([^"]+)":/g,"$1:");return["new Link().set(".concat(e,")")]}},{key:"setArea",value:function(t){return this.res.style.gridArea=t,this}},{key:"setup",value:function(){var t=document.createElement("a");t.setAttribute("href",this.link),t.style.textDecoration="none",t.style.color="black",t.style.fontFamily="Arial";var e=document.createTextNode(this.text);return t.appendChild(e),this.res=t,!1===this.stopEM&&this.em(1),this}},{key:"appendImageAsChild",value:function(t,e){var n=document.createElement("a");t.options.vtn&&(n.style.viewTransitionName=t.options.vtn),n.setAttribute("href",t.options.url);var r=document.createElement("img");return t.options&&(r.style.width=t.options.size,t.options.radius&&(r.style.borderRadius=t.options.radius),r.setAttribute("src",t.options.img),t.options.pad&&(this.res.style.padding=t.options.pad),t.options.padRight&&(this.res.style.paddingRight=t.options.padRight),n.appendChild(r)),this.res=n,e&&(this.res.style.marginLeft=e),this}},{key:"addIcon",value:function(t){var e=document.createElement("img");return e.style.width="20px",e.style.height="auto",e.style.marginLeft=t.padding?t.padding:"10px",e.setAttribute("src",t.url),this.res.appendChild(e),this}},{key:"removeQuotesFromFirstWord",value:function(t){if(t)return t.replace(/"([^"]+)":/g,"$1:")}},{key:"onTap",value:function(t){return this.res.addEventListener("click",t),this}},{key:"set",value:function(e){this.elCSS.push("text-decoration: none; \n"),this.options=e;var n="";e.onTap&&this.onTap(e.onTap),e.tags&&ft(t,"setTags",this,3)([e.tags]),e.id&&this.res.setAttribute("id",e.id),e.id&&ft(t,"setID",this,3)([e.id]),this.commonMethods(e),e.flex&&(this.res.style.display="flex"),e.fixMobileTap&&this.fixMobileTap(e.fixMobileTap);var r=this.removeQuotesFromFirstWord(JSON.stringify(e.pad));if(e.pad&&(n+="\n pad: ".concat(r,",")),e.preffersId&&(this.preffersId=e.preffersId),null!=e.preffersId&&(n+="\n preffersId: ".concat(e.preffersId,",")),e.class&&ft(t,"setClass",this,3)([e.class]),e.class&&(n+='\n class: "'.concat(e.class,'",')),e.borderObj){this.res.style.border="".concat(e.borderObj.width," solid ").concat(e.borderObj.color),this.res.style.borderRadius="".concat(e.borderObj.radius);var i=this.removeQuotesFromFirstWord(JSON.stringify(e.borderObj));n+="\n borderObj: ".concat(i,",")}if(!1===this.options.preffersId?this.html.push('<a class="'.concat(e.class,'" href="#hello">').concat(e.text,"</a> \n \n")):e.id&&this.html.push('<a id="'.concat(e.id.substr(1),'" href="#hello">').concat(e.text,"</a> \n \n")),null!=e.blastData){var o=this.removeQuotesFromFirstWord(JSON.stringify(e.blastData));ft(t,"setAny",this,3)([{globalBlast:"1px ".concat(e.blastData.color)}]),e.blastData&&(n+="\n blastData: ".concat(o,","))}e.nowrap&&(this.res.style.whiteSpace="nowrap"),e.font&&this.font(e.font),e.font&&(n+='\n font: "'.concat(e.font,'",')),e.font&&this.elCSS.push('font-family: "'.concat(e.font,'"; \n')),e.fluidc&&this.fluidCopy(e.fluidc),e.fluidc&&(n+='\n fluidc: "'.concat(e.fluidc,'",')),e.clampc&&this.clampCopy(e.clampc),this.options.id&&(n+='\n id: "'.concat(this.options.id,'",')),e.align&&this.leftAlign(e.align),e.align&&(n+='\n align: "'.concat(e.align,'",')),e.type&&(this.res.style.display="block"),e.color&&this.color(e.color),e.color&&(n+='\n color: "'.concat(e.color,'",')),e.color&&this.elCSS.push('color: "'.concat(e.color,'"; \n')),e.background&&this.background(e.background);var a=this.removeQuotesFromFirstWord(JSON.stringify(e.background));e.background&&(n+="\n background: ".concat(a,",")),e.hover&&this.hover(e.hover);var s=this.removeQuotesFromFirstWord(JSON.stringify(e.hover));if(e.hover&&(n+="\n hover: ".concat(s,",")),e.blast&&(this.blastData=e.blast),e.bold&&(n+="\n bold: ".concat(e.bold,",")),e.block&&this.toBlock(),e.block&&(n+="\n block: ".concat(e.block,",")),e.radius&&(n+='\n radius: "'.concat(e.radius,'",')),e.width&&(n+='\n width: "'.concat(e.width,'",')),e.arrayPadding){var l=e.arrayPadding.sides.map(function(t){return'"'.concat(t,'"')}).join(", ");e.arrayPadding&&this.arrayPadding(e.arrayPadding.sides,e.arrayPadding.value),e.arrayPadding&&(n+="\n arrayPadding: {sides: [".concat(l,'], value: "').concat(e.arrayPadding.value,'"},'))}if(e.arrayMargin&&this.arrayMargin(e.arrayMargin.sides,e.arrayMargin.value),e.arrayMargin&&(n+="\n arrayMargin: {sides: [".concat(e.arrayMargin.sides.map(function(t){return'"'.concat(t,'", ')}),'], value: "').concat(e.arrayMargin.value,'"},')),e.maxWidth&&this.maxWidth(e.maxWidth),e.url&&this.res.setAttribute("href",e.url),n+='\n url: "'.concat(e.url,'",'),e.text&&(this.res.textContent=e.text),n+='\n text: "'.concat(e.text,'",'),e.data){e.data&&this.appendImageAsChild(e.data,"20px");var c=this.removeQuotesFromFirstWord(JSON.stringify(e.data));e.data&&(n+="\n data: ".concat(c))}if(e.icon){this.addIcon(e.icon);var u=this.removeQuotesFromFirstWord(JSON.stringify(e.icon));n+="\n icon: ".concat(u,",")}if(e.shadow){var d=e.shadow,f=this.removeQuotesFromFirstWord(JSON.stringify(d));n+="\n shadow: ".concat(f,",")}if(e.stroke){var h=this.removeQuotesFromFirstWord(JSON.stringify(e.stroke));e.stroke&&(n+="\n stroke: ".concat(h,","))}if(e.backgroundOp){var p=this.removeQuotesFromFirstWord(JSON.stringify(e.backgroundOp));n+="\n backgroundOp: ".concat(p,",")}if(e.marginOp){var y=this.removeQuotesFromFirstWord(JSON.stringify(e.marginOp));n+="\n marginOp: ".concat(y,",")}if(e.gradient){var m=this.removeQuotesFromFirstWord(JSON.stringify(e.gradient));n+="\n gradient: ".concat(m,",")}if(e.animation){var v=this.removeQuotesFromFirstWord(JSON.stringify(e.animation));n+="\n animation: ".concat(v,",")}if(e.transform){var g=this.removeQuotesFromFirstWord(JSON.stringify(e.transform));n+="\n transform: ".concat(g,",")}if(e.blast){var b=this.removeQuotesFromFirstWord(JSON.stringify(e.blast));n+="\n blast: ".concat(b,",")}var w="new Link().set({".concat(n,"}) \n");this.code.push(w),e.color&&this.color(e.color),e.rounded&&this.round(),e.new&&(this.res.setAttribute("target","_blank"),this.res.setAttribute("rel","noopener noreferrer")),e.transform&&this.reactOnTransform(e.transform);var x=[],k=[e.border,e.blast,e.gradient,e.animation,e.span,e.shadow,e.backgroundOp,e.animation,e.transform];if((k=k.filter(function(t){return null!=t})).length>0){e.gradient&&(this.globalGradient=e.gradient.op.gradient,"radial"===e.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)")),e.stroke&&ft(t,"setAny",this,3)([{globalBlast:"".concat(e.stroke.op.width," ").concat(e.stroke.op.color)}]);for(var S=0;S<k.length;S++)x.push({range:k[S].range,log:k[S].op.name,target:k[S].target,op:k[S].op});var O=[];e.borderObj&&O.push("border"),e.background&&O.push("background"),e.mar&&O.push("margin"),e.animation&&O.push("animation"),this.chainReact(x,e.id,O,e.isNavA),this.res.style.zIndex=1}return this}},{key:"fixMobileTap",value:function(t){this.res.style.pointerEvents="auto",this.res.style.touchAction="manipulation",this.res.style.cursor="pointer",this.res.style.zIndex="1",this.res.style.position="relative"}},{key:"color",value:function(t){return this.res.style.color=t,this}},{key:"maxWidth",value:function(t){return this.res.style.maxWidth=t,this}},{key:"background",value:function(t){return this.res.style.backgroundColor=t,this}},{key:"leftAlign",value:function(t){return this.res.style.textAlign=t,this}},{key:"arrayPadding",value:function(t,e){return e||(this.res.style.marginLeft="".concat(t[0],"px"),this.res.style.marginTop="".concat(t[1],"px"),this.res.style.marginRight="".concat(t[2],"px"),this.res.style.marginBottom="".concat(t[3],"px")),"all"===t[0]&&(this.res.style.paddingLeft=e,this.res.style.paddingTop=e,this.res.style.paddingRight=e,this.res.style.paddingBottom=e),t.includes("left")&&(this.res.style.paddingLeft=e),t.includes("right")&&(this.res.style.paddingRight=e),t.includes("top")&&(this.res.style.paddingTop=e),t.includes("bottom")&&(this.res.style.paddingBottom=e),e||(this.res.style.paddingBottom=t),this}},{key:"arrayMargin",value:function(t,e){return t.includes("left")&&(this.res.style.marginLeft=e),t.includes("right")&&(this.res.style.marginRight=e),t.includes("top")&&(this.res.style.marginTop=e),t.includes("bottom")&&(this.res.style.marginBottom=e),t.includes("all")&&(this.res.style.margin=e),e||(this.res.style.marginBottom=t),this}},{key:"getClampValue",value:function(t){return"S6"===t?"clamp(2.25rem, 2vw+1.5rem, 3.25rem)":"S5"===t?"clamp(2.75rem, 2vw + 1.5rem, 3.25rem)":"S4"===t?"clamp(3.5rem, 2vw + 1.5rem, 3.25rem)":"S3"===t?"clamp(4.25rem, 2vw + 1.5rem, 3.25rem)":"S2"===t?"clamp(5rem, 2vw + 1.5rem, 3.25rem)":"S1"===t?"clamp(6rem, 2vw + 1.5rem, 3.25rem)":void 0}},{key:"clampCopy",value:function(t){return this.res.style.fontSize=this.getClampValue(t),this}},{key:"fluidCopy",value:function(t){return"S1"===t&&(this.res.style.fontSize="calc(1.625rem + 5.075vw)"),"S2"===t&&(this.res.style.fontSize="calc(1.500rem + 4.3vw)"),"S3"===t&&(this.res.style.fontSize="calc(1.375rem + 3.525vw)"),"S4"===t&&(this.res.style.fontSize="calc(1.250rem + 2.75vw)"),"S5"===t&&(this.res.style.fontSize="calc(1.125rem + 1.975vw)"),"S6"===t&&(this.res.style.fontSize="calc(1rem + 0.5vw)"),this}},{key:"inlineBlock",value:function(){return this.res.style.display="inline-block",this}},{key:"toBlock",value:function(){return this.res.style.display="block",this}},{key:"myself",value:function(t){var e=this,n=function(){window.matchMedia("(max-device-width: 415px)").matches?e.res.style.fontSize=t.desktop:e.res.style.fontSize=t.phone};return n(),window.addEventListener("resize",n),this}},{key:"style",value:function(t){return this.res.style.color=t.styles.color,this.res.style.fontWeight=t.styles.fontWeight,this.res.style.paddingLeft=t.styles.padding[0],this.res.style.paddingTop=t.styles.padding[1],this.res.style.paddingRight=t.styles.padding[2],this.res.style.paddingBottom=t.styles.padding[3],this}},{key:"round",value:function(){return this.res.style.borderRadius="0.5rem",this.options.rounded&&(this.res.children[0].style.borderRadius="0.5rem"),this}},{key:"newWindow",value:function(){return this.res.target="_new",this}},{key:"radius",value:function(t){return this.res.style.borderRadius="".concat(t),this}},{key:"transition",value:function(t){return this.res.style.transition="".concat(t,"s ease-in-out"),this.res.style.transionProperty="background, color",this}},{key:"width",value:function(t){return this.res.style.width=t,this}},{key:"italic",value:function(){return this.res.style.fontStyle="italic",this}},{key:"padding",value:function(t,e,n,r){return t&&e&&n&&r?(this.res.style.paddingLeft=t,this.res.style.paddingTop=e,this.res.style.paddingRight=n,this.res.style.paddingBottom=r):this.res.style.padding=t,this}},{key:"medium",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.res.style.fontSize="2rem":t.res.style.fontSize="1.5em"};return e(),window.addEventListener("resize",e),this}},{key:"opacity",value:function(t){return this.res.style.opacity=t,this}},{key:"margin",value:function(t,e,n,r){return this.res.style.marginTop=t,this.res.style.marginLeft=e,this.res.style.marginRight=n,this.res.style.marginBottom=r,this}},{key:"em",value:function(t){var e=this,n=window.matchMedia("(max-device-width: 415px)"),r=function(){n.matches?e.res.style.fontSize="2em":e.res.style.fontSize="1em"};return r(),window.addEventListener("resize",r),this}},{key:"font",value:function(t){return this.res.style.fontFamily=t,this}},{key:"render",value:function(t){return t?(document.querySelector(t).appendChild(this.res),this):this.res}}],n&&ct(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function vt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return gt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gt(t,e):void 0}}(t,e)||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 gt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function bt(t){return bt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bt(t)}function wt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,xt(r.key),r)}}function xt(t){var e=function(t){if("object"!=bt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=bt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==bt(e)?e:e+""}function kt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(kt=function(){return!!t})()}function St(){return St="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Ot(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},St.apply(null,arguments)}function Ot(t){return Ot=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ot(t)}function jt(t,e){return jt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},jt(t,e)}var Ct=function(){function t(e,n){var r,i,o,a;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(i=this,o=t,o=Ot(o),r=function(t,e){if(e&&("object"==bt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(i,kt()?Reflect.construct(o,a||[],Ot(i).constructor):o.apply(i,a))).code=[],r.saveEl=n,r.frs=e,r.res=null,r.setup(),r.responsive(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&jt(t,e)}(t,W),e=t,n=[{key:"getType",value:function(){return"FlexRowLayoutElement"}},{key:"set",value:function(t){this.options=t;var e=t;return e.onTap&&this.onTap(e.onTap),e.id&&this.res.setAttribute("id",e.id),e.position&&(this.res.style.position=e.position),void 0!==e.top&&(this.res.style.top=e.top),t.id&&this.res.setAttribute("id",t.id),this.commonMethods(e),t.padding&&this.padding(t.padding),t.background&&(this.res.style.backgroundColor="#ecf0f1",this.res.style.cornerRadius="#3rem"),t.alignTo&&(this.res.style.justifyContent=t.alignTo),t.background&&(this.res.style.backgroundColor=t.background),t.justify&&(this.res.style.justifyContent=t.justify),t.border&&("top"===t.border[0]&&(this.res.style.borderTop="".concat(t.border[1]," solid white")),"all"===t.border[0]&&(this.res.style.border="".concat(t.border[1]," solid orange"))),t.borderObj&&(this.borderObj(t.borderObj),JSON.stringify(t.borderObj)),t.width&&(this.res.style.width=t.width),t.height&&(this.res.style.height=t.height),t.gap&&(this.res.style.gap=t.gap),t.align&&(JSON.stringify(t.align),this.res.style.alignItems="flex-start",this.res.style.alignItems="flex-start"),t.wrap&&this.wrap(),t.alignIts&&(JSON.stringify(t.alignIts),this.res.style.alignItems="flex-start"),t.owrap&&this.onlyWrap(),null!=t.owrap&&!1===t.owrap&&(this.res.style.flexWrap="nowrap",this.res.style.background="yellow"),t.toColumn&&this.toColumn(t.toColumn),t.column&&this.makeCol(),t.colat&&t.colat&&this.toColumnAt(t.colat),t.arrayPadding&&this.arrayPadding(t.arrayPadding.sides,t.arrayPadding.value),t.arrayMargin&&this.arrayMargin(t.arrayMargin.sides,t.arrayMargin.value),this.arrayMarginValue=t.arrayMargin,t.multipad&&this.makeMultiPad(t.multipad),t.align&&this.makeJustify(t.justify),t.justify&&this.makeAlign(t.justify),"flex-start"===t.justifo&&(this.res.style.justifyContent="flex-start"),t.radius&&(this.res.style.borderRadius=t.radius),t.aligns&&this.aligns(t.aligns),this.callReact(e),!0===t.center&&(this.res.style.marginLeft="auto",this.res.style.marginRight="auto"),this}},{key:"callReact",value:function(e){this.options=e;var n,r,i=[],o=e.transform&&"object"===bt(e.transform);if(e.stroke||e.gradient||e.span||e.backgroundOp||e.layout||e.shadow||e.animation||e.filtera||o){e.gradient&&(this.globalGradient=e.gradient.op.gradient,"radial"===e.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)")),e.stroke&&(n=this,"function"==typeof(r=St(Ot(t.prototype),"setAny",n))?function(t){return r.apply(n,t)}:r)([{globalBlast:"".concat(e.stroke.op.width," ").concat(e.stroke.op.color)}]),e.span&&(e.span.prevText=this.text);var a=[e.stroke,e.gradient,e.animation,e.span,e.backgroundOp,e.layout,e.marginOp,e.shadow,e.animation,e.filtera,o?e.transform:void 0];a=a.filter(function(t){return null!=t});for(var s=0;s<a.length;s++)i.push({range:a[s].range,log:a[s].op.name,target:a[s].target,op:a[s].op});var l=[];e.borderObj&&l.push("border"),e.background&&l.push("background"),e.mar&&l.push("margin"),e.animation&&l.push("animation"),e.span&&l.push("span"),this.chainReact(i,e.id,l)}}},{key:"setArea",value:function(t){return this.res.style.gridArea=t,this}},{key:"toColumnAt",value:function(t){var e=this;if(!this.columnAlways){var n=function(){var n=window.matchMedia("(max-width: ".concat(t,")")),r=window.matchMedia("(max-device-width: 415px)");n.matches||r.matches?e.res.style.flexDirection="column":e.res.style.flexDirection="row"};n(),window.addEventListener("resize",n)}return this}},{key:"onlyWrap",value:function(){return this.res.style.flexWrap="wrap",this}},{key:"wrap",value:function(){return this.res.style.flexWrap="wrap",this.res.style.justifyContent="space-between",this}},{key:"aligns",value:function(t){return"start"===t&&(this.res.style.alignItems="flex-start"),"end"===t&&(this.res.style.alignItems="flex-end"),"center"===t&&(this.res.style.alignItems="center"),this}},{key:"toColumn",value:function(){return this.res.style.flexDirection="column",this}},{key:"toCode",value:function(){for(var t={},e=0,n=Object.entries(this.options||{});e<n.length;e++){var r=vt(n[e],2),i=r[0],o=r[1];null!=o&&""!==o&&(t[i]=o)}var a=JSON.stringify(t,null,4).replace(/"([^"]+)":/g,"$1:").replace(/"([^"]*)"/g,function(t,e){return e.includes("\n")?"`"+e.replace(/`/g,"\\`")+"`":'"'.concat(e,'"')}),s=(this.items||[]).map(function(t){return null!=t&&t.toCode?t.toCode():"/* element */"}).join(",\n ");return[["new FlexRow().set(".concat(a,")"),s?".items([\n ".concat(s,"\n])"):""].join("")]}},{key:"arrayPadding",value:function(t,e){return t.includes("left")&&(this.res.style.paddingLeft=e),t.includes("right")&&(this.res.style.paddingRight=e),t.includes("top")&&(this.res.style.paddingTop=e),t.includes("bottom")&&(this.res.style.paddingBottom=e),this}},{key:"borderAround",value:function(t){return this.res.style.border=t,this}},{key:"cornerRadius",value:function(t){return this.res.style.borderRadius=t,this}},{key:"makeJustify",value:function(t){return"start"===t&&(this.res.style.justifyContent="flex-start"),this}},{key:"makeAlign",value:function(t){return"center"===t?this.res.style.alignItems="center":this.res.style.justifyContent=t,this}},{key:"makeCol",value:function(){return this.res.style.flexDirection="column",this}},{key:"makeMultiPad",value:function(t){for(var e=0;e<t.length;e++)"left"===t[e].side&&(this.res.style.paddingLeft=t[e].value),"right"===t[e].side&&(this.res.style.paddingRight=t[e].value);return this}},{key:"padding",value:function(t){return this.res.style.padding=t,this}},{key:"center",value:function(){return this}},{key:"setClass",value:function(t){return this.res.setAttribute("class",t),this}},{key:"toCenter",value:function(t){return this.res.style.marginLeft="auto",this.res.style.marginRight="auto",this.res.setAttribute("class",t),this}},{key:"setup",value:function(){var t=document.createElement("div");return t.style.display="flex",t.style.justifyContent="space-around",t.style.alignItems="center",this.res=t,this}},{key:"noSpaceAround",value:function(){return this.res.style.justifyContent="",this}},{key:"itemAlignCenter",value:function(){return this.res.style.justifyContent="center",this.res.style.alignItems="center",this}},{key:"arrayMargin",value:function(t,e){return e||(this.res.style.marginLeft="".concat(t[0],"px"),this.res.style.marginTop="".concat(t[1],"px"),this.res.style.marginRight="".concat(t[2],"px"),this.res.style.marginBottom="".concat(t[3],"px")),t.includes("left")&&(this.res.style.marginLeft="".concat(e,"px")),t.includes("right")&&(this.res.style.marginRight="".concat(e,"px")),t.includes("top")&&(this.res.style.marginTop="".concat(e,"px")),t.includes("bottom")&&(this.res.style.marginBottom="".concat(e,"px")),this}},{key:"frame",value:function(t){return this.res.style.width=t.width,this.res.style.height=t.height,window.matchMedia("(max-device-width: 415px)").matches&&t.mobile&&(this.res.style.width=t.mobile),this}},{key:"background",value:function(t){return this.res.style.background=t,this}},{key:"radius",value:function(t){return this.res.style.borderRadius="".concat(t,"px"),this}},{key:"shadow",value:function(t,e,n){return this.res.style.boxShadow="0px 1px 10px 0px rgb(145 145 145)",this}},{key:"onTap",value:function(t){return this.res.addEventListener("click",t),this}},{key:"items",value:function(t){this.els=t,this.items=t;for(var e=0;e<t.length;e++){if(null!=t[e])if(t[e].render instanceof Function){var n=t[e].render();this.res.appendChild(n)}else this.res.appendChild(t[e]);if(null!=t[e]&&t[e].render instanceof Function){var r=t[e].render();this.res.appendChild(r),void 0!==t[e].toCode&&this.code.push(t[e].toCode().flatMap(function(t){return t}))}}return this}},{key:"adjustRatiosForLayout",value:function(){var t=this;return null==this.els[1].getWidth||null==this.els[1].getHeight||(window.addEventListener("resize",function(){t.resizeValues()}),this.resizeValues()),this}},{key:"resizeValues",value:function(){var t=.7*window.innerWidth*(this.els[1].getHeight()/this.els[1].getWidth());this.res.children[0].style.height="".concat(t,"px"),this.res.children[0].style.width="30%",this.res.children[1].style.width="70%"}},{key:"responsive",value:function(t){var e=this,n=window.matchMedia("(max-device-width: 415px)");return window.innerWidth<t||n.matches?this.res.style.gridTemplateColumns="1fr":this.res.style.gridTemplateColumns="1fr 1fr",window.addEventListener("resize",function(){window.innerWidth<t||n.matches?e.res.style.gridTemplateColumns="1fr":e.res.style.gridTemplateColumns="1fr 1fr"}),this}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}],n&&wt(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function Et(t){return Et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Et(t)}function Tt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,_t(r.key),r)}}function _t(t){var e=function(t){if("object"!=Et(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Et(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Et(e)?e:e+""}var Pt=function(){return t=function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.obj=e||{},this.items=n||[]},(e=[{key:"render",value:function(){var t=document.createElement("div");t.style.display="flex",t.style.width="100%",t.style.justifyContent="space-around",t.setAttribute("id","innerItemsWrapper");var e=window.matchMedia("(max-device-width: 415px)"),n=window.matchMedia("(max-width: 600px)");(e.matches||n.matches)&&(t.style.marginTop="3rem");for(var r=0;r<this.items.length;r++){var i=this.items[r];t.appendChild(i.render())}var o=document.createElement("div");return o.style.width=this.obj.isSide?"333px":"100%",o.style.background=this.obj.background||"white",o.style.display="flex",o.style.justifyContent="center",o.style.alignItems="center",o.style.height="100%",o.setAttribute("id","outerItemsWrapper"),o.appendChild(t),this.obj.customStyle&&(t.style.width="auto",t.style.top="0rem",t.style.borderRadius="1rem",t.style.background=this.obj.background||"white",t.style.margin="1rem",t.style.position="absolute",t.style.opacity=.8),o}}])&&Tt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function At(t){return At="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},At(t)}function Rt(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Mt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Mt(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Mt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Lt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,zt(r.key),r)}}function zt(t){var e=function(t){if("object"!=At(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=At(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==At(e)?e:e+""}function It(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(It=function(){return!!t})()}function Ft(t){return Ft=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ft(t)}function Wt(t,e){return Wt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Wt(t,e)}window.CustomDivRenderer=Pt;var Dt=function(){function t(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,n=Ft(n=t),function(t,e){if(e&&("object"==At(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(e,It()?Reflect.construct(n,r||[],Ft(e).constructor):n.apply(e,r));var e,n,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Wt(t,e)}(t,W),e=t,(n=[{key:"setup",value:function(t){return this.obj=t,this.setTags(this.obj.tags),this.animate=void 0===this.obj.animate||this.obj.animate,this.res=this.createSideNav(t),this.res.style.position="relative",this.res.style.zIndex=3,this.closed=!0,this}},{key:"toggleSideNav",value:function(t){var e=this;this.closed=!this.closed;var n=this.res.children[0];if(this.closed)if(n.style.overflowX="hidden",t.style.opacity=1,this.animate){this.ope=n.animate([{transform:"translateX(0)"},{transform:"translateX(100%)"}],{duration:300,fill:"forwards"}),this.ope.finished.then(function(){var t=new CustomEvent(e.obj.tags.close);window.dispatchEvent(t)});var r,i=-1,o=Rt(n.children);try{for(o.s();!(r=o.n()).done;){var a=r.value;if(i+=1,this.masterEL[i]){var s,l=Rt(a.children);try{for(l.s();!(s=l.n()).done;){var c=s.value,u=this.masterEL[i].options.animation;u&&this.mappedIDS.includes(c.id)&&c.animate(u.op.keyframesClose,u.op.closeOptions)}}catch(t){l.e(t)}finally{l.f()}}}}catch(t){o.e(t)}finally{o.f()}}else n.style.display="none";else{n.style.overflowX="none";var d,f=-1,h=Rt(n.children);try{for(h.s();!(d=h.n()).done;){var p=d.value;f+=1;var y,m=Rt(p.children);try{for(m.s();!(y=m.n()).done;){var v=y.value;if(this.mappedIDS.includes(v.id)&&void 0!==this.masterEL[0]){var g=this.masterEL[f].options.animation;if(g){var b=g.op.openOptions;b.delay||(b.delay=1),b.duration||(b.duration=300),v.animate(g.op.keyframesOpen,b)}}}}catch(t){m.e(t)}finally{m.f()}}}catch(t){h.e(t)}finally{h.f()}t.style.opacity=0,this.animate?(n.style.display="flex",this.opeClose=n.animate([{transform:"translateX(100%)"},{transform:"translateX(0)"}],{duration:300,fill:"forwards"}),this.opeClose.finished.then(function(){var t=new CustomEvent(e.obj.tags.open);window.dispatchEvent(t)})):n.style.display="flex"}}},{key:"createToggleButton",value:function(t){var e=document.createElement("button");return e.innerText="☰",e.style.padding="10px 20px",e.style.backgroundColor="transparent",e.style.color=null!=t?t:"#3498db",e.style.border="none",e.style.borderRadius="5px",e.style.cursor="pointer",e.style.zIndex=1,e.style.fontSize="1.6rem",this.obj.fixed&&(e.style.position="fixed"),e}},{key:"createCloseButton",value:function(t){var e=document.createElement("button");return e.innerText="×",e.style.fontSize="1.6rem",e.style.padding="10px 20px",e.style.backgroundColor="transparent",e.style.color=null!=t?t:"black",e.style.border="none",e.style.borderRadius="5px",e.style.cursor="pointer",e.style.zIndex=1,e.style.alignSelf="flex-end",e}},{key:"createSideNav",value:function(t){var e=this,n=document.createElement("div");n.style.display="flex",n.style.justifyContent="flex-end";var r=document.createElement("div");r.style.display="none",r.style.background=this.obj.background||"#1abc9c",r.style.height="100%",window.matchMedia("(max-device-width: 415px)").matches?r.style.width="100%":r.style.width=this.obj.width||"400px",r.style.position="fixed",r.style.right=0,this.animate&&(r.style.transform="translateX(100%)"),r.style.flexDirection="column",r.style.justifyContent="flex-start";var i=this.createToggleButton(this.obj.hamColour.opened),o=this.createCloseButton(this.obj.hamColour.closed);return i.addEventListener("click",function(){return e.toggleSideNav(i)}),o.addEventListener("click",function(){return e.toggleSideNav(i)}),r.appendChild(o),n.appendChild(r),n.appendChild(i),n}},{key:"items",value:function(t){this.masterEL=t.items.filter(function(t){return void 0!==t.link});var e=t.items.filter(function(t){return void 0===t.items}).map(function(t){return t.id});if(this.mappedIDS=e,this.item=t,this.res.children[0].appendChild(t.render()),void 0!==this.masterEL[0]){var n=this.masterEL[0].options.animation;if(n){var r,i=Rt(this.res.children[0].children);try{for(i.s();!(r=i.n()).done;){var o,a=Rt(r.value.children);try{for(a.s();!(o=a.n()).done;){var s=o.value;this.mappedIDS.includes(s.id)&&(n.op.closeOptions.delay=0,s.animate(n.op.keyframesClose,n.op.closeOptions))}}catch(t){a.e(t)}finally{a.f()}}}catch(t){i.e(t)}finally{i.f()}}}return this}},{key:"toCode",value:function(){var t="new SideNav().setup(".concat(this.formatObj(this.obj),")");if(this.item){var e=this.item.toCode?this.item.toCode().join(""):this.formatObj(this.item);e=e.replace(/,\s*(\.set\(|\.add\()/g,"\n $1"),t+=".items(".concat(e,")")}return t}},{key:"formatObj",value:function(t){return JSON.stringify(t,null,2).replace(/"(\w+)"\s*:/g,"$1:")}},{key:"render",value:function(t){return t&&document.querySelector(t).appendChild(this.res),this.res}}])&&Lt(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function Bt(t){return Bt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bt(t)}function Nt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Ht(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Gt(r.key),r)}}function Gt(t){var e=function(t){if("object"!=Bt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Bt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Bt(e)?e:e+""}function Ut(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ut=function(){return!!t})()}function qt(t){return qt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},qt(t)}function Jt(t,e){return Jt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Jt(t,e)}var Xt=function(){function t(){var e,n,r,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(n=this,r=t,r=qt(r),e=function(t,e){if(e&&("object"==Bt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(n,Ut()?Reflect.construct(r,i||[],qt(n).constructor):r.apply(n,i))).res=document.createElement("div"),e.res.style.display="grid",e.attributes={},e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Jt(t,e)}(t,W),e=t,n=[{key:"set",value:function(t){return this.options=t,this.attributes=t,this.templateCols=t.templateCols,t.templateCols&&(this.res.style.gridTemplateColumns="repeat(".concat(t.templateCols.cols,", 1fr)"),this.res.style.gridTemplateRows="repeat(".concat(t.templateCols.cols,", 1fr)")),this.res.style.height=t.height?t.height:"600px",t.positions&&(this.storedPositions=t.positions),this}},{key:"generateGridPositions",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:50,i=document.createElement("div");i.classList.add("container"),i.style.display="grid",i.style.gridTemplateColumns="repeat(".concat(r,", 1fr)"),i.style.gridTemplateRows="repeat(".concat(n,", 1fr)"),i.style.width="100%",i.style.height="100vh";var o=t.map(function(t,e){return{row:Math.floor(n/2)+e,col:Math.floor(r/2)+e}});return t.forEach(function(i,a){var s=o[a],l=s.row,c=s.col,u=function(e){var n=0,r=0;return t.forEach(function(t,i){var a=t.weight,s=t.direction,l=o[e],c=o[i],u=l.col-c.col,d=l.row-c.row,f=a*(1/(Math.sqrt(u*u+d*d)+1));switch(s){case"L":n-=f;break;case"R":n+=f;break;case"U":r-=f;break;case"B":r+=f}}),{forceX:n,forceY:r}}(a),d=u.forceX,f=u.forceY;c=Math.max(1,Math.min(r,c+Math.round(d))),l=Math.max(1,Math.min(n,l+Math.round(f)));var h=e.items.filter(function(t){return t.id===i.attract.slice(1)})[0].render();h.style.gridRowStart=l,h.style.gridColumnStart=c,h.style.display="flex",h.style.alignItems="center",h.style.justifyContent="center",h.style.fontWeight="bold",e.res.appendChild(h)}),this}},{key:"add",value:function(t){this.items=t;var e,n=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Nt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Nt(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;this.res.appendChild(r.render())}}catch(t){n.e(t)}finally{n.f()}return this.storedPositions&&this.generateGridPositions(this.storedPositions),this}},{key:"toCode",value:function(){if(this.excludeFromCodeTrue)return[""];var t=JSON.stringify(this.options,null,4).replace(/"([^"]+)":/g,"$1:"),e="";return e+=".add([\n",e+=this.items.map(function(t){return t.toCode().join("").trim()}).join(",\n"),e+="\n])",["new Free().set(".concat(t,")").concat(e)]}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}],n&&Ht(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function $t(t){return $t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$t(t)}function Vt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Yt(r.key),r)}}function Yt(t){var e=function(t){if("object"!=$t(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=$t(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==$t(e)?e:e+""}function Qt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Qt=function(){return!!t})()}function Kt(t){return Kt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Kt(t)}function Zt(t,e){return Zt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Zt(t,e)}var te=function(){function t(e){var n,r,i,o;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(r=this,i=t,i=Kt(i),n=function(t,e){if(e&&("object"==$t(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(r,Qt()?Reflect.construct(i,o||[],Kt(r).constructor):i.apply(r,o))).url=e,n.res=null,n.setup(),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Zt(t,e)}(t,W),e=t,(n=[{key:"setup",value:function(){this.res=document.createElement("audio"),this.res.setAttribute("src",this.url),this.res.setAttribute("controls","controls")}},{key:"size",value:function(t){return this.res.style.width=t,this}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}])&&Vt(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function ee(t){return ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ee(t)}function ne(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,re(r.key),r)}}function re(t){var e=function(t){if("object"!=ee(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ee(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ee(e)?e:e+""}function ie(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ie=function(){return!!t})()}function oe(){return oe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=ae(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},oe.apply(null,arguments)}function ae(t){return ae=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ae(t)}function se(t,e){return se=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},se(t,e)}var le=function(){function t(){var e,n,r,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(n=this,r=t,r=ae(r),e=function(t,e){if(e&&("object"==ee(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(n,ie()?Reflect.construct(r,i||[],ae(n).constructor):r.apply(n,i))).res=document.createElement("code"),e.pre=document.createElement("pre"),e.res.style.background="#18232e",e.res.style.display="block",e.res.style.width="auto",e.res.style.height="auto",e.res.style.borderRadius="1rem",e.pre.appendChild(e.res),e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&se(t,e)}(t,W),e=t,n=[{key:"getType",value:function(){return"LayoutWrapperElement"}},{key:"toCode",value:function(){var t=this.options;Object.keys(t).forEach(function(e){return void 0===t[e]&&delete t[e]});var e=JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:").replace(/"([^"]+)"/g,function(t,e){return e.includes("\n")||e.includes("'")||e.includes('"')?"`"+e.replace(/`/g,"\\`")+"`":'"'.concat(e,'"')});return"new Code().set(".concat(e,")")}},{key:"callReact",value:function(e){this.options=e;var n,r,i=[],o=e.transform&&"object"===ee(e.transform);if(e.stroke||e.gradient||e.span||e.backgroundOp||e.layout||e.shadow||e.animation||e.filtera||o){e.gradient&&(this.globalGradient=e.gradient.op.gradient,"radial"===e.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)")),e.stroke&&(n=this,"function"==typeof(r=oe(ae(t.prototype),"setAny",n))?function(t){return r.apply(n,t)}:r)([{globalBlast:"".concat(e.stroke.op.width," ").concat(e.stroke.op.color)}]),e.span&&(e.span.prevText=this.text);var a=[e.stroke,e.gradient,e.animation,e.span,e.backgroundOp,e.layout,e.marginOp,e.shadow,e.animation,e.filtera,o?e.transform:void 0];a=a.filter(function(t){return null!=t});for(var s=0;s<a.length;s++)i.push({range:a[s].range,log:a[s].op.name,target:a[s].target,op:a[s].op});var l=[];e.borderObj&&l.push("border"),e.background&&l.push("background"),e.mar&&l.push("margin"),e.animation&&l.push("animation"),e.span&&l.push("span"),this.chainReact(i,e.id,l)}}},{key:"set",value:function(t){return t.code&&(this.pre.children[0].innerHTML=t.code),t.class&&this.pre.children[0].setAttribute("class","".concat(t.class)),t.pad&&this.pad(t.pad),t.mar&&this.mar(t.mar),t.respad&&this.respad(t.respad),t.resmar&&this.resmar(t.resmar),t.resprop&&this.resprop(t.resprop),t.width&&(this.res.style.width=t.width),t.background&&(this.res.style.background=t.background),t.color&&(this.res.style.color=t.color),t.borderRadius&&(this.res.style.background=t.borderRadius),t.borderObj&&(this.res.style.border="".concat(t.borderObj.width," solid ").concat(t.borderObj.color),this.res.style.borderRadius="".concat(t.borderObj.radius)),this.callReact(t),this}},{key:"render",value:function(t){return t&&document.querySelector(t).appendChild(this.pre),this.res}}],n&&ne(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function ce(t){return ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ce(t)}function ue(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,de(r.key),r)}}function de(t){var e=function(t){if("object"!=ce(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ce(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ce(e)?e:e+""}var fe=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.res=null,this.st=e},(e=[{key:"setup",value:function(){var t=document.createElement("div");return t.style.display="grid",this.res=t,this.st&&this.sticky(),this}},{key:"set",value:function(t){return this.setup(),t.height&&(this.res.style.height=t.height),t.sticky&&this.sticky(),this}},{key:"sticky",value:function(){return this.res.style.position="sticky",this.res.style.top=0,this}},{key:"add",value:function(t){this.children=t;for(var e=0;e<t.length;e++){var n=t[e].render();n.style.gridColumn=1,n.style.gridRow=1,this.res.appendChild(n)}return this}},{key:"toCode",value:function(){var t="new Stack().set({})";if(this.children.length>0){var e=this.children.map(function(t){return t.toCode()}).join(",\n");t+=".add([\n \n ".concat(e," \n \n])")}return[t]}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector("body").style.margin=0,document.querySelector("body").style.padding=0,document.querySelector(t).appendChild(this.res)}}])&&ue(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function he(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=ye(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function pe(t){return pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pe(t)}function ye(t,e){if(t){if("string"==typeof t)return me(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?me(t,e):void 0}}function me(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function ve(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ge(r.key),r)}}function ge(t){var e=function(t){if("object"!=pe(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=pe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==pe(e)?e:e+""}function be(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(be=function(){return!!t})()}function we(){return we="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=xe(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},we.apply(null,arguments)}function xe(t){return xe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},xe(t)}function ke(t,e){return ke=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ke(t,e)}var Se=function(){function t(e){var n,r,i,o;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(r=this,i=t,i=xe(i),n=function(t,e){if(e&&("object"==pe(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(r,be()?Reflect.construct(i,o||[],xe(r).constructor):i.apply(r,o))).res=null,n.setup(e),n.code=[],n.isLast=!1,n.constrObj=e,n.code.push("\n new Wrapper() \n"),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ke(t,e)}(t,W),e=t,n=[{key:"isLasta",value:function(){return this.isLast=!0,this}},{key:"toCode",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.code=[],this.excludeFromCodeTrue)return[""];var n=" ".repeat(e),r="".concat(n,'new Wrapper("').concat(this.constrObj,'")');if(this.constrObj||(r="".concat(n,"new Wrapper()")),Object.keys(this.obj).length){var i=Object.fromEntries(Object.entries(this.obj).filter(function(t){var e,n,r=(n=2,function(t){if(Array.isArray(t))return t}(e=t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,n)||ye(e,n)||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.")}());return r[0],null!==r[1]})),o=JSON.stringify(i,null,2).replace(/"([^"]+)":/g,"$1:");r+="\n".concat(n," .set(").concat(o,")")}return null!==(t=this.items)&&void 0!==t&&t.length&&(r+="\n".concat(n," .add([\n")+this.items.map(function(t){return t.toCode(e+4)}).join(",\n")+"\n".concat(n," ])")),[r+="\n".concat(n)]}},{key:"getType",value:function(){return"LayoutWrapperElement"}},{key:"setArea",value:function(t){return this.res.style.gridArea=t,this}},{key:"removeQuotesFromFirstWord",value:function(t){return t.replace(/"([^"]+)":/g,"$1:")}},{key:"clicked",value:function(t){return this.res.addEventListener("click",t),this}},{key:"onTap",value:function(t){return this.res.addEventListener("click",t),this}},{key:"gpos",value:function(t){return this.res.style.gridColumn=t.col,this.res.style.gridRow=t.row,this}},{key:"set",value:function(e){this.obj=e,this.commonMethods(e),e.onTap&&this.onTap(e.onTap);var n=".set({";e.isHidden&&this.isHidden(e.isHidden),e.scale&&(this.res.style.scale=e.scale),e.scale&&(n+="scale: ".concat(e.scale)),e.keySet&&this.keySet(e.keySet),e.resprop&&this.resprop(e.resprop),e.position&&(this.res.style.position=e.position),void 0!==e.top&&(this.res.style.top=e.top),e.pad&&this.pad(e.pad),e.mar&&this.mar(e.mar),e.arrpad&&(n+="pad: {sides: [".concat(e.arrpad.sides.map(function(t){return'"'.concat(t,'"')}).join(", "),'], value: "').concat(e.arrpad.value,'"}, ')),e.gpos&&this.gpos(e.gpos);var r,i,o=[],a=e.transform&&"object"===pe(e.transform);if(e.stroke||e.gradient||e.span||e.backgroundOp||e.layout||e.shadow||e.animation||e.filtera||a){e.gradient&&(this.globalGradient=e.gradient.op.gradient,"radial"===e.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)")),e.stroke&&(r=this,"function"==typeof(i=we(xe(t.prototype),"setAny",r))?function(t){return i.apply(r,t)}:i)([{globalBlast:"".concat(e.stroke.op.width," ").concat(e.stroke.op.color)}]),e.span&&(e.span.prevText=this.text);var s=[e.stroke,e.gradient,e.animation,e.span,e.backgroundOp,e.layout,e.marginOp,e.shadow,e.animation,e.filtera,a?e.transform:void 0];s=s.filter(function(t){return null!=t});for(var l=0;l<s.length;l++)o.push({range:s[l].range,log:s[l].op.name,target:s[l].target,op:s[l].op});var c=[];e.borderObj&&c.push("border"),e.background&&c.push("background"),e.mar&&c.push("margin"),e.animation&&c.push("animation"),e.span&&c.push("span"),a&&c.push("transform"),e.gradient&&c.push("gradient"),e.blast,this.options=e,this.chainReact(o,this.options.id,c)}if(e.centerColumn&&(this.res.style.display="flex",this.res.style.flexDirection="column",this.res.style.alignItems="center",e.centerColumn&&(n+="centerColumn: ".concat(e.centerColumn,","))),e.mboth&&(this.res.style.marginRight="auto")&&(this.res.style.marginLeft="auto"),e.mar&&this.mar(e.mar),e.sticky&&this.sticky(),e.transition&&(this.res.style.transition=e.transition),e.class&&this.res.setAttribute("class",e.class),e.ga&&(this.res.style.gridArea=e.ga),e.opacity&&(0==e.opacity&&(this.res.style.opacity=0),e.opacity&&(this.res.style.opacity=e.opacity)),e.maxHeight&&(this.res.style.maxHeight=e.maxHeight),e.id&&this.res.setAttribute("id",e.id),e.arrpad&&this.arrayPadding(e.arrpad.sides,e.arrpad.value),e.arrpad&&(n+="arrpad: {sides: [".concat(e.arrpad.sides.map(function(t){return'"'.concat(t,'"')}).join(", "),'], value: "').concat(e.arrpad.value,'"}, ')),e.arrayMargin&&this.arrayMargin(e.arrayMargin.sides,e.arrayMargin.value),e.arrayMargin&&(n+='\n arrayMargin: {sides: ["'.concat(e.arrayMargin.sides,'"], value: "').concat(e.arrayMargin.value,'"},')),e.center&&this.toCenter(e.center),e.center&&(n+='center: "'.concat(e.center,'",')),e.simpleCenter&&this.simpleCenter(),e.simpleCenter&&(n+='center: "'.concat(e.simpleCenter,'",')),e.filter&&(this.res.style.backdropFilter="blur(3px)"),e.radius&&this.corner(e.radius),e.radius&&(n+='\n radius: "'.concat(e.radius,'",')),e.border&&this.border(e.border),e.simpleBorder&&(this.res.style.border=e.simpleBorder),e.width&&this.width(e.width),e.width&&(n+='\n width: "'.concat(e.width,'",')),e.overflow&&(n+='\n overflow: "'.concat(e.overflow,'",')),e.height&&this.heightNoAuto(e.height),e.height&&(n+='\n height: "'.concat(e.height,'",')),e.align&&this.flexAlign(e.align),e.align&&(n+='\n align: "'.concat(e.align,'",')),e.borderObj&&(this.res.style.border="".concat(e.borderObj.width," solid ").concat(e.borderObj.color),void 0!==e.borderObj.radius&&(this.res.style.borderRadius=e.borderObj.radius)),e.borderObja&&(this.res.style.border="".concat(e.borderObja.width," solid ").concat(e.borderObja.color),void 0!==e.borderObja.radius&&(this.res.style.borderRadius=e.borderObja.radius)),e.font&&this.font(e.font),e.font&&(n+='font: "'.concat(e.font,'",')),e.maxWidth&&this.maxWidth(e.maxWidth),e.flexCenter&&this.flexc(e.flexCenter),e.multipad&&this.makeMultiPad(e.multipad),e.multimargin&&this.makeMultiMargin(e.multimargin),e.color&&this.color(e.color),e.background&&this.background(e.background),e.background&&(n+='background: "'.concat(e.background,'",')),e.weight&&this.weight(e.weight),e.paddings&&this.paddingo(e.paddings),e.area&&this.setArea(e.area),e.area&&(n+='area: "'.concat(e.area,'"')),e.column&&this.makeCol(),e.column&&(n+='\n column: "'.concat(e.column,'",')),e.alignIts&&(this.res.style.background="gray"),e.alignIts&&(this.res.style.alignItems="flex-start"),e.alignIts&&(this.res.style.justifyItems="flex-start"),e.customAlign&&(this.res.style.alignItems=e.customAlign),e.customJustify&&(this.res.style.justifyItems=e.customJustify),e.disp&&(this.res.style.display=e.disp),e.flexDir&&(this.res.style.flexDirection=e.flexDir),e.flexDir&&(this.res.style.display="flex"),e.flexDir&&(n+='\n flexDir: "'.concat(e.flexDir,'",')),e.zIndex&&(this.res.style.zIndex=e.zIndex),e.transform&&"object"===pe(e.transform)&&this.reactOnTransform(e.transform),e.name&&(this.name=e.name),e.responsive&&this.rsp(e.responsive),e.stretch){e.stretch&&this.stretch(e.stretch);var u=this.removeQuotesFromFirstWord(JSON.stringify(e.stretch));n+="\n stretch: ".concat(u,",")}for(var d in e)if("margin"===d){var f=e[d];if(Array.isArray(f)&&f.length>0){var h,p=he(f);try{for(p.s();!(h=p.n()).done;){var y=h.value;y.hasOwnProperty("top")&&(this.res.style.marginTop=y.top),y.hasOwnProperty("right")&&(this.res.style.marginRight=y.right),y.hasOwnProperty("bottom")&&(this.res.style.marginBottom=y.bottom),y.hasOwnProperty("left")&&(this.res.style.marginLeft=y.left)}}catch(t){p.e(t)}finally{p.f()}}}return 8===(n+="})\n").length&&(n=""),this.code.push(n),this}},{key:"rsp",value:function(t){var e=this;this.res.style.display="flex";var n=t.sequence.split("-"),r=function(){var r=t.ranges;"0px"!==r[0]&&r.unshift("0px");for(var i=0;i<r.length-1;i++)(window.matchMedia("(min-width: ".concat(r[i],") and (max-width: ").concat(r[i+1],")")).matches||window.matchMedia("(min-width: ".concat(r[r.length-1],")")).matches)&&("row"===n[i]&&(e.res.style.flexDirection="row",e.res.style.border="3px solid green"),"col"===n[i]&&(e.res.style.flexDirection="column",e.res.style.border="3px solid purple"));return e};window.addEventListener("resize",r),r()}},{key:"sticky",value:function(){return this.res.style.position="sticky",this.res.style.top=0,this}},{key:"toSticky",value:function(){return this.res.style.position="sticky",this.res.style.top="0",this}},{key:"stretch",value:function(t){var e=this,n=function(){window.matchMedia("(max-width: ".concat(t.at,")")).matches?e.res.style.width="auto":window.matchMedia("(max-device-width: 415px)").matches?e.res.style.width="100%":e.res.style.width=t.backTo};n(),window.addEventListener("resize",n)}},{key:"makeCol",value:function(){return this.res.style.display="flex",this.res.style.flexDirection="column",this.res.style.alignItems="flex-start",this}},{key:"paddingo",value:function(t){return this.res.style.padding=t,this}},{key:"toCenter",value:function(t){return this.res.style.display="flex",this.res.style.flexDirection="column",this.res.style.justifyContent="center","both"===t&&(this.res.style.alignItems="center"),this}},{key:"simpleCenter",value:function(){return this.res.style.justifyContent="center",this.res.style.justifyItems="center",this.res.style.alignContent="center",this.res.style.alignItems="center",this}},{key:"color",value:function(t){return this.res.style.color=t,this}},{key:"weight",value:function(t){return this.res.style.fontWeight=t,this}},{key:"makeMultiPad",value:function(t){for(var e=0;e<t.length;e++)"left"===t[e].side&&(this.res.style.paddingLeft=t[e].value),"right"===t[e].side&&(this.res.style.paddingRight=t[e].value);return this}},{key:"makeMultiMargin",value:function(t){this.res.style.zIndex="1";for(var e=0;e<t.length;e++)"left"===t[e].side&&(this.res.style.marginLeft=t[e].value),"right"===t[e].side&&(this.res.style.marginRight=t[e].value),"top"===t[e].side&&(this.res.style.marginTop=t[e].value),"bottom"===t[e].side&&(this.res.style.marginBottom=t[e].value);return this}},{key:"flexc",value:function(t){return this.res.style.display="flex",this.res.style.flexDirection="column",this.res.style.justifyContent="center",this}},{key:"maxWidth",value:function(t){return this.res.style.maxWidth=t,this}},{key:"font",value:function(t){return this.res.style.fontFamily=t,this}},{key:"flexAlign",value:function(t){return this.res.style.display="flex",this.res.style.justifyContent="flex-start",this.res.style.alignItems="flex-start","center"===t?(this.res.style.display="flex",this.res.style.flexDirection="column",this.res.style.alignItems="center",this):this}},{key:"width",value:function(t){return this.res.style.width=t,this}},{key:"heightNoAuto",value:function(t){return this.res.style.height=t,this}},{key:"border",value:function(t){return this.res.style.borderRadius="".concat(t.radius,"px"),this.res.style.padding="0.25em",this.res.style.border="".concat(t.width,"px solid ").concat(t.color),this}},{key:"toCol",value:function(){return this.res.style.display="flex",this.res.style.flexDirection="column",this.res.style.justifyContent="center",this.res.style.alignItems="center",this}},{key:"add",value:function(t){this.items=t,this.code.push(".add([ \n");var e=t.map(function(e,n){return e.toCode().flatMap(function(t){return t}).join("")+(n<t.length-1?",":"")}).join("");this.code.push(e);for(var n=0;n<t.length;n++)if(void 0!==t[n]&&void 0!==t[n].toCode){var r=t[n].render();this.res.appendChild(r)}return this.code.push("])"),this}},{key:"arrayPadding",value:function(t,e){return t.includes("left")&&(this.res.style.paddingLeft=e),t.includes("right")&&(this.res.style.paddingRight=e),t.includes("top")&&(this.res.style.paddingTop=e),t.includes("bottom")&&(this.res.style.paddingBottom=e),this}},{key:"arrayMargin",value:function(t,e){return e||(this.res.style.marginLeft="".concat(t[0],"px"),this.res.style.marginTop="".concat(t[1],"px"),this.res.style.marginRight="".concat(t[2],"px"),this.res.style.marginBottom="".concat(t[3],"px")),t.includes("left")&&(this.res.style.marginLeft=e),t.includes("right")&&(this.res.style.marginRight=e),t.includes("top")&&(this.res.style.marginTop=e),t.includes("bottom")&&(this.res.style.marginBottom=e),this}},{key:"setWidth",value:function(t){this.res.style.width="100vw"}},{key:"setHeight",value:function(t){return this.res.style.height="".concat(t),this}},{key:"setup",value:function(t){var e=null;return t?(t.isLink&&(e=document.createElement("a")),"aside"===t&&(e=document.createElement("aside")),"article"===t&&(e=document.createElement("article")),"main"===t&&(e=document.createElement("main")),"section"===t&&(e=document.createElement("section")),"header"===t&&(e=document.createElement("header")),"footer"===t&&(e=document.createElement("footer"))):e=document.createElement("div"),t&&t.isLink&&(e.style.textDecoration="none",e.setAttribute("href",t.child)),this.res=e,this.res.style.margin=0,this.res.style.padding=0,t&&!0===t.hideOverflow&&(this.res.style.overflow="hidden",this.res.style.overflowY="scroll"),t&&!0===t.center&&(this.res.style.display="flex",this.res.style.flexDirection="column",this.res.style.justifyContent="center",this.res.style.alignItems="center"),t&&"left"===t.align&&(this.res.style.alignItems="flex-start"),t&&"right"===t.align&&(this.res.style.alignItems="flex-end"),t&&t.height&&(this.res.style.height=t.height),t&&t.width&&(this.res.style.width=t.width,this.res.style.marginLeft="auto",this.res.style.marginRight="auto",window.matchMedia("(max-device-width: 415px)").matches&&(this.res.style.width="95%")),this}},{key:"height",value:function(t){return this.res.style.width="auto",this.res.style.height="".concat(t),this}},{key:"size",value:function(t,e){return this.w=t,this.h=e,this.w?this.res.style.width=this.w:this.res.style.width=window.innerWidth,this.h?this.res.style.height=this.h:this.res.style.height=window.innerHeight,this}},{key:"background",value:function(t){return this.res.style.background=t,this}},{key:"corner",value:function(t){return this.res.style.borderRadius=t,this}},{key:"padding",value:function(t,e,n,r){return this.res.style.paddingLeft=t,this.res.style.paddingTop=e,this.res.style.paddingRight=n,this.res.style.paddingBottom=r,this}},{key:"margin",value:function(t,e,n,r){return this.res.style.marginLeft=t,this.res.style.marginTop=e,this.res.style.marginRight=n,this.res.style.marginBottom=r,this}},{key:"itemWidth",value:function(t){for(var e=0;e<this.res.childNodes.length;e++)this.res.childNodes[e].style.width=t;return this}},{key:"apply",value:function(t){var e=this,n=function(){for(var n=0;n<t.length;n++){var r=t[n],i=window.matchMedia("(max-width: ".concat(r.width,"px)"));r.device&&(i=window.matchMedia("(max-device-width: ".concat(r.width,"px)"))),i.matches&&Object.assign(e.res.style,r.styles)}},r=window.matchMedia("(max-width: ".concat(t[0].width,"px)"));return t[0].device&&(r=window.matchMedia("(max-device-width: ".concat(t[0].width,"px)"))),r.matches||Object.assign(this.res.style,t[0].styles),n(),window.addEventListener("resize",n),this}},{key:"mount",value:function(t){document.querySelector(t).appendChild(this.res)}},{key:"render",value:function(t){return t?(document.querySelector("#mount"),document.querySelector(t).appendChild(this.res),this):this.res}}],n&&ve(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function Oe(t){return Oe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oe(t)}function je(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Ce(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ce(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Ce(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Ee(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Te(r.key),r)}}function Te(t){var e=function(t){if("object"!=Oe(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Oe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Oe(e)?e:e+""}function _e(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_e=function(){return!!t})()}function Pe(){return Pe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Ae(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},Pe.apply(null,arguments)}function Ae(t){return Ae=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ae(t)}function Re(t,e){return Re=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Re(t,e)}var Me=function(){function t(){var e,n,r,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(n=this,r=t,r=Ae(r),e=function(t,e){if(e&&("object"==Oe(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(n,_e()?Reflect.construct(r,i||[],Ae(n).constructor):r.apply(n,i))).res=document.createElement("table"),e.res.style.borderCollapse="separate",e.res.style.borderSpacing="0",e.res.style.overflow="hidden",e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Re(t,e)}(t,W),e=t,n=[{key:"add",value:function(t){this.data=t,this.datas=t;var e=Object.keys(t[0]);return this.generateTable(this.res,t),this.generateTableHead(this.res,e),this}},{key:"style",value:function(t){return t.font&&(this.res.style.fontFamily=t.font),this}},{key:"getType",value:function(){return"LayoutWrapperElement"}},{key:"set",value:function(t){return t.cellPadding&&this.cellPadding(t.cellPadding),t.cellAlign&&this.cellAlign(t.cellAlign),t.style&&this.style(t.style),t.headStyle&&this.headStyle(t.headStyle),t.border&&this.border(t.border),t.center&&this.center(t.center),t.borderRadius&&this.borderRadius(t.borderRadius),t.gradient&&(this.res.style.background=t.gradient.op.gradient,this.res.style.backgroundClip="padding-box"),this.obj=t,this.options=t,this.callReact(t),this}},{key:"callReact",value:function(e){var n,r,i=[];if(e.stroke||e.gradient||e.span||e.backgroundOp||e.layout||e.shadow||e.animation||e.filtera||e.transform){e.gradient&&(this.globalGradient=e.gradient.op.gradient,"radial"===e.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)")),e.stroke&&(n=this,"function"==typeof(r=Pe(Ae(t.prototype),"setAny",n))?function(t){return r.apply(n,t)}:r)([{globalBlast:"".concat(e.stroke.op.width," ").concat(e.stroke.op.color)}]),e.span&&(e.span.prevText=this.text);var o=[e.stroke,e.gradient,e.animation,e.span,e.backgroundOp,e.layout,e.marginOp,e.shadow,e.animation,e.filtera,e.transform];o=o.filter(function(t){return null!=t});for(var a=0;a<o.length;a++)i.push({range:o[a].range,log:o[a].op.name,target:o[a].target,op:o[a].op});var s=[];e.borderObj&&s.push("border"),e.background&&s.push("background"),e.mar&&s.push("margin"),e.animation&&s.push("animation"),e.span&&s.push("span"),s.push("border"),this.chainReact(i,this.options.id,s)}}},{key:"toCode",value:function(){var t=JSON.stringify(this.data,null,2),e=JSON.stringify(this.obj,null,2);return t=t.replace(/"(\w+)"\s*:/g,"$1:"),e=e.replace(/"(\w+)"\s*:/g,"$1:"),["new Table()\n .add(".concat(t,")\n .set(").concat(e,")")]}},{key:"borderRadius",value:function(t){return this.res.style.borderRadius="".concat(4*t,"px"),this.res.style.overflow="hidden",this}},{key:"center",value:function(){return this.res.style.marginLeft="auto",this.res.style.marginRight="auto",this}},{key:"cellPadding",value:function(t){var e,n=je(this.res.rows);try{for(n.s();!(e=n.n()).done;){var r,i=je(e.value.cells);try{for(i.s();!(r=i.n()).done;)r.value.style.padding=t}catch(t){i.e(t)}finally{i.f()}}}catch(t){n.e(t)}finally{n.f()}return this}},{key:"cellAlign",value:function(t){var e,n=je(this.res.rows);try{for(n.s();!(e=n.n()).done;){var r,i=je(e.value.cells);try{for(i.s();!(r=i.n()).done;)r.value.style.textAlign=t}catch(t){i.e(t)}finally{i.f()}}}catch(t){n.e(t)}finally{n.f()}return this}},{key:"headStyle",value:function(t){var e=this.res.rows[0];return e&&(e.style.color=t.color,t.background&&(e.style.backgroundColor=t.background)),this}},{key:"border",value:function(t){var e;this.res.style.borderCollapse="separate",this.res.style.borderSpacing="0",this.res.style.border=t,this.res.style.borderRadius="12px";var n,r=je(this.res.rows);try{for(r.s();!(n=r.n()).done;){var i,o=je(n.value.cells);try{for(o.s();!(i=o.n()).done;)i.value.style.border="none"}catch(t){o.e(t)}finally{o.f()}}}catch(t){r.e(t)}finally{r.f()}for(var a=0;a<this.res.rows.length-1;a++){var s,l=je(this.res.rows[a].cells);try{for(l.s();!(s=l.n()).done;)s.value.style.borderBottom=t}catch(t){l.e(t)}finally{l.f()}}var c,u=(null===(e=this.res.rows[0])||void 0===e?void 0:e.cells.length)||0,d=je(this.res.rows);try{for(d.s();!(c=d.n()).done;)for(var f=c.value,h=0;h<u-1;h++)f.cells[h].style.borderRight=t}catch(t){d.e(t)}finally{d.f()}return this}},{key:"generateTableHead",value:function(t,e){var n,r=t.createTHead().insertRow(),i=je(e);try{for(i.s();!(n=i.n()).done;){var o=n.value,a=document.createElement("th");a.textContent=o,r.appendChild(a)}}catch(t){i.e(t)}finally{i.f()}}},{key:"generateTable",value:function(t,e){var n,r=je(e);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=t.insertRow();for(var a in i)o.insertCell().textContent=i[a]}}catch(t){r.e(t)}finally{r.f()}}},{key:"render",value:function(t){var e=document.createElement("div");if(e.style.overflowX="auto",e.appendChild(this.res),!t)return e;document.querySelector(t).appendChild(e)}}],n&&Ee(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function Le(t){return Le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Le(t)}function ze(t,e){if(t){if("string"==typeof t)return Ie(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ie(t,e):void 0}}function Ie(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Fe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,We(r.key),r)}}function We(t){var e=function(t){if("object"!=Le(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Le(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Le(e)?e:e+""}function De(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(De=function(){return!!t})()}function Be(t){return Be=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Be(t)}function Ne(t,e){return Ne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ne(t,e)}var He=function(){function t(){var e,n,r,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(n=this,r=t,r=Be(r),e=function(t,e){if(e&&("object"==Le(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(n,De()?Reflect.construct(r,i||[],Be(n).constructor):r.apply(n,i))).res=document.createElement("div"),e.res.style.position="relative",e.toggleWrap=document.createElement("div"),e.toggleWrap.style.zIndex=9999,e.toggleWrap.style.borderRadius="0.3rem",e.toggleWrap.style.cursor="pointer",e.toggleWrap.style.display="flex",e.toggleWrap.style.alignItems="center",e.toggleWrap.style.justifyContent="center",e.res.appendChild(e.toggleWrap),e.contentWrap=document.createElement("div"),e.contentWrap.style.position="fixed",e.contentWrap.style.background="#ecf0f1",e.contentWrap.style.borderRadius="0.3rem",e.contentWrap.style.boxShadow="0 2px 5px rgba(0, 0, 0, 0.15)",e.contentWrap.style.width="250px",e.contentWrap.style.display="none",e.contentWrap.style.zIndex=99999,document.addEventListener("DOMContentLoaded",function(){document.body.appendChild(e.contentWrap)}),document.body&&document.body.appendChild(e.contentWrap),e.styles={},e.children=[],e.isExpanded=!1,e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ne(t,e)}(t,W),e=t,n=[{key:"set",value:function(t){var e=this;this.options=t,t.title&&(this.toggleWrap.textContent=t.title),t.width&&(this.toggleWrap.style.width=t.width),t.contentWidth&&(this.contentWrap.style.width=t.contentWidth),t.background&&(this.contentWrap.style.backgroundColor=t.background),t.radius&&(this.contentWrap.style.borderRadius=t.radius);var n=function(){var t=e.toggleWrap.getBoundingClientRect(),n=e.contentWrap.style.display,r=e.contentWrap.style.visibility;"none"===n&&(e.contentWrap.style.visibility="hidden",e.contentWrap.style.display="block");var i=e.contentWrap.getBoundingClientRect();"none"===n&&(e.contentWrap.style.display=n,e.contentWrap.style.visibility=r||"");var o=window.innerWidth,a=t.left+t.width/2-i.width/2;a<8&&(a=8),a+i.width>o-8&&(a=o-8-i.width),a<8&&(a=8),e.contentWrap.style.top=t.bottom+4+"px",e.contentWrap.style.left=a+"px"};this._positionContent=n;var r=function(){"none"!==e.contentWrap.style.display&&n()};if(window.addEventListener("resize",r),window.addEventListener("scroll",r,!0),t.behaviour){var i=t.behaviour;if("mouseover"===i||"mouseenter"===i){var o,a=function(){clearTimeout(o),e.contentWrap.style.display="block",n()},s=function(){o=setTimeout(function(){e.contentWrap.style.display="none"},200)};this.toggleWrap.addEventListener("mouseenter",a),this.toggleWrap.addEventListener("mouseleave",s),this.contentWrap.addEventListener("mouseenter",a),this.contentWrap.addEventListener("mouseleave",s),this.toggleWrap.addEventListener("click",function(t){t.stopPropagation(),"block"===e.contentWrap.style.display?e.contentWrap.style.display="none":(e.contentWrap.style.display="block",n())}),document.addEventListener("click",function(t){"block"!==e.contentWrap.style.display||e.contentWrap.contains(t.target)||e.toggleWrap.contains(t.target)||(e.contentWrap.style.display="none")})}else"click"===i?this.res.addEventListener("click",function(){e.toggle(),"block"===e.contentWrap.style.display&&n()}):this.res.addEventListener(i,function(){e.contentWrap.style.display="block",n()})}else this.res.addEventListener("click",function(){e.toggle(),"block"===e.contentWrap.style.display&&n()});return t.mar&&this.mar(t.mar),t.pad&&this.pad(t.pad),t.respad&&this.respad(t.respad),t.resmar&&this.resmar(t.resmar),this}},{key:"add",value:function(t){var e,n,r=this;if(!Array.isArray(t))throw new Error("The 'add' method expects an array of children.");if(t.forEach(function(t,e){if(0!==e){if(!(t.res instanceof HTMLElement))throw new Error("Each child must have a valid 'element' property that is an HTMLElement.");r.contentWrap.appendChild(t.res)}}),!this.options||!this.options.title){var i=t[0];i&&i.res&&this.toggleWrap.appendChild(i.res)}return(e=this.children).push.apply(e,function(t){if(Array.isArray(t))return Ie(t)}(n=t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(n)||ze(n)||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.")}()),this}},{key:"toggle",value:function(){this.isExpanded=!this.isExpanded,this.contentWrap.style.display=this.isExpanded?"block":"none"}},{key:"toCode",value:function(){var t=this,e=this.options?Object.entries(this.options).map(function(t){var e,n,r=(n=2,function(t){if(Array.isArray(t))return t}(e=t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,n)||ze(e,n)||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.")}()),i=r[0],o=r[1];return"string"==typeof o?"".concat(i,': "').concat(o,'"'):"object"===Le(o)?"".concat(i,": ").concat(JSON.stringify(o)):"".concat(i,": ").concat(o)}).join(",\n "):"",n=this.children.map(function(e,n){return e.toCode().flatMap(function(t){return t}).join("")+(n<t.children.length-1?",":"")}).join("");return["new Dropdown().set({\n ".concat(e,"\n}).add([\n ").concat(n,"\n])")]}},{key:"render",value:function(t){return t&&document.querySelector(t).appendChild(this.res),this.res}}],n&&Fe(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function Ge(t){return Ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ge(t)}function Ue(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,qe(r.key),r)}}function qe(t){var e=function(t){if("object"!=Ge(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ge(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ge(e)?e:e+""}function Je(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Je=function(){return!!t})()}function Xe(t){return Xe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Xe(t)}function $e(t,e){return $e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},$e(t,e)}var Ve=function(){function t(e){var n,r,i,o;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(r=this,i=t,i=Xe(i),n=function(t,e){if(e&&("object"==Ge(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(r,Je()?Reflect.construct(i,o||[],Xe(r).constructor):i.apply(r,o))).text=e,n.res=null,n.valid=!1,n.setup(),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&$e(t,e)}(t,W),e=t,n=[{key:"setup",value:function(){var t=document.createElement("input");return this.res=t,this.res.style.padding=0,this.res.style.margin=0,this.res.style.padding=".4rem .75rem",this.res.style.fontSize="1rem",window.matchMedia("(max-device-width: 415px)").matches&&(this.res.style.width="100%"),this}},{key:"set",value:function(t){var e;return this.options=t,this.res.setAttribute("type",null!==(e=t.type)&&void 0!==e?e:"text"),t.placeholder&&(this.res.placeholder=t.placeholder),t.arrayPadding&&this.arrayPadding(t.arrayPadding.sides,t.arrayPadding.value),t.arrayMargin&&this.arrayMargin(t.arrayMargin.sides,t.arrayMargin.value),t.pad&&this.pad(t.pad),t.mar&&this.mar(t.mar),t.maxWidth&&(this.res.style.maxWidth=t.maxWidth),t.exact&&(this.res.style.fontSize=t.exact),t.radius&&this.round(t.radius),t.color&&(this.res.style.color=t.color),t.background&&(this.res.style.background=t.background),t.font&&(this.res.style.fontFamily=t.font),t.weight&&(this.res.style.fontWeight=t.weight),t.bold&&(this.res.style.fontWeight="bold"),t.theme&&this.theme(t.theme),this.commonMethods(t),this}},{key:"arrayPadding",value:function(t,e){return t.includes("left")&&(this.res.style.paddingLeft=e),t.includes("right")&&(this.res.style.paddingRight=e),t.includes("top")&&(this.res.style.paddingTop=e),t.includes("bottom")&&(this.res.style.paddingBottom=e),t.includes("all")&&(this.res.style.padding=e),this}},{key:"toCode",value:function(){var t=JSON.stringify(this.options,null,4);return["new TextField().set(".concat(t,")")]}},{key:"arrayMargin",value:function(t,e){return t.includes("left")&&(this.res.style.marginLeft=e),t.includes("right")&&(this.res.style.marginRight=e),t.includes("top")&&(this.res.style.marginTop=e),t.includes("bottom")&&(this.res.style.marginBottom=e),t.includes("all")&&(this.res.style.margin=e),this}},{key:"setValid",value:function(t,e){return this.res.style.border=t?"6px solid green":"6px solid red",0===e.length&&(this.res.style.border="none"),this}},{key:"auto",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.res.style.fontSize="3rem":t.res.style.fontSize="1rem"};return e(),window.addEventListener("resize",e),this}},{key:"listen",value:function(t){var e=this;return this.res.addEventListener("input",function(t){return e.process(t)}),this}},{key:"value",value:function(t){return this.res.setAttribute("value",t),this}},{key:"password",value:function(){return this.res.setAttribute("type","password"),this}},{key:"number",value:function(){return this.res.setAttribute("type","number"),this}},{key:"week",value:function(){return this.res.setAttribute("type","week"),this}},{key:"process",value:function(t){return this.res.value}},{key:"font",value:function(t){return this.res.style.fontFamily=t,this}},{key:"size",value:function(t){return this.res.style.fontSize=t,this}},{key:"em",value:function(t){return this.res.style.fontSize="".concat(t,"em"),this}},{key:"color",value:function(t){return this.res.style.color=t,this}},{key:"weight",value:function(t){return this.res.style.fontWeight=t,this}},{key:"bold",value:function(){return this.res.style.fontWeight="bold",this}},{key:"italic",value:function(){return this.res.style.fontStyle="italic",this}},{key:"padding",value:function(t,e,n,r){return t?this.res.style.padding="".concat(t,"px"):t&&e&&n&&r&&(this.res.style.paddingLeft=t,this.res.style.paddingTop=e,this.res.style.paddingRight=n,this.res.style.paddingBottom="".concat(r,"px")),this}},{key:"margin",value:function(t,e,n,r){return this.res.style.marginLeft=t,this.res.style.marginTop=e,this.res.style.marginLeft=n,this.res.style.marginBottom="".concat(r,"px"),this}},{key:"placeholder",value:function(t){return this.res.setAttribute("placeholder",t),this}},{key:"border",value:function(t,e){return this.res.style.border="".concat(e,"px solid ").concat(t),this}},{key:"width",value:function(t){return this.res.style.width=t,this}},{key:"round",value:function(t){return this.res.style.borderRadius="".concat(t,"px"),this}},{key:"onChange",value:function(t){var e=this;return this.res.value,this.res.addEventListener("input",function(n){t(e.res.value)}),this}},{key:"render",value:function(t){return t?(document.querySelector(t).appendChild(this.res),this.res):this.res}}],n&&Ue(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function Ye(t){return Ye="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ye(t)}function Qe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ke(r.key),r)}}function Ke(t){var e=function(t){if("object"!=Ye(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ye(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ye(e)?e:e+""}function Ze(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ze=function(){return!!t})()}function tn(t){return tn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},tn(t)}function en(t,e){return en=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},en(t,e)}var nn=function(){function t(){var e,n,r,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(n=this,r=t,r=tn(r),e=function(t,e){if(e&&("object"==Ye(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(n,Ze()?Reflect.construct(r,i||[],tn(n).constructor):r.apply(n,i))).navbar=document.createElement("nav"),e.navbar.classList.add("desktop-navbar"),e.navbarHeader=document.createElement("div"),e.navbarHeader.classList.add("navbar-header"),e.brand=document.createElement("div"),e.brand.classList.add("navbar-brand"),e.navContent=document.createElement("div"),e.navContent.classList.add("navbar-content"),e.navContent.style.width="100%",e.navContent.style.alignItems="center",e.navbarHeader.appendChild(e.brand),e.navbarHeader.appendChild(e.navContent),e.navbar.appendChild(e.navbarHeader),e.res=e.navbar,e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&en(t,e)}(t,W),e=t,(n=[{key:"set",value:function(t){return this.obj=t,this.setStyles(t),t.background&&(this.res.style.backgroundColor=t.background),t.brand&&this.setBrand(t.brand),t.radius&&(this.res.style.borderRadius=t.radius),t.pad&&this.pad(t.pad),t.respad&&this.respad(t.respad),t.resmar&&this.resmar(t.resmar),t.mar&&this.mar(t.mar),t.maxHeight&&(this.res.style.maxHeight=t.maxHeight),t.hamburgerColour&&(this.hamburgerColour=t.hamburgerColour),this}},{key:"setStyles",value:function(){var t;this.navbar.style.display="flex",this.navbar.style.flexDirection="column",this.navbar.style.padding="1rem",this.navbar.style.backgroundColor=null!==(t=this.obj.background)&&void 0!==t?t:"#333",this.navbarHeader.style.display="flex",this.navbarHeader.style.alignItems="center",this.navbarHeader.style.justifyContent="space-between",this.navbarHeader.style.width="100%",this.brand.style.fontSize="1.5rem",this.navContent.style.display="flex",this.navContent.style.gap="1rem"}},{key:"setBrand",value:function(t){return this.brand.innerHTML="",this.brand.appendChild(t),this}},{key:"add",value:function(t){this.items=t;for(var e=0;e<t.length;e++)t[e],this.navContent.appendChild(t[e].render());return this}},{key:"toCode",value:function(){var t=this.items.map(function(t){return t.toCode()}).flatMap(function(t){return t});return"new DesktopBar().set(".concat(this.removeQuotesFromFirstWord(JSON.stringify(this.obj)),").add([\n ").concat(t.join(","),"\n\n \n \n\n ])")}},{key:"render",value:function(t){return t&&document.querySelector(t).appendChild(this.navbar),this.navbar}}])&&Qe(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function rn(t){return rn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rn(t)}function on(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,an(r.key),r)}}function an(t){var e=function(t){if("object"!=rn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=rn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==rn(e)?e:e+""}function sn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(sn=function(){return!!t})()}function ln(){return ln="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=cn(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},ln.apply(null,arguments)}function cn(t){return cn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},cn(t)}function un(t,e){return un=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},un(t,e)}var dn=function(){function t(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,n=cn(n=t),function(t,e){if(e&&("object"==rn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(e,sn()?Reflect.construct(n,r||[],cn(e).constructor):n.apply(e,r));var e,n,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&un(t,e)}(t,W),e=t,n=[{key:"removeQuotesFromBoth",value:function(t){if(t)return t.replace(/"([^"]+)":\s*"([^"]+)"/g,"$1: $2")}},{key:"removeQuotesFromFirstWord",value:function(t){if(t)return t.replace(/"([^"]+)":/g,"$1:")}},{key:"toCode",value:function(){var t=this.items.map(function(t){return t.toCode()}).flatMap(function(t){return t}),e=(this.removeQuotesFromFirstWord(JSON.stringify(this.obj)),'\nbackground: "'.concat(this.obj.background,'",\nbrand: ').concat(this.obj.brand.toCode(),",\nmar: ").concat(JSON.stringify(this.obj.mar),",\npad: ").concat(JSON.stringify(this.obj.pad),",\nresmar: ").concat(JSON.stringify(this.obj.resmar),",\nrespad: ").concat(JSON.stringify(this.obj.respad),",\nradius: ").concat(JSON.stringify(this.obj.radius),",\n"));return"new MobileBar().set({".concat(e,"}).add([\n ").concat(t.join(","),"\n\n ])")}},{key:"set",value:function(e){return this.obj=e,this.obj=e,this.makeNavbar(e),e.mar&&(n=this,"function"==typeof(r=ln(cn(t.prototype),"mar",n))?function(t){return r.apply(n,t)}:r)([e.mar]),e.maxHeight&&(this.res.style.maxHeight=e.maxHeight),e.radius&&(this.res.style.borderRadius=e.radius),e.hamburgerColour&&(this.hamburgerColour=e.hamburgerColour),this.setStyles(e),this;var n,r}},{key:"makeNavbar",value:function(t){var e=this,n=t.brand;this.navbar=document.createElement("nav"),this.navbar.classList.add("mobile-navbar"),this.navbarHeader=document.createElement("div"),this.navbarHeader.classList.add("navbar-header"),this.brand=document.createElement("div"),this.brand.classList.add("navbar-brand"),t.brand&&"function"==typeof n.render&&(console.log("Appending brand:",n.render()),this.brand.appendChild(n.render())),this.toggleButton=document.createElement("button"),this.toggleButton.classList.add("navbar-toggle"),this.toggleButton.innerHTML="☰",this.navContent=document.createElement("div"),this.navContent.classList.add("navbar-content"),this.navbarHeader.appendChild(this.brand),this.navbarHeader.appendChild(this.toggleButton),this.navbar.appendChild(this.navbarHeader),this.navbar.appendChild(this.navContent),this.isMobileNavOpen=!1,this.toggleButton.addEventListener("click",function(){e.toggleMobileNav()}),this.res=this.navbar}},{key:"setStyles",value:function(t){var e,n;this.navbar.style.display="flex",this.navbar.style.flexDirection="column",this.navbar.style.padding="1rem",this.navbar.style.backgroundColor=null!==(e=t.background)&&void 0!==e?e:"orange",this.navbarHeader.style.display="flex",this.navbarHeader.style.alignItems="center",this.navbarHeader.style.justifyContent="space-between",this.navbarHeader.style.width="100%",this.brand.style.fontSize="1.5rem",this.toggleButton.style.background="none",this.toggleButton.style.border="none",this.toggleButton.style.color=null!==(n=this.hamburgerColour)&&void 0!==n?n:"#34495e",this.toggleButton.style.fontSize="1.5rem",this.toggleButton.style.cursor="pointer",this.navContent.style.display="none"}},{key:"add",value:function(t){this.items=t;for(var e=0;e<t.length;e++){var n=t[e];this.navContent.appendChild(n.render())}return this}},{key:"toggleMobileNav",value:function(){this.isMobileNavOpen=!this.isMobileNavOpen,this.navContent.style.display=this.isMobileNavOpen?"flex":"none",this.isMobileNavOpen?(this.navContent.style.flexDirection="column",this.navContent.style.gap="0.5rem",this.navContent.style.padding="1rem"):(this.navContent.style.flexDirection="",this.navContent.style.gap="",this.navContent.style.backgroundColor="",this.navContent.style.padding="")}},{key:"render",value:function(t){return t&&document.querySelector(t).appendChild(this.navbar),this.navbar}}],n&&on(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function fn(t){return fn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fn(t)}function hn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function pn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?hn(Object(n),!0).forEach(function(e){yn(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):hn(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function yn(t,e,n){return(e=vn(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function mn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,vn(r.key),r)}}function vn(t){var e=function(t){if("object"!=fn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=fn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==fn(e)?e:e+""}function gn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(gn=function(){return!!t})()}function bn(t){return bn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},bn(t)}function wn(t,e){return wn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},wn(t,e)}var xn=function(){function t(){var e,n,r,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(n=this,r=t,r=bn(r),e=function(t,e){if(e&&("object"==fn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(n,gn()?Reflect.construct(r,i||[],bn(n).constructor):r.apply(n,i))).breakpoints=[],e.container=null,e.currentView=null,e.internalDiv=null,e.resizeListener=null,e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&wn(t,e)}(t,W),e=t,n=[{key:"set",value:function(t){var e=t.breakpoints;if(this.options={breakpoints:e},!Array.isArray(e))throw new Error("Breakpoints should be an array of objects with 'at' and 'view' properties.");return this.breakpoints=e.map(function(t){if("string"!=typeof t.at||!(t.view.render()instanceof HTMLElement))throw new Error("Each breakpoint must have 'at' as a string and 'view' as an HTMLElement.");return pn(pn({},t),{},{at:parseInt(t.at,10)})}),this.breakpoints.sort(function(t,e){return t.at-e.at}),this}},{key:"toCode",value:function(){JSON.stringify(this.options.breakpoints.map(function(t){return t.view.toCode()}).flat(),null,4),JSON.stringify(this.options.breakpoints.map(function(t){return t.at}),null,4),JSON.stringify(this.options.breakpoints,null,4);for(var t="",e=0;e<this.options.breakpoints.length;e++)t+='{ at: "'.concat(this.options.breakpoints[e].at,'", view: ').concat(this.options.breakpoints[e].view.toCode()," }, \n");return["new Switcher().set({\n breakpoints: [\n ".concat(t,"\n ]\n })")]}},{key:"render",value:function(t){return this.internalDiv=document.createElement("div"),this.applyView(),this.resizeListener=this.applyView.bind(this),window.addEventListener("resize",this.resizeListener),void 0!==t&&document.querySelector(t).appendChild(this.internalDiv),this.internalDiv}},{key:"createRanges",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:99999,n=[],r=0;r<t.length;r++)n.push({from:t[r],to:r<t.length-1?t[r+1]-1:e});return n}},{key:"addRanges",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:99999;return t.map(function(t,r){var i=e[r],o=r<e.length-1?e[r+1]-1:n;return pn(pn({},t),{},{range:{from:i,to:o}})})}},{key:"applyView",value:function(){var t=this,e=(window.innerWidth,this.breakpoints.map(function(t){return t.at})),n=this.breakpoints.map(function(t){return t.at});this.createRanges(n),this.addRanges(this.breakpoints,e).forEach(function(e){var n="(min-width: ".concat(e.range.from,"px) and (max-width: ").concat(e.range.to,"px)");window.matchMedia(n).matches&&t.currentView!==e.view.render()&&(t.internalDiv.innerHTML="",t.internalDiv.appendChild(e.view.render()),t.currentView=e.view.render())})}},{key:"destroy",value:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null),this.internalDiv&&this.container&&this.container.removeChild(this.internalDiv),this.container=null,this.currentView=null,this.internalDiv=null}}],n&&mn(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function kn(t){return kn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kn(t)}function Sn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,On(r.key),r)}}function On(t){var e=function(t){if("object"!=kn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=kn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==kn(e)?e:e+""}var jn=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=document.createElement("div");return n.style.flex="1",this.res=n,this.res.setAttribute("class","innerHider"),this},(e=[{key:"toCode",value:function(){return["new Spacer(".concat(this.hide,")")]}},{key:"render",value:function(){return this.res}}])&&Sn(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Cn(t){return Cn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cn(t)}function En(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Tn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,_n(r.key),r)}}function _n(t){var e=function(t){if("object"!=Cn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Cn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Cn(e)?e:e+""}function Pn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Pn=function(){return!!t})()}function An(t){return An=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},An(t)}function Rn(t,e){return Rn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Rn(t,e)}var Mn=function(){function t(){var e,n,r,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(n=this,r=t,r=An(r),e=function(t,e){if(e&&("object"==Cn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(n,Pn()?Reflect.construct(r,i||[],An(n).constructor):r.apply(n,i))).el=null,e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Rn(t,e)}(t,W),e=t,n=[{key:"set",value:function(t){var e,n;this.options=t;var r=document.createElement("div");r.style.display="flex",r.style.alignItems="center";var i=document.createElement("input");i.type="checkbox",i.style.position="relative",i.style.marginRight="0.5rem";var o=t.size||"24px";i.style.width=o,i.style.height=o,t.customStyle&&(i.style.appearance="none"),i.style.border="2px solid #ccc",i.style.borderRadius="4px",i.style.backgroundColor=t.backgroundColor||"white",i.style.cursor="pointer",i.style.transition="background-color 0.2s ease, border-color 0.2s ease",i.style.display="inline-block",i.style.setProperty("--checked-bg-color",t.checkedBackgroundColor||"#4CAF50"),i.style.setProperty("--checkmark-color","white"),i.style.setProperty("--checkmark-clip-path",null!==(e=this.options.clipPath)&&void 0!==e?e:"polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%)");var a=document.createElement("style");a.textContent='\n input[type="checkbox"] {\n appearance: none;\n -webkit-appearance: none; /* For Safari */\n width: var(--size, 24px);\n height: var(--size, 24px);\n border: 2px solid #ccc;\n border-radius: 4px;\n background-color: white;\n position: relative;\n cursor: pointer;\n transition: background-color 0.2s ease, border-color 0.2s ease;\n }\n\n input[type="checkbox"]:checked {\n background-color: var(--checked-bg-color, #4CAF50);\n border-color: var(--checked-bg-color, #4CAF50);\n }\n\n input[type="checkbox"]::after {\n content: \'\';\n position: absolute;\n width: 50%;\n height: 50%;\n top: 25%;\n left: 25%;\n transform: scale(0);\n background-color: var(--checkmark-color, white);\n clip-path: var(--checkmark-clip-path);\n -webkit-clip-path: var(--checkmark-clip-path);\n transition: transform 0.2s ease;\n }\n\n input[type="checkbox"]:checked::after {\n transform: scale(1);\n }\n',t.customStyle&&document.head.appendChild(a),t.mar&&this.mar(t.mar),t.pad&&this.pad(t.pad),t.respad&&this.respad(t.respad),t.resmar&&this.resmar(t.resmar),i.addEventListener("change",function(){i.checked?(i.style.backgroundColor=t.checkedBackgroundColor||"#4CAF50",i.style.borderColor=t.checkedBackgroundColor||"#4CAF50"):(i.style.backgroundColor=t.backgroundColor||"white",i.style.borderColor="#ccc")}),t.name&&i.setAttribute("name",t.name),r.appendChild(i);var s=document.createElement("div");if("function"==typeof(null===(n=t.label)||void 0===n?void 0:n.render))s.appendChild(t.label.render());else{var l=document.createTextNode(t.title||"Label");s.appendChild(l)}return s.style.opacity=.8,s.style.transition="opacity ease 0.2s, transform ease 0.2s",r.appendChild(s),this.el=r,this}},{key:"getValue",value:function(){return this.el.children[0].checked}},{key:"toCode",value:function(){var t=Object.entries(this.options).map(function(t){var e,n,r=(n=2,function(t){if(Array.isArray(t))return t}(e=t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,n)||function(t,e){if(t){if("string"==typeof t)return En(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?En(t,e):void 0}}(e,n)||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.")}()),i=r[0],o=r[1];return"string"==typeof o?"".concat(i,': "').concat(o,'"'):"object"===Cn(o)&&null!==o?"function"==typeof o.toCode?"".concat(i,": ").concat(o.toCode()[0]):"".concat(i,": ").concat(JSON.stringify(o,null,4)):"".concat(i,": ").concat(o)}).join(",\n ");return["new Checkbox().set({\n ".concat(t,"\n})")]}},{key:"margin",value:function(t){return this.el.style.margin=t,this}},{key:"render",value:function(t){if(!t)return this.el;document.querySelector(t).appendChild(this.el)}}],n&&Tn(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function Ln(t){return Ln="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ln(t)}function zn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,In(r.key),r)}}function In(t){var e=function(t){if("object"!=Ln(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ln(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ln(e)?e:e+""}function Fn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Fn=function(){return!!t})()}function Wn(t){return Wn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Wn(t)}function Dn(t,e){return Dn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Dn(t,e)}window.Checkbox=Mn;var Bn=function(){function t(e){var n,r,i,o;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(r=this,i=t,i=Wn(i),n=function(t,e){if(e&&("object"==Ln(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(r,Fn()?Reflect.construct(i,o||[],Wn(r).constructor):i.apply(r,o))).url=e,n.res=null,n.setup(),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Dn(t,e)}(t,W),e=t,(n=[{key:"setup",value:function(){this.res=document.createElement("video"),this.res.setAttribute("src",this.url),this.res.setAttribute("controls","controls")}},{key:"set",value:function(t){return this.options=t,t.radius&&(this.res.style.borderRadius=t.radius),t.width&&(this.res.style.width="".concat(t.width)),t.opacity&&(this.res.style.opacity=t.opacity),this}},{key:"size",value:function(t){return this.res.style.width=t,this}},{key:"toCode",value:function(){var t=JSON.stringify(this.options,null,4);return['new Video("'.concat(this.url,'").set(').concat(t,")")]}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}])&&zn(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function Nn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Hn(t){return Hn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hn(t)}function Gn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Un(r.key),r)}}function Un(t){var e=function(t){if("object"!=Hn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Hn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Hn(e)?e:e+""}function qn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(qn=function(){return!!t})()}function Jn(){return Jn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Xn(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},Jn.apply(null,arguments)}function Xn(t){return Xn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Xn(t)}function $n(t,e){return $n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},$n(t,e)}var Vn=function(){function t(){var e,n,r,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(n=this,r=t,r=Xn(r),e=function(t,e){if(e&&("object"==Hn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(n,qn()?Reflect.construct(r,i||[],Xn(n).constructor):r.apply(n,i))).res=null,e.items=[],e.setup(),e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&$n(t,e)}(t,W),e=t,n=[{key:"set",value:function(t){return this.options=t,t.pad&&this.pad(t.pad),t.mar&&this.mar(t.mar),this.commonMethods(t),this.callReact(t),this}},{key:"callReact",value:function(e){var n,r,i=[],o=e.transform&&"object"===Hn(e.transform);if(e.stroke||e.gradient||e.span||e.backgroundOp||e.layout||e.shadow||e.animation||e.filtera||o){e.gradient&&(this.globalGradient=e.gradient.op.gradient,"radial"===e.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)")),e.stroke&&(n=this,"function"==typeof(r=Jn(Xn(t.prototype),"setAny",n))?function(t){return r.apply(n,t)}:r)([{globalBlast:"".concat(e.stroke.op.width," ").concat(e.stroke.op.color)}]),e.span&&(e.span.prevText=this.text);var a=[e.stroke,e.gradient,e.animation,e.span,e.backgroundOp,e.layout,e.marginOp,e.shadow,e.animation,e.filtera,o?e.transform:void 0];a=a.filter(function(t){return null!=t});for(var s=0;s<a.length;s++)i.push({range:a[s].range,log:a[s].op.name,target:a[s].target,op:a[s].op});var l=[];e.borderObj&&l.push("border"),e.background&&l.push("background"),e.mar&&l.push("margin"),e.animation&&l.push("animation"),e.span&&l.push("span"),this.chainReact(i,this.options.id,l)}}},{key:"setup",value:function(){var t=document.createElement("ul");return this.res=t,this.res.style.padding=0,this.res.style.margin=0,this}},{key:"setItems",value:function(t){this.items=t;var e,n=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Nn(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Nn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;if("string"==typeof r){var i=document.createElement("li");i.textContent=r,this.res.appendChild(i)}else{var o=r.render();this.res.appendChild(o)}}}catch(t){n.e(t)}finally{n.f()}return this}},{key:"font",value:function(t){return this.res.style.fontFamily=t,this}},{key:"size",value:function(t){return this.res.style.fontSize=t,this}},{key:"em",value:function(t){return this.res.style.fontSize="".concat(t,"em"),this}},{key:"color",value:function(t){return this.res.style.color=t,this}},{key:"align",value:function(t){return this.res.style.textAlign="".concat(t),this}},{key:"weight",value:function(t){return this.res.style.fontWeight=t,this}},{key:"bold",value:function(){return this.res.style.fontWeight="bold",this}},{key:"italic",value:function(){return this.res.style.fontStyle="italic",this}},{key:"margin",value:function(t){return this.res.style.margin=t,this}},{key:"border",value:function(t,e){return this.res.style.border="".concat(t,"px solid ").concat(e),this}},{key:"padding",value:function(t,e,n,r){return this.res.style.paddingTop=t,this.res.style.paddingLeft=e,this.res.style.paddingRight=n,this.res.style.paddingBottom=r,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.res.style.color="#3498db",this}},{key:"toCode",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.code=[],this.excludeFromCodeTrue)return[""];var e=" ".repeat(t),n="".concat(e,"new UList()");return this.items&&this.items.length&&(n+="\n".concat(e," .setItems([\n")+this.items.map(function(e){return"string"==typeof e?"".concat(" ".repeat(t+4),'"').concat(e,'"'):e.toCode(t+4)}).join(",\n")+"\n".concat(e," ])")),[n+="\n".concat(e)]}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}],n&&Gn(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function Yn(t){return Yn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yn(t)}function Qn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Kn(r.key),r)}}function Kn(t){var e=function(t){if("object"!=Yn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Yn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Yn(e)?e:e+""}function Zn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Zn=function(){return!!t})()}function tr(t){return tr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},tr(t)}function er(t,e){return er=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},er(t,e)}var nr=function(){function t(e,n){var r,i,o,a;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(i=this,o=t,o=tr(o),r=function(t,e){if(e&&("object"==Yn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(i,Zn()?Reflect.construct(o,a||[],tr(i).constructor):o.apply(i,a))).text=e,r.res=null,r.val=n,r.setup(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&er(t,e)}(t,W),e=t,n=[{key:"setup",value:function(t){return this}},{key:"set",value:function(t){this.options=t;var e=document.createElement("button");if(e.style.background="transparent",e.style.border="none",t.img)e.append(t.img.render());else if(t.svg)if("string"==typeof t.svg){var n=(new DOMParser).parseFromString(t.svg,"image/svg+xml").documentElement;e.appendChild(n)}else t.svg instanceof SVGElement&&e.appendChild(t.svg);else if(t.url&&!t.img){var r,i,o=document.createElement("img");o.setAttribute("src",t.url),o.style.width=(null===(r=t.frame)||void 0===r?void 0:r.width)||"50px",o.style.height=(null===(i=t.frame)||void 0===i?void 0:i.height)||"50px",e.appendChild(o)}else{var a=document.createTextNode(this.text.replace("$",this.val));e.appendChild(a)}return this.res=e,this.commonMethods(t),t&&"submit"===t.type&&e.setAttribute("type",t.type),this.border("none"),this.res.style.display="block",t.background&&this.background(t.background),t.padding&&this.padding(t.padding),t.margin&&this.margin(t.margin),t.respad&&this.respad(t.respad),t.resmar&&this.resmar(t.resmar),t.centered&&(this.res.style.marginRight="auto",this.res.style.marginLeft="auto",this.res.style.backgroundColor="black"),t.border&&this.border(t.border),t.radius&&this.borderRadius(t.radius),t.class&&this.setClass(t.class),t.color&&this.color(t.color),t.auto&&this.auto(),t.weight&&(this.res.style.fontWeight=t.weight),t.fluidc&&this.fluidButtonCopy(t.fluidc),t.fluidc&&'\n fluidc: "'.concat(t.fluidc,'",'),t.onTap&&this.onTap(t.onTap),t.frame&&this.frame(t.frame),t.frame&&'\n frame: "'.concat(t.frame,'",'),t.arrpad&&this.arrayPadding(t.arrpad.sides,t.arrpad.value),t.arrpad&&'\n arrpad: {sides: ["'.concat(t.arrpad.sides,'"], value: "').concat(t.arrpad.value,'"},'),t.arrayMargin&&this.arrayMargin(t.arrayMargin.sides,t.arrayMargin.value),t.arrayMargin&&'\n arrayMargin: {sides: ["'.concat(t.arrayMargin.sides,'"], value: "').concat(t.arrayMargin.value,'"},'),t.keySet&&this.keySet(t.keySet),t.align&&(this.res.style.textAlign=t.align),t.weight&&(this.res.style.fontWeight=t.weight),t.bold&&(this.res.style.fontWeight="bold"),t.width&&(this.res.style.width=t.width),t.exact&&(this.res.style.fontSize=t.exact),this}},{key:"arrayPadding",value:function(t,e){return t.includes("left")&&(this.res.style.paddingLeft=e),t.includes("right")&&(this.res.style.paddingRight=e),t.includes("top")&&(this.res.style.paddingTop=e),t.includes("bottom")&&(this.res.style.paddingBottom=e),t.includes("all")&&(this.res.style.padding=e),e||(this.res.style.paddingBottom=t),this}},{key:"arrayMargin",value:function(t,e){return e||(this.res.style.marginLeft="".concat(t[0],"px"),this.res.style.marginTop="".concat(t[1],"px"),this.res.style.marginRight="".concat(t[2],"px"),this.res.style.marginBottom="".concat(t[3],"px")),t.includes("left")&&(this.res.style.marginLeft=e),t.includes("right")&&(this.res.style.marginRight=e),t.includes("top")&&(this.res.style.marginTop=e),t.includes("bottom")&&(this.res.style.marginBottom=e),t.includes("all")&&(this.res.style.margin=e),e||(this.res.style.marginBottom=t),this}},{key:"fluidButtonCopy",value:function(t){if(t instanceof Object){this.prevStylex=this.res.style,this.res=document.createElement("button"),this.res.style.cssText=this.prevStylex.cssText;var e=document.createTextNode(this.text);return this.res.appendChild(e),this.res.style.fontSize=t.exact,this}if("S1"===t){this.prevStylex=this.res.style,this.res=document.createElement("button"),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"===t){this.prevStylex=this.res.style,this.res=document.createElement("button"),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"===t){this.prevStylex=this.res.style,this.res=document.createElement("button"),this.res.style.cssText=this.prevStylex.cssText;var i=document.createTextNode(this.text);this.res.appendChild(i),this.res.style.fontSize="calc(1.375rem + 3.525vw)"}if("S4"===t){this.prevStylex=this.res.style,this.res=document.createElement("button"),this.res.style.cssText=this.prevStylex.cssText;var o=document.createTextNode(this.text);this.res.appendChild(o),this.res.style.fontSize="calc(1.250rem + 2.75vw)"}if("S5"===t){this.prevStylex=this.res.style,this.res=document.createElement("button"),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"===t&&(this.res.style.fontSize="calc(1rem + 0.5vw)"),this}},{key:"setClass",value:function(t){return this.res.setAttribute("class",t),this}},{key:"color",value:function(t){return this.res.style.color=t,this}},{key:"background",value:function(t){return this.res.style.background=t,this}},{key:"width",value:function(t){return this.res.style.width=t,this}},{key:"borderRadius",value:function(t){return this.res.style.borderRadius=t,this}},{key:"padding",value:function(t,e,n,r){return t&&e&&n&&r?(this.res.style.paddingLeft=t,this.res.style.paddingTop=e,this.res.style.paddingRight=n,this.res.style.paddingBottom=r):this.res.style.padding=t,this}},{key:"margin",value:function(t,e,n,r){return t&&e&&n&&r?(this.res.style.marginLeft=t,this.res.style.marginTop=e,this.res.style.marginRight=n,this.res.style.marginBottom=r):this.res.style.margin=t,this}},{key:"auto",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.res.style.fontSize="2.2rem":t.res.style.fontSize="1rem"};return e(),window.addEventListener("resize",e),this}},{key:"large",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.res.style.fontSize="6rem":t.res.style.fontSize="3rem"};return e(),window.addEventListener("resize",e),this}},{key:"border",value:function(t,e){return"none"===t&&(this.res.style.border="none"),this.res.style.border="".concat(t," solid ").concat(e,"px"),this}},{key:"frame",value:function(t){return this.res.style.width=t.width,this.res.style.height=t.height,this}},{key:"updating",value:function(t,e){var n=this.res,r=this.text;return Object.defineProperty(t,e,{set:function(t){var e=document.createTextNode(r.replace("$",t));n.replaceChild(e,n.childNodes[0])}}),this}},{key:"onTap",value:function(t){return this.res.addEventListener("click",t),this}},{key:"toCode",value:function(){var t=JSON.stringify(this.options,function(t,e){return"function"==typeof e?e.toString():e},4).replace(/"(\w+)":/g,"$1:").replace(/"(\(\)\s*=>\s*{[^}]*})"/g,"$1").replace(/\\n/g,"").replace(/\\"/g,'"');return['new Button("'.concat(this.text,'").set(').concat(t,")")]}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}],n&&Qn(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function rr(t){return rr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rr(t)}function ir(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,or(r.key),r)}}function or(t){var e=function(t){if("object"!=rr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=rr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==rr(e)?e:e+""}function ar(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ar=function(){return!!t})()}function sr(t){return sr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},sr(t)}function lr(t,e){return lr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},lr(t,e)}var cr=function(){function t(){var e,n,r,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(n=this,r=t,r=sr(r),e=function(t,e){if(e&&("object"==rr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(n,ar()?Reflect.construct(r,i||[],sr(n).constructor):r.apply(n,i))).el=null,e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&lr(t,e)}(t,W),e=t,(n=[{key:"set",value:function(t){this.options=t;var e=document.createElement("div"),n=document.createElement("label");n.style.position="relative",n.style.display="block";var r=document.createTextNode(t.title);n.appendChild(r),n.style.opacity=0;var i=document.createElement("input");return"textarea"===t.type&&(i=document.createElement("textarea")),i.style.position="relative",i.placeholder=t.title,i.style.fontSize="1rem",i.style.padding=".4rem .75rem",e.appendChild(n),e.appendChild(i),this.res=e,t.mar&&this.mar(t.mar),t.pad&&this.pad(t.pad),i.addEventListener("focus",function(){n.style.transition="transform ease 0.2s",n.style.transform="scale(0.80)",n.style.textTransform="uppercase",n.style.transformOrigin="left top",n.style.fontWeight="bold",i.placeholder="",n.style.opacity="1.0",t.font&&(n.style.fontFamily=t.font),t.color&&(n.style.color=t.color),t.exact&&(n.style.fontSize=t.exact)}),i.addEventListener("focusout",function(){n.style.transform="scale(1.0)",i.placeholder=t.title,n.style.opacity="0.0"}),t.name&&i.setAttribute("name",t.name),window.matchMedia("(max-device-width: 415px)").matches&&(i.style.width="100%",e.style.width="100%"),i.style.fontSize="1rem",this.el=e,this}},{key:"getValue",value:function(){return this.el.children[1].value}},{key:"toCode",value:function(){var t=JSON.stringify(this.options,null,4);return t=t.replace(/"(\w+)"(?=\s*:)/g,"$1"),["new FloatingInput().set(".concat(t,")")]}},{key:"margin",value:function(t){return this.el.style.margin=t,this}},{key:"render",value:function(t){if(!t)return this.el;document.querySelector(t).appendChild(this.el)}}])&&ir(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function ur(t){return ur="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ur(t)}function dr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,fr(r.key),r)}}function fr(t){var e=function(t){if("object"!=ur(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ur(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ur(e)?e:e+""}window.FloatingInput=cr;var hr=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.el=null,this.minLabel=null,this.maxLabel=null,this.currentLabel=null},(e=[{key:"padding",value:function(t){return this.el.style.padding=t,this}},{key:"toCode",value:function(){var t=JSON.stringify(this.options,null,4);return["new Range().set(".concat(t,")")]}},{key:"set",value:function(t){var e,n,r=this;this.options=t;var i=document.createElement("input");if(i.setAttribute("id","slider"),i.setAttribute("type","range"),i.setAttribute("min",t.min),i.setAttribute("max",t.max),i.setAttribute("value",t.min),i.style.width=null!==(e=t.width)&&void 0!==e?e:"100%",!t.plain){var o,a;i.style.setProperty("-webkit-appearance","none"),i.style.appearance="none",i.style.height="9px",i.style.background=null!==(o=t.style.trackColor)&&void 0!==o?o:"orange",i.style.borderRadius="5px";var s="\n #slider::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 25px;\n height: 25px;\n border-radius: 50%;\n background: ".concat(null!==(a=t.style.thumbColor)&&void 0!==a?a:"4CAF50",";\n cursor: pointer;\n }\n "),l=document.createElement("style");l.appendChild(document.createTextNode(s)),document.head.appendChild(l)}var c=document.createElement("div");c.style.display="flex",c.style.flexDirection="column",c.style.alignItems="center",c.style.width="100%";var u=document.createElement("div");if(u.style.display="flex",u.style.justifyContent="space-between",u.style.width=null!==(n=t.width)&&void 0!==n?n:"100%",this.minLabel=document.createElement("span"),this.minLabel.textContent=t.min,this.maxLabel=document.createElement("span"),this.maxLabel.textContent=t.max,this.currentLabel=document.createElement("span"),this.currentLabel.textContent=i.value,t.font&&(this.currentLabel.style.fontFamily=t.font),t.font&&(this.minLabel.style.fontFamily=t.font),t.font&&(this.maxLabel.style.fontFamily=t.font),t.plain||(u.appendChild(this.minLabel),u.appendChild(this.currentLabel),u.appendChild(this.maxLabel)),i.addEventListener("input",function(){r.currentLabel.textContent=i.value}),window.matchMedia("(max-device-width: 415px)").matches)if(t.plain)i.style.width="80%";else{var d,f;i.style.height="20px",i.style.background=null!==(d=t.style.trackColor)&&void 0!==d?d:"1abc9C",i.style.borderRadius="10px",i.style.fontSize="3rem",i.style.width="80%";var h="\n #slider::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 25px;\n height: 25px;\n border-radius: 50%;\n background: ".concat(null!==(f=t.style.thumbColor)&&void 0!==f?f:"blue",";\n cursor: pointer;\n }\n "),p=document.createElement("style");p.appendChild(document.createTextNode(h)),document.head.appendChild(p)}return c.appendChild(u),c.appendChild(i),this.el=c,this}},{key:"value",value:function(){return this.el.querySelector("#slider").value}},{key:"render",value:function(t){if(!t)return this.el;document.querySelector(t).appendChild(this.el)}}])&&dr(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function pr(t){return pr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pr(t)}function yr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,mr(r.key),r)}}function mr(t){var e=function(t){if("object"!=pr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=pr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==pr(e)?e:e+""}window.Range=hr;var vr=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.el=null,this.radioCount=0},(e=[{key:"set",value:function(t){this.options=t,this.radioCount=t.items.length;for(var e=document.createElement("div"),n=t.items,r=0;r<n.length;r++){var i=document.createElement("label");n.font&&(i.style.font=n.font),n.color&&(i.style.color=n.color),n.exact&&(i.style.fontSize=n.exact);var o=document.createTextNode(n[r]);i.appendChild(o),i.setAttribute("for",n[r]);var a=document.createElement("input");a.setAttribute("type","radio"),a.setAttribute("id","S".concat(r)),a.setAttribute("value",n[r].split(" ").join("")),a.style.appearance="none",a.style.width="20px",a.style.height="20px",a.style.border=this.options.tint?"2px solid ".concat(this.options.tint):"2px solid #007BFF",a.style.borderRadius="50%",a.style.outline="none",a.style.cursor="pointer",a.style.transition="0.3s",this.options.font&&(i.style.fontFamily=this.options.font),t.multiple?a.setAttribute("name",n[r].split(" ").join("")):a.setAttribute("name",t.name),e.appendChild(a),e.appendChild(i),e.innerHTML+="</br>"}return this.el=e,this.responsive(),this}},{key:"padding",value:function(t){return this.el.style.padding=t,this}},{key:"getCheckedValues",value:function(){for(var t=[],e=0;e<this.radioCount;e++)if(document.querySelector("#S".concat(e)).checked){var n=document.querySelector("#S".concat(e));t.push(n.value)}return t}},{key:"toCode",value:function(){var t=JSON.stringify(this.options,null,4);return t=t.replace(/"(\w+)"(?=\s*:)/g,"$1"),["new RadioGroup().set(".concat(t,")")]}},{key:"responsive",value:function(){return window.matchMedia("(max-device-width: 415px)").matches&&(this.el.style.fontSize="1.7em"),this}},{key:"render",value:function(t){var e=this;if(!t){for(var n=function(){var t=e.el.children[r];"[object HTMLInputElement]"===t.toString()&&t.addEventListener("change",function(){if(t.checked){t.style.backgroundColor=e.options.tint?e.options.tint:"#007BFF",t.style.boxShadow=e.options.tint?"0 0 0 2px ".concat(e.options.tint," inset"):"0 0 0 2px #0056b3 inset";for(var n=0;n<e.el.children.length;n++){var r=e.el.children[n];"INPUT"===r.tagName&&"radio"===r.type&&!1===e.options.multiple&&r!==t&&(r.style.backgroundColor="transparent",r.style.boxShadow="none")}}else t.style.backgroundColor="transparent",t.style.boxShadow="none"})},r=0;r<this.el.children.length;r++)n();return this.el}document.querySelector(t).appendChild(this.el)}}])&&yr(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function gr(t){return gr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gr(t)}function br(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,wr(r.key),r)}}function wr(t){var e=function(t){if("object"!=gr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=gr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==gr(e)?e:e+""}function xr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(xr=function(){return!!t})()}function kr(t){return kr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},kr(t)}function Sr(t,e){return Sr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Sr(t,e)}window.RadioGroup=vr;var Or=function(){function t(){var e,n,r,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(n=this,r=t,r=kr(r),e=function(t,e){if(e&&("object"==gr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(n,xr()?Reflect.construct(r,i||[],kr(n).constructor):r.apply(n,i))).el=null,e.file=null,e.selected="",e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Sr(t,e)}(t,W),e=t,(n=[{key:"setup",value:function(t,e){document.createElement("div");var n=document.createElement("select");n.setAttribute("type","file"),n.setAttribute("name",e),n.addEventListener("change",function(){n.options[n.selectedIndex].value});for(var r=0;r<t.length;r++)n.appendChild(this.addNode(t[r][0],t[r][1]));return this.el=n,this.res=n,this}},{key:"set",value:function(t){return this.options=t,t.items&&this.setup(t.items,t.name),t.arrayPadding&&this.arrayPadding(t.arrayPadding.sides,t.arrayPadding.value),t.arrayMargin&&this.arrayMargin(t.arrayMargin.sides,t.arrayMargin.value),t.pad&&this.pad(t.pad),t.mar&&this.mar(t.mar),t.radius&&(this.el.style.borderRadius=t.radius),t.background&&(this.el.style.background=t.background),this.commonMethods(t),this}},{key:"arrayPadding",value:function(t,e){return t.includes("left")&&(this.el.style.paddingLeft=e),t.includes("right")&&(this.el.style.paddingRight=e),t.includes("top")&&(this.el.style.paddingTop=e),t.includes("bottom")&&(this.el.style.paddingBottom=e),t.includes("all")&&(this.el.style.padding=e),this}},{key:"arrayMargin",value:function(t,e){return t.includes("left")&&(this.el.style.marginLeft=e),t.includes("right")&&(this.el.style.marginRight=e),t.includes("top")&&(this.el.style.marginTop=e),t.includes("bottom")&&(this.el.style.marginBottom=e),t.includes("all")&&(this.el.style.margin=e),this}},{key:"addNode",value:function(t,e){var n=document.createElement("option");n.setAttribute("value",t);var r=document.createTextNode(e);return n.appendChild(r),n}},{key:"padding",value:function(t){return this.el.style.padding=t,this}},{key:"font",value:function(t){return this.el.style.fontFamily=t,this}},{key:"margin",value:function(t){return this.el.style.margin=t,this}},{key:"toCode",value:function(){var t=JSON.stringify(this.options,null,4);return t=t.replace(/"(\w+)"(?=\s*:)/g,"$1"),["new Picker().set(".concat(t,")")]}},{key:"rounded",value:function(t){return this.el.style.borderRadius="4px",this}},{key:"auto",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.el.style.fontSize="3rem":t.el.style.fontSize="1rem"};return e(),window.addEventListener("resize",e),this}},{key:"render",value:function(t){if(!t)return this.el;document.querySelector(t).appendChild(this.el)}}])&&br(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function jr(t){return jr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jr(t)}function Cr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Er(r.key),r)}}function Er(t){var e=function(t){if("object"!=jr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=jr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==jr(e)?e:e+""}function Tr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Tr=function(){return!!t})()}function _r(t){return _r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_r(t)}function Pr(t,e){return Pr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Pr(t,e)}window.Picker=Or;var Ar=function(){function t(){var e,n,r,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(n=this,r=t,r=_r(r),e=function(t,e){if(e&&("object"==jr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(n,Tr()?Reflect.construct(r,i||[],_r(n).constructor):r.apply(n,i))).el=null,e.file=null,e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Pr(t,e)}(t,W),e=t,(n=[{key:"set",value:function(t){var e=this;this.options=t,this.okayColor=t.okayColor,window.matchMedia("(max-device-width: 415px)");var n=document.createElement("div");n.style.paddingBottom="1em",n.style.display="flex",document.createElement("div");var r=document.createElement("input");r.setAttribute("type","text"),r.style.display="none",r.style.margin="0.5em";var i=document.createElement("input");i.setAttribute("type","file"),i.setAttribute("name",t.name),t.accept&&(i.accept=t.accept),i.setAttribute("id",t.id),i.style.visibility="hidden",i.style.display="none",window.matchMedia("(max-device-width: 415px)").matches&&(i.style.fontSize="1rem");var o=document.createElement("label");return o.setAttribute("for",t.id),o.innerText=t.title,o.style.marginRight=12,o.style.padding="0.5em",t.color&&(o.style.color=t.color),t.background&&(o.style.background=t.background,o.style.padding="10"),i.addEventListener("change",function(){r.style.display="block",t.hideField&&(r.style.display="none"),o.innerText="Change",e.file=i.files[0],e.onLoad(e.file),Rr[t.index]=e.file,r.setAttribute("value",e.file.name),r.setAttribute("readonly","true"),e.getLoaded(),e.highlight()}),n.appendChild(i),n.appendChild(o),n.appendChild(r),this.el=n,t.font&&this.font(t.font),t.radius&&this.borderRadius(t.radius),this}},{key:"borderRadius",value:function(t){return this.el.style.borderRadius=t,this}},{key:"addClass",value:function(t){return this.el.setAttribute("class",t),this}},{key:"font",value:function(t){return this.el.style.fontFamily=t,this}},{key:"bold",value:function(){return this.el.style.fontWeight="bold",this}},{key:"rounded",value:function(){return this.el.children[1].style.borderRadius="8px",this}},{key:"highlight",value:function(){return null===this.file?(this.hasFile=!1,this.el.children[1].style.background="red"):(this.hasFile=!0,this.okayColor?this.el.children[1].style.background=this.okayColor:this.el.children[1].style.background="#1abc9c"),this}},{key:"auto",value:function(){var t=function(){window.matchMedia("(max-device-width: 415px)").matches};return t(),window.addEventListener("resize",t),this}},{key:"onLoad",value:function(t){return this.returnObject(this.file),this}},{key:"getLoaded",value:function(){return this.file}},{key:"returnObject",value:function(t){return t}},{key:"loadCall",value:function(t){return this.func=t,this.func(this.file),this}},{key:"toCode",value:function(){var t=JSON.stringify(this.options,null,4);return t=t.replace(/"(\w+)"(?=\s*:)/g,"$1"),["new FilePickera().set(".concat(t,")")]}},{key:"render",value:function(t){return t?(document.querySelector(t).appendChild(this.el),this):this.el}}])&&Cr(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}(),Rr=[];function Mr(t,e){return Mr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Mr(t,e)}function Lr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Lr=function(){return!!t})()}function zr(t){return zr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zr(t)}function Ir(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Fr(r.key),r)}}function Fr(t){var e=function(t){if("object"!=zr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=zr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==zr(e)?e:e+""}var Wr=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.res=null,this.currentItem=""},(e=[{key:"set",value:function(t){var e=this,n=t;this.options=t;var r=document.createElement("input");r.setAttribute("list","dlCities"),r.setAttribute("id","my");var i=t.data,o=0,a=i.length,s=document.createElement("datalist");for(s.id="dlCities",o=0;o<a;o+=1){var l=document.createElement("option");l.value=i[o],s.appendChild(l)}return r.appendChild(s),r.addEventListener("change",function(){var t=document.querySelector("#my").value;e.currentItem=t}),r.setAttribute("placeholder","Type value"),r.style.padding=".4rem .75rem",r.style.fontSize="1rem",this.res=r,this.responsive(),n.arrayPadding&&this.arrayPadding(n.arrayPadding.sides,n.arrayPadding.value),n.arrayMargin&&this.arrayMargin(n.arrayMargin.sides,n.arrayMargin.value),n.pad&&this.pad(n.pad),n.mar&&this.mar(n.mar),this}},{key:"toCode",value:function(){var t=JSON.stringify(this.options,null,4);return["new DataList().set(".concat(t,")")]}},{key:"getValue",value:function(){return this.res.value}},{key:"arrayPadding",value:function(t,e){return t.includes("left")&&(this.res.style.paddingLeft=e),t.includes("right")&&(this.res.style.paddingRight=e),t.includes("top")&&(this.res.style.paddingTop=e),t.includes("bottom")&&(this.res.style.paddingBottom=e),t.includes("all")&&(this.res.style.padding=e),this}},{key:"arrayMargin",value:function(t,e){return t.includes("left")&&(this.res.style.marginLeft=e),t.includes("right")&&(this.res.style.marginRight=e),t.includes("top")&&(this.res.style.marginTop=e),t.includes("bottom")&&(this.res.style.marginBottom=e),t.includes("all")&&(this.res.style.margin=e),this}},{key:"margin",value:function(t){return this.res.style.margin=t,this}},{key:"responsive",value:function(){return window.matchMedia("(max-device-width: 415px)").matches&&(this.res.style.width="100%"),this}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}])&&Ir(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}(),Dr=Wr;function Br(t){return Br="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Br(t)}function Nr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Hr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Gr(r.key),r)}}function Gr(t){var e=function(t){if("object"!=Br(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Br(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Br(e)?e:e+""}Wr=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(t,e,n){if(Lr())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var i=new(t.bind.apply(t,r));return n&&Mr(i,n.prototype),i}(Dr,e)},window.DataList=Wr;var Ur=function(){return t=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"POST";!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.action=e,this.method=n,this.elements=[],this.formElement=document.createElement("form"),this.formElement.action=this.action,this.formElement.method=this.method},e=[{key:"add",value:function(t){var e=this;return this.elements=t,t.forEach(function(t){if(!t||"function"!=typeof t.render)throw new Error("Each element in the array must have a render method that returns an HTML DOM element.");e.formElement.appendChild(t.render())}),this}},{key:"toCode",value:function(){var t=this.elements.map(function(t){return t.toCode()}),e=Object.entries(this.obj).map(function(t){var e,n,r=(n=2,function(t){if(Array.isArray(t))return t}(e=t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,n)||function(t,e){if(t){if("string"==typeof t)return Nr(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Nr(t,e):void 0}}(e,n)||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.")}()),i=r[0],o=r[1],a="string"==typeof o?'"'.concat(o,'"'):o;return"".concat(i,": ").concat(a)}).join(", ");return["new Form().set({".concat(e,"}).add([ \n ").concat(t.join(", \n"),"])")]}},{key:"set",value:function(t){return this.obj=t,t.action&&this.setAction(t.action),t.method&&this.setMethod(t.method),this}},{key:"setAction",value:function(t){this.action=t,this.formElement.action=this.action}},{key:"setMethod",value:function(t){this.method=t,this.formElement.method=this.method}},{key:"render",value:function(t){return t&&document.querySelector(t).appendChild(this.formElement),this.formElement}}],e&&Hr(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function qr(t){return qr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qr(t)}function Jr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Xr(r.key),r)}}function Xr(t){var e=function(t){if("object"!=qr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=qr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==qr(e)?e:e+""}var $r=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},(e=[{key:"style",value:function(t){for(var e=t.bst,n=t.el,r=t.re,i=(t.options,[]),o=0;o<e.length;o++)e[o].target&&(n.id,e[o].target[0]);for(o=0;o<e.length;o++){var a=!0;e[o].target&&(a=!1,n.id===e[o].target[0]&&(a=!0));var s=e[o].op.ops.split("-");a&&s.includes("air")&&(r.borderObj={color:"#1abc9c",radius:"0rem",width:"3px"},r.color="#1abc9c",r.background="transparent"),a&&s.includes("round")&&(s.includes("air")?r.borderObj={width:"4px",radius:"0.7rem",color:"#1abc9c"}:r.borderObj={width:"0px",radius:"0.7rem",color:"#1abc9c"}),a&&s.includes("full")&&(r.background="#3498db",r.borderObj&&r.borderObj.radius&&(r.borderObj.radius="0.3rem"),r.color="white"),a&&s.includes("pill")&&(r.background="#3498db",r.borderObj.radius="9999px",r.color="white"),a&&s.includes("hover")&&(r.hover={color:"#1abc9c",background:"orange"}),i.push((new mt).set(r))}return i}}])&&Jr(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Vr(t){return Vr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vr(t)}function Yr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function Qr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Yr(Object(n),!0).forEach(function(e){Kr(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Yr(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function Kr(t,e,n){return(e=ti(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Zr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ti(r.key),r)}}function ti(t){var e=function(t){if("object"!=Vr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Vr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Vr(e)?e:e+""}function ei(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ei=function(){return!!t})()}function ni(){return ni="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=ri(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},ni.apply(null,arguments)}function ri(t){return ri=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ri(t)}function ii(t,e){return ii=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ii(t,e)}var oi=function(){function t(){var e,n,r,i,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(n=this,r=t,r=ri(r),e=function(t,e){if(e&&("object"==Vr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(n,ei()?Reflect.construct(r,i||[],ri(n).constructor):r.apply(n,i))).res=null,e.options={},e.code=[],e.elCSS=[],e.html=[],e.react=[],e.setup(o),e.code.push("new Polygon(".concat(JSON.stringify(o),")")),e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ii(t,e)}(t,W),e=t,n=[{key:"setup",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=document.createElement("div");return t.id&&e.setAttribute("id",t.id),this.res=e,this.res.style.padding=0,this.res.style.margin=0,this.res.style.display=t.inline?"inline-block":"block",this}},{key:"toCode",value:function(){var t=this.options||{},e=JSON.stringify(t,null,2);return e=e.replace(/"([^"]+)":/g,"$1:"),"new Polygon().set(".concat(e,")")}},{key:"getType",value:function(){return"LayoutWrapperElement"}},{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=Qr(Qr({},this.options),e),e.id&&(this.res.id=e.id),e.class&&(this.res.className=e.class),e.sides&&this.sides(e.sides),e.size&&this.size(e.size.width||e.size,e.size.height),e.color&&this.color(e.color),e.border&&this.border(e.border),e.margin&&this.margin(e.margin),e.padding&&this.padding(e.padding),e.background&&this.background(e.background),e.center&&this.center();var n=e;this.obj=e;var r,i,o=[];if(n.stroke||n.gradient||n.backgroundOp||n.layout||n.marginOp||n.shadow||n.animation||n.filtera||n.transform){var a;n.gradient&&(this.globalGradient=n.gradient.op.gradient),n.stroke&&(null===(r=this,a="function"==typeof(i=ni(ri(t.prototype),"setAny",r))?function(t){return i.apply(r,t)}:i)||void 0===a||a([{globalBlast:"".concat(n.stroke.op.width," ").concat(n.stroke.op.color)}]));for(var s=[n.stroke,n.gradient,n.animation,n.backgroundOp,n.layout,n.marginOp,n.shadow,n.animation,n.filtera,n.transform].filter(function(t){return null!=t}),l=0;l<s.length;l++)o.push({range:s[l].range,log:s[l].op.name,target:s[l].target,op:s[l].op});var c=[];n.border&&c.push("border"),n.background&&c.push("background"),(n.mar||n.margin)&&c.push("margin"),n.animation&&c.push("animation"),"radial"===n.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)"),this.chainReact(o,this.options.id,c)}return this}},{key:"size",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return this.res.style.width="number"==typeof t?t+"px":t,this.res.style.height="number"==typeof e?e+"px":e,this}},{key:"sides",value:function(e){return e<3&&(e=3),this.res.style.clipPath=t.makePolygon(e),this}},{key:"center",value:function(){return this.res.style.marginLeft="auto",this.res.style.marginRight="auto",this}},{key:"color",value:function(t){return this.res.style.background=t,this}},{key:"border",value:function(t){return this.res.style.border="string"==typeof t?t:"".concat((null==t?void 0:t.width)||"1px"," solid ").concat((null==t?void 0:t.color)||"black"),this}},{key:"margin",value:function(t){return this.res.style.margin="number"==typeof t?t+"px":t,this}},{key:"padding",value:function(t){return this.res.style.padding="number"==typeof t?t+"px":t,this}},{key:"background",value:function(t){return this.res.style.background=t,this}},{key:"render",value:function(t){return"string"==typeof t?document.querySelector(t).appendChild(this.res):t instanceof HTMLElement&&t.appendChild(this.res),this}}],r=[{key:"makePolygon",value:function(t){for(var e=2*Math.PI/t,n=[],r=0;r<t;r++){var i=50+50*Math.cos(r*e-Math.PI/2),o=50+50*Math.sin(r*e-Math.PI/2);n.push("".concat(i,"% ").concat(o,"%"))}return"polygon(".concat(n.join(","),")")}}],n&&Zr(e.prototype,n),r&&Zr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n,r}();function ai(t){return ai="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ai(t)}function si(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function li(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ci(r.key),r)}}function ci(t){var e=function(t){if("object"!=ai(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ai(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ai(e)?e:e+""}function ui(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ui=function(){return!!t})()}function di(){return di="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=fi(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},di.apply(null,arguments)}function fi(t){return fi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},fi(t)}function hi(t,e){return hi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},hi(t,e)}var pi=function(){function t(){var e,n,r,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(n=this,r=t,r=fi(r),e=function(t,e){if(e&&("object"==ai(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(n,ui()?Reflect.construct(r,i||[],fi(n).constructor):r.apply(n,i))).res=null,e.options={},e.code=[],e.elCSS=[],e.html=[],e.react=[],e.setup(),e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&hi(t,e)}(t,W),e=t,n=[{key:"setup",value:function(){var t=document.createElement("div");return this.res=t,this.res.style.padding=0,this.res.style.margin=0,this.res.style.borderRadius="50%",this}},{key:"toCode",value:function(){if(this.excludeFromCodeTrue)return[""];var t=Object.fromEntries(Object.entries(this.options||{}).filter(function(t){return null!=(e=t,n=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,n)||function(t,e){if(t){if("string"==typeof t)return si(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?si(t,e):void 0}}(e,n)||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.")}())[1];var e,n})),e=JSON.stringify(t,null,4).replace(/"([^"]+)":/g,"$1:");return["new Circle().set(".concat(e,")")]}},{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(t){return this.res.style.gridArea=t,this}},{key:"rowCol",value:function(t,e){return this.res.style.gridRow=t,this.res.style.gridColumn=e,this}},{key:"setGridRow",value:function(t){return this.res.style.gridRow=t,this}},{key:"setGridCol",value:function(t){return this.res.style.gridColumn=t,this}},{key:"diameter",value:function(t){return this.res.style.width=this.res.style.height="number"==typeof t?t+"px":t,this.res.style.borderRadius="50%",this}},{key:"size",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return this.res.style.width="number"==typeof t?t+"px":t,this.res.style.height="number"==typeof e?e+"px":e,this.res.style.borderRadius="50%",this}},{key:"center",value:function(){return this.res.style.marginLeft=this.res.style.marginRight="auto",this}},{key:"color",value:function(t){return this.res.style.backgroundColor=t,this}},{key:"border",value:function(t){return this.res.style.border="string"==typeof t?t:"".concat((null==t?void 0:t.width)||1,"px solid ").concat((null==t?void 0:t.color)||"black"),this}},{key:"radius",value:function(t){return this.res.style.borderRadius="number"==typeof t?t+"px":t,this}},{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=e,e.top&&(this.res.style.top=e.top),e.left&&(this.res.style.left=e.left),(e.top||e.left)&&(this.res.style.position="absolute"),e.diameter&&this.diameter(e.diameter),e.size&&this.size(e.size.w||e.size,e.size.h||e.size),e.width&&(this.res.style.width=e.width),e.height&&(this.res.style.height=e.height),e.radius&&this.radius(e.radius),e.id&&this.res.setAttribute("id",e.id),e.class&&this.res.setAttribute("class",e.class),e.zIndex&&(this.res.style.zIndex=e.zIndex),e.pad&&(this.res.style.padding=e.pad),e.mar&&(this.res.style.margin=e.mar),e.background&&(this.res.style.background=e.background),e.color&&this.color(e.color),e.border&&this.border(e.border),e.shadow&&(this.res.style.boxShadow=e.shadow),e.cursor&&(this.res.style.cursor=!0===e.cursor?"pointer":e.cursor);var n,r,i=[];if(e.stroke||e.gradient||e.backgroundOp||e.layout||e.marginOp||e.shadow||e.animation||e.filtera||e.transform){var o;e.gradient&&(this.globalGradient=e.gradient.op.gradient),"radial"===e.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)"),e.stroke&&(null===(n=this,o="function"==typeof(r=di(fi(t.prototype),"setAny",n))?function(t){return r.apply(n,t)}:r)||void 0===o||o([{globalBlast:"".concat(e.stroke.op.width," ").concat(e.stroke.op.color)}]));for(var a=[e.stroke,e.gradient,e.animation,e.backgroundOp,e.layout,e.marginOp,e.shadow,e.animation,e.filtera,e.transform].filter(function(t){return null!=t}),s=0;s<a.length;s++)i.push({range:a[s].range,log:a[s].op.name,target:a[s].target,op:a[s].op});var l=[];e.border&&l.push("border"),e.background&&l.push("background"),(e.mar||e.margin)&&l.push("margin"),e.animation&&l.push("animation"),this.chainReact(i,this.options.id,l)}return this}},{key:"getType",value:function(){return"LayoutWrapperElement"}},{key:"excludeFromCode",value:function(){return this.excludeFromCodeTrue=!0,this}},{key:"setClass",value:function(t){return this.res.setAttribute("class",t),this}},{key:"onTap",value:function(t){return this.res.addEventListener("click",t),this}},{key:"render",value:function(t){var e;return t&&(null===(e=document.querySelector(t))||void 0===e||e.appendChild(this.res)),this.res}}],n&&li(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function yi(t){return yi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yi(t)}function mi(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function vi(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?mi(Object(n),!0).forEach(function(e){gi(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):mi(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function gi(t,e,n){return(e=wi(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,wi(r.key),r)}}function wi(t){var e=function(t){if("object"!=yi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=yi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==yi(e)?e:e+""}var xi=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},(e=[{key:"mapType",value:function(t){return["h1","h2","h3","h4","h5","h6","p"].includes(t.el.type)?this.mapText(t):"img"===t.el.type?this.mapImage(t):"a"===t.el.type?this.mapLink(t):"cards"===t.el.type?this.mapGrid(t):"free"===t.el.type?this.mapFree(t):"nav"===t.el.type?this.protoNav(t):"sideNav"===t.el.type?this.sideNav(t):"row"===t.el.type?this.mapRow(t):"dropdown"===t.el.type?this.dropdown(t):"radio"===t.el.type?this.radio(t):"input"===t.el.type?this.input(t):"labelInput"===t.el.type?this.floatInput(t):"filePicker"===t.el.type?this.filePicker(t):"picker"===t.el.type?this.picker(t):"video"===t.el.type?this.video(t):"audio"===t.el.type?this.audio(t):"multiswitcher"===t.el.type?this.multiswitcher(t):"button"===t.el.type?this.button(t):"form"===t.el.type?this.form(t):"checkbox"===t.el.type?this.checkbox(t):"stack"===t.el.type?this.stack(t):"simple"===t.el.type?this.simple(t):"copy"===t.el.type?this.mapCopy(t):"wrap"===t.el.type?this.mapWrap(t):"circle"===t.el.type?this.mapCircle(t):"polygon"===t.el.type?this.mapPolygon(t):"code"===t.el.type?this.mapCode(t):"table"===t.el.type?this.mapTable(t):"ulist"===t.el.type?this.mapUList(t):void 0}},{key:"mapTable",value:function(t){var e=t.el;return(new Me).add([{abbr:"AUIUI/AK9PT",name:"Pokročilé mobilní technologie",grade:"A",date:"09.01.2024"},{abbr:"AUIUI/AK9PT",name:"Pokročilé mobilní technologie",grade:"A",date:"09.01.2024"},{abbr:"AUIUI/AK9PT",name:"Pokročilé mobilní technologie",grade:"A",date:"09.01.2024"}]).set({cellPadding:"0.3em",cellAlign:"center",style:{font:"Arial"},headStyle:{color:"white",background:"#ff6d22"},border:"2px solid black",center:!0,borderRadius:2.2,stroke:this.filtero("blast",e.id,t.customOptions),gradient:this.filtero("gradient",e.id,t.customOptions),animation:this.filtero("animation",e.id,t.customOptions),shadow:this.filtero("shadow",e.id,t.customOptions),span:this.filtero("span",e.id,t.customOptions),backgroundOp:this.filtero("background",e.id,t.customOptions),marginOp:this.filtero("margin",e.id,t.customOptions),transform:this.filtero("transform",e.id,t.customOptions),filtera:this.filtero("filter",e.id,t.customOptions),raster:this.filteroRaster(e.id,t.customOptions)})}},{key:"mapRow",value:function(t){var e=t.el;return(new Ct).set({stroke:this.filtero("blast",e.id,t.customOptions),gradient:this.filtero("gradient",e.id,t.customOptions),animation:this.filtero("animation",e.id,t.customOptions),shadow:this.filtero("shadow",e.id,t.customOptions),span:this.filtero("span",e.id,t.customOptions),backgroundOp:this.filtero("background",e.id,t.customOptions),marginOp:this.filtero("margin",e.id,t.customOptions),transform:this.filtero("transform",e.id,t.customOptions),filtera:this.filtero("filter",e.id,t.customOptions),raster:this.filteroRaster(e.id,t.customOptions)}).items([new Y("This").set({size:"S3"}),new Y("is").set({size:"S3",text:"Hello"}),new Y("row.").set({size:"S3",text:"Hello"})])}},{key:"mapCode",value:function(t){var e=t.el;return(new le).set({stroke:this.filtero("blast",e.id,t.customOptions),gradient:this.filtero("gradient",e.id,t.customOptions),animation:this.filtero("animation",e.id,t.customOptions),shadow:this.filtero("shadow",e.id,t.customOptions),span:this.filtero("span",e.id,t.customOptions),backgroundOp:this.filtero("background",e.id,t.customOptions),marginOp:this.filtero("margin",e.id,t.customOptions),transform:this.filtero("transform",e.id,t.customOptions),filtera:this.filtero("filter",e.id,t.customOptions),raster:this.filteroRaster(e.id,t.customOptions),pad:[{l:30}],mar:[{a:30}],class:"language-js",code:'new Text("Modality").set({ font: "Arial" })'})}},{key:"mapCopy",value:function(t){var e,n=t.customOptions.filter(function(t){return"copy"===t.op})[0],r=null!==(e=null==n?void 0:n.count)&&void 0!==e?e:3,i=300;return'new Wrapper()\n.set({\n width: "'.concat(i,'px",\n height: "').concat(i,'px",\n display: "flex",\n justifyContent: "center",\n alignItems: "center",\n position: "absolute",\n id: "#first",\n scale: 0.3,\n ').concat(null!=n&&n.animation?'\nanimation: {\n op: {\n name: "animation",\n color: "green",\n width: "1px",\n fireAt: "inview",\n keyframesOpen: [\n {\n transform: "rotate(360deg)",\n opacity: 0\n },\n {\n transform: "rotate(0deg)",\n opacity: 1\n }\n ],\n keyframesClose: [\n {\n transform: "rotate(0deg)",\n opacity: 1\n },\n {\n transform: "rotate(0deg)",\n opacity: 0\n }\n ],\n openOptions: {\n duration: 300,\n fill: "forwards",\n delay: 1000\n },\n closeOptions: {\n duration: 1,\n fill: "forwards",\n delay: 1000\n }\n },\n target: [\n "#first"\n ]\n },\n ':"","\n})\n.add(\n Array.from({ length: ").concat(r,' }).map((_, i) => {\n\n const bbox = {width: "').concat(i,'px", height: "').concat(i,'px"};\n\n const elHeight = bbox.height;\n\n const cx = ').concat(150,";\n const cy = ").concat(150,";\n\n const R = ").concat(150,";\n\n const n = ").concat(r,';\n\n // Evenly spaced angles, starting at top (-90°)\n const angle = (i / n) * Math.PI * 2 - Math.PI/2;\n const dist = R + parseFloat(elHeight)/2;\n\n const x = cx + dist * Math.cos(angle);\n const y = cy + dist * Math.sin(angle);\n\n let rot = angle * 180 / Math.PI + 90;\n rot = (rot % 360 + 360) % 360;\n rot = (rot % 360 + 360) % 360;\n\n return new Text("Hello").set({\n size: "S1",\n color: "green",\n font: "Arial",\n left: `${x}px`,\n top: `${y}px`,\n transform: {\n op: {\n name: "transform",\n transform: {\n static: true,\n keep: true,\n values: [\n "tx:-50%",\n "ty:-50%",\n `rotate(${rot}deg)`\n ]\n }\n }\n }\n })\n\n \n })\n)')}},{key:"button",value:function(){return new nr("Submit").set({fluidc:"S6",color:"white",background:"#1abc9c",arrpad:{sides:["all"],value:".3rem"},radius:".3rem",onTap:function(){console.log("[nodality] demo button tapped")},keySet:{key:"border",value:"3px solid green"}})}},{key:"multiswitcher",value:function(){return(new xn).set({breakpoints:[{at:"0px",view:new Y("First").set({})},{at:"700px",view:new Y("Nice").set({})},{at:"800px",view:new Y("Best").set({})}]})}},{key:"video",value:function(){return new Bn("https://www.w3schools.com/html/mov_bbb.mp4").set({})}},{key:"audio",value:function(){return new te("rouska.mp3").set({background:"#1abc9c"})}},{key:"radio",value:function(t){return(new vr).set({items:["Male","Female","Other"],multiple:!0})}},{key:"input",value:function(t){return(new Ve).set({type:"text",placeholder:"Enter swimming time",arrayMargin:{sides:["all"],value:"1rem"}})}},{key:"floatInput",value:function(t){return(new cr).set({title:"Your name",type:"input"})}},{key:"filePicker",value:function(t){return(new Ar).set({id:"A",title:"Add profile picture",background:"#3498DB",color:"white",font:"Arial",radius:"3rem",accept:"application/pdf"})}},{key:"picker",value:function(t){return(new Or).set({items:[["none","select a car---"],["tesla","Tesla"],["audi","Audi"]],font:"Arial",arrayPadding:{sides:["all"],value:"0.5rem"},rounded:!0})}},{key:"dropdown",value:function(t){t.el.items||(t.el.items=["Flower","Car","Maseratti"]);var e=t.el.items.map(function(t){return(new mt).set({pad:[{a:10}],font:"Arial",bold:!0,link:"https://www.apple.com",text:t,icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/32/32339.png"},hover:{color:"wheat",animation:.3}})});return(new He).set({behaviour:"click",pad:[{a:"1rem"}],mar:[{a:"1rem"}],border:"1px solid black",width:"180px",radius:"1rem"}).add([new Y(t.el.items[0]).set({font:"Arial",fluidc:"S6",weight:"bold",align:"center",cursor:"hand",icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/60/60995.png"},pad:[{l:10,r:10}]}),(new Se).set({border:"1px solid green",background:"#1abc9c",radius:"0.7rem",socenter:!0}).add(e.slice(1))])}},{key:"protoNav",value:function(t){t.customOptions;var e=[{title:"Fire",link:"@e"},{title:"and",link:"@e"},{title:"smoke",link:"@e"}],n=e.map(function(t,e){return new mt('"'.concat(t.title,'"')).set({fluidc:"S6",text:t.title,link:t.link,font:"Arial",pad:[{a:40}],bold:!0,hover:{color:"wheat",animation:.3}})}),r=e.map(function(t,e){return new mt('"'.concat(t.title,'"')).set({fluidc:"S6",text:t.title,link:t.link,font:"Arial",pad:[{a:40}],bold:!0,hover:{color:"wheat",animation:.3},animation:{range:["0px","1900px"],op:{name:"animation",color:"green",width:"1px",keyframesOpen:[{transform:"translate(100%, ".concat(10*e,"%)"),opacity:0},{transform:"translate(0%)",opacity:1}],keyframesClose:[{transform:"translate(0%)",opacity:1},{transform:"translate(100%, ".concat(10*e,"%)"),opacity:0}],openOptions:{duration:300,fill:"forwards",delay:1e3},closeOptions:{duration:1,fill:"forwards",delay:1e3}}}})});if(t.el.dropdown){var i=(new He).set({behaviour:"mouseover",pad:[{a:40}],padding:"10px",border:"1px solid black"}).add([new Y("First").set({cursor:"hand",icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/60/60995.png"},fluidc:"S6",pad:[{l:20,r:10}],font:"Arial",align:"center",weight:"bold"}),(new Se).set({centerColumn:!0,radius:"0.7rem",background:"#1abc9c",makeResponsiveBehaviour:"undefined"}).add([(new mt).set({pad:[{a:10}],font:"Arial",hover:{color:"wheat",animation:.3},bold:!0,link:"https://www.apple.com",text:"Second",icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/32/32339.png"}}),(new mt).set({pad:[{a:10}],font:"Arial",hover:{color:"wheat",animation:.3},bold:!0,link:"https://www.apple.com",text:"Third",icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/32/32339.png"}})])]);r.push(i),n.push(i)}return t.el.animation,(new xn).set({breakpoints:[{at:"0px",view:(new dn).set({background:"#ecf0f1",mar:[{a:21}],brand:new Y("Company").set({size:"S6",font:"Helvetica"}),hamburgerColour:"#3498db",radius:"1rem"}).add([(new mt).set({text:"About",url:"#a"}),(new He).set({behaviour:"mouseover",pad:[{a:40}],mar:[{lr:"auto"}],breakpoint:"1200px",padding:"10px",border:"1px solid black",height:"auto"}).add([new Y("More").set({cursor:"hand",icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/60/60995.png"},fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"}),new Y("Our story").set({cursor:"hand",fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"}),new Y("Team").set({cursor:"hand",fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"})]),new mt("B").set({text:"About",url:"#b"}),new mt("C").set({text:"Contact",url:"https://www.abcnews.com"})])},{at:"1200px",view:(new nn).set({background:"#ecf0f1",mar:[{a:21}],maxHeight:"100px",radius:"1rem"}).add([new Y("Company").set({size:"S6",font:"Helvetica"}),new jn(!0),(new He).set({behaviour:"mouseover",pad:[{a:40}],padding:"10px",border:"1px solid black",radius:"30px",width:"130px"}).add([new Y("More").set({cursor:"hand",icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/60/60995.png"},fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"}),(new Se).set({flexDir:"column",mar:[{t:"10px"}],radius:".3rem"}).add([new mt("").set({text:"Who we are",url:"jk",cursor:"hand",fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"}),new mt("").set({text:"Info",url:"#u",cursor:"hand",fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"}),new mt("").set({text:"About",url:"#u",cursor:"hand",fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"})])]),(new mt).set({text:"About",url:"#a"}),(new mt).set({text:"Services",url:"#a"}),(new mt).set({text:"Contact",url:"#a"})])}]})}},{key:"sideNav",value:function(t){t.customOptions;var e=[{title:"Home",link:"@e"},{title:"Projects",link:"@e"},{title:"Services",link:"@e"}],n=e.map(function(t,e){return new mt('"'.concat(t.title,'"')).set({fluidc:"S4",text:t.title,link:t.link,isNavA:!0,url:"#e",id:"#"+t.title.toLowerCase(),font:"Arial",pad:[{a:20}],bold:!0,tags:{open:"sidebar:open",close:"sidebar:closed"},align:"left",hover:{color:"wheat",animation:.3}})}),r=(new He).set({behaviour:"mouseover",pad:[{a:40}],padding:"10px",animation:{range:["0px","1900px"],op:{name:"animation",color:"green",width:"1px",keyframesOpen:[{transform:"translate(100%, ".concat(10,"%)"),opacity:0},{transform:"translate(0%)",opacity:1}],keyframesClose:[{transform:"translate(0%)",opacity:1},{transform:"translate(100%, ".concat(10,"%)"),opacity:0}],openOptions:{duration:300,fill:"forwards",delay:1e3},closeOptions:{duration:1,fill:"forwards",delay:1e3}}}}).add([new Y("More").set({cursor:"hand",icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/60/60995.png"},fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"}),(new Se).set({centerColumn:!0,radius:"0.7rem",background:"#1abc9c",makeResponsiveBehaviour:"undefined"}).add([(new mt).set({pad:[{a:10}],font:"Arial",hover:{color:"wheat",animation:.3},bold:!0,link:"https://www.apple.com",text:"Second",icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/32/32339.png"}}),(new mt).set({pad:[{a:10}],font:"Arial",hover:{color:"wheat",animation:.3},bold:!0,link:"https://www.apple.com",text:"Third",icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/32/32339.png"}})])]),i=e.map(function(t,e){return new mt('"'.concat(t.title,'"')).set({fluidc:"S4",text:t.title,link:t.link,isNavA:!0,url:"#myURL",id:"#"+t.title.toLowerCase(),font:"Arial",pad:[{a:20}],bold:!0,tags:{open:"sidebar:open",close:"sidebar:closed"},align:"left",hover:{color:"wheat",animation:.3},animation:{range:["0px","1900px"],op:{name:"animation",color:"green",width:"1px",keyframesOpen:[{transform:"translate(100%, ".concat(10*e,"%)"),opacity:0},{transform:"translate(0%)",opacity:1}],keyframesClose:[{transform:"translate(0%)",opacity:1},{transform:"translate(100%, ".concat(10*e,"%)"),opacity:0}],openOptions:{duration:300,fill:"forwards",delay:1e3},closeOptions:{duration:1,fill:"forwards",delay:1e3}}}})});t.el.dropdown&&(i.push(r),n.push(r));var o=(new Se).set({column:!0}).add([new Y("Sidebar").set({size:"S6",font:"Arial",id:"#olod",italic:!0,animation:{range:["0px","1900px"],op:{name:"animation",color:"green",width:"1px"}},pad:[{l:20},{t:20}]}),t.el.animation?i[0]:n[0],t.el.animation?i[1]:n[1],t.el.animation?i[2]:n[2],t.el.animation&&t.el.dropdown?i[3]:new Y("").set({}).excludeFromCode(),new Y("Company, 2025").set({pad:[{a:20}],animation:{range:["0px","1900px"],op:{name:"animation",color:"green",width:"1px"}}})]),a=(new Se).set({column:!0}).add([new Y("Off canvas").set({fluidc:"S6",font:"Arial",id:"#olod",italic:!0,animation:t.el.animation?{range:["0px","1900px"],op:{name:"animation",color:"green",width:"1px"}}:null,pad:[{l:40},{t:20}]})]);return(new Dt).setup({animate:!0,radius:"1rem",isSide:!0,background:"#ecf0f1",hamColour:{opened:"#1abc9c",closed:"#e67e22"},mobileSize:"1.2em",fixed:!0,tags:{open:"sidebar:open",close:"sidebar:closed"}}).items(t.el.offcanvas?a:o)}},{key:"mapFree",value:function(t){var e=t.customOptions.filter(function(t){return"slayout"===t.op.name||"layout"===t.op.name})[0],n=null,r={cols:6,rows:6};return"text-above-image"!==e.op.value&&"image-above-text"!==e.op.value||(n=null,r=null),"img-overlay-text"===e.op.value&&(n={text:{row:"1 / span 2",col:"3 / span 2"},image:{row:"2 / span 3",col:"3 / 3"}}),"img-leftof-text"===e.op.value&&(n={text:{row:"1",col:"1 / 3"},image:{row:"1",col:"3 / 4"}}),(new Xt).set({id:"#3",templateCols:r,height:"600px"}).add([new Y("I am free").set({border:"3px solid green",font:"Arial",size:"S1",color:"#1abc9c",gpos:null!=n?n.text:null,zIndex:1}),(new at).set({url:"https://upload.wikimedia.org/wikipedia/commons/a/ac/MSC_World_Europa_-_Saint-Nazaire_-_June_2022.jpg",width:"400px",height:"auto",gpos:null!=n?n.image:null})])}},{key:"mapCircle",value:function(t){var e=t.el;return(new pi).set({diameter:108,background:"#1abc9c",stroke:this.filtero("blast",e.id,t.customOptions),gradient:this.filtero("gradient",e.id,t.customOptions),animation:this.filtero("animation",e.id,t.customOptions),shadow:this.filtero("shadow",e.id,t.customOptions),span:this.filtero("span",e.id,t.customOptions),backgroundOp:this.filtero("background",e.id,t.customOptions),marginOp:this.filtero("margin",e.id,t.customOptions),transform:this.filtero("transform",e.id,t.customOptions),filtera:this.filtero("filter",e.id,t.customOptions),raster:this.filteroRaster(e.id,t.customOptions)})}},{key:"mapPolygon",value:function(t){var e,n=t.el,r=null!==(e=t.el.sides)&&void 0!==e?e:7;return new oi({id:"hex"}).set({sides:r,size:300,background:"#1abc9c",gradient:this.filtero("gradient",n.id,t.customOptions),animation:this.filtero("animation",n.id,t.customOptions),shadow:this.filtero("shadow",n.id,t.customOptions),span:this.filtero("span",n.id,t.customOptions),backgroundOp:this.filtero("background",n.id,t.customOptions),marginOp:this.filtero("margin",n.id,t.customOptions),transform:this.filtero("transform",n.id,t.customOptions),filtera:this.filtero("filter",n.id,t.customOptions),raster:this.filteroRaster(n.id,t.customOptions)})}},{key:"mapText",value:function(t){var e,n=t.el;return new Y(n.text||n.value).set({id:n.id,class:n.class,color:n.color,size:this.getElType(n.type),font:null!==(e=n.font)&&void 0!==e?e:"Arial",stroke:this.filtero("blast",n.id,t.customOptions),gradient:this.filtero("gradient",n.id,t.customOptions),animation:this.filtero("animation",n.id,t.customOptions),shadow:this.filtero("shadow",n.id,t.customOptions),span:this.filtero("span",n.id,t.customOptions),backgroundOp:this.filtero("background",n.id,t.customOptions),marginOp:this.filtero("margin",n.id,t.customOptions),transform:this.filtero("transform",n.id,t.customOptions),filtera:this.filtero("filter",n.id,t.customOptions),raster:this.filteroRaster(n.id,t.customOptions),resprop:n.resprop?[{breakpoint:"1400px",background:"orange",width:"200px",height:"200px"},{breakpoint:"900px",background:"green",height:"100px",width:"100px"}]:null})}},{key:"mapImage",value:function(t){var e=t.el;return new at(e.url).set(vi(vi({},e),{},{isFull:e.isFull,animation:this.filtero("animation",e.id,t.customOptions),shadow:this.filtero("shadow",e.id,t.customOptions),marginOp:this.filtero("margin",e.id,t.customOptions),filtera:this.filtero("filter",e.id,t.customOptions),raster:this.filteroRaster(e.id,t.customOptions)}))}},{key:"mapLink",value:function(t){var e=t.customOptions.filter(function(t){return"link-style"===t.op.name}),n=t.el;return t.el.id&&(n.id=t.el.id),t.el.link&&t.el.text&&(n.url=t.el.link,n.text=t.el.text),n.animation=this.filtero("animation",t.el.id,t.customOptions),n.class=t.el.class,n.width=t.el.width,n.font="Arial",n.fluidc=t.el.fluidc,n.transform=this.filtero("transform",t.el.id,t.customOptions),n.shadow=this.filtero("shadow",t.el.id,t.customOptions),n.gradient=this.filtero("gradient",t.el.id,t.customOptions),n.blast=this.filtero("blast",t.el.id,t.customOptions),n.backgroundOp=this.filtero("background",t.el.id,t.customOptions),n.pad=[{a:10}],e.length>0?$r.style({el:t.el,re:n,bst:e,options:t.customOptions})[e.length-1]:(new mt).set(n)}},{key:"mapGrid",value:function(t){var e=t.el,n=(t.customOptions.find(function(t){return"card-style"===t.op.name}),this.filtero("gradient",e.id,t.customOptions)),r=this.filtero("animation",e.id,t.customOptions),i=this.filtero("shadow",e.id,t.customOptions),o=this.filtero("margin",e.id,t.customOptions),a=this.filtero("filter",e.id,t.customOptions),s=this.filtero("blast",e.id,t.customOptions),l='\n new Card()\n .set({\n width: "300px", \n height: "700px",\n radius: "0.7rem", \n mar: { sides: ["all"], value: "0.8rem" }\n '.concat(void 0!==n?",\n gradient: ".concat(JSON.stringify(n)):"").concat(void 0!==r?",\n animation: ".concat(JSON.stringify(r)):"").concat(void 0!==i?",\n shadow: ".concat(JSON.stringify(i)):"").concat(void 0!==o?",\n marginOp: ".concat(JSON.stringify(o)):"").concat(void 0!==a?",\n filtera: ".concat(JSON.stringify(a)):"").concat(void 0!==s?",\n blast: ".concat(JSON.stringify(s)):"",'\n })\n .items([\n new Image(item.img).set({isFull: true, url: item.img}),\n new Text(item.title).set({ size: "S5", color: "orange" }),\n new Link("Link").set({\n text: item.title, \n url: item.link, \n background: "#3498db", \n pad: [{ lr: "0.5rem", tb: "1rem" }], \n radius: "0.4rem", \n color: "white",\n mar: [{"a": 21}]\n })\n ])'),c=t.el.backgroundCard?'\n new ZoomCard()\n .set({\n url: item.img, \n font: "Arial", \n mar: { sides: ["all"], value: "0.8rem" }, \n inpad: "1rem", \n useBrightness: true\n })\n .items([\n new Text(item.title).set({ fluidc: "S6", color: "orange" }),\n new Link("Link").set({\n text: item.title, \n url: item.link, \n background: "#3498db", \n pad: [{ lr: "0.5rem", tb: "1rem" }], \n radius: "0.4rem", \n color: "white"\n })\n ])':l;return' new FlexGrid()\n .set({\n colat: "700px",\n wrap: true,\n align: "center",\n gap: "1rem"\n '.concat(void 0!==n?",\n gradient: ".concat(JSON.stringify(n)):"").concat(void 0!==r?",\n animation: ".concat(JSON.stringify(r)):"").concat(void 0!==i?",\n shadow: ".concat(JSON.stringify(i)):"").concat(void 0!==o?",\n marginOp: ".concat(JSON.stringify(o)):"").concat(void 0!==a?",\n filtera: ".concat(JSON.stringify(a)):"").concat(void 0!==s?",\n blast: ".concat(JSON.stringify(s)):"",'\n })\n .items(\n [\n { img: "https://upload.wikimedia.org/wikipedia/commons/3/3a/Starship_S20.jpg", title: "Starship", link: "#ship" },\n { img: "https://upload.wikimedia.org/wikipedia/commons/1/16/Apollo_11_Launch_-_GPN-2000-000630.jpg", title: "Saturn V", link: "#saturn" },\n { img: "https://upload.wikimedia.org/wikipedia/commons/d/d6/STS120LaunchHiRes-edit1.jpg", title: "Shuttle", link: "#shuttle" }\n ].map(item => \n ').concat(c,"\n )\n )\n ")}},{key:"checkbox",value:function(t){return(new Mn).set({name:"acceptTerms",label:new Y("Check it out!").set({size:"S6",color:"#1abc9c",font:"Arial"}),mar:"10px"})}},{key:"stack",value:function(t){return(new fe).set({}).add([(new at).set({url:"https://pbs.twimg.com/media/DwYvbCBVAAEKY_R.jpg"}),new Y("Samuel Suresh").set({color:"#00ae56",font:"SF Pro Display",fluidc:"S2",pad:{sides:["top","left"],value:20}})])}},{key:"form",value:function(t){return(new Ur).set({action:"file.php"}).add([(new cr).set({title:"Your name",type:"input",name:"name"}),(new cr).set({title:"Your email",type:"input",name:"email",color:"#3498db",font:"Arial",mar:[{a:"1rem"}]}),(new vr).set({name:"gender",items:["Male","Female","Other"],multiple:!1,tint:"#1abc9c",font:"Arial",exact:"3rem"}),(new Or).set({name:"car",items:[["none","select a car---"],["tesla","Tesla"],["audi","Audi"]],font:"Arial",arrayPadding:{sides:["all"],value:"0.5rem"},radius:"1rem",background:"#1abc9c"}),(new Ar).set({id:"A",name:"image",title:"Add profile picture",background:"#3498DB",color:"white",font:"Arial",radius:"3rem"}),new nr("Submit form").set({type:"submit",background:"#3498db",color:"white",weight:"bold",radius:"1rem",pad:[{a:"1rem"}],mar:[{b:"1rem"}]})])}},{key:"simple",value:function(t){return'new AreaSwitcher()\n .set({ gap: "10px", height: "700px" })\n .react([\n {\n at: "0", // Default size\n color: "red",\n template: [\n "aaaaaa",\n "bbbbbb",\n "cccccc",\n "dddddd",\n "eeeeee",\n ],\n },\n {\n at: "768", // Medium screen size\n color: "blue",\n template: [\n "aa bbb",\n "aa bbb",\n "cc ddd",\n "ee ddd",\n ],\n },\n {\n at: "1024", // Large screen size\n color: "green",\n template: [\n "aaa bbb",\n "ccc ddd",\n "eee ddd",\n ],\n },\n ])\n .add([\n new Text("Hello A").set({size: "S1"}),\n new Text("Hello B").set({size: "S1"}),\n new Text("Hello C").set({size: "S1"}),\n new Text("Hello D").set({size: "S1"}),\n new Text("Hello E").set({size: "S1"})\n ])'}},{key:"mapWrap",value:function(t){var e,n,r=t.el,i=null!==(e=t.el.kind)&&void 0!==e?e:"";return new Se(i).set({id:r.id,class:r.class,color:r.color,size:this.getElType(r.type),font:null!==(n=r.font)&&void 0!==n?n:"Arial",keySet:r.keySet,stroke:this.filtero("blast",r.id,t.customOptions),gradient:this.filtero("gradient",r.id,t.customOptions),animation:this.filtero("animation",r.id,t.customOptions),shadow:this.filtero("shadow",r.id,t.customOptions),transform:this.filtero("transform",r.id,t.customOptions),filtera:this.filtero("filter",r.id,t.customOptions),raster:this.filteroRaster(r.id,t.customOptions)}).add([new Y("Hello").set({}),new Y("Hello").set({}),new Y("Hello").set({})])}},{key:"mapUList",value:function(t){var e,n,r=t.el,i=null!==(e=t.el.kind)&&void 0!==e?e:"";return new Vn(i).set({id:r.id,class:r.class,color:r.color,size:this.getElType(r.type),font:null!==(n=r.font)&&void 0!==n?n:"Arial",keySet:r.keySet,stroke:this.filtero("blast",r.id,t.customOptions),gradient:this.filtero("gradient",r.id,t.customOptions),animation:this.filtero("animation",r.id,t.customOptions),shadow:this.filtero("shadow",r.id,t.customOptions),transform:this.filtero("transform",r.id,t.customOptions),filtera:this.filtero("filter",r.id,t.customOptions),raster:this.filteroRaster(r.id,t.customOptions)}).setItems([new Y("First").set({}),new Y("Second").set({}),new Y("Third").set({})])}},{key:"getElType",value:function(t){return"p"===t?"S6":"S".concat(t.substr(1))}},{key:"filtero",value:function(t,e,n){return n.filter(function(e){return e.op.name===t}).filter(function(t){return!t.target||t.target.includes(e)})[0]}},{key:"filteroRaster",value:function(t,e){var n=(e||[]).filter(function(e){return e&&"string"==typeof e.op&&y.includes(e.op)&&(!e.target||t&&e.target.includes(t))});return n.length>0?n:void 0}}])&&bi(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();export{xi as ElementMapper};
|