nodality 1.3.2 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/animator.cjs.js +1 -1
- package/dist/animator.cjs.js.LICENSE.txt +1 -1
- package/dist/animator.esm.js +1 -1
- package/dist/animator.esm.js.LICENSE.txt +1 -1
- package/dist/audionew.cjs.js +1 -1
- package/dist/audionew.cjs.js.LICENSE.txt +1 -1
- package/dist/audionew.esm.js +1 -1
- package/dist/audionew.esm.js.LICENSE.txt +1 -1
- package/dist/base.cjs.js +1 -1
- package/dist/base.cjs.js.LICENSE.txt +1 -1
- package/dist/base.esm.js +1 -1
- package/dist/base.esm.js.LICENSE.txt +1 -1
- package/dist/beta-desktop-bar.cjs.js +1 -1
- package/dist/beta-desktop-bar.cjs.js.LICENSE.txt +1 -1
- package/dist/beta-desktop-bar.esm.js +1 -1
- package/dist/beta-desktop-bar.esm.js.LICENSE.txt +1 -1
- package/dist/beta-mobile-bar.cjs.js +1 -1
- package/dist/beta-mobile-bar.cjs.js.LICENSE.txt +1 -1
- package/dist/beta-mobile-bar.esm.js +1 -1
- package/dist/beta-mobile-bar.esm.js.LICENSE.txt +1 -1
- package/dist/bundle.umd.js +1 -1
- package/dist/bundle.umd.js.LICENSE.txt +1 -1
- package/dist/button.cjs.js +1 -1
- package/dist/button.cjs.js.LICENSE.txt +1 -1
- package/dist/button.esm.js +1 -1
- package/dist/button.esm.js.LICENSE.txt +1 -1
- package/dist/card-getter.cjs.js.LICENSE.txt +1 -1
- package/dist/card-getter.esm.js.LICENSE.txt +1 -1
- package/dist/center.cjs.js +1 -1
- package/dist/center.cjs.js.LICENSE.txt +1 -1
- package/dist/center.esm.js +1 -1
- package/dist/center.esm.js.LICENSE.txt +1 -1
- package/dist/checkbox.cjs.js +1 -1
- package/dist/checkbox.cjs.js.LICENSE.txt +1 -1
- package/dist/checkbox.esm.js +1 -1
- package/dist/checkbox.esm.js.LICENSE.txt +1 -1
- package/dist/code.cjs.js +1 -1
- package/dist/code.cjs.js.LICENSE.txt +1 -1
- package/dist/code.esm.js +1 -1
- package/dist/code.esm.js.LICENSE.txt +1 -1
- package/dist/container.cjs.js +1 -1
- package/dist/container.cjs.js.LICENSE.txt +1 -1
- package/dist/container.esm.js +1 -1
- package/dist/container.esm.js.LICENSE.txt +1 -1
- package/dist/data-list.cjs.js +1 -1
- package/dist/data-list.cjs.js.LICENSE.txt +1 -1
- package/dist/data-list.esm.js +1 -1
- package/dist/data-list.esm.js.LICENSE.txt +1 -1
- package/dist/designer.cjs.js +1 -1
- package/dist/designer.cjs.js.LICENSE.txt +1 -1
- package/dist/designer.esm.js +1 -1
- package/dist/designer.esm.js.LICENSE.txt +1 -1
- package/dist/element-mapper.cjs.js +1 -1
- package/dist/element-mapper.cjs.js.LICENSE.txt +1 -1
- package/dist/element-mapper.esm.js +1 -1
- package/dist/element-mapper.esm.js.LICENSE.txt +1 -1
- package/dist/finalresult.esm.js +1 -1
- package/dist/finalresult.esm.js.LICENSE.txt +1 -1
- package/dist/flex-card.cjs.js +1 -1
- package/dist/flex-card.cjs.js.LICENSE.txt +1 -1
- package/dist/flex-card.esm.js +1 -1
- package/dist/flex-card.esm.js.LICENSE.txt +1 -1
- package/dist/flex-grid.cjs.js +1 -1
- package/dist/flex-grid.cjs.js.LICENSE.txt +1 -1
- package/dist/flex-grid.esm.js +1 -1
- package/dist/flex-grid.esm.js.LICENSE.txt +1 -1
- package/dist/flex-row.cjs.js +1 -1
- package/dist/flex-row.cjs.js.LICENSE.txt +1 -1
- package/dist/flex-row.esm.js +1 -1
- package/dist/flex-row.esm.js.LICENSE.txt +1 -1
- package/dist/floating-input.cjs.js +1 -1
- package/dist/floating-input.cjs.js.LICENSE.txt +1 -1
- package/dist/floating-input.esm.js +1 -1
- package/dist/floating-input.esm.js.LICENSE.txt +1 -1
- package/dist/free.cjs.js +1 -1
- package/dist/free.cjs.js.LICENSE.txt +1 -1
- package/dist/free.esm.js +1 -1
- package/dist/free.esm.js.LICENSE.txt +1 -1
- package/dist/horizontal-scroller.cjs.js.LICENSE.txt +1 -1
- package/dist/horizontal-scroller.esm.js.LICENSE.txt +1 -1
- package/dist/image-picker.cjs.js +1 -1
- package/dist/image-picker.cjs.js.LICENSE.txt +1 -1
- package/dist/image-picker.esm.js +1 -1
- package/dist/image-picker.esm.js.LICENSE.txt +1 -1
- package/dist/image.cjs.js +1 -1
- package/dist/image.cjs.js.LICENSE.txt +1 -1
- package/dist/image.esm.js +1 -1
- package/dist/image.esm.js.LICENSE.txt +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.LICENSE.txt +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.LICENSE.txt +1 -1
- package/dist/keyframe-animation.cjs.js.LICENSE.txt +1 -1
- package/dist/keyframe-animation.esm.js.LICENSE.txt +1 -1
- package/dist/link-getter.cjs.js +1 -1
- package/dist/link-getter.cjs.js.LICENSE.txt +1 -1
- package/dist/link-getter.esm.js +1 -1
- package/dist/link-getter.esm.js.LICENSE.txt +1 -1
- package/dist/link.cjs.js +1 -1
- package/dist/link.cjs.js.LICENSE.txt +1 -1
- package/dist/link.esm.js +1 -1
- package/dist/link.esm.js.LICENSE.txt +1 -1
- package/dist/meta-adder.cjs.js +1 -1
- package/dist/meta-adder.cjs.js.LICENSE.txt +1 -1
- package/dist/meta-adder.esm.js +1 -1
- package/dist/meta-adder.esm.js.LICENSE.txt +1 -1
- package/dist/modal-2025.cjs.js +1 -1
- package/dist/modal-2025.cjs.js.LICENSE.txt +1 -1
- package/dist/modal-2025.esm.js +1 -1
- package/dist/modal-2025.esm.js.LICENSE.txt +1 -1
- package/dist/multiswitcher.cjs.js +1 -1
- package/dist/multiswitcher.cjs.js.LICENSE.txt +1 -1
- package/dist/multiswitcher.esm.js +1 -1
- package/dist/multiswitcher.esm.js.LICENSE.txt +1 -1
- package/dist/new-nav-bar.cjs.js +1 -1
- package/dist/new-nav-bar.cjs.js.LICENSE.txt +1 -1
- package/dist/new-nav-bar.esm.js +1 -1
- package/dist/new-nav-bar.esm.js.LICENSE.txt +1 -1
- package/dist/picker.cjs.js +1 -1
- package/dist/picker.cjs.js.LICENSE.txt +1 -1
- package/dist/picker.esm.js +1 -1
- package/dist/picker.esm.js.LICENSE.txt +1 -1
- package/dist/progress.cjs.js +1 -1
- package/dist/progress.cjs.js.LICENSE.txt +1 -1
- package/dist/progress.esm.js +1 -1
- package/dist/progress.esm.js.LICENSE.txt +1 -1
- package/dist/radio.cjs.js +1 -1
- package/dist/radio.cjs.js.LICENSE.txt +1 -1
- package/dist/radio.esm.js +1 -1
- package/dist/radio.esm.js.LICENSE.txt +1 -1
- package/dist/range.cjs.js +1 -1
- package/dist/range.cjs.js.LICENSE.txt +1 -1
- package/dist/range.esm.js +1 -1
- package/dist/range.esm.js.LICENSE.txt +1 -1
- package/dist/scroll-video.cjs.js.LICENSE.txt +1 -1
- package/dist/scroll-video.esm.js.LICENSE.txt +1 -1
- package/dist/side-bar.cjs.js +1 -1
- package/dist/side-bar.cjs.js.LICENSE.txt +1 -1
- package/dist/side-bar.esm.js +1 -1
- package/dist/side-bar.esm.js.LICENSE.txt +1 -1
- package/dist/side-nav-bar.cjs.js +1 -1
- package/dist/side-nav-bar.cjs.js.LICENSE.txt +1 -1
- package/dist/side-nav-bar.esm.js +1 -1
- package/dist/side-nav-bar.esm.js.LICENSE.txt +1 -1
- package/dist/simple-bar.cjs.js +1 -1
- package/dist/simple-bar.cjs.js.LICENSE.txt +1 -1
- package/dist/simple-bar.esm.js +1 -1
- package/dist/simple-bar.esm.js.LICENSE.txt +1 -1
- package/dist/slider-2025.cjs.js +1 -1
- package/dist/slider-2025.cjs.js.LICENSE.txt +1 -1
- package/dist/slider-2025.esm.js +1 -1
- package/dist/slider-2025.esm.js.LICENSE.txt +1 -1
- package/dist/spacer.cjs.js +1 -1
- package/dist/spacer.cjs.js.LICENSE.txt +1 -1
- package/dist/spacer.esm.js +1 -1
- package/dist/spacer.esm.js.LICENSE.txt +1 -1
- package/dist/stack.cjs.js +1 -1
- package/dist/stack.cjs.js.LICENSE.txt +1 -1
- package/dist/stack.esm.js +1 -1
- package/dist/stack.esm.js.LICENSE.txt +1 -1
- package/dist/stacker.cjs.js.LICENSE.txt +1 -1
- package/dist/stacker.esm.js.LICENSE.txt +1 -1
- package/dist/table.cjs.js +1 -1
- package/dist/table.cjs.js.LICENSE.txt +1 -1
- package/dist/table.esm.js +1 -1
- package/dist/table.esm.js.LICENSE.txt +1 -1
- package/dist/text-field.cjs.js +1 -1
- package/dist/text-field.cjs.js.LICENSE.txt +1 -1
- package/dist/text-field.esm.js +1 -1
- package/dist/text-field.esm.js.LICENSE.txt +1 -1
- package/dist/text.cjs.js +1 -1
- package/dist/text.cjs.js.LICENSE.txt +1 -1
- package/dist/text.esm.js +1 -1
- package/dist/text.esm.js.LICENSE.txt +1 -1
- package/dist/theme.cjs.js.LICENSE.txt +1 -1
- package/dist/theme.esm.js.LICENSE.txt +1 -1
- package/dist/transform-anim.cjs.js.LICENSE.txt +1 -1
- package/dist/transform-anim.esm.js.LICENSE.txt +1 -1
- package/dist/ulist.cjs.js +1 -1
- package/dist/ulist.cjs.js.LICENSE.txt +1 -1
- package/dist/ulist.esm.js +1 -1
- package/dist/ulist.esm.js.LICENSE.txt +1 -1
- package/dist/video.cjs.js +1 -1
- package/dist/video.cjs.js.LICENSE.txt +1 -1
- package/dist/video.esm.js +1 -1
- package/dist/video.esm.js.LICENSE.txt +1 -1
- package/dist/wrap.cjs.js +1 -1
- package/dist/wrap.cjs.js.LICENSE.txt +1 -1
- package/dist/wrap.esm.js +1 -1
- package/dist/wrap.esm.js.LICENSE.txt +1 -1
- package/dist/zoom-card.cjs.js +1 -1
- package/dist/zoom-card.cjs.js.LICENSE.txt +1 -1
- package/dist/zoom-card.esm.js +1 -1
- package/dist/zoom-card.esm.js.LICENSE.txt +1 -1
- package/layout/animator.js +30 -2
- package/layout/audio.js +1 -1
- package/layout/audionew.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/button.js +1 -1
- package/layout/center.js +1 -1
- package/layout/checkbox.js +1 -1
- package/layout/circle.js +1 -1
- package/layout/code.js +1 -1
- package/layout/container.js +1 -1
- package/layout/dropdown-2025.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/form-components/custom.js +1 -1
- package/layout/form-components/data-list.js +1 -1
- package/layout/form-components/floating-input.js +1 -1
- package/layout/form-components/form-all.js +1 -1
- package/layout/form-components/form.js +1 -1
- package/layout/form-components/image-picker.js +1 -1
- package/layout/form-components/picker.js +44 -9
- 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-switcher.js +1 -1
- package/layout/grid.js +1 -1
- package/layout/horizontal-scroller.js +1 -1
- package/layout/image.js +1 -1
- package/layout/index.js +1 -1
- package/layout/link.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/morph.js +1 -1
- package/layout/multiswitcher.js +1 -1
- package/layout/nav-bar.js +1 -1
- package/layout/nav-factor/custom-div.js +1 -1
- package/layout/new-nav-bar.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/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/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/wrap.js +1 -1
- package/layout/zoom-card.js +1 -1
- package/lib/agent-surface.js +1 -1
- package/lib/card-getter.js +1 -1
- package/lib/check-page.js +1 -1
- package/lib/codegen.js +1 -1
- package/lib/data.js +1 -1
- package/lib/designer.js +8 -2
- package/lib/element-mapper.js +6 -2
- package/lib/element-params.generated.js +1 -1
- package/lib/keyframe-animation.js +1 -1
- package/lib/link-getter.js +1 -1
- package/lib/morph-node.js +1 -1
- package/lib/normalize-spec.js +1 -1
- package/lib/parse-html.js +1 -1
- package/lib/raster-inspect.js +1 -1
- package/lib/raster-ops.js +1 -1
- package/lib/raster-presets.js +1 -1
- package/lib/resolve-refs.js +1 -1
- package/lib/scroll-video.js +1 -1
- package/lib/seo.js +1 -1
- package/lib/stacker.js +1 -1
- package/lib/suggest.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/transform-anim.js +1 -1
- package/lib/transition.js +1 -1
- package/lib/validate-nodes.js +1 -1
- package/lib/webmcp-adapter.js +1 -1
- package/package.json +1 -1
- package/schema.json +64 -35
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see element-mapper.esm.js.LICENSE.txt */
|
|
2
|
-
import{RASTER_OP_NAMES as t,applyRasterPipeline as e}from"../lib/raster-ops.js";var r={};function n(t){return n="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},n(t)}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var i="nodality.theme.mode",o="nodality:theme",s={mode:function(){try{var t=localStorage.getItem(i);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"===n(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"===n(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(i,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(o,e);try{t(this.mode,this.current)}catch(t){}return function(){return document.removeEventListener(o,e)}},_broadcast:function(){"undefined"!=typeof document&&document.dispatchEvent(new CustomEvent(o,{detail:{mode:this.mode,tokens:this.current}}))}};function a(){return new RegExp('"([A-Za-z_$][A-Za-z0-9_$]*)"\\s*:',"g")}function l(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4;return"string"!=typeof(e=JSON.stringify(t,null,r))?e:e.replace(a(),"$1:")}function c(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,s,a=[],l=!0,c=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(t,e)||f(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 u(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=f(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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,s=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw o}}}}function f(t,e){if(t){if("string"==typeof t)return d(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(t,e):void 0}}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function h(t){return h="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},h(t)}function p(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,y(n.key),n)}}function y(t){var e=function(t){if("object"!=h(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=h(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==h(e)?e:e+""}var m=function(){function t(){var e,r,n,i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,n=function(t){if(t.transform||t.op){var e=t.op;t.transform||(e=t.op),e.duration||(e.duration="3s-ease-in-out"),i.setDefault=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0px";return 0===t.length?e+" ":t};var r=function(){var r="",n="",o="",s="",a="",l="",c="",u="",f="";if(0!==e.values.length){e.values.forEach(function(t){t.startsWith("tx:")&&(r=t.replace("tx:","")),t.startsWith("ty:")&&(n=t.replace("ty:","")),t.startsWith("tz:")?o=t.replace("tz:",""):t.startsWith("scale(")?s=t:t.startsWith("skew(")?a=t:t.startsWith("rotate(")?l=function(t){var e=t.match(/rotate\(([^)]+)\)/);if(!e)return t;var r=e[1].split(",").map(function(t){return t.trim()});return 1===r.length?"rotate(".concat(r[0],")"):2===r.length?"rotateX(".concat(r[0],") rotateY(").concat(r[1],")"):3===r.length?"rotateX(".concat(r[0],") rotateY(").concat(r[1],") rotate(").concat(r[2],")"):t}(t):t.startsWith("perspective(")?c=t:t.startsWith("matrix(")?u=t:t.startsWith("opacity:")&&(f=t.replace("opacity:",""))}),r=i.setDefault(r),n=i.setDefault(n),o=i.setDefault(o);var d="";if("0px"!=n&&"0px"!=r&&"0px"!=o?d+="translate3d(".concat(r,", ").concat(n,", ").concat(o,")"):"0px"==n&&"0px"==r||(d+="translate(".concat(r,", ").concat(n,")")),s&&(d+=" ".concat(s)),l&&(d+=" ".concat(l)),a&&(d+=" ".concat(a)),c&&(d+=" ".concat(c)),u&&(d+=" ".concat(u)),d){if(t.op.duration){var h=t.op.duration.replace(/^(\d+)(s)-/,function(t,e,r){return e/2+r+" "}),p="transform ".concat(h,", opacity ").concat(h);i.res.style.transition=p}else i.res.style.transition="transform 3s ease-in-out, opacity 3s ease-in-out";t.op.static&&(i.res.style.transition=""),(i.blastTarget||i.res).style.transform=d,i.res.style.opacity=f}else console.warn("[nodality] transform produced no geometric value - check `values`")}};e.on?i.res.addEventListener(e.on,function(){e.delay?setTimeout(function(){r()},e.delay):r()}):i._on(window,"load",function(){e.delay?setTimeout(function(){r()},e.delay):r()});var n=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) "),i.res.style.opacity="1"}),t&&(i.res.style.transform=t.trim())};if(e.on)i.res.addEventListener("mouseout",function(){e.keep||n()});else{var o=1e3*parseFloat(e.duration),s=e.closeAfter?e.closeAfter:0;setTimeout(function(){e.keep||n()},o/2+s)}e.hardCSS&&(i.res.style.transform=e.hardCSS)}else console.warn("[nodality] reactOnTransform: unrecognised transform descriptor - ignored")},(r=y(r="reactOnTransform"))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,this.state={isExpanded:!1,isMovedUp:!1,isMovedDown:!1},this.openedElements=new WeakMap,"undefined"!=typeof document&&(this._themeUnsub=s.subscribe(function(t){return i._applyTheme(t)}),Promise.resolve().then(function(){return i._applyTheme(s.mode)}))}return r=t,n=[{key:"rasterize",value:function(t){var r=this;if(t&&0!==t.length&&!this._rasterHandle&&!this._rasterCancelled&&"undefined"!=typeof document&&"undefined"!=typeof setTimeout){var n=0,i=function(){if(!r._rasterHandle&&!r._rasterCancelled){if(r.res&&r.res.isConnected){try{r._rasterHandle=e(r.res,t)}catch(t){return void console.warn("[nodality] raster pipeline skipped:",t)}if(r._rasterHandle)return}++n<80&&(r._rasterTimer=setTimeout(i,50))}};this._rasterTimer=setTimeout(i,0),this._track(function(){return clearTimeout(r._rasterTimer)})}}},{key:"isHidden",value:function(t){t&&(this.res.style.display="none")}},{key:"theme",value:function(t){var e=this;return t&&"object"===h(t)?(this._themeMap=t,this._applyTheme(s.mode),this._themeUnsub||(this._themeUnsub=s.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,r,n){return t&&"function"==typeof t.addEventListener?(t.addEventListener(e,r,n),this._track(function(){return t.removeEventListener(e,r,n)}),r):r}},{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=u(this._disposables);try{for(e.s();!(t=e.n()).done;){var r=t.value;try{r()}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 r in e)this.res.style[r]=e[r]}else{var n=s.defaults&&s.defaults[t];if(n)for(var i in this._themeOriginal||(this._themeOriginal={}),n)i in this._themeOriginal||(this._themeOriginal[i]=this.res.style[i]||""),this._themeOriginal[i]||(this.res.style[i]=n[i])}}},{key:"vars",value:function(t){if(!t||"object"!==h(t))return this;for(var e in t)this.res.style.setProperty(e,String(t[e]));return this}},{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",color:"color",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",cols:"gridTemplateColumns",rows:"gridTemplateRows",areas:"gridTemplateAreas",area:"gridArea",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 r in e)null!=t[r]&&(this.res.style[e[r]]=t[r]);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.borderObj&&t.borderObj.width&&this.borderObj(t.borderObj),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.vars&&this.vars(t.vars),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.center&&this.center(t.center,{display:t.disp||t.display,flexDirection:t.flexDir||t.flexDirection}),t.transform&&"object"===h(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 r=t.border.width;this.res.style.border=r?"".concat(r,"px solid transparent"):"1px solid transparent"}var n=this.options&&this.options.borderObj;return n&&(this.res.style.border="".concat(n.width,"px solid ").concat(n.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 r,n=t.border.width,i=null!==(r=t.border.color)&&void 0!==r?r:"#2ECC71";e.res.style.border=n?"".concat(n,"px solid ").concat(i):"1px solid #2ECC71"}if(null!=t.scale||null!=t.transform){var o=e.prevTransform?"".concat(e.prevTransform," "):"",s=[];null!=t.transform&&s.push(t.transform),null!=t.scale&&s.push("scale(".concat(t.scale,")")),e.res.style.transform="".concat(o).concat(s.join(" "))}null!=t.boxShadow&&(e.res.style.boxShadow=t.boxShadow)},this}},{key:"onScroll",value:function(t){var e=this,r=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"}},n=function(t){var r=t&&null!=t.tx?t.tx:"0px",n=t&&null!=t.ty?t.ty:"0px";e.res.style.transform="translate3d(".concat(r,", ").concat(n,", 0)")};"opacity"===t.value?this.res.style.opacity=t.valMin:"scale"===t.value?this.res.style.transform="scale(".concat(t.valMin,")"):"trn"===t.value&&n(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={},s=["tx","ty"],a=0;a<s.length;a++){var l=s[a],c=t.valMin&&null!=t.valMin[l],u=t.valMax&&null!=t.valMax[l];if(c||u){var f=r(c?t.valMin[l]:u?t.valMax[l]:"0px"),d=r(u?t.valMax[l]:c?t.valMin[l]:"0px"),h=e.smartRange(window.scrollY,{min:t.from,max:t.to},{min:f.num,max:d.num});o[l]="".concat(h).concat(f.unit)}}n(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:"_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,r){var n=this;this.options=r;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"],s={flexDir:"flexDirection",dir:"flexDirection",justify:"justifyContent",align:"alignItems",wrap:"flexWrap",bg:"background",radius:"borderRadius",z:"zIndex",exact:"fontSize"},a=function(t){var e=s[t]||t;return"undefined"==typeof console||"function"==typeof n[t]||e in n.res.style||console.warn('[nodality] resprop: "'.concat(t,'" is not a CSS property or component method — ignored.')+(s[t]?"":" Did you mean one of: ".concat(Object.keys(s).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 u=new Set;e.forEach(function(t){Object.keys(t).forEach(function(t){o.includes(t)||"range"===t||u.add(t)})}),u.forEach(function(t){void 0===l[t]&&(l[t]=n.options[t]||"initial")}),this._responsiveTasks=this._responsiveTasks||[],this._responsiveTasks.push(function(){for(var r=t.viewportWidth(),i=l,s=0;s<e.length;s++){var f=e[s],d=c(f.range,2),h=d[0],p=d[1];if("default"!==f.breakpoint&&r>=h&&r<=p){i=f;break}}for(var y in u.forEach(function(t){if("keySet"===t){var e=l[t];e&&e.key&&(n.res.style[e.key]=e.value)}else n.res.style[a(t)]=l[t]}),i)if("exact"!==y){if(!o.includes(y)&&"range"!==y){var m=i[y];"keySet"===y&&m&&m.key?n.res.style[m.key]=m.value:"function"==typeof n[y]?n[y](m):n.res.style[a(y)]=m}}else n.res.style.fontSize=i[y]}),this._setupResponsiveManager()}},{key:"respad",value:function(e){var r=this,n={default:[0,1e5],xs:[0,575],sm:[576,767],md:[768,991],lg:[992,1199],xl:[1200,1399],xxl:[1400,1e5]};e.forEach(function(t){void 0!==n[t.breakpoint]?t.range=n[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:n.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 n=t.viewportWidth(),o=i,s=0;s<e.length;s++){var a=e[s],l=c(a.range,2),u=l[0],f=l[1];if("default"!==a.breakpoint&&n>=u&&n<=f){o=a;break}}var d=void 0!==o.values?o.values:i.values;null!=d&&r.pad(d)}),this._setupResponsiveManager()}},{key:"resmar",value:function(e){var r=this,n={default:[0,1e5],xs:[0,575],sm:[576,767],md:[768,991],lg:[992,1199],xl:[1200,1399],xxl:[1400,1e5]};e.forEach(function(t){void 0!==n[t.breakpoint]?t.range=n[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:n.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 n=t.viewportWidth(),o=i,s=0;s<e.length;s++){var a=e[s],l=c(a.range,2),u=l[0],f=l[1];if("default"!==a.breakpoint&&n>=u&&n<=f){o=a;break}}var d=void 0!==o.values?o.values:i.values;null!=d&&r.mar(d)}),this._setupResponsiveManager()}},{key:"color",value:function(t){return this.res.style.color=t,this}},{key:"onTap",value:function(t){return this.res.addEventListener("click",t),this}},{key:"setArea",value:function(t){return this.res.style.gridArea=t,this}},{key:"font",value:function(t){return this.res.style.fontFamily=t,this}},{key:"radius",value:function(t){return this.res.style.borderRadius="number"==typeof t?"".concat(t,"px"):t,this}},{key:"width",value:function(t){return this.res.style.width=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:"round",value:function(t){return this.deprecatedOption("round()","radius()"),this.radius(t)}},{key:"toCSS",value:function(){return this.css}},{key:"toHTMLA",value:function(){return this.html}},{key:"background",value:function(t){return this.res.style.background=t,this}},{key:"deprecatedOption",value:function(t,e){return console.error("nodality: `".concat(t,"` is deprecated — use `").concat(e,"` instead.")),this}},{key:"center",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.res.style,n=r.display||e.display||"",i=r.flexDirection||e.flexDirection||"",o=!0===t||"both"===t||"x"===t,s=!0===t||"both"===t||"y"===t;if(n.includes("grid"))return o&&(r.justifyItems="center",r.justifyContent="center"),s&&(r.alignItems="center",r.alignContent="center"),this;n.includes("flex")||(r.display="flex"),r.flexDirection||(r.flexDirection=i||"column");var a=(r.flexDirection||"column").startsWith("column");return(a?s:o)&&(r.justifyContent="center"),(a?o:s)&&(r.alignItems="center"),this}},{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 r=Object.keys(t[e]),n=0;n<r.length;n++)for(var i=r[n],o=t[e][i],s=0;s<i.length;s++)switch(i[s]){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 r=Object.keys(t[e]),n=0;n<r.length;n++){for(var i=r[n],o=t[e][i],s=0;s<i.length;s++)switch(i[s]){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,r){t<e.min&&(t=e.min),t>e.max&&(t=e.max);var n=(t-e.min)/(e.max-e.min);return e.min>e.max&&(n=(t-e.max)/(e.min-e.max)),r.min+(r.max-r.min)*n}},{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 r=document.createTextNode(this.text);this.res.appendChild(r),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 n=document.createTextNode(this.text);this.res.appendChild(n),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 s=document.createTextNode(this.text);this.res.appendChild(s),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,r=null!==(e=t.type)&&void 0!==e?e:"solid";return this.res.style.border="".concat(t.width," ").concat(r," ").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,r,n){var i=this;this.ap=!1,this.cta=0,this.once=!1;var o,s=u(e);try{for(s.s();!(o=s.n()).done;){var a=o.value;a.range||(a.range=["0px","999999px"])}}catch(t){s.e(t)}finally{s.f()}e.sort(function(t,e){return parseInt(t.range[0])-parseInt(e.range[0])});var l=function(o){var s=t.viewportWidth(),a=[],l=[];i.resCopy=i.res,i.storedQueries=e.map(function(t){return t.target}).filter(function(t){return null!=t});var f,d=u(e);try{for(d.s();!(f=d.n()).done;){var h=f.value;i.counterIndex++;var p=c(h.range,2),y=p[0],m=p[1],v=parseInt(y),b=parseInt(m),g=!0;if(h.target){g=!1;for(var w=0;w<h.target.length;w++){var k=function(t){return"string"==typeof t&&"#"===t.charAt(0)?t.slice(1):t};k(h.target[w])===k(r)&&(g=!0)}}s>=v&&s<=b&&g&&(a.push(h.log),l.push(h),h.op&&h.op.margin&&(i.useMargin=h.op.margin))}}catch(t){d.e(t)}finally{d.f()}if(n&&!n.includes("background")&&(i.res.style.background="",i.res.style.backgroundColor=""),i.res.style.textShadow="",n&&!n.includes("border")&&(i.res.style.border=""),n&&!n.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),a.includes("gradient"),(a.includes("gradient")||a.includes("shadow"))&&(i.res.style.position="relative"),a.includes("blast")){var O,x=l.filter(function(t){return"blast"===t.log})[0].op.color,S=null!==(O=l.filter(function(t){return"blast"===t.log})[0].op.width)&&void 0!==O?O:"1px";"FlexRowLayoutElement"===i.getType()||"LayoutWrapperElement"===i.getType()?(i.res.style.border="".concat("number"==typeof S?S+"px":S," 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"]=x,i.res.style["-webkit-text-stroke-width"]="".concat(S))}if(a.includes("filter")){var j=l.filter(function(t){return"filter"===t.log})[0].op.filter;i.res.style.filter=j}if(a.includes("background")&&(i.res.style.backgroundColor="green"),a.includes("gradient")&&i.globalGradient&&("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")),a.includes("shadow")){var C,E,P,T,A=i.options.shadow.op,_=null!==(C=A.steps)&&void 0!==C?C:1,R=null!==(E=A.colors)&&void 0!==E?E:["gray"],W=null!==(P=A.movements)&&void 0!==P?P:["3px","3px"],z=null!==(T=A.radius)&&void 0!==T?T:"3px";if(1===W.length&&(W=[W[0],W[0]]),"FlexRowLayoutElement"===i.getType()||"LayoutWrapperElement"===i.getType()){for(var I=[],L=0;L<_;L++){var M,N=null!==(M=R[L])&&void 0!==M?M:R[0],F=W[0],B=W[1];I.push("".concat(F," ").concat(B," ").concat(z," ").concat(N))}i.res.style.boxShadow=I.join(", ")}else{for(var D=[],H=0;H<_;H++){var J,$=null!==(J=R[H])&&void 0!==J?J:R[0],q=W[0],G=W[1];D.push("drop-shadow(".concat(q," ").concat(G," ").concat(z," ").concat($,")"))}i.res.style.filter=D.join(" ")}}if(a.includes("margin"))for(w=0;w<e.length;w++)if(e[w].op){var U=e[w].op.offsets;U&&void 0!==i.index&&(i.res.style.margin=U[Number(i.index)]+"px")}if(a.includes("spana")||a.includes("span")){var Q=document.createElement("div");if(Q.setAttribute("id","oroa"),Object.assign(Q.style,{position:"absolute",inset:"0",background:"linear-gradient(90deg, rgb(52,152,219), rgb(26,188,156))",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",pointerEvents:"none"}),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,r=i.prevText||"";if(t.op.parts.forEach(function(t){var n=t.text,o=t.style||{};if(e<r.length){var s=r.indexOf(n,e);if(s>e){var a=r.substring(e,s);i.res.appendChild(new i.constructor(a).setup({type:"span",id:o.id,animation:o.animation}).set({}).render())}e=s+n.length}var l=new i.constructor(n).setup({type:"span",id:o.id,animation:o.animation}).set(o).render();i.res.appendChild(l)}),e<r.length){var n=r.substring(e);i.res.appendChild(new i.constructor(n).setup({type:"span"}).set({}).render())}}})}else{var V=new i.constructor(i.prevText).set({}).render();i.prevText&&i.prevText.length>0&&o&&i.res.appendChild(V)}if(a.includes("animation")){if(i.options.animation&&!i.hasAnimated&&!i.options.animation.op.fireAt){i.hasAnimated=!0;var X=i.options.animation.op;i._on(window,"sidebar:open",function(){i.res.animate(X.keyframesOpen,X.openOptions)}),i._on(window,"sidebar:closed",function(){i.res.animate(X.keyframesClose,X.closeOptions)}),i.res.animate(X.keyframesClose,{duration:0,fill:"forwards"}),i.openTag&&i.closeTag&&(i._on(window,i.openTag,function(){i.res.animate(X.keyframesOpen,X.openOptions)}),i._on(window,i.closeTag,function(){i.res.animate(X.keyframesClose,X.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 Z=function(){window.scrollY>parseFloat(Y.fireAt)&&(i.res.animate(Y.keyframesOpen,Y.openOptions),window.removeEventListener("scroll",Z))};i._on(window,"scroll",Z)}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 tt=!1,et=new IntersectionObserver(function(t,e){t.forEach(function(t){t.isIntersecting&&!tt&&(tt=!0,i.res.animate(K.keyframesOpen,K.openOptions),e.disconnect())})});et.observe(i.res),i._track(function(){return et.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(a(),"$1:")}}],i=[{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&&p(r.prototype,n),i&&p(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function v(t){return v="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},v(t)}function b(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function g(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,w(n.key),n)}}function w(t){var e=function(t){if("object"!=v(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=v(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==v(e)?e:e+""}function k(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(k=function(){return!!t})()}function O(t,e,r,n){var i=x(S(1&n?t.prototype:t),e,r);return 2&n&&"function"==typeof i?function(t){return i.apply(r,t)}:i}function x(){return x="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=S(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},x.apply(null,arguments)}function S(t){return S=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},S(t)}function j(t,e){return j=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},j(t,e)}var C=function(){function t(e,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(t,e,r){return e=S(e),function(t,e){if(e&&("object"==v(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)}(t,k()?Reflect.construct(e,r||[],S(t).constructor):e.apply(t,r))}(this,t)).text=e,n.res=null,n.setup(r),n.code=[],n.elCSS=[],n.html=[],n.react=[],n.code.push('new Text("'.concat(n.text,'")')),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&&j(t,e)}(t,m),e=t,r=[{key:"toCode",value:function(){if(this.excludeFromCodeTrue)return[""];var t=l(Object.fromEntries(Object.entries(this.options).filter(function(t){var e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,s,a=[],l=!0,c=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return b(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?b(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.")}()}(t,2);return e[0],null!==e[1]})),4);return['new Text("'.concat(this.text,'").set(').concat(t,")")]}},{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:"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:"setClass",value:function(t){return this.res.setAttribute("class",t),this}},{key:"styled",value:function(t){return this.set(t),this}},{key:"removeQuotesFromFirstWord",value:function(t){return t.replace(a(),"$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){if(this.resCopy=this.res,this.options=e,O(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&&O(t,"setIndex",this,3)([e.index]),e.index&&(this.index=e.index),e.preffersId&&(this.preffersId=e.preffersId),O(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),O(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),O(t,"setClass",this,3)([this.options.class]),e.clampc&&this.clampCopy(e.clampc),e.absolute&&(this.res.style.position="absolute"),e.em&&this.em(e.em),e.fluid&&this.fluid(e.fluid),e.tag&&/^(h[1-6]|p)$/.test(String(e.tag))){var r=String(e.tag).toLowerCase();if(this.res&&this.res.tagName.toLowerCase()!==r){for(var n=document.createElement(r),i=0,o=Array.from(this.res.attributes);i<o.length;i++){var s=o[i];n.setAttribute(s.name,s.value)}for(;this.res.firstChild;)n.appendChild(this.res.firstChild);this.res=n}}return e.fluidc&&this.elCSS.push("font-family: ".concat(e.font,"; \n")),e.align&&(this.res.style.textAlign=e.align),e.breakWord&&(this.res.style.wordWrap="break-word"),e.center&&this.deprecatedOption("center on Text",'mar: "center"'),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 r=[],n=e.transform&&"object"===v(e.transform);if(e.stroke||e.gradient||e.span||e.backgroundOp||e.layout||e.shadow||e.animation||e.filtera||n){e.gradient&&(this.globalGradient=e.gradient.op.gradient,"radial"===e.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)")),e.stroke&&O(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,n?e.transform:void 0];i=i.filter(function(t){return null!=t});for(var o=0;o<i.length;o++)r.push({range:i[o].range,log:i[o].op.name,target:i[o].target,op:i[o].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"),this.chainReact(r,this.options.id,s)}}},{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),e.setAttribute("alt",void 0===t.alt?"":String(t.alt)),this.res.appendChild(e),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:"stringGen",value:function(t){for(var e="",r=0;r<t;r++)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 r=this.stringGen(1e3);return this.res.setAttribute("id",r),document.styleSheets[0].insertRule("#".concat(r,"::first-letter { color: green; font-size: 3em; padding: 0.1em }"),0),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 r=document.createTextNode(this.text);this.res.appendChild(r),this.res.style.fontSize="calc(1.525rem + 3.525vw)"}if("S3"===t){this.res=document.createElement("h3");var n=document.createTextNode(this.text);this.res.appendChild(n),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:"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:"responsive",value:function(t){var e=this;this.set=!1,this.setB=!1;var r=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 r(),window.addEventListener("resize",r),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 r=function(){for(var r=0;r<t.length;r++)t[r].width&&window.matchMedia("(min-width: ".concat(t[r].width,"px)")).matches&&(e.res.style.fontSize="".concat(t[r].size));window.matchMedia("(max-device-width: 415px)").matches&&(e.res.style.fontSize="".concat(t[t.length-1].mobile))};return r(),window.addEventListener("resize",r),this}},{key:"setup",value:function(t){var e;t?(e=document.createElement(t.type),void 0!==t.id&&null!==t.id&&e.setAttribute("id",t.id),"span"===t.type&&t.animation&&(e.style.position="relative",e.style.display="block")):e=document.createElement("p");var r=document.createTextNode(this.text);return e.appendChild(r),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:"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:"updating",value:function(t,e){var r=this.res,n=this.text;return Object.defineProperty(t,e,{set:function(t){var e=document.createTextNode(n.replace("$",t));r.replaceChild(e,r.childNodes[0])}}),this}},{key:"apply",value:function(t){var e=this,r=this.res.styles,n=function(){for(var n=0;n<t.length;n++){var i=t[n];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,r):window.matchMedia("(max-width: ".concat(i.max,"px)")).matches?Object.assign(e.res.style,i.styles):Object.assign(e.res.style,r)}};return n(),window.addEventListener("resize",n),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)}}],r&&g(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();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)}function P(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function T(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,A(n.key),n)}}function A(t){var e=function(t){if("object"!=E(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=E(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==E(e)?e:e+""}function _(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_=function(){return!!t})()}function R(t,e,r,n){var i=W(z(1&n?t.prototype:t),e,r);return 2&n&&"function"==typeof i?function(t){return i.apply(r,t)}:i}function W(){return W="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=z(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},W.apply(null,arguments)}function z(t){return z=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},z(t)}function I(t,e){return I=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},I(t,e)}var L=function(){function t(e,r,n,i){var o;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(o=function(t,e,r){return e=z(e),function(t,e){if(e&&("object"==E(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)}(t,_()?Reflect.construct(e,r||[],z(t).constructor):e.apply(t,r))}(this,t)).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&&I(t,e)}(t,m),e=t,r=[{key:"setType",value:function(t){t.url;var e=t.type,r=t.mode;if(this.code=[],"exact"===e){var n='new Image("'.concat(this.url,'", "exact")');this.code.push(n)}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,r,e),this}},{key:"hand",value:function(){return this.res.style.cursor="hand",this}},{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=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,s,a=[],l=!0,c=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return P(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?P(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.")}()}(t,2);return e[0],null!==e[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 r="";this.options=e;var n=e;n.onTap&&this.onTap(n.onTap);var i=e.isFull;if(i?this.image(e.url,"exact",i,"a"):this.setup(),"IMG"===this.res.tagName?e.url&&this.res.setAttribute("src",e.url):void 0!==e.alt&&(this.res.setAttribute("role","img"),this.res.setAttribute("aria-label",e.alt)),"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&&(r+=' 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(n),e.vtn&&(this.res.style.viewTransitionName=e.vtn),this.vtn=e.vtn,e.minHeight&&(this.res.style.minHeight=e.minHeight),e.index&&R(t,"setIndex",this,3)([e.index]),e.index&&(this.index=e.index),e.index&&(r+='\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&&(r+='\n objectFit: "'.concat(e.objectFit,'",')),e.objectPosition&&(this.res.style.objectPosition=e.objectPosition),e.objectPosition&&(r+='\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,r+="\n gpos: ".concat(this.removeQuotesFromFirstWord(JSON.stringify(e.gpos)),", ")),e.filtera){var o;o=Array.isArray(e.filtera)?n.filtera.filter(function(t){return"filter"===t.op.name})[0]:e.filtera;var s=this.removeQuotesFromFirstWord(JSON.stringify(o));r+="\n filtera: ".concat(s,", \n")}if(e.keySet&&this.keySet(e.keySet),e.stype&&this.setType(e.stype),e.isBackground&&(this.isBackground=e.isBackground),e.zIndex&&(r+='\n zIndex: "'.concat(e.zIndex,'", \n')),e.area&&this.setArea(e.area),e.area&&(r+='area: "'.concat(e.area,'", \n')),e.opacity&&(this.res.style.opacity=e.opacity),e.width&&(this.res.style.width=e.width),e.width&&(r+='width: "'.concat(e.width,'", ')),e.maxWidth&&(this.res.style.maxWidth=e.maxWidth),e.maxWidth&&(r+='maxWidth: "'.concat(e.maxWidth,'", ')),e.height&&(this.res.style.height=e.height),e.height&&(r+='height: "'.concat(e.height,'", ')),e.maxWidth&&this.maxWidth(e.maxWidth),e.maxWidth&&(r+='maxWidth: "'.concat(e.maxWidth,'", \n')),e.radius&&this.cornerRadius(e.radius),e.radius&&(r+='radius: "'.concat(e.radius,'", \n')),e.marginOp){var a=this.removeQuotesFromFirstWord(JSON.stringify(e.marginOp));r+="\n marginOp: ".concat(a,",")}if(e.clipPath&&this.clipPath(e.clipPath),e.clipPath&&(r+='clipPath: "'.concat(e.clipPath,'", \n')),n.stroke||n.gradient||n.span||n.backgroundOp||n.layout||n.marginOp||n.shadow||n.filtera||n.animation){n.gradient,n.gradient&&(this.globalGradient=n.gradient.op.gradient),n.stroke&&R(t,"setAny",this,3)([{globalBlast:"".concat(n.stroke.op.width," ").concat(n.stroke.op.color)}]);var l=[n.stroke,n.gradient,n.animation,n.span,n.backgroundOp,n.layout,n.marginOp,n.shadow,n.filtera,n.animation];l=l.filter(function(t){return null!=t});for(var c=[],u=0;u<l.length;u++)c.push({range:l[u].range,log:l[u].op.name,target:l[u].target,op:l[u].op});this.chainReact(c,this.options.id)}if(n.shadow){var f=n.shadow,d=this.removeQuotesFromFirstWord(JSON.stringify(f));r+="\n shadow: ".concat(d,",")}if(n.animation){var h=n.animation,p=this.removeQuotesFromFirstWord(JSON.stringify(h));r+="\n animation: ".concat(p,",")}var y="\n .set({".concat(r,"}) \n \n");return Object.keys(e).length>0?this.code.push(y):this.code.push(","),this}},{key:"setID",value:function(t){return null!=t&&this.res.setAttribute("id",t),this}},{key:"opacity",value:function(t){return this.res.style.opacity="".concat(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:"setClass",value:function(t){return this.res.setAttribute("class",t),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:"mobileWidth",value:function(){return window.matchMedia("(max-device-width: 415px)").matches&&(this.res.style.width="120%"),this}},{key:"image",value:function(t,e,r,n,i){var o=window.matchMedia("(max-device-width: 415px)"),s=document.createElement("div");return s.style.viewTransitionName=n,s.style.width="100%",s.style.height=this.options.height?this.options.height:"400px",i&&(s.style.gridColumn=i.gridColumn,s.style.gridRow=i.gridRow),o.matches&&(s.style.height="500"),s.style.backgroundImage="url(".concat(t,")"),s.style.backgroundPosition="center center",s.style.backgroundRepeat="no-repeat",s.style.backgroundSize="cover","uncover"===r&&(s.style.backgroundSize="contain"),"contain"===e&&(s.style.backgroundSize="contain"),this.res=s,this}},{key:"setup",value:function(){var t=document.createElement("img");return t.style.width="100%",t.src=this.url,this.res=t,this}},{key:"float",value:function(t){return this.res.style.float="".concat(t),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,r=function(){var r,n;if(window.matchMedia("(min-width: ".concat(t.at,")")).matches){e.res.style.width="".concat(t.width);var i=window.innerWidth/2-(n=r=t.width,(r.includes("%")||r.includes("px"))&&(n=n.substr(0,2)),(r.includes("%")?Number(n/100*window.innerWidth):r.includes("px")?Number(n):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 r(),window.addEventListener("resize",r),this}},{key:"width",value:function(t){return this.res.style.width=t,this.res.style.height="auto",this}},{key:"dimensions",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:"size",value:function(t,e){return this.deprecatedOption("size() on this component","dimensions(w, h)"),this.dimensions(t,e)}},{key:"frame",value:function(t){var e=t.width,r=t.height;return e&&r?(this.res.style.width=e,this.res.style.height=r):(this.res.style.width=e,this.res.style.height=e),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:"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)}}],r&&T(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();function M(t){return M="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},M(t)}function N(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function F(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,B(n.key),n)}}function B(t){var e=function(t){if("object"!=M(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=M(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==M(e)?e:e+""}function D(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(D=function(){return!!t})()}function H(t,e,r,n){var i=J($(1&n?t.prototype:t),e,r);return 2&n&&"function"==typeof i?function(t){return i.apply(r,t)}:i}function J(){return J="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=$(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},J.apply(null,arguments)}function $(t){return $=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},$(t)}function q(t,e){return q=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},q(t,e)}var G=function(){function t(e,r,n){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(i=function(t,e,r){return e=$(e),function(t,e){if(e&&("object"==M(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)}(t,D()?Reflect.construct(e,r||[],$(t).constructor):e.apply(t,r))}(this,t)).link=r,i.text=e,i.code=[],i.css=[],i.elCSS=[],i.html=[],i.res=null,i.stopEM=n,i.setup(),i.inlineBlock(),i.res.addEventListener("click",function(t){var e=i.link||i.res.getAttribute("href");if(e){var r=new URL(e,window.location.href).href,n=/^https?:\/\//i.test(r),o=r.startsWith("#"),s=/^[a-zA-Z]+:/.test(r);n||o||r.endsWith(".html")||s||(t.preventDefault(),"navigation"in window?navigation.navigate(r):(history.pushState({},"",r),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&&q(t,e)}(t,m),e=t,(r=[{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=l(Object.fromEntries(Object.entries(this.options).filter(function(t){var e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,s,a=[],l=!0,c=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return N(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?N(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.")}()}(t,2);return e[0],null!==e[1]})),4);return["new Link().set(".concat(t,")")]}},{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 r=document.createElement("a");t.options.vtn&&(r.style.viewTransitionName=t.options.vtn),r.setAttribute("href",t.options.url);var n=document.createElement("img");return t.options&&(n.style.width=t.options.size,t.options.radius&&(n.style.borderRadius=t.options.radius),n.setAttribute("src",t.options.img),t.options.pad&&(this.res.style.padding=t.options.pad),r.appendChild(n)),this.res=r,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(a(),"$1:")}},{key:"set",value:function(e){this.elCSS.push("text-decoration: none; \n"),this.options=e;var r="";e.onTap&&this.onTap(e.onTap),e.tags&&H(t,"setTags",this,3)([e.tags]),e.id&&this.res.setAttribute("id",e.id),e.id&&H(t,"setID",this,3)([e.id]),this.commonMethods(e),e.flex&&(this.res.style.display="flex"),e.fixMobileTap&&this.fixMobileTap(e.fixMobileTap);var n=this.removeQuotesFromFirstWord(JSON.stringify(e.pad));if(e.pad&&(r+="\n pad: ".concat(n,",")),e.preffersId&&(this.preffersId=e.preffersId),null!=e.preffersId&&(r+="\n preffersId: ".concat(e.preffersId,",")),e.class&&H(t,"setClass",this,3)([e.class]),e.class&&(r+='\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));r+="\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));H(t,"setAny",this,3)([{globalBlast:"1px ".concat(e.blastData.color)}]),e.blastData&&(r+="\n blastData: ".concat(o,","))}e.nowrap&&(this.res.style.whiteSpace="nowrap"),e.font&&this.font(e.font),e.font&&(r+='\n font: "'.concat(e.font,'",')),e.font&&this.elCSS.push('font-family: "'.concat(e.font,'"; \n')),e.fluidc&&this.fluidCopy(e.fluidc),e.fluidc&&(r+='\n fluidc: "'.concat(e.fluidc,'",')),e.clampc&&this.clampCopy(e.clampc),this.options.id&&(r+='\n id: "'.concat(this.options.id,'",')),e.align&&this.leftAlign(e.align),e.align&&(r+='\n align: "'.concat(e.align,'",')),e.type&&(this.res.style.display="block"),e.color&&this.color(e.color),e.color&&(r+='\n color: "'.concat(e.color,'",')),e.color&&this.elCSS.push('color: "'.concat(e.color,'"; \n')),e.background&&this.background(e.background);var s=this.removeQuotesFromFirstWord(JSON.stringify(e.background));e.background&&(r+="\n background: ".concat(s,",")),e.hover&&this.hover(e.hover);var a=this.removeQuotesFromFirstWord(JSON.stringify(e.hover));if(e.hover&&(r+="\n hover: ".concat(a,",")),e.blast&&(this.blastData=e.blast),e.bold&&(r+="\n bold: ".concat(e.bold,",")),e.block&&this.toBlock(),e.block&&(r+="\n block: ".concat(e.block,",")),e.radius&&(r+='\n radius: "'.concat(e.radius,'",')),e.width&&(r+='\n width: "'.concat(e.width,'",')),e.maxWidth&&this.maxWidth(e.maxWidth),e.url&&this.res.setAttribute("href",e.url),r+='\n url: "'.concat(e.url,'",'),e.text&&(this.res.textContent=e.text),r+='\n text: "'.concat(e.text,'",'),e.data){e.data&&this.appendImageAsChild(e.data,"20px");var l=this.removeQuotesFromFirstWord(JSON.stringify(e.data));e.data&&(r+="\n data: ".concat(l))}if(e.icon){this.addIcon(e.icon);var c=this.removeQuotesFromFirstWord(JSON.stringify(e.icon));r+="\n icon: ".concat(c,",")}if(e.shadow){var u=e.shadow,f=this.removeQuotesFromFirstWord(JSON.stringify(u));r+="\n shadow: ".concat(f,",")}if(e.stroke){var d=this.removeQuotesFromFirstWord(JSON.stringify(e.stroke));e.stroke&&(r+="\n stroke: ".concat(d,","))}if(e.backgroundOp){var h=this.removeQuotesFromFirstWord(JSON.stringify(e.backgroundOp));r+="\n backgroundOp: ".concat(h,",")}if(e.marginOp){var p=this.removeQuotesFromFirstWord(JSON.stringify(e.marginOp));r+="\n marginOp: ".concat(p,",")}if(e.gradient){var y=this.removeQuotesFromFirstWord(JSON.stringify(e.gradient));r+="\n gradient: ".concat(y,",")}if(e.animation){var m=this.removeQuotesFromFirstWord(JSON.stringify(e.animation));r+="\n animation: ".concat(m,",")}if(e.transform){var v=this.removeQuotesFromFirstWord(JSON.stringify(e.transform));r+="\n transform: ".concat(v,",")}if(e.blast){var b=this.removeQuotesFromFirstWord(JSON.stringify(e.blast));r+="\n blast: ".concat(b,",")}var g="new Link().set({".concat(r,"}) \n");this.code.push(g),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 w=[],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&&H(t,"setAny",this,3)([{globalBlast:"".concat(e.stroke.op.width," ").concat(e.stroke.op.color)}]);for(var O=0;O<k.length;O++)w.push({range:k[O].range,log:k[O].op.name,target:k[O].target,op:k[O].op});var x=[];e.borderObj&&x.push("border"),e.background&&x.push("background"),e.mar&&x.push("margin"),e.animation&&x.push("animation"),this.chainReact(w,e.id,x,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:"maxWidth",value:function(t){return this.res.style.maxWidth=t,this}},{key:"leftAlign",value:function(t){return this.res.style.textAlign=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:"color",value:function(t){return this.res.style.color=t,this}},{key:"newWindow",value:function(){return this.res.target="_new",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:"italic",value:function(){return this.res.style.fontStyle="italic",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:"em",value:function(t){var e=this,r=window.matchMedia("(max-device-width: 415px)"),n=function(){r.matches?e.res.style.fontSize="2em":e.res.style.fontSize="1em"};return n(),window.addEventListener("resize",n),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}}])&&F(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();function U(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,s,a=[],l=!0,c=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Q(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Q(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 Q(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function V(t){return V="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},V(t)}function X(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Y(n.key),n)}}function Y(t){var e=function(t){if("object"!=V(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=V(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==V(e)?e:e+""}function Z(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Z=function(){return!!t})()}function K(){return K="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=tt(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},K.apply(null,arguments)}function tt(t){return tt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},tt(t)}function et(t,e){return et=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},et(t,e)}var rt=function(){function t(e,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(t,e,r){return e=tt(e),function(t,e){if(e&&("object"==V(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)}(t,Z()?Reflect.construct(e,r||[],tt(t).constructor):e.apply(t,r))}(this,t)).code=[],n.saveEl=r,n.frs=e,n.res=null,n.setup(),n.responsive(),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&&et(t,e)}(t,m),e=t,r=[{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.pad([{a: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.deprecatedOption("toColumn","colat"),t.column&&this.makeCol(),t.colat&&t.colat&&this.toColumnAt(t.colat),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 r,n,i,o=[],s=e.transform&&"object"===V(e.transform);if(e.stroke||e.gradient||e.span||e.backgroundOp||e.layout||e.shadow||e.animation||e.filtera||s){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=t,n=this,"function"==typeof(i=K(tt(1&3?r.prototype:r),"setAny",n))?function(t){return i.apply(n,t)}:i)([{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,s?e.transform:void 0];a=a.filter(function(t){return null!=t});for(var l=0;l<a.length;l++)o.push({range:a[l].range,log:a[l].op.name,target:a[l].target,op:a[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"),this.chainReact(o,e.id,c)}}},{key:"toColumnAt",value:function(t){var e=this;if(!this.columnAlways){var r=function(){var r=window.matchMedia("(max-width: ".concat(t,")")),n=window.matchMedia("(max-device-width: 415px)");r.matches||n.matches?e.res.style.flexDirection="column":e.res.style.flexDirection="row"};r(),window.addEventListener("resize",r)}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:"toCode",value:function(){for(var t={},e=0,r=Object.entries(this.options||{});e<r.length;e++){var n=U(r[e],2),i=n[0],o=n[1];null!=o&&""!==o&&(t[i]=o)}var s=JSON.stringify(t,null,4).replace(a(),"$1:").replace(/"([^"]*)"/g,function(t,e){return e.includes("\n")?"`"+e.replace(/`/g,"\\`")+"`":'"'.concat(e,'"')}),l=(this.items||[]).map(function(t){return null!=t&&t.toCode?t.toCode():"/* element */"}).join(",\n ");return[["new FlexRow().set(".concat(s,")"),l?".items([\n ".concat(l,"\n])"):""].join("")]}},{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:"setClass",value:function(t){return 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:"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:"radius",value:function(t){return this.res.style.borderRadius="".concat(t,"px"),this}},{key:"shadow",value:function(t,e,r){return this.res.style.boxShadow="0px 1px 10px 0px rgb(145 145 145)",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 r=t[e].render();this.res.appendChild(r)}else this.res.appendChild(t[e]);if(null!=t[e]&&t[e].render instanceof Function){var n=t[e].render();this.res.appendChild(n),void 0!==t[e].toCode&&this.code.push(t[e].toCode().flatMap(function(t){return t}))}}return this}},{key:"responsive",value:function(t){var e=this,r=window.matchMedia("(max-device-width: 415px)");return window.innerWidth<t||r.matches?this.res.style.gridTemplateColumns="1fr":this.res.style.gridTemplateColumns="1fr 1fr",window.addEventListener("resize",function(){window.innerWidth<t||r.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)}}],r&&X(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();function nt(t){return nt="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},nt(t)}function it(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ot(n.key),n)}}function ot(t){var e=function(t){if("object"!=nt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=nt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==nt(e)?e:e+""}var st=function(){return t=function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.obj=e||{},this.items=r||[]},(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)"),r=window.matchMedia("(max-width: 600px)");(e.matches||r.matches)&&(t.style.marginTop="3rem");for(var n=0;n<this.items.length;n++){var i=this.items[n];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}}])&&it(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 lt(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return ct(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ct(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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,s=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw o}}}}function ct(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function ut(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ft(n.key),n)}}function ft(t){var e=function(t){if("object"!=at(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=at(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==at(e)?e:e+""}function dt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(dt=function(){return!!t})()}function ht(t){return ht=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ht(t)}function pt(t,e){return pt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},pt(t,e)}"undefined"!=typeof window&&(window.CustomDivRenderer=st);var yt=function(){function t(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),function(t,e,r){return e=ht(e),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)}(t,dt()?Reflect.construct(e,r||[],ht(t).constructor):e.apply(t,r))}(this,t)}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&&pt(t,e)}(t,m),e=t,(r=[{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 r=this.res.children[0];if(this.closed)if(r.style.overflowX="hidden",t.style.opacity=1,this.animate){this.ope=r.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 n,i=-1,o=lt(r.children);try{for(o.s();!(n=o.n()).done;){var s=n.value;if(i+=1,this.masterEL[i]){var a,l=lt(s.children);try{for(l.s();!(a=l.n()).done;){var c=a.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 r.style.display="none";else{r.style.overflowX="none";var f,d=-1,h=lt(r.children);try{for(h.s();!(f=h.n()).done;){var p=f.value;d+=1;var y,m=lt(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 b=this.masterEL[d].options.animation;if(b){var g=b.op.openOptions;g.delay||(g.delay=1),g.duration||(g.duration=300),v.animate(b.op.keyframesOpen,g)}}}}catch(t){m.e(t)}finally{m.f()}}}catch(t){h.e(t)}finally{h.f()}t.style.opacity=0,this.animate?(r.style.display="flex",this.opeClose=r.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)})):r.style.display="flex"}}},{key:"createToggleButton",value:function(t){var e=document.createElement("button");return e.textContent="☰",e.style.padding="10px 20px",e.style.minWidth="24px",e.style.minHeight="24px",e.style.lineHeight="1",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.textContent="×",e.style.fontSize="1.6rem",e.style.padding="10px 20px",e.style.minWidth="24px",e.style.minHeight="24px",e.style.lineHeight="1",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,r=document.createElement("div");r.style.display="flex",r.style.justifyContent="flex-end";var n=document.createElement("div");n.style.display="none",n.style.background=this.obj.background||"#1abc9c",n.style.height="100%",window.matchMedia("(max-device-width: 415px)").matches?n.style.width="100%":n.style.width=this.obj.width||"400px",n.style.position="fixed",n.style.right=0,this.animate&&(n.style.transform="translateX(100%)"),n.style.flexDirection="column",n.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)}),n.appendChild(o),r.appendChild(n),r.appendChild(i),r}},{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 r=this.masterEL[0].options.animation;if(r){var n,i=lt(this.res.children[0].children);try{for(i.s();!(n=i.n()).done;){var o,s=lt(n.value.children);try{for(s.s();!(o=s.n()).done;){var a=o.value;this.mappedIDS.includes(a.id)&&(r.op.closeOptions.delay=0,a.animate(r.op.keyframesClose,r.op.closeOptions))}}catch(t){s.e(t)}finally{s.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}}])&&ut(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();function mt(t){return mt="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},mt(t)}function vt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function bt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,gt(n.key),n)}}function gt(t){var e=function(t){if("object"!=mt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=mt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==mt(e)?e:e+""}function wt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(wt=function(){return!!t})()}function kt(t){return kt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},kt(t)}function Ot(t,e){return Ot=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ot(t,e)}var xt=function(){function t(){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(t,e,r){return e=kt(e),function(t,e){if(e&&("object"==mt(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)}(t,wt()?Reflect.construct(e,r||[],kt(t).constructor):e.apply(t,r))}(this,t)).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&&Ot(t,e)}(t,m),e=t,r=[{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,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,n=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(n,", 1fr)"),i.style.gridTemplateRows="repeat(".concat(r,", 1fr)"),i.style.width="100%",i.style.height="100vh";var o=t.map(function(t,e){return{row:Math.floor(r/2)+e,col:Math.floor(n/2)+e}});return t.forEach(function(i,s){var a=o[s],l=a.row,c=a.col,u=function(e){var r=0,n=0;return t.forEach(function(t,i){var s=t.weight,a=t.direction,l=o[e],c=o[i],u=l.col-c.col,f=l.row-c.row,d=s*(1/(Math.sqrt(u*u+f*f)+1));switch(a){case"L":r-=d;break;case"R":r+=d;break;case"U":n-=d;break;case"B":n+=d}}),{forceX:r,forceY:n}}(s),f=u.forceX,d=u.forceY;c=Math.max(1,Math.min(n,c+Math.round(f))),l=Math.max(1,Math.min(r,l+Math.round(d)));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,r=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return vt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?vt(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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,s=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw o}}}}(t);try{for(r.s();!(e=r.n()).done;){var n=e.value;this.res.appendChild(n.render())}}catch(t){r.e(t)}finally{r.f()}return this.storedPositions&&this.generateGridPositions(this.storedPositions),this}},{key:"toCode",value:function(){if(this.excludeFromCodeTrue)return[""];var t=l(this.options,4),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)}}],r&&bt(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();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 jt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ct(n.key),n)}}function Ct(t){var e=function(t){if("object"!=St(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=St(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==St(e)?e:e+""}function Et(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Et=function(){return!!t})()}function Pt(t){return Pt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Pt(t)}function Tt(t,e){return Tt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Tt(t,e)}var At=function(){function t(e){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(t,e,r){return e=Pt(e),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)}(t,Et()?Reflect.construct(e,r||[],Pt(t).constructor):e.apply(t,r))}(this,t)).url=e,r.res=null,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&&Tt(t,e)}(t,m),e=t,(r=[{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)}}])&&jt(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();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 Rt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Wt(n.key),n)}}function Wt(t){var e=function(t){if("object"!=_t(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=_t(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==_t(e)?e:e+""}function zt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(zt=function(){return!!t})()}function It(){return It="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Lt(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},It.apply(null,arguments)}function Lt(t){return Lt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Lt(t)}function Mt(t,e){return Mt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Mt(t,e)}var Nt=function(){function t(){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(t,e,r){return e=Lt(e),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)}(t,zt()?Reflect.construct(e,r||[],Lt(t).constructor):e.apply(t,r))}(this,t)).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&&Mt(t,e)}(t,m),e=t,r=[{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(a(),"$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 r,n,i,o=[],s=e.transform&&"object"===_t(e.transform);if(e.stroke||e.gradient||e.span||e.backgroundOp||e.layout||e.shadow||e.animation||e.filtera||s){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=t,n=this,"function"==typeof(i=It(Lt(1&3?r.prototype:r),"setAny",n))?function(t){return i.apply(n,t)}:i)([{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,s?e.transform:void 0];a=a.filter(function(t){return null!=t});for(var l=0;l<a.length;l++)o.push({range:a[l].range,log:a[l].op.name,target:a[l].target,op:a[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"),this.chainReact(o,e.id,c)}}},{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}}],r&&Rt(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();function Ft(t){return Ft="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},Ft(t)}function Bt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Dt(n.key),n)}}function Dt(t){var e=function(t){if("object"!=Ft(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Ft(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ft(e)?e:e+""}function Ht(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ht=function(){return!!t})()}function Jt(t){return Jt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Jt(t)}function $t(t,e){return $t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},$t(t,e)}var qt=function(){function t(e){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(t,e,r){return e=Jt(e),function(t,e){if(e&&("object"==Ft(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)}(t,Ht()?Reflect.construct(e,r||[],Jt(t).constructor):e.apply(t,r))}(this,t))._noTheme=!0,r.res=null,r.st=e,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&&$t(t,e)}(t,m),e=t,(r=[{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 r=t[e].render();r.style.gridColumn=1,r.style.gridRow=1,this.res.appendChild(r)}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)}}])&&Bt(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();function Gt(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Qt(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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,s=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw o}}}}function Ut(t){return Ut="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},Ut(t)}function Qt(t,e){if(t){if("string"==typeof t)return Vt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Vt(t,e):void 0}}function Vt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Xt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Yt(n.key),n)}}function Yt(t){var e=function(t){if("object"!=Ut(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Ut(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ut(e)?e:e+""}function Zt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Zt=function(){return!!t})()}function Kt(){return Kt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=te(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},Kt.apply(null,arguments)}function te(t){return te=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},te(t)}function ee(t,e){return ee=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ee(t,e)}var re=function(){function t(e){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(t,e,r){return e=te(e),function(t,e){if(e&&("object"==Ut(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)}(t,Zt()?Reflect.construct(e,r||[],te(t).constructor):e.apply(t,r))}(this,t)).res=null,r.setup(e),r.code=[],r.isLast=!1,r.constrObj=e,r.code.push("\n new Wrapper() \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&&ee(t,e)}(t,m),e=t,r=[{key:"toCode",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.code=[],this.excludeFromCodeTrue)return[""];var r=" ".repeat(e),n="".concat(r,'new Wrapper("').concat(this.constrObj,'")');if(this.constrObj||(n="".concat(r,"new Wrapper()")),Object.keys(this.obj).length){var i=l(Object.fromEntries(Object.entries(this.obj).filter(function(t){var e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,s,a=[],l=!0,c=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(t,e)||Qt(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.")}()}(t,2);return e[0],null!==e[1]})),2);n+="\n".concat(r," .set(").concat(i,")")}return null!==(t=this.items)&&void 0!==t&&t.length&&(n+="\n".concat(r," .add([\n")+this.items.map(function(t){return t.toCode(e+4)}).join(",\n")+"\n".concat(r," ])")),[n+="\n".concat(r)]}},{key:"getType",value:function(){return"LayoutWrapperElement"}},{key:"set",value:function(e){this.obj=e,this.commonMethods(e),e.onTap&&this.onTap(e.onTap);var r=".set({";e.isHidden&&this.isHidden(e.isHidden),e.scale&&(this.res.style.scale=e.scale),e.scale&&(r+="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.gpos&&this.gpos(e.gpos);var n,i,o,s=[],a=e.transform&&"object"===Ut(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&&(n=t,i=this,"function"==typeof(o=Kt(te(1&3?n.prototype:n),"setAny",i))?function(t){return o.apply(i,t)}:o)([{globalBlast:"".concat(e.stroke.op.width," ").concat(e.stroke.op.color)}]),e.span&&(e.span.prevText=this.text);var l=[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];l=l.filter(function(t){return null!=t});for(var c=0;c<l.length;c++)s.push({range:l[c].range,log:l[c].op.name,target:l[c].target,op:l[c].op});var u=[];e.borderObj&&u.push("border"),e.background&&u.push("background"),e.mar&&u.push("margin"),e.animation&&u.push("animation"),e.span&&u.push("span"),a&&u.push("transform"),e.gradient&&u.push("gradient"),e.blast,this.options=e,this.chainReact(s,this.options.id,u)}if(e.centerColumn&&this.deprecatedOption("centerColumn",'center: "x"'),e.mboth&&(this.deprecatedOption("mboth",'mar: "center"'),this.mar("center")),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.simpleCenter&&this.deprecatedOption("simpleCenter","center: true"),e.filter&&(this.res.style.backdropFilter="blur(3px)"),e.radius&&this.corner(e.radius),e.radius&&(r+='\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&&(r+='\n width: "'.concat(e.width,'",')),e.overflow&&(r+='\n overflow: "'.concat(e.overflow,'",')),e.height&&this.heightNoAuto(e.height),e.height&&(r+='\n height: "'.concat(e.height,'",')),e.align&&this.flexAlign(e.align),e.align&&(r+='\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&&(r+='font: "'.concat(e.font,'",')),e.maxWidth&&this.maxWidth(e.maxWidth),e.flexCenter&&this.deprecatedOption("flexCenter",'center: "y"'),e.color&&this.color(e.color),e.background&&this.background(e.background),e.background&&(r+='background: "'.concat(e.background,'",')),e.weight&&this.weight(e.weight),e.area&&this.setArea(e.area),e.area&&(r+='area: "'.concat(e.area,'"')),e.column&&this.makeCol(),e.column&&(r+='\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&&(r+='\n flexDir: "'.concat(e.flexDir,'",')),e.center&&(r+="center: ".concat(JSON.stringify(e.center),",")),e.zIndex&&(this.res.style.zIndex=e.zIndex),e.transform&&"object"===Ut(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 f=this.removeQuotesFromFirstWord(JSON.stringify(e.stretch));r+="\n stretch: ".concat(f,",")}for(var d in e)if("margin"===d){var h=e[d];if(Array.isArray(h)&&h.length>0){var p,y=Gt(h);try{for(y.s();!(p=y.n()).done;){var m=p.value;m.hasOwnProperty("top")&&(this.res.style.marginTop=m.top),m.hasOwnProperty("right")&&(this.res.style.marginRight=m.right),m.hasOwnProperty("bottom")&&(this.res.style.marginBottom=m.bottom),m.hasOwnProperty("left")&&(this.res.style.marginLeft=m.left)}}catch(t){y.e(t)}finally{y.f()}}}return 8===(r+="})\n").length&&(r=""),this.code.push(r),this}},{key:"rsp",value:function(t){var e=this;this.res.style.display="flex";var r=t.sequence.split("-"),n=function(){var n=t.ranges;"0px"!==n[0]&&n.unshift("0px");for(var i=0;i<n.length-1;i++)(window.matchMedia("(min-width: ".concat(n[i],") and (max-width: ").concat(n[i+1],")")).matches||window.matchMedia("(min-width: ".concat(n[n.length-1],")")).matches)&&("row"===r[i]&&(e.res.style.flexDirection="row",e.res.style.border="3px solid green"),"col"===r[i]&&(e.res.style.flexDirection="column",e.res.style.border="3px solid purple"));return e};window.addEventListener("resize",n),n()}},{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,r=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};r(),window.addEventListener("resize",r)}},{key:"makeCol",value:function(){return this.res.style.display="flex",this.res.style.flexDirection="column",this.res.style.alignItems="flex-start",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:"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:"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.border="".concat(t.width,"px solid ").concat(t.color),this}},{key:"add",value:function(t){this.items=t,this.code.push(".add([ \n");var e=t.map(function(e,r){return e.toCode().flatMap(function(t){return t}).join("")+(r<t.length-1?",":"")}).join("");this.code.push(e);for(var r=0;r<t.length;r++)if(void 0!==t[r]&&void 0!==t[r].toCode){var n=t[r].render();this.res.appendChild(n)}return this.code.push("])"),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:"dimensions",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:"size",value:function(t,e){return this.deprecatedOption("size() on this component","dimensions(w, h)"),this.dimensions(t,e)}},{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:"apply",value:function(t){var e=this,r=function(){for(var r=0;r<t.length;r++){var n=t[r],i=window.matchMedia("(max-width: ".concat(n.width,"px)"));n.device&&(i=window.matchMedia("(max-device-width: ".concat(n.width,"px)"))),i.matches&&Object.assign(e.res.style,n.styles)}},n=window.matchMedia("(max-width: ".concat(t[0].width,"px)"));return t[0].device&&(n=window.matchMedia("(max-device-width: ".concat(t[0].width,"px)"))),n.matches||Object.assign(this.res.style,t[0].styles),r(),window.addEventListener("resize",r),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}}],r&&Xt(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();function ne(t){return ne="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},ne(t)}function ie(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return oe(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?oe(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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,s=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw o}}}}function oe(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function se(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ae(n.key),n)}}function ae(t){var e=function(t){if("object"!=ne(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=ne(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ne(e)?e:e+""}function le(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(le=function(){return!!t})()}function ce(){return ce="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=ue(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},ce.apply(null,arguments)}function ue(t){return ue=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ue(t)}function fe(t,e){return fe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},fe(t,e)}var de=function(){function t(){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(t,e,r){return e=ue(e),function(t,e){if(e&&("object"==ne(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)}(t,le()?Reflect.construct(e,r||[],ue(t).constructor):e.apply(t,r))}(this,t)).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&&fe(t,e)}(t,m),e=t,r=[{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 r,n,i,o=[];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&&(r=t,n=this,"function"==typeof(i=ce(ue(1&3?r.prototype:r),"setAny",n))?function(t){return i.apply(n,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,e.transform];s=s.filter(function(t){return null!=t});for(var a=0;a<s.length;a++)o.push({range:s[a].range,log:s[a].op.name,target:s[a].target,op:s[a].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"),l.push("border"),this.chainReact(o,this.options.id,l)}}},{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:"cellPadding",value:function(t){var e,r=ie(this.res.rows);try{for(r.s();!(e=r.n()).done;){var n,i=ie(e.value.cells);try{for(i.s();!(n=i.n()).done;)n.value.style.padding=t}catch(t){i.e(t)}finally{i.f()}}}catch(t){r.e(t)}finally{r.f()}return this}},{key:"cellAlign",value:function(t){var e,r=ie(this.res.rows);try{for(r.s();!(e=r.n()).done;){var n,i=ie(e.value.cells);try{for(i.s();!(n=i.n()).done;)n.value.style.textAlign=t}catch(t){i.e(t)}finally{i.f()}}}catch(t){r.e(t)}finally{r.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 r,n=ie(this.res.rows);try{for(n.s();!(r=n.n()).done;){var i,o=ie(r.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){n.e(t)}finally{n.f()}for(var s=0;s<this.res.rows.length-1;s++){var a,l=ie(this.res.rows[s].cells);try{for(l.s();!(a=l.n()).done;)a.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,f=ie(this.res.rows);try{for(f.s();!(c=f.n()).done;)for(var d=c.value,h=0;h<u-1;h++)d.cells[h].style.borderRight=t}catch(t){f.e(t)}finally{f.f()}return this}},{key:"generateTableHead",value:function(t,e){var r,n=t.createTHead().insertRow(),i=ie(e);try{for(i.s();!(r=i.n()).done;){var o=r.value,s=document.createElement("th");s.textContent=o,n.appendChild(s)}}catch(t){i.e(t)}finally{i.f()}}},{key:"generateTable",value:function(t,e){var r,n=ie(e);try{for(n.s();!(r=n.n()).done;){var i=r.value,o=t.insertRow();for(var s in i)o.insertCell().textContent=i[s]}}catch(t){n.e(t)}finally{n.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)}}],r&&se(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();function he(t){return he="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},he(t)}function pe(t,e){if(t){if("string"==typeof t)return ye(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ye(t,e):void 0}}function ye(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function me(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ve(n.key),n)}}function ve(t){var e=function(t){if("object"!=he(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=he(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==he(e)?e:e+""}function be(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(be=function(){return!!t})()}function ge(t){return ge=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ge(t)}function we(t,e){return we=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},we(t,e)}var ke=function(){function t(){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(t,e,r){return e=ge(e),function(t,e){if(e&&("object"==he(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)}(t,be()?Reflect.construct(e,r||[],ge(t).constructor):e.apply(t,r))}(this,t)).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&&we(t,e)}(t,m),e=t,r=[{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 r=function(){var t=e.toggleWrap.getBoundingClientRect(),r=e.contentWrap.style.display,n=e.contentWrap.style.visibility;"none"===r&&(e.contentWrap.style.visibility="hidden",e.contentWrap.style.display="block");var i=e.contentWrap.getBoundingClientRect();"none"===r&&(e.contentWrap.style.display=r,e.contentWrap.style.visibility=n||"");var o=window.innerWidth,s=t.left+t.width/2-i.width/2;s<8&&(s=8),s+i.width>o-8&&(s=o-8-i.width),s<8&&(s=8),e.contentWrap.style.top=t.bottom+4+"px",e.contentWrap.style.left=s+"px"};this._positionContent=r;var n=function(){"none"!==e.contentWrap.style.display&&r()};if(window.addEventListener("resize",n),window.addEventListener("scroll",n,!0),t.behaviour){var i=t.behaviour;if("mouseover"===i||"mouseenter"===i){var o,s=function(){clearTimeout(o),e.contentWrap.style.display="block",r()},a=function(){o=setTimeout(function(){e.contentWrap.style.display="none"},200)};this.toggleWrap.addEventListener("mouseenter",s),this.toggleWrap.addEventListener("mouseleave",a),this.contentWrap.addEventListener("mouseenter",s),this.contentWrap.addEventListener("mouseleave",a),this.toggleWrap.addEventListener("click",function(t){t.stopPropagation(),"block"===e.contentWrap.style.display?e.contentWrap.style.display="none":(e.contentWrap.style.display="block",r())}),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&&r()}):this.res.addEventListener(i,function(){e.contentWrap.style.display="block",r()})}else this.res.addEventListener("click",function(){e.toggle(),"block"===e.contentWrap.style.display&&r()});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,r=this;if(!Array.isArray(t))throw new Error("The 'add' method expects an array of children.");var n=!this.options||!this.options.title;if(t.forEach(function(t,e){if(!n||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)}}),n){var i=t[0];i&&i.res&&this.toggleWrap.appendChild(i.res)}return(e=this.children).push.apply(e,function(t){return function(t){if(Array.isArray(t))return ye(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||pe(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.")}()}(t)),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=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,s,a=[],l=!0,c=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(t,e)||pe(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.")}()}(t,2),r=e[0],n=e[1];return"string"==typeof n?"".concat(r,': "').concat(n,'"'):"object"===he(n)?"".concat(r,": ").concat(JSON.stringify(n)):"".concat(r,": ").concat(n)}).join(",\n "):"",r=this.children.map(function(e,r){return e.toCode().flatMap(function(t){return t}).join("")+(r<t.children.length-1?",":"")}).join("");return["new Dropdown().set({\n ".concat(e,"\n}).add([\n ").concat(r,"\n])")]}},{key:"render",value:function(t){return t&&document.querySelector(t).appendChild(this.res),this.res}}],r&&me(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();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 xe(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Se(n.key),n)}}function Se(t){var e=function(t){if("object"!=Oe(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Oe(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Oe(e)?e:e+""}function je(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(je=function(){return!!t})()}function Ce(t){return Ce=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ce(t)}function Ee(t,e){return Ee=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ee(t,e)}var Pe=function(){function t(e){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(t,e,r){return e=Ce(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)}(t,je()?Reflect.construct(e,r||[],Ce(t).constructor):e.apply(t,r))}(this,t)).text=e,r.res=null,r.valid=!1,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&&Ee(t,e)}(t,m),e=t,r=[{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;if(this.options=t,this.res.setAttribute("type",null!==(e=t.type)&&void 0!==e?e:"text"),t.placeholder&&(this.res.placeholder=t.placeholder),this.res.style.boxSizing="border-box",!this.res.getAttribute("aria-label")){var r,n,i=null!==(r=null!==(n=t.label)&&void 0!==n?n:t.title)&&void 0!==r?r:t.placeholder;i&&this.res.setAttribute("aria-label",String(i))}return t.name&&this.res.setAttribute("name",t.name),t.id&&this.res.setAttribute("id",t.id),t.required&&this.res.setAttribute("required",""),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:"toCode",value:function(){var t=JSON.stringify(this.options,null,4);return["new TextField().set(".concat(t,")")]}},{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:"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:"process",value:function(t){return this.res.value}},{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:"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:"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:"onChange",value:function(t){var e=this;return this.res.value,this.res.addEventListener("input",function(r){t(e.res.value)}),this}},{key:"render",value:function(t){return t?(document.querySelector(t).appendChild(this.res),this.res):this.res}}],r&&xe(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();function Te(t){return Te="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},Te(t)}function Ae(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,_e(n.key),n)}}function _e(t){var e=function(t){if("object"!=Te(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Te(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Te(e)?e:e+""}function Re(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Re=function(){return!!t})()}function We(t){return We=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},We(t)}function ze(t,e){return ze=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ze(t,e)}var Ie=function(){function t(){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(t,e,r){return e=We(e),function(t,e){if(e&&("object"==Te(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)}(t,Re()?Reflect.construct(e,r||[],We(t).constructor):e.apply(t,r))}(this,t)).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&&ze(t,e)}(t,m),e=t,(r=[{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}}])&&Ae(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();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 Me(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ne(n.key),n)}}function Ne(t){var e=function(t){if("object"!=Le(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Le(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Le(e)?e:e+""}function Fe(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Fe=function(){return!!t})()}function Be(){return Be="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=De(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},Be.apply(null,arguments)}function De(t){return De=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},De(t)}function He(t,e){return He=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},He(t,e)}var Je=function(){function t(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),function(t,e,r){return e=De(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)}(t,Fe()?Reflect.construct(e,r||[],De(t).constructor):e.apply(t,r))}(this,t)}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&&He(t,e)}(t,m),e=t,r=[{key:"removeQuotesFromFirstWord",value:function(t){if(t)return t.replace(a(),"$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){var r,n,i;return this.obj=e,this.obj=e,this.makeNavbar(e),e.mar&&(r=t,n=this,"function"==typeof(i=Be(De(1&3?r.prototype:r),"mar",n))?function(t){return i.apply(n,t)}:i)([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}},{key:"makeNavbar",value:function(t){var e=this,r=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 r.render&&(console.log("Appending brand:",r.render()),this.brand.appendChild(r.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,r;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!==(r=this.hamburgerColour)&&void 0!==r?r:"#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 r=t[e];this.navContent.appendChild(r.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}}],r&&Me(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();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)}function qe(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Ge(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?qe(Object(r),!0).forEach(function(e){Ue(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):qe(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Ue(t,e,r){return(e=Ve(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Qe(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ve(n.key),n)}}function Ve(t){var e=function(t){if("object"!=$e(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=$e(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==$e(e)?e:e+""}function Xe(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Xe=function(){return!!t})()}function Ye(t){return Ye=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ye(t)}function Ze(t,e){return Ze=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ze(t,e)}var Ke=function(){function t(){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(t,e,r){return e=Ye(e),function(t,e){if(e&&("object"==$e(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)}(t,Xe()?Reflect.construct(e,r||[],Ye(t).constructor):e.apply(t,r))}(this,t)).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&&Ze(t,e)}(t,m),e=t,r=[{key:"set",value:function(t){var e=t.breakpoints,r=t.id,n=t.area;if(this.options={breakpoints:e},this._id=r,this._area=n,!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 Ge(Ge({},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.res=this.internalDiv,this._id&&this.internalDiv.setAttribute("id",this._id),this._area&&(this.internalDiv.style.gridArea=this._area),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,r=[],n=0;n<t.length;n++)r.push({from:t[n],to:n<t.length-1?t[n+1]-1:e});return r}},{key:"addRanges",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:99999;return t.map(function(t,n){var i=e[n],o=n<e.length-1?e[n+1]-1:r;return Ge(Ge({},t),{},{range:{from:i,to:o}})})}},{key:"applyView",value:function(){var t=this,e=(window.innerWidth,this.breakpoints.map(function(t){return t.at})),r=this.breakpoints.map(function(t){return t.at});this.createRanges(r),this.addRanges(this.breakpoints,e).forEach(function(e){var r="(min-width: ".concat(e.range.from,"px) and (max-width: ").concat(e.range.to,"px)");window.matchMedia(r).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}}],r&&Qe(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();function tr(t){return tr="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},tr(t)}function er(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,rr(n.key),n)}}function rr(t){var e=function(t){if("object"!=tr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=tr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==tr(e)?e:e+""}function nr(t,e){if(e&&("object"==tr(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)}function ir(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ir=function(){return!!t})()}function or(t){return or=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},or(t)}function sr(t,e){return sr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},sr(t,e)}var ar=function(){function t(e){var r,n,i,o;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),n=this,i=or(i=t),(r=nr(n,ir()?Reflect.construct(i,[],or(n).constructor):i.apply(n,o)))._noTheme=!0;var s=document.createElement("div");return s.style.flex="1",r.res=s,r.res.setAttribute("class","innerHider"),nr(r,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&&sr(t,e)}(t,m),e=t,(r=[{key:"toCode",value:function(){return["new Spacer(".concat(this.hide,")")]}},{key:"render",value:function(){return this.res}}])&&er(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();function lr(t){return lr="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},lr(t)}function cr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function ur(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,fr(n.key),n)}}function fr(t){var e=function(t){if("object"!=lr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=lr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==lr(e)?e:e+""}function dr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(dr=function(){return!!t})()}function hr(t){return hr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},hr(t)}function pr(t,e){return pr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},pr(t,e)}var yr=function(){function t(){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(t,e,r){return e=hr(e),function(t,e){if(e&&("object"==lr(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)}(t,dr()?Reflect.construct(e,r||[],hr(t).constructor):e.apply(t,r))}(this,t)).res=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,m),e=t,(r=[{key:"set",value:function(t){var e,r;this.options=t;var n=document.createElement("div");n.style.display="flex",n.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 s=document.createElement("style");s.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(s),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),n.appendChild(i);var a=document.createElement("div");if("function"==typeof(null===(r=t.label)||void 0===r?void 0:r.render))a.appendChild(t.label.render());else{var l=document.createTextNode(t.title||"Label");a.appendChild(l)}return a.style.opacity=.8,a.style.transition="opacity ease 0.2s, transform ease 0.2s",n.appendChild(a),this.res=n,this}},{key:"getValue",value:function(){return this.res.children[0].checked}},{key:"toCode",value:function(){var t=Object.entries(this.options).map(function(t){var e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,s,a=[],l=!0,c=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return cr(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?cr(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.")}()}(t,2),r=e[0],n=e[1];return"string"==typeof n?"".concat(r,': "').concat(n,'"'):"object"===lr(n)&&null!==n?"function"==typeof n.toCode?"".concat(r,": ").concat(n.toCode()[0]):"".concat(r,": ").concat(JSON.stringify(n,null,4)):"".concat(r,": ").concat(n)}).join(",\n ");return["new Checkbox().set({\n ".concat(t,"\n})")]}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}])&&ur(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();function mr(t){return mr="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},mr(t)}function vr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,br(n.key),n)}}function br(t){var e=function(t){if("object"!=mr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=mr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==mr(e)?e:e+""}function gr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(gr=function(){return!!t})()}function wr(t){return wr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},wr(t)}function kr(t,e){return kr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},kr(t,e)}"undefined"!=typeof window&&(window.Checkbox=yr);var Or=function(){function t(e){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(t,e,r){return e=wr(e),function(t,e){if(e&&("object"==mr(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)}(t,gr()?Reflect.construct(e,r||[],wr(t).constructor):e.apply(t,r))}(this,t)).url=e,r.res=null,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&&kr(t,e)}(t,m),e=t,(r=[{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)}}])&&vr(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();function xr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Sr(t){return Sr="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},Sr(t)}function jr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Cr(n.key),n)}}function Cr(t){var e=function(t){if("object"!=Sr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Sr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Sr(e)?e:e+""}function Er(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Er=function(){return!!t})()}function Pr(){return Pr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Tr(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},Pr.apply(null,arguments)}function Tr(t){return Tr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Tr(t)}function Ar(t,e){return Ar=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ar(t,e)}var _r=function(){function t(){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(t,e,r){return e=Tr(e),function(t,e){if(e&&("object"==Sr(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)}(t,Er()?Reflect.construct(e,r||[],Tr(t).constructor):e.apply(t,r))}(this,t)).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&&Ar(t,e)}(t,m),e=t,r=[{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 r,n,i,o=[],s=e.transform&&"object"===Sr(e.transform);if(e.stroke||e.gradient||e.span||e.backgroundOp||e.layout||e.shadow||e.animation||e.filtera||s){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=t,n=this,"function"==typeof(i=Pr(Tr(1&3?r.prototype:r),"setAny",n))?function(t){return i.apply(n,t)}:i)([{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,s?e.transform:void 0];a=a.filter(function(t){return null!=t});for(var l=0;l<a.length;l++)o.push({range:a[l].range,log:a[l].op.name,target:a[l].target,op:a[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"),this.chainReact(o,this.options.id,c)}}},{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,r=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return xr(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?xr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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,s=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw o}}}}(t);try{for(r.s();!(e=r.n()).done;){var n=e.value;if("string"==typeof n){var i=document.createElement("li");i.textContent=n,this.res.appendChild(i)}else{var o=n.render();this.res.appendChild(o)}}}catch(t){r.e(t)}finally{r.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:"border",value:function(t,e){return this.res.style.border="".concat(t,"px solid ").concat(e),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),r="".concat(e,"new UList()");return this.items&&this.items.length&&(r+="\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," ])")),[r+="\n".concat(e)]}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}],r&&jr(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();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 Wr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,zr(n.key),n)}}function zr(t){var e=function(t){if("object"!=Rr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Rr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Rr(e)?e:e+""}function Ir(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ir=function(){return!!t})()}function Lr(t){return Lr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Lr(t)}function Mr(t,e){return Mr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Mr(t,e)}var Nr=function(){function t(e,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(t,e,r){return e=Lr(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)}(t,Ir()?Reflect.construct(e,r||[],Lr(t).constructor):e.apply(t,r))}(this,t)).text=e,n.res=null,n.val=r,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&&Mr(t,e)}(t,m),e=t,(r=[{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 r=(new DOMParser).parseFromString(t.svg,"image/svg+xml").documentElement;e.appendChild(r)}else t.svg instanceof SVGElement&&e.appendChild(t.svg);else if(t.url&&!t.img){var n,i,o=document.createElement("img");o.setAttribute("src",t.url),o.style.width=(null===(n=t.frame)||void 0===n?void 0:n.width)||"50px",o.style.height=(null===(i=t.frame)||void 0===i?void 0:i.height)||"50px",e.appendChild(o)}else{var s=document.createTextNode(this.text.replace("$",this.val));e.appendChild(s)}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.deprecatedOption("padding","pad"),this.pad([{a:t.padding}])),t.margin&&(this.deprecatedOption("margin","mar"),this.mar([{a: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.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:"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 r=document.createTextNode(this.text);this.res.appendChild(r),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 n=document.createTextNode(this.text);this.res.appendChild(n),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 s=document.createTextNode(this.text);this.res.appendChild(s),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:"borderRadius",value:function(t){return this.res.style.borderRadius=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 r=this.res,n=this.text;return Object.defineProperty(t,e,{set:function(t){var e=document.createTextNode(n.replace("$",t));r.replaceChild(e,r.childNodes[0])}}),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)}}])&&Wr(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();function Fr(t){return Fr="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},Fr(t)}function Br(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Dr(n.key),n)}}function Dr(t){var e=function(t){if("object"!=Fr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Fr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Fr(e)?e:e+""}function Hr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Hr=function(){return!!t})()}function Jr(t){return Jr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Jr(t)}function $r(t,e){return $r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},$r(t,e)}var qr=function(){function t(){var e,r,n,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(r=this,n=t,n=Jr(n),e=function(t,e){if(e&&("object"==Fr(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,Hr()?Reflect.construct(n,i||[],Jr(r).constructor):n.apply(r,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&&$r(t,e)}(t,m),e=t,(r=[{key:"set",value:function(t){this.options=t;var e=document.createElement("div"),r=document.createElement("label");r.style.position="relative",r.style.display="block";var n=null==t.title?"":String(t.title),i=document.createTextNode(n);r.appendChild(i),r.style.opacity=0;var o=document.createElement("input");return"textarea"===t.type&&(o=document.createElement("textarea")),o.style.position="relative",o.placeholder=n,o.style.boxSizing="border-box",n&&!o.getAttribute("aria-label")&&o.setAttribute("aria-label",n),o.style.fontSize="1rem",o.style.padding=".4rem .75rem",e.appendChild(r),e.appendChild(o),this.res=e,t.mar&&this.mar(t.mar),t.pad&&this.pad(t.pad),o.addEventListener("focus",function(){r.style.transition="transform ease 0.2s",r.style.transform="scale(0.80)",r.style.textTransform="uppercase",r.style.transformOrigin="left top",r.style.fontWeight="bold",o.placeholder="",r.style.opacity="1.0",t.font&&(r.style.fontFamily=t.font),t.color&&(r.style.color=t.color),t.exact&&(r.style.fontSize=t.exact)}),o.addEventListener("focusout",function(){r.style.transform="scale(1.0)",o.placeholder=n,r.style.opacity="0.0"}),t.name&&o.setAttribute("name",t.name),window.matchMedia("(max-device-width: 415px)").matches&&(o.style.width="100%",e.style.width="100%"),o.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)}}])&&Br(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();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 Ur(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Qr(n.key),n)}}function Qr(t){var e=function(t){if("object"!=Gr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Gr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Gr(e)?e:e+""}"undefined"!=typeof window&&(window.FloatingInput=qr);var Vr=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,r,n=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,s;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 a="\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!==(s=t.style.thumbColor)&&void 0!==s?s:"4CAF50",";\n cursor: pointer;\n }\n "),l=document.createElement("style");l.appendChild(document.createTextNode(a)),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!==(r=t.width)&&void 0!==r?r:"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(){n.currentLabel.textContent=i.value}),window.matchMedia("(max-device-width: 415px)").matches)if(t.plain)i.style.width="80%";else{var f,d;i.style.height="20px",i.style.background=null!==(f=t.style.trackColor)&&void 0!==f?f:"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!==(d=t.style.thumbColor)&&void 0!==d?d:"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)}}])&&Ur(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Xr(t){return Xr="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},Xr(t)}function Yr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Zr(n.key),n)}}function Zr(t){var e=function(t){if("object"!=Xr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Xr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Xr(e)?e:e+""}"undefined"!=typeof window&&(window.Range=Vr);var Kr=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"),r=t.items,n=0;n<r.length;n++){var i=document.createElement("label");r.font&&(i.style.font=r.font),r.color&&(i.style.color=r.color),r.exact&&(i.style.fontSize=r.exact);var o=document.createTextNode(r[n]);i.appendChild(o),i.setAttribute("for",r[n]);var s=document.createElement("input");s.setAttribute("type","radio"),s.setAttribute("id","S".concat(n)),s.setAttribute("value",r[n].split(" ").join("")),s.style.appearance="none",s.style.width="20px",s.style.height="20px",s.style.border=this.options.tint?"2px solid ".concat(this.options.tint):"2px solid #007BFF",s.style.borderRadius="50%",s.style.outline="none",s.style.cursor="pointer",s.style.transition="0.3s",this.options.font&&(i.style.fontFamily=this.options.font),t.multiple?s.setAttribute("name",r[n].split(" ").join("")):s.setAttribute("name",t.name),e.appendChild(s),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 r=document.querySelector("#S".concat(e));t.push(r.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 r=function(){var t=e.el.children[n];"[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 r=0;r<e.el.children.length;r++){var n=e.el.children[r];"INPUT"===n.tagName&&"radio"===n.type&&!1===e.options.multiple&&n!==t&&(n.style.backgroundColor="transparent",n.style.boxShadow="none")}}else t.style.backgroundColor="transparent",t.style.boxShadow="none"})},n=0;n<this.el.children.length;n++)r();return this.el}document.querySelector(t).appendChild(this.el)}}])&&Yr(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function tn(t){return tn="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},tn(t)}function en(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,rn(n.key),n)}}function rn(t){var e=function(t){if("object"!=tn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=tn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==tn(e)?e:e+""}function nn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(nn=function(){return!!t})()}function on(t){return on=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},on(t)}function sn(t,e){return sn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},sn(t,e)}"undefined"!=typeof window&&(window.RadioGroup=Kr);var an=function(){function t(){var e,r,n,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(r=this,n=t,n=on(n),e=function(t,e){if(e&&("object"==tn(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,nn()?Reflect.construct(n,i||[],on(r).constructor):n.apply(r,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&&sn(t,e)}(t,m),e=t,(r=[{key:"setup",value:function(t,e){document.createElement("div");var r=document.createElement("select");r.setAttribute("type","file"),r.setAttribute("name",e),r.addEventListener("change",function(){r.options[r.selectedIndex].value});for(var n=0;n<t.length;n++){var i=t[n],o="string"==typeof i||"number"==typeof i?[String(i),String(i)]:[i&&i[0],i&&i[1]];r.appendChild(this.addNode(o[0],o[1]))}return this.el=r,this.res=r,this}},{key:"set",value:function(t){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);var e=void 0!==t.label?t.label:t.title;return null==e||this.el.getAttribute("aria-label")||this.el.setAttribute("aria-label",String(e)),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 r=document.createElement("option");r.setAttribute("value",t);var n=document.createTextNode(e);return r.appendChild(n),r}},{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)}}])&&en(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();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 cn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,un(n.key),n)}}function un(t){var e=function(t){if("object"!=ln(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=ln(r))return r;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 dn(t){return dn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},dn(t)}function hn(t,e){return hn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},hn(t,e)}"undefined"!=typeof window&&(window.Picker=an);var pn=function(){function t(){var e,r,n,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(r=this,n=t,n=dn(n),e=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(n,i||[],dn(r).constructor):n.apply(r,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&&hn(t,e)}(t,m),e=t,(r=[{key:"set",value:function(t){var e=this;this.options=t,this.okayColor=t.okayColor,window.matchMedia("(max-device-width: 415px)");var r=document.createElement("div");r.style.paddingBottom="1em",r.style.display="flex",document.createElement("div");var n=document.createElement("input");n.setAttribute("type","text"),n.style.display="none",n.style.margin="0.5em";var i=document.createElement("input");i.setAttribute("type","file"),i.setAttribute("name",t.name),t.accept&&(i.accept=t.accept),void 0!==t.id&&null!==t.id&&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.textContent=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(){n.style.display="block",t.hideField&&(n.style.display="none"),o.textContent="Change",e.file=i.files[0],e.onLoad(e.file),yn[t.index]=e.file,n.setAttribute("value",e.file.name),n.setAttribute("readonly","true"),e.getLoaded(),e.highlight()}),r.appendChild(i),r.appendChild(o),r.appendChild(n),this.el=r,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}}])&&cn(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}(),yn=[];function mn(t,e){return mn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},mn(t,e)}function vn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(vn=function(){return!!t})()}function bn(t){return bn="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},bn(t)}function gn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,wn(n.key),n)}}function wn(t){var e=function(t){if("object"!=bn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=bn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==bn(e)?e:e+""}var kn=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,r=t;this.options=t;var n=document.createElement("input");n.setAttribute("list","dlCities"),n.setAttribute("id","my");var i=t.data,o=0,s=i.length,a=document.createElement("datalist");for(a.id="dlCities",o=0;o<s;o+=1){var l=document.createElement("option");l.value=i[o],a.appendChild(l)}return n.appendChild(a),n.addEventListener("change",function(){var t=document.querySelector("#my").value;e.currentItem=t}),n.setAttribute("placeholder","Type value"),n.style.padding=".4rem .75rem",n.style.fontSize="1rem",this.res=n,this.responsive(),r.arrayPadding&&this.arrayPadding(r.arrayPadding.sides,r.arrayPadding.value),r.arrayMargin&&this.arrayMargin(r.arrayMargin.sides,r.arrayMargin.value),r.pad&&this.pad(r.pad),r.mar&&this.mar(r.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)}}])&&gn(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}(),On=kn;function xn(t){return xn="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},xn(t)}function Sn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function jn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Cn(n.key),n)}}function Cn(t){var e=function(t){if("object"!=xn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=xn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==xn(e)?e:e+""}kn=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(t,e,r){if(vn())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&mn(i,r.prototype),i}(On,e)},"undefined"!=typeof window&&(window.DataList=kn);var En=function(){return t=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=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=r,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,r,n=(r=2,function(t){if(Array.isArray(t))return t}(e=t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,s,a=[],l=!0,c=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(e,r)||function(t,e){if(t){if("string"==typeof t)return Sn(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Sn(t,e):void 0}}(e,r)||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=n[0],o=n[1],s="string"==typeof o?'"'.concat(o,'"'):o;return"".concat(i,": ").concat(s)}).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),t.id&&(this.formElement.id=t.id),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&&jn(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Pn(t){return Pn="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},Pn(t)}function Tn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,An(n.key),n)}}function An(t){var e=function(t){if("object"!=Pn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Pn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Pn(e)?e:e+""}var _n=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,r=t.el,n=t.re,i=(t.options,[]),o=0;o<e.length;o++)e[o].target&&(r.id,e[o].target[0]);for(o=0;o<e.length;o++){var s=!0;e[o].target&&(s=!1,r.id===e[o].target[0]&&(s=!0));var a=e[o].op.ops.split("-");s&&a.includes("air")&&(n.borderObj={color:"#1abc9c",radius:"0rem",width:"3px"},n.color="#1abc9c",n.background="transparent"),s&&a.includes("round")&&(a.includes("air")?n.borderObj={width:"4px",radius:"0.7rem",color:"#1abc9c"}:n.borderObj={width:"0px",radius:"0.7rem",color:"#1abc9c"}),s&&a.includes("full")&&(n.background="#3498db",n.borderObj&&n.borderObj.radius&&(n.borderObj.radius="0.3rem"),n.color="white"),s&&a.includes("pill")&&(n.background="#3498db",n.borderObj.radius="9999px",n.color="white"),s&&a.includes("hover")&&(n.hover={color:"#1abc9c",background:"orange"}),i.push((new G).set(n))}return i}}])&&Tn(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();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 Wn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function zn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Wn(Object(r),!0).forEach(function(e){In(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Wn(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function In(t,e,r){return(e=Mn(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ln(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Mn(n.key),n)}}function Mn(t){var e=function(t){if("object"!=Rn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Rn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Rn(e)?e:e+""}function Nn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Nn=function(){return!!t})()}function Fn(){return Fn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Bn(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},Fn.apply(null,arguments)}function Bn(t){return Bn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Bn(t)}function Dn(t,e){return Dn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Dn(t,e)}var Hn=function(){function t(){var e,r,n,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),(r=this,n=t,n=Bn(n),e=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)}(r,Nn()?Reflect.construct(n,i||[],Bn(r).constructor):n.apply(r,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&&Dn(t,e)}(t,m),e=t,r=[{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=l(this.options||{},2);return"new Polygon().set(".concat(t,")")}},{key:"getType",value:function(){return"LayoutWrapperElement"}},{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=zn(zn({},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.mar([{a:e.margin}]),e.padding&&this.pad([{a:e.padding}]),e.background&&this.background(e.background),e.center&&this.center();var r=e;this.obj=e;var n,i,o=[];if(r.stroke||r.gradient||r.backgroundOp||r.layout||r.marginOp||r.shadow||r.animation||r.filtera||r.transform){var s;r.gradient&&(this.globalGradient=r.gradient.op.gradient),r.stroke&&(null===(n=this,s="function"==typeof(i=Fn(Bn(t.prototype),"setAny",n))?function(t){return i.apply(n,t)}:i)||void 0===s||s([{globalBlast:"".concat(r.stroke.op.width," ").concat(r.stroke.op.color)}]));for(var a=[r.stroke,r.gradient,r.animation,r.backgroundOp,r.layout,r.marginOp,r.shadow,r.animation,r.filtera,r.transform].filter(function(t){return null!=t}),l=0;l<a.length;l++)o.push({range:a[l].range,log:a[l].op.name,target:a[l].target,op:a[l].op});var c=[];r.border&&c.push("border"),r.background&&c.push("background"),(r.mar||r.margin)&&c.push("margin"),r.animation&&c.push("animation"),"radial"===r.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:"color",value:function(t){return this.res.style.color=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:"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}}],n=[{key:"makePolygon",value:function(t){for(var e=2*Math.PI/t,r=[],n=0;n<t;n++){var i=50+50*Math.cos(n*e-Math.PI/2),o=50+50*Math.sin(n*e-Math.PI/2);r.push("".concat(i,"% ").concat(o,"%"))}return"polygon(".concat(r.join(","),")")}}],r&&Ln(e.prototype,r),n&&Ln(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();function Jn(t){return Jn="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},Jn(t)}function $n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function qn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Gn(n.key),n)}}function Gn(t){var e=function(t){if("object"!=Jn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Jn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Jn(e)?e:e+""}function Un(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Un=function(){return!!t})()}function Qn(){return Qn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Vn(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},Qn.apply(null,arguments)}function Vn(t){return Vn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Vn(t)}function Xn(t,e){return Xn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Xn(t,e)}var Yn=function(){function t(){var e,r,n,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(r=this,n=t,n=Vn(n),e=function(t,e){if(e&&("object"==Jn(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,Un()?Reflect.construct(n,i||[],Vn(r).constructor):n.apply(r,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&&Xn(t,e)}(t,m),e=t,r=[{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=l(Object.fromEntries(Object.entries(this.options||{}).filter(function(t){return null!=(e=t,r=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,s,a=[],l=!0,c=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(e,r)||function(t,e){if(t){if("string"==typeof t)return $n(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?$n(t,e):void 0}}(e,r)||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,r})),4);return["new Circle().set(".concat(t,")")]}},{key:"setArea",value:function(t){return this.res.style.gridArea=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:"color",value:function(t){return this.res.style.color=t,this}},{key:"background",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)||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 r,n,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===(r=this,o="function"==typeof(n=Qn(Vn(t.prototype),"setAny",r))?function(t){return n.apply(r,t)}:n)||void 0===o||o([{globalBlast:"".concat(e.stroke.op.width," ").concat(e.stroke.op.color)}]));for(var s=[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}),a=0;a<s.length;a++)i.push({range:s[a].range,log:s[a].op.name,target:s[a].target,op:s[a].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}}],r&&qn(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();function Zn(t){return Zn="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},Zn(t)}function Kn(t){return function(t){if(Array.isArray(t))return ti(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return ti(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ti(t,e):void 0}}(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 ti(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function ei(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,oi(n.key),n)}}function ri(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function ni(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ri(Object(r),!0).forEach(function(e){ii(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ri(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function ii(t,e,r){return(e=oi(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function oi(t){var e=function(t){if("object"!=Zn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Zn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Zn(e)?e:e+""}var si=["h1","h2","h3","h4","h5","h6","p","img","a","cards","free","nav","sideNav","row","dropdown","radio","input","labelInput","filePicker","picker","video","audio","multiswitcher","button","form","checkbox","stack","simple","copy","wrap","circle","polygon","code","table","ulist"],ai=function(t,e){var r=function(t){return"string"==typeof t&&"#"===t.charAt(0)?t.slice(1):t};return r(t)===r(e)},li=function(t){var e,r;return"string"==typeof t||"number"==typeof t?{title:String(t),link:"#e"}:ni(ni({},t),{},{title:String(null!==(e=null==t?void 0:t.title)&&void 0!==e?e:""),link:null!==(r=null==t?void 0:t.link)&&void 0!==r?r:"#e"})},ci=function(){return e=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},r=[{key:"mapType",value:function(t){if(["h1","h2","h3","h4","h5","h6","p"].includes(t.el.type))return this.mapText(t);if("img"===t.el.type)return this.mapImage(t);if("a"===t.el.type)return this.mapLink(t);if("cards"===t.el.type)return this.mapGrid(t);if("free"===t.el.type)return this.mapFree(t);if("nav"===t.el.type)return this.protoNav(t);if("sideNav"===t.el.type)return this.sideNav(t);if("row"===t.el.type)return this.mapRow(t);if("dropdown"===t.el.type)return this.dropdown(t);if("radio"===t.el.type)return this.radio(t);if("input"===t.el.type)return this.input(t);if("labelInput"===t.el.type)return this.floatInput(t);if("filePicker"===t.el.type)return this.filePicker(t);if("picker"===t.el.type)return this.picker(t);if("video"===t.el.type)return this.video(t);if("audio"===t.el.type)return this.audio(t);if("multiswitcher"===t.el.type)return this.multiswitcher(t);if("button"===t.el.type)return this.button(t);if("form"===t.el.type)return this.form(t);if("checkbox"===t.el.type)return this.checkbox(t);if("stack"===t.el.type)return this.stack(t);if("simple"===t.el.type)return this.simple(t);if("copy"===t.el.type)return this.mapCopy(t);if("wrap"===t.el.type)return this.mapWrap(t);if("circle"===t.el.type)return this.mapCircle(t);if("polygon"===t.el.type)return this.mapPolygon(t);if("code"===t.el.type)return this.mapCode(t);if("table"===t.el.type)return this.mapTable(t);if("ulist"===t.el.type)return this.mapUList(t);throw new Error("[nodality] "+function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"value",n=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,n=String(t);return e.filter(function(t){return function(t,e){if(t===e)return 0;for(var r=new Array(e.length+1),n=0;n<=e.length;n++)r[n]=n;for(var i=1;i<=t.length;i++){for(var o=[i],s=1;s<=e.length;s++){var a=t.charCodeAt(i-1)===e.charCodeAt(s-1)?0:1;o[s]=Math.min(r[s]+1,o[s-1]+1,r[s-1]+a)}r=o}return r[e.length]}(n,t)<=r})}(t,e),i="Unknown ".concat(r,' "').concat(t,'".');return n.length&&(i+=' Did you mean "'.concat(n[0],'"?')),e.length&&(i+=" Valid ".concat(r,"s: ").concat(e.join(", "),".")),i}(t.el.type,si,"element type"))}},{key:"mapTable",value:function(t){var e=t.el,r=Array.isArray(e.items)&&e.items.length?e.items:[{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"}];return(new de).add(r).set({cellPadding:"0.3em",cellAlign:"center",style:{font:"Arial"},headStyle:{color:"white",background:"#c2410c"},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=this,r=t.el;return(new rt).set({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),span:this.filtero("span",r.id,t.customOptions),backgroundOp:this.filtero("background",r.id,t.customOptions),marginOp:this.filtero("margin",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)}).items(Kn(Array.isArray(r.children)&&r.children.length?r.children.map(function(r){return e.mapType(ni(ni({},t),{},{el:r}))}):[new C("This").set({size:"S3"}),new C("is").set({size:"S3",text:"Hello"}),new C("row.").set({size:"S3",text:"Hello"})]))}},{key:"mapCode",value:function(t){var e=t.el;return(new Nt).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,r=t.customOptions,n=r.filter(function(t){return"copy"===t.op})[0],i=null!==(e=null==n?void 0:n.count)&&void 0!==e?e:3,o=(this.filteroRaster(t.el.id,r)||[]).filter(function(t){return t!==n}),s=300;return'new Wrapper()\n.set({\n width: "'.concat(s,'px",\n height: "').concat(s,'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 ':"").concat(o.length?",\n raster: ".concat(JSON.stringify(o)):"","\n})\n.add(\n Array.from({ length: ").concat(i,' }).map((_, i) => {\n\n const bbox = {width: "').concat(s,'px", height: "').concat(s,'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(i,';\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(t){var e,r=t.el;return new Nr(null!==(e=r.text)&&void 0!==e?e:"Button").set(ni(ni({fluidc:"S6"},this.elOpts(r)),{},{raster:this.filteroRaster(r.id,t.customOptions)}))}},{key:"multiswitcher",value:function(t){var e=this,r=Array.isArray(t.el.breakpoints)?t.el.breakpoints:null;if(!r||!r.length)throw new Error('[nodality] a "multiswitcher" element needs a non-empty `breakpoints` array of { at, view }.');return(new Ke).set({id:t.el.id,area:t.el.area,breakpoints:r.map(function(r){return{at:r.at,view:r.view&&"function"==typeof r.view.render?r.view:e.mapType(ni(ni({},t),{},{el:r.view}))}})})}},{key:"video",value:function(t){var e=t.el;if(!e.url)throw new Error('[nodality] a "video" element needs a `url`.');return this.attachRaster(new Or(e.url).set(this.elOpts(e)),e,t.customOptions)}},{key:"audio",value:function(t){var e=t.el;if(!e.url)throw new Error('[nodality] an "audio" element needs a `url`.');return this.attachRaster(new At(e.url),e,t.customOptions)}},{key:"radio",value:function(t){var e,r=t.el;return(new Kr).set(ni({items:Array.isArray(r.items)?r.items:[],multiple:null!==(e=r.multiple)&&void 0!==e&&e},this.elOpts(r)))}},{key:"input",value:function(t){var e,r=t.el;return(new Pe).set(ni(ni({type:null!==(e=r.inputType)&&void 0!==e?e:"text"},this.elOpts(r)),{},{raster:this.filteroRaster(r.id,t.customOptions)}))}},{key:"floatInput",value:function(t){var e,r=t.el;return this.attachRaster((new qr).set(ni(ni({type:null!==(e=r.inputType)&&void 0!==e?e:"input"},void 0!==r.title||void 0===r.label&&void 0===r.text?{}:{title:void 0!==r.label?r.label:r.text}),this.elOpts(r))),r,t.customOptions)}},{key:"filePicker",value:function(t){var e,r=t.el;return this.attachRaster((new pn).set(ni({title:null!==(e=r.title)&&void 0!==e?e:"Choose a file"},this.elOpts(r))),r,t.customOptions)}},{key:"picker",value:function(t){var e=t.el;return(new an).set(ni(ni({items:Array.isArray(e.items)?e.items:[],arrayPadding:{sides:["all"],value:"0.5rem"},rounded:!0},this.elOpts(e)),{},{raster:this.filteroRaster(e.id,t.customOptions)}))}},{key:"dropdown",value:function(t){var e,r=null!==(e=t.el.label)&&void 0!==e?e:t.el.title;t.el.items||(t.el.items=["Flower","Car","Maseratti"]);var n=t.el.items.map(function(t){return(new G).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}})}),i=(new ke).set(ni(ni({},void 0===r?{}:{title:r}),{},{behaviour:"click",pad:[{a:"1rem"}],mar:[{a:"1rem"}],border:"1px solid black",width:"180px",radius:"1rem"})).add([].concat(Kn(void 0!==r?[]:[new C(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 re).set({border:"1px solid green",background:"#1abc9c",radius:"0.7rem",socenter:!0}).add(void 0===r?n.slice(1):n)])),o=this.filteroRaster(t.el.id,t.customOptions);return o&&i.rasterize(o),i}},{key:"protoNav",value:function(t){var e,r,n=t.customOptions,i=Array.isArray(null===(e=t.el)||void 0===e?void 0:e.items)&&t.el.items.length?t.el.items.map(li):[{title:"Fire",link:"@e"},{title:"and",link:"@e"},{title:"smoke",link:"@e"}],o=Array.isArray(null===(r=t.el)||void 0===r?void 0:r.items)&&t.el.items.length?t.el.items.map(li):null,s=function(){return o.map(function(t){return(new G).set({text:t.title,url:t.link,pad:[{tb:8,lr:4}]})})},a=i.map(function(t,e){return new G('"'.concat(t.title,'"')).set({fluidc:"S6",text:t.title,link:t.link,font:"Arial",pad:[{a:40}],bold:!0,hover:{color:"wheat",animation:.3}})}),l=i.map(function(t,e){return new G('"'.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 c=(new ke).set({behaviour:"mouseover",pad:[{a:40}],padding:"10px",border:"1px solid black"}).add([new C("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 re).set({centerColumn:!0,radius:"0.7rem",background:"#1abc9c",makeResponsiveBehaviour:"undefined"}).add([(new G).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 G).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"}})])]);l.push(c),a.push(c)}t.el.animation;var u=(new Ke).set({breakpoints:[{at:"0px",view:(new Je).set({background:"#ecf0f1",mar:[{a:21}],brand:new C("Company").set({size:"S6",font:"Helvetica"}),hamburgerColour:"#3498db",radius:"1rem"}).add([].concat(Kn(o?s():[(new G).set({text:"About",url:"#a"})]),[(new ke).set({behaviour:"mouseover",pad:[{a:40}],mar:[{lr:"auto"}],breakpoint:"1200px",padding:"10px",border:"1px solid black",height:"auto"}).add([new C("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 C("Our story").set({cursor:"hand",fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"}),new C("Team").set({cursor:"hand",fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"})])],Kn(o?[]:[new G("B").set({text:"About",url:"#b"}),new G("C").set({text:"Contact",url:"https://www.abcnews.com"})])))},{at:"1200px",view:(new Ie).set({background:"#ecf0f1",mar:[{a:21}],maxHeight:"100px",radius:"1rem"}).add([new C("Company").set({size:"S6",font:"Helvetica"}),new ar(!0),(new ke).set({behaviour:"mouseover",pad:[{a:40}],padding:"10px",border:"1px solid black",radius:"30px",width:"130px"}).add([new C("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 re).set({flexDir:"column",mar:[{t:"10px"}],radius:".3rem"}).add([new G("").set({text:"Who we are",url:"jk",cursor:"hand",fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"}),new G("").set({text:"Info",url:"#u",cursor:"hand",fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"}),new G("").set({text:"About",url:"#u",cursor:"hand",fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"})])])].concat(Kn(o?s():[(new G).set({text:"About",url:"#a"}),(new G).set({text:"Services",url:"#a"}),(new G).set({text:"Contact",url:"#a"})])))}]});return this.attachRaster(u,t.el,n)}},{key:"sideNav",value:function(t){t.customOptions;var e,r,n=Array.isArray(null===(e=t.el)||void 0===e?void 0:e.items)&&t.el.items.length>0,i=Array.isArray(null===(r=t.el)||void 0===r?void 0:r.items)&&t.el.items.length?t.el.items.map(li):[{title:"Home",link:"@e"},{title:"Projects",link:"@e"},{title:"Services",link:"@e"}],o=i.map(function(t,e){return new G('"'.concat(t.title,'"')).set({fluidc:"S4",text:t.title,link:t.link,isNavA:!0,url:n&&t.link||"#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}})}),s=(new ke).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 C("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 re).set({centerColumn:!0,radius:"0.7rem",background:"#1abc9c",makeResponsiveBehaviour:"undefined"}).add([(new G).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 G).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"}})])]),a=i.map(function(t,e){return new G('"'.concat(t.title,'"')).set({fluidc:"S4",text:t.title,link:t.link,isNavA:!0,url:n&&t.link||"#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&&(a.push(s),o.push(s));var l=(new re).set({column:!0}).add([new C("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}]})].concat(Kn((t.el.animation?a:o).slice(0,i.length).filter(Boolean)),[t.el.animation&&t.el.dropdown?a[i.length]:new C("").set({}).excludeFromCode(),new C("Company, 2025").set({pad:[{a:20}],animation:{range:["0px","1900px"],op:{name:"animation",color:"green",width:"1px"}}})])),c=(new re).set({column:!0}).add([new C("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}]})]),u=(new yt).setup({animate:!0,radius:"1rem",isSide:!0,background:"#ecf0f1",hamColour:{opened:"#0f766e",closed:"#c2410c"},mobileSize:"1.2em",fixed:!0,tags:{open:"sidebar:open",close:"sidebar:closed"}}).items(t.el.offcanvas?c:l),f=this.filteroRaster(t.el.id,t.customOptions);return f&&u.rasterize(f),u}},{key:"mapFree",value:function(t){var e=t.customOptions.filter(function(t){return"slayout"===t.op.name||"layout"===t.op.name})[0],r=null,n={cols:6,rows:6};"text-above-image"!==e.op.value&&"image-above-text"!==e.op.value||(r=null,n=null),"img-overlay-text"===e.op.value&&(r={text:{row:"1 / span 2",col:"3 / span 2"},image:{row:"2 / span 3",col:"3 / 3"}}),"img-leftof-text"===e.op.value&&(r={text:{row:"1",col:"1 / 3"},image:{row:"1",col:"3 / 4"}});var i=(new xt).set({id:"#3",templateCols:n,height:"600px"}).add([new C("I am free").set({border:"3px solid green",font:"Arial",size:"S1",color:"#1abc9c",gpos:null!=r?r.text:null,zIndex:1}),(new L).set({url:"https://upload.wikimedia.org/wikipedia/commons/a/ac/MSC_World_Europa_-_Saint-Nazaire_-_June_2022.jpg",width:"400px",height:"auto",gpos:null!=r?r.image:null})]),o=this.filteroRaster(t.el.id,t.customOptions);return o&&i.rasterize(o),i}},{key:"mapCircle",value:function(t){var e=t.el;return(new Yn).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,r=t.el,n=null!==(e=t.el.sides)&&void 0!==e?e:7;return new Hn({id:"hex"}).set({sides:n,size:300,background:"#1abc9c",gradient:this.filtero("gradient",r.id,t.customOptions),animation:this.filtero("animation",r.id,t.customOptions),shadow:this.filtero("shadow",r.id,t.customOptions),span:this.filtero("span",r.id,t.customOptions),backgroundOp:this.filtero("background",r.id,t.customOptions),marginOp:this.filtero("margin",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)})}},{key:"mapText",value:function(t){var e,r,n=t.el;return new C(n.text||n.value).set({id:n.id,class:n.class,color:n.color,size:this.getElType(n.type),tag:n.tag,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:null!==(r=n.resprop)&&void 0!==r?r:null})}},{key:"mapImage",value:function(t){var e=t.el;return new L(e.url).set(ni(ni({},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}),r=t.el;return t.el.id&&(r.id=t.el.id),t.el.link&&t.el.text&&(r.url=t.el.link,r.text=t.el.text),r.animation=this.filtero("animation",t.el.id,t.customOptions),r.class=t.el.class,r.width=t.el.width,r.font="Arial",r.fluidc=t.el.fluidc,r.transform=this.filtero("transform",t.el.id,t.customOptions),r.shadow=this.filtero("shadow",t.el.id,t.customOptions),r.gradient=this.filtero("gradient",t.el.id,t.customOptions),r.blast=this.filtero("blast",t.el.id,t.customOptions),r.backgroundOp=this.filtero("background",t.el.id,t.customOptions),r.raster=this.filteroRaster(t.el.id,t.customOptions),r.pad=[{a:10}],e.length>0?_n.style({el:t.el,re:r,bst:e,options:t.customOptions})[e.length-1]:(new G).set(r)}},{key:"mapGrid",value:function(t){var e=t.el,r=(t.customOptions.find(function(t){return"card-style"===t.op.name}),this.filtero("gradient",e.id,t.customOptions)),n=this.filtero("animation",e.id,t.customOptions),i=this.filtero("shadow",e.id,t.customOptions),o=this.filtero("margin",e.id,t.customOptions),s=this.filtero("filter",e.id,t.customOptions),a=this.filteroRaster(e.id,t.customOptions),l=this.filtero("blast",e.id,t.customOptions),c='\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!==r?",\n gradient: ".concat(JSON.stringify(r)):"").concat(void 0!==n?",\n animation: ".concat(JSON.stringify(n)):"").concat(void 0!==i?",\n shadow: ".concat(JSON.stringify(i)):"").concat(void 0!==o?",\n marginOp: ".concat(JSON.stringify(o)):"").concat(void 0!==s?",\n filtera: ".concat(JSON.stringify(s)):"").concat(void 0!==l?",\n blast: ".concat(JSON.stringify(l)):"",'\n })\n .items([\n new Image(item.img).set({isFull: true, url: item.img}),\n // #c2410c is 5.18:1 on white; h2 keeps the outline intact.\n new Text(item.title).set({ size: "S5", tag: "h2", color: "#c2410c" }),\n new Link("Link").set({\n text: item.title, \n url: item.link, \n background: "#1d6fe0", \n pad: [{ lr: "0.5rem", tb: "1rem" }], \n radius: "0.4rem", \n color: "white",\n mar: [{"a": 21}]\n })\n ])'),u=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", tag: "h2", color: "#c2410c" }),\n new Link("Link").set({\n text: item.title, \n url: item.link, \n background: "#1d6fe0", \n pad: [{ lr: "0.5rem", tb: "1rem" }], \n radius: "0.4rem", \n color: "white"\n })\n ])':c;return' new FlexGrid()\n .set({\n colat: "700px",\n wrap: true,\n align: "center",\n gap: "1rem"\n '.concat(void 0!==r?",\n gradient: ".concat(JSON.stringify(r)):"").concat(void 0!==n?",\n animation: ".concat(JSON.stringify(n)):"").concat(void 0!==i?",\n shadow: ".concat(JSON.stringify(i)):"").concat(void 0!==o?",\n marginOp: ".concat(JSON.stringify(o)):"").concat(void 0!==s?",\n filtera: ".concat(JSON.stringify(s)):"").concat(void 0!==l?",\n blast: ".concat(JSON.stringify(l)):"").concat(void 0!==a?",\n raster: ".concat(JSON.stringify(a)):"","\n })\n .items(\n ").concat(this.gridItemsSource(t,u),"\n )\n ")}},{key:"gridItemsSource",value:function(t,e){var r=this,n=t.el.items;if(!Array.isArray(n)||0===n.length)return'[\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(e,"\n )");var i,o=function(t){return Array.isArray(t)},s=n.filter(function(t){return!o(t)});if(0===n.filter(o).length)return"".concat(JSON.stringify(s,null,2).split("\n").map(function(t,e){return 0===e?t:" "+t}).join("\n"),".map(item => \n ").concat((i=e,s.some(function(t){return t&&void 0!==t.alt})?i.replace("url: item.img}","url: item.img, alt: item.alt}"):i),"\n )");var a=n.map(function(e){return o(e)?r.cardFromSpecs(t,e):r.cardFromShorthand(e)});return"[\n ".concat(a.join(",\n "),"\n ]")}},{key:"cardFromSpecs",value:function(t,e){var r=this,n=e.map(function(e){var n=r.mapType(ni(ni({},t),{},{el:e}));return"string"==typeof n?n.trim():(n&&"function"==typeof n.toCode?[].concat(n.toCode()).join(""):"").trim()}).filter(Boolean);return'new Card()\n .set({ width: "300px", height: "700px", radius: "0.7rem", mar: { sides: ["all"], value: "0.8rem" } })\n .items([\n '.concat(n.join(",\n "),"\n ])")}},{key:"cardFromShorthand",value:function(t){var e=function(t){return JSON.stringify(null!=t?t:"")};return'new Card()\n .set({ width: "300px", height: "700px", radius: "0.7rem", mar: { sides: ["all"], value: "0.8rem" } })\n .items([\n new Image('.concat(e(t.img),").set({isFull: true, url: ").concat(e(t.img)).concat(void 0===t.alt?"":", alt: ".concat(e(t.alt)),"}),\n new Text(").concat(e(t.title),').set({ size: "S5", tag: "h2", color: "#c2410c" }),\n new Link("Link").set({ text: ').concat(e(t.title),", url: ").concat(e(t.link),', background: "#1d6fe0", pad: [{ lr: "0.5rem", tb: "1rem" }], radius: "0.4rem", color: "white" })\n ])')}},{key:"checkbox",value:function(t){var e=t.el,r="string"==typeof e.label?new C(e.label).set({size:"S6"}):e.label;return this.attachRaster((new yr).set(ni(ni({},this.elOpts(e,["label"])),void 0!==r?{label:r}:{})),e,t.customOptions)}},{key:"stack",value:function(t){var e=this,r=t.el,n=(new qt).set(this.elOpts(r)),i=Array.isArray(r.children)?r.children:null;return i&&n.add(i.map(function(r){return e.mapType(ni(ni({},t),{},{el:r}))})),this.attachRaster(n,r,t.customOptions)}},{key:"form",value:function(t){var e,r=this,n=t.el,i=(new En).set(ni(ni({action:null!==(e=n.action)&&void 0!==e?e:""},void 0!==n.method?{method:n.method}:{}),void 0!==n.id?{id:n.id}:{})),o=Array.isArray(n.children)?n.children:null;return o&&i.add(o.map(function(e){return r.mapType(ni(ni({},t),{},{el:e}))})),i}},{key:"simple",value:function(t){var e,r,n=this,i=t.el,o=Array.isArray(i.react)?i.react:[];if(!o.length)throw new Error('[nodality] a "simple" element needs a non-empty `react` array of { at, template }.');var s=(Array.isArray(i.children)?i.children:[]).map(function(e){var r=n.mapType(ni(ni({},t),{},{el:e})).toCode();return Array.isArray(r)?r.join(""):String(r)}).join(",\n ");return"new AreaSwitcher()\n .set(".concat(JSON.stringify(ni({gap:null!==(e=i.gap)&&void 0!==e?e:"10px",height:null!==(r=i.height)&&void 0!==r?r:"700px"},void 0!==i.id?{id:i.id}:{})),")\n .react(").concat(JSON.stringify(o,null,2),")\n .add([\n ").concat(s,"\n ])")}},{key:"mapWrap",value:function(t){var e,r,n=this,i=t.el,o=null!==(e=t.el.kind)&&void 0!==e?e:"",s=new re(o).set(ni(ni({},i),{},{font:null!==(r=i.font)&&void 0!==r?r:"Arial",stroke:this.filtero("blast",i.id,t.customOptions),gradient:this.filtero("gradient",i.id,t.customOptions),animation:this.filtero("animation",i.id,t.customOptions),shadow:this.filtero("shadow",i.id,t.customOptions),transform:this.filtero("transform",i.id,t.customOptions),filtera:this.filtero("filter",i.id,t.customOptions),raster:this.filteroRaster(i.id,t.customOptions)})),a=Array.isArray(i.children)?i.children:null;return a&&s.add(a.map(function(e){return n.mapType(ni(ni({},t),{},{el:e}))})),s}},{key:"mapUList",value:function(t){var e,r,n=this,i=t.el,o=null!==(e=t.el.kind)&&void 0!==e?e:"",s=new _r(o).set(ni(ni({},i),{},{font:null!==(r=i.font)&&void 0!==r?r:"Arial",stroke:this.filtero("blast",i.id,t.customOptions),gradient:this.filtero("gradient",i.id,t.customOptions),animation:this.filtero("animation",i.id,t.customOptions),shadow:this.filtero("shadow",i.id,t.customOptions),transform:this.filtero("transform",i.id,t.customOptions),filtera:this.filtero("filter",i.id,t.customOptions),raster:this.filteroRaster(i.id,t.customOptions)})),a=Array.isArray(i.items)?i.items:null;return a&&s.setItems(a.map(function(e){return"string"==typeof e?new C(e).set({}):n.mapType(ni(ni({},t),{},{el:e}))})),s}},{key:"getElType",value:function(t){return"p"===t?"S6":"S".concat(t.substr(1))}},{key:"filtero",value:function(t,e,r){return r.filter(function(e){return e.op.name===t}).filter(function(t){return!t.target||t.target.some(function(t){return ai(t,e)})})[0]}},{key:"elOpts",value:function(t){for(var e=new Set(["type","children","items","breakpoints","inputType","text","url"].concat(Kn(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]))),r={},n=0,i=Object.keys(t);n<i.length;n++){var o=i[n];e.has(o)||(r[o]=t[o])}return r}},{key:"attachRaster",value:function(t,e,r){var n=this.filteroRaster(e.id,r);return n&&t&&"function"==typeof t.rasterize&&t.rasterize(n),t}},{key:"filteroRaster",value:function(e,r){var n=(r||[]).filter(function(r){return r&&"string"==typeof r.op&&t.includes(r.op)&&(!r.target||e&&r.target.some(function(t){return ai(t,e)}))});return n.length>0?n:void 0}}],r&&ei(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();export{si as ELEMENT_TYPES,ci as ElementMapper};
|
|
2
|
+
import{RASTER_OP_NAMES as t,applyRasterPipeline as e}from"../lib/raster-ops.js";var r={};function n(t){return n="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},n(t)}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var i="nodality.theme.mode",o="nodality:theme",a={mode:function(){try{var t=localStorage.getItem(i);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"===n(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"===n(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(i,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(o,e);try{t(this.mode,this.current)}catch(t){}return function(){return document.removeEventListener(o,e)}},_broadcast:function(){"undefined"!=typeof document&&document.dispatchEvent(new CustomEvent(o,{detail:{mode:this.mode,tokens:this.current}}))}};function s(){return new RegExp('"([A-Za-z_$][A-Za-z0-9_$]*)"\\s*:',"g")}function l(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4;return"string"!=typeof(e=JSON.stringify(t,null,r))?e:e.replace(s(),"$1:")}function c(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,c=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(t,e)||f(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 u(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=f(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function f(t,e){if(t){if("string"==typeof t)return d(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(t,e):void 0}}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function h(t){return h="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},h(t)}function p(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,y(n.key),n)}}function y(t){var e=function(t){if("object"!=h(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=h(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==h(e)?e:e+""}var m=new Set,v=function(){function t(){var e,r,n,i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,n=function(t){if(t.transform||t.op){var e=t.op;t.transform||(e=t.op),e.duration||(e.duration="3s-ease-in-out"),i.setDefault=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0px";return 0===t.length?e+" ":t};var r=function(){var r="",n="",o="",a="",s="",l="",c="",u="",f="";if(0!==e.values.length){e.values.forEach(function(t){t.startsWith("tx:")&&(r=t.replace("tx:","")),t.startsWith("ty:")&&(n=t.replace("ty:","")),t.startsWith("tz:")?o=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 r=e[1].split(",").map(function(t){return t.trim()});return 1===r.length?"rotate(".concat(r[0],")"):2===r.length?"rotateX(".concat(r[0],") rotateY(").concat(r[1],")"):3===r.length?"rotateX(".concat(r[0],") rotateY(").concat(r[1],") rotate(").concat(r[2],")"):t}(t):t.startsWith("perspective(")?c=t:t.startsWith("matrix(")?u=t:t.startsWith("opacity:")&&(f=t.replace("opacity:",""))}),r=i.setDefault(r),n=i.setDefault(n),o=i.setDefault(o);var d="";if("0px"!=n&&"0px"!=r&&"0px"!=o?d+="translate3d(".concat(r,", ").concat(n,", ").concat(o,")"):"0px"==n&&"0px"==r||(d+="translate(".concat(r,", ").concat(n,")")),a&&(d+=" ".concat(a)),l&&(d+=" ".concat(l)),s&&(d+=" ".concat(s)),c&&(d+=" ".concat(c)),u&&(d+=" ".concat(u)),d){if(t.op.duration){var h=t.op.duration.replace(/^(\d+)(s)-/,function(t,e,r){return e/2+r+" "}),p="transform ".concat(h,", opacity ").concat(h);i.res.style.transition=p}else i.res.style.transition="transform 3s ease-in-out, opacity 3s ease-in-out";t.op.static&&(i.res.style.transition=""),(i.blastTarget||i.res).style.transform=d,i.res.style.opacity=f}else console.warn("[nodality] transform produced no geometric value - check `values`")}};e.on?i.res.addEventListener(e.on,function(){e.delay?setTimeout(function(){r()},e.delay):r()}):i._on(window,"load",function(){e.delay?setTimeout(function(){r()},e.delay):r()});var n=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) "),i.res.style.opacity="1"}),t&&(i.res.style.transform=t.trim())};if(e.on)i.res.addEventListener("mouseout",function(){e.keep||n()});else{var o=1e3*parseFloat(e.duration),a=e.closeAfter?e.closeAfter:0;setTimeout(function(){e.keep||n()},o/2+a)}e.hardCSS&&(i.res.style.transform=e.hardCSS)}else console.warn("[nodality] reactOnTransform: unrecognised transform descriptor - ignored")},(r=y(r="reactOnTransform"))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,this.state={isExpanded:!1,isMovedUp:!1,isMovedDown:!1},this.openedElements=new WeakMap,"undefined"!=typeof document&&(this._themeUnsub=a.subscribe(function(t){return i._applyTheme(t)}),Promise.resolve().then(function(){return i._applyTheme(a.mode)}))}return r=t,n=[{key:"rasterize",value:function(t){var r=this;if(t&&0!==t.length&&!this._rasterHandle&&!this._rasterCancelled&&"undefined"!=typeof document&&"undefined"!=typeof setTimeout){var n=0,i=function(){if(!r._rasterHandle&&!r._rasterCancelled){if(r.res&&r.res.isConnected){try{r._rasterHandle=e(r.res,t)}catch(t){return void console.warn("[nodality] raster pipeline skipped:",t)}if(r._rasterHandle)return}++n<80&&(r._rasterTimer=setTimeout(i,50))}};this._rasterTimer=setTimeout(i,0),this._track(function(){return clearTimeout(r._rasterTimer)})}}},{key:"isHidden",value:function(t){t&&(this.res.style.display="none")}},{key:"theme",value:function(t){var e=this;return t&&"object"===h(t)?(this._themeMap=t,this._applyTheme(a.mode),this._themeUnsub||(this._themeUnsub=a.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,r,n){return t&&"function"==typeof t.addEventListener?(t.addEventListener(e,r,n),this._track(function(){return t.removeEventListener(e,r,n)}),r):r}},{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=u(this._disposables);try{for(e.s();!(t=e.n()).done;){var r=t.value;try{r()}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 r in e)this.res.style[r]=e[r]}else{var n=a.defaults&&a.defaults[t];if(n)for(var i in this._themeOriginal||(this._themeOriginal={}),n)i in this._themeOriginal||(this._themeOriginal[i]=this.res.style[i]||""),this._themeOriginal[i]||(this.res.style[i]=n[i])}}},{key:"vars",value:function(t){if(!t||"object"!==h(t))return this;for(var e in t)this.res.style.setProperty(e,String(t[e]));return this}},{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",color:"color",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",cols:"gridTemplateColumns",rows:"gridTemplateRows",areas:"gridTemplateAreas",area:"gridArea",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 r in e)null!=t[r]&&(this.res.style[e[r]]=t[r]);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.borderObj&&t.borderObj.width&&this.borderObj(t.borderObj),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.vars&&this.vars(t.vars),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.center&&this.center(t.center,{display:t.disp||t.display,flexDirection:t.flexDir||t.flexDirection}),t.transform&&"object"===h(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 r=t.border.width;this.res.style.border=r?"".concat(r,"px solid transparent"):"1px solid transparent"}var n=this.options&&this.options.borderObj;return n&&(this.res.style.border="".concat(n.width,"px solid ").concat(n.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 r,n=t.border.width,i=null!==(r=t.border.color)&&void 0!==r?r:"#2ECC71";e.res.style.border=n?"".concat(n,"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,r=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"}},n=function(t){var r=t&&null!=t.tx?t.tx:"0px",n=t&&null!=t.ty?t.ty:"0px";e.res.style.transform="translate3d(".concat(r,", ").concat(n,", 0)")};"opacity"===t.value?this.res.style.opacity=t.valMin:"scale"===t.value?this.res.style.transform="scale(".concat(t.valMin,")"):"trn"===t.value&&n(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 f=r(c?t.valMin[l]:u?t.valMax[l]:"0px"),d=r(u?t.valMax[l]:c?t.valMin[l]:"0px"),h=e.smartRange(window.scrollY,{min:t.from,max:t.to},{min:f.num,max:d.num});o[l]="".concat(h).concat(f.unit)}}n(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:"_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,r){var n=this;this.options=r;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 n[t]||e in n.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 u=new Set;e.forEach(function(t){Object.keys(t).forEach(function(t){o.includes(t)||"range"===t||u.add(t)})}),u.forEach(function(t){void 0===l[t]&&(l[t]=n.options[t]||"initial")}),this._responsiveTasks=this._responsiveTasks||[],this._responsiveTasks.push(function(){for(var r=t.viewportWidth(),i=l,a=0;a<e.length;a++){var f=e[a],d=c(f.range,2),h=d[0],p=d[1];if("default"!==f.breakpoint&&r>=h&&r<=p){i=f;break}}for(var y in u.forEach(function(t){if("keySet"===t){var e=l[t];e&&e.key&&(n.res.style[e.key]=e.value)}else n.res.style[s(t)]=l[t]}),i)if("exact"!==y){if(!o.includes(y)&&"range"!==y){var m=i[y];"keySet"===y&&m&&m.key?n.res.style[m.key]=m.value:"function"==typeof n[y]?n[y](m):n.res.style[s(y)]=m}}else n.res.style.fontSize=i[y]}),this._setupResponsiveManager()}},{key:"respad",value:function(e){var r=this,n={default:[0,1e5],xs:[0,575],sm:[576,767],md:[768,991],lg:[992,1199],xl:[1200,1399],xxl:[1400,1e5]};e.forEach(function(t){void 0!==n[t.breakpoint]?t.range=n[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:n.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 n=t.viewportWidth(),o=i,a=0;a<e.length;a++){var s=e[a],l=c(s.range,2),u=l[0],f=l[1];if("default"!==s.breakpoint&&n>=u&&n<=f){o=s;break}}var d=void 0!==o.values?o.values:i.values;null!=d&&r.pad(d)}),this._setupResponsiveManager()}},{key:"resmar",value:function(e){var r=this,n={default:[0,1e5],xs:[0,575],sm:[576,767],md:[768,991],lg:[992,1199],xl:[1200,1399],xxl:[1400,1e5]};e.forEach(function(t){void 0!==n[t.breakpoint]?t.range=n[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:n.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 n=t.viewportWidth(),o=i,a=0;a<e.length;a++){var s=e[a],l=c(s.range,2),u=l[0],f=l[1];if("default"!==s.breakpoint&&n>=u&&n<=f){o=s;break}}var d=void 0!==o.values?o.values:i.values;null!=d&&r.mar(d)}),this._setupResponsiveManager()}},{key:"color",value:function(t){return this.res.style.color=t,this}},{key:"onTap",value:function(t){return this.res.addEventListener("click",t),this}},{key:"setArea",value:function(t){return this.res.style.gridArea=t,this}},{key:"font",value:function(t){return this.res.style.fontFamily=t,this}},{key:"radius",value:function(t){return this.res.style.borderRadius="number"==typeof t?"".concat(t,"px"):t,this}},{key:"width",value:function(t){return this.res.style.width=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:"round",value:function(t){return this.deprecatedOption("round()","radius()"),this.radius(t)}},{key:"toCSS",value:function(){return this.css}},{key:"toHTMLA",value:function(){return this.html}},{key:"background",value:function(t){return this.res.style.background=t,this}},{key:"deprecatedOption",value:function(t,e){var r="nodality: `".concat(t,"` is deprecated — use `").concat(e,"` instead.");return m.has(r)||(m.add(r),console.error(r)),this}},{key:"center",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.res.style,n=r.display||e.display||"",i=r.flexDirection||e.flexDirection||"",o=!0===t||"both"===t||"x"===t,a=!0===t||"both"===t||"y"===t;if(n.includes("grid"))return o&&(r.justifyItems="center",r.justifyContent="center"),a&&(r.alignItems="center",r.alignContent="center"),this;n.includes("flex")||(r.display="flex"),r.flexDirection||(r.flexDirection=i||"column");var s=(r.flexDirection||"column").startsWith("column");return(s?a:o)&&(r.justifyContent="center"),(s?o:a)&&(r.alignItems="center"),this}},{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 r=Object.keys(t[e]),n=0;n<r.length;n++)for(var i=r[n],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 r=Object.keys(t[e]),n=0;n<r.length;n++){for(var i=r[n],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,r){t<e.min&&(t=e.min),t>e.max&&(t=e.max);var n=(t-e.min)/(e.max-e.min);return e.min>e.max&&(n=(t-e.max)/(e.min-e.max)),r.min+(r.max-r.min)*n}},{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 r=document.createTextNode(this.text);this.res.appendChild(r),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 n=document.createTextNode(this.text);this.res.appendChild(n),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,r=null!==(e=t.type)&&void 0!==e?e:"solid";return this.res.style.border="".concat(t.width," ").concat(r," ").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,r,n){var i=this;this.ap=!1,this.cta=0,this.once=!1;var o,a=u(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 f,d=u(e);try{for(d.s();!(f=d.n()).done;){var h=f.value;i.counterIndex++;var p=c(h.range,2),y=p[0],m=p[1],v=parseInt(y),b=parseInt(m),g=!0;if(h.target){g=!1;for(var w=0;w<h.target.length;w++){var k=function(t){return"string"==typeof t&&"#"===t.charAt(0)?t.slice(1):t};k(h.target[w])===k(r)&&(g=!0)}}a>=v&&a<=b&&g&&(s.push(h.log),l.push(h),h.op&&h.op.margin&&(i.useMargin=h.op.margin))}}catch(t){d.e(t)}finally{d.f()}if(n&&!n.includes("background")&&(i.res.style.background="",i.res.style.backgroundColor=""),i.res.style.textShadow="",n&&!n.includes("border")&&(i.res.style.border=""),n&&!n.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 O,x=l.filter(function(t){return"blast"===t.log})[0].op.color,S=null!==(O=l.filter(function(t){return"blast"===t.log})[0].op.width)&&void 0!==O?O:"1px";"FlexRowLayoutElement"===i.getType()||"LayoutWrapperElement"===i.getType()?(i.res.style.border="".concat("number"==typeof S?S+"px":S," 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"]=x,i.res.style["-webkit-text-stroke-width"]="".concat(S))}if(s.includes("filter")){var j=l.filter(function(t){return"filter"===t.log})[0].op.filter;i.res.style.filter=j}if(s.includes("background")&&(i.res.style.backgroundColor="green"),s.includes("gradient")&&i.globalGradient&&("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 C,E,P,T,A=i.options.shadow.op,_=null!==(C=A.steps)&&void 0!==C?C:1,R=null!==(E=A.colors)&&void 0!==E?E:["gray"],W=null!==(P=A.movements)&&void 0!==P?P:["3px","3px"],z=null!==(T=A.radius)&&void 0!==T?T:"3px";if(1===W.length&&(W=[W[0],W[0]]),"FlexRowLayoutElement"===i.getType()||"LayoutWrapperElement"===i.getType()){for(var I=[],L=0;L<_;L++){var M,N=null!==(M=R[L])&&void 0!==M?M:R[0],F=W[0],B=W[1];I.push("".concat(F," ").concat(B," ").concat(z," ").concat(N))}i.res.style.boxShadow=I.join(", ")}else{for(var D=[],H=0;H<_;H++){var J,$=null!==(J=R[H])&&void 0!==J?J:R[0],q=W[0],G=W[1];D.push("drop-shadow(".concat(q," ").concat(G," ").concat(z," ").concat($,")"))}i.res.style.filter=D.join(" ")}}if(s.includes("margin"))for(w=0;w<e.length;w++)if(e[w].op){var U=e[w].op.offsets;U&&void 0!==i.index&&(i.res.style.margin=U[Number(i.index)]+"px")}if(s.includes("spana")||s.includes("span")){var Q=document.createElement("div");if(Q.setAttribute("id","oroa"),Object.assign(Q.style,{position:"absolute",inset:"0",background:"linear-gradient(90deg, rgb(52,152,219), rgb(26,188,156))",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",pointerEvents:"none"}),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,r=i.prevText||"";if(t.op.parts.forEach(function(t){var n=t.text,o=t.style||{};if(e<r.length){var a=r.indexOf(n,e);if(a>e){var s=r.substring(e,a);i.res.appendChild(new i.constructor(s).setup({type:"span",id:o.id,animation:o.animation}).set({}).render())}e=a+n.length}var l=new i.constructor(n).setup({type:"span",id:o.id,animation:o.animation}).set(o).render();i.res.appendChild(l)}),e<r.length){var n=r.substring(e);i.res.appendChild(new i.constructor(n).setup({type:"span"}).set({}).render())}}})}else{var V=new i.constructor(i.prevText).set({}).render();i.prevText&&i.prevText.length>0&&o&&i.res.appendChild(V)}if(s.includes("animation")){if(i.options.animation&&!i.hasAnimated&&!i.options.animation.op.fireAt){i.hasAnimated=!0;var X=i.options.animation.op;i._on(window,"sidebar:open",function(){i.res.animate(X.keyframesOpen,X.openOptions)}),i._on(window,"sidebar:closed",function(){i.res.animate(X.keyframesClose,X.closeOptions)}),i.res.animate(X.keyframesClose,{duration:0,fill:"forwards"}),i.openTag&&i.closeTag&&(i._on(window,i.openTag,function(){i.res.animate(X.keyframesOpen,X.openOptions)}),i._on(window,i.closeTag,function(){i.res.animate(X.keyframesClose,X.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 Z=function(){window.scrollY>parseFloat(Y.fireAt)&&(i.res.animate(Y.keyframesOpen,Y.openOptions),window.removeEventListener("scroll",Z))};i._on(window,"scroll",Z)}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 tt=!1,et=new IntersectionObserver(function(t,e){t.forEach(function(t){t.isIntersecting&&!tt&&(tt=!0,i.res.animate(K.keyframesOpen,K.openOptions),e.disconnect())})});et.observe(i.res),i._track(function(){return et.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(s(),"$1:")}}],i=[{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&&p(r.prototype,n),i&&p(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function b(t){return b="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},b(t)}function g(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function w(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,k(n.key),n)}}function k(t){var e=function(t){if("object"!=b(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=b(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==b(e)?e:e+""}function O(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(O=function(){return!!t})()}function x(t,e,r,n){var i=S(j(1&n?t.prototype:t),e,r);return 2&n&&"function"==typeof i?function(t){return i.apply(r,t)}:i}function S(){return S="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=j(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},S.apply(null,arguments)}function j(t){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},j(t)}function C(t,e){return C=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},C(t,e)}var E=function(){function t(e,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(t,e,r){return e=j(e),function(t,e){if(e&&("object"==b(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)}(t,O()?Reflect.construct(e,r||[],j(t).constructor):e.apply(t,r))}(this,t)).text=e,n.res=null,n.setup(r),n.code=[],n.elCSS=[],n.html=[],n.react=[],n.code.push('new Text("'.concat(n.text,'")')),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&&C(t,e)}(t,v),e=t,r=[{key:"toCode",value:function(){if(this.excludeFromCodeTrue)return[""];var t=l(Object.fromEntries(Object.entries(this.options).filter(function(t){var e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,c=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return g(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?g(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.")}()}(t,2);return e[0],null!==e[1]})),4);return['new Text("'.concat(this.text,'").set(').concat(t,")")]}},{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:"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:"setClass",value:function(t){return this.res.setAttribute("class",t),this}},{key:"styled",value:function(t){return this.set(t),this}},{key:"removeQuotesFromFirstWord",value:function(t){return t.replace(s(),"$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){if(this.resCopy=this.res,this.options=e,x(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&&x(t,"setIndex",this,3)([e.index]),e.index&&(this.index=e.index),e.preffersId&&(this.preffersId=e.preffersId),x(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),x(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),x(t,"setClass",this,3)([this.options.class]),e.clampc&&this.clampCopy(e.clampc),e.absolute&&(this.res.style.position="absolute"),e.em&&this.em(e.em),e.fluid&&this.fluid(e.fluid),e.tag&&/^(h[1-6]|p)$/.test(String(e.tag))){var r=String(e.tag).toLowerCase();if(this.res&&this.res.tagName.toLowerCase()!==r){for(var n=document.createElement(r),i=0,o=Array.from(this.res.attributes);i<o.length;i++){var a=o[i];n.setAttribute(a.name,a.value)}for(;this.res.firstChild;)n.appendChild(this.res.firstChild);this.res=n}}return e.fluidc&&this.elCSS.push("font-family: ".concat(e.font,"; \n")),e.align&&(this.res.style.textAlign=e.align),e.breakWord&&(this.res.style.wordWrap="break-word"),e.center&&this.deprecatedOption("center on Text",'mar: "center"'),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 r=[],n=e.transform&&"object"===b(e.transform);if(e.stroke||e.gradient||e.span||e.backgroundOp||e.layout||e.shadow||e.animation||e.filtera||n){e.gradient&&(this.globalGradient=e.gradient.op.gradient,"radial"===e.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)")),e.stroke&&x(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,n?e.transform:void 0];i=i.filter(function(t){return null!=t});for(var o=0;o<i.length;o++)r.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(r,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),e.setAttribute("alt",void 0===t.alt?"":String(t.alt)),this.res.appendChild(e),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:"stringGen",value:function(t){for(var e="",r=0;r<t;r++)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 r=this.stringGen(1e3);return this.res.setAttribute("id",r),document.styleSheets[0].insertRule("#".concat(r,"::first-letter { color: green; font-size: 3em; padding: 0.1em }"),0),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 r=document.createTextNode(this.text);this.res.appendChild(r),this.res.style.fontSize="calc(1.525rem + 3.525vw)"}if("S3"===t){this.res=document.createElement("h3");var n=document.createTextNode(this.text);this.res.appendChild(n),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:"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:"responsive",value:function(t){var e=this;this.set=!1,this.setB=!1;var r=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 r(),window.addEventListener("resize",r),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 r=function(){for(var r=0;r<t.length;r++)t[r].width&&window.matchMedia("(min-width: ".concat(t[r].width,"px)")).matches&&(e.res.style.fontSize="".concat(t[r].size));window.matchMedia("(max-device-width: 415px)").matches&&(e.res.style.fontSize="".concat(t[t.length-1].mobile))};return r(),window.addEventListener("resize",r),this}},{key:"setup",value:function(t){var e;t?(e=document.createElement(t.type),void 0!==t.id&&null!==t.id&&e.setAttribute("id",t.id),"span"===t.type&&t.animation&&(e.style.position="relative",e.style.display="block")):e=document.createElement("p");var r=document.createTextNode(this.text);return e.appendChild(r),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:"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:"updating",value:function(t,e){var r=this.res,n=this.text;return Object.defineProperty(t,e,{set:function(t){var e=document.createTextNode(n.replace("$",t));r.replaceChild(e,r.childNodes[0])}}),this}},{key:"apply",value:function(t){var e=this,r=this.res.styles,n=function(){for(var n=0;n<t.length;n++){var i=t[n];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,r):window.matchMedia("(max-width: ".concat(i.max,"px)")).matches?Object.assign(e.res.style,i.styles):Object.assign(e.res.style,r)}};return n(),window.addEventListener("resize",n),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)}}],r&&w(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();function P(t){return P="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},P(t)}function T(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function A(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,_(n.key),n)}}function _(t){var e=function(t){if("object"!=P(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=P(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==P(e)?e:e+""}function R(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(R=function(){return!!t})()}function W(t,e,r,n){var i=z(I(1&n?t.prototype:t),e,r);return 2&n&&"function"==typeof i?function(t){return i.apply(r,t)}:i}function z(){return z="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=I(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},z.apply(null,arguments)}function I(t){return I=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},I(t)}function L(t,e){return L=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},L(t,e)}var M=function(){function t(e,r,n,i){var o;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(o=function(t,e,r){return e=I(e),function(t,e){if(e&&("object"==P(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)}(t,R()?Reflect.construct(e,r||[],I(t).constructor):e.apply(t,r))}(this,t)).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&&L(t,e)}(t,v),e=t,r=[{key:"setType",value:function(t){t.url;var e=t.type,r=t.mode;if(this.code=[],"exact"===e){var n='new Image("'.concat(this.url,'", "exact")');this.code.push(n)}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,r,e),this}},{key:"hand",value:function(){return this.res.style.cursor="hand",this}},{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=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,c=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return T(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?T(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.")}()}(t,2);return e[0],null!==e[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 r="";this.options=e;var n=e;n.onTap&&this.onTap(n.onTap);var i=e.isFull;if(i?this.image(e.url,"exact",i,"a"):this.setup(),"IMG"===this.res.tagName?e.url&&this.res.setAttribute("src",e.url):void 0!==e.alt&&(this.res.setAttribute("role","img"),this.res.setAttribute("aria-label",e.alt)),"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&&(r+=' 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(n),e.vtn&&(this.res.style.viewTransitionName=e.vtn),this.vtn=e.vtn,e.minHeight&&(this.res.style.minHeight=e.minHeight),e.index&&W(t,"setIndex",this,3)([e.index]),e.index&&(this.index=e.index),e.index&&(r+='\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&&(r+='\n objectFit: "'.concat(e.objectFit,'",')),e.objectPosition&&(this.res.style.objectPosition=e.objectPosition),e.objectPosition&&(r+='\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,r+="\n gpos: ".concat(this.removeQuotesFromFirstWord(JSON.stringify(e.gpos)),", ")),e.filtera){var o;o=Array.isArray(e.filtera)?n.filtera.filter(function(t){return"filter"===t.op.name})[0]:e.filtera;var a=this.removeQuotesFromFirstWord(JSON.stringify(o));r+="\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&&(r+='\n zIndex: "'.concat(e.zIndex,'", \n')),e.area&&this.setArea(e.area),e.area&&(r+='area: "'.concat(e.area,'", \n')),e.opacity&&(this.res.style.opacity=e.opacity),e.width&&(this.res.style.width=e.width),e.width&&(r+='width: "'.concat(e.width,'", ')),e.maxWidth&&(this.res.style.maxWidth=e.maxWidth),e.maxWidth&&(r+='maxWidth: "'.concat(e.maxWidth,'", ')),e.height&&(this.res.style.height=e.height),e.height&&(r+='height: "'.concat(e.height,'", ')),e.maxWidth&&this.maxWidth(e.maxWidth),e.maxWidth&&(r+='maxWidth: "'.concat(e.maxWidth,'", \n')),e.radius&&this.cornerRadius(e.radius),e.radius&&(r+='radius: "'.concat(e.radius,'", \n')),e.marginOp){var s=this.removeQuotesFromFirstWord(JSON.stringify(e.marginOp));r+="\n marginOp: ".concat(s,",")}if(e.clipPath&&this.clipPath(e.clipPath),e.clipPath&&(r+='clipPath: "'.concat(e.clipPath,'", \n')),n.stroke||n.gradient||n.span||n.backgroundOp||n.layout||n.marginOp||n.shadow||n.filtera||n.animation){n.gradient,n.gradient&&(this.globalGradient=n.gradient.op.gradient),n.stroke&&W(t,"setAny",this,3)([{globalBlast:"".concat(n.stroke.op.width," ").concat(n.stroke.op.color)}]);var l=[n.stroke,n.gradient,n.animation,n.span,n.backgroundOp,n.layout,n.marginOp,n.shadow,n.filtera,n.animation];l=l.filter(function(t){return null!=t});for(var c=[],u=0;u<l.length;u++)c.push({range:l[u].range,log:l[u].op.name,target:l[u].target,op:l[u].op});this.chainReact(c,this.options.id)}if(n.shadow){var f=n.shadow,d=this.removeQuotesFromFirstWord(JSON.stringify(f));r+="\n shadow: ".concat(d,",")}if(n.animation){var h=n.animation,p=this.removeQuotesFromFirstWord(JSON.stringify(h));r+="\n animation: ".concat(p,",")}var y="\n .set({".concat(r,"}) \n \n");return Object.keys(e).length>0?this.code.push(y):this.code.push(","),this}},{key:"setID",value:function(t){return null!=t&&this.res.setAttribute("id",t),this}},{key:"opacity",value:function(t){return this.res.style.opacity="".concat(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:"setClass",value:function(t){return this.res.setAttribute("class",t),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:"mobileWidth",value:function(){return window.matchMedia("(max-device-width: 415px)").matches&&(this.res.style.width="120%"),this}},{key:"image",value:function(t,e,r,n,i){var o=window.matchMedia("(max-device-width: 415px)"),a=document.createElement("div");return a.style.viewTransitionName=n,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"===r&&(a.style.backgroundSize="contain"),"contain"===e&&(a.style.backgroundSize="contain"),this.res=a,this}},{key:"setup",value:function(){var t=document.createElement("img");return t.style.width="100%",t.src=this.url,this.res=t,this}},{key:"float",value:function(t){return this.res.style.float="".concat(t),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,r=function(){var r,n;if(window.matchMedia("(min-width: ".concat(t.at,")")).matches){e.res.style.width="".concat(t.width);var i=window.innerWidth/2-(n=r=t.width,(r.includes("%")||r.includes("px"))&&(n=n.substr(0,2)),(r.includes("%")?Number(n/100*window.innerWidth):r.includes("px")?Number(n):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 r(),window.addEventListener("resize",r),this}},{key:"width",value:function(t){return this.res.style.width=t,this.res.style.height="auto",this}},{key:"dimensions",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:"size",value:function(t,e){return this.deprecatedOption("size() on this component","dimensions(w, h)"),this.dimensions(t,e)}},{key:"frame",value:function(t){var e=t.width,r=t.height;return e&&r?(this.res.style.width=e,this.res.style.height=r):(this.res.style.width=e,this.res.style.height=e),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:"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)}}],r&&A(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();function N(t){return N="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},N(t)}function F(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function B(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,D(n.key),n)}}function D(t){var e=function(t){if("object"!=N(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=N(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==N(e)?e:e+""}function H(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(H=function(){return!!t})()}function J(t,e,r,n){var i=$(q(1&n?t.prototype:t),e,r);return 2&n&&"function"==typeof i?function(t){return i.apply(r,t)}:i}function $(){return $="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=q(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},$.apply(null,arguments)}function q(t){return q=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},q(t)}function G(t,e){return G=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},G(t,e)}var U=function(){function t(e,r,n){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(i=function(t,e,r){return e=q(e),function(t,e){if(e&&("object"==N(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)}(t,H()?Reflect.construct(e,r||[],q(t).constructor):e.apply(t,r))}(this,t)).link=r,i.text=e,i.code=[],i.css=[],i.elCSS=[],i.html=[],i.res=null,i.stopEM=n,i.setup(),i.inlineBlock(),i.res.addEventListener("click",function(t){var e=i.link||i.res.getAttribute("href");if(e){var r=new URL(e,window.location.href).href,n=/^https?:\/\//i.test(r),o=r.startsWith("#"),a=/^[a-zA-Z]+:/.test(r);n||o||r.endsWith(".html")||a||(t.preventDefault(),"navigation"in window?navigation.navigate(r):(history.pushState({},"",r),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&&G(t,e)}(t,v),e=t,(r=[{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=l(Object.fromEntries(Object.entries(this.options).filter(function(t){var e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,c=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return F(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?F(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.")}()}(t,2);return e[0],null!==e[1]})),4);return["new Link().set(".concat(t,")")]}},{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 r=document.createElement("a");t.options.vtn&&(r.style.viewTransitionName=t.options.vtn),r.setAttribute("href",t.options.url);var n=document.createElement("img");return t.options&&(n.style.width=t.options.size,t.options.radius&&(n.style.borderRadius=t.options.radius),n.setAttribute("src",t.options.img),t.options.pad&&(this.res.style.padding=t.options.pad),r.appendChild(n)),this.res=r,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(s(),"$1:")}},{key:"set",value:function(e){this.elCSS.push("text-decoration: none; \n"),this.options=e;var r="";e.onTap&&this.onTap(e.onTap),e.tags&&J(t,"setTags",this,3)([e.tags]),e.id&&this.res.setAttribute("id",e.id),e.id&&J(t,"setID",this,3)([e.id]),this.commonMethods(e),e.flex&&(this.res.style.display="flex"),e.fixMobileTap&&this.fixMobileTap(e.fixMobileTap);var n=this.removeQuotesFromFirstWord(JSON.stringify(e.pad));if(e.pad&&(r+="\n pad: ".concat(n,",")),e.preffersId&&(this.preffersId=e.preffersId),null!=e.preffersId&&(r+="\n preffersId: ".concat(e.preffersId,",")),e.class&&J(t,"setClass",this,3)([e.class]),e.class&&(r+='\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));r+="\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));J(t,"setAny",this,3)([{globalBlast:"1px ".concat(e.blastData.color)}]),e.blastData&&(r+="\n blastData: ".concat(o,","))}e.nowrap&&(this.res.style.whiteSpace="nowrap"),e.font&&this.font(e.font),e.font&&(r+='\n font: "'.concat(e.font,'",')),e.font&&this.elCSS.push('font-family: "'.concat(e.font,'"; \n')),e.fluidc&&this.fluidCopy(e.fluidc),e.fluidc&&(r+='\n fluidc: "'.concat(e.fluidc,'",')),e.clampc&&this.clampCopy(e.clampc),this.options.id&&(r+='\n id: "'.concat(this.options.id,'",')),e.align&&this.leftAlign(e.align),e.align&&(r+='\n align: "'.concat(e.align,'",')),e.type&&(this.res.style.display="block"),e.color&&this.color(e.color),e.color&&(r+='\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&&(r+="\n background: ".concat(a,",")),e.hover&&this.hover(e.hover);var s=this.removeQuotesFromFirstWord(JSON.stringify(e.hover));if(e.hover&&(r+="\n hover: ".concat(s,",")),e.blast&&(this.blastData=e.blast),e.bold&&(r+="\n bold: ".concat(e.bold,",")),e.block&&this.toBlock(),e.block&&(r+="\n block: ".concat(e.block,",")),e.radius&&(r+='\n radius: "'.concat(e.radius,'",')),e.width&&(r+='\n width: "'.concat(e.width,'",')),e.maxWidth&&this.maxWidth(e.maxWidth),e.url&&this.res.setAttribute("href",e.url),r+='\n url: "'.concat(e.url,'",'),e.text&&(this.res.textContent=e.text),r+='\n text: "'.concat(e.text,'",'),e.data){e.data&&this.appendImageAsChild(e.data,"20px");var l=this.removeQuotesFromFirstWord(JSON.stringify(e.data));e.data&&(r+="\n data: ".concat(l))}if(e.icon){this.addIcon(e.icon);var c=this.removeQuotesFromFirstWord(JSON.stringify(e.icon));r+="\n icon: ".concat(c,",")}if(e.shadow){var u=e.shadow,f=this.removeQuotesFromFirstWord(JSON.stringify(u));r+="\n shadow: ".concat(f,",")}if(e.stroke){var d=this.removeQuotesFromFirstWord(JSON.stringify(e.stroke));e.stroke&&(r+="\n stroke: ".concat(d,","))}if(e.backgroundOp){var h=this.removeQuotesFromFirstWord(JSON.stringify(e.backgroundOp));r+="\n backgroundOp: ".concat(h,",")}if(e.marginOp){var p=this.removeQuotesFromFirstWord(JSON.stringify(e.marginOp));r+="\n marginOp: ".concat(p,",")}if(e.gradient){var y=this.removeQuotesFromFirstWord(JSON.stringify(e.gradient));r+="\n gradient: ".concat(y,",")}if(e.animation){var m=this.removeQuotesFromFirstWord(JSON.stringify(e.animation));r+="\n animation: ".concat(m,",")}if(e.transform){var v=this.removeQuotesFromFirstWord(JSON.stringify(e.transform));r+="\n transform: ".concat(v,",")}if(e.blast){var b=this.removeQuotesFromFirstWord(JSON.stringify(e.blast));r+="\n blast: ".concat(b,",")}var g="new Link().set({".concat(r,"}) \n");this.code.push(g),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 w=[],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&&J(t,"setAny",this,3)([{globalBlast:"".concat(e.stroke.op.width," ").concat(e.stroke.op.color)}]);for(var O=0;O<k.length;O++)w.push({range:k[O].range,log:k[O].op.name,target:k[O].target,op:k[O].op});var x=[];e.borderObj&&x.push("border"),e.background&&x.push("background"),e.mar&&x.push("margin"),e.animation&&x.push("animation"),this.chainReact(w,e.id,x,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:"maxWidth",value:function(t){return this.res.style.maxWidth=t,this}},{key:"leftAlign",value:function(t){return this.res.style.textAlign=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:"color",value:function(t){return this.res.style.color=t,this}},{key:"newWindow",value:function(){return this.res.target="_new",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:"italic",value:function(){return this.res.style.fontStyle="italic",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:"em",value:function(t){var e=this,r=window.matchMedia("(max-device-width: 415px)"),n=function(){r.matches?e.res.style.fontSize="2em":e.res.style.fontSize="1em"};return n(),window.addEventListener("resize",n),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}}])&&B(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();function Q(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,c=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return V(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?V(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 V(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function X(t){return X="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},X(t)}function Y(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Z(n.key),n)}}function Z(t){var e=function(t){if("object"!=X(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=X(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==X(e)?e:e+""}function K(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(K=function(){return!!t})()}function tt(){return tt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=et(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},tt.apply(null,arguments)}function et(t){return et=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},et(t)}function rt(t,e){return rt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},rt(t,e)}var nt=function(){function t(e,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(t,e,r){return e=et(e),function(t,e){if(e&&("object"==X(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)}(t,K()?Reflect.construct(e,r||[],et(t).constructor):e.apply(t,r))}(this,t)).code=[],n.saveEl=r,n.frs=e,n.res=null,n.setup(),n.responsive(),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&&rt(t,e)}(t,v),e=t,r=[{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.pad([{a: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.deprecatedOption("toColumn","colat"),t.column&&this.makeCol(),t.colat&&t.colat&&this.toColumnAt(t.colat),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 r,n,i,o=[],a=e.transform&&"object"===X(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=t,n=this,"function"==typeof(i=tt(et(1&3?r.prototype:r),"setAny",n))?function(t){return i.apply(n,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"),this.chainReact(o,e.id,c)}}},{key:"toColumnAt",value:function(t){var e=this;if(!this.columnAlways){var r=function(){var r=window.matchMedia("(max-width: ".concat(t,")")),n=window.matchMedia("(max-device-width: 415px)");r.matches||n.matches?e.res.style.flexDirection="column":e.res.style.flexDirection="row"};r(),window.addEventListener("resize",r)}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:"toCode",value:function(){for(var t={},e=0,r=Object.entries(this.options||{});e<r.length;e++){var n=Q(r[e],2),i=n[0],o=n[1];null!=o&&""!==o&&(t[i]=o)}var a=JSON.stringify(t,null,4).replace(s(),"$1:").replace(/"([^"]*)"/g,function(t,e){return e.includes("\n")?"`"+e.replace(/`/g,"\\`")+"`":'"'.concat(e,'"')}),l=(this.items||[]).map(function(t){return null!=t&&t.toCode?t.toCode():"/* element */"}).join(",\n ");return[["new FlexRow().set(".concat(a,")"),l?".items([\n ".concat(l,"\n])"):""].join("")]}},{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:"setClass",value:function(t){return 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:"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:"radius",value:function(t){return this.res.style.borderRadius="".concat(t,"px"),this}},{key:"shadow",value:function(t,e,r){return this.res.style.boxShadow="0px 1px 10px 0px rgb(145 145 145)",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 r=t[e].render();this.res.appendChild(r)}else this.res.appendChild(t[e]);if(null!=t[e]&&t[e].render instanceof Function){var n=t[e].render();this.res.appendChild(n),void 0!==t[e].toCode&&this.code.push(t[e].toCode().flatMap(function(t){return t}))}}return this}},{key:"responsive",value:function(t){var e=this,r=window.matchMedia("(max-device-width: 415px)");return window.innerWidth<t||r.matches?this.res.style.gridTemplateColumns="1fr":this.res.style.gridTemplateColumns="1fr 1fr",window.addEventListener("resize",function(){window.innerWidth<t||r.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)}}],r&&Y(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();function it(t){return it="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},it(t)}function ot(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,at(n.key),n)}}function at(t){var e=function(t){if("object"!=it(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=it(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==it(e)?e:e+""}var st=function(){return t=function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.obj=e||{},this.items=r||[]},(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)"),r=window.matchMedia("(max-width: 600px)");(e.matches||r.matches)&&(t.style.marginTop="3rem");for(var n=0;n<this.items.length;n++){var i=this.items[n];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}}])&&ot(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function lt(t){return lt="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},lt(t)}function ct(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return ut(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ut(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function ut(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function ft(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,dt(n.key),n)}}function dt(t){var e=function(t){if("object"!=lt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=lt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==lt(e)?e:e+""}function ht(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ht=function(){return!!t})()}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)}"undefined"!=typeof window&&(window.CustomDivRenderer=st);var mt=function(){function t(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),function(t,e,r){return e=pt(e),function(t,e){if(e&&("object"==lt(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)}(t,ht()?Reflect.construct(e,r||[],pt(t).constructor):e.apply(t,r))}(this,t)}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,v),e=t,(r=[{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 r=this.res.children[0];if(this.closed)if(r.style.overflowX="hidden",t.style.opacity=1,this.animate){this.ope=r.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 n,i=-1,o=ct(r.children);try{for(o.s();!(n=o.n()).done;){var a=n.value;if(i+=1,this.masterEL[i]){var s,l=ct(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 r.style.display="none";else{r.style.overflowX="none";var f,d=-1,h=ct(r.children);try{for(h.s();!(f=h.n()).done;){var p=f.value;d+=1;var y,m=ct(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 b=this.masterEL[d].options.animation;if(b){var g=b.op.openOptions;g.delay||(g.delay=1),g.duration||(g.duration=300),v.animate(b.op.keyframesOpen,g)}}}}catch(t){m.e(t)}finally{m.f()}}}catch(t){h.e(t)}finally{h.f()}t.style.opacity=0,this.animate?(r.style.display="flex",this.opeClose=r.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)})):r.style.display="flex"}}},{key:"createToggleButton",value:function(t){var e=document.createElement("button");return e.textContent="☰",e.style.padding="10px 20px",e.style.minWidth="24px",e.style.minHeight="24px",e.style.lineHeight="1",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.textContent="×",e.style.fontSize="1.6rem",e.style.padding="10px 20px",e.style.minWidth="24px",e.style.minHeight="24px",e.style.lineHeight="1",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,r=document.createElement("div");r.style.display="flex",r.style.justifyContent="flex-end";var n=document.createElement("div");n.style.display="none",n.style.background=this.obj.background||"#1abc9c",n.style.height="100%",window.matchMedia("(max-device-width: 415px)").matches?n.style.width="100%":n.style.width=this.obj.width||"400px",n.style.position="fixed",n.style.right=0,this.animate&&(n.style.transform="translateX(100%)"),n.style.flexDirection="column",n.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)}),n.appendChild(o),r.appendChild(n),r.appendChild(i),r}},{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 r=this.masterEL[0].options.animation;if(r){var n,i=ct(this.res.children[0].children);try{for(i.s();!(n=i.n()).done;){var o,a=ct(n.value.children);try{for(a.s();!(o=a.n()).done;){var s=o.value;this.mappedIDS.includes(s.id)&&(r.op.closeOptions.delay=0,s.animate(r.op.keyframesClose,r.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}}])&&ft(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();function vt(t){return vt="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},vt(t)}function bt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function gt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,wt(n.key),n)}}function wt(t){var e=function(t){if("object"!=vt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=vt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==vt(e)?e:e+""}function kt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(kt=function(){return!!t})()}function Ot(t){return Ot=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ot(t)}function xt(t,e){return xt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},xt(t,e)}var St=function(){function t(){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(t,e,r){return e=Ot(e),function(t,e){if(e&&("object"==vt(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)}(t,kt()?Reflect.construct(e,r||[],Ot(t).constructor):e.apply(t,r))}(this,t)).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&&xt(t,e)}(t,v),e=t,r=[{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,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,n=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(n,", 1fr)"),i.style.gridTemplateRows="repeat(".concat(r,", 1fr)"),i.style.width="100%",i.style.height="100vh";var o=t.map(function(t,e){return{row:Math.floor(r/2)+e,col:Math.floor(n/2)+e}});return t.forEach(function(i,a){var s=o[a],l=s.row,c=s.col,u=function(e){var r=0,n=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,f=l.row-c.row,d=a*(1/(Math.sqrt(u*u+f*f)+1));switch(s){case"L":r-=d;break;case"R":r+=d;break;case"U":n-=d;break;case"B":n+=d}}),{forceX:r,forceY:n}}(a),f=u.forceX,d=u.forceY;c=Math.max(1,Math.min(n,c+Math.round(f))),l=Math.max(1,Math.min(r,l+Math.round(d)));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,r=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return bt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?bt(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(t);try{for(r.s();!(e=r.n()).done;){var n=e.value;this.res.appendChild(n.render())}}catch(t){r.e(t)}finally{r.f()}return this.storedPositions&&this.generateGridPositions(this.storedPositions),this}},{key:"toCode",value:function(){if(this.excludeFromCodeTrue)return[""];var t=l(this.options,4),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)}}],r&>(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();function jt(t){return jt="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},jt(t)}function Ct(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Et(n.key),n)}}function Et(t){var e=function(t){if("object"!=jt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=jt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==jt(e)?e:e+""}function Pt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Pt=function(){return!!t})()}function Tt(t){return Tt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Tt(t)}function At(t,e){return At=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},At(t,e)}var _t=function(){function t(e){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(t,e,r){return e=Tt(e),function(t,e){if(e&&("object"==jt(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)}(t,Pt()?Reflect.construct(e,r||[],Tt(t).constructor):e.apply(t,r))}(this,t)).url=e,r.res=null,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&&At(t,e)}(t,v),e=t,(r=[{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)}}])&&Ct(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();function Rt(t){return Rt="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},Rt(t)}function Wt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,zt(n.key),n)}}function zt(t){var e=function(t){if("object"!=Rt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Rt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Rt(e)?e:e+""}function It(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(It=function(){return!!t})()}function Lt(){return Lt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Mt(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},Lt.apply(null,arguments)}function Mt(t){return Mt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Mt(t)}function Nt(t,e){return Nt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Nt(t,e)}var Ft=function(){function t(){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(t,e,r){return e=Mt(e),function(t,e){if(e&&("object"==Rt(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)}(t,It()?Reflect.construct(e,r||[],Mt(t).constructor):e.apply(t,r))}(this,t)).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&&Nt(t,e)}(t,v),e=t,r=[{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(s(),"$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 r,n,i,o=[],a=e.transform&&"object"===Rt(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=t,n=this,"function"==typeof(i=Lt(Mt(1&3?r.prototype:r),"setAny",n))?function(t){return i.apply(n,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"),this.chainReact(o,e.id,c)}}},{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}}],r&&Wt(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,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 Dt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ht(n.key),n)}}function Ht(t){var e=function(t){if("object"!=Bt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Bt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Bt(e)?e:e+""}function Jt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Jt=function(){return!!t})()}function $t(t){return $t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},$t(t)}function qt(t,e){return qt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},qt(t,e)}var Gt=function(){function t(e){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(t,e,r){return e=$t(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)}(t,Jt()?Reflect.construct(e,r||[],$t(t).constructor):e.apply(t,r))}(this,t))._noTheme=!0,r.res=null,r.st=e,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&&qt(t,e)}(t,v),e=t,(r=[{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 r=t[e].render();r.style.gridColumn=1,r.style.gridRow=1,this.res.appendChild(r)}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)}}])&&Dt(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();function Ut(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Vt(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Qt(t){return Qt="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},Qt(t)}function Vt(t,e){if(t){if("string"==typeof t)return Xt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Xt(t,e):void 0}}function Xt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Yt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Zt(n.key),n)}}function Zt(t){var e=function(t){if("object"!=Qt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Qt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Qt(e)?e:e+""}function Kt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Kt=function(){return!!t})()}function te(){return te="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=ee(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},te.apply(null,arguments)}function ee(t){return ee=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ee(t)}function re(t,e){return re=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},re(t,e)}var ne=function(){function t(e){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(t,e,r){return e=ee(e),function(t,e){if(e&&("object"==Qt(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)}(t,Kt()?Reflect.construct(e,r||[],ee(t).constructor):e.apply(t,r))}(this,t)).res=null,r.setup(e),r.code=[],r.isLast=!1,r.constrObj=e,r.code.push("\n new Wrapper() \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&&re(t,e)}(t,v),e=t,r=[{key:"toCode",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.code=[],this.excludeFromCodeTrue)return[""];var r=" ".repeat(e),n="".concat(r,'new Wrapper("').concat(this.constrObj,'")');if(this.constrObj||(n="".concat(r,"new Wrapper()")),Object.keys(this.obj).length){var i=l(Object.fromEntries(Object.entries(this.obj).filter(function(t){var e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,c=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(t,e)||Vt(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.")}()}(t,2);return e[0],null!==e[1]})),2);n+="\n".concat(r," .set(").concat(i,")")}return null!==(t=this.items)&&void 0!==t&&t.length&&(n+="\n".concat(r," .add([\n")+this.items.map(function(t){return t.toCode(e+4)}).join(",\n")+"\n".concat(r," ])")),[n+="\n".concat(r)]}},{key:"getType",value:function(){return"LayoutWrapperElement"}},{key:"set",value:function(e){this.obj=e,this.commonMethods(e),e.onTap&&this.onTap(e.onTap);var r=".set({";e.isHidden&&this.isHidden(e.isHidden),e.scale&&(this.res.style.scale=e.scale),e.scale&&(r+="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.gpos&&this.gpos(e.gpos);var n,i,o,a=[],s=e.transform&&"object"===Qt(e.transform);if(e.stroke||e.gradient||e.span||e.backgroundOp||e.layout||e.shadow||e.animation||e.filtera||s){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=t,i=this,"function"==typeof(o=te(ee(1&3?n.prototype:n),"setAny",i))?function(t){return o.apply(i,t)}:o)([{globalBlast:"".concat(e.stroke.op.width," ").concat(e.stroke.op.color)}]),e.span&&(e.span.prevText=this.text);var l=[e.stroke,e.gradient,e.animation,e.span,e.backgroundOp,e.layout,e.marginOp,e.shadow,e.animation,e.filtera,s?e.transform:void 0];l=l.filter(function(t){return null!=t});for(var c=0;c<l.length;c++)a.push({range:l[c].range,log:l[c].op.name,target:l[c].target,op:l[c].op});var u=[];e.borderObj&&u.push("border"),e.background&&u.push("background"),e.mar&&u.push("margin"),e.animation&&u.push("animation"),e.span&&u.push("span"),s&&u.push("transform"),e.gradient&&u.push("gradient"),e.blast,this.options=e,this.chainReact(a,this.options.id,u)}if(e.centerColumn&&this.deprecatedOption("centerColumn",'center: "x"'),e.mboth&&(this.deprecatedOption("mboth",'mar: "center"'),this.mar("center")),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.simpleCenter&&this.deprecatedOption("simpleCenter","center: true"),e.filter&&(this.res.style.backdropFilter="blur(3px)"),e.radius&&this.corner(e.radius),e.radius&&(r+='\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&&(r+='\n width: "'.concat(e.width,'",')),e.overflow&&(r+='\n overflow: "'.concat(e.overflow,'",')),e.height&&this.heightNoAuto(e.height),e.height&&(r+='\n height: "'.concat(e.height,'",')),e.align&&this.flexAlign(e.align),e.align&&(r+='\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&&(r+='font: "'.concat(e.font,'",')),e.maxWidth&&this.maxWidth(e.maxWidth),e.flexCenter&&this.deprecatedOption("flexCenter",'center: "y"'),e.color&&this.color(e.color),e.background&&this.background(e.background),e.background&&(r+='background: "'.concat(e.background,'",')),e.weight&&this.weight(e.weight),e.area&&this.setArea(e.area),e.area&&(r+='area: "'.concat(e.area,'"')),e.column&&this.makeCol(),e.column&&(r+='\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&&(r+='\n flexDir: "'.concat(e.flexDir,'",')),e.center&&(r+="center: ".concat(JSON.stringify(e.center),",")),e.zIndex&&(this.res.style.zIndex=e.zIndex),e.transform&&"object"===Qt(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 f=this.removeQuotesFromFirstWord(JSON.stringify(e.stretch));r+="\n stretch: ".concat(f,",")}for(var d in e)if("margin"===d){var h=e[d];if(Array.isArray(h)&&h.length>0){var p,y=Ut(h);try{for(y.s();!(p=y.n()).done;){var m=p.value;m.hasOwnProperty("top")&&(this.res.style.marginTop=m.top),m.hasOwnProperty("right")&&(this.res.style.marginRight=m.right),m.hasOwnProperty("bottom")&&(this.res.style.marginBottom=m.bottom),m.hasOwnProperty("left")&&(this.res.style.marginLeft=m.left)}}catch(t){y.e(t)}finally{y.f()}}}return 8===(r+="})\n").length&&(r=""),this.code.push(r),this}},{key:"rsp",value:function(t){var e=this;this.res.style.display="flex";var r=t.sequence.split("-"),n=function(){var n=t.ranges;"0px"!==n[0]&&n.unshift("0px");for(var i=0;i<n.length-1;i++)(window.matchMedia("(min-width: ".concat(n[i],") and (max-width: ").concat(n[i+1],")")).matches||window.matchMedia("(min-width: ".concat(n[n.length-1],")")).matches)&&("row"===r[i]&&(e.res.style.flexDirection="row",e.res.style.border="3px solid green"),"col"===r[i]&&(e.res.style.flexDirection="column",e.res.style.border="3px solid purple"));return e};window.addEventListener("resize",n),n()}},{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,r=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};r(),window.addEventListener("resize",r)}},{key:"makeCol",value:function(){return this.res.style.display="flex",this.res.style.flexDirection="column",this.res.style.alignItems="flex-start",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:"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:"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.border="".concat(t.width,"px solid ").concat(t.color),this}},{key:"add",value:function(t){this.items=t,this.code.push(".add([ \n");var e=t.map(function(e,r){return e.toCode().flatMap(function(t){return t}).join("")+(r<t.length-1?",":"")}).join("");this.code.push(e);for(var r=0;r<t.length;r++)if(void 0!==t[r]&&void 0!==t[r].toCode){var n=t[r].render();this.res.appendChild(n)}return this.code.push("])"),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:"dimensions",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:"size",value:function(t,e){return this.deprecatedOption("size() on this component","dimensions(w, h)"),this.dimensions(t,e)}},{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:"apply",value:function(t){var e=this,r=function(){for(var r=0;r<t.length;r++){var n=t[r],i=window.matchMedia("(max-width: ".concat(n.width,"px)"));n.device&&(i=window.matchMedia("(max-device-width: ".concat(n.width,"px)"))),i.matches&&Object.assign(e.res.style,n.styles)}},n=window.matchMedia("(max-width: ".concat(t[0].width,"px)"));return t[0].device&&(n=window.matchMedia("(max-device-width: ".concat(t[0].width,"px)"))),n.matches||Object.assign(this.res.style,t[0].styles),r(),window.addEventListener("resize",r),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}}],r&&Yt(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();function ie(t){return ie="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},ie(t)}function oe(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return ae(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ae(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function ae(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function se(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,le(n.key),n)}}function le(t){var e=function(t){if("object"!=ie(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=ie(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ie(e)?e:e+""}function ce(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ce=function(){return!!t})()}function ue(){return ue="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=fe(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},ue.apply(null,arguments)}function fe(t){return fe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},fe(t)}function de(t,e){return de=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},de(t,e)}var he=function(){function t(){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(t,e,r){return e=fe(e),function(t,e){if(e&&("object"==ie(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)}(t,ce()?Reflect.construct(e,r||[],fe(t).constructor):e.apply(t,r))}(this,t)).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&&de(t,e)}(t,v),e=t,r=[{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 r,n,i,o=[];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&&(r=t,n=this,"function"==typeof(i=ue(fe(1&3?r.prototype:r),"setAny",n))?function(t){return i.apply(n,t)}:i)([{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,e.transform];a=a.filter(function(t){return null!=t});for(var s=0;s<a.length;s++)o.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"),l.push("border"),this.chainReact(o,this.options.id,l)}}},{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:"cellPadding",value:function(t){var e,r=oe(this.res.rows);try{for(r.s();!(e=r.n()).done;){var n,i=oe(e.value.cells);try{for(i.s();!(n=i.n()).done;)n.value.style.padding=t}catch(t){i.e(t)}finally{i.f()}}}catch(t){r.e(t)}finally{r.f()}return this}},{key:"cellAlign",value:function(t){var e,r=oe(this.res.rows);try{for(r.s();!(e=r.n()).done;){var n,i=oe(e.value.cells);try{for(i.s();!(n=i.n()).done;)n.value.style.textAlign=t}catch(t){i.e(t)}finally{i.f()}}}catch(t){r.e(t)}finally{r.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 r,n=oe(this.res.rows);try{for(n.s();!(r=n.n()).done;){var i,o=oe(r.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){n.e(t)}finally{n.f()}for(var a=0;a<this.res.rows.length-1;a++){var s,l=oe(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,f=oe(this.res.rows);try{for(f.s();!(c=f.n()).done;)for(var d=c.value,h=0;h<u-1;h++)d.cells[h].style.borderRight=t}catch(t){f.e(t)}finally{f.f()}return this}},{key:"generateTableHead",value:function(t,e){var r,n=t.createTHead().insertRow(),i=oe(e);try{for(i.s();!(r=i.n()).done;){var o=r.value,a=document.createElement("th");a.textContent=o,n.appendChild(a)}}catch(t){i.e(t)}finally{i.f()}}},{key:"generateTable",value:function(t,e){var r,n=oe(e);try{for(n.s();!(r=n.n()).done;){var i=r.value,o=t.insertRow();for(var a in i)o.insertCell().textContent=i[a]}}catch(t){n.e(t)}finally{n.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)}}],r&&se(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();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 r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?me(t,e):void 0}}function me(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function ve(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,be(n.key),n)}}function be(t){var e=function(t){if("object"!=pe(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=pe(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==pe(e)?e:e+""}function ge(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ge=function(){return!!t})()}function we(t){return we=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},we(t)}function ke(t,e){return ke=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ke(t,e)}var Oe=function(){function t(){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(t,e,r){return e=we(e),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)}(t,ge()?Reflect.construct(e,r||[],we(t).constructor):e.apply(t,r))}(this,t)).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&&ke(t,e)}(t,v),e=t,r=[{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 r=function(){var t=e.toggleWrap.getBoundingClientRect(),r=e.contentWrap.style.display,n=e.contentWrap.style.visibility;"none"===r&&(e.contentWrap.style.visibility="hidden",e.contentWrap.style.display="block");var i=e.contentWrap.getBoundingClientRect();"none"===r&&(e.contentWrap.style.display=r,e.contentWrap.style.visibility=n||"");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=r;var n=function(){"none"!==e.contentWrap.style.display&&r()};if(window.addEventListener("resize",n),window.addEventListener("scroll",n,!0),t.behaviour){var i=t.behaviour;if("mouseover"===i||"mouseenter"===i){var o,a=function(){clearTimeout(o),e.contentWrap.style.display="block",r()},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",r())}),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&&r()}):this.res.addEventListener(i,function(){e.contentWrap.style.display="block",r()})}else this.res.addEventListener("click",function(){e.toggle(),"block"===e.contentWrap.style.display&&r()});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,r=this;if(!Array.isArray(t))throw new Error("The 'add' method expects an array of children.");var n=!this.options||!this.options.title;if(t.forEach(function(t,e){if(!n||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)}}),n){var i=t[0];i&&i.res&&this.toggleWrap.appendChild(i.res)}return(e=this.children).push.apply(e,function(t){return function(t){if(Array.isArray(t))return me(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||ye(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.")}()}(t)),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=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,c=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(t,e)||ye(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.")}()}(t,2),r=e[0],n=e[1];return"string"==typeof n?"".concat(r,': "').concat(n,'"'):"object"===pe(n)?"".concat(r,": ").concat(JSON.stringify(n)):"".concat(r,": ").concat(n)}).join(",\n "):"",r=this.children.map(function(e,r){return e.toCode().flatMap(function(t){return t}).join("")+(r<t.children.length-1?",":"")}).join("");return["new Dropdown().set({\n ".concat(e,"\n}).add([\n ").concat(r,"\n])")]}},{key:"render",value:function(t){return t&&document.querySelector(t).appendChild(this.res),this.res}}],r&&ve(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();function xe(t){return xe="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},xe(t)}function Se(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,je(n.key),n)}}function je(t){var e=function(t){if("object"!=xe(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=xe(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==xe(e)?e:e+""}function Ce(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ce=function(){return!!t})()}function Ee(t){return Ee=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ee(t)}function Pe(t,e){return Pe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Pe(t,e)}var Te=function(){function t(e){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(t,e,r){return e=Ee(e),function(t,e){if(e&&("object"==xe(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)}(t,Ce()?Reflect.construct(e,r||[],Ee(t).constructor):e.apply(t,r))}(this,t)).text=e,r.res=null,r.valid=!1,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&&Pe(t,e)}(t,v),e=t,r=[{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;if(this.options=t,this.res.setAttribute("type",null!==(e=t.type)&&void 0!==e?e:"text"),t.placeholder&&(this.res.placeholder=t.placeholder),this.res.style.boxSizing="border-box",!this.res.getAttribute("aria-label")){var r,n,i=null!==(r=null!==(n=t.label)&&void 0!==n?n:t.title)&&void 0!==r?r:t.placeholder;i&&this.res.setAttribute("aria-label",String(i))}return t.name&&this.res.setAttribute("name",t.name),t.id&&this.res.setAttribute("id",t.id),t.required&&this.res.setAttribute("required",""),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:"toCode",value:function(){var t=JSON.stringify(this.options,null,4);return["new TextField().set(".concat(t,")")]}},{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:"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:"process",value:function(t){return this.res.value}},{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:"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:"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:"onChange",value:function(t){var e=this;return this.res.value,this.res.addEventListener("input",function(r){t(e.res.value)}),this}},{key:"render",value:function(t){return t?(document.querySelector(t).appendChild(this.res),this.res):this.res}}],r&&Se(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();function Ae(t){return Ae="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},Ae(t)}function _e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Re(n.key),n)}}function Re(t){var e=function(t){if("object"!=Ae(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Ae(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ae(e)?e:e+""}function We(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(We=function(){return!!t})()}function ze(t){return ze=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ze(t)}function Ie(t,e){return Ie=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ie(t,e)}var Le=function(){function t(){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(t,e,r){return e=ze(e),function(t,e){if(e&&("object"==Ae(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)}(t,We()?Reflect.construct(e,r||[],ze(t).constructor):e.apply(t,r))}(this,t)).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&&Ie(t,e)}(t,v),e=t,(r=[{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}}])&&_e(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();function Me(t){return Me="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},Me(t)}function Ne(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Fe(n.key),n)}}function Fe(t){var e=function(t){if("object"!=Me(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Me(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Me(e)?e:e+""}function Be(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Be=function(){return!!t})()}function De(){return De="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=He(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},De.apply(null,arguments)}function He(t){return He=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},He(t)}function Je(t,e){return Je=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Je(t,e)}var $e=function(){function t(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),function(t,e,r){return e=He(e),function(t,e){if(e&&("object"==Me(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)}(t,Be()?Reflect.construct(e,r||[],He(t).constructor):e.apply(t,r))}(this,t)}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&&Je(t,e)}(t,v),e=t,r=[{key:"removeQuotesFromFirstWord",value:function(t){if(t)return t.replace(s(),"$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){var r,n,i;return this.obj=e,this.obj=e,this.makeNavbar(e),e.mar&&(r=t,n=this,"function"==typeof(i=De(He(1&3?r.prototype:r),"mar",n))?function(t){return i.apply(n,t)}:i)([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}},{key:"makeNavbar",value:function(t){var e=this,r=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 r.render&&(console.log("Appending brand:",r.render()),this.brand.appendChild(r.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,r;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!==(r=this.hamburgerColour)&&void 0!==r?r:"#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 r=t[e];this.navContent.appendChild(r.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}}],r&&Ne(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();function qe(t){return qe="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},qe(t)}function Ge(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Ue(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ge(Object(r),!0).forEach(function(e){Qe(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ge(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Qe(t,e,r){return(e=Xe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ve(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Xe(n.key),n)}}function Xe(t){var e=function(t){if("object"!=qe(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=qe(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==qe(e)?e:e+""}function Ye(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ye=function(){return!!t})()}function Ze(t){return Ze=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ze(t)}function Ke(t,e){return Ke=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ke(t,e)}var tr=function(){function t(){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(t,e,r){return e=Ze(e),function(t,e){if(e&&("object"==qe(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)}(t,Ye()?Reflect.construct(e,r||[],Ze(t).constructor):e.apply(t,r))}(this,t)).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&&Ke(t,e)}(t,v),e=t,r=[{key:"set",value:function(t){var e=t.breakpoints,r=t.id,n=t.area;if(this.options={breakpoints:e},this._id=r,this._area=n,!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 Ue(Ue({},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.res=this.internalDiv,this._id&&this.internalDiv.setAttribute("id",this._id),this._area&&(this.internalDiv.style.gridArea=this._area),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,r=[],n=0;n<t.length;n++)r.push({from:t[n],to:n<t.length-1?t[n+1]-1:e});return r}},{key:"addRanges",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:99999;return t.map(function(t,n){var i=e[n],o=n<e.length-1?e[n+1]-1:r;return Ue(Ue({},t),{},{range:{from:i,to:o}})})}},{key:"applyView",value:function(){var t=this,e=(window.innerWidth,this.breakpoints.map(function(t){return t.at})),r=this.breakpoints.map(function(t){return t.at});this.createRanges(r),this.addRanges(this.breakpoints,e).forEach(function(e){var r="(min-width: ".concat(e.range.from,"px) and (max-width: ").concat(e.range.to,"px)");window.matchMedia(r).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}}],r&&Ve(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();function er(t){return er="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},er(t)}function rr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,nr(n.key),n)}}function nr(t){var e=function(t){if("object"!=er(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=er(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==er(e)?e:e+""}function ir(t,e){if(e&&("object"==er(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)}function or(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(or=function(){return!!t})()}function ar(t){return ar=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ar(t)}function sr(t,e){return sr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},sr(t,e)}var lr=function(){function t(e){var r,n,i,o;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),n=this,i=ar(i=t),(r=ir(n,or()?Reflect.construct(i,[],ar(n).constructor):i.apply(n,o)))._noTheme=!0;var a=document.createElement("div");return a.style.flex="1",r.res=a,r.res.setAttribute("class","innerHider"),ir(r,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&&sr(t,e)}(t,v),e=t,(r=[{key:"toCode",value:function(){return["new Spacer(".concat(this.hide,")")]}},{key:"render",value:function(){return this.res}}])&&rr(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();function cr(t){return cr="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},cr(t)}function ur(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function fr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,dr(n.key),n)}}function dr(t){var e=function(t){if("object"!=cr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=cr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==cr(e)?e:e+""}function hr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(hr=function(){return!!t})()}function pr(t){return pr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},pr(t)}function yr(t,e){return yr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},yr(t,e)}var mr=function(){function t(){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(t,e,r){return e=pr(e),function(t,e){if(e&&("object"==cr(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)}(t,hr()?Reflect.construct(e,r||[],pr(t).constructor):e.apply(t,r))}(this,t)).res=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&&yr(t,e)}(t,v),e=t,(r=[{key:"set",value:function(t){var e,r;this.options=t;var n=document.createElement("div");n.style.display="flex",n.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),n.appendChild(i);var s=document.createElement("div");if("function"==typeof(null===(r=t.label)||void 0===r?void 0:r.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",n.appendChild(s),this.res=n,this}},{key:"getValue",value:function(){return this.res.children[0].checked}},{key:"toCode",value:function(){var t=Object.entries(this.options).map(function(t){var e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,c=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return ur(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ur(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.")}()}(t,2),r=e[0],n=e[1];return"string"==typeof n?"".concat(r,': "').concat(n,'"'):"object"===cr(n)&&null!==n?"function"==typeof n.toCode?"".concat(r,": ").concat(n.toCode()[0]):"".concat(r,": ").concat(JSON.stringify(n,null,4)):"".concat(r,": ").concat(n)}).join(",\n ");return["new Checkbox().set({\n ".concat(t,"\n})")]}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}])&&fr(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();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 br(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,gr(n.key),n)}}function gr(t){var e=function(t){if("object"!=vr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=vr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==vr(e)?e:e+""}function wr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(wr=function(){return!!t})()}function kr(t){return kr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},kr(t)}function Or(t,e){return Or=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Or(t,e)}"undefined"!=typeof window&&(window.Checkbox=mr);var xr=function(){function t(e){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(t,e,r){return e=kr(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)}(t,wr()?Reflect.construct(e,r||[],kr(t).constructor):e.apply(t,r))}(this,t)).url=e,r.res=null,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&&Or(t,e)}(t,v),e=t,(r=[{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)}}])&&br(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();function Sr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return 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 r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Er(n.key),n)}}function Er(t){var e=function(t){if("object"!=jr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=jr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==jr(e)?e:e+""}function Pr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Pr=function(){return!!t})()}function Tr(){return Tr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Ar(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},Tr.apply(null,arguments)}function Ar(t){return Ar=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ar(t)}function _r(t,e){return _r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_r(t,e)}var Rr=function(){function t(){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(t,e,r){return e=Ar(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)}(t,Pr()?Reflect.construct(e,r||[],Ar(t).constructor):e.apply(t,r))}(this,t)).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&&_r(t,e)}(t,v),e=t,r=[{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 r,n,i,o=[],a=e.transform&&"object"===jr(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=t,n=this,"function"==typeof(i=Tr(Ar(1&3?r.prototype:r),"setAny",n))?function(t){return i.apply(n,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"),this.chainReact(o,this.options.id,c)}}},{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,r=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Sr(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Sr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(t);try{for(r.s();!(e=r.n()).done;){var n=e.value;if("string"==typeof n){var i=document.createElement("li");i.textContent=n,this.res.appendChild(i)}else{var o=n.render();this.res.appendChild(o)}}}catch(t){r.e(t)}finally{r.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:"border",value:function(t,e){return this.res.style.border="".concat(t,"px solid ").concat(e),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),r="".concat(e,"new UList()");return this.items&&this.items.length&&(r+="\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," ])")),[r+="\n".concat(e)]}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}],r&&Cr(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();function Wr(t){return Wr="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},Wr(t)}function zr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ir(n.key),n)}}function Ir(t){var e=function(t){if("object"!=Wr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Wr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Wr(e)?e:e+""}function Lr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Lr=function(){return!!t})()}function Mr(t){return Mr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Mr(t)}function Nr(t,e){return Nr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Nr(t,e)}var Fr=function(){function t(e,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(t,e,r){return e=Mr(e),function(t,e){if(e&&("object"==Wr(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)}(t,Lr()?Reflect.construct(e,r||[],Mr(t).constructor):e.apply(t,r))}(this,t)).text=e,n.res=null,n.val=r,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&&Nr(t,e)}(t,v),e=t,(r=[{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 r=(new DOMParser).parseFromString(t.svg,"image/svg+xml").documentElement;e.appendChild(r)}else t.svg instanceof SVGElement&&e.appendChild(t.svg);else if(t.url&&!t.img){var n,i,o=document.createElement("img");o.setAttribute("src",t.url),o.style.width=(null===(n=t.frame)||void 0===n?void 0:n.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.deprecatedOption("padding","pad"),this.pad([{a:t.padding}])),t.margin&&(this.deprecatedOption("margin","mar"),this.mar([{a: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.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:"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 r=document.createTextNode(this.text);this.res.appendChild(r),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 n=document.createTextNode(this.text);this.res.appendChild(n),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:"borderRadius",value:function(t){return this.res.style.borderRadius=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 r=this.res,n=this.text;return Object.defineProperty(t,e,{set:function(t){var e=document.createTextNode(n.replace("$",t));r.replaceChild(e,r.childNodes[0])}}),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)}}])&&zr(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();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 Dr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Hr(n.key),n)}}function Hr(t){var e=function(t){if("object"!=Br(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Br(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Br(e)?e:e+""}function Jr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Jr=function(){return!!t})()}function $r(t){return $r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},$r(t)}function qr(t,e){return qr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},qr(t,e)}var Gr=function(){function t(){var e,r,n,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(r=this,n=t,n=$r(n),e=function(t,e){if(e&&("object"==Br(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,Jr()?Reflect.construct(n,i||[],$r(r).constructor):n.apply(r,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&&qr(t,e)}(t,v),e=t,(r=[{key:"set",value:function(t){this.options=t;var e=document.createElement("div"),r=document.createElement("label");r.style.position="relative",r.style.display="block";var n=null==t.title?"":String(t.title),i=document.createTextNode(n);r.appendChild(i),r.style.opacity=0;var o=document.createElement("input");return"textarea"===t.type&&(o=document.createElement("textarea")),o.style.position="relative",o.placeholder=n,o.style.boxSizing="border-box",n&&!o.getAttribute("aria-label")&&o.setAttribute("aria-label",n),o.style.fontSize="1rem",o.style.padding=".4rem .75rem",e.appendChild(r),e.appendChild(o),this.res=e,t.mar&&this.mar(t.mar),t.pad&&this.pad(t.pad),o.addEventListener("focus",function(){r.style.transition="transform ease 0.2s",r.style.transform="scale(0.80)",r.style.textTransform="uppercase",r.style.transformOrigin="left top",r.style.fontWeight="bold",o.placeholder="",r.style.opacity="1.0",t.font&&(r.style.fontFamily=t.font),t.color&&(r.style.color=t.color),t.exact&&(r.style.fontSize=t.exact)}),o.addEventListener("focusout",function(){r.style.transform="scale(1.0)",o.placeholder=n,r.style.opacity="0.0"}),t.name&&o.setAttribute("name",t.name),window.matchMedia("(max-device-width: 415px)").matches&&(o.style.width="100%",e.style.width="100%"),o.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)}}])&&Dr(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();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 Qr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Vr(n.key),n)}}function Vr(t){var e=function(t){if("object"!=Ur(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Ur(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ur(e)?e:e+""}"undefined"!=typeof window&&(window.FloatingInput=Gr);var Xr=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,r,n=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!==(r=t.width)&&void 0!==r?r:"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(){n.currentLabel.textContent=i.value}),window.matchMedia("(max-device-width: 415px)").matches)if(t.plain)i.style.width="80%";else{var f,d;i.style.height="20px",i.style.background=null!==(f=t.style.trackColor)&&void 0!==f?f:"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!==(d=t.style.thumbColor)&&void 0!==d?d:"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)}}])&&Qr(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Yr(t){return Yr="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},Yr(t)}function Zr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Kr(n.key),n)}}function Kr(t){var e=function(t){if("object"!=Yr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Yr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Yr(e)?e:e+""}"undefined"!=typeof window&&(window.Range=Xr);var tn=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"),r=t.items,n=0;n<r.length;n++){var i=document.createElement("label");r.font&&(i.style.font=r.font),r.color&&(i.style.color=r.color),r.exact&&(i.style.fontSize=r.exact);var o=document.createTextNode(r[n]);i.appendChild(o),i.setAttribute("for",r[n]);var a=document.createElement("input");a.setAttribute("type","radio"),a.setAttribute("id","S".concat(n)),a.setAttribute("value",r[n].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",r[n].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 r=document.querySelector("#S".concat(e));t.push(r.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 r=function(){var t=e.el.children[n];"[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 r=0;r<e.el.children.length;r++){var n=e.el.children[r];"INPUT"===n.tagName&&"radio"===n.type&&!1===e.options.multiple&&n!==t&&(n.style.backgroundColor="transparent",n.style.boxShadow="none")}}else t.style.backgroundColor="transparent",t.style.boxShadow="none"})},n=0;n<this.el.children.length;n++)r();return this.el}document.querySelector(t).appendChild(this.el)}}])&&Zr(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function en(t){return en="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},en(t)}function rn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,nn(n.key),n)}}function nn(t){var e=function(t){if("object"!=en(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=en(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==en(e)?e:e+""}function on(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(on=function(){return!!t})()}function an(t){return an=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},an(t)}function sn(t,e){return sn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},sn(t,e)}"undefined"!=typeof window&&(window.RadioGroup=tn);var ln=function(){function t(){var e,r,n,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(r=this,n=t,n=an(n),e=function(t,e){if(e&&("object"==en(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,on()?Reflect.construct(n,i||[],an(r).constructor):n.apply(r,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&&sn(t,e)}(t,v),e=t,(r=[{key:"setup",value:function(t,e){document.createElement("div");var r=document.createElement("select");r.setAttribute("type","file"),r.setAttribute("name",e),r.addEventListener("change",function(){r.options[r.selectedIndex].value});for(var n=0;n<t.length;n++){var i=t[n],o="string"==typeof i||"number"==typeof i?[String(i),String(i)]:[i&&i[0],i&&i[1]];r.appendChild(this.addNode(o[0],o[1]))}return this.el=r,this.res=r,this}},{key:"set",value:function(t){this.options=t;var e=t.name;t.items&&this.setup(t.items,e),t.arrayPadding&&(this.deprecatedOption("arrayPadding",'pad: [{a: "0.5rem"}]'),this.arrayPadding(t.arrayPadding.sides,t.arrayPadding.value)),t.arrayMargin&&(this.deprecatedOption("arrayMargin","mar: [{a: 10}]"),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);var r=t.title,n=void 0!==t.label?t.label:r;return null==n||this.el.getAttribute("aria-label")||this.el.setAttribute("aria-label",String(n)),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 r=document.createElement("option");r.setAttribute("value",t);var n=document.createTextNode(e);return r.appendChild(n),r}},{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)}}])&&rn(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();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 un(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,fn(n.key),n)}}function fn(t){var e=function(t){if("object"!=cn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=cn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==cn(e)?e:e+""}function dn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(dn=function(){return!!t})()}function hn(t){return hn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},hn(t)}function pn(t,e){return pn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},pn(t,e)}"undefined"!=typeof window&&(window.Picker=ln);var yn=function(){function t(){var e,r,n,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(r=this,n=t,n=hn(n),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)}(r,dn()?Reflect.construct(n,i||[],hn(r).constructor):n.apply(r,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&&pn(t,e)}(t,v),e=t,(r=[{key:"set",value:function(t){var e=this;this.options=t,this.okayColor=t.okayColor,window.matchMedia("(max-device-width: 415px)");var r=document.createElement("div");r.style.paddingBottom="1em",r.style.display="flex",document.createElement("div");var n=document.createElement("input");n.setAttribute("type","text"),n.style.display="none",n.style.margin="0.5em";var i=document.createElement("input");i.setAttribute("type","file"),i.setAttribute("name",t.name),t.accept&&(i.accept=t.accept),void 0!==t.id&&null!==t.id&&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.textContent=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(){n.style.display="block",t.hideField&&(n.style.display="none"),o.textContent="Change",e.file=i.files[0],e.onLoad(e.file),mn[t.index]=e.file,n.setAttribute("value",e.file.name),n.setAttribute("readonly","true"),e.getLoaded(),e.highlight()}),r.appendChild(i),r.appendChild(o),r.appendChild(n),this.el=r,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}}])&&un(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}(),mn=[];function vn(t,e){return vn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},vn(t,e)}function bn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(bn=function(){return!!t})()}function gn(t){return gn="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},gn(t)}function wn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,kn(n.key),n)}}function kn(t){var e=function(t){if("object"!=gn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=gn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==gn(e)?e:e+""}var On=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,r=t;this.options=t;var n=document.createElement("input");n.setAttribute("list","dlCities"),n.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 n.appendChild(s),n.addEventListener("change",function(){var t=document.querySelector("#my").value;e.currentItem=t}),n.setAttribute("placeholder","Type value"),n.style.padding=".4rem .75rem",n.style.fontSize="1rem",this.res=n,this.responsive(),r.arrayPadding&&this.arrayPadding(r.arrayPadding.sides,r.arrayPadding.value),r.arrayMargin&&this.arrayMargin(r.arrayMargin.sides,r.arrayMargin.value),r.pad&&this.pad(r.pad),r.mar&&this.mar(r.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)}}])&&wn(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}(),xn=On;function Sn(t){return Sn="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},Sn(t)}function jn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Cn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,En(n.key),n)}}function En(t){var e=function(t){if("object"!=Sn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Sn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Sn(e)?e:e+""}On=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(t,e,r){if(bn())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&vn(i,r.prototype),i}(xn,e)},"undefined"!=typeof window&&(window.DataList=On);var Pn=function(){return t=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=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=r,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,r,n=(r=2,function(t){if(Array.isArray(t))return t}(e=t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,c=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,r)||function(t,e){if(t){if("string"==typeof t)return jn(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?jn(t,e):void 0}}(e,r)||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=n[0],o=n[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),t.id&&(this.formElement.id=t.id),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&&Cn(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Tn(t){return Tn="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},Tn(t)}function An(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,_n(n.key),n)}}function _n(t){var e=function(t){if("object"!=Tn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Tn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Tn(e)?e:e+""}var Rn=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,r=t.el,n=t.re,i=(t.options,[]),o=0;o<e.length;o++)e[o].target&&(r.id,e[o].target[0]);for(o=0;o<e.length;o++){var a=!0;e[o].target&&(a=!1,r.id===e[o].target[0]&&(a=!0));var s=e[o].op.ops.split("-");a&&s.includes("air")&&(n.borderObj={color:"#1abc9c",radius:"0rem",width:"3px"},n.color="#1abc9c",n.background="transparent"),a&&s.includes("round")&&(s.includes("air")?n.borderObj={width:"4px",radius:"0.7rem",color:"#1abc9c"}:n.borderObj={width:"0px",radius:"0.7rem",color:"#1abc9c"}),a&&s.includes("full")&&(n.background="#3498db",n.borderObj&&n.borderObj.radius&&(n.borderObj.radius="0.3rem"),n.color="white"),a&&s.includes("pill")&&(n.background="#3498db",n.borderObj.radius="9999px",n.color="white"),a&&s.includes("hover")&&(n.hover={color:"#1abc9c",background:"orange"}),i.push((new U).set(n))}return i}}])&&An(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Wn(t){return Wn="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},Wn(t)}function zn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function In(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?zn(Object(r),!0).forEach(function(e){Ln(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):zn(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Ln(t,e,r){return(e=Nn(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Mn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Nn(n.key),n)}}function Nn(t){var e=function(t){if("object"!=Wn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Wn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Wn(e)?e:e+""}function Fn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Fn=function(){return!!t})()}function Bn(){return Bn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Dn(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},Bn.apply(null,arguments)}function Dn(t){return Dn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Dn(t)}function Hn(t,e){return Hn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Hn(t,e)}var Jn=function(){function t(){var e,r,n,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),(r=this,n=t,n=Dn(n),e=function(t,e){if(e&&("object"==Wn(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(n,i||[],Dn(r).constructor):n.apply(r,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&&Hn(t,e)}(t,v),e=t,r=[{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=l(this.options||{},2);return"new Polygon().set(".concat(t,")")}},{key:"getType",value:function(){return"LayoutWrapperElement"}},{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=In(In({},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.mar([{a:e.margin}]),e.padding&&this.pad([{a:e.padding}]),e.background&&this.background(e.background),e.center&&this.center();var r=e;this.obj=e;var n,i,o=[];if(r.stroke||r.gradient||r.backgroundOp||r.layout||r.marginOp||r.shadow||r.animation||r.filtera||r.transform){var a;r.gradient&&(this.globalGradient=r.gradient.op.gradient),r.stroke&&(null===(n=this,a="function"==typeof(i=Bn(Dn(t.prototype),"setAny",n))?function(t){return i.apply(n,t)}:i)||void 0===a||a([{globalBlast:"".concat(r.stroke.op.width," ").concat(r.stroke.op.color)}]));for(var s=[r.stroke,r.gradient,r.animation,r.backgroundOp,r.layout,r.marginOp,r.shadow,r.animation,r.filtera,r.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=[];r.border&&c.push("border"),r.background&&c.push("background"),(r.mar||r.margin)&&c.push("margin"),r.animation&&c.push("animation"),"radial"===r.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:"color",value:function(t){return this.res.style.color=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:"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}}],n=[{key:"makePolygon",value:function(t){for(var e=2*Math.PI/t,r=[],n=0;n<t;n++){var i=50+50*Math.cos(n*e-Math.PI/2),o=50+50*Math.sin(n*e-Math.PI/2);r.push("".concat(i,"% ").concat(o,"%"))}return"polygon(".concat(r.join(","),")")}}],r&&Mn(e.prototype,r),n&&Mn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();function $n(t){return $n="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},$n(t)}function qn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Gn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Un(n.key),n)}}function Un(t){var e=function(t){if("object"!=$n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=$n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==$n(e)?e:e+""}function Qn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Qn=function(){return!!t})()}function Vn(){return Vn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Xn(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},Vn.apply(null,arguments)}function Xn(t){return Xn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Xn(t)}function Yn(t,e){return Yn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Yn(t,e)}var Zn=function(){function t(){var e,r,n,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(r=this,n=t,n=Xn(n),e=function(t,e){if(e&&("object"==$n(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,Qn()?Reflect.construct(n,i||[],Xn(r).constructor):n.apply(r,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&&Yn(t,e)}(t,v),e=t,r=[{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=l(Object.fromEntries(Object.entries(this.options||{}).filter(function(t){return null!=(e=t,r=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,c=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,r)||function(t,e){if(t){if("string"==typeof t)return qn(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?qn(t,e):void 0}}(e,r)||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,r})),4);return["new Circle().set(".concat(t,")")]}},{key:"setArea",value:function(t){return this.res.style.gridArea=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:"color",value:function(t){return this.res.style.color=t,this}},{key:"background",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)||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 r,n,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===(r=this,o="function"==typeof(n=Vn(Xn(t.prototype),"setAny",r))?function(t){return n.apply(r,t)}:n)||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}}],r&&Gn(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();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 ti(t){return function(t){if(Array.isArray(t))return ei(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return ei(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ei(t,e):void 0}}(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 ei(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function ri(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ai(n.key),n)}}function ni(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function ii(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ni(Object(r),!0).forEach(function(e){oi(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ni(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function oi(t,e,r){return(e=ai(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ai(t){var e=function(t){if("object"!=Kn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Kn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Kn(e)?e:e+""}var si=["h1","h2","h3","h4","h5","h6","p","img","a","cards","free","nav","sideNav","row","dropdown","radio","input","labelInput","filePicker","picker","video","audio","multiswitcher","button","form","checkbox","stack","simple","copy","wrap","circle","polygon","code","table","ulist"],li=function(t,e){var r=function(t){return"string"==typeof t&&"#"===t.charAt(0)?t.slice(1):t};return r(t)===r(e)},ci=function(t){var e,r;return"string"==typeof t||"number"==typeof t?{title:String(t),link:"#e"}:ii(ii({},t),{},{title:String(null!==(e=null==t?void 0:t.title)&&void 0!==e?e:""),link:null!==(r=null==t?void 0:t.link)&&void 0!==r?r:"#e"})},ui=function(){return e=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},r=[{key:"mapType",value:function(t){if(["h1","h2","h3","h4","h5","h6","p"].includes(t.el.type))return this.mapText(t);if("img"===t.el.type)return this.mapImage(t);if("a"===t.el.type)return this.mapLink(t);if("cards"===t.el.type)return this.mapGrid(t);if("free"===t.el.type)return this.mapFree(t);if("nav"===t.el.type)return this.protoNav(t);if("sideNav"===t.el.type)return this.sideNav(t);if("row"===t.el.type)return this.mapRow(t);if("dropdown"===t.el.type)return this.dropdown(t);if("radio"===t.el.type)return this.radio(t);if("input"===t.el.type)return this.input(t);if("labelInput"===t.el.type)return this.floatInput(t);if("filePicker"===t.el.type)return this.filePicker(t);if("picker"===t.el.type)return this.picker(t);if("video"===t.el.type)return this.video(t);if("audio"===t.el.type)return this.audio(t);if("multiswitcher"===t.el.type)return this.multiswitcher(t);if("button"===t.el.type)return this.button(t);if("form"===t.el.type)return this.form(t);if("checkbox"===t.el.type)return this.checkbox(t);if("stack"===t.el.type)return this.stack(t);if("simple"===t.el.type)return this.simple(t);if("copy"===t.el.type)return this.mapCopy(t);if("wrap"===t.el.type)return this.mapWrap(t);if("circle"===t.el.type)return this.mapCircle(t);if("polygon"===t.el.type)return this.mapPolygon(t);if("code"===t.el.type)return this.mapCode(t);if("table"===t.el.type)return this.mapTable(t);if("ulist"===t.el.type)return this.mapUList(t);throw new Error("[nodality] "+function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"value",n=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,n=String(t);return e.filter(function(t){return function(t,e){if(t===e)return 0;for(var r=new Array(e.length+1),n=0;n<=e.length;n++)r[n]=n;for(var i=1;i<=t.length;i++){for(var o=[i],a=1;a<=e.length;a++){var s=t.charCodeAt(i-1)===e.charCodeAt(a-1)?0:1;o[a]=Math.min(r[a]+1,o[a-1]+1,r[a-1]+s)}r=o}return r[e.length]}(n,t)<=r})}(t,e),i="Unknown ".concat(r,' "').concat(t,'".');return n.length&&(i+=' Did you mean "'.concat(n[0],'"?')),e.length&&(i+=" Valid ".concat(r,"s: ").concat(e.join(", "),".")),i}(t.el.type,si,"element type"))}},{key:"mapTable",value:function(t){var e=t.el,r=Array.isArray(e.items)&&e.items.length?e.items:[{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"}];return(new he).add(r).set({cellPadding:"0.3em",cellAlign:"center",style:{font:"Arial"},headStyle:{color:"white",background:"#c2410c"},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=this,r=t.el;return(new nt).set({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),span:this.filtero("span",r.id,t.customOptions),backgroundOp:this.filtero("background",r.id,t.customOptions),marginOp:this.filtero("margin",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)}).items(ti(Array.isArray(r.children)&&r.children.length?r.children.map(function(r){return e.mapType(ii(ii({},t),{},{el:r}))}):[new E("This").set({size:"S3"}),new E("is").set({size:"S3",text:"Hello"}),new E("row.").set({size:"S3",text:"Hello"})]))}},{key:"mapCode",value:function(t){var e=t.el;return(new Ft).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,r=t.customOptions,n=r.filter(function(t){return"copy"===t.op})[0],i=null!==(e=null==n?void 0:n.count)&&void 0!==e?e:3,o=(this.filteroRaster(t.el.id,r)||[]).filter(function(t){return t!==n}),a=300;return'new Wrapper()\n.set({\n width: "'.concat(a,'px",\n height: "').concat(a,'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 ':"").concat(o.length?",\n raster: ".concat(JSON.stringify(o)):"","\n})\n.add(\n Array.from({ length: ").concat(i,' }).map((_, i) => {\n\n const bbox = {width: "').concat(a,'px", height: "').concat(a,'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(i,';\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(t){var e,r=t.el;return new Fr(null!==(e=r.text)&&void 0!==e?e:"Button").set(ii(ii({fluidc:"S6"},this.elOpts(r)),{},{raster:this.filteroRaster(r.id,t.customOptions)}))}},{key:"multiswitcher",value:function(t){var e=this,r=Array.isArray(t.el.breakpoints)?t.el.breakpoints:null;if(!r||!r.length)throw new Error('[nodality] a "multiswitcher" element needs a non-empty `breakpoints` array of { at, view }.');return(new tr).set({id:t.el.id,area:t.el.area,breakpoints:r.map(function(r){return{at:r.at,view:r.view&&"function"==typeof r.view.render?r.view:e.mapType(ii(ii({},t),{},{el:r.view}))}})})}},{key:"video",value:function(t){var e=t.el;if(!e.url)throw new Error('[nodality] a "video" element needs a `url`.');return this.attachRaster(new xr(e.url).set(this.elOpts(e)),e,t.customOptions)}},{key:"audio",value:function(t){var e=t.el;if(!e.url)throw new Error('[nodality] an "audio" element needs a `url`.');return this.attachRaster(new _t(e.url),e,t.customOptions)}},{key:"radio",value:function(t){var e,r=t.el;return(new tn).set(ii({items:Array.isArray(r.items)?r.items:[],multiple:null!==(e=r.multiple)&&void 0!==e&&e},this.elOpts(r)))}},{key:"input",value:function(t){var e,r=t.el;return(new Te).set(ii(ii({type:null!==(e=r.inputType)&&void 0!==e?e:"text"},this.elOpts(r)),{},{raster:this.filteroRaster(r.id,t.customOptions)}))}},{key:"floatInput",value:function(t){var e,r=t.el;return this.attachRaster((new Gr).set(ii(ii({type:null!==(e=r.inputType)&&void 0!==e?e:"input"},void 0!==r.title||void 0===r.label&&void 0===r.text?{}:{title:void 0!==r.label?r.label:r.text}),this.elOpts(r))),r,t.customOptions)}},{key:"filePicker",value:function(t){var e,r=t.el;return this.attachRaster((new yn).set(ii({title:null!==(e=r.title)&&void 0!==e?e:"Choose a file"},this.elOpts(r))),r,t.customOptions)}},{key:"picker",value:function(t){var e=t.el;return(new ln).set(ii(ii({items:Array.isArray(e.items)?e.items:[],pad:[{a:"0.5rem"}],rounded:!0},this.elOpts(e)),{},{raster:this.filteroRaster(e.id,t.customOptions)}))}},{key:"dropdown",value:function(t){var e,r=null!==(e=t.el.label)&&void 0!==e?e:t.el.title;t.el.items||(t.el.items=["Flower","Car","Maseratti"]);var n=t.el.items.map(function(t){return(new U).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}})}),i=(new Oe).set(ii(ii({},void 0===r?{}:{title:r}),{},{behaviour:"click",pad:[{a:"1rem"}],mar:[{a:"1rem"}],border:"1px solid black",width:"180px",radius:"1rem"})).add([].concat(ti(void 0!==r?[]:[new E(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 ne).set({border:"1px solid green",background:"#1abc9c",radius:"0.7rem",socenter:!0}).add(void 0===r?n.slice(1):n)])),o=this.filteroRaster(t.el.id,t.customOptions);return o&&i.rasterize(o),i}},{key:"protoNav",value:function(t){var e,r,n=t.customOptions,i=Array.isArray(null===(e=t.el)||void 0===e?void 0:e.items)&&t.el.items.length?t.el.items.map(ci):[{title:"Fire",link:"@e"},{title:"and",link:"@e"},{title:"smoke",link:"@e"}],o=Array.isArray(null===(r=t.el)||void 0===r?void 0:r.items)&&t.el.items.length?t.el.items.map(ci):null,a=function(){return o.map(function(t){return(new U).set({text:t.title,url:t.link,pad:[{tb:8,lr:4}]})})},s=i.map(function(t,e){return new U('"'.concat(t.title,'"')).set({fluidc:"S6",text:t.title,link:t.link,font:"Arial",pad:[{a:40}],bold:!0,hover:{color:"wheat",animation:.3}})}),l=i.map(function(t,e){return new U('"'.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 c=(new Oe).set({behaviour:"mouseover",pad:[{a:40}],padding:"10px",border:"1px solid black"}).add([new E("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 ne).set({centerColumn:!0,radius:"0.7rem",background:"#1abc9c",makeResponsiveBehaviour:"undefined"}).add([(new U).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 U).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"}})])]);l.push(c),s.push(c)}t.el.animation;var u=(new tr).set({breakpoints:[{at:"0px",view:(new $e).set({background:"#ecf0f1",mar:[{a:21}],brand:new E("Company").set({size:"S6",font:"Helvetica"}),hamburgerColour:"#3498db",radius:"1rem"}).add([].concat(ti(o?a():[(new U).set({text:"About",url:"#a"})]),[(new Oe).set({behaviour:"mouseover",pad:[{a:40}],mar:[{lr:"auto"}],breakpoint:"1200px",padding:"10px",border:"1px solid black",height:"auto"}).add([new E("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 E("Our story").set({cursor:"hand",fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"}),new E("Team").set({cursor:"hand",fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"})])],ti(o?[]:[new U("B").set({text:"About",url:"#b"}),new U("C").set({text:"Contact",url:"https://www.abcnews.com"})])))},{at:"1200px",view:(new Le).set({background:"#ecf0f1",mar:[{a:21}],maxHeight:"100px",radius:"1rem"}).add([new E("Company").set({size:"S6",font:"Helvetica"}),new lr(!0),(new Oe).set({behaviour:"mouseover",pad:[{a:40}],padding:"10px",border:"1px solid black",radius:"30px",width:"130px"}).add([new E("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 ne).set({flexDir:"column",mar:[{t:"10px"}],radius:".3rem"}).add([new U("").set({text:"Who we are",url:"jk",cursor:"hand",fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"}),new U("").set({text:"Info",url:"#u",cursor:"hand",fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"}),new U("").set({text:"About",url:"#u",cursor:"hand",fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"})])])].concat(ti(o?a():[(new U).set({text:"About",url:"#a"}),(new U).set({text:"Services",url:"#a"}),(new U).set({text:"Contact",url:"#a"})])))}]});return this.attachRaster(u,t.el,n)}},{key:"sideNav",value:function(t){t.customOptions;var e,r,n=Array.isArray(null===(e=t.el)||void 0===e?void 0:e.items)&&t.el.items.length>0,i=Array.isArray(null===(r=t.el)||void 0===r?void 0:r.items)&&t.el.items.length?t.el.items.map(ci):[{title:"Home",link:"@e"},{title:"Projects",link:"@e"},{title:"Services",link:"@e"}],o=i.map(function(t,e){return new U('"'.concat(t.title,'"')).set({fluidc:"S4",text:t.title,link:t.link,isNavA:!0,url:n&&t.link||"#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}})}),a=(new Oe).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 E("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 ne).set({centerColumn:!0,radius:"0.7rem",background:"#1abc9c",makeResponsiveBehaviour:"undefined"}).add([(new U).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 U).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"}})])]),s=i.map(function(t,e){return new U('"'.concat(t.title,'"')).set({fluidc:"S4",text:t.title,link:t.link,isNavA:!0,url:n&&t.link||"#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&&(s.push(a),o.push(a));var l=(new ne).set({column:!0}).add([new E("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}]})].concat(ti((t.el.animation?s:o).slice(0,i.length).filter(Boolean)),[t.el.animation&&t.el.dropdown?s[i.length]:new E("").set({}).excludeFromCode(),new E("Company, 2025").set({pad:[{a:20}],animation:{range:["0px","1900px"],op:{name:"animation",color:"green",width:"1px"}}})])),c=(new ne).set({column:!0}).add([new E("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}]})]),u=(new mt).setup({animate:!0,radius:"1rem",isSide:!0,background:"#ecf0f1",hamColour:{opened:"#0f766e",closed:"#c2410c"},mobileSize:"1.2em",fixed:!0,tags:{open:"sidebar:open",close:"sidebar:closed"}}).items(t.el.offcanvas?c:l),f=this.filteroRaster(t.el.id,t.customOptions);return f&&u.rasterize(f),u}},{key:"mapFree",value:function(t){var e=t.customOptions.filter(function(t){return"slayout"===t.op.name||"layout"===t.op.name})[0],r=null,n={cols:6,rows:6};"text-above-image"!==e.op.value&&"image-above-text"!==e.op.value||(r=null,n=null),"img-overlay-text"===e.op.value&&(r={text:{row:"1 / span 2",col:"3 / span 2"},image:{row:"2 / span 3",col:"3 / 3"}}),"img-leftof-text"===e.op.value&&(r={text:{row:"1",col:"1 / 3"},image:{row:"1",col:"3 / 4"}});var i=(new St).set({id:"#3",templateCols:n,height:"600px"}).add([new E("I am free").set({border:"3px solid green",font:"Arial",size:"S1",color:"#1abc9c",gpos:null!=r?r.text:null,zIndex:1}),(new M).set({url:"https://upload.wikimedia.org/wikipedia/commons/a/ac/MSC_World_Europa_-_Saint-Nazaire_-_June_2022.jpg",width:"400px",height:"auto",gpos:null!=r?r.image:null})]),o=this.filteroRaster(t.el.id,t.customOptions);return o&&i.rasterize(o),i}},{key:"mapCircle",value:function(t){var e=t.el;return(new Zn).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,r=t.el,n=null!==(e=t.el.sides)&&void 0!==e?e:7;return new Jn({id:"hex"}).set({sides:n,size:300,background:"#1abc9c",gradient:this.filtero("gradient",r.id,t.customOptions),animation:this.filtero("animation",r.id,t.customOptions),shadow:this.filtero("shadow",r.id,t.customOptions),span:this.filtero("span",r.id,t.customOptions),backgroundOp:this.filtero("background",r.id,t.customOptions),marginOp:this.filtero("margin",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)})}},{key:"mapText",value:function(t){var e,r,n=t.el;return new E(n.text||n.value).set({id:n.id,class:n.class,color:n.color,size:this.getElType(n.type),tag:n.tag,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:null!==(r=n.resprop)&&void 0!==r?r:null})}},{key:"mapImage",value:function(t){var e=t.el;return new M(e.url).set(ii(ii({},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}),r=t.el;return t.el.id&&(r.id=t.el.id),t.el.link&&t.el.text&&(r.url=t.el.link,r.text=t.el.text),r.animation=this.filtero("animation",t.el.id,t.customOptions),r.class=t.el.class,r.width=t.el.width,r.font="Arial",r.fluidc=t.el.fluidc,r.transform=this.filtero("transform",t.el.id,t.customOptions),r.shadow=this.filtero("shadow",t.el.id,t.customOptions),r.gradient=this.filtero("gradient",t.el.id,t.customOptions),r.blast=this.filtero("blast",t.el.id,t.customOptions),r.backgroundOp=this.filtero("background",t.el.id,t.customOptions),r.raster=this.filteroRaster(t.el.id,t.customOptions),r.pad=[{a:10}],e.length>0?Rn.style({el:t.el,re:r,bst:e,options:t.customOptions})[e.length-1]:(new U).set(r)}},{key:"mapGrid",value:function(t){var e=t.el,r=(t.customOptions.find(function(t){return"card-style"===t.op.name}),this.filtero("gradient",e.id,t.customOptions)),n=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.filteroRaster(e.id,t.customOptions),l=this.filtero("blast",e.id,t.customOptions),c='\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!==r?",\n gradient: ".concat(JSON.stringify(r)):"").concat(void 0!==n?",\n animation: ".concat(JSON.stringify(n)):"").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!==l?",\n blast: ".concat(JSON.stringify(l)):"",'\n })\n .items([\n new Image(item.img).set({isFull: true, url: item.img}),\n // #c2410c is 5.18:1 on white; h2 keeps the outline intact.\n new Text(item.title).set({ size: "S5", tag: "h2", color: "#c2410c" }),\n new Link("Link").set({\n text: item.title, \n url: item.link, \n background: "#1d6fe0", \n pad: [{ lr: "0.5rem", tb: "1rem" }], \n radius: "0.4rem", \n color: "white",\n mar: [{"a": 21}]\n })\n ])'),u=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", tag: "h2", color: "#c2410c" }),\n new Link("Link").set({\n text: item.title, \n url: item.link, \n background: "#1d6fe0", \n pad: [{ lr: "0.5rem", tb: "1rem" }], \n radius: "0.4rem", \n color: "white"\n })\n ])':c;return' new FlexGrid()\n .set({\n colat: "700px",\n wrap: true,\n align: "center",\n gap: "1rem"\n '.concat(void 0!==r?",\n gradient: ".concat(JSON.stringify(r)):"").concat(void 0!==n?",\n animation: ".concat(JSON.stringify(n)):"").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!==l?",\n blast: ".concat(JSON.stringify(l)):"").concat(void 0!==s?",\n raster: ".concat(JSON.stringify(s)):"","\n })\n .items(\n ").concat(this.gridItemsSource(t,u),"\n )\n ")}},{key:"gridItemsSource",value:function(t,e){var r=this,n=t.el.items;if(!Array.isArray(n)||0===n.length)return'[\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(e,"\n )");var i,o=function(t){return Array.isArray(t)},a=n.filter(function(t){return!o(t)});if(0===n.filter(o).length)return"".concat(JSON.stringify(a,null,2).split("\n").map(function(t,e){return 0===e?t:" "+t}).join("\n"),".map(item => \n ").concat((i=e,a.some(function(t){return t&&void 0!==t.alt})?i.replace("url: item.img}","url: item.img, alt: item.alt}"):i),"\n )");var s=n.map(function(e){return o(e)?r.cardFromSpecs(t,e):r.cardFromShorthand(e)});return"[\n ".concat(s.join(",\n "),"\n ]")}},{key:"cardFromSpecs",value:function(t,e){var r=this,n=e.map(function(e){var n=r.mapType(ii(ii({},t),{},{el:e}));return"string"==typeof n?n.trim():(n&&"function"==typeof n.toCode?[].concat(n.toCode()).join(""):"").trim()}).filter(Boolean);return'new Card()\n .set({ width: "300px", height: "700px", radius: "0.7rem", mar: { sides: ["all"], value: "0.8rem" } })\n .items([\n '.concat(n.join(",\n "),"\n ])")}},{key:"cardFromShorthand",value:function(t){var e=function(t){return JSON.stringify(null!=t?t:"")};return'new Card()\n .set({ width: "300px", height: "700px", radius: "0.7rem", mar: { sides: ["all"], value: "0.8rem" } })\n .items([\n new Image('.concat(e(t.img),").set({isFull: true, url: ").concat(e(t.img)).concat(void 0===t.alt?"":", alt: ".concat(e(t.alt)),"}),\n new Text(").concat(e(t.title),').set({ size: "S5", tag: "h2", color: "#c2410c" }),\n new Link("Link").set({ text: ').concat(e(t.title),", url: ").concat(e(t.link),', background: "#1d6fe0", pad: [{ lr: "0.5rem", tb: "1rem" }], radius: "0.4rem", color: "white" })\n ])')}},{key:"checkbox",value:function(t){var e=t.el,r="string"==typeof e.label?new E(e.label).set({size:"S6"}):e.label;return this.attachRaster((new mr).set(ii(ii({},this.elOpts(e,["label"])),void 0!==r?{label:r}:{})),e,t.customOptions)}},{key:"stack",value:function(t){var e=this,r=t.el,n=(new Gt).set(this.elOpts(r)),i=Array.isArray(r.children)?r.children:null;return i&&n.add(i.map(function(r){return e.mapType(ii(ii({},t),{},{el:r}))})),this.attachRaster(n,r,t.customOptions)}},{key:"form",value:function(t){var e,r=this,n=t.el,i=(new Pn).set(ii(ii({action:null!==(e=n.action)&&void 0!==e?e:""},void 0!==n.method?{method:n.method}:{}),void 0!==n.id?{id:n.id}:{})),o=Array.isArray(n.children)?n.children:null;return o&&i.add(o.map(function(e){return r.mapType(ii(ii({},t),{},{el:e}))})),i}},{key:"simple",value:function(t){var e,r,n=this,i=t.el,o=Array.isArray(i.react)?i.react:[];if(!o.length)throw new Error('[nodality] a "simple" element needs a non-empty `react` array of { at, template }.');var a=(Array.isArray(i.children)?i.children:[]).map(function(e){var r=n.mapType(ii(ii({},t),{},{el:e})).toCode();return Array.isArray(r)?r.join(""):String(r)}).join(",\n ");return"new AreaSwitcher()\n .set(".concat(JSON.stringify(ii({gap:null!==(e=i.gap)&&void 0!==e?e:"10px",height:null!==(r=i.height)&&void 0!==r?r:"700px"},void 0!==i.id?{id:i.id}:{})),")\n .react(").concat(JSON.stringify(o,null,2),")\n .add([\n ").concat(a,"\n ])")}},{key:"mapWrap",value:function(t){var e,r,n=this,i=t.el,o=null!==(e=t.el.kind)&&void 0!==e?e:"",a=new ne(o).set(ii(ii({},i),{},{font:null!==(r=i.font)&&void 0!==r?r:"Arial",stroke:this.filtero("blast",i.id,t.customOptions),gradient:this.filtero("gradient",i.id,t.customOptions),animation:this.filtero("animation",i.id,t.customOptions),shadow:this.filtero("shadow",i.id,t.customOptions),transform:this.filtero("transform",i.id,t.customOptions),filtera:this.filtero("filter",i.id,t.customOptions),raster:this.filteroRaster(i.id,t.customOptions)})),s=Array.isArray(i.children)?i.children:null;return s&&a.add(s.map(function(e){return n.mapType(ii(ii({},t),{},{el:e}))})),a}},{key:"mapUList",value:function(t){var e,r,n=this,i=t.el,o=null!==(e=t.el.kind)&&void 0!==e?e:"",a=new Rr(o).set(ii(ii({},i),{},{font:null!==(r=i.font)&&void 0!==r?r:"Arial",stroke:this.filtero("blast",i.id,t.customOptions),gradient:this.filtero("gradient",i.id,t.customOptions),animation:this.filtero("animation",i.id,t.customOptions),shadow:this.filtero("shadow",i.id,t.customOptions),transform:this.filtero("transform",i.id,t.customOptions),filtera:this.filtero("filter",i.id,t.customOptions),raster:this.filteroRaster(i.id,t.customOptions)})),s=Array.isArray(i.items)?i.items:null;return s&&a.setItems(s.map(function(e){return"string"==typeof e?new E(e).set({}):n.mapType(ii(ii({},t),{},{el:e}))})),a}},{key:"getElType",value:function(t){return"p"===t?"S6":"S".concat(t.substr(1))}},{key:"filtero",value:function(t,e,r){return r.filter(function(e){return e.op.name===t}).filter(function(t){return!t.target||t.target.some(function(t){return li(t,e)})})[0]}},{key:"elOpts",value:function(t){for(var e=new Set(["type","children","items","breakpoints","inputType","text","url"].concat(ti(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]))),r={},n=0,i=Object.keys(t);n<i.length;n++){var o=i[n];e.has(o)||(r[o]=t[o])}return r}},{key:"attachRaster",value:function(t,e,r){var n=this.filteroRaster(e.id,r);return n&&t&&"function"==typeof t.rasterize&&t.rasterize(n),t}},{key:"filteroRaster",value:function(e,r){var n=(r||[]).filter(function(r){return r&&"string"==typeof r.op&&t.includes(r.op)&&(!r.target||e&&r.target.some(function(t){return li(t,e)}))});return n.length>0?n:void 0}}],r&&ri(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();export{si as ELEMENT_TYPES,ui as ElementMapper};
|