jqx-es 1.0.9 → 1.1.0

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.
@@ -1,15 +1,15 @@
1
- var JQx=(()=>{var le=Object.defineProperty;var tt=Object.getOwnPropertyDescriptor;var rt=Object.getOwnPropertyNames;var ot=Object.prototype.hasOwnProperty;var nt=(e,t)=>{for(var r in t)le(e,r,{get:t[r],enumerable:!0})},it=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of rt(t))!ot.call(e,i)&&i!==r&&le(e,i,{get:()=>t[i],enumerable:!(o=tt(t,i))||o.enumerable});return e};var st=e=>it(le({},"__esModule",{value:!0}),e);var hr={};nt(hr,{default:()=>b});var lt="url('data:image/svg+xml\\3butf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20version%3D%221.1%22%20id%3D%22Layer_1%22%20x%3D%220px%22%20y%3D%220px%22%20viewBox%3D%220%200%20128%20128%22%20style%3D%22enable-background%3Anew%200%200%20128%20128%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Crect%20x%3D%22-368%22%20y%3D%226%22%20style%3D%22display%3Anone%3Bfill%3A%23E0E0E0%3B%22%20width%3D%22866%22%20height%3D%221018%22%2F%3E%3Ccircle%20style%3D%22fill%3A%23FFFFFF%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2248%22%2F%3E%3Ccircle%20style%3D%22fill%3A%238CCFB9%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2239%22%2F%3E%3Ccircle%20style%3D%22fill%3Anone%3Bstroke%3A%23444B54%3Bstroke-width%3A6%3Bstroke-miterlimit%3A10%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2248%22%2F%3E%3Cpolyline%20style%3D%22fill%3Anone%3Bstroke%3A%23FFFFFF%3Bstroke-width%3A6%3Bstroke-linecap%3Around%3Bstroke-miterlimit%3A10%3B%22%20points%3D%2242%2C69%2055.55%2C81%20%20%2086%2C46%20%22%2F%3E%3C%2Fsvg%3E')",ae=ut(),Le=dt(),k=at(),Z=ct();function at(){return{html:Object.freeze("accept,action,align,alt,autocapitalize,autocomplete,autopictureinpicture,autoplay,background,bgcolor,border,capture,cellpadding,cellspacing,checked,cite,class,clear,contenteditable,color,cols,colspan,controls,controlslist,coords,crossorigin,datetime,decoding,default,dir,disabled,disablepictureinpicture,disableremoteplayback,download,draggable,enctype,enterkeyhint,face,for,headers,height,hidden,high,href,hreflang,id,inputmode,integrity,is,ismap,kind,label,lang,list,loading,loop,low,max,maxlength,media,method,min,minlength,multiple,muted,name,nonce,noshade,novalidate,nowrap,open,optimum,pattern,placeholder,playsinline,poster,preload,pubdate,radiogroup,readonly,rel,required,rev,reversed,role,rows,rowspan,spellcheck,scope,selected,shape,size,sizes,span,srclang,start,src,srcset,step,style,summary,tabindex,target,title,translate,type,usemap,valign,value,width,xmlns,slot".split(",")),svg:Object.freeze("accent-height,accumulate,additive,alignment-baseline,ascent,attributename,attributetype,azimuth,basefrequency,baseline-shift,begin,bias,by,class,clip,clippathunits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,cx,cy,d,dx,dy,diffuseconstant,direction,display,divisor,dur,edgemode,elevation,end,fill,fill-opacity,fill-rule,filter,filterunits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,fx,fy,g1,g2,glyph-name,glyphref,gradientunits,gradienttransform,height,href,id,image-rendering,in,in2,k,k1,k2,k3,k4,kerning,keypoints,keysplines,keytimes,lang,lengthadjust,letter-spacing,kernelmatrix,kernelunitlength,lighting-color,local,marker-end,marker-mid,marker-start,markerheight,markerunits,markerwidth,maskcontentunits,maskunits,max,mask,media,method,mode,min,name,numoctaves,offset,operator,opacity,order,orient,orientation,origin,overflow,paint-order,path,pathlength,patterncontentunits,patterntransform,patternunits,points,preservealpha,preserveaspectratio,primitiveunits,r,rx,ry,radius,refx,refy,repeatcount,repeatdur,restart,result,rotate,scale,seed,shape-rendering,specularconstant,specularexponent,spreadmethod,startoffset,stddeviation,stitchtiles,stop-color,stop-opacity,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke,stroke-width,style,surfacescale,systemlanguage,tabindex,targetx,targety,transform,text-anchor,text-decoration,text-rendering,textlength,type,u1,u2,unicode,values,viewbox,visibility,version,vert-adv-y,vert-origin-x,vert-origin-y,width,word-spacing,wrap,writing-mode,xchannelselector,ychannelselector,x,x1,x2,xmlns,y,y1,y2,z,zoomandpan".split(","))}}function ct(){return{a:!0,area:!0,audio:!1,br:!0,base:!0,body:!0,button:!0,canvas:!0,comment:!0,dl:!0,data:!0,datalist:!0,div:!0,em:!0,embed:!1,fieldset:!0,font:!0,footer:!0,form:!1,hr:!0,head:!0,header:!0,output:!0,iframe:!1,frameset:!1,img:!0,input:!0,li:!0,label:!0,legend:!0,link:!0,map:!0,mark:!0,menu:!0,media:!0,meta:!0,nav:!0,meter:!0,ol:!0,object:!1,optgroup:!0,option:!0,p:!0,param:!0,picture:!0,pre:!0,progress:!1,quote:!0,script:!1,select:!0,source:!0,span:!0,style:!0,caption:!0,td:!0,col:!0,table:!0,tr:!0,template:!1,textarea:!0,time:!0,title:!0,track:!0,details:!0,ul:!0,video:!0,del:!0,ins:!0,slot:!0,blockquote:!0,svg:!0,dialog:!0,summary:!0,main:!0,address:!0,colgroup:!0,tbody:!0,tfoot:!0,thead:!0,th:!0,dd:!0,dt:!0,figcaption:!0,figure:!0,i:!0,b:!0,code:!0,h1:!0,h2:!0,h3:!0,h4:!0,abbr:!0,bdo:!0,dfn:!0,kbd:!0,q:!0,rb:!0,rp:!0,rt:!0,ruby:!0,s:!0,strike:!0,samp:!0,small:!0,strong:!0,sup:!0,sub:!0,u:!0,var:!0,wbr:!0,nobr:!0,tt:!0,noscript:!0}}function ut(){return["#logBox{min-width:0px;max-width:0px;min-height:0px;max-height:0px;width:0;height:0;z-index:-1;border:none;padding:0px;overflow:hidden;transition:all 0.3s ease;margin-top:-100px;}","#logBox.visible{background-color:rgb(255, 255, 224);z-index:1;position:static;border:1px dotted rgb(153, 153, 153);max-width:50vw;min-width:30vw;min-height:10vh;max-height:90vh;overflow:auto;width:50vw;height:20vh;margin:1rem 0px;padding:0px 8px 19px;resize:both;}","#logBox.visible .legend{position:absolute;}","#logBox .legend{text-align:center;margin-top:-1em;width:inherit;max-width:inherit;}","#logBox .legend div{text-align:center;display:inline-block;max-width:inherit;height:1.2rem;background-color:rgb(119, 119, 119);padding:2px 10px;color:rgb(255, 255, 255);box-shadow:rgb(119 119 119) 2px 1px 10px;border-radius:4px;}","#logBox .legend div:before{content:'JQx Logging (chronological)';}","#logBox .legend.reversed div:before{content:'JQx Logging (reversed)';}","#logBox #jqx_logger{marginTop:0.7rem;lineHeight:1.4em;font-family:consolas,monospace;whiteSpace:pre-wrap;maxWidth:inherit;padding-left:100px;}","#logBox #jqx_logger div.entry{text-indent:-100px;whiteSpace:normal;}"]}function dt(){return[".popupContainer{position:fixed;inset:-5000px;opacity:0;height:0;width:0;background:rgba(0,0,0,0.1);transition:opacity 0.6s ease-in-out 0s;}",".popupContainer.popup-active{opacity:1;inset:0;height:auto;width:auto;z-index:2147483646;}",".popupContainer .content{box-shadow:rgba(0,0,0,0.5) 2px 2px 8px;border-radius:3px;min-width:125px;max-width:40vw;max-height:40vh;padding:8px;overflow:auto;background:#FFF;z-index:inherit;opacity:1;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);}",".popupContainer .content .popup-warn{position:relative;padding:3px 8px 0 8px;color:red;margin:6px -8px -4px -8px;text-align:center;display:none;}",".popupContainer .content.popup-warn-active .popup-warn{display:block;border-top:1px dashed rgb(0,0,0);}",`.closeHandleIcon{z-index:1;position:absolute;opacity:0;cursor:pointer;width:24px;height:24px;background:${lt} no-repeat;}`,".closeHandleIcon.popup-active{opacity:1;z-index:2147483647;}","@media screen and (width < 1200px){.popupContainer .content{max-width:75vw;}}","@media screen and (width < 640px){.popupContainer .content{max-width:90vw;max-height:60vw;}}"]}var ce=!1,ft={on:()=>ce=!0,off:()=>ce=!1},j={tagsRaw:Z,allowUnknownHtmlTags:ft,isAllowed(e){if(ce)return!0;let t=u(e,String)?e.toLowerCase():e?.nodeName.toLowerCase()||"none";return t==="#text"||!!Z[t]},allowTag:e=>Z[e.toLowerCase()]=!0,prohibitTag:e=>Z[e.toLowerCase()]=!1};var fe=!1,X=!1,z=!0,me=!1,mt=!0,$e,W=()=>b("#logBox"),Te="#jqx_logger",gt=e=>{ae?.forEach(t=>e(t))},pt=()=>{ae&&gt($e);let e=mt?"div":"pre",t=`<div id="logBox"><div class="legend"><div></div></div><${e} id="jqx_logger"></${e}></div>`;return ge(O(t),void 0,F.AfterBegin),b.node(Te)},Ce=e=>u(e,String)&&Object.assign(document.createElement("textarea"),{innerHTML:e}).textContent||e,A=(...e)=>{let t=e[0]==="fromStatic";if(e=t?e.slice(1):e,t&&!X)return e.forEach(o=>console.info(`${_()} \u2714 ${Ce(o)}`));if(!X)return;!z&&!b.node("#logBox")&&($e=b.createStyle("JQxLogCSS"),pt());let r=o=>`${u(o,Object)?JSON.stringify(o,null,2):o}
2
- `;e.forEach(o=>z?console.info(`${_()} \u2714 ${Ce(o)}`):b.node("#jqx_logger").insertAdjacentHTML(me?"afterbegin":"beforeend",`<div class="entry">${_()} ${r(o.replace(/\n/g,"<br>"))}</div>`))},ue={on(){X=!0,A("Logging activated")},off(){X=!1,console.log("Logging deactivated")}},de={on(){fe=!0},off(){fe=!1}},M=(...e)=>fe&&A(...e),$={get isConsole(){return z===!0},get isOn(){return X},isVisible:function(){return b("#jqx_logger").is("visible")},on(){return ue.on(),de.on(),z||W()?.addClass("visible"),A("Debug logging started. Every call to [jqx instance] is logged"),$},off(){return W().isEmpty||(de.off(),A("Debug logging stopped"),W()?.removeClass("visible")),ue.off(),$},toConsole:{on(){return z=!0,A("Started logging to console"),$},off(){return A("Stopped logging to console (except error messages)"),z=!1,$}},remove(){return ue.off(),de.off(),W()?.remove(),console.clear(),console.log(`${_()} logging completely disabled and all entries removed`),$},log:function(...e){return A(...e),$},hide(){return W()?.removeClass("visible"),$},show:()=>(W()?.addClass("visible"),$),get reversed(){return{on:()=>(me=!0,A("Reverse logging set: now logging bottom to top (latest first)"),b("#logBox .legend").addClass("reversed"),$),off:()=>(me=!1,b("#logBox .legend").removeClass("reversed"),A("Reverse logging reset: now logging chronological (latest last)"),$)}},clear(){return b(Te).text(""),console.clear(),A("Logging cleared"),$}};var yt=bt(),Fe={html:"innerHTML",text:"textContent",class:"className"},pe=yt;function bt(){let e={get(t,r){let o=String(r)?.toLowerCase();switch(!0){case o in t:return t[o];case $t(o):return He(t,o,r);default:return He(t,o,r,!0)}},enumerable:!1,configurable:!1};return new Proxy({},e)}function He(e,t,r,o=!1){return Object.defineProperty(e,t,{get(){return o?i=>Lt(r):Tt(t)}}),e[t]}function ht(e,t,r){return t=t?.isJQx&&t.first()||t,be({trial:o=>Ct(t)?e.append(t):Oe(t)?e.insertAdjacentHTML("beforeend",t):e.append(t),whenError:o=>console.info(`${r} (for root ${e}) not created, reason
3
- `,o)})}function xt(e,t,...r){let o=St(t,e);return r?.forEach(i=>ht(o,i,e)),o}function St(e,t){switch(e=ye(t)?wt(e):e?.isJQx?e.first():e,!0){case u(e,String):return Y(t,Oe(e,t)?{html:e}:{text:e});case u(e,Node):return Et(t,e);default:return Y(t,e)}}function vt(e){return delete e.data,Object.keys(e).length<1||Object.keys(e).forEach(t=>{let r=t.toLowerCase();r in Fe&&(e[Fe[r]]=e[t],delete e[t])}),e}function Et(e,t){let r=Y(e);return r.append(t),r}function Y(e,t={}){t=Ae(t,{});let r=Object.entries(t.data??{}),o=Object.assign(ye(e)?new Comment(t?.text):document.createElement(e),vt(t));return r.length&&r.forEach(([i,l])=>o.dataset[i]=String(l)),o}function Ae(e,t){return t?u(e,{isTypes:Object,notTypes:[Array,null,NaN,Proxy],defaultValue:t}):u(e,{isTypes:Object,notTypes:[Array,null,NaN,Proxy]})}function wt(e){return Ae(e)?e?.text??e?.textContent??"":String(e)}function Lt(e){return Y("b",{style:"color:red",text:`'${e}' is not a valid HTML-tag`})}function Oe(e,t){return!ye(t)&&u(e,String)&&/<.*>|&[#|0-9a-z]+[^;];/i.test(e)}function Ct(e){return e?.constructor===Comment||e?.constructor===CharacterData}function ye(e){return e?.constructor===Comment||/comment/i.test(e)}function $t(e){return!u(Y(e),HTMLUnknownElement)}function Tt(e){return(t,...r)=>xt(e,t,...r)}var{IS:u,maybe:be,$Wrap:Or,xProxy:Ir,isNothing:Nr}=Ft();function Ft(){Symbol.proxy=Symbol.for("toa.proxy"),Symbol.is=Symbol.for("toa.is"),Symbol.type=Symbol.for("toa.type"),Symbol.isSymbol=Symbol.for("toa.isASymbol"),y();let e=T(),[t,r]=[p(),v()];return r.custom(),{IS:o,maybe:e,$Wrap:t,isNothing:L,xProxy:r};function o(n,...s){if(e({trial:d=>"isTypes"in(s?.[0]??{})})){let d=s[0];return"defaultValue"in d?x(n,d):"notTypes"in d?f(n,d):o(n,...[d.isTypes].flat())}let c=typeof n=="symbol"?Symbol.isSymbol:n;return s.length>1?h(c,...s):l(n,...s)}function i(n){return n?.[Symbol.proxy]??o(n)}function l(n,...s){let{noInput:c,noShouldbe:d,compareTo:E,inputCTOR:H,isNaN:P,isInfinity:R,shouldBeFirstElementIsNothing:J}=S(n,...s);switch(s=s.length&&s[0],!0){case J:return String(n)===String(E);case(n?.[Symbol.proxy]&&d):return n[Symbol.proxy];case P:return d?"NaN":e({trial:B=>String(E)})===String(n);case R:return d?"Infinity":e({trial:B=>String(E)})===String(n);case c:return d?String(n):String(E)===String(n);case H===Boolean:return s?H===s:"Boolean";default:return w(n,s,d,g(n,H))}}function g(n,s){return n===0?Number:n===""?String:n?s:{name:String(n)}}function S(n,...s){let c=s.length<1,d=!c&&s[0],E=!c&&L(s[0]),H=n==null,P=!H&&Object.getPrototypeOf(n)?.constructor,R=e({trial:B=>String(n)})==="NaN",J=e({trial:B=>String(n)})==="Infinity";return{noInput:H,noShouldbe:c,compareTo:d,inputCTOR:P,isNaN:R,isInfinity:J,shouldBeFirstElementIsNothing:E}}function w(n,s,c,d){switch(!0){case(!c&&s===n||n?.[Symbol.proxy]&&s===Proxy):return!0;case e({trial:E=>String(s)})==="NaN":return String(n)==="NaN";case(n?.[Symbol.toStringTag]&&o(s,String)):return String(s)===n[Symbol.toStringTag];default:return s?e({trial:E=>n instanceof s})||s===d||s===Object.getPrototypeOf(d)||`${s?.name}`===d?.name:n?.[Symbol.toStringTag]&&`[object ${n?.[Symbol.toStringTag]}]`||d?.name||String(d)}}function h(n,...s){return s.some(c=>o(n,c))}function L(n,s=!1){let c=n==null;return c=s?c||o(n,1/0)||o(n,NaN):c,c}function T(){let n=(s,c)=>s?.constructor===Function?s(c):void 0;return function({trial:s,whenError:c=()=>{}}={}){try{return n(s)}catch(d){return n(c,d)}}}function p(){return function(n){return Object.freeze({get value(){return n},get[Symbol.type](){return i(n)},get type(){return i(n)},[Symbol.is](...s){return o(n,...s)},is(...s){return o(n,...s)}})}}function x(n,{defaultValue:s,isTypes:c=[void 0],notTypes:d}={}){return c=c?.constructor!==Array?[c]:c,d=d&&d?.constructor!==Array?[d]:[],d.length<1?o(n,...c)?n:s:f(n,{isTypes:c,notTypes:d})?n:s}function f(n,{isTypes:s=[void 0],notTypes:c=[void 0]}={}){return s=s?.constructor!==Array?[s]:s,c=c?.constructor!==Array?[c]:c,o(n,...s)&&!o(n,...c)}function y(){Object.getOwnPropertyDescriptors(Object.prototype)[Symbol.is]||(Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return i(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...n){return o(this,...n)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(n){return i(n)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(n,...s){return o(n,...s)},enumerable:!1,configurable:!1}}))}function a(n){let s=String(Object.getPrototypeOf(n)?.constructor);return s.slice(s.indexOf("ion")+3,s.indexOf("(")).trim()}function m(n){let s=n.set;return n.set=(c,d,E)=>d===Symbol.proxy?c[d]=E:s(c,d,E),n}function v(){let n=Proxy;return{native(){Proxy=n},custom(){Proxy=new n(n,{construct(s,c){for(let E of c)E.set&&(E=m(E));let d=new s(...c);return d[Symbol.proxy]=`Proxy (${a(c[0])})`,d}})}}}}var{IS:oe,maybe:Mr,$Wrap:Dr,xProxy:Pr,isNothing:Rr}=Ht();function Ht(){Symbol.proxy=Symbol.for("toa.proxy"),Symbol.is=Symbol.for("toa.is"),Symbol.type=Symbol.for("toa.type"),Symbol.isSymbol=Symbol.for("toa.isASymbol"),y();let e=T(),[t,r]=[p(),v()];return r.custom(),{IS:o,maybe:e,$Wrap:t,isNothing:L,xProxy:r};function o(n,...s){if(e({trial:d=>"isTypes"in(s?.[0]??{})})){let d=s[0];return"defaultValue"in d?x(n,d):"notTypes"in d?f(n,d):o(n,...[d.isTypes].flat())}let c=typeof n=="symbol"?Symbol.isSymbol:n;return s.length>1?h(c,...s):l(n,...s)}function i(n){return n?.[Symbol.proxy]??o(n)}function l(n,...s){let{noInput:c,noShouldbe:d,compareTo:E,inputCTOR:H,isNaN:P,isInfinity:R,shouldBeFirstElementIsNothing:J}=S(n,...s);switch(s=s.length&&s[0],!0){case J:return String(n)===String(E);case(n?.[Symbol.proxy]&&d):return n[Symbol.proxy];case P:return d?"NaN":e({trial:B=>String(E)})===String(n);case R:return d?"Infinity":e({trial:B=>String(E)})===String(n);case c:return d?String(n):String(E)===String(n);case H===Boolean:return s?H===s:"Boolean";default:return w(n,s,d,g(n,H))}}function g(n,s){return n===0?Number:n===""?String:n?s:{name:String(n)}}function S(n,...s){let c=s.length<1,d=!c&&s[0],E=!c&&L(s[0]),H=n==null,P=!H&&Object.getPrototypeOf(n)?.constructor,R=e({trial:B=>String(n)})==="NaN",J=e({trial:B=>String(n)})==="Infinity";return{noInput:H,noShouldbe:c,compareTo:d,inputCTOR:P,isNaN:R,isInfinity:J,shouldBeFirstElementIsNothing:E}}function w(n,s,c,d){switch(!0){case(!c&&s===n||n?.[Symbol.proxy]&&s===Proxy):return!0;case e({trial:E=>String(s)})==="NaN":return String(n)==="NaN";case(n?.[Symbol.toStringTag]&&o(s,String)):return String(s)===n[Symbol.toStringTag];default:return s?e({trial:E=>n instanceof s})||s===d||s===Object.getPrototypeOf(d)||`${s?.name}`===d?.name:n?.[Symbol.toStringTag]&&`[object ${n?.[Symbol.toStringTag]}]`||d?.name||String(d)}}function h(n,...s){return s.some(c=>o(n,c))}function L(n,s=!1){let c=n==null;return c=s?c||o(n,1/0)||o(n,NaN):c,c}function T(){let n=(s,c)=>s?.constructor===Function?s(c):void 0;return function({trial:s,whenError:c=()=>{}}={}){try{return n(s)}catch(d){return n(c,d)}}}function p(){return function(n){return Object.freeze({get value(){return n},get[Symbol.type](){return i(n)},get type(){return i(n)},[Symbol.is](...s){return o(n,...s)},is(...s){return o(n,...s)}})}}function x(n,{defaultValue:s,isTypes:c=[void 0],notTypes:d}={}){return c=c?.constructor!==Array?[c]:c,d=d&&d?.constructor!==Array?[d]:[],d.length<1?o(n,...c)?n:s:f(n,{isTypes:c,notTypes:d})?n:s}function f(n,{isTypes:s=[void 0],notTypes:c=[void 0]}={}){return s=s?.constructor!==Array?[s]:s,c=c?.constructor!==Array?[c]:c,o(n,...s)&&!o(n,...c)}function y(){Object.getOwnPropertyDescriptors(Object.prototype)[Symbol.is]||(Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return i(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...n){return o(this,...n)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(n){return i(n)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(n,...s){return o(n,...s)},enumerable:!1,configurable:!1}}))}function a(n){let s=String(Object.getPrototypeOf(n)?.constructor);return s.slice(s.indexOf("ion")+3,s.indexOf("(")).trim()}function m(n){let s=n.set;return n.set=(c,d,E)=>d===Symbol.proxy?c[d]=E:s(c,d,E),n}function v(){let n=Proxy;return{native(){Proxy=n},custom(){Proxy=new n(n,{construct(s,c){for(let E of c)E.set&&(E=m(E));let d=new s(...c);return d[Symbol.proxy]=`Proxy (${a(c[0])})`,d}})}}}}var K=At;function At({styleSheet:e,createWithId:t}={}){let{tryParseAtOrNestedRules:r,ruleExists:o,checkParams:i,sheet:l,removeRules:g,consider:S,currentSheetID:w}=Ot({styleSheet:e,createWithId:t});function h(f,y){if(f&&y.removeProperties){Object.keys(y.removeProperties).forEach(a=>f.style.removeProperty(Ie(a)));return}Object.entries(y).forEach(([a,m])=>{a=Ie(a.trim()),m=m.trim();let v;if(/!important/.test(m)&&(m=m.slice(0,m.indexOf("!important")).trim(),v="important"),!CSS.supports(a,m))return console.error(`StylingFactory ${w} error: '${a}' with value '${m}' not supported (yet)`);Ne(()=>f.style.setProperty(a,m,v),`StylingFactory ${w} (setRule4Selector) failed`)})}function L(f,y,a=l){if(f=f?.trim?.(),!oe(f,String)||!f.length||/[;,]$/g.test(f))return console.error(`StylingFactory ${w} (setRules): [${f||"[no selector given]"}] is not a valid selector`);if(y.removeRule)return g(f);let m=o(f,!0),v=m||a.cssRules[a.insertRule(`${f} {}`,a.cssRules.length||0)];return S(()=>h(v,y),f,m)}function T(f){let y=f.trim().split(/{/,2),a=y.shift().trim();if(!oe(a,String)||!a?.trim()?.length)return console.error(`StylingFactory ${w} (doParse): no (valid) selector could be extracted from rule ${he(f)}`);let m=Rt(y.shift());return Ne(()=>L(a,m),`StylingFactory ${w} (setRules) failed`)}function p(f){let y=r(f);return y.done?y.existing:T(f)}function x(f,y){return f.trim().startsWith("@media")?p(It(f,y)):L(f,y)}return function(f,y={}){return i(f,y)&&(Object.keys(y).length?x(f,y):p(f))}}function Ot({styleSheet:e,createWithId:t}){let r="Note: The rule or some of its properties may not be supported by your browser (yet)",o=`for style#${t}`;e=t?i(t):e;function i(p){let x=document.querySelector(`#${p}`)?.sheet;if(x)return x;let f=Object.assign(document.createElement("style"),{id:p});return document.head.insertAdjacentElement("beforeend",f),f.sheet}function l(p){return console.error(`StylingFactory ${o} [rule: ${p}]
4
- => @charset, @namespace and @import are not supported here`),{done:!0}}function g(p,x){return[...e.rules].find(f=>x?je(f.selectorText||"",p):Mt`${jt(p)}${[..."gim"]}`.test(f.cssText))}function S(p){return/^@charset|@import|namespace/i.test(p.trim())?l(p):p.match(/}/g)?.length>1?{existing:L(p,1),done:!0}:{done:!1}}function w(p){let x=[...e.cssRules].reduce((y,a,m)=>je(a.selectorText||"",p)&&y.concat(m)||y,[]),f=x.length;return x.forEach(y=>e.deleteRule(y)),f>0?console.info(`\u2714 Removed ${f} instance${f>1?"s":""} of selector ${p} from ${o.slice(4)}`):console.info(`\u2714 Remove rule: selector ${p} does not exist in ${o.slice(4)}`)}function h(p,x){return p&&oe(p,String)&&p.trim().length>0&&oe(x,Object)||(console.error(`StylingFactory ${o} called with invalid parameters`),!1)}function L(p){p=p.trim();let x=p.slice(0,p.indexOf("{")).trim(),f=!!g(x);try{return e.insertRule(`${p}`,e.cssRules.length),f}catch(y){return console.error(`StylingFactory ${o} (tryParse) ${y.name} Error:
5
- ${y.message}
6
- Rule: ${he(p)}
7
- ${r}`),f}}function T(p,x,f){try{return p(),f}catch(y){return console.error(`StylingFactory ${o} (tryAddOrModify) ${y.name} Error:
8
- ${y.message}
9
- Rule: ${he(x)}
10
- ${r}`),f}}return{sheet:e,removeRules:w,tryParseAtOrNestedRules:S,ruleExists:g,checkParams:h,tryParse:L,consider:T,currentSheetID:o}}function It(e,t){return`${e.trim()} ${Object.entries(t).map(([r,o])=>`${r}: { ${Nt(o)}`)}`}function he(e){let t=(e||"NO RULE").trim().slice(0,50).replace(/\n/g,"\\n").replace(/\s{2,}/g," ");return e.length>t.length?`${t.trim()}...truncated`:t}function Nt(e){return Object.entries(e).map(([t,r])=>`${t}: ${r.trim()}`).join(`;
11
- `)}function jt(e){return e.replace(/([*\[\]()-+{}.$?\\])/g,t=>`\\${t}`)}function Mt(e,...t){let r=t.length&&Array.isArray(t.slice(-1))?t.pop().join(""):"";return new RegExp((t.length&&e.raw.reduce((o,i,l)=>o.concat(t[l-1]||"").concat(i),"")||e.raw.join("")).split(`
12
- `).map(o=>o.replace(/\s|\/\/.*$/g,"").trim().replace(/(@s!)/g," ")).join(""),r)}function Ie(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`).replace(/[^--]^-|-$/,"")}function Ne(e,t){try{return e()}catch(r){console.error(`${t||"an error occured"}: ${r.message}`)}}function Dt(e){return e.replace(/\/\*.+?\*\//gm,"").replace(/[}{\r\n]/g,"").replace(/(data:.+?);/g,(t,r)=>`${r}\\3b`).split(";").map(t=>t.trim()).join(`;
13
- `).replaceAll("\\3b",";").split(`
14
- `)}function Pt(e){return e.reduce((t,r)=>{let[o,i]=[r.slice(0,r.indexOf(":")).trim(),r.slice(r.indexOf(":")+1).trim().replace(/;$|;.+(?=\/*).+\/$/,"")];return o&&i?{...t,[o]:i}:t},{})}function Rt(e){return Pt(Dt(e))}function je(e,t){return e?.replace("::",":")===t?.replace("::",":")}var Jt=[...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}`)),ne=(e,t=2)=>`${e}`.padStart(t,"0"),Bt=(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)),Qt=e=>{let t=e.length;for(;t--;){let r=Bt(t);[e[t],e[r]]=[e[r],e[t]]}return e};var I=(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(),N=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`).replace(/^-|-$/,""),kt=([e,...t])=>`${e.toUpperCase()}${t.join("")}`,ee=e=>u(e,String)?e.toLowerCase().split("-").map((t,r)=>r&&`${kt(t)}`||t).join(""):e,D=()=>`_${Qt(Jt).slice(0,8).join("")}`,ie=(e,t=120)=>I(e,t).replace(/&lt;/g,"<"),_=()=>(e=>`[${ne(e.getHours())}:${ne(e.getMinutes())}:${ne(e.getSeconds())}.${ne(e.getMilliseconds(),3)}]`)(new Date);var q=e=>e.replace(/</g,"&lt;");function Me(){let e=function(l){if(!l)return;let g=l.style,S=getComputedStyle(l),w=[g.visibility,S.visibility].includes("hidden"),h=[g.display,S.display].includes("none"),L=l.offsetTop<0||l.offsetLeft+l.offsetWidth<0||l.offsetLeft>document.body.offsetWidth,T=+S.opacity==0||+(g.opacity||1)==0;return!(L||T||h||w)},t="n/a",r=function(l){return l.parentNode?!!b.nodes(":is(:read-write)",l?.parentNode)?.find(g=>g===l):!1},o=function(l){return l.parentNode?!!b.nodes(":is(:modal)",l?.parentNode)?.find(g=>g===l):!1},i={notInDOM:!0,writable:t,modal:t,empty:!0,open:t,visible:t};return l=>{let g=l.node;return g?{get writable(){return r(g)},get modal(){return o(g)},get inDOM(){return g.isConnected},get open(){return g.open??!1},get visible(){return e(g)},get disabled(){return g.hasAttribute("readonly")||g.hasAttribute("disabled")},get empty(){return l.collection.length<1},get virtual(){return l.isVirtual}}:i}}var Wt=!0,se={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},zt=e=>{if(Wt&&Object.keys(e.removed).length){let t=Object.entries(e.removed).reduce((r,[o,i])=>[...r,`${q(o)} => ${i}`],[]).join("\\000A");$.log(`JQx HTML creation errors: ${$.isConsole?t:q(t)}`)}},_t=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)},te=e=>{let t={rawHTML:e?.parentElement?.getHTML()??"no html",removed:{}};return u(e,HTMLElement)&&[...e.childNodes].forEach(r=>{if(r?.children?.length&&te(r),r?.attributes){let i=u(r,SVGElement)?k.svg:k.html;[...(r??{attributes:[]}).attributes].forEach(l=>{let g=l.name.trim().toLowerCase(),S=l.value.trim().toLowerCase().replace(se.whiteSpace,""),w=g==="href"?!se.validURL.test(S):se.notAllowedValues.test(S),h=g.startsWith("data")?!se.data.test(g):!!i[g];if(w||h){let L=ie(l.value||"none",60);L+=L.length===60?"...":"",t.removed[`${l.name}`]=`attribute/property (-value) not allowed, removed. Value: ${L}`,r.removeAttribute(l.name)}})}if(!(_t(r)||r.constructor===CharacterData||r.constructor===Comment)){let i=(r?.outerHTML||r?.textContent).trim(),l=ie(i,60)??"EMPTY";l+=l.length===60?"...":"",t.removed[`<${r.nodeName?.toLowerCase()}>`]=`not allowed, not rendered. Value: ${l}`,r.remove()}}),zt(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]}}),qt=e=>{let t=document.createElement("div");return t.insertAdjacentHTML(F.end,e),t.childNodes.length?te(t):void 0},Ut=(e,t,r)=>u(e,Comment)?t.insertAdjacentHTML(r,`<!--${e.data}-->`):t.insertAdjacentText(r,e.data),U=(e=[],t=document.body,r=F.BeforeEnd)=>e.reduce((o,i)=>{let l=re(i)&&ge(i,t,r);return l?[...o,l]:o},[]),ge=(e,t=document.body,r=F.BeforeEnd)=>(t=t?.isJQx?t?.[0]:t,u(e,Comment,Text)?Ut(e,t,r):t.insertAdjacentElement(r,e)),O=e=>{if(u(e,Text,Comment))return e;let t=e?.trim(),r=t?.split(/<text>|<\/text>/i)??[];if(r?.length&&(r=r.length>1?r.filter(i=>i.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=qt(e);return o.childNodes.length<1?O(`<span data-jqxcreationerror="1">${I(e,60)}</span>`):o.children[0]};var C=(e,t)=>{let r=e.collection.filter(o=>!Qe(o));for(let o=0;o<r.length;o+=1)t(r[o],o);return e},Gt=Me(),De=e=>e&&(e.textContent="");var G=e=>{let t=e.cloneNode(!0);return t.removeAttribute&&t.removeAttribute("id"),e.isConnected?e.remove():e=null,t},Je=(e,t)=>{e&&u(t,Object)&&Object.entries(t).forEach(([r,o])=>e.setAttribute(`data-${N(r)}`,o))},Pe=(e,t)=>e.andThen(t,!0),Re=(e,t)=>e.andThen(t),Be=e=>e.startsWith("data")||k.html.find(t=>e.toLowerCase()===t),Vt=(e,t,r)=>{r&&u(t,String)&&(t={[t]:r==="-"?"":r});let o;t.className&&(o=t.className,delete t.className),o=[...e.classList].find(l=>l.startsWith("JQxClass-")||o&&l===o)||o||`JQxClass-${D().slice(1)}`,b.editCssRule(`.${o}`,t),e.classList.add(o)},Zt=(e,t)=>{e&&Object.entries(t).forEach(([r,o])=>{if(r=N(r),r.startsWith("data"))return Je(e,o);u(o,String)&&Be(r)&&e.setAttribute(r,o.split(/[, ]/)?.join(" "))})},xe=(e,t)=>{u(t,Object)&&Object.entries(t).forEach(([r,o])=>{let i;/!important/i.test(o)&&(o=o.slice(0,o.indexOf("!")).trim(),i="important"),e.style.setProperty(N(r),o,i)})},Xt={get(e,t){return e[ee(t)]||e[t]},enumerable:!1,configurable:!1},Yt=(...e)=>{$.log("\u2757"+e.map(t=>String(t)).join(", "))},Se=(e,t=0,r=!0)=>(e=e?.parentElement,t+=e?e[r?"scrollTop":"scrollLeft"]:0,e?Se(e,t,r):t),ve={factoryExtensions:{data:e=>({get all(){return new Proxy(e[0]?.dataset??{},Xt)},set:(t={})=>(!e.is.empty&&u(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&&u(t,Object)&&Object.entries(t).forEach(([r,o])=>e.setData({[r]:o})),e),remove:t=>(e[0]?.removeAttribute(`data-${N(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=Se(t,0),r.scrollLeftDistance=Se(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?q(o):o},set:(t,r=!1,o=!1)=>{t=t.isJQx?t.HTML.get(1):t;let i=u(t,String);return t=i&&o?q(t):t,i&&(t||"").trim().length&&e.html(t,r),e},replace:(t,r=!1)=>e.HTML.set(t,!1,r),append:(t,r=!1)=>(t=u(t,HTMLElement)?b(t).HTML.get(1):t.isJQx?t.HTML.get(1):t,e.HTML.set(t,!0,r)),insert:(t,r=!1)=>(t=u(t,HTMLElement)?b(t).HTML.get(1):t.isJQx?t.HTML.get(1):t,e.HTML.set(t+e.HTML.get(),!1,r))}),is:e=>Gt(e),length:e=>e.collection.length,outerHtml:e=>(e.first()||{outerHTML:void 0}).outerHTML,parent:e=>{let t=b(e[0]?.parentNode);return t.is.empty?e:t},render:e=>(!e.is.empty&&e.toDOM()||b.log("[JQx.render]: empty collection"),e),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])[N(t)],nwRule:t=>e.Style.byRule({rules:t}),byRule:({classes2Apply:t=[],rules:r=[]}={})=>{let i=u(r,String)&&!t.length?r.split("{")[0].trim():"";return r=r&&u(r,String)?[r]:r,t=t&&u(t,String)?[t]:t,(r?.length||t?.length)&&(r?.length&&b.editCssRules(...r),t?.forEach(l=>e.addClass(l))),i?.startsWith(".")&&e.addClass(i.slice(1)),i?.startsWith("#")&&!e.attr("id")&&e.prop({id:i.slice(1)}),e}})},instanceExtensions:{addClass:(e,...t)=>C(e,r=>r&&t.forEach(o=>r.classList.add(o))),after:Re,afterMe:Re,andThen:(e,t,r=!1)=>{if(!t||!u(t,String,Node,Proxy))return Yt(`[JQx instance].[beforeMe | afterMe | andThen]: insufficient input [${t}]`),e;t=t?.isJQx?t.collection:u(t,Node)?b.virtual(t).collection:b.virtual(O(t)).collection;let[o,i,l]=r?[0,"before",t.concat(e.collection)]:[e.collection.length-1,"after",e.collection.concat(t)];return e[o][i](...t),e.collection=l,e},append:(e,...t)=>{if(!e.is.empty&&t.length){let r=e.length===1;for(let o of t){if(!o.isJQx&&u(o,String)){let i=o.trim(),g=!/^<(.+)[^>]+>$/m.test(i)?b.text(o):O(o);C(e,S=>S.append(r?g:G(g)))}re(o)&&C(e,i=>i.append(r?o:G(o))),o.isJQx&&!o.is.empty&&C(e,i=>o.collection.forEach(l=>i.append(r?l:G(l))))}}return e},appendTo:(e,t)=>(t.isJQx||(t=b(t)),t.append(e),e),attr:(e,t,r)=>{let o=e[0];if(!o)return e;if(!r&&u(t,String))return t=N(t),t==="class"?[...o?.classList].join(" "):o?.getAttribute(t);if(u(t,String)&&r)switch(t=N(t),!0){case t.startsWith("data-"):t={data:{[t.replace("data-","")]:r}};break;default:t={[t]:r}}return u(t,Object)&&!e.is.empty&&Zt(o,t),e},before:Pe,beforeMe:Pe,clear:e=>C(e,De),closest:(e,t)=>{let r=u(t,String)?e[0].closest(t):null;return r?b(r):e},computedStyle:(e,t)=>e.first()&&getComputedStyle(e.first())[t],css:(e,t,r)=>C(e,o=>Vt(o,t,r)),duplicate:(e,t=!1,r=document.body)=>{let o=e.toNodeList().map(l=>l.removeAttribute&&l.removeAttribute("id")||l),i=b.virtual(o);return t?i.toDOM(r):i},each:(e,t)=>C(e,t),empty:e=>C(e,De),find:(e,t)=>e.collection.length>0?[...e.first()?.querySelectorAll(t)]:[],find$:(e,t)=>e.collection.length>0?b(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=>C(e,t=>xe(t,{display:"none !important"})),html:(e,t,r)=>{if(t===void 0)return e[0]?.getHTML();if(!e.isEmpty()){let o=O(`<div>${t.isJQx?t.HTML.get(!0):t}</div>`);if(!u(o,Comment))return C(e,l=>(r||(l.textContent=""),l.insertAdjacentHTML(b.at.end,o.getHTML())))}return e},htmlFor:(e,t,r="",o=!1)=>{if(t&&e.collection.length){if(!t||!u(r,String))return e;let i=e.find$(t);if(i.length<1)return e;let l=O(`<span>${r}</span>`);i.each(g=>{o||(g.textContent=""),g.insertAdjacentHTML(b.at.end,l.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 i=ke(e);b.delegate(t,i,o)}),e),prepend:(e,...t)=>{if(!e.is.empty&&t){let r=e.length===1;for(let o of t){if(u(o,String)){o=o.trim();let l=!/^<(.+)[^>]+>$/m.test(o)?b.text(o):O(o);l=r?l:G(l),C(e,g=>g.prepend(l.cloneNode(!0)))}re(o)&&C(e,i=>i.prepend(r?o:G(o))),o.isJQx&&!o.is.empty&&(o.collection.length>1&&o.collection.reverse(),C(e,i=>C(o,l=>i.prepend(r?l:G(l)))),o.collection.reverse())}}return e},prependTo:(e,t)=>(t.isJQx||(t=b.virtual(t)),t.prepend(e),e),prop:(e,t,r)=>{if(u(t,String)&&!r)return t.startsWith("data")?e[0]?.dataset[t.slice(t.indexOf("-")+1)]:e[0]?.[t];let o=u(t,Object)?t:{[t]:r};return Object.entries(o).forEach(([i,l])=>{if(i=i.trim(),l&&!Be(i)||!l)return!1;if(i.toLowerCase()==="id")return e[0].id=l;C(e,S=>{if(i.startsWith("data"))return S.dataset[i.slice(i.indexOf("-")+1)]=l;S[i]=l})}),e},remove:(e,t)=>{M(`remove ${I(e.HTML.get(1),40)}${t?` /w selector ${t}`:""}`);let r=i=>i.remove(),o=()=>e.collection=e.collection.filter(i=>document.documentElement.contains(i));if(t){let i=e.find$(t);return i.is.empty||(C(i,r),o()),e}return C(e,r),o(),e},rmAttr:(e,...t)=>(t.forEach(r=>e.node.removeAttribute(r)),e),removeClass:(e,...t)=>C(e,r=>r&&t.forEach(o=>r.classList.remove(o))),renderTo:(e,t=document.body,r=b.insertPositions.end)=>(e.toDOM(t,r),e),replace:(e,t,r)=>{let o=e[0];return!t||!r||!u(r,HTMLElement)&&!r.isJQx?(console.error("JQx replace: invalid replacement value"),e):(r.isJQx&&(r=r[0]),u(r,NodeList)&&(r=r[0]),o&&t&&(t=u(t,String)?o.querySelectorAll(t):t.isJQx?t.collection:t,u(t,HTMLElement,NodeList,Array)&&u(r,HTMLElement)&&(u(t,HTMLElement)?[t]:[...t]).forEach(i=>i.replaceWith(r.cloneNode(!0)))),e)},replaceClass:(e,t,...r)=>C(e,o=>{o.classList.remove(t),r.forEach(i=>o.classList.add(i))}),replaceMe:(e,t)=>e.replaceWith(t),replaceWith:(e,t)=>(t=u(t,Element)?t:t.isJQx?t[0]:void 0,t&&(e[0].replaceWith(t),e=b.virtual(t)),e),setData:(e,t)=>C(e,r=>Je(r,t)),show:e=>C(e,t=>xe(t,{display:"revert-layer !important"})),single:(e,t)=>e.collection.length>0?u(t,String)?e.find$(t):u(t,Number)?b(e.collection[t]):b(e.collection[0]):e,style:(e,t,r)=>C(e,i=>{r&&u(t,String)&&(t={[t]:r||"none"}),xe(i,t)}),text:(e,t,r=!1)=>e.isEmpty()?e:u(t,String)?C(e,i=>i.textContent=r?i.textContent+t:t):e.first().textContent,toDOM:(e,t=document.body,r=F.BeforeEnd)=>(e.isVirtual&&(e.isVirtual=!1),e.collection=U(e.collection,t,r),e),toggleClass:(e,t)=>C(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 i=new r(t,{...o,bubbles:o.bubbles??!0});for(let l of e.collection)l.dispatchEvent(i)}return e},val:(e,t)=>{let r=e[0];return!r||!u(r,HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement)?e:t===void 0?r.value:(r.value=u(t,String)?t:"",e)}}};var We=Kt;function Kt(e){let t=e.createStyle("JQxPopupCSS");Le.forEach(a=>t(a));let r={},o,i,l,g=e.virtual('<div class="popup-warn">'),S=e('<div class="popupContainer">').append(e('<span class="closeHandleIcon">')).append(e('<div class="content">')),[w,h]=[e(".popupContainer > .closeHandleIcon"),e(".popupContainer > .content")],L=()=>{if(w.hasClass("popup-active")){let{x:a,y:m,width:v}=h.dimensions;w.style({top:`${m-12}px`,left:`${a+v-12}px`})}},T=()=>{i&&e(".popup-warn").clear().append(e(`<div>${i}</div>`)),h.addClass("popup-warn-active")},p=()=>{o=!1,y(w.first())},x=(a,m)=>l=setTimeout(()=>y(w[0]),+a*1e3);return e.delegate("click",".popupContainer, .closeHandleIcon",a=>y(a.target)),e.delegate("click",".popupContainer .content",(a,m)=>o&&m.removeClass("popup-warn-active")),e.delegate("resize",L),{show:f,create:(a,m,v,n)=>{let s=e.IS(m,Boolean)?m:!1;f({content:a,modal:s,callback:s?v:m,warnMessage:n})},createTimed:(a,m,v)=>f({content:a,closeAfter:m,callback:v}),removeModal:p};function f({content:a,modal:m,closeAfter:v,callback:n,warnMessage:s}){if(a){if(a=e.IS(a,Node)?jqx(a):a,clearTimeout(l),o=m??!1,i=e.IS(s,String)&&`${s?.trim()}`.length||s?.isJQx?s:void 0,h.clear().append(a.isJQx?a:e(`<div>${a}</div>`)),o&&s&&h.append(g.duplicate()),S.addClass("popup-active"),e.IS(n,Function)){let c=D();S.data.set({callbackId:c}),r[c]=n}if(!o){if(e.IS(+v,Number)){let c=S.data.get("callbackId"),d=c&&r[c];x(v,d)}w.addClass("popup-active"),L()}return!0}return console.error("Popup creation needs at least some text to show")}function y(a){if(!o&&!a.closest(".content")){clearTimeout(l),h.clear();let m=S.data.get("callbackId");S.data.remove("callbackId"),e(".popup-active").removeClass("popup-active");let v=m&&r[m];e.IS(v,Function)&&v(),m&&delete r[m],i="";return}return o&&T()}}var Q={},er=["load","unload","scroll","focus","blur","DOMNodeRemovedFromDocument","DOMNodeInsertedIntoDocument","loadstart","progress","error","abort","load","loadend","pointerenter","pointerleave","readystatechange"],tr=e=>!!er.find(t=>t===e),ze=()=>{let e=o=>Q[o.type].forEach(i=>i(o)),t=(o,i)=>l=>{let g=l.target?.closest?.(o);return g&&i(l,b(g))},r=(o,i)=>{Q[o]||addEventListener(o,e,tr(o))};return(o,i,l,g=!1)=>{r(o,g);let S=i?t(i,l):l;Q=Q[o]?{...Q,[o]:Q[o].concat(S)}:{...Q,[o]:[S]}}};var rr={},{instanceMethods:_e,instanceGetters:qe,isCommentOrTextNode:Qe,isNode:re,isHtmlString:Ge,isArrayOfHtmlElements:Ve,isArrayOfHtmlStrings:Ze,ElemArray2HtmlString:Xe,input2Collection:Ye,setCollectionFromCssSelector:Ke,addHandlerId:ke,cssRuleEdit:Ee,addFn:or,elems4Docs:wo}=nr();function nr(){let e=K({createWithId:"JQxStylesheet"}),t=(a,m)=>r[a]=(v,...n)=>m(v,...n),r=ve.instanceExtensions,o=ve.factoryExtensions,i=a=>u(a,Comment,Text),l=a=>u(a,Text,HTMLElement,Comment),g=a=>u(a,Comment),S=a=>u(a,Text),w=a=>u(a,String)&&/^<|>$/.test(`${a}`.trim()),h=a=>u(a,Array)&&!a?.find(m=>!w(m)),L=a=>u(a,Array)&&!a?.find(m=>!l(m)),T=a=>a?.filter(m=>m).reduce((m,v)=>m.concat(g(v)?`<!--${v.data}-->`:i(v)?v.textContent:v.outerHTML),""),p=a=>a?u(a,Proxy)?[a.EL]:u(a,NodeList)?[...a]:l(a)?[a]:L(a)?a:a.isJQx?a.collection:void 0:[],x=(a,m,v)=>{let n=m!==document.body&&u(a,String)&&a.toLowerCase()!=="body"?m:document,s;try{v.collection=[...n.querySelectorAll(a)]}catch{s=`Invalid CSS querySelector. [${u(a,String)?a:"Nothing valid given!"}]`}return s??`CSS querySelector "${a}", output ${v.collection.length} element(s)`},f=a=>{let m=a.data.get("hid")||`HID${D()}`;return a.data.add({hid:m}),`[data-hid="${m}"]`},y=Object.entries(j.tagsRaw).filter(([,a])=>a).map(([a])=>a).sort((a,m)=>a.localeCompare(m));return{instanceMethods:r,instanceGetters:o,isCommentOrTextNode:i,isNode:l,isComment:g,isText:S,isHtmlString:w,isArrayOfHtmlElements:L,isArrayOfHtmlStrings:h,ElemArray2HtmlString:T,input2Collection:p,setCollectionFromCssSelector:x,addHandlerId:f,cssRuleEdit:e,addFn:t,elems4Docs:y}}function V(e){return new Proxy(e,{get:(t,r)=>lr(t,r,e)})}function ir(e,t){return(...r)=>u(e,Function)&&e(V(t),...r)}function sr(e,t){return(...r)=>u(e,Function)&&e(V(t),...r)}function lr(e,t,r){switch(!0){case u(t,Symbol):return e;case u(+t,Number):return e.collection?.[t]||`ELEMENT WITH INDEX ${t} NOT FOUND`;case t in qe:return sr(qe[t],r)();case t in _e:return ir(_e[t],r);default:return e[t]}}function et(e){let t=gr(e);return Object.entries(Object.getOwnPropertyDescriptors(t)).forEach(([r,o])=>{Object.defineProperty(e,r,o),Object.defineProperty(rr,r,o)}),e}function ar(e){return{allow:t=>{let r=/-/.test(t),o=r&&t;t=r?ee(t):t.toLowerCase(),j.allowTag(t),u(e[t],Function)||Object.defineProperties(e,we(t,!0,e,o))},prohibit:t=>{t=t.toLowerCase(),j.prohibitTag(t),u(e[t],Function)&&Object.defineProperties(e,we(t,!1,e))}}}function Ue(...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=>Ee(t,{removeRule:1}))}function cr(e){return function(t,r,...o){return u(r,Function)&&(o.push(r),r=void 0),o.forEach(i=>e(t,r,i))}}function ur(e){return function(t,r,o){r=r?.isJQx?r?.[0]:r,o=o&&Object.values(F).find(l=>o===l)?o:void 0;let i=e(t,document.createElement("br"));return r&&!u(r,HTMLBRElement)&&i.collection.forEach(l=>o?r.insertAdjacentElement(o,l):r.append(l)),i}}function dr(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.entries(o).forEach(([i,l])=>!(i in t)&&Object.defineProperty(t,i,l))}return t}function fr(e){console.error(`JQx: "${e}" not allowed, not rendered`)}function mr(e,t,r,o){return e=N(o||e.toLowerCase()),{get(){return(...i)=>t?r.virtual(te(pe[e](...i))):fr(e)},enumerable:!1,configurable:!0}}function we(e,t,r,o){e=e.toLowerCase();let i=mr(e,t,r,o);return o?{[o]:i,[ee(o)]:i}:{[e]:i,[e.toUpperCase()]:i}}function gr(e){return dr(Object.entries(j.tagsRaw).reduce(pr(e),{}),yr(e))}function pr(e){return function(t,[r,o]){return o&&Object.defineProperties(t,we(r,o,e)),t}}function yr(e){let t=(o,i)=>Ee(o,i),r=ar(e);return{debugLog:$,log:(...o)=>A("fromStatic",...o),insertPositions:F,get at(){return F},editCssRules:(...o)=>o.forEach(i=>Ee(i)),editCssRule:t,get setStyle(){return t},delegate:cr(ze()),virtual:ur(e),get fn(){return or},allowTag:r.allow,prohibitTag:r.prohibit,get lenient(){return j.allowUnknownHtmlTags},get IS(){return u},get Popup(){return e.activePopup||Object.defineProperty(e,"activePopup",{value:We(e),enumerable:!1}),e.activePopup},popup:()=>e.Popup,createStyle:o=>K({createWithId:o||`jqx${D()}`}),editStylesheet:o=>K({createWithId:o||`jqx${D()}`}),removeCssRule:Ue,removeCssRules:Ue,text:(o,i=!1)=>i?e.comment(o):document.createTextNode(o),node:(o,i=document)=>i.querySelector(o,i),nodes:(o,i=document)=>[...i.querySelectorAll(o,i)]}}var b=et(br());function br(){return function(r,o,i=F.BeforeEnd){if(r?.isJQx)return r;let l=u(o,HTMLBRElement);o=(!l&&o&&o.isJQx?o[0]:o)||document.body,i=i&&Object.values(F).find(x=>i===x)?i:void 0;let g=Ge(r),S=!g&&Ze(r),w=S||g,h={collection:Ye(r)??[],isVirtual:l,isJQx:!0},L=Ve(h.collection),T=`input =&gt; ${S?`"${I(r.join(", "),70)}"`:!w&&L?`element collection [${I(h.collection.map(x=>`${u(x,Comment,Text)?"Comment|Text @":""} ${x?.outerHTML||x?.textContent}`).join(", "),70)}]`:`"${I(r,70)}"`}`;if(h.collection.length&&L)return M(T),l||h.collection.forEach(x=>{o.contains(x)||U([x],o,i)}),V(h);if(w){if([r].flat().forEach(x=>h.collection.push(O(x))),h.collection.length>0){let x=h.collection.filter(f=>f?.dataset?.jqxcreationerror);h.collection=h.collection.filter(f=>!f?.dataset?.jqxcreationerror),M(`${T}`),M(`*Created ${h.isVirtual?"VIRTUAL ":""}[${I(Xe(h.collection)||"sanitized: no elements remaining",70)}]`),x.length&&console.error(`JQx: illegal html, not rendered: "${x.reduce((f,y)=>f.concat(`${y.textContent}
15
- `),"").trim()}"`),h.isVirtual||U(h.collection,o,i)}return V(h)}let p=Ke(r,o,h);return M(`input => ${p}`),V(h)}}return st(hr);})();
1
+ var JQx=(()=>{var se=Object.defineProperty;var tt=Object.getOwnPropertyDescriptor;var rt=Object.getOwnPropertyNames;var nt=Object.prototype.hasOwnProperty;var ot=(e,t)=>{for(var r in t)se(e,r,{get:t[r],enumerable:!0})},it=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of rt(t))!nt.call(e,i)&&i!==r&&se(e,i,{get:()=>t[i],enumerable:!(n=tt(t,i))||n.enumerable});return e};var lt=e=>it(se({},"__esModule",{value:!0}),e);var yr={};ot(yr,{default:()=>b});var ae=ct(),Le=ut(),J=st(),Z=at();function st(){return{html:Object.freeze("accept,action,align,alt,autocapitalize,autocomplete,autopictureinpicture,autoplay,background,bgcolor,border,capture,cellpadding,cellspacing,checked,cite,class,clear,contenteditable,color,cols,colspan,controls,controlslist,coords,crossorigin,datetime,decoding,default,dir,disabled,disablepictureinpicture,disableremoteplayback,download,draggable,enctype,enterkeyhint,face,for,headers,height,hidden,high,href,hreflang,id,inputmode,integrity,is,ismap,kind,label,lang,list,loading,loop,low,max,maxlength,media,method,min,minlength,multiple,muted,name,nonce,noshade,novalidate,nowrap,open,optimum,pattern,placeholder,playsinline,poster,preload,pubdate,radiogroup,readonly,rel,required,rev,reversed,role,rows,rowspan,spellcheck,scope,selected,shape,size,sizes,span,srclang,start,src,srcset,step,style,summary,tabindex,target,title,translate,type,usemap,valign,value,width,xmlns,slot".split(",")),svg:Object.freeze("accent-height,accumulate,additive,alignment-baseline,ascent,attributename,attributetype,azimuth,basefrequency,baseline-shift,begin,bias,by,class,clip,clippathunits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,cx,cy,d,dx,dy,diffuseconstant,direction,display,divisor,dur,edgemode,elevation,end,fill,fill-opacity,fill-rule,filter,filterunits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,fx,fy,g1,g2,glyph-name,glyphref,gradientunits,gradienttransform,height,href,id,image-rendering,in,in2,k,k1,k2,k3,k4,kerning,keypoints,keysplines,keytimes,lang,lengthadjust,letter-spacing,kernelmatrix,kernelunitlength,lighting-color,local,marker-end,marker-mid,marker-start,markerheight,markerunits,markerwidth,maskcontentunits,maskunits,max,mask,media,method,mode,min,name,numoctaves,offset,operator,opacity,order,orient,orientation,origin,overflow,paint-order,path,pathlength,patterncontentunits,patterntransform,patternunits,points,preservealpha,preserveaspectratio,primitiveunits,r,rx,ry,radius,refx,refy,repeatcount,repeatdur,restart,result,rotate,scale,seed,shape-rendering,specularconstant,specularexponent,spreadmethod,startoffset,stddeviation,stitchtiles,stop-color,stop-opacity,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke,stroke-width,style,surfacescale,systemlanguage,tabindex,targetx,targety,transform,text-anchor,text-decoration,text-rendering,textlength,type,u1,u2,unicode,values,viewbox,visibility,version,vert-adv-y,vert-origin-x,vert-origin-y,width,word-spacing,wrap,writing-mode,xchannelselector,ychannelselector,x,x1,x2,xmlns,y,y1,y2,z,zoomandpan".split(","))}}function at(){return{a:!0,area:!0,audio:!1,br:!0,base:!0,body:!0,button:!0,canvas:!0,comment:!0,dl:!0,data:!0,datalist:!0,div:!0,em:!0,embed:!1,fieldset:!0,font:!0,footer:!0,form:!1,hr:!0,head:!0,header:!0,output:!0,iframe:!1,frameset:!1,img:!0,input:!0,li:!0,label:!0,legend:!0,link:!0,map:!0,mark:!0,menu:!0,media:!0,meta:!0,nav:!0,meter:!0,ol:!0,object:!1,optgroup:!0,option:!0,p:!0,param:!0,picture:!0,pre:!0,progress:!1,quote:!0,script:!1,select:!0,source:!0,span:!0,style:!0,caption:!0,td:!0,col:!0,table:!0,tr:!0,template:!1,textarea:!0,time:!0,title:!0,track:!0,details:!0,ul:!0,video:!0,del:!0,ins:!0,slot:!0,blockquote:!0,svg:!0,dialog:!0,summary:!0,main:!0,address:!0,colgroup:!0,tbody:!0,tfoot:!0,thead:!0,th:!0,dd:!0,dt:!0,figcaption:!0,figure:!0,i:!0,b:!0,code:!0,h1:!0,h2:!0,h3:!0,h4:!0,abbr:!0,bdo:!0,dfn:!0,kbd:!0,q:!0,rb:!0,rp:!0,rt:!0,ruby:!0,s:!0,strike:!0,samp:!0,small:!0,strong:!0,sup:!0,sub:!0,u:!0,var:!0,wbr:!0,nobr:!0,tt:!0,noscript:!0}}function ct(){return["#logBox{min-width:0px;max-width:0px;min-height:0px;max-height:0px;width:0;height:0;z-index:-1;border:none;padding:0px;overflow:hidden;transition:all 0.3s ease;margin-top:-100px;}","#logBox.visible{background-color:rgb(255, 255, 224);z-index:1;position:static;border:1px dotted rgb(153, 153, 153);max-width:50vw;min-width:30vw;min-height:10vh;max-height:90vh;overflow:auto;width:50vw;height:20vh;margin:1rem 0px;padding:0px 8px 19px;resize:both;}","#logBox.visible .legend{position:absolute;}","#logBox .legend{text-align:center;margin-top:-1em;width:inherit;max-width:inherit;}","#logBox .legend div{text-align:center;display:inline-block;max-width:inherit;height:1.2rem;background-color:rgb(119, 119, 119);padding:2px 10px;color:rgb(255, 255, 255);box-shadow:rgb(119 119 119) 2px 1px 10px;border-radius:4px;}","#logBox .legend div:before{content:'JQx Logging (chronological)';}","#logBox .legend.reversed div:before{content:'JQx Logging (reversed)';}","#logBox #jqx_logger{marginTop:0.7rem;lineHeight:1.4em;font-family:consolas,monospace;whiteSpace:pre-wrap;maxWidth:inherit;padding-left:100px;}","#logBox #jqx_logger div.entry{text-indent:-100px;whiteSpace:normal;}"]}function ut(){return["::backdrop{background-color:grey;opacity:0.2;}",`#jqxPopup{overflow:hidden;background-color:transparent;outline:none;border:none;inset:0;animation:fade-out 0.5s ease-out;&[open]{display:flex;align-items:center;justify-content:center;animation:fade-in 0.5s ease;}#jqxPopupContent{background-color:white;border:solid 1px #eee;box-shadow:1px 2px 8px #999;border-radius:4px;padding:12px;vertical-align:middle;max-height:40vh;max-width:50vw;overflow:auto;margin:0 auto;div:not(#closeHandleIcon){clear:both;}@media (width <= 640px){max-width:80vw;max-height:60vh;}#closeHandleIcon{cursor:pointer;width:24px;height:24px;display:inline;position:absolute;top:4px;right:4px;justify-content:right;background-image:url("data:image/svg+xml;utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20version%3D%221.1%22%20id%3D%22Layer_1%22%20x%3D%220px%22%20y%3D%220px%22%20viewBox%3D%220%200%20128%20128%22%20style%3D%22enable-background%3Anew%200%200%20128%20128%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Crect%20x%3D%22-368%22%20y%3D%226%22%20style%3D%22display%3Anone%3Bfill%3A%23E0E0E0%3B%22%20width%3D%22866%22%20height%3D%221018%22%2F%3E%3Ccircle%20style%3D%22fill%3A%23FFFFFF%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2248%22%2F%3E%3Ccircle%20style%3D%22fill%3A%238CCFB9%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2239%22%2F%3E%3Ccircle%20style%3D%22fill%3Anone%3Bstroke%3A%23444B54%3Bstroke-width%3A6%3Bstroke-miterlimit%3A10%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2248%22%2F%3E%3Cpolyline%20style%3D%22fill%3Anone%3Bstroke%3A%23FFFFFF%3Bstroke-width%3A6%3Bstroke-linecap%3Around%3Bstroke-miterlimit%3A10%3B%22%20points%3D%2242%2C69%2055.55%2C81%20%20%2086%2C46%20%22%2F%3E%3C%2Fsvg%3E");@media (width <= 640px){background-image:none;position:relative;margin:-15px -15px 4px 0;float:right;vertical-align:middle;border:1px solid #AAA;padding:2px;border-radius:50%;width:12px;height:12px;font-size:12px;line-height:12px;font-weight:bold;text-align:center;&:after{content:'\\2714';color:green;}}}.warn{display:none;text-align:center;color:red;border-top:1px solid #999;margin-top:1em;padding-top:3px;animation:warn-fade-out 0.2s ease-out;}.warn.active{opacity:1;display:block;animation:warn-fade-in 0.2s ease-in;}}}`,"@keyframes fade-in{0%{opacity:0;transform:scale(0, 0);display:none;}100%{opacity:1;transform:scale(1, 1);display:flex;}}","@keyframes fade-out{0%{opacity:1;transform:scale(1, 1);display:flex;}100%{opacity:0;transform:scale(0, 0);display:none;}}","@keyframes warn-fade-in{0%{opacity:0;transform:scale(0, 0);display:none;}100%{opacity:1;transform:scale(1,1 );display:block;}}","@keyframes warn-fade-out{0%{opacity:1;transform:scale(1, 1);display:block;}100%{opacity:0;transform:scale(0, 0);display:none;}}"]}var ce=!1,ft={on:()=>ce=!0,off:()=>ce=!1},M={tagsRaw:Z,allowUnknownHtmlTags:ft,isAllowed(e){if(ce)return!0;let t=a(e,String)?e.toLowerCase():e?.nodeName.toLowerCase()||"none";return t==="#text"||!!Z[t]},allowTag:e=>Z[e.toLowerCase()]=!0,prohibitTag:e=>Z[e.toLowerCase()]=!1};var de=!1,X=!1,W=!0,me=!1,dt=!0,$e,Q=()=>b("#logBox"),Te="#jqx_logger",mt=e=>{ae?.forEach(t=>e(t))},gt=()=>{ae&&mt($e);let e=dt?"div":"pre",t=`<div id="logBox"><div class="legend"><div></div></div><${e} id="jqx_logger"></${e}></div>`;return ge(H(t),void 0,F.AfterBegin),b.node(Te)},Ce=e=>a(e,String)&&Object.assign(document.createElement("textarea"),{innerHTML:e}).textContent||e,D=(...e)=>{let t=e[0]==="fromStatic";if(e=t?e.slice(1):e,t&&!X)return e.forEach(n=>console.info(`${q()} \u2714 ${Ce(n)}`));if(!X)return;!W&&!b.node("#logBox")&&($e=b.createStyle("JQxLogCSS"),gt());let r=n=>`${a(n,Object)?JSON.stringify(n,null,2):n}
2
+ `;e.forEach(n=>W?console.info(`${q()} \u2714 ${Ce(n)}`):b.node("#jqx_logger").insertAdjacentHTML(me?"afterbegin":"beforeend",`<div class="entry">${q()} ${r(n.replace(/\n/g,"<br>"))}</div>`))},ue={on(){X=!0,D("Logging activated")},off(){X=!1,console.log("Logging deactivated")}},fe={on(){de=!0},off(){de=!1}},N=(...e)=>de&&D(...e),$={get isConsole(){return W===!0},get isOn(){return X},isVisible:function(){return b("#jqx_logger").is("visible")},on(){return ue.on(),fe.on(),W||Q()?.addClass("visible"),D("Debug logging started. Every call to [jqx instance] is logged"),$},off(){return Q().isEmpty||(fe.off(),D("Debug logging stopped"),Q()?.removeClass("visible")),ue.off(),$},toConsole:{on(){return W=!0,D("Started logging to console"),$},off(){return D("Stopped logging to console (except error messages)"),W=!1,$}},remove(){return ue.off(),fe.off(),Q()?.remove(),console.clear(),console.log(`${q()} logging completely disabled and all entries removed`),$},log:function(...e){return D(...e),$},hide(){return Q()?.removeClass("visible"),$},show:()=>(Q()?.addClass("visible"),$),get reversed(){return{on:()=>(me=!0,D("Reverse logging set: now logging bottom to top (latest first)"),b("#logBox .legend").addClass("reversed"),$),off:()=>(me=!1,b("#logBox .legend").removeClass("reversed"),D("Reverse logging reset: now logging chronological (latest last)"),$)}},clear(){return b(Te).text(""),console.clear(),D("Logging cleared"),$}};var pt=yt(),Fe={html:"innerHTML",text:"textContent",class:"className"},pe=pt;function yt(){let e={get(t,r){let n=String(r)?.toLowerCase();switch(!0){case n in t:return t[n];case Ct(n):return Ae(t,n,r);default:return Ae(t,n,r,!0)}},enumerable:!1,configurable:!1};return new Proxy({},e)}function Ae(e,t,r,n=!1){return Object.defineProperty(e,t,{get(){return n?i=>wt(r):$t(t)}}),e[t]}function bt(e,t,r){return t=t?.isJQx&&t.first()||t,be({trial:n=>Lt(t)?e.append(t):He(t)?e.insertAdjacentHTML("beforeend",t):e.append(t),whenError:n=>console.info(`${r} (for root ${e}) not created, reason
3
+ `,n)})}function ht(e,t,...r){let n=xt(t,e);return r?.forEach(i=>bt(n,i,e)),n}function xt(e,t){switch(e=ye(t)?Et(e):e?.isJQx?e.first():e,!0){case a(e,String):return Y(t,He(e,t)?{html:e}:{text:e});case a(e,Node):return vt(t,e);default:return Y(t,e)}}function St(e){return delete e.data,Object.keys(e).length<1||Object.keys(e).forEach(t=>{let r=t.toLowerCase();r in Fe&&(e[Fe[r]]=e[t],delete e[t])}),e}function vt(e,t){let r=Y(e);return r.append(t),r}function Y(e,t={}){t=De(t,{});let r=Object.entries(t.data??{}),n=Object.assign(ye(e)?new Comment(t?.text):document.createElement(e),St(t));return r.length&&r.forEach(([i,s])=>n.dataset[i]=String(s)),n}function De(e,t){return t?a(e,{isTypes:Object,notTypes:[Array,null,NaN,Proxy],defaultValue:t}):a(e,{isTypes:Object,notTypes:[Array,null,NaN,Proxy]})}function Et(e){return De(e)?e?.text??e?.textContent??"":String(e)}function wt(e){return Y("b",{style:"color:red",text:`'${e}' is not a valid HTML-tag`})}function He(e,t){return!ye(t)&&a(e,String)&&/<.*>|&[#|0-9a-z]+[^;];/i.test(e)}function Lt(e){return e?.constructor===Comment||e?.constructor===CharacterData}function ye(e){return e?.constructor===Comment||/comment/i.test(e)}function Ct(e){return!a(Y(e),HTMLUnknownElement)}function $t(e){return(t,...r)=>ht(e,t,...r)}var{IS:a,maybe:be,$Wrap:Ar,xProxy:Dr,isNothing:Hr}=Tt();function Tt(){Symbol.proxy=Symbol.for("toa.proxy"),Symbol.is=Symbol.for("toa.is"),Symbol.type=Symbol.for("toa.type"),Symbol.isSymbol=Symbol.for("toa.isASymbol"),y();let e=T(),[t,r]=[d(),C()];return r.custom(),{IS:n,maybe:e,$Wrap:t,isNothing:E,xProxy:r};function n(o,...l){if(e({trial:u=>"isTypes"in(l?.[0]??{})})){let u=l[0];return"defaultValue"in u?g(o,u):"notTypes"in u?m(o,u):n(o,...[u.isTypes].flat())}let c=typeof o=="symbol"?Symbol.isSymbol:o;return l.length>1?x(c,...l):s(o,...l)}function i(o){return o?.[Symbol.proxy]??n(o)}function s(o,...l){let{noInput:c,noShouldbe:u,compareTo:S,inputCTOR:A,isNaN:P,isInfinity:I,shouldBeFirstElementIsNothing:R}=v(o,...l);switch(l=l.length&&l[0],!0){case R:return String(o)===String(S);case(o?.[Symbol.proxy]&&u):return o[Symbol.proxy];case P:return u?"NaN":e({trial:B=>String(S)})===String(o);case I:return u?"Infinity":e({trial:B=>String(S)})===String(o);case c:return u?String(o):String(S)===String(o);case A===Boolean:return l?A===l:"Boolean";default:return L(o,l,u,p(o,A))}}function p(o,l){return o===0?Number:o===""?String:o?l:{name:String(o)}}function v(o,...l){let c=l.length<1,u=!c&&l[0],S=!c&&E(l[0]),A=o==null,P=!A&&Object.getPrototypeOf(o)?.constructor,I=e({trial:B=>String(o)})==="NaN",R=e({trial:B=>String(o)})==="Infinity";return{noInput:A,noShouldbe:c,compareTo:u,inputCTOR:P,isNaN:I,isInfinity:R,shouldBeFirstElementIsNothing:S}}function L(o,l,c,u){switch(!0){case(!c&&l===o||o?.[Symbol.proxy]&&l===Proxy):return!0;case e({trial:S=>String(l)})==="NaN":return String(o)==="NaN";case(o?.[Symbol.toStringTag]&&n(l,String)):return String(l)===o[Symbol.toStringTag];default:return l?e({trial:S=>o instanceof l})||l===u||l===Object.getPrototypeOf(u)||`${l?.name}`===u?.name:o?.[Symbol.toStringTag]&&`[object ${o?.[Symbol.toStringTag]}]`||u?.name||String(u)}}function x(o,...l){return l.some(c=>n(o,c))}function E(o,l=!1){let c=o==null;return c=l?c||n(o,1/0)||n(o,NaN):c,c}function T(){let o=(l,c)=>l?.constructor===Function?l(c):void 0;return function({trial:l,whenError:c=()=>{}}={}){try{return o(l)}catch(u){return o(c,u)}}}function d(){return function(o){return Object.freeze({get value(){return o},get[Symbol.type](){return i(o)},get type(){return i(o)},[Symbol.is](...l){return n(o,...l)},is(...l){return n(o,...l)}})}}function g(o,{defaultValue:l,isTypes:c=[void 0],notTypes:u}={}){return c=c?.constructor!==Array?[c]:c,u=u&&u?.constructor!==Array?[u]:[],u.length<1?n(o,...c)?o:l:m(o,{isTypes:c,notTypes:u})?o:l}function m(o,{isTypes:l=[void 0],notTypes:c=[void 0]}={}){return l=l?.constructor!==Array?[l]:l,c=c?.constructor!==Array?[c]:c,n(o,...l)&&!n(o,...c)}function y(){Object.getOwnPropertyDescriptors(Object.prototype)[Symbol.is]||(Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return i(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...o){return n(this,...o)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(o){return i(o)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(o,...l){return n(o,...l)},enumerable:!1,configurable:!1}}))}function f(o){let l=String(Object.getPrototypeOf(o)?.constructor);return l.slice(l.indexOf("ion")+3,l.indexOf("(")).trim()}function h(o){let l=o.set;return o.set=(c,u,S)=>u===Symbol.proxy?c[u]=S:l(c,u,S),o}function C(){let o=Proxy;return{native(){Proxy=o},custom(){Proxy=new o(o,{construct(l,c){for(let S of c)S.set&&(S=h(S));let u=new l(...c);return u[Symbol.proxy]=`Proxy (${f(c[0])})`,u}})}}}}var{IS:ne,maybe:Or,$Wrap:Mr,xProxy:Nr,isNothing:Pr}=Ft();function Ft(){Symbol.proxy=Symbol.for("toa.proxy"),Symbol.is=Symbol.for("toa.is"),Symbol.type=Symbol.for("toa.type"),Symbol.isSymbol=Symbol.for("toa.isASymbol"),y();let e=T(),[t,r]=[d(),C()];return r.custom(),{IS:n,maybe:e,$Wrap:t,isNothing:E,xProxy:r};function n(o,...l){if(e({trial:u=>"isTypes"in(l?.[0]??{})})){let u=l[0];return"defaultValue"in u?g(o,u):"notTypes"in u?m(o,u):n(o,...[u.isTypes].flat())}let c=typeof o=="symbol"?Symbol.isSymbol:o;return l.length>1?x(c,...l):s(o,...l)}function i(o){return o?.[Symbol.proxy]??n(o)}function s(o,...l){let{noInput:c,noShouldbe:u,compareTo:S,inputCTOR:A,isNaN:P,isInfinity:I,shouldBeFirstElementIsNothing:R}=v(o,...l);switch(l=l.length&&l[0],!0){case R:return String(o)===String(S);case(o?.[Symbol.proxy]&&u):return o[Symbol.proxy];case P:return u?"NaN":e({trial:B=>String(S)})===String(o);case I:return u?"Infinity":e({trial:B=>String(S)})===String(o);case c:return u?String(o):String(S)===String(o);case A===Boolean:return l?A===l:"Boolean";default:return L(o,l,u,p(o,A))}}function p(o,l){return o===0?Number:o===""?String:o?l:{name:String(o)}}function v(o,...l){let c=l.length<1,u=!c&&l[0],S=!c&&E(l[0]),A=o==null,P=!A&&Object.getPrototypeOf(o)?.constructor,I=e({trial:B=>String(o)})==="NaN",R=e({trial:B=>String(o)})==="Infinity";return{noInput:A,noShouldbe:c,compareTo:u,inputCTOR:P,isNaN:I,isInfinity:R,shouldBeFirstElementIsNothing:S}}function L(o,l,c,u){switch(!0){case(!c&&l===o||o?.[Symbol.proxy]&&l===Proxy):return!0;case e({trial:S=>String(l)})==="NaN":return String(o)==="NaN";case(o?.[Symbol.toStringTag]&&n(l,String)):return String(l)===o[Symbol.toStringTag];default:return l?e({trial:S=>o instanceof l})||l===u||l===Object.getPrototypeOf(u)||`${l?.name}`===u?.name:o?.[Symbol.toStringTag]&&`[object ${o?.[Symbol.toStringTag]}]`||u?.name||String(u)}}function x(o,...l){return l.some(c=>n(o,c))}function E(o,l=!1){let c=o==null;return c=l?c||n(o,1/0)||n(o,NaN):c,c}function T(){let o=(l,c)=>l?.constructor===Function?l(c):void 0;return function({trial:l,whenError:c=()=>{}}={}){try{return o(l)}catch(u){return o(c,u)}}}function d(){return function(o){return Object.freeze({get value(){return o},get[Symbol.type](){return i(o)},get type(){return i(o)},[Symbol.is](...l){return n(o,...l)},is(...l){return n(o,...l)}})}}function g(o,{defaultValue:l,isTypes:c=[void 0],notTypes:u}={}){return c=c?.constructor!==Array?[c]:c,u=u&&u?.constructor!==Array?[u]:[],u.length<1?n(o,...c)?o:l:m(o,{isTypes:c,notTypes:u})?o:l}function m(o,{isTypes:l=[void 0],notTypes:c=[void 0]}={}){return l=l?.constructor!==Array?[l]:l,c=c?.constructor!==Array?[c]:c,n(o,...l)&&!n(o,...c)}function y(){Object.getOwnPropertyDescriptors(Object.prototype)[Symbol.is]||(Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return i(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...o){return n(this,...o)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(o){return i(o)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(o,...l){return n(o,...l)},enumerable:!1,configurable:!1}}))}function f(o){let l=String(Object.getPrototypeOf(o)?.constructor);return l.slice(l.indexOf("ion")+3,l.indexOf("(")).trim()}function h(o){let l=o.set;return o.set=(c,u,S)=>u===Symbol.proxy?c[u]=S:l(c,u,S),o}function C(){let o=Proxy;return{native(){Proxy=o},custom(){Proxy=new o(o,{construct(l,c){for(let S of c)S.set&&(S=h(S));let u=new l(...c);return u[Symbol.proxy]=`Proxy (${f(c[0])})`,u}})}}}}var K=At;function At({styleSheet:e,createWithId:t}={}){let{tryParseAtOrNestedRules:r,ruleExists:n,checkParams:i,sheet:s,removeRules:p,consider:v,currentSheetID:L}=Dt({styleSheet:e,createWithId:t});function x(m,y){if(m&&y.removeProperties){Object.keys(y.removeProperties).forEach(f=>m.style.removeProperty(je(f)));return}Object.entries(y).forEach(([f,h])=>{f=je(f.trim()),h=h.trim();let C;if(/!important/.test(h)&&(h=h.slice(0,h.indexOf("!important")).trim(),C="important"),!CSS.supports(f,h))return console.error(`StylingFactory ${L} error: '${f}' with value '${h}' not supported (yet)`);Oe(()=>m.style.setProperty(f,h,C),`StylingFactory ${L} (setRule4Selector) failed`)})}function E(m,y,f=s){if(m=m?.trim?.(),!ne(m,String)||!m.length||/[;,]$/g.test(m))return console.error(`StylingFactory ${L} (setRules): [${m||"[no selector given]"}] is not a valid selector`);if(y.removeRule)return p(m);let h=n(m,!0),C=h||f.cssRules[f.insertRule(`${m} {}`,f.cssRules.length||0)];return v(()=>x(C,y),m,h)}function T(m){let y=m.trim().split(/{/,2),f=y.shift().trim();if(!ne(f,String)||!f?.trim()?.length)return console.error(`StylingFactory ${L} (doParse): no (valid) selector could be extracted from rule ${he(m)}`);let h=It(y.shift());return Oe(()=>E(f,h),`StylingFactory ${L} (setRules) failed`)}function d(m){let y=r(m);return y.done?y.existing:T(m)}function g(m,y){return m.trim().startsWith("@media")?d(Ht(m,y)):E(m,y)}return function(m,y={}){return i(m,y)&&(Object.keys(y).length?g(m,y):d(m))}}function Dt({styleSheet:e,createWithId:t}){let r="Note: The rule or some of its properties may not be supported by your browser (yet)",n=`for style#${t}`;e=t?i(t):e;function i(d){let g=document.querySelector(`#${d}`)?.sheet;if(g)return g;let m=Object.assign(document.createElement("style"),{id:d});return document.head.insertAdjacentElement("beforeend",m),m.sheet}function s(d){return console.error(`StylingFactory ${n} [rule: ${d}]
4
+ => @charset, @namespace and @import are not supported here`),{done:!0}}function p(d,g){return[...e.rules].find(m=>g?Me(m.selectorText||"",d):Mt`${Ot(d)}${[..."gim"]}`.test(m.cssText))}function v(d){return/^@charset|@import|namespace/i.test(d.trim())?s(d):d.match(/}/g)?.length>1?{existing:E(d,1),done:!0}:{done:!1}}function L(d){let g=[...e.cssRules].reduce((y,f,h)=>Me(f.selectorText||"",d)&&y.concat(h)||y,[]),m=g.length;return g.forEach(y=>e.deleteRule(y)),m>0?console.info(`\u2714 Removed ${m} instance${m>1?"s":""} of selector ${d} from ${n.slice(4)}`):console.info(`\u2714 Remove rule: selector ${d} does not exist in ${n.slice(4)}`)}function x(d,g){return d&&ne(d,String)&&d.trim().length>0&&ne(g,Object)||(console.error(`StylingFactory ${n} called with invalid parameters`),!1)}function E(d){d=d.trim();let g=d.slice(0,d.indexOf("{")).trim(),m=!!p(g);try{return e.insertRule(`${d}`,e.cssRules.length),m}catch(y){return console.error(`StylingFactory ${n} (tryParse) ${y.name} Error:
5
+ ${y.message}
6
+ Rule: ${he(d)}
7
+ ${r}`),m}}function T(d,g,m){try{return d(),m}catch(y){return console.error(`StylingFactory ${n} (tryAddOrModify) ${y.name} Error:
8
+ ${y.message}
9
+ Rule: ${he(g)}
10
+ ${r}`),m}}return{sheet:e,removeRules:L,tryParseAtOrNestedRules:v,ruleExists:p,checkParams:x,tryParse:E,consider:T,currentSheetID:n}}function Ht(e,t){return`${e.trim()} ${Object.entries(t).map(([r,n])=>`${r}: { ${jt(n)}`)}`}function he(e){let t=(e||"NO RULE").trim().slice(0,50).replace(/\n/g,"\\n").replace(/\s{2,}/g," ");return e.length>t.length?`${t.trim()}...truncated`:t}function jt(e){return Object.entries(e).map(([t,r])=>`${t}: ${r.trim()}`).join(`;
11
+ `)}function Ot(e){return e.replace(/([*\[\]()-+{}.$?\\])/g,t=>`\\${t}`)}function Mt(e,...t){let r=t.length&&Array.isArray(t.slice(-1))?t.pop().join(""):"";return new RegExp((t.length&&e.raw.reduce((n,i,s)=>n.concat(t[s-1]||"").concat(i),"")||e.raw.join("")).split(`
12
+ `).map(n=>n.replace(/\s|\/\/.*$/g,"").trim().replace(/(@s!)/g," ")).join(""),r)}function je(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`).replace(/[^--]^-|-$/,"")}function Oe(e,t){try{return e()}catch(r){console.error(`${t||"an error occured"}: ${r.message}`)}}function Nt(e){return e.replace(/\/\*.+?\*\//gm,"").replace(/[}{\r\n]/g,"").replace(/(data:.+?);/g,(t,r)=>`${r}\\3b`).split(";").map(t=>t.trim()).join(`;
13
+ `).replaceAll("\\3b",";").split(`
14
+ `)}function Pt(e){return e.reduce((t,r)=>{let[n,i]=[r.slice(0,r.indexOf(":")).trim(),r.slice(r.indexOf(":")+1).trim().replace(/;$|;.+(?=\/*).+\/$/,"")];return n&&i?{...t,[n]:i}:t},{})}function It(e){return Pt(Nt(e))}function Me(e,t){return e?.replace("::",":")===t?.replace("::",":")}var Rt=[...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}`)),oe=(e,t=2)=>`${e}`.padStart(t,"0"),Bt=(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)),kt=e=>{let t=e.length;for(;t--;){let r=Bt(t);[e[t],e[r]]=[e[r],e[t]]}return e};var j=(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(),O=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`).replace(/^-|-$/,""),Jt=([e,...t])=>`${e.toUpperCase()}${t.join("")}`,ee=e=>a(e,String)?e.toLowerCase().split("-").map((t,r)=>r&&`${Jt(t)}`||t).join(""):e,z=()=>`_${kt(Rt).slice(0,8).join("")}`,ie=(e,t=120)=>j(e,t).replace(/&lt;/g,"<"),q=()=>(e=>`[${oe(e.getHours())}:${oe(e.getMinutes())}:${oe(e.getSeconds())}.${oe(e.getMilliseconds(),3)}]`)(new Date);var _=e=>e.replace(/</g,"&lt;");function Ne(){let e=function(s){if(!s)return;let p=s.style,v=getComputedStyle(s),L=[p.visibility,v.visibility].includes("hidden"),x=[p.display,v.display].includes("none"),E=s.offsetTop<0||s.offsetLeft+s.offsetWidth<0||s.offsetLeft>document.body.offsetWidth,T=+v.opacity==0||+(p.opacity||1)==0;return!(E||T||x||L)},t="n/a",r=function(s){return s.parentNode?!!b.nodes(":is(:read-write)",s?.parentNode)?.find(p=>p===s):!1},n=function(s){return s.parentNode?!!b.nodes(":is(:modal)",s?.parentNode)?.find(p=>p===s):!1},i={notInDOM:!0,writable:t,modal:t,empty:!0,open:t,visible:t};return s=>{let p=s.node;return p?{get writable(){return r(p)},get modal(){return n(p)},get inDOM(){return p.isConnected},get open(){return p.open??!1},get visible(){return e(p)},get disabled(){return p.hasAttribute("readonly")||p.hasAttribute("disabled")},get empty(){return s.collection.length<1},get virtual(){return s.isVirtual}}:i}}var Qt=!0,le={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},Wt=e=>{if(Qt&&Object.keys(e.removed).length){let t=Object.entries(e.removed).reduce((r,[n,i])=>[...r,`${_(n)} => ${i}`],[]).join("\\000A");$.log(`JQx HTML creation errors: ${$.isConsole?t:_(t)}`)}},qt=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(n=>n===t)||M.isAllowed(t)},te=e=>{let t={rawHTML:e?.parentElement?.getHTML()??"no html",removed:{}};return a(e,HTMLElement)&&[...e.childNodes].forEach(r=>{if(r?.children?.length&&te(r),r?.attributes){let i=a(r,SVGElement)?J.svg:J.html;[...(r??{attributes:[]}).attributes].forEach(s=>{let p=s.name.trim().toLowerCase(),v=s.value.trim().toLowerCase().replace(le.whiteSpace,""),L=p==="href"?!le.validURL.test(v):le.notAllowedValues.test(v),x=p.startsWith("data")?!le.data.test(p):!!i[p];if(L||x){let E=ie(s.value||"none",60);E+=E.length===60?"...":"",t.removed[`${s.name}`]=`attribute/property (-value) not allowed, removed. Value: ${E}`,r.removeAttribute(s.name)}})}if(!(qt(r)||r.constructor===CharacterData||r.constructor===Comment)){let i=(r?.outerHTML||r?.textContent).trim(),s=ie(i,60)??"EMPTY";s+=s.length===60?"...":"",t.removed[`<${r.nodeName?.toLowerCase()}>`]=`not allowed, not rendered. Value: ${s}`,r.remove()}}),Wt(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?te(t):void 0},_t=(e,t,r)=>a(e,Comment)?t.insertAdjacentHTML(r,`<!--${e.data}-->`):t.insertAdjacentText(r,e.data),U=(e=[],t=document.body,r=F.BeforeEnd)=>e.reduce((n,i)=>{let s=re(i)&&ge(i,t,r);return s?[...n,s]:n},[]),ge=(e,t=document.body,r=F.BeforeEnd)=>(t=t?.isJQx?t?.[0]:t,a(e,Comment,Text)?_t(e,t,r):t.insertAdjacentElement(r,e)),H=e=>{if(a(e,Text,Comment))return e;let t=e?.trim(),r=t?.split(/<text>|<\/text>/i)??[];if(r?.length&&(r=r.length>1?r.filter(i=>i.length).shift():void 0),t.startsWith("<!--")&&t.endsWith("-->"))return document.createComment(e.replace(/<!--|-->$/g,""));if(r||!/^<(.+)[^>]+>/m.test(t))return document.createTextNode(r);let n=zt(e);return n.childNodes.length<1?H(`<span data-jqxcreationerror="1">${j(e,60)}</span>`):n.children[0]};var w=(e,t)=>{let r=e.collection.filter(n=>!Je(n));for(let n=0;n<r.length;n+=1)t(r[n],n);return e},Ut=Ne(),Pe=e=>e&&(e.textContent="");var V=e=>{let t=e.cloneNode(!0);return t.removeAttribute&&t.removeAttribute("id"),e.isConnected?e.remove():e=null,t},Be=(e,t)=>{e&&a(t,Object)&&Object.entries(t).forEach(([r,n])=>e.setAttribute(`data-${O(r)}`,n))},Ie=(e,t)=>e.andThen(t,!0),Re=(e,t)=>e.andThen(t),ke=e=>e.startsWith("data")||J.html.find(t=>e.toLowerCase()===t),Vt=(e,t,r)=>{r&&a(t,String)&&(t={[t]:r==="-"?"":r});let n;t.className&&(n=t.className,delete t.className),n=[...e.classList].find(s=>s.startsWith("JQxClass-")||n&&s===n)||n||`JQxClass-${z().slice(1)}`,b.editCssRule(`.${n}`,t),e.classList.add(n)},Gt=(e,t)=>{e&&Object.entries(t).forEach(([r,n])=>{if(r=O(r),r.startsWith("data"))return Be(e,n);a(n,String)&&ke(r)&&e.setAttribute(r,n.split(/[, ]/)?.join(" "))})},xe=(e,t)=>{a(t,Object)&&Object.entries(t).forEach(([r,n])=>{let i;/!important/i.test(n)&&(n=n.slice(0,n.indexOf("!")).trim(),i="important"),e.style.setProperty(O(r),n,i)})},Zt={get(e,t){return e[ee(t)]||e[t]},enumerable:!1,configurable:!1},Xt=(...e)=>{$.log("\u2757"+e.map(t=>String(t)).join(", "))},Se=(e,t=0,r=!0)=>(e=e?.parentElement,t+=e?e[r?"scrollTop":"scrollLeft"]:0,e?Se(e,t,r):t),ve={factoryExtensions:{data:e=>({get all(){return new Proxy(e[0]?.dataset??{},Zt)},set:(t={})=>(!e.is.empty&&a(t,Object)&&Object.entries(t).forEach(([r,n])=>e.setData({[r]:n})),e),get:(t,r)=>e.data.all[t]??r,add:(t={})=>(!e.is.empty&&a(t,Object)&&Object.entries(t).forEach(([r,n])=>e.setData({[r]:n})),e),remove:t=>(e[0]?.removeAttribute(`data-${O(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=Se(t,0),r.scrollLeftDistance=Se(t,0,!1),r},node:e=>e[0],HTML:e=>({get:(t,r)=>{if(e.is.empty)return"NO ELEMENTS IN COLLECTION";let n=t?e.outerHtml:e.html();return r?_(n):n},set:(t,r=!1,n=!1)=>{t=t.isJQx?t.HTML.get(1):t;let i=a(t,String);return t=i&&n?_(t):t,i&&(t||"").trim().length&&e.html(t,r),e},replace:(t,r=!1)=>e.HTML.set(t,!1,r),append:(t,r=!1)=>(t=a(t,HTMLElement)?b(t).HTML.get(1):t.isJQx?t.HTML.get(1):t,e.HTML.set(t,!0,r)),insert:(t,r=!1)=>(t=a(t,HTMLElement)?b(t).HTML.get(1):t.isJQx?t.HTML.get(1):t,e.HTML.set(t+e.HTML.get(),!1,r))}),is:e=>Ut(e),length:e=>e.collection.length,outerHtml:e=>(e.first()||{outerHTML:void 0}).outerHTML,parent:e=>{let t=b(e[0]?.parentNode);return t.is.empty?e:t},render:e=>(!e.is.empty&&e.toDOM()||b.log("[JQx.render]: empty collection"),e),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])[O(t)],nwRule:t=>e.Style.byRule({rules:t}),byRule:({classes2Apply:t=[],rules:r=[]}={})=>{let i=a(r,String)&&!t.length?r.split("{")[0].trim():"";return r=r&&a(r,String)?[r]:r,t=t&&a(t,String)?[t]:t,(r?.length||t?.length)&&(r?.length&&b.editCssRules(...r),t?.forEach(s=>e.addClass(s))),i?.startsWith(".")&&e.addClass(i.slice(1)),i?.startsWith("#")&&!e.attr("id")&&e.prop({id:i.slice(1)}),e}})},instanceExtensions:{addClass:(e,...t)=>w(e,r=>r&&t.forEach(n=>r.classList.add(n))),after:Re,afterMe:Re,andThen:(e,t,r=!1)=>{if(!t||!a(t,String,Node,Proxy))return Xt(`[JQx instance].[beforeMe | afterMe | andThen]: insufficient input [${t}]`),e;t=t?.isJQx?t.collection:a(t,Node)?b.virtual(t).collection:b.virtual(H(t)).collection;let[n,i,s]=r?[0,"before",t.concat(e.collection)]:[e.collection.length-1,"after",e.collection.concat(t)];return e[n][i](...t),e.collection=s,e},append:(e,...t)=>{if(!e.is.empty&&t.length){let r=e.length===1;for(let n of t){if(!n.isJQx&&a(n,String)){let i=n.trim(),p=!/^<(.+)[^>]+>$/m.test(i)?b.text(n):H(n);w(e,v=>v.append(r?p:V(p)))}re(n)&&w(e,i=>i.append(r?n:V(n))),n.isJQx&&!n.is.empty&&w(e,i=>n.collection.forEach(s=>i.append(r?s:V(s))))}}return e},appendTo:(e,t)=>(t.isJQx||(t=b(t)),t.append(e),e),attr:(e,t,r)=>{let n=e[0];if(!n)return e;if(!r&&a(t,String))return t=O(t),t==="class"?[...n?.classList].join(" "):n?.getAttribute(t);if(a(t,String)&&r)switch(t=O(t),!0){case t.startsWith("data-"):t={data:{[t.replace("data-","")]:r}};break;default:t={[t]:r}}return a(t,Object)&&!e.is.empty&&Gt(n,t),e},before:Ie,beforeMe:Ie,clear:e=>w(e,Pe),closest:(e,t)=>{let r=a(t,String)?e[0].closest(t):null;return r?b(r):e},computedStyle:(e,t)=>e.first()&&getComputedStyle(e.first())[t],css:(e,t,r)=>w(e,n=>Vt(n,t,r)),duplicate:(e,t=!1,r=document.body)=>{let n=e.toNodeList().map(s=>s.removeAttribute&&s.removeAttribute("id")||s),i=b.virtual(n);return t?i.toDOM(r):i},each:(e,t)=>w(e,t),empty:e=>w(e,Pe),find:(e,t)=>e.collection.length>0?[...e.first()?.querySelectorAll(t)]:[],find$:(e,t)=>e.collection.length>0?b(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(n=>r.classList.contains(n))&&!0||!1},hide:e=>w(e,t=>xe(t,{display:"none !important"})),html:(e,t,r)=>{if(t===void 0)return e[0]?.getHTML();if(!e.isEmpty()){let n=H(`<div>${t.isJQx?t.HTML.get(!0):t}</div>`);if(!a(n,Comment))return w(e,s=>(r||(s.textContent=""),s.insertAdjacentHTML(b.at.end,n.getHTML())))}return e},htmlFor:(e,t,r="",n=!1)=>{if(t&&e.collection.length){if(!t||!a(r,String))return e;let i=e.find$(t);if(i.length<1)return e;let s=H(`<span>${r}</span>`);i.each(p=>{n||(p.textContent=""),p.insertAdjacentHTML(b.at.end,s.getHTML())})}return e},isEmpty:e=>e.collection.length<1,nth$:(e,t)=>e.single(t),on:(e,t,...r)=>(e.collection.length&&r?.forEach(n=>{let i=Qe(e);b.delegate(t,i,n)}),e),prepend:(e,...t)=>{if(!e.is.empty&&t){let r=e.length===1;for(let n of t){if(a(n,String)){n=n.trim();let s=!/^<(.+)[^>]+>$/m.test(n)?b.text(n):H(n);s=r?s:V(s),w(e,p=>p.prepend(s.cloneNode(!0)))}re(n)&&w(e,i=>i.prepend(r?n:V(n))),n.isJQx&&!n.is.empty&&(n.collection.length>1&&n.collection.reverse(),w(e,i=>w(n,s=>i.prepend(r?s:V(s)))),n.collection.reverse())}}return e},prependTo:(e,t)=>(t.isJQx||(t=b.virtual(t)),t.prepend(e),e),prop:(e,t,r)=>{if(a(t,String)&&!r)return t.startsWith("data")?e[0]?.dataset[t.slice(t.indexOf("-")+1)]:e[0]?.[t];let n=a(t,Object)?t:{[t]:r};return Object.entries(n).forEach(([i,s])=>{if(i=i.trim(),s&&!ke(i)||!s)return!1;if(i.toLowerCase()==="id")return e[0].id=s;w(e,v=>{if(i.startsWith("data"))return v.dataset[i.slice(i.indexOf("-")+1)]=s;v[i]=s})}),e},remove:(e,t)=>{N(`remove ${j(e.HTML.get(1),40)}${t?` /w selector ${t}`:""}`);let r=i=>i.remove(),n=()=>e.collection=e.collection.filter(i=>document.documentElement.contains(i));if(t){let i=e.find$(t);return i.is.empty||(w(i,r),n()),e}return w(e,r),n(),e},rmAttr:(e,...t)=>(t.forEach(r=>e.node.removeAttribute(r)),e),removeClass:(e,...t)=>w(e,r=>r&&t.forEach(n=>r.classList.remove(n))),renderTo:(e,t=document.body,r=b.insertPositions.end)=>(e.toDOM(t,r),e),replace:(e,t,r)=>{let n=e[0];return!t||!r||!a(r,HTMLElement)&&!r.isJQx?(console.error("JQx replace: invalid replacement value"),e):(r.isJQx&&(r=r[0]),a(r,NodeList)&&(r=r[0]),n&&t&&(t=a(t,String)?n.querySelectorAll(t):t.isJQx?t.collection:t,a(t,HTMLElement,NodeList,Array)&&a(r,HTMLElement)&&(a(t,HTMLElement)?[t]:[...t]).forEach(i=>i.replaceWith(r.cloneNode(!0)))),e)},replaceClass:(e,t,...r)=>w(e,n=>{n.classList.remove(t),r.forEach(i=>n.classList.add(i))}),replaceMe:(e,t)=>e.replaceWith(t),replaceWith:(e,t)=>(t=a(t,Element)?t:t.isJQx?t[0]:void 0,t&&(e[0].replaceWith(t),e=b.virtual(t)),e),setData:(e,t)=>w(e,r=>Be(r,t)),show:e=>w(e,t=>xe(t,{display:"revert-layer !important"})),single:(e,t)=>e.collection.length>0?a(t,String)?e.find$(t):a(t,Number)?b(e.collection[t]):b(e.collection[0]):e,style:(e,t,r)=>w(e,i=>{r&&a(t,String)&&(t={[t]:r||"none"}),xe(i,t)}),text:(e,t,r=!1)=>e.isEmpty()?e:a(t,String)?w(e,i=>i.textContent=r?i.textContent+t:t):e.first().textContent,toDOM:(e,t=document.body,r=F.BeforeEnd)=>(e.isVirtual&&(e.isVirtual=!1),e.collection=U(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,n={})=>{if(e.collection.length){let i=new r(t,{...n,bubbles:n.bubbles??!0});for(let s of e.collection)s.dispatchEvent(i)}return e},val:(e,t)=>{let r=e[0];return!r||!a(r,HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement)?e:t===void 0?r.value:(r.value=a(t,String)?t:"",e)}}};function We(e){if(!e("#jqxPopup").isEmpty())return;e.dialog({id:"jqxPopup"},e.div({id:"jqxPopupContent"})).render,e.editCssRules(...Le);let[t,r]=[e("#jqxPopupContent"),e.node("#jqxPopup")],n={};return["click","keydown"].forEach(d=>document.addEventListener(d,x,!0)),Object.freeze({show:i,removeModal:L});function i(d){if(r.open)return;n={...d};let{content:g}=n;return e.IS(g,String,HTMLElement)||g?.isJQx?p():!0}function s(){return n.modal?T(n.warnMessage):v()}function p(){t.clear();let{content:d,modal:g,closeAfter:m}=n;g=e.IS(g,Boolean)?g:!1;let y=g?"":e.div({id:"closeHandleIcon"});t.append(y,e.IS(d,String)?e.div(d):d),r.showModal(),!g&&e.IS(m,Number)&&E(s,m)}function v(){return r.close(n.returnValue),e.IS(n.callback,Function)?n.callback(n.returnValue):!0}function L({callback:d,value:g}={}){n.returnValue=g,n.modal=!1,n.callback=d||n.callback,s()}function x(d){n.activeTimer&&clearTimeout(n.activeTimer);let g=d.key==="Escape";return g&&d.preventDefault(),(g||d.target.closest("#closeHandleIcon")||d.type!=="keydown"&&!d.target.closest("#jqxPopupContent"))&&s(),document.activeElement.blur()}function E(d,g){e.IS(d,Function)&&e.IS(g,Number)&&g>0&&(n.activeTimer=setTimeout(d,g*1e3))}function T(d){if(!e.IS(d,String,HTMLElement,Proxy))return;let g=t.find$(".warn");switch(!0){case g.is.empty:g=e.div({class:"warn"},d);default:t.append(g.addClass("active")),E(()=>t.find$(".warn").removeClass("active"),2)}}}var k={},Yt=["load","unload","scroll","focus","blur","DOMNodeRemovedFromDocument","DOMNodeInsertedIntoDocument","loadstart","progress","error","abort","load","loadend","pointerenter","pointerleave","readystatechange"],Kt=e=>!!Yt.find(t=>t===e),qe=()=>{let e=n=>k[n.type].forEach(i=>i(n)),t=(n,i)=>s=>{let p=s.target?.closest?.(n);return p&&i(s,b(p))},r=(n,i)=>{k[n]||addEventListener(n,e,Kt(n))};return(n,i,s,p=!1)=>{r(n,p);let v=i?t(i,s):s;k=k[n]?{...k,[n]:k[n].concat(v)}:{...k,[n]:[v]}}};var er={},{instanceMethods:ze,instanceGetters:_e,isCommentOrTextNode:Je,isNode:re,isHtmlString:Ve,isArrayOfHtmlElements:Ge,isArrayOfHtmlStrings:Ze,ElemArray2HtmlString:Xe,input2Collection:Ye,setCollectionFromCssSelector:Ke,addHandlerId:Qe,cssRuleEdit:Ee,addFn:tr,elems4Docs:Sn}=rr();function rr(){let e=K({createWithId:"JQxStylesheet"}),t=(f,h)=>r[f]=(C,...o)=>h(C,...o),r=ve.instanceExtensions,n=ve.factoryExtensions,i=f=>a(f,Comment,Text),s=f=>a(f,Text,HTMLElement,Comment),p=f=>a(f,Comment),v=f=>a(f,Text),L=f=>a(f,String)&&/^<|>$/.test(`${f}`.trim()),x=f=>a(f,Array)&&!f?.find(h=>!L(h)),E=f=>a(f,Array)&&!f?.find(h=>!s(h)),T=f=>f?.filter(h=>h).reduce((h,C)=>h.concat(p(C)?`<!--${C.data}-->`:i(C)?C.textContent:C.outerHTML),""),d=f=>f?a(f,Proxy)?[f.EL]:a(f,NodeList)?[...f]:s(f)?[f]:E(f)?f:f.isJQx?f.collection:void 0:[],g=(f,h,C)=>{let o=h!==document.body&&a(f,String)&&f.toLowerCase()!=="body"?h:document,l;try{C.collection=[...o.querySelectorAll(f)]}catch{l=`Invalid CSS querySelector. [${a(f,String)?f:"Nothing valid given!"}]`}return l??`CSS querySelector "${f}", output ${C.collection.length} element(s)`},m=f=>{let h=f.data.get("hid")||`HID${z()}`;return f.data.add({hid:h}),`[data-hid="${h}"]`},y=Object.entries(M.tagsRaw).filter(([,f])=>f).map(([f])=>f).sort((f,h)=>f.localeCompare(h));return{instanceMethods:r,instanceGetters:n,isCommentOrTextNode:i,isNode:s,isComment:p,isText:v,isHtmlString:L,isArrayOfHtmlElements:E,isArrayOfHtmlStrings:x,ElemArray2HtmlString:T,input2Collection:d,setCollectionFromCssSelector:g,addHandlerId:m,cssRuleEdit:e,addFn:t,elems4Docs:y}}function G(e){return new Proxy(e,{get:(t,r)=>ir(t,r,e)})}function nr(e,t){return(...r)=>a(e,Function)&&e(G(t),...r)}function or(e,t){return(...r)=>a(e,Function)&&e(G(t),...r)}function ir(e,t,r){switch(!0){case a(t,Symbol):return e;case a(+t,Number):return e.collection?.[t]||`ELEMENT WITH INDEX ${t} NOT FOUND`;case t in _e:return or(_e[t],r)();case t in ze:return nr(ze[t],r);default:return e[t]}}function et(e){let t=dr(e);return Object.entries(Object.getOwnPropertyDescriptors(t)).forEach(([r,n])=>{Object.defineProperty(e,r,n),Object.defineProperty(er,r,n)}),e}function lr(e){return{allow:t=>{let r=/-/.test(t),n=r&&t;t=r?ee(t):t.toLowerCase(),M.allowTag(t),a(e[t],Function)||Object.defineProperties(e,we(t,!0,e,n))},prohibit:t=>{t=t.toLowerCase(),M.prohibitTag(t),a(e[t],Function)&&Object.defineProperties(e,we(t,!1,e))}}}function Ue(...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=>Ee(t,{removeRule:1}))}function sr(e){return function(t,r,...n){return a(r,Function)&&(n.push(r),r=void 0),n.forEach(i=>e(t,r,i))}}function ar(e){return function(t,r,n){r=r?.isJQx?r?.[0]:r,n=n&&Object.values(F).find(s=>n===s)?n:void 0;let i=e(t,document.createElement("br"));return r&&!a(r,HTMLBRElement)&&i.collection.forEach(s=>n?r.insertAdjacentElement(n,s):r.append(s)),i}}function cr(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.entries(n).forEach(([i,s])=>!(i in t)&&Object.defineProperty(t,i,s))}return t}function ur(e){console.error(`JQx: "${e}" not allowed, not rendered`)}function fr(e,t,r,n){return e=O(n||e.toLowerCase()),{get(){return(...i)=>t?r.virtual(te(pe[e](...i))):ur(e)},enumerable:!1,configurable:!0}}function we(e,t,r,n){e=e.toLowerCase();let i=fr(e,t,r,n);return n?{[n]:i,[ee(n)]:i}:{[e]:i,[e.toUpperCase()]:i}}function dr(e){return cr(Object.entries(M.tagsRaw).reduce(mr(e),{}),gr(e))}function mr(e){return function(t,[r,n]){return n&&Object.defineProperties(t,we(r,n,e)),t}}function gr(e){let t=(n,i)=>Ee(n,i),r=lr(e);return{debugLog:$,log:(...n)=>D("fromStatic",...n),insertPositions:F,get at(){return F},editCssRules:(...n)=>n.forEach(i=>Ee(i)),editCssRule:t,get setStyle(){return t},delegate:sr(qe()),virtual:ar(e),get fn(){return tr},allowTag:r.allow,prohibitTag:r.prohibit,get lenient(){return M.allowUnknownHtmlTags},get IS(){return a},get Popup(){return e.activePopup||Object.defineProperty(e,"activePopup",{value:We(e),enumerable:!1}),e.activePopup},popup:()=>e.Popup,createStyle:n=>K({createWithId:n||`jqx${z()}`}),editStylesheet:n=>K({createWithId:n||`jqx${z()}`}),removeCssRule:Ue,removeCssRules:Ue,text:(n,i=!1)=>i?e.comment(n):document.createTextNode(n),node:(n,i=document)=>i.querySelector(n,i),nodes:(n,i=document)=>[...i.querySelectorAll(n,i)]}}var b=et(pr());function pr(){return function(r,n,i=F.BeforeEnd){if(r?.isJQx)return r;let s=a(n,HTMLBRElement);n=(!s&&n&&n.isJQx?n[0]:n)||document.body,i=i&&Object.values(F).find(g=>i===g)?i:void 0;let p=Ve(r),v=!p&&Ze(r),L=v||p,x={collection:Ye(r)??[],isVirtual:s,isJQx:!0},E=Ge(x.collection),T=`input =&gt; ${v?`"${j(r.join(", "),70)}"`:!L&&E?`element collection [${j(x.collection.map(g=>`${a(g,Comment,Text)?"Comment|Text @":""} ${g?.outerHTML||g?.textContent}`).join(", "),70)}]`:`"${j(r,70)}"`}`;if(x.collection.length&&E)return N(T),s||x.collection.forEach(g=>{n.contains(g)||U([g],n,i)}),G(x);if(L){if([r].flat().forEach(g=>x.collection.push(H(g))),x.collection.length>0){let g=x.collection.filter(m=>m?.dataset?.jqxcreationerror);x.collection=x.collection.filter(m=>!m?.dataset?.jqxcreationerror),N(`${T}`),N(`*Created ${x.isVirtual?"VIRTUAL ":""}[${j(Xe(x.collection)||"sanitized: no elements remaining",70)}]`),g.length&&console.error(`JQx: illegal html, not rendered: "${g.reduce((m,y)=>m.concat(`${y.textContent}
15
+ `),"").trim()}"`),x.isVirtual||U(x.collection,n,i)}return G(x)}let d=Ke(r,n,x);return N(`input => ${d}`),G(x)}}return lt(yr);})();
package/Bundle/jqx.min.js CHANGED
@@ -1,15 +1,15 @@
1
- var et="url('data:image/svg+xml\\3butf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20version%3D%221.1%22%20id%3D%22Layer_1%22%20x%3D%220px%22%20y%3D%220px%22%20viewBox%3D%220%200%20128%20128%22%20style%3D%22enable-background%3Anew%200%200%20128%20128%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Crect%20x%3D%22-368%22%20y%3D%226%22%20style%3D%22display%3Anone%3Bfill%3A%23E0E0E0%3B%22%20width%3D%22866%22%20height%3D%221018%22%2F%3E%3Ccircle%20style%3D%22fill%3A%23FFFFFF%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2248%22%2F%3E%3Ccircle%20style%3D%22fill%3A%238CCFB9%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2239%22%2F%3E%3Ccircle%20style%3D%22fill%3Anone%3Bstroke%3A%23444B54%3Bstroke-width%3A6%3Bstroke-miterlimit%3A10%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2248%22%2F%3E%3Cpolyline%20style%3D%22fill%3Anone%3Bstroke%3A%23FFFFFF%3Bstroke-width%3A6%3Bstroke-linecap%3Around%3Bstroke-miterlimit%3A10%3B%22%20points%3D%2242%2C69%2055.55%2C81%20%20%2086%2C46%20%22%2F%3E%3C%2Fsvg%3E')",le=ot(),we=nt(),k=tt(),Z=rt();function tt(){return{html:Object.freeze("accept,action,align,alt,autocapitalize,autocomplete,autopictureinpicture,autoplay,background,bgcolor,border,capture,cellpadding,cellspacing,checked,cite,class,clear,contenteditable,color,cols,colspan,controls,controlslist,coords,crossorigin,datetime,decoding,default,dir,disabled,disablepictureinpicture,disableremoteplayback,download,draggable,enctype,enterkeyhint,face,for,headers,height,hidden,high,href,hreflang,id,inputmode,integrity,is,ismap,kind,label,lang,list,loading,loop,low,max,maxlength,media,method,min,minlength,multiple,muted,name,nonce,noshade,novalidate,nowrap,open,optimum,pattern,placeholder,playsinline,poster,preload,pubdate,radiogroup,readonly,rel,required,rev,reversed,role,rows,rowspan,spellcheck,scope,selected,shape,size,sizes,span,srclang,start,src,srcset,step,style,summary,tabindex,target,title,translate,type,usemap,valign,value,width,xmlns,slot".split(",")),svg:Object.freeze("accent-height,accumulate,additive,alignment-baseline,ascent,attributename,attributetype,azimuth,basefrequency,baseline-shift,begin,bias,by,class,clip,clippathunits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,cx,cy,d,dx,dy,diffuseconstant,direction,display,divisor,dur,edgemode,elevation,end,fill,fill-opacity,fill-rule,filter,filterunits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,fx,fy,g1,g2,glyph-name,glyphref,gradientunits,gradienttransform,height,href,id,image-rendering,in,in2,k,k1,k2,k3,k4,kerning,keypoints,keysplines,keytimes,lang,lengthadjust,letter-spacing,kernelmatrix,kernelunitlength,lighting-color,local,marker-end,marker-mid,marker-start,markerheight,markerunits,markerwidth,maskcontentunits,maskunits,max,mask,media,method,mode,min,name,numoctaves,offset,operator,opacity,order,orient,orientation,origin,overflow,paint-order,path,pathlength,patterncontentunits,patterntransform,patternunits,points,preservealpha,preserveaspectratio,primitiveunits,r,rx,ry,radius,refx,refy,repeatcount,repeatdur,restart,result,rotate,scale,seed,shape-rendering,specularconstant,specularexponent,spreadmethod,startoffset,stddeviation,stitchtiles,stop-color,stop-opacity,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke,stroke-width,style,surfacescale,systemlanguage,tabindex,targetx,targety,transform,text-anchor,text-decoration,text-rendering,textlength,type,u1,u2,unicode,values,viewbox,visibility,version,vert-adv-y,vert-origin-x,vert-origin-y,width,word-spacing,wrap,writing-mode,xchannelselector,ychannelselector,x,x1,x2,xmlns,y,y1,y2,z,zoomandpan".split(","))}}function rt(){return{a:!0,area:!0,audio:!1,br:!0,base:!0,body:!0,button:!0,canvas:!0,comment:!0,dl:!0,data:!0,datalist:!0,div:!0,em:!0,embed:!1,fieldset:!0,font:!0,footer:!0,form:!1,hr:!0,head:!0,header:!0,output:!0,iframe:!1,frameset:!1,img:!0,input:!0,li:!0,label:!0,legend:!0,link:!0,map:!0,mark:!0,menu:!0,media:!0,meta:!0,nav:!0,meter:!0,ol:!0,object:!1,optgroup:!0,option:!0,p:!0,param:!0,picture:!0,pre:!0,progress:!1,quote:!0,script:!1,select:!0,source:!0,span:!0,style:!0,caption:!0,td:!0,col:!0,table:!0,tr:!0,template:!1,textarea:!0,time:!0,title:!0,track:!0,details:!0,ul:!0,video:!0,del:!0,ins:!0,slot:!0,blockquote:!0,svg:!0,dialog:!0,summary:!0,main:!0,address:!0,colgroup:!0,tbody:!0,tfoot:!0,thead:!0,th:!0,dd:!0,dt:!0,figcaption:!0,figure:!0,i:!0,b:!0,code:!0,h1:!0,h2:!0,h3:!0,h4:!0,abbr:!0,bdo:!0,dfn:!0,kbd:!0,q:!0,rb:!0,rp:!0,rt:!0,ruby:!0,s:!0,strike:!0,samp:!0,small:!0,strong:!0,sup:!0,sub:!0,u:!0,var:!0,wbr:!0,nobr:!0,tt:!0,noscript:!0}}function ot(){return["#logBox{min-width:0px;max-width:0px;min-height:0px;max-height:0px;width:0;height:0;z-index:-1;border:none;padding:0px;overflow:hidden;transition:all 0.3s ease;margin-top:-100px;}","#logBox.visible{background-color:rgb(255, 255, 224);z-index:1;position:static;border:1px dotted rgb(153, 153, 153);max-width:50vw;min-width:30vw;min-height:10vh;max-height:90vh;overflow:auto;width:50vw;height:20vh;margin:1rem 0px;padding:0px 8px 19px;resize:both;}","#logBox.visible .legend{position:absolute;}","#logBox .legend{text-align:center;margin-top:-1em;width:inherit;max-width:inherit;}","#logBox .legend div{text-align:center;display:inline-block;max-width:inherit;height:1.2rem;background-color:rgb(119, 119, 119);padding:2px 10px;color:rgb(255, 255, 255);box-shadow:rgb(119 119 119) 2px 1px 10px;border-radius:4px;}","#logBox .legend div:before{content:'JQx Logging (chronological)';}","#logBox .legend.reversed div:before{content:'JQx Logging (reversed)';}","#logBox #jqx_logger{marginTop:0.7rem;lineHeight:1.4em;font-family:consolas,monospace;whiteSpace:pre-wrap;maxWidth:inherit;padding-left:100px;}","#logBox #jqx_logger div.entry{text-indent:-100px;whiteSpace:normal;}"]}function nt(){return[".popupContainer{position:fixed;inset:-5000px;opacity:0;height:0;width:0;background:rgba(0,0,0,0.1);transition:opacity 0.6s ease-in-out 0s;}",".popupContainer.popup-active{opacity:1;inset:0;height:auto;width:auto;z-index:2147483646;}",".popupContainer .content{box-shadow:rgba(0,0,0,0.5) 2px 2px 8px;border-radius:3px;min-width:125px;max-width:40vw;max-height:40vh;padding:8px;overflow:auto;background:#FFF;z-index:inherit;opacity:1;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);}",".popupContainer .content .popup-warn{position:relative;padding:3px 8px 0 8px;color:red;margin:6px -8px -4px -8px;text-align:center;display:none;}",".popupContainer .content.popup-warn-active .popup-warn{display:block;border-top:1px dashed rgb(0,0,0);}",`.closeHandleIcon{z-index:1;position:absolute;opacity:0;cursor:pointer;width:24px;height:24px;background:${et} no-repeat;}`,".closeHandleIcon.popup-active{opacity:1;z-index:2147483647;}","@media screen and (width < 1200px){.popupContainer .content{max-width:75vw;}}","@media screen and (width < 640px){.popupContainer .content{max-width:90vw;max-height:60vw;}}"]}var ae=!1,it={on:()=>ae=!0,off:()=>ae=!1},j={tagsRaw:Z,allowUnknownHtmlTags:it,isAllowed(e){if(ae)return!0;let t=u(e,String)?e.toLowerCase():e?.nodeName.toLowerCase()||"none";return t==="#text"||!!Z[t]},allowTag:e=>Z[e.toLowerCase()]=!0,prohibitTag:e=>Z[e.toLowerCase()]=!1};var de=!1,X=!1,z=!0,fe=!1,st=!0,Ce,W=()=>b("#logBox"),$e="#jqx_logger",lt=e=>{le?.forEach(t=>e(t))},at=()=>{le&&lt(Ce);let e=st?"div":"pre",t=`<div id="logBox"><div class="legend"><div></div></div><${e} id="jqx_logger"></${e}></div>`;return me(O(t),void 0,F.AfterBegin),b.node($e)},Le=e=>u(e,String)&&Object.assign(document.createElement("textarea"),{innerHTML:e}).textContent||e,A=(...e)=>{let t=e[0]==="fromStatic";if(e=t?e.slice(1):e,t&&!X)return e.forEach(o=>console.info(`${_()} \u2714 ${Le(o)}`));if(!X)return;!z&&!b.node("#logBox")&&(Ce=b.createStyle("JQxLogCSS"),at());let r=o=>`${u(o,Object)?JSON.stringify(o,null,2):o}
2
- `;e.forEach(o=>z?console.info(`${_()} \u2714 ${Le(o)}`):b.node("#jqx_logger").insertAdjacentHTML(fe?"afterbegin":"beforeend",`<div class="entry">${_()} ${r(o.replace(/\n/g,"<br>"))}</div>`))},ce={on(){X=!0,A("Logging activated")},off(){X=!1,console.log("Logging deactivated")}},ue={on(){de=!0},off(){de=!1}},M=(...e)=>de&&A(...e),$={get isConsole(){return z===!0},get isOn(){return X},isVisible:function(){return b("#jqx_logger").is("visible")},on(){return ce.on(),ue.on(),z||W()?.addClass("visible"),A("Debug logging started. Every call to [jqx instance] is logged"),$},off(){return W().isEmpty||(ue.off(),A("Debug logging stopped"),W()?.removeClass("visible")),ce.off(),$},toConsole:{on(){return z=!0,A("Started logging to console"),$},off(){return A("Stopped logging to console (except error messages)"),z=!1,$}},remove(){return ce.off(),ue.off(),W()?.remove(),console.clear(),console.log(`${_()} logging completely disabled and all entries removed`),$},log:function(...e){return A(...e),$},hide(){return W()?.removeClass("visible"),$},show:()=>(W()?.addClass("visible"),$),get reversed(){return{on:()=>(fe=!0,A("Reverse logging set: now logging bottom to top (latest first)"),b("#logBox .legend").addClass("reversed"),$),off:()=>(fe=!1,b("#logBox .legend").removeClass("reversed"),A("Reverse logging reset: now logging chronological (latest last)"),$)}},clear(){return b($e).text(""),console.clear(),A("Logging cleared"),$}};var ct=ut(),Te={html:"innerHTML",text:"textContent",class:"className"},ge=ct;function ut(){let e={get(t,r){let o=String(r)?.toLowerCase();switch(!0){case o in t:return t[o];case xt(o):return Fe(t,o,r);default:return Fe(t,o,r,!0)}},enumerable:!1,configurable:!1};return new Proxy({},e)}function Fe(e,t,r,o=!1){return Object.defineProperty(e,t,{get(){return o?i=>bt(r):St(t)}}),e[t]}function dt(e,t,r){return t=t?.isJQx&&t.first()||t,ye({trial:o=>ht(t)?e.append(t):Ae(t)?e.insertAdjacentHTML("beforeend",t):e.append(t),whenError:o=>console.info(`${r} (for root ${e}) not created, reason
3
- `,o)})}function ft(e,t,...r){let o=mt(t,e);return r?.forEach(i=>dt(o,i,e)),o}function mt(e,t){switch(e=pe(t)?yt(e):e?.isJQx?e.first():e,!0){case u(e,String):return Y(t,Ae(e,t)?{html:e}:{text:e});case u(e,Node):return pt(t,e);default:return Y(t,e)}}function gt(e){return delete e.data,Object.keys(e).length<1||Object.keys(e).forEach(t=>{let r=t.toLowerCase();r in Te&&(e[Te[r]]=e[t],delete e[t])}),e}function pt(e,t){let r=Y(e);return r.append(t),r}function Y(e,t={}){t=He(t,{});let r=Object.entries(t.data??{}),o=Object.assign(pe(e)?new Comment(t?.text):document.createElement(e),gt(t));return r.length&&r.forEach(([i,l])=>o.dataset[i]=String(l)),o}function He(e,t){return t?u(e,{isTypes:Object,notTypes:[Array,null,NaN,Proxy],defaultValue:t}):u(e,{isTypes:Object,notTypes:[Array,null,NaN,Proxy]})}function yt(e){return He(e)?e?.text??e?.textContent??"":String(e)}function bt(e){return Y("b",{style:"color:red",text:`'${e}' is not a valid HTML-tag`})}function Ae(e,t){return!pe(t)&&u(e,String)&&/<.*>|&[#|0-9a-z]+[^;];/i.test(e)}function ht(e){return e?.constructor===Comment||e?.constructor===CharacterData}function pe(e){return e?.constructor===Comment||/comment/i.test(e)}function xt(e){return!u(Y(e),HTMLUnknownElement)}function St(e){return(t,...r)=>ft(e,t,...r)}var{IS:u,maybe:ye,$Wrap:Er,xProxy:wr,isNothing:Lr}=vt();function vt(){Symbol.proxy=Symbol.for("toa.proxy"),Symbol.is=Symbol.for("toa.is"),Symbol.type=Symbol.for("toa.type"),Symbol.isSymbol=Symbol.for("toa.isASymbol"),y();let e=T(),[t,r]=[p(),v()];return r.custom(),{IS:o,maybe:e,$Wrap:t,isNothing:L,xProxy:r};function o(n,...s){if(e({trial:d=>"isTypes"in(s?.[0]??{})})){let d=s[0];return"defaultValue"in d?x(n,d):"notTypes"in d?f(n,d):o(n,...[d.isTypes].flat())}let c=typeof n=="symbol"?Symbol.isSymbol:n;return s.length>1?h(c,...s):l(n,...s)}function i(n){return n?.[Symbol.proxy]??o(n)}function l(n,...s){let{noInput:c,noShouldbe:d,compareTo:E,inputCTOR:H,isNaN:P,isInfinity:R,shouldBeFirstElementIsNothing:J}=S(n,...s);switch(s=s.length&&s[0],!0){case J:return String(n)===String(E);case(n?.[Symbol.proxy]&&d):return n[Symbol.proxy];case P:return d?"NaN":e({trial:B=>String(E)})===String(n);case R:return d?"Infinity":e({trial:B=>String(E)})===String(n);case c:return d?String(n):String(E)===String(n);case H===Boolean:return s?H===s:"Boolean";default:return w(n,s,d,g(n,H))}}function g(n,s){return n===0?Number:n===""?String:n?s:{name:String(n)}}function S(n,...s){let c=s.length<1,d=!c&&s[0],E=!c&&L(s[0]),H=n==null,P=!H&&Object.getPrototypeOf(n)?.constructor,R=e({trial:B=>String(n)})==="NaN",J=e({trial:B=>String(n)})==="Infinity";return{noInput:H,noShouldbe:c,compareTo:d,inputCTOR:P,isNaN:R,isInfinity:J,shouldBeFirstElementIsNothing:E}}function w(n,s,c,d){switch(!0){case(!c&&s===n||n?.[Symbol.proxy]&&s===Proxy):return!0;case e({trial:E=>String(s)})==="NaN":return String(n)==="NaN";case(n?.[Symbol.toStringTag]&&o(s,String)):return String(s)===n[Symbol.toStringTag];default:return s?e({trial:E=>n instanceof s})||s===d||s===Object.getPrototypeOf(d)||`${s?.name}`===d?.name:n?.[Symbol.toStringTag]&&`[object ${n?.[Symbol.toStringTag]}]`||d?.name||String(d)}}function h(n,...s){return s.some(c=>o(n,c))}function L(n,s=!1){let c=n==null;return c=s?c||o(n,1/0)||o(n,NaN):c,c}function T(){let n=(s,c)=>s?.constructor===Function?s(c):void 0;return function({trial:s,whenError:c=()=>{}}={}){try{return n(s)}catch(d){return n(c,d)}}}function p(){return function(n){return Object.freeze({get value(){return n},get[Symbol.type](){return i(n)},get type(){return i(n)},[Symbol.is](...s){return o(n,...s)},is(...s){return o(n,...s)}})}}function x(n,{defaultValue:s,isTypes:c=[void 0],notTypes:d}={}){return c=c?.constructor!==Array?[c]:c,d=d&&d?.constructor!==Array?[d]:[],d.length<1?o(n,...c)?n:s:f(n,{isTypes:c,notTypes:d})?n:s}function f(n,{isTypes:s=[void 0],notTypes:c=[void 0]}={}){return s=s?.constructor!==Array?[s]:s,c=c?.constructor!==Array?[c]:c,o(n,...s)&&!o(n,...c)}function y(){Object.getOwnPropertyDescriptors(Object.prototype)[Symbol.is]||(Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return i(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...n){return o(this,...n)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(n){return i(n)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(n,...s){return o(n,...s)},enumerable:!1,configurable:!1}}))}function a(n){let s=String(Object.getPrototypeOf(n)?.constructor);return s.slice(s.indexOf("ion")+3,s.indexOf("(")).trim()}function m(n){let s=n.set;return n.set=(c,d,E)=>d===Symbol.proxy?c[d]=E:s(c,d,E),n}function v(){let n=Proxy;return{native(){Proxy=n},custom(){Proxy=new n(n,{construct(s,c){for(let E of c)E.set&&(E=m(E));let d=new s(...c);return d[Symbol.proxy]=`Proxy (${a(c[0])})`,d}})}}}}var{IS:oe,maybe:$r,$Wrap:Tr,xProxy:Fr,isNothing:Hr}=Et();function Et(){Symbol.proxy=Symbol.for("toa.proxy"),Symbol.is=Symbol.for("toa.is"),Symbol.type=Symbol.for("toa.type"),Symbol.isSymbol=Symbol.for("toa.isASymbol"),y();let e=T(),[t,r]=[p(),v()];return r.custom(),{IS:o,maybe:e,$Wrap:t,isNothing:L,xProxy:r};function o(n,...s){if(e({trial:d=>"isTypes"in(s?.[0]??{})})){let d=s[0];return"defaultValue"in d?x(n,d):"notTypes"in d?f(n,d):o(n,...[d.isTypes].flat())}let c=typeof n=="symbol"?Symbol.isSymbol:n;return s.length>1?h(c,...s):l(n,...s)}function i(n){return n?.[Symbol.proxy]??o(n)}function l(n,...s){let{noInput:c,noShouldbe:d,compareTo:E,inputCTOR:H,isNaN:P,isInfinity:R,shouldBeFirstElementIsNothing:J}=S(n,...s);switch(s=s.length&&s[0],!0){case J:return String(n)===String(E);case(n?.[Symbol.proxy]&&d):return n[Symbol.proxy];case P:return d?"NaN":e({trial:B=>String(E)})===String(n);case R:return d?"Infinity":e({trial:B=>String(E)})===String(n);case c:return d?String(n):String(E)===String(n);case H===Boolean:return s?H===s:"Boolean";default:return w(n,s,d,g(n,H))}}function g(n,s){return n===0?Number:n===""?String:n?s:{name:String(n)}}function S(n,...s){let c=s.length<1,d=!c&&s[0],E=!c&&L(s[0]),H=n==null,P=!H&&Object.getPrototypeOf(n)?.constructor,R=e({trial:B=>String(n)})==="NaN",J=e({trial:B=>String(n)})==="Infinity";return{noInput:H,noShouldbe:c,compareTo:d,inputCTOR:P,isNaN:R,isInfinity:J,shouldBeFirstElementIsNothing:E}}function w(n,s,c,d){switch(!0){case(!c&&s===n||n?.[Symbol.proxy]&&s===Proxy):return!0;case e({trial:E=>String(s)})==="NaN":return String(n)==="NaN";case(n?.[Symbol.toStringTag]&&o(s,String)):return String(s)===n[Symbol.toStringTag];default:return s?e({trial:E=>n instanceof s})||s===d||s===Object.getPrototypeOf(d)||`${s?.name}`===d?.name:n?.[Symbol.toStringTag]&&`[object ${n?.[Symbol.toStringTag]}]`||d?.name||String(d)}}function h(n,...s){return s.some(c=>o(n,c))}function L(n,s=!1){let c=n==null;return c=s?c||o(n,1/0)||o(n,NaN):c,c}function T(){let n=(s,c)=>s?.constructor===Function?s(c):void 0;return function({trial:s,whenError:c=()=>{}}={}){try{return n(s)}catch(d){return n(c,d)}}}function p(){return function(n){return Object.freeze({get value(){return n},get[Symbol.type](){return i(n)},get type(){return i(n)},[Symbol.is](...s){return o(n,...s)},is(...s){return o(n,...s)}})}}function x(n,{defaultValue:s,isTypes:c=[void 0],notTypes:d}={}){return c=c?.constructor!==Array?[c]:c,d=d&&d?.constructor!==Array?[d]:[],d.length<1?o(n,...c)?n:s:f(n,{isTypes:c,notTypes:d})?n:s}function f(n,{isTypes:s=[void 0],notTypes:c=[void 0]}={}){return s=s?.constructor!==Array?[s]:s,c=c?.constructor!==Array?[c]:c,o(n,...s)&&!o(n,...c)}function y(){Object.getOwnPropertyDescriptors(Object.prototype)[Symbol.is]||(Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return i(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...n){return o(this,...n)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(n){return i(n)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(n,...s){return o(n,...s)},enumerable:!1,configurable:!1}}))}function a(n){let s=String(Object.getPrototypeOf(n)?.constructor);return s.slice(s.indexOf("ion")+3,s.indexOf("(")).trim()}function m(n){let s=n.set;return n.set=(c,d,E)=>d===Symbol.proxy?c[d]=E:s(c,d,E),n}function v(){let n=Proxy;return{native(){Proxy=n},custom(){Proxy=new n(n,{construct(s,c){for(let E of c)E.set&&(E=m(E));let d=new s(...c);return d[Symbol.proxy]=`Proxy (${a(c[0])})`,d}})}}}}var K=wt;function wt({styleSheet:e,createWithId:t}={}){let{tryParseAtOrNestedRules:r,ruleExists:o,checkParams:i,sheet:l,removeRules:g,consider:S,currentSheetID:w}=Lt({styleSheet:e,createWithId:t});function h(f,y){if(f&&y.removeProperties){Object.keys(y.removeProperties).forEach(a=>f.style.removeProperty(Oe(a)));return}Object.entries(y).forEach(([a,m])=>{a=Oe(a.trim()),m=m.trim();let v;if(/!important/.test(m)&&(m=m.slice(0,m.indexOf("!important")).trim(),v="important"),!CSS.supports(a,m))return console.error(`StylingFactory ${w} error: '${a}' with value '${m}' not supported (yet)`);Ie(()=>f.style.setProperty(a,m,v),`StylingFactory ${w} (setRule4Selector) failed`)})}function L(f,y,a=l){if(f=f?.trim?.(),!oe(f,String)||!f.length||/[;,]$/g.test(f))return console.error(`StylingFactory ${w} (setRules): [${f||"[no selector given]"}] is not a valid selector`);if(y.removeRule)return g(f);let m=o(f,!0),v=m||a.cssRules[a.insertRule(`${f} {}`,a.cssRules.length||0)];return S(()=>h(v,y),f,m)}function T(f){let y=f.trim().split(/{/,2),a=y.shift().trim();if(!oe(a,String)||!a?.trim()?.length)return console.error(`StylingFactory ${w} (doParse): no (valid) selector could be extracted from rule ${be(f)}`);let m=Ot(y.shift());return Ie(()=>L(a,m),`StylingFactory ${w} (setRules) failed`)}function p(f){let y=r(f);return y.done?y.existing:T(f)}function x(f,y){return f.trim().startsWith("@media")?p(Ct(f,y)):L(f,y)}return function(f,y={}){return i(f,y)&&(Object.keys(y).length?x(f,y):p(f))}}function Lt({styleSheet:e,createWithId:t}){let r="Note: The rule or some of its properties may not be supported by your browser (yet)",o=`for style#${t}`;e=t?i(t):e;function i(p){let x=document.querySelector(`#${p}`)?.sheet;if(x)return x;let f=Object.assign(document.createElement("style"),{id:p});return document.head.insertAdjacentElement("beforeend",f),f.sheet}function l(p){return console.error(`StylingFactory ${o} [rule: ${p}]
4
- => @charset, @namespace and @import are not supported here`),{done:!0}}function g(p,x){return[...e.rules].find(f=>x?Ne(f.selectorText||"",p):Ft`${Tt(p)}${[..."gim"]}`.test(f.cssText))}function S(p){return/^@charset|@import|namespace/i.test(p.trim())?l(p):p.match(/}/g)?.length>1?{existing:L(p,1),done:!0}:{done:!1}}function w(p){let x=[...e.cssRules].reduce((y,a,m)=>Ne(a.selectorText||"",p)&&y.concat(m)||y,[]),f=x.length;return x.forEach(y=>e.deleteRule(y)),f>0?console.info(`\u2714 Removed ${f} instance${f>1?"s":""} of selector ${p} from ${o.slice(4)}`):console.info(`\u2714 Remove rule: selector ${p} does not exist in ${o.slice(4)}`)}function h(p,x){return p&&oe(p,String)&&p.trim().length>0&&oe(x,Object)||(console.error(`StylingFactory ${o} called with invalid parameters`),!1)}function L(p){p=p.trim();let x=p.slice(0,p.indexOf("{")).trim(),f=!!g(x);try{return e.insertRule(`${p}`,e.cssRules.length),f}catch(y){return console.error(`StylingFactory ${o} (tryParse) ${y.name} Error:
5
- ${y.message}
6
- Rule: ${be(p)}
7
- ${r}`),f}}function T(p,x,f){try{return p(),f}catch(y){return console.error(`StylingFactory ${o} (tryAddOrModify) ${y.name} Error:
8
- ${y.message}
9
- Rule: ${be(x)}
10
- ${r}`),f}}return{sheet:e,removeRules:w,tryParseAtOrNestedRules:S,ruleExists:g,checkParams:h,tryParse:L,consider:T,currentSheetID:o}}function Ct(e,t){return`${e.trim()} ${Object.entries(t).map(([r,o])=>`${r}: { ${$t(o)}`)}`}function be(e){let t=(e||"NO RULE").trim().slice(0,50).replace(/\n/g,"\\n").replace(/\s{2,}/g," ");return e.length>t.length?`${t.trim()}...truncated`:t}function $t(e){return Object.entries(e).map(([t,r])=>`${t}: ${r.trim()}`).join(`;
11
- `)}function Tt(e){return e.replace(/([*\[\]()-+{}.$?\\])/g,t=>`\\${t}`)}function Ft(e,...t){let r=t.length&&Array.isArray(t.slice(-1))?t.pop().join(""):"";return new RegExp((t.length&&e.raw.reduce((o,i,l)=>o.concat(t[l-1]||"").concat(i),"")||e.raw.join("")).split(`
12
- `).map(o=>o.replace(/\s|\/\/.*$/g,"").trim().replace(/(@s!)/g," ")).join(""),r)}function Oe(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`).replace(/[^--]^-|-$/,"")}function Ie(e,t){try{return e()}catch(r){console.error(`${t||"an error occured"}: ${r.message}`)}}function Ht(e){return e.replace(/\/\*.+?\*\//gm,"").replace(/[}{\r\n]/g,"").replace(/(data:.+?);/g,(t,r)=>`${r}\\3b`).split(";").map(t=>t.trim()).join(`;
13
- `).replaceAll("\\3b",";").split(`
14
- `)}function At(e){return e.reduce((t,r)=>{let[o,i]=[r.slice(0,r.indexOf(":")).trim(),r.slice(r.indexOf(":")+1).trim().replace(/;$|;.+(?=\/*).+\/$/,"")];return o&&i?{...t,[o]:i}:t},{})}function Ot(e){return At(Ht(e))}function Ne(e,t){return e?.replace("::",":")===t?.replace("::",":")}var It=[...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}`)),ne=(e,t=2)=>`${e}`.padStart(t,"0"),Nt=(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)),jt=e=>{let t=e.length;for(;t--;){let r=Nt(t);[e[t],e[r]]=[e[r],e[t]]}return e};var I=(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(),N=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`).replace(/^-|-$/,""),Mt=([e,...t])=>`${e.toUpperCase()}${t.join("")}`,ee=e=>u(e,String)?e.toLowerCase().split("-").map((t,r)=>r&&`${Mt(t)}`||t).join(""):e,D=()=>`_${jt(It).slice(0,8).join("")}`,ie=(e,t=120)=>I(e,t).replace(/&lt;/g,"<"),_=()=>(e=>`[${ne(e.getHours())}:${ne(e.getMinutes())}:${ne(e.getSeconds())}.${ne(e.getMilliseconds(),3)}]`)(new Date);var q=e=>e.replace(/</g,"&lt;");function je(){let e=function(l){if(!l)return;let g=l.style,S=getComputedStyle(l),w=[g.visibility,S.visibility].includes("hidden"),h=[g.display,S.display].includes("none"),L=l.offsetTop<0||l.offsetLeft+l.offsetWidth<0||l.offsetLeft>document.body.offsetWidth,T=+S.opacity==0||+(g.opacity||1)==0;return!(L||T||h||w)},t="n/a",r=function(l){return l.parentNode?!!b.nodes(":is(:read-write)",l?.parentNode)?.find(g=>g===l):!1},o=function(l){return l.parentNode?!!b.nodes(":is(:modal)",l?.parentNode)?.find(g=>g===l):!1},i={notInDOM:!0,writable:t,modal:t,empty:!0,open:t,visible:t};return l=>{let g=l.node;return g?{get writable(){return r(g)},get modal(){return o(g)},get inDOM(){return g.isConnected},get open(){return g.open??!1},get visible(){return e(g)},get disabled(){return g.hasAttribute("readonly")||g.hasAttribute("disabled")},get empty(){return l.collection.length<1},get virtual(){return l.isVirtual}}:i}}var Dt=!0,se={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},Pt=e=>{if(Dt&&Object.keys(e.removed).length){let t=Object.entries(e.removed).reduce((r,[o,i])=>[...r,`${q(o)} => ${i}`],[]).join("\\000A");$.log(`JQx HTML creation errors: ${$.isConsole?t:q(t)}`)}},Rt=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)},te=e=>{let t={rawHTML:e?.parentElement?.getHTML()??"no html",removed:{}};return u(e,HTMLElement)&&[...e.childNodes].forEach(r=>{if(r?.children?.length&&te(r),r?.attributes){let i=u(r,SVGElement)?k.svg:k.html;[...(r??{attributes:[]}).attributes].forEach(l=>{let g=l.name.trim().toLowerCase(),S=l.value.trim().toLowerCase().replace(se.whiteSpace,""),w=g==="href"?!se.validURL.test(S):se.notAllowedValues.test(S),h=g.startsWith("data")?!se.data.test(g):!!i[g];if(w||h){let L=ie(l.value||"none",60);L+=L.length===60?"...":"",t.removed[`${l.name}`]=`attribute/property (-value) not allowed, removed. Value: ${L}`,r.removeAttribute(l.name)}})}if(!(Rt(r)||r.constructor===CharacterData||r.constructor===Comment)){let i=(r?.outerHTML||r?.textContent).trim(),l=ie(i,60)??"EMPTY";l+=l.length===60?"...":"",t.removed[`<${r.nodeName?.toLowerCase()}>`]=`not allowed, not rendered. Value: ${l}`,r.remove()}}),Pt(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]}}),Jt=e=>{let t=document.createElement("div");return t.insertAdjacentHTML(F.end,e),t.childNodes.length?te(t):void 0},Bt=(e,t,r)=>u(e,Comment)?t.insertAdjacentHTML(r,`<!--${e.data}-->`):t.insertAdjacentText(r,e.data),U=(e=[],t=document.body,r=F.BeforeEnd)=>e.reduce((o,i)=>{let l=re(i)&&me(i,t,r);return l?[...o,l]:o},[]),me=(e,t=document.body,r=F.BeforeEnd)=>(t=t?.isJQx?t?.[0]:t,u(e,Comment,Text)?Bt(e,t,r):t.insertAdjacentElement(r,e)),O=e=>{if(u(e,Text,Comment))return e;let t=e?.trim(),r=t?.split(/<text>|<\/text>/i)??[];if(r?.length&&(r=r.length>1?r.filter(i=>i.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=Jt(e);return o.childNodes.length<1?O(`<span data-jqxcreationerror="1">${I(e,60)}</span>`):o.children[0]};var C=(e,t)=>{let r=e.collection.filter(o=>!Be(o));for(let o=0;o<r.length;o+=1)t(r[o],o);return e},Qt=je(),Me=e=>e&&(e.textContent="");var G=e=>{let t=e.cloneNode(!0);return t.removeAttribute&&t.removeAttribute("id"),e.isConnected?e.remove():e=null,t},Re=(e,t)=>{e&&u(t,Object)&&Object.entries(t).forEach(([r,o])=>e.setAttribute(`data-${N(r)}`,o))},De=(e,t)=>e.andThen(t,!0),Pe=(e,t)=>e.andThen(t),Je=e=>e.startsWith("data")||k.html.find(t=>e.toLowerCase()===t),kt=(e,t,r)=>{r&&u(t,String)&&(t={[t]:r==="-"?"":r});let o;t.className&&(o=t.className,delete t.className),o=[...e.classList].find(l=>l.startsWith("JQxClass-")||o&&l===o)||o||`JQxClass-${D().slice(1)}`,b.editCssRule(`.${o}`,t),e.classList.add(o)},Wt=(e,t)=>{e&&Object.entries(t).forEach(([r,o])=>{if(r=N(r),r.startsWith("data"))return Re(e,o);u(o,String)&&Je(r)&&e.setAttribute(r,o.split(/[, ]/)?.join(" "))})},he=(e,t)=>{u(t,Object)&&Object.entries(t).forEach(([r,o])=>{let i;/!important/i.test(o)&&(o=o.slice(0,o.indexOf("!")).trim(),i="important"),e.style.setProperty(N(r),o,i)})},zt={get(e,t){return e[ee(t)]||e[t]},enumerable:!1,configurable:!1},_t=(...e)=>{$.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??{},zt)},set:(t={})=>(!e.is.empty&&u(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&&u(t,Object)&&Object.entries(t).forEach(([r,o])=>e.setData({[r]:o})),e),remove:t=>(e[0]?.removeAttribute(`data-${N(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?q(o):o},set:(t,r=!1,o=!1)=>{t=t.isJQx?t.HTML.get(1):t;let i=u(t,String);return t=i&&o?q(t):t,i&&(t||"").trim().length&&e.html(t,r),e},replace:(t,r=!1)=>e.HTML.set(t,!1,r),append:(t,r=!1)=>(t=u(t,HTMLElement)?b(t).HTML.get(1):t.isJQx?t.HTML.get(1):t,e.HTML.set(t,!0,r)),insert:(t,r=!1)=>(t=u(t,HTMLElement)?b(t).HTML.get(1):t.isJQx?t.HTML.get(1):t,e.HTML.set(t+e.HTML.get(),!1,r))}),is:e=>Qt(e),length:e=>e.collection.length,outerHtml:e=>(e.first()||{outerHTML:void 0}).outerHTML,parent:e=>{let t=b(e[0]?.parentNode);return t.is.empty?e:t},render:e=>(!e.is.empty&&e.toDOM()||b.log("[JQx.render]: empty collection"),e),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])[N(t)],nwRule:t=>e.Style.byRule({rules:t}),byRule:({classes2Apply:t=[],rules:r=[]}={})=>{let i=u(r,String)&&!t.length?r.split("{")[0].trim():"";return r=r&&u(r,String)?[r]:r,t=t&&u(t,String)?[t]:t,(r?.length||t?.length)&&(r?.length&&b.editCssRules(...r),t?.forEach(l=>e.addClass(l))),i?.startsWith(".")&&e.addClass(i.slice(1)),i?.startsWith("#")&&!e.attr("id")&&e.prop({id:i.slice(1)}),e}})},instanceExtensions:{addClass:(e,...t)=>C(e,r=>r&&t.forEach(o=>r.classList.add(o))),after:Pe,afterMe:Pe,andThen:(e,t,r=!1)=>{if(!t||!u(t,String,Node,Proxy))return _t(`[JQx instance].[beforeMe | afterMe | andThen]: insufficient input [${t}]`),e;t=t?.isJQx?t.collection:u(t,Node)?b.virtual(t).collection:b.virtual(O(t)).collection;let[o,i,l]=r?[0,"before",t.concat(e.collection)]:[e.collection.length-1,"after",e.collection.concat(t)];return e[o][i](...t),e.collection=l,e},append:(e,...t)=>{if(!e.is.empty&&t.length){let r=e.length===1;for(let o of t){if(!o.isJQx&&u(o,String)){let i=o.trim(),g=!/^<(.+)[^>]+>$/m.test(i)?b.text(o):O(o);C(e,S=>S.append(r?g:G(g)))}re(o)&&C(e,i=>i.append(r?o:G(o))),o.isJQx&&!o.is.empty&&C(e,i=>o.collection.forEach(l=>i.append(r?l:G(l))))}}return e},appendTo:(e,t)=>(t.isJQx||(t=b(t)),t.append(e),e),attr:(e,t,r)=>{let o=e[0];if(!o)return e;if(!r&&u(t,String))return t=N(t),t==="class"?[...o?.classList].join(" "):o?.getAttribute(t);if(u(t,String)&&r)switch(t=N(t),!0){case t.startsWith("data-"):t={data:{[t.replace("data-","")]:r}};break;default:t={[t]:r}}return u(t,Object)&&!e.is.empty&&Wt(o,t),e},before:De,beforeMe:De,clear:e=>C(e,Me),closest:(e,t)=>{let r=u(t,String)?e[0].closest(t):null;return r?b(r):e},computedStyle:(e,t)=>e.first()&&getComputedStyle(e.first())[t],css:(e,t,r)=>C(e,o=>kt(o,t,r)),duplicate:(e,t=!1,r=document.body)=>{let o=e.toNodeList().map(l=>l.removeAttribute&&l.removeAttribute("id")||l),i=b.virtual(o);return t?i.toDOM(r):i},each:(e,t)=>C(e,t),empty:e=>C(e,Me),find:(e,t)=>e.collection.length>0?[...e.first()?.querySelectorAll(t)]:[],find$:(e,t)=>e.collection.length>0?b(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=>C(e,t=>he(t,{display:"none !important"})),html:(e,t,r)=>{if(t===void 0)return e[0]?.getHTML();if(!e.isEmpty()){let o=O(`<div>${t.isJQx?t.HTML.get(!0):t}</div>`);if(!u(o,Comment))return C(e,l=>(r||(l.textContent=""),l.insertAdjacentHTML(b.at.end,o.getHTML())))}return e},htmlFor:(e,t,r="",o=!1)=>{if(t&&e.collection.length){if(!t||!u(r,String))return e;let i=e.find$(t);if(i.length<1)return e;let l=O(`<span>${r}</span>`);i.each(g=>{o||(g.textContent=""),g.insertAdjacentHTML(b.at.end,l.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 i=Qe(e);b.delegate(t,i,o)}),e),prepend:(e,...t)=>{if(!e.is.empty&&t){let r=e.length===1;for(let o of t){if(u(o,String)){o=o.trim();let l=!/^<(.+)[^>]+>$/m.test(o)?b.text(o):O(o);l=r?l:G(l),C(e,g=>g.prepend(l.cloneNode(!0)))}re(o)&&C(e,i=>i.prepend(r?o:G(o))),o.isJQx&&!o.is.empty&&(o.collection.length>1&&o.collection.reverse(),C(e,i=>C(o,l=>i.prepend(r?l:G(l)))),o.collection.reverse())}}return e},prependTo:(e,t)=>(t.isJQx||(t=b.virtual(t)),t.prepend(e),e),prop:(e,t,r)=>{if(u(t,String)&&!r)return t.startsWith("data")?e[0]?.dataset[t.slice(t.indexOf("-")+1)]:e[0]?.[t];let o=u(t,Object)?t:{[t]:r};return Object.entries(o).forEach(([i,l])=>{if(i=i.trim(),l&&!Je(i)||!l)return!1;if(i.toLowerCase()==="id")return e[0].id=l;C(e,S=>{if(i.startsWith("data"))return S.dataset[i.slice(i.indexOf("-")+1)]=l;S[i]=l})}),e},remove:(e,t)=>{M(`remove ${I(e.HTML.get(1),40)}${t?` /w selector ${t}`:""}`);let r=i=>i.remove(),o=()=>e.collection=e.collection.filter(i=>document.documentElement.contains(i));if(t){let i=e.find$(t);return i.is.empty||(C(i,r),o()),e}return C(e,r),o(),e},rmAttr:(e,...t)=>(t.forEach(r=>e.node.removeAttribute(r)),e),removeClass:(e,...t)=>C(e,r=>r&&t.forEach(o=>r.classList.remove(o))),renderTo:(e,t=document.body,r=b.insertPositions.end)=>(e.toDOM(t,r),e),replace:(e,t,r)=>{let o=e[0];return!t||!r||!u(r,HTMLElement)&&!r.isJQx?(console.error("JQx replace: invalid replacement value"),e):(r.isJQx&&(r=r[0]),u(r,NodeList)&&(r=r[0]),o&&t&&(t=u(t,String)?o.querySelectorAll(t):t.isJQx?t.collection:t,u(t,HTMLElement,NodeList,Array)&&u(r,HTMLElement)&&(u(t,HTMLElement)?[t]:[...t]).forEach(i=>i.replaceWith(r.cloneNode(!0)))),e)},replaceClass:(e,t,...r)=>C(e,o=>{o.classList.remove(t),r.forEach(i=>o.classList.add(i))}),replaceMe:(e,t)=>e.replaceWith(t),replaceWith:(e,t)=>(t=u(t,Element)?t:t.isJQx?t[0]:void 0,t&&(e[0].replaceWith(t),e=b.virtual(t)),e),setData:(e,t)=>C(e,r=>Re(r,t)),show:e=>C(e,t=>he(t,{display:"revert-layer !important"})),single:(e,t)=>e.collection.length>0?u(t,String)?e.find$(t):u(t,Number)?b(e.collection[t]):b(e.collection[0]):e,style:(e,t,r)=>C(e,i=>{r&&u(t,String)&&(t={[t]:r||"none"}),he(i,t)}),text:(e,t,r=!1)=>e.isEmpty()?e:u(t,String)?C(e,i=>i.textContent=r?i.textContent+t:t):e.first().textContent,toDOM:(e,t=document.body,r=F.BeforeEnd)=>(e.isVirtual&&(e.isVirtual=!1),e.collection=U(e.collection,t,r),e),toggleClass:(e,t)=>C(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 i=new r(t,{...o,bubbles:o.bubbles??!0});for(let l of e.collection)l.dispatchEvent(i)}return e},val:(e,t)=>{let r=e[0];return!r||!u(r,HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement)?e:t===void 0?r.value:(r.value=u(t,String)?t:"",e)}}};var ke=qt;function qt(e){let t=e.createStyle("JQxPopupCSS");we.forEach(a=>t(a));let r={},o,i,l,g=e.virtual('<div class="popup-warn">'),S=e('<div class="popupContainer">').append(e('<span class="closeHandleIcon">')).append(e('<div class="content">')),[w,h]=[e(".popupContainer > .closeHandleIcon"),e(".popupContainer > .content")],L=()=>{if(w.hasClass("popup-active")){let{x:a,y:m,width:v}=h.dimensions;w.style({top:`${m-12}px`,left:`${a+v-12}px`})}},T=()=>{i&&e(".popup-warn").clear().append(e(`<div>${i}</div>`)),h.addClass("popup-warn-active")},p=()=>{o=!1,y(w.first())},x=(a,m)=>l=setTimeout(()=>y(w[0]),+a*1e3);return e.delegate("click",".popupContainer, .closeHandleIcon",a=>y(a.target)),e.delegate("click",".popupContainer .content",(a,m)=>o&&m.removeClass("popup-warn-active")),e.delegate("resize",L),{show:f,create:(a,m,v,n)=>{let s=e.IS(m,Boolean)?m:!1;f({content:a,modal:s,callback:s?v:m,warnMessage:n})},createTimed:(a,m,v)=>f({content:a,closeAfter:m,callback:v}),removeModal:p};function f({content:a,modal:m,closeAfter:v,callback:n,warnMessage:s}){if(a){if(a=e.IS(a,Node)?jqx(a):a,clearTimeout(l),o=m??!1,i=e.IS(s,String)&&`${s?.trim()}`.length||s?.isJQx?s:void 0,h.clear().append(a.isJQx?a:e(`<div>${a}</div>`)),o&&s&&h.append(g.duplicate()),S.addClass("popup-active"),e.IS(n,Function)){let c=D();S.data.set({callbackId:c}),r[c]=n}if(!o){if(e.IS(+v,Number)){let c=S.data.get("callbackId"),d=c&&r[c];x(v,d)}w.addClass("popup-active"),L()}return!0}return console.error("Popup creation needs at least some text to show")}function y(a){if(!o&&!a.closest(".content")){clearTimeout(l),h.clear();let m=S.data.get("callbackId");S.data.remove("callbackId"),e(".popup-active").removeClass("popup-active");let v=m&&r[m];e.IS(v,Function)&&v(),m&&delete r[m],i="";return}return o&&T()}}var Q={},Ut=["load","unload","scroll","focus","blur","DOMNodeRemovedFromDocument","DOMNodeInsertedIntoDocument","loadstart","progress","error","abort","load","loadend","pointerenter","pointerleave","readystatechange"],Gt=e=>!!Ut.find(t=>t===e),We=()=>{let e=o=>Q[o.type].forEach(i=>i(o)),t=(o,i)=>l=>{let g=l.target?.closest?.(o);return g&&i(l,b(g))},r=(o,i)=>{Q[o]||addEventListener(o,e,Gt(o))};return(o,i,l,g=!1)=>{r(o,g);let S=i?t(i,l):l;Q=Q[o]?{...Q,[o]:Q[o].concat(S)}:{...Q,[o]:[S]}}};var Vt={},{instanceMethods:ze,instanceGetters:_e,isCommentOrTextNode:Be,isNode:re,isHtmlString:Ue,isArrayOfHtmlElements:Ge,isArrayOfHtmlStrings:Ve,ElemArray2HtmlString:Ze,input2Collection:Xe,setCollectionFromCssSelector:Ye,addHandlerId:Qe,cssRuleEdit:ve,addFn:Zt,elems4Docs:go}=Xt();function Xt(){let e=K({createWithId:"JQxStylesheet"}),t=(a,m)=>r[a]=(v,...n)=>m(v,...n),r=Se.instanceExtensions,o=Se.factoryExtensions,i=a=>u(a,Comment,Text),l=a=>u(a,Text,HTMLElement,Comment),g=a=>u(a,Comment),S=a=>u(a,Text),w=a=>u(a,String)&&/^<|>$/.test(`${a}`.trim()),h=a=>u(a,Array)&&!a?.find(m=>!w(m)),L=a=>u(a,Array)&&!a?.find(m=>!l(m)),T=a=>a?.filter(m=>m).reduce((m,v)=>m.concat(g(v)?`<!--${v.data}-->`:i(v)?v.textContent:v.outerHTML),""),p=a=>a?u(a,Proxy)?[a.EL]:u(a,NodeList)?[...a]:l(a)?[a]:L(a)?a:a.isJQx?a.collection:void 0:[],x=(a,m,v)=>{let n=m!==document.body&&u(a,String)&&a.toLowerCase()!=="body"?m:document,s;try{v.collection=[...n.querySelectorAll(a)]}catch{s=`Invalid CSS querySelector. [${u(a,String)?a:"Nothing valid given!"}]`}return s??`CSS querySelector "${a}", output ${v.collection.length} element(s)`},f=a=>{let m=a.data.get("hid")||`HID${D()}`;return a.data.add({hid:m}),`[data-hid="${m}"]`},y=Object.entries(j.tagsRaw).filter(([,a])=>a).map(([a])=>a).sort((a,m)=>a.localeCompare(m));return{instanceMethods:r,instanceGetters:o,isCommentOrTextNode:i,isNode:l,isComment:g,isText:S,isHtmlString:w,isArrayOfHtmlElements:L,isArrayOfHtmlStrings:h,ElemArray2HtmlString:T,input2Collection:p,setCollectionFromCssSelector:x,addHandlerId:f,cssRuleEdit:e,addFn:t,elems4Docs:y}}function V(e){return new Proxy(e,{get:(t,r)=>er(t,r,e)})}function Yt(e,t){return(...r)=>u(e,Function)&&e(V(t),...r)}function Kt(e,t){return(...r)=>u(e,Function)&&e(V(t),...r)}function er(e,t,r){switch(!0){case u(t,Symbol):return e;case u(+t,Number):return e.collection?.[t]||`ELEMENT WITH INDEX ${t} NOT FOUND`;case t in _e:return Kt(_e[t],r)();case t in ze:return Yt(ze[t],r);default:return e[t]}}function Ke(e){let t=lr(e);return Object.entries(Object.getOwnPropertyDescriptors(t)).forEach(([r,o])=>{Object.defineProperty(e,r,o),Object.defineProperty(Vt,r,o)}),e}function tr(e){return{allow:t=>{let r=/-/.test(t),o=r&&t;t=r?ee(t):t.toLowerCase(),j.allowTag(t),u(e[t],Function)||Object.defineProperties(e,Ee(t,!0,e,o))},prohibit:t=>{t=t.toLowerCase(),j.prohibitTag(t),u(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 rr(e){return function(t,r,...o){return u(r,Function)&&(o.push(r),r=void 0),o.forEach(i=>e(t,r,i))}}function or(e){return function(t,r,o){r=r?.isJQx?r?.[0]:r,o=o&&Object.values(F).find(l=>o===l)?o:void 0;let i=e(t,document.createElement("br"));return r&&!u(r,HTMLBRElement)&&i.collection.forEach(l=>o?r.insertAdjacentElement(o,l):r.append(l)),i}}function nr(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.entries(o).forEach(([i,l])=>!(i in t)&&Object.defineProperty(t,i,l))}return t}function ir(e){console.error(`JQx: "${e}" not allowed, not rendered`)}function sr(e,t,r,o){return e=N(o||e.toLowerCase()),{get(){return(...i)=>t?r.virtual(te(ge[e](...i))):ir(e)},enumerable:!1,configurable:!0}}function Ee(e,t,r,o){e=e.toLowerCase();let i=sr(e,t,r,o);return o?{[o]:i,[ee(o)]:i}:{[e]:i,[e.toUpperCase()]:i}}function lr(e){return nr(Object.entries(j.tagsRaw).reduce(ar(e),{}),cr(e))}function ar(e){return function(t,[r,o]){return o&&Object.defineProperties(t,Ee(r,o,e)),t}}function cr(e){let t=(o,i)=>ve(o,i),r=tr(e);return{debugLog:$,log:(...o)=>A("fromStatic",...o),insertPositions:F,get at(){return F},editCssRules:(...o)=>o.forEach(i=>ve(i)),editCssRule:t,get setStyle(){return t},delegate:rr(We()),virtual:or(e),get fn(){return Zt},allowTag:r.allow,prohibitTag:r.prohibit,get lenient(){return j.allowUnknownHtmlTags},get IS(){return u},get Popup(){return e.activePopup||Object.defineProperty(e,"activePopup",{value:ke(e),enumerable:!1}),e.activePopup},popup:()=>e.Popup,createStyle:o=>K({createWithId:o||`jqx${D()}`}),editStylesheet:o=>K({createWithId:o||`jqx${D()}`}),removeCssRule:qe,removeCssRules:qe,text:(o,i=!1)=>i?e.comment(o):document.createTextNode(o),node:(o,i=document)=>i.querySelector(o,i),nodes:(o,i=document)=>[...i.querySelectorAll(o,i)]}}var b=Ke(ur());function ur(){return function(r,o,i=F.BeforeEnd){if(r?.isJQx)return r;let l=u(o,HTMLBRElement);o=(!l&&o&&o.isJQx?o[0]:o)||document.body,i=i&&Object.values(F).find(x=>i===x)?i:void 0;let g=Ue(r),S=!g&&Ve(r),w=S||g,h={collection:Xe(r)??[],isVirtual:l,isJQx:!0},L=Ge(h.collection),T=`input =&gt; ${S?`"${I(r.join(", "),70)}"`:!w&&L?`element collection [${I(h.collection.map(x=>`${u(x,Comment,Text)?"Comment|Text @":""} ${x?.outerHTML||x?.textContent}`).join(", "),70)}]`:`"${I(r,70)}"`}`;if(h.collection.length&&L)return M(T),l||h.collection.forEach(x=>{o.contains(x)||U([x],o,i)}),V(h);if(w){if([r].flat().forEach(x=>h.collection.push(O(x))),h.collection.length>0){let x=h.collection.filter(f=>f?.dataset?.jqxcreationerror);h.collection=h.collection.filter(f=>!f?.dataset?.jqxcreationerror),M(`${T}`),M(`*Created ${h.isVirtual?"VIRTUAL ":""}[${I(Ze(h.collection)||"sanitized: no elements remaining",70)}]`),x.length&&console.error(`JQx: illegal html, not rendered: "${x.reduce((f,y)=>f.concat(`${y.textContent}
15
- `),"").trim()}"`),h.isVirtual||U(h.collection,o,i)}return V(h)}let p=Ye(r,o,h);return M(`input => ${p}`),V(h)}}export{b as default};
1
+ var se=rt(),we=nt(),J=et(),Z=tt();function et(){return{html:Object.freeze("accept,action,align,alt,autocapitalize,autocomplete,autopictureinpicture,autoplay,background,bgcolor,border,capture,cellpadding,cellspacing,checked,cite,class,clear,contenteditable,color,cols,colspan,controls,controlslist,coords,crossorigin,datetime,decoding,default,dir,disabled,disablepictureinpicture,disableremoteplayback,download,draggable,enctype,enterkeyhint,face,for,headers,height,hidden,high,href,hreflang,id,inputmode,integrity,is,ismap,kind,label,lang,list,loading,loop,low,max,maxlength,media,method,min,minlength,multiple,muted,name,nonce,noshade,novalidate,nowrap,open,optimum,pattern,placeholder,playsinline,poster,preload,pubdate,radiogroup,readonly,rel,required,rev,reversed,role,rows,rowspan,spellcheck,scope,selected,shape,size,sizes,span,srclang,start,src,srcset,step,style,summary,tabindex,target,title,translate,type,usemap,valign,value,width,xmlns,slot".split(",")),svg:Object.freeze("accent-height,accumulate,additive,alignment-baseline,ascent,attributename,attributetype,azimuth,basefrequency,baseline-shift,begin,bias,by,class,clip,clippathunits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,cx,cy,d,dx,dy,diffuseconstant,direction,display,divisor,dur,edgemode,elevation,end,fill,fill-opacity,fill-rule,filter,filterunits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,fx,fy,g1,g2,glyph-name,glyphref,gradientunits,gradienttransform,height,href,id,image-rendering,in,in2,k,k1,k2,k3,k4,kerning,keypoints,keysplines,keytimes,lang,lengthadjust,letter-spacing,kernelmatrix,kernelunitlength,lighting-color,local,marker-end,marker-mid,marker-start,markerheight,markerunits,markerwidth,maskcontentunits,maskunits,max,mask,media,method,mode,min,name,numoctaves,offset,operator,opacity,order,orient,orientation,origin,overflow,paint-order,path,pathlength,patterncontentunits,patterntransform,patternunits,points,preservealpha,preserveaspectratio,primitiveunits,r,rx,ry,radius,refx,refy,repeatcount,repeatdur,restart,result,rotate,scale,seed,shape-rendering,specularconstant,specularexponent,spreadmethod,startoffset,stddeviation,stitchtiles,stop-color,stop-opacity,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke,stroke-width,style,surfacescale,systemlanguage,tabindex,targetx,targety,transform,text-anchor,text-decoration,text-rendering,textlength,type,u1,u2,unicode,values,viewbox,visibility,version,vert-adv-y,vert-origin-x,vert-origin-y,width,word-spacing,wrap,writing-mode,xchannelselector,ychannelselector,x,x1,x2,xmlns,y,y1,y2,z,zoomandpan".split(","))}}function tt(){return{a:!0,area:!0,audio:!1,br:!0,base:!0,body:!0,button:!0,canvas:!0,comment:!0,dl:!0,data:!0,datalist:!0,div:!0,em:!0,embed:!1,fieldset:!0,font:!0,footer:!0,form:!1,hr:!0,head:!0,header:!0,output:!0,iframe:!1,frameset:!1,img:!0,input:!0,li:!0,label:!0,legend:!0,link:!0,map:!0,mark:!0,menu:!0,media:!0,meta:!0,nav:!0,meter:!0,ol:!0,object:!1,optgroup:!0,option:!0,p:!0,param:!0,picture:!0,pre:!0,progress:!1,quote:!0,script:!1,select:!0,source:!0,span:!0,style:!0,caption:!0,td:!0,col:!0,table:!0,tr:!0,template:!1,textarea:!0,time:!0,title:!0,track:!0,details:!0,ul:!0,video:!0,del:!0,ins:!0,slot:!0,blockquote:!0,svg:!0,dialog:!0,summary:!0,main:!0,address:!0,colgroup:!0,tbody:!0,tfoot:!0,thead:!0,th:!0,dd:!0,dt:!0,figcaption:!0,figure:!0,i:!0,b:!0,code:!0,h1:!0,h2:!0,h3:!0,h4:!0,abbr:!0,bdo:!0,dfn:!0,kbd:!0,q:!0,rb:!0,rp:!0,rt:!0,ruby:!0,s:!0,strike:!0,samp:!0,small:!0,strong:!0,sup:!0,sub:!0,u:!0,var:!0,wbr:!0,nobr:!0,tt:!0,noscript:!0}}function rt(){return["#logBox{min-width:0px;max-width:0px;min-height:0px;max-height:0px;width:0;height:0;z-index:-1;border:none;padding:0px;overflow:hidden;transition:all 0.3s ease;margin-top:-100px;}","#logBox.visible{background-color:rgb(255, 255, 224);z-index:1;position:static;border:1px dotted rgb(153, 153, 153);max-width:50vw;min-width:30vw;min-height:10vh;max-height:90vh;overflow:auto;width:50vw;height:20vh;margin:1rem 0px;padding:0px 8px 19px;resize:both;}","#logBox.visible .legend{position:absolute;}","#logBox .legend{text-align:center;margin-top:-1em;width:inherit;max-width:inherit;}","#logBox .legend div{text-align:center;display:inline-block;max-width:inherit;height:1.2rem;background-color:rgb(119, 119, 119);padding:2px 10px;color:rgb(255, 255, 255);box-shadow:rgb(119 119 119) 2px 1px 10px;border-radius:4px;}","#logBox .legend div:before{content:'JQx Logging (chronological)';}","#logBox .legend.reversed div:before{content:'JQx Logging (reversed)';}","#logBox #jqx_logger{marginTop:0.7rem;lineHeight:1.4em;font-family:consolas,monospace;whiteSpace:pre-wrap;maxWidth:inherit;padding-left:100px;}","#logBox #jqx_logger div.entry{text-indent:-100px;whiteSpace:normal;}"]}function nt(){return["::backdrop{background-color:grey;opacity:0.2;}",`#jqxPopup{overflow:hidden;background-color:transparent;outline:none;border:none;inset:0;animation:fade-out 0.5s ease-out;&[open]{display:flex;align-items:center;justify-content:center;animation:fade-in 0.5s ease;}#jqxPopupContent{background-color:white;border:solid 1px #eee;box-shadow:1px 2px 8px #999;border-radius:4px;padding:12px;vertical-align:middle;max-height:40vh;max-width:50vw;overflow:auto;margin:0 auto;div:not(#closeHandleIcon){clear:both;}@media (width <= 640px){max-width:80vw;max-height:60vh;}#closeHandleIcon{cursor:pointer;width:24px;height:24px;display:inline;position:absolute;top:4px;right:4px;justify-content:right;background-image:url("data:image/svg+xml;utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20version%3D%221.1%22%20id%3D%22Layer_1%22%20x%3D%220px%22%20y%3D%220px%22%20viewBox%3D%220%200%20128%20128%22%20style%3D%22enable-background%3Anew%200%200%20128%20128%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Crect%20x%3D%22-368%22%20y%3D%226%22%20style%3D%22display%3Anone%3Bfill%3A%23E0E0E0%3B%22%20width%3D%22866%22%20height%3D%221018%22%2F%3E%3Ccircle%20style%3D%22fill%3A%23FFFFFF%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2248%22%2F%3E%3Ccircle%20style%3D%22fill%3A%238CCFB9%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2239%22%2F%3E%3Ccircle%20style%3D%22fill%3Anone%3Bstroke%3A%23444B54%3Bstroke-width%3A6%3Bstroke-miterlimit%3A10%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2248%22%2F%3E%3Cpolyline%20style%3D%22fill%3Anone%3Bstroke%3A%23FFFFFF%3Bstroke-width%3A6%3Bstroke-linecap%3Around%3Bstroke-miterlimit%3A10%3B%22%20points%3D%2242%2C69%2055.55%2C81%20%20%2086%2C46%20%22%2F%3E%3C%2Fsvg%3E");@media (width <= 640px){background-image:none;position:relative;margin:-15px -15px 4px 0;float:right;vertical-align:middle;border:1px solid #AAA;padding:2px;border-radius:50%;width:12px;height:12px;font-size:12px;line-height:12px;font-weight:bold;text-align:center;&:after{content:'\\2714';color:green;}}}.warn{display:none;text-align:center;color:red;border-top:1px solid #999;margin-top:1em;padding-top:3px;animation:warn-fade-out 0.2s ease-out;}.warn.active{opacity:1;display:block;animation:warn-fade-in 0.2s ease-in;}}}`,"@keyframes fade-in{0%{opacity:0;transform:scale(0, 0);display:none;}100%{opacity:1;transform:scale(1, 1);display:flex;}}","@keyframes fade-out{0%{opacity:1;transform:scale(1, 1);display:flex;}100%{opacity:0;transform:scale(0, 0);display:none;}}","@keyframes warn-fade-in{0%{opacity:0;transform:scale(0, 0);display:none;}100%{opacity:1;transform:scale(1,1 );display:block;}}","@keyframes warn-fade-out{0%{opacity:1;transform:scale(1, 1);display:block;}100%{opacity:0;transform:scale(0, 0);display:none;}}"]}var ae=!1,ot={on:()=>ae=!0,off:()=>ae=!1},M={tagsRaw:Z,allowUnknownHtmlTags:ot,isAllowed(e){if(ae)return!0;let t=a(e,String)?e.toLowerCase():e?.nodeName.toLowerCase()||"none";return t==="#text"||!!Z[t]},allowTag:e=>Z[e.toLowerCase()]=!0,prohibitTag:e=>Z[e.toLowerCase()]=!1};var fe=!1,X=!1,W=!0,de=!1,it=!0,Ce,Q=()=>h("#logBox"),$e="#jqx_logger",lt=e=>{se?.forEach(t=>e(t))},st=()=>{se&&lt(Ce);let e=it?"div":"pre",t=`<div id="logBox"><div class="legend"><div></div></div><${e} id="jqx_logger"></${e}></div>`;return me(H(t),void 0,F.AfterBegin),h.node($e)},Le=e=>a(e,String)&&Object.assign(document.createElement("textarea"),{innerHTML:e}).textContent||e,D=(...e)=>{let t=e[0]==="fromStatic";if(e=t?e.slice(1):e,t&&!X)return e.forEach(n=>console.info(`${q()} \u2714 ${Le(n)}`));if(!X)return;!W&&!h.node("#logBox")&&(Ce=h.createStyle("JQxLogCSS"),st());let r=n=>`${a(n,Object)?JSON.stringify(n,null,2):n}
2
+ `;e.forEach(n=>W?console.info(`${q()} \u2714 ${Le(n)}`):h.node("#jqx_logger").insertAdjacentHTML(de?"afterbegin":"beforeend",`<div class="entry">${q()} ${r(n.replace(/\n/g,"<br>"))}</div>`))},ce={on(){X=!0,D("Logging activated")},off(){X=!1,console.log("Logging deactivated")}},ue={on(){fe=!0},off(){fe=!1}},N=(...e)=>fe&&D(...e),$={get isConsole(){return W===!0},get isOn(){return X},isVisible:function(){return h("#jqx_logger").is("visible")},on(){return ce.on(),ue.on(),W||Q()?.addClass("visible"),D("Debug logging started. Every call to [jqx instance] is logged"),$},off(){return Q().isEmpty||(ue.off(),D("Debug logging stopped"),Q()?.removeClass("visible")),ce.off(),$},toConsole:{on(){return W=!0,D("Started logging to console"),$},off(){return D("Stopped logging to console (except error messages)"),W=!1,$}},remove(){return ce.off(),ue.off(),Q()?.remove(),console.clear(),console.log(`${q()} logging completely disabled and all entries removed`),$},log:function(...e){return D(...e),$},hide(){return Q()?.removeClass("visible"),$},show:()=>(Q()?.addClass("visible"),$),get reversed(){return{on:()=>(de=!0,D("Reverse logging set: now logging bottom to top (latest first)"),h("#logBox .legend").addClass("reversed"),$),off:()=>(de=!1,h("#logBox .legend").removeClass("reversed"),D("Reverse logging reset: now logging chronological (latest last)"),$)}},clear(){return h($e).text(""),console.clear(),D("Logging cleared"),$}};var at=ct(),Te={html:"innerHTML",text:"textContent",class:"className"},ge=at;function ct(){let e={get(t,r){let n=String(r)?.toLowerCase();switch(!0){case n in t:return t[n];case ht(n):return Fe(t,n,r);default:return Fe(t,n,r,!0)}},enumerable:!1,configurable:!1};return new Proxy({},e)}function Fe(e,t,r,n=!1){return Object.defineProperty(e,t,{get(){return n?i=>yt(r):xt(t)}}),e[t]}function ut(e,t,r){return t=t?.isJQx&&t.first()||t,ye({trial:n=>bt(t)?e.append(t):De(t)?e.insertAdjacentHTML("beforeend",t):e.append(t),whenError:n=>console.info(`${r} (for root ${e}) not created, reason
3
+ `,n)})}function ft(e,t,...r){let n=dt(t,e);return r?.forEach(i=>ut(n,i,e)),n}function dt(e,t){switch(e=pe(t)?pt(e):e?.isJQx?e.first():e,!0){case a(e,String):return Y(t,De(e,t)?{html:e}:{text:e});case a(e,Node):return gt(t,e);default:return Y(t,e)}}function mt(e){return delete e.data,Object.keys(e).length<1||Object.keys(e).forEach(t=>{let r=t.toLowerCase();r in Te&&(e[Te[r]]=e[t],delete e[t])}),e}function gt(e,t){let r=Y(e);return r.append(t),r}function Y(e,t={}){t=Ae(t,{});let r=Object.entries(t.data??{}),n=Object.assign(pe(e)?new Comment(t?.text):document.createElement(e),mt(t));return r.length&&r.forEach(([i,s])=>n.dataset[i]=String(s)),n}function Ae(e,t){return t?a(e,{isTypes:Object,notTypes:[Array,null,NaN,Proxy],defaultValue:t}):a(e,{isTypes:Object,notTypes:[Array,null,NaN,Proxy]})}function pt(e){return Ae(e)?e?.text??e?.textContent??"":String(e)}function yt(e){return Y("b",{style:"color:red",text:`'${e}' is not a valid HTML-tag`})}function De(e,t){return!pe(t)&&a(e,String)&&/<.*>|&[#|0-9a-z]+[^;];/i.test(e)}function bt(e){return e?.constructor===Comment||e?.constructor===CharacterData}function pe(e){return e?.constructor===Comment||/comment/i.test(e)}function ht(e){return!a(Y(e),HTMLUnknownElement)}function xt(e){return(t,...r)=>ft(e,t,...r)}var{IS:a,maybe:ye,$Wrap:Sr,xProxy:vr,isNothing:Er}=St();function St(){Symbol.proxy=Symbol.for("toa.proxy"),Symbol.is=Symbol.for("toa.is"),Symbol.type=Symbol.for("toa.type"),Symbol.isSymbol=Symbol.for("toa.isASymbol"),y();let e=T(),[t,r]=[d(),C()];return r.custom(),{IS:n,maybe:e,$Wrap:t,isNothing:E,xProxy:r};function n(o,...l){if(e({trial:u=>"isTypes"in(l?.[0]??{})})){let u=l[0];return"defaultValue"in u?g(o,u):"notTypes"in u?m(o,u):n(o,...[u.isTypes].flat())}let c=typeof o=="symbol"?Symbol.isSymbol:o;return l.length>1?x(c,...l):s(o,...l)}function i(o){return o?.[Symbol.proxy]??n(o)}function s(o,...l){let{noInput:c,noShouldbe:u,compareTo:S,inputCTOR:A,isNaN:P,isInfinity:I,shouldBeFirstElementIsNothing:R}=v(o,...l);switch(l=l.length&&l[0],!0){case R:return String(o)===String(S);case(o?.[Symbol.proxy]&&u):return o[Symbol.proxy];case P:return u?"NaN":e({trial:B=>String(S)})===String(o);case I:return u?"Infinity":e({trial:B=>String(S)})===String(o);case c:return u?String(o):String(S)===String(o);case A===Boolean:return l?A===l:"Boolean";default:return L(o,l,u,p(o,A))}}function p(o,l){return o===0?Number:o===""?String:o?l:{name:String(o)}}function v(o,...l){let c=l.length<1,u=!c&&l[0],S=!c&&E(l[0]),A=o==null,P=!A&&Object.getPrototypeOf(o)?.constructor,I=e({trial:B=>String(o)})==="NaN",R=e({trial:B=>String(o)})==="Infinity";return{noInput:A,noShouldbe:c,compareTo:u,inputCTOR:P,isNaN:I,isInfinity:R,shouldBeFirstElementIsNothing:S}}function L(o,l,c,u){switch(!0){case(!c&&l===o||o?.[Symbol.proxy]&&l===Proxy):return!0;case e({trial:S=>String(l)})==="NaN":return String(o)==="NaN";case(o?.[Symbol.toStringTag]&&n(l,String)):return String(l)===o[Symbol.toStringTag];default:return l?e({trial:S=>o instanceof l})||l===u||l===Object.getPrototypeOf(u)||`${l?.name}`===u?.name:o?.[Symbol.toStringTag]&&`[object ${o?.[Symbol.toStringTag]}]`||u?.name||String(u)}}function x(o,...l){return l.some(c=>n(o,c))}function E(o,l=!1){let c=o==null;return c=l?c||n(o,1/0)||n(o,NaN):c,c}function T(){let o=(l,c)=>l?.constructor===Function?l(c):void 0;return function({trial:l,whenError:c=()=>{}}={}){try{return o(l)}catch(u){return o(c,u)}}}function d(){return function(o){return Object.freeze({get value(){return o},get[Symbol.type](){return i(o)},get type(){return i(o)},[Symbol.is](...l){return n(o,...l)},is(...l){return n(o,...l)}})}}function g(o,{defaultValue:l,isTypes:c=[void 0],notTypes:u}={}){return c=c?.constructor!==Array?[c]:c,u=u&&u?.constructor!==Array?[u]:[],u.length<1?n(o,...c)?o:l:m(o,{isTypes:c,notTypes:u})?o:l}function m(o,{isTypes:l=[void 0],notTypes:c=[void 0]}={}){return l=l?.constructor!==Array?[l]:l,c=c?.constructor!==Array?[c]:c,n(o,...l)&&!n(o,...c)}function y(){Object.getOwnPropertyDescriptors(Object.prototype)[Symbol.is]||(Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return i(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...o){return n(this,...o)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(o){return i(o)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(o,...l){return n(o,...l)},enumerable:!1,configurable:!1}}))}function f(o){let l=String(Object.getPrototypeOf(o)?.constructor);return l.slice(l.indexOf("ion")+3,l.indexOf("(")).trim()}function b(o){let l=o.set;return o.set=(c,u,S)=>u===Symbol.proxy?c[u]=S:l(c,u,S),o}function C(){let o=Proxy;return{native(){Proxy=o},custom(){Proxy=new o(o,{construct(l,c){for(let S of c)S.set&&(S=b(S));let u=new l(...c);return u[Symbol.proxy]=`Proxy (${f(c[0])})`,u}})}}}}var{IS:ne,maybe:Lr,$Wrap:Cr,xProxy:$r,isNothing:Tr}=vt();function vt(){Symbol.proxy=Symbol.for("toa.proxy"),Symbol.is=Symbol.for("toa.is"),Symbol.type=Symbol.for("toa.type"),Symbol.isSymbol=Symbol.for("toa.isASymbol"),y();let e=T(),[t,r]=[d(),C()];return r.custom(),{IS:n,maybe:e,$Wrap:t,isNothing:E,xProxy:r};function n(o,...l){if(e({trial:u=>"isTypes"in(l?.[0]??{})})){let u=l[0];return"defaultValue"in u?g(o,u):"notTypes"in u?m(o,u):n(o,...[u.isTypes].flat())}let c=typeof o=="symbol"?Symbol.isSymbol:o;return l.length>1?x(c,...l):s(o,...l)}function i(o){return o?.[Symbol.proxy]??n(o)}function s(o,...l){let{noInput:c,noShouldbe:u,compareTo:S,inputCTOR:A,isNaN:P,isInfinity:I,shouldBeFirstElementIsNothing:R}=v(o,...l);switch(l=l.length&&l[0],!0){case R:return String(o)===String(S);case(o?.[Symbol.proxy]&&u):return o[Symbol.proxy];case P:return u?"NaN":e({trial:B=>String(S)})===String(o);case I:return u?"Infinity":e({trial:B=>String(S)})===String(o);case c:return u?String(o):String(S)===String(o);case A===Boolean:return l?A===l:"Boolean";default:return L(o,l,u,p(o,A))}}function p(o,l){return o===0?Number:o===""?String:o?l:{name:String(o)}}function v(o,...l){let c=l.length<1,u=!c&&l[0],S=!c&&E(l[0]),A=o==null,P=!A&&Object.getPrototypeOf(o)?.constructor,I=e({trial:B=>String(o)})==="NaN",R=e({trial:B=>String(o)})==="Infinity";return{noInput:A,noShouldbe:c,compareTo:u,inputCTOR:P,isNaN:I,isInfinity:R,shouldBeFirstElementIsNothing:S}}function L(o,l,c,u){switch(!0){case(!c&&l===o||o?.[Symbol.proxy]&&l===Proxy):return!0;case e({trial:S=>String(l)})==="NaN":return String(o)==="NaN";case(o?.[Symbol.toStringTag]&&n(l,String)):return String(l)===o[Symbol.toStringTag];default:return l?e({trial:S=>o instanceof l})||l===u||l===Object.getPrototypeOf(u)||`${l?.name}`===u?.name:o?.[Symbol.toStringTag]&&`[object ${o?.[Symbol.toStringTag]}]`||u?.name||String(u)}}function x(o,...l){return l.some(c=>n(o,c))}function E(o,l=!1){let c=o==null;return c=l?c||n(o,1/0)||n(o,NaN):c,c}function T(){let o=(l,c)=>l?.constructor===Function?l(c):void 0;return function({trial:l,whenError:c=()=>{}}={}){try{return o(l)}catch(u){return o(c,u)}}}function d(){return function(o){return Object.freeze({get value(){return o},get[Symbol.type](){return i(o)},get type(){return i(o)},[Symbol.is](...l){return n(o,...l)},is(...l){return n(o,...l)}})}}function g(o,{defaultValue:l,isTypes:c=[void 0],notTypes:u}={}){return c=c?.constructor!==Array?[c]:c,u=u&&u?.constructor!==Array?[u]:[],u.length<1?n(o,...c)?o:l:m(o,{isTypes:c,notTypes:u})?o:l}function m(o,{isTypes:l=[void 0],notTypes:c=[void 0]}={}){return l=l?.constructor!==Array?[l]:l,c=c?.constructor!==Array?[c]:c,n(o,...l)&&!n(o,...c)}function y(){Object.getOwnPropertyDescriptors(Object.prototype)[Symbol.is]||(Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return i(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...o){return n(this,...o)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(o){return i(o)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(o,...l){return n(o,...l)},enumerable:!1,configurable:!1}}))}function f(o){let l=String(Object.getPrototypeOf(o)?.constructor);return l.slice(l.indexOf("ion")+3,l.indexOf("(")).trim()}function b(o){let l=o.set;return o.set=(c,u,S)=>u===Symbol.proxy?c[u]=S:l(c,u,S),o}function C(){let o=Proxy;return{native(){Proxy=o},custom(){Proxy=new o(o,{construct(l,c){for(let S of c)S.set&&(S=b(S));let u=new l(...c);return u[Symbol.proxy]=`Proxy (${f(c[0])})`,u}})}}}}var K=Et;function Et({styleSheet:e,createWithId:t}={}){let{tryParseAtOrNestedRules:r,ruleExists:n,checkParams:i,sheet:s,removeRules:p,consider:v,currentSheetID:L}=wt({styleSheet:e,createWithId:t});function x(m,y){if(m&&y.removeProperties){Object.keys(y.removeProperties).forEach(f=>m.style.removeProperty(He(f)));return}Object.entries(y).forEach(([f,b])=>{f=He(f.trim()),b=b.trim();let C;if(/!important/.test(b)&&(b=b.slice(0,b.indexOf("!important")).trim(),C="important"),!CSS.supports(f,b))return console.error(`StylingFactory ${L} error: '${f}' with value '${b}' not supported (yet)`);je(()=>m.style.setProperty(f,b,C),`StylingFactory ${L} (setRule4Selector) failed`)})}function E(m,y,f=s){if(m=m?.trim?.(),!ne(m,String)||!m.length||/[;,]$/g.test(m))return console.error(`StylingFactory ${L} (setRules): [${m||"[no selector given]"}] is not a valid selector`);if(y.removeRule)return p(m);let b=n(m,!0),C=b||f.cssRules[f.insertRule(`${m} {}`,f.cssRules.length||0)];return v(()=>x(C,y),m,b)}function T(m){let y=m.trim().split(/{/,2),f=y.shift().trim();if(!ne(f,String)||!f?.trim()?.length)return console.error(`StylingFactory ${L} (doParse): no (valid) selector could be extracted from rule ${be(m)}`);let b=Dt(y.shift());return je(()=>E(f,b),`StylingFactory ${L} (setRules) failed`)}function d(m){let y=r(m);return y.done?y.existing:T(m)}function g(m,y){return m.trim().startsWith("@media")?d(Lt(m,y)):E(m,y)}return function(m,y={}){return i(m,y)&&(Object.keys(y).length?g(m,y):d(m))}}function wt({styleSheet:e,createWithId:t}){let r="Note: The rule or some of its properties may not be supported by your browser (yet)",n=`for style#${t}`;e=t?i(t):e;function i(d){let g=document.querySelector(`#${d}`)?.sheet;if(g)return g;let m=Object.assign(document.createElement("style"),{id:d});return document.head.insertAdjacentElement("beforeend",m),m.sheet}function s(d){return console.error(`StylingFactory ${n} [rule: ${d}]
4
+ => @charset, @namespace and @import are not supported here`),{done:!0}}function p(d,g){return[...e.rules].find(m=>g?Oe(m.selectorText||"",d):Tt`${$t(d)}${[..."gim"]}`.test(m.cssText))}function v(d){return/^@charset|@import|namespace/i.test(d.trim())?s(d):d.match(/}/g)?.length>1?{existing:E(d,1),done:!0}:{done:!1}}function L(d){let g=[...e.cssRules].reduce((y,f,b)=>Oe(f.selectorText||"",d)&&y.concat(b)||y,[]),m=g.length;return g.forEach(y=>e.deleteRule(y)),m>0?console.info(`\u2714 Removed ${m} instance${m>1?"s":""} of selector ${d} from ${n.slice(4)}`):console.info(`\u2714 Remove rule: selector ${d} does not exist in ${n.slice(4)}`)}function x(d,g){return d&&ne(d,String)&&d.trim().length>0&&ne(g,Object)||(console.error(`StylingFactory ${n} called with invalid parameters`),!1)}function E(d){d=d.trim();let g=d.slice(0,d.indexOf("{")).trim(),m=!!p(g);try{return e.insertRule(`${d}`,e.cssRules.length),m}catch(y){return console.error(`StylingFactory ${n} (tryParse) ${y.name} Error:
5
+ ${y.message}
6
+ Rule: ${be(d)}
7
+ ${r}`),m}}function T(d,g,m){try{return d(),m}catch(y){return console.error(`StylingFactory ${n} (tryAddOrModify) ${y.name} Error:
8
+ ${y.message}
9
+ Rule: ${be(g)}
10
+ ${r}`),m}}return{sheet:e,removeRules:L,tryParseAtOrNestedRules:v,ruleExists:p,checkParams:x,tryParse:E,consider:T,currentSheetID:n}}function Lt(e,t){return`${e.trim()} ${Object.entries(t).map(([r,n])=>`${r}: { ${Ct(n)}`)}`}function be(e){let t=(e||"NO RULE").trim().slice(0,50).replace(/\n/g,"\\n").replace(/\s{2,}/g," ");return e.length>t.length?`${t.trim()}...truncated`:t}function Ct(e){return Object.entries(e).map(([t,r])=>`${t}: ${r.trim()}`).join(`;
11
+ `)}function $t(e){return e.replace(/([*\[\]()-+{}.$?\\])/g,t=>`\\${t}`)}function Tt(e,...t){let r=t.length&&Array.isArray(t.slice(-1))?t.pop().join(""):"";return new RegExp((t.length&&e.raw.reduce((n,i,s)=>n.concat(t[s-1]||"").concat(i),"")||e.raw.join("")).split(`
12
+ `).map(n=>n.replace(/\s|\/\/.*$/g,"").trim().replace(/(@s!)/g," ")).join(""),r)}function He(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 Ft(e){return e.replace(/\/\*.+?\*\//gm,"").replace(/[}{\r\n]/g,"").replace(/(data:.+?);/g,(t,r)=>`${r}\\3b`).split(";").map(t=>t.trim()).join(`;
13
+ `).replaceAll("\\3b",";").split(`
14
+ `)}function At(e){return e.reduce((t,r)=>{let[n,i]=[r.slice(0,r.indexOf(":")).trim(),r.slice(r.indexOf(":")+1).trim().replace(/;$|;.+(?=\/*).+\/$/,"")];return n&&i?{...t,[n]:i}:t},{})}function Dt(e){return At(Ft(e))}function Oe(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}`)),oe=(e,t=2)=>`${e}`.padStart(t,"0"),jt=(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)),Ot=e=>{let t=e.length;for(;t--;){let r=jt(t);[e[t],e[r]]=[e[r],e[t]]}return e};var j=(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(),O=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`).replace(/^-|-$/,""),Mt=([e,...t])=>`${e.toUpperCase()}${t.join("")}`,ee=e=>a(e,String)?e.toLowerCase().split("-").map((t,r)=>r&&`${Mt(t)}`||t).join(""):e,z=()=>`_${Ot(Ht).slice(0,8).join("")}`,ie=(e,t=120)=>j(e,t).replace(/&lt;/g,"<"),q=()=>(e=>`[${oe(e.getHours())}:${oe(e.getMinutes())}:${oe(e.getSeconds())}.${oe(e.getMilliseconds(),3)}]`)(new Date);var _=e=>e.replace(/</g,"&lt;");function Me(){let e=function(s){if(!s)return;let p=s.style,v=getComputedStyle(s),L=[p.visibility,v.visibility].includes("hidden"),x=[p.display,v.display].includes("none"),E=s.offsetTop<0||s.offsetLeft+s.offsetWidth<0||s.offsetLeft>document.body.offsetWidth,T=+v.opacity==0||+(p.opacity||1)==0;return!(E||T||x||L)},t="n/a",r=function(s){return s.parentNode?!!h.nodes(":is(:read-write)",s?.parentNode)?.find(p=>p===s):!1},n=function(s){return s.parentNode?!!h.nodes(":is(:modal)",s?.parentNode)?.find(p=>p===s):!1},i={notInDOM:!0,writable:t,modal:t,empty:!0,open:t,visible:t};return s=>{let p=s.node;return p?{get writable(){return r(p)},get modal(){return n(p)},get inDOM(){return p.isConnected},get open(){return p.open??!1},get visible(){return e(p)},get disabled(){return p.hasAttribute("readonly")||p.hasAttribute("disabled")},get empty(){return s.collection.length<1},get virtual(){return s.isVirtual}}:i}}var Nt=!0,le={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},Pt=e=>{if(Nt&&Object.keys(e.removed).length){let t=Object.entries(e.removed).reduce((r,[n,i])=>[...r,`${_(n)} => ${i}`],[]).join("\\000A");$.log(`JQx HTML creation errors: ${$.isConsole?t:_(t)}`)}},It=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(n=>n===t)||M.isAllowed(t)},te=e=>{let t={rawHTML:e?.parentElement?.getHTML()??"no html",removed:{}};return a(e,HTMLElement)&&[...e.childNodes].forEach(r=>{if(r?.children?.length&&te(r),r?.attributes){let i=a(r,SVGElement)?J.svg:J.html;[...(r??{attributes:[]}).attributes].forEach(s=>{let p=s.name.trim().toLowerCase(),v=s.value.trim().toLowerCase().replace(le.whiteSpace,""),L=p==="href"?!le.validURL.test(v):le.notAllowedValues.test(v),x=p.startsWith("data")?!le.data.test(p):!!i[p];if(L||x){let E=ie(s.value||"none",60);E+=E.length===60?"...":"",t.removed[`${s.name}`]=`attribute/property (-value) not allowed, removed. Value: ${E}`,r.removeAttribute(s.name)}})}if(!(It(r)||r.constructor===CharacterData||r.constructor===Comment)){let i=(r?.outerHTML||r?.textContent).trim(),s=ie(i,60)??"EMPTY";s+=s.length===60?"...":"",t.removed[`<${r.nodeName?.toLowerCase()}>`]=`not allowed, not rendered. Value: ${s}`,r.remove()}}),Pt(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]}}),Rt=e=>{let t=document.createElement("div");return t.insertAdjacentHTML(F.end,e),t.childNodes.length?te(t):void 0},Bt=(e,t,r)=>a(e,Comment)?t.insertAdjacentHTML(r,`<!--${e.data}-->`):t.insertAdjacentText(r,e.data),U=(e=[],t=document.body,r=F.BeforeEnd)=>e.reduce((n,i)=>{let s=re(i)&&me(i,t,r);return s?[...n,s]:n},[]),me=(e,t=document.body,r=F.BeforeEnd)=>(t=t?.isJQx?t?.[0]:t,a(e,Comment,Text)?Bt(e,t,r):t.insertAdjacentElement(r,e)),H=e=>{if(a(e,Text,Comment))return e;let t=e?.trim(),r=t?.split(/<text>|<\/text>/i)??[];if(r?.length&&(r=r.length>1?r.filter(i=>i.length).shift():void 0),t.startsWith("<!--")&&t.endsWith("-->"))return document.createComment(e.replace(/<!--|-->$/g,""));if(r||!/^<(.+)[^>]+>/m.test(t))return document.createTextNode(r);let n=Rt(e);return n.childNodes.length<1?H(`<span data-jqxcreationerror="1">${j(e,60)}</span>`):n.children[0]};var w=(e,t)=>{let r=e.collection.filter(n=>!ke(n));for(let n=0;n<r.length;n+=1)t(r[n],n);return e},kt=Me(),Ne=e=>e&&(e.textContent="");var V=e=>{let t=e.cloneNode(!0);return t.removeAttribute&&t.removeAttribute("id"),e.isConnected?e.remove():e=null,t},Re=(e,t)=>{e&&a(t,Object)&&Object.entries(t).forEach(([r,n])=>e.setAttribute(`data-${O(r)}`,n))},Pe=(e,t)=>e.andThen(t,!0),Ie=(e,t)=>e.andThen(t),Be=e=>e.startsWith("data")||J.html.find(t=>e.toLowerCase()===t),Jt=(e,t,r)=>{r&&a(t,String)&&(t={[t]:r==="-"?"":r});let n;t.className&&(n=t.className,delete t.className),n=[...e.classList].find(s=>s.startsWith("JQxClass-")||n&&s===n)||n||`JQxClass-${z().slice(1)}`,h.editCssRule(`.${n}`,t),e.classList.add(n)},Qt=(e,t)=>{e&&Object.entries(t).forEach(([r,n])=>{if(r=O(r),r.startsWith("data"))return Re(e,n);a(n,String)&&Be(r)&&e.setAttribute(r,n.split(/[, ]/)?.join(" "))})},he=(e,t)=>{a(t,Object)&&Object.entries(t).forEach(([r,n])=>{let i;/!important/i.test(n)&&(n=n.slice(0,n.indexOf("!")).trim(),i="important"),e.style.setProperty(O(r),n,i)})},Wt={get(e,t){return e[ee(t)]||e[t]},enumerable:!1,configurable:!1},qt=(...e)=>{$.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??{},Wt)},set:(t={})=>(!e.is.empty&&a(t,Object)&&Object.entries(t).forEach(([r,n])=>e.setData({[r]:n})),e),get:(t,r)=>e.data.all[t]??r,add:(t={})=>(!e.is.empty&&a(t,Object)&&Object.entries(t).forEach(([r,n])=>e.setData({[r]:n})),e),remove:t=>(e[0]?.removeAttribute(`data-${O(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 n=t?e.outerHtml:e.html();return r?_(n):n},set:(t,r=!1,n=!1)=>{t=t.isJQx?t.HTML.get(1):t;let i=a(t,String);return t=i&&n?_(t):t,i&&(t||"").trim().length&&e.html(t,r),e},replace:(t,r=!1)=>e.HTML.set(t,!1,r),append:(t,r=!1)=>(t=a(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=a(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=>kt(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"),e),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])[O(t)],nwRule:t=>e.Style.byRule({rules:t}),byRule:({classes2Apply:t=[],rules:r=[]}={})=>{let i=a(r,String)&&!t.length?r.split("{")[0].trim():"";return r=r&&a(r,String)?[r]:r,t=t&&a(t,String)?[t]:t,(r?.length||t?.length)&&(r?.length&&h.editCssRules(...r),t?.forEach(s=>e.addClass(s))),i?.startsWith(".")&&e.addClass(i.slice(1)),i?.startsWith("#")&&!e.attr("id")&&e.prop({id:i.slice(1)}),e}})},instanceExtensions:{addClass:(e,...t)=>w(e,r=>r&&t.forEach(n=>r.classList.add(n))),after:Ie,afterMe:Ie,andThen:(e,t,r=!1)=>{if(!t||!a(t,String,Node,Proxy))return qt(`[JQx instance].[beforeMe | afterMe | andThen]: insufficient input [${t}]`),e;t=t?.isJQx?t.collection:a(t,Node)?h.virtual(t).collection:h.virtual(H(t)).collection;let[n,i,s]=r?[0,"before",t.concat(e.collection)]:[e.collection.length-1,"after",e.collection.concat(t)];return e[n][i](...t),e.collection=s,e},append:(e,...t)=>{if(!e.is.empty&&t.length){let r=e.length===1;for(let n of t){if(!n.isJQx&&a(n,String)){let i=n.trim(),p=!/^<(.+)[^>]+>$/m.test(i)?h.text(n):H(n);w(e,v=>v.append(r?p:V(p)))}re(n)&&w(e,i=>i.append(r?n:V(n))),n.isJQx&&!n.is.empty&&w(e,i=>n.collection.forEach(s=>i.append(r?s:V(s))))}}return e},appendTo:(e,t)=>(t.isJQx||(t=h(t)),t.append(e),e),attr:(e,t,r)=>{let n=e[0];if(!n)return e;if(!r&&a(t,String))return t=O(t),t==="class"?[...n?.classList].join(" "):n?.getAttribute(t);if(a(t,String)&&r)switch(t=O(t),!0){case t.startsWith("data-"):t={data:{[t.replace("data-","")]:r}};break;default:t={[t]:r}}return a(t,Object)&&!e.is.empty&&Qt(n,t),e},before:Pe,beforeMe:Pe,clear:e=>w(e,Ne),closest:(e,t)=>{let r=a(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,n=>Jt(n,t,r)),duplicate:(e,t=!1,r=document.body)=>{let n=e.toNodeList().map(s=>s.removeAttribute&&s.removeAttribute("id")||s),i=h.virtual(n);return t?i.toDOM(r):i},each:(e,t)=>w(e,t),empty:e=>w(e,Ne),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(n=>r.classList.contains(n))&&!0||!1},hide:e=>w(e,t=>he(t,{display:"none !important"})),html:(e,t,r)=>{if(t===void 0)return e[0]?.getHTML();if(!e.isEmpty()){let n=H(`<div>${t.isJQx?t.HTML.get(!0):t}</div>`);if(!a(n,Comment))return w(e,s=>(r||(s.textContent=""),s.insertAdjacentHTML(h.at.end,n.getHTML())))}return e},htmlFor:(e,t,r="",n=!1)=>{if(t&&e.collection.length){if(!t||!a(r,String))return e;let i=e.find$(t);if(i.length<1)return e;let s=H(`<span>${r}</span>`);i.each(p=>{n||(p.textContent=""),p.insertAdjacentHTML(h.at.end,s.getHTML())})}return e},isEmpty:e=>e.collection.length<1,nth$:(e,t)=>e.single(t),on:(e,t,...r)=>(e.collection.length&&r?.forEach(n=>{let i=Je(e);h.delegate(t,i,n)}),e),prepend:(e,...t)=>{if(!e.is.empty&&t){let r=e.length===1;for(let n of t){if(a(n,String)){n=n.trim();let s=!/^<(.+)[^>]+>$/m.test(n)?h.text(n):H(n);s=r?s:V(s),w(e,p=>p.prepend(s.cloneNode(!0)))}re(n)&&w(e,i=>i.prepend(r?n:V(n))),n.isJQx&&!n.is.empty&&(n.collection.length>1&&n.collection.reverse(),w(e,i=>w(n,s=>i.prepend(r?s:V(s)))),n.collection.reverse())}}return e},prependTo:(e,t)=>(t.isJQx||(t=h.virtual(t)),t.prepend(e),e),prop:(e,t,r)=>{if(a(t,String)&&!r)return t.startsWith("data")?e[0]?.dataset[t.slice(t.indexOf("-")+1)]:e[0]?.[t];let n=a(t,Object)?t:{[t]:r};return Object.entries(n).forEach(([i,s])=>{if(i=i.trim(),s&&!Be(i)||!s)return!1;if(i.toLowerCase()==="id")return e[0].id=s;w(e,v=>{if(i.startsWith("data"))return v.dataset[i.slice(i.indexOf("-")+1)]=s;v[i]=s})}),e},remove:(e,t)=>{N(`remove ${j(e.HTML.get(1),40)}${t?` /w selector ${t}`:""}`);let r=i=>i.remove(),n=()=>e.collection=e.collection.filter(i=>document.documentElement.contains(i));if(t){let i=e.find$(t);return i.is.empty||(w(i,r),n()),e}return w(e,r),n(),e},rmAttr:(e,...t)=>(t.forEach(r=>e.node.removeAttribute(r)),e),removeClass:(e,...t)=>w(e,r=>r&&t.forEach(n=>r.classList.remove(n))),renderTo:(e,t=document.body,r=h.insertPositions.end)=>(e.toDOM(t,r),e),replace:(e,t,r)=>{let n=e[0];return!t||!r||!a(r,HTMLElement)&&!r.isJQx?(console.error("JQx replace: invalid replacement value"),e):(r.isJQx&&(r=r[0]),a(r,NodeList)&&(r=r[0]),n&&t&&(t=a(t,String)?n.querySelectorAll(t):t.isJQx?t.collection:t,a(t,HTMLElement,NodeList,Array)&&a(r,HTMLElement)&&(a(t,HTMLElement)?[t]:[...t]).forEach(i=>i.replaceWith(r.cloneNode(!0)))),e)},replaceClass:(e,t,...r)=>w(e,n=>{n.classList.remove(t),r.forEach(i=>n.classList.add(i))}),replaceMe:(e,t)=>e.replaceWith(t),replaceWith:(e,t)=>(t=a(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=>Re(r,t)),show:e=>w(e,t=>he(t,{display:"revert-layer !important"})),single:(e,t)=>e.collection.length>0?a(t,String)?e.find$(t):a(t,Number)?h(e.collection[t]):h(e.collection[0]):e,style:(e,t,r)=>w(e,i=>{r&&a(t,String)&&(t={[t]:r||"none"}),he(i,t)}),text:(e,t,r=!1)=>e.isEmpty()?e:a(t,String)?w(e,i=>i.textContent=r?i.textContent+t:t):e.first().textContent,toDOM:(e,t=document.body,r=F.BeforeEnd)=>(e.isVirtual&&(e.isVirtual=!1),e.collection=U(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,n={})=>{if(e.collection.length){let i=new r(t,{...n,bubbles:n.bubbles??!0});for(let s of e.collection)s.dispatchEvent(i)}return e},val:(e,t)=>{let r=e[0];return!r||!a(r,HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement)?e:t===void 0?r.value:(r.value=a(t,String)?t:"",e)}}};function Qe(e){if(!e("#jqxPopup").isEmpty())return;e.dialog({id:"jqxPopup"},e.div({id:"jqxPopupContent"})).render,e.editCssRules(...we);let[t,r]=[e("#jqxPopupContent"),e.node("#jqxPopup")],n={};return["click","keydown"].forEach(d=>document.addEventListener(d,x,!0)),Object.freeze({show:i,removeModal:L});function i(d){if(r.open)return;n={...d};let{content:g}=n;return e.IS(g,String,HTMLElement)||g?.isJQx?p():!0}function s(){return n.modal?T(n.warnMessage):v()}function p(){t.clear();let{content:d,modal:g,closeAfter:m}=n;g=e.IS(g,Boolean)?g:!1;let y=g?"":e.div({id:"closeHandleIcon"});t.append(y,e.IS(d,String)?e.div(d):d),r.showModal(),!g&&e.IS(m,Number)&&E(s,m)}function v(){return r.close(n.returnValue),e.IS(n.callback,Function)?n.callback(n.returnValue):!0}function L({callback:d,value:g}={}){n.returnValue=g,n.modal=!1,n.callback=d||n.callback,s()}function x(d){n.activeTimer&&clearTimeout(n.activeTimer);let g=d.key==="Escape";return g&&d.preventDefault(),(g||d.target.closest("#closeHandleIcon")||d.type!=="keydown"&&!d.target.closest("#jqxPopupContent"))&&s(),document.activeElement.blur()}function E(d,g){e.IS(d,Function)&&e.IS(g,Number)&&g>0&&(n.activeTimer=setTimeout(d,g*1e3))}function T(d){if(!e.IS(d,String,HTMLElement,Proxy))return;let g=t.find$(".warn");switch(!0){case g.is.empty:g=e.div({class:"warn"},d);default:t.append(g.addClass("active")),E(()=>t.find$(".warn").removeClass("active"),2)}}}var k={},zt=["load","unload","scroll","focus","blur","DOMNodeRemovedFromDocument","DOMNodeInsertedIntoDocument","loadstart","progress","error","abort","load","loadend","pointerenter","pointerleave","readystatechange"],_t=e=>!!zt.find(t=>t===e),We=()=>{let e=n=>k[n.type].forEach(i=>i(n)),t=(n,i)=>s=>{let p=s.target?.closest?.(n);return p&&i(s,h(p))},r=(n,i)=>{k[n]||addEventListener(n,e,_t(n))};return(n,i,s,p=!1)=>{r(n,p);let v=i?t(i,s):s;k=k[n]?{...k,[n]:k[n].concat(v)}:{...k,[n]:[v]}}};var Ut={},{instanceMethods:qe,instanceGetters:ze,isCommentOrTextNode:ke,isNode:re,isHtmlString:Ue,isArrayOfHtmlElements:Ve,isArrayOfHtmlStrings:Ge,ElemArray2HtmlString:Ze,input2Collection:Xe,setCollectionFromCssSelector:Ye,addHandlerId:Je,cssRuleEdit:ve,addFn:Vt,elems4Docs:fn}=Gt();function Gt(){let e=K({createWithId:"JQxStylesheet"}),t=(f,b)=>r[f]=(C,...o)=>b(C,...o),r=Se.instanceExtensions,n=Se.factoryExtensions,i=f=>a(f,Comment,Text),s=f=>a(f,Text,HTMLElement,Comment),p=f=>a(f,Comment),v=f=>a(f,Text),L=f=>a(f,String)&&/^<|>$/.test(`${f}`.trim()),x=f=>a(f,Array)&&!f?.find(b=>!L(b)),E=f=>a(f,Array)&&!f?.find(b=>!s(b)),T=f=>f?.filter(b=>b).reduce((b,C)=>b.concat(p(C)?`<!--${C.data}-->`:i(C)?C.textContent:C.outerHTML),""),d=f=>f?a(f,Proxy)?[f.EL]:a(f,NodeList)?[...f]:s(f)?[f]:E(f)?f:f.isJQx?f.collection:void 0:[],g=(f,b,C)=>{let o=b!==document.body&&a(f,String)&&f.toLowerCase()!=="body"?b:document,l;try{C.collection=[...o.querySelectorAll(f)]}catch{l=`Invalid CSS querySelector. [${a(f,String)?f:"Nothing valid given!"}]`}return l??`CSS querySelector "${f}", output ${C.collection.length} element(s)`},m=f=>{let b=f.data.get("hid")||`HID${z()}`;return f.data.add({hid:b}),`[data-hid="${b}"]`},y=Object.entries(M.tagsRaw).filter(([,f])=>f).map(([f])=>f).sort((f,b)=>f.localeCompare(b));return{instanceMethods:r,instanceGetters:n,isCommentOrTextNode:i,isNode:s,isComment:p,isText:v,isHtmlString:L,isArrayOfHtmlElements:E,isArrayOfHtmlStrings:x,ElemArray2HtmlString:T,input2Collection:d,setCollectionFromCssSelector:g,addHandlerId:m,cssRuleEdit:e,addFn:t,elems4Docs:y}}function G(e){return new Proxy(e,{get:(t,r)=>Yt(t,r,e)})}function Zt(e,t){return(...r)=>a(e,Function)&&e(G(t),...r)}function Xt(e,t){return(...r)=>a(e,Function)&&e(G(t),...r)}function Yt(e,t,r){switch(!0){case a(t,Symbol):return e;case a(+t,Number):return e.collection?.[t]||`ELEMENT WITH INDEX ${t} NOT FOUND`;case t in ze:return Xt(ze[t],r)();case t in qe:return Zt(qe[t],r);default:return e[t]}}function Ke(e){let t=ir(e);return Object.entries(Object.getOwnPropertyDescriptors(t)).forEach(([r,n])=>{Object.defineProperty(e,r,n),Object.defineProperty(Ut,r,n)}),e}function Kt(e){return{allow:t=>{let r=/-/.test(t),n=r&&t;t=r?ee(t):t.toLowerCase(),M.allowTag(t),a(e[t],Function)||Object.defineProperties(e,Ee(t,!0,e,n))},prohibit:t=>{t=t.toLowerCase(),M.prohibitTag(t),a(e[t],Function)&&Object.defineProperties(e,Ee(t,!1,e))}}}function _e(...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 er(e){return function(t,r,...n){return a(r,Function)&&(n.push(r),r=void 0),n.forEach(i=>e(t,r,i))}}function tr(e){return function(t,r,n){r=r?.isJQx?r?.[0]:r,n=n&&Object.values(F).find(s=>n===s)?n:void 0;let i=e(t,document.createElement("br"));return r&&!a(r,HTMLBRElement)&&i.collection.forEach(s=>n?r.insertAdjacentElement(n,s):r.append(s)),i}}function rr(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.entries(n).forEach(([i,s])=>!(i in t)&&Object.defineProperty(t,i,s))}return t}function nr(e){console.error(`JQx: "${e}" not allowed, not rendered`)}function or(e,t,r,n){return e=O(n||e.toLowerCase()),{get(){return(...i)=>t?r.virtual(te(ge[e](...i))):nr(e)},enumerable:!1,configurable:!0}}function Ee(e,t,r,n){e=e.toLowerCase();let i=or(e,t,r,n);return n?{[n]:i,[ee(n)]:i}:{[e]:i,[e.toUpperCase()]:i}}function ir(e){return rr(Object.entries(M.tagsRaw).reduce(lr(e),{}),sr(e))}function lr(e){return function(t,[r,n]){return n&&Object.defineProperties(t,Ee(r,n,e)),t}}function sr(e){let t=(n,i)=>ve(n,i),r=Kt(e);return{debugLog:$,log:(...n)=>D("fromStatic",...n),insertPositions:F,get at(){return F},editCssRules:(...n)=>n.forEach(i=>ve(i)),editCssRule:t,get setStyle(){return t},delegate:er(We()),virtual:tr(e),get fn(){return Vt},allowTag:r.allow,prohibitTag:r.prohibit,get lenient(){return M.allowUnknownHtmlTags},get IS(){return a},get Popup(){return e.activePopup||Object.defineProperty(e,"activePopup",{value:Qe(e),enumerable:!1}),e.activePopup},popup:()=>e.Popup,createStyle:n=>K({createWithId:n||`jqx${z()}`}),editStylesheet:n=>K({createWithId:n||`jqx${z()}`}),removeCssRule:_e,removeCssRules:_e,text:(n,i=!1)=>i?e.comment(n):document.createTextNode(n),node:(n,i=document)=>i.querySelector(n,i),nodes:(n,i=document)=>[...i.querySelectorAll(n,i)]}}var h=Ke(ar());function ar(){return function(r,n,i=F.BeforeEnd){if(r?.isJQx)return r;let s=a(n,HTMLBRElement);n=(!s&&n&&n.isJQx?n[0]:n)||document.body,i=i&&Object.values(F).find(g=>i===g)?i:void 0;let p=Ue(r),v=!p&&Ge(r),L=v||p,x={collection:Xe(r)??[],isVirtual:s,isJQx:!0},E=Ve(x.collection),T=`input =&gt; ${v?`"${j(r.join(", "),70)}"`:!L&&E?`element collection [${j(x.collection.map(g=>`${a(g,Comment,Text)?"Comment|Text @":""} ${g?.outerHTML||g?.textContent}`).join(", "),70)}]`:`"${j(r,70)}"`}`;if(x.collection.length&&E)return N(T),s||x.collection.forEach(g=>{n.contains(g)||U([g],n,i)}),G(x);if(L){if([r].flat().forEach(g=>x.collection.push(H(g))),x.collection.length>0){let g=x.collection.filter(m=>m?.dataset?.jqxcreationerror);x.collection=x.collection.filter(m=>!m?.dataset?.jqxcreationerror),N(`${T}`),N(`*Created ${x.isVirtual?"VIRTUAL ":""}[${j(Ze(x.collection)||"sanitized: no elements remaining",70)}]`),g.length&&console.error(`JQx: illegal html, not rendered: "${g.reduce((m,y)=>m.concat(`${y.textContent}
15
+ `),"").trim()}"`),x.isVirtual||U(x.collection,n,i)}return G(x)}let d=Ye(r,n,x);return N(`input => ${d}`),G(x)}}export{h as default};
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  <div align="center">
2
- <!-- bundlephobia is broken !<a href="https://bundlephobia.com/package/jqx-es@latest" rel="nofollow"
3
- ><img src="https://badgen.net/bundlephobia/min/jqx-es"></a> -->
2
+ <!-- bundlephobia is broken! ... and fixed. --><a href="https://bundlephobia.com/package/jqx-es@latest" rel="nofollow"
3
+ ><img src="https://badgen.net/bundlephobia/min/jqx-es"></a>
4
4
  <a target="_blank" href="https://www.npmjs.com/package/jqx-es"
5
5
  ><img src="https://img.shields.io/npm/v/jqx-es.svg?labelColor=cb3837&logo=npm&color=dcfdd9"></a>
6
6
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jqx-es",
3
- "version": "1.0.9",
3
+ "version": "1.1.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "The good parts of JQuery",
@@ -34,14 +34,11 @@ function getLogStyling() {
34
34
 
35
35
  function getPopupStyling() {
36
36
  return [
37
- ".popupContainer{position:fixed;inset:-5000px;opacity:0;height:0;width:0;background:rgba(0,0,0,0.1);transition:opacity 0.6s ease-in-out 0s;}",
38
- ".popupContainer.popup-active{opacity:1;inset:0;height:auto;width:auto;z-index:2147483646;}",
39
- ".popupContainer .content{box-shadow:rgba(0,0,0,0.5) 2px 2px 8px;border-radius:3px;min-width:125px;max-width:40vw;max-height:40vh;padding:8px;overflow:auto;background:#FFF;z-index:inherit;opacity:1;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);}",
40
- ".popupContainer .content .popup-warn{position:relative;padding:3px 8px 0 8px;color:red;margin:6px -8px -4px -8px;text-align:center;display:none;}",
41
- ".popupContainer .content.popup-warn-active .popup-warn{display:block;border-top:1px dashed rgb(0,0,0);}",
42
- `.closeHandleIcon{z-index:1;position:absolute;opacity:0;cursor:pointer;width:24px;height:24px;background:${svgImg} no-repeat;}`,
43
- ".closeHandleIcon.popup-active{opacity:1;z-index:2147483647;}",
44
- "@media screen and (width < 1200px){.popupContainer .content{max-width:75vw;}}",
45
- "@media screen and (width < 640px){.popupContainer .content{max-width:90vw;max-height:60vw;}}",
37
+ "::backdrop{background-color:grey;opacity:0.2;}",
38
+ "#jqxPopup{overflow:hidden;background-color:transparent;outline:none;border:none;inset:0;animation:fade-out 0.5s ease-out;&[open]{display:flex;align-items:center;justify-content:center;animation:fade-in 0.5s ease;}#jqxPopupContent{background-color:white;border:solid 1px #eee;box-shadow:1px 2px 8px #999;border-radius:4px;padding:12px;vertical-align:middle;max-height:40vh;max-width:50vw;overflow:auto;margin:0 auto;div:not(#closeHandleIcon){clear:both;}@media (width <= 640px){max-width:80vw;max-height:60vh;}#closeHandleIcon{cursor:pointer;width:24px;height:24px;display:inline;position:absolute;top:4px;right:4px;justify-content:right;background-image:url(\"data:image/svg+xml;utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20version%3D%221.1%22%20id%3D%22Layer_1%22%20x%3D%220px%22%20y%3D%220px%22%20viewBox%3D%220%200%20128%20128%22%20style%3D%22enable-background%3Anew%200%200%20128%20128%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Crect%20x%3D%22-368%22%20y%3D%226%22%20style%3D%22display%3Anone%3Bfill%3A%23E0E0E0%3B%22%20width%3D%22866%22%20height%3D%221018%22%2F%3E%3Ccircle%20style%3D%22fill%3A%23FFFFFF%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2248%22%2F%3E%3Ccircle%20style%3D%22fill%3A%238CCFB9%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2239%22%2F%3E%3Ccircle%20style%3D%22fill%3Anone%3Bstroke%3A%23444B54%3Bstroke-width%3A6%3Bstroke-miterlimit%3A10%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2248%22%2F%3E%3Cpolyline%20style%3D%22fill%3Anone%3Bstroke%3A%23FFFFFF%3Bstroke-width%3A6%3Bstroke-linecap%3Around%3Bstroke-miterlimit%3A10%3B%22%20points%3D%2242%2C69%2055.55%2C81%20%20%2086%2C46%20%22%2F%3E%3C%2Fsvg%3E\");@media (width <= 640px){background-image:none;position:relative;margin:-15px -15px 4px 0;float:right;vertical-align:middle;border:1px solid #AAA;padding:2px;border-radius:50%;width:12px;height:12px;font-size:12px;line-height:12px;font-weight:bold;text-align:center;&:after{content:'\\2714';color:green;}}}.warn{display:none;text-align:center;color:red;border-top:1px solid #999;margin-top:1em;padding-top:3px;animation:warn-fade-out 0.2s ease-out;}.warn.active{opacity:1;display:block;animation:warn-fade-in 0.2s ease-in;}}}",
39
+ "@keyframes fade-in{0%{opacity:0;transform:scale(0, 0);display:none;}100%{opacity:1;transform:scale(1, 1);display:flex;}}",
40
+ "@keyframes fade-out{0%{opacity:1;transform:scale(1, 1);display:flex;}100%{opacity:0;transform:scale(0, 0);display:none;}}",
41
+ "@keyframes warn-fade-in{0%{opacity:0;transform:scale(0, 0);display:none;}100%{opacity:1;transform:scale(1,1 );display:block;}}",
42
+ "@keyframes warn-fade-out{0%{opacity:1;transform:scale(1, 1);display:block;}100%{opacity:0;transform:scale(0, 0);display:none;}}"
46
43
  ];
47
44
  }
@@ -42,10 +42,10 @@ function smallHelpersFactory() {
42
42
  const setCollectionFromCssSelector = (input, root, self) => {
43
43
  const selectorRoot = root !== document.body && (IS(input, String) && input.toLowerCase() !== "body") ? root : document;
44
44
  let errorStr = undefined;
45
-
45
+
46
46
  try { self.collection = [...selectorRoot.querySelectorAll(input)]; }
47
47
  catch (err) { errorStr = `Invalid CSS querySelector. [${!IS(input, String) ? `Nothing valid given!` : input}]`; }
48
-
48
+
49
49
  return errorStr ?? `CSS querySelector "${input}", output ${self.collection.length} element(s)`;
50
50
  };
51
51
  const addHandlerId = instance => {
@@ -57,7 +57,7 @@ function smallHelpersFactory() {
57
57
  .filter( ([,cando]) => cando)
58
58
  .map( ([key,]) => key)
59
59
  .sort( (a, b) => a.localeCompare(b));
60
-
60
+
61
61
  return {
62
62
  instanceMethods, instanceGetters,isCommentOrTextNode, isNode, isComment, isText,
63
63
  isHtmlString, isArrayOfHtmlElements, isArrayOfHtmlStrings, ElemArray2HtmlString,
@@ -103,7 +103,7 @@ function allowances(jqx) {
103
103
  const webComponentTagName = isWebComponent && tagName;
104
104
  tagName = isWebComponent ? toCamelcase(tagName) : tagName.toLowerCase();
105
105
  tagLib.allowTag(tagName);
106
-
106
+
107
107
  if (!IS(jqx[tagName], Function)) {
108
108
  Object.defineProperties( jqx, addGetters(tagName, true, jqx, webComponentTagName) );
109
109
  }
@@ -111,7 +111,7 @@ function allowances(jqx) {
111
111
  prohibit: tagName => {
112
112
  tagName = tagName.toLowerCase();
113
113
  tagLib.prohibitTag(tagName);
114
-
114
+
115
115
  if (IS(jqx[tagName], Function)) {
116
116
  Object.defineProperties( jqx, addGetters(tagName, false, jqx) );
117
117
  }
@@ -136,7 +136,7 @@ function delegateFactory(handle) {
136
136
  handlers.push(origin);
137
137
  origin = undefined;
138
138
  }
139
-
139
+
140
140
  return handlers.forEach(handler => handle(type, origin, handler));
141
141
  }
142
142
  }
@@ -156,13 +156,13 @@ function virtualFactory(jqx) {
156
156
 
157
157
  function combineObjectSources(...sources) {
158
158
  const result = {};
159
-
159
+
160
160
  for (const source of sources) {
161
161
  const descriptors = Object.getOwnPropertyDescriptors(source);
162
162
  Object.entries(descriptors).forEach( ([key, descriptor]) =>
163
163
  !(key in result) && Object.defineProperty(result, key, descriptor) );
164
164
  }
165
-
165
+
166
166
  return result;
167
167
  }
168
168
 
@@ -173,7 +173,7 @@ function tagNotAllowed(tagName) {
173
173
 
174
174
  function tagGetterFactory(tagName, cando, jqx, webComponentTagName) {
175
175
  tagName = toDashedNotation(webComponentTagName || tagName.toLowerCase());
176
-
176
+
177
177
  return {
178
178
  get() {
179
179
  return (...args) => {
@@ -189,7 +189,7 @@ function tagGetterFactory(tagName, cando, jqx, webComponentTagName) {
189
189
  function addGetters(tag, cando, jqx, webComponentTagName) {
190
190
  tag = tag.toLowerCase();
191
191
  const jqxGetterForThisTag = tagGetterFactory(tag, cando, jqx, webComponentTagName);
192
-
192
+
193
193
  return webComponentTagName
194
194
  ? { [webComponentTagName]: jqxGetterForThisTag, [toCamelcase(webComponentTagName)]: jqxGetterForThisTag, }
195
195
  : { [tag]: jqxGetterForThisTag, [tag.toUpperCase()]: jqxGetterForThisTag, };
package/src/Popup.js CHANGED
@@ -1,89 +1,71 @@
1
- import { popupStyling } from "./EmbedResources.js";
2
- import { randomString } from "./Utilities.js";
1
+ import { popupStyling as styleRules } from "./EmbedResources.js";
3
2
 
4
- export default newPopupFactory;
3
+ export default function($) {
4
+ if (!$(`#jqxPopup`).isEmpty()) { return; }
5
5
 
6
- function newPopupFactory($) {
7
- const editRule = $.createStyle(`JQxPopupCSS`);
8
- popupStyling.forEach( rule => editRule(rule) );
9
- let callbackOnClose = {};
10
- let isModal, modalWarning, timeout;
11
- const warnTemplate = $.virtual(`<div class="popup-warn">`);
12
- const popupContainer = $(`<div class="popupContainer">`)
13
- .append( $(`<span class="closeHandleIcon">`) )
14
- .append( $(`<div class="content">`) );
15
- const [closer, txtBox] = [$(`.popupContainer > .closeHandleIcon`), $( `.popupContainer > .content` )];
16
- const positionCloser = () => {
17
- if ( closer.hasClass(`popup-active`) ) {
18
- const {x, y, width} = txtBox.dimensions;
19
- closer.style({top: `${y - 12}px`, left: `${x + width - 12}px`});
20
- } };
21
- const warn = () => {
22
- modalWarning && $(`.popup-warn`).clear().append($(`<div>${modalWarning}</div>`));
23
- txtBox.addClass(`popup-warn-active`); };
24
- const removeModal = () => { isModal = false; remove(closer.first()); };
25
- const timed = (seconds, callback) => timeout = setTimeout( () => remove(closer[0]), +seconds * 1000 );
26
- $.delegate(`click`, `.popupContainer, .closeHandleIcon`, evt => remove(evt.target));
27
- $.delegate(`click`, `.popupContainer .content`, (_, self) => isModal && self.removeClass(`popup-warn-active`));
28
- $.delegate(`resize`, positionCloser);
6
+ $.dialog({id: `jqxPopup`}, $.div({ id: "jqxPopupContent" })).render;
7
+ $.editCssRules(...styleRules);
8
+ const [popupContent, popupNode] = [$(`#jqxPopupContent`), $.node(`#jqxPopup`)];
9
+ let currentProps = {};
10
+ [`click`, `keydown`].forEach(evtType =>
11
+ document.addEventListener(evtType, genericPopupCloseHandler, true));
12
+ return Object.freeze({show: initPopup, removeModal});
29
13
 
30
- return {
31
- show: createAndShowPupup,
32
- create: (message, isModalOrCallback, modalCallback, modalWarning) => { /*legacy*/
33
- const isModal = $.IS(isModalOrCallback, Boolean) ? isModalOrCallback : false;
34
- createAndShowPupup({
35
- content: message, modal: isModal,
36
- callback: isModal ? modalCallback : isModalOrCallback, warnMessage: modalWarning, }); },
37
- createTimed: (message, closeAfter, callback) => /*legacy*/
38
- createAndShowPupup({content: message, closeAfter, callback}),
39
- removeModal,
40
- };
41
-
42
- function createAndShowPupup( { content, modal, closeAfter, callback, warnMessage } ) {
43
- if (content) {
44
- content = $.IS(content, Node) ? jqx(content) : content;
45
- clearTimeout(timeout);
46
- isModal = modal ?? false;
47
- modalWarning = $.IS(warnMessage, String) && `${warnMessage?.trim()}`.length || warnMessage?.isJQx
48
- ? warnMessage : undefined;
49
- txtBox.clear().append(content.isJQx ? content : $(`<div>${content}</div>`));
50
- isModal && warnMessage && txtBox.append(warnTemplate.duplicate());
51
- popupContainer.addClass(`popup-active`);
52
-
53
- if ($.IS(callback, Function)) {
54
- const tmpId = randomString();
55
- popupContainer.data.set( {callbackId: tmpId} );
56
- callbackOnClose[tmpId] = callback;
57
- }
14
+ function initPopup(props) {
15
+ if (popupNode.open) { return; }
16
+ currentProps = {...props};
17
+ let {content} = currentProps;
18
+ return !($.IS(content, String, HTMLElement) || content?.isJQx) ? true : showPopup();
19
+ }
20
+
21
+ function initHidePopup() {
22
+ return currentProps.modal ? failModalClose(currentProps.warnMessage) : hidePopup();
23
+ }
24
+
25
+ function showPopup() {
26
+ popupContent.clear();
27
+ let {content, modal, closeAfter} = currentProps;
28
+ modal = $.IS(modal, Boolean) ? modal : false;
29
+ const closerIcon = modal ? "" : $.div({ id: "closeHandleIcon"});
30
+ popupContent.append(closerIcon, $.IS(content, String) ? $.div(content) : content);
31
+ popupNode.showModal();
32
+ if (!modal && $.IS(closeAfter, Number)) { createTimer(initHidePopup, closeAfter); }
33
+ }
58
34
 
59
- if (!isModal) {
60
- if ($.IS(+closeAfter, Number)) {
61
- const callbackId = popupContainer.data.get(`callbackId`);
62
- const callback = callbackId && callbackOnClose[callbackId];
63
- timed(closeAfter, callback);
64
- }
65
- closer.addClass(`popup-active`);
66
- positionCloser();
67
- }
35
+ function hidePopup() {
36
+ popupNode.close(currentProps.returnValue);
37
+ return $.IS(currentProps.callback, Function) ? currentProps.callback(currentProps.returnValue) : true;
38
+ }
39
+
40
+ function removeModal({callback, value} = {}) {
41
+ currentProps.returnValue = value;
42
+ currentProps.modal = false;
43
+ currentProps.callback = callback || currentProps.callback;
44
+ initHidePopup();
45
+ }
46
+
47
+ function genericPopupCloseHandler(evt) {
48
+ currentProps.activeTimer && clearTimeout(currentProps.activeTimer);
49
+ const escPressed = evt.key === `Escape`;
50
+ escPressed && evt.preventDefault();
51
+ if (escPressed || evt.target.closest(`#closeHandleIcon`) ||
52
+ (evt.type !== `keydown` && !evt.target.closest(`#jqxPopupContent`))) { initHidePopup() }
53
+ return document.activeElement.blur();
54
+ }
68
55
 
69
- return true;
56
+ function createTimer(callback, seconds) {
57
+ if ($.IS(callback, Function) && $.IS(seconds, Number) && seconds > 0) {
58
+ currentProps.activeTimer = setTimeout(callback, seconds * 1000);
70
59
  }
71
- return console.error(`Popup creation needs at least some text to show`);
72
60
  }
73
61
 
74
- function remove(origin) {
75
- if (!isModal && !origin.closest(`.content`)) {
76
- clearTimeout(timeout);
77
- txtBox.clear();
78
- const callbackId = popupContainer.data.get(`callbackId`);
79
- popupContainer.data.remove(`callbackId`);
80
- $(`.popup-active`).removeClass(`popup-active`);
81
- const cb = callbackId && callbackOnClose[callbackId];
82
- if ($.IS(cb, Function)) { cb(); }
83
- if (callbackId) { delete callbackOnClose[callbackId]; }
84
- modalWarning = ``;
85
- return;
62
+ function failModalClose(warnMessage) {
63
+ if (!$.IS(warnMessage, String, HTMLElement, Proxy)) { return; }
64
+ let modalWarningBox = popupContent.find$(`.warn`);
65
+ switch(true) {
66
+ case modalWarningBox.is.empty: modalWarningBox = $.div({class: `warn`}, warnMessage);
67
+ default: popupContent.append(modalWarningBox.addClass(`active`));
68
+ createTimer(() => popupContent.find$(`.warn`).removeClass(`active`), 2);
86
69
  }
87
- return isModal && warn();
88
70
  }
89
71
  }