tiny-essentials 1.18.1 → 1.19.1

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 (74) hide show
  1. package/README.md +17 -3
  2. package/dist/node_modules/firebase-functions/lib/common/trace.cjs +0 -1
  3. package/dist/node_modules/firebase-functions/lib/logger/index.cjs +1 -0
  4. package/dist/v1/ColorSafeStringify.min.js +1 -1
  5. package/dist/v1/TinyAfterScrollWatcher.min.js +1 -1
  6. package/dist/v1/TinyBasicsEs.js +13 -6
  7. package/dist/v1/TinyBasicsEs.min.js +1 -1
  8. package/dist/v1/TinyClipboard.min.js +1 -1
  9. package/dist/v1/TinyColorConverter.js +617 -0
  10. package/dist/v1/TinyColorConverter.min.js +1 -0
  11. package/dist/v1/TinyDomReadyManager.min.js +1 -1
  12. package/dist/v1/TinyDragger.min.js +1 -1
  13. package/dist/v1/TinyEssentials.js +2635 -482
  14. package/dist/v1/TinyEssentials.min.js +1 -1
  15. package/dist/v1/TinyEvents.js +402 -0
  16. package/dist/v1/TinyEvents.min.js +1 -0
  17. package/dist/v1/TinyHtml.min.js +1 -1
  18. package/dist/v1/TinyLocalStorage.js +1292 -0
  19. package/dist/v1/TinyLocalStorage.min.js +1 -0
  20. package/dist/v1/TinyNotifications.min.js +1 -1
  21. package/dist/v1/TinyNotifyCenter.min.js +1 -1
  22. package/dist/v1/TinyPromiseQueue.min.js +1 -1
  23. package/dist/v1/TinyRateLimiter.js +2 -1
  24. package/dist/v1/TinyRateLimiter.min.js +1 -1
  25. package/dist/v1/TinySmartScroller.js +570 -52
  26. package/dist/v1/TinySmartScroller.min.js +1 -1
  27. package/dist/v1/TinyTextRangeEditor.min.js +1 -1
  28. package/dist/v1/TinyTimeout.js +233 -0
  29. package/dist/v1/TinyTimeout.min.js +1 -0
  30. package/dist/v1/TinyToastNotify.min.js +1 -1
  31. package/dist/v1/TinyUploadClicker.js +1457 -106
  32. package/dist/v1/TinyUploadClicker.min.js +1 -1
  33. package/dist/v1/UltraRandomMsgGen.min.js +1 -1
  34. package/dist/v1/basics/html.cjs +13 -6
  35. package/dist/v1/basics/html.d.mts +12 -4
  36. package/dist/v1/basics/html.mjs +13 -6
  37. package/dist/v1/build/TinyColorConverter.cjs +7 -0
  38. package/dist/v1/build/TinyColorConverter.d.mts +3 -0
  39. package/dist/v1/build/TinyColorConverter.mjs +2 -0
  40. package/dist/v1/build/TinyEvents.cjs +7 -0
  41. package/dist/v1/build/TinyEvents.d.mts +3 -0
  42. package/dist/v1/build/TinyEvents.mjs +2 -0
  43. package/dist/v1/build/TinyLocalStorage.cjs +7 -0
  44. package/dist/v1/build/TinyLocalStorage.d.mts +3 -0
  45. package/dist/v1/build/TinyLocalStorage.mjs +2 -0
  46. package/dist/v1/build/TinyTimeout.cjs +7 -0
  47. package/dist/v1/build/TinyTimeout.d.mts +3 -0
  48. package/dist/v1/build/TinyTimeout.mjs +2 -0
  49. package/dist/v1/index.cjs +8 -0
  50. package/dist/v1/index.d.mts +5 -1
  51. package/dist/v1/index.mjs +5 -1
  52. package/dist/v1/libs/TinyColorConverter.cjs +578 -0
  53. package/dist/v1/libs/TinyColorConverter.d.mts +396 -0
  54. package/dist/v1/libs/TinyColorConverter.mjs +520 -0
  55. package/dist/v1/libs/TinyEvents.cjs +363 -0
  56. package/dist/v1/libs/TinyEvents.d.mts +160 -0
  57. package/dist/v1/libs/TinyEvents.mjs +328 -0
  58. package/dist/v1/libs/TinyLocalStorage.cjs +847 -0
  59. package/dist/v1/libs/TinyLocalStorage.d.mts +407 -0
  60. package/dist/v1/libs/TinyLocalStorage.mjs +740 -0
  61. package/dist/v1/libs/TinySmartScroller.cjs +207 -52
  62. package/dist/v1/libs/TinySmartScroller.d.mts +164 -16
  63. package/dist/v1/libs/TinySmartScroller.mjs +181 -52
  64. package/dist/v1/libs/TinyTimeout.cjs +194 -0
  65. package/dist/v1/libs/TinyTimeout.d.mts +89 -0
  66. package/dist/v1/libs/TinyTimeout.mjs +179 -0
  67. package/dist/v1/libs/TinyUploadClicker.cjs +1 -0
  68. package/docs/v1/README.md +4 -0
  69. package/docs/v1/libs/TinyColorConverter.md +220 -0
  70. package/docs/v1/libs/TinyEvents.md +199 -0
  71. package/docs/v1/libs/TinyLocalStorage.md +350 -0
  72. package/docs/v1/libs/TinyRateLimiter.md +0 -3
  73. package/docs/v1/libs/TinyTimeout.md +190 -0
  74. package/package.json +28 -5
