jqlmodule
Version:
A JQuery alike es20xx module
16 lines (15 loc) • 39.9 kB
JavaScript
var Yt="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')",it=ee(),xt=re(),z=Kt(),W=te();function Kt(){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 te(){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 ee(){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:'JQL Logging (chronological)';}","#logBox .legend.reversed div:before{content:'JQL Logging (reversed)';}","#logBox #jql_logger{marginTop:0.7rem;lineHeight:1.4em;font-family:consolas,monospace;whiteSpace:pre-wrap;maxWidth:inherit;padding-left:100px;}","#logBox #jql_logger div.entry{text-indent:-100px;whiteSpace:normal;}"]}function re(){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:${Yt} 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 st=!1,ne={on:()=>st=!0,off:()=>st=!1},M={tagsRaw:W,allowUnknownHtmlTags:ne,isAllowed(t){if(st)return!0;let e=c(t,String)?t.toLowerCase():t?.nodeName.toLowerCase()||"none";return e==="#text"||!!W[e]},allowTag:t=>W[t.toLowerCase()]=!0,prohibitTag:t=>W[t.toLowerCase()]=!1};var lt=!1,U=!1,P=!0,ut=!1,oe=!0,vt,D=()=>x("#logBox"),Lt="#jql_logger",ie=t=>{it?.forEach(e=>t(e))},se=()=>{it&&ie(vt);let t=oe?"div":"pre",e=`<div id="logBox"><div class="legend"><div></div></div><${t} id="jql_logger"></${t}></div>`;return dt(j(e),void 0,T.AfterBegin),x.node(Lt)},St=t=>c(t,String)&&Object.assign(document.createElement("textarea"),{innerHTML:t}).textContent||t,H=(...t)=>{let e=t[0]==="fromStatic";if(t=e?t.slice(1):t,e&&!U)return t.forEach(n=>console.info(`${k()} \u2714 ${St(n)}`));if(!U)return;!P&&!x.node("#logBox")&&(vt=x.createStyle("JQLLogCSS"),se());let r=n=>`${c(n,Object)?JSON.stringify(n,null,2):n}
`;t.forEach(n=>P?console.info(`${k()} \u2714 ${St(n)}`):x.node("#jql_logger").insertAdjacentHTML(ut?"afterbegin":"beforeend",`<div class="entry">${k()} ${r(n.replace(/\n/g,"<br>"))}</div>`))},at={on(){U=!0,H("Logging activated")},off(){U=!1,console.log("Logging deactivated")}},ct={on(){lt=!0},off(){lt=!1}},R=(...t)=>lt&&H(...t),C={get isConsole(){return P===!0},get isOn(){return U},isVisible:function(){return x("#jql_logger").is("visible")},on(){return at.on(),ct.on(),P||D()?.addClass("visible"),H("Debug logging started. Every call to [jql instance] is logged"),C},off(){return D().isEmpty||(ct.off(),H("Debug logging stopped"),D()?.removeClass("visible")),at.off(),C},toConsole:{on(){return P=!0,H("Started logging to console"),C},off(){return H("Stopped logging to console (except error messages)"),P=!1,C}},remove(){return at.off(),ct.off(),D()?.remove(),console.clear(),console.log(`${k()} logging completely disabled and all entries removed`),C},log:function(...t){return H(...t),C},hide(){return D()?.removeClass("visible"),C},show:()=>(D()?.addClass("visible"),C),get reversed(){return{on:()=>(ut=!0,H("Reverse logging set: now logging bottom to top (latest first)"),x("#logBox .legend").addClass("reversed"),C),off:()=>(ut=!1,x("#logBox .legend").removeClass("reversed"),H("Reverse logging reset: now logging chronological (latest last)"),C)}},clear(){return x(Lt).text(""),console.clear(),H("Logging cleared"),C}};var X=ae(),Et={html:"innerHTML",text:"textContent",class:"className"};function ae(){let t={get(e,r){let n=String(r)?.toLowerCase();switch(!0){case n in e:return e[n];case pe(n):return wt(e,n,r);default:return wt(e,n,r,!0)}},enumerable:!1,configurable:!1};return new Proxy({},t)}function wt(t,e,r,n=!1){return Object.defineProperty(t,e,{get(){return n?o=>ge(r):ye(e)}}),t[e]}function ce(t,e,r){return e=e?.isJQL&&e.first()||e,be({trial:n=>Ht(e)?t.insertAdjacentHTML("beforeend",e):t.append(e),whenError:n=>console.info(`${r} not created, reason
`,n)})}function le(t,e,...r){let n=ue(e,t);return r?.forEach(o=>ce(n,o,t)),n}function ue(t,e){switch(t=ft(e)?fe(t):t,!0){case c(t,String):return G(e,Ht(t,e)?{html:t}:{text:t});case c(t,Node):return me(e,t);default:return G(e,t)}}function de(t){return delete t.data,Object.keys(t).length<1||Object.keys(t).forEach(e=>{let r=e.toLowerCase();r in Et&&(t[Et[r]]=t[e])&&delete t[e]}),t}function me(t,e){let r=G(t);return r.append(e),r}function G(t,e={}){e=Ft(e,{});let r=Object.entries(e.data??{}),n=Object.assign(ft(t)?new Comment:document.createElement(t),de(e));return r.length&&r.forEach(([o,i])=>n.dataset[o]=i),n}function Ft(t,e){return e?c(t,{isTypes:Object,notTypes:[Array,null,NaN,Proxy],defaultValue:e}):c(t,{isTypes:Object,notTypes:[Array,null,NaN,Proxy]})}function fe(t){return Ft(t)?t?.text??t?.textContent??"":String(t)}function ge(t){return G("b",{style:"color:red",text:`'${t}' is not a valid HTML-tag`})}function Ht(t,e){return!ft(e)&&c(t,String)&&/<.*>|&[#|0-9a-z]+[^;];/i.test(t)}function ft(t){return/comment/i.test(t)}function pe(t){return!c(G(t),HTMLUnknownElement)}function ye(t){return(e,...r)=>le(t,e,...r)}var{IS:c,maybe:be,$Wrap:ur,xProxy:dr,isNothing:mr}=he();function he(){Symbol.proxy=Symbol.for("toa.proxy"),Symbol.is=Symbol.for("toa.is"),Symbol.type=Symbol.for("toa.type"),Symbol.isSymbol=Symbol.for("toa.isASymbol"),p();let t=F(),[e,r]=[g(),v()];return r.custom(),{IS:n,maybe:t,$Wrap:e,isNothing:w,xProxy:r};function n(a,...l){if(t({trial:b=>"isTypes"in(l?.[0]??{})})){let b=l[0];return"defaultValue"in b?h(a,b):"notTypes"in b?d(a,b):n(a,...[b.isTypes].flat())}let f=typeof a=="symbol"?Symbol.isSymbol:a;return l.length>1?y(f,...l):i(a,...l)}function o(a){return a?.[Symbol.proxy]??n(a)}function i(a,...l){let{noInput:f,noShouldbe:b,compareTo:$,inputCTOR:N,isNaN:rt,isInfinity:nt,shouldBeFirstElementIsNothing:ot}=S(a,...l);switch(l=l.length&&l[0],!0){case ot:return String(a)===String($);case(a?.[Symbol.proxy]&&b):return a[Symbol.proxy];case rt:return b?"NaN":t({trial:ht=>String($)})===String(a);case nt:return b?"Infinity":t({trial:ht=>String($)})===String(a);case f:return b?String(a):String($)===String(a);case N===Boolean:return l?N===l:"Boolean";default:return L(a,l,b,u(a,N))}}function u(a,l){return a===0?Number:a===""?String:a?l:{name:String(a)}}function S(a,...l){let f=l.length<1,b=!f&&l[0],$=!f&&w(l[0]),N=a==null,rt=!N&&Object.getPrototypeOf(a)?.constructor,nt=Number.isNaN(a),ot=t({trial:ht=>String(a)})==="Infinity";return{noInput:N,noShouldbe:f,compareTo:b,inputCTOR:rt,isNaN:nt,isInfinity:ot,shouldBeFirstElementIsNothing:$}}function L(a,l,f,b){switch(!0){case(!f&&l===a||a?.[Symbol.proxy]&&l===Proxy):return!0;case t({trial:$=>String(l)})==="NaN":return String(a)==="NaN";case(a?.[Symbol.toStringTag]&&n(l,String)):return String(l)===a[Symbol.toStringTag];default:return l?t({trial:$=>a instanceof l})||l===b||l===Object.getPrototypeOf(b)||`${l?.name}`===b?.name:a?.[Symbol.toStringTag]&&`[object ${a?.[Symbol.toStringTag]}]`||b?.name||String(b)}}function y(a,...l){return l.some(f=>n(a,f))}function w(a,l=!1){let f=a==null;return f=l?f||n(a,1/0)||n(a,NaN):f,f}function F(){let a=(l,f)=>l?.constructor===Function?l(f):void 0;return function({trial:l,whenError:f=()=>{}}={}){try{return a(l)}catch(b){return a(f,b)}}}function g(){return function(a){return Object.freeze({get value(){return a},get[Symbol.type](){return o(a)},get type(){return o(a)},[Symbol.is](...l){return n(a,...l)},is(...l){return n(a,...l)}})}}function h(a,{defaultValue:l,isTypes:f=[void 0],notTypes:b}={}){return f=f?.constructor!==Array?[f]:f,b=b&&b?.constructor!==Array?[b]:[],b.length<1?n(a,...f)?a:l:d(a,{isTypes:f,notTypes:b})?a:l}function d(a,{isTypes:l=[void 0],notTypes:f=[void 0]}={}){return l=l?.constructor!==Array?[l]:l,f=f?.constructor!==Array?[f]:f,n(a,...l)&&!n(a,...f)}function p(){Object.getOwnPropertyDescriptors(Object.prototype)[Symbol.is]||(Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return o(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...a){return n(this,...a)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(a){return o(a)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(a,...l){return n(a,...l)},enumerable:!1,configurable:!1}}))}function s(a){let l=String(Object.getPrototypeOf(a)?.constructor);return l.slice(l.indexOf("ion")+3,l.indexOf("(")).trim()}function m(a){let l=a.set;return a.set=(f,b,$)=>b===Symbol.proxy?f[b]=$:l(f,b,$),a}function v(){let a=Proxy;return{native(){Proxy=a},custom(){Proxy=new a(a,{construct(l,f){for(let $ of f)$.set&&($=m($));let b=new l(...f);return b[Symbol.proxy]=`Proxy (${s(f[0])})`,b}})}}}}function V({styleSheet:t,createWithId:e}={}){let{tryParseAtOrNestedRules:r,ruleExists:n,checkParams:o,sheet:i,removeRules:u,consider:S,currentSheetID:L}=xe({styleSheet:t,createWithId:e});function y(d,p){if(d&&p.removeProperties){Object.keys(p.removeProperties).forEach(s=>d.style.removeProperty(Ct(s)));return}Object.entries(p).forEach(([s,m])=>{s=Ct(s.trim()),m=m.trim();let v;if(/!important/.test(m)&&(m=m.slice(0,m.indexOf("!important")).trim(),v="important"),!CSS.supports(s,m))return console.error(`StylingFactory ${L} error: '${s}' with value '${m}' not supported (yet)`);$t(()=>d.style.setProperty(s,m,v),`StylingFactory ${L} (setRule4Selector) failed`)})}function w(d,p,s=i){if(d=d?.trim?.(),!c(d,String)||!d.length||/[;,]$/g.test(d))return console.error(`StylingFactory ${L} (setRules): [${d||"[no selector given]"}] is not a valid selector`);if(p.removeRule)return u(d);let m=n(d,!0),v=m||s.cssRules[s.insertRule(`${d} {}`,s.cssRules.length||0)];return S(()=>y(v,p),d,m)}function F(d){let p=d.trim().split(/{/,2),s=p.shift().trim();if(!c(s,String)||!s?.trim()?.length)return console.error(`StylingFactory ${L} (doParse): no (valid) selector could be extracted from rule ${mt(d)}`);let m=$e(p.shift());return $t(()=>w(s,m),`StylingFactory ${L} (setRules) failed`)}function g(d){let p=r(d);return p.done?p.existing:F(d)}function h(d,p){return d.trim().startsWith("@media")?g(Se(d,p)):w(d,p)}return function(d,p={}){return o(d,p)&&(Object.keys(p).length?h(d,p):g(d))}}function xe({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 h=document.querySelector(`#${g}`)?.sheet;if(h)return h;let d=Object.assign(document.createElement("style"),{id:g});return document.head.insertAdjacentElement("beforeend",d),d.sheet}function i(g){return console.error(`StylingFactory ${n} [rule: ${g}]
=> @charset, @namespace and @import are not supported here`),{done:!0}}function u(g,h){return[...t.rules].find(d=>h?Tt(d.selectorText||"",g):Ee`${Le(g)}${[..."gim"]}`.test(d.cssText))}function S(g){return/^@charset|@import|namespace/i.test(g.trim())?i(g):g.match(/}/g)?.length>1?{existing:w(g,1),done:!0}:{done:!1}}function L(g){let h=[...t.cssRules].reduce((p,s,m)=>Tt(s.selectorText||"",g)&&p.concat(m)||p,[]),d=h.length;return h.forEach(p=>t.deleteRule(p)),d>0?console.info(`\u2714 Removed ${d} instance${d>1?"s":""} of selector ${g} from ${n.slice(4)}`):console.info(`\u2714 Remove rule: selector ${g} does not exist in ${n.slice(4)}`)}function y(g,h){return g&&c(g,String)&&g.trim().length>0&&c(h,Object)||(console.error(`StylingFactory ${n} called with invalid parameters`),!1)}function w(g){g=g.trim();let h=g.slice(0,g.indexOf("{")).trim(),d=!!u(h);try{return t.insertRule(`${g}`,t.cssRules.length),d}catch(p){return console.error(`StylingFactory ${n} (tryParse) ${p.name} Error:
${p.message}
Rule: ${mt(g)}
${r}`),d}}function F(g,h,d){try{return g(),d}catch(p){return console.error(`StylingFactory ${n} (tryAddOrModify) ${p.name} Error:
${p.message}
Rule: ${mt(h)}
${r}`),d}}return{sheet:t,removeRules:L,tryParseAtOrNestedRules:S,ruleExists:u,checkParams:y,tryParse:w,consider:F,currentSheetID:n}}function Se(t,e){return`${t.trim()} ${Object.entries(e).map(([r,n])=>`${r}: { ${ve(n)}`)}`}function mt(t){let e=(t||"NO RULE").trim().slice(0,50).replace(/\n/g,"\\n").replace(/\s{2,}/g," ");return t.length>e.length?`${e.trim()}...truncated`:e}function ve(t){return Object.entries(t).map(([e,r])=>`${e}: ${r.trim()}`).join(`;
`)}function Le(t){return t.replace(/([*\[\]()-+{}.$?\\])/g,e=>`\\${e}`)}function Ee(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(`
`).map(n=>n.replace(/\s|\/\/.*$/g,"").trim().replace(/(@s!)/g," ")).join(""),r)}function Ct(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`).replace(/[^--]^-|-$/,"")}function $t(t,e){try{return t()}catch(r){console.error(`${e||"an error occured"}: ${r.message}`)}}function we(t){return t.replace(/\/\*.+?\*\//gm,"").replace(/[}{\r\n]/g,"").replace(/(data:.+?);/g,(e,r)=>`${r}\\3b`).split(";").map(e=>e.trim()).join(`;
`).replaceAll("\\3b",";").split(`
`)}function Ce(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 $e(t){return Ce(we(t))}function Tt(t,e){return t?.replace("::",":")===e?.replace("::",":")}var Te=[...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}`));var Y=(t,e=2)=>`${t}`.padStart(e,"0");var Fe=(t,e=0)=>([t,e]=[Math.floor(t),Math.ceil(e)],Math.floor([...crypto.getRandomValues(new Uint32Array(1))].shift()/2**32*(t-e+1)+e)),He=t=>{let e=t.length;for(;e--;){let r=Fe(e);[t[e],t[r]]=[t[r],t[e]]}return t};var A=(t,e=120)=>`${t}`.trim().slice(0,e).replace(/>\s+</g,"><").replace(/</g,"<").replace(/\s{2,}/g," ").replace(/\n/g,"\\n")+(t.length>e?" …":"").trim(),J=t=>t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`).replace(/^-|-$/,""),je=([t,...e])=>`${t.toUpperCase()}${e.join("")}`,K=t=>c(t,String)?t.toLowerCase().split("-").map((e,r)=>r&&`${je(e)}`||e).join(""):t,O=()=>`_${He(Te).slice(0,8).join("")}`,tt=(t,e=120)=>A(t,e).replace(/</g,"<"),k=()=>(t=>`[${Y(t.getHours())}:${Y(t.getMinutes())}:${Y(t.getSeconds())}.${Y(t.getMilliseconds(),3)}]`)(new Date);var Q=t=>t.replace(/</g,"<");function jt(){let t=function(i){if(!i)return;let u=i.style,S=getComputedStyle(i),L=[u.visibility,S.visibility].includes("hidden"),y=[u.display,S.display].includes("none"),w=i.offsetTop<0||i.offsetLeft+i.offsetWidth<0||i.offsetLeft>document.body.offsetWidth,F=+S.opacity==0||+(u.opacity||1)==0;return!(w||F||y||L)},e="n/a",r=function(i){return i.parentNode?!!x.nodes(":is(:read-write)",i?.parentNode)?.find(u=>u===i):!1},n=function(i){return i.parentNode?!!x.nodes(":is(:modal)",i?.parentNode)?.find(u=>u===i):!1},o={notInDOM:!0,writable:e,modal:e,empty:!0,open:e,visible:e};return i=>{let u=i[0];return u?{get writable(){return r(u)},get modal(){return n(u)},get inDOM(){return!!u.parentNode},get open(){return u.open??!1},get visible(){return t(u)},get disabled(){return u.hasAttribute("readonly")||u.hasAttribute("disabled")},get empty(){return i.collection.length<1},get virtual(){return i.isVirtual}}:o}}var Ae=!0,et={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},Me=t=>{if(Ae&&Object.keys(t.removed).length){let e=Object.entries(t.removed).reduce((r,[n,o])=>[...r,`${Q(n)} => ${o}`],[]).join("\\000A");C.log(`JQL HTML creation errors: ${C.isConsole?e:Q(e)}`)}},Re=function(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)||M.isAllowed(e)},gt=t=>{let e={rawHTML:t?.parentElement?.getHTML()??"no html",removed:{}};return c(t,HTMLElement)&&[...t.childNodes].forEach(r=>{if(r?.children?.length&>(r),r?.attributes){let o=c(r,SVGElement)?z.svg:z.html;[...(r??{attributes:[]}).attributes].forEach(i=>{let u=i.name.trim().toLowerCase(),S=i.value.trim().toLowerCase().replace(et.whiteSpace,""),L=u==="href"?!et.validURL.test(S):et.notAllowedValues.test(S),y=u.startsWith("data")?!et.data.test(u):!!o[u];if(L||y){let w=tt(i.value||"none",60);w+=w.length===60?"...":"",e.removed[`${i.name}`]=`attribute/property (-value) not allowed, removed. Value: ${w}`,r.removeAttribute(i.name)}})}if(!Re(r)){let o=(r?.outerHTML||r?.textContent).trim(),i=tt(o,60)??"EMPTY";i+=i.length===60?"...":"",e.removed[`<${r.nodeName?.toLowerCase()}>`]=`not allowed, not rendered. Value: ${i}`,r.remove()}}),Me(e),t};var T=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]}}),Oe=t=>{let e=document.createElement("div");return e.insertAdjacentHTML(T.end,t),e.childNodes.length?gt(e):void 0},Ie=(t,e,r)=>c(t,Comment)?e.insertAdjacentHTML(r,`<!--${t.data}-->`):e.insertAdjacentText(r,t.data),B=(t=[],e=document.body,r=T.BeforeEnd)=>t.reduce((n,o)=>{let i=Z(o)&&dt(o,e,r);return i?[...n,i]:n},[]),dt=(t,e=document.body,r=T.BeforeEnd)=>(e=e?.isJQL?e?.[0]:e,c(t,Comment,Text)?Ie(t,e,r):e.insertAdjacentElement(r,t)),j=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||!/^<(.+)[^>]+>/m.test(e))return document.createTextNode(r);let n=Oe(t);return n.childNodes.length<1?j(`<span data-jqlcreationerror="1">${A(t,60)}</span>`):n.children[0]};var E=(t,e)=>{let r=t.collection.filter(n=>!Nt(n));for(let n=0;n<r.length;n+=1)e(r[n],n);return t},Ne=jt(),At=t=>t&&(t.textContent="");var q=t=>{let e=t.cloneNode(!0);return e.removeAttribute&&e.removeAttribute("id"),t.isConnected?t.remove():t=null,e},Ot=(t,e)=>{t&&c(e,Object)&&Object.entries(e).forEach(([r,n])=>t.setAttribute(`data-${J(r)}`,n))},Mt=(t,e)=>t.andThen(e,!0),Rt=(t,e)=>t.andThen(e),It=t=>t.startsWith("data")||z.html.find(e=>t.toLowerCase()===e),De=(t,e,r)=>{r&&c(e,String)&&(e={[e]:r==="-"?"":r});let n;e.className&&(n=e.className,delete e.className),n=[...t.classList].find(i=>i.startsWith("JQLClass-")||n&&i===n)||n||`JQLClass-${O().slice(1)}`,x.editCssRule(`.${n}`,e),t.classList.add(n)},Pe=(t,e)=>{t&&Object.entries(e).forEach(([r,n])=>{if(r.toLowerCase().startsWith("data"))return Ot(t,n);c(n,String)&&It(r)&&t.setAttribute(r,n.split(/[, ]/)?.join(" "))})},pt=(t,e)=>{c(e,Object)&&Object.entries(e).forEach(([r,n])=>{let o;/!important/i.test(n)&&(n=n.slice(0,n.indexOf("!")).trim(),o="important"),t.style.setProperty(J(r),n,o)})},ke={get(t,e){return t[K(e)]||t[e]}},Je=(...t)=>{C.log("\u2757"+t.map(e=>String(e)).join(", "))},Qe={factoryExtensions:{is:t=>Ne(t),length:t=>t.collection.length,dimensions:t=>t.first()?.getBoundingClientRect(),parent:t=>{let e=x(t[0]?.parentNode);return e.is.empty?t:e},outerHtml:t=>(t.first()||{outerHTML:void 0}).outerHTML,data:t=>({get all(){return new Proxy(t[0]?.dataset??{},ke)},set:(e={})=>(!t.is.empty&&c(e,Object)&&Object.entries(e).forEach(([r,n])=>t.setData({[r]:n})),t),get:(e,r)=>t.data.all[e]??r,add:(e={})=>(!t.is.empty&&c(e,Object)&&Object.entries(e).forEach(([r,n])=>t.setData({[r]:n})),t),remove:e=>(t[0]?.removeAttribute(`data-${J(e)}`),t)}),Style:t=>({get computed(){return t.is.empty?{}:getComputedStyle(t[0])},inline:e=>t.style(e),inSheet:e=>t.css(e),valueOf:e=>t.is.empty?void 0:getComputedStyle(t[0])[J(e)],nwRule:e=>t.Style.byRule({rules:e}),byRule:({classes2Apply:e=[],rules:r=[]}={})=>{let o=c(r,String)&&!e.length?r.split("{")[0].trim():"";return r=r&&c(r,String)?[r]:r,e=e&&c(e,String)?[e]:e,(r?.length||e?.length)&&(r?.length&&x.editCssRules(...r),e?.forEach(i=>t.addClass(i))),o?.startsWith(".")&&t.addClass(o.slice(1)),o?.startsWith("#")&&!t.attr("id")&&t.prop({id:o.slice(1)}),t}}),HTML:t=>({get:(e,r)=>{if(t.is.empty)return"NO ELEMENTS IN COLLECTION";let n=e?t.outerHtml:t.html();return r?Q(n):n},set:(e,r=!1,n=!1)=>{e=e.isJQL?e.HTML.get(1):e;let o=c(e,String);return e=o&&n?Q(e):e,o&&(e||"").trim().length&&t.html(e,r),t},replace:(e,r=!1)=>t.HTML.set(e,!1,r),append:(e,r=!1)=>(e=c(e,HTMLElement)?e[Symbol.jqlvirtual].HTML.get(1):e.isJQL?e.HTML.get(1):e,t.HTML.set(e,!0,r)),insert:(e,r=!1)=>(e=c(e,HTMLElement)?e[Symbol.jqlvirtual].HTML.get(1):e.isJQL?e.HTML.get(1):e,t.HTML.set(e+t.HTML.get(),!1,r))})},instanceExtensions:{isEmpty:t=>t.collection.length<1,replaceClass:(t,e,...r)=>E(t,n=>{n.classList.remove(e),r.forEach(o=>n.classList.add(o))}),removeClass:(t,...e)=>E(t,r=>r&&e.forEach(n=>r.classList.remove(n))),addClass:(t,...e)=>E(t,r=>r&&e.forEach(n=>r.classList.add(n))),setData:(t,e)=>E(t,r=>Ot(r,e)),show:t=>E(t,e=>pt(e,{display:"revert-layer !important"})),hide:t=>E(t,e=>pt(e,{display:"none !important"})),empty:t=>E(t,At),clear:t=>E(t,At),closest:(t,e)=>{let r=c(e,String)?t[0].closest(e):null;return r?x(r):t},style:(t,e,r)=>E(t,o=>{r&&c(e,String)&&(e={[e]:r||"none"}),pt(o,e)}),toggleClass:(t,e)=>E(t,r=>r.classList.toggle(e)),css:(t,e,r)=>E(t,n=>De(n,e,r)),text:(t,e,r=!1)=>t.isEmpty()?t:c(e,String)?E(t,o=>o.textContent=r?o.textContent+e:e):t.first().textContent,removeAttribute:(t,e)=>E(t,r=>r.removeAttribute(e)),each:(t,e)=>E(t,e),remove:(t,e)=>{R(`remove ${A(t.HTML.get(1),40)}${e?` /w selector ${e}`:""}`);let r=o=>o.remove(),n=()=>t.collection=t.collection.filter(o=>document.documentElement.contains(o));if(e){let o=t.find$(e);return o.is.empty||(E(o,r),n()),t}return E(t,r),n(),t},computedStyle:(t,e)=>t.first()&&getComputedStyle(t.first())[e],getData:(t,e,r)=>t.first()&&t.first().dataset?.[e]||r,hasClass:(t,...e)=>{let r=t[0];return!r||!r.classList.length?!1:e.find(n=>r.classList.contains(n))&&!0||!1},replace:(t,e,r)=>{let n=t[0];return!e||!r||!c(r,HTMLElement)&&!r.isJQL?(console.error("JQL replace: invalid replacement value"),t):(r.isJQL&&(r=r[0]),c(r,NodeList)&&(r=r[0]),n&&e&&(e=c(e,String)?n.querySelectorAll(e):e.isJQL?e.collection:e,c(e,HTMLElement,NodeList,Array)&&c(r,HTMLElement)&&(c(e,HTMLElement)?[e]:[...e]).forEach(o=>o.replaceWith(r.cloneNode(!0)))),t)},replaceWith:(t,e)=>(e=c(e,Element)?e:e.isJQL?e[0]:void 0,e&&(t[0].replaceWith(e),t=x.virtual(e)),t),replaceMe:(t,e)=>t.replaceWith(e),val:(t,e)=>{let r=t[0];return!r||!c(r,HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement)?t:e===void 0?r.value:(r.value=c(e,String)?e:"",t)},attr:(t,e,r)=>{let n=t[0];return n?!r&&c(e,String)?e==="class"?[...n?.classList].join(" "):n?.getAttribute(e):(c(e,String)&&r&&(e={[e]:r}),c(e,Object)&&!t.is.empty&&Pe(n,e),t):t},andThen:(t,e,r=!1)=>{if(!e||!c(e,String,Node,Proxy))return Je(`[JQL instance].[beforeMe | afterMe | andThen]: insufficient input [${e}]`),t;e=e?.isJQL?e.collection:c(e,Node)?x.virtual(e).collection:x.virtual(j(e)).collection;let[n,o,i]=r?[0,"before",e.concat(t.collection)]:[t.collection.length-1,"after",t.collection.concat(e)];return t[n][o](...e),t.collection=i,t},after:Rt,afterMe:Rt,before:Mt,beforeMe:Mt,append:(t,...e)=>{if(!t.is.empty&&e.length){let r=t.length===1;for(let n of e){if(!n.isJQL&&c(n,String)){let o=n.trim(),u=!/^<(.+)[^>]+>$/m.test(o)?x.text(n):j(n);E(t,S=>S.append(r?u:q(u)))}Z(n)&&E(t,o=>o.append(r?n:q(n))),n.isJQL&&!n.is.empty&&E(t,o=>n.collection.forEach(i=>o.append(r?i:q(i))))}}return t},prepend:(t,...e)=>{if(!t.is.empty&&e){let r=t.length===1;for(let n of e){if(c(n,String)){n=n.trim();let i=!/^<(.+)[^>]+>$/m.test(n)?x.text(n):j(n);i=r?i:q(i),E(t,u=>u.prepend(i.cloneNode(!0)))}Z(n)&&E(t,o=>o.prepend(r?n:q(n))),n.isJQL&&!n.is.empty&&(n.collection.length>1&&n.collection.reverse(),E(t,o=>E(n,i=>o.prepend(r?i:q(i)))),n.collection.reverse())}}return t},appendTo:(t,e)=>(e.isJQL||(e=x(e)),e.append(t),t),prependTo:(t,e)=>(e.isJQL||(e=x.virtual(e)),e.prepend(t),t),single:(t,e)=>t.collection.length>0?c(e,String)?t.find$(e):c(e,Number)?x(t.collection[e]):x(t.collection[0]):t,toNodeList:t=>[...t.collection].map(e=>document.importNode(e,!0)),duplicate:(t,e=!1,r=document.body)=>{let n=t.toNodeList().map(i=>i.removeAttribute&&i.removeAttribute("id")||i),o=x.virtual(n);return e?o.toDOM(r):o},toDOM:(t,e=document.body,r=T.BeforeEnd)=>(t.collection=B(t.collection,e,r),t.isVirtual&&(t.isVirtual=!1),t),first:(t,e=!1)=>{if(t.collection.length>0)return e?t.single():t.collection[0]},first$:(t,e)=>t.single(e),nth$:(t,e)=>t.single(e),find:(t,e)=>t.collection.length>0?[...t.first()?.querySelectorAll(e)]:[],find$:(t,e)=>t.collection.length>0?x(e,t):t,prop:(t,e,r)=>{if(c(e,String)&&!r)return e.startsWith("data")?t[0]?.dataset[e.slice(e.indexOf("-")+1)]:t[0]?.[e];let n=c(e,Object)?e:{[e]:r};return Object.entries(n).forEach(([o,i])=>{if(o=o.trim(),i&&!It(o)||!i)return!1;if(o.toLowerCase()==="id")return t[0].id=i;E(t,S=>{if(o.startsWith("data"))return S.dataset[o.slice(o.indexOf("-")+1)]=i;S[o]=i})}),t},on:(t,e,...r)=>(t.collection.length&&r?.forEach(n=>{let o=Dt(t);x.delegate(e,o,n)}),t),html:(t,e,r)=>{if(e===void 0)return t[0]?.getHTML();if(!t.isEmpty()){let n=j(`<div>${e.isJQL?e.HTML.get(!0):e}</div>`);if(!c(n,Comment))return E(t,i=>(r||(i.textContent=""),i.insertAdjacentHTML(x.at.end,n.getHTML())))}return t},htmlFor:(t,e,r="",n=!1)=>{if(e&&t.collection.length){if(!e||!c(r,String))return t;let o=t.find$(e);if(o.length<1)return t;let i=j(`<span>${r}</span>`);o.each(u=>{n||(u.textContent=""),u.insertAdjacentHTML(x.at.end,i.getHTML())})}return t},trigger:(t,e,r=Event,n={})=>{if(t.collection.length){let o=new r(e,{...n,bubbles:n.bubbles??!0});for(let i of t.collection)i.dispatchEvent(o)}return t}}},yt=Qe;var Pt=Be;function Be(t){let e=t.createStyle("JQLPopupCSS");xt.forEach(s=>e(s));let r={},n,o,i,u=t.virtual('<div class="popup-warn">'),S=t('<div class="popupContainer">').append(t('<span class="closeHandleIcon">')).append(t('<div class="content">')),[L,y]=[t(".popupContainer > .closeHandleIcon"),t(".popupContainer > .content")],w=()=>{if(L.hasClass("popup-active")){let{x:s,y:m,width:v}=y.dimensions;L.style({top:`${m-12}px`,left:`${s+v-12}px`})}},F=()=>{o&&t(".popup-warn").clear().append(t(`<div>${o}</div>`)),y.addClass("popup-warn-active")},g=()=>{n=!1,p(L.first())},h=(s,m)=>i=setTimeout(()=>p(L[0]),+s*1e3);return t.delegate("click",".popupContainer, .closeHandleIcon",s=>p(s.target)),t.delegate("click",".popupContainer .content",(s,m)=>n&&m.removeClass("popup-warn-active")),t.delegate("resize",w),{show:d,create:(s,m,v,a)=>{let l=t.IS(m,Boolean)?m:!1;d({content:s,modal:l,callback:l?v:m,warnMessage:a})},createTimed:(s,m,v)=>d({content:s,closeAfter:m,callback:v}),removeModal:g};function d({content:s,modal:m,closeAfter:v,callback:a,warnMessage:l}){if(s){if(s=t.IS(s,Node)?s[Symbol.jqlvirtual]:s,clearTimeout(i),n=m??!1,o=t.IS(l,String)&&`${l?.trim()}`.length||l?.isJQL?l:void 0,y.clear().append(s.isJQL?s:t(`<div>${s}</div>`)),n&&l&&y.append(u.duplicate()),S.addClass("popup-active"),t.IS(a,Function)){let f=O();S.data.set({callbackId:f}),r[f]=a}if(!n){if(t.IS(+v,Number)){let f=S.data.get("callbackId"),b=f&&r[f];h(v,b)}L.addClass("popup-active"),w()}return!0}return console.error("Popup creation needs at least some text to show")}function p(s){if(!n&&!s.closest(".content")){clearTimeout(i),y.clear();let m=S.data.get("callbackId");S.data.remove("callbackId"),t(".popup-active").removeClass("popup-active");let v=m&&r[m];t.IS(v,Function)&&v(),m&&delete r[m],o="";return}return n&&F()}}var I={},qe=["load","unload","scroll","focus","blur","DOMNodeRemovedFromDocument","DOMNodeInsertedIntoDocument","loadstart","progress","error","abort","load","loadend","pointerenter","pointerleave","readystatechange"],_e=t=>!!qe.find(e=>e===t),kt=()=>{let t=n=>I[n.type].forEach(o=>o(n)),e=(n,o)=>i=>{let u=i.target?.closest?.(n);return u&&o(i,x(u))},r=(n,o)=>{I[n]||addEventListener(n,t,_e(n))};return(n,o,i,u=!1)=>{r(n,u);let S=o?e(o,i):i;I=I[n]?{...I,[n]:I[n].concat(S)}:{...I,[n]:[S]}}};var ze={},{instanceMethods:Jt,instanceGetters:Qt,isCommentOrTextNode:Nt,isNode:Z,isComment:Ur,isText:Gr,isHtmlString:_t,isArrayOfHtmlElements:zt,isArrayOfHtmlStrings:Wt,ElemArray2HtmlString:Ut,input2Collection:Gt,setCollectionFromCssSelector:Vt,addHandlerId:Dt,cssRuleEdit:bt,addFn:We,elems4Docs:Vr}=Ue();Symbol.jql=Symbol.for("jql");Symbol.jqlvirtual=Symbol.for("jqlvirtual");Symbol.jql2Root=Symbol.for("jql2dom");Symbol.JQLX=Symbol.for("NodeProxy");function Ue(){let t=V({createWithId:"JQLStylesheet"}),e=(s,m)=>r[s]=(v,...a)=>m(v,...a),r=yt.instanceExtensions,n=yt.factoryExtensions,o=s=>c(s,Comment,Text),i=s=>c(s,Text,HTMLElement,Comment),u=s=>c(s,Comment),S=s=>c(s,Text),L=s=>c(s,String)&&/^<|>$/.test(`${s}`.trim()),y=s=>c(s,Array)&&!s?.find(m=>!L(m)),w=s=>c(s,Array)&&!s?.find(m=>!i(m)),F=s=>s?.filter(m=>m).reduce((m,v)=>m.concat(u(v)?`<!--${v.data}-->`:o(v)?v.textContent:v.outerHTML),""),g=s=>s?c(s,Proxy)?[s.EL]:c(s,NodeList)?[...s]:i(s)?[s]:w(s)?s:s.isJQL?s.collection:void 0:[],h=(s,m,v)=>{let a=m!==document.body&&c(s,String)&&s.toLowerCase()!=="body"?m:document,l;try{v.collection=[...a.querySelectorAll(s)]}catch{l=`Invalid CSS querySelector. [${c(s,String)?s:"Nothing valid given!"}]`}return l??`CSS querySelector "${s}", output ${v.collection.length} element(s)`},d=s=>{let m=s.data.get("hid")||`HID${O()}`;return s.data.add({hid:m}),`[data-hid="${m}"]`},p=Object.entries(M.tagsRaw).filter(([,s])=>s).map(([s])=>s).sort((s,m)=>s.localeCompare(m));return{instanceMethods:r,instanceGetters:n,isCommentOrTextNode:o,isNode:i,isComment:u,isText:S,isHtmlString:L,isArrayOfHtmlElements:w,isArrayOfHtmlStrings:y,ElemArray2HtmlString:F,input2Collection:g,setCollectionFromCssSelector:h,addHandlerId:d,cssRuleEdit:t,addFn:e,elems4Docs:p}}function _(t){let e=i=>(...u)=>c(i,Function)&&i(_(t),...u),r=i=>(...u)=>c(i,Function)?{tmpKey:i(_(t),...u)}:{tmpKey:void 0},n=(i,u)=>c(u,Symbol)?()=>i:c(+u,Number)?i.collection?.[u]:u in Qt?r(Qt[u])().tmpKey:u in Jt?e(Jt[u]):i[u],o={get:(i,u)=>n(i,u)};return new Proxy(t,o)}function Zt(t){Object.defineProperties(Node.prototype,{[Symbol.jql]:{get(){return t(this)},enumerable:!1,configurable:!1},[Symbol.jqlvirtual]:{get(){return t.virtual(this)},enumerable:!1,configurable:!1},[Symbol.jql2Root]:{value(r=document.body,n=T.end){return t(this,r,n)},enumerable:!1,configurable:!1}});let e=Ge(t);return Object.entries(Object.getOwnPropertyDescriptors(e)).forEach(([r,n])=>{Object.defineProperty(t,r,n),Object.defineProperty(ze,r,n)}),t}function Ge(t){return Ye(Object.entries(M.tagsRaw).reduce(Ke(t),{}),Ve(t))}function Ve(t){let e=(r,n)=>bt(r,n);return{debugLog:C,log:(...r)=>H("fromStatic",...r),insertPositions:T,get at(){return T},editCssRules:(...r)=>r.forEach(n=>bt(n)),editCssRule:e,get setStyle(){return e},delegate:Ze(kt()),virtual:Xe(t),get fn(){return We},allowTag:r=>{r=r.toLowerCase(),M.allowTag(r),c(t[r],Function)||Object.defineProperties(t,Xt(r,t))},prohibitTag:M.prohibitTag,get lenient(){return M.allowUnknownHtmlTags},get IS(){return c},get Popup(){return t.activePopup||Object.defineProperty(t,"activePopup",{value:Pt(t),enumerable:!1}),t.activePopup},popup:()=>t.Popup,createStyle:r=>V({createWithId:r||`jql${O()}`}),editStylesheet:r=>V({createWithId:r||`jql${O()}`}),removeCssRule:Bt,removeCssRules:Bt,text:(r,n=!1)=>n?t.comment(r):document.createTextNode(r),node:(r,n=document)=>n.querySelector(r,n),nodes:(r,n=document)=>[...n.querySelectorAll(r,n)]}}function Bt(...t){if(t.length===1){let e=String(t.shift().trim());t=e.startsWith("!")?[e.slice(1,-1)]:e.split(",").map(r=>r.trim())}t.map(e=>e.startsWith("!")?e.slice(1,-1):e).forEach(e=>bt(e,{removeRule:1}))}function Ze(t){return function(e,r,...n){return c(r,Function)&&(n.push(r),r=void 0),n.forEach(o=>t(e,r,o))}}function Xe(t){return function(e,r,n){r=r?.isJQL?r?.[0]:r,n=n&&Object.values(T).find(i=>n===i)?n:void 0;let o=t(e,document.createElement("br"));return r&&!c(r,HTMLBRElement)&&o.collection.forEach(i=>n?r.insertAdjacentElement(n,i):r.append(i)),o}}function Ye(...t){let e={};for(let r of t){let n=Object.getOwnPropertyDescriptors(r);Object.entries(n).forEach(([o,i])=>!(o in e)&&Object.defineProperty(e,o,i))}return e}function qt(t,e){return t=t.toLowerCase(),{get(){return(...r)=>c(e,Function)?M.tagsRaw[t.toLowerCase()]&&e.virtual(X[t](...r))||void 0:M.tagsRaw[t.toLowerCase()]&&X[t](...r)||void 0},enumerable:!1,configurable:!1}}function Xt(t,e){let r=qt(t),n=qt(t.replace(/_jql$/i,""),e),o={[t]:r,[t.toUpperCase()]:r,[`${t}_jql`]:n,[`${t.toUpperCase()}_JQL`]:n};return/\-/.test(t)&&(t=K(t),o[t]=r,o[`${t}_jql`]=n),o}function Ke(t){return function(e,[r,n]){return Object.defineProperties(e,Xt(r,t)),e}}var x=Zt(tr());function tr(){return function(r,n,o=T.BeforeEnd){let i=c(n,HTMLBRElement);n=(!i&&n&&n.isJQL?n[0]:n)||document.body,o=o&&Object.values(T).find(h=>o===h)?o:void 0;let u=_t(r),S=!u&&Wt(r),L=S||u,y={collection:Gt(r)??[],isVirtual:i,isJQL:!0},w=zt(y.collection);location.host.startsWith("dev")&&(y.params={virtual:y.isVirtual,jql:y.isJQL,isRawHtml:u,isRawHtmlArray:S,isRawElemCollection:w});let F=`input => ${S?`"${A(r.join(", "),70)}"`:!L&&w?`element collection [${A(y.collection.map(h=>`${c(h,Comment,Text)?"Comment|Text @":""} ${h?.outerHTML||h?.textContent}`).join(", "),70)}]`:`"${A(r,70)}"`}`;if(y.collection.length&&w)return R(F),i||y.collection.forEach(h=>{n.contains(h)||B([h],n,o)}),_(y);if(L){if([r].flat().forEach(h=>y.collection.push(j(h))),y.collection.length>0){let h=y.collection.filter(d=>d?.dataset?.jqlcreationerror);y.collection=y.collection.filter(d=>!d?.dataset?.jqlcreationerror),R(`${F}`),R(`*Created ${y.isVirtual?"VIRTUAL ":""}[${A(Ut(y.collection)||"sanitized: no elements remaining",70)}]`),h.length&&console.error(`JQL: illegal html, not rendered: "${h.reduce((d,p)=>d.concat(`${p.textContent}
`),"").trim()}"`),y.isVirtual||B(y.collection,n,o)}return _(y)}let g=Vt(r,n,y);return R(`input => ${g}`),_(y)}}export{x as default};