@mantou/gem 2.2.1 → 2.2.2
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/gem.es.js +1015 -1014
- package/dist/gem.umd.js +12 -15
- package/elements/base/gesture.js +1 -1
- package/elements/base/link.d.ts +1 -1
- package/elements/base/link.d.ts.map +1 -1
- package/elements/base/link.js +13 -9
- package/elements/base/link.js.map +1 -1
- package/elements/base/modal-factory.d.ts +73 -48
- package/elements/base/modal-factory.d.ts.map +1 -1
- package/elements/base/modal-factory.js +12 -11
- package/elements/base/modal-factory.js.map +1 -1
- package/elements/base/route.d.ts +1 -1
- package/elements/base/route.d.ts.map +1 -1
- package/elements/base/route.js +11 -15
- package/elements/base/route.js.map +1 -1
- package/elements/base/title.d.ts.map +1 -1
- package/elements/base/title.js +2 -4
- package/elements/base/title.js.map +1 -1
- package/elements/base/unsafe.d.ts +3 -2
- package/elements/base/unsafe.d.ts.map +1 -1
- package/elements/base/unsafe.js +45 -24
- package/elements/base/unsafe.js.map +1 -1
- package/helper/i18n.d.ts.map +1 -1
- package/helper/logger.d.ts.map +1 -1
- package/helper/react-utils.d.ts.map +1 -1
- package/helper/react-utils.js +2 -6
- package/helper/react-utils.js.map +1 -1
- package/helper/ssr-shim.d.ts.map +1 -1
- package/helper/ssr-shim.js +0 -1
- package/helper/ssr-shim.js.map +1 -1
- package/helper/theme.d.ts +15 -3
- package/helper/theme.d.ts.map +1 -1
- package/helper/theme.js +22 -7
- package/helper/theme.js.map +1 -1
- package/lib/decorators.d.ts +49 -49
- package/lib/decorators.d.ts.map +1 -1
- package/lib/decorators.js +50 -49
- package/lib/decorators.js.map +1 -1
- package/lib/directive.d.ts.map +1 -1
- package/lib/element.d.ts.map +1 -1
- package/lib/element.js.map +1 -1
- package/lib/history.d.ts +1 -1
- package/lib/history.d.ts.map +1 -1
- package/lib/history.js +3 -3
- package/lib/history.js.map +1 -1
- package/lib/lit-html.d.ts +2 -5
- package/lib/lit-html.d.ts.map +1 -1
- package/lib/lit-html.js +2 -5
- package/lib/lit-html.js.map +1 -1
- package/lib/reactive.d.ts +12 -5
- package/lib/reactive.d.ts.map +1 -1
- package/lib/reactive.js +14 -18
- package/lib/reactive.js.map +1 -1
- package/lib/repeat.d.ts.map +1 -1
- package/lib/store.d.ts +2 -2
- package/lib/store.d.ts.map +1 -1
- package/lib/store.js +1 -0
- package/lib/store.js.map +1 -1
- package/lib/utils.d.ts +4 -1
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +11 -9
- package/lib/utils.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.d.ts.map +1 -1
- package/lib/version.js +2 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/src/elements/base/gesture.ts +1 -1
- package/src/elements/base/link.ts +3 -3
- package/src/elements/base/modal-factory.ts +12 -11
- package/src/elements/base/route.ts +9 -15
- package/src/elements/base/title.ts +2 -4
- package/src/elements/base/unsafe.ts +33 -14
- package/src/helper/react-utils.ts +4 -12
- package/src/helper/ssr-shim.ts +0 -1
- package/src/helper/theme.ts +25 -10
- package/src/lib/decorators.ts +51 -49
- package/src/lib/element.ts +0 -1
- package/src/lib/history.ts +3 -4
- package/src/lib/lit-html.ts +3 -0
- package/src/lib/reactive.ts +45 -21
- package/src/lib/store.ts +3 -2
- package/src/lib/utils.ts +15 -8
- package/src/lib/version.ts +2 -1
- package/src/test/gem-element/advance.test.ts +1 -1
- package/src/test/gem-element/basic.test.ts +1 -2
- package/src/test/utils.test.ts +1 -1
package/dist/gem.umd.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
(function(h,O){typeof exports=="object"&&typeof module<"u"?O(exports):typeof define=="function"&&define.amd?define(["exports"],O):(h=typeof globalThis<"u"?globalThis:h||self,O(h.Gem={}))})(this,function(h){"use strict";var Nh=Object.defineProperty;var oc=h=>{throw TypeError(h)};var Rh=(h,O,I)=>O in h?Nh(h,O,{enumerable:!0,configurable:!0,writable:!0,value:I}):h[O]=I;var $=(h,O,I)=>Rh(h,typeof O!="symbol"?O+"":O,I),Gs=(h,O,I)=>O.has(h)||oc("Cannot "+I);var f=(h,O,I)=>(Gs(h,O,"read from private field"),I?I.call(h):O.get(h)),C=(h,O,I)=>O.has(h)?oc("Cannot add the same private member more than once"):O instanceof WeakSet?O.add(h):O.set(h,I),L=(h,O,I,$n)=>(Gs(h,O,"write to private field"),$n?$n.call(h,I):O.set(h,I),I),zs=(h,O,I)=>(Gs(h,O,"access private method"),I);var Ot,gt,Lt,dn,Vs,ve,Jn,vt,qt,un,$e,Se,ye,st,ut,xt,$t,we,ct,Ee,Ce,Bt,lt,ke,Ds,Yn,Zn,_n,be,Kt,fn,Xn,ti,pn,Te,mn,Pe,ei,G,ni,cc,lc,vn,ii,gn;const{assign:O,fromEntries:I,entries:$n,keys:hc}=Object,si=new Set;function _t(n,t){if(si.has(n))return;const e=()=>{si.delete(n),n()};t?process.nextTick(e):Promise.resolve().then(e),si.add(n)}function Me(n,t){const e=t;return delete e.name,delete e.length,O(e,n),e}function ri(n="",t=""){const{pathname:e,search:i,hash:s}=new URL(t,location.origin+n);return e+i+decodeURIComponent(s)}function oi(n,t,e,i){return n.addEventListener(t,e,i),()=>n.removeEventListener(t,e,i)}class Us extends EventTarget{constructor(){super(...arguments);C(this,dn);C(this,Ot,new Map);C(this,gt);C(this,Lt)}get size(){return f(this,Ot).size}get first(){return f(this,gt)}get last(){return f(this,Lt)}isSuperLinkOf(e){let i=e.first;if(!i)return!0;let s=this.find(i.value);for(;s&&s.value===i.value;){if(i=i.next,!i)return!0;s=s.next}return!1}find(e){return f(this,Ot).get(e)}add(e){f(this,Lt)||this.dispatchEvent(new CustomEvent("start"));const i=zs(this,dn,Vs).call(this,e)||{value:e};i.prev=f(this,Lt),i.prev&&(i.prev.next=i),i.next=void 0,L(this,Lt,i),f(this,gt)||L(this,gt,i),f(this,Ot).set(e,i)}delete(e){const i=zs(this,dn,Vs).call(this,e);return f(this,gt)||this.dispatchEvent(new CustomEvent("end")),i}get(){const e=f(this,gt);if(e)return this.delete(e.value),e.value}}Ot=new WeakMap,gt=new WeakMap,Lt=new WeakMap,dn=new WeakSet,Vs=function(e){const i=f(this,Ot).get(e);return i&&(i.prev?i.prev.next=i.next:L(this,gt,i.next),i.next?i.next.prev=i.prev:L(this,Lt,i.prev),f(this,Ot).delete(e)),i};class Fs extends WeakMap{get(t){let e=super.get(t);return e||(e={},this.set(t,e)),e}}class jt extends URLSearchParams{constructor(){super(...arguments);C(this,ve,e=>typeof e=="string"?e:JSON.stringify(e));C(this,Jn,e=>{if(!e)return null;try{return JSON.parse(e)}catch{return null}})}concat(e){let i;typeof e=="string"?i=I(new URLSearchParams(e).entries()):i=e,$n(i).forEach(([s,o])=>{this.append(s,f(this,ve).call(this,o))})}setAny(e,i){if(Array.isArray(i))this.delete(e),i.forEach(s=>this.append(e,f(this,ve).call(this,s)));else{const s=f(this,ve).call(this,i);s?this.set(e,s):this.delete(e)}}getAny(e){return this.getAnyAll(e)[0]}getAnyAll(e){return this.getAll(e).filter(i=>i!=="").map(i=>f(this,Jn).call(this,i))}toString(){const e=super.toString();return e?`?${e}`:""}toJSON(){return this.toString()}}ve=new WeakMap,Jn=new WeakMap;function Sn(n,...t){return n.reduce((e,i,s)=>e+(t[s-1]??"")+i)}const dc=Sn;function yn(n=5){const t=Math.random().toString(36).slice(2,2+n);return t.length<n?t+yn(n-t.length):t}function At(n){return n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function uc(n){return n.replace(/-(.)/g,(t,e)=>e.toUpperCase())}function wn(n){return hc(n).forEach(t=>{delete n[t]}),n}class ft extends Error{constructor(t){super(t),this.message=`gem: ${this.message}`}}function qs(n,t){const e=n.length;if(t.length!==e)return!0;for(let i=0;i<e;i++)if(n[i]!==t[i])return!0;return!1}function En(n,t,e){let i=t;for(const s in n){const o=e(s,n[s]);i+=o?o+t:""}return i}function _c(n){return En(n,";",(t,e)=>e||e===0?`${At(t)}:${e}`:"")}function xs(n){return En(n," ",(t,e)=>e?t:"")}const fc=xs;function pc(n){return En(n,",",(t,e)=>e===!0||t===e?t:e?`${t}:${e}`:"")}const Oe=new WeakMap;function St(n){const t=Me(n,e=>{var i;Object.assign(t,e),(i=Oe.get(t))==null||i.forEach(s=>_t(s))});return Oe.set(t,new Set),t}function ht(n,t){const e=Oe.get(n);return e==null||e.add(t),()=>e==null?void 0:e.delete(t)}const mc=Object.freeze(Object.defineProperty({__proto__:null,_StoreListenerMap:Oe,connect:ht,createStore:St},Symbol.toStringTag,{value:"Module"}));h.html=(n,...t)=>Sn(n,...t.map(e=>e instanceof Element?e.outerHTML:e)),h.render=(n,t)=>t.innerHTML=n;function ai(n,t){h.html=n,h.render=t}const{assign:Bs,defineProperty:gc}=Object;gc(Symbol,"metadata",{value:Symbol.for("Symbol.metadata")});const Ks=n=>typeof n=="function"&&n(),yt=Symbol.for("gem@sheetToken"),Le=Symbol.for("gem@update"),js="gem-style-boundary",Cn="gem@render-error",vc=Le,ci=new WeakMap,Qs=new WeakMap;class $c extends CSSStyleSheet{constructor(){super(...arguments);C(this,vt);$(this,"cssText","")}get element(){return f(this,vt)||(L(this,vt,document.createElement("style")),f(this,vt).textContent=this.cssText),f(this,vt)}replaceSync(e){this.cssText=e,f(this,vt)&&(f(this,vt).textContent=e),super.replaceSync(e)}}vt=new WeakMap;class Sc{constructor(t=""){C(this,qt,"");C(this,un,"");C(this,$e,new Map);C(this,Se,new Map);L(this,un,t)}setContent(t){L(this,qt,t)}getStyle(t){var o;const e=t&&!((o=t.internals)!=null&&o.shadowRoot),i=e?t.constructor:this;if(!f(this,$e).has(i)){const a=new $c({media:f(this,un)});f(this,$e).set(i,a)}const s=f(this,$e).get(i);if(!f(this,Se).has(s)){let a=f(this,qt),c="";e&&(c=`@scope (${t.tagName}) to (:state(${js}) > *)`,a=`${c}{ ${a} }`),s.replaceSync(a),f(this,Se).set(s,c)}return s}updateStyle(){f(this,Se).forEach((t,e)=>{e.replaceSync(t?`${t}{${f(this,qt)}}`:f(this,qt))})}}qt=new WeakMap,un=new WeakMap,$e=new WeakMap,Se=new WeakMap;function Qt(n,...t){let e="",i="";const s=t.at(0);Array.isArray(n)?i=Sn(n,...t):s!==void 0?(e=n,i=s):i=n;const o=new Sc(e),a={[yt]:o};let c="";return typeof i=="string"?c=i:Object.keys(i).forEach(u=>{const d=u==="$";a[u]=d||u.includes("-")?u:`${u}-${yn()}`,c+=`${d?":where(:scope:not([hidden])),:host(:where(:not([hidden])))":`.${a[u]}`} {${i[u]}}`}),o.setContent(c),a}const li=typeof process<"u",Js=(n,t,e)=>{let i=!1;t.forEach(s=>{const o=n.get(s)||0;i||(i=e===1&&o===0||e===-1&&o===1),n.set(s,o+e)}),i&&_t(Qs.get(n),li)},yc=(n,t)=>{const e=n.getRootNode();if(!ci.has(e)){const s=new Map;ci.set(e,s),Qs.set(s,()=>{const o=e.adoptedStyleSheets.filter(a=>!s.has(a));s.forEach((a,c)=>a&&o.push(c)),e.adoptedStyleSheets=o.reverse()})}const i=ci.get(e);return Js(i,t,1),()=>Js(i,t,-1)};h.createState=void 0;function Ys(n){n==null||n.forEach(t=>{const{callback:e,getDep:i,values:s,preCallback:o}=t,a=i==null?void 0:i();(!i||!s||qs(s,a))&&(Ks(o),t.preCallback=e(a,s),t.values=a,t.initialized=!0)})}function Zs(n){return n.filter(t=>(Ks(t.preCallback),t.initialized=!1,t.values=void 0,t.fixed))}h._createTemplate=void 0;const Jt=new Us,hi=(n=performance.now())=>{if(performance.now()>n+16)return requestAnimationFrame(hi);const t=Jt.get();t&&(t(),hi(n))};Jt.addEventListener("start",()=>_t(hi));let Xs;class J extends HTMLElement{constructor(){super();C(this,lt);C(this,ye);C(this,st);C(this,ut,[]);C(this,xt,[]);C(this,$t,[]);C(this,we);C(this,ct);C(this,Ee);C(this,Ce);C(this,Bt);C(this,Yn,()=>{Ys(f(this,ut))});C(this,Zn,()=>{Ys(f(this,xt))});C(this,_n,e=>{try{L(this,Ce,!0),f(this,Zn).call(this);const i=f(this,ye)===this,s=e?e.render():i?void 0:h.html`<slot></slot>`;if(s===void 0)return;h.render(s!==null?s:i?h.html`<style>@scope{:scope{display:none !important}}</style>`:h.html`<style>:host{display:none !important}</style>`,f(this,ye))}catch(i){throw this.dispatchEvent(new CustomEvent(Cn,{bubbles:!0,composed:!0,detail:i})),i}finally{L(this,Ce,!1)}});C(this,be,()=>{const e=f(this,lt,Ds);f(this,ct)&&(e||!f(this,$t).length)&&(f(this,_n).call(this,e),_t(f(this,Yn)))});C(this,Kt,()=>{f(this,lt,ke).noBlocking?Jt.add(f(this,be)):f(this,be).call(this)});C(this,fn,()=>{const{adoptedStyleSheets:e=[]}=f(this,lt,ke),{shadowRoot:i,sheets:s}=f(this,st),o=e.map(a=>a[yt].getStyle(this));if(i)i.adoptedStyleSheets=o.concat(s);else return this.prepend(...s.map(a=>a.element)),yc(this,o)});C(this,Xn,()=>{var e;(e=f(this,ut))==null||e.forEach(i=>{const{callback:s,getDep:o,initialized:a}=i;a||(i.values=o==null?void 0:o(),i.preCallback=s(i.values),i.initialized=!0)})});C(this,ti,()=>{var e;this.willMount&&this.memo(this.willMount.bind(this),()=>[]),this.mounted&&this.effect(this.mounted.bind(this),()=>[]),this.updated&&this.effect((i,s)=>s&&this.updated.apply(this)),this.unmounted&&this.effect(()=>this.unmounted.bind(this),()=>[]),!f(this,$t).length&&this.render&&f(this,$t).push({render:this.render.bind(this),condition:(e=this.shouldUpdate)==null?void 0:e.bind(this)})});C(this,pn);C(this,Te,async()=>{var o;if(f(this,we)){L(this,we,!1),(o=f(this,Bt))==null||o.call(this),L(this,Bt,f(this,fn).call(this));return}L(this,Ee,!0),f(this,ti).call(this);const{observedStores:e,mode:i,penetrable:s}=f(this,lt,ke);!i&&f(this,$t).length&&!s&&f(this,st).states.add(js),L(this,pn,e==null?void 0:e.map(a=>ht(a,f(this,Kt)))),f(this,_n).call(this,f(this,lt,Ds)),L(this,ct,!0),L(this,Bt,f(this,fn).call(this)),_t(f(this,Xn))});$(this,"effect",(e,i)=>{const s={callback:e,getDep:i,initialized:f(this,ct),fixed:!f(this,Ee)};f(this,ct)&&(s.values=i==null?void 0:i(),s.preCallback=e(s.values)),f(this,ut).push(s)});$(this,"memo",(e,i)=>{f(this,xt).push({callback:e,getDep:i,fixed:!f(this,Ee)})});$(this,"update",()=>_t(f(this,Kt)));Xs=this;const{mode:e,serializable:i,delegatesFocus:s,slotAssignment:o,aria:a}=f(this,lt,ke),{focusable:c,...u}=a||{};L(this,ye,e?this.attachShadow({mode:e,serializable:i,delegatesFocus:s,slotAssignment:o}):this),L(this,st,this.attachInternals()),f(this,st).stateList=[],f(this,st).sheets=[],Bs(f(this,st),u);let d;f(this,ut).push({fixed:!0,getDep:()=>[this.disabled],callback:([m=!1])=>{if(d===void 0&&(d=this.hasAttribute("tabindex")),f(this,st).ariaDisabled=String(m),c&&!d&&(this.tabIndex=-Number(m)),(c||s)&&m)return oi(this,"click",r=>r.isTrusted&&r.stopImmediatePropagation(),{capture:!0})}})}[vc](){f(this,ct)&&_t(f(this,Kt))}get internals(){return f(this,st)}connectedCallback(){f(this,lt,ke).noBlocking?Jt.add(f(this,Te)):f(this,Te).call(this)}disconnectedCallback(){var e,i;if(this.isConnected){L(this,we,!0);return}Jt.delete(f(this,Te)),Jt.delete(f(this,be)),L(this,ct,!1),(e=f(this,pn))==null||e.forEach(s=>s()),L(this,ut,Zs(f(this,ut))),L(this,xt,Zs(f(this,xt))),(i=f(this,Bt))==null||i.call(this)}}ye=new WeakMap,st=new WeakMap,ut=new WeakMap,xt=new WeakMap,$t=new WeakMap,we=new WeakMap,ct=new WeakMap,Ee=new WeakMap,Ce=new WeakMap,Bt=new WeakMap,lt=new WeakSet,ke=function(){return this.constructor[Symbol.metadata]},Ds=function(){return f(this,$t).findLast(e=>!e.condition||e.condition())},Yn=new WeakMap,Zn=new WeakMap,_n=new WeakMap,be=new WeakMap,Kt=new WeakMap,fn=new WeakMap,Xn=new WeakMap,ti=new WeakMap,pn=new WeakMap,Te=new WeakMap,h.createState=e=>{const i=Xs,s=Me(e,o=>{const a=f(i,ut).at(0);if(f(i,ct)&&a&&!a.initialized)throw new ft("Do't set state sync before insert the DOM");Bs(s,o),!f(i,Ce)&&f(i,ct)&&_t(f(i,Kt))});return f(i,st).stateList.push(s),s},h._createTemplate=(e,i)=>f(e,$t).push(i);const wc=Object.freeze(Object.defineProperty({__proto__:null,GemElement:J,SheetToken:yt,UpdateToken:Le,_RenderErrorEvent:Cn,get _createTemplate(){return h._createTemplate},get createState(){return h.createState},css:Qt,get html(){return h.html},isSSR:li,get render(){return h.render},setEngine:ai},Symbol.toStringTag,{value:"Module"})),{deleteProperty:Ec,getOwnPropertyDescriptor:di,defineProperty:bn}=Reflect,{getPrototypeOf:Tn,assign:Cc,hasOwn:Pn}=Object,tr=new Fs;function wt(n,t,e){var s;const i=n.metadata;di(i,t)||bn(i,t,{value:((s=i[t])==null?void 0:s.filter(o=>o!==e))||[]}),i[t].push(e)}function kn(n,t){const{value:e}=di(n,t)||{};Ec(n,t),n[t]=e}const ui=new WeakMap,{setAttribute:er,toggleAttribute:bc,removeAttribute:nr}=Element.prototype,_i=(n,t)=>{var e;return(e=ui.get(Tn(n)))==null?void 0:e.get(t)};J.prototype.setAttribute=function(n,t){const e=_i(this,n);if(!e)return er.call(this,n,t);this[e]=t},J.prototype.removeAttribute=function(n){const t=_i(this,n);if(!t)return nr.call(this,n);this[t]=null},J.prototype.toggleAttribute=function(n,t){const e=_i(this,n);return e?this[e]=t??!this.hasAttribute(n):bc.call(this,n,t)};function Tc(){}const ir=Symbol("event handle");function fi(n,t,{attr:e,attrType:i,event:s,eventOptions:o}={}){bn(n,t,{configurable:!0,get(){const a=tr.get(this)[t];return s&&!a?(this[t]=Tc,this[t]):a},set(a){const c=this,u=tr.get(c);e&&(a=i===Boolean&&a===""?!0:i(a||""),a?er.call(this,e,i===Boolean?"":a):nr.call(this,e)),a!==u[t]&&(s?(u[t]=a!=null&&a[ir]?a:async(d,m)=>{await Promise.resolve();const r=new CustomEvent(s,{...m,...o,detail:d});c.dispatchEvent(r),await a(d,m)},u[t][ir]=!0):(u[t]=a,this[Le]()))}})}const sr=new WeakMap;function Ae(n,{metadata:t}){const e=sr.get(t);if(e)return e;let i=n;do i=Tn(i);while(i.constructor[Symbol.metadata]!==t);return sr.set(t,i),i}function pi(n,t){const e=n.name,i=At(e);return n.addInitializer(function(){const s=Ae(this,n);Pn(s,e)||(wt(n,"observedAttributes",i),fi(s,e,{attr:i,attrType:t})),kn(this,e);const o=Tn(this),a=ui.get(o)||new Map;a.set(i,e),ui.set(o,a)}),function(s){return this.getAttribute(i)??s}}function F(n,t){return pi(t,String)}function Ne(n,t){return pi(t,Boolean)}function rr(n,t){return pi(t,Number)}function x(n,t){const e=t.name;return t.addInitializer(function(){const i=Ae(this,t);Pn(i,e)||(wt(t,"observedProperties",e),fi(i,e)),kn(this,e)}),function(i){return this[e]??i}}function mi(n){return(t,e)=>{const{addInitializer:i,name:s,access:o,kind:a}=e;i(function(){const c=n&&(()=>n(this));if(a==="getter"){if(e.private)throw new ft("not support");const u=Ae(this,e),d=di(u,s).get.bind(this);this.memo(()=>{bn(this,s,{configurable:!0,value:d()})},c)}else this.memo(o.get.call(this,this).bind(this),c)})}}function pt(n){return(t,{addInitializer:e,access:i})=>{e(function(){this.effect(i.get.call(this,this).bind(this),n&&(()=>n(this)))})}}function or(){return(n,{addInitializer:t,access:e})=>{t(function(){this.effect(()=>e.get.call(this,this).bind(this),()=>[])})}}function Mn(){return mi(()=>[])}function Yt(){return pt(()=>[])}function Nt(n){return(t,{addInitializer:e,access:i})=>{e(function(){h._createTemplate(this,{render:i.get.call(this,this).bind(this),condition:n&&(()=>n(this))})})}}function ar(){return(n,{addInitializer:t,access:e})=>{t(function(){this.addEventListener(Cn,({detail:i})=>{h.render(e.get.call(this,this).apply(this,[i]),this.internals.shadowRoot||this)})})}}function Pc(n,t,e){bn(n,t,{configurable:!0,get(){const i=this,{states:s}=i.internals;return s==null?void 0:s.has(e)},set(i){const s=this,{states:o}=s.internals;i?o==null||o.add(e):o==null||o.delete(e)}})}function Re(n,t){const e=t.name,i=At(e);t.addInitializer(function(){const s=Ae(this,t);Pn(s,e)||(wt(t,"definedCSSStates",i),Pc(s,e,i)),kn(this,e)})}function cr(n,t,e,i){const s=n.name,o=At(s);if(n.static)wt(n,e,o);else{const a=Tn(t);a[s]||(a[s]=o,wt(n,e,o))}return i||o}function lr(n,t){return function(e){return cr(t,this,"definedSlots",e)}}function gi(n,t){return function(e){return cr(t,this,"definedParts",e)}}function Zt(n,t){dr(t)}function hr(n,t){dr(t,{bubbles:!0,composed:!0})}function dr(n,t){const e=n.name,i=At(e);n.addInitializer(function(){const s=Ae(this,n);Pn(s,e)||(wt(n,"definedEvents",i),fi(s,e,{event:i,eventOptions:t})),kn(this,e)})}function Ie(n){return(t,e)=>{wt(e,"adoptedStyleSheets",n)}}function He(n){return(t,e)=>{wt(e,"observedStores",n)}}function Et({mode:n="open",serializable:t=!0,delegatesFocus:e,slotAssignment:i}={}){return(s,o)=>{const a=o.metadata;Cc(a,{mode:n,serializable:t,delegatesFocus:e,slotAssignment:i})}}function vi({penetrable:n}){return(t,e)=>{const i=e.metadata;i.penetrable=n}}function ur(){return(n,t)=>{const e=t.metadata;e.noBlocking=!0}}function We(n){return(t,e)=>{const i=e.metadata;i.aria={...i.aria,...n}}}function _r(n){return(t,{addInitializer:e})=>{e(()=>{customElements.define(n,t)})}}const kc=Object.freeze(Object.defineProperty({__proto__:null,adoptedStyle:Ie,aria:We,async:ur,attribute:F,boolattribute:Ne,connectStore:He,customElement:_r,effect:pt,emitter:Zt,fallback:ar,globalemitter:hr,light:vi,memo:mi,mounted:Yt,numattribute:rr,part:gi,property:x,shadow:Et,slot:lr,state:Re,template:Nt,unmounted:or,willMount:Mn},Symbol.toStringTag,{value:"Module"}));/**
|
|
1
|
+
(function(l,L){typeof exports=="object"&&typeof module<"u"?L(exports):typeof define=="function"&&define.amd?define(["exports"],L):(l=typeof globalThis<"u"?globalThis:l||self,L(l.Gem={}))})(this,function(l){"use strict";var Dl=Object.defineProperty;var dc=l=>{throw TypeError(l)};var Ul=(l,L,I)=>L in l?Dl(l,L,{enumerable:!0,configurable:!0,writable:!0,value:I}):l[L]=I;var $=(l,L,I)=>Ul(l,typeof L!="symbol"?L+"":L,I),Us=(l,L,I)=>L.has(l)||dc("Cannot "+I);var f=(l,L,I)=>(Us(l,L,"read from private field"),I?I.call(l):L.get(l)),C=(l,L,I)=>L.has(l)?dc("Cannot add the same private member more than once"):L instanceof WeakSet?L.add(l):L.set(l,I),O=(l,L,I,vn)=>(Us(l,L,"write to private field"),vn?vn.call(l,I):L.set(l,I),I),qs=(l,L,I)=>(Us(l,L,"access private method"),I);var $t,ut,St,ln,Fs,ve,Qn,yt,Ft,dn,$e,Se,ye,it,_t,xt,wt,we,at,Ee,Ce,Bt,ct,Pe,xs,Jn,Yn,un,be,Kt,_n,Zn,Xn,fn,Te,pn,ke,ti,z,ei,pc,mc,gn,ni,mn;const{assign:L,fromEntries:I,entries:vn,keys:gc}=Object;function vc(n){Promise.resolve().then(n)}const ii=new Set;function ft(n,t=vc){ii.has(n)||(t(()=>{ii.delete(n),n()}),ii.add(n))}function Me(n,t){const e=t;return delete e.name,delete e.length,L(e,n),e}function si(n="",t=""){const{pathname:e,search:i,hash:s}=new URL(t,location.origin+n);return e+i+decodeURIComponent(s)}function ri(n,t,e,i){return n.addEventListener(t,e,i),()=>n.removeEventListener(t,e,i)}class Bs extends EventTarget{constructor(){super(...arguments);C(this,ln);C(this,$t,new Map);C(this,ut);C(this,St)}get size(){return f(this,$t).size}get first(){return f(this,ut)}get last(){return f(this,St)}isSuperLinkOf(e){let i=e.first;if(!i)return!0;let s=this.find(i.value);for(;s&&s.value===i.value;){if(i=i.next,!i)return!0;s=s.next}return!1}find(e){return f(this,$t).get(e)}add(e){f(this,St)||this.dispatchEvent(new CustomEvent("start"));const i=qs(this,ln,Fs).call(this,e)||{value:e};i.prev=f(this,St),i.prev&&(i.prev.next=i),i.next=void 0,O(this,St,i),f(this,ut)||O(this,ut,i),f(this,$t).set(e,i)}delete(e){const i=qs(this,ln,Fs).call(this,e);return f(this,ut)||this.dispatchEvent(new CustomEvent("end")),i}clear(){f(this,$t).clear(),O(this,ut,O(this,St,void 0))}get(){const e=f(this,ut);if(e)return this.delete(e.value),e.value}}$t=new WeakMap,ut=new WeakMap,St=new WeakMap,ln=new WeakSet,Fs=function(e){const i=f(this,$t).get(e);return i&&(i.prev?i.prev.next=i.next:O(this,ut,i.next),i.next?i.next.prev=i.prev:O(this,St,i.prev),f(this,$t).delete(e)),i};class Ks extends WeakMap{get(t){let e=super.get(t);return e||(e={},this.set(t,e)),e}}class jt extends URLSearchParams{constructor(){super(...arguments);C(this,ve,e=>typeof e=="string"?e:JSON.stringify(e));C(this,Qn,e=>{if(!e)return null;try{return JSON.parse(e)}catch{return null}})}concat(e){let i;typeof e=="string"?i=I(new URLSearchParams(e).entries()):i=e,vn(i).forEach(([s,o])=>{this.append(s,f(this,ve).call(this,o))})}setAny(e,i){if(Array.isArray(i))this.delete(e),i.forEach(s=>this.append(e,f(this,ve).call(this,s)));else{const s=f(this,ve).call(this,i);s?this.set(e,s):this.delete(e)}}getAny(e){return this.getAnyAll(e)[0]}getAnyAll(e){return this.getAll(e).filter(i=>i!=="").map(i=>f(this,Qn).call(this,i))}toString(){const e=super.toString();return e?`?${e}`:""}toJSON(){return this.toString()}}ve=new WeakMap,Qn=new WeakMap;function $n(n,...t){return n.reduce((e,i,s)=>e+(t[s-1]??"")+i)}const $c=$n;function Sn(n=5){const t=Math.random().toString(36).slice(2,2+n);return t.length<n?t+Sn(n-t.length):t}function At(n){return n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Sc(n){return n.replace(/-(.)/g,(t,e)=>e.toUpperCase())}function yn(n){return gc(n).forEach(t=>{delete n[t]}),n}class pt extends Error{constructor(t){super(t),this.message=`gem: ${this.message}`}}function js(n,t){const e=n.length;if(t.length!==e)return!0;for(let i=0;i<e;i++)if(n[i]!==t[i])return!0;return!1}function wn(n,t,e){let i=t;for(const s in n){const o=e(s,n[s]);i+=o?o+t:""}return i}function yc(n){return wn(n,";",(t,e)=>e||e===0?`${At(t)}:${e}`:"")}function Qs(n){return wn(n," ",(t,e)=>e?t:"")}const wc=Qs;function Ec(n){return wn(n,",",(t,e)=>e===!0||t===e?t:e?`${t}:${e}`:"")}const Oe=new WeakMap;function Et(n){const t=Me(n,e=>{var i;Object.assign(t,e),(i=Oe.get(t))==null||i.forEach(s=>ft(s))});return Oe.set(t,new Set),t}function ht(n,t){const e=Oe.get(n);return e==null||e.add(t),()=>e==null?void 0:e.delete(t)}const Cc=Object.freeze(Object.defineProperty({__proto__:null,_StoreListenerMap:Oe,connect:ht,createStore:Et},Symbol.toStringTag,{value:"Module"}));l.html=(n,...t)=>$n(n,...t.map(e=>e instanceof Element?e.outerHTML:e)),l.render=(n,t)=>t.innerHTML=n;function oi(n,t){l.html=n,l.render=t}const{assign:Js,defineProperty:bc}=Object;bc(Symbol,"metadata",{value:Symbol.for("Symbol.metadata")});const Ys=n=>typeof n=="function"&&n(),ai=globalThis.nQM,mt=Symbol.for("gem@sheetToken"),Le=Symbol.for("gem@update"),Zs="gem-style-boundary",En="gem@render-error",Tc=Le,ci=new WeakMap,Xs=new WeakMap;class kc extends CSSStyleSheet{constructor(){super(...arguments);C(this,yt);$(this,"cssText","")}get element(){return f(this,yt)||(O(this,yt,document.createElement("style")),f(this,yt).textContent=this.cssText),f(this,yt)}replaceSync(e){this.cssText=e,f(this,yt)&&(f(this,yt).textContent=e),super.replaceSync(e)}}yt=new WeakMap;class Pc{constructor(t=""){C(this,Ft,"");C(this,dn,"");C(this,$e,new Map);C(this,Se,new Map);O(this,dn,t)}setContent(t){O(this,Ft,t)}getStyle(t,e){var a;const i=t&&!((a=t.internals)!=null&&a.shadowRoot),s=i?t.constructor:this;if(!f(this,$e).has(s)){const c=new kc({media:f(this,dn)});f(this,$e).set(s,c)}const o=f(this,$e).get(s);if(!f(this,Se).has(o)){let c=f(this,Ft),d="";i&&(d=e?"@scope":`@scope (${t.tagName}) to (:state(${Zs}) > *)`,c=`${d}{ ${c} }`),o.replaceSync(c),f(this,Se).set(o,d)}return o}updateStyle(){f(this,Se).forEach((t,e)=>{e.replaceSync(t?`${t}{${f(this,Ft)}}`:f(this,Ft))})}}Ft=new WeakMap,dn=new WeakMap,$e=new WeakMap,Se=new WeakMap;function Nt(n,...t){let e="",i="";const s=t.at(0);Array.isArray(n)?i=$n(n,...t):s!==void 0?(e=n,i=s):i=n;const o=new Pc(e),a={[mt]:o};let c="";return typeof i=="string"?c=i:Object.keys(i).forEach(d=>{const u=d==="$";a[d]=u||d.includes("-")?d:`${d}-${Sn()}`,c+=`${u?":where(&:not([hidden])),:host(:where(:not([hidden])))":`.${a[d]}`} {${i[d]}}`}),o.setContent(c),a}const tr=(n,t,e)=>{let i=!1;t.forEach(s=>{const o=n.get(s)||0;i||(i=e===1&&o===0||e===-1&&o===1),n.set(s,o+e)}),i&&ft(Xs.get(n),ai)},Mc=(n,t)=>{const e=n.getRootNode();if(!ci.has(e)){const s=new Map;ci.set(e,s),Xs.set(s,()=>{const o=e.adoptedStyleSheets.filter(a=>!s.has(a));s.forEach((a,c)=>a&&o.push(c)),e.adoptedStyleSheets=o.reverse()})}const i=ci.get(e);return tr(i,t,1),()=>tr(i,t,-1)};l.createState=void 0;function er(n){n==null||n.forEach(t=>{const{callback:e,getDep:i,values:s,preCallback:o}=t,a=i==null?void 0:i();(!i||!s||js(s,a))&&(Ys(o),t.preCallback=e(a,s),t.values=a,t.initialized=!0)})}function nr(n){return n.filter(t=>(Ys(t.preCallback),t.initialized=!1,t.values=void 0,t.fixed))}l._createTemplate=void 0;const Qt=new Bs,hi=(n=performance.now())=>{if(performance.now()>n+16)return requestAnimationFrame(hi);const t=Qt.get();t&&(t(),hi(n))};Qt.addEventListener("start",()=>ft(hi));let ir;class J extends HTMLElement{constructor(){super();C(this,ct);C(this,ye);C(this,it);C(this,_t,[]);C(this,xt,[]);C(this,wt,[]);C(this,we);C(this,at);C(this,Ee);C(this,Ce);C(this,Bt);C(this,Jn,()=>{er(f(this,_t))});C(this,Yn,()=>{er(f(this,xt))});C(this,un,e=>{try{O(this,Ce,!0),f(this,Yn).call(this);const i=f(this,ye)===this,s=e?e.render():i?void 0:l.html`<slot></slot>`;if(s===void 0)return;l.render(s!==null?s:l.html`<style>${i?"@scope":":host"}{&{display:none!important;}}</style>`,f(this,ye))}catch(i){throw this.dispatchEvent(new CustomEvent(En,{bubbles:!0,composed:!0,detail:i})),i}finally{O(this,Ce,!1)}});C(this,be,()=>{const e=f(this,ct,xs);f(this,at)&&(e||!f(this,wt).length)&&(f(this,un).call(this,e),ft(f(this,Jn)))});C(this,Kt,()=>{f(this,ct,Pe).noBlocking?Qt.add(f(this,be)):f(this,be).call(this)});C(this,_n,()=>{const{adoptedStyleSheets:e=[]}=f(this,ct,Pe),{shadowRoot:i,sheets:s}=f(this,it),o=e.map(a=>a[mt].getStyle(this));if(i)i.adoptedStyleSheets=o.concat(s);else return this.prepend(...s.map(a=>a.element)),Mc(this,o)});C(this,Zn,()=>{var e;(e=f(this,_t))==null||e.forEach(i=>{const{callback:s,getDep:o,initialized:a}=i;a||(i.values=o==null?void 0:o(),i.preCallback=s(i.values),i.initialized=!0)})});C(this,Xn,()=>{var e;this.willMount&&this.memo(this.willMount.bind(this),()=>[]),this.mounted&&this.effect(this.mounted.bind(this),()=>[]),this.updated&&this.effect((i,s)=>s&&this.updated.apply(this)),this.unmounted&&this.effect(()=>this.unmounted.bind(this),()=>[]),!f(this,wt).length&&this.render&&f(this,wt).push({render:this.render.bind(this),condition:(e=this.shouldUpdate)==null?void 0:e.bind(this)})});C(this,fn);C(this,Te,async()=>{var o;if(f(this,we)){O(this,we,!1),(o=f(this,Bt))==null||o.call(this),O(this,Bt,f(this,_n).call(this));return}O(this,Ee,!0),f(this,Xn).call(this);const{observedStores:e,mode:i,penetrable:s}=f(this,ct,Pe);!i&&f(this,wt).length&&!s&&f(this,it).states.add(Zs),O(this,fn,e==null?void 0:e.map(a=>ht(a,f(this,Kt)))),f(this,un).call(this,f(this,ct,xs)),O(this,at,!0),O(this,Bt,f(this,_n).call(this)),ft(f(this,Zn))});$(this,"effect",(e,i)=>{const s={callback:e,getDep:i,initialized:f(this,at),fixed:!f(this,Ee)};f(this,at)&&(s.values=i==null?void 0:i(),s.preCallback=e(s.values)),f(this,_t).push(s)});$(this,"memo",(e,i)=>{f(this,xt).push({callback:e,getDep:i,fixed:!f(this,Ee)})});$(this,"update",()=>ft(f(this,Kt)));ir=this;const{mode:e,serializable:i,delegatesFocus:s,slotAssignment:o,aria:a}=f(this,ct,Pe),{focusable:c,...d}=a||{};O(this,ye,e?this.attachShadow({mode:e,serializable:i,delegatesFocus:s,slotAssignment:o}):this),O(this,it,this.attachInternals()),f(this,it).stateList=[],f(this,it).sheets=[],Js(f(this,it),d);let u;f(this,_t).push({fixed:!0,getDep:()=>[this.disabled],callback:([m=!1])=>{if(u===void 0&&(u=this.hasAttribute("tabindex")),f(this,it).ariaDisabled=String(m),c&&!u&&(this.tabIndex=-Number(m)),(c||s)&&m)return ri(this,"click",r=>r.isTrusted&&r.stopImmediatePropagation(),{capture:!0})}})}[Tc](){f(this,at)&&ft(f(this,Kt))}get internals(){return f(this,it)}connectedCallback(){f(this,ct,Pe).noBlocking?Qt.add(f(this,Te)):f(this,Te).call(this)}disconnectedCallback(){var e,i;if(this.isConnected){O(this,we,!0);return}Qt.delete(f(this,Te)),Qt.delete(f(this,be)),O(this,at,!1),(e=f(this,fn))==null||e.forEach(s=>s()),O(this,_t,nr(f(this,_t))),O(this,xt,nr(f(this,xt))),(i=f(this,Bt))==null||i.call(this)}}ye=new WeakMap,it=new WeakMap,_t=new WeakMap,xt=new WeakMap,wt=new WeakMap,we=new WeakMap,at=new WeakMap,Ee=new WeakMap,Ce=new WeakMap,Bt=new WeakMap,ct=new WeakSet,Pe=function(){return this.constructor[Symbol.metadata]},xs=function(){return f(this,wt).findLast(e=>!e.condition||e.condition())},Jn=new WeakMap,Yn=new WeakMap,un=new WeakMap,be=new WeakMap,Kt=new WeakMap,_n=new WeakMap,Zn=new WeakMap,Xn=new WeakMap,fn=new WeakMap,Te=new WeakMap,l.createState=e=>{const i=ir,s=Me(e,o=>{const a=f(i,_t).at(0);if(!ai&&f(i,at)&&a&&!a.initialized)throw new pt("Don't set state sync before insert the DOM");Js(s,o),!f(i,Ce)&&f(i,at)&&ft(f(i,Kt),ai)});return f(i,it).stateList.push(s),s},l._createTemplate=(e,i)=>f(e,wt).push(i);const Oc=Object.freeze(Object.defineProperty({__proto__:null,GemElement:J,SheetToken:mt,UpdateToken:Le,_RenderErrorEvent:En,get _createTemplate(){return l._createTemplate},get createState(){return l.createState},css:Nt,get html(){return l.html},get render(){return l.render},setEngine:oi},Symbol.toStringTag,{value:"Module"})),{deleteProperty:Lc,getOwnPropertyDescriptor:li,defineProperty:Cn}=Reflect,{getPrototypeOf:bn,assign:Ac,hasOwn:Tn}=Object,sr=new Ks;function Ct(n,t,e){var s;const i=n.metadata;li(i,t)||Cn(i,t,{value:((s=i[t])==null?void 0:s.filter(o=>o!==e))||[]}),i[t].push(e)}function kn(n,t){const{value:e}=li(n,t)||{};Lc(n,t),n[t]=e}const di=new WeakMap,{setAttribute:rr,toggleAttribute:Nc,removeAttribute:or}=Element.prototype,ui=(n,t)=>{var e;return(e=di.get(bn(n)))==null?void 0:e.get(t)};J.prototype.setAttribute=function(n,t){const e=ui(this,n);if(!e)return rr.call(this,n,t);this[e]=t},J.prototype.removeAttribute=function(n){const t=ui(this,n);if(!t)return or.call(this,n);this[t]=null},J.prototype.toggleAttribute=function(n,t){const e=ui(this,n);return e?this[e]=t??!this.hasAttribute(n):Nc.call(this,n,t)};function Rc(){}const ar=Symbol("event handle");function _i(n,t,{attr:e,attrType:i,event:s,eventOptions:o}={}){Cn(n,t,{configurable:!0,get(){const a=sr.get(this)[t];return s&&!a?(this[t]=Rc,this[t]):a},set(a){const c=this,d=sr.get(c);e&&(a=i===Boolean&&a===""?!0:i(a||""),a?rr.call(this,e,i===Boolean?"":a):or.call(this,e)),a!==d[t]&&(s?(d[t]=a!=null&&a[ar]?a:async(u,m)=>{await Promise.resolve();const r=new CustomEvent(s,{...m,...o,detail:u});c.dispatchEvent(r),await a(u,m)},d[t][ar]=!0):(d[t]=a,this[Le]()))}})}const cr=new WeakMap;function Ae(n,{metadata:t}){const e=cr.get(t);if(e)return e;let i=n;do i=bn(i);while(i.constructor[Symbol.metadata]!==t);return cr.set(t,i),i}function fi(n,t){const e=n.name,i=At(e);return n.addInitializer(function(){const s=Ae(this,n);Tn(s,e)||(Ct(n,"observedAttributes",i),_i(s,e,{attr:i,attrType:t})),kn(this,e);const o=bn(this),a=di.get(o)||new Map;a.set(i,e),di.set(o,a)}),function(s){return this.getAttribute(i)??s}}function x(n,t){return fi(t,String)}function Ne(n,t){return fi(t,Boolean)}function hr(n,t){return fi(t,Number)}function U(n,t){const e=t.name;return t.addInitializer(function(){const i=Ae(this,t);Tn(i,e)||(Ct(t,"observedProperties",e),_i(i,e)),kn(this,e)}),function(i){return this[e]??i}}function pi(n){return(t,e)=>{const{addInitializer:i,name:s,access:o,kind:a}=e;i(function(){const c=n&&(()=>n(this));if(a==="getter"){if(e.private)throw new pt("not support");const d=Ae(this,e),u=li(d,s).get.bind(this);this.memo(()=>{Cn(this,s,{configurable:!0,value:u()})},c)}else this.memo(o.get.call(this,this).bind(this),c)})}}function lt(n){return(t,{addInitializer:e,access:i})=>{e(function(){this.effect(i.get.call(this,this).bind(this),n&&(()=>n(this)))})}}function lr(){return(n,{addInitializer:t,access:e})=>{t(function(){this.effect(()=>e.get.call(this,this).bind(this),()=>[])})}}function Pn(){return pi(()=>[])}function Jt(){return lt(()=>[])}function Rt(n){return(t,{addInitializer:e,access:i})=>{e(function(){l._createTemplate(this,{render:i.get.call(this,this).bind(this),condition:n&&(()=>n(this))})})}}function dr(){return(n,{addInitializer:t,access:e})=>{t(function(){this.addEventListener(En,({detail:i})=>{l.render(e.get.call(this,this).apply(this,[i]),this.internals.shadowRoot||this)})})}}function Ic(n,t,e){Cn(n,t,{configurable:!0,get(){const i=this,{states:s}=i.internals;return s==null?void 0:s.has(e)},set(i){const s=this,{states:o}=s.internals;i?o==null||o.add(e):o==null||o.delete(e)}})}function Re(n,t){const e=t.name,i=At(e);t.addInitializer(function(){const s=Ae(this,t);Tn(s,e)||(Ct(t,"definedCSSStates",i),Ic(s,e,i)),kn(this,e)})}function ur(n,t,e,i){const s=n.name,o=At(s);if(n.static)Ct(n,e,o);else{const a=bn(t);a[s]||(a[s]=o,Ct(n,e,o))}return i||o}function _r(n,t){return function(e){return ur(t,this,"definedSlots",e)}}function mi(n,t){return function(e){return ur(t,this,"definedParts",e)}}function Yt(n,t){pr(t)}function fr(n,t){pr(t,{bubbles:!0,composed:!0})}function pr(n,t){const e=n.name,i=At(e);n.addInitializer(function(){const s=Ae(this,n);Tn(s,e)||(Ct(n,"definedEvents",i),_i(s,e,{event:i,eventOptions:t})),kn(this,e)})}function Zt(n){return(t,e)=>{Ct(e,"adoptedStyleSheets",n)}}function Ie(n){return(t,e)=>{Ct(e,"observedStores",n)}}function bt({mode:n="open",serializable:t=!0,delegatesFocus:e,slotAssignment:i}={}){return(s,o)=>{const a=o.metadata;Ac(a,{mode:n,serializable:t,delegatesFocus:e,slotAssignment:i})}}function gi({penetrable:n}){return(t,e)=>{const i=e.metadata;i.penetrable=n}}function mr(){return(n,t)=>{const e=t.metadata;e.noBlocking=!0}}function He(n){return(t,e)=>{const i=e.metadata;i.aria={...i.aria,...n}}}function gr(n){return(t,{addInitializer:e})=>{e(()=>{customElements.define(n,t)})}}const Hc=Object.freeze(Object.defineProperty({__proto__:null,adoptedStyle:Zt,aria:He,async:mr,attribute:x,boolattribute:Ne,connectStore:Ie,customElement:gr,effect:lt,emitter:Yt,fallback:dr,globalemitter:fr,light:gi,memo:pi,mounted:Jt,numattribute:hr,part:mi,property:U,shadow:bt,slot:_r,state:Re,template:Rt,unmounted:lr,willMount:Pn},Symbol.toStringTag,{value:"Module"}));/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2017 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/const
|
|
6
|
-
\f\r]`,
|
|
7
|
-
\f\r"'\`<>=]`,
|
|
5
|
+
*/const We=globalThis.trustedTypes,vr=We==null?void 0:We.createPolicy("lit-html",{createHTML:n=>n}),$r="$lit$",Tt=`lit$${Math.random().toFixed(9).slice(2)}$`,Sr="?"+Tt,Wc=`<${Sr}>`,It=document,Xt=()=>It.createComment(""),Ge=n=>n===null||typeof n!="object"&&typeof n!="function",te=n=>n==null,Gc=n=>Symbol.iterator in n,vi=`[
|
|
6
|
+
\f\r]`,zc=`[^
|
|
7
|
+
\f\r"'\`<>=]`,Vc=`[^\\s"'>=/]`,ze=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,yr=1,$i=2,Dc=3,wr=/-->/g,Er=/>/g,Ht=new RegExp(`>|${vi}(?:(${Vc}+)(${vi}*=${vi}*(?:${zc}|("|')|))|$)`,"g"),Uc=0,Cr=1,qc=2,br=3,Tr=/'/g,kr=/"/g,Pr=/^(?:script|style|textarea|title)$/i,Fc=1,Mn=2,On=3,Si=1,Ln=2,xc=3,Bc=4,Kc=5,yi=6,jc=7,Mr="v-if",Or="v-else-if",Lr="v-else";class wi{constructor(t,e,i){$(this,"type");$(this,"strings");$(this,"values");this.type=t,this.strings=e,this.values=i}}const Ei=n=>(t,...e)=>new wi(n,t,e),Qc=Ei(Fc),Jc=Ei(Mn),Yc=Ei(On),Ci=Symbol.for("lit-noChange"),Ar=new WeakMap,Wt=It.createTreeWalker(It,129);function Zc(n,t){if(!Array.isArray(n))throw new Error("invalid template");return vr!==void 0?vr.createHTML(t):t}const Xc=(n,t)=>{const e=n.length-1,i=[];let s=t===Mn?"<svg>":t===On?"<math>":"",o,a=ze;for(let d=0;d<e;d++){const u=n[d];let m=-1,r,g=0,h;for(;g<u.length&&(a.lastIndex=g,h=a.exec(u),h!==null);)g=a.lastIndex,a===ze?h[yr]==="!--"?a=wr:h[yr]!==void 0?a=Er:h[$i]!==void 0?(Pr.test(h[$i])&&(o=new RegExp(`</${h[$i]}`,"g")),a=Ht):h[Dc]!==void 0&&(a=Ht):a===Ht?h[Uc]===">"?(a=o??ze,m=-1):h[Cr]===void 0?m=-2:(m=a.lastIndex-h[qc].length,r=h[Cr],a=h[br]===void 0?Ht:h[br]==='"'?kr:Tr):a===kr||a===Tr?a=Ht:a===wr||a===Er?a=ze:(a=Ht,o=void 0);const v=a===Ht&&n[d+1].startsWith("/>")?" ":"";s+=a===ze?u+Wc:m>=0?(i.push(r),u.slice(0,m)+$r+u.slice(m)+Tt+v):u+Tt+(m===-2?d:v)}const c=s+(n[e]||"<?>")+(t===Mn?"</svg>":t===On?"</math>":"");return[Zc(n,c),i]};class bi{constructor({strings:t,type:e},i){$(this,"el");$(this,"parts",[]);let s,o=0,a=0;const c=t.length-1,d=this.parts,[u,m]=Xc(t,e);if(this.el=bi.createElement(u,i),Wt.currentNode=this.el.content,e===Mn||e===On){const r=this.el.content.firstChild;r.replaceWith(...r.childNodes)}for(;(s=Wt.nextNode())!==null&&d.length<c;){if(s.nodeType===1){if(s.hasAttributes())for(const r of s.getAttributeNames())if(r.endsWith($r)){const g=m[a++],v=s.getAttribute(r).split(Tt),S=/([.?@])?(.*)/.exec(g);d.push({type:Si,index:o,name:S[2],strings:v,ctor:S[1]==="."?nh:S[1]==="?"?ih:S[1]==="@"?sh:An}),s.removeAttribute(r)}else r.startsWith(Tt)&&(d.push({type:yi,index:o}),s.removeAttribute(r));if(Pr.test(s.tagName)){const r=s.textContent.split(Tt),g=r.length-1;if(g>0){s.textContent=We?We.emptyScript:"";for(let h=0;h<g;h++)s.append(r[h],Xt()),Wt.nextNode(),d.push({type:Ln,index:++o});s.append(r[g],Xt())}}}else if(s.nodeType===8)if(s.data===Sr)d.push({type:Ln,index:o});else{let g=-1;for(;(g=s.data.indexOf(Tt,g+1))!==-1;)d.push({type:jc,index:o}),g+=Tt.length-1}o++}}static createElement(t,e){const i=It.createElement("template");return i.innerHTML=t,i}}function ee(n,t,e=n,i){var a,c;if(t===Ci)return t;let s=i!==void 0?(a=e.__directives)==null?void 0:a[i]:e.__directive;const o=Ge(t)?void 0:t._$litDirective$;return(s==null?void 0:s.constructor)!==o&&((c=s==null?void 0:s._$notifyDirectiveConnectionChanged)==null||c.call(s,!1),o===void 0?s=void 0:(s=new o(n),s._$initialize(n,e,i)),i!==void 0?(e.__directives??(e.__directives=[]))[i]=s:e.__directive=s),s!==void 0&&(t=ee(n,s._$resolve(n,t.values),s,i)),t}class th{constructor(t,e){$(this,"_$template");$(this,"_$parts",[]);$(this,"_$conditions",[]);$(this,"_$parent");$(this,"_$disconnectableChildren");this._$template=t,this._$parent=e}get parentNode(){return this._$parent.parentNode}get _$isConnected(){return this._$parent._$isConnected}_clone(t){const{el:{content:e},parts:i}=this._$template,s=new Map,o=new Map,a=((t==null?void 0:t.creationScope)??It).importNode(e,!0);Wt.currentNode=a;let c=Wt.nextNode(),d=0,u=0,m=i[0];for(;m!==void 0;){if(d===m.index){let r;m.type===Ln?r=new Ve(c,c.nextSibling,this,t):m.type===Si?(m.name===Mr&&s.set(c,u),m.name===Or&&o.set(c,u),r=new m.ctor(c,m.name,m.strings,this,t)):m.type===yi&&(r=new rh(c,this,t)),this._$parts.push(r),m=i[++u]}d!==(m==null?void 0:m.index)&&(c=Wt.nextNode(),d++)}return s.forEach((r,g)=>{const h=new eh(g,r);this._$conditions.push(h);let v=g;for(;v=v.nextElementSibling;){const S=o.get(v);if(S===void 0)break;h.push(v,S)}}),Wt.currentNode=It,a}_update(t){let e=0;for(const i of this._$parts)i!==void 0&&(i.strings!==void 0?(i._$setValue(t,i,e),e+=i.strings.length-2):i.name===Mr||i.name===Or||i._$setValue(t[e])),e++;this._$conditions.forEach(i=>i.update(t))}}class eh{constructor(t,e){$(this,"mark");$(this,"list");const i=Xt();t.before(i),this.mark=i,this.list=[{ele:t,idx:e}],this.check()}get next(){return this.list.at(-1).ele.nextElementSibling}push(t,e){this.list.push({ele:t,idx:e}),this.check()}check(){const t=this.next;t!=null&&t.attributes.getNamedItem(Lr)&&(this.list.push({ele:t}),t.removeAttribute(Lr))}update(t){const{mark:e,list:i}=this,s=i.find(({idx:o})=>o===void 0||!!t[o]);s&&!s.ele.parentNode&&e.after(s.ele),i.forEach(({ele:o})=>(!s||o!==s.ele)&&o.remove())}}class Ve{constructor(t,e,i,s){$(this,"type",Ln);$(this,"options");$(this,"_$committedValue");$(this,"__directive");$(this,"_$startNode");$(this,"_$endNode");$(this,"_$parent");$(this,"__isConnected");$(this,"_$disconnectableChildren");this._$startNode=t,this._$endNode=e,this._$parent=i,this.options=s,this.__isConnected=(s==null?void 0:s.isConnected)??!0}get _$isConnected(){var t;return((t=this._$parent)==null?void 0:t._$isConnected)??this.__isConnected}get parentNode(){let t=this._$startNode.parentNode;const e=this._$parent;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$startNode}get endNode(){return this._$endNode}_$setValue(t,e=this){this.parentNode&&(t=ee(this,t,e),Ge(t)?te(t)||t===""?(te(this._$committedValue)||this._$clear(),this._$committedValue=void 0):t!==this._$committedValue&&t!==Ci&&this._commitText(t):t instanceof wi?this._commitTemplateResult(t):t.nodeType!==void 0?this._commitNode(t):Gc(t)?this._commitIterable(t):this._commitText(t))}_insert(t){return this._$startNode.parentNode.insertBefore(t,this._$endNode)}_commitNode(t){this._$committedValue!==t&&(this._$clear(),this._$committedValue=this._insert(t))}_commitText(t){if(!te(this._$committedValue)&&Ge(this._$committedValue)){const e=this._$startNode.nextSibling;e.data=t}else this._commitNode(It.createTextNode(t));this._$committedValue=t}_commitTemplateResult(t){var s;const{values:e}=t,i=this._$getTemplate(t);if(((s=this._$committedValue)==null?void 0:s._$template)===i)this._$committedValue._update(e);else{const o=new th(i,this),a=o._clone(this.options);o._update(e),this._commitNode(a),this._$committedValue=o}}_$getTemplate(t){let e=Ar.get(t.strings);return e===void 0&&Ar.set(t.strings,e=new bi(t)),e}_commitIterable(t){Array.isArray(this._$committedValue)||(this._$committedValue=[],this._$clear());const e=this._$committedValue;let i=0,s;for(const o of t)i===e.length?e.push(s=new Ve(this._insert(Xt()),this._insert(Xt()),this,this.options)):s=e[i],s._$setValue(o),i++;i<e.length&&(this._$clear(s&&s._$endNode.nextSibling,i),e.length=i)}_$clear(t=this._$startNode.nextSibling,e){var i;for((i=this._$notifyConnectionChanged)==null||i.call(this,!1,!0,e);t&&t!==this._$endNode;){const s=t.nextSibling;t.remove(),t=s}}setConnected(t){var e;this._$parent===void 0&&(this.__isConnected=t,(e=this._$notifyConnectionChanged)==null||e.call(this,t))}}class An{constructor(t,e,i,s,o){$(this,"type",Si);$(this,"element");$(this,"name");$(this,"options");$(this,"strings");$(this,"_$committedValue");$(this,"__directives");$(this,"_$parent");$(this,"_$disconnectableChildren");this.element=t,this.name=e,this._$parent=s,this.options=o,i.length>2||i[0]!==""||i[1]!==""?(this._$committedValue=new Array(i.length-1).fill(new String),this.strings=i):this._$committedValue=void 0}get tagName(){return this.element.tagName}get _$isConnected(){return this._$parent._$isConnected}_$setValue(t,e=this,i,s){const o=this.strings;let a=!1;if(o===void 0)t=ee(this,t,e,0),a=!Ge(t)||t!==this._$committedValue,a&&(this._$committedValue=t);else{const c=t;t=o[0];let d,u;for(d=0;d<o.length-1;d++)u=ee(this,c[i+d],e,d),a||(a=!Ge(u)||u!==this._$committedValue[d]),te(u)?t=void 0:te(t)||(t+=u+o[d+1]),this._$committedValue[d]=u}a&&!s&&this._commitValue(t)}_commitValue(t){te(t)?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t)}}class nh extends An{constructor(){super(...arguments);$(this,"type",xc)}_commitValue(e){this.element[this.name]=e}}class ih extends An{constructor(){super(...arguments);$(this,"type",Bc)}_commitValue(e){this.element.toggleAttribute(this.name,!!e)}}class sh extends An{constructor(){super(...arguments);$(this,"type",Kc)}_$setValue(e,i=this){e=ee(this,e,i,0);const s=this._$committedValue,o=s&&(!e||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive),a=e&&(!s||o);o&&this.element.removeEventListener(this.name,this,s),a&&this.element.addEventListener(this.name,this,e),this._$committedValue=e}handleEvent(e){var i;typeof this._$committedValue=="function"?this._$committedValue.call(((i=this.options)==null?void 0:i.host)??this.element,e):this._$committedValue.handleEvent(e)}}class rh{constructor(t,e,i){$(this,"type",yi);$(this,"__directive");$(this,"_$committedValue");$(this,"_$parent");$(this,"_$disconnectableChildren");$(this,"_$props");$(this,"options");this.element=t,this._$parent=e,this.options=i}get _$isConnected(){return this._$parent._$isConnected}_$setValue(t){if(t)if(t instanceof Nr)t.value=this.element;else if(t._$litDirective$)ee(this,t);else{if(this._$props)for(const e in this._$props)Reflect.set(this.element,e,void 0);Object.assign(this.element,t),this._$props=t}}}const oh=()=>new Nr;class Nr{constructor(){$(this,"value")}}const ah=(n,t,e)=>{const i=(e==null?void 0:e.renderBefore)??t;let s=i._$litPart$;if(s===void 0){const o=(e==null?void 0:e.renderBefore)??null;i._$litPart$=s=new Ve(t.insertBefore(Xt(),o),o,void 0,e??{})}return s._$setValue(n),s},Rr="0.0.0",ch=Object.freeze(Object.defineProperty({__proto__:null,version:Rr},Symbol.toStringTag,{value:"Module"}));/**
|
|
8
8
|
* @license
|
|
9
9
|
* Copyright 2017 Google LLC
|
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
-
*/const el={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Lr=n=>(...t)=>({_$litDirective$:n,values:t});class nl{constructor(){$(this,"__part");$(this,"__attributeIndex");$(this,"__directive");$(this,"_$parent");$(this,"_$disconnectableChildren")}get _$isConnected(){return this._$parent._$isConnected}_$initialize(t,e,i){this.__part=t,this._$parent=e,this.__attributeIndex=i}_$resolve(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}const Ar=()=>document.createComment(""),Ue=(n,t,e)=>{var o;const i=n._$startNode.parentNode,s=t===void 0?n._$endNode:t._$startNode;if(e===void 0){const a=i.insertBefore(Ar(),s),c=i.insertBefore(Ar(),s);e=new De(a,c,n,n.options)}else{const a=e._$endNode.nextSibling,c=e._$parent,u=c!==n;if(u){(o=e._$reparentDisconnectables)==null||o.call(e,n),e._$parent=n;let d;e._$notifyConnectionChanged!==void 0&&(d=n._$isConnected)!==c._$isConnected&&e._$notifyConnectionChanged(d)}if(a!==s||u){let d=e._$startNode;for(;d!==a;){const m=d.nextSibling;i.insertBefore(d,s),d=m}}}return e},Wt=(n,t,e=n)=>(n._$setValue(t,e),n),il={},sl=(n,t=il)=>n._$committedValue=t,rl=n=>n._$committedValue,Pi=n=>{var i;(i=n._$notifyConnectionChanged)==null||i.call(n,!1,!0);let t=n._$startNode;const e=n._$endNode.nextSibling;for(;t!==e;){const s=t.nextSibling;t.remove(),t=s}},Nr=(n,t,e)=>{const i=new Map;for(let s=t;s<=e;s++)i.set(n[s],s);return i};class ol extends nl{constructor(e){super();$(this,"_itemKeys");if(e.type!==el.CHILD)throw new Error("repeat() can only be used in text expressions")}_getValuesAndKeys(e,i,s){let o;s===void 0?s=i:i!==void 0&&(o=i);const a=[],c=[];let u=0;for(const d of e)a[u]=o?o(d,u):u,c[u]=s(d,u),u++;return{values:c,keys:a}}render(e,i,s){return this._getValuesAndKeys(e,i,s).values}update(e,[i,s,o]){const a=rl(e),{values:c,keys:u}=this._getValuesAndKeys(i,s,o);if(!Array.isArray(a))return this._itemKeys=u,c;const d=this._itemKeys??(this._itemKeys=[]),m=[];let r,g,l=0,v=a.length-1,S=0,E=c.length-1;for(;l<=v&&S<=E;)if(a[l]===null)l++;else if(a[v]===null)v--;else if(d[l]===u[S])m[S]=Wt(a[l],c[S]),l++,S++;else if(d[v]===u[E])m[E]=Wt(a[v],c[E]),v--,E--;else if(d[l]===u[E])m[E]=Wt(a[l],c[E]),Ue(e,m[E+1],a[l]),l++,E--;else if(d[v]===u[S])m[S]=Wt(a[v],c[S]),Ue(e,a[l],a[v]),v--,S++;else if(r===void 0&&(r=Nr(u,S,E),g=Nr(d,l,v)),!r.has(d[l]))Pi(a[l]),l++;else if(!r.has(d[v]))Pi(a[v]),v--;else{const k=g.get(u[S]),p=k!==void 0?a[k]:null;if(p===null){const T=Ue(e,a[l]);Wt(T,c[S]),m[S]=T}else m[S]=Wt(p,c[S]),Ue(e,a[l],p),a[k]=null;S++}for(;S<=E;){const k=Ue(e,m[E+1]);Wt(k,c[S]),m[S++]=k}for(;l<=v;){const k=a[l++];k!==null&&Pi(k)}return this._itemKeys=u,sl(e,m),bi}}const al=Lr(ol);ai(Dc,Xc),globalThis.__GEM_DEVTOOLS__HOOK__&&!globalThis.__GEM_DEVTOOLS__HOOK__.GemElement&&Object.assign(globalThis.__GEM_DEVTOOLS__HOOK__,{...wc,...kc,...mc,...tl});const X=globalThis.history,Rr=X.pushState.bind(X),Ir=X.replaceState.bind(X);let cl=0;const ki=()=>`${performance.now()}-${++cl}`,A=St({$hasCloseHandle:!1,$hasOpenHandle:!1,$hasShouldCloseHandle:!1,$key:""}),K=new Map;function Hr(n){const{$key:t,$hasCloseHandle:e,$hasOpenHandle:i,$hasShouldCloseHandle:s}=n||{};if(A.$key!==t){if(t)throw new ft("`$key` is not allowed");if(e)throw new ft("`$hasCloseHandle` is not allowed");if(i)throw new ft("`$hasOpenHandle` is not allowed");if(s)throw new ft("`$hasShouldCloseHandle` is not allowed")}}function Wr(n){return tt.basePath?tt.basePath+n:n}function Mi(n){return n===tt.basePath?"/":n.replace(new RegExp(`^${tt.basePath}/`),"/")}function Oi(){tt.dispatchEvent(new CustomEvent("beforechange"))}function Rn(n){const t=K.get(A.$key)||{path:Mi(location.pathname),query:new jt},e=n.path?ri(t.path,n.path):Mi(location.pathname),i=new jt(n.query??(n.path?"":location.search)),s=String(i)!==String(t.query),o=s?i:t.query,a=e!==t.path||s,c=n.title||(a?"":document.title),u=n.close||n.data||n.open||n.shouldClose,d=decodeURIComponent(n.hash??(!a&&u?location.hash:""));return{...n,title:c,path:e,query:o,hash:d}}function Gr(n,t){Hr(n.data);const e=Rn(n),{title:i,path:s,query:o,hash:a,close:c,open:u,shouldClose:d,data:m}=e,r={$hasCloseHandle:!!c,$hasOpenHandle:!!u,$hasShouldCloseHandle:!!d,$key:ki(),$title:i,...m};K.set(r.$key,e),Oi(),wn(A),A(r);const g=Wr(s)+new jt(o)+a,l=decodeURIComponent(location.hash);t(r,i,g),l!==a&&dispatchEvent(new CustomEvent("hashchange"))}function zr(n,t,e,i){Hr(n);const s={$key:ki(),$title:t,...n||{}},{pathname:o,search:a,hash:c}=new URL(e,location.origin+location.pathname),u=Rn({path:o,query:new jt(a),hash:c,title:t,data:n});K.set(s.$key,u),Oi(),wn(A),A(s);const d=Wr(o)+u.query+c,m=location.hash;i(s,t,d),m!==c&&dispatchEvent(new CustomEvent("hashchange"))}const Li=St({basePath:""});class ll extends EventTarget{get store(){return A}get currentKey(){return A.$key}get basePath(){return Li.basePath}set basePath(t){Li({basePath:t}),Object.assign(K.get(A.$key),{path:Mi(location.pathname)})}getParams(){return K.get(A.$key)}updateParams(t){Object.assign(K.get(A.$key),t),A()}push(t){Gr(t,Rr)}replace(t){Gr(t,Ir)}pushIgnoreCloseHandle(t){var e,i;A.$hasCloseHandle?((i=(e=K.get(A.$key))==null?void 0:e.close)==null||i.call(e),this.replace(t)):this.push(t)}forward(){X.forward()}back(){X.back()}}const tt=new ll,Fe=St({defaultTitle:document.title,url:"",title:""}),hl={history:tt,titleStore:Fe,basePathStore:Li};if(!globalThis._GEMHISTORY){if(globalThis._GEMHISTORY=hl,X.pushState=(t,e,i)=>{zr(t,e,i,Rr)},X.replaceState=(t,e,i)=>{zr(t,e,i,Ir)},addEventListener("hashchange",({isTrusted:t})=>{t&&tt.replace({hash:location.hash})}),X.state)if(X.state.$hasCloseHandle){A(X.state);const t=Rn({title:document.title});K.set(A.$key,t),tt.back()}else{const t=Rn({title:document.title,hash:location.hash});A({$key:ki(),...X.state||{}}),K.set(A.$key,t)}else{const{protocol:t,pathname:e,search:i,hash:s}=location;t.startsWith("http")&&tt.replace({path:e,query:i,hash:s})}ht(Fe,()=>{const t=K.get(A.$key);t&&(t.title=Fe.title)}),ht(A,()=>{const{title:t}=tt.getParams();t!==Fe.title&&Fe({title:t})});let n=!1;addEventListener("popstate",t=>{var o,a;const e=t.state;if(!(e!=null&&e.$key))return;if(n){n=!1;return}if(!K.has(e.$key)){const{pathname:c,search:u,hash:d}=location;K.set(e.$key,{path:c,query:new jt(u),hash:decodeURIComponent(d),title:e.$title,data:e})}const i=A;if(parseFloat(e.$key)>parseFloat(i.$key)&&e.$hasOpenHandle)(a=(o=K.get(e.$key))==null?void 0:o.open)==null||a.call(o);else if(i.$hasCloseHandle){const c=K.get(i.$key),u=c==null?void 0:c.close,d=c==null?void 0:c.shouldClose;if(d&&!d()){n=!0,tt.forward();return}else u?u():e.$hasCloseHandle&&(n=!0,tt.back())}Oi(),wn(A),A(e)})}const{history:N,titleStore:bt,basePathStore:Vr}=globalThis._GEMHISTORY;var dl=Object.create,Ai=Object.defineProperty,ul=Object.getOwnPropertyDescriptor,Dr=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n),ne=n=>{throw TypeError(n)},Ur=(n,t,e)=>t in n?Ai(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Fr=(n,t)=>Ai(n,"name",{value:t,configurable:!0}),_l=n=>[,,,dl((n==null?void 0:n[Dr("metadata")])??null)],qr=["class","method","getter","setter","accessor","field","value","get","set"],qe=n=>n!==void 0&&typeof n!="function"?ne("Function expected"):n,fl=(n,t,e,i,s)=>({kind:qr[n],name:t,metadata:i,addInitializer:o=>e._?ne("Already initialized"):s.push(qe(o||null))}),pl=(n,t)=>Ur(t,Dr("metadata"),n[3]),Gt=(n,t,e,i)=>{for(var s=0,o=n[t>>1],a=o&&o.length;s<a;s++)t&1?o[s].call(e):i=o[s].call(e,i);return i},In=(n,t,e,i,s,o)=>{var a,c,u,d,m,r=t&7,g=!!(t&8),l=!!(t&16),v=r>3?n.length+1:r?g?1:2:0,S=qr[r+5],E=r>3&&(n[v-1]=[]),k=n[v]||(n[v]=[]),p=r&&(!l&&!g&&(s=s.prototype),r<5&&(r>3||!l)&&ul(r<4?s:{get[e](){return rt(this,o)},set[e](_){return Be(this,o,_)}},e));r?l&&r<4&&Fr(o,(r>2?"set ":r>1?"get ":"")+e):Fr(s,e);for(var T=i.length-1;T>=0;T--)d=fl(r,e,u={},n[3],k),r&&(d.static=g,d.private=l,m=d.access={has:l?_=>ml(s,_):_=>e in _},r^3&&(m.get=l?_=>(r^1?rt:gl)(_,s,r^4?o:p.get):_=>_[e]),r>2&&(m.set=l?(_,M)=>Be(_,s,M,r^4?o:p.set):(_,M)=>_[e]=M)),c=(0,i[T])(r?r<4?l?o:p[S]:r>4?void 0:{get:p.get,set:p.set}:s,d),u._=1,r^4||c===void 0?qe(c)&&(r>4?E.unshift(c):r?l?o=c:p[S]=c:s=c):typeof c!="object"||c===null?ne("Object expected"):(qe(a=c.get)&&(p.get=a),qe(a=c.set)&&(p.set=a),qe(a=c.init)&&E.unshift(a));return r||pl(n,s),p&&Ai(s,e,p),l?r^4?o:p:s},xe=(n,t,e)=>Ur(n,typeof t!="symbol"?t+"":t,e),Ni=(n,t,e)=>t.has(n)||ne("Cannot "+e),ml=(n,t)=>Object(t)!==t?ne('Cannot use the "in" operator on this value'):n.has(t),rt=(n,t,e)=>(Ni(n,t,"read from private field"),e?e.call(n):t.get(n)),ie=(n,t,e)=>t.has(n)?ne("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,e),Be=(n,t,e,i)=>(Ni(n,t,"write to private field"),i?i.call(n,e):t.set(n,e),e),gl=(n,t,e)=>(Ni(n,t,"access private method"),e),xr,Br,Kr,Ri,jr,et,Ke,je,Qe,Ii,Hn,Hi;const Wi=Symbol();jr=[He(N.store),We({role:"dialog",ariaModal:"true"})];class se extends(Ri=J,Kr=[F],Br=[Re],xr=[Mn()],Ri){constructor(){super(...arguments),xe(this,"label",Gt(et,8,this)),Gt(et,11,this),xe(this,"opened",Gt(et,12,this)),Gt(et,15,this),ie(this,Ke),ie(this,je),ie(this,Qe,[]),ie(this,Ii,()=>{var t;this.inert=!0,rt(this,Qe).forEach(e=>e.inert=!1),rt(this,Ke)?rt(this,Ke).before(this):rt(this,je)&&((t=rt(this,je))==null||t.appendChild(this)),this.dispatchEvent(new CustomEvent("close")),this.opened=!1}),ie(this,Hn,()=>{this.hidden=!1,this.inert=!1,Be(this,Ke,this.nextSibling),Be(this,je,this.parentElement||this.getRootNode()),Be(this,Qe,[...document.body.children].filter(t=>!t.inert)),rt(this,Qe).forEach(t=>t.inert=!0),document.body.append(this),this.dispatchEvent(new CustomEvent("open")),this.opened=!0}),ie(this,Hi,Gt(et,16,this,()=>this.inert=!0)),Gt(et,19,this),xe(this,"open",()=>{if(!this.opened)return rt(this,Hn).call(this),N.push({title:this.label,open:rt(this,Hn),close:rt(this,Ii),shouldClose:this.shouldClose}),Wi}),xe(this,"close",()=>(N.back(),Wi)),xe(this,"forceClose",()=>(this.opened=!1,setTimeout(this.close,100),Wi))}shouldClose(){return!0}}et=_l(Ri),Ke=new WeakMap,je=new WeakMap,Qe=new WeakMap,Ii=new WeakMap,Hn=new WeakMap,Hi=new WeakMap,In(et,5,"label",Kr,se),In(et,5,"opened",Br,se),In(et,21,"#init",xr,Hi),se=In(et,0,"GemDialogBaseElement",jr,se),Gt(et,1,se);var vl=Object.create,Gi=Object.defineProperty,$l=Object.getOwnPropertyDescriptor,Qr=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n),re=n=>{throw TypeError(n)},Jr=(n,t,e)=>t in n?Gi(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Yr=(n,t)=>Gi(n,"name",{value:t,configurable:!0}),Sl=n=>[,,,vl((n==null?void 0:n[Qr("metadata")])??null)],Zr=["class","method","getter","setter","accessor","field","value","get","set"],Je=n=>n!==void 0&&typeof n!="function"?re("Function expected"):n,yl=(n,t,e,i,s)=>({kind:Zr[n],name:t,metadata:i,addInitializer:o=>e._?re("Already initialized"):s.push(Je(o||null))}),wl=(n,t)=>Jr(t,Qr("metadata"),n[3]),Ye=(n,t,e,i)=>{for(var s=0,o=n[t>>1],a=o&&o.length;s<a;s++)t&1?o[s].call(e):i=o[s].call(e,i);return i},zi=(n,t,e,i,s,o)=>{var a,c,u,d,m,r=t&7,g=!!(t&8),l=!!(t&16),v=r>3?n.length+1:r?g?1:2:0,S=Zr[r+5],E=r>3&&(n[v-1]=[]),k=n[v]||(n[v]=[]),p=r&&(!l&&!g&&(s=s.prototype),r<5&&(r>3||!l)&&$l(r<4?s:{get[e](){return Xr(this,o)},set[e](_){return eo(this,o,_)}},e));r?l&&r<4&&Yr(o,(r>2?"set ":r>1?"get ":"")+e):Yr(s,e);for(var T=i.length-1;T>=0;T--)d=yl(r,e,u={},n[3],k),r&&(d.static=g,d.private=l,m=d.access={has:l?_=>El(s,_):_=>e in _},r^3&&(m.get=l?_=>(r^1?Xr:Cl)(_,s,r^4?o:p.get):_=>_[e]),r>2&&(m.set=l?(_,M)=>eo(_,s,M,r^4?o:p.set):(_,M)=>_[e]=M)),c=(0,i[T])(r?r<4?l?o:p[S]:r>4?void 0:{get:p.get,set:p.set}:s,d),u._=1,r^4||c===void 0?Je(c)&&(r>4?E.unshift(c):r?l?o=c:p[S]=c:s=c):typeof c!="object"||c===null?re("Object expected"):(Je(a=c.get)&&(p.get=a),Je(a=c.set)&&(p.set=a),Je(a=c.init)&&E.unshift(a));return r||wl(n,s),p&&Gi(s,e,p),l?r^4?o:p:s},Wn=(n,t,e)=>Jr(n,typeof t!="symbol"?t+"":t,e),Vi=(n,t,e)=>t.has(n)||re("Cannot "+e),El=(n,t)=>Object(t)!==t?re('Cannot use the "in" operator on this value'):n.has(t),Xr=(n,t,e)=>(Vi(n,t,"read from private field"),e?e.call(n):t.get(n)),to=(n,t,e)=>t.has(n)?re("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,e),eo=(n,t,e,i)=>(Vi(n,t,"write to private field"),i?i.call(n,e):t.set(n,e),e),Cl=(n,t,e)=>(Vi(n,t,"access private method"),e);const Gn=Symbol("open mark");function bl(n){var t,e,i,s,o,a,c;const u=Symbol();s=[Et(),We({role:"alertdialog",ariaModal:"true"})];let d=class B extends(i=J,e=[Yt()],t=[Yt()],i){constructor(){super(...arguments),Wn(this,"label",""),to(this,a,Ye(o,8,this,()=>ht(N.store,this.update))),Ye(o,11,this),to(this,c,Ye(o,12,this,()=>ht(B.store,this.update))),Ye(o,15,this)}static get isOpen(){return B.store[Gn]}static open(g){const l=new B;B.instance=l,B.inertStore=[...document.body.children].filter(S=>!S.inert),B.inertStore.forEach(S=>S.inert=!0),document.body.append(l);const v=()=>B.store({[Gn]:!0,...g});return setTimeout(()=>{v(),N.push({title:l.label,open:v,close:B.closeHandle.bind(B),shouldClose:B.shouldClose.bind(B)})},100),u}static close(){return N.back(),u}static closeHandle(){var g;return B.inertStore.forEach(l=>l.inert=!1),(g=B.instance)==null||g.remove(),B.store({[Gn]:!1,...n}),u}static shouldClose(){return!0}};return o=Sl(i),a=new WeakMap,c=new WeakMap,zi(o,21,"#connectHistory",e,a),zi(o,21,"#connectStore",t,c),d=zi(o,0,"ModalElement",s,d),Wn(d,"inertStore",[]),Wn(d,"instance",null),Wn(d,"store",St({[Gn]:!1,...n})),Ye(o,1,d),d}var Tl=Object.create,Di=Object.defineProperty,Pl=Object.getOwnPropertyDescriptor,no=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n),oe=n=>{throw TypeError(n)},io=(n,t,e)=>t in n?Di(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,so=(n,t)=>Di(n,"name",{value:t,configurable:!0}),ro=n=>[,,,Tl((n==null?void 0:n[no("metadata")])??null)],oo=["class","method","getter","setter","accessor","field","value","get","set"],Ze=n=>n!==void 0&&typeof n!="function"?oe("Function expected"):n,kl=(n,t,e,i,s)=>({kind:oo[n],name:t,metadata:i,addInitializer:o=>e._?oe("Already initialized"):s.push(Ze(o||null))}),Ml=(n,t)=>io(t,no("metadata"),n[3]),P=(n,t,e,i)=>{for(var s=0,o=n[t>>1],a=o&&o.length;s<a;s++)t&1?o[s].call(e):i=o[s].call(e,i);return i},D=(n,t,e,i,s,o)=>{var a,c,u,d,m,r=t&7,g=!!(t&8),l=!!(t&16),v=r>3?n.length+1:r?g?1:2:0,S=oo[r+5],E=r>3&&(n[v-1]=[]),k=n[v]||(n[v]=[]),p=r&&(!l&&!g&&(s=s.prototype),r<5&&(r>3||!l)&&Pl(r<4?s:{get[e](){return U(this,o)},set[e](_){return zn(this,o,_)}},e));r?l&&r<4&&so(o,(r>2?"set ":r>1?"get ":"")+e):so(s,e);for(var T=i.length-1;T>=0;T--)d=kl(r,e,u={},n[3],k),r&&(d.static=g,d.private=l,m=d.access={has:l?_=>Ol(s,_):_=>e in _},r^3&&(m.get=l?_=>(r^1?U:Ll)(_,s,r^4?o:p.get):_=>_[e]),r>2&&(m.set=l?(_,M)=>zn(_,s,M,r^4?o:p.set):(_,M)=>_[e]=M)),c=(0,i[T])(r?r<4?l?o:p[S]:r>4?void 0:{get:p.get,set:p.set}:s,d),u._=1,r^4||c===void 0?Ze(c)&&(r>4?E.unshift(c):r?l?o=c:p[S]=c:s=c):typeof c!="object"||c===null?oe("Object expected"):(Ze(a=c.get)&&(p.get=a),Ze(a=c.set)&&(p.set=a),Ze(a=c.init)&&E.unshift(a));return r||Ml(n,s),p&&Di(s,e,p),l?r^4?o:p:s},q=(n,t,e)=>io(n,typeof t!="symbol"?t+"":t,e),Ui=(n,t,e)=>t.has(n)||oe("Cannot "+e),Ol=(n,t)=>Object(t)!==t?oe('Cannot use the "in" operator on this value'):n.has(t),U=(n,t,e)=>(Ui(n,t,"read from private field"),e?e.call(n):t.get(n)),ot=(n,t,e)=>t.has(n)?oe("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,e),zn=(n,t,e,i)=>(Ui(n,t,"write to private field"),i?i.call(n,e):t.set(n,e),e),Ll=(n,t,e)=>(Ui(n,t,"access private method"),e),ao,co,lo,ho,uo,_o,fo,po,mo,go,vo,$o,So,yo,wo,Fi,Eo,y,zt,ae,Xe,Vn,qi,tn,Dn,xi,Bi,Ki,ji,Qi,Co,Ji,bo;const To="_";class Al extends RegExp{constructor(t){let e=0;super(`^${t.replace(/((:[^/$]+)|(\*))/g,(i,s)=>s==="*"?`(?<${To}${e++}>.*)`:`(?<${s.slice(1)}>[^/]+)`)}$`)}}function Yi(n,t){if(globalThis.URLPattern){const o=new URLPattern({pathname:n}),a=o.exec({pathname:t})||o.exec({pathname:`${t}/`});return a?a.pathname.groups:null}const e=new Al(n),i=t.match(e)||`${t}/`.match(e);if(!i)return null;const s={};return i.groups&&Object.entries(i.groups).forEach(([o,a])=>{s[o.startsWith(To)?o.slice(1):o]=a}),s}function Un(n,t){let e=0,i=n.pattern.replaceAll("*",()=>`:${e++}`);const s=t==null?void 0:t.params;return s&&Object.keys(s).forEach(o=>{i=i.replace(new RegExp(`:${o}`,"g"),s[o])}),i}function Po(n,t){return{path:Un(n,t),...t}}const Zi=h.html``,ko=new Map;Eo=[vi({penetrable:!0})];class H extends(Fi=J,wo=[Ne],yo=[x],So=[x],$o=[x],vo=[Zt],go=[Zt],mo=[Zt],po=[Zt],fo=[x],_o=[x],uo=[x],ho=[pt(t=>[t.scrollContainer])],lo=[pt(t=>[t.scrollContainer])],co=[pt(t=>{var e;return U(e=t,Ki).call(e)})],ao=[Nt(t=>!t.inert)],Fi){constructor(){super(...arguments),ot(this,zt),q(this,"transition",P(y,8,this)),P(y,11,this),q(this,"routes",P(y,12,this)),P(y,15,this),q(this,"locationStore",P(y,16,this)),P(y,19,this),q(this,"key",P(y,20,this)),P(y,23,this),q(this,"loading",P(y,24,this)),P(y,27,this),q(this,"beforeroutechange",P(y,28,this)),P(y,31,this),q(this,"routechange",P(y,32,this)),P(y,35,this),q(this,"error",P(y,36,this)),P(y,39,this),q(this,"scrollContainer",P(y,40,this)),P(y,43,this),q(this,"scrollIgnoreHash",P(y,44,this)),P(y,47,this),q(this,"trigger",P(y,48,this,N)),P(y,51,this),q(this,"currentRoute"),q(this,"currentParams",{}),ot(this,Xe,h.createState({content:Zi})),ot(this,Vn,()=>{if(!this.locationStore)return;const{path:t,query:e,hash:i,data:s}=N.getParams();this.locationStore({path:t,params:this.currentParams,query:e,hash:i,data:s})}),ot(this,qi,()=>{if(!U(this,zt,ae))return;const t=ko.get(N.currentKey);t?U(this,zt,ae).scroll(0,t):(this.scrollIgnoreHash||!N.getParams().hash)&&U(this,zt,ae).scroll(0,0)}),ot(this,tn),ot(this,Dn,(t,e,i)=>{this.beforeroutechange(t),zn(this,tn,void 0),this.currentRoute=t,this.currentParams=e;const s=async()=>{U(this,Xe).call(this,{content:i}),U(this,Vn).call(this),await Promise.resolve(),U(this,qi).call(this),this.routechange(this.currentRoute)};this.transition&&"startViewTransition"in document?document.startViewTransition(()=>s()):s()}),ot(this,xi,P(y,52,this,()=>{if(U(this,zt,ae))return oi(N,"beforechange",()=>ko.set(N.currentKey,U(this,zt,ae).scrollTop))})),P(y,55,this),ot(this,Bi,P(y,56,this,()=>this.trigger.store&&ht(this.trigger.store,()=>U(this,Xe).call(this)))),P(y,59,this),ot(this,Ki,()=>{const{path:t,query:e,hash:i}=this.trigger.getParams();return[this.key,t,e,i]}),ot(this,ji,P(y,60,this,([t,e],i)=>{if(i&&t===i[0]&&e===i[1]){U(this,Vn).call(this);return}this.update()})),P(y,63,this),ot(this,Qi,P(y,64,this,()=>{const{content:t}=U(this,Xe);if(t!==void 0)return this.shadowRoot?t===Zi?h.html`<slot></slot>`:t:t===Zi?void 0:h.html`${t}`})),P(y,67,this),q(this,"update",()=>{const{path:t,hash:e,query:i}=this.trigger.getParams(),{route:s,params:o={}}=ce.findRoute(this.routes,t),{redirect:a,content:c,getContent:u}=s||{};if(a){this.trigger.replace({path:Un({pattern:a},{params:o}),query:i,hash:e});return}this.trigger===N&&(location.href!==bt.url||s!=null&&s.title)&&bt({url:location.href,title:s==null?void 0:s.title});const d=c||(u==null?void 0:u(o,this.shadowRoot||this));if(this.loading(s),d instanceof Promise){zn(this,tn,d);const m=()=>U(this,tn)===d;d.then(r=>{m()&&U(this,Dn).call(this,s,o,r)}).catch(r=>{m()&&this.error(r)});return}U(this,Dn).call(this,s,o,d)})}}y=ro(Fi),zt=new WeakSet,ae=function(){return typeof this.scrollContainer=="function"?this.scrollContainer():this.scrollContainer},Xe=new WeakMap,Vn=new WeakMap,qi=new WeakMap,tn=new WeakMap,Dn=new WeakMap,xi=new WeakMap,Bi=new WeakMap,Ki=new WeakMap,ji=new WeakMap,Qi=new WeakMap,D(y,5,"transition",wo,H),D(y,5,"routes",yo,H),D(y,5,"locationStore",So,H),D(y,5,"key",$o,H),D(y,5,"loading",vo,H),D(y,5,"beforeroutechange",go,H),D(y,5,"routechange",mo,H),D(y,5,"error",po,H),D(y,5,"scrollContainer",fo,H),D(y,5,"scrollIgnoreHash",_o,H),D(y,5,"trigger",uo,H),D(y,21,"#rememberScrollPosition",ho,xi),D(y,21,"#connectTriggerStore",lo,Bi),D(y,21,"#updateContent",co,ji),D(y,21,"#content",ao,Qi),H=D(y,0,"GemLightRouteElement",Eo,H),q(H,"createLocationStore",()=>{const{path:n,query:t,hash:e,data:i}=N.getParams();return St({path:n,query:t,hash:e,data:i,params:{}})}),q(H,"findRoute",(n=[],t)=>{let e=null,i;Array.isArray(n)?i=n:i=Object.values(n);for(const s of i)if(s.pattern==="*")e=s;else{const o=Yi(s.pattern,t);if(o)return{route:s,params:o}}return{route:e}}),P(y,1,H);const Nl=Qt`
|
|
11
|
+
*/const hh={CHILD:2},Ir=n=>(...t)=>({_$litDirective$:n,values:t});class lh{constructor(){$(this,"__part");$(this,"__attributeIndex");$(this,"__directive");$(this,"_$parent");$(this,"_$disconnectableChildren")}get _$isConnected(){return this._$parent._$isConnected}_$initialize(t,e,i){this.__part=t,this._$parent=e,this.__attributeIndex=i}_$resolve(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}const Hr=()=>document.createComment(""),De=(n,t,e)=>{var o;const i=n._$startNode.parentNode,s=t===void 0?n._$endNode:t._$startNode;if(e===void 0){const a=i.insertBefore(Hr(),s),c=i.insertBefore(Hr(),s);e=new Ve(a,c,n,n.options)}else{const a=e._$endNode.nextSibling,c=e._$parent,d=c!==n;if(d){(o=e._$reparentDisconnectables)==null||o.call(e,n),e._$parent=n;let u;e._$notifyConnectionChanged!==void 0&&(u=n._$isConnected)!==c._$isConnected&&e._$notifyConnectionChanged(u)}if(a!==s||d){let u=e._$startNode;for(;u!==a;){const m=u.nextSibling;i.insertBefore(u,s),u=m}}}return e},Gt=(n,t,e=n)=>(n._$setValue(t,e),n),dh={},uh=(n,t=dh)=>n._$committedValue=t,_h=n=>n._$committedValue,Ti=n=>{var i;(i=n._$notifyConnectionChanged)==null||i.call(n,!1,!0);let t=n._$startNode;const e=n._$endNode.nextSibling;for(;t!==e;){const s=t.nextSibling;t.remove(),t=s}},Wr=(n,t,e)=>{const i=new Map;for(let s=t;s<=e;s++)i.set(n[s],s);return i};class fh extends lh{constructor(e){super();$(this,"_itemKeys");if(e.type!==hh.CHILD)throw new Error("repeat() can only be used in text expressions")}_getValuesAndKeys(e,i,s){let o;s===void 0?s=i:i!==void 0&&(o=i);const a=[],c=[];let d=0;for(const u of e)a[d]=o?o(u,d):d,c[d]=s(u,d),d++;return{values:c,keys:a}}render(e,i,s){return this._getValuesAndKeys(e,i,s).values}update(e,[i,s,o]){const a=_h(e),{values:c,keys:d}=this._getValuesAndKeys(i,s,o);if(!Array.isArray(a))return this._itemKeys=d,c;const u=this._itemKeys??(this._itemKeys=[]),m=[];let r,g,h=0,v=a.length-1,S=0,E=c.length-1;for(;h<=v&&S<=E;)if(a[h]===null)h++;else if(a[v]===null)v--;else if(u[h]===d[S])m[S]=Gt(a[h],c[S]),h++,S++;else if(u[v]===d[E])m[E]=Gt(a[v],c[E]),v--,E--;else if(u[h]===d[E])m[E]=Gt(a[h],c[E]),De(e,m[E+1],a[h]),h++,E--;else if(u[v]===d[S])m[S]=Gt(a[v],c[S]),De(e,a[h],a[v]),v--,S++;else if(r===void 0&&(r=Wr(d,S,E),g=Wr(u,h,v)),!r.has(u[h]))Ti(a[h]),h++;else if(!r.has(u[v]))Ti(a[v]),v--;else{const P=g.get(d[S]),p=P!==void 0?a[P]:null;if(p===null){const T=De(e,a[h]);Gt(T,c[S]),m[S]=T}else m[S]=Gt(p,c[S]),De(e,a[h],p),a[P]=null;S++}for(;S<=E;){const P=De(e,m[E+1]);Gt(P,c[S]),m[S++]=P}for(;h<=v;){const P=a[h++];P!==null&&Ti(P)}return this._itemKeys=d,uh(e,m),Ci}}const ph=Ir(fh);oi(Qc,ah),globalThis.__GEM_DEVTOOLS__HOOK__&&!globalThis.__GEM_DEVTOOLS__HOOK__.GemElement&&Object.assign(globalThis.__GEM_DEVTOOLS__HOOK__,{...Oc,...Hc,...Cc,...ch});const X=globalThis.history,Gr=X.pushState.bind(X),zr=X.replaceState.bind(X);let mh=0;const ki=()=>`${performance.now()}-${++mh}`,A=Et({$hasCloseHandle:!1,$hasOpenHandle:!1,$hasShouldCloseHandle:!1,$key:""}),K=new Map;function Vr(n){const{$key:t,$hasCloseHandle:e,$hasOpenHandle:i,$hasShouldCloseHandle:s}=n||{};if(A.$key!==t){if(t)throw new pt("`$key` is not allowed");if(e)throw new pt("`$hasCloseHandle` is not allowed");if(i)throw new pt("`$hasOpenHandle` is not allowed");if(s)throw new pt("`$hasShouldCloseHandle` is not allowed")}}function Dr(n){return tt.basePath?tt.basePath+n:n}function Nn(n){return n===tt.basePath?"/":n.replace(new RegExp(`^${tt.basePath}/`),"/")}function Pi(){tt.dispatchEvent(new CustomEvent("beforechange"))}function Rn(n){const t=K.get(A.$key)||{path:Nn(location.pathname),query:new jt},e=n.path?si(t.path,n.path):Nn(location.pathname),i=new jt(n.query??(n.path?"":location.search)),s=String(i)!==String(t.query),o=s?i:t.query,a=e!==t.path||s,c=n.title||(a?"":document.title),d=n.close||n.data||n.open||n.shouldClose,u=decodeURIComponent(n.hash??(!a&&d?location.hash:""));return{...n,title:c,path:e,query:o,hash:u}}function Ur(n,t){Vr(n.data);const e=Rn(n),{title:i,path:s,query:o,hash:a,close:c,open:d,shouldClose:u,data:m}=e,r={$hasCloseHandle:!!c,$hasOpenHandle:!!d,$hasShouldCloseHandle:!!u,$key:ki(),$title:i,...m};K.set(r.$key,e),Pi(),yn(A),A(r);const g=Dr(s)+new jt(o)+a,h=decodeURIComponent(location.hash);t(r,i,g),h!==a&&dispatchEvent(new CustomEvent("hashchange"))}function qr(n,t,e,i){Vr(n);const s={$key:ki(),$title:t,...n||{}},{pathname:o,search:a,hash:c}=new URL(e,location.origin+location.pathname),d=Rn({path:o,query:new jt(a),hash:c,title:t,data:n});K.set(s.$key,d),Pi(),yn(A),A(s);const u=Dr(o)+d.query+c,m=location.hash;i(s,t,u),m!==c&&dispatchEvent(new CustomEvent("hashchange"))}const Mi=Et({basePath:""});class gh extends EventTarget{get store(){return A}get currentKey(){return A.$key}get basePath(){return Mi.basePath}set basePath(t){Mi({basePath:t}),Object.assign(K.get(A.$key),{path:Nn(location.pathname)})}getParams(){return K.get(A.$key)}updateParams(t){Object.assign(K.get(A.$key),t),A()}push(t){Ur(t,Gr)}replace(t){Ur(t,zr)}pushIgnoreCloseHandle(t){var e,i;A.$hasCloseHandle?((i=(e=K.get(A.$key))==null?void 0:e.close)==null||i.call(e),this.replace(t)):this.push(t)}forward(){X.forward()}back(){X.back()}}const tt=new gh,ne=Et({defaultTitle:document.title,url:"",title:""}),vh={history:tt,titleStore:ne,basePathStore:Mi};if(!globalThis._GEMHISTORY){if(globalThis._GEMHISTORY=vh,X.pushState=(t,e,i)=>{qr(t,e,i,Gr)},X.replaceState=(t,e,i)=>{qr(t,e,i,zr)},addEventListener("hashchange",({isTrusted:t})=>{t&&tt.replace({hash:location.hash})}),X.state)if(X.state.$hasCloseHandle){A(X.state);const t=Rn({title:document.title});K.set(A.$key,t),tt.back()}else{const t=Rn({title:document.title,hash:location.hash});A({$key:ki(),...X.state||{}}),K.set(A.$key,t)}else{const{protocol:t,pathname:e,search:i,hash:s}=location;t.startsWith("http")&&tt.replace({path:e,query:i,hash:s})}ht(ne,()=>{const t=K.get(A.$key);t&&(t.title=ne.title)}),ht(A,()=>{const{title:t}=tt.getParams();t!==ne.title&&ne({title:t})});let n=!1;addEventListener("popstate",t=>{var o,a;const e=t.state;if(!(e!=null&&e.$key))return;if(n){n=!1;return}if(!K.has(e.$key)){const{pathname:c,search:d,hash:u}=location;K.set(e.$key,{path:Nn(c),query:new jt(d),hash:decodeURIComponent(u),title:ne.title||e.$title,data:e})}const i=A;if(parseFloat(e.$key)>parseFloat(i.$key)&&e.$hasOpenHandle)(a=(o=K.get(e.$key))==null?void 0:o.open)==null||a.call(o);else if(i.$hasCloseHandle){const c=K.get(i.$key),d=c==null?void 0:c.close,u=c==null?void 0:c.shouldClose;if(u&&!u()){n=!0,tt.forward();return}else d?d():e.$hasCloseHandle&&(n=!0,tt.back())}Pi(),yn(A),A(e)})}const{history:N,titleStore:kt,basePathStore:Fr}=globalThis._GEMHISTORY;var $h=Object.create,Oi=Object.defineProperty,Sh=Object.getOwnPropertyDescriptor,xr=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n),ie=n=>{throw TypeError(n)},Br=(n,t,e)=>t in n?Oi(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Kr=(n,t)=>Oi(n,"name",{value:t,configurable:!0}),yh=n=>[,,,$h((n==null?void 0:n[xr("metadata")])??null)],jr=["class","method","getter","setter","accessor","field","value","get","set"],Ue=n=>n!==void 0&&typeof n!="function"?ie("Function expected"):n,wh=(n,t,e,i,s)=>({kind:jr[n],name:t,metadata:i,addInitializer:o=>e._?ie("Already initialized"):s.push(Ue(o||null))}),Eh=(n,t)=>Br(t,xr("metadata"),n[3]),zt=(n,t,e,i)=>{for(var s=0,o=n[t>>1],a=o&&o.length;s<a;s++)t&1?o[s].call(e):i=o[s].call(e,i);return i},In=(n,t,e,i,s,o)=>{var a,c,d,u,m,r=t&7,g=!!(t&8),h=!!(t&16),v=r>3?n.length+1:r?g?1:2:0,S=jr[r+5],E=r>3&&(n[v-1]=[]),P=n[v]||(n[v]=[]),p=r&&(!h&&!g&&(s=s.prototype),r<5&&(r>3||!h)&&Sh(r<4?s:{get[e](){return st(this,o)},set[e](_){return Fe(this,o,_)}},e));r?h&&r<4&&Kr(o,(r>2?"set ":r>1?"get ":"")+e):Kr(s,e);for(var T=i.length-1;T>=0;T--)u=wh(r,e,d={},n[3],P),r&&(u.static=g,u.private=h,m=u.access={has:h?_=>Ch(s,_):_=>e in _},r^3&&(m.get=h?_=>(r^1?st:bh)(_,s,r^4?o:p.get):_=>_[e]),r>2&&(m.set=h?(_,M)=>Fe(_,s,M,r^4?o:p.set):(_,M)=>_[e]=M)),c=(0,i[T])(r?r<4?h?o:p[S]:r>4?void 0:{get:p.get,set:p.set}:s,u),d._=1,r^4||c===void 0?Ue(c)&&(r>4?E.unshift(c):r?h?o=c:p[S]=c:s=c):typeof c!="object"||c===null?ie("Object expected"):(Ue(a=c.get)&&(p.get=a),Ue(a=c.set)&&(p.set=a),Ue(a=c.init)&&E.unshift(a));return r||Eh(n,s),p&&Oi(s,e,p),h?r^4?o:p:s},qe=(n,t,e)=>Br(n,typeof t!="symbol"?t+"":t,e),Li=(n,t,e)=>t.has(n)||ie("Cannot "+e),Ch=(n,t)=>Object(t)!==t?ie('Cannot use the "in" operator on this value'):n.has(t),st=(n,t,e)=>(Li(n,t,"read from private field"),e?e.call(n):t.get(n)),se=(n,t,e)=>t.has(n)?ie("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,e),Fe=(n,t,e,i)=>(Li(n,t,"write to private field"),i?i.call(n,e):t.set(n,e),e),bh=(n,t,e)=>(Li(n,t,"access private method"),e),Qr,Jr,Yr,Ai,Zr,et,xe,Be,Ke,Ni,Hn,Ri;const Ii=Symbol();Zr=[Ie(N.store),He({role:"dialog",ariaModal:"true"})];class re extends(Ai=J,Yr=[x],Jr=[Re],Qr=[Pn()],Ai){constructor(){super(...arguments),qe(this,"label",zt(et,8,this)),zt(et,11,this),qe(this,"opened",zt(et,12,this)),zt(et,15,this),se(this,xe),se(this,Be),se(this,Ke,[]),se(this,Ni,()=>{var t;this.inert=!0,st(this,Ke).forEach(e=>e.inert=!1),st(this,xe)?st(this,xe).before(this):st(this,Be)&&((t=st(this,Be))==null||t.appendChild(this)),this.dispatchEvent(new CustomEvent("close")),this.opened=!1}),se(this,Hn,()=>{this.hidden=!1,this.inert=!1,Fe(this,xe,this.nextSibling),Fe(this,Be,this.parentElement||this.getRootNode()),Fe(this,Ke,[...document.body.children].filter(t=>!t.inert)),st(this,Ke).forEach(t=>t.inert=!0),document.body.append(this),this.dispatchEvent(new CustomEvent("open")),this.opened=!0}),se(this,Ri,zt(et,16,this,()=>this.inert=!0)),zt(et,19,this),qe(this,"open",()=>{if(!this.opened)return st(this,Hn).call(this),N.push({title:this.label,open:st(this,Hn),close:st(this,Ni),shouldClose:this.shouldClose}),Ii}),qe(this,"close",()=>(N.back(),Ii)),qe(this,"forceClose",()=>(this.opened=!1,setTimeout(this.close,100),Ii))}shouldClose(){return!0}}et=yh(Ai),xe=new WeakMap,Be=new WeakMap,Ke=new WeakMap,Ni=new WeakMap,Hn=new WeakMap,Ri=new WeakMap,In(et,5,"label",Yr,re),In(et,5,"opened",Jr,re),In(et,21,"#init",Qr,Ri),re=In(et,0,"GemDialogBaseElement",Zr,re),zt(et,1,re);var Th=Object.create,Hi=Object.defineProperty,kh=Object.getOwnPropertyDescriptor,Xr=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n),oe=n=>{throw TypeError(n)},to=(n,t,e)=>t in n?Hi(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,eo=(n,t)=>Hi(n,"name",{value:t,configurable:!0}),Ph=n=>[,,,Th((n==null?void 0:n[Xr("metadata")])??null)],no=["class","method","getter","setter","accessor","field","value","get","set"],je=n=>n!==void 0&&typeof n!="function"?oe("Function expected"):n,Mh=(n,t,e,i,s)=>({kind:no[n],name:t,metadata:i,addInitializer:o=>e._?oe("Already initialized"):s.push(je(o||null))}),Oh=(n,t)=>to(t,Xr("metadata"),n[3]),Qe=(n,t,e,i)=>{for(var s=0,o=n[t>>1],a=o&&o.length;s<a;s++)t&1?o[s].call(e):i=o[s].call(e,i);return i},Wi=(n,t,e,i,s,o)=>{var a,c,d,u,m,r=t&7,g=!!(t&8),h=!!(t&16),v=r>3?n.length+1:r?g?1:2:0,S=no[r+5],E=r>3&&(n[v-1]=[]),P=n[v]||(n[v]=[]),p=r&&(!h&&!g&&(s=s.prototype),r<5&&(r>3||!h)&&kh(r<4?s:{get[e](){return io(this,o)},set[e](_){return ro(this,o,_)}},e));r?h&&r<4&&eo(o,(r>2?"set ":r>1?"get ":"")+e):eo(s,e);for(var T=i.length-1;T>=0;T--)u=Mh(r,e,d={},n[3],P),r&&(u.static=g,u.private=h,m=u.access={has:h?_=>Lh(s,_):_=>e in _},r^3&&(m.get=h?_=>(r^1?io:Ah)(_,s,r^4?o:p.get):_=>_[e]),r>2&&(m.set=h?(_,M)=>ro(_,s,M,r^4?o:p.set):(_,M)=>_[e]=M)),c=(0,i[T])(r?r<4?h?o:p[S]:r>4?void 0:{get:p.get,set:p.set}:s,u),d._=1,r^4||c===void 0?je(c)&&(r>4?E.unshift(c):r?h?o=c:p[S]=c:s=c):typeof c!="object"||c===null?oe("Object expected"):(je(a=c.get)&&(p.get=a),je(a=c.set)&&(p.set=a),je(a=c.init)&&E.unshift(a));return r||Oh(n,s),p&&Hi(s,e,p),h?r^4?o:p:s},Wn=(n,t,e)=>to(n,typeof t!="symbol"?t+"":t,e),Gi=(n,t,e)=>t.has(n)||oe("Cannot "+e),Lh=(n,t)=>Object(t)!==t?oe('Cannot use the "in" operator on this value'):n.has(t),io=(n,t,e)=>(Gi(n,t,"read from private field"),e?e.call(n):t.get(n)),so=(n,t,e)=>t.has(n)?oe("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,e),ro=(n,t,e,i)=>(Gi(n,t,"write to private field"),i?i.call(n,e):t.set(n,e),e),Ah=(n,t,e)=>(Gi(n,t,"access private method"),e);const Gn=Symbol("open mark");function Nh(n){var t,e,i,s,o,a,c;const d=Symbol();s=[bt(),He({role:"alertdialog",ariaModal:"true"})];let u=class uc extends(i=J,e=[Jt()],t=[Jt()],i){constructor(){super(...arguments),Wn(this,"label",""),so(this,a,Qe(o,8,this,()=>ht(N.store,this.update))),Qe(o,11,this),so(this,c,Qe(o,12,this,()=>ht(uc.store,this.update))),Qe(o,15,this)}static get isOpen(){return this.store[Gn]}static open(g){const h=new this;this.instance=h,this.inertStore=[...document.body.children].filter(S=>!S.inert),this.inertStore.forEach(S=>S.inert=!0),document.body.append(h);const v=()=>this.store({[Gn]:!0,...g});return setTimeout(()=>{v(),N.push({title:h.label,open:v,close:this.closeHandle.bind(this),shouldClose:this.shouldClose.bind(this)})},100),d}static close(){return N.back(),d}static closeHandle(){var g;return this.inertStore.forEach(h=>h.inert=!1),(g=this.instance)==null||g.remove(),this.store({[Gn]:!1,...n}),d}static shouldClose(){return!0}};return o=Ph(i),a=new WeakMap,c=new WeakMap,Wi(o,21,"#connectHistory",e,a),Wi(o,21,"#connectStore",t,c),u=Wi(o,0,"ModalElement",s,u),Wn(u,"inertStore",[]),Wn(u,"instance",null),Wn(u,"store",Et({[Gn]:!1,...n})),Qe(o,1,u),u}var Rh=Object.create,zi=Object.defineProperty,Ih=Object.getOwnPropertyDescriptor,oo=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n),ae=n=>{throw TypeError(n)},ao=(n,t,e)=>t in n?zi(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,co=(n,t)=>zi(n,"name",{value:t,configurable:!0}),ho=n=>[,,,Rh((n==null?void 0:n[oo("metadata")])??null)],lo=["class","method","getter","setter","accessor","field","value","get","set"],Je=n=>n!==void 0&&typeof n!="function"?ae("Function expected"):n,Hh=(n,t,e,i,s)=>({kind:lo[n],name:t,metadata:i,addInitializer:o=>e._?ae("Already initialized"):s.push(Je(o||null))}),Wh=(n,t)=>ao(t,oo("metadata"),n[3]),k=(n,t,e,i)=>{for(var s=0,o=n[t>>1],a=o&&o.length;s<a;s++)t&1?o[s].call(e):i=o[s].call(e,i);return i},D=(n,t,e,i,s,o)=>{var a,c,d,u,m,r=t&7,g=!!(t&8),h=!!(t&16),v=r>3?n.length+1:r?g?1:2:0,S=lo[r+5],E=r>3&&(n[v-1]=[]),P=n[v]||(n[v]=[]),p=r&&(!h&&!g&&(s=s.prototype),r<5&&(r>3||!h)&&Ih(r<4?s:{get[e](){return F(this,o)},set[e](_){return zn(this,o,_)}},e));r?h&&r<4&&co(o,(r>2?"set ":r>1?"get ":"")+e):co(s,e);for(var T=i.length-1;T>=0;T--)u=Hh(r,e,d={},n[3],P),r&&(u.static=g,u.private=h,m=u.access={has:h?_=>Gh(s,_):_=>e in _},r^3&&(m.get=h?_=>(r^1?F:zh)(_,s,r^4?o:p.get):_=>_[e]),r>2&&(m.set=h?(_,M)=>zn(_,s,M,r^4?o:p.set):(_,M)=>_[e]=M)),c=(0,i[T])(r?r<4?h?o:p[S]:r>4?void 0:{get:p.get,set:p.set}:s,u),d._=1,r^4||c===void 0?Je(c)&&(r>4?E.unshift(c):r?h?o=c:p[S]=c:s=c):typeof c!="object"||c===null?ae("Object expected"):(Je(a=c.get)&&(p.get=a),Je(a=c.set)&&(p.set=a),Je(a=c.init)&&E.unshift(a));return r||Wh(n,s),p&&zi(s,e,p),h?r^4?o:p:s},q=(n,t,e)=>ao(n,typeof t!="symbol"?t+"":t,e),Vi=(n,t,e)=>t.has(n)||ae("Cannot "+e),Gh=(n,t)=>Object(t)!==t?ae('Cannot use the "in" operator on this value'):n.has(t),F=(n,t,e)=>(Vi(n,t,"read from private field"),e?e.call(n):t.get(n)),rt=(n,t,e)=>t.has(n)?ae("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,e),zn=(n,t,e,i)=>(Vi(n,t,"write to private field"),i?i.call(n,e):t.set(n,e),e),zh=(n,t,e)=>(Vi(n,t,"access private method"),e),uo,_o,fo,po,mo,go,vo,$o,So,yo,wo,Eo,Co,bo,To,Di,ko,y,Vt,ce,Ye,Vn,Ui,Ze,qi,Fi,xi,Bi,Ki,ji,Po,Qi,Mo;const Oo="_";class Vh extends RegExp{constructor(t){let e=0;super(`^${t.replace(/((:[^/$]+)|(\*))/g,(i,s)=>s==="*"?`(?<${Oo}${e++}>.*)`:`(?<${s.slice(1)}>[^/]+)`)}$`)}}function Ji(n,t){if(globalThis.URLPattern){const o=new URLPattern({pathname:n}),a=o.exec({pathname:t})||o.exec({pathname:`${t}/`});return a?a.pathname.groups:null}const e=new Vh(n),i=t.match(e)||`${t}/`.match(e);if(!i)return null;const s={};return i.groups&&Object.entries(i.groups).forEach(([o,a])=>{s[o.startsWith(Oo)?o.slice(1):o]=a}),s}function Dn(n,t){let e=0,i=n.pattern.replaceAll("*",()=>`:${e++}`);const s=t==null?void 0:t.params;return s&&Object.keys(s).forEach(o=>{i=i.replace(new RegExp(`:${o}`,"g"),s[o])}),i}function Lo(n,t){return{path:Dn(n,t),...t}}const Yi=l.html``,Ao=new Map;ko=[gi({penetrable:!0})];class H extends(Di=J,To=[Ne],bo=[U],Co=[U],Eo=[U],wo=[Yt],yo=[Yt],So=[Yt],$o=[Yt],vo=[U],go=[U],mo=[U],po=[lt(t=>[t.scrollContainer])],fo=[lt(t=>[t.scrollContainer])],_o=[lt(t=>{var e;return F(e=t,Bi).call(e)})],uo=[Rt(t=>!t.inert)],Di){constructor(){super(...arguments),rt(this,Vt),q(this,"transition",k(y,8,this)),k(y,11,this),q(this,"routes",k(y,12,this)),k(y,15,this),q(this,"locationStore",k(y,16,this)),k(y,19,this),q(this,"key",k(y,20,this)),k(y,23,this),q(this,"loading",k(y,24,this)),k(y,27,this),q(this,"beforeroutechange",k(y,28,this)),k(y,31,this),q(this,"routechange",k(y,32,this)),k(y,35,this),q(this,"error",k(y,36,this)),k(y,39,this),q(this,"scrollContainer",k(y,40,this)),k(y,43,this),q(this,"scrollIgnoreHash",k(y,44,this)),k(y,47,this),q(this,"trigger",k(y,48,this,N)),k(y,51,this),q(this,"currentRoute"),q(this,"currentParams",{}),rt(this,Ye,l.createState({content:Yi})),rt(this,Vn,()=>{if(!this.locationStore)return;const{path:t,query:e,hash:i,data:s}=N.getParams();this.locationStore({path:t,params:this.currentParams,query:e,hash:i,data:s})}),rt(this,Ui,()=>{if(!F(this,Vt,ce))return;const t=Ao.get(N.currentKey);t?F(this,Vt,ce).scroll(0,t):(this.scrollIgnoreHash||!N.getParams().hash)&&F(this,Vt,ce).scroll(0,0)}),rt(this,Ze),rt(this,qi,(t,e,i)=>{this.beforeroutechange(t),zn(this,Ze,void 0),this.currentRoute=t,this.currentParams=e;const s=async()=>{F(this,Ye).call(this,{content:i}),F(this,Vn).call(this),await Promise.resolve(),F(this,Ui).call(this),this.routechange(this.currentRoute)};this.transition&&"startViewTransition"in document?document.startViewTransition(()=>s()):s()}),rt(this,Fi,k(y,52,this,()=>{if(F(this,Vt,ce))return ri(N,"beforechange",()=>Ao.set(N.currentKey,F(this,Vt,ce).scrollTop))})),k(y,55,this),rt(this,xi,k(y,56,this,()=>this.trigger.store&&ht(this.trigger.store,()=>F(this,Ye).call(this)))),k(y,59,this),rt(this,Bi,()=>{const{path:t,query:e,hash:i}=this.trigger.getParams();return[this.key,t,e,i]}),rt(this,Ki,k(y,60,this,([t,e],i)=>{if(i&&t===i[0]&&e===i[1]){F(this,Vn).call(this);return}this.update()})),k(y,63,this),rt(this,ji,k(y,64,this,()=>{const{content:t}=F(this,Ye);if(t!==void 0)return this.shadowRoot?t===Yi?l.html`<slot></slot>`:t:t===Yi?void 0:l.html`${t}`})),k(y,67,this),q(this,"update",async()=>{const{path:t,hash:e,query:i}=this.trigger.getParams(),{route:s,params:o={}}=he.findRoute(this.routes,t),{redirect:a,content:c,getContent:d}=s||{};if(a){this.trigger.replace({path:Dn({pattern:a},{params:o}),query:i,hash:e});return}this.trigger===N&&(location.href!==kt.url||s!=null&&s.title)&&kt({url:location.href,title:s==null?void 0:s.title});const u=c||(d==null?void 0:d(o,this.shadowRoot||this));this.loading(s),zn(this,Ze,u);const m=()=>F(this,Ze)===u;try{const r=await u;m()&&F(this,qi).call(this,s,o,r)}catch(r){m()&&this.error(r)}})}}y=ho(Di),Vt=new WeakSet,ce=function(){return typeof this.scrollContainer=="function"?this.scrollContainer():this.scrollContainer},Ye=new WeakMap,Vn=new WeakMap,Ui=new WeakMap,Ze=new WeakMap,qi=new WeakMap,Fi=new WeakMap,xi=new WeakMap,Bi=new WeakMap,Ki=new WeakMap,ji=new WeakMap,D(y,5,"transition",To,H),D(y,5,"routes",bo,H),D(y,5,"locationStore",Co,H),D(y,5,"key",Eo,H),D(y,5,"loading",wo,H),D(y,5,"beforeroutechange",yo,H),D(y,5,"routechange",So,H),D(y,5,"error",$o,H),D(y,5,"scrollContainer",vo,H),D(y,5,"scrollIgnoreHash",go,H),D(y,5,"trigger",mo,H),D(y,21,"#rememberScrollPosition",po,Fi),D(y,21,"#connectTriggerStore",fo,xi),D(y,21,"#updateContent",_o,Ki),D(y,21,"#content",uo,ji),H=D(y,0,"GemLightRouteElement",ko,H),q(H,"createLocationStore",()=>{const{path:n,query:t,hash:e,data:i}=N.getParams();return Et({path:n,query:t,hash:e,data:i,params:{}})}),q(H,"findRoute",(n=[],t)=>{let e=null,i;Array.isArray(n)?i=n:i=Object.values(n);for(const s of i)if(s.pattern==="*")e=s;else{const o=Ji(s.pattern,t);if(o)return{route:s,params:o}}return{route:e}}),k(y,1,H);const Dh=Nt`
|
|
12
12
|
:host(:where(:not([hidden]))),
|
|
13
13
|
:not(:defined) {
|
|
14
14
|
display: contents;
|
|
15
15
|
}
|
|
16
|
-
`;
|
|
16
|
+
`;Po=[bt(),Zt(Dh)];class he extends(Mo=H){}Qi=ho(Mo),he=D(Qi,0,"GemRouteElement",Po,he),k(Qi,1,he);var Uh=Object.create,Zi=Object.defineProperty,qh=Object.getOwnPropertyDescriptor,No=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n),le=n=>{throw TypeError(n)},Ro=(n,t,e)=>t in n?Zi(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Io=(n,t)=>Zi(n,"name",{value:t,configurable:!0}),Ho=n=>[,,,Uh((n==null?void 0:n[No("metadata")])??null)],Wo=["class","method","getter","setter","accessor","field","value","get","set"],Xe=n=>n!==void 0&&typeof n!="function"?le("Function expected"):n,Fh=(n,t,e,i,s)=>({kind:Wo[n],name:t,metadata:i,addInitializer:o=>e._?le("Already initialized"):s.push(Xe(o||null))}),xh=(n,t)=>Ro(t,No("metadata"),n[3]),b=(n,t,e,i)=>{for(var s=0,o=n[t>>1],a=o&&o.length;s<a;s++)t&1?o[s].call(e):i=o[s].call(e,i);return i},W=(n,t,e,i,s,o)=>{var a,c,d,u,m,r=t&7,g=!!(t&8),h=!!(t&16),v=r>3?n.length+1:r?g?1:2:0,S=Wo[r+5],E=r>3&&(n[v-1]=[]),P=n[v]||(n[v]=[]),p=r&&(!h&&!g&&(s=s.prototype),r<5&&(r>3||!h)&&qh(r<4?s:{get[e](){return dt(this,o)},set[e](_){return Go(this,o,_)}},e));r?h&&r<4&&Io(o,(r>2?"set ":r>1?"get ":"")+e):Io(s,e);for(var T=i.length-1;T>=0;T--)u=Fh(r,e,d={},n[3],P),r&&(u.static=g,u.private=h,m=u.access={has:h?_=>Bh(s,_):_=>e in _},r^3&&(m.get=h?_=>(r^1?dt:Kh)(_,s,r^4?o:p.get):_=>_[e]),r>2&&(m.set=h?(_,M)=>Go(_,s,M,r^4?o:p.set):(_,M)=>_[e]=M)),c=(0,i[T])(r?r<4?h?o:p[S]:r>4?void 0:{get:p.get,set:p.set}:s,u),d._=1,r^4||c===void 0?Xe(c)&&(r>4?E.unshift(c):r?h?o=c:p[S]=c:s=c):typeof c!="object"||c===null?le("Object expected"):(Xe(a=c.get)&&(p.get=a),Xe(a=c.set)&&(p.set=a),Xe(a=c.init)&&E.unshift(a));return r||xh(n,s),p&&Zi(s,e,p),h?r^4?o:p:s},j=(n,t,e)=>Ro(n,typeof t!="symbol"?t+"":t,e),Xi=(n,t,e)=>t.has(n)||le("Cannot "+e),Bh=(n,t)=>Object(t)!==t?le('Cannot use the "in" operator on this value'):n.has(t),dt=(n,t,e)=>(Xi(n,t,"read from private field"),e?e.call(n):t.get(n)),de=(n,t,e)=>t.has(n)?le("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,e),Go=(n,t,e,i)=>(Xi(n,t,"write to private field"),i?i.call(n,e):t.set(n,e),e),Kh=(n,t,e)=>(Xi(n,t,"access private method"),e),zo,Vo,Do,Uo,qo,Fo,xo,Bo,Ko,jo,Qo,Jo,Yo,Zo,ts,Xo,w,Pt,tn,ta,es,ns,is,ss,rs,ea,na,ia,os,sa,nt,as;function ra(n){return!n.startsWith("/")}const jh=Nt`
|
|
17
17
|
:host {
|
|
18
18
|
/* link default style */
|
|
19
19
|
cursor: pointer;
|
|
@@ -27,14 +27,11 @@
|
|
|
27
27
|
a:visited {
|
|
28
28
|
color: unset;
|
|
29
29
|
}
|
|
30
|
-
`;Qo=[He(Vr),Ie(Vl),Et(),We({focusable:!0})];class z extends(es=J,jo=[F],Ko=[F],Bo=[F],xo=[F],qo=[F],Fo=[F],Uo=[Ne],Do=[x],Vo=[x],zo=[x],Go=[x],Wo=[gi],Ho=[Yt()],Io=[Nt()],es){constructor(){super(...arguments),b(w,5,this),he(this,Tt),j(this,"href",b(w,8,this)),b(w,11,this),j(this,"target",b(w,12,this)),b(w,15,this),j(this,"path",b(w,16,this)),b(w,19,this),j(this,"query",b(w,20,this)),b(w,23,this),j(this,"hash",b(w,24,this)),b(w,27,this),j(this,"hint",b(w,28,this)),b(w,31,this),j(this,"preload",b(w,32,this)),b(w,35,this),j(this,"route",b(w,36,this)),b(w,39,this),j(this,"options",b(w,40,this)),b(w,43,this),j(this,"routeOptions",b(w,44,this)),b(w,47,this),j(this,"prepare",b(w,48,this)),b(w,51,this),j(this,"link",b(w,52,this)),b(w,55,this),he(this,ns,async t=>{var a;t.preventDefault();const e=this._getLocationString();if(!e)return;if(ea(e))switch(this.target){case"_self":window.location.href=e;return;case"_parent":window.parent.location.href=e;return;case"_top":window.top.location.href=e;return;default:window.open(e);return}const{path:i,query:s,hash:o}=N.getParams();if(i+s+o!==e)if(await((a=this.prepare)==null?void 0:a.call(this)),this.route)N.pushIgnoreCloseHandle(Po(this.route,dt(this,Tt,nn)));else if(this.href){const c=new URL(e,location.origin);N.pushIgnoreCloseHandle({path:c.pathname,query:c.search,hash:c.hash})}else N.pushIgnoreCloseHandle({path:this.path,query:this.query,hash:this.hash})}),he(this,is,()=>{const t=this._getLocationString();return ea(t)?t:new URL(N.basePath+t,location.origin).toString()}),he(this,ss,()=>{var t,e,i;(t=this.route)==null||t.content,(i=(e=this.route)==null?void 0:e.getContent)==null||i.call(e,{},this.shadowRoot)}),he(this,os,b(w,56,this,()=>{const t=dt(this,Tt,Jo)==="off"?null:dt(this,is).call(this);return h.html`<a part=${this.link} href=${t} tabindex="-1"><slot></slot></a>`})),b(w,59,this)}_getLocationString(){var t,e;if(this.route){const i=((t=dt(this,Tt,nn))==null?void 0:t.query)||"",s=((e=dt(this,Tt,nn))==null?void 0:e.hash)||"";return Un(this.route,dt(this,Tt,nn))+i+s}else{const i=this.href||this.path+this.query+this.hash,{path:s,query:o}=N.getParams();return i.startsWith("#")?`${s}${o}${i}`:i.startsWith("?")?`${s}${i}`:i.startsWith(".")?ri(s,i):i}}}w=Ao(es),Tt=new WeakSet,nn=function(){return this.routeOptions||this.options},Jo=function(){return this.hint||"on"},ns=new WeakMap,is=new WeakMap,ss=new WeakMap,rs=function(){this.addEventListener("click",dt(this,ns)),this.addEventListener("pointerenter",dt(this,ss))},os=new WeakMap,rs=W(w,17,"#init",Ho,Tt,rs),W(w,5,"href",jo,z),W(w,5,"target",Ko,z),W(w,5,"path",Bo,z),W(w,5,"query",xo,z),W(w,5,"hash",qo,z),W(w,5,"hint",Fo,z),W(w,5,"preload",Uo,z),W(w,5,"route",Do,z),W(w,5,"options",Vo,z),W(w,5,"routeOptions",zo,z),W(w,5,"prepare",Go,z),W(w,5,"link",Wo,z),W(w,21,"#content",Io,os),z=W(w,0,"GemLinkElement",Qo,z),b(w,1,z),ta=[He(N.store)];class Vt extends(as=z,Xo=[F],Zo=[Re],Yo=[pt()],as){constructor(){super(...arguments),j(this,"pattern",b(nt,8,this)),b(nt,11,this),j(this,"active",b(nt,12,this)),b(nt,15,this),he(this,cs,b(nt,16,this,()=>{const{path:t,query:e,hash:i}=N.getParams(),s=this.pattern&&Yi(this.pattern,t);this.active=!!s||t+e+i===this._getLocationString()})),b(nt,19,this)}}nt=Ao(as),cs=new WeakMap,W(nt,5,"pattern",Xo,Vt),W(nt,5,"active",Zo,Vt),W(nt,21,"#updateState",Yo,cs),Vt=W(nt,0,"GemActiveLinkElement",ta,Vt),b(nt,1,Vt),customElements.define("gem-link",z),customElements.define("gem-active-link",Vt);var Dl=Object.create,ls=Object.defineProperty,Ul=Object.getOwnPropertyDescriptor,na=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n),de=n=>{throw TypeError(n)},ia=(n,t,e)=>t in n?ls(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,sa=(n,t)=>ls(n,"name",{value:t,configurable:!0}),Fl=n=>[,,,Dl((n==null?void 0:n[na("metadata")])??null)],ra=["class","method","getter","setter","accessor","field","value","get","set"],sn=n=>n!==void 0&&typeof n!="function"?de("Function expected"):n,ql=(n,t,e,i,s)=>({kind:ra[n],name:t,metadata:i,addInitializer:o=>e._?de("Already initialized"):s.push(sn(o||null))}),oa=(n,t)=>ia(t,na("metadata"),n[3]),Pt=(n,t,e,i)=>{for(var s=0,o=n[t>>1],a=o&&o.length;s<a;s++)t&1?o[s].call(e):i=o[s].call(e,i);return i},Fn=(n,t,e,i,s,o)=>{var a,c,u,d,m,r=t&7,g=!!(t&8),l=!!(t&16),v=r>3?n.length+1:r?g?1:2:0,S=ra[r+5],E=r>3&&(n[v-1]=[]),k=n[v]||(n[v]=[]),p=r&&(!l&&!g&&(s=s.prototype),r<5&&(r>3||!l)&&Ul(r<4?s:{get[e](){return kt(this,o)},set[e](_){return ds(this,o,_)}},e));r?l&&r<4&&sa(o,(r>2?"set ":r>1?"get ":"")+e):sa(s,e);for(var T=i.length-1;T>=0;T--)d=ql(r,e,u={},n[3],k),r&&(d.static=g,d.private=l,m=d.access={has:l?_=>xl(s,_):_=>e in _},r^3&&(m.get=l?_=>(r^1?kt:Bl)(_,s,r^4?o:p.get):_=>_[e]),r>2&&(m.set=l?(_,M)=>ds(_,s,M,r^4?o:p.set):(_,M)=>_[e]=M)),c=(0,i[T])(r?r<4?l?o:p[S]:r>4?void 0:{get:p.get,set:p.set}:s,d),u._=1,r^4||c===void 0?sn(c)&&(r>4?E.unshift(c):r?l?o=c:p[S]=c:s=c):typeof c!="object"||c===null?de("Object expected"):(sn(a=c.get)&&(p.get=a),sn(a=c.set)&&(p.set=a),sn(a=c.init)&&E.unshift(a));return r||oa(n,s),p&&ls(s,e,p),l?r^4?o:p:s},aa=(n,t,e)=>ia(n,typeof t!="symbol"?t+"":t,e),hs=(n,t,e)=>t.has(n)||de("Cannot "+e),xl=(n,t)=>Object(t)!==t?de('Cannot use the "in" operator on this value'):n.has(t),kt=(n,t,e)=>(hs(n,t,"read from private field"),e?e.call(n):t.get(n)),ue=(n,t,e)=>t.has(n)?de("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,e),ds=(n,t,e,i)=>(hs(n,t,"write to private field"),i?i.call(n,e):t.set(n,e),e),Bl=(n,t,e)=>(hs(n,t,"access private method"),e),ca,la,ha,da,us,Q,_s,ua,fs,qn,ps,rn,ms;const Kl="gem-reflect-start",_a="gem-reflect-end",fa=n=>new Comment(n),jl=n=>{const t=[];let e=n;for(;e&&(t.push(e),e.nodeValue!==_a);)e=e.nextSibling;return t};class on extends(us=J,da=[F],ha=[x],la=[Mn()],ca=[pt(t=>[t.target])],us){constructor(){super(...arguments),ue(this,_s),aa(this,"method",Pt(Q,8,this)),Pt(Q,11,this),aa(this,"target",Pt(Q,12,this,document.head)),Pt(Q,15,this),ue(this,fs,Pt(Q,16,this,()=>{this.hidden=!0})),Pt(Q,19,this),ue(this,qn,fa(Kl)),ue(this,ps,fa(_a)),ue(this,rn),ue(this,ms,Pt(Q,20,this,()=>((kt(this,rn)||[kt(this,qn),...this.childNodes,kt(this,ps)]).forEach((t,e,i)=>{const s=i[e-1];s?s.after(t):this.target[kt(this,_s,ua)](t)}),()=>{ds(this,rn,jl(kt(this,qn))),kt(this,rn).forEach(t=>t.remove())}))),Pt(Q,23,this)}}Q=Fl(us),_s=new WeakSet,ua=function(){return this.method||"append"},fs=new WeakMap,qn=new WeakMap,ps=new WeakMap,rn=new WeakMap,ms=new WeakMap,Fn(Q,5,"method",da,on),Fn(Q,5,"target",ha,on),Fn(Q,21,"#init",la,fs),Fn(Q,21,"#changeTarget",ca,ms),oa(Q,on),customElements.define("gem-reflect",on),customElements.define("gem-route",ce),customElements.define("gem-light-route",H);var Ql=Object.create,gs=Object.defineProperty,Jl=Object.getOwnPropertyDescriptor,pa=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n),_e=n=>{throw TypeError(n)},ma=(n,t,e)=>t in n?gs(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,ga=(n,t)=>gs(n,"name",{value:t,configurable:!0}),Yl=n=>[,,,Ql((n==null?void 0:n[pa("metadata")])??null)],va=["class","method","getter","setter","accessor","field","value","get","set"],an=n=>n!==void 0&&typeof n!="function"?_e("Function expected"):n,Zl=(n,t,e,i,s)=>({kind:va[n],name:t,metadata:i,addInitializer:o=>e._?_e("Already initialized"):s.push(an(o||null))}),Xl=(n,t)=>ma(t,pa("metadata"),n[3]),Y=(n,t,e,i)=>{for(var s=0,o=n[t>>1],a=o&&o.length;s<a;s++)t&1?o[s].call(e):i=o[s].call(e,i);return i},Dt=(n,t,e,i,s,o)=>{var a,c,u,d,m,r=t&7,g=!!(t&8),l=!!(t&16),v=r>3?n.length+1:r?g?1:2:0,S=va[r+5],E=r>3&&(n[v-1]=[]),k=n[v]||(n[v]=[]),p=r&&(!l&&!g&&(s=s.prototype),r<5&&(r>3||!l)&&Jl(r<4?s:{get[e](){return $s(this,o)},set[e](_){return $a(this,o,_)}},e));r?l&&r<4&&ga(o,(r>2?"set ":r>1?"get ":"")+e):ga(s,e);for(var T=i.length-1;T>=0;T--)d=Zl(r,e,u={},n[3],k),r&&(d.static=g,d.private=l,m=d.access={has:l?_=>th(s,_):_=>e in _},r^3&&(m.get=l?_=>(r^1?$s:eh)(_,s,r^4?o:p.get):_=>_[e]),r>2&&(m.set=l?(_,M)=>$a(_,s,M,r^4?o:p.set):(_,M)=>_[e]=M)),c=(0,i[T])(r?r<4?l?o:p[S]:r>4?void 0:{get:p.get,set:p.set}:s,d),u._=1,r^4||c===void 0?an(c)&&(r>4?E.unshift(c):r?l?o=c:p[S]=c:s=c):typeof c!="object"||c===null?_e("Object expected"):(an(a=c.get)&&(p.get=a),an(a=c.set)&&(p.set=a),an(a=c.init)&&E.unshift(a));return r||Xl(n,s),p&&gs(s,e,p),l?r^4?o:p:s},xn=(n,t,e)=>ma(n,typeof t!="symbol"?t+"":t,e),vs=(n,t,e)=>t.has(n)||_e("Cannot "+e),th=(n,t)=>Object(t)!==t?_e('Cannot use the "in" operator on this value'):n.has(t),$s=(n,t,e)=>(vs(n,t,"read from private field"),e?e.call(n):t.get(n)),Bn=(n,t,e)=>t.has(n)?_e("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,e),$a=(n,t,e,i)=>(vs(n,t,"write to private field"),i?i.call(n,e):t.set(n,e),e),eh=(n,t,e)=>(vs(n,t,"access private method"),e),Sa,ya,wa,Ea,Ca,ba,Ss,Ta,R,ys,ws,Es,Cs;let Pa=0;const ka=n=>{clearTimeout(Pa),Pa=setTimeout(()=>document.title=n)};function nh(n,t="",e=""){const i=bt.title||n;i&&i!==bt.defaultTitle?(fe.title=i,ka(t+fe.title+e)):(fe.title=bt.defaultTitle,ka(fe.title))}Ta=[Et()];let Mt=class ac extends(Ss=J,ba=[F],Ca=[F],Ea=[Ne],wa=[pt(t=>[t.inert])],ya=[Yt()],Sa=[Nt()],Ss){constructor(){super(...arguments),xn(this,"prefix",Y(R,8,this)),Y(R,11,this),xn(this,"suffix",Y(R,12,this)),Y(R,15,this),xn(this,"inert",Y(R,16,this)),Y(R,19,this),Bn(this,ys,Y(R,20,this,()=>!this.inert&&ht(bt,this.update))),Y(R,23,this),Bn(this,ws,new MutationObserver(()=>this.update())),Bn(this,Es,Y(R,24,this,()=>{$s(this,ws).observe(this,{characterData:!0,childList:!0,subtree:!0})})),Y(R,27,this),Bn(this,Cs,Y(R,28,this,()=>{var t;return nh((t=this.textContent)==null?void 0:t.trim(),this.prefix,this.suffix),h.html`${ac.title}`})),Y(R,31,this)}static setTitle(t){bt({title:t})}};R=Yl(Ss),ys=new WeakMap,ws=new WeakMap,Es=new WeakMap,Cs=new WeakMap,Dt(R,5,"prefix",ba,Mt),Dt(R,5,"suffix",Ca,Mt),Dt(R,5,"inert",Ea,Mt),Dt(R,21,"#connectStore",wa,ys),Dt(R,21,"#obTextContent",ya,Es),Dt(R,21,"#content",Sa,Cs),Mt=Dt(R,0,"GemTitleElement",Ta,Mt),xn(Mt,"title",document.title),Y(R,1,Mt);let fe=Mt;customElements.define("gem-title",fe);var ih=Object.create,bs=Object.defineProperty,sh=Object.getOwnPropertyDescriptor,Ma=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n),pe=n=>{throw TypeError(n)},Oa=(n,t,e)=>t in n?bs(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,La=(n,t)=>bs(n,"name",{value:t,configurable:!0}),rh=n=>[,,,ih((n==null?void 0:n[Ma("metadata")])??null)],Aa=["class","method","getter","setter","accessor","field","value","get","set"],cn=n=>n!==void 0&&typeof n!="function"?pe("Function expected"):n,oh=(n,t,e,i,s)=>({kind:Aa[n],name:t,metadata:i,addInitializer:o=>e._?pe("Already initialized"):s.push(cn(o||null))}),ah=(n,t)=>Oa(t,Ma("metadata"),n[3]),Ut=(n,t,e,i)=>{for(var s=0,o=n[t>>1],a=o&&o.length;s<a;s++)t&1?o[s].call(e):i=o[s].call(e,i);return i},Kn=(n,t,e,i,s,o)=>{var a,c,u,d,m,r=t&7,g=!!(t&8),l=!!(t&16),v=r>3?n.length+1:r?g?1:2:0,S=Aa[r+5],E=r>3&&(n[v-1]=[]),k=n[v]||(n[v]=[]),p=r&&(!l&&!g&&(s=s.prototype),r<5&&(r>3||!l)&&sh(r<4?s:{get[e](){return Ra(this,o)},set[e](_){return Ia(this,o,_)}},e));r?l&&r<4&&La(o,(r>2?"set ":r>1?"get ":"")+e):La(s,e);for(var T=i.length-1;T>=0;T--)d=oh(r,e,u={},n[3],k),r&&(d.static=g,d.private=l,m=d.access={has:l?_=>ch(s,_):_=>e in _},r^3&&(m.get=l?_=>(r^1?Ra:hh)(_,s,r^4?o:p.get):_=>_[e]),r>2&&(m.set=l?(_,M)=>Ia(_,s,M,r^4?o:p.set):(_,M)=>_[e]=M)),c=(0,i[T])(r?r<4?l?o:p[S]:r>4?void 0:{get:p.get,set:p.set}:s,d),u._=1,r^4||c===void 0?cn(c)&&(r>4?E.unshift(c):r?l?o=c:p[S]=c:s=c):typeof c!="object"||c===null?pe("Object expected"):(cn(a=c.get)&&(p.get=a),cn(a=c.set)&&(p.set=a),cn(a=c.init)&&E.unshift(a));return r||ah(n,s),p&&bs(s,e,p),l?r^4?o:p:s},Na=(n,t,e)=>Oa(n,typeof t!="symbol"?t+"":t,e),Ts=(n,t,e)=>t.has(n)||pe("Cannot "+e),ch=(n,t)=>Object(t)!==t?pe('Cannot use the "in" operator on this value'):n.has(t),Ra=(n,t,e)=>(Ts(n,t,"read from private field"),e?e.call(n):t.get(n)),lh=(n,t,e)=>t.has(n)?pe("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,e),Ia=(n,t,e,i)=>(Ts(n,t,"write to private field"),i?i.call(n,e):t.set(n,e),e),hh=(n,t,e)=>(Ts(n,t,"access private method"),e),Ha,Wa,Ga,Ps,za,it,ks;za=[Et()];class Ft extends(Ps=J,Ga=[F],Wa=[F],Ha=[Nt()],Ps){constructor(){super(...arguments),Na(this,"content",Ut(it,8,this)),Ut(it,11,this),Na(this,"contentcss",Ut(it,12,this)),Ut(it,15,this),lh(this,ks,Ut(it,16,this,()=>{const t=`
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
${this.contentcss}
|
|
36
|
-
</style>
|
|
37
|
-
`;this.shadowRoot.innerHTML=this.content+t.trim()})),Ut(it,19,this)}}it=rh(Ps),ks=new WeakMap,Kn(it,5,"content",Ga,Ft),Kn(it,5,"contentcss",Wa,Ft),Kn(it,21,"#content",Ha,ks),Ft=Kn(it,0,"GemUnsafeElement",za,Ft),Ut(it,1,Ft),customElements.define("gem-unsafe",Ft);var dh=Object.create,Ms=Object.defineProperty,uh=Object.getOwnPropertyDescriptor,Va=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n),me=n=>{throw TypeError(n)},Da=(n,t,e)=>t in n?Ms(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Ua=(n,t)=>Ms(n,"name",{value:t,configurable:!0}),_h=n=>[,,,dh((n==null?void 0:n[Va("metadata")])??null)],Fa=["class","method","getter","setter","accessor","field","value","get","set"],ln=n=>n!==void 0&&typeof n!="function"?me("Function expected"):n,fh=(n,t,e,i,s)=>({kind:Fa[n],name:t,metadata:i,addInitializer:o=>e._?me("Already initialized"):s.push(ln(o||null))}),ph=(n,t)=>Da(t,Va("metadata"),n[3]),at=(n,t,e,i)=>{for(var s=0,o=n[t>>1],a=o&&o.length;s<a;s++)t&1?o[s].call(e):i=o[s].call(e,i);return i},ge=(n,t,e,i,s,o)=>{var a,c,u,d,m,r=t&7,g=!!(t&8),l=!!(t&16),v=r>3?n.length+1:r?g?1:2:0,S=Fa[r+5],E=r>3&&(n[v-1]=[]),k=n[v]||(n[v]=[]),p=r&&(!l&&!g&&(s=s.prototype),r<5&&(r>3||!l)&&uh(r<4?s:{get[e](){return Ls(this,o)},set[e](_){return xa(this,o,_)}},e));r?l&&r<4&&Ua(o,(r>2?"set ":r>1?"get ":"")+e):Ua(s,e);for(var T=i.length-1;T>=0;T--)d=fh(r,e,u={},n[3],k),r&&(d.static=g,d.private=l,m=d.access={has:l?_=>mh(s,_):_=>e in _},r^3&&(m.get=l?_=>(r^1?Ls:gh)(_,s,r^4?o:p.get):_=>_[e]),r>2&&(m.set=l?(_,M)=>xa(_,s,M,r^4?o:p.set):(_,M)=>_[e]=M)),c=(0,i[T])(r?r<4?l?o:p[S]:r>4?void 0:{get:p.get,set:p.set}:s,d),u._=1,r^4||c===void 0?ln(c)&&(r>4?E.unshift(c):r?l?o=c:p[S]=c:s=c):typeof c!="object"||c===null?me("Object expected"):(ln(a=c.get)&&(p.get=a),ln(a=c.set)&&(p.set=a),ln(a=c.init)&&E.unshift(a));return r||ph(n,s),p&&Ms(s,e,p),l?r^4?o:p:s},jn=(n,t,e)=>Da(n,typeof t!="symbol"?t+"":t,e),Os=(n,t,e)=>t.has(n)||me("Cannot "+e),mh=(n,t)=>Object(t)!==t?me('Cannot use the "in" operator on this value'):n.has(t),Ls=(n,t,e)=>(Os(n,t,"read from private field"),e?e.call(n):t.get(n)),qa=(n,t,e)=>t.has(n)?me("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,e),xa=(n,t,e,i)=>(Os(n,t,"write to private field"),i?i.call(n,e):t.set(n,e),e),gh=(n,t,e)=>(Os(n,t,"access private method"),e),Ba,Ka,ja,Qa,Ja,As,Ya,V,Ns,Rs;const vh=Qt`
|
|
30
|
+
`;Xo=[Ie(Fr),Zt(jh),bt(),He({focusable:!0})];let G=class _c extends(ts=J,Zo=[mi],Yo=[x],Jo=[x],Qo=[x],jo=[x],Ko=[x],Bo=[x],xo=[Ne],Fo=[U],qo=[U],Uo=[U],Do=[U],Vo=[Jt()],zo=[Rt()],ts){constructor(){super(...arguments),b(w,5,this),de(this,Pt),j(this,"href",b(w,12,this)),b(w,15,this),j(this,"target",b(w,16,this)),b(w,19,this),j(this,"path",b(w,20,this)),b(w,23,this),j(this,"query",b(w,24,this)),b(w,27,this),j(this,"hash",b(w,28,this)),b(w,31,this),j(this,"hint",b(w,32,this)),b(w,35,this),j(this,"preload",b(w,36,this)),b(w,39,this),j(this,"route",b(w,40,this)),b(w,43,this),j(this,"options",b(w,44,this)),b(w,47,this),j(this,"routeOptions",b(w,48,this)),b(w,51,this),j(this,"prepare",b(w,52,this)),b(w,55,this),de(this,es,async t=>{var a;t.preventDefault();const e=this._getLocationString();if(!e)return;if(ra(e))switch(this.target){case"_self":window.location.href=e;return;case"_parent":window.parent.location.href=e;return;case"_top":window.top.location.href=e;return;default:window.open(e);return}const{path:i,query:s,hash:o}=N.getParams();if(i+s+o!==e)if(await((a=this.prepare)==null?void 0:a.call(this)),this.route)N.pushIgnoreCloseHandle(Lo(this.route,dt(this,Pt,tn)));else if(this.href){const c=new URL(e,location.origin);N.pushIgnoreCloseHandle({path:c.pathname,query:c.search,hash:c.hash})}else N.pushIgnoreCloseHandle({path:this.path,query:this.query,hash:this.hash})}),de(this,ns,()=>{const t=this._getLocationString();return ra(t)?t:new URL(N.basePath+t,location.origin).toString()}),de(this,is,()=>{var t,e,i;(t=this.route)==null||t.content,(i=(e=this.route)==null?void 0:e.getContent)==null||i.call(e,{},this.shadowRoot)}),de(this,rs,b(w,56,this,()=>{const t=dt(this,Pt,ta)==="off"?null:dt(this,ns).call(this);return l.html`<a part=${_c.link} href=${t} tabindex="-1"><slot></slot></a>`})),b(w,59,this)}_getLocationString(){var t,e;if(this.route){const i=((t=dt(this,Pt,tn))==null?void 0:t.query)||"",s=((e=dt(this,Pt,tn))==null?void 0:e.hash)||"";return Dn(this.route,dt(this,Pt,tn))+i+s}else{const i=this.href||this.path+this.query+this.hash,{path:s,query:o}=N.getParams();return i.startsWith("#")?`${s}${o}${i}`:i.startsWith("?")?`${s}${i}`:i.startsWith(".")?si(s,i):i}}};w=Ho(ts),Pt=new WeakSet,tn=function(){return this.routeOptions||this.options},ta=function(){return this.hint||"on"},es=new WeakMap,ns=new WeakMap,is=new WeakMap,ss=function(){this.addEventListener("click",dt(this,es)),this.addEventListener("pointerenter",dt(this,is))},rs=new WeakMap,ss=W(w,17,"#init",Vo,Pt,ss),W(w,13,"link",Zo,G),W(w,5,"href",Yo,G),W(w,5,"target",Jo,G),W(w,5,"path",Qo,G),W(w,5,"query",jo,G),W(w,5,"hash",Ko,G),W(w,5,"hint",Bo,G),W(w,5,"preload",xo,G),W(w,5,"route",Fo,G),W(w,5,"options",qo,G),W(w,5,"routeOptions",Uo,G),W(w,5,"prepare",Do,G),W(w,21,"#content",zo,rs),G=W(w,0,"GemLinkElement",Xo,G),j(G,"link",b(w,8,G)),b(w,11,G),b(w,1,G);let cs=G;sa=[Ie(N.store)];class Dt extends(os=cs,ia=[x],na=[Re],ea=[lt()],os){constructor(){super(...arguments),j(this,"pattern",b(nt,8,this)),b(nt,11,this),j(this,"active",b(nt,12,this)),b(nt,15,this),de(this,as,b(nt,16,this,()=>{const{path:t,query:e,hash:i}=N.getParams(),s=this.pattern&&Ji(this.pattern,t);this.active=!!s||t+e+i===this._getLocationString()})),b(nt,19,this)}}nt=Ho(os),as=new WeakMap,W(nt,5,"pattern",ia,Dt),W(nt,5,"active",na,Dt),W(nt,21,"#updateState",ea,as),Dt=W(nt,0,"GemActiveLinkElement",sa,Dt),b(nt,1,Dt),customElements.define("gem-link",cs),customElements.define("gem-active-link",Dt);var Qh=Object.create,hs=Object.defineProperty,Jh=Object.getOwnPropertyDescriptor,oa=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n),ue=n=>{throw TypeError(n)},aa=(n,t,e)=>t in n?hs(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,ca=(n,t)=>hs(n,"name",{value:t,configurable:!0}),Yh=n=>[,,,Qh((n==null?void 0:n[oa("metadata")])??null)],ha=["class","method","getter","setter","accessor","field","value","get","set"],en=n=>n!==void 0&&typeof n!="function"?ue("Function expected"):n,Zh=(n,t,e,i,s)=>({kind:ha[n],name:t,metadata:i,addInitializer:o=>e._?ue("Already initialized"):s.push(en(o||null))}),la=(n,t)=>aa(t,oa("metadata"),n[3]),Mt=(n,t,e,i)=>{for(var s=0,o=n[t>>1],a=o&&o.length;s<a;s++)t&1?o[s].call(e):i=o[s].call(e,i);return i},Un=(n,t,e,i,s,o)=>{var a,c,d,u,m,r=t&7,g=!!(t&8),h=!!(t&16),v=r>3?n.length+1:r?g?1:2:0,S=ha[r+5],E=r>3&&(n[v-1]=[]),P=n[v]||(n[v]=[]),p=r&&(!h&&!g&&(s=s.prototype),r<5&&(r>3||!h)&&Jh(r<4?s:{get[e](){return Ot(this,o)},set[e](_){return ds(this,o,_)}},e));r?h&&r<4&&ca(o,(r>2?"set ":r>1?"get ":"")+e):ca(s,e);for(var T=i.length-1;T>=0;T--)u=Zh(r,e,d={},n[3],P),r&&(u.static=g,u.private=h,m=u.access={has:h?_=>Xh(s,_):_=>e in _},r^3&&(m.get=h?_=>(r^1?Ot:tl)(_,s,r^4?o:p.get):_=>_[e]),r>2&&(m.set=h?(_,M)=>ds(_,s,M,r^4?o:p.set):(_,M)=>_[e]=M)),c=(0,i[T])(r?r<4?h?o:p[S]:r>4?void 0:{get:p.get,set:p.set}:s,u),d._=1,r^4||c===void 0?en(c)&&(r>4?E.unshift(c):r?h?o=c:p[S]=c:s=c):typeof c!="object"||c===null?ue("Object expected"):(en(a=c.get)&&(p.get=a),en(a=c.set)&&(p.set=a),en(a=c.init)&&E.unshift(a));return r||la(n,s),p&&hs(s,e,p),h?r^4?o:p:s},da=(n,t,e)=>aa(n,typeof t!="symbol"?t+"":t,e),ls=(n,t,e)=>t.has(n)||ue("Cannot "+e),Xh=(n,t)=>Object(t)!==t?ue('Cannot use the "in" operator on this value'):n.has(t),Ot=(n,t,e)=>(ls(n,t,"read from private field"),e?e.call(n):t.get(n)),_e=(n,t,e)=>t.has(n)?ue("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,e),ds=(n,t,e,i)=>(ls(n,t,"write to private field"),i?i.call(n,e):t.set(n,e),e),tl=(n,t,e)=>(ls(n,t,"access private method"),e),ua,_a,fa,pa,us,Q,_s,ma,fs,qn,ps,nn,ms;const el="gem-reflect-start",ga="gem-reflect-end",va=n=>new Comment(n),nl=n=>{const t=[];let e=n;for(;e&&(t.push(e),e.nodeValue!==ga);)e=e.nextSibling;return t};class sn extends(us=J,pa=[x],fa=[U],_a=[Pn()],ua=[lt(t=>[t.target])],us){constructor(){super(...arguments),_e(this,_s),da(this,"method",Mt(Q,8,this)),Mt(Q,11,this),da(this,"target",Mt(Q,12,this,document.head)),Mt(Q,15,this),_e(this,fs,Mt(Q,16,this,()=>{this.hidden=!0})),Mt(Q,19,this),_e(this,qn,va(el)),_e(this,ps,va(ga)),_e(this,nn),_e(this,ms,Mt(Q,20,this,()=>((Ot(this,nn)||[Ot(this,qn),...this.childNodes,Ot(this,ps)]).forEach((t,e,i)=>{const s=i[e-1];s?s.after(t):this.target[Ot(this,_s,ma)](t)}),()=>{ds(this,nn,nl(Ot(this,qn))),Ot(this,nn).forEach(t=>t.remove())}))),Mt(Q,23,this)}}Q=Yh(us),_s=new WeakSet,ma=function(){return this.method||"append"},fs=new WeakMap,qn=new WeakMap,ps=new WeakMap,nn=new WeakMap,ms=new WeakMap,Un(Q,5,"method",pa,sn),Un(Q,5,"target",fa,sn),Un(Q,21,"#init",_a,fs),Un(Q,21,"#changeTarget",ua,ms),la(Q,sn),customElements.define("gem-reflect",sn),customElements.define("gem-route",he),customElements.define("gem-light-route",H);var il=Object.create,gs=Object.defineProperty,sl=Object.getOwnPropertyDescriptor,$a=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n),fe=n=>{throw TypeError(n)},Sa=(n,t,e)=>t in n?gs(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,ya=(n,t)=>gs(n,"name",{value:t,configurable:!0}),rl=n=>[,,,il((n==null?void 0:n[$a("metadata")])??null)],wa=["class","method","getter","setter","accessor","field","value","get","set"],rn=n=>n!==void 0&&typeof n!="function"?fe("Function expected"):n,ol=(n,t,e,i,s)=>({kind:wa[n],name:t,metadata:i,addInitializer:o=>e._?fe("Already initialized"):s.push(rn(o||null))}),al=(n,t)=>Sa(t,$a("metadata"),n[3]),Y=(n,t,e,i)=>{for(var s=0,o=n[t>>1],a=o&&o.length;s<a;s++)t&1?o[s].call(e):i=o[s].call(e,i);return i},Ut=(n,t,e,i,s,o)=>{var a,c,d,u,m,r=t&7,g=!!(t&8),h=!!(t&16),v=r>3?n.length+1:r?g?1:2:0,S=wa[r+5],E=r>3&&(n[v-1]=[]),P=n[v]||(n[v]=[]),p=r&&(!h&&!g&&(s=s.prototype),r<5&&(r>3||!h)&&sl(r<4?s:{get[e](){return $s(this,o)},set[e](_){return Ea(this,o,_)}},e));r?h&&r<4&&ya(o,(r>2?"set ":r>1?"get ":"")+e):ya(s,e);for(var T=i.length-1;T>=0;T--)u=ol(r,e,d={},n[3],P),r&&(u.static=g,u.private=h,m=u.access={has:h?_=>cl(s,_):_=>e in _},r^3&&(m.get=h?_=>(r^1?$s:hl)(_,s,r^4?o:p.get):_=>_[e]),r>2&&(m.set=h?(_,M)=>Ea(_,s,M,r^4?o:p.set):(_,M)=>_[e]=M)),c=(0,i[T])(r?r<4?h?o:p[S]:r>4?void 0:{get:p.get,set:p.set}:s,u),d._=1,r^4||c===void 0?rn(c)&&(r>4?E.unshift(c):r?h?o=c:p[S]=c:s=c):typeof c!="object"||c===null?fe("Object expected"):(rn(a=c.get)&&(p.get=a),rn(a=c.set)&&(p.set=a),rn(a=c.init)&&E.unshift(a));return r||al(n,s),p&&gs(s,e,p),h?r^4?o:p:s},Fn=(n,t,e)=>Sa(n,typeof t!="symbol"?t+"":t,e),vs=(n,t,e)=>t.has(n)||fe("Cannot "+e),cl=(n,t)=>Object(t)!==t?fe('Cannot use the "in" operator on this value'):n.has(t),$s=(n,t,e)=>(vs(n,t,"read from private field"),e?e.call(n):t.get(n)),xn=(n,t,e)=>t.has(n)?fe("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,e),Ea=(n,t,e,i)=>(vs(n,t,"write to private field"),i?i.call(n,e):t.set(n,e),e),hl=(n,t,e)=>(vs(n,t,"access private method"),e),Ca,ba,Ta,ka,Pa,Ma,Ss,Oa,R,ys,ws,Es,Cs;let La=0;const Aa=n=>{clearTimeout(La),La=setTimeout(()=>document.title=n)};function ll(n,t="",e=""){const i=kt.title||n;i&&i!==kt.defaultTitle?Aa(t+(Bn.title=i)+e):Aa(Bn.title=kt.defaultTitle)}Oa=[bt()];let Lt=class fc extends(Ss=J,Ma=[x],Pa=[x],ka=[Ne],Ta=[lt(t=>[t.inert])],ba=[Jt()],Ca=[Rt()],Ss){constructor(){super(...arguments),Fn(this,"prefix",Y(R,8,this)),Y(R,11,this),Fn(this,"suffix",Y(R,12,this)),Y(R,15,this),Fn(this,"inert",Y(R,16,this)),Y(R,19,this),xn(this,ys,Y(R,20,this,()=>!this.inert&&ht(kt,this.update))),Y(R,23,this),xn(this,ws,new MutationObserver(()=>this.update())),xn(this,Es,Y(R,24,this,()=>{$s(this,ws).observe(this,{characterData:!0,childList:!0,subtree:!0})})),Y(R,27,this),xn(this,Cs,Y(R,28,this,()=>{var t;return ll((t=this.textContent)==null?void 0:t.trim(),this.prefix,this.suffix),l.html`${fc.title}`})),Y(R,31,this)}static setTitle(t){kt({title:t})}};R=rl(Ss),ys=new WeakMap,ws=new WeakMap,Es=new WeakMap,Cs=new WeakMap,Ut(R,5,"prefix",Ma,Lt),Ut(R,5,"suffix",Pa,Lt),Ut(R,5,"inert",ka,Lt),Ut(R,21,"#connectStore",Ta,ys),Ut(R,21,"#obTextContent",ba,Es),Ut(R,21,"#content",Ca,Cs),Lt=Ut(R,0,"GemTitleElement",Oa,Lt),Fn(Lt,"title",document.title),Y(R,1,Lt);let Bn=Lt;customElements.define("gem-title",Bn);var dl=Object.create,bs=Object.defineProperty,ul=Object.getOwnPropertyDescriptor,Na=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n),pe=n=>{throw TypeError(n)},Ra=(n,t,e)=>t in n?bs(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Ia=(n,t)=>bs(n,"name",{value:t,configurable:!0}),_l=n=>[,,,dl((n==null?void 0:n[Na("metadata")])??null)],Ha=["class","method","getter","setter","accessor","field","value","get","set"],on=n=>n!==void 0&&typeof n!="function"?pe("Function expected"):n,fl=(n,t,e,i,s)=>({kind:Ha[n],name:t,metadata:i,addInitializer:o=>e._?pe("Already initialized"):s.push(on(o||null))}),pl=(n,t)=>Ra(t,Na("metadata"),n[3]),gt=(n,t,e,i)=>{for(var s=0,o=n[t>>1],a=o&&o.length;s<a;s++)t&1?o[s].call(e):i=o[s].call(e,i);return i},an=(n,t,e,i,s,o)=>{var a,c,d,u,m,r=t&7,g=!!(t&8),h=!!(t&16),v=r>3?n.length+1:r?g?1:2:0,S=Ha[r+5],E=r>3&&(n[v-1]=[]),P=n[v]||(n[v]=[]),p=r&&(!h&&!g&&(s=s.prototype),r<5&&(r>3||!h)&&ul(r<4?s:{get[e](){return ks(this,o)},set[e](_){return Ga(this,o,_)}},e));r?h&&r<4&&Ia(o,(r>2?"set ":r>1?"get ":"")+e):Ia(s,e);for(var T=i.length-1;T>=0;T--)u=fl(r,e,d={},n[3],P),r&&(u.static=g,u.private=h,m=u.access={has:h?_=>ml(s,_):_=>e in _},r^3&&(m.get=h?_=>(r^1?ks:gl)(_,s,r^4?o:p.get):_=>_[e]),r>2&&(m.set=h?(_,M)=>Ga(_,s,M,r^4?o:p.set):(_,M)=>_[e]=M)),c=(0,i[T])(r?r<4?h?o:p[S]:r>4?void 0:{get:p.get,set:p.set}:s,u),d._=1,r^4||c===void 0?on(c)&&(r>4?E.unshift(c):r?h?o=c:p[S]=c:s=c):typeof c!="object"||c===null?pe("Object expected"):(on(a=c.get)&&(p.get=a),on(a=c.set)&&(p.set=a),on(a=c.init)&&E.unshift(a));return r||pl(n,s),p&&bs(s,e,p),h?r^4?o:p:s},Wa=(n,t,e)=>Ra(n,typeof t!="symbol"?t+"":t,e),Ts=(n,t,e)=>t.has(n)||pe("Cannot "+e),ml=(n,t)=>Object(t)!==t?pe('Cannot use the "in" operator on this value'):n.has(t),ks=(n,t,e)=>(Ts(n,t,"read from private field"),e?e.call(n):t.get(n)),Ps=(n,t,e)=>t.has(n)?pe("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,e),Ga=(n,t,e,i)=>(Ts(n,t,"write to private field"),i?i.call(n,e):t.set(n,e),e),gl=(n,t,e)=>(Ts(n,t,"access private method"),e),za,Va,Da,Ua,Ms,qa,B,Os,Fa,Ls,As;const vl=Nt`
|
|
31
|
+
:host(:where(:not([hidden]))) {
|
|
32
|
+
display: contents;
|
|
33
|
+
}
|
|
34
|
+
`;qa=[bt(),Zt(vl)];class qt extends(Ms=J,Ua=[x],Da=[U],Va=[lt()],za=[Rt()],Ms){constructor(){super(...arguments),Ps(this,Os),Wa(this,"html",gt(B,8,this)),gt(B,11,this),Wa(this,"styles",gt(B,12,this)),gt(B,15,this),Ps(this,Ls,gt(B,16,this,()=>{const t=this.shadowRoot.adoptedStyleSheets;return this.shadowRoot.adoptedStyleSheets=t.concat(ks(this,Os,Fa)),()=>{this.shadowRoot.adoptedStyleSheets=t}})),gt(B,19,this),Ps(this,As,gt(B,20,this,()=>{this.shadowRoot.innerHTML=this.html})),gt(B,23,this)}}B=_l(Ms),Os=new WeakSet,Fa=function(){if(!this.styles)return[];if(typeof this.styles=="string"){const n=new CSSStyleSheet;return n.replaceSync(this.styles),[n]}else return[this.styles].flat().map(n=>n[mt].getStyle())},Ls=new WeakMap,As=new WeakMap,an(B,5,"html",Ua,qt),an(B,5,"styles",Da,qt),an(B,21,"#adoptStyles",Va,Ls),an(B,21,"#content",za,As),qt=an(B,0,"GemUnsafeElement",qa,qt),gt(B,1,qt),customElements.define("gem-unsafe",qt);var $l=Object.create,Ns=Object.defineProperty,Sl=Object.getOwnPropertyDescriptor,xa=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n),me=n=>{throw TypeError(n)},Ba=(n,t,e)=>t in n?Ns(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Ka=(n,t)=>Ns(n,"name",{value:t,configurable:!0}),yl=n=>[,,,$l((n==null?void 0:n[xa("metadata")])??null)],ja=["class","method","getter","setter","accessor","field","value","get","set"],cn=n=>n!==void 0&&typeof n!="function"?me("Function expected"):n,wl=(n,t,e,i,s)=>({kind:ja[n],name:t,metadata:i,addInitializer:o=>e._?me("Already initialized"):s.push(cn(o||null))}),El=(n,t)=>Ba(t,xa("metadata"),n[3]),ot=(n,t,e,i)=>{for(var s=0,o=n[t>>1],a=o&&o.length;s<a;s++)t&1?o[s].call(e):i=o[s].call(e,i);return i},ge=(n,t,e,i,s,o)=>{var a,c,d,u,m,r=t&7,g=!!(t&8),h=!!(t&16),v=r>3?n.length+1:r?g?1:2:0,S=ja[r+5],E=r>3&&(n[v-1]=[]),P=n[v]||(n[v]=[]),p=r&&(!h&&!g&&(s=s.prototype),r<5&&(r>3||!h)&&Sl(r<4?s:{get[e](){return Is(this,o)},set[e](_){return Ja(this,o,_)}},e));r?h&&r<4&&Ka(o,(r>2?"set ":r>1?"get ":"")+e):Ka(s,e);for(var T=i.length-1;T>=0;T--)u=wl(r,e,d={},n[3],P),r&&(u.static=g,u.private=h,m=u.access={has:h?_=>Cl(s,_):_=>e in _},r^3&&(m.get=h?_=>(r^1?Is:bl)(_,s,r^4?o:p.get):_=>_[e]),r>2&&(m.set=h?(_,M)=>Ja(_,s,M,r^4?o:p.set):(_,M)=>_[e]=M)),c=(0,i[T])(r?r<4?h?o:p[S]:r>4?void 0:{get:p.get,set:p.set}:s,u),d._=1,r^4||c===void 0?cn(c)&&(r>4?E.unshift(c):r?h?o=c:p[S]=c:s=c):typeof c!="object"||c===null?me("Object expected"):(cn(a=c.get)&&(p.get=a),cn(a=c.set)&&(p.set=a),cn(a=c.init)&&E.unshift(a));return r||El(n,s),p&&Ns(s,e,p),h?r^4?o:p:s},Kn=(n,t,e)=>Ba(n,typeof t!="symbol"?t+"":t,e),Rs=(n,t,e)=>t.has(n)||me("Cannot "+e),Cl=(n,t)=>Object(t)!==t?me('Cannot use the "in" operator on this value'):n.has(t),Is=(n,t,e)=>(Rs(n,t,"read from private field"),e?e.call(n):t.get(n)),Qa=(n,t,e)=>t.has(n)?me("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,e),Ja=(n,t,e,i)=>(Rs(n,t,"write to private field"),i?i.call(n,e):t.set(n,e),e),bl=(n,t,e)=>(Rs(n,t,"access private method"),e),Ya,Za,Xa,tc,ec,Hs,nc,V,Ws,Gs;const Tl=Nt`
|
|
38
35
|
:host(:where(:not([hidden]))) {
|
|
39
36
|
position: relative;
|
|
40
37
|
display: inline-flex;
|
|
@@ -44,4 +41,4 @@
|
|
|
44
41
|
width: 100%;
|
|
45
42
|
height: 100%;
|
|
46
43
|
}
|
|
47
|
-
`,Za=new Map;Ya=[Et(),Ie(vh)];class mt extends(As=J,Ja=[F],Qa=[x],ja=[x],Ka=[Re],Ba=[Nt()],As){constructor(){super(...arguments),jn(this,"selector",at(V,8,this)),at(V,11,this),jn(this,"root",at(V,12,this)),at(V,15,this),jn(this,"element",at(V,16,this)),at(V,19,this),jn(this,"active",at(V,20,this)),at(V,23,this),qa(this,Ns,()=>{const t=this.element||(this.selector?(this.root||document).querySelector(this.selector):null);if(typeof t=="string"){let e=Za.get(t);return e||(e=document.createElement("template"),e.innerHTML=t,Za.set(t,e)),e.content.cloneNode(!0)}else return t instanceof HTMLTemplateElement?t.content.cloneNode(!0):t==null?void 0:t.cloneNode(!0)}),qa(this,Rs,at(V,24,this,()=>h.html`${Ls(this,Ns).call(this)}<slot></slot>`)),at(V,27,this)}}V=_h(As),Ns=new WeakMap,Rs=new WeakMap,ge(V,5,"selector",Ja,mt),ge(V,5,"root",Qa,mt),ge(V,5,"element",ja,mt),ge(V,5,"active",Ka,mt),ge(V,21,"#content",Ba,Rs),mt=ge(V,0,"GemUseElement",Ya,mt),at(V,1,mt),customElements.define("gem-use",mt);class Xa{constructor(t){C(this,Pe);C(this,mn);$(this,"info",(...t)=>{console.log(f(this,Pe,ei),...t)});$(this,"warn",(...t)=>{console.warn(f(this,Pe,ei),...t)});$(this,"error",(...t)=>{console.error(f(this,Pe,ei),...t)});L(this,mn,t)}}mn=new WeakMap,Pe=new WeakSet,ei=function(){return`[${f(this,mn)}]`};const tc=new Xa("GEM"),$h=/\$\d(?:<[^>]*>)?/,Sh=/\$(\d)(<([^>]*)>)?/g,yh=3;function ec(n,...t){const e=n.split($h),i=[];let s;for(;s=Sh.exec(n);){const o=s[yh],a=Number(s[1])-1,c=t[a];i.push(typeof c=="function"?c(o):c)}return h.html(e,...i)}const hn=new Set,Ws=class Ws{constructor(t){C(this,G);$(this,"resources");$(this,"fallbackLanguage");$(this,"currentLanguage");$(this,"cache");$(this,"cachePrefix","gem-i18n");$(this,"urlParamsType");$(this,"urlParamsName");$(this,"onChange");$(this,"replace",({path:t})=>this.setLanguage(t));$(this,"getParams",()=>({path:this.currentLanguage}));C(this,gn,!0);if(!t.resources[t.fallbackLanguage])throw new ft("i18n: fallbackLanguage invalid");Object.assign(this,t);let e=f(this,G,cc)||this.currentLanguage||f(this,G,lc);const i=document.querySelector(`[type*=${this.cachePrefix}]`);if(i)try{const s=JSON.parse(i.textContent||"");e=s.currentLanguage,this.resources[s.currentLanguage]=s.currentLanguagePack}catch{}e?(L(this,G,e,ii),this.setLanguage(e)):this.resetLanguage(),L(this,gn,!1)}get(t,...e){const i=this.resources[this.currentLanguage],s=this.resources[this.fallbackLanguage],o=i[t]||s[t],a=(o==null?void 0:o.message)||o||`[${t}]`;return e.length?ec(a,...e):a}detectLanguage(){const t=Object.keys(this.resources),e=navigator.languages.map(i=>i.replace(/-(.*)/,s=>s.toUpperCase()));for(const i of e){const s=t.find(o=>o===i||i.startsWith(`${o}-`));if(s)return s}return this.fallbackLanguage}async setLanguage(t){var s,o;f(this,G,vn)&&hn.forEach(async a=>await a.setLanguage(t));let e;const i=this.resources[t];if(!i)return tc.warn(`${this.cachePrefix}: not found \`${t}\``),this.resetLanguage();if(typeof i=="string"){const a=`${this.cachePrefix}:`,c=`${a}${i}`,u=localStorage.getItem(c),d=async()=>{const m=await(await fetch(i)).json();if(this.cache){for(let r=0;r<localStorage.length;r++){const g=localStorage.key(r);g.startsWith(a)&&localStorage.removeItem(g)}localStorage.setItem(c,JSON.stringify(m))}return m};if(u)try{e=JSON.parse(u)}catch{e=await d()}else e=await d()}else e=i;if(this.resources[t]=e,!f(this,gn)){const a=[document.documentElement];for(;a.length;){const c=a.pop();(s=c[Le])==null||s.call(c),a.push(...[...c.children,...((o=c.shadowRoot)==null?void 0:o.children)||[]].reverse())}}return t!==this.currentLanguage&&L(this,G,t,ii),this.cache===!0&&this.setCache(),t}resetLanguage(){return f(this,G,vn)&&hn.forEach(t=>t.resetLanguage()),L(this,G,this.fallbackLanguage,ii),this.cache&&localStorage.removeItem(f(this,G,ni)),this.setLanguage(this.detectLanguage())}setCache(){f(this,G,vn)&&hn.forEach(t=>t.setCache()),localStorage.setItem(f(this,G,ni),this.currentLanguage)}createSubModule(t,e){const i=new Ws({resources:e,cachePrefix:`${this.cachePrefix}-${t}`,currentLanguage:this.currentLanguage,fallbackLanguage:this.fallbackLanguage,cache:this.cache});return hn.add(i),i}toJSON(){return{currentLanguage:this.currentLanguage,currentLanguagePack:this.resources[this.currentLanguage]}}};G=new WeakSet,ni=function(){return`${this.cachePrefix}:current`},cc=function(){const{hostname:t,pathname:e,search:i}=location,s=t.split(".");switch(this.urlParamsType){case"ccTLD":return s.pop();case"gTLD":return s.shift();case"path":return e.split("/")[1];default:{const o=this.urlParamsName&&new URLSearchParams(i).get(this.urlParamsName)||"";return o in this.resources?o:""}}},lc=function(){return this.cache&&localStorage.getItem(f(this,G,ni))||""},vn=function(){return!hn.has(this)},ii=function(t){var e;f(this,G,vn)&&(document.documentElement.lang=t),this.currentLanguage=t,(e=this.onChange)==null||e.call(this,t)},gn=new WeakMap;let Is=Ws;const Z=n=>matchMedia(n).matches,wh={PRINT:"print",get isPrint(){return Z(this.PRINT)},HOVER:"(hover: hover)",get isHover(){return Z(this.HOVER)},PWA:"(display-mode: standalone)",get isPWA(){return Z(this.PWA)},MOTION_REDUCE:"(prefers-reduced-motion: reduce)",get isMotionReduce(){return Z(this.MOTION_REDUCE)},DATA_REDUCE:"(prefers-reduced-data: reduce)",get isDataReduce(){return Z(this.DATA_REDUCE)},WATCH:"(width < 320px)",get isWatch(){return Z(this.WATCH)},SMALL_PHONE:"(320px <= width <= 480px) and (height <= 640px)",get isSmallPhone(){return Z(this.SMALL_PHONE)},PHONE:"(320px <= width <= 480px)",get isPhone(){return Z(this.PHONE)},PHONE_LANDSCAPE:"(480px < width < 960px) and (orientation: landscape)",get isPhoneLandscape(){return Z(this.PHONE_LANDSCAPE)},SHORT:"(width >= 480px) and (height <= 320px)",get isShort(){return Z(this.SHORT)},TABLET:"(480px < width <= 1280px)",get isTablet(){return Z(this.TABLET)},DESKTOP:"(width > 1280px) and (orientation: landscape)",get isDesktop(){return Z(this.DESKTOP)},WIDTHSCREEN:"(width >= 1920px) and (orientation: landscape)",get isWidthScreen(){return Z(this.WIDTHSCREEN)}},Eh=Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)).constructor;function nc(n={}){const{origin:t=location.origin,base:e="",appendHeaders:i=()=>({}),transformInput:s=r=>r,transformOutput:o=r=>r,...a}=n,c=r=>r instanceof FormData||r instanceof Blob||r instanceof Eh||r instanceof URLSearchParams||r instanceof ReadableStream||r instanceof ArrayBuffer?r:typeof r=="object"?JSON.stringify(r):r,u=(r,g)=>{if(new URL(r,location.origin).pathname!==r)throw new ft("`path` format is incorrect");const l=new URLSearchParams(g).toString();return`${t}${e}${r}${l?"?":""}${l}`},d=r=>{if(!r)return{};if(r instanceof Headers)return Object.fromEntries(r);const g=Array.isArray(r)?r:Object.entries(r);return Object.fromEntries(g.map(([l,v])=>[l.toLowerCase(),v]))},m=async(r,g={})=>{const l=new Request(r,{...a,...g,headers:new Headers({"content-type":"application/json",...d(a.headers),...d(g.headers)})}),v=await fetch(l);if(v.status===0)throw new Error("Request fail");if(v.status>=500)throw new Error(v.statusText);const S=l.headers.get("content-type"),E=v.status>=400;try{let k;if(S.includes("json")?k=await v.json():S.includes("octet-stream")?k=await v.arrayBuffer():k=await v.text(),E)throw new Error(v.statusText,{cause:k});return o(k,l)}catch{throw new Error("Parse error")}};return{request:m,get(r,g){const l=s(g);return m(u(r,l),{method:"GET",headers:i(l)})},del(r,g){const l=s(g);return m(u(r,l),{method:"DELETE",headers:i(l)})},put(r,g){const l=s(g);return m(u(r),{method:"PUT",headers:i(l),body:c(l)})},post(r,g){const l=s(g);return m(u(r),{method:"POST",headers:i(l),body:c(l)})}}}const{request:Ch,del:bh,get:Th,post:Ph,put:kh}=nc(),ic=new WeakMap,sc=new WeakMap;function Mh(n){return ic.get(n)}function Hs(n){return sc.get(n)}function Qn(n,t={}){const e=yn(),i=Qt({})[yt],s=St(n),o=new Proxy(Me({[yt]:i},c=>s(c)),{get(c,u){if(!c[u]){const[d,m,r]=u.match(/^(\w*Color)(\d+)$/)||[];m&&(c[u]=`oklch(from ${c[m]} calc(l - ${(Number(r)-400)/1e3}) c h)`)}return c[u]}});sc.set(o,t),ic.set(o,s);const a=()=>{let c="";Object.keys(s).forEach(u=>{t[u]||(t[u]=`--${At(u)}-${e}`,o[u]=`var(${t[u]})`),c+=`${t[u]}:${s[u]};`}),i.setContent(`:scope,:host{${c}}`)};return a(),ht(s,()=>{a(),i.updateStyle()}),o}function rc(n){return Qn(n)}function Oh(n){const t=rc(n);return document.adoptedStyleSheets.push(t[yt].getStyle()),t}function Lh(n,t){return Qn(t,Hs(n))}function Ah(n){const t=Qn(n),e=Hs(t);return Me(t,s=>(o,{addInitializer:a,access:c})=>{a(function(){const u=Qn({...n},e);this.internals.sheets.push(u[yt].getStyle(this)),this.memo(()=>u(c.get(this).apply(this)),s&&(()=>s(this)))})})}h.GemActiveLinkElement=Vt,h.GemDialogBaseElement=se,h.GemElement=J,h.GemError=ft,h.GemLightRouteElement=H,h.GemLinkElement=z,h.GemReflectElement=on,h.GemRouteElement=ce,h.GemTitleElement=fe,h.GemUnsafeElement=Ft,h.GemUseElement=mt,h.I18n=Is,h.LinkedList=Us,h.Logger=Xa,h.PropProxyMap=Fs,h.QueryString=jt,h.SheetToken=yt,h.TemplateResult=Ei,h.UpdateToken=Le,h._RenderErrorEvent=Cn,h._StoreListenerMap=Oe,h.absoluteLocation=ri,h.addListener=oi,h.addMicrotask=_t,h.adoptedStyle=Ie,h.aria=We,h.async=ur,h.attribute=F,h.basePathStore=Vr,h.boolattribute=Ne,h.camelToKebabCase=At,h.classMap=xs,h.cleanObject=wn,h.connect=ht,h.connectStore=He,h.createDecoratorTheme=Ah,h.createHistoryParams=Po,h.createModalClass=bl,h.createOverrideTheme=Lh,h.createPath=Un,h.createRef=Zc,h.createScopedTheme=rc,h.createStore=St,h.createTheme=Oh,h.createUpdater=Me,h.css=Qt,h.customElement=_r,h.del=bh,h.directive=Lr,h.effect=pt,h.emitter=Zt,h.exportPartsMap=pc,h.fallback=ar,h.get=Th,h.getThemeProps=Hs,h.getThemeStore=Mh,h.globalemitter=hr,h.history=N,h.initRequest=nc,h.isArrayChange=qs,h.isSSR=li,h.kebabToCamelCase=uc,h.light=vi,h.logger=tc,h.matchPath=Yi,h.mathml=Fc,h.mediaQuery=wh,h.memo=mi,h.mounted=Yt,h.numattribute=rr,h.objectMapToString=En,h.part=gi,h.partMap=fc,h.post=Ph,h.property=x,h.put=kh,h.randomStr=yn,h.raw=Sn,h.repeat=al,h.request=Ch,h.setEngine=ai,h.shadow=Et,h.slot=lr,h.splice=ec,h.state=Re,h.styleMap=_c,h.styled=dc,h.svg=Uc,h.template=Nt,h.titleStore=bt,h.unmounted=or,h.version=Or,h.willMount=Mn,Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})});
|
|
44
|
+
`,ic=new Map;nc=[bt(),Zt(Tl)];class vt extends(Hs=J,ec=[x],tc=[U],Xa=[U],Za=[Re],Ya=[Rt()],Hs){constructor(){super(...arguments),Kn(this,"selector",ot(V,8,this)),ot(V,11,this),Kn(this,"root",ot(V,12,this)),ot(V,15,this),Kn(this,"element",ot(V,16,this)),ot(V,19,this),Kn(this,"active",ot(V,20,this)),ot(V,23,this),Qa(this,Ws,()=>{const t=this.element||(this.selector?(this.root||document).querySelector(this.selector):null);if(typeof t=="string"){let e=ic.get(t);return e||(e=document.createElement("template"),e.innerHTML=t,ic.set(t,e)),e.content.cloneNode(!0)}else return t instanceof HTMLTemplateElement?t.content.cloneNode(!0):t==null?void 0:t.cloneNode(!0)}),Qa(this,Gs,ot(V,24,this,()=>l.html`${Is(this,Ws).call(this)}<slot></slot>`)),ot(V,27,this)}}V=yl(Hs),Ws=new WeakMap,Gs=new WeakMap,ge(V,5,"selector",ec,vt),ge(V,5,"root",tc,vt),ge(V,5,"element",Xa,vt),ge(V,5,"active",Za,vt),ge(V,21,"#content",Ya,Gs),vt=ge(V,0,"GemUseElement",nc,vt),ot(V,1,vt),customElements.define("gem-use",vt);class sc{constructor(t){C(this,ke);C(this,pn);$(this,"info",(...t)=>{console.log(f(this,ke,ti),...t)});$(this,"warn",(...t)=>{console.warn(f(this,ke,ti),...t)});$(this,"error",(...t)=>{console.error(f(this,ke,ti),...t)});O(this,pn,t)}}pn=new WeakMap,ke=new WeakSet,ti=function(){return`[${f(this,pn)}]`};const rc=new sc("GEM"),kl=/\$\d(?:<[^>]*>)?/,Pl=/\$(\d)(<([^>]*)>)?/g,Ml=3;function oc(n,...t){const e=n.split(kl),i=[];let s;for(;s=Pl.exec(n);){const o=s[Ml],a=Number(s[1])-1,c=t[a];i.push(typeof c=="function"?c(o):c)}return l.html(e,...i)}const hn=new Set,Ds=class Ds{constructor(t){C(this,z);$(this,"resources");$(this,"fallbackLanguage");$(this,"currentLanguage");$(this,"cache");$(this,"cachePrefix","gem-i18n");$(this,"urlParamsType");$(this,"urlParamsName");$(this,"onChange");$(this,"replace",({path:t})=>this.setLanguage(t));$(this,"getParams",()=>({path:this.currentLanguage}));C(this,mn,!0);if(!t.resources[t.fallbackLanguage])throw new pt("i18n: fallbackLanguage invalid");Object.assign(this,t);let e=f(this,z,pc)||this.currentLanguage||f(this,z,mc);const i=document.querySelector(`[type*=${this.cachePrefix}]`);if(i)try{const s=JSON.parse(i.textContent||"");e=s.currentLanguage,this.resources[s.currentLanguage]=s.currentLanguagePack}catch{}e?(O(this,z,e,ni),this.setLanguage(e)):this.resetLanguage(),O(this,mn,!1)}get(t,...e){const i=this.resources[this.currentLanguage],s=this.resources[this.fallbackLanguage],o=i[t]||s[t],a=(o==null?void 0:o.message)||o||`[${t}]`;return e.length?oc(a,...e):a}detectLanguage(){const t=Object.keys(this.resources),e=navigator.languages.map(i=>i.replace(/-(.*)/,s=>s.toUpperCase()));for(const i of e){const s=t.find(o=>o===i||i.startsWith(`${o}-`));if(s)return s}return this.fallbackLanguage}async setLanguage(t){var s,o;f(this,z,gn)&&hn.forEach(async a=>await a.setLanguage(t));let e;const i=this.resources[t];if(!i)return rc.warn(`${this.cachePrefix}: not found \`${t}\``),this.resetLanguage();if(typeof i=="string"){const a=`${this.cachePrefix}:`,c=`${a}${i}`,d=localStorage.getItem(c),u=async()=>{const m=await(await fetch(i)).json();if(this.cache){for(let r=0;r<localStorage.length;r++){const g=localStorage.key(r);g.startsWith(a)&&localStorage.removeItem(g)}localStorage.setItem(c,JSON.stringify(m))}return m};if(d)try{e=JSON.parse(d)}catch{e=await u()}else e=await u()}else e=i;if(this.resources[t]=e,!f(this,mn)){const a=[document.documentElement];for(;a.length;){const c=a.pop();(s=c[Le])==null||s.call(c),a.push(...[...c.children,...((o=c.shadowRoot)==null?void 0:o.children)||[]].reverse())}}return t!==this.currentLanguage&&O(this,z,t,ni),this.cache===!0&&this.setCache(),t}resetLanguage(){return f(this,z,gn)&&hn.forEach(t=>t.resetLanguage()),O(this,z,this.fallbackLanguage,ni),this.cache&&localStorage.removeItem(f(this,z,ei)),this.setLanguage(this.detectLanguage())}setCache(){f(this,z,gn)&&hn.forEach(t=>t.setCache()),localStorage.setItem(f(this,z,ei),this.currentLanguage)}createSubModule(t,e){const i=new Ds({resources:e,cachePrefix:`${this.cachePrefix}-${t}`,currentLanguage:this.currentLanguage,fallbackLanguage:this.fallbackLanguage,cache:this.cache});return hn.add(i),i}toJSON(){return{currentLanguage:this.currentLanguage,currentLanguagePack:this.resources[this.currentLanguage]}}};z=new WeakSet,ei=function(){return`${this.cachePrefix}:current`},pc=function(){const{hostname:t,pathname:e,search:i}=location,s=t.split(".");switch(this.urlParamsType){case"ccTLD":return s.pop();case"gTLD":return s.shift();case"path":return e.split("/")[1];default:{const o=this.urlParamsName&&new URLSearchParams(i).get(this.urlParamsName)||"";return o in this.resources?o:""}}},mc=function(){return this.cache&&localStorage.getItem(f(this,z,ei))||""},gn=function(){return!hn.has(this)},ni=function(t){var e;f(this,z,gn)&&(document.documentElement.lang=t),this.currentLanguage=t,(e=this.onChange)==null||e.call(this,t)},mn=new WeakMap;let zs=Ds;const Z=n=>matchMedia(n).matches,Ol={PRINT:"print",get isPrint(){return Z(this.PRINT)},HOVER:"(hover: hover)",get isHover(){return Z(this.HOVER)},PWA:"(display-mode: standalone)",get isPWA(){return Z(this.PWA)},MOTION_REDUCE:"(prefers-reduced-motion: reduce)",get isMotionReduce(){return Z(this.MOTION_REDUCE)},DATA_REDUCE:"(prefers-reduced-data: reduce)",get isDataReduce(){return Z(this.DATA_REDUCE)},WATCH:"(width < 320px)",get isWatch(){return Z(this.WATCH)},SMALL_PHONE:"(320px <= width <= 480px) and (height <= 640px)",get isSmallPhone(){return Z(this.SMALL_PHONE)},PHONE:"(320px <= width <= 480px)",get isPhone(){return Z(this.PHONE)},PHONE_LANDSCAPE:"(480px < width < 960px) and (orientation: landscape)",get isPhoneLandscape(){return Z(this.PHONE_LANDSCAPE)},SHORT:"(width >= 480px) and (height <= 320px)",get isShort(){return Z(this.SHORT)},TABLET:"(480px < width <= 1280px)",get isTablet(){return Z(this.TABLET)},DESKTOP:"(width > 1280px) and (orientation: landscape)",get isDesktop(){return Z(this.DESKTOP)},WIDTHSCREEN:"(width >= 1920px) and (orientation: landscape)",get isWidthScreen(){return Z(this.WIDTHSCREEN)}},Ll=Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)).constructor;function ac(n={}){const{origin:t=location.origin,base:e="",appendHeaders:i=()=>({}),transformInput:s=r=>r,transformOutput:o=r=>r,...a}=n,c=r=>r instanceof FormData||r instanceof Blob||r instanceof Ll||r instanceof URLSearchParams||r instanceof ReadableStream||r instanceof ArrayBuffer?r:typeof r=="object"?JSON.stringify(r):r,d=(r,g)=>{if(new URL(r,location.origin).pathname!==r)throw new pt("`path` format is incorrect");const h=new URLSearchParams(g).toString();return`${t}${e}${r}${h?"?":""}${h}`},u=r=>{if(!r)return{};if(r instanceof Headers)return Object.fromEntries(r);const g=Array.isArray(r)?r:Object.entries(r);return Object.fromEntries(g.map(([h,v])=>[h.toLowerCase(),v]))},m=async(r,g={})=>{const h=new Request(r,{...a,...g,headers:new Headers({"content-type":"application/json",...u(a.headers),...u(g.headers)})}),v=await fetch(h);if(v.status===0)throw new Error("Request fail");if(v.status>=500)throw new Error(v.statusText);const S=h.headers.get("content-type"),E=v.status>=400;try{let P;if(S.includes("json")?P=await v.json():S.includes("octet-stream")?P=await v.arrayBuffer():P=await v.text(),E)throw new Error(v.statusText,{cause:P});return o(P,h)}catch{throw new Error("Parse error")}};return{request:m,get(r,g){const h=s(g);return m(d(r,h),{method:"GET",headers:i(h)})},del(r,g){const h=s(g);return m(d(r,h),{method:"DELETE",headers:i(h)})},put(r,g){const h=s(g);return m(d(r),{method:"PUT",headers:i(h),body:c(h)})},post(r,g){const h=s(g);return m(d(r),{method:"POST",headers:i(h),body:c(h)})}}}const{request:Al,del:Nl,get:Rl,post:Il,put:Hl}=ac(),cc=new WeakMap,hc=new WeakMap;function Wl(n){return cc.get(n)}function Vs(n){return hc.get(n)}function jn(n,t={}){const e=Sn(),i=Nt({})[mt],s=Et(n),o=new Proxy(Me({[mt]:i},c=>s(c)),{get(c,d){if(!c[d]){const[u,m,r]=d.match(/^(\w*Color)(\d+)$/)||[];m&&(c[d]=`oklch(from ${c[m]} calc(l - ${(Number(r)-400)/1e3}) c h)`)}return c[d]}});hc.set(o,t),cc.set(o,s);const a=()=>{let c="";Object.keys(s).forEach(d=>{t[d]||(t[d]=`--${At(d)}-${e}`,o[d]=`var(${t[d]})`),c+=`${t[d]}:${s[d]};`}),i.setContent(`&,:host{${c}}`)};return a(),ht(s,()=>{a(),i.updateStyle()}),o}function lc(n){return jn(n)}function Gl(n){const t=lc(n);return document.adoptedStyleSheets.push(t[mt].getStyle()),t}function zl(n,t){return jn(t,Vs(n))}function Vl(n){const t=jn(n),e=Vs(t);return Me(t,s=>(o,{addInitializer:a,access:c})=>{a(function(){const d=jn({...n},e);this.internals.sheets.push(d[mt].getStyle(this,!0)),this.memo(()=>d(c.get(this).apply(this)),s&&(()=>s(this)))})})}l.GemActiveLinkElement=Dt,l.GemDialogBaseElement=re,l.GemElement=J,l.GemError=pt,l.GemLightRouteElement=H,l.GemLinkElement=cs,l.GemReflectElement=sn,l.GemRouteElement=he,l.GemTitleElement=Bn,l.GemUnsafeElement=qt,l.GemUseElement=vt,l.I18n=zs,l.LinkedList=Bs,l.Logger=sc,l.PropProxyMap=Ks,l.QueryString=jt,l.SheetToken=mt,l.TemplateResult=wi,l.UpdateToken=Le,l._RenderErrorEvent=En,l._StoreListenerMap=Oe,l.absoluteLocation=si,l.addListener=ri,l.addMicrotask=ft,l.adoptedStyle=Zt,l.aria=He,l.async=mr,l.attribute=x,l.basePathStore=Fr,l.boolattribute=Ne,l.camelToKebabCase=At,l.classMap=Qs,l.cleanObject=yn,l.connect=ht,l.connectStore=Ie,l.createDecoratorTheme=Vl,l.createHistoryParams=Lo,l.createModalClass=Nh,l.createOverrideTheme=zl,l.createPath=Dn,l.createRef=oh,l.createScopedTheme=lc,l.createStore=Et,l.createTheme=Gl,l.createUpdater=Me,l.css=Nt,l.customElement=gr,l.del=Nl,l.directive=Ir,l.effect=lt,l.emitter=Yt,l.exportPartsMap=Ec,l.fallback=dr,l.get=Rl,l.getThemeProps=Vs,l.getThemeStore=Wl,l.globalemitter=fr,l.history=N,l.initRequest=ac,l.isArrayChange=js,l.kebabToCamelCase=Sc,l.light=gi,l.logger=rc,l.matchPath=Ji,l.mathml=Yc,l.mediaQuery=Ol,l.memo=pi,l.mounted=Jt,l.numattribute=hr,l.objectMapToString=wn,l.part=mi,l.partMap=wc,l.post=Il,l.property=U,l.put=Hl,l.randomStr=Sn,l.raw=$n,l.repeat=ph,l.request=Al,l.setEngine=oi,l.shadow=bt,l.slot=_r,l.splice=oc,l.state=Re,l.styleMap=yc,l.styled=$c,l.svg=Jc,l.template=Rt,l.titleStore=kt,l.unmounted=lr,l.version=Rr,l.willMount=Pn,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})});
|
package/elements/base/gesture.js
CHANGED
|
@@ -41,7 +41,7 @@ function angleAB(a, b, c, { clientX: x1, clientY: y1 }, { clientX: x2, clientY:
|
|
|
41
41
|
}
|
|
42
42
|
const style = css `
|
|
43
43
|
@layer {
|
|
44
|
-
|
|
44
|
+
&:where(:not([hidden])) {
|
|
45
45
|
display: block;
|
|
46
46
|
user-select: none;
|
|
47
47
|
touch-action: attr(touch-action, none);
|
package/elements/base/link.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import type { RouteItem, RouteOptions } from './route';
|
|
|
5
5
|
*/
|
|
6
6
|
export declare class GemLinkElement extends GemElement {
|
|
7
7
|
#private;
|
|
8
|
+
static link: string;
|
|
8
9
|
href: string;
|
|
9
10
|
target: string;
|
|
10
11
|
path: string;
|
|
@@ -18,7 +19,6 @@ export declare class GemLinkElement extends GemElement {
|
|
|
18
19
|
options?: RouteOptions;
|
|
19
20
|
routeOptions?: RouteOptions;
|
|
20
21
|
prepare?: () => void | Promise<void>;
|
|
21
|
-
link: string;
|
|
22
22
|
/**
|
|
23
23
|
* 如果该元素是外部链接返回 URL,否则返回路径(不包含 basePath)
|
|
24
24
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/elements/base/link.ts"],"names":[],"mappings":"AAcA,OAAO,EAAO,UAAU,EAAQ,MAAM,mBAAmB,CAAC;AAG1D,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAuBvD;;GAEG;AACH,qBAIa,cAAe,SAAQ,UAAU;;
|
|
1
|
+
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/elements/base/link.ts"],"names":[],"mappings":"AAcA,OAAO,EAAO,UAAU,EAAQ,MAAM,mBAAmB,CAAC;AAG1D,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAuBvD;;GAEG;AACH,qBAIa,cAAe,SAAQ,UAAU;;IACtC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC;IAEf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,IAAI,GAAG,KAAK,CAAC;IAC9B,4CAA4C;IAC7B,OAAO,EAAE,OAAO,CAAC;IAGtB,KAAK,CAAC,EAAE,SAAS,CAAC;IAC5B,iBAAiB;IACP,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAuF/C;;OAEG;IACH,kBAAkB;CAmBnB;AAED,qBACa,oBAAqB,SAAQ,cAAc;;IAC3C,OAAO,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;CAQxB"}
|
package/elements/base/link.js
CHANGED
|
@@ -63,12 +63,16 @@ const styles = css `
|
|
|
63
63
|
* Bug: [can't print `<link>`](https://github.com/mantou132/gem/issues/36)
|
|
64
64
|
*/
|
|
65
65
|
let GemLinkElement = (() => {
|
|
66
|
+
var _a;
|
|
66
67
|
let _classDecorators = [connectStore(basePathStore), adoptedStyle(styles), shadow(), aria({ focusable: true })];
|
|
67
68
|
let _classDescriptor;
|
|
68
69
|
let _classExtraInitializers = [];
|
|
69
70
|
let _classThis;
|
|
70
71
|
let _classSuper = GemElement;
|
|
71
72
|
let _instanceExtraInitializers = [];
|
|
73
|
+
let _static_link_decorators;
|
|
74
|
+
let _static_link_initializers = [];
|
|
75
|
+
let _static_link_extraInitializers = [];
|
|
72
76
|
let _href_decorators;
|
|
73
77
|
let _href_initializers = [];
|
|
74
78
|
let _href_extraInitializers = [];
|
|
@@ -102,9 +106,6 @@ let GemLinkElement = (() => {
|
|
|
102
106
|
let _prepare_decorators;
|
|
103
107
|
let _prepare_initializers = [];
|
|
104
108
|
let _prepare_extraInitializers = [];
|
|
105
|
-
let _link_decorators;
|
|
106
|
-
let _link_initializers = [];
|
|
107
|
-
let _link_extraInitializers = [];
|
|
108
109
|
let _private_init_decorators;
|
|
109
110
|
let _private_init_descriptor;
|
|
110
111
|
let _private_content_decorators;
|
|
@@ -114,6 +115,7 @@ let GemLinkElement = (() => {
|
|
|
114
115
|
static { _classThis = this; }
|
|
115
116
|
static {
|
|
116
117
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
118
|
+
_static_link_decorators = [part];
|
|
117
119
|
_href_decorators = [attribute];
|
|
118
120
|
_target_decorators = [attribute];
|
|
119
121
|
_path_decorators = [attribute];
|
|
@@ -125,13 +127,13 @@ let GemLinkElement = (() => {
|
|
|
125
127
|
_options_decorators = [property];
|
|
126
128
|
_routeOptions_decorators = [property];
|
|
127
129
|
_prepare_decorators = [property];
|
|
128
|
-
_link_decorators = [part];
|
|
129
130
|
_private_init_decorators = [mounted()];
|
|
130
131
|
_private_content_decorators = [template()];
|
|
131
132
|
__esDecorate(this, _private_init_descriptor = { value: __setFunctionName(function () {
|
|
132
133
|
this.addEventListener('click', this.#onClick);
|
|
133
134
|
this.addEventListener('pointerenter', this.#preload);
|
|
134
135
|
}, "#init") }, _private_init_decorators, { kind: "method", name: "#init", static: false, private: true, access: { has: obj => #init in obj, get: obj => obj.#init }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
136
|
+
__esDecorate(null, null, _static_link_decorators, { kind: "field", name: "link", static: true, private: false, access: { has: obj => "link" in obj, get: obj => obj.link, set: (obj, value) => { obj.link = value; } }, metadata: _metadata }, _static_link_initializers, _static_link_extraInitializers);
|
|
135
137
|
__esDecorate(null, null, _href_decorators, { kind: "field", name: "href", static: false, private: false, access: { has: obj => "href" in obj, get: obj => obj.href, set: (obj, value) => { obj.href = value; } }, metadata: _metadata }, _href_initializers, _href_extraInitializers);
|
|
136
138
|
__esDecorate(null, null, _target_decorators, { kind: "field", name: "target", static: false, private: false, access: { has: obj => "target" in obj, get: obj => obj.target, set: (obj, value) => { obj.target = value; } }, metadata: _metadata }, _target_initializers, _target_extraInitializers);
|
|
137
139
|
__esDecorate(null, null, _path_decorators, { kind: "field", name: "path", static: false, private: false, access: { has: obj => "path" in obj, get: obj => obj.path, set: (obj, value) => { obj.path = value; } }, metadata: _metadata }, _path_initializers, _path_extraInitializers);
|
|
@@ -143,13 +145,12 @@ let GemLinkElement = (() => {
|
|
|
143
145
|
__esDecorate(null, null, _options_decorators, { kind: "field", name: "options", static: false, private: false, access: { has: obj => "options" in obj, get: obj => obj.options, set: (obj, value) => { obj.options = value; } }, metadata: _metadata }, _options_initializers, _options_extraInitializers);
|
|
144
146
|
__esDecorate(null, null, _routeOptions_decorators, { kind: "field", name: "routeOptions", static: false, private: false, access: { has: obj => "routeOptions" in obj, get: obj => obj.routeOptions, set: (obj, value) => { obj.routeOptions = value; } }, metadata: _metadata }, _routeOptions_initializers, _routeOptions_extraInitializers);
|
|
145
147
|
__esDecorate(null, null, _prepare_decorators, { kind: "field", name: "prepare", static: false, private: false, access: { has: obj => "prepare" in obj, get: obj => obj.prepare, set: (obj, value) => { obj.prepare = value; } }, metadata: _metadata }, _prepare_initializers, _prepare_extraInitializers);
|
|
146
|
-
__esDecorate(null, null, _link_decorators, { kind: "field", name: "link", static: false, private: false, access: { has: obj => "link" in obj, get: obj => obj.link, set: (obj, value) => { obj.link = value; } }, metadata: _metadata }, _link_initializers, _link_extraInitializers);
|
|
147
148
|
__esDecorate(null, null, _private_content_decorators, { kind: "field", name: "#content", static: false, private: true, access: { has: obj => #content in obj, get: obj => obj.#content, set: (obj, value) => { obj.#content = value; } }, metadata: _metadata }, _private_content_initializers, _private_content_extraInitializers);
|
|
148
149
|
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
149
150
|
GemLinkElement = _classThis = _classDescriptor.value;
|
|
150
151
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
151
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
152
152
|
}
|
|
153
|
+
static link = __runInitializers(_classThis, _static_link_initializers, void 0);
|
|
153
154
|
href = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _href_initializers, void 0));
|
|
154
155
|
target = (__runInitializers(this, _href_extraInitializers), __runInitializers(this, _target_initializers, void 0));
|
|
155
156
|
path = (__runInitializers(this, _target_extraInitializers), __runInitializers(this, _path_initializers, void 0));
|
|
@@ -164,14 +165,13 @@ let GemLinkElement = (() => {
|
|
|
164
165
|
options = (__runInitializers(this, _route_extraInitializers), __runInitializers(this, _options_initializers, void 0));
|
|
165
166
|
routeOptions = (__runInitializers(this, _options_extraInitializers), __runInitializers(this, _routeOptions_initializers, void 0));
|
|
166
167
|
prepare = (__runInitializers(this, _routeOptions_extraInitializers), __runInitializers(this, _prepare_initializers, void 0));
|
|
167
|
-
link = (__runInitializers(this, _prepare_extraInitializers), __runInitializers(this, _link_initializers, void 0));
|
|
168
168
|
get #routeOptions() {
|
|
169
169
|
return this.routeOptions || this.options;
|
|
170
170
|
}
|
|
171
171
|
get #hint() {
|
|
172
172
|
return this.hint || 'on';
|
|
173
173
|
}
|
|
174
|
-
#onClick = (__runInitializers(this,
|
|
174
|
+
#onClick = (__runInitializers(this, _prepare_extraInitializers), async (e) => {
|
|
175
175
|
e.preventDefault();
|
|
176
176
|
const locationString = this._getLocationString();
|
|
177
177
|
if (!locationString)
|
|
@@ -233,7 +233,7 @@ let GemLinkElement = (() => {
|
|
|
233
233
|
get #init() { return _private_init_descriptor.value; }
|
|
234
234
|
#content = __runInitializers(this, _private_content_initializers, () => {
|
|
235
235
|
const href = this.#hint === 'off' ? null : this.#getHint();
|
|
236
|
-
return html `<a part=${
|
|
236
|
+
return html `<a part=${GemLinkElement.link} href=${href} tabindex="-1"><slot></slot></a>`;
|
|
237
237
|
});
|
|
238
238
|
/**
|
|
239
239
|
* 如果该元素是外部链接返回 URL,否则返回路径(不包含 basePath)
|
|
@@ -265,6 +265,10 @@ let GemLinkElement = (() => {
|
|
|
265
265
|
super(...arguments);
|
|
266
266
|
__runInitializers(this, _private_content_extraInitializers);
|
|
267
267
|
}
|
|
268
|
+
static {
|
|
269
|
+
__runInitializers(_classThis, _static_link_extraInitializers);
|
|
270
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
271
|
+
}
|
|
268
272
|
};
|
|
269
273
|
return GemLinkElement = _classThis;
|
|
270
274
|
})();
|