nodality 1.2.3 → 1.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/dist/bundle.umd.js +1 -1
  2. package/dist/center.cjs.js +1 -1
  3. package/dist/center.esm.js +1 -1
  4. package/dist/designer.cjs.js +1 -1
  5. package/dist/designer.esm.js +1 -1
  6. package/dist/element-mapper.cjs.js +1 -1
  7. package/dist/element-mapper.esm.js +1 -1
  8. package/dist/finalresult.esm.js +1 -1
  9. package/dist/image-picker.cjs.js +1 -1
  10. package/dist/image-picker.esm.js +1 -1
  11. package/dist/image.cjs.js +1 -1
  12. package/dist/image.esm.js +1 -1
  13. package/dist/index.cjs.js +1 -1
  14. package/dist/index.d.ts +1 -1
  15. package/dist/index.esm.js +1 -1
  16. package/dist/keyframe-animation.cjs.js +1 -1
  17. package/dist/keyframe-animation.esm.js +1 -1
  18. package/dist/text.cjs.js +1 -1
  19. package/dist/text.esm.js +1 -1
  20. package/layout/animator.js +1 -1
  21. package/layout/audio.js +1 -1
  22. package/layout/audionew.js +1 -1
  23. package/layout/base.js +1 -1
  24. package/layout/beta-desktop-bar.js +1 -1
  25. package/layout/beta-mobile-bar.js +1 -1
  26. package/layout/button.js +1 -1
  27. package/layout/center.js +3 -3
  28. package/layout/checkbox.js +1 -1
  29. package/layout/circle.js +1 -1
  30. package/layout/code.js +1 -1
  31. package/layout/container.js +1 -1
  32. package/layout/dropdown-2025.js +1 -1
  33. package/layout/flex-card.js +1 -1
  34. package/layout/flex-grid.js +1 -1
  35. package/layout/flex-row.js +1 -1
  36. package/layout/form-components/custom.js +1 -1
  37. package/layout/form-components/data-list.js +1 -1
  38. package/layout/form-components/floating-input.js +1 -1
  39. package/layout/form-components/form-all.js +1 -1
  40. package/layout/form-components/form.js +1 -1
  41. package/layout/form-components/image-picker.js +2 -2
  42. package/layout/form-components/picker.js +1 -1
  43. package/layout/form-components/radio.js +1 -1
  44. package/layout/form-components/radiogroup.js +1 -1
  45. package/layout/form-components/range.js +1 -1
  46. package/layout/free.js +1 -1
  47. package/layout/grid-switcher.js +1 -1
  48. package/layout/grid.js +1 -1
  49. package/layout/horizontal-scroller.js +1 -1
  50. package/layout/image.js +2 -2
  51. package/layout/index.js +1 -1
  52. package/layout/link.js +1 -1
  53. package/layout/list.js +1 -1
  54. package/layout/meta-adder.js +1 -1
  55. package/layout/modal-2025.js +1 -1
  56. package/layout/morph.js +1 -1
  57. package/layout/multiswitcher.js +1 -1
  58. package/layout/nav-bar.js +1 -1
  59. package/layout/nav-factor/custom-div.js +1 -1
  60. package/layout/new-nav-bar.js +1 -1
  61. package/layout/polygon.js +1 -1
  62. package/layout/prerender-site.js +1 -1
  63. package/layout/prerender.js +1 -1
  64. package/layout/progress.js +1 -1
  65. package/layout/row.js +1 -1
  66. package/layout/scroll-video.js +1 -1
  67. package/layout/side-bar.js +1 -1
  68. package/layout/side-nav-bar.js +1 -1
  69. package/layout/simple-bar.js +1 -1
  70. package/layout/slider-2025.js +1 -1
  71. package/layout/spacer.js +1 -1
  72. package/layout/stack.js +1 -1
  73. package/layout/svg.js +1 -1
  74. package/layout/switcher.js +1 -1
  75. package/layout/table.js +1 -1
  76. package/layout/text-field.js +1 -1
  77. package/layout/text.js +2 -2
  78. package/layout/ulist.js +1 -1
  79. package/layout/video.js +1 -1
  80. package/layout/wrap.js +1 -1
  81. package/layout/zoom-card.js +1 -1
  82. package/lib/agent-surface.js +1 -1
  83. package/lib/card-getter.js +1 -1
  84. package/lib/codegen.js +1 -1
  85. package/lib/data.js +1 -1
  86. package/lib/designer.js +1 -1
  87. package/lib/element-mapper.js +1 -1
  88. package/lib/keyframe-animation.js +2 -2
  89. package/lib/link-getter.js +1 -1
  90. package/lib/morph-node.js +1 -1
  91. package/lib/raster-inspect.js +1 -1
  92. package/lib/raster-ops.js +1 -1
  93. package/lib/raster-presets.js +1 -1
  94. package/lib/scroll-video.js +1 -1
  95. package/lib/seo.js +1 -1
  96. package/lib/stacker.js +1 -1
  97. package/lib/suggest.js +1 -1
  98. package/lib/theme.js +1 -1
  99. package/lib/transform-anim.js +1 -1
  100. package/lib/transition.js +1 -1
  101. package/lib/validate-nodes.js +1 -1
  102. package/lib/webmcp-adapter.js +1 -1
  103. package/package.json +1 -1