@@ -1 +1 @@
1
- (()=>{"use strict";var t={d:(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.d(e,{TinySmartScroller:()=>N});var r={};t.r(r),t.d(r,{areElsCollBottom:()=>n,areElsCollLeft:()=>i,areElsCollPerfBottom:()=>a,areElsCollPerfLeft:()=>c,areElsCollPerfRight:()=>u,areElsCollPerfTop:()=>l,areElsCollRight:()=>s,areElsCollTop:()=>o,areElsColliding:()=>p,areElsPerfColliding:()=>m,getElsCollDetails:()=>E,getElsCollDirDepth:()=>w,getElsCollOverlap:()=>f,getElsCollOverlapPos:()=>g,getElsColliding:()=>d,getElsPerfColliding:()=>h,getElsRelativeCenterOffset:()=>b,getRectCenter:()=>y});const o=(t,e)=>t.bottom<e.top,n=(t,e)=>t.top>e.bottom,i=(t,e)=>t.right<e.left,s=(t,e)=>t.left>e.right,l=(t,e)=>t.bottom<=e.top,a=(t,e)=>t.top>=e.bottom,c=(t,e)=>t.right<=e.left,u=(t,e)=>t.left>=e.right,p=(t,e)=>!(i(t,e)||s(t,e)||o(t,e)||n(t,e)),m=(t,e)=>!(c(t,e)||u(t,e)||l(t,e)||a(t,e)),d=(t,e)=>i(t,e)?"left":s(t,e)?"right":o(t,e)?"top":n(t,e)?"bottom":null,h=(t,e)=>c(t,e)?"left":u(t,e)?"right":l(t,e)?"top":a(t,e)?"bottom":null,f=(t,e)=>({overlapLeft:e.right-t.left,overlapRight:t.right-e.left,overlapTop:e.bottom-t.top,overlapBottom:t.bottom-e.top}),g=({overlapLeft:t=-1,overlapRight:e=-1,overlapTop:r=-1,overlapBottom:o=-1}={})=>({dirX:t<e?"right":"left",dirY:r<o?"bottom":"top"}),y=t=>({x:t.left+t.width/2,y:t.top+t.height/2});function b(t,e){const r=t.left+t.width/2,o=t.top+t.height/2;return{x:e.left+e.width/2-r,y:e.top+e.height/2-o}}function w(t,e){if(!m(t,e))return{inDir:null,dirX:null,dirY:null,depthX:0,depthY:0};const{overlapLeft:r,overlapRight:o,overlapTop:n,overlapBottom:i}=f(t,e),{dirX:s,dirY:l}=g({overlapLeft:r,overlapRight:o,overlapTop:n,overlapBottom:i}),a=Math.min(r,o),c=Math.min(n,i);let u;return u=a<c?s:l,{inDir:u,dirX:s,dirY:l,depthX:a,depthY:c}}function E(t,e){const r=m(t,e),o={in:null,x:null,y:null},n={y:null,x:null},i={top:0,bottom:0,left:0,right:0},{overlapLeft:s,overlapRight:l,overlapTop:a,overlapBottom:c}=f(e,t);i.top=a,i.bottom=c,i.left=s,i.right=l;const u=Object.entries(i).filter((([,t])=>t>0)).sort(((t,e)=>t[1]-e[1])),{dirX:p,dirY:d}=g({overlapLeft:l,overlapRight:s,overlapTop:c,overlapBottom:a});return o.y=d,o.x=p,i.bottom<0?n.y="bottom":i.top<0&&(n.y="top"),i.left<0?n.x="left":i.right<0&&(n.x="right"),o.in=r?i.top===i.bottom&&i.bottom===i.left&&i.left===i.right?"center":u.length?u[0][0]:"top":null,{dirs:o,depth:i,isNeg:n}}const{areElsColliding:T,areElsPerfColliding:v,areElsCollTop:S,areElsCollBottom:_,areElsCollLeft:A,areElsCollRight:C}=r,L=new WeakMap,x=new WeakMap,k={top:new WeakMap,bottom:new WeakMap,left:new WeakMap,right:new WeakMap};class W{static Utils={...r};static createElement(t,e){if("string"!=typeof t)throw new TypeError("[TinyHtml] createElement(): The tagName must be a string.");if(void 0!==e&&"object"!=typeof e)throw new TypeError("[TinyHtml] createElement(): The ops must be a object.");return new W(document.createElement(t,e))}static createTextNode(t){if("string"!=typeof t)throw new TypeError("[TinyHtml] createTextNode(): The value must be a string.");return new W(document.createTextNode(t))}static createElementFromHTML(t){const e=document.createElement("template");if(!(t=t.trim()).startsWith("<"))return W.createTextNode(t);if(e.innerHTML=t,!(e.content.firstChild instanceof Element))throw new Error("");return new W(e.content.firstChild)}static query(t,e=document){const r=e.querySelector(t);return r?new W(r):null}querySelector(t){return W.query(t,W._preElem(this,"query"))}static queryAll(t,e=document){const r=e.querySelectorAll(t);return W.toTinyElm([...r])}querySelectorAll(t){return W.queryAll(t,W._preElem(this,"queryAll"))}static getById(t){const e=document.getElementById(t);return e?new W(e):null}static getByClassName(t,e=document){const r=e.getElementsByClassName(t);return W.toTinyElm([...r])}getElementsByClassName(t){return W.getByClassName(t,W._preElem(this,"getByClassName"))}static getByName(t){const e=document.getElementsByName(t);return W.toTinyElm([...e])}static getByTagNameNS(t,e="http://www.w3.org/1999/xhtml",r=document){const o=r.getElementsByTagNameNS(e,t);return W.toTinyElm([...o])}getElementsByTagNameNS(t,e="http://www.w3.org/1999/xhtml"){return W.getByTagNameNS(t,e,W._preElem(this,"getByTagNameNS"))}get(){return this.#t}_getElement(t){if(!(this.#t instanceof Element||this.#t instanceof Window||this.#t instanceof Document))throw new Error(`[TinyHtml] Invalid Element in ${t}().`);return this.#t}static _preElemsTemplate(t,e,r,o){const n=t=>t.map((t=>{const n=t instanceof W?t._getElement(e):t;let i=!1;for(const t of r)if(n instanceof t){i=!0;break}if(!i)throw new Error(`[TinyHtml] Invalid element of the list "${o.join(",")}" in ${e}().`);return n}));return Array.isArray(t)?n(t):n([t])}static _preElemTemplate(t,e,r,o,n=!1){const i=t=>{const i=t[0];let s=i instanceof W?i._getElement(e):i,l=!1;for(const t of r)if(s instanceof t){l=!0;break}if(n&&null==s&&(s=null,l=!0),!l)throw new Error(`[TinyHtml] Invalid element of the list "${o.join(",")}" in ${e}().`);return s};if(!Array.isArray(t))return i([t]);if(t.length>1)throw new Error(`[TinyHtml] Invalid element amount in ${e}() (Received ${t.length}/1).`);return i(t)}static _preElems(t,e){return W._preElemsTemplate(t,e,[Element],["Element"])}static _preElem(t,e){return W._preElemTemplate(t,e,[Element],["Element"])}static _preNodeElems(t,e){return W._preElemsTemplate(t,e,[Node],["Node"])}static _preNodeElem(t,e){return W._preElemTemplate(t,e,[Node],["Node"])}static _preNodeElemWithNull(t,e){return W._preElemTemplate(t,e,[Node],["Node"],!0)}static _preHtmlElems(t,e){return W._preElemsTemplate(t,e,[HTMLElement],["HTMLElement"])}static _preHtmlElem(t,e){return W._preElemTemplate(t,e,[HTMLElement],["HTMLElement"])}static _preInputElems(t,e){return W._preElemsTemplate(t,e,[HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement,HTMLOptionElement],["HTMLInputElement","HTMLSelectElement","HTMLTextAreaElement","HTMLOptionElement"])}static _preInputElem(t,e){return W._preElemTemplate(t,e,[HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement,HTMLOptionElement],["HTMLInputElement","HTMLSelectElement","HTMLTextAreaElement","HTMLOptionElement"])}static _preEventTargetElems(t,e){return W._preElemsTemplate(t,e,[EventTarget],["EventTarget"])}static _preEventTargetElem(t,e){return W._preElemTemplate(t,e,[EventTarget],["EventTarget"])}static _preElemsAndWindow(t,e){return W._preElemsTemplate(t,e,[Element,Window],["Element","Window"])}static _preElemAndWindow(t,e){return W._preElemTemplate(t,e,[Element,Window],["Element","Window"])}static _preElemsAndWinAndDoc(t,e){return W._preElemsTemplate(t,e,[Element,Window,Document],["Element","Window","Document"]).map((t=>t instanceof Document?t.documentElement:t))}static _preElemAndWinAndDoc(t,e){const r=W._preElemTemplate(t,e,[Element,Window,Document],["Element","Window","Document"]);return r instanceof Document?r.documentElement:r}static _preElemsWithDoc(t,e){return W._preElemsTemplate(t,e,[Element,Document],["Element","Document"])}static _preElemWithDoc(t,e){return W._preElemTemplate(t,e,[Element,Document],["Element","Document"])}static toTinyElm(t){const e=t=>t.map((t=>t instanceof W?t:new W(t)));return Array.isArray(t)?e(t):e([t])}static fromTinyElm(t){const e=t=>t.map((t=>t instanceof W?t._getElement("fromTinyElm"):t));return Array.isArray(t)?e(t):e([t])}static winnow(t,e,r,o=!1){if("boolean"!=typeof o)throw new TypeError('The "not" must be a boolean.');if("function"==typeof e)return W._preElems(t,r).filter(((t,r)=>!!e.call(t,r,t)!==o));if(e instanceof Element)return W._preElems(t,r).filter((t=>t===e!==o));if(Array.isArray(e)||"string"!=typeof e&&null!=e.length)return W._preElems(t,r).filter((t=>e.includes(t)!==o));let n=e;return o&&(n=`:not(${n})`),W._preElems(t,r).filter((t=>1===t.nodeType&&t.matches(n)))}static filter(t,e,r=!1){return r&&(e=`:not(${e})`),W._preElems(t,"filter").filter((t=>1===t.nodeType&&t.matches(e)))}static filterOnly(t,e){return W.winnow(t,e,"filterOnly",!1)}static not(t,e){return W.winnow(t,e,"not",!0)}not(t){return W.not(this,t)}static find(t,e){const r=[];for(const o of W._preElems(t,"find"))r.push(...o.querySelectorAll(e));return[...new Set(r)]}find(t){return W.find(this,t)}static is(t,e){return W.winnow(t,e,"is",!1).length>0}is(t){return W.is(this,t)}static has(t,e){const r="string"==typeof e?[...document.querySelectorAll(e)]:W._preElems(e,"has");return W._preElems(t,"has").filter((t=>r.some((e=>t&&t.contains(e)))))}has(t){return W.has(this,t).length>0}static closest(t,e,r){const o=[];for(const n of W._preElems(t,"closest")){let t=n;for(;t&&t!==r;){if(1===t.nodeType&&("string"==typeof e?t.matches(e):t===e)){o.push(t);break}t=t.parentElement}}return[...new Set(o)]}closest(t,e){return W.closest(this,t,e)}static isSameDom(t,e){return W._preNodeElem(t,"isSameDom")===W._preNodeElem(e,"isSameDom")}isSameDom(t){return W.isSameDom(this,t)}_data={};static _dataSelector={public:(t,e)=>{const r=W._preElem(e,t);let o=x.get(r);return o||(o={},x.set(r,o)),o},private:(t,e)=>{if(!(e instanceof W))throw new Error(`Element must be a TinyHtml instance to execute ${t}().`);return e._data}};static data(t,e,r=!1){const o=W._dataSelector[r?"private":"public"]("data",t);if(null==e)return{...o};if("string"!=typeof e)throw new TypeError("The key must be a string.");return o.hasOwnProperty(e)?o[e]:void 0}data(t,e){return W.data(this,t,e)}static setData(t,e,r,o=!1){const n=W._dataSelector[o?"private":"public"]("setData",t);if("string"!=typeof e)throw new TypeError("The key must be a string.");return n[e]=r,t}setData(t,e,r=!1){return W.setData(this,t,e,r)}static _getSibling(t,e,r){let o=W._preNodeElemWithNull(t,r);for(;o&&(o=o[e])&&1!==o.nodeType;);return o instanceof Node?o:null}static _getSiblings(t,e){let r=t;const o=[];for(;r;r=r.nextSibling)1===r.nodeType&&r!==e&&o.push(r);return o}static domDir(t,e,r,o="domDir"){if("string"!=typeof e)throw new TypeError('The "direction" must be a string.');let n=W._preNodeElemWithNull(t,o);const i=[];for(;n&&(n=n[e]);)if(1===n.nodeType){if(r&&("string"==typeof r?n.matches(r):n===r))break;i.push(n)}return i}static parent(t){let e=W._preNodeElemWithNull(t,"parent");const r=e?e.parentNode:null;return r&&11!==r.nodeType?r:null}parent(){return W.parent(this)}static parents(t,e){return W.domDir(t,"parentNode",e,"parents")}parents(t){return W.parents(this,t)}static next(t){return W._getSibling(t,"nextSibling","next")}next(){return W.next(this)}static prev(t){return W._getSibling(t,"previousSibling","prev")}prev(){return W.prev(this)}static nextAll(t){return W.domDir(t,"nextSibling",void 0,"nextAll")}nextAll(){return W.nextAll(this)}static prevAll(t){return W.domDir(t,"previousSibling",void 0,"prevAll")}prevAll(){return W.prevAll(this)}static nextUntil(t,e){return W.domDir(t,"nextSibling",e,"nextUtil")}nextUntil(t){return W.nextUntil(this,t)}static prevUntil(t,e){return W.domDir(t,"previousSibling",e,"prevUtil")}prevUntil(t){return W.prevUntil(this,t)}static siblings(t){const e=W._preNodeElemWithNull(t,"siblings");return W._getSiblings(e&&e.parentNode?e.parentNode.firstChild:null,e)}siblings(){return W.siblings(this)}static children(t){const e=W._preNodeElemWithNull(t,"children");return W._getSiblings(e?e.firstChild:null)}children(){return W.children(this)}static contents(t){const e=W._preNodeElemWithNull(t,"contents");return e instanceof HTMLIFrameElement&&null!=e.contentDocument&&Object.getPrototypeOf(e.contentDocument)?[e.contentDocument]:e instanceof HTMLTemplateElement?Array.from((e.content||e).childNodes):e?Array.from(e.childNodes):[]}contents(){return W.contents(this)}static clone(t,e=!0){if("boolean"!=typeof e)throw new TypeError('The "deep" must be a boolean.');return W._preNodeElems(t,"clone").map((t=>t.cloneNode(e)))}clone(t){return W.clone(this,t)[0]}static _appendChecker(t,...e){const r=[],o=[...e];for(const e in o)"string"!=typeof o[e]?r.push(W._preNodeElem(o[e],t)):r.push(o[e]);return r}static append(t,...e){return W._preElem(t,"append").append(...W._appendChecker("append",...e)),t}append(...t){return W.append(this,...t)}static prepend(t,...e){return W._preElem(t,"prepend").prepend(...W._appendChecker("prepend",...e)),t}prepend(...t){return W.prepend(this,...t)}static before(t,...e){return W._preElem(t,"before").before(...W._appendChecker("before",...e)),t}before(...t){return W.before(this,...t)}static after(t,...e){return W._preElem(t,"after").after(...W._appendChecker("after",...e)),t}after(...t){return W.after(this,...t)}static replaceWith(t,...e){return W._preElem(t,"replaceWith").replaceWith(...W._appendChecker("replaceWith",...e)),t}replaceWith(...t){return W.replaceWith(this,...t)}static appendTo(t,e){const r=W._preNodeElems(t,"appendTo"),o=W._preNodeElems(e,"appendTo");return o.forEach(((t,e)=>{r.forEach((r=>t.appendChild(e===o.length-1?r:r.cloneNode(!0))))})),t}appendTo(t){return W.appendTo(this,t)}static prependTo(t,e){const r=W._preElems(t,"prependTo"),o=W._preElems(e,"prependTo");return o.forEach(((t,e)=>{r.slice().reverse().forEach((r=>t.prepend(e===o.length-1?r:r.cloneNode(!0))))})),t}prependTo(t){return W.prependTo(this,t)}static insertBefore(t,e,r=null){const o=W._preNodeElem(t,"insertBefore"),n=W._preNodeElem(e,"insertBefore"),i=W._preNodeElemWithNull(r,"insertBefore");if(!n.parentNode)throw new Error("");return n.parentNode.insertBefore(o,i||n),t}insertBefore(t,e){return W.insertBefore(this,t,e)}static insertAfter(t,e,r=null){const o=W._preNodeElem(t,"insertAfter"),n=W._preNodeElem(e,"insertBefore"),i=W._preNodeElemWithNull(r,"insertBefore");if(!n.parentNode)throw new Error("");return n.parentNode.insertBefore(o,i||n.nextSibling),t}insertAfter(t,e){return W.insertAfter(this,t,e)}static replaceAll(t,e){const r=W._preNodeElems(t,"replaceAll"),o=W._preNodeElems(e,"replaceAll");return o.forEach(((t,e)=>{const n=t.parentNode;r.forEach((r=>{n&&n.replaceChild(e===o.length-1?r:r.cloneNode(!0),t)}))})),t}replaceAll(t){return W.replaceAll(this,t)}#t;constructor(t){if(t instanceof W)throw new Error("[TinyHtml] You are trying to put a TinyHtml inside another TinyHtml in constructor.");if(!(t instanceof Element||t instanceof Window||t instanceof Document||t instanceof Text))throw new Error("[TinyHtml] Invalid Target in constructor.");this.#t=t}static isWindow(t){return null!=t&&t===t.window}static css(t){const e=W._preElem(t,"css");return window.getComputedStyle(e)}css(){return W.css(this)}static cssString(t,e){const r=W._preElem(t,"cssString");if("string"!=typeof e)throw new TypeError("The prop must be a string.");const o=window.getComputedStyle(r)[e];return"string"==typeof o?o:"number"==typeof o?o.toString():null}cssString(t){return W.cssString(this,t)}static cssList(t,e){const r=W._preElem(t,"cssList");if(!Array.isArray(e))throw new TypeError("The prop must be an array of strings.");const o=window.getComputedStyle(r),n={};for(const t of e)void 0!==t&&(n[t]=o.getPropertyValue(t));return n}cssList(t){return W.cssList(this,t)}static cssFloat(t,e){const r=W._preElem(t,"cssFloat");if("string"!=typeof e)throw new TypeError("The prop must be a string.");const o=window.getComputedStyle(r)[e];return parseFloat(o)||0}cssFloat(t){return W.cssFloat(this,t)}static cssFloats(t,e){const r=W._preElem(t,"cssFloats");if(!Array.isArray(e))throw new TypeError("The prop must be an array of strings.");const o=window.getComputedStyle(r),n={};for(const t of e)n[t]=parseFloat(o[t])||0;return n}cssFloats(t){return W.cssFloats(this,t)}static#e={alignContent:"align-content",alignItems:"align-items",alignSelf:"align-self",animationDelay:"animation-delay",animationDirection:"animation-direction",animationDuration:"animation-duration",animationFillMode:"animation-fill-mode",animationIterationCount:"animation-iteration-count",animationName:"animation-name",animationPlayState:"animation-play-state",animationTimingFunction:"animation-timing-function",backfaceVisibility:"backface-visibility",backgroundAttachment:"background-attachment",backgroundBlendMode:"background-blend-mode",backgroundClip:"background-clip",backgroundColor:"background-color",backgroundImage:"background-image",backgroundOrigin:"background-origin",backgroundPosition:"background-position",backgroundRepeat:"background-repeat",backgroundSize:"background-size",borderBottom:"border-bottom",borderBottomColor:"border-bottom-color",borderBottomLeftRadius:"border-bottom-left-radius",borderBottomRightRadius:"border-bottom-right-radius",borderBottomStyle:"border-bottom-style",borderBottomWidth:"border-bottom-width",borderCollapse:"border-collapse",borderColor:"border-color",borderImage:"border-image",borderImageOutset:"border-image-outset",borderImageRepeat:"border-image-repeat",borderImageSlice:"border-image-slice",borderImageSource:"border-image-source",borderImageWidth:"border-image-width",borderLeft:"border-left",borderLeftColor:"border-left-color",borderLeftStyle:"border-left-style",borderLeftWidth:"border-left-width",borderRadius:"border-radius",borderRight:"border-right",borderRightColor:"border-right-color",borderRightStyle:"border-right-style",borderRightWidth:"border-right-width",borderSpacing:"border-spacing",borderStyle:"border-style",borderTop:"border-top",borderTopColor:"border-top-color",borderTopLeftRadius:"border-top-left-radius",borderTopRightRadius:"border-top-right-radius",borderTopStyle:"border-top-style",borderTopWidth:"border-top-width",borderWidth:"border-width",boxDecorationBreak:"box-decoration-break",boxShadow:"box-shadow",boxSizing:"box-sizing",breakAfter:"break-after",breakBefore:"break-before",breakInside:"break-inside",captionSide:"caption-side",caretColor:"caret-color",clipPath:"clip-path",columnCount:"column-count",columnFill:"column-fill",columnGap:"column-gap",columnRule:"column-rule",columnRuleColor:"column-rule-color",columnRuleStyle:"column-rule-style",columnRuleWidth:"column-rule-width",columnSpan:"column-span",columnWidth:"column-width",counterIncrement:"counter-increment",counterReset:"counter-reset",emptyCells:"empty-cells",flexBasis:"flex-basis",flexDirection:"flex-direction",flexFlow:"flex-flow",flexGrow:"flex-grow",flexShrink:"flex-shrink",flexWrap:"flex-wrap",fontFamily:"font-family",fontFeatureSettings:"font-feature-settings",fontKerning:"font-kerning",fontLanguageOverride:"font-language-override",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontSynthesis:"font-synthesis",fontVariant:"font-variant",fontVariantAlternates:"font-variant-alternates",fontVariantCaps:"font-variant-caps",fontVariantEastAsian:"font-variant-east-asian",fontVariantLigatures:"font-variant-ligatures",fontVariantNumeric:"font-variant-numeric",fontVariantPosition:"font-variant-position",fontWeight:"font-weight",gridArea:"grid-area",gridAutoColumns:"grid-auto-columns",gridAutoFlow:"grid-auto-flow",gridAutoRows:"grid-auto-rows",gridColumn:"grid-column",gridColumnEnd:"grid-column-end",gridColumnGap:"grid-column-gap",gridColumnStart:"grid-column-start",gridGap:"grid-gap",gridRow:"grid-row",gridRowEnd:"grid-row-end",gridRowGap:"grid-row-gap",gridRowStart:"grid-row-start",gridTemplate:"grid-template",gridTemplateAreas:"grid-template-areas",gridTemplateColumns:"grid-template-columns",gridTemplateRows:"grid-template-rows",imageRendering:"image-rendering",justifyContent:"justify-content",letterSpacing:"letter-spacing",lineBreak:"line-break",lineHeight:"line-height",listStyle:"list-style",listStyleImage:"list-style-image",listStylePosition:"list-style-position",listStyleType:"list-style-type",marginBottom:"margin-bottom",marginLeft:"margin-left",marginRight:"margin-right",marginTop:"margin-top",maskClip:"mask-clip",maskComposite:"mask-composite",maskImage:"mask-image",maskMode:"mask-mode",maskOrigin:"mask-origin",maskPosition:"mask-position",maskRepeat:"mask-repeat",maskSize:"mask-size",maskType:"mask-type",maxHeight:"max-height",maxWidth:"max-width",minHeight:"min-height",minWidth:"min-width",mixBlendMode:"mix-blend-mode",objectFit:"object-fit",objectPosition:"object-position",offsetAnchor:"offset-anchor",offsetDistance:"offset-distance",offsetPath:"offset-path",offsetRotate:"offset-rotate",outlineColor:"outline-color",outlineOffset:"outline-offset",outlineStyle:"outline-style",outlineWidth:"outline-width",overflowAnchor:"overflow-anchor",overflowWrap:"overflow-wrap",overflowX:"overflow-x",overflowY:"overflow-y",paddingBottom:"padding-bottom",paddingLeft:"padding-left",paddingRight:"padding-right",paddingTop:"padding-top",pageBreakAfter:"page-break-after",pageBreakBefore:"page-break-before",pageBreakInside:"page-break-inside",perspectiveOrigin:"perspective-origin",placeContent:"place-content",placeItems:"place-items",placeSelf:"place-self",pointerEvents:"pointer-events",rowGap:"row-gap",scrollBehavior:"scroll-behavior",scrollMargin:"scroll-margin",scrollMarginBlock:"scroll-margin-block",scrollMarginBlockEnd:"scroll-margin-block-end",scrollMarginBlockStart:"scroll-margin-block-start",scrollMarginBottom:"scroll-margin-bottom",scrollMarginInline:"scroll-margin-inline",scrollMarginInlineEnd:"scroll-margin-inline-end",scrollMarginInlineStart:"scroll-margin-inline-start",scrollMarginLeft:"scroll-margin-left",scrollMarginRight:"scroll-margin-right",scrollMarginTop:"scroll-margin-top",scrollPadding:"scroll-padding",scrollPaddingBlock:"scroll-padding-block",scrollPaddingBlockEnd:"scroll-padding-block-end",scrollPaddingBlockStart:"scroll-padding-block-start",scrollPaddingBottom:"scroll-padding-bottom",scrollPaddingInline:"scroll-padding-inline",scrollPaddingInlineEnd:"scroll-padding-inline-end",scrollPaddingInlineStart:"scroll-padding-inline-start",scrollPaddingLeft:"scroll-padding-left",scrollPaddingRight:"scroll-padding-right",scrollPaddingTop:"scroll-padding-top",scrollSnapAlign:"scroll-snap-align",scrollSnapStop:"scroll-snap-stop",scrollSnapType:"scroll-snap-type",shapeImageThreshold:"shape-image-threshold",shapeMargin:"shape-margin",shapeOutside:"shape-outside",tabSize:"tab-size",tableLayout:"table-layout",textAlign:"text-align",textAlignLast:"text-align-last",textCombineUpright:"text-combine-upright",textDecoration:"text-decoration",textDecorationColor:"text-decoration-color",textDecorationLine:"text-decoration-line",textDecorationStyle:"text-decoration-style",textIndent:"text-indent",textJustify:"text-justify",textOrientation:"text-orientation",textOverflow:"text-overflow",textShadow:"text-shadow",textTransform:"text-transform",transformBox:"transform-box",transformOrigin:"transform-origin",transformStyle:"transform-style",transitionDelay:"transition-delay",transitionDuration:"transition-duration",transitionProperty:"transition-property",transitionTimingFunction:"transition-timing-function",unicodeBidi:"unicode-bidi",userSelect:"user-select",verticalAlign:"vertical-align",whiteSpace:"white-space",willChange:"will-change",wordBreak:"word-break",wordSpacing:"word-spacing",wordWrap:"word-wrap",writingMode:"writing-mode",zIndex:"z-index",WebkitTransform:"-webkit-transform",WebkitTransition:"-webkit-transition",WebkitBoxShadow:"-webkit-box-shadow",MozBoxShadow:"-moz-box-shadow",MozTransform:"-moz-transform",MozTransition:"-moz-transition",msTransform:"-ms-transform",msTransition:"-ms-transition"};static cssPropAliases=new Proxy(W.#e,{set:(t,e,r)=>(t[e]=r,W.cssPropRevAliases[r]=e,!0)});static cssPropRevAliases=Object.fromEntries(Object.entries(W.#e).map((([t,e])=>[e,t])));static toStyleKc(t){return"string"==typeof W.cssPropAliases[t]?W.cssPropAliases[t]:t}static toStyleCc(t){return"string"==typeof W.cssPropRevAliases[t]?W.cssPropRevAliases[t]:t}static setStyle(t,e,r=null){return W._preHtmlElems(t,"setStyle").forEach((t=>{if("object"==typeof e)for(const[r,o]of Object.entries(e))t.style.setProperty(W.toStyleKc(r),"string"==typeof o?o:"number"==typeof o?`${o}px`:String(o));else t.style.setProperty(W.toStyleKc(e),r)})),t}setStyle(t,e){return W.setStyle(this,t,e)}static getStyle(t,e){return W._preHtmlElem(t,"getStyle").style.getPropertyValue(W.toStyleKc(e))}getStyle(t){return W.getStyle(this,t)}static style(t,{camelCase:e=!1,rawAttr:r=!1}={}){if("boolean"!=typeof e)throw new TypeError('"camelCase" must be a boolean. Received: '+typeof e);if("boolean"!=typeof r)throw new TypeError('"rawAttr" must be a boolean. Received: '+typeof r);const o=W._preHtmlElem(t,"style"),n={};if(r){const t=(o.getAttribute("style")||"").split(";");for(const r of t){const[t,o]=r.split(":");if(!t||!o)continue;const i=t.trim(),s=o.trim();n[e?W.toStyleCc(i):i]=s}}else{const t=o.style;for(let r=0;r<t.length;r++){const o=t[r],i=t.getPropertyValue(o);n[e?W.toStyleCc(o):o]=i}}return n}style(t){return W.style(this,t)}static removeStyle(t,e){return W._preHtmlElems(t,"removeStyle").forEach((t=>{if(Array.isArray(e))for(const r of e)t.style.removeProperty(W.toStyleKc(r));else t.style.removeProperty(W.toStyleKc(e))})),t}removeStyle(t){return W.removeStyle(this,t)}static toggleStyle(t,e,r,o){return W._preHtmlElems(t,"toggleStyle").forEach((t=>{const n=W.getStyle(t,e).trim()===W.toStyleKc(r)?o:r;W.setStyle(t,e,n)})),t}toggleStyle(t,e,r){return W.toggleStyle(this,t,e,r)}static clearStyle(t){return W._preElems(t,"clearStyle").forEach((t=>t.removeAttribute("style"))),t}clearStyle(){return W.clearStyle(this)}static focus(t){return W._preHtmlElem(t,"focus").focus(),t}focus(){return W.focus(this)}static blur(t){return W._preHtmlElem(t,"blur").blur(),t}blur(){return W.blur(this)}static boolCheck(t){return void 0!==t&&("true"===t||"1"===t||!0===t||"on"===t||"number"==typeof t&&t>0)}static setWinScrollTop(t){if("number"!=typeof t)throw new TypeError("The value must be a number.");W.setScrollTop(window,t)}static setWinScrollLeft(t){if("number"!=typeof t)throw new TypeError("The value must be a number.");W.setScrollLeft(window,t)}static winScrollTop(){return window.scrollY||document.documentElement.scrollTop}static winScrollLeft(){return window.scrollX||document.documentElement.scrollLeft}static winInnerHeight(){return window.innerHeight||document.documentElement.clientHeight}static winInnerWidth(){return window.innerWidth||document.documentElement.clientWidth}static isPageTop(){return 0===window.scrollY}static isPageBottom(){return window.innerHeight+window.scrollY>=document.body.offsetHeight}static getDimension(t,e,r="content"){const o=W._preElemAndWinAndDoc(t,"getDimension");if("string"!=typeof e)throw new TypeError("The type must be a string.");if("string"!=typeof r)throw new TypeError("The extra must be a string.");const n="width"===e?"Width":"Height";if(W.isWindow(o))return"margin"===r?o["inner"+n]:o.document.documentElement["client"+n];const i=o;if(9===i.nodeType){const t=i.documentElement;return Math.max(i.body["scroll"+n],t["scroll"+n],i.body["offset"+n],t["offset"+n],t["client"+n])}let s=i.getBoundingClientRect()[e];function l(t){return"width"===e?W.cssFloat(i,t+"Left")+W.cssFloat(i,t+"Right"):W.cssFloat(i,t+"Top")+W.cssFloat(i,t+"Bottom")}switch(r){case"content":s-=l("padding"),s-=l("border");break;case"padding":s-=l("border");break;case"border":break;case"margin":s+=l("margin")}return s}getDimension(t,e){return W.getDimension(this,t,e)}static setHeight(t,e){const r=W._preHtmlElem(t,"setHeight");if("number"!=typeof e&&"string"!=typeof e)throw new TypeError("The value must be a string or number.");return r.style.height="number"==typeof e?`${e}px`:e,t}setHeight(t){return W.setHeight(this,t)}static setWidth(t,e){const r=W._preHtmlElem(t,"setWidth");if("number"!=typeof e&&"string"!=typeof e)throw new TypeError("The value must be a string or number.");return r.style.width="number"==typeof e?`${e}px`:e,t}setWidth(t){return W.setWidth(this,t)}static height(t){const e=W._preElemAndWinAndDoc(t,"height");return W.getDimension(e,"height","content")}height(){return W.height(this)}static width(t){const e=W._preElemAndWinAndDoc(t,"width");return W.getDimension(e,"width","content")}width(){return W.width(this)}static innerHeight(t){const e=W._preElemAndWinAndDoc(t,"innerHeight");return W.getDimension(e,"height","padding")}innerHeight(){return W.innerHeight(this)}static innerWidth(t){const e=W._preElemAndWinAndDoc(t,"innerWidth");return W.getDimension(e,"width","padding")}innerWidth(){return W.innerWidth(this)}static outerHeight(t,e=!1){if("boolean"!=typeof e)throw new TypeError('The "includeMargin" must be a boolean.');const r=W._preElemAndWinAndDoc(t,"outerHeight");return W.getDimension(r,"height",e?"margin":"border")}outerHeight(t){return W.outerHeight(this,t)}static outerWidth(t,e=!1){if("boolean"!=typeof e)throw new TypeError('The "includeMargin" must be a boolean.');const r=W._preElemAndWinAndDoc(t,"outerWidth");return W.getDimension(r,"width",e?"margin":"border")}outerWidth(t){return W.outerWidth(this,t)}static animate(t,e,r){return W._preElems(t,"animate").forEach((t=>t.animate(e,r))),t}animate(t,e){return W.animate(this,t,e)}static offset(t){const e=W._preElem(t,"offset").getBoundingClientRect(),r=window.scrollY||document.documentElement.scrollTop,o=window.scrollX||document.documentElement.scrollLeft;return{top:e.top+r,left:e.left+o}}offset(){return W.offset(this)}static position(t){const e=W._preHtmlElem(t,"position");let r,o,n={top:0,left:0};if("fixed"===window.getComputedStyle(e).position)o=e.getBoundingClientRect();else{o=W.offset(e),r=e.offsetParent||document.documentElement;const{position:t}=window.getComputedStyle(r);for(;r instanceof HTMLElement&&(r===document.body||r===document.documentElement)&&"static"===t;)r=r.parentNode;if(r instanceof HTMLElement&&r!==e&&1===r.nodeType){const{borderTopWidth:t,borderLeftWidth:e}=W.cssFloats(r,["borderTopWidth","borderLeftWidth"]);n=W.offset(r),n.top+=t,n.left+=e}}return{top:o.top-n.top-W.cssFloat(e,"marginTop"),left:o.left-n.left-W.cssFloat(e,"marginLeft")}}position(){return W.position(this)}static offsetParent(t){let e=W._preHtmlElem(t,"offsetParent").offsetParent;for(;e instanceof HTMLElement&&"static"===window.getComputedStyle(e).position;)e=e.offsetParent;return e instanceof HTMLElement?e:document.documentElement}offsetParent(){return W.offsetParent(this)}static scrollTop(t){const e=W._preElemAndWindow(t,"scrollTop");return W.isWindow(e)?e.pageYOffset:9===e.nodeType?e.defaultView.pageYOffset:e.scrollTop}scrollTop(){return W.scrollTop(this)}static scrollLeft(t){const e=W._preElemAndWindow(t,"scrollLeft");return W.isWindow(e)?e.pageXOffset:9===e.nodeType?e.defaultView.pageXOffset:e.scrollLeft}scrollLeft(){return W.scrollLeft(this)}static easings={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>t*(2-t),easeInOutQuad:t=>t<.5?2*t*t:(4-2*t)*t-1,easeInCubic:t=>t*t*t,easeOutCubic:t=>--t*t*t+1,easeInOutCubic:t=>t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1};static scrollToXY(t,{targetX:e,targetY:r,duration:o,easing:n,onAnimation:i}={}){if(void 0!==e&&"number"!=typeof e)throw new TypeError("`targetX` must be a number if provided.");if(void 0!==r&&"number"!=typeof r)throw new TypeError("`targetY` must be a number if provided.");if(void 0!==o&&"number"!=typeof o)throw new TypeError("`duration` must be a number if provided.");if(void 0!==n&&"string"!=typeof n)throw new TypeError("`easing` must be a string if provided.");if(void 0!==n&&"function"!=typeof W.easings[n])throw new TypeError(`Unknown easing function: "${n}".`);if(void 0!==i&&"function"!=typeof i)throw new TypeError("`onAnimation` must be a function if provided.");const s=(t,e,r,o)=>{if(t instanceof Window)window.scrollTo(e,r);else if(9===t.nodeType)t.defaultView.scrollTo(e,r);else{const o=t instanceof Window?window.scrollX:t.scrollLeft,n=t instanceof Window?window.scrollY:t.scrollTop;o!==e&&(t.scrollLeft=e),n!==r&&(t.scrollTop=r)}"function"==typeof i&&i({x:e,y:r,isComplete:o>=1,time:o})};return W._preElemsAndWindow(t,"scrollToXY").forEach((t=>{const i=t instanceof Window?window.scrollX:t.scrollLeft,l=t instanceof Window?window.scrollY:t.scrollTop,a=e??i,c=r??l,u=a-i,p=c-l,m="string"==typeof n&&W.easings[n]||null;if("number"!=typeof o||"function"!=typeof m)return s(t,a,c,1);const d=performance.now(),h=o??0;requestAnimationFrame((function e(r){if("function"!=typeof m)return;const o=Math.min(1,(r-d)/h),n=m(o);s(t,i+u*n,l+p*n,o),o<1&&requestAnimationFrame(e)}))})),t}scrollToXY({targetX:t,targetY:e,duration:r,easing:o,onAnimation:n}={}){return W.scrollToXY(this,{targetX:t,targetY:e,duration:r,easing:o,onAnimation:n})}static setScrollTop(t,e){if("number"!=typeof e)throw new TypeError("ScrollTop value must be a number.");return W.scrollToXY(t,{targetY:e})}setScrollTop(t){return W.setScrollTop(this,t)}static setScrollLeft(t,e){if("number"!=typeof e)throw new TypeError("ScrollLeft value must be a number.");return W.scrollToXY(t,{targetX:e})}setScrollLeft(t){return W.setScrollLeft(this,t)}static borderWidth(t){const e=W._preElem(t,"borderWidth"),{borderLeftWidth:r,borderRightWidth:o,borderTopWidth:n,borderBottomWidth:i}=W.cssFloats(e,["borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"]);return{x:r+o,y:n+i,left:r,right:o,top:n,bottom:i}}borderWidth(){return W.borderWidth(this)}static border(t){const e=W._preElem(t,"border"),{borderLeft:r,borderRight:o,borderTop:n,borderBottom:i}=W.cssFloats(e,["borderLeft","borderRight","borderTop","borderBottom"]);return{x:r+o,y:n+i,left:r,right:o,top:n,bottom:i}}border(){return W.border(this)}static margin(t){const e=W._preElem(t,"margin"),{marginLeft:r,marginRight:o,marginTop:n,marginBottom:i}=W.cssFloats(e,["marginLeft","marginRight","marginTop","marginBottom"]);return{x:r+o,y:n+i,left:r,right:o,top:n,bottom:i}}margin(){return W.margin(this)}static padding(t){const e=W._preElem(t,"padding"),{paddingLeft:r,paddingRight:o,paddingTop:n,paddingBottom:i}=W.cssFloats(e,["paddingLeft","paddingRight","paddingTop","paddingBottom"]);return{x:r+o,y:n+i,left:r,right:o,top:n,bottom:i}}padding(){return W.padding(this)}static addClass(t,...e){return W._preElems(t,"addClass").forEach((t=>t.classList.add(...e))),t}addClass(...t){return W.addClass(this,...t)}static removeClass(t,...e){return W._preElems(t,"removeClass").forEach((t=>t.classList.remove(...e))),t}removeClass(...t){return W.removeClass(this,...t)}static replaceClass(t,e,r){if("string"!=typeof e)throw new TypeError('The "token" parameter must be a string.');if("string"!=typeof r)throw new TypeError('The "newToken" parameter must be a string.');const o=[];return W._preElems(t,"replaceClass").forEach((t=>o.push(t.classList.replace(e,r)))),o}replaceClass(t,e){return W.replaceClass(this,t,e)[0]}static classItem(t,e){const r=W._preElem(t,"classItem");if("number"!=typeof e)throw new TypeError('The "index" parameter must be a number.');return r.classList.item(e)}classItem(t){return W.classItem(this,t)}static toggleClass(t,e,r){if("string"!=typeof e)throw new TypeError('The "token" parameter must be a string.');if(void 0!==r&&"boolean"!=typeof r)throw new TypeError('The "force" parameter must be a boolean.');const o=[];return W._preElems(t,"toggleClass").forEach((t=>o.push(t.classList.toggle(e,r)))),o}toggleClass(t,e){return W.toggleClass(this,t,e)[0]}static hasClass(t,e){const r=W._preElem(t,"hasClass");if("string"!=typeof e)throw new TypeError('The "token" parameter must be a string.');return r.classList.contains(e)}hasClass(t){return W.hasClass(this,t)}static classLength(t){return W._preElem(t,"classLength").classList.length}classLength(){return W.classLength(this)}static classList(t){return W._preElem(t,"classList").classList.values().toArray()}classList(){return W.classList(this)}static tagName(t){return W._preElem(t,"tagName").tagName}tagName(){return W.tagName(this)}static id(t){return W._preElem(t,"id").id}id(){return W.id(this)}static text(t){return W._preElem(t,"text").textContent}text(){return W.text(this)}static setText(t,e){if("string"!=typeof e)throw new Error("Value is not a valid string.");return W._preElems(t,"setText").forEach((t=>t.textContent=e)),t}setText(t){return W.setText(this,t)}static empty(t){return W._preElems(t,"empty").forEach((t=>t.textContent="")),t}empty(){return W.empty(this)}static html(t,e){return W._preElem(t,"html").getHTML(e)}html(t){return W.html(this,t)}static setHtml(t,e){if("string"!=typeof e)throw new Error("Value is not a valid string.");return W._preElems(t,"setHtml").forEach((t=>t.innerHTML=e)),t}setHtml(t){return W.setHtml(this,t)}static _valHooks={option:{get:t=>{const e=t.getAttribute("value");return null!=e?e:t.textContent}},select:{get:t=>{const e=t.options,r=t.selectedIndex,o="select-one"===t.type,n=o?r+1:e.length,i=[];let s=r<0?n:o?r:0;for(;s<n;s++){const t=e[s],n=t.parentNode;if((t.selected||s===r)&&!t.disabled&&(!n||!n.disabled||"OPTGROUP"!==n.tagName)){const e=W._valHooks.option.get(t);if(o)return e;i.push(e)}}return i},set:(t,e)=>{const r=t.options,o=Array.isArray(e)?e.map(String):[String(e)];let n=!1;for(let t=0;t<r.length;t++){const e=r[t],i=W._valHooks.option.get(e);"string"==typeof i&&(e.selected=o.includes(i))&&(n=!0)}return n||(t.selectedIndex=-1),o}},radio:{get:t=>t.checked?"on":"off",set(t,e){if("boolean"==typeof e){const r=t.closest("label");return e&&r&&r.querySelectorAll('input[type="radio"]').forEach((e=>{e instanceof HTMLInputElement&&e!==t&&(e.checked=!1)})),t.checked=e,e}}},checkbox:{get:t=>t.checked?"on":"off",set(t,e){if("boolean"==typeof e)return t.checked=e,e}}};static setVal(t,e){return W._preInputElems(t,"setVal").forEach((t=>{if(1!==t.nodeType)return;let r="function"==typeof e?e(t,W.val(t)):e;null==r?r="":"number"==typeof r?r=String(r):Array.isArray(r)&&(r=(t=>{const e=[];for(let o=0;o<t.length;o++)e.push(null==(r=t[o])?"":String(r));var r;return e})(r));const o=W._valHooks[t.type]||W._valHooks[t.nodeName.toLowerCase()];if(!o||"function"!=typeof o.set||void 0===o.set(t,r,"value")){if("string"!=typeof r&&"boolean"!=typeof r)throw new Error(`Invalid setValue "${typeof r}" value.`);"string"==typeof r&&(t.value=r)}})),t}setVal(t){return W.setVal(this,t)}static _valTypes={string:t=>t.value,date:t=>t.valueAsDate,number:t=>t.valueAsNumber};static _getValByType(t,e,r){if("string"!=typeof e)throw new TypeError('The "type" must be a string.');if("string"!=typeof r)throw new TypeError('The "where" must be a string.');if(!(t instanceof HTMLInputElement))throw new Error(`Provided element is not an HTMLInputElement in ${r}().`);if("function"!=typeof W._valTypes[e])throw new Error(`No handler found for type "${e}" in ${r}().`);return W._valTypes[e](t)}static _val(t,e,r){const o=W._preInputElem(t,e),n=W._valHooks[o.type]||W._valHooks[o.nodeName.toLowerCase()];if(n&&"function"==typeof n.get){const t=n.get(o,"value",r);if(void 0!==t)return"string"==typeof t?t.replace(/\r/g,""):t}return W._getValByType(o,r,e)}_val(t,e){return W._val(this,t,e)}static val(t){return W._val(t,"val","string")}val(){return W.val(this)}static valTxt(t){const e=W._val(t,"valTxt","string");if("string"!=typeof e&&null!==e)throw new Error("Value is not a valid string.");return null==e?"":"string"==typeof e?e.replace(/\r/g,""):e}valTxt(){return W.valTxt(this)}static _valArr(t,e,r){const o=W._val(t,e,r);if(!Array.isArray(o))throw new Error(`Value expected an array but got ${typeof o}.`);return o}_valArr(t,e){return W._valArr(this,t,e)}static valArr(t){return W._valArr(t,"valArr","string")}valArr(){return W.valArr(this)}static valNb(t){if(!(W._preInputElem(t,"valNb")instanceof HTMLInputElement))throw new Error("Element must be an input element.");const e=W._val(t,"valNb","number");if(Number.isNaN(e))throw new Error("Value is not a valid number.");return e}valNb(){return W.valNb(this)}static valDate(t){if(!(W._preInputElem(t,"valDate")instanceof HTMLInputElement))throw new Error("Element must be an input element.");const e=W._val(t,"valDate","date");if(!(e instanceof Date))throw new Error("Value is not a valid date.");return e}valDate(){return W.valDate(this)}static valBool(t){const e=W._preInputElem(t,"valBool");if(!(e instanceof HTMLInputElement))throw new Error("Element must be an input element.");return"on"===W.val(e)}valBool(){return W.valBool(this)}static listenForPaste(t,{onFilePaste:e,onTextPaste:r}={}){if(void 0!==e&&"function"!=typeof e)throw new TypeError("onFilePaste must be a function.");if(void 0!==r&&"function"!=typeof r)throw new TypeError("onTextPaste must be a function.");const o=t=>{if(!(t instanceof ClipboardEvent))return;const o=t.clipboardData?.items||[];for(const t of o)if("file"===t.kind){if("function"==typeof e){const r=t.getAsFile();r&&e(t,r)}}else"string"===t.kind&&"function"==typeof r&&t.getAsString((e=>r(t,e)))};return W._preElemsWithDoc(t,"listenForPaste").forEach((t=>W.on(t,"paste",o))),o}listenForPaste({onFilePaste:t,onTextPaste:e}={}){return W.listenForPaste(this,{onFilePaste:t,onTextPaste:e})}static hasEventListener(t,e){const r=W._preEventTargetElem(t,"hasEventListener");if(!L.has(r))return!1;const o=L.get(r);return!!(o&&Array.isArray(o[e])&&o[e].length>0)}hasEventListener(t){return W.hasEventListener(this,t)}static hasExactEventListener(t,e,r){const o=W._preEventTargetElem(t,"hasExactEventListener");if("function"!=typeof r)throw new TypeError('The "handler" must be a function.');if(!L.has(o))return!1;const n=L.get(o);return!(!n||!Array.isArray(n[e]))&&n[e].some((t=>t.handler===r))}hasExactEventListener(t,e){return W.hasExactEventListener(this,t,e)}static on(t,e,r,o){if("string"!=typeof e)throw new TypeError("The event name must be a string.");return W._preEventTargetElems(t,"on").forEach((t=>{t.addEventListener(e,r,o),L.has(t)||L.set(t,{});const n=L.get(t);n&&(Array.isArray(n[e])||(n[e]=[]),n[e].push({handler:r,options:o}))})),t}on(t,e,r){return W.on(this,t,e,r)}static once(t,e,r,o={}){if("string"!=typeof e)throw new TypeError("The event name must be a string.");return W._preEventTargetElems(t,"once").forEach((t=>{const n=o=>{W.off(t,e,n),"function"==typeof r&&r(o)};W.on(t,e,n,"boolean"==typeof o?o:{...o,once:!0})})),t}once(t,e,r={}){return W.once(this,t,e,r)}static off(t,e,r,o){if("string"!=typeof e)throw new TypeError("The event name must be a string.");return W._preEventTargetElems(t,"off").forEach((t=>{t.removeEventListener(e,r,o);const n=L.get(t);n&&n[e]&&(n[e]=n[e].filter((t=>t.handler!==r)),0===n[e].length&&delete n[e])})),t}off(t,e,r){return W.off(this,t,e,r)}static offAll(t,e){if("string"!=typeof e)throw new TypeError("The event name must be a string.");return W._preEventTargetElems(t,"offAll").forEach((t=>{const r=L.get(t);if(r&&r[e]){for(const o of r[e])t.removeEventListener(e,o.handler,o.options);delete r[e]}})),t}offAll(t){return W.offAll(this,t)}static offAllTypes(t,e=null){if(null!==e&&"function"!=typeof e)throw new TypeError('The "filterFn" must be a function.');return W._preEventTargetElems(t,"offAllTypes").forEach((t=>{const r=L.get(t);if(r){for(const o in r)for(const n of r[o])("function"!=typeof e||e(n.handler,o))&&t.removeEventListener(o,n.handler,n.options);L.delete(t)}})),t}offAllTypes(t=null){return W.offAllTypes(this,t)}static trigger(t,e,r={}){if("string"!=typeof e)throw new TypeError("The event name must be a string.");return W._preEventTargetElems(t,"trigger").forEach((t=>{const o=r instanceof Event||r instanceof CustomEvent?r:new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t.dispatchEvent(o)})),t}trigger(t,e={}){return W.trigger(this,t,e)}static _propFix={for:"htmlFor",class:"className"};static attr(t,e){if("string"!=typeof e)throw new TypeError('The "name" must be a string.');return W._preElem(t,"attr").getAttribute(e)}attr(t){return W.attr(this,t)}static setAttr(t,e,r=null){if("string"!=typeof e)throw new TypeError('The "name" must be a string.');if(null!==r&&"string"!=typeof r)throw new TypeError('The "value" must be a string.');return W._preElems(t,"setAttr").forEach((t=>{null===r?t.removeAttribute(e):t.setAttribute(e,r)})),t}setAttr(t,e){return W.setAttr(this,t,e)}static removeAttr(t,e){if("string"!=typeof e)throw new TypeError('The "name" must be a string.');return W._preElems(t,"removeAttr").forEach((t=>t.removeAttribute(e))),t}removeAttr(t){return W.removeAttr(this,t)}static hasAttr(t,e){if("string"!=typeof e)throw new TypeError('The "name" must be a string.');return W._preElem(t,"hasAttr").hasAttribute(e)}hasAttr(t){return W.hasAttr(this,t)}static hasProp(t,e){if("string"!=typeof e)throw new TypeError('The "name" must be a string.');return!!W._preElem(t,"hasProp")[W._propFix[e]||e]}hasProp(t){return W.hasProp(this,t)}static addProp(t,e){if("string"!=typeof e)throw new TypeError('The "name" must be a string.');return W._preElems(t,"addProp").forEach((t=>{t[e=W._propFix[e]||e]=!0})),t}addProp(t){return W.addProp(this,t)}static removeProp(t,e){if("string"!=typeof e)throw new TypeError('The "name" must be a string.');return W._preElems(t,"removeProp").forEach((t=>{t[e=W._propFix[e]||e]=!1})),t}removeProp(t){return W.removeProp(this,t)}static toggleProp(t,e,r){if("string"!=typeof e)throw new TypeError('The "name" must be a string.');if(void 0!==r&&"boolean"!=typeof r)throw new TypeError('The "force" must be a boolean.');W._preElems(t,"toggleProp").forEach((t=>{const o=W._propFix[e]||e;(void 0===r?!t[o]:r)?W.addProp(t,e):W.removeProp(t,e)}))}toggleProp(t,e){return W.toggleProp(this,t,e)}static remove(t){return W._preElems(t,"remove").forEach((t=>t.remove())),t}remove(){return W.remove(this)}static index(t,e=null){const r=W._preElem(t,"index");if(!r)return-1;if(!e)return Array.prototype.indexOf.call(r.parentNode?.children||[],r);if(e){const t="string"==typeof e?document.querySelectorAll(e):W._preElems(e,"index");return Array.prototype.indexOf.call(t,r)}return-1}index(t){return W.index(this,t)}static _getCustomRect(t,e){const r={height:0,width:0,x:0,y:0,bottom:0,left:0,right:0,top:0,toJSON:function(){throw new Error("Function not implemented.")}};for(const e in t)"number"==typeof t[e]&&(r[e]=t[e]);if("object"!=typeof e||null===e||Array.isArray(e))throw new Error("");const{height:o=0,width:n=0,top:i=0,bottom:s=0,left:l=0,right:a=0}=e;if("number"!=typeof o)throw new Error("");if("number"!=typeof n)throw new Error("");if("number"!=typeof i)throw new Error("");if("number"!=typeof s)throw new Error("");if("number"!=typeof l)throw new Error("");if("number"!=typeof a)throw new Error("");return r.height+=o,r.width+=n,r.top+=i,r.bottom+=s,r.left+=l,r.right+=a,r}static isCollWith(t,e,r={}){const o=W._getCustomRect(W._preElem(t,"isCollWith").getBoundingClientRect(),r),n=W._preElem(e,"isCollWith").getBoundingClientRect();return T(o,n)}isCollWith(t,e){return W.isCollWith(this,t,e)}static isCollPerfWith(t,e,r={}){const o=W._getCustomRect(W._preElem(t,"isCollPerfWith").getBoundingClientRect(),r),n=W._preElem(e,"isCollPerfWith").getBoundingClientRect();return v(o,n)}isCollPerfWith(t,e){return W.isCollPerfWith(this,t,e)}static _isCollWithLock(t,e,r,o,n){const i=k[n];if(t)return i.has(o)||i.set(o,!0),!0;if(i.has(o)){let t=!1;switch(n){case"top":t=S(e,r);break;case"bottom":t=_(e,r);break;case"left":t=A(e,r);break;case"right":t=C(e,r)}return t&&i.delete(o),i.has(o)}return!1}static isCollWithLock(t,e,r,o={}){const n=W._preElem(t,"isCollWithLock"),i=W._preElem(e,"isCollWithLock"),s=W._getCustomRect(n.getBoundingClientRect(),o),l=i.getBoundingClientRect(),a=T(s,l);return W._isCollWithLock(a,s,l,n,r)}isCollWithLock(t,e,r){return W.isCollWithLock(this,t,e,r)}static isCollPerfWithLock(t,e,r,o={}){const n=W._preElem(t,"isCollPerfWithLock"),i=W._preElem(e,"isCollPerfWithLock"),s=W._getCustomRect(n.getBoundingClientRect(),o),l=i.getBoundingClientRect(),a=v(s,l);return W._isCollWithLock(a,s,l,n,r)}isCollPerfWithLock(t,e,r){return W.isCollPerfWithLock(this,t,e,r)}static resetCollLock(t){const e=W._preElem(t,"resetCollLock");let r=!1;for(const t of["top","bottom","left","right"])k[t].has(e)&&(k[t].delete(e),r=!0);return r}resetCollLock(){return W.resetCollLock(this)}static resetCollLockDir(t,e){const r=W._preElem(t,"resetCollLockDir"),o=k[e];return!!o.has(r)&&(o.delete(r),!0)}resetCollLockDir(t){return W.resetCollLockDir(this,t)}static isInViewport(t){const e=W._preElem(t,"isInViewport");if(!e.checkVisibility({contentVisibilityAuto:!1,opacityProperty:!1,visibilityProperty:!1}))return!1;const r=W.offset(e).top,o=r+W.outerHeight(e),n=W.scrollTop(window),i=n+W.height(window);return o>n&&r<i}isInViewport(){return W.isInViewport(this)}static isScrolledIntoView(t){const e=W._preElem(t,"isScrolledIntoView");if(!e.checkVisibility({contentVisibilityAuto:!1,opacityProperty:!1,visibilityProperty:!1}))return!1;const r=W.scrollTop(window),o=r+W.height(window),n=W.offset(e).top;return n+W.height(e)<=o&&n>=r}isScrolledIntoView(){return W.isScrolledIntoView(this)}static isInContainer(t,e){const r=W._preElem(t,"isInContainer"),o=W._preElem(e,"isInContainer");if(!r.checkVisibility({contentVisibilityAuto:!1,opacityProperty:!1,visibilityProperty:!1}))return!1;const n=r.getBoundingClientRect(),i=o.getBoundingClientRect(),s=n.bottom>i.top&&n.top<i.bottom,l=n.right>i.left&&n.left<i.right;return s&&l}isInContainer(t){return W.isInContainer(this,t)}static isFullyInContainer(t,e){const r=W._preElem(t,"isScrolledIntoView"),o=W._preElem(e,"isInContainer");if(!r.checkVisibility({contentVisibilityAuto:!1,opacityProperty:!1,visibilityProperty:!1}))return!1;const n=r.getBoundingClientRect(),i=o.getBoundingClientRect();return n.top>=i.top&&n.bottom<=i.bottom&&n.left>=i.left&&n.right<=i.right}isFullyInContainer(t){return W.isFullyInContainer(this,t)}static hasScroll(t){const e=W._preElem(t,"hasScroll");return{v:e.scrollHeight>e.clientHeight,h:e.scrollWidth>e.clientWidth}}hasScroll(){return W.hasScroll(this)}}const B=W;class P{static Utils={...r,TinyHtml:B};#r=new WeakMap;#o=new WeakMap;#n=new WeakMap;#i=new WeakMap;#s=new WeakMap;#l=new WeakMap;#a={};#c=null;#u=null;#p=new Set(["IMG","IFRAME","VIDEO"]);#m=null;#d=!1;#h=!1;#f=!1;#g=!1;#y="";#b=!1;#w=!1;#E=!1;#T=!1;#v=!1;#S=!1;#_=0;#A=0;#C=0;#L=0;#x=0;#k;#W;#B=new Set;constructor(t,{extraScrollBoundary:e=0,autoScrollBottom:r=!0,observeMutations:o=!0,preserveScrollOnLayoutShift:n=!0,debounceTime:i=100,querySelector:s=null,attributeFilter:l=["class","style","src","data-*","height","width"]}={}){if(!(t instanceof Element||t===window))throw new TypeError("TinySmartScroller: 'target' must be a DOM Element or 'window', but got "+typeof t);if("number"!=typeof e||Number.isNaN(e))throw new TypeError(`TinySmartScroller: 'extraScrollBoundary' must be a valid number, received ${e}`);if("boolean"!=typeof r)throw new TypeError("TinySmartScroller: 'autoScrollBottom' must be a boolean, received "+typeof r);if("boolean"!=typeof o)throw new TypeError("TinySmartScroller: 'observeMutations' must be a boolean, received "+typeof o);if("boolean"!=typeof n)throw new TypeError("TinySmartScroller: 'preserveScrollOnLayoutShift' must be a boolean, received "+typeof n);if("number"!=typeof i||i<0||Number.isNaN(i))throw new TypeError(`TinySmartScroller: 'debounceTime' must be a non-negative number, received ${i}`);if(null!==s&&"string"!=typeof s)throw new TypeError("TinySmartScroller: 'querySelector' must be a string or null, received "+typeof s);if(!(null===l||Array.isArray(l)||l instanceof Set))throw new TypeError("TinySmartScroller: 'attributeFilter' must be an array, Set, or null. Got "+typeof l);let a;this.#W=t instanceof Window?document.documentElement:t,this.#b=t instanceof Window,this.#T=r,this.#v=o,this.#S=n,this.#_=i,this.#x=e,this.#y=s||"",this.#k=new Set(l||void 0),this.#m=()=>{this._scrollDataUpdater(),clearTimeout(a),a=setTimeout((()=>this._onScroll()),this.#_)},(this.#b?window:this.#W).addEventListener("scroll",this.#m,{passive:!0}),this.#v&&(this._observeMutations(),this._observeResizes(this.#W.children)),this._scrollDataUpdater()}getSimpleOnHeight(t=[]){if(!Array.isArray(t))throw new TypeError("getSimpleOnHeight(filter): filter must be an array of tag names");return(e,r,o)=>{if(t.length>0&&!t.includes(e.tagName)||o.now!==o.old)return;const n=r.old;return{height:r.now.height-n.height,width:0}}}addSimpleOnHeight(t){if(!Array.isArray(t))throw new TypeError("addSimpleOnHeight(filter): filter must be an array of tag names");const e=this.getSimpleOnHeight(t);return this.onSize(e),e}getLoadTags(){return Array.from(this.#p)}addLoadTag(t){if("string"!=typeof t)throw new TypeError("addLoadTag(tag): tag must be a string");this.#p.add(t.toUpperCase())}removeLoadTag(t){if("string"!=typeof t)throw new TypeError("removeLoadTag(tag): tag must be a string");this.#p.delete(t.toUpperCase())}hasLoadTag(t){if("string"!=typeof t)throw new TypeError("hasLoadTag(tag): tag must be a string");return this.#p.has(t.toUpperCase())}resetLoadTags(t=!1){if("boolean"!=typeof t)throw new TypeError("resetLoadTags(addDefault): addDefault must be a boolean");this.#p.clear(),t&&(this.#p.add("IMG"),this.#p.add("IFRAME"),this.#p.add("VIDEO"))}getAttributeFilters(){return Array.from(this.#k)}addAttributeFilter(t){if("string"!=typeof t)throw new TypeError("addAttributeFilter(attr): attr must be a string");this.#k.add(t)}removeAttributeFilter(t){if("string"!=typeof t)throw new TypeError("removeAttributeFilter(attr): attr must be a string");this.#k.delete(t)}hasAttributeFilter(t){if("string"!=typeof t)throw new TypeError("hasAttributeFilter(attr): attr must be a string");return this.#k.has(t)}resetAttributeFilters(t=!1){if("boolean"!=typeof t)throw new TypeError("resetAttributeFilters(addDefault): addDefault must be a boolean");this.#k.clear(),t&&["class","style","src","data-*","height","width"].forEach((t=>this.#k.add(t)))}onSize(t){if(!this.#w){if("function"!=typeof t)throw new TypeError("onSize(handler): handler must be a function");this.#B.add(t)}}offSize(t){if(!this.#w){if("function"!=typeof t)throw new TypeError("offSize(handler): handler must be a function");this.#B.delete(t)}}on(t,e){if(!this.#w){if("string"!=typeof t)throw new TypeError("on(event, handler): event name must be a string");if("function"!=typeof e)throw new TypeError("on(event, handler): handler must be a function");this.#a[t]||(this.#a[t]=[]),this.#a[t].push(e)}}off(t,e){if(this.#w)return;if("string"!=typeof t)throw new TypeError("off(event, handler): event name must be a string");if("function"!=typeof e)throw new TypeError("off(event, handler): handler must be a function");const r=this.#a[t];if(!Array.isArray(r))return;const o=r.indexOf(e);-1!==o&&r.splice(o,1),0===r.length&&delete this.#a[t]}_scrollDataUpdater(){const t=new Map;return this.#W.querySelectorAll(this.#y||"*").forEach((e=>{const r=this.#n.get(e)??!1;this.#i.set(e,r);const o=B.isInContainer(this.#W,e);this.#n.set(e,o),t.set(e,{oldIsVisible:r,isVisible:o})})),t}_emit(t,e){if(!this.#w){if("string"!=typeof t)throw new TypeError("_emit(event, payload): event name must be a string");(this.#a[t]||[]).forEach((t=>t(e)))}}_onScroll(){if(this.#w)return;const t=this._scrollDataUpdater(),e=this.#W,r=e.scrollTop,o=e.scrollHeight,n=e.clientHeight,i={scrollTop:r,scrollHeight:o,clientHeight:n};let s=null,l=null;const a=0===r,c=r+n>=o-1,u=r<=0+this.#x,p=r+n>=o-1-this.#x;a&&c?s="all":a?s="top":c&&(s="bottom"),u&&p?l="all":u?l="top":p&&(l="bottom"),this.#h=a,this.#d=c,this.#f=u,this.#g=p,this.#E=!(this.#T&&this.#d),this.#L=o-r-n,this._emit("onScrollBoundary",{status:s,...i,scrollCache:t}),this._emit("onExtraScrollBoundary",{status:l,...i,scrollCache:t}),this.#E?this._emit("onScrollPause",{...i,scrollCache:t}):this._emit("onAutoScroll",{...i,scrollCache:t})}_fixScroll(t=[]){if(this.#w)return;if(!Array.isArray(t))throw new TypeError("_fixScroll: targets must be an array of Elements");const e=this.#W.scrollHeight,r=this.#W.scrollTop,o=this.#W.scrollHeight-this.#W.scrollTop-this.#W.clientHeight,n=this.#W.scrollHeight-e,i=()=>{const e={height:0,width:0};for(const r of t){const t=this.#r.get(r)||{height:0,width:0},o=this.#o.get(r)||{height:0,width:0};this.#B.forEach((n=>{const i=n(r,{old:t,now:o},{old:this.#C,now:this.#A});if(this.#n.get(r)||this.#s.get(r)){if(void 0!==i&&"object"!=typeof i)throw new Error("_fixScroll: size filter must return an object or undefined");if(void 0===i)return;e.height=i.height,e.width=i.width}}))}if("number"!=typeof e.height&&e.height<0)throw new Error("_fixScroll: invalid scrollSize.height value");if("number"!=typeof e.width&&e.width<0)throw new Error("_fixScroll: invalid scrollSize.width value");if(0!==e.height||0!==e.width)for(const e of t)this.#s.set(e,this.#n.get(e)??!1),this.#l.set(e,this.#i.get(e)??!1);return e};if(this.#C>0&&B.hasScroll(this.#W).v&&this.#T&&this.#S&&!this.#d&&!this.#h){const t=i();this.#W.scrollTop=r+n+t.height,t.width>0&&(this.#W.scrollLeft=this.#W.scrollLeft+t.width)}else!this.#E&&this.#T?(i(),this.scrollToBottom()):this.#T||this.#d||(i(),this.#W.scrollTop=this.#W.scrollHeight-this.#W.clientHeight-o)}_observeMutations(){this.#u=new MutationObserver((t=>{this.#w||(this._scrollDataUpdater(),this.#C=this.#A,this.#A=this.#W.childElementCount,t.forEach((t=>{t.addedNodes.forEach((t=>{if(t instanceof Element&&1===t.nodeType&&(this._observeResizes([t]),this._listenLoadEvents(t),this.#y)){const e=t.querySelectorAll(this.#y);this._observeResizes(e),this._listenLoadEvents(e)}}))})),this._fixScroll())})),this.#u.observe(this.#W,{childList:!0,subtree:!0,attributes:!0,attributeFilter:this.#k.size>0?Array.from(this.#k):void 0})}_observeResizes(t){this.#c||(this.#c=new ResizeObserver((t=>{if(this.#w)return;this._scrollDataUpdater();const e=[];for(const r of t){const t=r.target,o=this.#o.get(t);o&&this.#r.set(t,o);const{width:n,height:i}=r.contentRect;this.#o.set(t,{width:n,height:i}),e.push(t)}this._fixScroll(e)}))),Array.from(t).forEach((t=>{if(!this.#c)throw new Error("_observeResizes: ResizeObserver instance is not initialized");this.#c.observe(t)}))}_listenLoadEvents(t){this.#w||(t instanceof NodeList?Array.from(t):[t]).forEach((t=>{this.#p.has(t.tagName)&&(t.complete||t.addEventListener("load",(()=>{this._scrollDataUpdater(),!this.#E&&this.#T&&this.scrollToBottom()})))}))}get target(){return this.#W}getOldSize(t){return this.#r.get(t)??null}getNewSize(t){return this.#o.get(t)??null}wasVisible(t){return this.#i.get(t)??!1}isVisible(t){return this.#n.get(t)??!1}wasTimedVisible(t){return this.#l.get(t)??!1}isTimedVisible(t){return this.#s.get(t)??!1}setExtraScrollBoundary(t){if("number"!=typeof t||Number.isNaN(t))throw new TypeError("setExtraScrollBoundary(value): value must be a valid number");this.#x=t}getExtraScrollBoundary(){return this.#x}getLastKnownScrollBottomOffset(){return this.#L}scrollToBottom(){this.#W.scrollTop=this.#W.scrollHeight}scrollToTop(){this.#W.scrollTop=0}isUserAtCustomBottom(){return this.#g}isUserAtCustomTop(){return this.#f}isUserAtBottom(){return this.#d}isUserAtTop(){return this.#h}isScrollPaused(){return this.#E}isWindow(){return this.#b}isDestroyed(){return this.#w}getAutoScrollBottom(){return this.#T}getObserveMutations(){return this.#v}getPreserveScrollOnLayoutShift(){return this.#S}getDebounceTime(){return this.#_}getElemAmount(){return this.#A}getPrevElemAmount(){return this.#C}getQuerySelector(){return this.#y}destroy(){if(this.#w)return;this.#w=!0,this.#u&&(this.#u.disconnect(),this.#u=null),this.#c&&(this.#c.disconnect(),this.#c=null);const t=this.#b?window:this.#W;this.#m&&t.removeEventListener("scroll",this.#m),this.#r=new WeakMap,this.#o=new WeakMap,this.#n=new WeakMap,this.#i=new WeakMap,this.#s=new WeakMap,this.#l=new WeakMap,this.#a={},this.#B.clear(),this.#p.clear()}}const N=P;window.TinySmartScroller=e.TinySmartScroller})();
1
+ (()=>{"use strict";var e={d:(t,r)=>{for(var o in r)e.o(r,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:r[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.d(t,{TinySmartScroller:()=>N});var r={};e.r(r),e.d(r,{areElsCollBottom:()=>n,areElsCollLeft:()=>i,areElsCollPerfBottom:()=>a,areElsCollPerfLeft:()=>c,areElsCollPerfRight:()=>u,areElsCollPerfTop:()=>l,areElsCollRight:()=>s,areElsCollTop:()=>o,areElsColliding:()=>p,areElsPerfColliding:()=>h,getElsCollDetails:()=>E,getElsCollDirDepth:()=>w,getElsCollOverlap:()=>f,getElsCollOverlapPos:()=>g,getElsColliding:()=>m,getElsPerfColliding:()=>d,getElsRelativeCenterOffset:()=>b,getRectCenter:()=>y});const o=(e,t)=>e.bottom<t.top,n=(e,t)=>e.top>t.bottom,i=(e,t)=>e.right<t.left,s=(e,t)=>e.left>t.right,l=(e,t)=>e.bottom<=t.top,a=(e,t)=>e.top>=t.bottom,c=(e,t)=>e.right<=t.left,u=(e,t)=>e.left>=t.right,p=(e,t)=>!(i(e,t)||s(e,t)||o(e,t)||n(e,t)),h=(e,t)=>!(c(e,t)||u(e,t)||l(e,t)||a(e,t)),m=(e,t)=>i(e,t)?"left":s(e,t)?"right":o(e,t)?"top":n(e,t)?"bottom":null,d=(e,t)=>c(e,t)?"left":u(e,t)?"right":l(e,t)?"top":a(e,t)?"bottom":null,f=(e,t)=>({overlapLeft:t.right-e.left,overlapRight:e.right-t.left,overlapTop:t.bottom-e.top,overlapBottom:e.bottom-t.top}),g=({overlapLeft:e=-1,overlapRight:t=-1,overlapTop:r=-1,overlapBottom:o=-1}={})=>({dirX:e<t?"right":"left",dirY:r<o?"bottom":"top"}),y=e=>({x:e.left+e.width/2,y:e.top+e.height/2});function b(e,t){const r=e.left+e.width/2,o=e.top+e.height/2;return{x:t.left+t.width/2-r,y:t.top+t.height/2-o}}function w(e,t){if(!h(e,t))return{inDir:null,dirX:null,dirY:null,depthX:0,depthY:0};const{overlapLeft:r,overlapRight:o,overlapTop:n,overlapBottom:i}=f(e,t),{dirX:s,dirY:l}=g({overlapLeft:r,overlapRight:o,overlapTop:n,overlapBottom:i}),a=Math.min(r,o),c=Math.min(n,i);let u;return u=a<c?s:l,{inDir:u,dirX:s,dirY:l,depthX:a,depthY:c}}function E(e,t){const r=h(e,t),o={in:null,x:null,y:null},n={y:null,x:null},i={top:0,bottom:0,left:0,right:0},{overlapLeft:s,overlapRight:l,overlapTop:a,overlapBottom:c}=f(t,e);i.top=a,i.bottom=c,i.left=s,i.right=l;const u=Object.entries(i).filter(([,e])=>e>0).sort((e,t)=>e[1]-t[1]),{dirX:p,dirY:m}=g({overlapLeft:l,overlapRight:s,overlapTop:c,overlapBottom:a});return o.y=m,o.x=p,i.bottom<0?n.y="bottom":i.top<0&&(n.y="top"),i.left<0?n.x="left":i.right<0&&(n.x="right"),o.in=r?i.top===i.bottom&&i.bottom===i.left&&i.left===i.right?"center":u.length?u[0][0]:"top":null,{dirs:o,depth:i,isNeg:n}}const{areElsColliding:T,areElsPerfColliding:v,areElsCollTop:S,areElsCollBottom:_,areElsCollLeft:A,areElsCollRight:L}=r,C=new WeakMap,x=new WeakMap,k={top:new WeakMap,bottom:new WeakMap,left:new WeakMap,right:new WeakMap};class W{static Utils={...r};static createElement(e,t){if("string"!=typeof e)throw new TypeError("[TinyHtml] createElement(): The tagName must be a string.");if(void 0!==t&&"object"!=typeof t)throw new TypeError("[TinyHtml] createElement(): The ops must be a object.");return new W(document.createElement(e,t))}static createTextNode(e){if("string"!=typeof e)throw new TypeError("[TinyHtml] createTextNode(): The value must be a string.");return new W(document.createTextNode(e))}static createElementFromHTML(e){const t=document.createElement("template");if(!(e=e.trim()).startsWith("<"))return W.createTextNode(e);if(t.innerHTML=e,!(t.content.firstChild instanceof Element))throw new Error("");return new W(t.content.firstChild)}static query(e,t=document){const r=t.querySelector(e);return r?new W(r):null}querySelector(e){return W.query(e,W._preElem(this,"query"))}static queryAll(e,t=document){const r=t.querySelectorAll(e);return W.toTinyElm([...r])}querySelectorAll(e){return W.queryAll(e,W._preElem(this,"queryAll"))}static getById(e){const t=document.getElementById(e);return t?new W(t):null}static getByClassName(e,t=document){const r=t.getElementsByClassName(e);return W.toTinyElm([...r])}getElementsByClassName(e){return W.getByClassName(e,W._preElem(this,"getByClassName"))}static getByName(e){const t=document.getElementsByName(e);return W.toTinyElm([...t])}static getByTagNameNS(e,t="http://www.w3.org/1999/xhtml",r=document){const o=r.getElementsByTagNameNS(t,e);return W.toTinyElm([...o])}getElementsByTagNameNS(e,t="http://www.w3.org/1999/xhtml"){return W.getByTagNameNS(e,t,W._preElem(this,"getByTagNameNS"))}get(){return this.#e}_getElement(e){if(!(this.#e instanceof Element||this.#e instanceof Window||this.#e instanceof Document))throw new Error(`[TinyHtml] Invalid Element in ${e}().`);return this.#e}static _preElemsTemplate(e,t,r,o){const n=e=>e.map(e=>{const n=e instanceof W?e._getElement(t):e;let i=!1;for(const e of r)if(n instanceof e){i=!0;break}if(!i)throw new Error(`[TinyHtml] Invalid element of the list "${o.join(",")}" in ${t}().`);return n});return Array.isArray(e)?n(e):n([e])}static _preElemTemplate(e,t,r,o,n=!1){const i=e=>{const i=e[0];let s=i instanceof W?i._getElement(t):i,l=!1;for(const e of r)if(s instanceof e){l=!0;break}if(n&&null==s&&(s=null,l=!0),!l)throw new Error(`[TinyHtml] Invalid element of the list "${o.join(",")}" in ${t}().`);return s};if(!Array.isArray(e))return i([e]);if(e.length>1)throw new Error(`[TinyHtml] Invalid element amount in ${t}() (Received ${e.length}/1).`);return i(e)}static _preElems(e,t){return W._preElemsTemplate(e,t,[Element],["Element"])}static _preElem(e,t){return W._preElemTemplate(e,t,[Element],["Element"])}static _preNodeElems(e,t){return W._preElemsTemplate(e,t,[Node],["Node"])}static _preNodeElem(e,t){return W._preElemTemplate(e,t,[Node],["Node"])}static _preNodeElemWithNull(e,t){return W._preElemTemplate(e,t,[Node],["Node"],!0)}static _preHtmlElems(e,t){return W._preElemsTemplate(e,t,[HTMLElement],["HTMLElement"])}static _preHtmlElem(e,t){return W._preElemTemplate(e,t,[HTMLElement],["HTMLElement"])}static _preInputElems(e,t){return W._preElemsTemplate(e,t,[HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement,HTMLOptionElement],["HTMLInputElement","HTMLSelectElement","HTMLTextAreaElement","HTMLOptionElement"])}static _preInputElem(e,t){return W._preElemTemplate(e,t,[HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement,HTMLOptionElement],["HTMLInputElement","HTMLSelectElement","HTMLTextAreaElement","HTMLOptionElement"])}static _preEventTargetElems(e,t){return W._preElemsTemplate(e,t,[EventTarget],["EventTarget"])}static _preEventTargetElem(e,t){return W._preElemTemplate(e,t,[EventTarget],["EventTarget"])}static _preElemsAndWindow(e,t){return W._preElemsTemplate(e,t,[Element,Window],["Element","Window"])}static _preElemAndWindow(e,t){return W._preElemTemplate(e,t,[Element,Window],["Element","Window"])}static _preElemsAndWinAndDoc(e,t){return W._preElemsTemplate(e,t,[Element,Window,Document],["Element","Window","Document"]).map(e=>e instanceof Document?e.documentElement:e)}static _preElemAndWinAndDoc(e,t){const r=W._preElemTemplate(e,t,[Element,Window,Document],["Element","Window","Document"]);return r instanceof Document?r.documentElement:r}static _preElemsWithDoc(e,t){return W._preElemsTemplate(e,t,[Element,Document],["Element","Document"])}static _preElemWithDoc(e,t){return W._preElemTemplate(e,t,[Element,Document],["Element","Document"])}static toTinyElm(e){const t=e=>e.map(e=>e instanceof W?e:new W(e));return Array.isArray(e)?t(e):t([e])}static fromTinyElm(e){const t=e=>e.map(e=>e instanceof W?e._getElement("fromTinyElm"):e);return Array.isArray(e)?t(e):t([e])}static winnow(e,t,r,o=!1){if("boolean"!=typeof o)throw new TypeError('The "not" must be a boolean.');if("function"==typeof t)return W._preElems(e,r).filter((e,r)=>!!t.call(e,r,e)!==o);if(t instanceof Element)return W._preElems(e,r).filter(e=>e===t!==o);if(Array.isArray(t)||"string"!=typeof t&&null!=t.length)return W._preElems(e,r).filter(e=>t.includes(e)!==o);let n=t;return o&&(n=`:not(${n})`),W._preElems(e,r).filter(e=>1===e.nodeType&&e.matches(n))}static filter(e,t,r=!1){return r&&(t=`:not(${t})`),W._preElems(e,"filter").filter(e=>1===e.nodeType&&e.matches(t))}static filterOnly(e,t){return W.winnow(e,t,"filterOnly",!1)}static not(e,t){return W.winnow(e,t,"not",!0)}not(e){return W.not(this,e)}static find(e,t){const r=[];for(const o of W._preElems(e,"find"))r.push(...o.querySelectorAll(t));return[...new Set(r)]}find(e){return W.find(this,e)}static is(e,t){return W.winnow(e,t,"is",!1).length>0}is(e){return W.is(this,e)}static has(e,t){const r="string"==typeof t?[...document.querySelectorAll(t)]:W._preElems(t,"has");return W._preElems(e,"has").filter(e=>r.some(t=>e&&e.contains(t)))}has(e){return W.has(this,e).length>0}static closest(e,t,r){const o=[];for(const n of W._preElems(e,"closest")){let e=n;for(;e&&e!==r;){if(1===e.nodeType&&("string"==typeof t?e.matches(t):e===t)){o.push(e);break}e=e.parentElement}}return[...new Set(o)]}closest(e,t){return W.closest(this,e,t)}static isSameDom(e,t){return W._preNodeElem(e,"isSameDom")===W._preNodeElem(t,"isSameDom")}isSameDom(e){return W.isSameDom(this,e)}_data={};static _dataSelector={public:(e,t)=>{const r=W._preElem(t,e);let o=x.get(r);return o||(o={},x.set(r,o)),o},private:(e,t)=>{if(!(t instanceof W))throw new Error(`Element must be a TinyHtml instance to execute ${e}().`);return t._data}};static data(e,t,r=!1){const o=W._dataSelector[r?"private":"public"]("data",e);if(null==t)return{...o};if("string"!=typeof t)throw new TypeError("The key must be a string.");return o.hasOwnProperty(t)?o[t]:void 0}data(e,t){return W.data(this,e,t)}static setData(e,t,r,o=!1){const n=W._dataSelector[o?"private":"public"]("setData",e);if("string"!=typeof t)throw new TypeError("The key must be a string.");return n[t]=r,e}setData(e,t,r=!1){return W.setData(this,e,t,r)}static _getSibling(e,t,r){let o=W._preNodeElemWithNull(e,r);for(;o&&(o=o[t])&&1!==o.nodeType;);return o instanceof Node?o:null}static _getSiblings(e,t){let r=e;const o=[];for(;r;r=r.nextSibling)1===r.nodeType&&r!==t&&o.push(r);return o}static domDir(e,t,r,o="domDir"){if("string"!=typeof t)throw new TypeError('The "direction" must be a string.');let n=W._preNodeElemWithNull(e,o);const i=[];for(;n&&(n=n[t]);)if(1===n.nodeType){if(r&&("string"==typeof r?n.matches(r):n===r))break;i.push(n)}return i}static parent(e){let t=W._preNodeElemWithNull(e,"parent");const r=t?t.parentNode:null;return r&&11!==r.nodeType?r:null}parent(){return W.parent(this)}static parents(e,t){return W.domDir(e,"parentNode",t,"parents")}parents(e){return W.parents(this,e)}static next(e){return W._getSibling(e,"nextSibling","next")}next(){return W.next(this)}static prev(e){return W._getSibling(e,"previousSibling","prev")}prev(){return W.prev(this)}static nextAll(e){return W.domDir(e,"nextSibling",void 0,"nextAll")}nextAll(){return W.nextAll(this)}static prevAll(e){return W.domDir(e,"previousSibling",void 0,"prevAll")}prevAll(){return W.prevAll(this)}static nextUntil(e,t){return W.domDir(e,"nextSibling",t,"nextUtil")}nextUntil(e){return W.nextUntil(this,e)}static prevUntil(e,t){return W.domDir(e,"previousSibling",t,"prevUtil")}prevUntil(e){return W.prevUntil(this,e)}static siblings(e){const t=W._preNodeElemWithNull(e,"siblings");return W._getSiblings(t&&t.parentNode?t.parentNode.firstChild:null,t)}siblings(){return W.siblings(this)}static children(e){const t=W._preNodeElemWithNull(e,"children");return W._getSiblings(t?t.firstChild:null)}children(){return W.children(this)}static contents(e){const t=W._preNodeElemWithNull(e,"contents");return t instanceof HTMLIFrameElement&&null!=t.contentDocument&&Object.getPrototypeOf(t.contentDocument)?[t.contentDocument]:t instanceof HTMLTemplateElement?Array.from((t.content||t).childNodes):t?Array.from(t.childNodes):[]}contents(){return W.contents(this)}static clone(e,t=!0){if("boolean"!=typeof t)throw new TypeError('The "deep" must be a boolean.');return W._preNodeElems(e,"clone").map(e=>e.cloneNode(t))}clone(e){return W.clone(this,e)[0]}static _appendChecker(e,...t){const r=[],o=[...t];for(const t in o)"string"!=typeof o[t]?r.push(W._preNodeElem(o[t],e)):r.push(o[t]);return r}static append(e,...t){return W._preElem(e,"append").append(...W._appendChecker("append",...t)),e}append(...e){return W.append(this,...e)}static prepend(e,...t){return W._preElem(e,"prepend").prepend(...W._appendChecker("prepend",...t)),e}prepend(...e){return W.prepend(this,...e)}static before(e,...t){return W._preElem(e,"before").before(...W._appendChecker("before",...t)),e}before(...e){return W.before(this,...e)}static after(e,...t){return W._preElem(e,"after").after(...W._appendChecker("after",...t)),e}after(...e){return W.after(this,...e)}static replaceWith(e,...t){return W._preElem(e,"replaceWith").replaceWith(...W._appendChecker("replaceWith",...t)),e}replaceWith(...e){return W.replaceWith(this,...e)}static appendTo(e,t){const r=W._preNodeElems(e,"appendTo"),o=W._preNodeElems(t,"appendTo");return o.forEach((e,t)=>{r.forEach(r=>e.appendChild(t===o.length-1?r:r.cloneNode(!0)))}),e}appendTo(e){return W.appendTo(this,e)}static prependTo(e,t){const r=W._preElems(e,"prependTo"),o=W._preElems(t,"prependTo");return o.forEach((e,t)=>{r.slice().reverse().forEach(r=>e.prepend(t===o.length-1?r:r.cloneNode(!0)))}),e}prependTo(e){return W.prependTo(this,e)}static insertBefore(e,t,r=null){const o=W._preNodeElem(e,"insertBefore"),n=W._preNodeElem(t,"insertBefore"),i=W._preNodeElemWithNull(r,"insertBefore");if(!n.parentNode)throw new Error("");return n.parentNode.insertBefore(o,i||n),e}insertBefore(e,t){return W.insertBefore(this,e,t)}static insertAfter(e,t,r=null){const o=W._preNodeElem(e,"insertAfter"),n=W._preNodeElem(t,"insertBefore"),i=W._preNodeElemWithNull(r,"insertBefore");if(!n.parentNode)throw new Error("");return n.parentNode.insertBefore(o,i||n.nextSibling),e}insertAfter(e,t){return W.insertAfter(this,e,t)}static replaceAll(e,t){const r=W._preNodeElems(e,"replaceAll"),o=W._preNodeElems(t,"replaceAll");return o.forEach((e,t)=>{const n=e.parentNode;r.forEach(r=>{n&&n.replaceChild(t===o.length-1?r:r.cloneNode(!0),e)})}),e}replaceAll(e){return W.replaceAll(this,e)}#e;constructor(e){if(e instanceof W)throw new Error("[TinyHtml] You are trying to put a TinyHtml inside another TinyHtml in constructor.");if(!(e instanceof Element||e instanceof Window||e instanceof Document||e instanceof Text))throw new Error("[TinyHtml] Invalid Target in constructor.");this.#e=e}static isWindow(e){return null!=e&&e===e.window}static css(e){const t=W._preElem(e,"css");return window.getComputedStyle(t)}css(){return W.css(this)}static cssString(e,t){const r=W._preElem(e,"cssString");if("string"!=typeof t)throw new TypeError("The prop must be a string.");const o=window.getComputedStyle(r)[t];return"string"==typeof o?o:"number"==typeof o?o.toString():null}cssString(e){return W.cssString(this,e)}static cssList(e,t){const r=W._preElem(e,"cssList");if(!Array.isArray(t))throw new TypeError("The prop must be an array of strings.");const o=window.getComputedStyle(r),n={};for(const e of t)void 0!==e&&(n[e]=o.getPropertyValue(e));return n}cssList(e){return W.cssList(this,e)}static cssFloat(e,t){const r=W._preElem(e,"cssFloat");if("string"!=typeof t)throw new TypeError("The prop must be a string.");const o=window.getComputedStyle(r)[t];return parseFloat(o)||0}cssFloat(e){return W.cssFloat(this,e)}static cssFloats(e,t){const r=W._preElem(e,"cssFloats");if(!Array.isArray(t))throw new TypeError("The prop must be an array of strings.");const o=window.getComputedStyle(r),n={};for(const e of t)n[e]=parseFloat(o[e])||0;return n}cssFloats(e){return W.cssFloats(this,e)}static#t={alignContent:"align-content",alignItems:"align-items",alignSelf:"align-self",animationDelay:"animation-delay",animationDirection:"animation-direction",animationDuration:"animation-duration",animationFillMode:"animation-fill-mode",animationIterationCount:"animation-iteration-count",animationName:"animation-name",animationPlayState:"animation-play-state",animationTimingFunction:"animation-timing-function",backfaceVisibility:"backface-visibility",backgroundAttachment:"background-attachment",backgroundBlendMode:"background-blend-mode",backgroundClip:"background-clip",backgroundColor:"background-color",backgroundImage:"background-image",backgroundOrigin:"background-origin",backgroundPosition:"background-position",backgroundRepeat:"background-repeat",backgroundSize:"background-size",borderBottom:"border-bottom",borderBottomColor:"border-bottom-color",borderBottomLeftRadius:"border-bottom-left-radius",borderBottomRightRadius:"border-bottom-right-radius",borderBottomStyle:"border-bottom-style",borderBottomWidth:"border-bottom-width",borderCollapse:"border-collapse",borderColor:"border-color",borderImage:"border-image",borderImageOutset:"border-image-outset",borderImageRepeat:"border-image-repeat",borderImageSlice:"border-image-slice",borderImageSource:"border-image-source",borderImageWidth:"border-image-width",borderLeft:"border-left",borderLeftColor:"border-left-color",borderLeftStyle:"border-left-style",borderLeftWidth:"border-left-width",borderRadius:"border-radius",borderRight:"border-right",borderRightColor:"border-right-color",borderRightStyle:"border-right-style",borderRightWidth:"border-right-width",borderSpacing:"border-spacing",borderStyle:"border-style",borderTop:"border-top",borderTopColor:"border-top-color",borderTopLeftRadius:"border-top-left-radius",borderTopRightRadius:"border-top-right-radius",borderTopStyle:"border-top-style",borderTopWidth:"border-top-width",borderWidth:"border-width",boxDecorationBreak:"box-decoration-break",boxShadow:"box-shadow",boxSizing:"box-sizing",breakAfter:"break-after",breakBefore:"break-before",breakInside:"break-inside",captionSide:"caption-side",caretColor:"caret-color",clipPath:"clip-path",columnCount:"column-count",columnFill:"column-fill",columnGap:"column-gap",columnRule:"column-rule",columnRuleColor:"column-rule-color",columnRuleStyle:"column-rule-style",columnRuleWidth:"column-rule-width",columnSpan:"column-span",columnWidth:"column-width",counterIncrement:"counter-increment",counterReset:"counter-reset",emptyCells:"empty-cells",flexBasis:"flex-basis",flexDirection:"flex-direction",flexFlow:"flex-flow",flexGrow:"flex-grow",flexShrink:"flex-shrink",flexWrap:"flex-wrap",fontFamily:"font-family",fontFeatureSettings:"font-feature-settings",fontKerning:"font-kerning",fontLanguageOverride:"font-language-override",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontSynthesis:"font-synthesis",fontVariant:"font-variant",fontVariantAlternates:"font-variant-alternates",fontVariantCaps:"font-variant-caps",fontVariantEastAsian:"font-variant-east-asian",fontVariantLigatures:"font-variant-ligatures",fontVariantNumeric:"font-variant-numeric",fontVariantPosition:"font-variant-position",fontWeight:"font-weight",gridArea:"grid-area",gridAutoColumns:"grid-auto-columns",gridAutoFlow:"grid-auto-flow",gridAutoRows:"grid-auto-rows",gridColumn:"grid-column",gridColumnEnd:"grid-column-end",gridColumnGap:"grid-column-gap",gridColumnStart:"grid-column-start",gridGap:"grid-gap",gridRow:"grid-row",gridRowEnd:"grid-row-end",gridRowGap:"grid-row-gap",gridRowStart:"grid-row-start",gridTemplate:"grid-template",gridTemplateAreas:"grid-template-areas",gridTemplateColumns:"grid-template-columns",gridTemplateRows:"grid-template-rows",imageRendering:"image-rendering",justifyContent:"justify-content",letterSpacing:"letter-spacing",lineBreak:"line-break",lineHeight:"line-height",listStyle:"list-style",listStyleImage:"list-style-image",listStylePosition:"list-style-position",listStyleType:"list-style-type",marginBottom:"margin-bottom",marginLeft:"margin-left",marginRight:"margin-right",marginTop:"margin-top",maskClip:"mask-clip",maskComposite:"mask-composite",maskImage:"mask-image",maskMode:"mask-mode",maskOrigin:"mask-origin",maskPosition:"mask-position",maskRepeat:"mask-repeat",maskSize:"mask-size",maskType:"mask-type",maxHeight:"max-height",maxWidth:"max-width",minHeight:"min-height",minWidth:"min-width",mixBlendMode:"mix-blend-mode",objectFit:"object-fit",objectPosition:"object-position",offsetAnchor:"offset-anchor",offsetDistance:"offset-distance",offsetPath:"offset-path",offsetRotate:"offset-rotate",outlineColor:"outline-color",outlineOffset:"outline-offset",outlineStyle:"outline-style",outlineWidth:"outline-width",overflowAnchor:"overflow-anchor",overflowWrap:"overflow-wrap",overflowX:"overflow-x",overflowY:"overflow-y",paddingBottom:"padding-bottom",paddingLeft:"padding-left",paddingRight:"padding-right",paddingTop:"padding-top",pageBreakAfter:"page-break-after",pageBreakBefore:"page-break-before",pageBreakInside:"page-break-inside",perspectiveOrigin:"perspective-origin",placeContent:"place-content",placeItems:"place-items",placeSelf:"place-self",pointerEvents:"pointer-events",rowGap:"row-gap",scrollBehavior:"scroll-behavior",scrollMargin:"scroll-margin",scrollMarginBlock:"scroll-margin-block",scrollMarginBlockEnd:"scroll-margin-block-end",scrollMarginBlockStart:"scroll-margin-block-start",scrollMarginBottom:"scroll-margin-bottom",scrollMarginInline:"scroll-margin-inline",scrollMarginInlineEnd:"scroll-margin-inline-end",scrollMarginInlineStart:"scroll-margin-inline-start",scrollMarginLeft:"scroll-margin-left",scrollMarginRight:"scroll-margin-right",scrollMarginTop:"scroll-margin-top",scrollPadding:"scroll-padding",scrollPaddingBlock:"scroll-padding-block",scrollPaddingBlockEnd:"scroll-padding-block-end",scrollPaddingBlockStart:"scroll-padding-block-start",scrollPaddingBottom:"scroll-padding-bottom",scrollPaddingInline:"scroll-padding-inline",scrollPaddingInlineEnd:"scroll-padding-inline-end",scrollPaddingInlineStart:"scroll-padding-inline-start",scrollPaddingLeft:"scroll-padding-left",scrollPaddingRight:"scroll-padding-right",scrollPaddingTop:"scroll-padding-top",scrollSnapAlign:"scroll-snap-align",scrollSnapStop:"scroll-snap-stop",scrollSnapType:"scroll-snap-type",shapeImageThreshold:"shape-image-threshold",shapeMargin:"shape-margin",shapeOutside:"shape-outside",tabSize:"tab-size",tableLayout:"table-layout",textAlign:"text-align",textAlignLast:"text-align-last",textCombineUpright:"text-combine-upright",textDecoration:"text-decoration",textDecorationColor:"text-decoration-color",textDecorationLine:"text-decoration-line",textDecorationStyle:"text-decoration-style",textIndent:"text-indent",textJustify:"text-justify",textOrientation:"text-orientation",textOverflow:"text-overflow",textShadow:"text-shadow",textTransform:"text-transform",transformBox:"transform-box",transformOrigin:"transform-origin",transformStyle:"transform-style",transitionDelay:"transition-delay",transitionDuration:"transition-duration",transitionProperty:"transition-property",transitionTimingFunction:"transition-timing-function",unicodeBidi:"unicode-bidi",userSelect:"user-select",verticalAlign:"vertical-align",whiteSpace:"white-space",willChange:"will-change",wordBreak:"word-break",wordSpacing:"word-spacing",wordWrap:"word-wrap",writingMode:"writing-mode",zIndex:"z-index",WebkitTransform:"-webkit-transform",WebkitTransition:"-webkit-transition",WebkitBoxShadow:"-webkit-box-shadow",MozBoxShadow:"-moz-box-shadow",MozTransform:"-moz-transform",MozTransition:"-moz-transition",msTransform:"-ms-transform",msTransition:"-ms-transition"};static cssPropAliases=new Proxy(W.#t,{set:(e,t,r)=>(e[t]=r,W.cssPropRevAliases[r]=t,!0)});static cssPropRevAliases=Object.fromEntries(Object.entries(W.#t).map(([e,t])=>[t,e]));static toStyleKc(e){return"string"==typeof W.cssPropAliases[e]?W.cssPropAliases[e]:e}static toStyleCc(e){return"string"==typeof W.cssPropRevAliases[e]?W.cssPropRevAliases[e]:e}static setStyle(e,t,r=null){return W._preHtmlElems(e,"setStyle").forEach(e=>{if("object"==typeof t)for(const[r,o]of Object.entries(t))e.style.setProperty(W.toStyleKc(r),"string"==typeof o?o:"number"==typeof o?`${o}px`:String(o));else e.style.setProperty(W.toStyleKc(t),r)}),e}setStyle(e,t){return W.setStyle(this,e,t)}static getStyle(e,t){return W._preHtmlElem(e,"getStyle").style.getPropertyValue(W.toStyleKc(t))}getStyle(e){return W.getStyle(this,e)}static style(e,{camelCase:t=!1,rawAttr:r=!1}={}){if("boolean"!=typeof t)throw new TypeError('"camelCase" must be a boolean. Received: '+typeof t);if("boolean"!=typeof r)throw new TypeError('"rawAttr" must be a boolean. Received: '+typeof r);const o=W._preHtmlElem(e,"style"),n={};if(r){const e=(o.getAttribute("style")||"").split(";");for(const r of e){const[e,o]=r.split(":");if(!e||!o)continue;const i=e.trim(),s=o.trim();n[t?W.toStyleCc(i):i]=s}}else{const e=o.style;for(let r=0;r<e.length;r++){const o=e[r],i=e.getPropertyValue(o);n[t?W.toStyleCc(o):o]=i}}return n}style(e){return W.style(this,e)}static removeStyle(e,t){return W._preHtmlElems(e,"removeStyle").forEach(e=>{if(Array.isArray(t))for(const r of t)e.style.removeProperty(W.toStyleKc(r));else e.style.removeProperty(W.toStyleKc(t))}),e}removeStyle(e){return W.removeStyle(this,e)}static toggleStyle(e,t,r,o){return W._preHtmlElems(e,"toggleStyle").forEach(e=>{const n=W.getStyle(e,t).trim()===W.toStyleKc(r)?o:r;W.setStyle(e,t,n)}),e}toggleStyle(e,t,r){return W.toggleStyle(this,e,t,r)}static clearStyle(e){return W._preElems(e,"clearStyle").forEach(e=>e.removeAttribute("style")),e}clearStyle(){return W.clearStyle(this)}static focus(e){return W._preHtmlElem(e,"focus").focus(),e}focus(){return W.focus(this)}static blur(e){return W._preHtmlElem(e,"blur").blur(),e}blur(){return W.blur(this)}static boolCheck(e){return void 0!==e&&("true"===e||"1"===e||!0===e||"on"===e||"number"==typeof e&&e>0)}static setWinScrollTop(e){if("number"!=typeof e)throw new TypeError("The value must be a number.");W.setScrollTop(window,e)}static setWinScrollLeft(e){if("number"!=typeof e)throw new TypeError("The value must be a number.");W.setScrollLeft(window,e)}static winScrollTop(){return window.scrollY||document.documentElement.scrollTop}static winScrollLeft(){return window.scrollX||document.documentElement.scrollLeft}static winInnerHeight(){return window.innerHeight||document.documentElement.clientHeight}static winInnerWidth(){return window.innerWidth||document.documentElement.clientWidth}static isPageTop(){return 0===window.scrollY}static isPageBottom(){return window.innerHeight+window.scrollY>=document.body.offsetHeight}static getDimension(e,t,r="content"){const o=W._preElemAndWinAndDoc(e,"getDimension");if("string"!=typeof t)throw new TypeError("The type must be a string.");if("string"!=typeof r)throw new TypeError("The extra must be a string.");const n="width"===t?"Width":"Height";if(W.isWindow(o))return"margin"===r?o["inner"+n]:o.document.documentElement["client"+n];const i=o;if(9===i.nodeType){const e=i.documentElement;return Math.max(i.body["scroll"+n],e["scroll"+n],i.body["offset"+n],e["offset"+n],e["client"+n])}let s=i.getBoundingClientRect()[t];function l(e){return"width"===t?W.cssFloat(i,e+"Left")+W.cssFloat(i,e+"Right"):W.cssFloat(i,e+"Top")+W.cssFloat(i,e+"Bottom")}switch(r){case"content":s-=l("padding"),s-=l("border");break;case"padding":s-=l("border");break;case"border":break;case"margin":s+=l("margin")}return s}getDimension(e,t){return W.getDimension(this,e,t)}static setHeight(e,t){const r=W._preHtmlElem(e,"setHeight");if("number"!=typeof t&&"string"!=typeof t)throw new TypeError("The value must be a string or number.");return r.style.height="number"==typeof t?`${t}px`:t,e}setHeight(e){return W.setHeight(this,e)}static setWidth(e,t){const r=W._preHtmlElem(e,"setWidth");if("number"!=typeof t&&"string"!=typeof t)throw new TypeError("The value must be a string or number.");return r.style.width="number"==typeof t?`${t}px`:t,e}setWidth(e){return W.setWidth(this,e)}static height(e){const t=W._preElemAndWinAndDoc(e,"height");return W.getDimension(t,"height","content")}height(){return W.height(this)}static width(e){const t=W._preElemAndWinAndDoc(e,"width");return W.getDimension(t,"width","content")}width(){return W.width(this)}static innerHeight(e){const t=W._preElemAndWinAndDoc(e,"innerHeight");return W.getDimension(t,"height","padding")}innerHeight(){return W.innerHeight(this)}static innerWidth(e){const t=W._preElemAndWinAndDoc(e,"innerWidth");return W.getDimension(t,"width","padding")}innerWidth(){return W.innerWidth(this)}static outerHeight(e,t=!1){if("boolean"!=typeof t)throw new TypeError('The "includeMargin" must be a boolean.');const r=W._preElemAndWinAndDoc(e,"outerHeight");return W.getDimension(r,"height",t?"margin":"border")}outerHeight(e){return W.outerHeight(this,e)}static outerWidth(e,t=!1){if("boolean"!=typeof t)throw new TypeError('The "includeMargin" must be a boolean.');const r=W._preElemAndWinAndDoc(e,"outerWidth");return W.getDimension(r,"width",t?"margin":"border")}outerWidth(e){return W.outerWidth(this,e)}static animate(e,t,r){return W._preElems(e,"animate").forEach(e=>e.animate(t,r)),e}animate(e,t){return W.animate(this,e,t)}static offset(e){const t=W._preElem(e,"offset").getBoundingClientRect(),r=window.scrollY||document.documentElement.scrollTop,o=window.scrollX||document.documentElement.scrollLeft;return{top:t.top+r,left:t.left+o}}offset(){return W.offset(this)}static position(e){const t=W._preHtmlElem(e,"position");let r,o,n={top:0,left:0};if("fixed"===window.getComputedStyle(t).position)o=t.getBoundingClientRect();else{o=W.offset(t),r=t.offsetParent||document.documentElement;const{position:e}=window.getComputedStyle(r);for(;r instanceof HTMLElement&&(r===document.body||r===document.documentElement)&&"static"===e;)r=r.parentNode;if(r instanceof HTMLElement&&r!==t&&1===r.nodeType){const{borderTopWidth:e,borderLeftWidth:t}=W.cssFloats(r,["borderTopWidth","borderLeftWidth"]);n=W.offset(r),n.top+=e,n.left+=t}}return{top:o.top-n.top-W.cssFloat(t,"marginTop"),left:o.left-n.left-W.cssFloat(t,"marginLeft")}}position(){return W.position(this)}static offsetParent(e){let t=W._preHtmlElem(e,"offsetParent").offsetParent;for(;t instanceof HTMLElement&&"static"===window.getComputedStyle(t).position;)t=t.offsetParent;return t instanceof HTMLElement?t:document.documentElement}offsetParent(){return W.offsetParent(this)}static scrollTop(e){const t=W._preElemAndWindow(e,"scrollTop");return W.isWindow(t)?t.pageYOffset:9===t.nodeType?t.defaultView.pageYOffset:t.scrollTop}scrollTop(){return W.scrollTop(this)}static scrollLeft(e){const t=W._preElemAndWindow(e,"scrollLeft");return W.isWindow(t)?t.pageXOffset:9===t.nodeType?t.defaultView.pageXOffset:t.scrollLeft}scrollLeft(){return W.scrollLeft(this)}static easings={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>e*(2-e),easeInOutQuad:e=>e<.5?2*e*e:(4-2*e)*e-1,easeInCubic:e=>e*e*e,easeOutCubic:e=>--e*e*e+1,easeInOutCubic:e=>e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1};static scrollToXY(e,{targetX:t,targetY:r,duration:o,easing:n,onAnimation:i}={}){if(void 0!==t&&"number"!=typeof t)throw new TypeError("`targetX` must be a number if provided.");if(void 0!==r&&"number"!=typeof r)throw new TypeError("`targetY` must be a number if provided.");if(void 0!==o&&"number"!=typeof o)throw new TypeError("`duration` must be a number if provided.");if(void 0!==n&&"string"!=typeof n)throw new TypeError("`easing` must be a string if provided.");if(void 0!==n&&"function"!=typeof W.easings[n])throw new TypeError(`Unknown easing function: "${n}".`);if(void 0!==i&&"function"!=typeof i)throw new TypeError("`onAnimation` must be a function if provided.");const s=(e,t,r,o)=>{if(e instanceof Window)window.scrollTo(t,r);else if(9===e.nodeType)e.defaultView.scrollTo(t,r);else{const o=e instanceof Window?window.scrollX:e.scrollLeft,n=e instanceof Window?window.scrollY:e.scrollTop;o!==t&&(e.scrollLeft=t),n!==r&&(e.scrollTop=r)}"function"==typeof i&&i({x:t,y:r,isComplete:o>=1,time:o})};return W._preElemsAndWindow(e,"scrollToXY").forEach(e=>{const i=e instanceof Window?window.scrollX:e.scrollLeft,l=e instanceof Window?window.scrollY:e.scrollTop,a=t??i,c=r??l,u=a-i,p=c-l,h="string"==typeof n&&W.easings[n]||null;if("number"!=typeof o||"function"!=typeof h)return s(e,a,c,1);const m=performance.now(),d=o??0;requestAnimationFrame(function t(r){if("function"!=typeof h)return;const o=Math.min(1,(r-m)/d),n=h(o);s(e,i+u*n,l+p*n,o),o<1&&requestAnimationFrame(t)})}),e}scrollToXY({targetX:e,targetY:t,duration:r,easing:o,onAnimation:n}={}){return W.scrollToXY(this,{targetX:e,targetY:t,duration:r,easing:o,onAnimation:n})}static setScrollTop(e,t){if("number"!=typeof t)throw new TypeError("ScrollTop value must be a number.");return W.scrollToXY(e,{targetY:t})}setScrollTop(e){return W.setScrollTop(this,e)}static setScrollLeft(e,t){if("number"!=typeof t)throw new TypeError("ScrollLeft value must be a number.");return W.scrollToXY(e,{targetX:t})}setScrollLeft(e){return W.setScrollLeft(this,e)}static borderWidth(e){const t=W._preElem(e,"borderWidth"),{borderLeftWidth:r,borderRightWidth:o,borderTopWidth:n,borderBottomWidth:i}=W.cssFloats(t,["borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"]);return{x:r+o,y:n+i,left:r,right:o,top:n,bottom:i}}borderWidth(){return W.borderWidth(this)}static border(e){const t=W._preElem(e,"border"),{borderLeft:r,borderRight:o,borderTop:n,borderBottom:i}=W.cssFloats(t,["borderLeft","borderRight","borderTop","borderBottom"]);return{x:r+o,y:n+i,left:r,right:o,top:n,bottom:i}}border(){return W.border(this)}static margin(e){const t=W._preElem(e,"margin"),{marginLeft:r,marginRight:o,marginTop:n,marginBottom:i}=W.cssFloats(t,["marginLeft","marginRight","marginTop","marginBottom"]);return{x:r+o,y:n+i,left:r,right:o,top:n,bottom:i}}margin(){return W.margin(this)}static padding(e){const t=W._preElem(e,"padding"),{paddingLeft:r,paddingRight:o,paddingTop:n,paddingBottom:i}=W.cssFloats(t,["paddingLeft","paddingRight","paddingTop","paddingBottom"]);return{x:r+o,y:n+i,left:r,right:o,top:n,bottom:i}}padding(){return W.padding(this)}static addClass(e,...t){return W._preElems(e,"addClass").forEach(e=>e.classList.add(...t)),e}addClass(...e){return W.addClass(this,...e)}static removeClass(e,...t){return W._preElems(e,"removeClass").forEach(e=>e.classList.remove(...t)),e}removeClass(...e){return W.removeClass(this,...e)}static replaceClass(e,t,r){if("string"!=typeof t)throw new TypeError('The "token" parameter must be a string.');if("string"!=typeof r)throw new TypeError('The "newToken" parameter must be a string.');const o=[];return W._preElems(e,"replaceClass").forEach(e=>o.push(e.classList.replace(t,r))),o}replaceClass(e,t){return W.replaceClass(this,e,t)[0]}static classItem(e,t){const r=W._preElem(e,"classItem");if("number"!=typeof t)throw new TypeError('The "index" parameter must be a number.');return r.classList.item(t)}classItem(e){return W.classItem(this,e)}static toggleClass(e,t,r){if("string"!=typeof t)throw new TypeError('The "token" parameter must be a string.');if(void 0!==r&&"boolean"!=typeof r)throw new TypeError('The "force" parameter must be a boolean.');const o=[];return W._preElems(e,"toggleClass").forEach(e=>o.push(e.classList.toggle(t,r))),o}toggleClass(e,t){return W.toggleClass(this,e,t)[0]}static hasClass(e,t){const r=W._preElem(e,"hasClass");if("string"!=typeof t)throw new TypeError('The "token" parameter must be a string.');return r.classList.contains(t)}hasClass(e){return W.hasClass(this,e)}static classLength(e){return W._preElem(e,"classLength").classList.length}classLength(){return W.classLength(this)}static classList(e){return W._preElem(e,"classList").classList.values().toArray()}classList(){return W.classList(this)}static tagName(e){return W._preElem(e,"tagName").tagName}tagName(){return W.tagName(this)}static id(e){return W._preElem(e,"id").id}id(){return W.id(this)}static text(e){return W._preElem(e,"text").textContent}text(){return W.text(this)}static setText(e,t){if("string"!=typeof t)throw new Error("Value is not a valid string.");return W._preElems(e,"setText").forEach(e=>e.textContent=t),e}setText(e){return W.setText(this,e)}static empty(e){return W._preElems(e,"empty").forEach(e=>e.textContent=""),e}empty(){return W.empty(this)}static html(e,t){return W._preElem(e,"html").getHTML(t)}html(e){return W.html(this,e)}static setHtml(e,t){if("string"!=typeof t)throw new Error("Value is not a valid string.");return W._preElems(e,"setHtml").forEach(e=>e.innerHTML=t),e}setHtml(e){return W.setHtml(this,e)}static _valHooks={option:{get:e=>{const t=e.getAttribute("value");return null!=t?t:e.textContent}},select:{get:e=>{const t=e.options,r=e.selectedIndex,o="select-one"===e.type,n=o?r+1:t.length,i=[];let s=r<0?n:o?r:0;for(;s<n;s++){const e=t[s],n=e.parentNode;if((e.selected||s===r)&&!e.disabled&&(!n||!n.disabled||"OPTGROUP"!==n.tagName)){const t=W._valHooks.option.get(e);if(o)return t;i.push(t)}}return i},set:(e,t)=>{const r=e.options,o=Array.isArray(t)?t.map(String):[String(t)];let n=!1;for(let e=0;e<r.length;e++){const t=r[e],i=W._valHooks.option.get(t);"string"==typeof i&&(t.selected=o.includes(i))&&(n=!0)}return n||(e.selectedIndex=-1),o}},radio:{get:e=>e.checked?"on":"off",set(e,t){if("boolean"==typeof t){const r=e.closest("label");return t&&r&&r.querySelectorAll('input[type="radio"]').forEach(t=>{t instanceof HTMLInputElement&&t!==e&&(t.checked=!1)}),e.checked=t,t}}},checkbox:{get:e=>e.checked?"on":"off",set(e,t){if("boolean"==typeof t)return e.checked=t,t}}};static setVal(e,t){return W._preInputElems(e,"setVal").forEach(e=>{if(1!==e.nodeType)return;let r="function"==typeof t?t(e,W.val(e)):t;null==r?r="":"number"==typeof r?r=String(r):Array.isArray(r)&&(r=((e,t)=>{const r=[];for(let o=0;o<e.length;o++)r.push(t(e[o]));return r})(r,e=>null==e?"":String(e)));const o=W._valHooks[e.type]||W._valHooks[e.nodeName.toLowerCase()];if(!o||"function"!=typeof o.set||void 0===o.set(e,r,"value")){if("string"!=typeof r&&"boolean"!=typeof r)throw new Error(`Invalid setValue "${typeof r}" value.`);"string"==typeof r&&(e.value=r)}}),e}setVal(e){return W.setVal(this,e)}static _valTypes={string:e=>e.value,date:e=>e.valueAsDate,number:e=>e.valueAsNumber};static _getValByType(e,t,r){if("string"!=typeof t)throw new TypeError('The "type" must be a string.');if("string"!=typeof r)throw new TypeError('The "where" must be a string.');if(!(e instanceof HTMLInputElement))throw new Error(`Provided element is not an HTMLInputElement in ${r}().`);if("function"!=typeof W._valTypes[t])throw new Error(`No handler found for type "${t}" in ${r}().`);return W._valTypes[t](e)}static _val(e,t,r){const o=W._preInputElem(e,t),n=W._valHooks[o.type]||W._valHooks[o.nodeName.toLowerCase()];if(n&&"function"==typeof n.get){const e=n.get(o,"value",r);if(void 0!==e)return"string"==typeof e?e.replace(/\r/g,""):e}return W._getValByType(o,r,t)}_val(e,t){return W._val(this,e,t)}static val(e){return W._val(e,"val","string")}val(){return W.val(this)}static valTxt(e){const t=W._val(e,"valTxt","string");if("string"!=typeof t&&null!==t)throw new Error("Value is not a valid string.");return null==t?"":"string"==typeof t?t.replace(/\r/g,""):t}valTxt(){return W.valTxt(this)}static _valArr(e,t,r){const o=W._val(e,t,r);if(!Array.isArray(o))throw new Error(`Value expected an array but got ${typeof o}.`);return o}_valArr(e,t){return W._valArr(this,e,t)}static valArr(e){return W._valArr(e,"valArr","string")}valArr(){return W.valArr(this)}static valNb(e){if(!(W._preInputElem(e,"valNb")instanceof HTMLInputElement))throw new Error("Element must be an input element.");const t=W._val(e,"valNb","number");if(Number.isNaN(t))throw new Error("Value is not a valid number.");return t}valNb(){return W.valNb(this)}static valDate(e){if(!(W._preInputElem(e,"valDate")instanceof HTMLInputElement))throw new Error("Element must be an input element.");const t=W._val(e,"valDate","date");if(!(t instanceof Date))throw new Error("Value is not a valid date.");return t}valDate(){return W.valDate(this)}static valBool(e){const t=W._preInputElem(e,"valBool");if(!(t instanceof HTMLInputElement))throw new Error("Element must be an input element.");return"on"===W.val(t)}valBool(){return W.valBool(this)}static listenForPaste(e,{onFilePaste:t,onTextPaste:r}={}){if(void 0!==t&&"function"!=typeof t)throw new TypeError("onFilePaste must be a function.");if(void 0!==r&&"function"!=typeof r)throw new TypeError("onTextPaste must be a function.");const o=e=>{if(!(e instanceof ClipboardEvent))return;const o=e.clipboardData?.items||[];for(const e of o)if("file"===e.kind){if("function"==typeof t){const r=e.getAsFile();r&&t(e,r)}}else"string"===e.kind&&"function"==typeof r&&e.getAsString(t=>r(e,t))};return W._preElemsWithDoc(e,"listenForPaste").forEach(e=>W.on(e,"paste",o)),o}listenForPaste({onFilePaste:e,onTextPaste:t}={}){return W.listenForPaste(this,{onFilePaste:e,onTextPaste:t})}static hasEventListener(e,t){const r=W._preEventTargetElem(e,"hasEventListener");if(!C.has(r))return!1;const o=C.get(r);return!!(o&&Array.isArray(o[t])&&o[t].length>0)}hasEventListener(e){return W.hasEventListener(this,e)}static hasExactEventListener(e,t,r){const o=W._preEventTargetElem(e,"hasExactEventListener");if("function"!=typeof r)throw new TypeError('The "handler" must be a function.');if(!C.has(o))return!1;const n=C.get(o);return!(!n||!Array.isArray(n[t]))&&n[t].some(e=>e.handler===r)}hasExactEventListener(e,t){return W.hasExactEventListener(this,e,t)}static on(e,t,r,o){if("string"!=typeof t)throw new TypeError("The event name must be a string.");return W._preEventTargetElems(e,"on").forEach(e=>{e.addEventListener(t,r,o),C.has(e)||C.set(e,{});const n=C.get(e);n&&(Array.isArray(n[t])||(n[t]=[]),n[t].push({handler:r,options:o}))}),e}on(e,t,r){return W.on(this,e,t,r)}static once(e,t,r,o={}){if("string"!=typeof t)throw new TypeError("The event name must be a string.");return W._preEventTargetElems(e,"once").forEach(e=>{const n=o=>{W.off(e,t,n),"function"==typeof r&&r(o)};W.on(e,t,n,"boolean"==typeof o?o:{...o,once:!0})}),e}once(e,t,r={}){return W.once(this,e,t,r)}static off(e,t,r,o){if("string"!=typeof t)throw new TypeError("The event name must be a string.");return W._preEventTargetElems(e,"off").forEach(e=>{e.removeEventListener(t,r,o);const n=C.get(e);n&&n[t]&&(n[t]=n[t].filter(e=>e.handler!==r),0===n[t].length&&delete n[t])}),e}off(e,t,r){return W.off(this,e,t,r)}static offAll(e,t){if("string"!=typeof t)throw new TypeError("The event name must be a string.");return W._preEventTargetElems(e,"offAll").forEach(e=>{const r=C.get(e);if(r&&r[t]){for(const o of r[t])e.removeEventListener(t,o.handler,o.options);delete r[t]}}),e}offAll(e){return W.offAll(this,e)}static offAllTypes(e,t=null){if(null!==t&&"function"!=typeof t)throw new TypeError('The "filterFn" must be a function.');return W._preEventTargetElems(e,"offAllTypes").forEach(e=>{const r=C.get(e);if(r){for(const o in r)for(const n of r[o])("function"!=typeof t||t(n.handler,o))&&e.removeEventListener(o,n.handler,n.options);C.delete(e)}}),e}offAllTypes(e=null){return W.offAllTypes(this,e)}static trigger(e,t,r={}){if("string"!=typeof t)throw new TypeError("The event name must be a string.");return W._preEventTargetElems(e,"trigger").forEach(e=>{const o=r instanceof Event||r instanceof CustomEvent?r:new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});e.dispatchEvent(o)}),e}trigger(e,t={}){return W.trigger(this,e,t)}static _propFix={for:"htmlFor",class:"className"};static attr(e,t){if("string"!=typeof t)throw new TypeError('The "name" must be a string.');return W._preElem(e,"attr").getAttribute(t)}attr(e){return W.attr(this,e)}static setAttr(e,t,r=null){if("string"!=typeof t)throw new TypeError('The "name" must be a string.');if(null!==r&&"string"!=typeof r)throw new TypeError('The "value" must be a string.');return W._preElems(e,"setAttr").forEach(e=>{null===r?e.removeAttribute(t):e.setAttribute(t,r)}),e}setAttr(e,t){return W.setAttr(this,e,t)}static removeAttr(e,t){if("string"!=typeof t)throw new TypeError('The "name" must be a string.');return W._preElems(e,"removeAttr").forEach(e=>e.removeAttribute(t)),e}removeAttr(e){return W.removeAttr(this,e)}static hasAttr(e,t){if("string"!=typeof t)throw new TypeError('The "name" must be a string.');return W._preElem(e,"hasAttr").hasAttribute(t)}hasAttr(e){return W.hasAttr(this,e)}static hasProp(e,t){if("string"!=typeof t)throw new TypeError('The "name" must be a string.');return!!W._preElem(e,"hasProp")[W._propFix[t]||t]}hasProp(e){return W.hasProp(this,e)}static addProp(e,t){if("string"!=typeof t)throw new TypeError('The "name" must be a string.');return W._preElems(e,"addProp").forEach(e=>{e[t=W._propFix[t]||t]=!0}),e}addProp(e){return W.addProp(this,e)}static removeProp(e,t){if("string"!=typeof t)throw new TypeError('The "name" must be a string.');return W._preElems(e,"removeProp").forEach(e=>{e[t=W._propFix[t]||t]=!1}),e}removeProp(e){return W.removeProp(this,e)}static toggleProp(e,t,r){if("string"!=typeof t)throw new TypeError('The "name" must be a string.');if(void 0!==r&&"boolean"!=typeof r)throw new TypeError('The "force" must be a boolean.');W._preElems(e,"toggleProp").forEach(e=>{const o=W._propFix[t]||t;(void 0===r?!e[o]:r)?W.addProp(e,t):W.removeProp(e,t)})}toggleProp(e,t){return W.toggleProp(this,e,t)}static remove(e){return W._preElems(e,"remove").forEach(e=>e.remove()),e}remove(){return W.remove(this)}static index(e,t=null){const r=W._preElem(e,"index");if(!r)return-1;if(!t)return Array.prototype.indexOf.call(r.parentNode?.children||[],r);if(t){const e="string"==typeof t?document.querySelectorAll(t):W._preElems(t,"index");return Array.prototype.indexOf.call(e,r)}return-1}index(e){return W.index(this,e)}static _getCustomRect(e,t){const r={height:0,width:0,x:0,y:0,bottom:0,left:0,right:0,top:0,toJSON:function(){throw new Error("Function not implemented.")}};for(const t in e)"number"==typeof e[t]&&(r[t]=e[t]);if("object"!=typeof t||null===t||Array.isArray(t))throw new Error("");const{height:o=0,width:n=0,top:i=0,bottom:s=0,left:l=0,right:a=0}=t;if("number"!=typeof o)throw new Error("");if("number"!=typeof n)throw new Error("");if("number"!=typeof i)throw new Error("");if("number"!=typeof s)throw new Error("");if("number"!=typeof l)throw new Error("");if("number"!=typeof a)throw new Error("");return r.height+=o,r.width+=n,r.top+=i,r.bottom+=s,r.left+=l,r.right+=a,r}static isCollWith(e,t,r={}){const o=W._getCustomRect(W._preElem(e,"isCollWith").getBoundingClientRect(),r),n=W._preElem(t,"isCollWith").getBoundingClientRect();return T(o,n)}isCollWith(e,t){return W.isCollWith(this,e,t)}static isCollPerfWith(e,t,r={}){const o=W._getCustomRect(W._preElem(e,"isCollPerfWith").getBoundingClientRect(),r),n=W._preElem(t,"isCollPerfWith").getBoundingClientRect();return v(o,n)}isCollPerfWith(e,t){return W.isCollPerfWith(this,e,t)}static _isCollWithLock(e,t,r,o,n){const i=k[n];if(e)return i.has(o)||i.set(o,!0),!0;if(i.has(o)){let e=!1;switch(n){case"top":e=S(t,r);break;case"bottom":e=_(t,r);break;case"left":e=A(t,r);break;case"right":e=L(t,r)}return e&&i.delete(o),i.has(o)}return!1}static isCollWithLock(e,t,r,o={}){const n=W._preElem(e,"isCollWithLock"),i=W._preElem(t,"isCollWithLock"),s=W._getCustomRect(n.getBoundingClientRect(),o),l=i.getBoundingClientRect(),a=T(s,l);return W._isCollWithLock(a,s,l,n,r)}isCollWithLock(e,t,r){return W.isCollWithLock(this,e,t,r)}static isCollPerfWithLock(e,t,r,o={}){const n=W._preElem(e,"isCollPerfWithLock"),i=W._preElem(t,"isCollPerfWithLock"),s=W._getCustomRect(n.getBoundingClientRect(),o),l=i.getBoundingClientRect(),a=v(s,l);return W._isCollWithLock(a,s,l,n,r)}isCollPerfWithLock(e,t,r){return W.isCollPerfWithLock(this,e,t,r)}static resetCollLock(e){const t=W._preElem(e,"resetCollLock");let r=!1;for(const e of["top","bottom","left","right"])k[e].has(t)&&(k[e].delete(t),r=!0);return r}resetCollLock(){return W.resetCollLock(this)}static resetCollLockDir(e,t){const r=W._preElem(e,"resetCollLockDir"),o=k[t];return!!o.has(r)&&(o.delete(r),!0)}resetCollLockDir(e){return W.resetCollLockDir(this,e)}static isInViewport(e){const t=W._preElem(e,"isInViewport");if(!t.checkVisibility({contentVisibilityAuto:!1,opacityProperty:!1,visibilityProperty:!1}))return!1;const r=W.offset(t).top,o=r+W.outerHeight(t),n=W.scrollTop(window),i=n+W.height(window);return o>n&&r<i}isInViewport(){return W.isInViewport(this)}static isScrolledIntoView(e){const t=W._preElem(e,"isScrolledIntoView");if(!t.checkVisibility({contentVisibilityAuto:!1,opacityProperty:!1,visibilityProperty:!1}))return!1;const r=W.scrollTop(window),o=r+W.height(window),n=W.offset(t).top;return n+W.height(t)<=o&&n>=r}isScrolledIntoView(){return W.isScrolledIntoView(this)}static isInContainer(e,t){const r=W._preElem(e,"isInContainer"),o=W._preElem(t,"isInContainer");if(!r.checkVisibility({contentVisibilityAuto:!1,opacityProperty:!1,visibilityProperty:!1}))return!1;const n=r.getBoundingClientRect(),i=o.getBoundingClientRect(),s=n.bottom>i.top&&n.top<i.bottom,l=n.right>i.left&&n.left<i.right;return s&&l}isInContainer(e){return W.isInContainer(this,e)}static isFullyInContainer(e,t){const r=W._preElem(e,"isScrolledIntoView"),o=W._preElem(t,"isInContainer");if(!r.checkVisibility({contentVisibilityAuto:!1,opacityProperty:!1,visibilityProperty:!1}))return!1;const n=r.getBoundingClientRect(),i=o.getBoundingClientRect();return n.top>=i.top&&n.bottom<=i.bottom&&n.left>=i.left&&n.right<=i.right}isFullyInContainer(e){return W.isFullyInContainer(this,e)}static hasScroll(e){const t=W._preElem(e,"hasScroll");return{v:t.scrollHeight>t.clientHeight,h:t.scrollWidth>t.clientWidth}}hasScroll(){return W.hasScroll(this)}}const B=W,P=class{#r=new Map;#o=10;#n=!1;setThrowOnMaxListeners(e){if("boolean"!=typeof e)throw new TypeError("setThrowOnMaxListeners(value): value must be a boolean");this.#n=e}getThrowOnMaxListeners(){return this.#n}#i(e,t,{once:r=!1}={}){let o=this.#r.get(e);Array.isArray(o)||(o=[],this.#r.set(e,o)),o.unshift({handler:t,config:{once:r}});const n=this.#o;if(n>0&&o.length>n){const t=`Possible memory leak detected. ${o.length} "${e}" listeners added. Use setMaxListeners() to increase limit.`;if(this.#n)throw new Error(t);console.warn(t)}}prependListener(e,t){if("string"!=typeof e)throw new TypeError("prepend(event, handler): event name must be a string");if("function"!=typeof t)throw new TypeError("prepend(event, handler): handler must be a function");this.#i(e,t)}prependListenerOnce(e,t){if("string"!=typeof e)throw new TypeError("prependOnceListener(event, handler): event name must be a string");if("function"!=typeof t)throw new TypeError("prependOnceListener(event, handler): handler must be a function");const r=(...o)=>{this.off(e,r),t(...o)};return this.#i(e,r,{once:!0}),r}#s(e,t,{once:r=!1}={}){let o=this.#r.get(e);Array.isArray(o)||(o=[],this.#r.set(e,o)),o.push({handler:t,config:{once:r}});const n=this.#o;if(n>0&&o.length>n){const t=`Possible memory leak detected. ${o.length} "${e}" listeners added. Use setMaxListeners() to increase limit.`;if(this.#n)throw new Error(t);console.warn(t)}}on(e,t){if("string"!=typeof e)throw new TypeError("on(event, handler): event name must be a string");if("function"!=typeof t)throw new TypeError("on(event, handler): handler must be a function");return this.#s(e,t)}once(e,t){if("string"!=typeof e)throw new TypeError("The event name must be a string.");if("function"!=typeof t)throw new TypeError("once(event, handler): handler must be a function");const r=o=>{this.off(e,r),"function"==typeof t&&t(o)};return this.#s(e,r,{once:!0}),r}appendListener(e,t){return this.on(e,t)}appendListenerOnce(e,t){return this.once(e,t)}off(e,t){if("string"!=typeof e)throw new TypeError("off(event, handler): event name must be a string");if("function"!=typeof t)throw new TypeError("off(event, handler): handler must be a function");const r=this.#r.get(e);if(!Array.isArray(r))return;const o=r.findIndex(e=>e.handler===t);-1!==o&&r.splice(o,1),0===r.length&&this.#r.delete(e)}offAll(e){if("string"!=typeof e)throw new TypeError("The event name must be a string.");this.#r.delete(e)}offAllTypes(){this.#r.clear()}listenerCount(e){if("string"!=typeof e)throw new TypeError("listenerCount(event): event name must be a string");const t=this.#r.get(e);return Array.isArray(t)?t.length:0}listeners(e){if("string"!=typeof e)throw new TypeError("listeners(event): event name must be a string");const t=this.#r.get(e);return Array.isArray(t)?[...t].filter(e=>!e.config.once).map(e=>e.handler):[]}onceListeners(e){if("string"!=typeof e)throw new TypeError("onceListeners(event): event name must be a string");const t=this.#r.get(e);return Array.isArray(t)?[...t].filter(e=>e.config.once).map(e=>e.handler):[]}allListeners(e){if("string"!=typeof e)throw new TypeError("allListeners(event): event name must be a string");const t=this.#r.get(e);return Array.isArray(t)?[...t].map(e=>e.handler):[]}eventNames(){return[...this.#r.keys()]}emit(e,...t){if("string"!=typeof e)throw new TypeError("emit(event, data): event name must be a string");const r=this.#r.get(e);return!(!Array.isArray(r)||0===r.length||(r.forEach(e=>e.handler(...t)),0))}setMaxListeners(e){if(!Number.isInteger(e)||e<0)throw new TypeError("setMaxListeners(n): n must be a non-negative integer");this.#o=e}getMaxListeners(){return this.#o}};class M{static Utils={...r,TinyHtml:B};#l=new P;setThrowOnMaxListeners(e){return this.#l.setThrowOnMaxListeners(e)}getThrowOnMaxListeners(){return this.#l.getThrowOnMaxListeners()}prependListener(e,t){return this.#l.prependListener(e,t)}prependListenerOnce(e,t){return this.#l.prependListenerOnce(e,t)}appendListener(e,t){return this.#l.appendListener(e,t)}appendListenerOnce(e,t){return this.#l.appendListenerOnce(e,t)}on(e,t){return this.#l.on(e,t)}once(e,t){return this.#l.once(e,t)}off(e,t){return this.#l.off(e,t)}offAll(e){return this.#l.offAll(e)}offAllTypes(){return this.#l.offAllTypes()}listenerCount(e){return this.#l.listenerCount(e)}listeners(e){return this.#l.listeners(e)}onceListeners(e){return this.#l.onceListeners(e)}allListeners(e){return this.#l.allListeners(e)}eventNames(){return this.#l.eventNames()}emit(e,...t){return this.#l.emit(e,...t)}setMaxListeners(e){return this.#l.setMaxListeners(e)}getMaxListeners(){return this.#l.getMaxListeners()}#a=new WeakMap;#c=new WeakMap;#u=new WeakMap;#p=new WeakMap;#h=new WeakMap;#m=new WeakMap;#d=null;#f=null;#g=new Set(["IMG","IFRAME","VIDEO"]);#y=null;#b=!1;#w=!1;#E=!1;#T=!1;#v="";#S=!1;#_=!1;#A=!1;#L=!1;#C=!1;#x=!1;#k=0;#W=0;#B=0;#P=0;#M=0;#N;#H;#O=new Set;constructor(e,{extraScrollBoundary:t=0,autoScrollBottom:r=!0,observeMutations:o=!0,preserveScrollOnLayoutShift:n=!0,debounceTime:i=100,querySelector:s=null,attributeFilter:l=["class","style","src","data-*","height","width"]}={}){if(!(e instanceof Element||e===window))throw new TypeError("TinySmartScroller: 'target' must be a DOM Element or 'window', but got "+typeof e);if("number"!=typeof t||Number.isNaN(t))throw new TypeError(`TinySmartScroller: 'extraScrollBoundary' must be a valid number, received ${t}`);if("boolean"!=typeof r)throw new TypeError("TinySmartScroller: 'autoScrollBottom' must be a boolean, received "+typeof r);if("boolean"!=typeof o)throw new TypeError("TinySmartScroller: 'observeMutations' must be a boolean, received "+typeof o);if("boolean"!=typeof n)throw new TypeError("TinySmartScroller: 'preserveScrollOnLayoutShift' must be a boolean, received "+typeof n);if("number"!=typeof i||i<0||Number.isNaN(i))throw new TypeError(`TinySmartScroller: 'debounceTime' must be a non-negative number, received ${i}`);if(null!==s&&"string"!=typeof s)throw new TypeError("TinySmartScroller: 'querySelector' must be a string or null, received "+typeof s);if(!(null===l||Array.isArray(l)||l instanceof Set))throw new TypeError("TinySmartScroller: 'attributeFilter' must be an array, Set, or null. Got "+typeof l);let a;this.#H=e instanceof Window?document.documentElement:e,this.#S=e instanceof Window,this.#L=r,this.#C=o,this.#x=n,this.#k=i,this.#M=t,this.#v=s||"",this.#N=new Set(l||void 0),this.#y=()=>{this._scrollDataUpdater(),clearTimeout(a),a=setTimeout(()=>this._onScroll(),this.#k)},(this.#S?window:this.#H).addEventListener("scroll",this.#y,{passive:!0}),this.#C&&(this._observeMutations(),this._observeResizes(this.#H.children)),this._scrollDataUpdater()}getSimpleOnHeight(e=[]){if(!Array.isArray(e))throw new TypeError("getSimpleOnHeight(filter): filter must be an array of tag names");return(t,r,o)=>{if(e.length>0&&!e.includes(t.tagName)||o.now!==o.old)return;const n=r.old;return{height:r.now.height-n.height,width:0}}}addSimpleOnHeight(e){if(!Array.isArray(e))throw new TypeError("addSimpleOnHeight(filter): filter must be an array of tag names");const t=this.getSimpleOnHeight(e);return this.onSize(t),t}getLoadTags(){return Array.from(this.#g)}addLoadTag(e){if("string"!=typeof e)throw new TypeError("addLoadTag(tag): tag must be a string");this.#g.add(e.toUpperCase())}removeLoadTag(e){if("string"!=typeof e)throw new TypeError("removeLoadTag(tag): tag must be a string");this.#g.delete(e.toUpperCase())}hasLoadTag(e){if("string"!=typeof e)throw new TypeError("hasLoadTag(tag): tag must be a string");return this.#g.has(e.toUpperCase())}resetLoadTags(e=!1){if("boolean"!=typeof e)throw new TypeError("resetLoadTags(addDefault): addDefault must be a boolean");this.#g.clear(),e&&(this.#g.add("IMG"),this.#g.add("IFRAME"),this.#g.add("VIDEO"))}getAttributeFilters(){return Array.from(this.#N)}addAttributeFilter(e){if("string"!=typeof e)throw new TypeError("addAttributeFilter(attr): attr must be a string");this.#N.add(e)}removeAttributeFilter(e){if("string"!=typeof e)throw new TypeError("removeAttributeFilter(attr): attr must be a string");this.#N.delete(e)}hasAttributeFilter(e){if("string"!=typeof e)throw new TypeError("hasAttributeFilter(attr): attr must be a string");return this.#N.has(e)}resetAttributeFilters(e=!1){if("boolean"!=typeof e)throw new TypeError("resetAttributeFilters(addDefault): addDefault must be a boolean");this.#N.clear(),e&&["class","style","src","data-*","height","width"].forEach(e=>this.#N.add(e))}onSize(e){if(!this.#_){if("function"!=typeof e)throw new TypeError("onSize(handler): handler must be a function");this.#O.add(e)}}offSize(e){if(!this.#_){if("function"!=typeof e)throw new TypeError("offSize(handler): handler must be a function");this.#O.delete(e)}}_scrollDataUpdater(){const e=new Map;return this.#H.querySelectorAll(this.#v||"*").forEach(t=>{const r=this.#u.get(t)??!1;this.#p.set(t,r);const o=B.isInContainer(this.#H,t);this.#u.set(t,o),e.set(t,{oldIsVisible:r,isVisible:o})}),e}_emit(e,t){this.emit(e,t)}_onScroll(){if(this.#_)return;const e=this._scrollDataUpdater(),t=this.#H,r=t.scrollTop,o=t.scrollHeight,n=t.clientHeight,i={scrollTop:r,scrollHeight:o,clientHeight:n};let s=null,l=null;const a=0===r,c=r+n>=o-1,u=r<=0+this.#M,p=r+n>=o-1-this.#M;a&&c?s="all":a?s="top":c&&(s="bottom"),u&&p?l="all":u?l="top":p&&(l="bottom"),this.#w=a,this.#b=c,this.#E=u,this.#T=p,this.#A=!(this.#L&&this.#b),this.#P=o-r-n,this.emit("onScrollBoundary",{status:s,...i,scrollCache:e}),this.emit("onExtraScrollBoundary",{status:l,...i,scrollCache:e}),this.#A?this.emit("onScrollPause",{...i,scrollCache:e}):this.emit("onAutoScroll",{...i,scrollCache:e})}_fixScroll(e=[]){if(this.#_)return;if(!Array.isArray(e))throw new TypeError("_fixScroll: targets must be an array of Elements");const t=this.#H.scrollHeight,r=this.#H.scrollTop,o=this.#H.scrollHeight-this.#H.scrollTop-this.#H.clientHeight,n=this.#H.scrollHeight-t,i=()=>{const t={height:0,width:0};for(const r of e){const e=this.#a.get(r)||{height:0,width:0},o=this.#c.get(r)||{height:0,width:0};this.#O.forEach(n=>{const i=n(r,{old:e,now:o},{old:this.#B,now:this.#W});if(this.#u.get(r)||this.#h.get(r)){if(void 0!==i&&"object"!=typeof i)throw new Error("_fixScroll: size filter must return an object or undefined");if(void 0===i)return;t.height=i.height,t.width=i.width}})}if("number"!=typeof t.height&&t.height<0)throw new Error("_fixScroll: invalid scrollSize.height value");if("number"!=typeof t.width&&t.width<0)throw new Error("_fixScroll: invalid scrollSize.width value");if(0!==t.height||0!==t.width)for(const t of e)this.#h.set(t,this.#u.get(t)??!1),this.#m.set(t,this.#p.get(t)??!1);return t};if(this.#B>0&&B.hasScroll(this.#H).v&&this.#L&&this.#x&&!this.#b&&!this.#w){const e=i();this.#H.scrollTop=r+n+e.height,e.width>0&&(this.#H.scrollLeft=this.#H.scrollLeft+e.width)}else!this.#A&&this.#L?(i(),this.scrollToBottom()):this.#L||this.#b||(i(),this.#H.scrollTop=this.#H.scrollHeight-this.#H.clientHeight-o)}_observeMutations(){this.#f=new MutationObserver(e=>{this.#_||(this._scrollDataUpdater(),this.#B=this.#W,this.#W=this.#H.childElementCount,e.forEach(e=>{e.addedNodes.forEach(e=>{if(e instanceof Element&&1===e.nodeType&&(this._observeResizes([e]),this._listenLoadEvents(e),this.#v)){const t=e.querySelectorAll(this.#v);this._observeResizes(t),this._listenLoadEvents(t)}})}),this._fixScroll())}),this.#f.observe(this.#H,{childList:!0,subtree:!0,attributes:!0,attributeFilter:this.#N.size>0?Array.from(this.#N):void 0})}_observeResizes(e){this.#d||(this.#d=new ResizeObserver(e=>{if(this.#_)return;this._scrollDataUpdater();const t=[];for(const r of e){const e=r.target,o=this.#c.get(e);o&&this.#a.set(e,o);const{width:n,height:i}=r.contentRect;this.#c.set(e,{width:n,height:i}),t.push(e)}this._fixScroll(t)})),Array.from(e).forEach(e=>{if(!this.#d)throw new Error("_observeResizes: ResizeObserver instance is not initialized");this.#d.observe(e)})}_listenLoadEvents(e){this.#_||(e instanceof NodeList?Array.from(e):[e]).forEach(e=>{this.#g.has(e.tagName)&&(e.complete||e.addEventListener("load",()=>{this._scrollDataUpdater(),!this.#A&&this.#L&&this.scrollToBottom()}))})}get target(){return this.#H}getOldSize(e){return this.#a.get(e)??null}getNewSize(e){return this.#c.get(e)??null}wasVisible(e){return this.#p.get(e)??!1}isVisible(e){return this.#u.get(e)??!1}wasTimedVisible(e){return this.#m.get(e)??!1}isTimedVisible(e){return this.#h.get(e)??!1}setExtraScrollBoundary(e){if("number"!=typeof e||Number.isNaN(e))throw new TypeError("setExtraScrollBoundary(value): value must be a valid number");this.#M=e}getExtraScrollBoundary(){return this.#M}getLastKnownScrollBottomOffset(){return this.#P}scrollToBottom(){this.#H.scrollTop=this.#H.scrollHeight}scrollToTop(){this.#H.scrollTop=0}isUserAtCustomBottom(){return this.#T}isUserAtCustomTop(){return this.#E}isUserAtBottom(){return this.#b}isUserAtTop(){return this.#w}isScrollPaused(){return this.#A}isWindow(){return this.#S}isDestroyed(){return this.#_}getAutoScrollBottom(){return this.#L}getObserveMutations(){return this.#C}getPreserveScrollOnLayoutShift(){return this.#x}getDebounceTime(){return this.#k}getElemAmount(){return this.#W}getPrevElemAmount(){return this.#B}getQuerySelector(){return this.#v}destroy(){if(this.#_)return;this.#_=!0,this.#f&&(this.#f.disconnect(),this.#f=null),this.#d&&(this.#d.disconnect(),this.#d=null);const e=this.#S?window:this.#H;this.#y&&e.removeEventListener("scroll",this.#y),this.#a=new WeakMap,this.#c=new WeakMap,this.#u=new WeakMap,this.#p=new WeakMap,this.#h=new WeakMap,this.#m=new WeakMap,this.#l.offAllTypes(),this.#O.clear(),this.#g.clear()}}const N=M;window.TinySmartScroller=t.TinySmartScroller})();
@@ -1 +1 @@
1
- (()=>{"use strict";var e={d:(t,r)=>{for(var s in r)e.o(r,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:r[s]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},t={};e.d(t,{TinyTextRangeEditor:()=>r});const r=class{#e;#t;#r;constructor(e,{openTag:t="[",closeTag:r="]"}={}){if(!(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement))throw new TypeError("Element must be an input or textarea.");if("string"!=typeof t)throw new TypeError("openTag must be a string.");if("string"!=typeof r)throw new TypeError("closeTag must be a string.");this.#e=e,this.#t=t,this.#r=r}getOpenTag(){return this.#t}getCloseTag(){return this.#r}setOpenTag(e){if("string"!=typeof e)throw new TypeError("Open tag must be a string.");this.#t=e}setCloseTag(e){if("string"!=typeof e)throw new TypeError("Close tag must be a string.");this.#r=e}ensureFocus(){return document.activeElement!==this.#e&&this.#e.focus(),this}focus(){return this.#e.focus(),this}getSelectionRange(){return{start:this.#e.selectionStart??NaN,end:this.#e.selectionEnd??NaN}}setSelectionRange(e,t,r=!0){if("number"!=typeof e||"number"!=typeof t)throw new TypeError("start and end must be numbers.");if("boolean"!=typeof r)throw new TypeError("preserveScroll must be a boolean.");const s=this.#e.scrollTop,n=this.#e.scrollLeft;return this.#e.setSelectionRange(e,t),r&&(this.#e.scrollTop=s,this.#e.scrollLeft=n),this}getValue(){return this.#e.value}setValue(e){if("string"!=typeof e)throw new TypeError("Value must be a string.");return this.#e.value=e,this}getSelectedText(){const{start:e,end:t}=this.getSelectionRange();return this.#e.value.slice(e,t)}insertText(e,{newCursor:t="end",autoSpacing:r=!1,autoSpaceLeft:s=r,autoSpaceRight:n=r}={}){if("string"!=typeof e)throw new TypeError("Text must be a string.");if(!["start","end","preserve"].includes(t))throw new TypeError("newCursor must be one of 'start', 'end', or 'preserve'.");if("boolean"!=typeof r)throw new TypeError("autoSpacing must be a boolean.");if("boolean"!=typeof s)throw new TypeError("autoSpaceLeft must be a boolean.");if("boolean"!=typeof n)throw new TypeError("autoSpaceRight must be a boolean.");const{start:i,end:o}=this.getSelectionRange(),a=this.#e.value,l=a[i-1]||"",h=a[o]||"",g=`${s&&l&&!/\s/.test(l)?" ":""}${e}${n&&h&&!/\s/.test(h)?" ":""}`,c=a.slice(0,i)+g+a.slice(o);this.setValue(c);let p=i;return"end"===t?p=i+g.length:"preserve"===t&&(p=i),this.setSelectionRange(p,p),this}deleteSelection(){return this.insertText(""),this}transformSelection(e){if("function"!=typeof e)throw new TypeError("transformer must be a function.");const{start:t}=this.getSelectionRange(),r=e(this.getSelectedText());return this.insertText(r),this.setSelectionRange(t,t+r.length),this}surroundSelection(e,t){if("string"!=typeof e||"string"!=typeof t)throw new TypeError("prefix and suffix must be strings.");const r=this.getSelectedText();return this.insertText(`${e}${r}${t}`),this}moveCaret(e){if("number"!=typeof e)throw new TypeError("offset must be a number.");const{start:t}=this.getSelectionRange(),r=Math.max(0,t+e);return this.setSelectionRange(r,r),this}selectAll(){return this.setSelectionRange(0,this.#e.value.length),this}expandSelection(e,t){if("number"!=typeof e||"number"!=typeof t)throw new TypeError("before and after must be numbers.");const{start:r,end:s}=this.getSelectionRange(),n=Math.max(0,r-e),i=Math.min(this.#e.value.length,s+t);return this.setSelectionRange(n,i),this}replaceAll(e,t){if(!(e instanceof RegExp))throw new TypeError("regex must be a RegExp.");if("function"!=typeof t)throw new TypeError("replacer must be a function.");const r=this.#e.value.replace(e,t);return this.setValue(r),this}replaceInSelection(e,t){if(!(e instanceof RegExp))throw new TypeError("regex must be a RegExp.");if("function"!=typeof t)throw new TypeError("replacer must be a function.");const{start:r,end:s}=this.getSelectionRange(),n=this.#e.value,i=n.slice(r,s).replace(e,t),o=n.slice(0,r)+i+n.slice(s);return this.setValue(o),this.setSelectionRange(r,r+i.length),this}toggleCode(e){if("string"!=typeof e)throw new TypeError("codeName must be a string.");const t=this.getSelectedText();if(t.startsWith(e)&&t.endsWith(e)){const r=t.slice(e.length,t.length-e.length);this.insertText(r)}else this.insertText(`${e}${t}${e}`);return this}_insertAttr(e){let t="";if(Array.isArray(e)){if(!e.every((e=>"string"==typeof e)))throw new TypeError("All entries in attributes array must be strings.");t=e.map((e=>`${e}`)).join(" ")}else{if("object"!=typeof e||null===e)throw new TypeError("attributes must be an object or an array of strings.");t=Object.entries(e).map((([e,t])=>{if("string"!=typeof t)throw new TypeError("All entries in attributes object must be strings.");return`${e}${t.length>0?`="${t}"`:""}`})).join(" ")}return t}wrapWithTag(e,t={}){if("string"!=typeof e)throw new TypeError("tagName must be a string.");const r=this._insertAttr(t),s=r?`${this.#t}${e} ${r}${this.#r}`:`${this.#t}${e}${this.#r}`,n=`${this.#t}/${e}${this.#r}`;return this.surroundSelection(s,n),this}insertTag(e,t="",r={}){if("string"!=typeof e)throw new TypeError("tagName must be a string.");if("string"!=typeof t)throw new TypeError("content must be a string.");const s=this._insertAttr(r),n=s?`${this.#t}${e} ${s}${this.#r}`:`${this.#t}${e}${this.#r}`,i=`${this.#t}/${e}${this.#r}`;return this.insertText(`${n}${t}${i}`),this}insertSelfClosingTag(e,t={}){if("string"!=typeof e)throw new TypeError("tagName must be a string.");const r=this._insertAttr(t),s=r?`${this.#t}${e} ${r}${this.#r}`:`${this.#t}${e}${this.#r}`;return this.insertText(s),this}toggleTag(e,t={}){if("string"!=typeof e)throw new TypeError("tagName must be a string.");const r=this.getSelectedText(),s=new RegExp(`^\\[${e}(\\s+[^\\]]*)?\\]`),n=new RegExp(`\\[/${e}\\]$`),i=s.test(r),o=n.test(r);if(i&&o){const e=r.replace(s,"").replace(n,"");this.insertText(e)}else{const s=this._insertAttr(t),n=s?`${this.#t}${e} ${s}${this.#r}`:`${this.#t}${e}${this.#r}`,i=`${this.#t}/${e}${this.#r}`;this.insertText(`${n}${r}${i}`)}return this}};window.TinyTextRangeEditor=t.TinyTextRangeEditor})();
1
+ (()=>{"use strict";var e={d:(t,r)=>{for(var s in r)e.o(r,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:r[s]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},t={};e.d(t,{TinyTextRangeEditor:()=>r});const r=class{#e;#t;#r;constructor(e,{openTag:t="[",closeTag:r="]"}={}){if(!(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement))throw new TypeError("Element must be an input or textarea.");if("string"!=typeof t)throw new TypeError("openTag must be a string.");if("string"!=typeof r)throw new TypeError("closeTag must be a string.");this.#e=e,this.#t=t,this.#r=r}getOpenTag(){return this.#t}getCloseTag(){return this.#r}setOpenTag(e){if("string"!=typeof e)throw new TypeError("Open tag must be a string.");this.#t=e}setCloseTag(e){if("string"!=typeof e)throw new TypeError("Close tag must be a string.");this.#r=e}ensureFocus(){return document.activeElement!==this.#e&&this.#e.focus(),this}focus(){return this.#e.focus(),this}getSelectionRange(){return{start:this.#e.selectionStart??NaN,end:this.#e.selectionEnd??NaN}}setSelectionRange(e,t,r=!0){if("number"!=typeof e||"number"!=typeof t)throw new TypeError("start and end must be numbers.");if("boolean"!=typeof r)throw new TypeError("preserveScroll must be a boolean.");const s=this.#e.scrollTop,n=this.#e.scrollLeft;return this.#e.setSelectionRange(e,t),r&&(this.#e.scrollTop=s,this.#e.scrollLeft=n),this}getValue(){return this.#e.value}setValue(e){if("string"!=typeof e)throw new TypeError("Value must be a string.");return this.#e.value=e,this}getSelectedText(){const{start:e,end:t}=this.getSelectionRange();return this.#e.value.slice(e,t)}insertText(e,{newCursor:t="end",autoSpacing:r=!1,autoSpaceLeft:s=r,autoSpaceRight:n=r}={}){if("string"!=typeof e)throw new TypeError("Text must be a string.");if(!["start","end","preserve"].includes(t))throw new TypeError("newCursor must be one of 'start', 'end', or 'preserve'.");if("boolean"!=typeof r)throw new TypeError("autoSpacing must be a boolean.");if("boolean"!=typeof s)throw new TypeError("autoSpaceLeft must be a boolean.");if("boolean"!=typeof n)throw new TypeError("autoSpaceRight must be a boolean.");const{start:i,end:o}=this.getSelectionRange(),a=this.#e.value,l=a[i-1]||"",h=a[o]||"",g=`${s&&l&&!/\s/.test(l)?" ":""}${e}${n&&h&&!/\s/.test(h)?" ":""}`,c=a.slice(0,i)+g+a.slice(o);this.setValue(c);let p=i;return"end"===t?p=i+g.length:"preserve"===t&&(p=i),this.setSelectionRange(p,p),this}deleteSelection(){return this.insertText(""),this}transformSelection(e){if("function"!=typeof e)throw new TypeError("transformer must be a function.");const{start:t}=this.getSelectionRange(),r=e(this.getSelectedText());return this.insertText(r),this.setSelectionRange(t,t+r.length),this}surroundSelection(e,t){if("string"!=typeof e||"string"!=typeof t)throw new TypeError("prefix and suffix must be strings.");const r=this.getSelectedText();return this.insertText(`${e}${r}${t}`),this}moveCaret(e){if("number"!=typeof e)throw new TypeError("offset must be a number.");const{start:t}=this.getSelectionRange(),r=Math.max(0,t+e);return this.setSelectionRange(r,r),this}selectAll(){return this.setSelectionRange(0,this.#e.value.length),this}expandSelection(e,t){if("number"!=typeof e||"number"!=typeof t)throw new TypeError("before and after must be numbers.");const{start:r,end:s}=this.getSelectionRange(),n=Math.max(0,r-e),i=Math.min(this.#e.value.length,s+t);return this.setSelectionRange(n,i),this}replaceAll(e,t){if(!(e instanceof RegExp))throw new TypeError("regex must be a RegExp.");if("function"!=typeof t)throw new TypeError("replacer must be a function.");const r=this.#e.value.replace(e,t);return this.setValue(r),this}replaceInSelection(e,t){if(!(e instanceof RegExp))throw new TypeError("regex must be a RegExp.");if("function"!=typeof t)throw new TypeError("replacer must be a function.");const{start:r,end:s}=this.getSelectionRange(),n=this.#e.value,i=n.slice(r,s).replace(e,t),o=n.slice(0,r)+i+n.slice(s);return this.setValue(o),this.setSelectionRange(r,r+i.length),this}toggleCode(e){if("string"!=typeof e)throw new TypeError("codeName must be a string.");const t=this.getSelectedText();if(t.startsWith(e)&&t.endsWith(e)){const r=t.slice(e.length,t.length-e.length);this.insertText(r)}else this.insertText(`${e}${t}${e}`);return this}_insertAttr(e){let t="";if(Array.isArray(e)){if(!e.every(e=>"string"==typeof e))throw new TypeError("All entries in attributes array must be strings.");t=e.map(e=>`${e}`).join(" ")}else{if("object"!=typeof e||null===e)throw new TypeError("attributes must be an object or an array of strings.");t=Object.entries(e).map(([e,t])=>{if("string"!=typeof t)throw new TypeError("All entries in attributes object must be strings.");return`${e}${t.length>0?`="${t}"`:""}`}).join(" ")}return t}wrapWithTag(e,t={}){if("string"!=typeof e)throw new TypeError("tagName must be a string.");const r=this._insertAttr(t),s=r?`${this.#t}${e} ${r}${this.#r}`:`${this.#t}${e}${this.#r}`,n=`${this.#t}/${e}${this.#r}`;return this.surroundSelection(s,n),this}insertTag(e,t="",r={}){if("string"!=typeof e)throw new TypeError("tagName must be a string.");if("string"!=typeof t)throw new TypeError("content must be a string.");const s=this._insertAttr(r),n=s?`${this.#t}${e} ${s}${this.#r}`:`${this.#t}${e}${this.#r}`,i=`${this.#t}/${e}${this.#r}`;return this.insertText(`${n}${t}${i}`),this}insertSelfClosingTag(e,t={}){if("string"!=typeof e)throw new TypeError("tagName must be a string.");const r=this._insertAttr(t),s=r?`${this.#t}${e} ${r}${this.#r}`:`${this.#t}${e}${this.#r}`;return this.insertText(s),this}toggleTag(e,t={}){if("string"!=typeof e)throw new TypeError("tagName must be a string.");const r=this.getSelectedText(),s=new RegExp(`^\\[${e}(\\s+[^\\]]*)?\\]`),n=new RegExp(`\\[/${e}\\]$`),i=s.test(r),o=n.test(r);if(i&&o){const e=r.replace(s,"").replace(n,"");this.insertText(e)}else{const s=this._insertAttr(t),n=s?`${this.#t}${e} ${s}${this.#r}`:`${this.#t}${e}${this.#r}`,i=`${this.#t}/${e}${this.#r}`;this.insertText(`${n}${r}${i}`)}return this}};window.TinyTextRangeEditor=t.TinyTextRangeEditor})();
@@ -0,0 +1,233 @@
1
+ /******/ (() => { // webpackBootstrap
2
+ /******/ "use strict";
3
+ /******/ // The require scope
4
+ /******/ var __webpack_require__ = {};
5
+ /******/
6
+ /************************************************************************/
7
+ /******/ /* webpack/runtime/define property getters */
8
+ /******/ (() => {
9
+ /******/ // define getter functions for harmony exports
10
+ /******/ __webpack_require__.d = (exports, definition) => {
11
+ /******/ for(var key in definition) {
12
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
13
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
14
+ /******/ }
15
+ /******/ }
16
+ /******/ };
17
+ /******/ })();
18
+ /******/
19
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
20
+ /******/ (() => {
21
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
22
+ /******/ })();
23
+ /******/
24
+ /************************************************************************/
25
+ var __webpack_exports__ = {};
26
+
27
+ // EXPORTS
28
+ __webpack_require__.d(__webpack_exports__, {
29
+ TinyTimeout: () => (/* reexport */ libs_TinyTimeout)
30
+ });
31
+
32
+ ;// ./src/v1/libs/TinyTimeout.mjs
33
+ /**
34
+ * A utility class to manage dynamically adjusted timeouts based on how often
35
+ * each unique ID is triggered. Also provides polling support for asynchronous conditions.
36
+ */
37
+ class TinyTimeout {
38
+ /** @type {boolean} Whether this instance has been destroyed. */
39
+ #isDestroyed = false;
40
+
41
+ /** @type {boolean} Whether to allow auto-updating an ID's timeout config if `value` changes. */
42
+ #allowAutoConfigChange;
43
+
44
+ /** @type {number} The interval time (ms) used to decrement cooldown counters. */
45
+ #cooldownWatcherTime;
46
+
47
+ /** @type {NodeJS.Timeout|null} Reference to the internal cooldown interval. */
48
+ #cooldownWatcher = null;
49
+
50
+ /**
51
+ * Internal map that keeps track of how many times each ID has been triggered,
52
+ * along with the base multiplier used to calculate delays.
53
+ *
54
+ * @type {Map<string, { value: number, now: number }>}
55
+ */
56
+ #timeoutFixer = new Map();
57
+
58
+ /**
59
+ * Creates a new instance of TinyTimeout.
60
+ *
61
+ * @param {Object} [options={}] Optional configuration object.
62
+ * @param {number} [options.cooldownWatcherTime=5000] Interval in milliseconds for reducing `now` counters.
63
+ * @param {boolean} [options.allowAutoConfigChange=false] Whether to allow auto value changes for existing IDs.
64
+ */
65
+ constructor({ cooldownWatcherTime = 5000, allowAutoConfigChange = false } = {}) {
66
+ if (!Number.isFinite(cooldownWatcherTime) || cooldownWatcherTime <= 0)
67
+ throw new TypeError(`Expected 'cooldownWatcherTime' to be a positive number.`);
68
+ if (typeof allowAutoConfigChange !== 'boolean')
69
+ throw new TypeError(`Expected 'allowAutoConfigChange' to be a boolean.`);
70
+ this.#cooldownWatcherTime = cooldownWatcherTime;
71
+ this.#allowAutoConfigChange = allowAutoConfigChange;
72
+ this.setCooldownWatcherTime(cooldownWatcherTime);
73
+ }
74
+
75
+ /**
76
+ * Whether this instance has been destroyed and is no longer usable.
77
+ *
78
+ * @returns {boolean}
79
+ */
80
+ isDestroyed() {
81
+ return this.#isDestroyed;
82
+ }
83
+
84
+ /**
85
+ * Whether auto config change is enabled.
86
+ *
87
+ * @returns {boolean}
88
+ */
89
+ getAllowAutoConfigChange() {
90
+ return this.#allowAutoConfigChange;
91
+ }
92
+
93
+ /**
94
+ * Gets the interval time used for cooldown decrementing.
95
+ *
96
+ * @returns {number}
97
+ */
98
+ getCooldownWatcherTime() {
99
+ return this.#cooldownWatcherTime;
100
+ }
101
+
102
+ /**
103
+ * Sets whether to allow auto-updating an ID's timeout config if `value` changes.
104
+ *
105
+ * @param {boolean} value
106
+ */
107
+ setAllowAutoConfigChange(value) {
108
+ if (typeof value !== 'boolean') throw new TypeError(`Expected 'value' to be a boolean.`);
109
+ this.#allowAutoConfigChange = value;
110
+ }
111
+
112
+ /**
113
+ * Sets the cooldown watcher interval time.
114
+ * Automatically resets the interval if it was already running.
115
+ *
116
+ * @param {number} value
117
+ */
118
+ setCooldownWatcherTime(value) {
119
+ if (this.#isDestroyed) throw new Error('TinyTimeout has been destroyed.');
120
+ if (!Number.isFinite(value) || value <= 0)
121
+ throw new TypeError(`Expected 'value' to be a positive number.`);
122
+
123
+ this.#cooldownWatcherTime = value;
124
+
125
+ if (this.#cooldownWatcher) clearInterval(this.#cooldownWatcher);
126
+ this.#cooldownWatcher = setInterval(() => {
127
+ this.#timeoutFixer.forEach((data) => {
128
+ if (data.now > 0) data.now--;
129
+ });
130
+ }, this.#cooldownWatcherTime);
131
+ }
132
+
133
+ /**
134
+ * Schedules a callback using a dynamically adjusted timeout based on usage frequency.
135
+ * The more often an ID is triggered, the longer the timeout becomes,
136
+ * scaled by the provided `value`. Optionally, the delay can be limited by `limit`.
137
+ *
138
+ * @param {string} id - A unique identifier to track timeout usage.
139
+ * @param {Function} callback - The function to execute after the delay.
140
+ * @param {number} value - Base delay multiplier in milliseconds.
141
+ * @param {number|null} [limit=null] - Optional maximum delay cap.
142
+ * @returns {number} Handle to the scheduled timeout.
143
+ * @throws {Error} Throws if the instance has been destroyed or arguments are invalid.
144
+ */
145
+ set(id, callback, value, limit = null) {
146
+ if (this.#isDestroyed) throw new Error('TinyTimeout has been destroyed.');
147
+ if (typeof id !== 'string' || id.trim() === '')
148
+ throw new TypeError(`Expected 'id' to be a non-empty string.`);
149
+ if (typeof callback !== 'function')
150
+ throw new TypeError(`Expected 'callback' to be a function.`);
151
+ if (!Number.isFinite(value) || value < 0)
152
+ throw new TypeError(`Expected 'value' to be a non-negative number.`);
153
+ if (limit !== null && (!Number.isFinite(limit) || limit < 0))
154
+ throw new TypeError(`Expected 'limit' to be null or a non-negative number.`);
155
+
156
+ let entry = this.#timeoutFixer.get(id);
157
+ if (!entry || (this.#allowAutoConfigChange && value !== entry.value)) {
158
+ entry = { value, now: 0 };
159
+ this.#timeoutFixer.set(id, entry);
160
+ }
161
+
162
+ const delay = entry.value * entry.now;
163
+ entry.now++;
164
+
165
+ return setTimeout(callback, typeof limit === 'number' ? Math.min(delay, limit) : delay);
166
+ }
167
+
168
+ /**
169
+ * Waits until a provided function returns `true`, checking repeatedly at the defined interval.
170
+ * Useful for polling asynchronous conditions.
171
+ *
172
+ * @param {() => boolean} getValue - A function that returns `true` when the condition is met.
173
+ * @param {number} [checkInterval=100] - How often (in ms) to check the condition.
174
+ * @returns {Promise<void>} Resolves when the condition is met.
175
+ * @throws {TypeError} If arguments are invalid.
176
+ */
177
+ static waitForTrue(getValue, checkInterval = 100) {
178
+ if (typeof getValue !== 'function')
179
+ throw new TypeError(`Expected 'getValue' to be a function.`);
180
+ if (!Number.isFinite(checkInterval) || checkInterval <= 0)
181
+ throw new TypeError(`Expected 'checkInterval' to be a positive number.`);
182
+
183
+ return new Promise((resolve) => {
184
+ const interval = setInterval(() => {
185
+ if (getValue()) {
186
+ clearInterval(interval);
187
+ resolve();
188
+ }
189
+ }, checkInterval);
190
+ });
191
+ }
192
+
193
+ /**
194
+ * Instance version of `waitForTrue`, which defaults to using the instance's
195
+ * cooldownWatcherTime if not explicitly provided.
196
+ *
197
+ * @param {() => boolean} getValue - A function that returns `true` when the condition is met.
198
+ * @param {number|null} [checkInterval=100] - How often (in ms) to check the condition.
199
+ * @returns {Promise<void>} Resolves when the condition is met.
200
+ * @throws {Error} If the instance is destroyed or arguments are invalid.
201
+ */
202
+ waitForTrue(getValue, checkInterval = 100) {
203
+ if (this.#isDestroyed) throw new Error('TinyTimeout has been destroyed.');
204
+ if (typeof getValue !== 'function')
205
+ throw new TypeError(`Expected 'getValue' to be a function.`);
206
+ if (checkInterval !== null && (!Number.isFinite(checkInterval) || checkInterval <= 0))
207
+ throw new TypeError(`Expected 'checkInterval' to be null or a positive number.`);
208
+ return TinyTimeout.waitForTrue(getValue, checkInterval ?? this.#cooldownWatcherTime);
209
+ }
210
+
211
+ /**
212
+ * Cleans up all internal references and stops the cooldown watcher.
213
+ * After calling this, the instance becomes unusable.
214
+ */
215
+ destroy() {
216
+ if (this.#isDestroyed) return;
217
+ this.#isDestroyed = true;
218
+ if (this.#cooldownWatcher) clearInterval(this.#cooldownWatcher);
219
+ this.#cooldownWatcher = null;
220
+ this.#timeoutFixer.clear();
221
+ }
222
+ }
223
+
224
+ /* harmony default export */ const libs_TinyTimeout = (TinyTimeout);
225
+
226
+ ;// ./src/v1/build/TinyTimeout.mjs
227
+
228
+
229
+
230
+
231
+ window.TinyTimeout = __webpack_exports__.TinyTimeout;
232
+ /******/ })()
233
+ ;
@@ -0,0 +1 @@
1
+ (()=>{"use strict";var e={d:(o,t)=>{for(var r in t)e.o(t,r)&&!e.o(o,r)&&Object.defineProperty(o,r,{enumerable:!0,get:t[r]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o)},o={};e.d(o,{TinyTimeout:()=>r});class t{#e=!1;#o;#t;#r=null;#i=new Map;constructor({cooldownWatcherTime:e=5e3,allowAutoConfigChange:o=!1}={}){if(!Number.isFinite(e)||e<=0)throw new TypeError("Expected 'cooldownWatcherTime' to be a positive number.");if("boolean"!=typeof o)throw new TypeError("Expected 'allowAutoConfigChange' to be a boolean.");this.#t=e,this.#o=o,this.setCooldownWatcherTime(e)}isDestroyed(){return this.#e}getAllowAutoConfigChange(){return this.#o}getCooldownWatcherTime(){return this.#t}setAllowAutoConfigChange(e){if("boolean"!=typeof e)throw new TypeError("Expected 'value' to be a boolean.");this.#o=e}setCooldownWatcherTime(e){if(this.#e)throw new Error("TinyTimeout has been destroyed.");if(!Number.isFinite(e)||e<=0)throw new TypeError("Expected 'value' to be a positive number.");this.#t=e,this.#r&&clearInterval(this.#r),this.#r=setInterval(()=>{this.#i.forEach(e=>{e.now>0&&e.now--})},this.#t)}set(e,o,t,r=null){if(this.#e)throw new Error("TinyTimeout has been destroyed.");if("string"!=typeof e||""===e.trim())throw new TypeError("Expected 'id' to be a non-empty string.");if("function"!=typeof o)throw new TypeError("Expected 'callback' to be a function.");if(!Number.isFinite(t)||t<0)throw new TypeError("Expected 'value' to be a non-negative number.");if(null!==r&&(!Number.isFinite(r)||r<0))throw new TypeError("Expected 'limit' to be null or a non-negative number.");let i=this.#i.get(e);(!i||this.#o&&t!==i.value)&&(i={value:t,now:0},this.#i.set(e,i));const n=i.value*i.now;return i.now++,setTimeout(o,"number"==typeof r?Math.min(n,r):n)}static waitForTrue(e,o=100){if("function"!=typeof e)throw new TypeError("Expected 'getValue' to be a function.");if(!Number.isFinite(o)||o<=0)throw new TypeError("Expected 'checkInterval' to be a positive number.");return new Promise(t=>{const r=setInterval(()=>{e()&&(clearInterval(r),t())},o)})}waitForTrue(e,o=100){if(this.#e)throw new Error("TinyTimeout has been destroyed.");if("function"!=typeof e)throw new TypeError("Expected 'getValue' to be a function.");if(null!==o&&(!Number.isFinite(o)||o<=0))throw new TypeError("Expected 'checkInterval' to be null or a positive number.");return t.waitForTrue(e,o??this.#t)}destroy(){this.#e||(this.#e=!0,this.#r&&clearInterval(this.#r),this.#r=null,this.#i.clear())}}const r=t;window.TinyTimeout=o.TinyTimeout})();