jqx-es 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,5 +11,5 @@ ${r}`),u}}return{sheet:e,removeRules:E,tryParseAtOrNestedRules:S,ruleExists:f,ch
11
11
  `)}function Mt(e){return e.replace(/([*\[\]()-+{}.$?\\])/g,t=>`\\${t}`)}function jt(e,...t){let r=t.length&&Array.isArray(t.slice(-1))?t.pop().join(""):"";return new RegExp((t.length&&e.raw.reduce((o,n,i)=>o.concat(t[i-1]||"").concat(n),"")||e.raw.join("")).split(`
12
12
  `).map(o=>o.replace(/\s|\/\/.*$/g,"").trim().replace(/(@s!)/g," ")).join(""),r)}function Me(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`).replace(/[^--]^-|-$/,"")}function je(e,t){try{return e()}catch(r){console.error(`${t||"an error occured"}: ${r.message}`)}}function Ot(e){return e.replace(/\/\*.+?\*\//gm,"").replace(/[}{\r\n]/g,"").replace(/(data:.+?);/g,(t,r)=>`${r}\\3b`).split(";").map(t=>t.trim()).join(`;
13
13
  `).replaceAll("\\3b",";").split(`
14
- `)}function Rt(e){return e.reduce((t,r)=>{let[o,n]=[r.slice(0,r.indexOf(":")).trim(),r.slice(r.indexOf(":")+1).trim().replace(/;$|;.+(?=\/*).+\/$/,"")];return o&&n?{...t,[o]:n}:t},{})}function Dt(e){return Rt(Ot(e))}function Oe(e,t){return e?.replace("::",":")===t?.replace("::",":")}var Nt=[...Array(26)].map((e,t)=>String.fromCharCode(t+65)).concat([...Array(26)].map((e,t)=>String.fromCharCode(t+97))).concat([...Array(10)].map((e,t)=>`${t}`)),K=(e,t=2)=>`${e}`.padStart(t,"0"),It=(e,t=0)=>([e,t]=[Math.floor(e),Math.ceil(t)],Math.floor([...crypto.getRandomValues(new Uint32Array(1))].shift()/2**32*(e-t+1)+t)),Pt=e=>{let t=e.length;for(;t--;){let r=It(t);[e[t],e[r]]=[e[r],e[t]]}return e};var M=(e,t=120)=>`${e}`.trim().slice(0,t).replace(/>\s+</g,"><").replace(/</g,"&lt;").replace(/\s{2,}/g," ").replace(/\n/g,"\\n")+(e.length>t?" &hellip;":"").trim(),D=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`).replace(/^-|-$/,""),Jt=([e,...t])=>`${e.toUpperCase()}${t.join("")}`,Z=e=>c(e,String)?e.toLowerCase().split("-").map((t,r)=>r&&`${Jt(t)}`||t).join(""):e,R=()=>`_${Pt(Nt).slice(0,8).join("")}`,ee=(e,t=120)=>M(e,t).replace(/&lt;/g,"<"),Q=()=>(e=>`[${K(e.getHours())}:${K(e.getMinutes())}:${K(e.getSeconds())}.${K(e.getMilliseconds(),3)}]`)(new Date);var B=e=>e.replace(/</g,"&lt;");function Re(){let e=function(i){if(!i)return;let f=i.style,S=getComputedStyle(i),E=[f.visibility,S.visibility].includes("hidden"),b=[f.display,S.display].includes("none"),L=i.offsetTop<0||i.offsetLeft+i.offsetWidth<0||i.offsetLeft>document.body.offsetWidth,T=+S.opacity==0||+(f.opacity||1)==0;return!(L||T||b||E)},t="n/a",r=function(i){return i.parentNode?!!h.nodes(":is(:read-write)",i?.parentNode)?.find(f=>f===i):!1},o=function(i){return i.parentNode?!!h.nodes(":is(:modal)",i?.parentNode)?.find(f=>f===i):!1},n={notInDOM:!0,writable:t,modal:t,empty:!0,open:t,visible:t};return i=>{let f=i[0];return f?{get writable(){return r(f)},get modal(){return o(f)},get inDOM(){return!!f.parentNode},get open(){return f.open??!1},get visible(){return e(f)},get disabled(){return f.hasAttribute("readonly")||f.hasAttribute("disabled")},get empty(){return i.collection.length<1},get virtual(){return i.isVirtual}}:n}}var kt=!0,te={data:/data-[\-\w.\p{L}]/ui,validURL:/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,whiteSpace:/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g,notAllowedValues:/javascript|injected|noreferrer|alert|DataURL/gi},Qt=e=>{if(kt&&Object.keys(e.removed).length){let t=Object.entries(e.removed).reduce((r,[o,n])=>[...r,`${B(o)} => ${n}`],[]).join("\\000A");C.log(`JQx HTML creation errors: ${C.isConsole?t:B(t)}`)}},Bt=function(e){let t=e.nodeName.toLowerCase(),r=["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"];return/-/.test(t)&&!r.find(o=>o===t)||j.isAllowed(t)},X=e=>{let t={rawHTML:e?.parentElement?.getHTML()??"no html",removed:{}};return c(e,HTMLElement)&&[...e.childNodes].forEach(r=>{if(r?.children?.length&&X(r),r?.attributes){let n=c(r,SVGElement)?P.svg:P.html;[...(r??{attributes:[]}).attributes].forEach(i=>{let f=i.name.trim().toLowerCase(),S=i.value.trim().toLowerCase().replace(te.whiteSpace,""),E=f==="href"?!te.validURL.test(S):te.notAllowedValues.test(S),b=f.startsWith("data")?!te.data.test(f):!!n[f];if(E||b){let L=ee(i.value||"none",60);L+=L.length===60?"...":"",t.removed[`${i.name}`]=`attribute/property (-value) not allowed, removed. Value: ${L}`,r.removeAttribute(i.name)}})}if(!(Bt(r)||r.constructor===CharacterData||r.constructor===Comment)){let n=(r?.outerHTML||r?.textContent).trim(),i=ee(n,60)??"EMPTY";i+=i.length===60?"...":"",t.removed[`<${r.nodeName?.toLowerCase()}>`]=`not allowed, not rendered. Value: ${i}`,r.remove()}}),Qt(t),e};var F=new Proxy({start:"afterbegin",afterbegin:"afterbegin",end:"beforeend",beforeend:"beforeend",before:"beforebegin",beforebegin:"beforebegin",after:"afterend",afterend:"afterend"},{get(e,t){return e[String(t).toLowerCase()]??e[t]}}),zt=e=>{let t=document.createElement("div");return t.insertAdjacentHTML(F.end,e),t.childNodes.length?X(t):void 0},_t=(e,t,r)=>c(e,Comment)?t.insertAdjacentHTML(r,`<!--${e.data}-->`):t.insertAdjacentText(r,e.data),z=(e=[],t=document.body,r=F.BeforeEnd)=>e.reduce((o,n)=>{let i=Y(n)&&me(n,t,r);return i?[...o,i]:o},[]),me=(e,t=document.body,r=F.BeforeEnd)=>(t=t?.isJQx?t?.[0]:t,c(e,Comment,Text)?_t(e,t,r):t.insertAdjacentElement(r,e)),A=e=>{if(c(e,Text,Comment))return e;let t=e?.trim(),r=t?.split(/<text>|<\/text>/i)??[];if(r?.length&&(r=r.length>1?r.filter(n=>n.length).shift():void 0),t.startsWith("<!--")&&t.endsWith("-->"))return document.createComment(e.replace(/<!--|-->$/g,""));if(r||!/^<(.+)[^>]+>/m.test(t))return document.createTextNode(r);let o=zt(e);return o.childNodes.length<1?A(`<span data-jqxcreationerror="1">${M(e,60)}</span>`):o.children[0]};var w=(e,t)=>{let r=e.collection.filter(o=>!ke(o));for(let o=0;o<r.length;o+=1)t(r[o],o);return e},Wt=Re(),De=e=>e&&(e.textContent="");var _=e=>{let t=e.cloneNode(!0);return t.removeAttribute&&t.removeAttribute("id"),e.isConnected?e.remove():e=null,t},Pe=(e,t)=>{e&&c(t,Object)&&Object.entries(t).forEach(([r,o])=>e.setAttribute(`data-${D(r)}`,o))},Ne=(e,t)=>e.andThen(t,!0),Ie=(e,t)=>e.andThen(t),Je=e=>e.startsWith("data")||P.html.find(t=>e.toLowerCase()===t),qt=(e,t,r)=>{r&&c(t,String)&&(t={[t]:r==="-"?"":r});let o;t.className&&(o=t.className,delete t.className),o=[...e.classList].find(i=>i.startsWith("JQxClass-")||o&&i===o)||o||`JQxClass-${R().slice(1)}`,h.editCssRule(`.${o}`,t),e.classList.add(o)},Ut=(e,t)=>{e&&Object.entries(t).forEach(([r,o])=>{if(r.toLowerCase().startsWith("data"))return Pe(e,o);c(o,String)&&Je(r)&&e.setAttribute(r,o.split(/[, ]/)?.join(" "))})},be=(e,t)=>{c(t,Object)&&Object.entries(t).forEach(([r,o])=>{let n;/!important/i.test(o)&&(o=o.slice(0,o.indexOf("!")).trim(),n="important"),e.style.setProperty(D(r),o,n)})},Gt={get(e,t){return e[Z(t)]||e[t]},enumerable:!1,configurable:!1},Vt=(...e)=>{C.log("\u2757"+e.map(t=>String(t)).join(", "))},xe=(e,t=0,r=!0)=>(e=e?.parentElement,t+=e?e[r?"scrollTop":"scrollLeft"]:0,e?xe(e,t,r):t),Se={factoryExtensions:{data:e=>({get all(){return new Proxy(e[0]?.dataset??{},Gt)},set:(t={})=>(!e.is.empty&&c(t,Object)&&Object.entries(t).forEach(([r,o])=>e.setData({[r]:o})),e),get:(t,r)=>e.data.all[t]??r,add:(t={})=>(!e.is.empty&&c(t,Object)&&Object.entries(t).forEach(([r,o])=>e.setData({[r]:o})),e),remove:t=>(e[0]?.removeAttribute(`data-${D(t)}`),e)}),dimensions:e=>{if(e.is.empty)return{error:"[instance].dimensions: NO ELEMENTS"};let t=e[0],r=e.first()?.getBoundingClientRect().toJSON();return r.scrollTopDistance=xe(t,0),r.scrollLeftDistance=xe(t,0,!1),r},node:e=>e[0],HTML:e=>({get:(t,r)=>{if(e.is.empty)return"NO ELEMENTS IN COLLECTION";let o=t?e.outerHtml:e.html();return r?B(o):o},set:(t,r=!1,o=!1)=>{t=t.isJQx?t.HTML.get(1):t;let n=c(t,String);return t=n&&o?B(t):t,n&&(t||"").trim().length&&e.html(t,r),e},replace:(t,r=!1)=>e.HTML.set(t,!1,r),append:(t,r=!1)=>(t=c(t,HTMLElement)?h(t).HTML.get(1):t.isJQx?t.HTML.get(1):t,e.HTML.set(t,!0,r)),insert:(t,r=!1)=>(t=c(t,HTMLElement)?h(t).HTML.get(1):t.isJQx?t.HTML.get(1):t,e.HTML.set(t+e.HTML.get(),!1,r))}),is:e=>Wt(e),length:e=>e.collection.length,outerHtml:e=>(e.first()||{outerHTML:void 0}).outerHTML,parent:e=>{let t=h(e[0]?.parentNode);return t.is.empty?e:t},render:e=>!e.is.empty&&e.toDOM()||(h.log("[JQx.render]: empty collection"),void 0),Style:e=>({get computed(){return e.is.empty?{}:getComputedStyle(e[0])},inline:t=>e.style(t),inSheet:t=>e.css(t),valueOf:t=>e.is.empty?void 0:getComputedStyle(e[0])[D(t)],nwRule:t=>e.Style.byRule({rules:t}),byRule:({classes2Apply:t=[],rules:r=[]}={})=>{let n=c(r,String)&&!t.length?r.split("{")[0].trim():"";return r=r&&c(r,String)?[r]:r,t=t&&c(t,String)?[t]:t,(r?.length||t?.length)&&(r?.length&&h.editCssRules(...r),t?.forEach(i=>e.addClass(i))),n?.startsWith(".")&&e.addClass(n.slice(1)),n?.startsWith("#")&&!e.attr("id")&&e.prop({id:n.slice(1)}),e}})},instanceExtensions:{addClass:(e,...t)=>w(e,r=>r&&t.forEach(o=>r.classList.add(o))),after:Ie,afterMe:Ie,andThen:(e,t,r=!1)=>{if(!t||!c(t,String,Node,Proxy))return Vt(`[JQx instance].[beforeMe | afterMe | andThen]: insufficient input [${t}]`),e;t=t?.isJQx?t.collection:c(t,Node)?h.virtual(t).collection:h.virtual(A(t)).collection;let[o,n,i]=r?[0,"before",t.concat(e.collection)]:[e.collection.length-1,"after",e.collection.concat(t)];return e[o][n](...t),e.collection=i,e},append:(e,...t)=>{if(!e.is.empty&&t.length){let r=e.length===1;for(let o of t){if(!o.isJQx&&c(o,String)){let n=o.trim(),f=!/^<(.+)[^>]+>$/m.test(n)?h.text(o):A(o);w(e,S=>S.append(r?f:_(f)))}Y(o)&&w(e,n=>n.append(r?o:_(o))),o.isJQx&&!o.is.empty&&w(e,n=>o.collection.forEach(i=>n.append(r?i:_(i))))}}return e},appendTo:(e,t)=>(t.isJQx||(t=h(t)),t.append(e),e),attr:(e,t,r)=>{let o=e[0];return o?!r&&c(t,String)?t==="class"?[...o?.classList].join(" "):o?.getAttribute(t):(c(t,String)&&r&&(t={[t]:r}),c(t,Object)&&!e.is.empty&&Ut(o,t),e):e},before:Ne,beforeMe:Ne,clear:e=>w(e,De),closest:(e,t)=>{let r=c(t,String)?e[0].closest(t):null;return r?h(r):e},computedStyle:(e,t)=>e.first()&&getComputedStyle(e.first())[t],css:(e,t,r)=>w(e,o=>qt(o,t,r)),duplicate:(e,t=!1,r=document.body)=>{let o=e.toNodeList().map(i=>i.removeAttribute&&i.removeAttribute("id")||i),n=h.virtual(o);return t?n.toDOM(r):n},each:(e,t)=>w(e,t),empty:e=>w(e,De),find:(e,t)=>e.collection.length>0?[...e.first()?.querySelectorAll(t)]:[],find$:(e,t)=>e.collection.length>0?h(t,e):e,first:(e,t=!1)=>{if(e.collection.length>0)return t?e.single():e.collection[0]},first$:(e,t)=>e.single(t),getData:(e,t,r)=>e.first()&&e.first().dataset?.[t]||r,hasClass:(e,...t)=>{let r=e[0];return!r||!r.classList.length?!1:t.find(o=>r.classList.contains(o))&&!0||!1},hide:e=>w(e,t=>be(t,{display:"none !important"})),html:(e,t,r)=>{if(t===void 0)return e[0]?.getHTML();if(!e.isEmpty()){let o=A(`<div>${t.isJQx?t.HTML.get(!0):t}</div>`);if(!c(o,Comment))return w(e,i=>(r||(i.textContent=""),i.insertAdjacentHTML(h.at.end,o.getHTML())))}return e},htmlFor:(e,t,r="",o=!1)=>{if(t&&e.collection.length){if(!t||!c(r,String))return e;let n=e.find$(t);if(n.length<1)return e;let i=A(`<span>${r}</span>`);n.each(f=>{o||(f.textContent=""),f.insertAdjacentHTML(h.at.end,i.getHTML())})}return e},isEmpty:e=>e.collection.length<1,nth$:(e,t)=>e.single(t),on:(e,t,...r)=>(e.collection.length&&r?.forEach(o=>{let n=Qe(e);h.delegate(t,n,o)}),e),prepend:(e,...t)=>{if(!e.is.empty&&t){let r=e.length===1;for(let o of t){if(c(o,String)){o=o.trim();let i=!/^<(.+)[^>]+>$/m.test(o)?h.text(o):A(o);i=r?i:_(i),w(e,f=>f.prepend(i.cloneNode(!0)))}Y(o)&&w(e,n=>n.prepend(r?o:_(o))),o.isJQx&&!o.is.empty&&(o.collection.length>1&&o.collection.reverse(),w(e,n=>w(o,i=>n.prepend(r?i:_(i)))),o.collection.reverse())}}return e},prependTo:(e,t)=>(t.isJQx||(t=h.virtual(t)),t.prepend(e),e),prop:(e,t,r)=>{if(c(t,String)&&!r)return t.startsWith("data")?e[0]?.dataset[t.slice(t.indexOf("-")+1)]:e[0]?.[t];let o=c(t,Object)?t:{[t]:r};return Object.entries(o).forEach(([n,i])=>{if(n=n.trim(),i&&!Je(n)||!i)return!1;if(n.toLowerCase()==="id")return e[0].id=i;w(e,S=>{if(n.startsWith("data"))return S.dataset[n.slice(n.indexOf("-")+1)]=i;S[n]=i})}),e},remove:(e,t)=>{O(`remove ${M(e.HTML.get(1),40)}${t?` /w selector ${t}`:""}`);let r=n=>n.remove(),o=()=>e.collection=e.collection.filter(n=>document.documentElement.contains(n));if(t){let n=e.find$(t);return n.is.empty||(w(n,r),o()),e}return w(e,r),o(),e},removeAttribute:(e,t)=>w(e,r=>r.removeAttribute(t)),removeClass:(e,...t)=>w(e,r=>r&&t.forEach(o=>r.classList.remove(o))),renderTo:(e,t=document.body,r=h.insertPositions.end)=>(e.appendTo(t,r),e),replace:(e,t,r)=>{let o=e[0];return!t||!r||!c(r,HTMLElement)&&!r.isJQx?(console.error("JQx replace: invalid replacement value"),e):(r.isJQx&&(r=r[0]),c(r,NodeList)&&(r=r[0]),o&&t&&(t=c(t,String)?o.querySelectorAll(t):t.isJQx?t.collection:t,c(t,HTMLElement,NodeList,Array)&&c(r,HTMLElement)&&(c(t,HTMLElement)?[t]:[...t]).forEach(n=>n.replaceWith(r.cloneNode(!0)))),e)},replaceClass:(e,t,...r)=>w(e,o=>{o.classList.remove(t),r.forEach(n=>o.classList.add(n))}),replaceMe:(e,t)=>e.replaceWith(t),replaceWith:(e,t)=>(t=c(t,Element)?t:t.isJQx?t[0]:void 0,t&&(e[0].replaceWith(t),e=h.virtual(t)),e),setData:(e,t)=>w(e,r=>Pe(r,t)),show:e=>w(e,t=>be(t,{display:"revert-layer !important"})),single:(e,t)=>e.collection.length>0?c(t,String)?e.find$(t):c(t,Number)?h(e.collection[t]):h(e.collection[0]):e,style:(e,t,r)=>w(e,n=>{r&&c(t,String)&&(t={[t]:r||"none"}),be(n,t)}),text:(e,t,r=!1)=>e.isEmpty()?e:c(t,String)?w(e,n=>n.textContent=r?n.textContent+t:t):e.first().textContent,toDOM:(e,t=document.body,r=F.BeforeEnd)=>(e.isVirtual&&(e.isVirtual=!1),e.collection=z(e.collection,t,r),e),toggleClass:(e,t)=>w(e,r=>r.classList.toggle(t)),toNodeList:e=>[...e.collection].map(t=>document.importNode(t,!0)),trigger:(e,t,r=Event,o={})=>{if(e.collection.length){let n=new r(t,{...o,bubbles:o.bubbles??!0});for(let i of e.collection)i.dispatchEvent(n)}return e},val:(e,t)=>{let r=e[0];return!r||!c(r,HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement)?e:t===void 0?r.value:(r.value=c(t,String)?t:"",e)}}};var Be=Zt;function Zt(e){let t=e.createStyle("JQxPopupCSS");we.forEach(s=>t(s));let r={},o,n,i,f=e.virtual('<div class="popup-warn">'),S=e('<div class="popupContainer">').append(e('<span class="closeHandleIcon">')).append(e('<div class="content">')),[E,b]=[e(".popupContainer > .closeHandleIcon"),e(".popupContainer > .content")],L=()=>{if(E.hasClass("popup-active")){let{x:s,y:d,width:v}=b.dimensions;E.style({top:`${d-12}px`,left:`${s+v-12}px`})}},T=()=>{n&&e(".popup-warn").clear().append(e(`<div>${n}</div>`)),b.addClass("popup-warn-active")},g=()=>{o=!1,p(E.first())},x=(s,d)=>i=setTimeout(()=>p(E[0]),+s*1e3);return e.delegate("click",".popupContainer, .closeHandleIcon",s=>p(s.target)),e.delegate("click",".popupContainer .content",(s,d)=>o&&d.removeClass("popup-warn-active")),e.delegate("resize",L),{show:u,create:(s,d,v,l)=>{let a=e.IS(d,Boolean)?d:!1;u({content:s,modal:a,callback:a?v:d,warnMessage:l})},createTimed:(s,d,v)=>u({content:s,closeAfter:d,callback:v}),removeModal:g};function u({content:s,modal:d,closeAfter:v,callback:l,warnMessage:a}){if(s){if(s=e.IS(s,Node)?jqx(s):s,clearTimeout(i),o=d??!1,n=e.IS(a,String)&&`${a?.trim()}`.length||a?.isJQx?a:void 0,b.clear().append(s.isJQx?s:e(`<div>${s}</div>`)),o&&a&&b.append(f.duplicate()),S.addClass("popup-active"),e.IS(l,Function)){let m=R();S.data.set({callbackId:m}),r[m]=l}if(!o){if(e.IS(+v,Number)){let m=S.data.get("callbackId"),y=m&&r[m];x(v,y)}E.addClass("popup-active"),L()}return!0}return console.error("Popup creation needs at least some text to show")}function p(s){if(!o&&!s.closest(".content")){clearTimeout(i),b.clear();let d=S.data.get("callbackId");S.data.remove("callbackId"),e(".popup-active").removeClass("popup-active");let v=d&&r[d];e.IS(v,Function)&&v(),d&&delete r[d],n="";return}return o&&T()}}var N={},Xt=["load","unload","scroll","focus","blur","DOMNodeRemovedFromDocument","DOMNodeInsertedIntoDocument","loadstart","progress","error","abort","load","loadend","pointerenter","pointerleave","readystatechange"],Yt=e=>!!Xt.find(t=>t===e),ze=()=>{let e=o=>N[o.type].forEach(n=>n(o)),t=(o,n)=>i=>{let f=i.target?.closest?.(o);return f&&n(i,h(f))},r=(o,n)=>{N[o]||addEventListener(o,e,Yt(o))};return(o,n,i,f=!1)=>{r(o,f);let S=n?t(n,i):i;N=N[o]?{...N,[o]:N[o].concat(S)}:{...N,[o]:[S]}}};var Kt={},{instanceMethods:_e,instanceGetters:We,isCommentOrTextNode:ke,isNode:Y,isHtmlString:Ue,isArrayOfHtmlElements:Ge,isArrayOfHtmlStrings:Ve,ElemArray2HtmlString:Ze,input2Collection:Xe,setCollectionFromCssSelector:Ye,addHandlerId:Qe,cssRuleEdit:ve,addFn:er,elems4Docs:go}=tr();function tr(){let e=V({createWithId:"JQxStylesheet"}),t=(s,d)=>r[s]=(v,...l)=>d(v,...l),r=Se.instanceExtensions,o=Se.factoryExtensions,n=s=>c(s,Comment,Text),i=s=>c(s,Text,HTMLElement,Comment),f=s=>c(s,Comment),S=s=>c(s,Text),E=s=>c(s,String)&&/^<|>$/.test(`${s}`.trim()),b=s=>c(s,Array)&&!s?.find(d=>!E(d)),L=s=>c(s,Array)&&!s?.find(d=>!i(d)),T=s=>s?.filter(d=>d).reduce((d,v)=>d.concat(f(v)?`<!--${v.data}-->`:n(v)?v.textContent:v.outerHTML),""),g=s=>s?c(s,Proxy)?[s.EL]:c(s,NodeList)?[...s]:i(s)?[s]:L(s)?s:s.isJQx?s.collection:void 0:[],x=(s,d,v)=>{let l=d!==document.body&&c(s,String)&&s.toLowerCase()!=="body"?d:document,a;try{v.collection=[...l.querySelectorAll(s)]}catch{a=`Invalid CSS querySelector. [${c(s,String)?s:"Nothing valid given!"}]`}return a??`CSS querySelector "${s}", output ${v.collection.length} element(s)`},u=s=>{let d=s.data.get("hid")||`HID${R()}`;return s.data.add({hid:d}),`[data-hid="${d}"]`},p=Object.entries(j.tagsRaw).filter(([,s])=>s).map(([s])=>s).sort((s,d)=>s.localeCompare(d));return{instanceMethods:r,instanceGetters:o,isCommentOrTextNode:n,isNode:i,isComment:f,isText:S,isHtmlString:E,isArrayOfHtmlElements:L,isArrayOfHtmlStrings:b,ElemArray2HtmlString:T,input2Collection:g,setCollectionFromCssSelector:x,addHandlerId:u,cssRuleEdit:e,addFn:t,elems4Docs:p}}function W(e){return new Proxy(e,{get:(t,r)=>nr(t,r,e)})}function rr(e,t){return(...r)=>c(e,Function)&&e(W(t),...r)}function or(e,t){return(...r)=>c(e,Function)&&e(W(t),...r)}function nr(e,t,r){switch(!0){case c(t,Symbol):return e;case c(+t,Number):return e.collection?.[t]||`ELEMENT WITH INDEX ${t} NOT FOUND`;case t in We:return or(We[t],r)();case t in _e:return rr(_e[t],r);default:return e[t]}}function Ke(e){let t=dr(e);return Object.entries(Object.getOwnPropertyDescriptors(t)).forEach(([r,o])=>{Object.defineProperty(e,r,o),Object.defineProperty(Kt,r,o)}),e}function ir(e){return{allow:t=>{let r=/-/.test(t),o=r&&t;t=r?Z(t):t.toLowerCase(),j.allowTag(t),c(e[t],Function)||Object.defineProperties(e,Ee(t,!0,e,o))},prohibit:t=>{t=t.toLowerCase(),j.prohibitTag(t),c(e[t],Function)&&Object.defineProperties(e,Ee(t,!1,e))}}}function qe(...e){if(e.length===1){let t=String(e.shift().trim());e=t.startsWith("!")?[t.slice(1,-1)]:t.split(",").map(r=>r.trim())}e.map(t=>t.startsWith("!")?t.slice(1,-1):t).forEach(t=>ve(t,{removeRule:1}))}function sr(e){return function(t,r,...o){return c(r,Function)&&(o.push(r),r=void 0),o.forEach(n=>e(t,r,n))}}function lr(e){return function(t,r,o){r=r?.isJQx?r?.[0]:r,o=o&&Object.values(F).find(i=>o===i)?o:void 0;let n=e(t,document.createElement("br"));return r&&!c(r,HTMLBRElement)&&n.collection.forEach(i=>o?r.insertAdjacentElement(o,i):r.append(i)),n}}function cr(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.entries(o).forEach(([n,i])=>!(n in t)&&Object.defineProperty(t,n,i))}return t}function ar(e){console.error(`JQx: "${e}" not allowed, not rendered`)}function ur(e,t,r,o){return e=D(o||e.toLowerCase()),{get(){return(...n)=>t?r.virtual(X(ge[e](...n))):ar(e)},enumerable:!1,configurable:!0}}function Ee(e,t,r,o){e=e.toLowerCase();let n=ur(e,t,r,o);return o?{[o]:n,[Z(o)]:n}:{[e]:n,[e.toUpperCase()]:n}}function dr(e){return cr(Object.entries(j.tagsRaw).reduce(fr(e),{}),mr(e))}function fr(e){return function(t,[r,o]){return o&&Object.defineProperties(t,Ee(r,o,e)),t}}function mr(e){let t=(o,n)=>ve(o,n),r=ir(e);return{debugLog:C,log:(...o)=>H("fromStatic",...o),insertPositions:F,get at(){return F},editCssRules:(...o)=>o.forEach(n=>ve(n)),editCssRule:t,get setStyle(){return t},delegate:sr(ze()),virtual:lr(e),get fn(){return er},allowTag:r.allow,prohibitTag:r.prohibit,get lenient(){return j.allowUnknownHtmlTags},get IS(){return c},get Popup(){return e.activePopup||Object.defineProperty(e,"activePopup",{value:Be(e),enumerable:!1}),e.activePopup},popup:()=>e.Popup,createStyle:o=>V({createWithId:o||`jqx${R()}`}),editStylesheet:o=>V({createWithId:o||`jqx${R()}`}),removeCssRule:qe,removeCssRules:qe,text:(o,n=!1)=>n?e.comment(o):document.createTextNode(o),node:(o,n=document)=>n.querySelector(o,n),nodes:(o,n=document)=>[...n.querySelectorAll(o,n)]}}var h=Ke(gr());function gr(){return function(r,o,n=F.BeforeEnd){if(r?.isJQx)return r;let i=c(o,HTMLBRElement);o=(!i&&o&&o.isJQx?o[0]:o)||document.body,n=n&&Object.values(F).find(x=>n===x)?n:void 0;let f=Ue(r),S=!f&&Ve(r),E=S||f,b={collection:Xe(r)??[],isVirtual:i,isJQx:!0},L=Ge(b.collection),T=`input =&gt; ${S?`"${M(r.join(", "),70)}"`:!E&&L?`element collection [${M(b.collection.map(x=>`${c(x,Comment,Text)?"Comment|Text @":""} ${x?.outerHTML||x?.textContent}`).join(", "),70)}]`:`"${M(r,70)}"`}`;if(b.collection.length&&L)return O(T),i||b.collection.forEach(x=>{o.contains(x)||z([x],o,n)}),W(b);if(E){if([r].flat().forEach(x=>b.collection.push(A(x))),b.collection.length>0){let x=b.collection.filter(u=>u?.dataset?.jqxcreationerror);b.collection=b.collection.filter(u=>!u?.dataset?.jqxcreationerror),O(`${T}`),O(`*Created ${b.isVirtual?"VIRTUAL ":""}[${M(Ze(b.collection)||"sanitized: no elements remaining",70)}]`),x.length&&console.error(`JQx: illegal html, not rendered: "${x.reduce((u,p)=>u.concat(`${p.textContent}
14
+ `)}function Rt(e){return e.reduce((t,r)=>{let[o,n]=[r.slice(0,r.indexOf(":")).trim(),r.slice(r.indexOf(":")+1).trim().replace(/;$|;.+(?=\/*).+\/$/,"")];return o&&n?{...t,[o]:n}:t},{})}function Dt(e){return Rt(Ot(e))}function Oe(e,t){return e?.replace("::",":")===t?.replace("::",":")}var Nt=[...Array(26)].map((e,t)=>String.fromCharCode(t+65)).concat([...Array(26)].map((e,t)=>String.fromCharCode(t+97))).concat([...Array(10)].map((e,t)=>`${t}`)),K=(e,t=2)=>`${e}`.padStart(t,"0"),It=(e,t=0)=>([e,t]=[Math.floor(e),Math.ceil(t)],Math.floor([...crypto.getRandomValues(new Uint32Array(1))].shift()/2**32*(e-t+1)+t)),Pt=e=>{let t=e.length;for(;t--;){let r=It(t);[e[t],e[r]]=[e[r],e[t]]}return e};var M=(e,t=120)=>`${e}`.trim().slice(0,t).replace(/>\s+</g,"><").replace(/</g,"&lt;").replace(/\s{2,}/g," ").replace(/\n/g,"\\n")+(e.length>t?" &hellip;":"").trim(),D=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`).replace(/^-|-$/,""),Jt=([e,...t])=>`${e.toUpperCase()}${t.join("")}`,Z=e=>c(e,String)?e.toLowerCase().split("-").map((t,r)=>r&&`${Jt(t)}`||t).join(""):e,R=()=>`_${Pt(Nt).slice(0,8).join("")}`,ee=(e,t=120)=>M(e,t).replace(/&lt;/g,"<"),Q=()=>(e=>`[${K(e.getHours())}:${K(e.getMinutes())}:${K(e.getSeconds())}.${K(e.getMilliseconds(),3)}]`)(new Date);var B=e=>e.replace(/</g,"&lt;");function Re(){let e=function(i){if(!i)return;let f=i.style,S=getComputedStyle(i),E=[f.visibility,S.visibility].includes("hidden"),b=[f.display,S.display].includes("none"),L=i.offsetTop<0||i.offsetLeft+i.offsetWidth<0||i.offsetLeft>document.body.offsetWidth,T=+S.opacity==0||+(f.opacity||1)==0;return!(L||T||b||E)},t="n/a",r=function(i){return i.parentNode?!!h.nodes(":is(:read-write)",i?.parentNode)?.find(f=>f===i):!1},o=function(i){return i.parentNode?!!h.nodes(":is(:modal)",i?.parentNode)?.find(f=>f===i):!1},n={notInDOM:!0,writable:t,modal:t,empty:!0,open:t,visible:t};return i=>{let f=i[0];return f?{get writable(){return r(f)},get modal(){return o(f)},get inDOM(){return!!f.parentNode},get open(){return f.open??!1},get visible(){return e(f)},get disabled(){return f.hasAttribute("readonly")||f.hasAttribute("disabled")},get empty(){return i.collection.length<1},get virtual(){return i.isVirtual}}:n}}var kt=!0,te={data:/data-[\-\w.\p{L}]/ui,validURL:/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,whiteSpace:/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g,notAllowedValues:/javascript|injected|noreferrer|alert|DataURL/gi},Qt=e=>{if(kt&&Object.keys(e.removed).length){let t=Object.entries(e.removed).reduce((r,[o,n])=>[...r,`${B(o)} => ${n}`],[]).join("\\000A");C.log(`JQx HTML creation errors: ${C.isConsole?t:B(t)}`)}},Bt=function(e){let t=e.nodeName.toLowerCase(),r=["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"];return/-/.test(t)&&!r.find(o=>o===t)||j.isAllowed(t)},X=e=>{let t={rawHTML:e?.parentElement?.getHTML()??"no html",removed:{}};return c(e,HTMLElement)&&[...e.childNodes].forEach(r=>{if(r?.children?.length&&X(r),r?.attributes){let n=c(r,SVGElement)?P.svg:P.html;[...(r??{attributes:[]}).attributes].forEach(i=>{let f=i.name.trim().toLowerCase(),S=i.value.trim().toLowerCase().replace(te.whiteSpace,""),E=f==="href"?!te.validURL.test(S):te.notAllowedValues.test(S),b=f.startsWith("data")?!te.data.test(f):!!n[f];if(E||b){let L=ee(i.value||"none",60);L+=L.length===60?"...":"",t.removed[`${i.name}`]=`attribute/property (-value) not allowed, removed. Value: ${L}`,r.removeAttribute(i.name)}})}if(!(Bt(r)||r.constructor===CharacterData||r.constructor===Comment)){let n=(r?.outerHTML||r?.textContent).trim(),i=ee(n,60)??"EMPTY";i+=i.length===60?"...":"",t.removed[`<${r.nodeName?.toLowerCase()}>`]=`not allowed, not rendered. Value: ${i}`,r.remove()}}),Qt(t),e};var F=new Proxy({start:"afterbegin",afterbegin:"afterbegin",end:"beforeend",beforeend:"beforeend",before:"beforebegin",beforebegin:"beforebegin",after:"afterend",afterend:"afterend"},{get(e,t){return e[String(t).toLowerCase()]??e[t]}}),zt=e=>{let t=document.createElement("div");return t.insertAdjacentHTML(F.end,e),t.childNodes.length?X(t):void 0},_t=(e,t,r)=>c(e,Comment)?t.insertAdjacentHTML(r,`<!--${e.data}-->`):t.insertAdjacentText(r,e.data),z=(e=[],t=document.body,r=F.BeforeEnd)=>e.reduce((o,n)=>{let i=Y(n)&&me(n,t,r);return i?[...o,i]:o},[]),me=(e,t=document.body,r=F.BeforeEnd)=>(t=t?.isJQx?t?.[0]:t,c(e,Comment,Text)?_t(e,t,r):t.insertAdjacentElement(r,e)),A=e=>{if(c(e,Text,Comment))return e;let t=e?.trim(),r=t?.split(/<text>|<\/text>/i)??[];if(r?.length&&(r=r.length>1?r.filter(n=>n.length).shift():void 0),t.startsWith("<!--")&&t.endsWith("-->"))return document.createComment(e.replace(/<!--|-->$/g,""));if(r||!/^<(.+)[^>]+>/m.test(t))return document.createTextNode(r);let o=zt(e);return o.childNodes.length<1?A(`<span data-jqxcreationerror="1">${M(e,60)}</span>`):o.children[0]};var w=(e,t)=>{let r=e.collection.filter(o=>!ke(o));for(let o=0;o<r.length;o+=1)t(r[o],o);return e},Wt=Re(),De=e=>e&&(e.textContent="");var _=e=>{let t=e.cloneNode(!0);return t.removeAttribute&&t.removeAttribute("id"),e.isConnected?e.remove():e=null,t},Pe=(e,t)=>{e&&c(t,Object)&&Object.entries(t).forEach(([r,o])=>e.setAttribute(`data-${D(r)}`,o))},Ne=(e,t)=>e.andThen(t,!0),Ie=(e,t)=>e.andThen(t),Je=e=>e.startsWith("data")||P.html.find(t=>e.toLowerCase()===t),qt=(e,t,r)=>{r&&c(t,String)&&(t={[t]:r==="-"?"":r});let o;t.className&&(o=t.className,delete t.className),o=[...e.classList].find(i=>i.startsWith("JQxClass-")||o&&i===o)||o||`JQxClass-${R().slice(1)}`,h.editCssRule(`.${o}`,t),e.classList.add(o)},Ut=(e,t)=>{e&&Object.entries(t).forEach(([r,o])=>{if(r.toLowerCase().startsWith("data"))return Pe(e,o);c(o,String)&&Je(r)&&e.setAttribute(r,o.split(/[, ]/)?.join(" "))})},be=(e,t)=>{c(t,Object)&&Object.entries(t).forEach(([r,o])=>{let n;/!important/i.test(o)&&(o=o.slice(0,o.indexOf("!")).trim(),n="important"),e.style.setProperty(D(r),o,n)})},Gt={get(e,t){return e[Z(t)]||e[t]},enumerable:!1,configurable:!1},Vt=(...e)=>{C.log("\u2757"+e.map(t=>String(t)).join(", "))},xe=(e,t=0,r=!0)=>(e=e?.parentElement,t+=e?e[r?"scrollTop":"scrollLeft"]:0,e?xe(e,t,r):t),Se={factoryExtensions:{data:e=>({get all(){return new Proxy(e[0]?.dataset??{},Gt)},set:(t={})=>(!e.is.empty&&c(t,Object)&&Object.entries(t).forEach(([r,o])=>e.setData({[r]:o})),e),get:(t,r)=>e.data.all[t]??r,add:(t={})=>(!e.is.empty&&c(t,Object)&&Object.entries(t).forEach(([r,o])=>e.setData({[r]:o})),e),remove:t=>(e[0]?.removeAttribute(`data-${D(t)}`),e)}),dimensions:e=>{if(e.is.empty)return{error:"[instance].dimensions: NO ELEMENTS"};let t=e[0],r=e.first()?.getBoundingClientRect().toJSON();return r.scrollTopDistance=xe(t,0),r.scrollLeftDistance=xe(t,0,!1),r},node:e=>e[0],HTML:e=>({get:(t,r)=>{if(e.is.empty)return"NO ELEMENTS IN COLLECTION";let o=t?e.outerHtml:e.html();return r?B(o):o},set:(t,r=!1,o=!1)=>{t=t.isJQx?t.HTML.get(1):t;let n=c(t,String);return t=n&&o?B(t):t,n&&(t||"").trim().length&&e.html(t,r),e},replace:(t,r=!1)=>e.HTML.set(t,!1,r),append:(t,r=!1)=>(t=c(t,HTMLElement)?h(t).HTML.get(1):t.isJQx?t.HTML.get(1):t,e.HTML.set(t,!0,r)),insert:(t,r=!1)=>(t=c(t,HTMLElement)?h(t).HTML.get(1):t.isJQx?t.HTML.get(1):t,e.HTML.set(t+e.HTML.get(),!1,r))}),is:e=>Wt(e),length:e=>e.collection.length,outerHtml:e=>(e.first()||{outerHTML:void 0}).outerHTML,parent:e=>{let t=h(e[0]?.parentNode);return t.is.empty?e:t},render:e=>!e.is.empty&&e.toDOM()||(h.log("[JQx.render]: empty collection"),void 0),Style:e=>({get computed(){return e.is.empty?{}:getComputedStyle(e[0])},inline:t=>e.style(t),inSheet:t=>e.css(t),valueOf:t=>e.is.empty?void 0:getComputedStyle(e[0])[D(t)],nwRule:t=>e.Style.byRule({rules:t}),byRule:({classes2Apply:t=[],rules:r=[]}={})=>{let n=c(r,String)&&!t.length?r.split("{")[0].trim():"";return r=r&&c(r,String)?[r]:r,t=t&&c(t,String)?[t]:t,(r?.length||t?.length)&&(r?.length&&h.editCssRules(...r),t?.forEach(i=>e.addClass(i))),n?.startsWith(".")&&e.addClass(n.slice(1)),n?.startsWith("#")&&!e.attr("id")&&e.prop({id:n.slice(1)}),e}})},instanceExtensions:{addClass:(e,...t)=>w(e,r=>r&&t.forEach(o=>r.classList.add(o))),after:Ie,afterMe:Ie,andThen:(e,t,r=!1)=>{if(!t||!c(t,String,Node,Proxy))return Vt(`[JQx instance].[beforeMe | afterMe | andThen]: insufficient input [${t}]`),e;t=t?.isJQx?t.collection:c(t,Node)?h.virtual(t).collection:h.virtual(A(t)).collection;let[o,n,i]=r?[0,"before",t.concat(e.collection)]:[e.collection.length-1,"after",e.collection.concat(t)];return e[o][n](...t),e.collection=i,e},append:(e,...t)=>{if(!e.is.empty&&t.length){let r=e.length===1;for(let o of t){if(!o.isJQx&&c(o,String)){let n=o.trim(),f=!/^<(.+)[^>]+>$/m.test(n)?h.text(o):A(o);w(e,S=>S.append(r?f:_(f)))}Y(o)&&w(e,n=>n.append(r?o:_(o))),o.isJQx&&!o.is.empty&&w(e,n=>o.collection.forEach(i=>n.append(r?i:_(i))))}}return e},appendTo:(e,t)=>(t.isJQx||(t=h(t)),t.append(e),e),attr:(e,t,r)=>{let o=e[0];return o?!r&&c(t,String)?t==="class"?[...o?.classList].join(" "):o?.getAttribute(t):(c(t,String)&&r&&(t={[t]:r}),c(t,Object)&&!e.is.empty&&Ut(o,t),e):e},before:Ne,beforeMe:Ne,clear:e=>w(e,De),closest:(e,t)=>{let r=c(t,String)?e[0].closest(t):null;return r?h(r):e},computedStyle:(e,t)=>e.first()&&getComputedStyle(e.first())[t],css:(e,t,r)=>w(e,o=>qt(o,t,r)),duplicate:(e,t=!1,r=document.body)=>{let o=e.toNodeList().map(i=>i.removeAttribute&&i.removeAttribute("id")||i),n=h.virtual(o);return t?n.toDOM(r):n},each:(e,t)=>w(e,t),empty:e=>w(e,De),find:(e,t)=>e.collection.length>0?[...e.first()?.querySelectorAll(t)]:[],find$:(e,t)=>e.collection.length>0?h(t,e):e,first:(e,t=!1)=>{if(e.collection.length>0)return t?e.single():e.collection[0]},first$:(e,t)=>e.single(t),getData:(e,t,r)=>e.first()&&e.first().dataset?.[t]||r,hasClass:(e,...t)=>{let r=e[0];return!r||!r.classList.length?!1:t.find(o=>r.classList.contains(o))&&!0||!1},hide:e=>w(e,t=>be(t,{display:"none !important"})),html:(e,t,r)=>{if(t===void 0)return e[0]?.getHTML();if(!e.isEmpty()){let o=A(`<div>${t.isJQx?t.HTML.get(!0):t}</div>`);if(!c(o,Comment))return w(e,i=>(r||(i.textContent=""),i.insertAdjacentHTML(h.at.end,o.getHTML())))}return e},htmlFor:(e,t,r="",o=!1)=>{if(t&&e.collection.length){if(!t||!c(r,String))return e;let n=e.find$(t);if(n.length<1)return e;let i=A(`<span>${r}</span>`);n.each(f=>{o||(f.textContent=""),f.insertAdjacentHTML(h.at.end,i.getHTML())})}return e},isEmpty:e=>e.collection.length<1,nth$:(e,t)=>e.single(t),on:(e,t,...r)=>(e.collection.length&&r?.forEach(o=>{let n=Qe(e);h.delegate(t,n,o)}),e),prepend:(e,...t)=>{if(!e.is.empty&&t){let r=e.length===1;for(let o of t){if(c(o,String)){o=o.trim();let i=!/^<(.+)[^>]+>$/m.test(o)?h.text(o):A(o);i=r?i:_(i),w(e,f=>f.prepend(i.cloneNode(!0)))}Y(o)&&w(e,n=>n.prepend(r?o:_(o))),o.isJQx&&!o.is.empty&&(o.collection.length>1&&o.collection.reverse(),w(e,n=>w(o,i=>n.prepend(r?i:_(i)))),o.collection.reverse())}}return e},prependTo:(e,t)=>(t.isJQx||(t=h.virtual(t)),t.prepend(e),e),prop:(e,t,r)=>{if(c(t,String)&&!r)return t.startsWith("data")?e[0]?.dataset[t.slice(t.indexOf("-")+1)]:e[0]?.[t];let o=c(t,Object)?t:{[t]:r};return Object.entries(o).forEach(([n,i])=>{if(n=n.trim(),i&&!Je(n)||!i)return!1;if(n.toLowerCase()==="id")return e[0].id=i;w(e,S=>{if(n.startsWith("data"))return S.dataset[n.slice(n.indexOf("-")+1)]=i;S[n]=i})}),e},remove:(e,t)=>{O(`remove ${M(e.HTML.get(1),40)}${t?` /w selector ${t}`:""}`);let r=n=>n.remove(),o=()=>e.collection=e.collection.filter(n=>document.documentElement.contains(n));if(t){let n=e.find$(t);return n.is.empty||(w(n,r),o()),e}return w(e,r),o(),e},removeAttribute:(e,t)=>w(e,r=>r.removeAttribute(t)),removeClass:(e,...t)=>w(e,r=>r&&t.forEach(o=>r.classList.remove(o))),renderTo:(e,t=document.body,r=h.insertPositions.end)=>(e.toDOM(t,r),e),replace:(e,t,r)=>{let o=e[0];return!t||!r||!c(r,HTMLElement)&&!r.isJQx?(console.error("JQx replace: invalid replacement value"),e):(r.isJQx&&(r=r[0]),c(r,NodeList)&&(r=r[0]),o&&t&&(t=c(t,String)?o.querySelectorAll(t):t.isJQx?t.collection:t,c(t,HTMLElement,NodeList,Array)&&c(r,HTMLElement)&&(c(t,HTMLElement)?[t]:[...t]).forEach(n=>n.replaceWith(r.cloneNode(!0)))),e)},replaceClass:(e,t,...r)=>w(e,o=>{o.classList.remove(t),r.forEach(n=>o.classList.add(n))}),replaceMe:(e,t)=>e.replaceWith(t),replaceWith:(e,t)=>(t=c(t,Element)?t:t.isJQx?t[0]:void 0,t&&(e[0].replaceWith(t),e=h.virtual(t)),e),setData:(e,t)=>w(e,r=>Pe(r,t)),show:e=>w(e,t=>be(t,{display:"revert-layer !important"})),single:(e,t)=>e.collection.length>0?c(t,String)?e.find$(t):c(t,Number)?h(e.collection[t]):h(e.collection[0]):e,style:(e,t,r)=>w(e,n=>{r&&c(t,String)&&(t={[t]:r||"none"}),be(n,t)}),text:(e,t,r=!1)=>e.isEmpty()?e:c(t,String)?w(e,n=>n.textContent=r?n.textContent+t:t):e.first().textContent,toDOM:(e,t=document.body,r=F.BeforeEnd)=>(e.isVirtual&&(e.isVirtual=!1),e.collection=z(e.collection,t,r),e),toggleClass:(e,t)=>w(e,r=>r.classList.toggle(t)),toNodeList:e=>[...e.collection].map(t=>document.importNode(t,!0)),trigger:(e,t,r=Event,o={})=>{if(e.collection.length){let n=new r(t,{...o,bubbles:o.bubbles??!0});for(let i of e.collection)i.dispatchEvent(n)}return e},val:(e,t)=>{let r=e[0];return!r||!c(r,HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement)?e:t===void 0?r.value:(r.value=c(t,String)?t:"",e)}}};var Be=Zt;function Zt(e){let t=e.createStyle("JQxPopupCSS");we.forEach(s=>t(s));let r={},o,n,i,f=e.virtual('<div class="popup-warn">'),S=e('<div class="popupContainer">').append(e('<span class="closeHandleIcon">')).append(e('<div class="content">')),[E,b]=[e(".popupContainer > .closeHandleIcon"),e(".popupContainer > .content")],L=()=>{if(E.hasClass("popup-active")){let{x:s,y:d,width:v}=b.dimensions;E.style({top:`${d-12}px`,left:`${s+v-12}px`})}},T=()=>{n&&e(".popup-warn").clear().append(e(`<div>${n}</div>`)),b.addClass("popup-warn-active")},g=()=>{o=!1,p(E.first())},x=(s,d)=>i=setTimeout(()=>p(E[0]),+s*1e3);return e.delegate("click",".popupContainer, .closeHandleIcon",s=>p(s.target)),e.delegate("click",".popupContainer .content",(s,d)=>o&&d.removeClass("popup-warn-active")),e.delegate("resize",L),{show:u,create:(s,d,v,l)=>{let a=e.IS(d,Boolean)?d:!1;u({content:s,modal:a,callback:a?v:d,warnMessage:l})},createTimed:(s,d,v)=>u({content:s,closeAfter:d,callback:v}),removeModal:g};function u({content:s,modal:d,closeAfter:v,callback:l,warnMessage:a}){if(s){if(s=e.IS(s,Node)?jqx(s):s,clearTimeout(i),o=d??!1,n=e.IS(a,String)&&`${a?.trim()}`.length||a?.isJQx?a:void 0,b.clear().append(s.isJQx?s:e(`<div>${s}</div>`)),o&&a&&b.append(f.duplicate()),S.addClass("popup-active"),e.IS(l,Function)){let m=R();S.data.set({callbackId:m}),r[m]=l}if(!o){if(e.IS(+v,Number)){let m=S.data.get("callbackId"),y=m&&r[m];x(v,y)}E.addClass("popup-active"),L()}return!0}return console.error("Popup creation needs at least some text to show")}function p(s){if(!o&&!s.closest(".content")){clearTimeout(i),b.clear();let d=S.data.get("callbackId");S.data.remove("callbackId"),e(".popup-active").removeClass("popup-active");let v=d&&r[d];e.IS(v,Function)&&v(),d&&delete r[d],n="";return}return o&&T()}}var N={},Xt=["load","unload","scroll","focus","blur","DOMNodeRemovedFromDocument","DOMNodeInsertedIntoDocument","loadstart","progress","error","abort","load","loadend","pointerenter","pointerleave","readystatechange"],Yt=e=>!!Xt.find(t=>t===e),ze=()=>{let e=o=>N[o.type].forEach(n=>n(o)),t=(o,n)=>i=>{let f=i.target?.closest?.(o);return f&&n(i,h(f))},r=(o,n)=>{N[o]||addEventListener(o,e,Yt(o))};return(o,n,i,f=!1)=>{r(o,f);let S=n?t(n,i):i;N=N[o]?{...N,[o]:N[o].concat(S)}:{...N,[o]:[S]}}};var Kt={},{instanceMethods:_e,instanceGetters:We,isCommentOrTextNode:ke,isNode:Y,isHtmlString:Ue,isArrayOfHtmlElements:Ge,isArrayOfHtmlStrings:Ve,ElemArray2HtmlString:Ze,input2Collection:Xe,setCollectionFromCssSelector:Ye,addHandlerId:Qe,cssRuleEdit:ve,addFn:er,elems4Docs:go}=tr();function tr(){let e=V({createWithId:"JQxStylesheet"}),t=(s,d)=>r[s]=(v,...l)=>d(v,...l),r=Se.instanceExtensions,o=Se.factoryExtensions,n=s=>c(s,Comment,Text),i=s=>c(s,Text,HTMLElement,Comment),f=s=>c(s,Comment),S=s=>c(s,Text),E=s=>c(s,String)&&/^<|>$/.test(`${s}`.trim()),b=s=>c(s,Array)&&!s?.find(d=>!E(d)),L=s=>c(s,Array)&&!s?.find(d=>!i(d)),T=s=>s?.filter(d=>d).reduce((d,v)=>d.concat(f(v)?`<!--${v.data}-->`:n(v)?v.textContent:v.outerHTML),""),g=s=>s?c(s,Proxy)?[s.EL]:c(s,NodeList)?[...s]:i(s)?[s]:L(s)?s:s.isJQx?s.collection:void 0:[],x=(s,d,v)=>{let l=d!==document.body&&c(s,String)&&s.toLowerCase()!=="body"?d:document,a;try{v.collection=[...l.querySelectorAll(s)]}catch{a=`Invalid CSS querySelector. [${c(s,String)?s:"Nothing valid given!"}]`}return a??`CSS querySelector "${s}", output ${v.collection.length} element(s)`},u=s=>{let d=s.data.get("hid")||`HID${R()}`;return s.data.add({hid:d}),`[data-hid="${d}"]`},p=Object.entries(j.tagsRaw).filter(([,s])=>s).map(([s])=>s).sort((s,d)=>s.localeCompare(d));return{instanceMethods:r,instanceGetters:o,isCommentOrTextNode:n,isNode:i,isComment:f,isText:S,isHtmlString:E,isArrayOfHtmlElements:L,isArrayOfHtmlStrings:b,ElemArray2HtmlString:T,input2Collection:g,setCollectionFromCssSelector:x,addHandlerId:u,cssRuleEdit:e,addFn:t,elems4Docs:p}}function W(e){return new Proxy(e,{get:(t,r)=>nr(t,r,e)})}function rr(e,t){return(...r)=>c(e,Function)&&e(W(t),...r)}function or(e,t){return(...r)=>c(e,Function)&&e(W(t),...r)}function nr(e,t,r){switch(!0){case c(t,Symbol):return e;case c(+t,Number):return e.collection?.[t]||`ELEMENT WITH INDEX ${t} NOT FOUND`;case t in We:return or(We[t],r)();case t in _e:return rr(_e[t],r);default:return e[t]}}function Ke(e){let t=dr(e);return Object.entries(Object.getOwnPropertyDescriptors(t)).forEach(([r,o])=>{Object.defineProperty(e,r,o),Object.defineProperty(Kt,r,o)}),e}function ir(e){return{allow:t=>{let r=/-/.test(t),o=r&&t;t=r?Z(t):t.toLowerCase(),j.allowTag(t),c(e[t],Function)||Object.defineProperties(e,Ee(t,!0,e,o))},prohibit:t=>{t=t.toLowerCase(),j.prohibitTag(t),c(e[t],Function)&&Object.defineProperties(e,Ee(t,!1,e))}}}function qe(...e){if(e.length===1){let t=String(e.shift().trim());e=t.startsWith("!")?[t.slice(1,-1)]:t.split(",").map(r=>r.trim())}e.map(t=>t.startsWith("!")?t.slice(1,-1):t).forEach(t=>ve(t,{removeRule:1}))}function sr(e){return function(t,r,...o){return c(r,Function)&&(o.push(r),r=void 0),o.forEach(n=>e(t,r,n))}}function lr(e){return function(t,r,o){r=r?.isJQx?r?.[0]:r,o=o&&Object.values(F).find(i=>o===i)?o:void 0;let n=e(t,document.createElement("br"));return r&&!c(r,HTMLBRElement)&&n.collection.forEach(i=>o?r.insertAdjacentElement(o,i):r.append(i)),n}}function cr(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.entries(o).forEach(([n,i])=>!(n in t)&&Object.defineProperty(t,n,i))}return t}function ar(e){console.error(`JQx: "${e}" not allowed, not rendered`)}function ur(e,t,r,o){return e=D(o||e.toLowerCase()),{get(){return(...n)=>t?r.virtual(X(ge[e](...n))):ar(e)},enumerable:!1,configurable:!0}}function Ee(e,t,r,o){e=e.toLowerCase();let n=ur(e,t,r,o);return o?{[o]:n,[Z(o)]:n}:{[e]:n,[e.toUpperCase()]:n}}function dr(e){return cr(Object.entries(j.tagsRaw).reduce(fr(e),{}),mr(e))}function fr(e){return function(t,[r,o]){return o&&Object.defineProperties(t,Ee(r,o,e)),t}}function mr(e){let t=(o,n)=>ve(o,n),r=ir(e);return{debugLog:C,log:(...o)=>H("fromStatic",...o),insertPositions:F,get at(){return F},editCssRules:(...o)=>o.forEach(n=>ve(n)),editCssRule:t,get setStyle(){return t},delegate:sr(ze()),virtual:lr(e),get fn(){return er},allowTag:r.allow,prohibitTag:r.prohibit,get lenient(){return j.allowUnknownHtmlTags},get IS(){return c},get Popup(){return e.activePopup||Object.defineProperty(e,"activePopup",{value:Be(e),enumerable:!1}),e.activePopup},popup:()=>e.Popup,createStyle:o=>V({createWithId:o||`jqx${R()}`}),editStylesheet:o=>V({createWithId:o||`jqx${R()}`}),removeCssRule:qe,removeCssRules:qe,text:(o,n=!1)=>n?e.comment(o):document.createTextNode(o),node:(o,n=document)=>n.querySelector(o,n),nodes:(o,n=document)=>[...n.querySelectorAll(o,n)]}}var h=Ke(gr());function gr(){return function(r,o,n=F.BeforeEnd){if(r?.isJQx)return r;let i=c(o,HTMLBRElement);o=(!i&&o&&o.isJQx?o[0]:o)||document.body,n=n&&Object.values(F).find(x=>n===x)?n:void 0;let f=Ue(r),S=!f&&Ve(r),E=S||f,b={collection:Xe(r)??[],isVirtual:i,isJQx:!0},L=Ge(b.collection),T=`input =&gt; ${S?`"${M(r.join(", "),70)}"`:!E&&L?`element collection [${M(b.collection.map(x=>`${c(x,Comment,Text)?"Comment|Text @":""} ${x?.outerHTML||x?.textContent}`).join(", "),70)}]`:`"${M(r,70)}"`}`;if(b.collection.length&&L)return O(T),i||b.collection.forEach(x=>{o.contains(x)||z([x],o,n)}),W(b);if(E){if([r].flat().forEach(x=>b.collection.push(A(x))),b.collection.length>0){let x=b.collection.filter(u=>u?.dataset?.jqxcreationerror);b.collection=b.collection.filter(u=>!u?.dataset?.jqxcreationerror),O(`${T}`),O(`*Created ${b.isVirtual?"VIRTUAL ":""}[${M(Ze(b.collection)||"sanitized: no elements remaining",70)}]`),x.length&&console.error(`JQx: illegal html, not rendered: "${x.reduce((u,p)=>u.concat(`${p.textContent}
15
15
  `),"").trim()}"`),b.isVirtual||z(b.collection,o,n)}return W(b)}let g=Ye(r,o,b);return O(`input => ${g}`),W(b)}}return it(pr);})();
package/Bundle/jqx.min.js CHANGED
@@ -11,5 +11,5 @@ ${r}`),u}}return{sheet:e,removeRules:E,tryParseAtOrNestedRules:S,ruleExists:f,ch
11
11
  `)}function Lt(e){return e.replace(/([*\[\]()-+{}.$?\\])/g,t=>`\\${t}`)}function Ct(e,...t){let r=t.length&&Array.isArray(t.slice(-1))?t.pop().join(""):"";return new RegExp((t.length&&e.raw.reduce((o,n,i)=>o.concat(t[i-1]||"").concat(n),"")||e.raw.join("")).split(`
12
12
  `).map(o=>o.replace(/\s|\/\/.*$/g,"").trim().replace(/(@s!)/g," ")).join(""),r)}function Ae(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`).replace(/[^--]^-|-$/,"")}function Me(e,t){try{return e()}catch(r){console.error(`${t||"an error occured"}: ${r.message}`)}}function $t(e){return e.replace(/\/\*.+?\*\//gm,"").replace(/[}{\r\n]/g,"").replace(/(data:.+?);/g,(t,r)=>`${r}\\3b`).split(";").map(t=>t.trim()).join(`;
13
13
  `).replaceAll("\\3b",";").split(`
14
- `)}function Tt(e){return e.reduce((t,r)=>{let[o,n]=[r.slice(0,r.indexOf(":")).trim(),r.slice(r.indexOf(":")+1).trim().replace(/;$|;.+(?=\/*).+\/$/,"")];return o&&n?{...t,[o]:n}:t},{})}function Ft(e){return Tt($t(e))}function je(e,t){return e?.replace("::",":")===t?.replace("::",":")}var Ht=[...Array(26)].map((e,t)=>String.fromCharCode(t+65)).concat([...Array(26)].map((e,t)=>String.fromCharCode(t+97))).concat([...Array(10)].map((e,t)=>`${t}`)),K=(e,t=2)=>`${e}`.padStart(t,"0"),At=(e,t=0)=>([e,t]=[Math.floor(e),Math.ceil(t)],Math.floor([...crypto.getRandomValues(new Uint32Array(1))].shift()/2**32*(e-t+1)+t)),Mt=e=>{let t=e.length;for(;t--;){let r=At(t);[e[t],e[r]]=[e[r],e[t]]}return e};var M=(e,t=120)=>`${e}`.trim().slice(0,t).replace(/>\s+</g,"><").replace(/</g,"&lt;").replace(/\s{2,}/g," ").replace(/\n/g,"\\n")+(e.length>t?" &hellip;":"").trim(),D=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`).replace(/^-|-$/,""),jt=([e,...t])=>`${e.toUpperCase()}${t.join("")}`,Z=e=>c(e,String)?e.toLowerCase().split("-").map((t,r)=>r&&`${jt(t)}`||t).join(""):e,R=()=>`_${Mt(Ht).slice(0,8).join("")}`,ee=(e,t=120)=>M(e,t).replace(/&lt;/g,"<"),Q=()=>(e=>`[${K(e.getHours())}:${K(e.getMinutes())}:${K(e.getSeconds())}.${K(e.getMilliseconds(),3)}]`)(new Date);var B=e=>e.replace(/</g,"&lt;");function Oe(){let e=function(i){if(!i)return;let f=i.style,S=getComputedStyle(i),E=[f.visibility,S.visibility].includes("hidden"),b=[f.display,S.display].includes("none"),L=i.offsetTop<0||i.offsetLeft+i.offsetWidth<0||i.offsetLeft>document.body.offsetWidth,T=+S.opacity==0||+(f.opacity||1)==0;return!(L||T||b||E)},t="n/a",r=function(i){return i.parentNode?!!y.nodes(":is(:read-write)",i?.parentNode)?.find(f=>f===i):!1},o=function(i){return i.parentNode?!!y.nodes(":is(:modal)",i?.parentNode)?.find(f=>f===i):!1},n={notInDOM:!0,writable:t,modal:t,empty:!0,open:t,visible:t};return i=>{let f=i[0];return f?{get writable(){return r(f)},get modal(){return o(f)},get inDOM(){return!!f.parentNode},get open(){return f.open??!1},get visible(){return e(f)},get disabled(){return f.hasAttribute("readonly")||f.hasAttribute("disabled")},get empty(){return i.collection.length<1},get virtual(){return i.isVirtual}}:n}}var Ot=!0,te={data:/data-[\-\w.\p{L}]/ui,validURL:/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,whiteSpace:/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g,notAllowedValues:/javascript|injected|noreferrer|alert|DataURL/gi},Rt=e=>{if(Ot&&Object.keys(e.removed).length){let t=Object.entries(e.removed).reduce((r,[o,n])=>[...r,`${B(o)} => ${n}`],[]).join("\\000A");C.log(`JQx HTML creation errors: ${C.isConsole?t:B(t)}`)}},Dt=function(e){let t=e.nodeName.toLowerCase(),r=["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"];return/-/.test(t)&&!r.find(o=>o===t)||j.isAllowed(t)},X=e=>{let t={rawHTML:e?.parentElement?.getHTML()??"no html",removed:{}};return c(e,HTMLElement)&&[...e.childNodes].forEach(r=>{if(r?.children?.length&&X(r),r?.attributes){let n=c(r,SVGElement)?P.svg:P.html;[...(r??{attributes:[]}).attributes].forEach(i=>{let f=i.name.trim().toLowerCase(),S=i.value.trim().toLowerCase().replace(te.whiteSpace,""),E=f==="href"?!te.validURL.test(S):te.notAllowedValues.test(S),b=f.startsWith("data")?!te.data.test(f):!!n[f];if(E||b){let L=ee(i.value||"none",60);L+=L.length===60?"...":"",t.removed[`${i.name}`]=`attribute/property (-value) not allowed, removed. Value: ${L}`,r.removeAttribute(i.name)}})}if(!(Dt(r)||r.constructor===CharacterData||r.constructor===Comment)){let n=(r?.outerHTML||r?.textContent).trim(),i=ee(n,60)??"EMPTY";i+=i.length===60?"...":"",t.removed[`<${r.nodeName?.toLowerCase()}>`]=`not allowed, not rendered. Value: ${i}`,r.remove()}}),Rt(t),e};var F=new Proxy({start:"afterbegin",afterbegin:"afterbegin",end:"beforeend",beforeend:"beforeend",before:"beforebegin",beforebegin:"beforebegin",after:"afterend",afterend:"afterend"},{get(e,t){return e[String(t).toLowerCase()]??e[t]}}),Nt=e=>{let t=document.createElement("div");return t.insertAdjacentHTML(F.end,e),t.childNodes.length?X(t):void 0},It=(e,t,r)=>c(e,Comment)?t.insertAdjacentHTML(r,`<!--${e.data}-->`):t.insertAdjacentText(r,e.data),z=(e=[],t=document.body,r=F.BeforeEnd)=>e.reduce((o,n)=>{let i=Y(n)&&fe(n,t,r);return i?[...o,i]:o},[]),fe=(e,t=document.body,r=F.BeforeEnd)=>(t=t?.isJQx?t?.[0]:t,c(e,Comment,Text)?It(e,t,r):t.insertAdjacentElement(r,e)),A=e=>{if(c(e,Text,Comment))return e;let t=e?.trim(),r=t?.split(/<text>|<\/text>/i)??[];if(r?.length&&(r=r.length>1?r.filter(n=>n.length).shift():void 0),t.startsWith("<!--")&&t.endsWith("-->"))return document.createComment(e.replace(/<!--|-->$/g,""));if(r||!/^<(.+)[^>]+>/m.test(t))return document.createTextNode(r);let o=Nt(e);return o.childNodes.length<1?A(`<span data-jqxcreationerror="1">${M(e,60)}</span>`):o.children[0]};var w=(e,t)=>{let r=e.collection.filter(o=>!Je(o));for(let o=0;o<r.length;o+=1)t(r[o],o);return e},Pt=Oe(),Re=e=>e&&(e.textContent="");var _=e=>{let t=e.cloneNode(!0);return t.removeAttribute&&t.removeAttribute("id"),e.isConnected?e.remove():e=null,t},Ie=(e,t)=>{e&&c(t,Object)&&Object.entries(t).forEach(([r,o])=>e.setAttribute(`data-${D(r)}`,o))},De=(e,t)=>e.andThen(t,!0),Ne=(e,t)=>e.andThen(t),Pe=e=>e.startsWith("data")||P.html.find(t=>e.toLowerCase()===t),Jt=(e,t,r)=>{r&&c(t,String)&&(t={[t]:r==="-"?"":r});let o;t.className&&(o=t.className,delete t.className),o=[...e.classList].find(i=>i.startsWith("JQxClass-")||o&&i===o)||o||`JQxClass-${R().slice(1)}`,y.editCssRule(`.${o}`,t),e.classList.add(o)},kt=(e,t)=>{e&&Object.entries(t).forEach(([r,o])=>{if(r.toLowerCase().startsWith("data"))return Ie(e,o);c(o,String)&&Pe(r)&&e.setAttribute(r,o.split(/[, ]/)?.join(" "))})},ye=(e,t)=>{c(t,Object)&&Object.entries(t).forEach(([r,o])=>{let n;/!important/i.test(o)&&(o=o.slice(0,o.indexOf("!")).trim(),n="important"),e.style.setProperty(D(r),o,n)})},Qt={get(e,t){return e[Z(t)]||e[t]},enumerable:!1,configurable:!1},Bt=(...e)=>{C.log("\u2757"+e.map(t=>String(t)).join(", "))},be=(e,t=0,r=!0)=>(e=e?.parentElement,t+=e?e[r?"scrollTop":"scrollLeft"]:0,e?be(e,t,r):t),xe={factoryExtensions:{data:e=>({get all(){return new Proxy(e[0]?.dataset??{},Qt)},set:(t={})=>(!e.is.empty&&c(t,Object)&&Object.entries(t).forEach(([r,o])=>e.setData({[r]:o})),e),get:(t,r)=>e.data.all[t]??r,add:(t={})=>(!e.is.empty&&c(t,Object)&&Object.entries(t).forEach(([r,o])=>e.setData({[r]:o})),e),remove:t=>(e[0]?.removeAttribute(`data-${D(t)}`),e)}),dimensions:e=>{if(e.is.empty)return{error:"[instance].dimensions: NO ELEMENTS"};let t=e[0],r=e.first()?.getBoundingClientRect().toJSON();return r.scrollTopDistance=be(t,0),r.scrollLeftDistance=be(t,0,!1),r},node:e=>e[0],HTML:e=>({get:(t,r)=>{if(e.is.empty)return"NO ELEMENTS IN COLLECTION";let o=t?e.outerHtml:e.html();return r?B(o):o},set:(t,r=!1,o=!1)=>{t=t.isJQx?t.HTML.get(1):t;let n=c(t,String);return t=n&&o?B(t):t,n&&(t||"").trim().length&&e.html(t,r),e},replace:(t,r=!1)=>e.HTML.set(t,!1,r),append:(t,r=!1)=>(t=c(t,HTMLElement)?y(t).HTML.get(1):t.isJQx?t.HTML.get(1):t,e.HTML.set(t,!0,r)),insert:(t,r=!1)=>(t=c(t,HTMLElement)?y(t).HTML.get(1):t.isJQx?t.HTML.get(1):t,e.HTML.set(t+e.HTML.get(),!1,r))}),is:e=>Pt(e),length:e=>e.collection.length,outerHtml:e=>(e.first()||{outerHTML:void 0}).outerHTML,parent:e=>{let t=y(e[0]?.parentNode);return t.is.empty?e:t},render:e=>!e.is.empty&&e.toDOM()||(y.log("[JQx.render]: empty collection"),void 0),Style:e=>({get computed(){return e.is.empty?{}:getComputedStyle(e[0])},inline:t=>e.style(t),inSheet:t=>e.css(t),valueOf:t=>e.is.empty?void 0:getComputedStyle(e[0])[D(t)],nwRule:t=>e.Style.byRule({rules:t}),byRule:({classes2Apply:t=[],rules:r=[]}={})=>{let n=c(r,String)&&!t.length?r.split("{")[0].trim():"";return r=r&&c(r,String)?[r]:r,t=t&&c(t,String)?[t]:t,(r?.length||t?.length)&&(r?.length&&y.editCssRules(...r),t?.forEach(i=>e.addClass(i))),n?.startsWith(".")&&e.addClass(n.slice(1)),n?.startsWith("#")&&!e.attr("id")&&e.prop({id:n.slice(1)}),e}})},instanceExtensions:{addClass:(e,...t)=>w(e,r=>r&&t.forEach(o=>r.classList.add(o))),after:Ne,afterMe:Ne,andThen:(e,t,r=!1)=>{if(!t||!c(t,String,Node,Proxy))return Bt(`[JQx instance].[beforeMe | afterMe | andThen]: insufficient input [${t}]`),e;t=t?.isJQx?t.collection:c(t,Node)?y.virtual(t).collection:y.virtual(A(t)).collection;let[o,n,i]=r?[0,"before",t.concat(e.collection)]:[e.collection.length-1,"after",e.collection.concat(t)];return e[o][n](...t),e.collection=i,e},append:(e,...t)=>{if(!e.is.empty&&t.length){let r=e.length===1;for(let o of t){if(!o.isJQx&&c(o,String)){let n=o.trim(),f=!/^<(.+)[^>]+>$/m.test(n)?y.text(o):A(o);w(e,S=>S.append(r?f:_(f)))}Y(o)&&w(e,n=>n.append(r?o:_(o))),o.isJQx&&!o.is.empty&&w(e,n=>o.collection.forEach(i=>n.append(r?i:_(i))))}}return e},appendTo:(e,t)=>(t.isJQx||(t=y(t)),t.append(e),e),attr:(e,t,r)=>{let o=e[0];return o?!r&&c(t,String)?t==="class"?[...o?.classList].join(" "):o?.getAttribute(t):(c(t,String)&&r&&(t={[t]:r}),c(t,Object)&&!e.is.empty&&kt(o,t),e):e},before:De,beforeMe:De,clear:e=>w(e,Re),closest:(e,t)=>{let r=c(t,String)?e[0].closest(t):null;return r?y(r):e},computedStyle:(e,t)=>e.first()&&getComputedStyle(e.first())[t],css:(e,t,r)=>w(e,o=>Jt(o,t,r)),duplicate:(e,t=!1,r=document.body)=>{let o=e.toNodeList().map(i=>i.removeAttribute&&i.removeAttribute("id")||i),n=y.virtual(o);return t?n.toDOM(r):n},each:(e,t)=>w(e,t),empty:e=>w(e,Re),find:(e,t)=>e.collection.length>0?[...e.first()?.querySelectorAll(t)]:[],find$:(e,t)=>e.collection.length>0?y(t,e):e,first:(e,t=!1)=>{if(e.collection.length>0)return t?e.single():e.collection[0]},first$:(e,t)=>e.single(t),getData:(e,t,r)=>e.first()&&e.first().dataset?.[t]||r,hasClass:(e,...t)=>{let r=e[0];return!r||!r.classList.length?!1:t.find(o=>r.classList.contains(o))&&!0||!1},hide:e=>w(e,t=>ye(t,{display:"none !important"})),html:(e,t,r)=>{if(t===void 0)return e[0]?.getHTML();if(!e.isEmpty()){let o=A(`<div>${t.isJQx?t.HTML.get(!0):t}</div>`);if(!c(o,Comment))return w(e,i=>(r||(i.textContent=""),i.insertAdjacentHTML(y.at.end,o.getHTML())))}return e},htmlFor:(e,t,r="",o=!1)=>{if(t&&e.collection.length){if(!t||!c(r,String))return e;let n=e.find$(t);if(n.length<1)return e;let i=A(`<span>${r}</span>`);n.each(f=>{o||(f.textContent=""),f.insertAdjacentHTML(y.at.end,i.getHTML())})}return e},isEmpty:e=>e.collection.length<1,nth$:(e,t)=>e.single(t),on:(e,t,...r)=>(e.collection.length&&r?.forEach(o=>{let n=ke(e);y.delegate(t,n,o)}),e),prepend:(e,...t)=>{if(!e.is.empty&&t){let r=e.length===1;for(let o of t){if(c(o,String)){o=o.trim();let i=!/^<(.+)[^>]+>$/m.test(o)?y.text(o):A(o);i=r?i:_(i),w(e,f=>f.prepend(i.cloneNode(!0)))}Y(o)&&w(e,n=>n.prepend(r?o:_(o))),o.isJQx&&!o.is.empty&&(o.collection.length>1&&o.collection.reverse(),w(e,n=>w(o,i=>n.prepend(r?i:_(i)))),o.collection.reverse())}}return e},prependTo:(e,t)=>(t.isJQx||(t=y.virtual(t)),t.prepend(e),e),prop:(e,t,r)=>{if(c(t,String)&&!r)return t.startsWith("data")?e[0]?.dataset[t.slice(t.indexOf("-")+1)]:e[0]?.[t];let o=c(t,Object)?t:{[t]:r};return Object.entries(o).forEach(([n,i])=>{if(n=n.trim(),i&&!Pe(n)||!i)return!1;if(n.toLowerCase()==="id")return e[0].id=i;w(e,S=>{if(n.startsWith("data"))return S.dataset[n.slice(n.indexOf("-")+1)]=i;S[n]=i})}),e},remove:(e,t)=>{O(`remove ${M(e.HTML.get(1),40)}${t?` /w selector ${t}`:""}`);let r=n=>n.remove(),o=()=>e.collection=e.collection.filter(n=>document.documentElement.contains(n));if(t){let n=e.find$(t);return n.is.empty||(w(n,r),o()),e}return w(e,r),o(),e},removeAttribute:(e,t)=>w(e,r=>r.removeAttribute(t)),removeClass:(e,...t)=>w(e,r=>r&&t.forEach(o=>r.classList.remove(o))),renderTo:(e,t=document.body,r=y.insertPositions.end)=>(e.appendTo(t,r),e),replace:(e,t,r)=>{let o=e[0];return!t||!r||!c(r,HTMLElement)&&!r.isJQx?(console.error("JQx replace: invalid replacement value"),e):(r.isJQx&&(r=r[0]),c(r,NodeList)&&(r=r[0]),o&&t&&(t=c(t,String)?o.querySelectorAll(t):t.isJQx?t.collection:t,c(t,HTMLElement,NodeList,Array)&&c(r,HTMLElement)&&(c(t,HTMLElement)?[t]:[...t]).forEach(n=>n.replaceWith(r.cloneNode(!0)))),e)},replaceClass:(e,t,...r)=>w(e,o=>{o.classList.remove(t),r.forEach(n=>o.classList.add(n))}),replaceMe:(e,t)=>e.replaceWith(t),replaceWith:(e,t)=>(t=c(t,Element)?t:t.isJQx?t[0]:void 0,t&&(e[0].replaceWith(t),e=y.virtual(t)),e),setData:(e,t)=>w(e,r=>Ie(r,t)),show:e=>w(e,t=>ye(t,{display:"revert-layer !important"})),single:(e,t)=>e.collection.length>0?c(t,String)?e.find$(t):c(t,Number)?y(e.collection[t]):y(e.collection[0]):e,style:(e,t,r)=>w(e,n=>{r&&c(t,String)&&(t={[t]:r||"none"}),ye(n,t)}),text:(e,t,r=!1)=>e.isEmpty()?e:c(t,String)?w(e,n=>n.textContent=r?n.textContent+t:t):e.first().textContent,toDOM:(e,t=document.body,r=F.BeforeEnd)=>(e.isVirtual&&(e.isVirtual=!1),e.collection=z(e.collection,t,r),e),toggleClass:(e,t)=>w(e,r=>r.classList.toggle(t)),toNodeList:e=>[...e.collection].map(t=>document.importNode(t,!0)),trigger:(e,t,r=Event,o={})=>{if(e.collection.length){let n=new r(t,{...o,bubbles:o.bubbles??!0});for(let i of e.collection)i.dispatchEvent(n)}return e},val:(e,t)=>{let r=e[0];return!r||!c(r,HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement)?e:t===void 0?r.value:(r.value=c(t,String)?t:"",e)}}};var Qe=zt;function zt(e){let t=e.createStyle("JQxPopupCSS");Ee.forEach(s=>t(s));let r={},o,n,i,f=e.virtual('<div class="popup-warn">'),S=e('<div class="popupContainer">').append(e('<span class="closeHandleIcon">')).append(e('<div class="content">')),[E,b]=[e(".popupContainer > .closeHandleIcon"),e(".popupContainer > .content")],L=()=>{if(E.hasClass("popup-active")){let{x:s,y:d,width:v}=b.dimensions;E.style({top:`${d-12}px`,left:`${s+v-12}px`})}},T=()=>{n&&e(".popup-warn").clear().append(e(`<div>${n}</div>`)),b.addClass("popup-warn-active")},g=()=>{o=!1,p(E.first())},x=(s,d)=>i=setTimeout(()=>p(E[0]),+s*1e3);return e.delegate("click",".popupContainer, .closeHandleIcon",s=>p(s.target)),e.delegate("click",".popupContainer .content",(s,d)=>o&&d.removeClass("popup-warn-active")),e.delegate("resize",L),{show:u,create:(s,d,v,l)=>{let a=e.IS(d,Boolean)?d:!1;u({content:s,modal:a,callback:a?v:d,warnMessage:l})},createTimed:(s,d,v)=>u({content:s,closeAfter:d,callback:v}),removeModal:g};function u({content:s,modal:d,closeAfter:v,callback:l,warnMessage:a}){if(s){if(s=e.IS(s,Node)?jqx(s):s,clearTimeout(i),o=d??!1,n=e.IS(a,String)&&`${a?.trim()}`.length||a?.isJQx?a:void 0,b.clear().append(s.isJQx?s:e(`<div>${s}</div>`)),o&&a&&b.append(f.duplicate()),S.addClass("popup-active"),e.IS(l,Function)){let m=R();S.data.set({callbackId:m}),r[m]=l}if(!o){if(e.IS(+v,Number)){let m=S.data.get("callbackId"),h=m&&r[m];x(v,h)}E.addClass("popup-active"),L()}return!0}return console.error("Popup creation needs at least some text to show")}function p(s){if(!o&&!s.closest(".content")){clearTimeout(i),b.clear();let d=S.data.get("callbackId");S.data.remove("callbackId"),e(".popup-active").removeClass("popup-active");let v=d&&r[d];e.IS(v,Function)&&v(),d&&delete r[d],n="";return}return o&&T()}}var N={},_t=["load","unload","scroll","focus","blur","DOMNodeRemovedFromDocument","DOMNodeInsertedIntoDocument","loadstart","progress","error","abort","load","loadend","pointerenter","pointerleave","readystatechange"],Wt=e=>!!_t.find(t=>t===e),Be=()=>{let e=o=>N[o.type].forEach(n=>n(o)),t=(o,n)=>i=>{let f=i.target?.closest?.(o);return f&&n(i,y(f))},r=(o,n)=>{N[o]||addEventListener(o,e,Wt(o))};return(o,n,i,f=!1)=>{r(o,f);let S=n?t(n,i):i;N=N[o]?{...N,[o]:N[o].concat(S)}:{...N,[o]:[S]}}};var qt={},{instanceMethods:ze,instanceGetters:_e,isCommentOrTextNode:Je,isNode:Y,isHtmlString:qe,isArrayOfHtmlElements:Ue,isArrayOfHtmlStrings:Ge,ElemArray2HtmlString:Ve,input2Collection:Ze,setCollectionFromCssSelector:Xe,addHandlerId:ke,cssRuleEdit:Se,addFn:Ut,elems4Docs:no}=Gt();function Gt(){let e=V({createWithId:"JQxStylesheet"}),t=(s,d)=>r[s]=(v,...l)=>d(v,...l),r=xe.instanceExtensions,o=xe.factoryExtensions,n=s=>c(s,Comment,Text),i=s=>c(s,Text,HTMLElement,Comment),f=s=>c(s,Comment),S=s=>c(s,Text),E=s=>c(s,String)&&/^<|>$/.test(`${s}`.trim()),b=s=>c(s,Array)&&!s?.find(d=>!E(d)),L=s=>c(s,Array)&&!s?.find(d=>!i(d)),T=s=>s?.filter(d=>d).reduce((d,v)=>d.concat(f(v)?`<!--${v.data}-->`:n(v)?v.textContent:v.outerHTML),""),g=s=>s?c(s,Proxy)?[s.EL]:c(s,NodeList)?[...s]:i(s)?[s]:L(s)?s:s.isJQx?s.collection:void 0:[],x=(s,d,v)=>{let l=d!==document.body&&c(s,String)&&s.toLowerCase()!=="body"?d:document,a;try{v.collection=[...l.querySelectorAll(s)]}catch{a=`Invalid CSS querySelector. [${c(s,String)?s:"Nothing valid given!"}]`}return a??`CSS querySelector "${s}", output ${v.collection.length} element(s)`},u=s=>{let d=s.data.get("hid")||`HID${R()}`;return s.data.add({hid:d}),`[data-hid="${d}"]`},p=Object.entries(j.tagsRaw).filter(([,s])=>s).map(([s])=>s).sort((s,d)=>s.localeCompare(d));return{instanceMethods:r,instanceGetters:o,isCommentOrTextNode:n,isNode:i,isComment:f,isText:S,isHtmlString:E,isArrayOfHtmlElements:L,isArrayOfHtmlStrings:b,ElemArray2HtmlString:T,input2Collection:g,setCollectionFromCssSelector:x,addHandlerId:u,cssRuleEdit:e,addFn:t,elems4Docs:p}}function W(e){return new Proxy(e,{get:(t,r)=>Xt(t,r,e)})}function Vt(e,t){return(...r)=>c(e,Function)&&e(W(t),...r)}function Zt(e,t){return(...r)=>c(e,Function)&&e(W(t),...r)}function Xt(e,t,r){switch(!0){case c(t,Symbol):return e;case c(+t,Number):return e.collection?.[t]||`ELEMENT WITH INDEX ${t} NOT FOUND`;case t in _e:return Zt(_e[t],r)();case t in ze:return Vt(ze[t],r);default:return e[t]}}function Ye(e){let t=nr(e);return Object.entries(Object.getOwnPropertyDescriptors(t)).forEach(([r,o])=>{Object.defineProperty(e,r,o),Object.defineProperty(qt,r,o)}),e}function Yt(e){return{allow:t=>{let r=/-/.test(t),o=r&&t;t=r?Z(t):t.toLowerCase(),j.allowTag(t),c(e[t],Function)||Object.defineProperties(e,ve(t,!0,e,o))},prohibit:t=>{t=t.toLowerCase(),j.prohibitTag(t),c(e[t],Function)&&Object.defineProperties(e,ve(t,!1,e))}}}function We(...e){if(e.length===1){let t=String(e.shift().trim());e=t.startsWith("!")?[t.slice(1,-1)]:t.split(",").map(r=>r.trim())}e.map(t=>t.startsWith("!")?t.slice(1,-1):t).forEach(t=>Se(t,{removeRule:1}))}function Kt(e){return function(t,r,...o){return c(r,Function)&&(o.push(r),r=void 0),o.forEach(n=>e(t,r,n))}}function er(e){return function(t,r,o){r=r?.isJQx?r?.[0]:r,o=o&&Object.values(F).find(i=>o===i)?o:void 0;let n=e(t,document.createElement("br"));return r&&!c(r,HTMLBRElement)&&n.collection.forEach(i=>o?r.insertAdjacentElement(o,i):r.append(i)),n}}function tr(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.entries(o).forEach(([n,i])=>!(n in t)&&Object.defineProperty(t,n,i))}return t}function rr(e){console.error(`JQx: "${e}" not allowed, not rendered`)}function or(e,t,r,o){return e=D(o||e.toLowerCase()),{get(){return(...n)=>t?r.virtual(X(me[e](...n))):rr(e)},enumerable:!1,configurable:!0}}function ve(e,t,r,o){e=e.toLowerCase();let n=or(e,t,r,o);return o?{[o]:n,[Z(o)]:n}:{[e]:n,[e.toUpperCase()]:n}}function nr(e){return tr(Object.entries(j.tagsRaw).reduce(ir(e),{}),sr(e))}function ir(e){return function(t,[r,o]){return o&&Object.defineProperties(t,ve(r,o,e)),t}}function sr(e){let t=(o,n)=>Se(o,n),r=Yt(e);return{debugLog:C,log:(...o)=>H("fromStatic",...o),insertPositions:F,get at(){return F},editCssRules:(...o)=>o.forEach(n=>Se(n)),editCssRule:t,get setStyle(){return t},delegate:Kt(Be()),virtual:er(e),get fn(){return Ut},allowTag:r.allow,prohibitTag:r.prohibit,get lenient(){return j.allowUnknownHtmlTags},get IS(){return c},get Popup(){return e.activePopup||Object.defineProperty(e,"activePopup",{value:Qe(e),enumerable:!1}),e.activePopup},popup:()=>e.Popup,createStyle:o=>V({createWithId:o||`jqx${R()}`}),editStylesheet:o=>V({createWithId:o||`jqx${R()}`}),removeCssRule:We,removeCssRules:We,text:(o,n=!1)=>n?e.comment(o):document.createTextNode(o),node:(o,n=document)=>n.querySelector(o,n),nodes:(o,n=document)=>[...n.querySelectorAll(o,n)]}}var y=Ye(lr());function lr(){return function(r,o,n=F.BeforeEnd){if(r?.isJQx)return r;let i=c(o,HTMLBRElement);o=(!i&&o&&o.isJQx?o[0]:o)||document.body,n=n&&Object.values(F).find(x=>n===x)?n:void 0;let f=qe(r),S=!f&&Ge(r),E=S||f,b={collection:Ze(r)??[],isVirtual:i,isJQx:!0},L=Ue(b.collection),T=`input =&gt; ${S?`"${M(r.join(", "),70)}"`:!E&&L?`element collection [${M(b.collection.map(x=>`${c(x,Comment,Text)?"Comment|Text @":""} ${x?.outerHTML||x?.textContent}`).join(", "),70)}]`:`"${M(r,70)}"`}`;if(b.collection.length&&L)return O(T),i||b.collection.forEach(x=>{o.contains(x)||z([x],o,n)}),W(b);if(E){if([r].flat().forEach(x=>b.collection.push(A(x))),b.collection.length>0){let x=b.collection.filter(u=>u?.dataset?.jqxcreationerror);b.collection=b.collection.filter(u=>!u?.dataset?.jqxcreationerror),O(`${T}`),O(`*Created ${b.isVirtual?"VIRTUAL ":""}[${M(Ve(b.collection)||"sanitized: no elements remaining",70)}]`),x.length&&console.error(`JQx: illegal html, not rendered: "${x.reduce((u,p)=>u.concat(`${p.textContent}
14
+ `)}function Tt(e){return e.reduce((t,r)=>{let[o,n]=[r.slice(0,r.indexOf(":")).trim(),r.slice(r.indexOf(":")+1).trim().replace(/;$|;.+(?=\/*).+\/$/,"")];return o&&n?{...t,[o]:n}:t},{})}function Ft(e){return Tt($t(e))}function je(e,t){return e?.replace("::",":")===t?.replace("::",":")}var Ht=[...Array(26)].map((e,t)=>String.fromCharCode(t+65)).concat([...Array(26)].map((e,t)=>String.fromCharCode(t+97))).concat([...Array(10)].map((e,t)=>`${t}`)),K=(e,t=2)=>`${e}`.padStart(t,"0"),At=(e,t=0)=>([e,t]=[Math.floor(e),Math.ceil(t)],Math.floor([...crypto.getRandomValues(new Uint32Array(1))].shift()/2**32*(e-t+1)+t)),Mt=e=>{let t=e.length;for(;t--;){let r=At(t);[e[t],e[r]]=[e[r],e[t]]}return e};var M=(e,t=120)=>`${e}`.trim().slice(0,t).replace(/>\s+</g,"><").replace(/</g,"&lt;").replace(/\s{2,}/g," ").replace(/\n/g,"\\n")+(e.length>t?" &hellip;":"").trim(),D=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`).replace(/^-|-$/,""),jt=([e,...t])=>`${e.toUpperCase()}${t.join("")}`,Z=e=>c(e,String)?e.toLowerCase().split("-").map((t,r)=>r&&`${jt(t)}`||t).join(""):e,R=()=>`_${Mt(Ht).slice(0,8).join("")}`,ee=(e,t=120)=>M(e,t).replace(/&lt;/g,"<"),Q=()=>(e=>`[${K(e.getHours())}:${K(e.getMinutes())}:${K(e.getSeconds())}.${K(e.getMilliseconds(),3)}]`)(new Date);var B=e=>e.replace(/</g,"&lt;");function Oe(){let e=function(i){if(!i)return;let f=i.style,S=getComputedStyle(i),E=[f.visibility,S.visibility].includes("hidden"),b=[f.display,S.display].includes("none"),L=i.offsetTop<0||i.offsetLeft+i.offsetWidth<0||i.offsetLeft>document.body.offsetWidth,T=+S.opacity==0||+(f.opacity||1)==0;return!(L||T||b||E)},t="n/a",r=function(i){return i.parentNode?!!y.nodes(":is(:read-write)",i?.parentNode)?.find(f=>f===i):!1},o=function(i){return i.parentNode?!!y.nodes(":is(:modal)",i?.parentNode)?.find(f=>f===i):!1},n={notInDOM:!0,writable:t,modal:t,empty:!0,open:t,visible:t};return i=>{let f=i[0];return f?{get writable(){return r(f)},get modal(){return o(f)},get inDOM(){return!!f.parentNode},get open(){return f.open??!1},get visible(){return e(f)},get disabled(){return f.hasAttribute("readonly")||f.hasAttribute("disabled")},get empty(){return i.collection.length<1},get virtual(){return i.isVirtual}}:n}}var Ot=!0,te={data:/data-[\-\w.\p{L}]/ui,validURL:/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,whiteSpace:/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g,notAllowedValues:/javascript|injected|noreferrer|alert|DataURL/gi},Rt=e=>{if(Ot&&Object.keys(e.removed).length){let t=Object.entries(e.removed).reduce((r,[o,n])=>[...r,`${B(o)} => ${n}`],[]).join("\\000A");C.log(`JQx HTML creation errors: ${C.isConsole?t:B(t)}`)}},Dt=function(e){let t=e.nodeName.toLowerCase(),r=["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"];return/-/.test(t)&&!r.find(o=>o===t)||j.isAllowed(t)},X=e=>{let t={rawHTML:e?.parentElement?.getHTML()??"no html",removed:{}};return c(e,HTMLElement)&&[...e.childNodes].forEach(r=>{if(r?.children?.length&&X(r),r?.attributes){let n=c(r,SVGElement)?P.svg:P.html;[...(r??{attributes:[]}).attributes].forEach(i=>{let f=i.name.trim().toLowerCase(),S=i.value.trim().toLowerCase().replace(te.whiteSpace,""),E=f==="href"?!te.validURL.test(S):te.notAllowedValues.test(S),b=f.startsWith("data")?!te.data.test(f):!!n[f];if(E||b){let L=ee(i.value||"none",60);L+=L.length===60?"...":"",t.removed[`${i.name}`]=`attribute/property (-value) not allowed, removed. Value: ${L}`,r.removeAttribute(i.name)}})}if(!(Dt(r)||r.constructor===CharacterData||r.constructor===Comment)){let n=(r?.outerHTML||r?.textContent).trim(),i=ee(n,60)??"EMPTY";i+=i.length===60?"...":"",t.removed[`<${r.nodeName?.toLowerCase()}>`]=`not allowed, not rendered. Value: ${i}`,r.remove()}}),Rt(t),e};var F=new Proxy({start:"afterbegin",afterbegin:"afterbegin",end:"beforeend",beforeend:"beforeend",before:"beforebegin",beforebegin:"beforebegin",after:"afterend",afterend:"afterend"},{get(e,t){return e[String(t).toLowerCase()]??e[t]}}),Nt=e=>{let t=document.createElement("div");return t.insertAdjacentHTML(F.end,e),t.childNodes.length?X(t):void 0},It=(e,t,r)=>c(e,Comment)?t.insertAdjacentHTML(r,`<!--${e.data}-->`):t.insertAdjacentText(r,e.data),z=(e=[],t=document.body,r=F.BeforeEnd)=>e.reduce((o,n)=>{let i=Y(n)&&fe(n,t,r);return i?[...o,i]:o},[]),fe=(e,t=document.body,r=F.BeforeEnd)=>(t=t?.isJQx?t?.[0]:t,c(e,Comment,Text)?It(e,t,r):t.insertAdjacentElement(r,e)),A=e=>{if(c(e,Text,Comment))return e;let t=e?.trim(),r=t?.split(/<text>|<\/text>/i)??[];if(r?.length&&(r=r.length>1?r.filter(n=>n.length).shift():void 0),t.startsWith("<!--")&&t.endsWith("-->"))return document.createComment(e.replace(/<!--|-->$/g,""));if(r||!/^<(.+)[^>]+>/m.test(t))return document.createTextNode(r);let o=Nt(e);return o.childNodes.length<1?A(`<span data-jqxcreationerror="1">${M(e,60)}</span>`):o.children[0]};var w=(e,t)=>{let r=e.collection.filter(o=>!Je(o));for(let o=0;o<r.length;o+=1)t(r[o],o);return e},Pt=Oe(),Re=e=>e&&(e.textContent="");var _=e=>{let t=e.cloneNode(!0);return t.removeAttribute&&t.removeAttribute("id"),e.isConnected?e.remove():e=null,t},Ie=(e,t)=>{e&&c(t,Object)&&Object.entries(t).forEach(([r,o])=>e.setAttribute(`data-${D(r)}`,o))},De=(e,t)=>e.andThen(t,!0),Ne=(e,t)=>e.andThen(t),Pe=e=>e.startsWith("data")||P.html.find(t=>e.toLowerCase()===t),Jt=(e,t,r)=>{r&&c(t,String)&&(t={[t]:r==="-"?"":r});let o;t.className&&(o=t.className,delete t.className),o=[...e.classList].find(i=>i.startsWith("JQxClass-")||o&&i===o)||o||`JQxClass-${R().slice(1)}`,y.editCssRule(`.${o}`,t),e.classList.add(o)},kt=(e,t)=>{e&&Object.entries(t).forEach(([r,o])=>{if(r.toLowerCase().startsWith("data"))return Ie(e,o);c(o,String)&&Pe(r)&&e.setAttribute(r,o.split(/[, ]/)?.join(" "))})},ye=(e,t)=>{c(t,Object)&&Object.entries(t).forEach(([r,o])=>{let n;/!important/i.test(o)&&(o=o.slice(0,o.indexOf("!")).trim(),n="important"),e.style.setProperty(D(r),o,n)})},Qt={get(e,t){return e[Z(t)]||e[t]},enumerable:!1,configurable:!1},Bt=(...e)=>{C.log("\u2757"+e.map(t=>String(t)).join(", "))},be=(e,t=0,r=!0)=>(e=e?.parentElement,t+=e?e[r?"scrollTop":"scrollLeft"]:0,e?be(e,t,r):t),xe={factoryExtensions:{data:e=>({get all(){return new Proxy(e[0]?.dataset??{},Qt)},set:(t={})=>(!e.is.empty&&c(t,Object)&&Object.entries(t).forEach(([r,o])=>e.setData({[r]:o})),e),get:(t,r)=>e.data.all[t]??r,add:(t={})=>(!e.is.empty&&c(t,Object)&&Object.entries(t).forEach(([r,o])=>e.setData({[r]:o})),e),remove:t=>(e[0]?.removeAttribute(`data-${D(t)}`),e)}),dimensions:e=>{if(e.is.empty)return{error:"[instance].dimensions: NO ELEMENTS"};let t=e[0],r=e.first()?.getBoundingClientRect().toJSON();return r.scrollTopDistance=be(t,0),r.scrollLeftDistance=be(t,0,!1),r},node:e=>e[0],HTML:e=>({get:(t,r)=>{if(e.is.empty)return"NO ELEMENTS IN COLLECTION";let o=t?e.outerHtml:e.html();return r?B(o):o},set:(t,r=!1,o=!1)=>{t=t.isJQx?t.HTML.get(1):t;let n=c(t,String);return t=n&&o?B(t):t,n&&(t||"").trim().length&&e.html(t,r),e},replace:(t,r=!1)=>e.HTML.set(t,!1,r),append:(t,r=!1)=>(t=c(t,HTMLElement)?y(t).HTML.get(1):t.isJQx?t.HTML.get(1):t,e.HTML.set(t,!0,r)),insert:(t,r=!1)=>(t=c(t,HTMLElement)?y(t).HTML.get(1):t.isJQx?t.HTML.get(1):t,e.HTML.set(t+e.HTML.get(),!1,r))}),is:e=>Pt(e),length:e=>e.collection.length,outerHtml:e=>(e.first()||{outerHTML:void 0}).outerHTML,parent:e=>{let t=y(e[0]?.parentNode);return t.is.empty?e:t},render:e=>!e.is.empty&&e.toDOM()||(y.log("[JQx.render]: empty collection"),void 0),Style:e=>({get computed(){return e.is.empty?{}:getComputedStyle(e[0])},inline:t=>e.style(t),inSheet:t=>e.css(t),valueOf:t=>e.is.empty?void 0:getComputedStyle(e[0])[D(t)],nwRule:t=>e.Style.byRule({rules:t}),byRule:({classes2Apply:t=[],rules:r=[]}={})=>{let n=c(r,String)&&!t.length?r.split("{")[0].trim():"";return r=r&&c(r,String)?[r]:r,t=t&&c(t,String)?[t]:t,(r?.length||t?.length)&&(r?.length&&y.editCssRules(...r),t?.forEach(i=>e.addClass(i))),n?.startsWith(".")&&e.addClass(n.slice(1)),n?.startsWith("#")&&!e.attr("id")&&e.prop({id:n.slice(1)}),e}})},instanceExtensions:{addClass:(e,...t)=>w(e,r=>r&&t.forEach(o=>r.classList.add(o))),after:Ne,afterMe:Ne,andThen:(e,t,r=!1)=>{if(!t||!c(t,String,Node,Proxy))return Bt(`[JQx instance].[beforeMe | afterMe | andThen]: insufficient input [${t}]`),e;t=t?.isJQx?t.collection:c(t,Node)?y.virtual(t).collection:y.virtual(A(t)).collection;let[o,n,i]=r?[0,"before",t.concat(e.collection)]:[e.collection.length-1,"after",e.collection.concat(t)];return e[o][n](...t),e.collection=i,e},append:(e,...t)=>{if(!e.is.empty&&t.length){let r=e.length===1;for(let o of t){if(!o.isJQx&&c(o,String)){let n=o.trim(),f=!/^<(.+)[^>]+>$/m.test(n)?y.text(o):A(o);w(e,S=>S.append(r?f:_(f)))}Y(o)&&w(e,n=>n.append(r?o:_(o))),o.isJQx&&!o.is.empty&&w(e,n=>o.collection.forEach(i=>n.append(r?i:_(i))))}}return e},appendTo:(e,t)=>(t.isJQx||(t=y(t)),t.append(e),e),attr:(e,t,r)=>{let o=e[0];return o?!r&&c(t,String)?t==="class"?[...o?.classList].join(" "):o?.getAttribute(t):(c(t,String)&&r&&(t={[t]:r}),c(t,Object)&&!e.is.empty&&kt(o,t),e):e},before:De,beforeMe:De,clear:e=>w(e,Re),closest:(e,t)=>{let r=c(t,String)?e[0].closest(t):null;return r?y(r):e},computedStyle:(e,t)=>e.first()&&getComputedStyle(e.first())[t],css:(e,t,r)=>w(e,o=>Jt(o,t,r)),duplicate:(e,t=!1,r=document.body)=>{let o=e.toNodeList().map(i=>i.removeAttribute&&i.removeAttribute("id")||i),n=y.virtual(o);return t?n.toDOM(r):n},each:(e,t)=>w(e,t),empty:e=>w(e,Re),find:(e,t)=>e.collection.length>0?[...e.first()?.querySelectorAll(t)]:[],find$:(e,t)=>e.collection.length>0?y(t,e):e,first:(e,t=!1)=>{if(e.collection.length>0)return t?e.single():e.collection[0]},first$:(e,t)=>e.single(t),getData:(e,t,r)=>e.first()&&e.first().dataset?.[t]||r,hasClass:(e,...t)=>{let r=e[0];return!r||!r.classList.length?!1:t.find(o=>r.classList.contains(o))&&!0||!1},hide:e=>w(e,t=>ye(t,{display:"none !important"})),html:(e,t,r)=>{if(t===void 0)return e[0]?.getHTML();if(!e.isEmpty()){let o=A(`<div>${t.isJQx?t.HTML.get(!0):t}</div>`);if(!c(o,Comment))return w(e,i=>(r||(i.textContent=""),i.insertAdjacentHTML(y.at.end,o.getHTML())))}return e},htmlFor:(e,t,r="",o=!1)=>{if(t&&e.collection.length){if(!t||!c(r,String))return e;let n=e.find$(t);if(n.length<1)return e;let i=A(`<span>${r}</span>`);n.each(f=>{o||(f.textContent=""),f.insertAdjacentHTML(y.at.end,i.getHTML())})}return e},isEmpty:e=>e.collection.length<1,nth$:(e,t)=>e.single(t),on:(e,t,...r)=>(e.collection.length&&r?.forEach(o=>{let n=ke(e);y.delegate(t,n,o)}),e),prepend:(e,...t)=>{if(!e.is.empty&&t){let r=e.length===1;for(let o of t){if(c(o,String)){o=o.trim();let i=!/^<(.+)[^>]+>$/m.test(o)?y.text(o):A(o);i=r?i:_(i),w(e,f=>f.prepend(i.cloneNode(!0)))}Y(o)&&w(e,n=>n.prepend(r?o:_(o))),o.isJQx&&!o.is.empty&&(o.collection.length>1&&o.collection.reverse(),w(e,n=>w(o,i=>n.prepend(r?i:_(i)))),o.collection.reverse())}}return e},prependTo:(e,t)=>(t.isJQx||(t=y.virtual(t)),t.prepend(e),e),prop:(e,t,r)=>{if(c(t,String)&&!r)return t.startsWith("data")?e[0]?.dataset[t.slice(t.indexOf("-")+1)]:e[0]?.[t];let o=c(t,Object)?t:{[t]:r};return Object.entries(o).forEach(([n,i])=>{if(n=n.trim(),i&&!Pe(n)||!i)return!1;if(n.toLowerCase()==="id")return e[0].id=i;w(e,S=>{if(n.startsWith("data"))return S.dataset[n.slice(n.indexOf("-")+1)]=i;S[n]=i})}),e},remove:(e,t)=>{O(`remove ${M(e.HTML.get(1),40)}${t?` /w selector ${t}`:""}`);let r=n=>n.remove(),o=()=>e.collection=e.collection.filter(n=>document.documentElement.contains(n));if(t){let n=e.find$(t);return n.is.empty||(w(n,r),o()),e}return w(e,r),o(),e},removeAttribute:(e,t)=>w(e,r=>r.removeAttribute(t)),removeClass:(e,...t)=>w(e,r=>r&&t.forEach(o=>r.classList.remove(o))),renderTo:(e,t=document.body,r=y.insertPositions.end)=>(e.toDOM(t,r),e),replace:(e,t,r)=>{let o=e[0];return!t||!r||!c(r,HTMLElement)&&!r.isJQx?(console.error("JQx replace: invalid replacement value"),e):(r.isJQx&&(r=r[0]),c(r,NodeList)&&(r=r[0]),o&&t&&(t=c(t,String)?o.querySelectorAll(t):t.isJQx?t.collection:t,c(t,HTMLElement,NodeList,Array)&&c(r,HTMLElement)&&(c(t,HTMLElement)?[t]:[...t]).forEach(n=>n.replaceWith(r.cloneNode(!0)))),e)},replaceClass:(e,t,...r)=>w(e,o=>{o.classList.remove(t),r.forEach(n=>o.classList.add(n))}),replaceMe:(e,t)=>e.replaceWith(t),replaceWith:(e,t)=>(t=c(t,Element)?t:t.isJQx?t[0]:void 0,t&&(e[0].replaceWith(t),e=y.virtual(t)),e),setData:(e,t)=>w(e,r=>Ie(r,t)),show:e=>w(e,t=>ye(t,{display:"revert-layer !important"})),single:(e,t)=>e.collection.length>0?c(t,String)?e.find$(t):c(t,Number)?y(e.collection[t]):y(e.collection[0]):e,style:(e,t,r)=>w(e,n=>{r&&c(t,String)&&(t={[t]:r||"none"}),ye(n,t)}),text:(e,t,r=!1)=>e.isEmpty()?e:c(t,String)?w(e,n=>n.textContent=r?n.textContent+t:t):e.first().textContent,toDOM:(e,t=document.body,r=F.BeforeEnd)=>(e.isVirtual&&(e.isVirtual=!1),e.collection=z(e.collection,t,r),e),toggleClass:(e,t)=>w(e,r=>r.classList.toggle(t)),toNodeList:e=>[...e.collection].map(t=>document.importNode(t,!0)),trigger:(e,t,r=Event,o={})=>{if(e.collection.length){let n=new r(t,{...o,bubbles:o.bubbles??!0});for(let i of e.collection)i.dispatchEvent(n)}return e},val:(e,t)=>{let r=e[0];return!r||!c(r,HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement)?e:t===void 0?r.value:(r.value=c(t,String)?t:"",e)}}};var Qe=zt;function zt(e){let t=e.createStyle("JQxPopupCSS");Ee.forEach(s=>t(s));let r={},o,n,i,f=e.virtual('<div class="popup-warn">'),S=e('<div class="popupContainer">').append(e('<span class="closeHandleIcon">')).append(e('<div class="content">')),[E,b]=[e(".popupContainer > .closeHandleIcon"),e(".popupContainer > .content")],L=()=>{if(E.hasClass("popup-active")){let{x:s,y:d,width:v}=b.dimensions;E.style({top:`${d-12}px`,left:`${s+v-12}px`})}},T=()=>{n&&e(".popup-warn").clear().append(e(`<div>${n}</div>`)),b.addClass("popup-warn-active")},g=()=>{o=!1,p(E.first())},x=(s,d)=>i=setTimeout(()=>p(E[0]),+s*1e3);return e.delegate("click",".popupContainer, .closeHandleIcon",s=>p(s.target)),e.delegate("click",".popupContainer .content",(s,d)=>o&&d.removeClass("popup-warn-active")),e.delegate("resize",L),{show:u,create:(s,d,v,l)=>{let a=e.IS(d,Boolean)?d:!1;u({content:s,modal:a,callback:a?v:d,warnMessage:l})},createTimed:(s,d,v)=>u({content:s,closeAfter:d,callback:v}),removeModal:g};function u({content:s,modal:d,closeAfter:v,callback:l,warnMessage:a}){if(s){if(s=e.IS(s,Node)?jqx(s):s,clearTimeout(i),o=d??!1,n=e.IS(a,String)&&`${a?.trim()}`.length||a?.isJQx?a:void 0,b.clear().append(s.isJQx?s:e(`<div>${s}</div>`)),o&&a&&b.append(f.duplicate()),S.addClass("popup-active"),e.IS(l,Function)){let m=R();S.data.set({callbackId:m}),r[m]=l}if(!o){if(e.IS(+v,Number)){let m=S.data.get("callbackId"),h=m&&r[m];x(v,h)}E.addClass("popup-active"),L()}return!0}return console.error("Popup creation needs at least some text to show")}function p(s){if(!o&&!s.closest(".content")){clearTimeout(i),b.clear();let d=S.data.get("callbackId");S.data.remove("callbackId"),e(".popup-active").removeClass("popup-active");let v=d&&r[d];e.IS(v,Function)&&v(),d&&delete r[d],n="";return}return o&&T()}}var N={},_t=["load","unload","scroll","focus","blur","DOMNodeRemovedFromDocument","DOMNodeInsertedIntoDocument","loadstart","progress","error","abort","load","loadend","pointerenter","pointerleave","readystatechange"],Wt=e=>!!_t.find(t=>t===e),Be=()=>{let e=o=>N[o.type].forEach(n=>n(o)),t=(o,n)=>i=>{let f=i.target?.closest?.(o);return f&&n(i,y(f))},r=(o,n)=>{N[o]||addEventListener(o,e,Wt(o))};return(o,n,i,f=!1)=>{r(o,f);let S=n?t(n,i):i;N=N[o]?{...N,[o]:N[o].concat(S)}:{...N,[o]:[S]}}};var qt={},{instanceMethods:ze,instanceGetters:_e,isCommentOrTextNode:Je,isNode:Y,isHtmlString:qe,isArrayOfHtmlElements:Ue,isArrayOfHtmlStrings:Ge,ElemArray2HtmlString:Ve,input2Collection:Ze,setCollectionFromCssSelector:Xe,addHandlerId:ke,cssRuleEdit:Se,addFn:Ut,elems4Docs:no}=Gt();function Gt(){let e=V({createWithId:"JQxStylesheet"}),t=(s,d)=>r[s]=(v,...l)=>d(v,...l),r=xe.instanceExtensions,o=xe.factoryExtensions,n=s=>c(s,Comment,Text),i=s=>c(s,Text,HTMLElement,Comment),f=s=>c(s,Comment),S=s=>c(s,Text),E=s=>c(s,String)&&/^<|>$/.test(`${s}`.trim()),b=s=>c(s,Array)&&!s?.find(d=>!E(d)),L=s=>c(s,Array)&&!s?.find(d=>!i(d)),T=s=>s?.filter(d=>d).reduce((d,v)=>d.concat(f(v)?`<!--${v.data}-->`:n(v)?v.textContent:v.outerHTML),""),g=s=>s?c(s,Proxy)?[s.EL]:c(s,NodeList)?[...s]:i(s)?[s]:L(s)?s:s.isJQx?s.collection:void 0:[],x=(s,d,v)=>{let l=d!==document.body&&c(s,String)&&s.toLowerCase()!=="body"?d:document,a;try{v.collection=[...l.querySelectorAll(s)]}catch{a=`Invalid CSS querySelector. [${c(s,String)?s:"Nothing valid given!"}]`}return a??`CSS querySelector "${s}", output ${v.collection.length} element(s)`},u=s=>{let d=s.data.get("hid")||`HID${R()}`;return s.data.add({hid:d}),`[data-hid="${d}"]`},p=Object.entries(j.tagsRaw).filter(([,s])=>s).map(([s])=>s).sort((s,d)=>s.localeCompare(d));return{instanceMethods:r,instanceGetters:o,isCommentOrTextNode:n,isNode:i,isComment:f,isText:S,isHtmlString:E,isArrayOfHtmlElements:L,isArrayOfHtmlStrings:b,ElemArray2HtmlString:T,input2Collection:g,setCollectionFromCssSelector:x,addHandlerId:u,cssRuleEdit:e,addFn:t,elems4Docs:p}}function W(e){return new Proxy(e,{get:(t,r)=>Xt(t,r,e)})}function Vt(e,t){return(...r)=>c(e,Function)&&e(W(t),...r)}function Zt(e,t){return(...r)=>c(e,Function)&&e(W(t),...r)}function Xt(e,t,r){switch(!0){case c(t,Symbol):return e;case c(+t,Number):return e.collection?.[t]||`ELEMENT WITH INDEX ${t} NOT FOUND`;case t in _e:return Zt(_e[t],r)();case t in ze:return Vt(ze[t],r);default:return e[t]}}function Ye(e){let t=nr(e);return Object.entries(Object.getOwnPropertyDescriptors(t)).forEach(([r,o])=>{Object.defineProperty(e,r,o),Object.defineProperty(qt,r,o)}),e}function Yt(e){return{allow:t=>{let r=/-/.test(t),o=r&&t;t=r?Z(t):t.toLowerCase(),j.allowTag(t),c(e[t],Function)||Object.defineProperties(e,ve(t,!0,e,o))},prohibit:t=>{t=t.toLowerCase(),j.prohibitTag(t),c(e[t],Function)&&Object.defineProperties(e,ve(t,!1,e))}}}function We(...e){if(e.length===1){let t=String(e.shift().trim());e=t.startsWith("!")?[t.slice(1,-1)]:t.split(",").map(r=>r.trim())}e.map(t=>t.startsWith("!")?t.slice(1,-1):t).forEach(t=>Se(t,{removeRule:1}))}function Kt(e){return function(t,r,...o){return c(r,Function)&&(o.push(r),r=void 0),o.forEach(n=>e(t,r,n))}}function er(e){return function(t,r,o){r=r?.isJQx?r?.[0]:r,o=o&&Object.values(F).find(i=>o===i)?o:void 0;let n=e(t,document.createElement("br"));return r&&!c(r,HTMLBRElement)&&n.collection.forEach(i=>o?r.insertAdjacentElement(o,i):r.append(i)),n}}function tr(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.entries(o).forEach(([n,i])=>!(n in t)&&Object.defineProperty(t,n,i))}return t}function rr(e){console.error(`JQx: "${e}" not allowed, not rendered`)}function or(e,t,r,o){return e=D(o||e.toLowerCase()),{get(){return(...n)=>t?r.virtual(X(me[e](...n))):rr(e)},enumerable:!1,configurable:!0}}function ve(e,t,r,o){e=e.toLowerCase();let n=or(e,t,r,o);return o?{[o]:n,[Z(o)]:n}:{[e]:n,[e.toUpperCase()]:n}}function nr(e){return tr(Object.entries(j.tagsRaw).reduce(ir(e),{}),sr(e))}function ir(e){return function(t,[r,o]){return o&&Object.defineProperties(t,ve(r,o,e)),t}}function sr(e){let t=(o,n)=>Se(o,n),r=Yt(e);return{debugLog:C,log:(...o)=>H("fromStatic",...o),insertPositions:F,get at(){return F},editCssRules:(...o)=>o.forEach(n=>Se(n)),editCssRule:t,get setStyle(){return t},delegate:Kt(Be()),virtual:er(e),get fn(){return Ut},allowTag:r.allow,prohibitTag:r.prohibit,get lenient(){return j.allowUnknownHtmlTags},get IS(){return c},get Popup(){return e.activePopup||Object.defineProperty(e,"activePopup",{value:Qe(e),enumerable:!1}),e.activePopup},popup:()=>e.Popup,createStyle:o=>V({createWithId:o||`jqx${R()}`}),editStylesheet:o=>V({createWithId:o||`jqx${R()}`}),removeCssRule:We,removeCssRules:We,text:(o,n=!1)=>n?e.comment(o):document.createTextNode(o),node:(o,n=document)=>n.querySelector(o,n),nodes:(o,n=document)=>[...n.querySelectorAll(o,n)]}}var y=Ye(lr());function lr(){return function(r,o,n=F.BeforeEnd){if(r?.isJQx)return r;let i=c(o,HTMLBRElement);o=(!i&&o&&o.isJQx?o[0]:o)||document.body,n=n&&Object.values(F).find(x=>n===x)?n:void 0;let f=qe(r),S=!f&&Ge(r),E=S||f,b={collection:Ze(r)??[],isVirtual:i,isJQx:!0},L=Ue(b.collection),T=`input =&gt; ${S?`"${M(r.join(", "),70)}"`:!E&&L?`element collection [${M(b.collection.map(x=>`${c(x,Comment,Text)?"Comment|Text @":""} ${x?.outerHTML||x?.textContent}`).join(", "),70)}]`:`"${M(r,70)}"`}`;if(b.collection.length&&L)return O(T),i||b.collection.forEach(x=>{o.contains(x)||z([x],o,n)}),W(b);if(E){if([r].flat().forEach(x=>b.collection.push(A(x))),b.collection.length>0){let x=b.collection.filter(u=>u?.dataset?.jqxcreationerror);b.collection=b.collection.filter(u=>!u?.dataset?.jqxcreationerror),O(`${T}`),O(`*Created ${b.isVirtual?"VIRTUAL ":""}[${M(Ve(b.collection)||"sanitized: no elements remaining",70)}]`),x.length&&console.error(`JQx: illegal html, not rendered: "${x.reduce((u,p)=>u.concat(`${p.textContent}
15
15
  `),"").trim()}"`),b.isVirtual||z(b.collection,o,n)}return W(b)}let g=Xe(r,o,b);return O(`input => ${g}`),W(b)}}export{y as default};
package/README.md CHANGED
@@ -7,15 +7,14 @@
7
7
 
8
8
  # JQx
9
9
 
10
- <h3>JQuery - the good parts redone</h3>
10
+ This module was inspired by the idea that some parts of [JQuery](https://jquery.com) are too good [to ditch](https://youmightnotneedjquery.com/).
11
11
 
12
- This module was inspired by the idea that some JQuery was too good <a target="_blank" href="http://youmightnotneedjquery.com/" rel="nofollow">to ditch</a>.
12
+ JQx is **not** a replacement for JQuery.
13
13
 
14
- It is developed in a modular fashion and uses plain ES20xx, so not really (or really not, take your pick) suitable for older browsers.
14
+ Consider it a set of JQuery alike ES/JS-methods to programmatically ***create***, ***retrieve***, ***modify***, ***style*** and/or ***manipulate***
15
+ (collections of) HTML elements in a HTML document.
15
16
 
16
- The module was rewritten in 2023 in a <i>classfree object oriented</i> fashion, inspired by a <a target="_blank" href="https://youtu.be/XFTOG895C7c?t=2562">Douglas Crockford presentation</a>.
17
-
18
- The objective was and is to ***not*** use `prototype` and `this` in the code.
17
+ The code is written in a modular fashion and uses plain ES20xx, so not really (or really not, take your pick) suitable for older browsers.
19
18
 
20
19
  ## Documentation/demo
21
20
  Documentation can be found @[https://kooiinc.codeberg.page/JQx/Resource/Docs/](https://kooiinc.codeberg.page/JQx/Resource/Docs/).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jqx-es",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "A JQuery alike es20xx module",
package/src/JQxMethods.js CHANGED
@@ -444,7 +444,7 @@ export default {
444
444
  removeClass: (instance, ...classNames) =>
445
445
  loop(instance, el => el && classNames.forEach(cn => el.classList.remove(cn))),
446
446
  renderTo: (instance, root = document.body, at = jqx.insertPositions.end) => {
447
- instance.appendTo(root, at);
447
+ instance.toDOM(root, at);
448
448
  return instance;
449
449
  },
450
450
  replace: (instance, oldChild, newChild) => {