package/dist/image.esm.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see image.esm.js.LICENSE.txt */
2
- import{applyRasterPipeline as t}from"../lib/raster-ops.js";var e={};function r(t){return r="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},r(t)}e.d=(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},e.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var n="nodality.theme.mode",i="nodality:theme",s={mode:function(){try{var t=localStorage.getItem(n);if("light"===t||"dark"===t)return t}catch(t){}return"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}(),tokens:{light:{},dark:{}},defaults:{light:{color:"#111"},dark:{}},setDefaults:function(t){return t&&"object"===r(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"===r(t)&&(t.light&&Object.assign(this.tokens.light,t.light),t.dark&&Object.assign(this.tokens.dark,t.dark)),this},get current(){return this.tokens[this.mode]||{}},set:function(t){if("light"!==t&&"dark"!==t)return this;if(t===this.mode)return this;this.mode=t;try{localStorage.setItem(n,t)}catch(t){}return this._broadcast(),this},toggle:function(){return this.set("dark"===this.mode?"light":"dark")},subscribe:function(t){if("undefined"==typeof document)return function(){};var e=function(e){return t(e.detail.mode,e.detail.tokens)};document.addEventListener(i,e);try{t(this.mode,this.current)}catch(t){}return function(){return document.removeEventListener(i,e)}},_broadcast:function(){"undefined"!=typeof document&&document.dispatchEvent(new CustomEvent(i,{detail:{mode:this.mode,tokens:this.current}}))}};function o(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,s,o,a=[],l=!0,c=!1;try{if(s=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=s.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&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}(t,e)||l(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 a(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=l(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 s,o=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return o=t.done,t},e:function(t){a=!0,s=t},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw s}}}}function l(t,e){if(t){if("string"==typeof t)return c(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)?c(t,e):void 0}}function c(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 u(t){return u="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},u(t)}function h(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"!=u(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=u(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==u(e)?e:e+""}var f=function(){function e(){var t,r,n,i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),t=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="",s="",o="",a="",l="",c="",u="",h="";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:")?s=t.replace("tz:",""):t.startsWith("scale(")?o=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:")&&(h=t.replace("opacity:",""))}),r=i.setDefault(r),n=i.setDefault(n),s=i.setDefault(s);var d="";if("0px"!=n&&"0px"!=r&&"0px"!=s?d+="translate3d(".concat(r,", ").concat(n,", ").concat(s,")"):"0px"==n&&"0px"==r||(d+="translate(".concat(r,", ").concat(n,")")),o&&(d+=" ".concat(o)),l&&(d+=" ".concat(l)),a&&(d+=" ".concat(a)),c&&(d+=" ".concat(c)),u&&(d+=" ".concat(u)),d){if(t.op.duration){var f=t.op.duration.replace(/^(\d+)(s)-/,function(t,e,r){return e/2+r+" "}),p="transform ".concat(f,", opacity ").concat(f);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=h}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 s=1e3*parseFloat(e.duration),o=e.closeAfter?e.closeAfter:0;setTimeout(function(){e.keep||n()},s/2+o)}e.hardCSS&&(i.res.style.transform=e.hardCSS)}else console.warn("[nodality] reactOnTransform: unrecognised transform descriptor - ignored")},(r=d(r="reactOnTransform"))in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[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=e,n=[{key:"rasterize",value:function(e){var r=this;if(e&&0!==e.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=t(r.res,e)}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"===u(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=a(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"!==u(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"===u(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 s=e.prevTransform?"".concat(e.prevTransform," "):"",o=[];null!=t.transform&&o.push(t.transform),null!=t.scale&&o.push("scale(".concat(t.scale,")")),e.res.style.transform="".concat(s).concat(o.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 s={},o=["tx","ty"],a=0;a<o.length;a++){var l=o[a],c=t.valMin&&null!=t.valMin[l],u=t.valMax&&null!=t.valMax[l];if(c||u){var h=r(c?t.valMin[l]:u?t.valMax[l]:"0px"),d=r(u?t.valMax[l]:c?t.valMin[l]:"0px"),f=e.smartRange(window.scrollY,{min:t.from,max:t.to},{min:h.num,max:d.num});s[l]="".concat(f).concat(h.unit)}}n(s)}};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(t,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]},s=["resprop","breakpoint","value","values","range"],a={flexDir:"flexDirection",dir:"flexDirection",justify:"justifyContent",align:"alignItems",wrap:"flexWrap",bg:"background",radius:"borderRadius",z:"zIndex",exact:"fontSize"},l=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};t.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)]}),t.sort(function(t,e){return t.range[1]-e.range[1]});var c=t.find(function(t){return"default"===t.breakpoint});c||(c={breakpoint:"default",range:i.default},t.unshift(c));var u=new Set;t.forEach(function(t){Object.keys(t).forEach(function(t){s.includes(t)||"range"===t||u.add(t)})}),u.forEach(function(t){void 0===c[t]&&(c[t]=n.options[t]||"initial")}),this._responsiveTasks=this._responsiveTasks||[],this._responsiveTasks.push(function(){for(var r=e.viewportWidth(),i=c,a=0;a<t.length;a++){var h=t[a],d=o(h.range,2),f=d[0],p=d[1];if("default"!==h.breakpoint&&r>=f&&r<=p){i=h;break}}for(var y in u.forEach(function(t){if("keySet"===t){var e=c[t];e&&e.key&&(n.res.style[e.key]=e.value)}else n.res.style[l(t)]=c[t]}),i)if("exact"!==y){if(!s.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[l(y)]=m}}else n.res.style.fontSize=i[y]}),this._setupResponsiveManager()}},{key:"respad",value:function(t){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]};t.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]}),t.sort(function(t,e){return t.range[0]-e.range[0]});var i=t.find(function(t){return"default"===t.breakpoint});i||(i={breakpoint:"default",range:n.default},t.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=e.viewportWidth(),s=i,a=0;a<t.length;a++){var l=t[a],c=o(l.range,2),u=c[0],h=c[1];if("default"!==l.breakpoint&&n>=u&&n<=h){s=l;break}}var d=void 0!==s.values?s.values:i.values;null!=d&&r.pad(d)}),this._setupResponsiveManager()}},{key:"resmar",value:function(t){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]};t.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]}),t.sort(function(t,e){return t.range[0]-e.range[0]});var i=t.find(function(t){return"default"===t.breakpoint});i||(i={breakpoint:"default",range:n.default},t.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=e.viewportWidth(),s=i,a=0;a<t.length;a++){var l=t[a],c=o(l.range,2),u=c[0],h=c[1];if("default"!==l.breakpoint&&n>=u&&n<=h){s=l;break}}var d=void 0!==s.values?s.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||"",s=!0===t||"both"===t||"x"===t,o=!0===t||"both"===t||"y"===t;if(n.includes("grid"))return s&&(r.justifyItems="center",r.justifyContent="center"),o&&(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?o:s)&&(r.justifyContent="center"),(a?s:o)&&(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],s=t[e][i],o=0;o<i.length;o++)switch(i[o]){case"a":this.res.style.padding=this.isNumber(s)?"".concat(s,"px"):s;break;case"t":this.res.style.paddingTop=this.isNumber(s)?"".concat(s,"px"):s;break;case"l":this.res.style.paddingLeft=this.isNumber(s)?"".concat(s,"px"):s;break;case"r":this.res.style.paddingRight=this.isNumber(s)?"".concat(s,"px"):s;break;case"b":this.res.style.paddingBottom=this.isNumber(s)?"".concat(s,"px"):s}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],s=t[e][i],o=0;o<i.length;o++)switch(i[o]){case"a":"auto"===s?(this.res.style.marginLeft="auto",this.res.style.marginRight="auto"):this.res.style.margin=this.isNumber(s)?"".concat(s,"px"):s;break;case"t":this.res.style.marginTop=this.isNumber(s)?"".concat(s,"px"):s;break;case"l":this.res.style.marginLeft=this.isNumber(s)?"".concat(s,"px"):s;break;case"r":this.res.style.marginRight=this.isNumber(s)?"".concat(s,"px"):s;break;case"b":this.res.style.marginBottom=this.isNumber(s)?"".concat(s,"px"):s}"center"===i&&!0===s&&(this.res.style.marginLeft="auto",this.res.style.marginRight="auto"),"auto"===s&&(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 s=document.createTextNode(this.text);this.res.appendChild(s),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 o=document.createTextNode(this.text);this.res.appendChild(o),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(t,r,n){var i=this;this.ap=!1,this.cta=0,this.once=!1;var s,l=a(t);try{for(l.s();!(s=l.n()).done;){var c=s.value;c.range||(c.range=["0px","999999px"])}}catch(t){l.e(t)}finally{l.f()}t.sort(function(t,e){return parseInt(t.range[0])-parseInt(e.range[0])});var u=function(s){var l=e.viewportWidth(),c=[],u=[];i.resCopy=i.res,i.storedQueries=t.map(function(t){return t.target}).filter(function(t){return null!=t});var h,d=a(t);try{for(d.s();!(h=d.n()).done;){var f=h.value;i.counterIndex++;var p=o(f.range,2),y=p[0],m=p[1],v=parseInt(y),g=parseInt(m),b=!0;if(f.target){b=!1;for(var k=0;k<f.target.length;k++)f.target[k]===r&&(b=!0)}l>=v&&l<=g&&b&&(c.push(f.log),u.push(f),f.op&&f.op.margin&&(i.useMargin=f.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),c.includes("gradient"),(c.includes("gradient")||c.includes("shadow"))&&(i.res.style.position="relative"),c.includes("blast")){var x,w=u.filter(function(t){return"blast"===t.log})[0].op.color,S=null!==(x=u.filter(function(t){return"blast"===t.log})[0].op.width)&&void 0!==x?x:"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"]=w,i.res.style["-webkit-text-stroke-width"]="".concat(S))}if(c.includes("filter")){var T=u.filter(function(t){return"filter"===t.log})[0].op.filter;i.res.style.filter=T}if(c.includes("background")&&(i.res.style.backgroundColor="green"),c.includes("gradient")&&("LayoutWrapperElement"!==i.getType()&&"FlexRowLayoutElement"!==i.getType()&&(i.res.style["-webkit-text-fill-color"]="transparent"),i.res.style.background=i.globalGradient,"LayoutWrapperElement"!==i.getType()&&"FlexRowLayoutElement"!==i.getType()&&(i.res.style["background-clip"]="text")),c.includes("shadow")){var O,_,j,W,C=i.options.shadow.op,E=null!==(O=C.steps)&&void 0!==O?O:1,A=null!==(_=C.colors)&&void 0!==_?_:["gray"],I=null!==(j=C.movements)&&void 0!==j?j:["3px","3px"],R=null!==(W=C.radius)&&void 0!==W?W:"3px";if(1===I.length&&(I=[I[0],I[0]]),"FlexRowLayoutElement"===i.getType()||"LayoutWrapperElement"===i.getType()){for(var P=[],z=0;z<E;z++){var M,L=null!==(M=A[z])&&void 0!==M?M:A[0],F=I[0],N=I[1];P.push("".concat(F," ").concat(N," ").concat(R," ").concat(L))}i.res.style.boxShadow=P.join(", ")}else{for(var H=[],D=0;D<E;D++){var B,U=null!==(B=A[D])&&void 0!==B?B:A[0],G=I[0],Y=I[1];H.push("drop-shadow(".concat(G," ").concat(Y," ").concat(R," ").concat(U,")"))}i.res.style.filter=H.join(" ")}}if(c.includes("margin"))for(k=0;k<t.length;k++)if(t[k].op){var $=t[k].op.offsets;$&&void 0!==i.index&&(i.res.style.margin=$[Number(i.index)]+"px")}if(c.includes("spana")||c.includes("span")){var J=document.createElement("div");if(J.setAttribute("id","oroa"),Object.assign(J.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,s=t.style||{};if(e<r.length){var o=r.indexOf(n,e);if(o>e){var a=r.substring(e,o);i.res.appendChild(new i.constructor(a).setup({type:"span",id:s.id,animation:s.animation}).set({}).render())}e=o+n.length}var l=new i.constructor(n).setup({type:"span",id:s.id,animation:s.animation}).set(s).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 Q=new i.constructor(i.prevText).set({}).render();i.prevText&&i.prevText.length>0&&s&&i.res.appendChild(Q)}if(c.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 Z=i.options.animation.op;i.res.animate(Z.keyframesClose,{duration:0,fill:"forwards"});var q=function(){window.scrollY>parseFloat(Z.fireAt)&&(i.res.animate(Z.keyframesOpen,Z.openOptions),window.removeEventListener("scroll",q))};i._on(window,"scroll",q)}if(i.options.animation&&"inview"===i.options.animation.op.fireAt){var V=i.options.animation.op;i.res.animate(V.keyframesClose,{duration:0,fill:"forwards"});var K=!1,tt=new IntersectionObserver(function(t,e){t.forEach(function(t){t.isIntersecting&&!K&&(K=!0,i.res.animate(V.keyframesOpen,V.openOptions),e.disconnect())})});tt.observe(i.res),i._track(function(){return tt.disconnect()})}}};this.options.animation||this._on(window,"resize",function(){return u()}),u()}},{key:"maxWidth",value:function(t){return this.res.style.maxWidth=t,this}},{key:"removeQuotesFromFirstWord",value:function(t){return t.replace(new RegExp('"([A-Za-z_$][A-Za-z0-9_$]*)"\\s*:',"g"),"$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&&h(r.prototype,n),i&&h(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();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 y(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 m(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,v(n.key),n)}}function v(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 g(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(g=function(){return!!t})()}function b(t,e,r,n){var i=k(x(1&n?t.prototype:t),e,r);return 2&n&&"function"==typeof i?function(t){return i.apply(r,t)}:i}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=x(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 x(t){return x=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},x(t)}function w(t,e){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},w(t,e)}var S=function(){function t(e,r,n,i){var s;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(s=function(t,e,r){return e=x(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,g()?Reflect.construct(e,r||[],x(t).constructor):e.apply(t,r))}(this,t)).url=e,s.res=null,s.code=[],s}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&&w(t,e)}(t,f),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,s,o,a=[],l=!0,c=!1;try{if(s=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=s.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&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return y(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)?y(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(),e.url&&this.res.setAttribute("src",e.url),"IMG"===this.res.tagName&&(e.srcset&&this.res.setAttribute("srcset",e.srcset),e.sizes&&this.res.setAttribute("sizes",e.sizes),void 0!==e.alt&&this.res.setAttribute("alt",e.alt),e.loading&&this.res.setAttribute("loading",e.loading),e.decoding&&this.res.setAttribute("decoding",e.decoding),e.fetchPriority&&this.res.setAttribute("fetchpriority",e.fetchPriority)),e.id&&this.res.setAttribute("id",e.id),e.id&&(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&&b(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 s;s=Array.isArray(e.filtera)?n.filtera.filter(function(t){return"filter"===t.op.name})[0]:e.filtera;var o=this.removeQuotesFromFirstWord(JSON.stringify(s));r+="\n filtera: ".concat(o,", \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&&b(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 h=n.shadow,d=this.removeQuotesFromFirstWord(JSON.stringify(h));r+="\n shadow: ".concat(d,",")}if(n.animation){var f=n.animation,p=this.removeQuotesFromFirstWord(JSON.stringify(f));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 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 s=window.matchMedia("(max-device-width: 415px)"),o=document.createElement("div");return o.style.viewTransitionName=n,o.style.width="100%",o.style.height=this.options.height?this.options.height:"400px",i&&(o.style.gridColumn=i.gridColumn,o.style.gridRow=i.gridRow),s.matches&&(o.style.height="500"),o.style.backgroundImage="url(".concat(t,")"),o.style.backgroundPosition="center center",o.style.backgroundRepeat="no-repeat",o.style.backgroundSize="cover","uncover"===r&&(o.style.backgroundSize="contain"),"contain"===e&&(o.style.backgroundSize="contain"),this.res=o,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&&m(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();export{S as Image};
2
+ import{applyRasterPipeline as t}from"../lib/raster-ops.js";var e={};function r(t){return r="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},r(t)}e.d=(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},e.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var n="nodality.theme.mode",i="nodality:theme",s={mode:function(){try{var t=localStorage.getItem(n);if("light"===t||"dark"===t)return t}catch(t){}return"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}(),tokens:{light:{},dark:{}},defaults:{light:{color:"#111"},dark:{}},setDefaults:function(t){return t&&"object"===r(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"===r(t)&&(t.light&&Object.assign(this.tokens.light,t.light),t.dark&&Object.assign(this.tokens.dark,t.dark)),this},get current(){return this.tokens[this.mode]||{}},set:function(t){if("light"!==t&&"dark"!==t)return this;if(t===this.mode)return this;this.mode=t;try{localStorage.setItem(n,t)}catch(t){}return this._broadcast(),this},toggle:function(){return this.set("dark"===this.mode?"light":"dark")},subscribe:function(t){if("undefined"==typeof document)return function(){};var e=function(e){return t(e.detail.mode,e.detail.tokens)};document.addEventListener(i,e);try{t(this.mode,this.current)}catch(t){}return function(){return document.removeEventListener(i,e)}},_broadcast:function(){"undefined"!=typeof document&&document.dispatchEvent(new CustomEvent(i,{detail:{mode:this.mode,tokens:this.current}}))}};function o(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,s,o,a=[],l=!0,c=!1;try{if(s=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=s.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&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}(t,e)||l(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 a(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=l(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 s,o=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return o=t.done,t},e:function(t){a=!0,s=t},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw s}}}}function l(t,e){if(t){if("string"==typeof t)return c(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)?c(t,e):void 0}}function c(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 u(t){return u="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},u(t)}function h(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"!=u(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=u(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==u(e)?e:e+""}var f=function(){function e(){var t,r,n,i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),t=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="",s="",o="",a="",l="",c="",u="",h="";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:")?s=t.replace("tz:",""):t.startsWith("scale(")?o=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:")&&(h=t.replace("opacity:",""))}),r=i.setDefault(r),n=i.setDefault(n),s=i.setDefault(s);var d="";if("0px"!=n&&"0px"!=r&&"0px"!=s?d+="translate3d(".concat(r,", ").concat(n,", ").concat(s,")"):"0px"==n&&"0px"==r||(d+="translate(".concat(r,", ").concat(n,")")),o&&(d+=" ".concat(o)),l&&(d+=" ".concat(l)),a&&(d+=" ".concat(a)),c&&(d+=" ".concat(c)),u&&(d+=" ".concat(u)),d){if(t.op.duration){var f=t.op.duration.replace(/^(\d+)(s)-/,function(t,e,r){return e/2+r+" "}),p="transform ".concat(f,", opacity ").concat(f);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=h}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 s=1e3*parseFloat(e.duration),o=e.closeAfter?e.closeAfter:0;setTimeout(function(){e.keep||n()},s/2+o)}e.hardCSS&&(i.res.style.transform=e.hardCSS)}else console.warn("[nodality] reactOnTransform: unrecognised transform descriptor - ignored")},(r=d(r="reactOnTransform"))in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[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=e,n=[{key:"rasterize",value:function(e){var r=this;if(e&&0!==e.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=t(r.res,e)}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"===u(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=a(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"!==u(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"===u(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 s=e.prevTransform?"".concat(e.prevTransform," "):"",o=[];null!=t.transform&&o.push(t.transform),null!=t.scale&&o.push("scale(".concat(t.scale,")")),e.res.style.transform="".concat(s).concat(o.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 s={},o=["tx","ty"],a=0;a<o.length;a++){var l=o[a],c=t.valMin&&null!=t.valMin[l],u=t.valMax&&null!=t.valMax[l];if(c||u){var h=r(c?t.valMin[l]:u?t.valMax[l]:"0px"),d=r(u?t.valMax[l]:c?t.valMin[l]:"0px"),f=e.smartRange(window.scrollY,{min:t.from,max:t.to},{min:h.num,max:d.num});s[l]="".concat(f).concat(h.unit)}}n(s)}};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(t,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]},s=["resprop","breakpoint","value","values","range"],a={flexDir:"flexDirection",dir:"flexDirection",justify:"justifyContent",align:"alignItems",wrap:"flexWrap",bg:"background",radius:"borderRadius",z:"zIndex",exact:"fontSize"},l=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};t.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)]}),t.sort(function(t,e){return t.range[1]-e.range[1]});var c=t.find(function(t){return"default"===t.breakpoint});c||(c={breakpoint:"default",range:i.default},t.unshift(c));var u=new Set;t.forEach(function(t){Object.keys(t).forEach(function(t){s.includes(t)||"range"===t||u.add(t)})}),u.forEach(function(t){void 0===c[t]&&(c[t]=n.options[t]||"initial")}),this._responsiveTasks=this._responsiveTasks||[],this._responsiveTasks.push(function(){for(var r=e.viewportWidth(),i=c,a=0;a<t.length;a++){var h=t[a],d=o(h.range,2),f=d[0],p=d[1];if("default"!==h.breakpoint&&r>=f&&r<=p){i=h;break}}for(var y in u.forEach(function(t){if("keySet"===t){var e=c[t];e&&e.key&&(n.res.style[e.key]=e.value)}else n.res.style[l(t)]=c[t]}),i)if("exact"!==y){if(!s.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[l(y)]=m}}else n.res.style.fontSize=i[y]}),this._setupResponsiveManager()}},{key:"respad",value:function(t){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]};t.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]}),t.sort(function(t,e){return t.range[0]-e.range[0]});var i=t.find(function(t){return"default"===t.breakpoint});i||(i={breakpoint:"default",range:n.default},t.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=e.viewportWidth(),s=i,a=0;a<t.length;a++){var l=t[a],c=o(l.range,2),u=c[0],h=c[1];if("default"!==l.breakpoint&&n>=u&&n<=h){s=l;break}}var d=void 0!==s.values?s.values:i.values;null!=d&&r.pad(d)}),this._setupResponsiveManager()}},{key:"resmar",value:function(t){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]};t.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]}),t.sort(function(t,e){return t.range[0]-e.range[0]});var i=t.find(function(t){return"default"===t.breakpoint});i||(i={breakpoint:"default",range:n.default},t.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=e.viewportWidth(),s=i,a=0;a<t.length;a++){var l=t[a],c=o(l.range,2),u=c[0],h=c[1];if("default"!==l.breakpoint&&n>=u&&n<=h){s=l;break}}var d=void 0!==s.values?s.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||"",s=!0===t||"both"===t||"x"===t,o=!0===t||"both"===t||"y"===t;if(n.includes("grid"))return s&&(r.justifyItems="center",r.justifyContent="center"),o&&(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?o:s)&&(r.justifyContent="center"),(a?s:o)&&(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],s=t[e][i],o=0;o<i.length;o++)switch(i[o]){case"a":this.res.style.padding=this.isNumber(s)?"".concat(s,"px"):s;break;case"t":this.res.style.paddingTop=this.isNumber(s)?"".concat(s,"px"):s;break;case"l":this.res.style.paddingLeft=this.isNumber(s)?"".concat(s,"px"):s;break;case"r":this.res.style.paddingRight=this.isNumber(s)?"".concat(s,"px"):s;break;case"b":this.res.style.paddingBottom=this.isNumber(s)?"".concat(s,"px"):s}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],s=t[e][i],o=0;o<i.length;o++)switch(i[o]){case"a":"auto"===s?(this.res.style.marginLeft="auto",this.res.style.marginRight="auto"):this.res.style.margin=this.isNumber(s)?"".concat(s,"px"):s;break;case"t":this.res.style.marginTop=this.isNumber(s)?"".concat(s,"px"):s;break;case"l":this.res.style.marginLeft=this.isNumber(s)?"".concat(s,"px"):s;break;case"r":this.res.style.marginRight=this.isNumber(s)?"".concat(s,"px"):s;break;case"b":this.res.style.marginBottom=this.isNumber(s)?"".concat(s,"px"):s}"center"===i&&!0===s&&(this.res.style.marginLeft="auto",this.res.style.marginRight="auto"),"auto"===s&&(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 s=document.createTextNode(this.text);this.res.appendChild(s),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 o=document.createTextNode(this.text);this.res.appendChild(o),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(t,r,n){var i=this;this.ap=!1,this.cta=0,this.once=!1;var s,l=a(t);try{for(l.s();!(s=l.n()).done;){var c=s.value;c.range||(c.range=["0px","999999px"])}}catch(t){l.e(t)}finally{l.f()}t.sort(function(t,e){return parseInt(t.range[0])-parseInt(e.range[0])});var u=function(s){var l=e.viewportWidth(),c=[],u=[];i.resCopy=i.res,i.storedQueries=t.map(function(t){return t.target}).filter(function(t){return null!=t});var h,d=a(t);try{for(d.s();!(h=d.n()).done;){var f=h.value;i.counterIndex++;var p=o(f.range,2),y=p[0],m=p[1],v=parseInt(y),g=parseInt(m),b=!0;if(f.target){b=!1;for(var k=0;k<f.target.length;k++)f.target[k]===r&&(b=!0)}l>=v&&l<=g&&b&&(c.push(f.log),u.push(f),f.op&&f.op.margin&&(i.useMargin=f.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),c.includes("gradient"),(c.includes("gradient")||c.includes("shadow"))&&(i.res.style.position="relative"),c.includes("blast")){var x,w=u.filter(function(t){return"blast"===t.log})[0].op.color,S=null!==(x=u.filter(function(t){return"blast"===t.log})[0].op.width)&&void 0!==x?x:"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"]=w,i.res.style["-webkit-text-stroke-width"]="".concat(S))}if(c.includes("filter")){var T=u.filter(function(t){return"filter"===t.log})[0].op.filter;i.res.style.filter=T}if(c.includes("background")&&(i.res.style.backgroundColor="green"),c.includes("gradient")&&("LayoutWrapperElement"!==i.getType()&&"FlexRowLayoutElement"!==i.getType()&&(i.res.style["-webkit-text-fill-color"]="transparent"),i.res.style.background=i.globalGradient,"LayoutWrapperElement"!==i.getType()&&"FlexRowLayoutElement"!==i.getType()&&(i.res.style["background-clip"]="text")),c.includes("shadow")){var O,_,j,W,C=i.options.shadow.op,E=null!==(O=C.steps)&&void 0!==O?O:1,A=null!==(_=C.colors)&&void 0!==_?_:["gray"],I=null!==(j=C.movements)&&void 0!==j?j:["3px","3px"],R=null!==(W=C.radius)&&void 0!==W?W:"3px";if(1===I.length&&(I=[I[0],I[0]]),"FlexRowLayoutElement"===i.getType()||"LayoutWrapperElement"===i.getType()){for(var P=[],z=0;z<E;z++){var M,L=null!==(M=A[z])&&void 0!==M?M:A[0],F=I[0],N=I[1];P.push("".concat(F," ").concat(N," ").concat(R," ").concat(L))}i.res.style.boxShadow=P.join(", ")}else{for(var H=[],D=0;D<E;D++){var B,U=null!==(B=A[D])&&void 0!==B?B:A[0],G=I[0],Y=I[1];H.push("drop-shadow(".concat(G," ").concat(Y," ").concat(R," ").concat(U,")"))}i.res.style.filter=H.join(" ")}}if(c.includes("margin"))for(k=0;k<t.length;k++)if(t[k].op){var $=t[k].op.offsets;$&&void 0!==i.index&&(i.res.style.margin=$[Number(i.index)]+"px")}if(c.includes("spana")||c.includes("span")){var J=document.createElement("div");if(J.setAttribute("id","oroa"),Object.assign(J.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,s=t.style||{};if(e<r.length){var o=r.indexOf(n,e);if(o>e){var a=r.substring(e,o);i.res.appendChild(new i.constructor(a).setup({type:"span",id:s.id,animation:s.animation}).set({}).render())}e=o+n.length}var l=new i.constructor(n).setup({type:"span",id:s.id,animation:s.animation}).set(s).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 Q=new i.constructor(i.prevText).set({}).render();i.prevText&&i.prevText.length>0&&s&&i.res.appendChild(Q)}if(c.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 Z=i.options.animation.op;i.res.animate(Z.keyframesClose,{duration:0,fill:"forwards"});var q=function(){window.scrollY>parseFloat(Z.fireAt)&&(i.res.animate(Z.keyframesOpen,Z.openOptions),window.removeEventListener("scroll",q))};i._on(window,"scroll",q)}if(i.options.animation&&"inview"===i.options.animation.op.fireAt){var V=i.options.animation.op;i.res.animate(V.keyframesClose,{duration:0,fill:"forwards"});var K=!1,tt=new IntersectionObserver(function(t,e){t.forEach(function(t){t.isIntersecting&&!K&&(K=!0,i.res.animate(V.keyframesOpen,V.openOptions),e.disconnect())})});tt.observe(i.res),i._track(function(){return tt.disconnect()})}}};this.options.animation||this._on(window,"resize",function(){return u()}),u()}},{key:"maxWidth",value:function(t){return this.res.style.maxWidth=t,this}},{key:"removeQuotesFromFirstWord",value:function(t){return t.replace(new RegExp('"([A-Za-z_$][A-Za-z0-9_$]*)"\\s*:',"g"),"$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&&h(r.prototype,n),i&&h(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();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 y(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 m(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,v(n.key),n)}}function v(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 g(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(g=function(){return!!t})()}function b(t,e,r,n){var i=k(x(1&n?t.prototype:t),e,r);return 2&n&&"function"==typeof i?function(t){return i.apply(r,t)}:i}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=x(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 x(t){return x=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},x(t)}function w(t,e){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},w(t,e)}var S=function(){function t(e,r,n,i){var s;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(s=function(t,e,r){return e=x(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,g()?Reflect.construct(e,r||[],x(t).constructor):e.apply(t,r))}(this,t)).url=e,s.res=null,s.code=[],s}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&&w(t,e)}(t,f),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,s,o,a=[],l=!0,c=!1;try{if(s=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=s.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&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return y(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)?y(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(),e.url&&this.res.setAttribute("src",e.url),"IMG"===this.res.tagName&&(e.srcset&&this.res.setAttribute("srcset",e.srcset),e.sizes&&this.res.setAttribute("sizes",e.sizes),void 0!==e.alt&&this.res.setAttribute("alt",e.alt),e.loading&&this.res.setAttribute("loading",e.loading),e.decoding&&this.res.setAttribute("decoding",e.decoding),e.fetchPriority&&this.res.setAttribute("fetchpriority",e.fetchPriority)),e.id&&this.res.setAttribute("id",e.id),e.id&&(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&&b(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 s;s=Array.isArray(e.filtera)?n.filtera.filter(function(t){return"filter"===t.op.name})[0]:e.filtera;var o=this.removeQuotesFromFirstWord(JSON.stringify(s));r+="\n filtera: ".concat(o,", \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&&b(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 h=n.shadow,d=this.removeQuotesFromFirstWord(JSON.stringify(h));r+="\n shadow: ".concat(d,",")}if(n.animation){var f=n.animation,p=this.removeQuotesFromFirstWord(JSON.stringify(f));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 s=window.matchMedia("(max-device-width: 415px)"),o=document.createElement("div");return o.style.viewTransitionName=n,o.style.width="100%",o.style.height=this.options.height?this.options.height:"400px",i&&(o.style.gridColumn=i.gridColumn,o.style.gridRow=i.gridRow),s.matches&&(o.style.height="500"),o.style.backgroundImage="url(".concat(t,")"),o.style.backgroundPosition="center center",o.style.backgroundRepeat="no-repeat",o.style.backgroundSize="cover","uncover"===r&&(o.style.backgroundSize="contain"),"contain"===e&&(o.style.backgroundSize="contain"),this.res=o,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&&m(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();export{S as Image};