@pacem/pacem 1.0.5-bartels → 1.0.5-curry
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/dist/browser/pacem-2d.js +1 -1
- package/dist/browser/pacem-2d.min.js +1 -1
- package/dist/browser/pacem-3d.js +1 -1
- package/dist/browser/pacem-3d.min.js +1 -1
- package/dist/browser/pacem-charts.js +1 -1
- package/dist/browser/pacem-charts.min.js +1 -1
- package/dist/browser/pacem-cms.js +1 -1
- package/dist/browser/pacem-cms.min.js +1 -1
- package/dist/browser/pacem-core.js +2 -2
- package/dist/browser/pacem-core.js.map +1 -1
- package/dist/browser/pacem-core.min.js +2 -2
- package/dist/browser/pacem-foundation.js +1 -1
- package/dist/browser/pacem-foundation.min.js +1 -1
- package/dist/browser/pacem-fx.js +1 -1
- package/dist/browser/pacem-fx.min.js +1 -1
- package/dist/browser/pacem-logging.js +1 -1
- package/dist/browser/pacem-logging.min.js +1 -1
- package/dist/browser/pacem-maps.js +1 -1
- package/dist/browser/pacem-maps.min.js +1 -1
- package/dist/browser/pacem-media.js +1 -1
- package/dist/browser/pacem-media.min.js +1 -1
- package/dist/browser/pacem-networking.js +1 -1
- package/dist/browser/pacem-networking.min.js +1 -1
- package/dist/browser/pacem-numerical.js +1 -1
- package/dist/browser/pacem-numerical.min.js +1 -1
- package/dist/browser/pacem-plus.js +1 -1
- package/dist/browser/pacem-plus.min.js +1 -1
- package/dist/browser/pacem-scaffolding.js +1 -1
- package/dist/browser/pacem-scaffolding.min.js +1 -1
- package/dist/browser/pacem-ui.js +1 -1
- package/dist/browser/pacem-ui.min.js +1 -1
- package/dist/bundle/pacem.min.mjs +2 -2
- package/dist/bundle/pacem.mjs +2 -2
- package/dist/bundle/pacem.mjs.map +2 -2
- package/dist/typings/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/browser/pacem-fx.js
CHANGED
package/dist/browser/pacem-ui.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @pacem/pacem v1.0.5-
|
|
2
|
+
* @pacem/pacem v1.0.5-curry (https://js.pacem.it)
|
|
3
3
|
* Pacem (https://pacem.it)
|
|
4
4
|
* Licensed under Apache-2.0
|
|
5
5
|
*/
|
|
@@ -10,7 +10,7 @@ var Hv=Object.defineProperty;var hx=Object.getOwnPropertyDescriptor;var Bv=o=>{t
|
|
|
10
10
|
`).trim()}var zu=class{constructor(r=(e,t)=>e?.text||""){this._extraItemRender=r;this._renderContent=r=>{let e=r.tokens;return be.isNullOrEmpty(e)?r.text:this._render(e)}}_rendeItem(r,e){let t=this._renderContent,n=jx;switch(r?.type){case"ref":return"";case"html":return r.raw;case"blockquote":return`<blockquote>
|
|
11
11
|
${t(r)}</blockquote>${n}`;case"bold":return`<b>${t(r)}</b>`;case"codeblock":let i=r.lang;return`<pre>${n}<code${i?' class="'+i+'"':""}>${t(r)}</code>${n}</pre>${n}`;case"code":return`<code>${t(r)}</code>`;case"hr":return`<hr />${n}`;case"heading":let s=r.level,l=r.ref;return`<h${s} id="${l}">${t(r)}</h${s}>${n}`;case"img":case"imglike":let p=r,u=p.src,f="",g=p.text,v=p.ref;if(!u&&v){let E=e.find(k=>k.type==="ref"&&k.image===!0&&k.id?.toLowerCase()===v.toLowerCase());E&&(u=E.url,f=E.title??"")}return u?`<img src="${u}" alt="${g}"${f?' title="'+f+'"':""} />`:`![${t(r)}]`;case"italic":return`<i>${t(r)}</i>`;case"strike":return`<s>${t(r)}</s>`;case"quote":return`<q>${t(r)}</q>`;case"br":return"<br />"+n;case"ol":return`<ol start="${r.start}">
|
|
12
12
|
${t(r)}</ol>${n}`;case"ul":return`<ul>
|
|
13
|
-
${t(r)}</ul>${n}`;case"listitem":return` <li>${t(r)}</li>${n}`;case"link":case"linklike":let y=r,_=y.href,x="",w=y.ref;if(!_&&w){let E=e.find(k=>k.type==="ref"&&k.image!==!0&&k.id?.toLowerCase()===w.toLowerCase());E&&(_=E.url,x=E.title??"")}return _?`<a href="${_}"${x?' title="'+x+'"':""}>${t(r)}</a>`:`[${t(r)}]`;case"paragraph":return`<p>${t(r)}</p>${n}`;case"text":case"space":return r.text}return this._extraItemRender(r,e)}_render(r){let e="";for(let t of r||[])e+=this._rendeItem(t,r);return e}render(r){return Xx(this._render(r))}},Xm=class{_render(r){return be.isNullOrEmpty(r)?"":JSON.stringify(r)}render(r){return"["+r.filter(e=>!be.isNullOrEmpty(e)).map(this._render).join(",")+"]"}};function qx(o){return o&&typeof o=="object"&&typeof o.render=="function"}var qm=class extends $p{toHtml(r,e,t){let n=new zu(t);return be.isNullOrEmpty(e)?this.parse(r,n):this.parse(r,Uu(e),n)}tokenize(r,e){let t=this.parse(r,Uu(e),new Xm);return JSON.parse(t)}parse(r,e=Uu(),t=new zu){return qx(e)?super.parse(r,Uu(),e):super.parse(r,e,t)}};var Wl=class o{constructor(){}static clone(r){return new o()._clone(r)}_clone(r){let e=new WeakMap;function t(n){if(typeof n=="object"&&n!==null&&!(n instanceof Element)&&!(n instanceof FileSystemHandle)&&!(n instanceof File)){if(Array.isArray(n))return n.map(t);if(n instanceof Date)return new Date(n.valueOf());if(n instanceof RegExp)return new RegExp(n);if(e.has(n))return e.get(n);{let i=Object.assign({},n);return e.set(n,i),Object.keys(i).forEach(s=>{i[s]=t(n[s])}),i}}return n}return t(r)}};var vo="$refId",Jv=(t=>(t[t.Ignore=0]="Ignore",t.Reference="reference",t.Plain="plain",t))(Jv||{}),Fu=class{static{this._jsonFnWeakMap=new WeakMap}static{this._jsonFnMap=new Map}static store(r){let e=this._jsonFnWeakMap;if(!e.has(r)){let t=Qs.uniqueCode();e.set(r,t),this._jsonFnMap.set(t,r)}return e.get(r)}static retrieve(r){return this._jsonFnMap.get(r)}static remove(r){let e=this.retrieve(r);this._jsonFnMap.delete(r),this._jsonFnWeakMap.delete(e)}},Hp=class _Json{constructor(o){this._options=o}static serialize(o,r){return new _Json(r)._serialize(o)}static deserialize(o){return new _Json()._deserialize(o)}_serialize(o){let r=Wl.clone(o),e=[vo],t=this._flatten(r,0,null,e);return JSON.stringify(t,e.sort())}_deserialize(json){let hasRefs=!1,obj=JSON.parse(json,(key,value)=>{let elPattern=/^\$<#(.+)>$/,fnPattern=/^\$<fn:([^\x05]+)>$/,regexPattern=/^\$<regex:(.+)>$/,fnRefPattern=/^\$<fn#(.+)>$/,arr;if(key===vo)hasRefs=!0;else if(typeof value=="string")if((arr=regexPattern.exec(value))&&arr.length>1){let o=arr[1],r=o.lastIndexOf("|");return new RegExp(o.substr(0,r),o.substr(r+1))}else{if((arr=elPattern.exec(value))&&arr.length>1)return document.getElementById(arr[1]);if((arr=fnPattern.exec(value))&&arr.length>1)return eval(arr[1]);if((arr=fnRefPattern.exec(value))&&arr.length>1)return Fu.retrieve(arr[1])}return value});return hasRefs?this._revive(obj):obj}_flatten(o,r=0,e,t){if(e=e||new WeakSet,t=t||[],o instanceof Element)return o.id?`$<#${o.id}>`:void 0;if(o instanceof RegExp)return`$<regex:${o.source}|${o.flags}>`;if(typeof o=="object"&&o!=null&&!(o instanceof Date))return Array.isArray(o)?o.map(n=>this._flatten(n,r,e,t)):e.has(o)?o[vo]=o[vo]||"$#ref_"+r++:(e.add(o),Object.keys(o).forEach(n=>{t.indexOf(n)===-1&&t.push(n),o[n]=this._flatten(o[n],r,e,t)}),o);if(typeof o=="function")switch(this._options?.functions){case"reference":return"$<fn#"+Fu.store(o)+">";case"plain":return"$<fn:"+o+">";default:return}return o}_revive(o){let r={},e=/^\$#ref_(.+)$/;function t(n){if(typeof n=="object"&&n!==null){if(Array.isArray(n))return n.map(t);vo in n&&(r[n[vo]]=n,delete n[vo]),Object.keys(n).forEach(i=>{n[i]=t(n[i])})}else if(typeof n=="string"&&e.test(n)){let i=e.exec(n);return r[i[0]]}return n}return t(o)}};var _t=class o{constructor(){this.deferred=null;var r=this;r.promise=new Promise(function(e,t){r.deferred={resolve:e,reject:t,promise:r}})}then(r,e){return this.promise.then(r,e)}finally(r){return this.promise.then(r,r),this}success(r){return this.promise.then(r,null),this}error(r){return this.promise.then(null,r),this}static defer(){var r=new o;return r.deferred}};var Kx="pacem",Zv="download",Re=o=>{o.stopPropagation()},jl=o=>{o.preventDefault()},Q=o=>{o.preventDefault(),o.stopPropagation()},Qv=/^\/[^\/]+/,Jx=/\/\{([a-z\$_][\w]*)\??\}/,a=class o{static get core(){let r=window.Pacem;var e=r&&r.Configuration&&r.Configuration.core||Kx;return window[e]=window[e]||{}}static get customElements(){return window.customElements}static uniqueId(){return Qs.uniqueId()}static uniqueCode(){return Qs.uniqueCode()}static randomString(r){return Qs.randomString(r)}static parseDate(r){return br.parse(r)}static copyToClipboard(r){return navigator.clipboard?navigator.clipboard.writeText(r):new Promise((e,t)=>{let n=document.createElement("textarea");n.value=r,n.style.opacity="0",document.body.appendChild(n);try{n.select(),document.execCommand("copy"),n.remove(),e()}catch(i){t(i)}})}static{this.Json={stringify:Hp.serialize,parse:Hp.deserialize}}static{this.Dates={now:()=>o.parseDate(Date.now()),parse:o.parseDate,isLeapYear:br.isLeapYear,daysInMonth:br.daysInMonth,isDate:br.isDate,dateOnly:br.dateOnly,addMonths:br.addMonths,addDays:br.addDays,daysBetween:br.daysBetween}}static colorize(r,e){let t={h:38,s:.245,l:.6};var n,i,s,l;r instanceof HTMLElement?n=e:n=r,typeof n=="string"?i=Be.parse(n):i={r:n[0],g:n[1],b:n[2]};let p=Be.hsl(i);if(s=`brightness(50%) sepia(1) hue-rotate(${p.h-t.h}deg) saturate(${1+(p.s-t.s)}) brightness(${1+(p.l-t.l)})`,n===e)l.style.filter=s;else return s}static cssEscape(r){return escape(r).replace("%","\\")}static{this.Css={colorize:o.colorize,escape:o.cssEscape,getVariableValue(r){return getComputedStyle(document.documentElement).getPropertyValue(r)},setVariable(r,e){getComputedStyle(document.documentElement).setProperty(r,e)},isClassDefined(r){let e=new RegExp("."+r+"($|[s.,])");for(let t=0;t<document.styleSheets.length;t++){let n=document.styleSheets.item(t);try{let i=n.cssRules;for(let s=0;s<i.length;s++){let l=n.cssRules.item(s);if(e.test(l.selectorText))return!0}}catch(i){i instanceof DOMException&&console.warn(`Couldn't access cssRules of stylesheet "`+n.href+'".')}}return!1},deserializeTransform(r){let e=r instanceof Element?getComputedStyle(r):r,t=1,n=0,i=0,s=1,l=0,p=0,u=/^matrix\((.*)\)$/.exec(e.transform),f;return u&&u.length>1&&(f=u[1].split(",")).length==6&&(t=parseFloat(f[0]),n=parseFloat(f[1]),i=parseFloat(f[2]),s=parseFloat(f[3]),l+=parseFloat(f[4]),p+=parseFloat(f[5])),{a:t,b:n,c:i,d:s,e:l,f:p}}}}static{this.leftPad=gn.leftPad}static{this.formatString=gn.format}static{this.diff=gn.diff}static{this.Strings={leftPad:gn.leftPad,format:gn.format,diff:gn.diff,stripHTML:r=>new DOMParser().parseFromString(r,"text/html").body.textContent||""}}static{this.Blobs={toDataURL:mo.blobToDataURL,fromDataURL:mo.dataURLToBlob,toText:mo.blobToText,fromText:mo.textToBlob}}static{this.Images={load:fo.loadImage,resize:fo.resizeImage}}static loadImage(r){return new Promise((e,t)=>{let n=new Image;n.src=r,n.complete?e(n):(n.onload=i=>{e(n)},n.onerror=i=>{t()})})}static blobToDataURL(r){return o.Blobs.toDataURL(r)}static dataURLToBlob(r){return o.Blobs.fromDataURL(r)}static blobToText(r,e){return o.Blobs.toText(r,e)}static textToBlob(r,e="text/plain"){return o.Blobs.fromText(r,e)}static resizeImage(r,e,t,n){var i=_t.defer();return o.blobToDataURL(r).then(o.loadImage).then(s=>{let l=s.width,p=s.height,u=document.createElement("canvas");u.width=l,u.height=p;let f=u.getContext("2d");if(l>e||p>t){let g=l/p,v=e/t,y,_;v<g?(_=e,y=e/g):(y=t,_=t*g),u.width=_,u.height=y;let x=n>0&&n<=1;x&&(f.fillStyle="#000",f.fillRect(0,0,u.width,u.height)),o.cropImageOntoCanvas(s,f);let w;x?w=f.canvas.toDataURL("image/jpeg",n):w=f.canvas.toDataURL(),i.resolve(o.dataURLToBlob(w))}else i.resolve(r)},s=>{}),i.promise}static cropImage(r,e,t,n){var i=_t.defer();let s=new Image;return s.crossOrigin="anonymous",s.onload=function(l){let p=document.createElement("canvas"),u=p.getContext("2d");e&&(p.width=e),t&&(p.height=t);let f=n>0&&n<=1;f&&(u.fillStyle="#000",u.fillRect(0,0,p.width,p.height)),o.cropImageOntoCanvas(s,u),i.resolve(f?p.toDataURL("image/jpeg",n):p.toDataURL())},s.src=r,i.promise}static getUserMediaFunctions(){var r=[];let t=[navigator.getUserMedia,navigator.webkitGetUserMedia,navigator.msGetUserMedia,navigator.mozGetUserMedia].filter(function(n,i){return typeof n=="function"});return t.length&&(r=t),r}static cropImageOntoCanvas(r,e,t,n){e.imageSmoothingEnabled=e.mozImageSmoothingEnabled=e.oImageSmoothingEnabled=e.webkitImageSmoothingEnabled=!0;let i=e.canvas.width,s=e.canvas.height,l=i,p=s,u=t||1*r.width,f=n||1*r.height;var g=u/f,v=i/s;if(v>g){var y=i/u;s=y*f,e.drawImage(r,0,.5*(-s+p),l,s)}else{var y=s/f;i=y*u,e.drawImage(r,-Math.abs(.5*(-i+l)),0,i,p)}}static get _domURL(){return window.URL||window.webkitURL||window}static snapshotElement(r,e,t="image/png",n){function i(s){return new Promise((l,p)=>{let u=document.createElement("canvas"),f=s.width,g=s.height;if(!(f>0))p("Image has width zero.");else if(!(g>0))p("Image has height zero.");else{u.width=f,u.height=g;let v=u.getContext("2d");o.isNullOrEmpty(e)||(v.fillStyle=e,v.fillRect(0,0,f,g)),v.drawImage(s,0,0),u.toBlob(y=>{l(y)},t,n)}})}return r instanceof HTMLCanvasElement?i(r):new Promise((s,l)=>{let p=[];function u(w){let E=new Promise((k,N)=>{let T=()=>w instanceof HTMLImageElement?w.src:w.href.baseVal,O=D=>{w instanceof HTMLImageElement?w.src=D:w.setAttribute("href",D)};fetch(T()).then(D=>D.blob()).then(D=>o.blobToDataURL(D)).then(D=>{O(D),k()})});p.push(E)}function f(w,E){let k=new Promise((N,T)=>{let O=new Image;O.crossOrigin="anonymous",O.width=E.width,O.height=E.height,O.style.cssText=w.style.cssText,O.onload=()=>{w.replaceWith(O),N()},O.src=E.toDataURL()});p.push(k)}function g(w,E){let k=getComputedStyle(E);for(let N=0;N<k.length;N++){let T=k.item(N);w.style[T]=k[T]}}function v(w,E){g(w,E),w instanceof HTMLImageElement||w instanceof SVGImageElement?u(w):w instanceof HTMLCanvasElement&&f(w,E);let k=w.children.length;for(let N=0;N<k;N++){let T=w.children.item(N),O=E.children.item(N);T.tagName===O.tagName&&v(T,O)}}if(r instanceof SVGElement){let w=r.cloneNode(!0);v(w,r),Promise.all(p).then(E=>{r=w,x()})}else{var _=document.implementation.createHTMLDocument("");_.write(r.outerHTML),_.documentElement.setAttribute("xmlns",_.documentElement.namespaceURI);let E=document.evaluate(".//"+r.localName,_.body,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;E.setAttribute("xmlns",_.documentElement.namespaceURI),v(E,r),Promise.all(p).then(k=>{let N=document.createElementNS("http://www.w3.org/2000/svg","svg"),T=o.offset(r);N.setAttribute("viewBox",`0 0 ${T.width} ${T.height}`),N.setAttribute("width",T.width.toString()),N.setAttribute("height",T.height.toString()),N.innerHTML=`<foreignObject width="${T.width}" height="${T.height}">${E.outerHTML}</foreignObject>`,r=N,x()})}function x(){let w=new XMLSerializer().serializeToString(r),E=new Image;E.crossOrigin="anonymous";let k="data:image/svg+xml;charset=utf8,"+encodeURIComponent(w);E.onload=()=>{i(E).then(s)},E.src=k}})}static async download(r,e,t="application/download"){if(typeof r=="string"){let l=r,p={},u;o.isNullOrEmpty(e)||(typeof e=="object"?(p={credentials:e.credentials,headers:e.headers},u=e.filename||u,t=e.mime||t):u=e);var n=await fetch(l,p);if(n.ok){if(o.isNullOrEmpty(u)){let g="Content-Disposition";if(n.headers.has(g)){let v=n.headers.get(g),y=/^attachment; filename=\"?([^;\"]+)\"?(;|$)/.exec(v);y.length>1&&(u=y[1])}else u=Zv}var i=await n.blob();let f=u.split(/[\\\/]/g).join("_");return o.download(i,f)}{let f=await n.text();throw new Error(f)}}else{let l=r,p=typeof e=="string"&&e||Zv,u=document.createElement("a");if(u.setAttribute("href",o._domURL.createObjectURL(l)),u.setAttribute("download",p),document.createEvent){var s=document.createEvent("MouseEvents");s.initEvent("click",!0,!0),u.dispatchEvent(s)}else u.click()}}static isDOMReady(){return document.readyState==="complete"}static onDOMReady(r){window.addEventListener("load",r,!1)}static moveChildren(r,e){return o.moveItems(r.childNodes,e)}static moveItems(r,e){let t=[],n;for(let i=r.length-1;i>=0;i--){let s=r instanceof NodeList?r.item(i):r[i];e.insertBefore(s,n),t.unshift(s),n=s}return t}static is(r,e){return(r.matches||r.matchesSelector||r.msMatchesSelector||r.mozMatchesSelector||r.webkitMatchesSelector||r.oMatchesSelector).call(r,e)}static lang(r){return r.lang||document.documentElement.lang||navigator.language}static jsonSortStringify(r){return o.isNull(r)?r:o.Json.stringify(r)}static{this.Browsers={detect:Bu}}static cookies(r){let e=(r??document.cookie).split(";"),t={};for(var n of e){let i=n.split("=");if(i.length<2)continue;let s=(i[0]||"").trim(),l=(i[1]||"").trim();Object.defineProperty(t,s,{configurable:!1,enumerable:!0,writable:!1,value:decodeURIComponent(l.split("+").join(" "))})}return t}static{this.Cookies={getAll:async r=>{let e="cookieStore"in window?window.cookieStore:null,t=[];if(o.isNull(e)){let n=o.cookies();for(let i in n)!o.isNullOrEmpty(r)&&r!==i||t.push({name:i,value:n[i]});return t}else return await e.getAll(r)},stringify:r=>{let e=`${r.name}=${encodeURIComponent(r.value??"")}`;return o.isNullOrEmpty(r.domain)||(e+=`; domain=${encodeURIComponent(r.domain)}`),o.isNullOrEmpty(r.path)||(e+=`; path=${encodeURIComponent(r.path)}`),r.maxAge>0&&(e+=`; max-age=${r.maxAge.toFixed(0)}`),o.isNullOrEmpty(r.expires)||(e+=`; expires=${r.expires}`),r.partitioned&&(e+="; Partitioned"),o.isNullOrEmpty(r.sameSite)||(e+=`; SameSite=${encodeURIComponent(r.sameSite)}`),r.secure&&(e+="; Secure"),e}}}static isVisible(r){return"checkVisibility"in r?r.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0}):getComputedStyle(r).visibility!=="hidden"&&(r.clientWidth>0||r.clientHeight>0)}static hasClass(r,e){return r.classList?r.classList.contains(e):new RegExp("(^| )"+e+"( |$)","gi").test(r.className)}static addClass(r,e){let t=e.trim();r.classList?DOMTokenList.prototype.add.apply(r.classList,t.split(" ")):r.setAttribute("class",r.className+" "+t)}static removeClass(r,e){let t=e.trim();r.classList?DOMTokenList.prototype.remove.apply(r.classList,t.split(" ")):r.setAttribute("class",r.className.replace(new RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," "))}static toggleClass(r,e,t){t?o.addClass(r,e):o.removeClass(r,e)}static hasPart(r,e){return r.part.contains(e)}static addPart(r,e){DOMTokenList.prototype.add.apply(r.part,e.trim().split(" "))}static removePart(r,e){DOMTokenList.prototype.remove.apply(r.part,e.trim().split(" "))}static togglePart(r,e,t){t?o.addPart(r,e):o.removePart(r,e)}static offset(r){var e=r.getBoundingClientRect();return{top:Math.round(e.top)+o.scrollTop,left:Math.round(e.left)+o.scrollLeft,width:Math.round(e.width),height:Math.round(e.height)}}static offsetRect(r){var e=this.offset(r);return{y:e.top,x:e.left,width:e.width,height:e.height}}static naturalOffsetTop(r){return(r?.offsetTop??0)+(r?.offsetParent&&r.offsetParent instanceof HTMLElement?this.naturalOffsetTop(r.offsetParent):0)}static naturalOffsetLeft(r){return(r?.offsetTop??0)+(r?.offsetParent&&r.offsetParent instanceof HTMLElement?this.naturalOffsetLeft(r.offsetParent):0)}static naturalOffset(r){return{left:this.naturalOffsetLeft(r),top:this.naturalOffsetTop(r),width:r?.offsetWidth??0,height:r?.offsetHeight??0}}static naturalOffsetRect(r){var e=this.naturalOffset(r);return{y:e.top,x:e.left,width:e.width,height:e.height}}static deserializeTransform(r){return o.Css.deserializeTransform(r)}static set scrollTop(r){window.scrollTo(o.scrollLeft,r)}static set scrollLeft(r){window.scrollTo(r,o.scrollTop)}static scrollTo(r,e=!0,t=!0){let n=o.isNull(e)||typeof e=="boolean",i=n?o.scrollLeft:r,s=n?r:e,l=(n?e:t)?"smooth":"instant";window.scrollTo({behavior:l,left:i,top:s})}static get scrollTop(){return window.scrollY||document.documentElement.scrollTop||document.body.scrollTop||0}static get scrollLeft(){return window.scrollX||document.documentElement.scrollLeft||document.body.scrollLeft||0}static get windowSize(){let r=window;return{width:r.innerWidth||r.document.documentElement.clientWidth||r.document.body.clientWidth||0,height:r.innerHeight||r.document.documentElement.clientHeight||r.document.body.clientHeight||0}}static addAnimationEndCallback(r,e,t=500){let n=s=>{(!s||s.target==r)&&(clearTimeout(i),r.removeEventListener("animationend",n,!1),r.removeEventListener("transitionend",n,!1),e.apply(this,[r]))};r.addEventListener("animationend",n,!1),r.addEventListener("transitionend",n,!1);let i=setTimeout(n,t)}static waitForAnimationEnd(r,e=500){return new Promise((t,n)=>{o.addAnimationEndCallback(r,()=>{t()},e)})}static idle(r){return new Promise((e,t)=>{setTimeout(()=>e(),r)})}static accelerateCallback(r,e=500,t=5,n=20){let i={cancel:!1},s=e,l=t+n,p=()=>{r(i),i.cancel||(setTimeout(p,s),s<l?s=n:s-=t)};p()}static isEmpty(r){return be.isEmpty(r)&&!(r instanceof Node)}static isNull(r){return be.isNull(r)}static isArray(r){return Array.isArray(r)}static isNullOrEmpty(r){return o.isNull(r)||o.isEmpty(r)}static areSemanticallyEqual(r,e){r??=null,e??=null;let t=r&&r.valueOf&&r.valueOf(),n=e&&e.valueOf&&e.valueOf();return t===n}static{this.extend=Object.assign}static clone(r){if(r!==void 0)return Wl.clone(r)}static fromResult(r){return Promise.resolve(r)}static fromResultAsync(r){return new Promise(e=>requestAnimationFrame(()=>e(r())))}static readonlyCopy(r){if(o.isNull(r))return null;if(o.isArray(r)){let e=r.slice(0);return Object.freeze(e),e}else{let e={};for(let t in r)e[t]=r[t];return Object.freeze(e),e}}static{this.URIs={format:function(r,e,t){for(let s in e||{}){let p=new RegExp("(^|\\/)\\{"+s+"\\??\\}(\\/|$)").exec(r);if(p&&p.length){let u=new RegExp("\\{"+s+"\\??\\}"),f=p.index;r=r.substring(0,f)+r.substring(f).replace(u,encodeURIComponent(e[s])),t&&delete e[s]}}let n=/(^|\/)\{[\w]+\?\}(\/|$)/;for(var i;(i=n.exec(r))&&i.length>0;){let s=i[0];r=r.replace(s,s.endsWith("/")?"/":"")}return r},appendQuery:function(r,e,t=!1,n=!1){let i=n?"#":"?",l=((n?/#/:/\?/).test(r)?"&":i)+Object.keys(e).filter(p=>!o.isNull(e[p])||!t).map(p=>encodeURIComponent(p)+"="+encodeURIComponent(e[p]??"")).join("&");return r+(l.length>1?l:"")},parseQuery:(r=window.location)=>{typeof r!="string"&&(r=r.search);let e={};return new URLSearchParams(r).forEach((t,n)=>{Object.defineProperty(e,n,{enumerable:!0,value:t})}),e},hasMandatoryTemplateSegments:function(r){return/(^|\/)\{\.*\}(\/|$)/.test(r)},parseRoute:function(r){let e=r,t=[];if(!o.isNullOrEmpty(e)){let n,i=0;for(;(n=Qv.exec(e))!=null;){let s=n[0],l=Jx.exec(s);if(!o.isNullOrEmpty(l)){let p=l[1];t.push({name:p,optional:s.charAt(s.length-2)==="?",index:i})}e=e.substring(n.index+s.length),i++}}return t},split:function(r){let t=/^((https?:)?\/\/[^\/]+)?([^\?#]+)(\?[^#]*)?(#[^#]*)?$/.exec(r);return t?{domain:t[2]??"",protocol:t[1]??"",path:t[3]??"",query:t[4]??"",hash:t[5]??""}:null},parseState:function(r,e,t,n,i){let s=e;if(o.isNullOrEmpty(t)){let v=o.URIs.split(e);t=v.path,o.isNullOrEmpty(n)&&(n=v.query??""),o.isNullOrEmpty(i)&&(i=v.hash??""),s=t+n+i}let l=v=>{let y=v.indexOf("#");return y!==0?null:v.substring(y+1)},p=v=>{let y=v.indexOf("?");return y===0?o.URIs.parseQuery(v.substring(y+1)):{}},u={$path:s,$pathname:t,$querystring:n.length>0?n.substring(1):n,$query:p(n),$hash:l(i)},f=0,g=r.slice();if(!o.isNullOrEmpty(g)){let v;for(;(v=Qv.exec(t))!=null;){let y=v[0],_=g.findIndex(x=>x.index===f);if(_>=0){let x=g[_],{name:w}=x;Object.defineProperty(u,w,{enumerable:!0,value:y.substring(1)}),g.splice(_,1)}f++,t=t.substring(v.index+y.length)}}for(let v=0;v<g.length;v++)if(!g[v].optional)throw`Must provide "${g[v].name}" route value.`;return u}}}static getApiResult(r){if(typeof r=="object"&&!o.isNull(r)&&r.hasOwnProperty("success"))switch(r.success){case!0:if(r.hasOwnProperty("result"))return r.result;break;case!1:if(r.hasOwnProperty("error"))return null;break}return r}};var Zk=Function,Wu="pacem:properties",Yl="pacem:custom-element:bindings",ea="pacem:custom-element:host",Bp="pacem:custom-element:scope";var eb,d=(eb=window.Pacem)?.Configuration?.prefix??"pacem",b=eb?.Configuration?.css??d;var zi="__context_pacem",Zx=/'(\\'|[^'])*[^\\]?'|"(\\"|[^"])*[^\\]?"/g,Qx=/[^\w]new\s|[^\w]window\s*[\.\[]|[^\w]document\s*\.|[^\w]eval\s*\(/,tb=/(^|[\s\(\[\+\-\*\/!])(:host\.|\^+item[\s\.,;\)\]]|\^+item$|\^+index[^\w\.]|\^+index$|\$?this[\.\s$]?|#[a-zA-Z_][\w]*|::[a-zA-Z_][\w]*)/g,ta=class o{constructor(){this._pending=!1;this._independent=!1}get dependencies(){return this._dependencies}get functionBody(){return this._fnBody}get voidBody(){return this._voidBody}get pending(){return this._pending}get independent(){return this._independent}evaluate(){return this._fn||(this._fn=new Function("$pacem",zi,this._fnBody)),this._fn.apply(null,[a.core,this._args])}evaluateAsync(){let r=_t.defer();return this._fn||(this._fn=new Function("$pacem",zi,this._fnBody)),r.resolve(this._fn.apply(null,[a.core,this._args])),r.promise}evaluatePlus(r={}){if(!this._fn){let n=[zi];for(var e in r)n.push(e);n.push("$pacem"),this._fn=new Function(n.join(", "),this._voidBody)}let t=[].concat(this._args);for(var e in r)t.push(r[e]);return t.push(a.core),this._fn.apply(null,t)}static{this._pendingExpression=null}static _getPendingExpressionSingleton(){if(o._pendingExpression==null){let r=new o;r._pending=!0,r._dependencies=[],o._pendingExpression=r}return o._pendingExpression}static parse(r,e){for(var t=A.findScopeContext(e),n={$this:e},i=[],s="",l=!0,p=[],u,f=0,g=[];(u=Zx.exec(r))!=null;){g.push(r.substr(f,u.index-f));let w=u[0].length;p.push({start:u.index,length:w}),f=u.index+w}f<r.length&&g.push(r.substr(f,r.length-f));for(var v=0;v<g.length;v++){let w=g[v];if(Qx.test(w))throw`Unsafe expression detected: "${w}".`;if(t==null){if(new RegExp(tb).test(w)===!0){l=!1;break}}else{let E=w.replace(tb,(k,N,T,O,D)=>{l=!1;let P="__host_pacem",F=zi+".$this"+(T.endsWith(".")?".":""),B=e,$=D.indexOf(".",O),U=$>O?D.substr($+1).trim():"",I=/^[\w\.\$]+/.exec(U),G=I&&I.length>0&&I[0],Y,W=G&&(Y=G.split(".")).length>0&&Y[0];if(T===":host.")B=n[P]=n[P]||A.findHostContext(e),F=`${zi}.${P}.`;else if(T.endsWith("^item")||T.substr(0,T.length-1).endsWith("^item")){let V=T.endsWith("^item")?"":T.substr(T.length-1,1),X=T.length-(V.length>0?6:5),q=`__item_${X}_up_pacem`,Z=ra.findItemContext(e,X);B=n[q]=n[q]||Z&&Z.placeholder,G="item"+(G?"."+G:""),W="item",F=`${zi}.${q}.item${V}`}else if(T.endsWith("^index")||T.substr(0,T.length-1).endsWith("^index")){let V=T.endsWith("^index")?"":T.substr(T.length-1,1),X=T.length-(V.length>0?7:6),q=`__item_${X}_up_pacem`,Z=ra.findItemContext(e,X);B=n[q]=n[q]||Z&&Z.placeholder,G="index",W="index",F=`${zi}.${q}.index${V}`}else if(T.startsWith("::")){let V=T.substr(2,T.length-2),X=n[P]=n[P]||A.findHostContext(e);a.isNull(X)?B=null:B=X[V],F=`${zi}.${P}.${V}`}else if(T.startsWith("#")){let V=T.substr(1,T.length-1);B=n[V]=n[V]||t.querySelector("#"+V),F=`${zi}.${V}`}return W&&B&&W in B&&typeof B[W]!="function"&&i.find(V=>V.element===B&&V.property==W)==null&&i.push({element:B,property:W,path:G,twowayAllowed:!1}),N+F});if(s+=E,v<p.length){let k=p[v];s+=r.substr(k.start,k.length)}}}if(l){var y=new o;return y._independent=!0,y._fnBody=`return ${r};`,y._voidBody=r,y._dependencies=[],y}if(t==null)return this._getPendingExpressionSingleton();for(var _ in n)if(n[_]==null)return o._getPendingExpressionSingleton();i.length==1&&/[^\w\.\$]+/.test(s.trim())!==!0&&(i[0].twowayAllowed=!0);var x=new o;return x._args=n,x._fnBody=`try{ var ___$$$r = ${s}; return ___$$$r; }catch(e){ }`,x._voidBody=`try{ ${s} }catch(e){ }`,x._dependencies=i,x}};var Xl=class extends HTMLElement{};var ju="__pacem__",eC=/^\{\{(.|\n)+\}\}$/,A=class o{static get polyfilling(){return customElements instanceof window.CustomElementRegistry}static camelToKebab(r){return r&&r.replace(/([A-Z])/g,"-$1").toLowerCase()}static kebabToCamel(r){return r&&r.replace(/(-[a-z])/g,e=>e[1].toUpperCase())}static waitForReady(r){return new Promise((e,t)=>{a.isNull(r)&&t("Not found."),r.isReady&&e();let n=()=>{r.removeEventListener("load",n),e()};r.addEventListener("load",n)})}static whenReady(r,e){o.waitForReady(r).then(e)}static getWatchedProperties(r,e=!0){var t=[],n=r instanceof HTMLElement?r.constructor:r;do{let s=(this.getAttachedPropertyValue(n,Wu)||[]).filter(l=>!l.name.startsWith("_"));Array.prototype.splice.apply(t,[0,0].concat(s))}while(e&&(n=Object.getPrototypeOf(n)));return t}static getWatchedProperty(r,e){return this.getWatchedProperties(r,!0).find(t=>t.name===e)}static importjs(r,e=null,t=!1){var n={type:"text/javascript",src:r};return a.isNullOrEmpty(e)||a.extend(n,{integrity:e}),t&&a.extend(n,{crossorigin:""}),o.import(r,"script",n,document.head||document.getElementsByTagName("head")[0])}static importcss(r,e=null,t=!1){var n={rel:"stylesheet",href:r};return a.isNullOrEmpty(e)||a.extend(n,{integrity:e}),t&&a.extend(n,{crossorigin:"anonymous"}),o.import(r,"link",n,document.head||document.getElementsByTagName("head")[0])}static import(r,e,t,n=document.body){let i=a.core;var s=i.imports=i.imports||{};return s[r]=s[r]||new Promise((l,p)=>{var u=e;for(let v in t||{})u+=`[${v}="${t[v]}"]`;var f=document.querySelector(u);if(!a.isNull(f))l(f);else{f=document.createElement(e),f.onerror=v=>{p(v)},f.onload=()=>{l(f)};for(var g in t||{})f.setAttribute(g,t[g]);n.appendChild(f)}})}static{this.Theme={importWebFonts(){function r(i){return/^('|").*\1$/.test(i)?i.substring(1,i.length-1):i}function e(i){return a.isNullOrEmpty(i)?Promise.resolve():document.fonts.load("1rem "+i)}let t=["icons","std","main","tech","btn"].map(i=>{let s=a.Css.getVariableValue(`--${b}-font-${i}`).split(",")[0],l=r(a.Css.getVariableValue(`--${b}-font-${i}-api-url`));return a.isNullOrEmpty(l)?e(s):o.importcss(l).then(p=>e(s))}),n=new Promise(i=>{function s(l=0){l>4||!("size"in document.fonts)||typeof document.fonts.size=="number"&&document.fonts.size>0?document.fonts.ready.then(i):setTimeout(s,250,l++)}s()});return t.push(n),Promise.all(t)}}}static setAttachedPropertyValue(r,e,t){if(a.isNull(r))return;let n=Object.getOwnPropertyDescriptor(r,ju),i=n&&n.value||Object.defineProperty(r,ju,{value:{},enumerable:!1,writable:!1,configurable:!1})[ju];a.isNull(t)?delete i[e]:i[e]=t}static deleteAttachedPropertyValue(r,e){o.setAttachedPropertyValue(r,e,void 0)}static getAttachedPropertyValue(r,e,t){let n=Object.getOwnPropertyDescriptor(r,ju),i=n&&n.value;return a.isNull(i&&i[e])&&!a.isNull(t)?(o.setAttachedPropertyValue(r,e,t),t):i&&i[e]}static resolvePath(r,e){if(!r||!e)return;if(/[\(\)\{\}]/.test(r))throw`Security alert: not allowed to process paths like ${r}.`;let t=r.split(".");var n=e,i=n,s,l=t[0];t.forEach((f,g)=>{var v=f.split("[");v.forEach((y,_)=>{s=i,/\]$/.test(y)&&(y=y.substring(0,y.length-1),/^('|").+[^\\]\1$/.test(y)&&(y=y.substr(1,y.length-2))),i=i[y]})});var p,u;return/\]$/.test(r)?(u=r.lastIndexOf("["),p=r.substring(u+1),p=p.substring(0,p.length-1)):(u=r.lastIndexOf("."),p=r.substring(u+1)),{target:{value:i,name:p},parent:{value:s||e,path:r.substring(0,u)},root:{value:n,property:l}}}static set(r,e,t){var n=o.resolvePath(e,r),i=n.target.value;if(i!==t)if(n.parent.value!=n.root.value&&!(n.parent.value instanceof HTMLElement)){n.parent.value[n.target.name]=t;let s=a.clone(n.root.value[n.root.property]);n.parent.value[n.target.name]=i;let l;n.root.property==="item"&&!a.isNull(l=Gi.getRepeaterItem(n.root.value))?l.repeater&&l.repeater.datasource&&l.repeater.datasource.splice(l.index,1,l.item=s):n.root.value[n.root.property]=s}else n.parent.value[n.target.name]=t}static get(r,e){var t=o.resolvePath(e,r);return t&&t.target&&t.target.value}static _findScopeContextLegacy(r){let e=r,t;do e=e.parentNode;while(e!=null&&(e!=(t=r.ownerDocument)||e instanceof HTMLElement&&(t=e.shadowRoot)!=null));return t}static findScopeContext(r){return(r.isConnected?r.getRootNode():o.getAttachedPropertyValue(r,Bp))??o._findScopeContextLegacy(r)}static findAncestor(r,e){let t=r,n;for(;t&&(t=t.parentNode||t.getRootNode()?.host)!=null;)if(t.host instanceof HTMLElement&&(t=t.host),e.apply(t,[t])){n=t;break}return n}static findAncestorShell(r){return o.findAncestor(r,e=>a.is(e,`.${b}-body`)||e===document.body)}static findAncestorOfType(r,e){return o.findAncestor(r,t=>t instanceof e)}static findDescendants(r,e,t=!1){let n=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT);for(var i=[];n.nextNode();){let s=n.currentNode;if(e(s)===!0&&(i.push(s),t))return i}return i}static findFirstDescendant(r,e){let t=o.findDescendants(r,e,!0);return a.isNullOrEmpty(t)?void 0:t[0]}static findAll(r="[pacem]",e=t=>!0){let t=[];return document.querySelectorAll(r).forEach((n,i,s)=>{e(n)===!0&&t.push(n)}),t}static findPreviousSiblingOrAncestorOfType(r,e,t=0){let n=r,i=null,s=0;do if(n=n.previousSibling||n.parentNode,n instanceof e){if(s>=t){i=n;break}else n=n.parentNode;s++}while(n!=null);return i}static findPreviousSiblingOrAncestor(r,e,t=0){let n=r,i=null,s=0;do if(n=n.previousSibling||n.parentNode,n&&e.apply(n,[n])){if(s>=t){i=n;break}else n=n.parentNode;s++}while(n!=null);return i}static assignHostContext(r,e){let t=document.createTreeWalker(e.content,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_DOCUMENT_FRAGMENT);for(;t.nextNode();){var n=t.currentNode;a.isNull(o.getAttachedPropertyValue(n,ea))&&o.setAttachedPropertyValue(n,ea,r)}}static findHostContext(r){let e=r,t;if(!e.isConnected)return t;for(;e!=null&&(t=o.getAttachedPropertyValue(e,ea),!(t instanceof HTMLElement));)e=e.parentElement;let n;return t==null&&console&&(n=console.warn)&&n(`Element "${r.constructor.name}" isn't a descendant of a templated component.`),t}static isBindingAttribute(r){return eC.test(r)}static extractBindingAttributeExpression(r){if(o.isBindingAttribute(r))return r.substr(2,r.length-4);throw"Invalid attribute: incorrect binding syntax."}static parseBindingAttribute(r,e){let t=o.extractBindingAttributeExpression(r),n=/,\s*(twoway|once)\s*$/.exec(t),i=n&&n.length>1&&n[1];a.isNullOrEmpty(i)||(t=t.substr(0,t.lastIndexOf(",")));var s=ta.parse(t,e);return(s&&s.dependencies).forEach(l=>{switch(i){case"twoway":l.mode=l.twowayAllowed&&s.dependencies.length==1?"twoway":void 0;break;case"once":l.mode=i;break}}),s}static ensureMember(r,e,t){let n=Object.getOwnPropertyDescriptor(r,e);return n??(Object.defineProperty(r,e,t),Object.getOwnPropertyDescriptor(r,e))}static stripObservedAttributes(r){rb(r,!1)}static freezeObservedAttributes(r){rb(r)}};function rb(o,r=!0){let e=document.createTreeWalker(o,NodeFilter.SHOW_ELEMENT);do{var t=e.currentNode;if(t instanceof HTMLElement){let i=t.constructor.observedAttributes;if(!a.isNull(i)){A.deleteAttachedPropertyValue(t,Yl);let s=function(l){return a.isArray(l)?"["+l.map(s).join(",")+"]":l instanceof Element?`#${l.id=l.id||"_"+a.uniqueCode()}`:`${a.Json.stringify(l)}`};for(var n of i)if(n in t.attributes){let l,p;if(r&&!a.isNull(p=t[l=A.kebabToCamel(n)])){let u=s(p);t.setAttribute(n,`{{ ${u} }}`)}else t.removeAttribute(n)}}}}while(e.nextNode())}var nb=A.getAttachedPropertyValue,tC=A.setAttachedPropertyValue,Jm="pacem:repeater-item",ra=class{static findItemContext(r,e=0,t=console.warn){let n=Gi.findUpwards(r,e,t);return n==null&&t&&r instanceof HTMLElement&&r.isConnected&&t(`Couldn't find a ${Gi.name} up ${e} level${e===1?"":"s"} from element "${r.constructor.name}".`),n}},Gi=class o{constructor(r){this._placeholder=r;tC(r,Jm,this)}static findUpwards(r,e=0,t=console.warn){if(a.isNull(r)||r.localName==="template"||r instanceof Xl)return null;let n=null,i=l=>!a.isNull(n=o.getRepeaterItem(l));return A.findPreviousSiblingOrAncestor(r,i,e)==null&&t&&r instanceof HTMLElement&&r.isConnected&&t(`Couldn't find a ${o.name} up ${e} level${e===1?"":"s"} from element "${r.constructor.name}".`),n}static isRepeaterItem(r){return!a.isNull(nb(r,Jm))}static getRepeaterItem(r){return nb(r,Jm)}get placeholder(){return this._placeholder}};var ib=(n=>(n.AltKey="Alt",n.CtrlKey="Ctrl",n.ShiftKey="Shift",n.MetaKey="Cmd",n))(ib||{}),de=class{static isInstanceOf(r,e){return r instanceof e}static getEventCoordinates(r){var e;return"touches"in r?a.isNullOrEmpty(r.touches)?a.isNullOrEmpty(r.changedTouches)||(e=r.changedTouches[0]):e=r.touches[0]:e=r,{page:{x:e.pageX,y:e.pageY},screen:{x:e.screenX,y:e.screenY},client:{x:e.clientX,y:e.clientY}}}static getEventKeyModifiers(r){var e=r.which;return r instanceof MouseEvent&&(e=r.button),{which:e,shiftKey:r.shiftKey,altKey:r.altKey,ctrlKey:r.ctrlKey,metaKey:r.metaKey}}static matchModifiers(r,...e){let t=!a.isNull(e)&&(e.length===1&&a.isArray(e[0])?e[0]:Array.from(e).filter(u=>!a.isNullOrEmpty(u))),n=(t||[]).map(u=>u.toLowerCase()),i=n.indexOf("alt")>=0||n.indexOf("option")>=0,s=n.indexOf("shift")>=0,l=n.indexOf("ctrl")>=0,p=n.indexOf("win")>=0||n.indexOf("cmd")>=0;return!(i!==r.altKey||s!==r.shiftKey||p!==r.metaKey||l!==r.ctrlKey)}static fixEdgeCustomEventSubClassInstance(r,e){r instanceof e||Object.setPrototypeOf(r,e)}};var oe=class extends CustomEvent{constructor(r,e,t){super(r,a.extend({detail:e},t||{})),de.fixEdgeCustomEventSubClassInstance(this,this.constructor)}};function rC(o){if("detail"in o){for(let r in o)if(r!=="bubbles"&&r!=="cancelable"&&r!=="composed"&&r!=="detail")return!1;return!0}return!1}var ht=class extends CustomEvent{constructor(r,e,t,n){super(r,a.extend(rC(e||{})?e:{detail:e},!(t instanceof Event)&&t||{}));let i=n||t;i instanceof Event&&(this.#e=i,this.#t=de.getEventKeyModifiers(i),(i instanceof MouseEvent||i instanceof TouchEvent)&&(this.#r=de.getEventCoordinates(i))),de.fixEdgeCustomEventSubClassInstance(this,this.constructor)}#e;#t;#r;get originalEvent(){return this.#e}get which(){return this.#t?.which}get altKey(){return this.#t?.altKey}get shiftKey(){return this.#t?.shiftKey}get ctrlKey(){return this.#t?.ctrlKey}get metaKey(){return this.#t?.metaKey}get pageX(){return this.#r?.page.x}get pageY(){return this.#r?.page.y}get clientX(){return this.#r?.client.x}get clientY(){return this.#r?.client.y}get screenX(){return this.#r?.screen.x}get screenY(){return this.#r?.screen.y}},Ku="attributechange",Yu=class extends oe{constructor(r){super(Ku,r)}},ee="propertychange",ue=class extends oe{constructor(r){super(ee,r)}},nC="navigating",iC="navigate",Xu=class extends oe{constructor(r){super(iC,typeof r=="string"?{path:r}:r,{cancelable:!1,bubbles:!1})}},qu=class extends oe{constructor(r){super(nC,r,{cancelable:!0,bubbles:!1})}};var Ju=class extends oe{constructor(r){super("currentindexchange",r)}};var Yt="command",ql=class extends oe{constructor(r){super(Yt,r,{bubbles:!0,cancelable:!0})}};var bo=(o,r)=>a.areSemanticallyEqual(o,r);var sC={convert:o=>{}},aC={convert:o=>o,convertBack:o=>o},oC={convert:o=>o&&o.trim().split(/[ ,]+/),convertBack:o=>a.isArray(o)&&o.join(" ")||""},lC={convert:o=>parseFloat(o),convertBack:o=>o.toString()},cC={convert:o=>!a.isNullOrEmpty(o)&&o!=="0"&&o!=="false",convertBack:o=>(!!o).toString()},pC={convert:o=>o==="true"||o==="1",convertBack:o=>(!!o).toString()},sb={convert:o=>a.parseDate(o),convertBack:o=>a.parseDate(o).toISOString()},dC=sb,uC={convert:o=>a.Json.parse(o),convertBack:o=>a.Json.stringify(o)},hC={convert:o=>Function(`return ${o};`).apply(null),convertBack:o=>{}},mC={convert:o=>document.querySelector(o),convertBack:o=>o instanceof Element&&o.id?"#"+o.id:void 0,retryConversionWhenReady:!0},fC={convert:o=>se.parse(o),convertBack:o=>`${o.x||0} ${o.y||0}`},gC={convert:o=>Zs.parse(o),convertBack:o=>`${o.width||0} ${o.height||0}`},vC={convert:o=>Ze.parse(o),convertBack:o=>`${o.x||0} ${o.y||0} ${o.width||0} ${o.height||0}`},m={None:sC,String:aC,StringArray:oC,Number:lC,Boolean:cC,BooleanStrict:pC,Date:dC,Datetime:sb,Json:uC,Eval:hC,Element:mC,Point:fC,Rect:vC,Size:gC};var Zu=(u=>(u.Get="GET",u.Post="POST",u.Put="PUT",u.Delete="DELETE",u.Options="OPTIONS",u.Head="HEAD",u.Patch="PATCH",u.Connect="CONNECT",u.Trace="TRACE",u))(Zu||{}),Zm="fetchresult",Qm="error",ef="success",Vp=class{static isEmpty(r){return r.status===204||r.headers.get("Content-Length")==="0"}};var bC=()=>{},Up=class extends Error{constructor(e,t){super(t);this.statusCode=e}get status(){return this.statusCode}},Qu=class{constructor(r,e){r&&(this._status=r.status,this._body=r.response,this._text=r.responseText,this._type=r.responseType,this._allHeadersRaw=r.getAllResponseHeaders(),this._processTime=e)}get processTime(){return this._processTime}get headers(){return this._headers===void 0&&this._allHeadersRaw&&this._parseHeaders(),this._headers}get size(){return+this.headers["Content-Length"]}get mime(){return this.headers["Content-Type"]}get date(){return new Date(Date.parse(this.headers.Date))}_parseHeaders(){let r={};this._allHeadersRaw.split(`\r
|
|
13
|
+
${t(r)}</ul>${n}`;case"listitem":return` <li>${t(r)}</li>${n}`;case"link":case"linklike":let y=r,_=y.href,x="",w=y.ref;if(!_&&w){let E=e.find(k=>k.type==="ref"&&k.image!==!0&&k.id?.toLowerCase()===w.toLowerCase());E&&(_=E.url,x=E.title??"")}return _?`<a href="${_}"${x?' title="'+x+'"':""}>${t(r)}</a>`:`[${t(r)}]`;case"paragraph":return`<p>${t(r)}</p>${n}`;case"text":case"space":return r.text}return this._extraItemRender(r,e)}_render(r){let e="";for(let t of r||[])e+=this._rendeItem(t,r);return e}render(r){return Xx(this._render(r))}},Xm=class{_render(r){return be.isNullOrEmpty(r)?"":JSON.stringify(r)}render(r){return"["+r.filter(e=>!be.isNullOrEmpty(e)).map(this._render).join(",")+"]"}};function qx(o){return o&&typeof o=="object"&&typeof o.render=="function"}var qm=class extends $p{toHtml(r,e,t){let n=new zu(t);return be.isNullOrEmpty(e)?this.parse(r,n):this.parse(r,Uu(e),n)}tokenize(r,e){let t=this.parse(r,Uu(e),new Xm);return JSON.parse(t)}parse(r,e=Uu(),t=new zu){return qx(e)?super.parse(r,Uu(),e):super.parse(r,e,t)}};var Wl=class o{constructor(){}static clone(r){return new o()._clone(r)}_clone(r){let e=new WeakMap;function t(n){if(typeof n=="object"&&n!==null&&!(n instanceof Element)&&!(n instanceof FileSystemHandle)&&!(n instanceof File)){if(Array.isArray(n))return n.map(t);if(n instanceof Date)return new Date(n.valueOf());if(n instanceof RegExp)return new RegExp(n);if(e.has(n))return e.get(n);{let i=Object.assign({},n);return e.set(n,i),Object.keys(i).forEach(s=>{i[s]=t(n[s])}),i}}return n}return t(r)}};var vo="$refId",Jv=(t=>(t[t.Ignore=0]="Ignore",t.Reference="reference",t.Plain="plain",t))(Jv||{}),Fu=class{static{this._jsonFnWeakMap=new WeakMap}static{this._jsonFnMap=new Map}static store(r){let e=this._jsonFnWeakMap;if(!e.has(r)){let t=Qs.uniqueCode();e.set(r,t),this._jsonFnMap.set(t,r)}return e.get(r)}static retrieve(r){return this._jsonFnMap.get(r)}static remove(r){let e=this.retrieve(r);this._jsonFnMap.delete(r),this._jsonFnWeakMap.delete(e)}},Hp=class _Json{constructor(o){this._options=o}static serialize(o,r){return new _Json(r)._serialize(o)}static deserialize(o){return new _Json()._deserialize(o)}_serialize(o){let r=Wl.clone(o),e=[vo],t=this._flatten(r,0,null,e);return JSON.stringify(t,e.sort())}_deserialize(json){let hasRefs=!1,obj=JSON.parse(json,(key,value)=>{let elPattern=/^\$<#(.+)>$/,fnPattern=/^\$<fn:([^\x05]+)>$/,regexPattern=/^\$<regex:(.+)>$/,fnRefPattern=/^\$<fn#(.+)>$/,arr;if(key===vo)hasRefs=!0;else if(typeof value=="string")if((arr=regexPattern.exec(value))&&arr.length>1){let o=arr[1],r=o.lastIndexOf("|");return new RegExp(o.substr(0,r),o.substr(r+1))}else{if((arr=elPattern.exec(value))&&arr.length>1)return document.getElementById(arr[1]);if((arr=fnPattern.exec(value))&&arr.length>1)return eval(arr[1]);if((arr=fnRefPattern.exec(value))&&arr.length>1)return Fu.retrieve(arr[1])}return value});return hasRefs?this._revive(obj):obj}_flatten(o,r=0,e,t){if(e=e||new WeakSet,t=t||[],o instanceof Element)return o.id?`$<#${o.id}>`:void 0;if(o instanceof RegExp)return`$<regex:${o.source}|${o.flags}>`;if(typeof o=="object"&&o!=null&&!(o instanceof Date))return Array.isArray(o)?o.map(n=>this._flatten(n,r,e,t)):e.has(o)?o[vo]=o[vo]||"$#ref_"+r++:(e.add(o),Object.keys(o).forEach(n=>{t.indexOf(n)===-1&&t.push(n),o[n]=this._flatten(o[n],r,e,t)}),o);if(typeof o=="function")switch(this._options?.functions){case"reference":return"$<fn#"+Fu.store(o)+">";case"plain":return"$<fn:"+o+">";default:return}return o}_revive(o){let r={},e=/^\$#ref_(.+)$/;function t(n){if(typeof n=="object"&&n!==null){if(Array.isArray(n))return n.map(t);vo in n&&(r[n[vo]]=n,delete n[vo]),Object.keys(n).forEach(i=>{n[i]=t(n[i])})}else if(typeof n=="string"&&e.test(n)){let i=e.exec(n);return r[i[0]]}return n}return t(o)}};var _t=class o{constructor(){this.deferred=null;var r=this;r.promise=new Promise(function(e,t){r.deferred={resolve:e,reject:t,promise:r}})}then(r,e){return this.promise.then(r,e)}finally(r){return this.promise.then(r,r),this}success(r){return this.promise.then(r,null),this}error(r){return this.promise.then(null,r),this}static defer(){var r=new o;return r.deferred}};var Kx="pacem",Zv="download",Re=o=>{o.stopPropagation()},jl=o=>{o.preventDefault()},Q=o=>{o.preventDefault(),o.stopPropagation()},Qv=/^\/[^\/]+/,Jx=/\/\{([a-z\$_][\w]*)\??\}/,a=class o{static get core(){let r=window.Pacem;var e=r&&r.Configuration&&r.Configuration.core||Kx;return window[e]=window[e]||{}}static get customElements(){return window.customElements}static uniqueId(){return Qs.uniqueId()}static uniqueCode(){return Qs.uniqueCode()}static randomString(r){return Qs.randomString(r)}static parseDate(r){return br.parse(r)}static copyToClipboard(r){return navigator.clipboard?navigator.clipboard.writeText(r):new Promise((e,t)=>{let n=document.createElement("textarea");n.value=r,n.style.opacity="0",document.body.appendChild(n);try{n.select(),document.execCommand("copy"),n.remove(),e()}catch(i){t(i)}})}static{this.Json={stringify:Hp.serialize,parse:Hp.deserialize}}static{this.Dates={now:()=>o.parseDate(Date.now()),parse:o.parseDate,isLeapYear:br.isLeapYear,daysInMonth:br.daysInMonth,isDate:br.isDate,dateOnly:br.dateOnly,addMonths:br.addMonths,addDays:br.addDays,daysBetween:br.daysBetween}}static colorize(r,e){let t={h:38,s:.245,l:.6};var n,i,s,l;r instanceof HTMLElement?n=e:n=r,typeof n=="string"?i=Be.parse(n):i={r:n[0],g:n[1],b:n[2]};let p=Be.hsl(i);if(s=`brightness(50%) sepia(1) hue-rotate(${p.h-t.h}deg) saturate(${1+(p.s-t.s)}) brightness(${1+(p.l-t.l)})`,n===e)l.style.filter=s;else return s}static cssEscape(r){return escape(r).replace("%","\\")}static{this.Css={colorize:o.colorize,escape:o.cssEscape,getVariableValue(r){return getComputedStyle(document.documentElement).getPropertyValue(r)},setVariable(r,e){getComputedStyle(document.documentElement).setProperty(r,e)},isClassDefined(r){let e=new RegExp("."+r+"($|[s.,])");for(let t=0;t<document.styleSheets.length;t++){let n=document.styleSheets.item(t);try{let i=n.cssRules;for(let s=0;s<i.length;s++){let l=n.cssRules.item(s);if(e.test(l.selectorText))return!0}}catch(i){i instanceof DOMException&&console.warn(`Couldn't access cssRules of stylesheet "`+n.href+'".')}}return!1},deserializeTransform(r){let e=r instanceof Element?getComputedStyle(r):r,t=1,n=0,i=0,s=1,l=0,p=0,u=/^matrix\((.*)\)$/.exec(e.transform),f;return u&&u.length>1&&(f=u[1].split(",")).length==6&&(t=parseFloat(f[0]),n=parseFloat(f[1]),i=parseFloat(f[2]),s=parseFloat(f[3]),l+=parseFloat(f[4]),p+=parseFloat(f[5])),{a:t,b:n,c:i,d:s,e:l,f:p}}}}static{this.leftPad=gn.leftPad}static{this.formatString=gn.format}static{this.diff=gn.diff}static{this.Strings={leftPad:gn.leftPad,format:gn.format,diff:gn.diff,stripHTML:r=>new DOMParser().parseFromString(r,"text/html").body.textContent||""}}static{this.Blobs={toDataURL:mo.blobToDataURL,fromDataURL:mo.dataURLToBlob,toText:mo.blobToText,fromText:mo.textToBlob}}static{this.Images={load:fo.loadImage,resize:fo.resizeImage}}static loadImage(r){return new Promise((e,t)=>{let n=new Image;n.src=r,n.complete?e(n):(n.onload=i=>{e(n)},n.onerror=i=>{t()})})}static blobToDataURL(r){return o.Blobs.toDataURL(r)}static dataURLToBlob(r){return o.Blobs.fromDataURL(r)}static blobToText(r,e){return o.Blobs.toText(r,e)}static textToBlob(r,e="text/plain"){return o.Blobs.fromText(r,e)}static resizeImage(r,e,t,n){var i=_t.defer();return o.blobToDataURL(r).then(o.loadImage).then(s=>{let l=s.width,p=s.height,u=document.createElement("canvas");u.width=l,u.height=p;let f=u.getContext("2d");if(l>e||p>t){let g=l/p,v=e/t,y,_;v<g?(_=e,y=e/g):(y=t,_=t*g),u.width=_,u.height=y;let x=n>0&&n<=1;x&&(f.fillStyle="#000",f.fillRect(0,0,u.width,u.height)),o.cropImageOntoCanvas(s,f);let w;x?w=f.canvas.toDataURL("image/jpeg",n):w=f.canvas.toDataURL(),i.resolve(o.dataURLToBlob(w))}else i.resolve(r)},s=>{}),i.promise}static cropImage(r,e,t,n){var i=_t.defer();let s=new Image;return s.crossOrigin="anonymous",s.onload=function(l){let p=document.createElement("canvas"),u=p.getContext("2d");e&&(p.width=e),t&&(p.height=t);let f=n>0&&n<=1;f&&(u.fillStyle="#000",u.fillRect(0,0,p.width,p.height)),o.cropImageOntoCanvas(s,u),i.resolve(f?p.toDataURL("image/jpeg",n):p.toDataURL())},s.src=r,i.promise}static getUserMediaFunctions(){var r=[];let t=[navigator.getUserMedia,navigator.webkitGetUserMedia,navigator.msGetUserMedia,navigator.mozGetUserMedia].filter(function(n,i){return typeof n=="function"});return t.length&&(r=t),r}static cropImageOntoCanvas(r,e,t,n){e.imageSmoothingEnabled=e.mozImageSmoothingEnabled=e.oImageSmoothingEnabled=e.webkitImageSmoothingEnabled=!0;let i=e.canvas.width,s=e.canvas.height,l=i,p=s,u=t||1*r.width,f=n||1*r.height;var g=u/f,v=i/s;if(v>g){var y=i/u;s=y*f,e.drawImage(r,0,.5*(-s+p),l,s)}else{var y=s/f;i=y*u,e.drawImage(r,-Math.abs(.5*(-i+l)),0,i,p)}}static get _domURL(){return window.URL||window.webkitURL||window}static snapshotElement(r,e,t="image/png",n){function i(s){return new Promise((l,p)=>{let u=document.createElement("canvas"),f=s.width,g=s.height;if(!(f>0))p("Image has width zero.");else if(!(g>0))p("Image has height zero.");else{u.width=f,u.height=g;let v=u.getContext("2d");o.isNullOrEmpty(e)||(v.fillStyle=e,v.fillRect(0,0,f,g)),v.drawImage(s,0,0),u.toBlob(y=>{l(y)},t,n)}})}return r instanceof HTMLCanvasElement?i(r):new Promise((s,l)=>{let p=[];function u(w){let E=new Promise((k,N)=>{let T=()=>w instanceof HTMLImageElement?w.src:w.href.baseVal,O=D=>{w instanceof HTMLImageElement?w.src=D:w.setAttribute("href",D)};fetch(T()).then(D=>D.blob()).then(D=>o.blobToDataURL(D)).then(D=>{O(D),k()})});p.push(E)}function f(w,E){let k=new Promise((N,T)=>{let O=new Image;O.crossOrigin="anonymous",O.width=E.width,O.height=E.height,O.style.cssText=w.style.cssText,O.onload=()=>{w.replaceWith(O),N()},O.src=E.toDataURL()});p.push(k)}function g(w,E){let k=getComputedStyle(E);for(let N=0;N<k.length;N++){let T=k.item(N);w.style[T]=k[T]}}function v(w,E){g(w,E),w instanceof HTMLImageElement||w instanceof SVGImageElement?u(w):w instanceof HTMLCanvasElement&&f(w,E);let k=w.children.length;for(let N=0;N<k;N++){let T=w.children.item(N),O=E.children.item(N);T.tagName===O.tagName&&v(T,O)}}if(r instanceof SVGElement){let w=r.cloneNode(!0);v(w,r),Promise.all(p).then(E=>{r=w,x()})}else{var _=document.implementation.createHTMLDocument("");_.write(r.outerHTML),_.documentElement.setAttribute("xmlns",_.documentElement.namespaceURI);let E=document.evaluate(".//"+r.localName,_.body,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;E.setAttribute("xmlns",_.documentElement.namespaceURI),v(E,r),Promise.all(p).then(k=>{let N=document.createElementNS("http://www.w3.org/2000/svg","svg"),T=o.offset(r);N.setAttribute("viewBox",`0 0 ${T.width} ${T.height}`),N.setAttribute("width",T.width.toString()),N.setAttribute("height",T.height.toString()),N.innerHTML=`<foreignObject width="${T.width}" height="${T.height}">${E.outerHTML}</foreignObject>`,r=N,x()})}function x(){let w=new XMLSerializer().serializeToString(r),E=new Image;E.crossOrigin="anonymous";let k="data:image/svg+xml;charset=utf8,"+encodeURIComponent(w);E.onload=()=>{i(E).then(s)},E.src=k}})}static async download(r,e,t="application/download"){if(typeof r=="string"){let l=r,p={},u;o.isNullOrEmpty(e)||(typeof e=="object"?(p={credentials:e.credentials,headers:e.headers},u=e.filename||u,t=e.mime||t):u=e);var n=await fetch(l,p);if(n.ok){if(o.isNullOrEmpty(u)){let g="Content-Disposition";if(n.headers.has(g)){let v=n.headers.get(g),y=/^attachment; filename=\"?([^;\"]+)\"?(;|$)/.exec(v);y.length>1&&(u=y[1])}else u=Zv}var i=await n.blob();let f=u.split(/[\\\/]/g).join("_");return o.download(i,f)}{let f=await n.text();throw new Error(f)}}else{let l=r,p=typeof e=="string"&&e||Zv,u=document.createElement("a");if(u.setAttribute("href",o._domURL.createObjectURL(l)),u.setAttribute("download",p),document.createEvent){var s=document.createEvent("MouseEvents");s.initEvent("click",!0,!0),u.dispatchEvent(s)}else u.click()}}static isDOMReady(){return document.readyState==="complete"}static onDOMReady(r){window.addEventListener("load",r,!1)}static moveChildren(r,e){return o.moveItems(r.childNodes,e)}static moveItems(r,e){let t=[],n;for(let i=r.length-1;i>=0;i--){let s=r instanceof NodeList?r.item(i):r[i];e.insertBefore(s,n),t.unshift(s),n=s}return t}static is(r,e){return(r.matches||r.matchesSelector||r.msMatchesSelector||r.mozMatchesSelector||r.webkitMatchesSelector||r.oMatchesSelector).call(r,e)}static lang(r){return r.lang||document.documentElement.lang||navigator.language}static jsonSortStringify(r){return o.isNull(r)?r:o.Json.stringify(r)}static{this.Browsers={detect:Bu}}static cookies(r){let e=(r??document.cookie).split(";"),t={};for(var n of e){let i=n.split("=");if(i.length<2)continue;let s=(i[0]||"").trim(),l=(i[1]||"").trim();Object.defineProperty(t,s,{configurable:!1,enumerable:!0,writable:!1,value:decodeURIComponent(l.split("+").join(" "))})}return t}static{this.Cookies={getAll:async r=>{let e="cookieStore"in window?window.cookieStore:null,t=[];if(o.isNull(e)){let n=o.cookies();for(let i in n)!o.isNullOrEmpty(r)&&r!==i||t.push({name:i,value:n[i]});return t}else return await e.getAll(r)},stringify:r=>{let e=`${r.name}=${encodeURIComponent(r.value??"")}`;return o.isNullOrEmpty(r.domain)||(e+=`; domain=${encodeURIComponent(r.domain)}`),o.isNullOrEmpty(r.path)||(e+=`; path=${encodeURIComponent(r.path)}`),r.maxAge>0&&(e+=`; max-age=${r.maxAge.toFixed(0)}`),o.isNullOrEmpty(r.expires)||(e+=`; expires=${r.expires}`),r.partitioned&&(e+="; Partitioned"),o.isNullOrEmpty(r.sameSite)||(e+=`; SameSite=${encodeURIComponent(r.sameSite)}`),r.secure&&(e+="; Secure"),e}}}static isVisible(r){return"checkVisibility"in r?r.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0}):getComputedStyle(r).visibility!=="hidden"&&(r.clientWidth>0||r.clientHeight>0)}static hasClass(r,e){return r.classList?r.classList.contains(e):new RegExp("(^| )"+e+"( |$)","gi").test(r.className)}static addClass(r,e){let t=e.trim();r.classList?DOMTokenList.prototype.add.apply(r.classList,t.split(" ")):r.setAttribute("class",r.className+" "+t)}static removeClass(r,e){let t=e.trim();r.classList?DOMTokenList.prototype.remove.apply(r.classList,t.split(" ")):r.setAttribute("class",r.className.replace(new RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," "))}static toggleClass(r,e,t){t?o.addClass(r,e):o.removeClass(r,e)}static hasPart(r,e){return r.part.contains(e)}static addPart(r,e){DOMTokenList.prototype.add.apply(r.part,e.trim().split(" "))}static removePart(r,e){DOMTokenList.prototype.remove.apply(r.part,e.trim().split(" "))}static togglePart(r,e,t){t?o.addPart(r,e):o.removePart(r,e)}static offset(r){var e=r.getBoundingClientRect();return{top:Math.round(e.top)+o.scrollTop,left:Math.round(e.left)+o.scrollLeft,width:Math.round(e.width),height:Math.round(e.height)}}static offsetRect(r){var e=this.offset(r);return{y:e.top,x:e.left,width:e.width,height:e.height}}static naturalOffsetTop(r){return(r?.offsetTop??0)+(r?.offsetParent&&r.offsetParent instanceof HTMLElement?this.naturalOffsetTop(r.offsetParent):0)}static naturalOffsetLeft(r){return(r?.offsetTop??0)+(r?.offsetParent&&r.offsetParent instanceof HTMLElement?this.naturalOffsetLeft(r.offsetParent):0)}static naturalOffset(r){return{left:this.naturalOffsetLeft(r),top:this.naturalOffsetTop(r),width:r?.offsetWidth??0,height:r?.offsetHeight??0}}static naturalOffsetRect(r){var e=this.naturalOffset(r);return{y:e.top,x:e.left,width:e.width,height:e.height}}static deserializeTransform(r){return o.Css.deserializeTransform(r)}static set scrollTop(r){window.scrollTo(o.scrollLeft,r)}static set scrollLeft(r){window.scrollTo(r,o.scrollTop)}static scrollTo(r,e=!0,t=!0){let n=o.isNull(e)||typeof e=="boolean",i=n?o.scrollLeft:r,s=n?r:e,l=(n?e:t)?"smooth":"instant";window.scrollTo({behavior:l,left:i,top:s})}static get scrollTop(){return window.scrollY||document.documentElement.scrollTop||document.body.scrollTop||0}static get scrollLeft(){return window.scrollX||document.documentElement.scrollLeft||document.body.scrollLeft||0}static get windowSize(){let r=window;return{width:r.innerWidth||r.document.documentElement.clientWidth||r.document.body.clientWidth||0,height:r.innerHeight||r.document.documentElement.clientHeight||r.document.body.clientHeight||0}}static addAnimationEndCallback(r,e,t=500){let n=s=>{(!s||s.target==r)&&(clearTimeout(i),r.removeEventListener("animationend",n,!1),r.removeEventListener("transitionend",n,!1),e.apply(this,[r]))};r.addEventListener("animationend",n,!1),r.addEventListener("transitionend",n,!1);let i=setTimeout(n,t)}static waitForAnimationEnd(r,e=500){return new Promise((t,n)=>{o.addAnimationEndCallback(r,()=>{t()},e)})}static idle(r){return new Promise((e,t)=>{setTimeout(()=>e(),r)})}static accelerateCallback(r,e=500,t=5,n=20){let i={cancel:!1},s=e,l=t+n,p=()=>{r(i),i.cancel||(setTimeout(p,s),s<l?s=n:s-=t)};p()}static isEmpty(r){return be.isEmpty(r)&&!(r instanceof Node)}static isNull(r){return be.isNull(r)}static isArray(r){return Array.isArray(r)}static isNullOrEmpty(r){return o.isNull(r)||o.isEmpty(r)}static areSemanticallyEqual(r,e){r??=null,e??=null;let t=r&&r.valueOf&&r.valueOf(),n=e&&e.valueOf&&e.valueOf();return t===n}static{this.extend=Object.assign}static clone(r){if(r!==void 0)return Wl.clone(r)}static fromResult(r){return Promise.resolve(r)}static fromResultAsync(r){return new Promise(e=>requestAnimationFrame(()=>e(r())))}static readonlyCopy(r){if(o.isNull(r))return null;if(o.isArray(r)){let e=r.slice(0);return Object.freeze(e),e}else{let e={};for(let t in r)e[t]=r[t];return Object.freeze(e),e}}static{this.URIs={format:function(r,e,t){for(let s in e||{}){let p=new RegExp("(^|\\/)\\{"+s+"\\??\\}(\\/|$)").exec(r);if(p&&p.length){let u=new RegExp("\\{"+s+"\\??\\}"),f=p.index;r=r.substring(0,f)+r.substring(f).replace(u,encodeURIComponent(e[s])),t&&delete e[s]}}let n=/(^|\/)\{[\w]+\?\}(\/|$)/;for(var i;(i=n.exec(r))&&i.length>0;){let s=i[0];r=r.replace(s,s.endsWith("/")?"/":"")}return r},appendQuery:function(r,e,t=!1,n=!1){let i=n?"#":"?",l=((n?/#/:/\?/).test(r)?"&":i)+Object.keys(e).filter(p=>!o.isNull(e[p])||!t).map(p=>encodeURIComponent(p)+"="+encodeURIComponent(e[p]??"")).join("&");return r+(l.length>1?l:"")},parseQuery:(r=window.location)=>{typeof r!="string"&&(r=r.search);let e={};return new URLSearchParams(r).forEach((t,n)=>{Object.defineProperty(e,n,{enumerable:!0,value:t})}),e},hasMandatoryTemplateSegments:function(r){return/(^|\/)\{\.*\}(\/|$)/.test(r)},parseRoute:function(r){let e=r,t=[];if(!o.isNullOrEmpty(e)){let n,i=0;for(;(n=Qv.exec(e))!=null;){let s=n[0],l=Jx.exec(s);if(!o.isNullOrEmpty(l)){let p=l[1];t.push({name:p,optional:s.charAt(s.length-2)==="?",index:i})}e=e.substring(n.index+s.length),i++}}return t},split:function(r){let t=/^((https?:)?\/\/[^\/]+)?([^\?#]+)(\?[^#]*)?(#[^#]*)?$/.exec(r);return t?{domain:t[2]??"",protocol:t[1]??"",path:t[3]??"",query:t[4]??"",hash:t[5]??""}:null},parseState:function(r,e,t,n,i){let s=e;if(o.isNullOrEmpty(t)){let v=o.URIs.split(e);t=v.path,o.isNullOrEmpty(n)&&(n=v.query??""),o.isNullOrEmpty(i)&&(i=v.hash??""),s=t+n+i}let l=v=>{let y=v.indexOf("#");return y!==0?null:v.substring(y+1)},p=v=>{let y=v.indexOf("?");return y===0?o.URIs.parseQuery(v.substring(y+1)):{}},u={$path:s,$pathname:t,$querystring:n.length>0?n.substring(1):n,$query:p(n),$hash:l(i)},f=0,g=r.slice();if(!o.isNullOrEmpty(g)){let v;for(;(v=Qv.exec(t))!=null;){let y=v[0],_=g.findIndex(x=>x.index===f);if(_>=0){let x=g[_],{name:w}=x;Object.defineProperty(u,w,{enumerable:!0,value:y.substring(1)}),g.splice(_,1)}f++,t=t.substring(v.index+y.length)}}for(let v=0;v<g.length;v++)if(!g[v].optional)throw`Must provide "${g[v].name}" route value.`;return u}}}static getApiResult(r){if(typeof r=="object"&&!o.isNull(r)&&r.hasOwnProperty("success"))switch(r.success){case!0:if(r.hasOwnProperty("result"))return r.result;break;case!1:if(r.hasOwnProperty("error"))return null;break}return r}};var Zk=Function,Wu="pacem:properties",Yl="pacem:custom-element:bindings",ea="pacem:custom-element:host",Bp="pacem:custom-element:scope";var eb,d=(eb=window.Pacem)?.Configuration?.prefix??"pacem",b=eb?.Configuration?.css??d;var zi="__context_pacem",Zx=/'(\\'|[^'])*[^\\]?'|"(\\"|[^"])*[^\\]?"/g,Qx=/[^\w]new\s|[^\w]window\s*[\.\[]|[^\w]document\s*\.|[^\w]eval\s*\(/,tb=/(^|[\s\(\[\+\-\*\/!])(:host\.|\^+item[\s\.,;\)\]]|\^+item$|\^+index[^\w\.]|\^+index$|\$?this[\.\s$]?|#[a-zA-Z_][\w]*|::[a-zA-Z_][\w]*)/g,ta=class o{constructor(){this._pending=!1;this._independent=!1}get dependencies(){return this._dependencies}get functionBody(){return this._fnBody}get voidBody(){return this._voidBody}get pending(){return this._pending}get independent(){return this._independent}evaluate(){return this._fn||(this._fn=new Function("$pacem",zi,this._fnBody)),this._fn.apply(null,[a.core,this._args])}evaluateAsync(){let r=_t.defer();return this._fn||(this._fn=new Function("$pacem",zi,this._fnBody)),r.resolve(this._fn.apply(null,[a.core,this._args])),r.promise}evaluatePlus(r={}){if(!this._fn){let n=[zi];for(var e in r)n.push(e);n.push("$pacem"),this._fn=new Function(n.join(", "),this._voidBody)}let t=[].concat(this._args);for(var e in r)t.push(r[e]);return t.push(a.core),this._fn.apply(null,t)}static{this._pendingExpression=null}static _getPendingExpressionSingleton(){if(o._pendingExpression==null){let r=new o;r._pending=!0,r._dependencies=[],o._pendingExpression=r}return o._pendingExpression}static parse(r,e){for(var t=A.findScopeContext(e),n={$this:e},i=[],s="",l=!0,p=[],u,f=0,g=[];(u=Zx.exec(r))!=null;){g.push(r.substr(f,u.index-f));let w=u[0].length;p.push({start:u.index,length:w}),f=u.index+w}f<r.length&&g.push(r.substr(f,r.length-f));for(var v=0;v<g.length;v++){let w=g[v];if(Qx.test(w))throw`Unsafe expression detected: "${w}".`;if(t==null){if(new RegExp(tb).test(w)===!0){l=!1;break}}else{let E=w.replace(tb,(k,N,T,O,D)=>{l=!1;let P="__host_pacem",F=zi+".$this"+(T.endsWith(".")?".":""),B=e,$=D.indexOf(".",O),U=$>O?D.substr($+1).trim():"",I=/^[\w\.\$]+/.exec(U),G=I&&I.length>0&&I[0],Y,W=G&&(Y=G.split(".")).length>0&&Y[0];if(T===":host.")B=n[P]=n[P]||A.findHostContext(e),F=`${zi}.${P}.`;else if(T.endsWith("^item")||T.substr(0,T.length-1).endsWith("^item")){let V=T.endsWith("^item")?"":T.substr(T.length-1,1),X=T.length-(V.length>0?6:5),q=`__item_${X}_up_pacem`,Z=ra.findItemContext(e,X);B=n[q]=n[q]||Z&&Z.placeholder,G="item"+(G?"."+G:""),W="item",F=`${zi}.${q}.item${V}`}else if(T.endsWith("^index")||T.substr(0,T.length-1).endsWith("^index")){let V=T.endsWith("^index")?"":T.substr(T.length-1,1),X=T.length-(V.length>0?7:6),q=`__item_${X}_up_pacem`,Z=ra.findItemContext(e,X);B=n[q]=n[q]||Z&&Z.placeholder,G="index",W="index",F=`${zi}.${q}.index${V}`}else if(T.startsWith("::")){let V=T.substr(2,T.length-2),X=n[P]=n[P]||A.findHostContext(e);a.isNull(X)?B=null:B=X[V],F=`${zi}.${P}.${V}`}else if(T.startsWith("#")){let V=T.substr(1,T.length-1);B=n[V]=n[V]||t.querySelector("#"+V),F=`${zi}.${V}`}return W&&B&&W in B&&typeof B[W]!="function"&&i.find(V=>V.element===B&&V.property==W)==null&&i.push({element:B,property:W,path:G,twowayAllowed:!1}),N+F});if(s+=E,v<p.length){let k=p[v];s+=r.substr(k.start,k.length)}}}if(l){var y=new o;return y._independent=!0,y._fnBody=`return ${r};`,y._voidBody=r,y._dependencies=[],y}if(t==null)return this._getPendingExpressionSingleton();for(var _ in n)if(n[_]==null)return o._getPendingExpressionSingleton();i.length==1&&/[^\w\.\$]+/.test(s.trim())!==!0&&(i[0].twowayAllowed=!0);var x=new o;return x._args=n,x._fnBody=`try{ var ___$$$r = ${s}; return ___$$$r; }catch(e){ }`,x._voidBody=`try{ ${s} }catch(e){ }`,x._dependencies=i,x}};var Xl=class extends HTMLElement{};var ju="__pacem__",eC=/^\{\{(.|\n)+\}\}$/,A=class o{static get polyfilling(){return customElements instanceof window.CustomElementRegistry}static camelToKebab(r){return r&&r.replace(/([A-Z])/g,"-$1").toLowerCase()}static kebabToCamel(r){return r&&r.replace(/(-[a-z])/g,e=>e[1].toUpperCase())}static waitForReady(r){return new Promise((e,t)=>{a.isNull(r)&&t("Not found."),r.isReady&&e();let n=()=>{r.removeEventListener("load",n),e()};r.addEventListener("load",n)})}static whenReady(r,e){o.waitForReady(r).then(e)}static getWatchedProperties(r,e=!0){var t=[],n=r instanceof HTMLElement?r.constructor:r;do{let s=(this.getAttachedPropertyValue(n,Wu)||[]).filter(l=>!l.name.startsWith("_"));Array.prototype.splice.apply(t,[0,0].concat(s))}while(e&&(n=Object.getPrototypeOf(n)));return t}static getWatchedProperty(r,e){return this.getWatchedProperties(r,!0).find(t=>t.name===e)}static importjs(r,e=null,t=!1){var n={type:"text/javascript",src:r};return a.isNullOrEmpty(e)||a.extend(n,{integrity:e}),t&&a.extend(n,{crossorigin:""}),o.import(r,"script",n,document.head||document.getElementsByTagName("head")[0])}static importcss(r,e=null,t=!1){var n={rel:"stylesheet",href:r};return a.isNullOrEmpty(e)||a.extend(n,{integrity:e}),t&&a.extend(n,{crossorigin:"anonymous"}),o.import(r,"link",n,document.head||document.getElementsByTagName("head")[0])}static import(r,e,t,n=document.body){let i=a.core;var s=i.imports=i.imports||{};return s[r]=s[r]||new Promise((l,p)=>{var u=e;for(let v in t||{})u+=`[${v}="${t[v]}"]`;var f=document.querySelector(u);if(!a.isNull(f))l(f);else{f=document.createElement(e),f.onerror=v=>{p(v)},f.onload=()=>{l(f)};for(var g in t||{})f.setAttribute(g,t[g]);n.appendChild(f)}})}static{this.Theme={importWebFonts(){function r(i){return/^('|").*\1$/.test(i)?i.substring(1,i.length-1):i}function e(i){return a.isNullOrEmpty(i)?Promise.resolve():document.fonts.load("1rem "+i)}let t=["icons","std","main","tech","btn"].map(i=>{let s=a.Css.getVariableValue(`--${b}-font-${i}`).split(",")[0],l=r(a.Css.getVariableValue(`--${b}-font-${i}-api-url`));return a.isNullOrEmpty(l)?e(s):o.importcss(l).then(p=>e(s))}),n=new Promise(i=>{function s(l=0){l>4||!("size"in document.fonts)||typeof document.fonts.size=="number"&&document.fonts.size>0?document.fonts.ready.then(i):setTimeout(s,250,l++)}s()});return t.push(n),Promise.all(t)}}}static setAttachedPropertyValue(r,e,t){if(a.isNull(r))return;let n=Object.getOwnPropertyDescriptor(r,ju),i=n&&n.value||Object.defineProperty(r,ju,{value:{},enumerable:!1,writable:!1,configurable:!1})[ju];a.isNull(t)?delete i[e]:i[e]=t}static deleteAttachedPropertyValue(r,e){o.setAttachedPropertyValue(r,e,void 0)}static getAttachedPropertyValue(r,e,t){let n=Object.getOwnPropertyDescriptor(r,ju),i=n&&n.value;return a.isNull(i&&i[e])&&!a.isNull(t)?(o.setAttachedPropertyValue(r,e,t),t):i&&i[e]}static resolvePath(r,e){if(!r||!e)return;if(/[\(\)\{\}]/.test(r))throw`Security alert: not allowed to process paths like ${r}.`;let t=r.split(".");var n=e,i=n,s,l=t[0];t.forEach((f,g)=>{var v=f.split("[");v.forEach((y,_)=>{s=i,/\]$/.test(y)&&(y=y.substring(0,y.length-1),/^('|").+[^\\]\1$/.test(y)&&(y=y.substr(1,y.length-2))),i=a.isNull(i)?null:i[y]})});var p,u;return/\]$/.test(r)?(u=r.lastIndexOf("["),p=r.substring(u+1),p=p.substring(0,p.length-1)):(u=r.lastIndexOf("."),p=r.substring(u+1)),{target:{value:i,name:p},parent:{value:s||e,path:r.substring(0,u)},root:{value:n,property:l}}}static set(r,e,t){var n=o.resolvePath(e,r),i=n.target.value;if(i!==t)if(n.parent.value!=n.root.value&&!(n.parent.value instanceof HTMLElement)){n.parent.value[n.target.name]=t;let s=a.clone(n.root.value[n.root.property]);n.parent.value[n.target.name]=i;let l;n.root.property==="item"&&!a.isNull(l=Gi.getRepeaterItem(n.root.value))?l.repeater&&l.repeater.datasource&&l.repeater.datasource.splice(l.index,1,l.item=s):n.root.value[n.root.property]=s}else n.parent.value[n.target.name]=t}static get(r,e){var t=o.resolvePath(e,r);return t&&t.target&&t.target.value}static _findScopeContextLegacy(r){let e=r,t;do e=e.parentNode;while(e!=null&&(e!=(t=r.ownerDocument)||e instanceof HTMLElement&&(t=e.shadowRoot)!=null));return t}static findScopeContext(r){return(r.isConnected?r.getRootNode():o.getAttachedPropertyValue(r,Bp))??o._findScopeContextLegacy(r)}static findAncestor(r,e){let t=r,n;for(;t&&(t=t.parentNode||t.getRootNode()?.host)!=null;)if(t.host instanceof HTMLElement&&(t=t.host),e.apply(t,[t])){n=t;break}return n}static findAncestorShell(r){return o.findAncestor(r,e=>a.is(e,`.${b}-body`)||e===document.body)}static findAncestorOfType(r,e){return o.findAncestor(r,t=>t instanceof e)}static findDescendants(r,e,t=!1){let n=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT);for(var i=[];n.nextNode();){let s=n.currentNode;if(e(s)===!0&&(i.push(s),t))return i}return i}static findFirstDescendant(r,e){let t=o.findDescendants(r,e,!0);return a.isNullOrEmpty(t)?void 0:t[0]}static findAll(r="[pacem]",e=t=>!0){let t=[];return document.querySelectorAll(r).forEach((n,i,s)=>{e(n)===!0&&t.push(n)}),t}static findPreviousSiblingOrAncestorOfType(r,e,t=0){let n=r,i=null,s=0;do if(n=n.previousSibling||n.parentNode,n instanceof e){if(s>=t){i=n;break}else n=n.parentNode;s++}while(n!=null);return i}static findPreviousSiblingOrAncestor(r,e,t=0){let n=r,i=null,s=0;do if(n=n.previousSibling||n.parentNode,n&&e.apply(n,[n])){if(s>=t){i=n;break}else n=n.parentNode;s++}while(n!=null);return i}static assignHostContext(r,e){let t=document.createTreeWalker(e.content,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_DOCUMENT_FRAGMENT);for(;t.nextNode();){var n=t.currentNode;a.isNull(o.getAttachedPropertyValue(n,ea))&&o.setAttachedPropertyValue(n,ea,r)}}static findHostContext(r){let e=r,t;if(!e.isConnected)return t;for(;e!=null&&(t=o.getAttachedPropertyValue(e,ea),!(t instanceof HTMLElement));)e=e.parentElement;let n;return t==null&&console&&(n=console.warn)&&n(`Element "${r.constructor.name}" isn't a descendant of a templated component.`),t}static isBindingAttribute(r){return eC.test(r)}static extractBindingAttributeExpression(r){if(o.isBindingAttribute(r))return r.substr(2,r.length-4);throw"Invalid attribute: incorrect binding syntax."}static parseBindingAttribute(r,e){let t=o.extractBindingAttributeExpression(r),n=/,\s*(twoway|once)\s*$/.exec(t),i=n&&n.length>1&&n[1];a.isNullOrEmpty(i)||(t=t.substr(0,t.lastIndexOf(",")));var s=ta.parse(t,e);return(s&&s.dependencies).forEach(l=>{switch(i){case"twoway":l.mode=l.twowayAllowed&&s.dependencies.length==1?"twoway":void 0;break;case"once":l.mode=i;break}}),s}static ensureMember(r,e,t){let n=Object.getOwnPropertyDescriptor(r,e);return n??(Object.defineProperty(r,e,t),Object.getOwnPropertyDescriptor(r,e))}static stripObservedAttributes(r){rb(r,!1)}static freezeObservedAttributes(r){rb(r)}};function rb(o,r=!0){let e=document.createTreeWalker(o,NodeFilter.SHOW_ELEMENT);do{var t=e.currentNode;if(t instanceof HTMLElement){let i=t.constructor.observedAttributes;if(!a.isNull(i)){A.deleteAttachedPropertyValue(t,Yl);let s=function(l){return a.isArray(l)?"["+l.map(s).join(",")+"]":l instanceof Element?`#${l.id=l.id||"_"+a.uniqueCode()}`:`${a.Json.stringify(l)}`};for(var n of i)if(n in t.attributes){let l,p;if(r&&!a.isNull(p=t[l=A.kebabToCamel(n)])){let u=s(p);t.setAttribute(n,`{{ ${u} }}`)}else t.removeAttribute(n)}}}}while(e.nextNode())}var nb=A.getAttachedPropertyValue,tC=A.setAttachedPropertyValue,Jm="pacem:repeater-item",ra=class{static findItemContext(r,e=0,t=console.warn){let n=Gi.findUpwards(r,e,t);return n==null&&t&&r instanceof HTMLElement&&r.isConnected&&t(`Couldn't find a ${Gi.name} up ${e} level${e===1?"":"s"} from element "${r.constructor.name}".`),n}},Gi=class o{constructor(r){this._placeholder=r;tC(r,Jm,this)}static findUpwards(r,e=0,t=console.warn){if(a.isNull(r)||r.localName==="template"||r instanceof Xl)return null;let n=null,i=l=>!a.isNull(n=o.getRepeaterItem(l));return A.findPreviousSiblingOrAncestor(r,i,e)==null&&t&&r instanceof HTMLElement&&r.isConnected&&t(`Couldn't find a ${o.name} up ${e} level${e===1?"":"s"} from element "${r.constructor.name}".`),n}static isRepeaterItem(r){return!a.isNull(nb(r,Jm))}static getRepeaterItem(r){return nb(r,Jm)}get placeholder(){return this._placeholder}};var ib=(n=>(n.AltKey="Alt",n.CtrlKey="Ctrl",n.ShiftKey="Shift",n.MetaKey="Cmd",n))(ib||{}),de=class{static isInstanceOf(r,e){return r instanceof e}static getEventCoordinates(r){var e;return"touches"in r?a.isNullOrEmpty(r.touches)?a.isNullOrEmpty(r.changedTouches)||(e=r.changedTouches[0]):e=r.touches[0]:e=r,{page:{x:e.pageX,y:e.pageY},screen:{x:e.screenX,y:e.screenY},client:{x:e.clientX,y:e.clientY}}}static getEventKeyModifiers(r){var e=r.which;return r instanceof MouseEvent&&(e=r.button),{which:e,shiftKey:r.shiftKey,altKey:r.altKey,ctrlKey:r.ctrlKey,metaKey:r.metaKey}}static matchModifiers(r,...e){let t=!a.isNull(e)&&(e.length===1&&a.isArray(e[0])?e[0]:Array.from(e).filter(u=>!a.isNullOrEmpty(u))),n=(t||[]).map(u=>u.toLowerCase()),i=n.indexOf("alt")>=0||n.indexOf("option")>=0,s=n.indexOf("shift")>=0,l=n.indexOf("ctrl")>=0,p=n.indexOf("win")>=0||n.indexOf("cmd")>=0;return!(i!==r.altKey||s!==r.shiftKey||p!==r.metaKey||l!==r.ctrlKey)}static fixEdgeCustomEventSubClassInstance(r,e){r instanceof e||Object.setPrototypeOf(r,e)}};var oe=class extends CustomEvent{constructor(r,e,t){super(r,a.extend({detail:e},t||{})),de.fixEdgeCustomEventSubClassInstance(this,this.constructor)}};function rC(o){if("detail"in o){for(let r in o)if(r!=="bubbles"&&r!=="cancelable"&&r!=="composed"&&r!=="detail")return!1;return!0}return!1}var ht=class extends CustomEvent{constructor(r,e,t,n){super(r,a.extend(rC(e||{})?e:{detail:e},!(t instanceof Event)&&t||{}));let i=n||t;i instanceof Event&&(this.#e=i,this.#t=de.getEventKeyModifiers(i),(i instanceof MouseEvent||i instanceof TouchEvent)&&(this.#r=de.getEventCoordinates(i))),de.fixEdgeCustomEventSubClassInstance(this,this.constructor)}#e;#t;#r;get originalEvent(){return this.#e}get which(){return this.#t?.which}get altKey(){return this.#t?.altKey}get shiftKey(){return this.#t?.shiftKey}get ctrlKey(){return this.#t?.ctrlKey}get metaKey(){return this.#t?.metaKey}get pageX(){return this.#r?.page.x}get pageY(){return this.#r?.page.y}get clientX(){return this.#r?.client.x}get clientY(){return this.#r?.client.y}get screenX(){return this.#r?.screen.x}get screenY(){return this.#r?.screen.y}},Ku="attributechange",Yu=class extends oe{constructor(r){super(Ku,r)}},ee="propertychange",ue=class extends oe{constructor(r){super(ee,r)}},nC="navigating",iC="navigate",Xu=class extends oe{constructor(r){super(iC,typeof r=="string"?{path:r}:r,{cancelable:!1,bubbles:!1})}},qu=class extends oe{constructor(r){super(nC,r,{cancelable:!0,bubbles:!1})}};var Ju=class extends oe{constructor(r){super("currentindexchange",r)}};var Yt="command",ql=class extends oe{constructor(r){super(Yt,r,{bubbles:!0,cancelable:!0})}};var bo=(o,r)=>a.areSemanticallyEqual(o,r);var sC={convert:o=>{}},aC={convert:o=>o,convertBack:o=>o},oC={convert:o=>o&&o.trim().split(/[ ,]+/),convertBack:o=>a.isArray(o)&&o.join(" ")||""},lC={convert:o=>parseFloat(o),convertBack:o=>o.toString()},cC={convert:o=>!a.isNullOrEmpty(o)&&o!=="0"&&o!=="false",convertBack:o=>(!!o).toString()},pC={convert:o=>o==="true"||o==="1",convertBack:o=>(!!o).toString()},sb={convert:o=>a.parseDate(o),convertBack:o=>a.parseDate(o).toISOString()},dC=sb,uC={convert:o=>a.Json.parse(o),convertBack:o=>a.Json.stringify(o)},hC={convert:o=>Function(`return ${o};`).apply(null),convertBack:o=>{}},mC={convert:o=>document.querySelector(o),convertBack:o=>o instanceof Element&&o.id?"#"+o.id:void 0,retryConversionWhenReady:!0},fC={convert:o=>se.parse(o),convertBack:o=>`${o.x||0} ${o.y||0}`},gC={convert:o=>Zs.parse(o),convertBack:o=>`${o.width||0} ${o.height||0}`},vC={convert:o=>Ze.parse(o),convertBack:o=>`${o.x||0} ${o.y||0} ${o.width||0} ${o.height||0}`},m={None:sC,String:aC,StringArray:oC,Number:lC,Boolean:cC,BooleanStrict:pC,Date:dC,Datetime:sb,Json:uC,Eval:hC,Element:mC,Point:fC,Rect:vC,Size:gC};var Zu=(u=>(u.Get="GET",u.Post="POST",u.Put="PUT",u.Delete="DELETE",u.Options="OPTIONS",u.Head="HEAD",u.Patch="PATCH",u.Connect="CONNECT",u.Trace="TRACE",u))(Zu||{}),Zm="fetchresult",Qm="error",ef="success",Vp=class{static isEmpty(r){return r.status===204||r.headers.get("Content-Length")==="0"}};var bC=()=>{},Up=class extends Error{constructor(e,t){super(t);this.statusCode=e}get status(){return this.statusCode}},Qu=class{constructor(r,e){r&&(this._status=r.status,this._body=r.response,this._text=r.responseText,this._type=r.responseType,this._allHeadersRaw=r.getAllResponseHeaders(),this._processTime=e)}get processTime(){return this._processTime}get headers(){return this._headers===void 0&&this._allHeadersRaw&&this._parseHeaders(),this._headers}get size(){return+this.headers["Content-Length"]}get mime(){return this.headers["Content-Type"]}get date(){return new Date(Date.parse(this.headers.Date))}_parseHeaders(){let r={};this._allHeadersRaw.split(`\r
|
|
14
14
|
`).forEach(t=>{if(t&&t.length){let n=t.indexOf(":"),i=t.substr(0,n).trim(),s=t.substr(n+1).trim();r[i]=s}}),this._headers=r}get status(){return this._status}get text(){return this._text}get content(){return this._body}get type(){return this._type}get json(){if(this._type==="json")return this._body;try{return JSON.parse(this._text)}catch{return}}},zp=class{constructor(){}request(r,e){var t=this;let n=_t.defer();e=e||{method:"GET"};var i=e.method||"GET",s=e.data||{},l=e.progress||bC,p=e.headers||{};t.accessToken&&(p.Authorization="Bearer "+t.accessToken);var u=new XMLHttpRequest;u.withCredentials=!1,u.addEventListener("progress",y=>{if(y.lengthComputable){var _=y.loaded/y.total;typeof l=="function"&&l.apply(t,[_])}},!1),u.addEventListener("error",y=>{n.reject(new Up(500,y.message||"Unknown error"))},!1);var f;u.addEventListener("load",()=>{if(u.status>=200&&u.status<300){var y=new Qu(u,Date.now()-f);n.resolve(y)}else n.reject(new Up(u.status,u.statusText))},!1);var g;switch(i.toUpperCase()){case"GET":r+=(/\?/.test(r)?"&":"?")+(typeof s=="string"?s:Object.keys(s).map(function(y){return encodeURIComponent(y)+"="+encodeURIComponent(s[y])}).join("&"));break;case"POST":g=JSON.stringify(s)}switch(u.open(i,r,!0),i.toUpperCase()){case"GET":u.setRequestHeader("X-Requested-With","XMLHttpRequest");break;case"POST":u.setRequestHeader("X-Requested-With","XMLHttpRequest"),u.setRequestHeader("Content-Type","application/json");break}for(var v in p)u.setRequestHeader(v,p[v]);return f=Date.now(),u.send(g),n.promise}get(r,e,t){return this.request(r,{method:"GET",data:e,headers:t||{}})}post(r,e,t){return this.request(r,{method:"POST",data:e,headers:t||{}})}};var $e=A.getAttachedPropertyValue,Xt=A.setAttachedPropertyValue,Fp=A.deleteAttachedPropertyValue,yC="pacem:property:",ab="pacem:version",Gp="pacem:binding:",cb="pacem:view-children",tf="pacem:has-binding:",pb="pacem:custom-element:has-template",ob="pacem:custom-element:has-templated",db="pacem:custom-element:promise",Jl="pacem:custom-element:ready",lb="pacem:custom-element:startup";function Kl(o,r,e){var t=o;let n=r,i=e;var s=$e(t,Gp+n);if(s&&s.forEach(l=>{l.dep.element.removeEventListener(ee,l.callback,!1)}),a.isNull(i)||$e(o,Jl)!==!0)Fp(t,Gp+n),Fp(t,tf+n);else if(i.pending)Xt(t,Gp+n,[]);else{let l="oneway";switch(i.dependencies&&i.dependencies.length&&i.dependencies[0].mode){case"twoway":i.dependencies.length==1&&(l="twoway");break;case"once":l="once"}Xt(t,tf+n,l);let p=i.dependencies.map(u=>{var f={dep:u,callback:function(g){g.detail.propertyName===u.property&&(t[n]=i.evaluate())}};return u.element.addEventListener(ee,f.callback,!1),f});Xt(t,Gp+n,p),t[n]=i.evaluate()}}function _C(o){var r=_t.defer();let e=t=>{a.isDOMReady()?r.resolve(t):a.onDOMReady(n=>{r.resolve(t)})};return o.template?e(o.template):o.templateUrl?new zp().get(o.templateUrl).success(n=>{let i=o.template=n.text;return e(i),n}).error(n=>{console.error(n.message),e(null)}):e(null),r.promise}function xC(o,r){let e=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT);for(var t=[];e.nextNode();){var n=e.currentNode;if($e(n.constructor,pb)===!0){var i=$e(n,db,_t.defer());t.push(i.promise)}}return t}var C=o=>r=>{if(a.customElements.get(o.tagName)){console.warn(`${o.tagName} registration skipped, since already defined.`);return}var e=A.getWatchedProperties(r,!0);if(Xt(r,pb,!(a.isNullOrEmpty(o.template)&&a.isNullOrEmpty(o.templateUrl))),e&&e.length>0){let i="observedAttributes";var t=[];r.hasOwnProperty(i)&&(t=r[i].slice(),delete r[i]);let s=t;for(var n of e){let l=A.camelToKebab(n.name);s.unshift(l)}Object.defineProperty(r,i,{get:function(){return s},enumerable:!0,configurable:!1})}{let i=r.prototype,s=Object.getOwnPropertyDescriptor(i,"connectedCallback")||i.connectedCallback,l=Object.getOwnPropertyDescriptor(i,"viewActivatedCallback")||i.viewActivatedCallback;Object.defineProperty(i,"connectedCallback",{value:function(){let v=this;v.setAttribute("pacem",""),v.setAttribute("cloak",""),Fp(v,cb),s&&s.value?s.value.apply(v,[]):typeof s=="function"&&s.apply(v),_C(o).then(y=>{if(!v.isConnected)return;var _=[];if($e(v,Jl)!==!0&&!a.isNullOrEmpty(y)&&$e(v,ob)!=!0){Xt(v,ob,!0);let D=v,P=o.shadow,F=document.createElement("template").content,B=document.createElement("template");if(!P)for(var x=D.childNodes.length-1;x>=0;x--)F.insertBefore(D.childNodes.item(x),F.firstChild);B.innerHTML=y;let $=B.content.querySelectorAll(d+"-content");if(A.assignHostContext(v,B),$.length==1){let U=$.item(0);var w=U.nextSibling;let I=U.parentElement||B.content,G=F.childNodes;for(I.removeChild(U);G.length>0;)try{let Y=G.item(0);I.insertBefore(Y,w)}catch(Y){console.error(Y.toString())}}else if($.length>1)throw"There can only be at most 1 content placeholder inside a template.";var E;if(o.shadow)E=D.attachShadow({mode:"open"}),E.appendChild(B.content);else{E=D;for(var k=B.content.children;k.length>0;)E.append(k.item(0))}_=xC(v,E)}Xt(v,Jl,!0);for(let D of e){let P=D.name,F=D.config;if(!F.converter.retryConversionWhenReady||!a.isNull(v[P]))continue;let B=A.camelToKebab(P),$=v.getAttribute(B);!a.isNullOrEmpty($)&&!A.isBindingAttribute($)&&(v[P]=F.converter.convert($,v))}($e(v,lb)||[]).forEach(D=>{D.apply(v)}),(D=>{var P=$e(v,Yl)||[];P.forEach(F=>{let B=F;if(!(B in v.attributes))throw`Howcome? ${B} not in ${v.constructor.name} attributes!?...`;let $=v.attributes[B].value;if(A.isBindingAttribute($)){var U=A.parseBindingAttribute($,v);Kl(v,A.kebabToCamel(F),U)}})})();let O=D=>{l&&l.value?l.value.apply(v,[]):typeof l=="function"&&l.apply(v);var P=$e(v,db);a.isNull(P)||P.resolve()};v.removeAttribute("cloak"),Promise.all(_).then(D=>O())})},configurable:!0,enumerable:!0});let p=Object.getOwnPropertyDescriptor(i,"disconnectedCallback")||i.disconnectedCallback;Object.defineProperty(i,"disconnectedCallback",{value:function(){let v=this;p&&p.value?p.value.apply(v,[]):typeof p=="function"&&p.apply(v,[]),Xt(v,Jl,!1),($e(v,Yl)||[]).forEach(_=>{Kl(v,A.kebabToCamel(_))})},configurable:!0,enumerable:!0});let u=Object.getOwnPropertyDescriptor(i,"attributeChangedCallback")||i.attributeChangedCallback;Object.defineProperty(i,"attributeChangedCallback",{value:function(v,y,_){let x=this,w=$e(x,Jl)===!0;u&&u.value?u.value.apply(x,[v,y,_]):typeof u=="function"&&u.apply(x,[v,y,_]);let E=new Yu({attributeName:v,oldValue:y,currentValue:_,firstChange:!w});x.dispatchEvent(E);let k=A.isBindingAttribute(_),N=v,T=A.kebabToCamel(N),O=!1;if(k){let P=A.parseBindingAttribute(_,x);if(P instanceof ta){let F=()=>{x[T]=P.evaluate(),Kl(x,T)},B=()=>{var $=$e(x,Yl,[]);$.push(N),P.pending||Kl(x,T,P)};if(P.independent&&!O)try{F()}catch($){console.warn(`Error occurred in early binding evaluation:
|
|
15
15
|
${_}
|
|
16
16
|
${$.message??$}`),B()}else B()}else throw`Howcome? ${_} misinterpreted as ${N} binding...`}else{var D=e.find(P=>P.name===T);a.isNull(D)||(Kl(x,T),x[T]=D.config.converter.convert(_,x))}},configurable:!0,enumerable:!0});let f=Object.getOwnPropertyDescriptor(i,"propertyChangedCallback")||i.propertyChangedCallback;Object.defineProperty(i,"propertyChangedCallback",{value:function(v,y,_,x,w){let E=this,k=$e(E,Jl)===!0,N=()=>{let O=$e(E,tf+v);if(f&&f.value?f.value.apply(E,[v,y,_,!k]):typeof f=="function"&&f.apply(E,[v,y,_,!k]),!w||w.emit!==!1){let $=new ue({propertyName:v,oldValue:y,currentValue:_,firstChange:!k});E.dispatchEvent($)}if(a.isNullOrEmpty(O)){var D=e.find($=>$.name===v);if(w&&w.reflectBack===!0&&!A.polyfilling){var P=A.camelToKebab(v),F=E.attributes.getNamedItem(P);if(k||a.isNullOrEmpty(F)){var B;if(_==null)E.removeAttribute(P);else if(D&&(B=D.config)&&typeof B.converter.convertBack=="function"){let $=B.converter.convertBack(_,E);(F==null||$!==F.value)&&E.setAttribute(P,$)}}}}else if(O==="twoway"){let $=$e(E,Gp+v)[0].dep;A.set($.element,$.path,_)}else O==="once"&&Kl(E,v)};if(k)N.apply(E);else{var T=$e(E,lb,[]);T.push(N)}},configurable:!0,enumerable:!0})}a.customElements.define(o.tagName,r,o.options),a.customElements.whenDefined(o.tagName).then(()=>{})},CC=m.None;function h(o){return(r,e,t)=>{var n=$e(r.constructor,Wu,[]);n.push({name:e,config:a.extend({emit:!0,converter:CC},o)});let i=bo,s=t&&t.set,l=yC+e,p=ab,u=ab+":"+e;function f(){return $e(this,l)}function g(_,x,w){let E=this,k=o&&o.debounce,N;if(typeof(N=E.propertyChangedCallback)=="function"){let T=()=>N.apply(E,[_,x,$e(E,l),!1,o]);typeof k=="number"&&k>0?(clearTimeout(this["_handle_"+e]),this["_handle_"+e]=setTimeout(T,k)):k===!0?(cancelAnimationFrame(this["_handle_"+e]),this["_handle_"+e]=requestAnimationFrame(T)):T()}}function v(_){let x=this;if(_=_||x[e],$e(_,"pacem:array:decorated")===!0)return;Xt(_,"pacem:array:decorated",!0);let w=Array.prototype,E={splice:w.splice,pop:w.pop,copyWithin:w.copyWithin,push:w.push,shift:w.shift,unshift:w.unshift};for(let k in E){let N=k;_[N]=function(...T){let O=E[N].apply(this,T);return Xt(this,p,Date.now()),g.call(x,e,this,this),O}}}function y(_,x){let w=this,E=a.isArray(x);(!i(_,x)||E&&$e(x,p)!==$e(w,u))&&(Xt(w,l,x),E&&(Xt(w,u,$e(x,p)),v.call(w,x)),g.call(w,e,_,x))}if(s)t.set=function(_){let x=this,w=x[e];s.call(x,_);let E=x[e];y.call(x,w,E)};else{try{r.ownerDocument&&(r[l]=r[e])}catch{}delete r[e]&&Object.defineProperty(r,e,{get:function(){return f.call(this)},set:function(_){let x=this,w=$e(x,l);y.call(x,w,_)},enumerable:!0,configurable:!0})}}}function S(o){return(r,e,t)=>{let n=`${e}_${a.uniqueCode()}`;function i(){let l=this,p=(l.shadowRoot||l).querySelectorAll(o);for(let u=0;u<p.length;u++){let f=p.item(u);if($e(f,ea)===l)return f}return null}function s(){let l=this,p=$e(l,cb,{});return p[n]=p[n]||i.call(l)}delete r[e]&&Object.defineProperty(r,e,{get:function(){return s.call(this)},enumerable:!0,configurable:!0})}}function ub(){function o(r){return r&&typeof r.then=="function"}return function(r,e,t){let n=t.value,i=`pacem:concurrent-buffer:${e}`,s=`pacem:concurrent-running:${e}`;t.value=function(...l){var p=this,u=A.getAttachedPropertyValue(p,i,[]),f=A.getAttachedPropertyValue(p,s,!1);if(f){let v=_t.defer();return l.push(v),u.push(l),v.promise}var g=n.apply(p,l);if(o(g)){let v=l&&l.length>0&&l[l.length-1];return v&&v.promise instanceof _t?l.pop():v=_t.defer(),A.setAttachedPropertyValue(p,s,!0),g.then(y=>{v.resolve(y),A.setAttachedPropertyValue(p,s,!1),u.length>0&&n.apply(p,u.shift())},y=>{A.setAttachedPropertyValue(p,s,!1),v.reject(y)}),v.promise}else return g}}}function me(o=50,r=(e,...t)=>`pacem:debouncer:${e}`){return function(e,t,n){let i=n.value;o===!0?n.value=function(...s){let l=r(t,...s);var p=this;cancelAnimationFrame($e(p,l)),Xt(p,l,requestAnimationFrame(()=>{i.apply(p,s)}))}:o>0&&(n.value=function(...s){let l=r(t,...s);var p=this;clearTimeout($e(p,l,0)),Xt(p,l,setTimeout(()=>{i.apply(p,s)},o))})}}function Wp(o=50,r=(e,...t)=>`pacem:throttler:${e}`){return function(e,t,n){let i=n.value;n.value=function(...s){let l=r(t,...s),p=`${l}:args`,u=this,f=()=>{Fp(u,l);let g=$e(u,p);Fp(u,p),g&&i.apply(u,s)};if(!a.isNull($e(u,l))){Xt(u,p,s??["pacem"]);return}Xt(u,l,1),i.apply(u,s),o===!0?requestAnimationFrame(f):o>0&&setTimeout(f,o)}}}var rf=class{static register(r,e){let t=a.core,n=(r||e.name).split(".");for(let s of n.slice(0,-1))t=t[s]||(t[s]={});let i=n[n.length-1]||e.name;a.isNull(t[i])?t[i]=e:console.warn(`A transform named ${i} already exists in this set.`)}};function Te(o){return function(r,e,t){let n=t.value;rf.register(o,n)}}var j={USE_SHADOW_ROOT:!1};var qt=(s=>(s.Trace="trace",s.Debug="debug",s.Warn="warn",s.Error="error",s.Info="info",s.Log="log",s))(qt||{});var K=class extends HTMLElement{constructor(){super();this._isReady=!1;this.emitHandler=e=>{this.disabled||this.emit(e)}}emit(e){e.defaultPrevented||this._emitCore(e)}_emitCore(e){var t=`on-${e.type.toLowerCase()}`;if(t in this.attributes){this.log("debug",`Calling ${t} handler for event ${e.type}`);var n=this.attributes[t].value,i=ta.parse(n,this);!a.isNull(i)&&i.pending!==!0&&i.evaluatePlus({$event:e})}}handle(e,t){typeof e=="string"&&(e=a.isNull(t)?new Event(e,{cancelable:!1}):new CustomEvent(e,{cancelable:!1,detail:t})),this.emit(e)}get isReady(){return this._isReady}connectedCallback(){A.setAttachedPropertyValue(this,Bp,A.findScopeContext(this)),this.log("debug","Connected.")}disconnectedCallback(){this._isReady=!1,this.dispatchEvent(new Event("unload")),A.deleteAttachedPropertyValue(this,Bp),this.log("debug","Disconnected.")}viewActivatedCallback(){this._isReady=!0,this.log("debug","Loaded (view activated)."),this.dispatchEvent(new Event("load"))}propertyChangedCallback(e,t,n,i){i?this.log("log",`Property "${e}" changed at start-up`):this.log("log",`Property "${e}" changed from ${t} to ${n}`)}dispatchEvent(e){if(this.disabled)return!1;this.log("log",`Dispatching event "${e.type}"`);let t=super.dispatchEvent(e);return this.emit(e),t}log(e,t,n=this.localName+(this.id?"#"+this.id:"")){this.logger&&typeof this.logger.log=="function"&&this.logger.log(e,t,n)}refreshBindings(){for(let e=0;e<this.attributes.length;e++){let t=this.attributes.item(e);if(!A.isBindingAttribute(t.value))continue;let i=A.kebabToCamel(t.name),s=A.parseBindingAttribute(t.value,this);this[i]=s.evaluate()}}};c([h({reflectBack:!0,converter:m.Boolean})],K.prototype,"disabled",2),c([h({emit:!1,converter:m.Element})],K.prototype,"logger",2);var fS=/a^/,hb=class{static split(r,e){for(var t,n=0,i=[];(t=e.exec(r))!=null;){i.push({value:r.substr(n,t.index-n),match:!1,index:n});let s=t[0].length;i.push({value:r.substr(t.index,s),match:!0,index:t.index}),n=t.index+s}return n<r.length&&i.push({value:r.substr(n,r.length-n),match:!1,index:n}),i}};var nf="_exp",eh=class{_getStorage(r){return r?window.localStorage:window.sessionStorage}_parseValue(r,e){let t=r.getItem(e);if(a.isNullOrEmpty(t))return null;let n=a.Json.parse(t);return Object.hasOwnProperty(nf)?n[nf]<Date.now()?(r.removeItem(e),null):n.value:n}setPropertyValue(r,e,t){var n=this._getStorage(t===!0||typeof t=="number"&&t>0),i=e;if(typeof t=="number"&&t>0){let s=Date.now()+1e3*t;i={value:e},i[nf]=s}n.setItem(r,a.Json.stringify(i)),n=this._getStorage(!t),n.removeItem(r)}getPropertyValue(r){return this._parseValue(this._getStorage(!1),r)||this._parseValue(this._getStorage(!0),r)}clear(){var r=this._getStorage(!0);r.clear(),r=this._getStorage(!1),r.clear()}removeProperty(r){var e=this._getStorage(!0);e.removeItem(r),e=this._getStorage(!1),e.removeItem(r)}};function EC(o){return o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function wC(o,r,e,t){let n="char",i="full",s,l;return["line","word","char"].includes(o)?(n=o,i=r,s=e,l=t):(i=o,s=r,l=e),{mode:n,output:i,cssAdd:s??"fill-green-container",cssRemove:l??"fill-red-container"}}var ct=class{static highlight(r,e,t=b+"-highlight"){if(!e||!r)return r;let n=r.substring(0),i=e.substring(0).split(" ");for(var s=0;s<i.length;s++){let l=EC(i[s]),p=new RegExp("(?![^<>]*>)"+l,"gi");n=n.replace(p,function(u,f,g){var v,y;return(v=g.indexOf("<",f))!=(y=g.indexOf("</",f))||v==-1?'<span class="'+t+'">'+u+"</span>":u})}return n}static diff(r,e,t="full",n,i,s){let{mode:l,output:p,cssAdd:u,cssRemove:f}=wC(t,n,i,s);return a.diff(r,e,l).reduce((v,y)=>{let _=y.type;if(_==="=")v+=y.value;else if(_==="+"&&p!=="left"||_==="-"&&p!=="right"){let x=y.value.split(/\r?\n/),w=x.length-1;for(let E=0;E<=w;E++){let k=x[E];(!a.isNullOrEmpty(k)||E<w)&&(v+=`<span class="${b}-token ${_==="-"?f:u} text-prewrap">${k||" "}</span>`),E<w&&(v+=`
|
package/dist/bundle/pacem.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @pacem/pacem v1.0.5-
|
|
2
|
+
* @pacem/pacem v1.0.5-curry (https://js.pacem.it)
|
|
3
3
|
* Pacem (https://pacem.it)
|
|
4
4
|
* Licensed under Apache-2.0
|
|
5
5
|
*/
|
|
@@ -4016,7 +4016,7 @@ var CustomElementUtils = class _CustomElementUtils {
|
|
|
4016
4016
|
t2 = t2.substr(1, t2.length - 2);
|
|
4017
4017
|
}
|
|
4018
4018
|
}
|
|
4019
|
-
ref = ref[t2];
|
|
4019
|
+
ref = Utils.isNull(ref) ? null : ref[t2];
|
|
4020
4020
|
});
|
|
4021
4021
|
});
|
|
4022
4022
|
var name, ndx;
|