dynamic-html-helpers 1.5.9 → 1.6.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.
- package/Bundle/htmlhelpers.min.js +8 -8
- package/Bundle/htmlhelpers.min.js.map +3 -3
- package/Bundle/htmlhelpers.script.js +31 -90
- package/Bundle/htmlhelpers.script.js.map +3 -3
- package/Resource/Externals/jqx.min.js +3 -3
- package/Resource/Externals/jqx.min.js.map +3 -3
- package/index.js +2 -4
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var F=Symbol.for("toa.symbols");Object[F]=Object.create(null,{});var{IS:c,isOnly:Fr,maybe:R,$Wrap:Tr,isNothing:ft,addSymbolicExtensions:He,proxyWrapper:G}=dt({useSymbolicExtensions:!1});function dt(t={}){let{useSymbolicExtensions:e}=t,r=pt(),{shouldbeIsSingleObject:n,ISOneOf:o,isExcept:i,verifyNothingness:a,determineType:h,addSymbolicExtensions:p,maybe:E,$Wrap:f,detectableProxy:y}=mt(m,e),g=y;e&&p();let S=Object[F];return{IS:m,isOnly:u,maybe:E,$Wrap:f,isNothing:a,addSymbolicExtensions:p,proxyWrapper:g};function m(l,...s){let d=Object.getOwnPropertySymbols(l||{})?.some(w=>w===S.justME)&&s.length>0,b=l?.[S.justME],x=d?b:typeof l=="symbol"?S.isSymbol:l;switch(!0){case d:return r(b,...s);case!!E({trial:w=>"isTypes"in(s?.[0]??{})}):return n(l,s[0]);default:return s.length>1?o(x,...s):h(l,...s)}}function u(l,...s){return m({[S.justME]:l},...s)}}function mt(t,e){let{SymbolAndCustomProxyFactory:r,maybeFactory:n,WrapAnyFactory:o,verifyNothingness:i,determineType:a,detectableProxy:h}=gt(t,y),{addSymbolicExtensions:p}=r(t,y,e),[E,f]=[n(),o(t,y)];return Object.freeze({shouldbeIsSingleObject:g,ISOneOf:S,isExcept:u,verifyNothingness:i,determineType:a,detectableProxy:h,addSymbolicExtensions:p,maybe:E,$Wrap:f});function y(l){return l?.[Object[F].proxy]||t(l)}function g(l,s){switch(!0){case"defaultValue"in s:return m(l,s);case"notTypes"in s:return u(l,s);default:return t(l,...[s.isTypes].flat())}}function S(l,...s){return s.some(d=>t(l,d))}function m(l,{defaultValue:s,isTypes:d=[void 0],notTypes:b}={}){return d=d?.constructor!==Array?[d]:d,b=b&&b?.constructor!==Array?[b]:[],b.length<1?t(l,...d)?l:s:u(l,{isTypes:d,notTypes:b})?l:s}function u(l,{isTypes:s=[void 0],notTypes:d=[void 0]}={}){return s=s?.constructor!==Array?[s]:s,d=d?.constructor!==Array?[d]:d,t(l,...s)&&!t(l,...d)}}function gt(){let t=Object[F],e={IS:"toa.is",TYPE:"toa.type",IS_SYMBOL:"toa.isASymbol",PROXY:"toa.proxyFor",TARGET:"toa.target",JUSTME:"toa.justME"},r={NAN:"NaN",INFINITY:"Infinity",BOOLEAN:"Boolean",OBJECT:"Object",PROXY_PREFIX:"Proxy for"},n=o();return Object.freeze({SymbolAndCustomProxyFactory:a,maybeFactory:u,WrapAnyFactory:m,verifyNothingness:l,determineType:E,detectableProxy:n});function o(){let s=x=>({get(w,O){return O===Object[F].proxy?`Proxy for ${x}`:O===Object[F].target?w:Reflect.get(w,O)},has(w,O){return O===Object[F].proxy?!0:O in w}});function d(x){let w=x.name||x.constructor.name;return new Proxy(x,s(w))}function b(x,w){return w=c(w,Object)?w:{},d(new Proxy(x,w))}return{wrap:d,create:b}}function i(s,d){t.is||(t.is=Symbol(e.IS),t.type=Symbol(e.TYPE),Object.defineProperties(Object.prototype,{[t.type]:{get(){return d(this)},enumerable:!1,configurable:!0},[t.is]:{value:function(...b){return s(this,...b)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[t.type]:{value(b){return d(b)},enumerable:!1,configurable:!1},[t.is]:{value:function(b,...x){return s(b,...x)},enumerable:!1,configurable:!1}}))}function a(s,d,b){return t.isSymbol||(t.isSymbol=Symbol(e.IS_SYMBOL),t.proxy=Symbol(e.PROXY),t.target=Symbol(e.TARGET),t.justME=Symbol(e.JUSTME)),{addSymbolicExtensions:()=>i(s,d)}}function h(s){return(ft(s,!0)?{name:"unknown"}:Object.getPrototypeOf(s)?.constructor).name}function p(s,...d){let b=d.length<1,x=s==null;return{noInput:x,noShouldbe:b,compareTo:!b&&d[0],inputCTOR:!x&&(s?.constructor||Object.getPrototypeOf(s)?.constructor),isNaN:Number.isNaN(s)||R({trial:w=>String(s)===r.NAN}),isInfinity:R({trial:w=>String(s)})===r.INFINITY,shouldBeFirstElementIsNothing:!b&&l(d[0])}}function E(s,...d){let{noInput:b,noShouldbe:x,compareTo:w,inputCTOR:O,isNaN:ct,isInfinity:lt,shouldBeFirstElementIsNothing:ut}=p(s,...d);switch(d=d.length&&d[0],!0){case ut:return String(s)===String(w);case(s?.[Object[F].proxy]&&x):return s[Object[F].proxy];case(s?.[Object[F].proxy]&&typeof d=="string"):return s[Object[F].proxy].toLowerCase()===d.toLowerCase();case ct:return x?r.NAN:String(w)===String(s);case lt:return x?r.INFINITY:String(w)===String(s);case b:return x?String(s):String(w)===String(s);case O===Boolean:return x?r.BOOLEAN:O===d;default:return y(s,d,x,f(s,O))}}function f(s,d){switch(!0){case s===0:return Number;case s==="":return String;case!s:return{name:String(s)};default:return d}}function y(s,d,b,x){switch(!0){case(!b&&d===s||s?.[Object[F].proxy]&&d===Proxy):return!0;case String(d)===r.NAN:return String(s)===r.NAN;case(s?.[Symbol.toStringTag]&&typeof d=="string"):return String(d)===s[Symbol.toStringTag];default:return d?S(s,d,x):g(s,x)}}function g(s,d){return(s?.[Symbol.toStringTag]??s?.prototype?.[Symbol.toStringTag])||d?.name||String(d)}function S(s,d,b){return R({trial:x=>s instanceof d})||d===b||d===Object.getPrototypeOf(b)||`${d?.name}`===b?.name}function m(s,d){return function(b){let x={get value(){return b},is(...w){return s(b,...w)},get type(){return d(b)}};return Object[Object[F].type]&&Object.defineProperties(x,{[Object[F].type]:{get(){return d(b)}},[Object[F].is]:{value(...w){return s(b,...w)}}}),Object.freeze(x)}}function u(){let s=d=>{};return function({trial:d,whenError:b=s}={}){try{return d()}catch(x){return b(x)}}}function l(s,d=!1){let b=s==null;return b=d?b||c(s,1/0)||c(s,NaN):b,b}}function pt(){let t=new Intl.Collator("en",{sensitivity:"base"}),e=o=>typeof o?.constructor=="function"?o?.name||o?.constructor?.name:typeof o=="string"?o:typeof o,r=o=>[null,void 0,1/0,NaN].some(i=>i===o);function n(o,i){if(i!==o&&(r(o)||i===Number&&(Number.isNaN(o)||!Number.isFinite(o))))return!1;let[a,h]=[e(o),e(i)];return o?.[Object[F].proxy]===i||i===o?.name||t.compare(a,h)===0||t.compare(o.constructor?.name,i?.name)===0||o.constructor?.name===i||a===i||t.compare(Object.prototype.toString.call(o),`[object ${h}]`)===0}return function(i,...a){if(Array.isArray(a)&&a.length>1){for(let h of a)if(n(i,h))return!0;return!1}return n(i,a?.[0])}}var Me=ht(),J=yt(),k=bt();function yt(){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 bt(){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 ht(){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 Q=xt(),St=Lt(),Pe={html:"innerHTML",text:"textContent",class:"className"};function xt(){let t=new Intl.Collator("en",{sensitivity:"base"}),e=o=>typeof o?.constructor=="function"?o?.name||o?.constructor?.name:typeof o=="string"?o:typeof o,r=o=>[null,void 0,1/0,NaN].some(i=>i===o);function n(o,i){switch(!0){case(i!==o&&(r(o)||i===Number&&(Number.isNaN(o)||!Number.isFinite(o)))):return!1;default:let[a,h]=[e(o),e(i)];return o?.[Symbol.proxy]===i||i===o?.name||t.compare(a,h)===0||t.compare(o.constructor?.name,i?.name)===0||o.constructor?.name===i||a===i||t.compare(Object.prototype.toString.call(o),`[object ${h}]`)===0}}return function(i,...a){if(Array.isArray(a)&&a.length>1){for(let h of a)if(n(i,h))return!0;return!1}return n(i,a?.[0])}}function Et([t,...e]){return`${t.toUpperCase()}${e.join("")}`}function wt(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`).replace(/^-|-$/,"")}function vt(t){return Q(t,String)?t.toLowerCase().split("-").map((e,r)=>r&&`${Et(e)}`||e).join(""):t}function Lt(){let t=e=>{};return function({trial:e,whenError:r=t}={}){try{return e()}catch(n){return r(n)}}}function At(t){return Object.fromEntries(Object.entries(Object.getOwnPropertyDescriptors(t)))}function Ft(t){if(Object.keys(t).length<1)return{assignable:{},specials:[...Array(3)]};let e=Tt(t);return Object.keys(t).forEach(r=>{let n=r.toLowerCase();n in Pe&&(t[Pe[n]]=t[r])&&delete t[r]}),{assignable:t,specials:e}}function Tt(t){if(t=Q(t,Object)&&t||void 0,!t)return Array(3);let e=Object.entries(t.data??{}),r=Object.entries(t.attributes??{}),n=t.class?.split(/[ ,]/).map(o=>o.trim()).filter(o=>o.length>1);return delete t.data,delete t.attributes,delete t.class,[e,r,n]}function $t(t){return t?.constructor===Comment?t?.textContent:String(t)}function ye(t){return/comment/i.test(t)}function je(t,e){return!ye(e)&&Q(t,String)&&/<.*>|&[#|0-9a-z]+[^;];/i.test(t)}function Ot(t){return t=t.toLowerCase(),typeof t=="string"&&t.length>0&&/^[a-z]/.test(t)&&/^[a-z0-9-]+$/gi.test(t)}function Ct(t,e,r){return Ot(t)&&(t in e||!Q(r(t),HTMLUnknownElement))}var X=Object.create(null,{}),Z=Object.create(null,{}),Je=t=>{console.error(`tinyDOM error: "${t}" is not a valid HTML tag`)},z=Nt();function Nt(){return Object.seal(new Proxy(X,Qe()))}function Qe(){return{get(t,e){let r=String(e);switch(!0){case r in t:return t[r];case Ct(r,Z,K):return Re({tag:r,key:e});default:return Re({tag:r,key:e,isError:!0})}},set(t,e,r){return e==="setError"&&typeof r=="function"&&(Je=r),!0},enumerable:!1,configurable:!1}}function Re({tag:t,key:e,custom:r,debug:n=!1,isError:o=!1}={}){let i=At(X);if(o)return Object.defineProperty(i,t,{get(){return a=>Je(e)??""}}),De(i,t);if(t.includes("-")){let[a,h]=t.includes("-")?[t,vt(t)]:[wt(t),t];Z[a]=a,Z[h]=a,r=h}return r&&Object.defineProperty(i,r,{get(){return Ie(t)}}),Object.defineProperty(i,t,{get(){return Ie(t)}}),De(i,t)}function De(t,e){return X=Object.seal(new Proxy(t,Qe())),X[e]}function Ht(t,e,r){return e=e?.isJQx&&e.node||(Q(e,Number)?String(e):e),St({trial:n=>je(e)?t.insertAdjacentHTML("beforeend",e):t.append(e),whenError:n=>console.info(`${r} not created, reason
|
|
1
|
+
var F=Symbol.for("toa.symbols");Object[F]=Object.create(null,{});var{IS:c,isOnly:Fr,maybe:R,$Wrap:Tr,isNothing:ft,addSymbolicExtensions:He,proxyWrapper:G}=dt({useSymbolicExtensions:!1});function dt(t={}){let{useSymbolicExtensions:e}=t,r=pt(),{shouldbeIsSingleObject:n,ISOneOf:o,isExcept:i,verifyNothingness:a,determineType:h,addSymbolicExtensions:p,maybe:E,$Wrap:f,detectableProxy:y}=mt(m,e),g=y;e&&p();let S=Object[F];return{IS:m,isOnly:u,maybe:E,$Wrap:f,isNothing:a,addSymbolicExtensions:p,proxyWrapper:g};function m(l,...s){let d=Object.getOwnPropertySymbols(l||{})?.some(w=>w===S.justME)&&s.length>0,b=l?.[S.justME],x=d?b:typeof l=="symbol"?S.isSymbol:l;switch(!0){case d:return r(b,...s);case!!E({trial:w=>"isTypes"in(s?.[0]??{})}):return n(l,s[0]);default:return s.length>1?o(x,...s):h(l,...s)}}function u(l,...s){return m({[S.justME]:l},...s)}}function mt(t,e){let{SymbolAndCustomProxyFactory:r,maybeFactory:n,WrapAnyFactory:o,verifyNothingness:i,determineType:a,detectableProxy:h}=gt(t,y),{addSymbolicExtensions:p}=r(t,y,e),[E,f]=[n(),o(t,y)];return Object.freeze({shouldbeIsSingleObject:g,ISOneOf:S,isExcept:u,verifyNothingness:i,determineType:a,detectableProxy:h,addSymbolicExtensions:p,maybe:E,$Wrap:f});function y(l){return l?.[Object[F].proxy]||t(l)}function g(l,s){switch(!0){case"defaultValue"in s:return m(l,s);case"notTypes"in s:return u(l,s);default:return t(l,...[s.isTypes].flat())}}function S(l,...s){return s.some(d=>t(l,d))}function m(l,{defaultValue:s,isTypes:d=[void 0],notTypes:b}={}){return d=d?.constructor!==Array?[d]:d,b=b&&b?.constructor!==Array?[b]:[],b.length<1?t(l,...d)?l:s:u(l,{isTypes:d,notTypes:b})?l:s}function u(l,{isTypes:s=[void 0],notTypes:d=[void 0]}={}){return s=s?.constructor!==Array?[s]:s,d=d?.constructor!==Array?[d]:d,t(l,...s)&&!t(l,...d)}}function gt(){let t=Object[F],e={IS:"toa.is",TYPE:"toa.type",IS_SYMBOL:"toa.isASymbol",PROXY:"toa.proxyFor",TARGET:"toa.target",JUSTME:"toa.justME"},r={NAN:"NaN",INFINITY:"Infinity",BOOLEAN:"Boolean",OBJECT:"Object",PROXY_PREFIX:"Proxy for"},n=o();return Object.freeze({SymbolAndCustomProxyFactory:a,maybeFactory:u,WrapAnyFactory:m,verifyNothingness:l,determineType:E,detectableProxy:n});function o(){let s=x=>({get(w,O){return O===Object[F].proxy?`Proxy for ${x}`:O===Object[F].target?w:Reflect.get(w,O)},has(w,O){return O===Object[F].proxy?!0:O in w}});function d(x){let w=x.name||x.constructor.name;return new Proxy(x,s(w))}function b(x,w){return w=c(w,Object)?w:{},d(new Proxy(x,w))}return{wrap:d,create:b}}function i(s,d){t.is||(t.is=Symbol(e.IS),t.type=Symbol(e.TYPE),Object.defineProperties(Object.prototype,{[t.type]:{get(){return d(this)},enumerable:!1,configurable:!0},[t.is]:{value:function(...b){return s(this,...b)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[t.type]:{value(b){return d(b)},enumerable:!1,configurable:!1},[t.is]:{value:function(b,...x){return s(b,...x)},enumerable:!1,configurable:!1}}))}function a(s,d,b){return t.isSymbol||(t.isSymbol=Symbol(e.IS_SYMBOL),t.proxy=Symbol(e.PROXY),t.target=Symbol(e.TARGET),t.justME=Symbol(e.JUSTME)),{addSymbolicExtensions:()=>i(s,d)}}function h(s){return(ft(s,!0)?{name:"unknown"}:Object.getPrototypeOf(s)?.constructor).name}function p(s,...d){let b=d.length<1,x=s==null;return{noInput:x,noShouldbe:b,compareTo:!b&&d[0],inputCTOR:!x&&(s?.constructor||Object.getPrototypeOf(s)?.constructor),isNaN:Number.isNaN(s)||R({trial:w=>String(s)===r.NAN}),isInfinity:R({trial:w=>String(s)})===r.INFINITY,shouldBeFirstElementIsNothing:!b&&l(d[0])}}function E(s,...d){let{noInput:b,noShouldbe:x,compareTo:w,inputCTOR:O,isNaN:ct,isInfinity:lt,shouldBeFirstElementIsNothing:ut}=p(s,...d);switch(d=d.length&&d[0],!0){case ut:return String(s)===String(w);case(s?.[Object[F].proxy]&&x):return s[Object[F].proxy];case(s?.[Object[F].proxy]&&typeof d=="string"):return s[Object[F].proxy].toLowerCase()===d.toLowerCase();case ct:return x?r.NAN:String(w)===String(s);case lt:return x?r.INFINITY:String(w)===String(s);case b:return x?String(s):String(w)===String(s);case O===Boolean:return x?r.BOOLEAN:O===d;default:return y(s,d,x,f(s,O))}}function f(s,d){switch(!0){case s===0:return Number;case s==="":return String;case!s:return{name:String(s)};default:return d}}function y(s,d,b,x){switch(!0){case(!b&&d===s||s?.[Object[F].proxy]&&d===Proxy):return!0;case String(d)===r.NAN:return String(s)===r.NAN;case(s?.[Symbol.toStringTag]&&typeof d=="string"):return String(d)===s[Symbol.toStringTag];default:return d?S(s,d,x):g(s,x)}}function g(s,d){return(s?.[Symbol.toStringTag]??s?.prototype?.[Symbol.toStringTag])||d?.name||String(d)}function S(s,d,b){return R({trial:x=>s instanceof d})||d===b||d===Object.getPrototypeOf(b)||`${d?.name}`===b?.name}function m(s,d){return function(b){let x={get value(){return b},is(...w){return s(b,...w)},get type(){return d(b)}};return Object[Object[F].type]&&Object.defineProperties(x,{[Object[F].type]:{get(){return d(b)}},[Object[F].is]:{value(...w){return s(b,...w)}}}),Object.freeze(x)}}function u(){let s=d=>{};return function({trial:d,whenError:b=s}={}){try{return d()}catch(x){return b(x)}}}function l(s,d=!1){let b=s==null;return b=d?b||c(s,1/0)||c(s,NaN):b,b}}function pt(){let t=new Intl.Collator("en",{sensitivity:"base"}),e=o=>typeof o?.constructor=="function"?o?.name||o?.constructor?.name:typeof o=="string"?o:typeof o,r=o=>[null,void 0,1/0,NaN].some(i=>i===o);function n(o,i){if(i!==o&&(r(o)||i===Number&&(Number.isNaN(o)||!Number.isFinite(o))))return!1;let[a,h]=[e(o),e(i)];return o?.[Object[F].proxy]===i||i===o?.name||t.compare(a,h)===0||t.compare(o.constructor?.name,i?.name)===0||o.constructor?.name===i||a===i||t.compare(Object.prototype.toString.call(o),`[object ${h}]`)===0}return function(i,...a){if(Array.isArray(a)&&a.length>1){for(let h of a)if(n(i,h))return!0;return!1}return n(i,a?.[0])}}var Me=ht(),J=yt(),k=bt();function yt(){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 bt(){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 ht(){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 Q=xt(),St=Lt(),Pe={html:"innerHTML",text:"textContent",class:"className"};function xt(){let t=new Intl.Collator("en",{sensitivity:"base"}),e=o=>typeof o?.constructor=="function"?o?.name||o?.constructor?.name:typeof o=="string"?o:typeof o,r=o=>[null,void 0,1/0,NaN].some(i=>i===o);function n(o,i){if(!0===(i!==o&&(r(o)||i===Number&&(Number.isNaN(o)||!Number.isFinite(o)))))return!1;{let[a,h]=[e(o),e(i)];return o?.[Symbol.proxy]===i||i===o?.name||t.compare(a,h)===0||t.compare(o.constructor?.name,i?.name)===0||o.constructor?.name===i||a===i||t.compare(Object.prototype.toString.call(o),`[object ${h}]`)===0}}return function(i,...a){if(Array.isArray(a)&&a.length>1){for(let h of a)if(n(i,h))return!0;return!1}return n(i,a?.[0])}}function Et([t,...e]){return`${t.toUpperCase()}${e.join("")}`}function wt(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`).replace(/^-|-$/,"")}function vt(t){return Q(t,String)?t.toLowerCase().split("-").map((e,r)=>r&&`${Et(e)}`||e).join(""):t}function Lt(){let t=e=>{};return function({trial:e,whenError:r=t}={}){try{return e()}catch(n){return r(n)}}}function At(t){return Object.fromEntries(Object.entries(Object.getOwnPropertyDescriptors(t)))}function Ft(t){if(Object.keys(t).length<1)return{assignable:{},specials:[...Array(3)]};let e=Tt(t);return Object.keys(t).forEach(r=>{let n=r.toLowerCase();n in Pe&&(t[Pe[n]]=t[r])&&delete t[r]}),{assignable:t,specials:e}}function Tt(t){if(t=Q(t,Object)&&t||void 0,!t)return Array(3);let e=Object.entries(t.data??{}),r=Object.entries(t.attributes??{}),n=t.class?.split(/[ ,]/).map(o=>o.trim()).filter(o=>o.length>1);return delete t.data,delete t.attributes,delete t.class,[e,r,n]}function $t(t){return t?.constructor===Comment?t?.textContent:String(t)}function ye(t){return/comment/i.test(t)}function je(t,e){return!ye(e)&&Q(t,String)&&/<.*>|&[#|0-9a-z]+[^;];/i.test(t)}function Ot(t){return t=t.toLowerCase(),typeof t=="string"&&t.length>0&&/^[a-z]/.test(t)&&/^[a-z0-9-]+$/gi.test(t)}function Ct(t,e,r){return Ot(t)&&(t in e||!Q(r(t),HTMLUnknownElement))}var X=Object.create(null,{}),Z=Object.create(null,{}),Je=t=>{console.error(`tinyDOM error: "${t}" is not a valid HTML tag`)},z=Nt();function Nt(){return Object.seal(new Proxy(X,Qe()))}function Qe(){return{get(t,e){let r=String(e);switch(!0){case r in t:return t[r];case Ct(r,Z,K):return Re({tag:r,key:e});default:return Re({tag:r,key:e,isError:!0})}},set(t,e,r){return e==="setError"&&typeof r=="function"&&(Je=r),!0},enumerable:!1,configurable:!1}}function Re({tag:t,key:e,custom:r,debug:n=!1,isError:o=!1}={}){let i=At(X);if(o)return Object.defineProperty(i,t,{get(){return a=>Je(e)??""}}),De(i,t);if(t.includes("-")){let[a,h]=t.includes("-")?[t,vt(t)]:[wt(t),t];Z[a]=a,Z[h]=a,r=h}return r&&Object.defineProperty(i,r,{get(){return Ie(t)}}),Object.defineProperty(i,t,{get(){return Ie(t)}}),De(i,t)}function De(t,e){return X=Object.seal(new Proxy(t,Qe())),X[e]}function Ht(t,e,r){return e=e?.isJQx&&e.node||(Q(e,Number)?String(e):e),St({trial:n=>je(e)?t.insertAdjacentHTML("beforeend",e):t.append(e),whenError:n=>console.info(`${r} not created, reason
|
|
2
2
|
`,n)})}function Mt(t,e,...r){let n=Pt(e,t);return r?.forEach(o=>Ht(n,o,t)),n}function Pt(t,e){switch(t=ye(e)?$t(t):t?.isJQx?t.node:t,!0){case Q(t,String):return K(e,je(t,e)?{html:t}:{text:t});case t instanceof Node:return Rt(e,t);default:return K(e,t)}}function Rt(t,e){let r=K(t);return r.append(e),r}function Dt(t,e){let[r,n,o]=t;r?.length&&r.forEach(([i,a])=>e.dataset[i]=a),n?.length&&n.forEach(([i,a])=>e.setAttribute(i,a)),o?.forEach(i=>e.classList.add(i))}function K(t,e){e=e||{};let{assignable:r,specials:n}=Ft(e),o=Object.assign(ye(t)?new Comment:document.createElement(t),r);return Dt(n,o),o}function Ie(t){return t=Z[t]??t,(e,...r)=>Mt(t,e,...r)}var W=It;function It({styleSheet:t,createWithId:e}={}){let{tryParseAtOrNestedRules:r,ruleExists:n,checkParams:o,sheet:i,removeRules:a,consider:h,currentSheetID:p}=jt({styleSheet:t,createWithId:e});function E(m,u){if(m&&u.removeProperties){Object.keys(u.removeProperties).forEach(l=>m.style.removeProperty(ke(l)));return}Object.entries(u).forEach(([l,s])=>{l=ke(l.trim()),s=s.trim();let d;if(/!important/.test(s)&&(s=s.slice(0,s.indexOf("!important")).trim(),d="important"),!CSS.supports(l,s))return console.error(`StylingFactory ${p} error: '${l}' with value '${s}' not supported (yet)`);ze(()=>m.style.setProperty(l,s,d),`StylingFactory ${p} (setRule4Selector) failed`)})}function f(m,u,l=i){if(m=m?.trim?.(),!c(m,String)||!m.length||/[;,]$/g.test(m))return console.error(`StylingFactory ${p} (setRules): [${m||"[no selector given]"}] is not a valid selector`);if(u.removeRule)return a(m);let s=n(m,!0),d=s||l.cssRules[l.insertRule(`${m} {}`,l.cssRules.length||0)];return h(()=>E(d,u),m,s)}function y(m){let u=m.trim().split(/{/,2),l=u.shift().trim();if(!c(l,String)||!l?.trim()?.length)return console.error(`StylingFactory ${p} (doParse): no (valid) selector could be extracted from rule ${be(m)}`);let s=Ut(u.shift());return ze(()=>f(l,s),`StylingFactory ${p} (setRules) failed`)}function g(m){let u=r(m);return u.done?u.existing:y(m)}function S(m,u){return m.trim().startsWith("@media")?g(Jt(m,u)):f(m,u)}return function(m,u={}){return o(m,u)&&(Object.keys(u).length?S(m,u):g(m))}}function jt({styleSheet:t,createWithId:e}){let r="Note: The rule or some of its properties may not be supported by your browser (yet)",n=`for style#${e}`;t=e?o(e):t;function o(g){let S=document.querySelector(`#${g}`)?.sheet;if(S)return S;let m=Object.assign(document.createElement("style"),{id:g});return document.head.insertAdjacentElement("beforeend",m),m.sheet}function i(g){return console.error(`StylingFactory ${n} [rule: ${g}]
|
|
3
3
|
=> @charset, @namespace and @import are not supported here`),{done:!0}}function a(g,S){return[...t.rules].find(m=>S?We(m.selectorText||"",g):zt`${kt(g)}${[..."gim"]}`.test(m.cssText))}function h(g){return/^@charset|@import|namespace/i.test(g.trim())?i(g):g.match(/}/g)?.length>1?{existing:f(g,1),done:!0}:{done:!1}}function p(g){let S=[...t.cssRules].reduce((u,l,s)=>We(l.selectorText||"",g)&&u.concat(s)||u,[]),m=S.length;return S.forEach(u=>t.deleteRule(u)),m>0?console.info(`\u2714 Removed ${m} instance${m>1?"s":""} of selector ${g} from ${n.slice(4)}`):console.info(`\u2714 Remove rule: selector ${g} does not exist in ${n.slice(4)}`)}function E(g,S){return g&&c(g,String)&&g.trim().length>0&&c(S,Object)||(console.error(`StylingFactory ${n} called with invalid parameters`),!1)}function f(g){g=g.trim();let S=g.slice(0,g.indexOf("{")).trim(),m=!!a(S);try{return t.insertRule(`${g}`,t.cssRules.length),m}catch(u){return console.error(`StylingFactory ${n} (tryParse) ${u.name} Error:
|
|
4
4
|
${u.message}
|
|
@@ -10,8 +10,8 @@ ${r}`),m}}return{sheet:t,removeRules:p,tryParseAtOrNestedRules:h,ruleExists:a,ch
|
|
|
10
10
|
`)}function kt(t){return t.replace(/([*\[\]()-+{}.$?\\])/g,e=>`\\${e}`)}function zt(t,...e){let r=e.length&&Array.isArray(e.slice(-1))?e.pop().join(""):"";return new RegExp((e.length&&t.raw.reduce((n,o,i)=>n.concat(e[i-1]||"").concat(o),"")||t.raw.join("")).split(`
|
|
11
11
|
`).map(n=>n.replace(/\s|\/\/.*$/g,"").trim().replace(/(@s!)/g," ")).join(""),r)}function ke(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`).replace(/[^--]^-|-$/,"")}function ze(t,e){try{return t()}catch(r){console.error(`${e||"an error occured"}: ${r.message}`)}}function Wt(t){return t.replace(/\/\*.+?\*\//gm,"").replace(/[}{\r\n]/g,"").replace(/(data:.+?);/g,(e,r)=>`${r}\\3b`).split(";").map(e=>e.trim()).join(`;
|
|
12
12
|
`).replaceAll("\\3b",";").split(`
|
|
13
|
-
`)}function Bt(t){return t.reduce((e,r)=>{let[n,o]=[r.slice(0,r.indexOf(":")).trim(),r.slice(r.indexOf(":")+1).trim().replace(/;$|;.+(?=\/*).+\/$/,"")];return n&&o?{...e,[n]:o}:e},{})}function Ut(t){return Bt(Wt(t))}function We(t,e){return t?.replace("::",":")===e?.replace("::",":")}var he=!1,Vt={on:()=>he=!0,off:()=>he=!1},N={tagsRaw:k,allowUnknownHtmlTags:Vt,isAllowed(t){if(he)return!0;let e=c(t,String)?t.toLowerCase():t?.nodeName.toLowerCase()||"none";return e==="#text"||!!k[e]},allowTag:t=>k[t.toLowerCase()]=!0,prohibitTag:t=>k[t.toLowerCase()]=!1};var _t=!0,q={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};function Yt(t){if(_t&&Object.keys(t.removed).length){let e=Object.entries(t.removed).reduce((r,[n,o])=>[...r,`${M(n)} => ${o}`],[]).join("\\000A");L.error(`JQx: HTML creation error(s): ${e}`)}}function Gt(t){let e=t.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(e)&&!r.find(n=>n===e)||N.isAllowed(e)}function D(t){let e={rawHTML:t?.parentElement?.getHTML()??"no html",removed:{}};return c(t,HTMLElement)&&[...t.childNodes].forEach(r=>{if(r?.children?.length&&D(r),r?.attributes){let o=c(r,SVGElement)?J.svg:J.html;[...(r??{attributes:[]}).attributes].forEach(i=>{let a=i.name.trim().toLowerCase(),h=i.value.trim().toLowerCase().replace(q.whiteSpace,""),p=a==="href"?!q.validURL.test(h):q.notAllowedValues.test(h),E=a.startsWith("data")?!q.data.test(a):!!o[a];if(p||E){let f=ee(i.value||"none",60);f+=f.length===60?"...":"",e.removed[`${i.name}`]=`attribute/property/value not allowed, removed. Value: ${f}`,r.removeAttribute(i.name)}})}if(!(Gt(r)||r.constructor===CharacterData||r.constructor===Comment)){let o=(r?.outerHTML||r?.textContent).trim(),i=ee(o,60)??"EMPTY";i+=i.length===60?"...":"",e.removed[`<${r.nodeName?.toLowerCase()}>`]=`not allowed, not rendered. Value: ${i}`,r.remove()}}),Yt(e),t}function Xt(t){let e=document.createElement("div");return e.insertAdjacentHTML(T.end,t),e.childNodes.length?D(e):void 0}function Zt(t,e,r){switch(!0){case c(t,Comment):return e.insertAdjacentHTML(r,`<!--${t.data}-->`);case c(t,Text):return e.insertAdjacentText(r,t.data||t.textContent);default:return}}function I(t=[],e=document.body,r=T.BeforeEnd){return r=r||T.BeforeEnd,e=e?.isJQx?e.node:e||document.body,t.reduce((n,o)=>{let i=H(o)&&Kt(o,e,r);return i?[...n,i]:n},[])}function Kt(t,e=document.body,r=T.BeforeEnd){return r=r||T.BeforeEnd,e=e?.isJQx?e?.[0]:e,c(t,Comment,Text)?Zt(t,e,r):c(t,HTMLElement)?e.insertAdjacentElement(r,t):void 0}function C(t){if(c(t,Text,Comment))return t;let e=t?.trim(),r=e?.split(/<text>|<\/text>/i)??[];if(r?.length&&(r=r.length>1?r.filter(o=>o.length).shift():void 0),e.startsWith("<!--")&&e.endsWith("-->"))return document.createComment(t.replace(/<!--|-->$/g,""));if(r||c(e,String)&&!/^<(.+)[^>]+>/m.test(e))return document.createTextNode(r??e);let n=Xt(t);return n.childNodes.length<1?C(`<span data-jqxcreationerror="1">${te(t,60)}</span>`):n.children[0]}function re(t){if(t.node("#jqxPopup"))return;t.logger.log("JQx: [JQx].Popup first call. Dialog element created."),t.dialog({id:"jqxPopup"},t.div({id:"jqxPopupContent"})).render,t.editCssRules(...Me);let e=[],[r,n]=[t("#jqxPopupContent"),t.node("#jqxPopup")],o={};return t.handle({type:"click, cancel",handlers:g,name:"genericPopupCloseHandler",capture:!0,about:"A generic handler for JQx popups"}),Object.freeze({show:i,remove:a,removeModal:y});function i(u){if(n.open)
|
|
13
|
+
`)}function Bt(t){return t.reduce((e,r)=>{let[n,o]=[r.slice(0,r.indexOf(":")).trim(),r.slice(r.indexOf(":")+1).trim().replace(/;$|;.+(?=\/*).+\/$/,"")];return n&&o?{...e,[n]:o}:e},{})}function Ut(t){return Bt(Wt(t))}function We(t,e){return t?.replace("::",":")===e?.replace("::",":")}var he=!1,Vt={on:()=>he=!0,off:()=>he=!1},N={tagsRaw:k,allowUnknownHtmlTags:Vt,isAllowed(t){if(he)return!0;let e=c(t,String)?t.toLowerCase():t?.nodeName.toLowerCase()||"none";return e==="#text"||!!k[e]},allowTag:t=>k[t.toLowerCase()]=!0,prohibitTag:t=>k[t.toLowerCase()]=!1};var _t=!0,q={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};function Yt(t){if(_t&&Object.keys(t.removed).length){let e=Object.entries(t.removed).reduce((r,[n,o])=>[...r,`${M(n)} => ${o}`],[]).join("\\000A");L.error(`JQx: HTML creation error(s): ${e}`)}}function Gt(t){let e=t.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(e)&&!r.find(n=>n===e)||N.isAllowed(e)}function D(t){let e={rawHTML:t?.parentElement?.getHTML()??"no html",removed:{}};return c(t,HTMLElement)&&[...t.childNodes].forEach(r=>{if(r?.children?.length&&D(r),r?.attributes){let o=c(r,SVGElement)?J.svg:J.html;[...(r??{attributes:[]}).attributes].forEach(i=>{let a=i.name.trim().toLowerCase(),h=i.value.trim().toLowerCase().replace(q.whiteSpace,""),p=a==="href"?!q.validURL.test(h):q.notAllowedValues.test(h),E=a.startsWith("data")?!q.data.test(a):!!o[a];if(p||E){let f=ee(i.value||"none",60);f+=f.length===60?"...":"",e.removed[`${i.name}`]=`attribute/property/value not allowed, removed. Value: ${f}`,r.removeAttribute(i.name)}})}if(!(Gt(r)||r.constructor===CharacterData||r.constructor===Comment)){let o=(r?.outerHTML||r?.textContent).trim(),i=ee(o,60)??"EMPTY";i+=i.length===60?"...":"",e.removed[`<${r.nodeName?.toLowerCase()}>`]=`not allowed, not rendered. Value: ${i}`,r.remove()}}),Yt(e),t}function Xt(t){let e=document.createElement("div");return e.insertAdjacentHTML(T.end,t),e.childNodes.length?D(e):void 0}function Zt(t,e,r){switch(!0){case c(t,Comment):return e.insertAdjacentHTML(r,`<!--${t.data}-->`);case c(t,Text):return e.insertAdjacentText(r,t.data||t.textContent);default:return}}function I(t=[],e=document.body,r=T.BeforeEnd){return r=r||T.BeforeEnd,e=e?.isJQx?e.node:e||document.body,t.reduce((n,o)=>{let i=H(o)&&Kt(o,e,r);return i?[...n,i]:n},[])}function Kt(t,e=document.body,r=T.BeforeEnd){return r=r||T.BeforeEnd,e=e?.isJQx?e?.[0]:e,c(t,Comment,Text)?Zt(t,e,r):c(t,HTMLElement)?e.insertAdjacentElement(r,t):void 0}function C(t){if(c(t,Text,Comment))return t;let e=t?.trim(),r=e?.split(/<text>|<\/text>/i)??[];if(r?.length&&(r=r.length>1?r.filter(o=>o.length).shift():void 0),e.startsWith("<!--")&&e.endsWith("-->"))return document.createComment(t.replace(/<!--|-->$/g,""));if(r||c(e,String)&&!/^<(.+)[^>]+>/m.test(e))return document.createTextNode(r??e);let n=Xt(t);return n.childNodes.length<1?C(`<span data-jqxcreationerror="1">${te(t,60)}</span>`):n.children[0]}function re(t){if(t.node("#jqxPopup"))return;t.logger.log("JQx: [JQx].Popup first call. Dialog element created."),t.dialog({id:"jqxPopup"},t.div({id:"jqxPopupContent"})).render,t.editCssRules(...Me);let e=[],[r,n]=[t("#jqxPopupContent"),t.node("#jqxPopup")],o={};return t.handle({type:"click, cancel",handlers:g,name:"genericPopupCloseHandler",capture:!0,about:"A generic handler for JQx popups"}),Object.freeze({show:i,remove:a,removeModal:y});function i(u){if(n.open)return!0===h(u)?void 0:(a(),setTimeout(()=>i(u),200));o={...u};let{content:l}=o;return t.IS(l,String,HTMLElement)||l?.isJQx?p():!0}function a(){return o.modal?m(o.warnMessage):E()}function h(u){for(let[l,s]of Object.entries(o))if(s!==u[l])return!1;return!0}function p(){r.clear();let{content:u,modal:l,closeAfter:s}=o;l=t.IS(l,Boolean)?l:!1;let d=l?"":t.div({id:"closeHandleIcon"});r.append(d,t.IS(u,String)?t.div(u):u),n.showModal(),!l&&t.IS(s,Number)&&S(a,s)}function E(){if(n.close(o.returnValue),f(),t.IS(o.callback,Function))return e.push(setTimeout(()=>o.callback(o.returnValue),200));o={}}function f(){e.forEach(u=>clearTimeout(u)),e=[]}function y({callback:u,value:l}={}){o.returnValue=l,o.modal=!1,o.callback=u||o.callback,a()}function g({evt:u}){if(!(Object.keys(o).length<1||!n.open)&&(u.type==="cancel"&&o.modal&&u.preventDefault(),u.target.closest("#closeHandleIcon")||!u.target.closest("#jqxPopupContent")))return o.activeTimer&&clearTimeout(o.activeTimer),a()}function S(u,l){t.IS(u,Function)&&t.IS(l,Number)&&l>0&&(f(),e.push(setTimeout(u,l*1e3)))}function m(u){if(!t.IS(u,String,HTMLElement)&&!u.isJQx)return;let l=r.find$(".warn");switch(!0){case l.is.empty:l=t.div({class:"warn"},u);default:r.append(l.addClass("active")),S(()=>r.find$(".warn").removeClass("active"),2)}}}function ne(t){let e={},r="anonymous_";function n(f){if(f){let{handler:y,capture:g,type:S}=f;document.addEventListener(S,y,{capture:g})}}function o(f){if(f){let{type:y,handler:g,capture:S}=f;document.removeEventListener(y,g,{capture:S})}}function i(f,y,g,S){return function(m){if(!A(y))return f({evt:m});let u=m.target.closest(y);if(u){let l=t(u);f({self:l,me:l,evt:m}),g&&p(m.type,S)}return!0}}function a(f){return e[f]=e[f]||{},e[f]}function h(f,y){return Object.entries(a(f)).find(([g])=>g===y)}function p(f,y){let g=h(f,y);g&&(o(g[1]),delete e[f][y],delete oe[y],L.warn(`Removed listener [${y}] for event type [${f}].`))}function E(f){let{type:y,handler:g,name:S,capture:m,once:u,selector:l,node:s,about:d}=f;e[y]=e[y]||{};let b=Se(S||g.name),x=g;if(s instanceof HTMLElement){let w=s.dataset.hid||b;s.dataset.hid=w,l=`[data-hid=${w}]`}return!0===!e[y][b]?(L.log(`JQx: created listener for event type ${y}, with handler name ${b}`),e[y][b]={name:b,handler:i(g,l,u,b),capture:Be(y,m),once:!!u,type:y,initialHandler:x,selector:!!l&&l||!1,about:!!d&&d||!1,unListen(){p(y,b)}},e[y][b]):console.warn(`The listener [${b}] for [${y}] exists, it is not re-assigned.`)}return{remove(...f){return p(...f)},listen:function(f){let{type:y,handler:g}=f;if(!A(y)||!c(g,Function))return;let S=E(f);if(S)return n(S),{type:y,name:S.name,unListen(){p(y,S.name)}}},get ListenerStore(){return Object.freeze({...e})}}}He();var L=tr(),qt=["load","unload","scroll","focus","blur","DOMNodeRemovedFromDocument","DOMNodeInsertedIntoDocument","loadstart","progress","error","abort","load","loadend","pointerenter","pointerleave","readystatechange"],T=Object.freeze(new Proxy({start:"afterbegin",afterbegin:"afterbegin",end:"beforeend",beforeend:"beforeend",before:"beforebegin",beforebegin:"beforebegin",after:"afterend",afterend:"afterend"},{get(t,e){return t[String(e).toLowerCase()]??t[e]}})),er=[...Array(26)].map((t,e)=>String.fromCharCode(e+65)).concat([...Array(26)].map((t,e)=>String.fromCharCode(e+97))).concat([...Array(10)].map((t,e)=>`${e}`)),Ee=Object.freeze({get(t,e){return t[V(e)]||t[e]},enumerable:!1,configurable:!1}),oe={};function we(){let t=setTimeout(()=>{});for(;t>=0;)clearTimeout(t--)}function Se(t){return A(t)&&!/^handler|handlers$/gi.test(t.trim())?t.trim():Ue()}function ve(t){if(!0===(!!t.node&&!c(t,Text,Comment))){let r=t.node.dataset?Object.keys(t.node.dataset).map(i=>`[data-${i}]`):[],o=[t.attr("id")&&`#${t?.attr("id")}`||void 0,t.attr("class")&&t?.attr("class").split(" ").map(i=>`.${i}`).join(", ")||void 0,r.length>0&&r.join(", ")||void 0].filter(i=>!!i).join(", ")||[];return o.length?`(${o})`:""}else return""}function Ue(t){let e=`anonymous_${Math.random().toString(36).slice(2)}`;return oe[e]?Ue():(oe[e]=e,e)}function Be(t,e){return!!qt.find(r=>r===t)||!!e}function ae(t){return t.startsWith("data")||J.html.find(e=>t.toLowerCase()===e)}function ce(t){return t&&(t.textContent="")}function B(t,e=0,r=!0){return t=t?.parentElement,e+=t?t[r?"scrollTop":"scrollLeft"]:0,t?B(t,e,r):e}function A(t,e=1){return e=c(e,Number)&&e||1,c(t,String)&&t.length>=e}function ee(t,e=120){return te(t,e).replace(/</g,"<")}function te(t,e=120){return`${t}`.trim().slice(0,e).replace(/>\s+</g,"><").replace(/</g,"<").replace(/\s{2,}/g," ").replace(/\n/g,"\\n")+(t.length>e?" …":"").trim()}function M(t){if(!0===c(t,String)){let e=document.createElement("div");return e.append(t),e.innerHTML}else return t}function xe(t){return c(t,String)&&Object.assign(document.createElement("textarea"),{innerHTML:t}).textContent||t}function tr(){let[t,e]=[!1,!0],r=[],n={get on(){return t=!0,n},get off(){return t=!1,n},get disable(){return e=!0,n},get enable(){return e=!1,n},get backLog(){return r}};function o(){e=!0}function i(){e=!1}function a(...E){return r.unshift(...E.map(f=>`${se()} \u2A3B ${xe(f)}`)),console.error(r.slice(0,E.length).join(`
|
|
14
14
|
`)),n}function h(...E){return r.unshift(...E.map(f=>`${se()} \u26A0 ${xe(f)}`)),console.warn(r.slice(0,E.length).join(`
|
|
15
15
|
`)),n}function p(...E){let f=E.map(y=>`${se()} \u2714 ${xe(y)}`);switch(!e&&r.unshift(...f),t){case!0:console.log(f.join(`
|
|
16
|
-
`));default:return n}}return Object.defineProperties(n,{log:{value:p,enumerable:!1},error:{value:a,enumerable:!1},warn:{value:h,enumerable:!1}}),Object.freeze(n)}function se(){return(t=>`[${ie(t.getHours())}:${ie(t.getMinutes())}:${ie(t.getSeconds())}.${ie(t.getMilliseconds(),3)}]`)(new Date)}function Le(t,e){if(t)for(let[r,n]of Object.entries(e)){if(r=$(r),r.startsWith("data"))return le(t,n);c(n,String)&&ae(r)&&t.setAttribute(r,n.split(/[, ]/)?.join(" "))}}function le(t,e){if(t&&c(e,Object))for(let[r,n]of Object.entries(e))t.setAttribute(`data-${$(r)}`,n)}function ue(t){return t?t.EL?[t.EL]:c(t,NodeList)?[...t]:H(t)?[t]:Y(t)?t:t.isJQx?t.collection:void 0:[]}function j(t,e,r=!0,...n){if(t.is.empty)return L.log("[JQx instance].[before(Me) | after(Me) | andThen]: instance is empty."),t;if(n=n.map(i=>i.isJQx?i.node:c(i,String)?e(i).node??i:i),n.find(i=>!c(i,String,Element))){let i=r?"after":"before";return L.log(`[JQx instance].[${i}(Me)]: invalid/-sufficient input.`),t}return t.node[r?"after":"before"](...n),t}function H(t){return c(t,Text,HTMLElement,Comment)}function U(t,e){if(c(e,Object))for(let[r,n]of Object.entries(e)){let o;/!important/i.test(n)&&(n=n.slice(0,n.indexOf("!")).trim(),o="important"),t.style.setProperty($(r),n,o)}}function P(t){let e=t.cloneNode(!0);return e.removeAttribute&&e.removeAttribute("id"),t.isConnected?t.remove():t=null,e}function Ve(t){if(!c(t,HTMLElement))return;let e=t.style,r=getComputedStyle(t),n=!![e.visibility,r.visibility].includes("hidden"),o=!![e.display,r.display].includes("none"),i=!!t.hidden,a=parseInt(r.height)<1||parseInt(r.width)<1,h=t.offsetTop<0||t.offsetLeft+t.offsetWidth<0||t.offsetLeft>document.body.offsetWidth,p=+r.opacity==0||+(e.opacity||1)==0;return!(i||h||p||o||n||a)}function _e(t){return t?.isConnected?!![...document.querySelectorAll(":is(:read-write)")].find(e=>e===t):!1}function Ye(t){return t?.filter(e=>e).reduce((e,r)=>e.concat(Te(r)?`<!--${r.data}-->`:de(r)?r.textContent:r.outerHTML),"")}function ie(t,e=2){return`${t}`.padStart(e,"0")}function Ge(t,e=0){return[t,e]=[Math.floor(t),Math.ceil(e)],Math.floor([...crypto.getRandomValues(new Uint32Array(1))].shift()/2**32*(t-e+1)+e)}function fe(){return`_${rr(er).slice(0,8).join("")}`}function Ae(t){return t=c(t,String)&&/,/.test(t)?t.split(",").map(e=>e.trim().toLowerCase()).filter(e=>e.length>0):t,c(t,Array)?t:c(t,String)&&t?.trim().toLowerCase()||""}function Xe(t){return t?.isConnected?!![...document.querySelectorAll(":is(:modal)")].find(e=>e===t):!1}function Fe(t,e){switch(t=String(t).trim(),!0){case/^(0|false|f)$/i.test(t):return!1;case/^(1|true|t)$/i.test(t):return!0;default:return e}}function rr(t){let e=t.length;for(;e--;){let r=Ge(e);[t[e],t[r]]=[t[r],t[e]]}return t}function V(t){return c(t,String)?t.toLowerCase().split("-").map((e,r)=>r&&`${nr(e)}`||e).join(""):t}function $(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`).replace(/^-|-$/,"")}function nr([t,...e]){return`${t.toUpperCase()}${e.join("")}`}function de(t){return c(t,Comment,Text)}function Te(t){c(t,Comment)}function Ze(t){return c(t,Text)}function _(t){return c(t,String)&&/^<|>$/.test(`${t}`.trim())}function Y(t){return c(t,Array)&&!t?.find(e=>!H(e))}function me(t){return c(t,Array)&&!t?.find(e=>!_(e))}function v(t,e){let r=t.collection.filter(n=>!de(n));for(let n=0;n<r.length;n+=1)e(r[n],n);return t}function Ke(t){return t.node?c(t.node,Comment)?`<!--${t.node.textContent}-->`:t.HTML.get(1).split(">")[0]+">...":""}function $e(t,e,r){let n=e!==document.body&&c(t,String)&&t.toLowerCase()!=="body"?e:document;if(!(!c(t,String)||t.trim().length<1))try{r.collection=[...n.querySelectorAll(t)]}catch{L.warn(`JQx: Invalid CSS querySelector. [${c(t,String)?t:"Not a string!"}]`)}}function qe(){return{isCommentOrTextNode:de,isNode:H,isComment:Te,isText:Ze,isHtmlString:_,isArrayOfHtmlElements:Y,isArrayOfHtmlStrings:me,ElemArray2HtmlString:Ye,input2Collection:ue,setCollectionFromCssSelector:$e,cssRuleEdit:W({createWithId:"JQxStylesheet"})}}function et(){let e=Object.freeze({notInDOM:"n/a",writable:"n/a",modal:"n/a",empty:!0,open:"n/a",visible:"n/a"});return r=>{let n=r.node;return c(n,Node)?Object.freeze({get writable(){return _e(n)},get modal(){return Xe(n)},get inDOM(){return n.isConnected},get open(){return n.open??!1},get visible(){return Ve(n)},get disabled(){return n.hasAttribute("readonly")||n.hasAttribute("disabled")},get empty(){return r.collection.length<1},get virtual(){return r.isVirtual}}):e}}function tt(t,e,r,n){r&&c(e,String)&&(e={[e]:r==="-"?"":r});let o;e.className&&(o=e.className,delete e.className),o=[...t.classList].find(a=>a.startsWith("JQxClass-")||o&&a===o)||o||`JQxClass-${fe().slice(1)}`,n.editCssRule(`.${o}`,e),t.classList.add(o)}var or=et();function rt(t){return{factoryExtensions:ir(t),instanceExtensions:sr(t)}}function ir(t){return{data(e){return{get all(){return new Proxy(e[0]?.dataset??{},Ee)},set(r={}){if(!e.is.empty&&c(r,Object))for(let[n,o]of Object.entries(r))e.setData({[n]:o});return e},get(r,n){return e.data.all[r]??n},add(r={}){if(!e.is.empty&&c(r,Object))for(let[n,o]of Object.entries(r))e.setData({[n]:o});return e},remove(r){return e[0]?.removeAttribute(`data-${$(r)}`),e}}},dimensions(e){if(e.is.empty)return L.error("[JQx instance].dimensions called on empty instance"),{error:"[JQx instance].dimensions: NO ELEMENTS"};let{node:r}=e,n=r.getBoundingClientRect().toJSON();return n.scrollTopDistance=B(r,0),n.scrollLeftDistance=B(r,0,!1),n},node(e){return e[0]},HTML(e){return{get(r,n){if(e.is.empty)return"NO ELEMENTS IN COLLECTION";let o=r?e.outerHtml:e.html();return n?M(o):o},set(r,n=!1,o=!1){r=r.isJQx?r.HTML.get(1):r;let i=c(r,String);return r=i&&o?M(r):r,i&&(r||"").trim().length&&e.html(r,n),e},replace(r,n=!1){return e.HTML.set(r,!1,n)},append(r,n=!1){return r=c(r,HTMLElement)?t(r).HTML.get(1):r.isJQx?r.HTML.get(1):r,e.HTML.set(r,!0,n)},insert(r,n=!1){return r=c(r,HTMLElement)?t(r).HTML.get(1):r.isJQx?r.HTML.get(1):r,e.HTML.set(r+e.HTML.get(),!1,n)}}},is(e){return or(e)},length(e){return e.collection.length},outerHtml(e){return(e.first()||{outerHTML:void 0}).outerHTML},parent(e){let r=t(e[0]?.parentNode);return r.is.empty?e:r},render(e){switch(!0){case!e.is.empty:return e.toDOM();default:return t.logger.warn("[JQx.render]: empty collection"),e}},Style(e){return{get computed(){return e.is.empty?{}:getComputedStyle(e[0])},inline(r){return e.style(r)},inSheet(r){return e.css(r)},valueOf(r){return e.is.empty?void 0:getComputedStyle(e[0])[$(r)]},nwRule(r){return e.Style.byRule({rules:r})},byRule({classes2Apply:r=[],rules:n=[]}={}){let i=c(n,String)&&!r.length?n.split("{")[0].trim():"";if(n=n&&c(n,String)?[n]:n,r=r&&c(r,String)?[r]:r,(n?.length||r?.length)&&(n?.length&&t.editCssRules(...n),r))for(let a of r)e.addClass(a);return i?.startsWith(".")&&e.addClass(i.slice(1)),i?.startsWith("#")&&!e.attr("id")&&e.prop({id:i.slice(1)}),e}}}}}function sr(t){return{addClass(e,...r){return v(e,n=>n&&r.forEach(o=>n.classList.add(o)))},after(e,...r){return j(e,t,!0,...r)},afterMe(e,...r){return j(e,t,!0,...r)},andThen(e,...r){return j(e,t,!0,...r)},append(e,...r){if(e.is.empty||r.length<1)return e;let n=e.length===1;for(let o of r){if(!o.isJQx&&A(o)){let i=o.trim(),h=!/^<(.+)[^>]+>$/m.test(i)?t.text(o):C(o);v(e,p=>p.append(n?h:P(h)))}H(o)&&v(e,i=>i.append(n?o:P(o))),o.isJQx&&!o.is.empty&&v(e,i=>o.collection.forEach(a=>i.append(n?a:P(a))))}return e},appendTo(e,r){switch(r=typeof r=="string"?t(r):r,!0){case(!r?.isJQx&&!c(r,HTMLElement)||r?.collection?.length<1):return t.warn("[JQx instance].appendTo: invalid input"),e;default:return(r.isJQx?r:t(r)).append(e),e}},attr(e,r,n){if(!e.node||c(e.node,Text,Comment))return e;if(!n&&A(r))return r=$(r),r==="class"?[...e.node.classList].join(" "):e.node.getAttribute(r);if(A(r)&&n)switch(r=$(r),!0){case r.startsWith("data-"):r={data:{[r.replace("data-","")]:n}};break;default:r={[r]:n}}return c(r,Object)&&!e.is.empty&&Le(e.node,r),e},before(e,...r){return j(e,t,!1,...r)},beforeMe(e,...r){j(e,t,!1,...r)},clear(e){return v(e,ce)},closest(e,r){let n=A(r)?e.node?.closest(r):void 0;return n?t(n):e},computedStyle(e,r){let{node:n}=e;return n&&getComputedStyle(n)[r]},css(e,r,n){return v(e,o=>tt(o,r,n,t))},duplicate(e,r=!1,n=document.body){switch(!0){case e.is.empty:return L.error("Duplicating an empty JQx instance is not possible"),e;default:let o=e.collection[0].cloneNode(!0);return o.childNodes.forEach(i=>{i.removeAttribute&&i?.removeAttribute("id")}),r?t(o).toDOM(n):t.virtual(o)}},each(e,r){return v(e,r)},empty(e){return v(e,ce)},find(e,r){return e.collection.length>0?[...e.first()?.querySelectorAll(r)]:[]},find$(e,r){return e.collection.length>0?t(r,e):e},first(e,r=!1){return e.collection.length>0?r?e.single():e.collection[0]:void 0},first$(e,r){return e.single(r)},getData(e,r,n){return e.node?.dataset?.[r]||n},hasClass(e,...r){return e.is.empty||!e.node.classList.length?!1:r.find(n=>e.node.classList.contains(n))&&!0||!1},hide(e){return v(e,r=>U(r,{display:"none !important"}))},html(e,r,n){switch(!0){case(e.is.empty&&!A(r)):return"";case!A(r):return e.node?.getHTML()??"";default:let o=C(`<div>${r.isJQx?r.HTML.get(!0):r}</div>`);return v(e,a=>(a.textContent=n?a.textContent:"",a.insertAdjacentHTML(t.at.end,o.getHTML())))}},htmlFor(e,r,n="",o=!1){if(e.is.empty||!A(r)||!A(n))return e;let i=e.find$(r);if(i.length<1)return e;let a=C(`<span>${n}</span>`);return i.each(h=>{o||(h.textContent=""),h.insertAdjacentHTML(t.at.end,a?.getHTML())}),e},isEmpty(e){return!e.node},nth$(e,r){return e.single(r)},on(e,r,...n){switch(!0){case(e.is.empty||!c(r,String,Array)||!A(r)||n.length<1):return e;default:return t.handle({type:r,node:e.node,handler:n}),e}},once(e,r,...n){switch(!0){case(e.is.empty||!c(r,String,Array)||!A(r)||n.length<1):return e;default:return t.handle({type:r,once:!0,node:e.node,handler:n}),e}},prepend(e,...r){if(e.is.empty||!r)return;let n=e.length===1;for(let o of r){if(A(o)){o=o.trim();let a=!/^<(.+)[^>]+>$/m.test(o)?t.text(o):C(o);a=n?a:P(a),v(e,h=>h.prepend(a.cloneNode(!0)))}H(o)&&v(e,i=>i.prepend(n?o:P(o))),o.isJQx&&!o.is.empty&&(o.collection.length>1&&o.collection.reverse(),v(e,i=>v(o,a=>i.prepend(n?a:P(a)))),o.collection.reverse())}return e},prependTo(e,r){switch(r=typeof r=="string"?t(r):r,!0){case(!r?.isJQx&&!c(r,HTMLElement)||r?.collection?.length<1):return t.warn("[JQx instance].appendTo: invalid input"),e;default:return(r.isJQx?r:t(r)).prepend(e),e}},prop(e,r,n){if(c(r,String)&&!n)return r.startsWith("data")?e[0]?.dataset[r.slice(r.indexOf("-")+1)]:e[0]?.[r];let o=c(r,Object)?r:{[r]:n};for(let[i,a]of Object.entries(o)){if(i=i.trim(),a&&!ae(i)||!a)return!1;if(i.toLowerCase()==="id")return e[0].id=a;v(e,p=>{if(i.startsWith("data"))return p.dataset[i.slice(i.indexOf("-")+1)]=a;p[i]=a})}return e},remove(e,r){let n=i=>i.remove(),o=()=>e.collection=e.collection.filter(i=>document.documentElement.contains(i));if(r){let i=e.find$(r);return i.is.empty||(v(i,n),o()),e}return v(e,n),o(),e},rmAttr(e,...r){for(let n of r)e.node.removeAttribute(n);return e},removeClass(e,...r){return v(e,n=>{if(n)for(let o of r)n.classList.remove(o)})},renderTo(e,r,n){return r=c(r,HTMLElement)||r.isJQx?r:document.body,n=c(n,String)&&t.at[n]?n:t.at.end,e.first$().toDOM(r,n),e},replace(e,r,n){let o=e.node;return!r||!c(n,HTMLElement)&&!n?.isJQx?(t.logger.error("JQx replace: invalid replacement value"),e):((n.isJQx||c(n,NodeList))&&(n=n[0]),o&&r&&(r=c(r,String)?o.querySelectorAll(r):r.isJQx?r.collection:r,c(r,HTMLElement,NodeList,Array)&&c(n,HTMLElement)&&(c(r,HTMLElement)?[r]:[...r]).forEach(i=>i.replaceWith(n.cloneNode(!0)))),e)},replaceClass(e,r,...n){return v(e,o=>{o.classList.remove(r);for(let i of n)o.classList.add(i)})},replaceMe(e,r){return e.replaceWith(r)},replaceWith(e,r){return r=c(r,Element)?r:r.isJQx?r[0]:void 0,r&&(e[0].replaceWith(r),e=t.virtual(r)),e},setData(e,r){return v(e,n=>le(n,r))},show(e){return v(e,r=>U(r,{display:"revert-layer !important"}))},single(e,r){let n=e.collection.length>0;switch(r=r??0,!0){case(n&&c(r,String)):return e.find$(r);case(n&&c(r,Number)):return t(e.collection[r]);case n:return e.collection[0];default:return e}},style(e,r,n){return v(e,i=>{n&&c(r,String)&&(r={[r]:n||"none"}),U(i,r)})},text(e,r,n=!1){switch(!0){case e.isEmpty():return e;case!c(r,String):return e.node.textContent;default:return v(e,o=>o.textContent=n?o.textContent+r:r)}},toDOM(e,r=document.body,n=T.BeforeEnd){return e.isVirtual=!1,I(e.collection,r,n),e},toggleClass(e,r){return v(e,n=>n.classList.toggle(r))},toNodeList(e){return[...e.collection].map(r=>document.importNode(r,!0))},trigger(e,r,n,o){n=c(n,Function)?n:Event,o=c(o,Object)?{...o,bubbles:o.bubbles??!0}:{bubbles:!0};let i=new n(r,o);return e.is.empty||e.each(a=>a.dispatchEvent(i)),e},val(e,r){switch(!0){case(e.is.empty||!c(e.node,HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement)):return e;case!c(r,String):return e.node.value;default:return e.node.value=c(r,String)?r:"",e}}}}var Oe,ge,{isComment:un,isText:fn,isHtmlString:dn,isArrayOfHtmlElements:mn,isArrayOfHtmlStrings:gn,ElemArray2HtmlString:pn,cssRuleEdit:Ce,addFn:ar}=cr();function cr(){return{...qe(),addFn:lr}}function lr(t,e){return t=t?.trim(),!A(t)||!c(e,Function)?L.error("JQx.fn: method invalid parameter(s)"):(ge[t]=(r,...n)=>e(r,...n),L.log(`JQx: added extension function [${t}]`))}function ur(t){return function(e,r,n){if(e=e?.trim(),!A(e)||!c(r,Function))return t.error("JQx.staticFn: invalid parameter(s)");let o=n?{get(){return r()}}:{value(...i){return r(...i)}};try{Object.defineProperty(t,e,o)}catch{return t.warn(`JQx.staticFn: extension [${e}] already exists`)}return L.log(`JQx: added static extension function [${e}]`)}}function pe(t){return new Proxy(t,{get:(e,r)=>dr(e,r,t)})}function nt(t,e,r=!1){e=e[Symbol.proxy]?e:pe(e);let n=function(...o){return t(e,...o)};return r?n():n}function fr(t){return`Proxy for JQx${t.collection.length<1?" (empty)":""} instance`}function dr(t,e,r){switch(!0){case e===Symbol.proxy:return fr(r);case typeof e=="symbol":return R({trial:()=>t[e],whenError:()=>t});case(!Number.isNaN(+e)&&typeof+e=="number"):return t.collection?.[e]||void 0;case Oe.hasOwnProperty(e):return nt(Oe[e],r,!0);case ge.hasOwnProperty(e):return nt(ge[e],r);default:return Reflect.get(t,e)}}function st(t){let e=br(t);for(let[r,n]of Object.entries(Object.getOwnPropertyDescriptors(e)))Object.defineProperty(t,r,n);return t}function mr(t){return{allow(e){let r=/-/.test(e),n=r&&e;e=r?V(e):e.toLowerCase(),N.allowTag(e),Object.defineProperties(t,Ne(e,!0,t,n))},prohibit(e){e=e.toLowerCase(),N.prohibitTag(e),Object.defineProperties(t,Ne(e,!1,t))}}}function ot(...t){if(t.length===1){let e=String(t.shift().trim());t=e.startsWith("!")?[e.slice(1,-1)]:e.split(",").map(r=>r.trim())}for(let e of t.map(r=>r.startsWith("!")?r.slice(1,-1):r))Ce(e,{removeRule:1})}function gr(t){return function(e,r,n){r=r?.isJQx?r?.[0]:r,n=n&&Object.values(T).find(i=>n===i);let o=t(e,document.createElement("br"));if(r&&!c(r,HTMLBRElement))for(let i of o.collection)n?r.insertAdjacentElement(n,i):r.append(i);return o}}function pr(...t){let e={};for(let r of t){let n=Object.getOwnPropertyDescriptors(r);for(let[o,i]of Object.entries(n))!(o in e)&&Object.defineProperty(e,o,{...i,enumerable:!1})}return e}function yr(t,e,r,n){return t=$(n||t.toLowerCase()),{get(){return(...o)=>{let i=e&&r.virtual(D(z[t](...o)))||void 0,h=!c(i?.node,Comment,Text,void 0)?ve(i):"";return L.log(e?`JQx: created (virtual) instance from [JQx].${t} ${h}`:`JQx: ${t.toUpperCase()} is prohibited. Use [JQx].allowTag if necessary.`),i}},enumerable:!1,configurable:!0}}function Ne(t,e,r,n){t=t.toLowerCase();let o=yr(t,e,r,n);return n?{[n]:o,[V(n)]:o}:{[t]:o,[t.toUpperCase()]:o}}function br(t){return pr(Object.entries(N.tagsRaw).reduce(hr(t),{}),Lr(t))}function hr(t){return function(e,[r,n]){return Object.defineProperties(e,Ne(r,n,t)),e}}function Sr(t){return function(e,r,...n){c(r,Function)&&(n.push(r),r=void 0),t({type:e,selector:r,handlers:n})}}function xr(t){return function(e){let{type:r,types:n,origin:o,selector:i,handler:a,handlers:h,node:p,name:E,capture:f,once:y,about:g}=e;a=h||a,r=n||r,i=o||i;let S=Ae(r),m=E;a=c(a,Function)?[a]:a;let u={type:S,selector:i||o,capture:f,name:m,once:y,node:p,about:g};switch(!0){case(c(S,Array)&&S.length>0):for(let l of S)u.type=l,it(a,u,t);break;default:return it(a,u,t)}}}function it(t,e,r){for(let n of t)r.listen({...e,handler:n})}function Er(t){return function(e,r){return r=A(r)&&r,e=A(e)&&e,r&&e&&t.listenerStore[e][r]}}function wr(t){return t.activePopup||Object.defineProperty(t,"activePopup",{value:re(t),enumerable:!1}),t.activePopup}function vr(t){let e=(f,y)=>Ce(f,y),r=function(f){return W({createWithId:f||`jqx${fe()}`})},n=function(...f){for(let y of f)Ce(y)},o=mr(t),i=ne(t),a=xr(i);return{editCssRule:e,createStyle:r,editCssRules:n,allowProhibit:o,handle:a,capturedHandling:a,log:(...f)=>L.on.log(...f).off,warn:(...f)=>L.on.warn(...f).off,error:(...f)=>L.on.error(...f).off,handlerWrapper:i}}function Lr(t){let{factoryExtensions:e,instanceExtensions:r}=rt(t);Oe=e,ge=r;let{editCssRule:n,createStyle:o,editCssRules:i,allowProhibit:a,handle:h,capturedHandling:p,log:E,warn:f,error:y,handlerWrapper:g}=vr(t),S=Er(t),m=ur(t);return z.setError=u=>(y(`JQx direct element creation error: [${u}] is not a valid tag`),t.br()),{log:E,warn:f,error:y,editCssRules:i,createStyle:o,editStylesheet:o,editCssRule:n,escHtml:M,logger:L,proxyWrapper:G,text(u,l=!1){return l?t.comment(u):document.createTextNode(u)},node(u,l=document){return l.querySelector(u,l)},nodes(u,l=document){return[...l.querySelectorAll(u,l)]},clearAllTimers:we,get staticFn(){return function(u,l,s){return m(u,l,s)}},get toBool(){return Fe},get getNamedListener(){return S},get virtual(){return gr(t)},get allowTag(){return a.allow},get prohibitTag(){return a.prohibit},get removeCssRule(){return ot},get removeCssRules(){return ot},get delegate(){return Sr(p)},get delegateCaptured(){return p},get handle(){return p},get listen(){return g.listen},get at(){return T},get setStyle(){return n},get fn(){return ar},get lenient(){return N.allowUnknownHtmlTags},get IS(){return c},get Popup(){return wr(t)},get listenerStore(){return g.ListenerStore}}}var at=Ar();function Ar(){return st(function(e,r,n=T.BeforeEnd){if(e?.isJQx)return e;let o=c(r,HTMLBRElement);r=(!o&&r&&r.isJQx?r[0]:r)||document.body,n=n&&Object.values(T).find(f=>n===f)?n:void 0;let i=_(e),h=!i&&me(e)||i,p={collection:ue(e)??[],isVirtual:o,isJQx:!0},E=Y(p.collection);switch(!0){case(p.collection.length&&E&&!o):for(let f of p.collection)r.contains(f)||I([f],r,n);break;case h:for(let f of[e].flat())p.collection.push(C(f));if(p.collection.length>0){let f=p.collection.filter(m=>m?.dataset?.jqxcreationerror);p.collection=p.collection.filter(m=>!m?.dataset?.jqxcreationerror);let g=p.collection.map(m=>`${String(m.constructor).split(/function|\(/)[1].trim()}`).length>1;p=pe(p);let S=p.collection.length>0?Ke(p):"sanitized: no elements remaining";L.log(`JQx: created ${p.isVirtual?"(virtual)":""} instance from ${g?"array of ":""}HTML string${g?"s":""} ${S}`),p.isVirtual||I(p.collection,r,n)}break;default:$e(e,r,p)}return pe(p)})}var En=at;export{En as default};
|
|
16
|
+
`));default:return n}}return Object.defineProperties(n,{log:{value:p,enumerable:!1},error:{value:a,enumerable:!1},warn:{value:h,enumerable:!1}}),Object.freeze(n)}function se(){return(t=>`[${ie(t.getHours())}:${ie(t.getMinutes())}:${ie(t.getSeconds())}.${ie(t.getMilliseconds(),3)}]`)(new Date)}function Le(t,e){if(t)for(let[r,n]of Object.entries(e)){if(r=$(r),r.startsWith("data"))return le(t,n);c(n,String)&&ae(r)&&t.setAttribute(r,n.split(/[, ]/)?.join(" "))}}function le(t,e){if(t&&c(e,Object))for(let[r,n]of Object.entries(e))t.setAttribute(`data-${$(r)}`,n)}function ue(t){return t?t.EL?[t.EL]:c(t,NodeList)?[...t]:H(t)?[t]:Y(t)?t:t.isJQx?t.collection:void 0:[]}function j(t,e,r=!0,...n){if(t.is.empty)return L.log("[JQx instance].[before(Me) | after(Me) | andThen]: instance is empty."),t;if(n=n.map(i=>i.isJQx?i.node:c(i,String)?e(i).node??i:i),n.find(i=>!c(i,String,Element))){let i=r?"after":"before";return L.log(`[JQx instance].[${i}(Me)]: invalid/-sufficient input.`),t}return t.node[r?"after":"before"](...n),t}function H(t){return c(t,Text,HTMLElement,Comment)}function U(t,e){if(c(e,Object))for(let[r,n]of Object.entries(e)){let o;/!important/i.test(n)&&(n=n.slice(0,n.indexOf("!")).trim(),o="important"),t.style.setProperty($(r),n,o)}}function P(t){let e=t.cloneNode(!0);return e.removeAttribute&&e.removeAttribute("id"),t.isConnected?t.remove():t=null,e}function Ve(t){if(!c(t,HTMLElement))return;let e=t.style,r=getComputedStyle(t),n=!![e.visibility,r.visibility].includes("hidden"),o=!![e.display,r.display].includes("none"),i=!!t.hidden,a=parseInt(r.height)<1||parseInt(r.width)<1,h=t.offsetTop<0||t.offsetLeft+t.offsetWidth<0||t.offsetLeft>document.body.offsetWidth,p=+r.opacity==0||+(e.opacity||1)==0;return!(i||h||p||o||n||a)}function _e(t){return t?.isConnected?!![...document.querySelectorAll(":is(:read-write)")].find(e=>e===t):!1}function Ye(t){return t?.filter(e=>e).reduce((e,r)=>e.concat(Te(r)?`<!--${r.data}-->`:de(r)?r.textContent:r.outerHTML),"")}function ie(t,e=2){return`${t}`.padStart(e,"0")}function Ge(t,e=0){return[t,e]=[Math.floor(t),Math.ceil(e)],Math.floor([...crypto.getRandomValues(new Uint32Array(1))].shift()/2**32*(t-e+1)+e)}function fe(){return`_${rr(er).slice(0,8).join("")}`}function Ae(t){return t=c(t,String)&&/,/.test(t)?t.split(",").map(e=>e.trim().toLowerCase()).filter(e=>e.length>0):t,c(t,Array)?t:c(t,String)&&t?.trim().toLowerCase()||""}function Xe(t){return t?.isConnected?!![...document.querySelectorAll(":is(:modal)")].find(e=>e===t):!1}function Fe(t,e){switch(t=String(t).trim(),!0){case/^(0|false|f)$/i.test(t):return!1;case/^(1|true|t)$/i.test(t):return!0;default:return e}}function rr(t){let e=t.length;for(;e--;){let r=Ge(e);[t[e],t[r]]=[t[r],t[e]]}return t}function V(t){return c(t,String)?t.toLowerCase().split("-").map((e,r)=>r&&`${nr(e)}`||e).join(""):t}function $(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`).replace(/^-|-$/,"")}function nr([t,...e]){return`${t.toUpperCase()}${e.join("")}`}function de(t){return c(t,Comment,Text)}function Te(t){c(t,Comment)}function Ze(t){return c(t,Text)}function _(t){return c(t,String)&&/^<|>$/.test(`${t}`.trim())}function Y(t){return c(t,Array)&&!t?.find(e=>!H(e))}function me(t){return c(t,Array)&&!t?.find(e=>!_(e))}function v(t,e){let r=t.collection.filter(n=>!de(n));for(let n=0;n<r.length;n+=1)e(r[n],n);return t}function Ke(t){return t.node?c(t.node,Comment)?`<!--${t.node.textContent}-->`:t.HTML.get(1).split(">")[0]+">...":""}function $e(t,e,r){let n=e!==document.body&&c(t,String)&&t.toLowerCase()!=="body"?e:document;if(!(!c(t,String)||t.trim().length<1))try{r.collection=[...n.querySelectorAll(t)]}catch{L.warn(`JQx: Invalid CSS querySelector. [${c(t,String)?t:"Not a string!"}]`)}}function qe(){return{isCommentOrTextNode:de,isNode:H,isComment:Te,isText:Ze,isHtmlString:_,isArrayOfHtmlElements:Y,isArrayOfHtmlStrings:me,ElemArray2HtmlString:Ye,input2Collection:ue,setCollectionFromCssSelector:$e,cssRuleEdit:W({createWithId:"JQxStylesheet"})}}function et(){let e=Object.freeze({notInDOM:"n/a",writable:"n/a",modal:"n/a",empty:!0,open:"n/a",visible:"n/a"});return r=>{let n=r.node;return c(n,Node)?Object.freeze({get writable(){return _e(n)},get modal(){return Xe(n)},get inDOM(){return n.isConnected},get open(){return n.open??!1},get visible(){return Ve(n)},get disabled(){return n.hasAttribute("readonly")||n.hasAttribute("disabled")},get empty(){return r.collection.length<1},get virtual(){return r.isVirtual}}):e}}function tt(t,e,r,n){r&&c(e,String)&&(e={[e]:r==="-"?"":r});let o;e.className&&(o=e.className,delete e.className),o=[...t.classList].find(a=>a.startsWith("JQxClass-")||o&&a===o)||o||`JQxClass-${fe().slice(1)}`,n.editCssRule(`.${o}`,e),t.classList.add(o)}var or=et();function rt(t){return{factoryExtensions:ir(t),instanceExtensions:sr(t)}}function ir(t){return{data(e){return{get all(){return new Proxy(e[0]?.dataset??{},Ee)},set(r={}){if(!e.is.empty&&c(r,Object))for(let[n,o]of Object.entries(r))e.setData({[n]:o});return e},get(r,n){return e.data.all[r]??n},add(r={}){if(!e.is.empty&&c(r,Object))for(let[n,o]of Object.entries(r))e.setData({[n]:o});return e},remove(r){return e[0]?.removeAttribute(`data-${$(r)}`),e}}},dimensions(e){if(e.is.empty)return L.error("[JQx instance].dimensions called on empty instance"),{error:"[JQx instance].dimensions: NO ELEMENTS"};let{node:r}=e,n=r.getBoundingClientRect().toJSON();return n.scrollTopDistance=B(r,0),n.scrollLeftDistance=B(r,0,!1),n},node(e){return e[0]},HTML(e){return{get(r,n){if(e.is.empty)return"NO ELEMENTS IN COLLECTION";let o=r?e.outerHtml:e.html();return n?M(o):o},set(r,n=!1,o=!1){r=r.isJQx?r.HTML.get(1):r;let i=c(r,String);return r=i&&o?M(r):r,i&&(r||"").trim().length&&e.html(r,n),e},replace(r,n=!1){return e.HTML.set(r,!1,n)},append(r,n=!1){return r=c(r,HTMLElement)?t(r).HTML.get(1):r.isJQx?r.HTML.get(1):r,e.HTML.set(r,!0,n)},insert(r,n=!1){return r=c(r,HTMLElement)?t(r).HTML.get(1):r.isJQx?r.HTML.get(1):r,e.HTML.set(r+e.HTML.get(),!1,n)}}},is(e){return or(e)},length(e){return e.collection.length},outerHtml(e){return(e.first()||{outerHTML:void 0}).outerHTML},parent(e){let r=t(e[0]?.parentNode);return r.is.empty?e:r},render(e){return!0===!e.is.empty?e.toDOM():(t.logger.warn("[JQx.render]: empty collection"),e)},Style(e){return{get computed(){return e.is.empty?{}:getComputedStyle(e[0])},inline(r){return e.style(r)},inSheet(r){return e.css(r)},valueOf(r){return e.is.empty?void 0:getComputedStyle(e[0])[$(r)]},nwRule(r){return e.Style.byRule({rules:r})},byRule({classes2Apply:r=[],rules:n=[]}={}){let i=c(n,String)&&!r.length?n.split("{")[0].trim():"";if(n=n&&c(n,String)?[n]:n,r=r&&c(r,String)?[r]:r,(n?.length||r?.length)&&(n?.length&&t.editCssRules(...n),r))for(let a of r)e.addClass(a);return i?.startsWith(".")&&e.addClass(i.slice(1)),i?.startsWith("#")&&!e.attr("id")&&e.prop({id:i.slice(1)}),e}}}}}function sr(t){return{addClass(e,...r){return v(e,n=>n&&r.forEach(o=>A(o)&&n.classList.add(o)))},after(e,...r){return j(e,t,!0,...r)},afterMe(e,...r){return j(e,t,!0,...r)},andThen(e,...r){return j(e,t,!0,...r)},append(e,...r){if(e.is.empty||r.length<1)return e;let n=e.length===1;for(let o of r){if(!o.isJQx&&A(o)){let i=o.trim(),h=!/^<(.+)[^>]+>$/m.test(i)?t.text(o):C(o);v(e,p=>p.append(n?h:P(h)))}H(o)&&v(e,i=>i.append(n?o:P(o))),o.isJQx&&!o.is.empty&&v(e,i=>o.collection.forEach(a=>i.append(n?a:P(a))))}return e},appendTo(e,r){return r=typeof r=="string"?t(r):r,!0===(!r?.isJQx&&!c(r,HTMLElement)||r?.collection?.length<1)?(t.warn("[JQx instance].appendTo: invalid input"),e):((r.isJQx?r:t(r)).append(e),e)},attr(e,r,n){return!e.node||c(e.node,Text,Comment)?e:!n&&A(r)?(r=$(r),r==="class"?[...e.node.classList].join(" "):e.node.getAttribute(r)):(A(r)&&n&&(r=$(r),!0===r.startsWith("data-")?r={data:{[r.replace("data-","")]:n}}:r={[r]:n}),c(r,Object)&&!e.is.empty&&Le(e.node,r),e)},before(e,...r){return j(e,t,!1,...r)},beforeMe(e,...r){j(e,t,!1,...r)},clear(e){return v(e,ce)},closest(e,r){let n=A(r)?e.node?.closest(r):void 0;return n?t(n):e},computedStyle(e,r){let{node:n}=e;return n&&getComputedStyle(n)[r]},css(e,r,n){return v(e,o=>tt(o,r,n,t))},duplicate(e,r=!1,n=document.body){if(!0===e.is.empty)return L.error("Duplicating an empty JQx instance is not possible"),e;{let o=e.collection[0].cloneNode(!0);return o.childNodes.forEach(i=>{i.removeAttribute&&i?.removeAttribute("id")}),r?t(o).toDOM(n):t.virtual(o)}},each(e,r){return v(e,r)},empty(e){return v(e,ce)},find(e,r){return e.collection.length>0?[...e.first()?.querySelectorAll(r)]:[]},find$(e,r){return e.collection.length>0?t(r,e):e},first(e,r=!1){return e.collection.length>0?r?e.single():e.collection[0]:void 0},first$(e,r){return e.single(r)},getData(e,r,n){return e.node?.dataset?.[r]||n},hasClass(e,...r){return e.is.empty||!e.node.classList.length?!1:r.find(n=>e.node.classList.contains(n))&&!0||!1},hide(e){return v(e,r=>U(r,{display:"none !important"}))},html(e,r,n){switch(!0){case(e.is.empty&&!A(r)):return"";case!A(r):return e.node?.getHTML()??"";default:let o=C(`<div>${r.isJQx?r.HTML.get(!0):r}</div>`);return v(e,a=>(a.textContent=n?a.textContent:"",a.insertAdjacentHTML(t.at.end,o.getHTML())))}},htmlFor(e,r,n="",o=!1){if(e.is.empty||!A(r)||!A(n))return e;let i=e.find$(r);if(i.length<1)return e;let a=C(`<span>${n}</span>`);return i.each(h=>{o||(h.textContent=""),h.insertAdjacentHTML(t.at.end,a?.getHTML())}),e},isEmpty(e){return!e.node},nth$(e,r){return e.single(r)},on(e,r,...n){return!0===(e.is.empty||!c(r,String,Array)||!A(r)||n.length<1)||t.handle({type:r,node:e.node,handler:n}),e},once(e,r,...n){return!0===(e.is.empty||!c(r,String,Array)||!A(r)||n.length<1)||t.handle({type:r,once:!0,node:e.node,handler:n}),e},prepend(e,...r){if(e.is.empty||!r)return;let n=e.length===1;for(let o of r){if(A(o)){o=o.trim();let a=!/^<(.+)[^>]+>$/m.test(o)?t.text(o):C(o);a=n?a:P(a),v(e,h=>h.prepend(a.cloneNode(!0)))}H(o)&&v(e,i=>i.prepend(n?o:P(o))),o.isJQx&&!o.is.empty&&(o.collection.length>1&&o.collection.reverse(),v(e,i=>v(o,a=>i.prepend(n?a:P(a)))),o.collection.reverse())}return e},prependTo(e,r){return r=typeof r=="string"?t(r):r,!0===(!r?.isJQx&&!c(r,HTMLElement)||r?.collection?.length<1)?(t.warn("[JQx instance].appendTo: invalid input"),e):((r.isJQx?r:t(r)).prepend(e),e)},prop(e,r,n){if(c(r,String)&&!n)return r.startsWith("data")?e[0]?.dataset[r.slice(r.indexOf("-")+1)]:e[0]?.[r];let o=c(r,Object)?r:{[r]:n};for(let[i,a]of Object.entries(o)){if(i=i.trim(),a&&!ae(i)||!a)return!1;if(i.toLowerCase()==="id")return e[0].id=a;v(e,p=>{if(i.startsWith("data"))return p.dataset[i.slice(i.indexOf("-")+1)]=a;p[i]=a})}return e},remove(e,r){let n=i=>i.remove(),o=()=>e.collection=e.collection.filter(i=>document.documentElement.contains(i));if(r){let i=e.find$(r);return i.is.empty||(v(i,n),o()),e}return v(e,n),o(),e},rmAttr(e,...r){for(let n of r)e.node.removeAttribute(n);return e},removeClass(e,...r){return v(e,n=>{if(n)for(let o of r)n.classList.remove(o)})},renderTo(e,r,n){return r=c(r,HTMLElement)||r.isJQx?r:document.body,n=c(n,String)&&t.at[n]?n:t.at.end,e.first$().toDOM(r,n),e},replace(e,r,n){let o=e.node;return!r||!c(n,HTMLElement)&&!n?.isJQx?(t.logger.error("JQx replace: invalid replacement value"),e):((n.isJQx||c(n,NodeList))&&(n=n[0]),o&&r&&(r=c(r,String)?o.querySelectorAll(r):r.isJQx?r.collection:r,c(r,HTMLElement,NodeList,Array)&&c(n,HTMLElement)&&(c(r,HTMLElement)?[r]:[...r]).forEach(i=>i.replaceWith(n.cloneNode(!0)))),e)},replaceClass(e,r,...n){return v(e,o=>{o.classList.remove(r);for(let i of n)o.classList.add(i)})},replaceMe(e,r){return e.replaceWith(r)},replaceWith(e,r){return r=c(r,Element)?r:r.isJQx?r[0]:void 0,r&&(e[0].replaceWith(r),e=t.virtual(r)),e},setData(e,r){return v(e,n=>le(n,r))},show(e){return v(e,r=>U(r,{display:"revert-layer !important"}))},single(e,r){let n=e.collection.length>0;switch(r=r??0,!0){case(n&&c(r,String)):return e.find$(r);case(n&&c(r,Number)):return t(e.collection[r]);case n:return e.collection[0];default:return e}},style(e,r,n){return v(e,i=>{n&&c(r,String)&&(r={[r]:n||"none"}),U(i,r)})},text(e,r,n=!1){switch(!0){case e.isEmpty():return e;case!c(r,String):return e.node.textContent;default:return v(e,o=>o.textContent=n?o.textContent+r:r)}},toDOM(e,r=document.body,n=T.BeforeEnd){return e.isVirtual=!1,I(e.collection,r,n),e},toggleClass(e,r){return v(e,n=>n.classList.toggle(r))},toNodeList(e){return[...e.collection].map(r=>document.importNode(r,!0))},trigger(e,r,n,o){n=c(n,Function)?n:Event,o=c(o,Object)?{...o,bubbles:o.bubbles??!0}:{bubbles:!0};let i=new n(r,o);return e.is.empty||e.each(a=>a.dispatchEvent(i)),e},val(e,r){switch(!0){case(e.is.empty||!c(e.node,HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement)):return e;case!c(r,String):return e.node.value;default:return e.node.value=c(r,String)?r:"",e}}}}var Oe,ge,{isComment:un,isText:fn,isHtmlString:dn,isArrayOfHtmlElements:mn,isArrayOfHtmlStrings:gn,ElemArray2HtmlString:pn,cssRuleEdit:Ce,addFn:ar}=cr();function cr(){return{...qe(),addFn:lr}}function lr(t,e){return t=t?.trim(),!A(t)||!c(e,Function)?L.error("JQx.fn: method invalid parameter(s)"):(ge[t]=(r,...n)=>e(r,...n),L.log(`JQx: added extension function [${t}]`))}function ur(t){return function(e,r,n){if(e=e?.trim(),!A(e)||!c(r,Function))return t.error("JQx.staticFn: invalid parameter(s)");let o=n?{get(){return r()}}:{value(...i){return r(...i)}};try{Object.defineProperty(t,e,o)}catch{return t.warn(`JQx.staticFn: extension [${e}] already exists`)}return L.log(`JQx: added static extension function [${e}]`)}}function pe(t){return new Proxy(t,{get:(e,r)=>dr(e,r,t)})}function nt(t,e,r=!1){e=e[Symbol.proxy]?e:pe(e);let n=function(...o){return t(e,...o)};return r?n():n}function fr(t){return`Proxy for JQx${t.collection.length<1?" (empty)":""} instance`}function dr(t,e,r){switch(!0){case e===Symbol.proxy:return fr(r);case typeof e=="symbol":return R({trial:()=>t[e],whenError:()=>t});case(!Number.isNaN(+e)&&typeof+e=="number"):return t.collection?.[e]||void 0;case Oe.hasOwnProperty(e):return nt(Oe[e],r,!0);case ge.hasOwnProperty(e):return nt(ge[e],r);default:return Reflect.get(t,e)}}function st(t){let e=br(t);for(let[r,n]of Object.entries(Object.getOwnPropertyDescriptors(e)))Object.defineProperty(t,r,n);return t}function mr(t){return{allow(e){let r=/-/.test(e),n=r&&e;e=r?V(e):e.toLowerCase(),N.allowTag(e),Object.defineProperties(t,Ne(e,!0,t,n))},prohibit(e){e=e.toLowerCase(),N.prohibitTag(e),Object.defineProperties(t,Ne(e,!1,t))}}}function ot(...t){if(t.length===1){let e=String(t.shift().trim());t=e.startsWith("!")?[e.slice(1,-1)]:e.split(",").map(r=>r.trim())}for(let e of t.map(r=>r.startsWith("!")?r.slice(1,-1):r))Ce(e,{removeRule:1})}function gr(t){return function(e,r,n){r=r?.isJQx?r?.[0]:r,n=n&&Object.values(T).find(i=>n===i);let o=t(e,document.createElement("br"));if(r&&!c(r,HTMLBRElement))for(let i of o.collection)n?r.insertAdjacentElement(n,i):r.append(i);return o}}function pr(...t){let e={};for(let r of t){let n=Object.getOwnPropertyDescriptors(r);for(let[o,i]of Object.entries(n))!(o in e)&&Object.defineProperty(e,o,{...i,enumerable:!1})}return e}function yr(t,e,r,n){return t=$(n||t.toLowerCase()),{get(){return(...o)=>{let i=e&&r.virtual(D(z[t](...o)))||void 0,h=!c(i?.node,Comment,Text,void 0)?ve(i):"";return L.log(e?`JQx: created (virtual) instance from [JQx].${t} ${h}`:`JQx: ${t.toUpperCase()} is prohibited. Use [JQx].allowTag if necessary.`),i}},enumerable:!1,configurable:!0}}function Ne(t,e,r,n){t=t.toLowerCase();let o=yr(t,e,r,n);return n?{[n]:o,[V(n)]:o}:{[t]:o,[t.toUpperCase()]:o}}function br(t){return pr(Object.entries(N.tagsRaw).reduce(hr(t),{}),Lr(t))}function hr(t){return function(e,[r,n]){return Object.defineProperties(e,Ne(r,n,t)),e}}function Sr(t){return function(e,r,...n){c(r,Function)&&(n.push(r),r=void 0),t({type:e,selector:r,handlers:n})}}function xr(t){return function(e){let{type:r,types:n,origin:o,selector:i,handler:a,handlers:h,node:p,name:E,capture:f,once:y,about:g}=e;a=h||a,r=n||r,i=o||i;let S=Ae(r),m=E;a=c(a,Function)?[a]:a;let u={type:S,selector:i||o,capture:f,name:m,once:y,node:p,about:g};switch(!0){case(c(S,Array)&&S.length>0):for(let l of S)u.type=l,it(a,u,t);break;default:return it(a,u,t)}}}function it(t,e,r){for(let n of t)r.listen({...e,handler:n})}function Er(t){return function(e,r){return r=A(r)&&r,e=A(e)&&e,r&&e&&t.listenerStore[e][r]}}function wr(t){return t.activePopup||Object.defineProperty(t,"activePopup",{value:re(t),enumerable:!1}),t.activePopup}function vr(t){let e=(f,y)=>Ce(f,y),r=function(f){return W({createWithId:f||`jqx${fe()}`})},n=function(...f){for(let y of f)Ce(y)},o=mr(t),i=ne(t),a=xr(i);return{editCssRule:e,createStyle:r,editCssRules:n,allowProhibit:o,handle:a,capturedHandling:a,log:(...f)=>L.on.log(...f).off,warn:(...f)=>L.on.warn(...f).off,error:(...f)=>L.on.error(...f).off,handlerWrapper:i}}function Lr(t){let{factoryExtensions:e,instanceExtensions:r}=rt(t);Oe=e,ge=r;let{editCssRule:n,createStyle:o,editCssRules:i,allowProhibit:a,handle:h,capturedHandling:p,log:E,warn:f,error:y,handlerWrapper:g}=vr(t),S=Er(t),m=ur(t);return z.setError=u=>(y(`JQx direct element creation error: [${u}] is not a valid tag`),t.br()),{log:E,warn:f,error:y,editCssRules:i,createStyle:o,editStylesheet:o,editCssRule:n,escHtml:M,logger:L,proxyWrapper:G,text(u,l=!1){return l?t.comment(u):document.createTextNode(u)},node(u,l=document){return l.querySelector(u,l)},nodes(u,l=document){return[...l.querySelectorAll(u,l)]},clearAllTimers:we,get staticFn(){return function(u,l,s){return m(u,l,s)}},get toBool(){return Fe},get getNamedListener(){return S},get virtual(){return gr(t)},get allowTag(){return a.allow},get prohibitTag(){return a.prohibit},get removeCssRule(){return ot},get removeCssRules(){return ot},get delegate(){return Sr(p)},get delegateCaptured(){return p},get handle(){return p},get listen(){return g.listen},get at(){return T},get setStyle(){return n},get fn(){return ar},get lenient(){return N.allowUnknownHtmlTags},get IS(){return c},get Popup(){return wr(t)},get listenerStore(){return g.ListenerStore}}}var at=Ar();function Ar(){return st(function(e,r,n=T.BeforeEnd){if(e?.isJQx)return e;let o=c(r,HTMLBRElement);r=(!o&&r&&r.isJQx?r[0]:r)||document.body,n=n&&Object.values(T).find(f=>n===f)?n:void 0;let i=_(e),h=!i&&me(e)||i,p={collection:ue(e)??[],isVirtual:o,isJQx:!0},E=Y(p.collection);switch(!0){case(p.collection.length&&E&&!o):for(let f of p.collection)r.contains(f)||I([f],r,n);break;case h:for(let f of[e].flat())p.collection.push(C(f));if(p.collection.length>0){let f=p.collection.filter(m=>m?.dataset?.jqxcreationerror);p.collection=p.collection.filter(m=>!m?.dataset?.jqxcreationerror);let g=p.collection.map(m=>`${String(m.constructor).split(/function|\(/)[1].trim()}`).length>1;p=pe(p);let S=p.collection.length>0?Ke(p):"sanitized: no elements remaining";L.log(`JQx: created ${p.isVirtual?"(virtual)":""} instance from ${g?"array of ":""}HTML string${g?"s":""} ${S}`),p.isVirtual||I(p.collection,r,n)}break;default:$e(e,r,p)}return pe(p)})}var En=at;export{En as default};
|
|
17
17
|
//# sourceMappingURL=jqx.min.js.map
|