@mantou/gem 1.7.6 → 1.7.7

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.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- var sn=(o,E,L)=>{if(!E.has(o))throw TypeError("Cannot "+L)};var f=(o,E,L)=>(sn(o,E,"read from private field"),L?L.call(o):E.get(o)),w=(o,E,L)=>{if(E.has(o))throw TypeError("Cannot add the same private member more than once");E instanceof WeakSet?E.add(o):E.set(o,L)},C=(o,E,L,Y)=>(sn(o,E,"write to private field"),Y?Y.call(o,L):E.set(o,L),L);var rn=(o,E,L)=>(sn(o,E,"access private method"),L);(function(o,E){typeof exports=="object"&&typeof module!="undefined"?E(exports):typeof define=="function"&&define.amd?define(["exports"],E):(o=typeof globalThis!="undefined"?globalThis:o||self,E(o.Gem={}))})(this,function(o){var Q,X,re,je,on,Ee,_t,ae,Be,vt,ps,De,qe,Ue,fs,xe,_e,ve,ce,ms,Se,Pt,St,gs,bt,ys,le,Fe,be,Ct;"use strict";var E=Object.freeze(Object.defineProperty({__proto__:null,get GemElement(){return R},get defineAttribute(){return at},get defineProperty(){return pe},get defineRef(){return ct},get defineCSSState(){return lt},get nativeDefineElement(){return ht},get html(){return W},get svg(){return _n},get render(){return ze},get directive(){return Y},get TemplateResult(){return ke},get SVGTemplateResult(){return Lt},get repeat(){return Nn},get guard(){return An},get ifDefined(){return Wt}},Symbol.toStringTag,{value:"Module"}));/**
1
+ var cn=(o,_,k)=>{if(!_.has(o))throw TypeError("Cannot "+k)};var f=(o,_,k)=>(cn(o,_,"read from private field"),k?k.call(o):_.get(o)),E=(o,_,k)=>{if(_.has(o))throw TypeError("Cannot add the same private member more than once");_ instanceof WeakSet?_.add(o):_.set(o,k)},P=(o,_,k,Y)=>(cn(o,_,"write to private field"),Y?Y.call(o,k):_.set(o,k),k);var ln=(o,_,k)=>(cn(o,_,"access private method"),k);(function(o,_){typeof exports=="object"&&typeof module!="undefined"?_(exports):typeof define=="function"&&define.amd?define(["exports"],_):(o=typeof globalThis!="undefined"?globalThis:o||self,_(o.Gem={}))})(this,function(o){var Q,X,ie,je,hn,_e,Pt,ce,Fe,Ct,vs,De,qe,Ue,Es,Be,ve,Se,le,_s,be,$t,Lt,Ss,kt,bs,he,ze,Pe,Tt;"use strict";var _=Object.freeze(Object.defineProperty({__proto__:null,get GemElement(){return M},get defineAttribute(){return ht},get defineProperty(){return ge},get defineRef(){return ut},get defineCSSState(){return dt},get nativeDefineElement(){return ft},get html(){return B},get svg(){return Pn},get render(){return Ke},get directive(){return Y},get TemplateResult(){return ke},get SVGTemplateResult(){return Nt},get repeat(){return Gn},get guard(){return Wn},get ifDefined(){return Dt}},Symbol.toStringTag,{value:"Module"}));/**
2
2
  * @license
3
3
  * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
4
4
  * This code may only be used under the BSD style license found at
@@ -10,7 +10,7 @@ var sn=(o,E,L)=>{if(!E.has(o))throw TypeError("Cannot "+L)};var f=(o,E,L)=>(sn(o
10
10
  * Code distributed by Google as part of the polymer project is also
11
11
  * subject to an additional IP rights grant found at
12
12
  * http://polymer.github.io/PATENTS.txt
13
- */const L=new WeakMap,Y=n=>(...e)=>{const t=n(...e);return L.set(t,!0),t},Pe=n=>typeof n=="function"&&L.has(n);/**
13
+ */const k=new WeakMap,Y=n=>(...e)=>{const t=n(...e);return k.set(t,!0),t},Ce=n=>typeof n=="function"&&k.has(n);/**
14
14
  * @license
15
15
  * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
16
16
  * This code may only be used under the BSD style license found at
@@ -22,7 +22,7 @@ var sn=(o,E,L)=>{if(!E.has(o))throw TypeError("Cannot "+L)};var f=(o,E,L)=>(sn(o
22
22
  * Code distributed by Google as part of the polymer project is also
23
23
  * subject to an additional IP rights grant found at
24
24
  * http://polymer.github.io/PATENTS.txt
25
- */const an=typeof window!="undefined"&&window.customElements!=null&&window.customElements.polyfillWrapFlushCallback!==void 0,cn=(n,e,t=null,s=null)=>{for(;e!==t;){const i=e.nextSibling;n.insertBefore(e,s),e=i}},kt=(n,e,t=null)=>{for(;e!==t;){const s=e.nextSibling;n.removeChild(e),e=s}};/**
25
+ */const un=typeof window!="undefined"&&window.customElements!=null&&window.customElements.polyfillWrapFlushCallback!==void 0,dn=(n,e,t=null,s=null)=>{for(;e!==t;){const i=e.nextSibling;n.insertBefore(e,s),e=i}},Mt=(n,e,t=null)=>{for(;e!==t;){const s=e.nextSibling;n.removeChild(e),e=s}};/**
26
26
  * @license
27
27
  * Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
28
28
  * This code may only be used under the BSD style license found at
@@ -34,7 +34,7 @@ var sn=(o,E,L)=>{if(!E.has(o))throw TypeError("Cannot "+L)};var f=(o,E,L)=>(sn(o
34
34
  * Code distributed by Google as part of the polymer project is also
35
35
  * subject to an additional IP rights grant found at
36
36
  * http://polymer.github.io/PATENTS.txt
37
- */const I={},ln={};/**
37
+ */const W={},fn={};/**
38
38
  * @license
39
39
  * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
40
40
  * This code may only be used under the BSD style license found at
@@ -46,7 +46,7 @@ var sn=(o,E,L)=>{if(!E.has(o))throw TypeError("Cannot "+L)};var f=(o,E,L)=>(sn(o
46
46
  * Code distributed by Google as part of the polymer project is also
47
47
  * subject to an additional IP rights grant found at
48
48
  * http://polymer.github.io/PATENTS.txt
49
- */const Z=`{{lit-${String(Math.random()).slice(2)}}}`,hn=`<!--${Z}-->`,un=new RegExp(`${Z}|${hn}`),Ce="$lit$";class ws{constructor(e,t){this.parts=[],this.element=t;const s=[],i=[],r=document.createTreeWalker(t.content,133,null,!1);let a=0,c=-1,l=0;const{strings:h,values:{length:p}}=e;for(;l<p;){const d=r.nextNode();if(d===null){r.currentNode=i.pop();continue}if(c++,d.nodeType===1){if(d.hasAttributes()){const M=d.attributes,{length:g}=M;let y=0;for(let m=0;m<g;m++)dn(M[m].name,Ce)&&y++;for(;y-- >0;){const m=h[l],S=Tt.exec(m)[2],P=S.toLowerCase()+Ce,x=d.getAttribute(P);d.removeAttribute(P);const H=x.split(un);this.parts.push({type:"attribute",index:c,name:S,strings:H}),l+=H.length-1}}d.tagName==="TEMPLATE"&&(i.push(d),r.currentNode=d.content)}else if(d.nodeType===3){const M=d.data;if(M.indexOf(Z)>=0){const g=d.parentNode,y=M.split(un),m=y.length-1;for(let S=0;S<m;S++){let P,x=y[S];if(x==="")P=B();else{const H=Tt.exec(x);H!==null&&dn(H[2],Ce)&&(x=x.slice(0,H.index)+H[1]+H[2].slice(0,-Ce.length)+H[3]),P=document.createTextNode(x)}g.insertBefore(P,d),this.parts.push({type:"node",index:++c})}y[m]===""?(g.insertBefore(B(),d),s.push(d)):d.data=y[m],l+=m}}else if(d.nodeType===8)if(d.data===Z){const M=d.parentNode;(d.previousSibling===null||c===a)&&(c++,M.insertBefore(B(),d)),a=c,this.parts.push({type:"node",index:c}),d.nextSibling===null?d.data="":(s.push(d),c--),l++}else{let M=-1;for(;(M=d.data.indexOf(Z,M+1))!==-1;)this.parts.push({type:"node",index:-1}),l++}}for(const d of s)d.parentNode.removeChild(d)}}const dn=(n,e)=>{const t=n.length-e.length;return t>=0&&n.slice(t)===e},Es=n=>n.index!==-1,B=()=>document.createComment(""),Tt=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;/**
49
+ */const Z=`{{lit-${String(Math.random()).slice(2)}}}`,mn=`<!--${Z}-->`,pn=new RegExp(`${Z}|${mn}`),Le="$lit$";class Ps{constructor(e,t){this.parts=[],this.element=t;const s=[],i=[],r=document.createTreeWalker(t.content,133,null,!1);let a=0,c=-1,l=0;const{strings:h,values:{length:p}}=e;for(;l<p;){const d=r.nextNode();if(d===null){r.currentNode=i.pop();continue}if(c++,d.nodeType===1){if(d.hasAttributes()){const T=d.attributes,{length:g}=T;let y=0;for(let m=0;m<g;m++)gn(T[m].name,Le)&&y++;for(;y-- >0;){const m=h[l],S=Rt.exec(m)[2],b=S.toLowerCase()+Le,q=d.getAttribute(b);d.removeAttribute(b);const G=q.split(pn);this.parts.push({type:"attribute",index:c,name:S,strings:G}),l+=G.length-1}}d.tagName==="TEMPLATE"&&(i.push(d),r.currentNode=d.content)}else if(d.nodeType===3){const T=d.data;if(T.indexOf(Z)>=0){const g=d.parentNode,y=T.split(pn),m=y.length-1;for(let S=0;S<m;S++){let b,q=y[S];if(q==="")b=U();else{const G=Rt.exec(q);G!==null&&gn(G[2],Le)&&(q=q.slice(0,G.index)+G[1]+G[2].slice(0,-Le.length)+G[3]),b=document.createTextNode(q)}g.insertBefore(b,d),this.parts.push({type:"node",index:++c})}y[m]===""?(g.insertBefore(U(),d),s.push(d)):d.data=y[m],l+=m}}else if(d.nodeType===8)if(d.data===Z){const T=d.parentNode;(d.previousSibling===null||c===a)&&(c++,T.insertBefore(U(),d)),a=c,this.parts.push({type:"node",index:c}),d.nextSibling===null?d.data="":(s.push(d),c--),l++}else{let T=-1;for(;(T=d.data.indexOf(Z,T+1))!==-1;)this.parts.push({type:"node",index:-1}),l++}}for(const d of s)d.parentNode.removeChild(d)}}const gn=(n,e)=>{const t=n.length-e.length;return t>=0&&n.slice(t)===e},Cs=n=>n.index!==-1,U=()=>document.createComment(""),Rt=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;/**
50
50
  * @license
51
51
  * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
52
52
  * This code may only be used under the BSD style license found at
@@ -58,7 +58,7 @@ var sn=(o,E,L)=>{if(!E.has(o))throw TypeError("Cannot "+L)};var f=(o,E,L)=>(sn(o
58
58
  * Code distributed by Google as part of the polymer project is also
59
59
  * subject to an additional IP rights grant found at
60
60
  * http://polymer.github.io/PATENTS.txt
61
- */class fn{constructor(e,t,s){this.__parts=[],this.template=e,this.processor=t,this.options=s}update(e){let t=0;for(const s of this.__parts)s!==void 0&&s.setValue(e[t]),t++;for(const s of this.__parts)s!==void 0&&s.commit()}_clone(){const e=an?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),t=[],s=this.template.parts,i=document.createTreeWalker(e,133,null,!1);let r=0,a=0,c,l=i.nextNode();for(;r<s.length;){if(c=s[r],!Es(c)){this.__parts.push(void 0),r++;continue}for(;a<c.index;)a++,l.nodeName==="TEMPLATE"&&(t.push(l),i.currentNode=l.content),(l=i.nextNode())===null&&(i.currentNode=t.pop(),l=i.nextNode());if(c.type==="node"){const h=this.processor.handleTextExpression(this.options);h.insertAfterNode(l.previousSibling),this.__parts.push(h)}else this.__parts.push(...this.processor.handleAttributeExpressions(l,c.name,c.strings,this.options));r++}return an&&(document.adoptNode(e),customElements.upgrade(e)),e}}/**
61
+ */class yn{constructor(e,t,s){this.__parts=[],this.template=e,this.processor=t,this.options=s}update(e){let t=0;for(const s of this.__parts)s!==void 0&&s.setValue(e[t]),t++;for(const s of this.__parts)s!==void 0&&s.commit()}_clone(){const e=un?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),t=[],s=this.template.parts,i=document.createTreeWalker(e,133,null,!1);let r=0,a=0,c,l=i.nextNode();for(;r<s.length;){if(c=s[r],!Cs(c)){this.__parts.push(void 0),r++;continue}for(;a<c.index;)a++,l.nodeName==="TEMPLATE"&&(t.push(l),i.currentNode=l.content),(l=i.nextNode())===null&&(i.currentNode=t.pop(),l=i.nextNode());if(c.type==="node"){const h=this.processor.handleTextExpression(this.options);h.insertAfterNode(l.previousSibling),this.__parts.push(h)}else this.__parts.push(...this.processor.handleAttributeExpressions(l,c.name,c.strings,this.options));r++}return un&&(document.adoptNode(e),customElements.upgrade(e)),e}}/**
62
62
  * @license
63
63
  * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
64
64
  * This code may only be used under the BSD style license found at
@@ -70,7 +70,7 @@ var sn=(o,E,L)=>{if(!E.has(o))throw TypeError("Cannot "+L)};var f=(o,E,L)=>(sn(o
70
70
  * Code distributed by Google as part of the polymer project is also
71
71
  * subject to an additional IP rights grant found at
72
72
  * http://polymer.github.io/PATENTS.txt
73
- */const mn=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:n=>n}),_s=` ${Z} `;class ke{constructor(e,t,s,i){this.strings=e,this.values=t,this.type=s,this.processor=i}getHTML(){const e=this.strings.length-1;let t="",s=!1;for(let i=0;i<e;i++){const r=this.strings[i],a=r.lastIndexOf("<!--");s=(a>-1||s)&&r.indexOf("-->",a+1)===-1;const c=Tt.exec(r);c===null?t+=r+(s?_s:hn):t+=r.substr(0,c.index)+c[1]+c[2]+Ce+c[3]+Z}return t+=this.strings[e],t}getTemplateElement(){const e=document.createElement("template");let t=this.getHTML();return mn!==void 0&&(t=mn.createHTML(t)),e.innerHTML=t,e}}class Lt extends ke{getHTML(){return`<svg>${super.getHTML()}</svg>`}getTemplateElement(){const e=super.getTemplateElement(),t=e.content,s=t.firstChild;return t.removeChild(s),cn(t,s.firstChild),e}}/**
73
+ */const wn=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:n=>n}),Ls=` ${Z} `;class ke{constructor(e,t,s,i){this.strings=e,this.values=t,this.type=s,this.processor=i}getHTML(){const e=this.strings.length-1;let t="",s=!1;for(let i=0;i<e;i++){const r=this.strings[i],a=r.lastIndexOf("<!--");s=(a>-1||s)&&r.indexOf("-->",a+1)===-1;const c=Rt.exec(r);c===null?t+=r+(s?Ls:mn):t+=r.substr(0,c.index)+c[1]+c[2]+Le+c[3]+Z}return t+=this.strings[e],t}getTemplateElement(){const e=document.createElement("template");let t=this.getHTML();return wn!==void 0&&(t=wn.createHTML(t)),e.innerHTML=t,e}}class Nt extends ke{getHTML(){return`<svg>${super.getHTML()}</svg>`}getTemplateElement(){const e=super.getTemplateElement(),t=e.content,s=t.firstChild;return t.removeChild(s),dn(t,s.firstChild),e}}/**
74
74
  * @license
75
75
  * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
76
76
  * This code may only be used under the BSD style license found at
@@ -82,7 +82,7 @@ var sn=(o,E,L)=>{if(!E.has(o))throw TypeError("Cannot "+L)};var f=(o,E,L)=>(sn(o
82
82
  * Code distributed by Google as part of the polymer project is also
83
83
  * subject to an additional IP rights grant found at
84
84
  * http://polymer.github.io/PATENTS.txt
85
- */const $t=n=>n===null||!(typeof n=="object"||typeof n=="function"),Mt=n=>Array.isArray(n)||!!(n&&n[Symbol.iterator]);class pn{constructor(e,t,s){this.dirty=!0,this.element=e,this.name=t,this.strings=s,this.parts=[];for(let i=0;i<s.length-1;i++)this.parts[i]=this._createPart()}_createPart(){return new Rt(this)}_getValue(){const e=this.strings,t=e.length-1,s=this.parts;if(t===1&&e[0]===""&&e[1]===""){const r=s[0].value;if(typeof r=="symbol")return String(r);if(typeof r=="string"||!Mt(r))return r}let i="";for(let r=0;r<t;r++){i+=e[r];const a=s[r];if(a!==void 0){const c=a.value;if($t(c)||!Mt(c))i+=typeof c=="string"?c:String(c);else for(const l of c)i+=typeof l=="string"?l:String(l)}}return i+=e[t],i}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class Rt{constructor(e){this.value=void 0,this.committer=e}setValue(e){e!==I&&(!$t(e)||e!==this.value)&&(this.value=e,Pe(e)||(this.committer.dirty=!0))}commit(){for(;Pe(this.value);){const e=this.value;this.value=I,e(this)}this.value!==I&&this.committer.commit()}}class he{constructor(e){this.value=void 0,this.__pendingValue=void 0,this.options=e}appendInto(e){this.startNode=e.appendChild(B()),this.endNode=e.appendChild(B())}insertAfterNode(e){this.startNode=e,this.endNode=e.nextSibling}appendIntoPart(e){e.__insert(this.startNode=B()),e.__insert(this.endNode=B())}insertAfterPart(e){e.__insert(this.startNode=B()),this.endNode=e.endNode,e.endNode=this.startNode}setValue(e){this.__pendingValue=e}commit(){if(this.startNode.parentNode===null)return;for(;Pe(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=I,t(this)}const e=this.__pendingValue;e!==I&&($t(e)?e!==this.value&&this.__commitText(e):e instanceof ke?this.__commitTemplateResult(e):e instanceof Node?this.__commitNode(e):Mt(e)?this.__commitIterable(e):e===ln?(this.value=ln,this.clear()):this.__commitText(e))}__insert(e){this.endNode.parentNode.insertBefore(e,this.endNode)}__commitNode(e){this.value!==e&&(this.clear(),this.__insert(e),this.value=e)}__commitText(e){const t=this.startNode.nextSibling;e=e==null?"":e;const s=typeof e=="string"?e:String(e);t===this.endNode.previousSibling&&t.nodeType===3?t.data=s:this.__commitNode(document.createTextNode(s)),this.value=e}__commitTemplateResult(e){const t=this.options.templateFactory(e);if(this.value instanceof fn&&this.value.template===t)this.value.update(e.values);else{const s=new fn(t,e.processor,this.options),i=s._clone();s.update(e.values),this.__commitNode(i),this.value=s}}__commitIterable(e){Array.isArray(this.value)||(this.value=[],this.clear());const t=this.value;let s=0,i;for(const r of e)i=t[s],i===void 0&&(i=new he(this.options),t.push(i),s===0?i.appendIntoPart(this):i.insertAfterPart(t[s-1])),i.setValue(r),i.commit(),s++;s<t.length&&(t.length=s,this.clear(i&&i.endNode))}clear(e=this.startNode){kt(this.startNode.parentNode,e.nextSibling,this.endNode)}}class vs{constructor(e,t,s){if(this.value=void 0,this.__pendingValue=void 0,s.length!==2||s[0]!==""||s[1]!=="")throw new Error("Boolean attributes can only contain a single expression");this.element=e,this.name=t,this.strings=s}setValue(e){this.__pendingValue=e}commit(){for(;Pe(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=I,t(this)}if(this.__pendingValue===I)return;const e=!!this.__pendingValue;this.value!==e&&(e?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=e),this.__pendingValue=I}}class Ss extends pn{constructor(e,t,s){super(e,t,s),this.single=s.length===2&&s[0]===""&&s[1]===""}_createPart(){return new bs(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class bs extends Rt{}let gn=!1;(()=>{try{const n={get capture(){return gn=!0,!1}};window.addEventListener("test",n,n),window.removeEventListener("test",n,n)}catch{}})();class Ps{constructor(e,t,s){this.value=void 0,this.__pendingValue=void 0,this.element=e,this.eventName=t,this.eventContext=s,this.__boundHandleEvent=i=>this.handleEvent(i)}setValue(e){this.__pendingValue=e}commit(){for(;Pe(this.__pendingValue);){const r=this.__pendingValue;this.__pendingValue=I,r(this)}if(this.__pendingValue===I)return;const e=this.__pendingValue,t=this.value,s=e==null||t!=null&&(e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive),i=e!=null&&(t==null||s);s&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),i&&(this.__options=Cs(e),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=e,this.__pendingValue=I}handleEvent(e){typeof this.value=="function"?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}}const Cs=n=>n&&(gn?{capture:n.capture,passive:n.passive,once:n.once}:n.capture);/**
85
+ */const Ot=n=>n===null||!(typeof n=="object"||typeof n=="function"),At=n=>Array.isArray(n)||!!(n&&n[Symbol.iterator]);class En{constructor(e,t,s){this.dirty=!0,this.element=e,this.name=t,this.strings=s,this.parts=[];for(let i=0;i<s.length-1;i++)this.parts[i]=this._createPart()}_createPart(){return new Ht(this)}_getValue(){const e=this.strings,t=e.length-1,s=this.parts;if(t===1&&e[0]===""&&e[1]===""){const r=s[0].value;if(typeof r=="symbol")return String(r);if(typeof r=="string"||!At(r))return r}let i="";for(let r=0;r<t;r++){i+=e[r];const a=s[r];if(a!==void 0){const c=a.value;if(Ot(c)||!At(c))i+=typeof c=="string"?c:String(c);else for(const l of c)i+=typeof l=="string"?l:String(l)}}return i+=e[t],i}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class Ht{constructor(e){this.value=void 0,this.committer=e}setValue(e){e!==W&&(!Ot(e)||e!==this.value)&&(this.value=e,Ce(e)||(this.committer.dirty=!0))}commit(){for(;Ce(this.value);){const e=this.value;this.value=W,e(this)}this.value!==W&&this.committer.commit()}}class ue{constructor(e){this.value=void 0,this.__pendingValue=void 0,this.options=e}appendInto(e){this.startNode=e.appendChild(U()),this.endNode=e.appendChild(U())}insertAfterNode(e){this.startNode=e,this.endNode=e.nextSibling}appendIntoPart(e){e.__insert(this.startNode=U()),e.__insert(this.endNode=U())}insertAfterPart(e){e.__insert(this.startNode=U()),this.endNode=e.endNode,e.endNode=this.startNode}setValue(e){this.__pendingValue=e}commit(){if(this.startNode.parentNode===null)return;for(;Ce(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=W,t(this)}const e=this.__pendingValue;e!==W&&(Ot(e)?e!==this.value&&this.__commitText(e):e instanceof ke?this.__commitTemplateResult(e):e instanceof Node?this.__commitNode(e):At(e)?this.__commitIterable(e):e===fn?(this.value=fn,this.clear()):this.__commitText(e))}__insert(e){this.endNode.parentNode.insertBefore(e,this.endNode)}__commitNode(e){this.value!==e&&(this.clear(),this.__insert(e),this.value=e)}__commitText(e){const t=this.startNode.nextSibling;e=e==null?"":e;const s=typeof e=="string"?e:String(e);t===this.endNode.previousSibling&&t.nodeType===3?t.data=s:this.__commitNode(document.createTextNode(s)),this.value=e}__commitTemplateResult(e){const t=this.options.templateFactory(e);if(this.value instanceof yn&&this.value.template===t)this.value.update(e.values);else{const s=new yn(t,e.processor,this.options),i=s._clone();s.update(e.values),this.__commitNode(i),this.value=s}}__commitIterable(e){Array.isArray(this.value)||(this.value=[],this.clear());const t=this.value;let s=0,i;for(const r of e)i=t[s],i===void 0&&(i=new ue(this.options),t.push(i),s===0?i.appendIntoPart(this):i.insertAfterPart(t[s-1])),i.setValue(r),i.commit(),s++;s<t.length&&(t.length=s,this.clear(i&&i.endNode))}clear(e=this.startNode){Mt(this.startNode.parentNode,e.nextSibling,this.endNode)}}class ks{constructor(e,t,s){if(this.value=void 0,this.__pendingValue=void 0,s.length!==2||s[0]!==""||s[1]!=="")throw new Error("Boolean attributes can only contain a single expression");this.element=e,this.name=t,this.strings=s}setValue(e){this.__pendingValue=e}commit(){for(;Ce(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=W,t(this)}if(this.__pendingValue===W)return;const e=!!this.__pendingValue;this.value!==e&&(e?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=e),this.__pendingValue=W}}class $s extends En{constructor(e,t,s){super(e,t,s),this.single=s.length===2&&s[0]===""&&s[1]===""}_createPart(){return new Ts(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class Ts extends Ht{}let _n=!1;(()=>{try{const n={get capture(){return _n=!0,!1}};window.addEventListener("test",n,n),window.removeEventListener("test",n,n)}catch{}})();class Ms{constructor(e,t,s){this.value=void 0,this.__pendingValue=void 0,this.element=e,this.eventName=t,this.eventContext=s,this.__boundHandleEvent=i=>this.handleEvent(i)}setValue(e){this.__pendingValue=e}commit(){for(;Ce(this.__pendingValue);){const r=this.__pendingValue;this.__pendingValue=W,r(this)}if(this.__pendingValue===W)return;const e=this.__pendingValue,t=this.value,s=e==null||t!=null&&(e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive),i=e!=null&&(t==null||s);s&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),i&&(this.__options=Rs(e),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=e,this.__pendingValue=W}handleEvent(e){typeof this.value=="function"?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}}const Rs=n=>n&&(_n?{capture:n.capture,passive:n.passive,once:n.once}:n.capture);/**
86
86
  * @license
87
87
  * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
88
88
  * This code may only be used under the BSD style license found at
@@ -94,7 +94,7 @@ var sn=(o,E,L)=>{if(!E.has(o))throw TypeError("Cannot "+L)};var f=(o,E,L)=>(sn(o
94
94
  * Code distributed by Google as part of the polymer project is also
95
95
  * subject to an additional IP rights grant found at
96
96
  * http://polymer.github.io/PATENTS.txt
97
- */class ks{handleAttributeExpressions(e,t,s,i){const r=t[0];return r==="."?new Ss(e,t.slice(1),s).parts:r==="@"?[new Ps(e,t.slice(1),i.eventContext)]:r==="?"?[new vs(e,t.slice(1),s)]:new pn(e,t,s).parts}handleTextExpression(e){return new he(e)}}const yn=new ks;/**
97
+ */class Ns{handleAttributeExpressions(e,t,s,i){const r=t[0];return r==="."?new $s(e,t.slice(1),s).parts:r==="@"?[new Ms(e,t.slice(1),i.eventContext)]:r==="?"?[new ks(e,t.slice(1),s)]:new En(e,t,s).parts}handleTextExpression(e){return new ue(e)}}const vn=new Ns;/**
98
98
  * @license
99
99
  * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
100
100
  * This code may only be used under the BSD style license found at
@@ -106,7 +106,7 @@ var sn=(o,E,L)=>{if(!E.has(o))throw TypeError("Cannot "+L)};var f=(o,E,L)=>(sn(o
106
106
  * Code distributed by Google as part of the polymer project is also
107
107
  * subject to an additional IP rights grant found at
108
108
  * http://polymer.github.io/PATENTS.txt
109
- */function Ts(n){let e=wn.get(n.type);e===void 0&&(e={stringsArray:new WeakMap,keyString:new Map},wn.set(n.type,e));let t=e.stringsArray.get(n.strings);if(t!==void 0)return t;const s=n.strings.join(Z);return t=e.keyString.get(s),t===void 0&&(t=new ws(n,n.getTemplateElement()),e.keyString.set(s,t)),e.stringsArray.set(n.strings,t),t}const wn=new Map;/**
109
+ */function Os(n){let e=Sn.get(n.type);e===void 0&&(e={stringsArray:new WeakMap,keyString:new Map},Sn.set(n.type,e));let t=e.stringsArray.get(n.strings);if(t!==void 0)return t;const s=n.strings.join(Z);return t=e.keyString.get(s),t===void 0&&(t=new Ps(n,n.getTemplateElement()),e.keyString.set(s,t)),e.stringsArray.set(n.strings,t),t}const Sn=new Map;/**
110
110
  * @license
111
111
  * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
112
112
  * This code may only be used under the BSD style license found at
@@ -118,7 +118,7 @@ var sn=(o,E,L)=>{if(!E.has(o))throw TypeError("Cannot "+L)};var f=(o,E,L)=>(sn(o
118
118
  * Code distributed by Google as part of the polymer project is also
119
119
  * subject to an additional IP rights grant found at
120
120
  * http://polymer.github.io/PATENTS.txt
121
- */const En=new WeakMap,ze=(n,e,t)=>{let s=En.get(e);s===void 0&&(kt(e,e.firstChild),En.set(e,s=new he(Object.assign({templateFactory:Ts},t))),s.appendInto(e)),s.setValue(n),s.commit()};/**
121
+ */const bn=new WeakMap,Ke=(n,e,t)=>{let s=bn.get(e);s===void 0&&(Mt(e,e.firstChild),bn.set(e,s=new ue(Object.assign({templateFactory:Os},t))),s.appendInto(e)),s.setValue(n),s.commit()};/**
122
122
  * @license
123
123
  * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
124
124
  * This code may only be used under the BSD style license found at
@@ -130,8 +130,8 @@ var sn=(o,E,L)=>{if(!E.has(o))throw TypeError("Cannot "+L)};var f=(o,E,L)=>(sn(o
130
130
  * Code distributed by Google as part of the polymer project is also
131
131
  * subject to an additional IP rights grant found at
132
132
  * http://polymer.github.io/PATENTS.txt
133
- */typeof window!="undefined"&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.4.1");const W=(n,...e)=>new ke(n,e,"html",yn),_n=(n,...e)=>new Lt(n,e,"svg",yn),Te=new Set;function V(n){typeof n=="function"&&(Te.size||globalThis.queueMicrotask(()=>{Te.forEach(e=>e()),Te.clear()}),Te.delete(n),Te.add(n))}const Le=[];function Ls(){for(let n=Le.length-1;n>=0;n--)Le[n]();Le.length=0}function $s(n){Le.length||V(Ls),Le.push(n)}function Ot(n="",e=""){const{pathname:t,search:s,hash:i}=new URL(e,location.origin+n);return t+s+i}class vn extends EventTarget{constructor(){super(...arguments);w(this,je);w(this,Q,void 0);w(this,X,void 0);w(this,re,void 0);C(this,Q,new Map)}get size(){return f(this,Q).size}get first(){return f(this,X)}get last(){return f(this,re)}isSuperLinkOf(t){let s=t.first;if(!s)return!0;let i=this.find(s.value);for(;i&&i.value===s.value;){if(s=s.next,!s)return!0;i=i.next}return!1}find(t){return f(this,Q).get(t)}add(t){f(this,re)||this.dispatchEvent(new CustomEvent("start"));const s=rn(this,je,on).call(this,t)||{value:t};s.prev=f(this,re),s.prev&&(s.prev.next=s),s.next=void 0,C(this,re,s),f(this,X)||C(this,X,s),f(this,Q).set(t,s)}delete(t){const s=rn(this,je,on).call(this,t);return f(this,X)||this.dispatchEvent(new CustomEvent("end")),s}get(){const t=f(this,X);if(!!t)return this.delete(t.value),t.value}}Q=new WeakMap,X=new WeakMap,re=new WeakMap,je=new WeakSet,on=function(t){const s=f(this,Q).get(t);return s&&(s.prev?s.prev.next=s.next:C(this,X,s.next),s.next?s.next.prev=s.prev:C(this,re,s.prev),f(this,Q).delete(t)),s};class Sn extends WeakMap{get(e){let t=super.get(e);return t||(t={},this.set(e,t)),t}}class $e extends URLSearchParams{constructor(t){super(t);w(this,Ee,t=>typeof t=="string"?t:JSON.stringify(t));w(this,_t,t=>{if(!t)return null;try{return JSON.parse(t)}catch{return null}})}concat(t){let s;typeof t=="string"?s=Object.fromEntries(new URLSearchParams(t).entries()):s=t,Object.entries(s).forEach(([i,r])=>{this.append(i,f(this,Ee).call(this,r))})}setAny(t,s){if(Array.isArray(s))this.delete(t),s.forEach(i=>this.append(t,f(this,Ee).call(this,i)));else{const i=f(this,Ee).call(this,s);i?this.set(t,i):this.delete(t)}}getAny(t){return this.getAnyAll(t)[0]}getAnyAll(t){return this.getAll(t).filter(s=>s!=="").map(s=>f(this,_t).call(this,s))}toString(){const t=super.toString();return t?`?${t}`:""}toJSON(){return this.toString()}}Ee=new WeakMap,_t=new WeakMap;function Me(n,...e){return n.reduce((t,s,i)=>{var r;return t+((r=e[i-1])!=null?r:"")+s})}function Ms(n,...e){return Me(n,...e)}const Nt=Symbol.for("gem@sheetToken");function Rs(n,e=""){const t=new CSSStyleSheet,s={};t.media.mediaText=e;let i="";return typeof n=="string"?i=n:Object.keys(n).forEach(r=>{s[r]=`${r}-${Ke()}`,i+=n[r].styledContent.replace(/&/g,s[r])}),t.replaceSync(i),s[Nt]=t,s}function Ke(n=5,e="0123456789abcdefghijklmnopqrstuvwxyz"){const t=e.length;let s="";for(let i=0;i<n;i++)s+=e[Math.floor(Math.random()*t)];return s}const Os=new RegExp(`&.*{((.|
134
- )*)}`,"g");function bn(n,e){const t=[];let s=`& {${n.replace(Os,i=>(t.push(i),""))}}`+t.join("");return s=s.replace(/&/g,e==="class"?".&":"#&"),{styledContent:s,type:e}}const Ns={class:(n,...e)=>{const t=Me(n,...e);return bn(t,"class")},id:(n,...e)=>{const t=Me(n,...e);return bn(t,"id")},keyframes:(n,...e)=>({styledContent:`@keyframes & {${Me(n,...e)}}`,type:"keyframes"})};function j(n){return n.replace(/[A-Z]/g,e=>"-"+e.toLowerCase())}function ee(n){return n.replace(/-(.)/g,(e,t)=>t.toUpperCase())}function Je(n){return Object.keys(n).forEach(e=>{const t=e;delete n[t]}),n}class z extends Error{constructor(e){super(e),this.message=`gem: ${this.message}`}}function Pn(n,e){const t=n.length;if(e.length!==t)return!0;for(let s=0;s<t;s++)if(n[s]!==e[s])return!0;return!1}function Cn(n,e){const t=new Set(e);return n.filter(s=>t.has(s)?(t.delete(s),!1):!0)}function Qe(n,e,t){let s=e;for(const i in n){const r=t(i,n[i]);s+=r?r+e:""}return s}function As(n){return Qe(n,";",(e,t)=>t!=null?`${j(e)}:${t}`:"")}function kn(n){return Qe(n," ",(e,t)=>t?e:"")}const Gs=kn;function Hs(n){return Qe(n,",",(e,t)=>t===!0||e===t?e:t?`${e}:${t}`:"")}const ue=new WeakMap;function K(n){if(ue.has(n))throw new z("argument error");return ue.set(n,new Set),n}function Is(n){return Object.keys(n).forEach(t=>{K(n[t])}),n}function k(n,e){Object.assign(n,e);const t=ue.get(n);t==null||t.forEach(s=>{V(s)})}function de(n,e){const t=ue.get(n);t==null||t.add(e)}function Tn(n,e){const t=ue.get(n);t==null||t.delete(e)}const Ln="1.7.6";var Ws=Object.freeze(Object.defineProperty({__proto__:null,version:Ln},Symbol.toStringTag,{value:"Module"}));/**
133
+ */typeof window!="undefined"&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.4.1");const B=(n,...e)=>new ke(n,e,"html",vn),Pn=(n,...e)=>new Nt(n,e,"svg",vn),$e=new Set;function I(n){typeof n=="function"&&($e.size||globalThis.queueMicrotask(()=>{$e.forEach(e=>e()),$e.clear()}),$e.delete(n),$e.add(n))}const Te=[];function As(){for(let n=Te.length-1;n>=0;n--)Te[n]();Te.length=0}function Hs(n){Te.length||I(As),Te.push(n)}function Gt(n="",e=""){const{pathname:t,search:s,hash:i}=new URL(e,location.origin+n);return t+s+i}class Cn extends EventTarget{constructor(){super(...arguments);E(this,je);E(this,Q,void 0);E(this,X,void 0);E(this,ie,void 0);P(this,Q,new Map)}get size(){return f(this,Q).size}get first(){return f(this,X)}get last(){return f(this,ie)}isSuperLinkOf(t){let s=t.first;if(!s)return!0;let i=this.find(s.value);for(;i&&i.value===s.value;){if(s=s.next,!s)return!0;i=i.next}return!1}find(t){return f(this,Q).get(t)}add(t){f(this,ie)||this.dispatchEvent(new CustomEvent("start"));const s=ln(this,je,hn).call(this,t)||{value:t};s.prev=f(this,ie),s.prev&&(s.prev.next=s),s.next=void 0,P(this,ie,s),f(this,X)||P(this,X,s),f(this,Q).set(t,s)}delete(t){const s=ln(this,je,hn).call(this,t);return f(this,X)||this.dispatchEvent(new CustomEvent("end")),s}get(){const t=f(this,X);if(!!t)return this.delete(t.value),t.value}}Q=new WeakMap,X=new WeakMap,ie=new WeakMap,je=new WeakSet,hn=function(t){const s=f(this,Q).get(t);return s&&(s.prev?s.prev.next=s.next:P(this,X,s.next),s.next?s.next.prev=s.prev:P(this,ie,s.prev),f(this,Q).delete(t)),s};class Ln extends WeakMap{get(e){let t=super.get(e);return t||(t={},this.set(e,t)),t}}class Me extends URLSearchParams{constructor(t){super(t);E(this,_e,t=>typeof t=="string"?t:JSON.stringify(t));E(this,Pt,t=>{if(!t)return null;try{return JSON.parse(t)}catch{return null}})}concat(t){let s;typeof t=="string"?s=Object.fromEntries(new URLSearchParams(t).entries()):s=t,Object.entries(s).forEach(([i,r])=>{this.append(i,f(this,_e).call(this,r))})}setAny(t,s){if(Array.isArray(s))this.delete(t),s.forEach(i=>this.append(t,f(this,_e).call(this,i)));else{const i=f(this,_e).call(this,s);i?this.set(t,i):this.delete(t)}}getAny(t){return this.getAnyAll(t)[0]}getAnyAll(t){return this.getAll(t).filter(s=>s!=="").map(s=>f(this,Pt).call(this,s))}toString(){const t=super.toString();return t?`?${t}`:""}toJSON(){return this.toString()}}_e=new WeakMap,Pt=new WeakMap;function Re(n,...e){return n.reduce((t,s,i)=>{var r;return t+((r=e[i-1])!=null?r:"")+s})}function Gs(n,...e){return Re(n,...e)}const Wt=Symbol.for("gem@sheetToken");function Ws(n,e=""){const t=new CSSStyleSheet,s={};t.media.mediaText=e;let i="";return typeof n=="string"?i=n:Object.keys(n).forEach(r=>{s[r]=`${r}-${Je()}`,i+=n[r].styledContent.replace(/&/g,s[r])}),t.replaceSync(i),s[Wt]=t,s}function Je(n=5,e="0123456789abcdefghijklmnopqrstuvwxyz"){const t=e.length;let s="";for(let i=0;i<n;i++)s+=e[Math.floor(Math.random()*t)];return s}const Is=new RegExp(`&.*{((.|
134
+ )*)}`,"g");function kn(n,e){const t=[];let s=`& {${n.replace(Is,i=>(t.push(i),""))}}`+t.join("");return s=s.replace(/&/g,e==="class"?".&":"#&"),{styledContent:s,type:e}}const Vs={class:(n,...e)=>{const t=Re(n,...e);return kn(t,"class")},id:(n,...e)=>{const t=Re(n,...e);return kn(t,"id")},keyframes:(n,...e)=>({styledContent:`@keyframes & {${Re(n,...e)}}`,type:"keyframes"})};function V(n){return n.replace(/[A-Z]/g,e=>"-"+e.toLowerCase())}function ee(n){return n.replace(/-(.)/g,(e,t)=>t.toUpperCase())}function Qe(n){return Object.keys(n).forEach(e=>{const t=e;delete n[t]}),n}class z extends Error{constructor(e){super(e),this.message=`gem: ${this.message}`}}function $n(n,e){const t=n.length;if(e.length!==t)return!0;for(let s=0;s<t;s++)if(n[s]!==e[s])return!0;return!1}function Tn(n,e){const t=new Set(e);return n.filter(s=>t.has(s)?(t.delete(s),!1):!0)}function Xe(n,e,t){let s=e;for(const i in n){const r=t(i,n[i]);s+=r?r+e:""}return s}function xs(n){return Xe(n,";",(e,t)=>t!=null?`${V(e)}:${t}`:"")}function Mn(n){return Xe(n," ",(e,t)=>t?e:"")}const js=Mn;function Ds(n){return Xe(n,",",(e,t)=>t===!0||e===t?e:t?`${e}:${t}`:"")}const de=new WeakMap;function fe(n){if(de.has(n))throw new z("argument error");return de.set(n,new Set),n}function K(n,e){var t;Object.assign(n,e),(t=de.get(n))==null||t.forEach(s=>{I(s)})}function Ye(n){const e=fe(n);return[e,t=>K(e,t)]}function re(n,e){const t=de.get(n);return t==null||t.add(e),()=>t==null?void 0:t.delete(e)}function qs(n,e){const t=de.get(n);t==null||t.delete(e)}const Rn="1.7.7";var Us=Object.freeze(Object.defineProperty({__proto__:null,version:Rn},Symbol.toStringTag,{value:"Module"}));/**
135
135
  * @license
136
136
  * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
137
137
  * This code may only be used under the BSD style license found at
@@ -143,7 +143,7 @@ var sn=(o,E,L)=>{if(!E.has(o))throw TypeError("Cannot "+L)};var f=(o,E,L)=>(sn(o
143
143
  * Code distributed by Google as part of the polymer project is also
144
144
  * subject to an additional IP rights grant found at
145
145
  * http://polymer.github.io/PATENTS.txt
146
- */const $n=(n,e)=>{const t=n.startNode.parentNode,s=e===void 0?n.endNode:e.startNode,i=t.insertBefore(B(),s);t.insertBefore(B(),s);const r=new he(n.options);return r.insertAfterNode(i),r},oe=(n,e)=>(n.setValue(e),n.commit(),n),At=(n,e,t)=>{const s=n.startNode.parentNode,i=t?t.startNode:n.endNode,r=e.endNode.nextSibling;r!==i&&cn(s,e.startNode,r,i)},Gt=n=>{kt(n.startNode.parentNode,n.startNode,n.endNode.nextSibling)},Mn=(n,e,t)=>{const s=new Map;for(let i=e;i<=t;i++)s.set(n[i],i);return s},Rn=new WeakMap,On=new WeakMap,Nn=Y((n,e,t)=>{let s;return t===void 0?t=e:e!==void 0&&(s=e),i=>{if(!(i instanceof he))throw new Error("repeat can only be used in text bindings");const r=Rn.get(i)||[],a=On.get(i)||[],c=[],l=[],h=[];let p=0;for(const P of n)h[p]=s?s(P,p):p,l[p]=t(P,p),p++;let d,M,g=0,y=r.length-1,m=0,S=l.length-1;for(;g<=y&&m<=S;)if(r[g]===null)g++;else if(r[y]===null)y--;else if(a[g]===h[m])c[m]=oe(r[g],l[m]),g++,m++;else if(a[y]===h[S])c[S]=oe(r[y],l[S]),y--,S--;else if(a[g]===h[S])c[S]=oe(r[g],l[S]),At(i,r[g],c[S+1]),g++,S--;else if(a[y]===h[m])c[m]=oe(r[y],l[m]),At(i,r[y],r[g]),y--,m++;else if(d===void 0&&(d=Mn(h,m,S),M=Mn(a,g,y)),!d.has(a[g]))Gt(r[g]),g++;else if(!d.has(a[y]))Gt(r[y]),y--;else{const P=M.get(h[m]),x=P!==void 0?r[P]:null;if(x===null){const H=$n(i,r[g]);oe(H,l[m]),c[m]=H}else c[m]=oe(x,l[m]),At(i,x,r[g]),r[P]=null;m++}for(;m<=S;){const P=$n(i,c[S+1]);oe(P,l[m]),c[m++]=P}for(;g<=y;){const P=r[g++];P!==null&&Gt(P)}Rn.set(i,c),On.set(i,h)}});/**
146
+ */const Nn=(n,e)=>{const t=n.startNode.parentNode,s=e===void 0?n.endNode:e.startNode,i=t.insertBefore(U(),s);t.insertBefore(U(),s);const r=new ue(n.options);return r.insertAfterNode(i),r},oe=(n,e)=>(n.setValue(e),n.commit(),n),It=(n,e,t)=>{const s=n.startNode.parentNode,i=t?t.startNode:n.endNode,r=e.endNode.nextSibling;r!==i&&dn(s,e.startNode,r,i)},Vt=n=>{Mt(n.startNode.parentNode,n.startNode,n.endNode.nextSibling)},On=(n,e,t)=>{const s=new Map;for(let i=e;i<=t;i++)s.set(n[i],i);return s},An=new WeakMap,Hn=new WeakMap,Gn=Y((n,e,t)=>{let s;return t===void 0?t=e:e!==void 0&&(s=e),i=>{if(!(i instanceof ue))throw new Error("repeat can only be used in text bindings");const r=An.get(i)||[],a=Hn.get(i)||[],c=[],l=[],h=[];let p=0;for(const b of n)h[p]=s?s(b,p):p,l[p]=t(b,p),p++;let d,T,g=0,y=r.length-1,m=0,S=l.length-1;for(;g<=y&&m<=S;)if(r[g]===null)g++;else if(r[y]===null)y--;else if(a[g]===h[m])c[m]=oe(r[g],l[m]),g++,m++;else if(a[y]===h[S])c[S]=oe(r[y],l[S]),y--,S--;else if(a[g]===h[S])c[S]=oe(r[g],l[S]),It(i,r[g],c[S+1]),g++,S--;else if(a[y]===h[m])c[m]=oe(r[y],l[m]),It(i,r[y],r[g]),y--,m++;else if(d===void 0&&(d=On(h,m,S),T=On(a,g,y)),!d.has(a[g]))Vt(r[g]),g++;else if(!d.has(a[y]))Vt(r[y]),y--;else{const b=T.get(h[m]),q=b!==void 0?r[b]:null;if(q===null){const G=Nn(i,r[g]);oe(G,l[m]),c[m]=G}else c[m]=oe(q,l[m]),It(i,q,r[g]),r[b]=null;m++}for(;m<=S;){const b=Nn(i,c[S+1]);oe(b,l[m]),c[m++]=b}for(;g<=y;){const b=r[g++];b!==null&&Vt(b)}An.set(i,c),Hn.set(i,h)}});/**
147
147
  * @license
148
148
  * Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
149
149
  * This code may only be used under the BSD style license found at
@@ -155,7 +155,7 @@ var sn=(o,E,L)=>{if(!E.has(o))throw TypeError("Cannot "+L)};var f=(o,E,L)=>(sn(o
155
155
  * Code distributed by Google as part of the polymer project is also
156
156
  * subject to an additional IP rights grant found at
157
157
  * http://polymer.github.io/PATENTS.txt
158
- */const Ht=new WeakMap,An=Y((n,e)=>t=>{const s=Ht.get(t);if(Array.isArray(n)){if(Array.isArray(s)&&s.length===n.length&&n.every((i,r)=>i===s[r]))return}else if(s===n&&(n!==void 0||Ht.has(t)))return;t.setValue(e()),Ht.set(t,Array.isArray(n)?Array.from(n):n)});/**
158
+ */const xt=new WeakMap,Wn=Y((n,e)=>t=>{const s=xt.get(t);if(Array.isArray(n)){if(Array.isArray(s)&&s.length===n.length&&n.every((i,r)=>i===s[r]))return}else if(s===n&&(n!==void 0||xt.has(t)))return;t.setValue(e()),xt.set(t,Array.isArray(n)?Array.from(n):n)});/**
159
159
  * @license
160
160
  * Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
161
161
  * This code may only be used under the BSD style license found at
@@ -167,15 +167,15 @@ var sn=(o,E,L)=>{if(!E.has(o))throw TypeError("Cannot "+L)};var f=(o,E,L)=>(sn(o
167
167
  * Code distributed by Google as part of the polymer project is also
168
168
  * subject to an additional IP rights grant found at
169
169
  * http://polymer.github.io/PATENTS.txt
170
- */const It=new WeakMap,Wt=Y(n=>e=>{const t=It.get(e);if(n===void 0&&e instanceof Rt){if(t!==void 0||!It.has(e)){const s=e.committer.name;e.committer.element.removeAttribute(s)}}else n!==t&&e.setValue(n);It.set(e,n)});var Gn=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},u=(n,e,t)=>(Gn(n,e,"read from private field"),t?t.call(n):e.get(n)),_=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},A=(n,e,t,s)=>(Gn(n,e,"write to private field"),s?s.call(n,t):e.set(n,t),t),fe,me,te,Re,J,Oe,F,ne,Xe,Ye,Vt,jt,Dt,Ze,qt,et,se,Ut,tt,nt;function Vs(){}function xt(n){typeof n=="function"&&n()}const st=new vn,Bt=(n=performance.now())=>{if(performance.now()>n+16)return requestAnimationFrame(Bt);const e=st.get();e&&(e(),Bt(n))};st.addEventListener("start",()=>V(Bt));const it=Symbol("constructor"),rt=Symbol("init"),Hn=Symbol("update"),Ne=class extends HTMLElement{constructor({isAsync:n,isLight:e,delegatesFocus:t,slotAssignment:s}={}){super(),_(this,me,void 0),_(this,te,void 0),_(this,Re,void 0),_(this,J,void 0),_(this,Oe,void 0),_(this,F,void 0),_(this,ne,void 0),_(this,Xe,void 0),this.setState=r=>{if(!this.state)throw new z("`state` not initialized");Object.assign(this.state,r),V(u(this,se))},_(this,Ye,r=>{r==null||r.forEach(a=>{const{callback:c,getDep:l,values:h,preCallback:p}=a,d=l==null?void 0:l();(!l||!h||Pn(h,d))&&(xt(p),a.preCallback=c(d,h),a.values=d)})}),_(this,Vt,()=>{u(this,Ye).call(this,u(this,F))}),_(this,jt,()=>{u(this,Ye).call(this,u(this,ne))}),this.effect=(r,a)=>{u(this,F)||A(this,F,[]);const c={callback:r,getDep:a,initialized:u(this,J),inConstructor:this[it]};u(this,J)&&(c.values=a==null?void 0:a(),c.preCallback=r(c.values)),u(this,F).push(c)},this.memo=(r,a)=>{u(this,ne)||A(this,ne,[]),u(this,ne).push({callback:r,getDep:a,inConstructor:this[it]})},_(this,Dt,()=>{var r;(r=u(this,F))==null||r.forEach(a=>{const{callback:c,getDep:l,initialized:h}=a;h||(a.values=l==null?void 0:l(),a.preCallback=c(a.values),a.initialized=!0)})}),_(this,Ze,()=>(u(this,jt).call(this),this.render?this.render():u(this,me)===this?void 0:W`<slot></slot>`)),_(this,qt,()=>this.shouldUpdate?this.shouldUpdate():!0),_(this,et,()=>{if(u(this,J)&&u(this,qt).call(this)){const r=u(this,Ze).call(this);r!==void 0&&ze(r,u(this,me)),V(u(this,Ut)),V(u(this,Vt))}}),_(this,se,()=>{u(this,Oe)?st.add(u(this,et)):u(this,et).call(this)}),this.update=()=>{V(u(this,se))},_(this,Ut,()=>{var r;(r=this.updated)==null||r.call(this)}),_(this,tt,()=>{var l,h,p;if(u(this,Re)){A(this,Re,!1);return}Reflect.set(this,it,!1),(l=this.willMount)==null||l.call(this);const{observedStores:r,rootElement:a}=this.constructor;r==null||r.forEach(d=>{de(d,u(this,se))});const c=u(this,Ze).call(this);if(c!==void 0&&ze(c,u(this,me)),A(this,J,!0),A(this,Xe,(h=this.mounted)==null?void 0:h.call(this)),u(this,Dt).call(this),a&&((p=this.getRootNode().host)==null?void 0:p.tagName)!==a.toUpperCase())throw new z("not allow current root type")}),_(this,nt,r=>(r.initialized=!1,r.inConstructor)),V(()=>Reflect.set(this,rt,!1)),Reflect.set(this,it,!0),Reflect.set(this,rt,!0),Reflect.set(this,Hn,()=>{u(this,J)&&V(u(this,se))}),A(this,Oe,n),A(this,me,e?this:this.attachShadow({mode:"open",delegatesFocus:t,slotAssignment:s}));const{adoptedStyleSheets:i}=new.target;if(i){const r=i.map(a=>a[Nt]||a);this.shadowRoot?this.shadowRoot.adoptedStyleSheets=r:this.effect(()=>{const a=this.getRootNode();return a.adoptedStyleSheets=[...a.adoptedStyleSheets,...r],()=>{a.adoptedStyleSheets=Cn(a.adoptedStyleSheets,r)}},()=>[])}}get internals(){if(!u(this,te)){A(this,te,this.attachInternals());try{u(this,te).states.add("foo"),u(this,te).states.delete("foo")}catch{Reflect.defineProperty(u(this,te),"states",{value:{has:n=>ee(n)in this.dataset,add:n=>this.dataset[ee(n)]="",delete:n=>delete this.dataset[ee(n)]}})}}return u(this,te)}attributeChangedCallback(){return u(this,J)&&V(u(this,se)),u(Ne,fe)}closestElement(n){const e=typeof n=="function",t=typeof n=="string"&&n.toUpperCase(),s=i=>{const r=i.parentElement||i.getRootNode().host;if(!r)return null;if(e){if(r.constructor===n)return r}else if(r.tagName===t)return r;return s(r)};return s(this)}connectedCallback(){return u(this,Oe)?st.add(u(this,tt)):u(this,tt).call(this),u(Ne,fe)}adoptedCallback(){return u(Ne,fe)}disconnectedCallback(){var e,t,s,i;if(this.isConnected){A(this,Re,!0);return}A(this,J,!1);const{observedStores:n}=this.constructor;return n==null||n.forEach(r=>{Tn(r,u(this,se))}),xt(u(this,Xe)),(e=this.unmounted)==null||e.call(this),(t=u(this,F))==null||t.forEach(({preCallback:r})=>xt(r)),A(this,F,(s=u(this,F))==null?void 0:s.filter(u(this,nt))),A(this,ne,(i=u(this,ne))==null?void 0:i.filter(u(this,nt))),u(Ne,fe)}};let R=Ne;fe=new WeakMap,me=new WeakMap,te=new WeakMap,Re=new WeakMap,J=new WeakMap,Oe=new WeakMap,F=new WeakMap,ne=new WeakMap,Xe=new WeakMap,Ye=new WeakMap,Vt=new WeakMap,jt=new WeakMap,Dt=new WeakMap,Ze=new WeakMap,qt=new WeakMap,et=new WeakMap,se=new WeakMap,Ut=new WeakMap,tt=new WeakMap,nt=new WeakMap,_(R,fe,Symbol());const ot=new Sn;function at(n,e,t){const{booleanAttributes:s,numberAttributes:i}=n.constructor;Object.defineProperty(n,e,{configurable:!0,get(){if(!(rt in this))return;const a=this.getAttribute(t);return s!=null&&s.has(t)?a!==null:i!=null&&i.has(t)?Number(a):a||""},set(r){const a=this,c=ot.get(this),l=c[e],h=a.getAttribute(t);if(this[rt]&&h!==null&&!l)return;c[e]=!0;const p=s==null?void 0:s.has(t);r==null?a.removeAttribute(t):p?a.toggleAttribute(t,!!r):h!==String(r)&&a.setAttribute(t,String(r))}})}const In=Symbol("event handle");function pe(n,e,t,s){Object.defineProperty(n,e,{configurable:!0,get(){const i=ot.get(this)[e];return i||!t?i:(this[e]=Vs,this[e])},set(i){const r=this,a=ot.get(r);i!==a[e]&&(t?(a[e]=i!=null&&i[In]?i:(c,l)=>{const h=new CustomEvent(t,{...l,...s,detail:c});r.dispatchEvent(h),i(c,l)},Reflect.set(a[e],In,!0)):(a[e]=i,this[Hn]()))}})}function ct(n,e,t){Object.defineProperty(n,e,{configurable:!0,get(){const s=ot.get(this);let i=s[e];if(!i){const r=this,a=r.shadowRoot||r;i={get ref(){return t},get element(){const c=[...a.querySelectorAll("[data-gem-reflect]")].map(l=>l.target);for(const l of[a,...c]){const h=l.querySelector(`[ref=${t}]`);if(h)return h}}},s[e]=i}return i}})}function lt(n,e,t){Object.defineProperty(n,e,{configurable:!0,get(){const s=this,{states:i}=s.internals;return i==null?void 0:i.has(t)},set(s){const i=this,{states:r}=i.internals;s?r==null||r.add(t):r==null||r.delete(t)}})}const ht=customElements.define.bind(customElements);customElements.define=(n,e,t)=>{if(e.prototype instanceof R){const{observedAttributes:s,observedProperties:i,defineEvents:r,defineCSSStates:a,defineRefs:c}=e;s==null||s.forEach(l=>at(e.prototype,ee(l),l)),i==null||i.forEach(l=>pe(e.prototype,l)),r==null||r.forEach(l=>pe(e.prototype,ee(l),l)),a==null||a.forEach(l=>lt(e.prototype,ee(l),l)),c==null||c.forEach(l=>ct(e.prototype,ee(l),l))}ht(n,e,t)},window.__GEM_DEVTOOLS__HOOK__&&Object.assign(window.__GEM_DEVTOOLS__HOOK__,{...E,...Ws});function D(n,e,t,s=!1){const i=n.constructor,r=i[e];i.hasOwnProperty(e)||Object.defineProperty(i,e,{value:s?new Set(r):r?Array.from(r):[]}),i[e][s?"add":"push"](t)}function js(n,e){const t=`${j(e)}-${Ke()}`;D(n,"defineRefs",t),ct(n,e,t)}function Ft(n,e,t){D(n,"observedAttributes",t),at(n,e,t)}function $(n,e){Ft(n,e,j(e))}function Wn(n,e){const t=j(e);D(n,"booleanAttributes",t,!0),Ft(n,e,t)}function Ds(n,e){const t=j(e);D(n,"numberAttributes",t,!0),Ft(n,e,t)}function q(n,e){D(n,"observedProperties",e),pe(n,e)}function ut(n,e){const t=j(e);D(n,"defineCSSStates",t),lt(n,e,t)}function qs(n,e){const t=j(n[e]||e);n[e]=t,D(n instanceof R?n:n.prototype,"defineSlots",t)}function Vn(n,e){const t=j(n[e]||e);n[e]=t,D(n instanceof R?n:n.prototype,"defineParts",t)}function dt(n,e){jn(n,e)}function Us(n,e){jn(n,e,{bubbles:!0,composed:!0})}function jn(n,e,t){const s=j(e);D(n,"defineEvents",s),pe(n,e,s,t)}function xs(n){return function(e){D(e.prototype,"adoptedStyleSheets",n)}}function ge(n){return function(e){D(e.prototype,"observedStores",n)}}function Bs(n){return function(e){const t=e;t.rootElement=n}}function Fs(n){return function(e){ht(n,e)}}const G=window.history,Dn=G.pushState.bind(G),qn=G.replaceState.bind(G);let zs=0;const zt=()=>`${performance.now()}-${++zs}`,b=K({$hasCloseHandle:!1,$hasOpenHandle:!1,$hasShouldCloseHandle:!1,$key:""}),O=new Map;function Un(n){const{$key:e,$hasCloseHandle:t,$hasOpenHandle:s,$hasShouldCloseHandle:i}=n||{};if(b.$key!==e){if(e)throw new z("`$key` is not allowed");if(t)throw new z("`$hasCloseHandle` is not allowed");if(s)throw new z("`$hasOpenHandle` is not allowed");if(i)throw new z("`$hasShouldCloseHandle` is not allowed")}}function xn(n){return U.basePath?U.basePath+n:n}function Bn(n){return n===U.basePath?"/":n.replace(new RegExp(`^${U.basePath}/`),"/")}function ft(n){const e=O.get(b.$key)||{},t=n.path?Ot(e.path,n.path):Bn(location.pathname),s=new $e(n.query||(n.path?"":location.search)),i=n.path&&n.path!==e.path||n.query&&String(n.query)!==String(e.query),r=n.title||(i?"":document.title),a=n.close||n.data||n.open||n.shouldClose,c=n.hash||(!i&&a?decodeURIComponent(location.hash):"");return{...n,title:r,path:t,query:s,hash:c}}function Fn(n,e){Un(n.data);const t=ft(n),{title:s,path:i,query:r,hash:a,close:c,open:l,shouldClose:h,data:p}=t,d={$hasCloseHandle:!!c,$hasOpenHandle:!!l,$hasShouldCloseHandle:!!h,$key:zt(),...p};O.set(d.$key,t),k(Je(b),d);const M=xn(i)+new $e(r)+a,g=decodeURIComponent(location.hash);e(d,s,M),g!==a&&window.dispatchEvent(new CustomEvent("hashchange"))}function zn(n,e,t,s){Un(n);const i={$key:zt(),...n||{}},{pathname:r,search:a,hash:c}=new URL(t,location.origin+location.pathname),l=ft({path:r,query:new $e(a),hash:c,title:e,data:n});O.set(i.$key,l),k(Je(b),i);const h=xn(r)+l.query+c,p=location.hash;s(i,e,h),p!==c&&window.dispatchEvent(new CustomEvent("hashchange"))}const Kt=K({basePath:""});class Ks{get store(){return b}get basePath(){return Kt.basePath}set basePath(e){k(Kt,{basePath:e}),Object.assign(O.get(b.$key),{path:Bn(location.pathname)})}getParams(){return O.get(b.$key)}updateParams(e){Object.assign(O.get(b.$key),e),k(b,{})}push(e){Fn(e,Dn)}replace(e){Fn(e,qn)}pushIgnoreCloseHandle(e){var t,s;b.$hasCloseHandle?((s=(t=O.get(b.$key))==null?void 0:t.close)==null||s.call(t),this.replace(e)):this.push(e)}forward(){G.forward()}back(){G.back()}}const U=new Ks,Ae=K({title:""}),Js={history:U,titleStore:Ae,basePathStore:Kt};if(!window._GEMHISTORY){if(window._GEMHISTORY=Js,G.pushState=function(e,t,s){zn(e,t,s,Dn)},G.replaceState=function(e,t,s){zn(e,t,s,qn)},window.addEventListener("hashchange",({isTrusted:e})=>{e&&U.replace({hash:decodeURIComponent(location.hash)})}),G.state)if(G.state.$hasCloseHandle){k(b,G.state);const e=ft({title:document.title});O.set(b.$key,e),U.back()}else{const e=ft({title:document.title,hash:location.hash});k(b,{$key:zt(),...G.state||{}}),O.set(b.$key,e)}else{const{pathname:e,search:t,hash:s}=location;U.replace({path:e,query:t,hash:s})}de(Ae,()=>{const e=O.get(b.$key);e&&(e.title=Ae.title)}),de(b,()=>{const{title:e}=U.getParams();e!==Ae.title&&k(Ae,{title:e})});let n=!1;window.addEventListener("popstate",e=>{var r,a;const t=e.state;if(!(t!=null&&t.$key))return;if(n){n=!1;return}if(!O.has(t.$key)){const{pathname:c,search:l,hash:h}=location;O.set(t.$key,{path:c,query:new $e(l),hash:h,title:document.title,data:t})}const s=b;if(parseFloat(t.$key)>parseFloat(s.$key)&&t.$hasOpenHandle)(a=(r=O.get(t.$key))==null?void 0:r.open)==null||a.call(r);else if(s.$hasCloseHandle){const c=O.get(s.$key),l=c==null?void 0:c.close,h=c==null?void 0:c.shouldClose;if(h&&!h()){n=!0,U.forward();return}else l?l():t.$hasCloseHandle&&(n=!0,U.back())}k(Je(b),t)})}const{history:v,titleStore:ye,basePathStore:Kn}=window._GEMHISTORY;var Qs=Object.defineProperty,Xs=Object.getOwnPropertyDescriptor,ie=(n,e,t,s)=>{for(var i=s>1?void 0:s?Xs(e,t):e,r=n.length-1,a;r>=0;r--)(a=n[r])&&(i=(s?a(e,t,i):a(i))||i);return s&&i&&Qs(e,t,i),i},Jn=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},Ge=(n,e,t)=>(Jn(n,e,"read from private field"),t?t.call(n):e.get(n)),Jt=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},Qn=(n,e,t,s)=>(Jn(n,e,"write to private field"),s?s.call(n,t):e.set(n,t),t),He,mt,pt;class Ys extends RegExp{constructor(e){const t={};let s=0;super(`^${e.replace(/:([^/$]+)/g,(i,r)=>(t[r]=s++,"([^/]+)")).replace("*",".*")}$`,"i"),this.namePosition=t}}function Qt(n,e){if(window.URLPattern){const r=new window.URLPattern({pathname:n}),a=r.exec({pathname:e})||r.exec({pathname:`${e}/`});return a?a.pathname.groups:null}const t=new Ys(n),s=e.match(t)||`${e}/`.match(t);if(!s)return null;const i={};return s&&Object.keys(t.namePosition).forEach(r=>{i[r]=s[t.namePosition[r]+1]}),i}function Xt(n,e){let t=n.pattern;const s=e==null?void 0:e.params;return s&&Object.keys(s).forEach(i=>{t=t.replace(new RegExp(`:${i}`,"g"),s[i])}),t}function Xn(n,e){return{path:Xt(n,e),...e}}o.GemRouteElement=class extends R{constructor({isLight:n,routes:e}={}){super({isLight:n}),this.currentParams={},Jt(this,He,void 0),this.state={content:void 0},Jt(this,mt,()=>{if(this.locationStore){const{path:t,query:s,data:i}=v.getParams();k(this.locationStore,{path:t,params:this.currentParams,query:s,data:i})}}),Jt(this,pt,(t,s,i)=>{Qn(this,He,void 0),this.currentRoute=t,this.currentParams=s;const r=()=>{this.setState({content:i}),this.routechange(this.currentRoute),Ge(this,mt).call(this)};this.transition&&"startViewTransition"in document?document.startViewTransition(()=>(r(),Promise.resolve())):r()}),this.routes=e}mounted(){this.effect(([n,e],t)=>{if(t&&n===t[0]&&e===t[1]){Ge(this,mt).call(this);return}const{route:s,params:i={}}=o.GemRouteElement.findRoute(this.routes,e),{redirect:r,content:a,getContent:c}=s||{};if(r){v.replace({path:r});return}const l=s==null?void 0:s.title;l&&k(ye,{title:l});const h=a||(c==null?void 0:c(i));if(h instanceof Promise){this.loading(s),Qn(this,He,h);const p=()=>Ge(this,He)===h;h.then(d=>{p()&&Ge(this,pt).call(this,s,i,d)}).catch(d=>{p()&&this.error(d)});return}Ge(this,pt).call(this,s,i,h)},()=>{const{path:n}=v.getParams();return[this.key,n,location.search]})}shouldUpdate(){return!this.inert}render(){const{content:n}=this.state;return this.shadowRoot?W`
170
+ */const jt=new WeakMap,Dt=Y(n=>e=>{const t=jt.get(e);if(n===void 0&&e instanceof Ht){if(t!==void 0||!jt.has(e)){const s=e.committer.name;e.committer.element.removeAttribute(s)}}else n!==t&&e.setValue(n);jt.set(e,n)});var In=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},u=(n,e,t)=>(In(n,e,"read from private field"),t?t.call(n):e.get(n)),w=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},N=(n,e,t,s)=>(In(n,e,"write to private field"),s?s.call(n,t):e.set(n,t),t),me,pe,te,Ne,J,Oe,F,ne,Ze,et,qt,Ut,Bt,tt,Ft,nt,ae,zt,st,it,rt;function Bs(){}function Kt(n){typeof n=="function"&&n()}const ot=new Cn,Jt=(n=performance.now())=>{if(performance.now()>n+16)return requestAnimationFrame(Jt);const e=ot.get();e&&(e(),Jt(n))};ot.addEventListener("start",()=>I(Jt));const at=Symbol("constructor"),ct=Symbol("init"),Vn=Symbol("update"),Ae=class extends HTMLElement{constructor({isAsync:n,isLight:e,delegatesFocus:t,slotAssignment:s}={}){super(),w(this,pe,void 0),w(this,te,void 0),w(this,Ne,void 0),w(this,J,void 0),w(this,Oe,void 0),w(this,F,void 0),w(this,ne,void 0),w(this,Ze,void 0),this.setState=r=>{if(!this.state)throw new z("`state` not initialized");Object.assign(this.state,r),I(u(this,ae))},w(this,et,r=>{r==null||r.forEach(a=>{const{callback:c,getDep:l,values:h,preCallback:p}=a,d=l==null?void 0:l();(!l||!h||$n(h,d))&&(Kt(p),a.preCallback=c(d,h),a.values=d)})}),w(this,qt,()=>{u(this,et).call(this,u(this,F))}),w(this,Ut,()=>{u(this,et).call(this,u(this,ne))}),this.effect=(r,a)=>{u(this,F)||N(this,F,[]);const c={callback:r,getDep:a,initialized:u(this,J),inConstructor:this[at]};u(this,J)&&(c.values=a==null?void 0:a(),c.preCallback=r(c.values)),u(this,F).push(c)},this.memo=(r,a)=>{u(this,ne)||N(this,ne,[]),u(this,ne).push({callback:r,getDep:a,inConstructor:this[at]})},w(this,Bt,()=>{var r;(r=u(this,F))==null||r.forEach(a=>{const{callback:c,getDep:l,initialized:h}=a;h||(a.values=l==null?void 0:l(),a.preCallback=c(a.values),a.initialized=!0)})}),w(this,tt,()=>(u(this,Ut).call(this),this.render?this.render():u(this,pe)===this?void 0:B`<slot></slot>`)),w(this,Ft,()=>this.shouldUpdate?this.shouldUpdate():!0),w(this,nt,()=>{if(u(this,J)&&u(this,Ft).call(this)){const r=u(this,tt).call(this);r!==void 0&&Ke(r,u(this,pe)),I(u(this,zt)),I(u(this,qt))}}),w(this,ae,()=>{u(this,Oe)?ot.add(u(this,nt)):u(this,nt).call(this)}),this.update=()=>{I(u(this,ae))},w(this,zt,()=>{var r;(r=this.updated)==null||r.call(this)}),w(this,st,void 0),w(this,it,()=>{var l,h,p;if(u(this,Ne)){N(this,Ne,!1);return}Reflect.set(this,at,!1),(l=this.willMount)==null||l.call(this);const{observedStores:r,rootElement:a}=this.constructor;N(this,st,r==null?void 0:r.map(d=>re(d,u(this,ae))));const c=u(this,tt).call(this);if(c!==void 0&&Ke(c,u(this,pe)),N(this,J,!0),N(this,Ze,(h=this.mounted)==null?void 0:h.call(this)),u(this,Bt).call(this),a&&this.isConnected&&((p=this.getRootNode().host)==null?void 0:p.tagName)!==a.toUpperCase())throw new z("not allow current root type")}),w(this,rt,r=>(r.initialized=!1,r.inConstructor)),I(()=>Reflect.set(this,ct,!1)),Reflect.set(this,at,!0),Reflect.set(this,ct,!0),Reflect.set(this,Vn,()=>{u(this,J)&&I(u(this,ae))}),N(this,Oe,n),N(this,pe,e?this:this.attachShadow({mode:"open",delegatesFocus:t,slotAssignment:s}));const{adoptedStyleSheets:i}=new.target;if(i){const r=i.map(a=>a[Wt]||a);this.shadowRoot?this.shadowRoot.adoptedStyleSheets=r:this.effect(()=>{const a=this.getRootNode();return a.adoptedStyleSheets=[...a.adoptedStyleSheets,...r],()=>{a.adoptedStyleSheets=Tn(a.adoptedStyleSheets,r)}},()=>[])}}get internals(){if(!u(this,te)){N(this,te,this.attachInternals());try{u(this,te).states.add("foo"),u(this,te).states.delete("foo")}catch{Reflect.defineProperty(u(this,te),"states",{value:{has:n=>ee(n)in this.dataset,add:n=>this.dataset[ee(n)]="",delete:n=>delete this.dataset[ee(n)]}})}}return u(this,te)}attributeChangedCallback(){return u(this,J)&&I(u(this,ae)),u(Ae,me)}closestElement(n){const e=typeof n=="function",t=typeof n=="string"&&n.toUpperCase(),s=i=>{const r=i.parentElement||i.getRootNode().host;if(!r)return null;if(e){if(r.constructor===n)return r}else if(r.tagName===t)return r;return s(r)};return s(this)}connectedCallback(){return this.isConnected&&u(this,Oe)?ot.add(u(this,it)):u(this,it).call(this),u(Ae,me)}adoptedCallback(){return u(Ae,me)}disconnectedCallback(){var n,e,t,s,i;if(this.isConnected){N(this,Ne,!0);return}return N(this,J,!1),(n=u(this,st))==null||n.forEach(r=>r()),Kt(u(this,Ze)),(e=this.unmounted)==null||e.call(this),(t=u(this,F))==null||t.forEach(({preCallback:r})=>Kt(r)),N(this,F,(s=u(this,F))==null?void 0:s.filter(u(this,rt))),N(this,ne,(i=u(this,ne))==null?void 0:i.filter(u(this,rt))),u(Ae,me)}};let M=Ae;me=new WeakMap,pe=new WeakMap,te=new WeakMap,Ne=new WeakMap,J=new WeakMap,Oe=new WeakMap,F=new WeakMap,ne=new WeakMap,Ze=new WeakMap,et=new WeakMap,qt=new WeakMap,Ut=new WeakMap,Bt=new WeakMap,tt=new WeakMap,Ft=new WeakMap,nt=new WeakMap,ae=new WeakMap,zt=new WeakMap,st=new WeakMap,it=new WeakMap,rt=new WeakMap,w(M,me,Symbol());const lt=new Ln;function ht(n,e,t){const{booleanAttributes:s,numberAttributes:i}=n.constructor;Object.defineProperty(n,e,{configurable:!0,get(){if(!(ct in this))return;const a=this.getAttribute(t);return s!=null&&s.has(t)?a!==null:i!=null&&i.has(t)?Number(a):a||""},set(r){const a=this,c=lt.get(this),l=c[e],h=a.getAttribute(t);if(this[ct]&&h!==null&&!l)return;c[e]=!0;const p=s==null?void 0:s.has(t);r==null?a.removeAttribute(t):p?a.toggleAttribute(t,!!r):h!==String(r)&&a.setAttribute(t,String(r))}})}const xn=Symbol("event handle");function ge(n,e,t,s){Object.defineProperty(n,e,{configurable:!0,get(){const i=lt.get(this)[e];return i||!t?i:(this[e]=Bs,this[e])},set(i){const r=this,a=lt.get(r);i!==a[e]&&(t?(a[e]=i!=null&&i[xn]?i:(c,l)=>{const h=new CustomEvent(t,{...l,...s,detail:c});r.dispatchEvent(h),i(c,l)},Reflect.set(a[e],xn,!0)):(a[e]=i,this[Vn]()))}})}function ut(n,e,t){Object.defineProperty(n,e,{configurable:!0,get(){const s=lt.get(this);let i=s[e];if(!i){const r=this,a=r.shadowRoot||r;i={get ref(){return t},get element(){const c=[...a.querySelectorAll("[data-gem-reflect]")].map(l=>l.target);for(const l of[a,...c]){const h=l.querySelector(`[ref=${t}]`);if(h)return h}}},s[e]=i}return i}})}function dt(n,e,t){Object.defineProperty(n,e,{configurable:!0,get(){const s=this,{states:i}=s.internals;return i==null?void 0:i.has(t)},set(s){const i=this,{states:r}=i.internals;s?r==null||r.add(t):r==null||r.delete(t)}})}const ft=customElements.define.bind(customElements);customElements.define=(n,e,t)=>{if(e.prototype instanceof M){const{observedAttributes:s,observedProperties:i,defineEvents:r,defineCSSStates:a,defineRefs:c}=e;s==null||s.forEach(l=>ht(e.prototype,ee(l),l)),i==null||i.forEach(l=>ge(e.prototype,l)),r==null||r.forEach(l=>ge(e.prototype,ee(l),l)),a==null||a.forEach(l=>dt(e.prototype,ee(l),l)),c==null||c.forEach(l=>ut(e.prototype,ee(l),l))}ft(n,e,t)},window.__GEM_DEVTOOLS__HOOK__&&Object.assign(window.__GEM_DEVTOOLS__HOOK__,{..._,...Us});function x(n,e,t,s=!1){const i=n.constructor,r=i[e];i.hasOwnProperty(e)||Object.defineProperty(i,e,{value:s?new Set(r):r?Array.from(r):[]}),i[e][s?"add":"push"](t)}function Fs(n,e){const t=`${V(e)}-${Je()}`;x(n,"defineRefs",t),ut(n,e,t)}function Qt(n,e,t){x(n,"observedAttributes",t),ht(n,e,t)}function $(n,e){Qt(n,e,V(e))}function Xt(n,e){const t=V(e);x(n,"booleanAttributes",t,!0),Qt(n,e,t)}function zs(n,e){const t=V(e);x(n,"numberAttributes",t,!0),Qt(n,e,t)}function j(n,e){x(n,"observedProperties",e),ge(n,e)}function mt(n,e){const t=V(e);x(n,"defineCSSStates",t),dt(n,e,t)}function Ks(n,e){const t=V(n[e]||e);n[e]=t,x(n instanceof M?n:n.prototype,"defineSlots",t)}function jn(n,e){const t=V(n[e]||e);n[e]=t,x(n instanceof M?n:n.prototype,"defineParts",t)}function pt(n,e){Dn(n,e)}function Js(n,e){Dn(n,e,{bubbles:!0,composed:!0})}function Dn(n,e,t){const s=V(e);x(n,"defineEvents",s),ge(n,e,s,t)}function Qs(n){return function(e){x(e.prototype,"adoptedStyleSheets",n)}}function He(n){return function(e){x(e.prototype,"observedStores",n)}}function Xs(n){return function(e){const t=e;t.rootElement=n}}function Ys(n){return function(e){ft(n,e)}}const A=window.history,qn=A.pushState.bind(A),Un=A.replaceState.bind(A);let Zs=0;const Yt=()=>`${performance.now()}-${++Zs}`,[C,ye]=Ye({$hasCloseHandle:!1,$hasOpenHandle:!1,$hasShouldCloseHandle:!1,$key:""}),R=new Map;function Bn(n){const{$key:e,$hasCloseHandle:t,$hasOpenHandle:s,$hasShouldCloseHandle:i}=n||{};if(C.$key!==e){if(e)throw new z("`$key` is not allowed");if(t)throw new z("`$hasCloseHandle` is not allowed");if(s)throw new z("`$hasOpenHandle` is not allowed");if(i)throw new z("`$hasShouldCloseHandle` is not allowed")}}function Fn(n){return D.basePath?D.basePath+n:n}function zn(n){return n===D.basePath?"/":n.replace(new RegExp(`^${D.basePath}/`),"/")}function gt(n){const e=R.get(C.$key)||{},t=n.path?Gt(e.path,n.path):zn(location.pathname),s=new Me(n.query||(n.path?"":location.search)),i=n.path&&n.path!==e.path||n.query&&String(n.query)!==String(e.query),r=n.title||(i?"":document.title),a=n.close||n.data||n.open||n.shouldClose,c=n.hash||(!i&&a?decodeURIComponent(location.hash):"");return{...n,title:r,path:t,query:s,hash:c}}function Kn(n,e){Bn(n.data);const t=gt(n),{title:s,path:i,query:r,hash:a,close:c,open:l,shouldClose:h,data:p}=t,d={$hasCloseHandle:!!c,$hasOpenHandle:!!l,$hasShouldCloseHandle:!!h,$key:Yt(),$title:s,...p};R.set(d.$key,t),Qe(C),ye(d);const T=Fn(i)+new Me(r)+a,g=decodeURIComponent(location.hash);e(d,s,T),g!==a&&window.dispatchEvent(new CustomEvent("hashchange"))}function Jn(n,e,t,s){Bn(n);const i={$key:Yt(),$title:e,...n||{}},{pathname:r,search:a,hash:c}=new URL(t,location.origin+location.pathname),l=gt({path:r,query:new Me(a),hash:c,title:e,data:n});R.set(i.$key,l),Qe(C),ye(i);const h=Fn(r)+l.query+c,p=location.hash;s(i,e,h),p!==c&&window.dispatchEvent(new CustomEvent("hashchange"))}const[Qn,ei]=Ye({basePath:""});class ti{get store(){return C}get basePath(){return Qn.basePath}set basePath(e){ei({basePath:e}),Object.assign(R.get(C.$key),{path:zn(location.pathname)})}getParams(){return R.get(C.$key)}updateParams(e){Object.assign(R.get(C.$key),e),ye()}push(e){Kn(e,qn)}replace(e){Kn(e,Un)}pushIgnoreCloseHandle(e){var t,s;C.$hasCloseHandle?((s=(t=R.get(C.$key))==null?void 0:t.close)==null||s.call(t),this.replace(e)):this.push(e)}forward(){A.forward()}back(){A.back()}}const D=new ti,[yt,ni]=Ye({title:""}),si={history:D,titleStore:yt,basePathStore:Qn};if(!window._GEMHISTORY){if(window._GEMHISTORY=si,A.pushState=function(e,t,s){Jn(e,t,s,qn)},A.replaceState=function(e,t,s){Jn(e,t,s,Un)},window.addEventListener("hashchange",({isTrusted:e})=>{e&&D.replace({hash:decodeURIComponent(location.hash)})}),A.state)if(A.state.$hasCloseHandle){ye(A.state);const e=gt({title:document.title});R.set(C.$key,e),D.back()}else{const e=gt({title:document.title,hash:location.hash});ye({$key:Yt(),...A.state||{}}),R.set(C.$key,e)}else{const{pathname:e,search:t,hash:s}=location;D.replace({path:e,query:t,hash:s})}re(yt,()=>{const e=R.get(C.$key);e&&(e.title=yt.title)}),re(C,()=>{const{title:e}=D.getParams();e!==yt.title&&ni({title:e})});let n=!1;window.addEventListener("popstate",e=>{var r,a;const t=e.state;if(!(t!=null&&t.$key))return;if(n){n=!1;return}if(!R.has(t.$key)){const{pathname:c,search:l,hash:h}=location;R.set(t.$key,{path:c,query:new Me(l),hash:h,title:t.$title,data:t})}const s=C;if(parseFloat(t.$key)>parseFloat(s.$key)&&t.$hasOpenHandle)(a=(r=R.get(t.$key))==null?void 0:r.open)==null||a.call(r);else if(s.$hasCloseHandle){const c=R.get(s.$key),l=c==null?void 0:c.close,h=c==null?void 0:c.shouldClose;if(h&&!h()){n=!0,D.forward();return}else l?l():t.$hasCloseHandle&&(n=!0,D.back())}Qe(C),ye(t)})}const{history:v,titleStore:we,basePathStore:Xn}=window._GEMHISTORY;var ii=Object.defineProperty,ri=Object.getOwnPropertyDescriptor,se=(n,e,t,s)=>{for(var i=s>1?void 0:s?ri(e,t):e,r=n.length-1,a;r>=0;r--)(a=n[r])&&(i=(s?a(e,t,i):a(i))||i);return s&&i&&ii(e,t,i),i},Yn=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},Ge=(n,e,t)=>(Yn(n,e,"read from private field"),t?t.call(n):e.get(n)),Zt=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},Zn=(n,e,t,s)=>(Yn(n,e,"write to private field"),s?s.call(n,t):e.set(n,t),t),We,wt,Et;class oi extends RegExp{constructor(e){const t={};let s=0;super(`^${e.replace(/:([^/$]+)/g,(i,r)=>(t[r]=s++,"([^/]+)")).replace("*",".*")}$`,"i"),this.namePosition=t}}function en(n,e){if(window.URLPattern){const r=new window.URLPattern({pathname:n}),a=r.exec({pathname:e})||r.exec({pathname:`${e}/`});return a?a.pathname.groups:null}const t=new oi(n),s=e.match(t)||`${e}/`.match(t);if(!s)return null;const i={};return s&&Object.keys(t.namePosition).forEach(r=>{i[r]=s[t.namePosition[r]+1]}),i}function tn(n,e){let t=n.pattern;const s=e==null?void 0:e.params;return s&&Object.keys(s).forEach(i=>{t=t.replace(new RegExp(`:${i}`,"g"),s[i])}),t}function es(n,e){return{path:tn(n,e),...e}}o.GemRouteElement=class extends M{constructor({isLight:n,routes:e}={}){super({isLight:n}),this.currentParams={},Zt(this,We,void 0),this.state={content:void 0},Zt(this,wt,()=>{if(this.locationStore){const{path:t,query:s,data:i}=v.getParams();K(this.locationStore,{path:t,params:this.currentParams,query:s,data:i})}}),Zt(this,Et,(t,s,i)=>{Zn(this,We,void 0),this.currentRoute=t,this.currentParams=s;const r=()=>{this.setState({content:i}),this.routechange(this.currentRoute),Ge(this,wt).call(this)};this.transition&&"startViewTransition"in document?document.startViewTransition(()=>(r(),Promise.resolve())):r()}),this.routes=e}mounted(){this.effect(([n,e],t)=>{if(t&&n===t[0]&&e===t[1]){Ge(this,wt).call(this);return}const{route:s,params:i={}}=o.GemRouteElement.findRoute(this.routes,e),{redirect:r,content:a,getContent:c}=s||{};if(r){v.replace({path:r});return}const l=s==null?void 0:s.title;l&&K(we,{title:l});const h=a||(c==null?void 0:c(i));if(h instanceof Promise){this.loading(s),Zn(this,We,h);const p=()=>Ge(this,We)===h;h.then(d=>{p()&&Ge(this,Et).call(this,s,i,d)}).catch(d=>{p()&&this.error(d)});return}Ge(this,Et).call(this,s,i,h)},()=>{const{path:n}=v.getParams();return[this.key,n,location.search]})}shouldUpdate(){return!this.inert}render(){const{content:n}=this.state;return this.shadowRoot?B`
171
171
  <style>
172
172
  :host(:where(:not([hidden]))),
173
173
  :not(:defined) {
174
174
  display: contents;
175
175
  }
176
176
  </style>
177
- ${n!=null?n:W`<slot></slot>`}
178
- `:W`${n}`}},He=new WeakMap,mt=new WeakMap,pt=new WeakMap,o.GemRouteElement.createLocationStore=()=>{const{path:n,query:e,data:t}=v.getParams();return K({path:n,query:e,data:t,params:{}})},o.GemRouteElement.findRoute=(n=[],e)=>{let t=null,s;n instanceof Array?s=n:s=Object.values(n);for(const i of s)if(i.pattern==="*")t=i;else{const r=Qt(i.pattern,e);if(r)return{route:i,params:r}}return{route:t}},ie([Wn],o.GemRouteElement.prototype,"transition",2),ie([q],o.GemRouteElement.prototype,"routes",2),ie([q],o.GemRouteElement.prototype,"locationStore",2),ie([q],o.GemRouteElement.prototype,"key",2),ie([dt],o.GemRouteElement.prototype,"routechange",2),ie([dt],o.GemRouteElement.prototype,"loading",2),ie([dt],o.GemRouteElement.prototype,"error",2),o.GemRouteElement=ie([ge(v.store)],o.GemRouteElement);class Yn extends o.GemRouteElement{constructor(e={}){super({...e,isLight:!0})}}var Zs=Object.defineProperty,ei=Object.getOwnPropertyDescriptor,T=(n,e,t,s)=>{for(var i=s>1?void 0:s?ei(e,t):e,r=n.length-1,a;r>=0;r--)(a=n[r])&&(i=(s?a(e,t,i):a(i))||i);return s&&i&&Zs(e,t,i),i};function Zn(n){return!n.startsWith("/")}o.GemLinkElement=(fs=class extends R{constructor(){super();w(this,ae);w(this,vt);w(this,De,void 0);w(this,qe,void 0);w(this,Ue,void 0);C(this,De,async()=>{var r;const e=this.getLocationString();if(!e)return;if(Zn(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:t,query:s,hash:i}=v.getParams();if(t+s+i!==e)if(await((r=this.prepare)==null?void 0:r.call(this)),this.route)v.pushIgnoreCloseHandle({...Xn(this.route,f(this,ae,Be)),title:this.route.title||this.docTitle});else if(this.href){const{pathname:a,search:c,hash:l}=new URL(e,location.origin);v.pushIgnoreCloseHandle({path:a,query:c,hash:l,title:this.docTitle})}else v.pushIgnoreCloseHandle({path:this.path,query:this.query,hash:this.hash,title:this.docTitle})}),C(this,qe,e=>{e.preventDefault()}),C(this,Ue,()=>{const e=this.getLocationString();return Zn(e)?e:new URL(v.basePath+e,location.origin).toString()}),this.tabIndex=0,this.addEventListener("click",f(this,De))}render(){return W`
177
+ ${n!=null?n:B`<slot></slot>`}
178
+ `:B`${n}`}},We=new WeakMap,wt=new WeakMap,Et=new WeakMap,o.GemRouteElement.createLocationStore=()=>{const{path:n,query:e,data:t}=v.getParams();return fe({path:n,query:e,data:t,params:{}})},o.GemRouteElement.findRoute=(n=[],e)=>{let t=null,s;n instanceof Array?s=n:s=Object.values(n);for(const i of s)if(i.pattern==="*")t=i;else{const r=en(i.pattern,e);if(r)return{route:i,params:r}}return{route:t}},se([Xt],o.GemRouteElement.prototype,"transition",2),se([j],o.GemRouteElement.prototype,"routes",2),se([j],o.GemRouteElement.prototype,"locationStore",2),se([j],o.GemRouteElement.prototype,"key",2),se([pt],o.GemRouteElement.prototype,"routechange",2),se([pt],o.GemRouteElement.prototype,"loading",2),se([pt],o.GemRouteElement.prototype,"error",2),o.GemRouteElement=se([He(v.store)],o.GemRouteElement);class ts extends o.GemRouteElement{constructor(e={}){super({...e,isLight:!0})}}var ai=Object.defineProperty,ci=Object.getOwnPropertyDescriptor,L=(n,e,t,s)=>{for(var i=s>1?void 0:s?ci(e,t):e,r=n.length-1,a;r>=0;r--)(a=n[r])&&(i=(s?a(e,t,i):a(i))||i);return s&&i&&ai(e,t,i),i};function ns(n){return!n.startsWith("/")}o.GemLinkElement=(Es=class extends M{constructor(){super();E(this,ce);E(this,Ct);E(this,De,void 0);E(this,qe,void 0);E(this,Ue,void 0);P(this,De,async()=>{var r;const e=this.getLocationString();if(!e)return;if(ns(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:t,query:s,hash:i}=v.getParams();if(t+s+i!==e)if(await((r=this.prepare)==null?void 0:r.call(this)),this.route)v.pushIgnoreCloseHandle({...es(this.route,f(this,ce,Fe)),title:this.route.title||this.docTitle});else if(this.href){const{pathname:a,search:c,hash:l}=new URL(e,location.origin);v.pushIgnoreCloseHandle({path:a,query:c,hash:l,title:this.docTitle})}else v.pushIgnoreCloseHandle({path:this.path,query:this.query,hash:this.hash,title:this.docTitle})}),P(this,qe,e=>{e.preventDefault()}),P(this,Ue,()=>{const e=this.getLocationString();return ns(e)?e:new URL(v.basePath+e,location.origin).toString()}),this.tabIndex=0,this.addEventListener("click",f(this,De))}render(){return B`
179
179
  <style>
180
180
  :host {
181
181
  /* link default style */
@@ -194,11 +194,11 @@ var sn=(o,E,L)=>{if(!E.has(o))throw TypeError("Cannot "+L)};var f=(o,E,L)=>(sn(o
194
194
  <a
195
195
  part=${this.link}
196
196
  @click=${f(this,qe)}
197
- href=${Wt(f(this,vt,ps)==="off"?void 0:f(this,Ue).call(this))}
197
+ href=${Dt(f(this,Ct,vs)==="off"?void 0:f(this,Ue).call(this))}
198
198
  >
199
199
  <slot></slot>
200
200
  </a>
201
- `}getLocationString(){var e,t;if(this.route){const s=((e=f(this,ae,Be))==null?void 0:e.query)||"",i=((t=f(this,ae,Be))==null?void 0:t.hash)||"";return Xt(this.route,f(this,ae,Be))+s+i}else{const s=this.href||this.path+this.query+this.hash,{path:i,query:r}=v.getParams();return s.startsWith("#")?`${i}${r}${s}`:s.startsWith("?")?`${i}${s}`:s.startsWith(".")?Ot(i,s):s}}},ae=new WeakSet,Be=function(){return this.routeOptions||this.options},vt=new WeakSet,ps=function(){return this.hint||"on"},De=new WeakMap,qe=new WeakMap,Ue=new WeakMap,fs),T([$],o.GemLinkElement.prototype,"href",2),T([$],o.GemLinkElement.prototype,"target",2),T([$],o.GemLinkElement.prototype,"path",2),T([$],o.GemLinkElement.prototype,"query",2),T([$],o.GemLinkElement.prototype,"hash",2),T([$],o.GemLinkElement.prototype,"docTitle",2),T([$],o.GemLinkElement.prototype,"hint",2),T([q],o.GemLinkElement.prototype,"route",2),T([q],o.GemLinkElement.prototype,"options",2),T([q],o.GemLinkElement.prototype,"routeOptions",2),T([q],o.GemLinkElement.prototype,"prepare",2),T([Vn],o.GemLinkElement.prototype,"link",2),o.GemLinkElement=T([ge(Kn)],o.GemLinkElement),o.GemActiveLinkElement=class extends o.GemLinkElement{constructor(){super(),this.effect(()=>{const{path:n,query:e,hash:t}=v.getParams(),s=this.pattern&&Qt(this.pattern,n);this.active=!!s||n+e+t===this.getLocationString()})}},T([$],o.GemActiveLinkElement.prototype,"pattern",2),T([ut],o.GemActiveLinkElement.prototype,"active",2),o.GemActiveLinkElement=T([ge(v.store)],o.GemActiveLinkElement),customElements.define("gem-link",o.GemLinkElement),customElements.define("gem-active-link",o.GemActiveLinkElement),customElements.define("gem-route",o.GemRouteElement),customElements.define("gem-light-route",Yn);var ti=Object.defineProperty,ni=Object.getOwnPropertyDescriptor,Yt=(n,e,t,s)=>{for(var i=s>1?void 0:s?ni(e,t):e,r=n.length-1,a;r>=0;r--)(a=n[r])&&(i=(s?a(e,t,i):a(i))||i);return s&&i&&ti(e,t,i),i};const gt=document.title;function es(n,e="",t=""){const s=ye.title||n;s&&s!==gt?(o.GemTitleElement.title=s,document.title=e+o.GemTitleElement.title+t):(o.GemTitleElement.title=gt,document.title=o.GemTitleElement.title)}const ts=`${gt} | `,ns=` - ${gt}`;o.GemTitleElement=class extends R{constructor(){super(),new MutationObserver(()=>this.update()).observe(this,{characterData:!0,subtree:!0})}static setTitle(n){k(ye,{title:n})}render(){return es(this.textContent,this.prefix,this.suffix),this.hidden?W``:W`${o.GemTitleElement.title}`}},o.GemTitleElement.title=document.title,o.GemTitleElement.defaultPrefix=ts,o.GemTitleElement.defaultSuffix=ns,Yt([$],o.GemTitleElement.prototype,"prefix",2),Yt([$],o.GemTitleElement.prototype,"suffix",2),o.GemTitleElement=Yt([ge(ye)],o.GemTitleElement),de(ye,es),customElements.define("gem-title",o.GemTitleElement);var si=Object.defineProperty,ii=Object.getOwnPropertyDescriptor,yt=(n,e,t,s)=>{for(var i=s>1?void 0:s?ii(e,t):e,r=n.length-1,a;r>=0;r--)(a=n[r])&&(i=(s?a(e,t,i):a(i))||i);return s&&i&&si(e,t,i),i};const ss=new Map;class we extends R{constructor(){super(...arguments);w(this,xe,void 0);C(this,xe,()=>{const t=this.element||(this.selector?(this.root||document).querySelector(this.selector):null);if(typeof t=="string"){let s=ss.get(t);return s||(s=document.createElement("template"),s.innerHTML=t,ss.set(t,s)),s.content.cloneNode(!0)}else return t instanceof HTMLTemplateElement?t.content.cloneNode(!0):t==null?void 0:t.cloneNode(!0)})}render(){return W`
201
+ `}getLocationString(){var e,t;if(this.route){const s=((e=f(this,ce,Fe))==null?void 0:e.query)||"",i=((t=f(this,ce,Fe))==null?void 0:t.hash)||"";return tn(this.route,f(this,ce,Fe))+s+i}else{const s=this.href||this.path+this.query+this.hash,{path:i,query:r}=v.getParams();return s.startsWith("#")?`${i}${r}${s}`:s.startsWith("?")?`${i}${s}`:s.startsWith(".")?Gt(i,s):s}}},ce=new WeakSet,Fe=function(){return this.routeOptions||this.options},Ct=new WeakSet,vs=function(){return this.hint||"on"},De=new WeakMap,qe=new WeakMap,Ue=new WeakMap,Es),L([$],o.GemLinkElement.prototype,"href",2),L([$],o.GemLinkElement.prototype,"target",2),L([$],o.GemLinkElement.prototype,"path",2),L([$],o.GemLinkElement.prototype,"query",2),L([$],o.GemLinkElement.prototype,"hash",2),L([$],o.GemLinkElement.prototype,"docTitle",2),L([$],o.GemLinkElement.prototype,"hint",2),L([j],o.GemLinkElement.prototype,"route",2),L([j],o.GemLinkElement.prototype,"options",2),L([j],o.GemLinkElement.prototype,"routeOptions",2),L([j],o.GemLinkElement.prototype,"prepare",2),L([jn],o.GemLinkElement.prototype,"link",2),o.GemLinkElement=L([He(Xn)],o.GemLinkElement),o.GemActiveLinkElement=class extends o.GemLinkElement{constructor(){super(),this.effect(()=>{const{path:n,query:e,hash:t}=v.getParams(),s=this.pattern&&en(this.pattern,n);this.active=!!s||n+e+t===this.getLocationString()})}},L([$],o.GemActiveLinkElement.prototype,"pattern",2),L([mt],o.GemActiveLinkElement.prototype,"active",2),o.GemActiveLinkElement=L([He(v.store)],o.GemActiveLinkElement),customElements.define("gem-link",o.GemLinkElement),customElements.define("gem-active-link",o.GemActiveLinkElement),customElements.define("gem-route",o.GemRouteElement),customElements.define("gem-light-route",ts);var li=Object.defineProperty,hi=Object.getOwnPropertyDescriptor,nn=(n,e,t,s)=>{for(var i=s>1?void 0:s?hi(e,t):e,r=n.length-1,a;r>=0;r--)(a=n[r])&&(i=(s?a(e,t,i):a(i))||i);return s&&i&&li(e,t,i),i};const _t=document.title;function ss(n,e="",t=""){const s=we.title||n;s&&s!==_t?(H.title=s,document.title=e+H.title+t):(H.title=_t,document.title=H.title)}re(we,ss);const is=`${_t} | `,rs=` - ${_t}`,os=class extends M{constructor(){super(),this.mounted=()=>{this.effect(()=>!this.inert&&re(we,this.update),()=>[this.inert])},new MutationObserver(()=>this.update()).observe(this,{characterData:!0,subtree:!0})}static setTitle(n){K(we,{title:n})}render(){var n;return ss((n=this.textContent)==null?void 0:n.trim(),this.prefix,this.suffix),B`${os.title}`}};let H=os;H.title=document.title,H.defaultPrefix=is,H.defaultSuffix=rs,nn([$],H.prototype,"prefix",2),nn([$],H.prototype,"suffix",2),nn([Xt],H.prototype,"inert",2),customElements.define("gem-title",H);var ui=Object.defineProperty,di=Object.getOwnPropertyDescriptor,vt=(n,e,t,s)=>{for(var i=s>1?void 0:s?di(e,t):e,r=n.length-1,a;r>=0;r--)(a=n[r])&&(i=(s?a(e,t,i):a(i))||i);return s&&i&&ui(e,t,i),i};const as=new Map;class Ee extends M{constructor(){super(...arguments);E(this,Be,void 0);P(this,Be,()=>{const t=this.element||(this.selector?(this.root||document).querySelector(this.selector):null);if(typeof t=="string"){let s=as.get(t);return s||(s=document.createElement("template"),s.innerHTML=t,as.set(t,s)),s.content.cloneNode(!0)}else return t instanceof HTMLTemplateElement?t.content.cloneNode(!0):t==null?void 0:t.cloneNode(!0)})}render(){return B`
202
202
  <style>
203
203
  :host(:where(:not([hidden]))) {
204
204
  position: relative;
@@ -210,9 +210,9 @@ var sn=(o,E,L)=>{if(!E.has(o))throw TypeError("Cannot "+L)};var f=(o,E,L)=>(sn(o
210
210
  height: 100%;
211
211
  }
212
212
  </style>
213
- ${f(this,xe).call(this)}
213
+ ${f(this,Be).call(this)}
214
214
  <slot></slot>
215
- `}}xe=new WeakMap,yt([$],we.prototype,"selector",2),yt([q],we.prototype,"root",2),yt([q],we.prototype,"element",2),yt([ut],we.prototype,"active",2),customElements.define("gem-use",we);var ri=Object.defineProperty,oi=Object.getOwnPropertyDescriptor,is=(n,e,t,s)=>{for(var i=s>1?void 0:s?oi(e,t):e,r=n.length-1,a;r>=0;r--)(a=n[r])&&(i=(s?a(e,t,i):a(i))||i);return s&&i&&ri(e,t,i),i};class wt extends R{constructor(){super(),this.effect(()=>{this.shadowRoot&&(this.shadowRoot.innerHTML=`
215
+ `}}Be=new WeakMap,vt([$],Ee.prototype,"selector",2),vt([j],Ee.prototype,"root",2),vt([j],Ee.prototype,"element",2),vt([mt],Ee.prototype,"active",2),customElements.define("gem-use",Ee);var fi=Object.defineProperty,mi=Object.getOwnPropertyDescriptor,cs=(n,e,t,s)=>{for(var i=s>1?void 0:s?mi(e,t):e,r=n.length-1,a;r>=0;r--)(a=n[r])&&(i=(s?a(e,t,i):a(i))||i);return s&&i&&fi(e,t,i),i};class St extends M{constructor(){super(),this.effect(()=>{this.shadowRoot&&(this.shadowRoot.innerHTML=`
216
216
  <style>
217
217
  :host(:where(:not([hidden]))) {
218
218
  display: contents;
@@ -220,4 +220,4 @@ var sn=(o,E,L)=>{if(!E.has(o))throw TypeError("Cannot "+L)};var f=(o,E,L)=>(sn(o
220
220
  ${this.contentcss}
221
221
  </style>
222
222
  ${this.content}
223
- `)},()=>[this.content,this.contentcss])}render(){}}is([$],wt.prototype,"content",2),is([$],wt.prototype,"contentcss",2),customElements.define("gem-unsafe",wt);var ai=Object.defineProperty,ci=Object.getOwnPropertyDescriptor,li=(n,e,t,s)=>{for(var i=s>1?void 0:s?ci(e,t):e,r=n.length-1,a;r>=0;r--)(a=n[r])&&(i=(s?a(e,t,i):a(i))||i);return s&&i&&ai(e,t,i),i};class Zt extends R{constructor(){super({isLight:!0}),this.target=document.head,this.hidden=!0,this.dataset.gemReflect="",this.effect(()=>{const e=[...this.childNodes];return e.forEach(t=>{t instanceof HTMLElement&&(t.dataset.reflect=""),this.target.append(t)}),()=>{e.forEach(t=>t.remove())}},()=>[this.target])}}li([q],Zt.prototype,"target",2),customElements.define("gem-reflect",Zt);const Et=Symbol("open mark");function hi(n){var e;const t=Symbol();return e=class extends R{constructor(){super(),this.label="",this.internals.role="alertdialog",this.internals.ariaModal="true"}static get isOpen(){return this.store[Et]}static get observedStores(){return[v.store,this.store]}static open(s){const i=new this;this.instance=i,this.inertStore=[...document.body.children].filter(a=>!a.inert),this.inertStore.forEach(a=>a.inert=!0),document.body.append(i);const r=()=>k(this.store,{[Et]:!0,...s});return setTimeout(()=>{r(),v.push({title:i.label,open:r,close:this.closeHandle.bind(this),shouldClose:this.shouldClose.bind(this)})},100),t}static close(){return v.back(),t}static closeHandle(){var s;return this.inertStore.forEach(i=>i.inert=!1),(s=this.instance)==null||s.remove(),k(this.store,{[Et]:!1,...n}),t}static shouldClose(){return!0}},e.inertStore=[],e.instance=null,e.store=K({[Et]:!1,...n}),e}var ui=Object.defineProperty,di=Object.getOwnPropertyDescriptor,en=(n,e,t,s)=>{for(var i=s>1?void 0:s?di(e,t):e,r=n.length-1,a;r>=0;r--)(a=n[r])&&(i=(s?a(e,t,i):a(i))||i);return s&&i&&ui(e,t,i),i};const Ie=Symbol();o.GemDialogBaseElement=(ms=class extends R{constructor(){super();w(this,_e,void 0);w(this,ve,void 0);w(this,ce,void 0);C(this,ce,[]),this.closeHandle=()=>{var e;return this.inert=!0,f(this,ce).forEach(t=>t.inert=!1),f(this,_e)?f(this,_e).before(this):f(this,ve)&&((e=f(this,ve))==null||e.appendChild(this)),this.dispatchEvent(new CustomEvent("close")),this.opened=!1,Ie},this.openHandle=()=>(this.hidden=!1,this.inert=!1,C(this,_e,this.nextSibling),C(this,ve,this.parentElement||this.getRootNode()),C(this,ce,[...document.body.children].filter(e=>!e.inert)),f(this,ce).forEach(e=>e.inert=!0),document.body.append(this),this.dispatchEvent(new CustomEvent("open")),this.opened=!0,Ie),this.open=()=>{if(!this.opened)return this.openHandle(),v.push({title:this.label,open:this.openHandle,close:this.closeHandle,shouldClose:this.shouldClose}),Ie},this.close=()=>(v.back(),Ie),this.forceClose=()=>(this.opened=!1,setTimeout(this.close,100),Ie),this.inert=!0,this.internals.role="dialog",this.internals.ariaModal="true"}shouldClose(){return!0}},_e=new WeakMap,ve=new WeakMap,ce=new WeakMap,ms),en([$],o.GemDialogBaseElement.prototype,"label",2),en([ut],o.GemDialogBaseElement.prototype,"opened",2),o.GemDialogBaseElement=en([ge(v.store)],o.GemDialogBaseElement);const rs=new WeakMap;function os(n){return rs.get(n)}const as=new WeakMap;function fi(n){return as.get(n)}const cs=new WeakMap;function mi(n){const e=Ke(),t=document.createElement("style"),s=K(n),i={},r={};as.set(i,r),rs.set(i,s);const a=()=>Object.keys(s).forEach(h=>{r[h]||(r[h]=`--${j(h)}-${e}`,i[h]=`var(${r[h]})`)});cs.set(i,a),a();const c=()=>`:root, :host {${Object.keys(s).reduce((h,p)=>h+`${r[p]}:${s[p]};`,"")}}`,l=()=>t.textContent=c();return de(s,l),l(),(document.head||document.documentElement).append(t),i}function pi(n,e){k(os(n),e),cs.get(n)()}const gi=/\$\d(?:<[^>]*>)?/,yi=/\$(\d)(<([^>]*)>)?/g,wi=3;function ls(n,...e){const t=n.split(gi),s=[];let i;for(;i=yi.exec(n);){const r=i[wi],a=Number(i[1])-1,c=e[a];s.push(typeof c=="function"?c(r):c)}return W(t,...s)}const We=new Set,nn=class{constructor(e){w(this,Se);w(this,St);w(this,bt);w(this,le);w(this,be);if(this.cachePrefix="gem-i18n",!e.resources[e.fallbackLanguage])throw new z("i18n: fallbackLanguage invalid");this.store=K(this),Object.assign(this,e);let t=f(this,St,gs)||this.currentLanguage||f(this,bt,ys);const s=document.querySelector(`[type*=${this.cachePrefix}]`);if(s)try{const i=JSON.parse(s.textContent||"");t=i.currentLanguage,this.resources[i.currentLanguage]=i.currentLanguagePack}catch{}t?(C(this,be,t,Ct),this.setLanguage(t)):this.resetLanguage()}get(e,...t){const s=this.resources[this.currentLanguage],i=this.resources[this.fallbackLanguage],r=s[e]||i[e],a=(r==null?void 0:r.message)||r||`[${e}]`;return t.length?ls(a,...t):a}detectLanguage(){const e=Object.keys(this.resources),t=navigator.languages.map(s=>s.replace(/-(.*)/,i=>i.toUpperCase()));for(const s of t){const i=e.find(r=>r===s||s.startsWith(`${r}-`));if(i)return i}return this.fallbackLanguage}async setLanguage(e){f(this,le,Fe)&&We.forEach(async i=>await i.setLanguage(e));let t;const s=this.resources[e];if(!s)return console.warn(`${this.cachePrefix}: not found \`${e}\``),this.resetLanguage();if(typeof s=="string"){const i=`${this.cachePrefix}:`,r=`${i}${s}`,a=localStorage.getItem(r),c=async()=>{const l=await(await fetch(s)).json();if(this.cache){for(let h=0;h<localStorage.length;h++){const p=localStorage.key(h);p.startsWith(i)&&localStorage.removeItem(p)}localStorage.setItem(r,JSON.stringify(l))}return l};if(a)try{t=JSON.parse(a)}catch{t=await c()}else t=await c()}else t=s;return this.resources[e]=t,k(this.store,{}),e!==this.currentLanguage&&C(this,be,e,Ct),this.cache===!0&&this.setCache(),e}resetLanguage(){return f(this,le,Fe)&&We.forEach(e=>e.resetLanguage()),C(this,be,this.fallbackLanguage,Ct),this.cache&&localStorage.removeItem(f(this,Se,Pt)),this.setLanguage(this.detectLanguage())}setCache(){f(this,le,Fe)&&We.forEach(e=>e.setCache()),localStorage.setItem(f(this,Se,Pt),this.currentLanguage)}createSubModule(e,t){const s=new nn({resources:t,cachePrefix:`${this.cachePrefix}-${e}`,currentLanguage:this.currentLanguage,fallbackLanguage:this.fallbackLanguage,cache:this.cache});return We.add(s),s}toJSON(){return{currentLanguage:this.currentLanguage,currentLanguagePack:this.resources[this.currentLanguage]}}};let tn=nn;Se=new WeakSet,Pt=function(){return`${this.cachePrefix}:current`},St=new WeakSet,gs=function(){const{hostname:e,pathname:t,search:s}=location,i=e.split(".");switch(this.urlParamsType){case"ccTLD":return i.pop();case"gTLD":return i.shift();case"path":return t.split("/")[1];default:const r=this.urlParamsName&&new URLSearchParams(s).get(this.urlParamsName)||"";return r in this.resources?r:""}},bt=new WeakSet,ys=function(){return this.cache&&localStorage.getItem(f(this,Se,Pt))||""},le=new WeakSet,Fe=function(){return!We.has(this)},be=new WeakSet,Ct=function(e){var t;f(this,le,Fe)&&(document.documentElement.lang=e),this.currentLanguage=e,(t=this.onChange)==null||t.call(this,e)};const hs={headers:{"Content-Type":"application/json"}};async function Ve(n,e={}){const t=await fetch(n,{...hs,...e});if(t.status===0)throw new Error("Request fail");if(t.status>=500)throw new Error(t.statusText);try{const s=await t.json();if(t.status>=400)throw new Error((s==null?void 0:s.message)||t.statusText,{cause:s});return s}catch{throw new Error("Server error")}}const Ei=Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)).constructor;function us(n){return n instanceof FormData||n instanceof Blob||n instanceof Ei||n instanceof URLSearchParams||n instanceof ReadableStream||n instanceof ArrayBuffer?n:typeof n=="object"?JSON.stringify(n):n}function ds(n,e){const{origin:t,pathname:s,search:i}=new URL(n,location.origin),r=new URLSearchParams(e).toString();return`${t}${s}${i?`${i}&`:r?"?":""}${r}`}function _i(n,e){return Ve(ds(n,e),{method:"GET"})}function vi(n,e){return Ve(ds(n,e),{method:"DELETE"})}function Si(n,e){return Ve(n,{method:"PUT",body:us(e)})}function bi(n,e){return Ve(n,{method:"POST",body:us(e)})}const N=n=>window.matchMedia(n).matches,Pi={PRINT:"print",get isPrint(){return N(this.PRINT)},HOVER:"(hover: hover)",get isHover(){return N(this.HOVER)},PWA:"(display-mode: standalone)",get isPWA(){return N(this.PWA)},MOTION_REDUCE:"(prefers-reduced-motion: reduce)",get isMotionReduce(){return N(this.MOTION_REDUCE)},DATA_REDUCE:"(prefers-reduced-data: reduce)",get isDataReduce(){return N(this.DATA_REDUCE)},WATCH:"(width < 320px)",get isWatch(){return N(this.WATCH)},SMALL_PHONE:"(320px <= width <= 480px) and (height <= 640px)",get isSmallPhone(){return N(this.SMALL_PHONE)},PHONE:"(320px <= width <= 480px)",get isPhone(){return N(this.PHONE)},PHONE_LANDSCAPE:"(480px < width < 960px) and (orientation: landscape)",get isPhoneLandscape(){return N(this.PHONE_LANDSCAPE)},SHORT:"(width >= 480px) and (height <= 320px)",get isShort(){return N(this.SHORT)},TABLET:"(480px < width <= 1280px)",get isTablet(){return N(this.TABLET)},DESKTOP:"(width > 1280px) and (orientation: landscape)",get isDesktop(){return N(this.DESKTOP)},WIDTHSCREEN:"(width >= 1920px) and (orientation: landscape)",get isWidthScreen(){return N(this.WIDTHSCREEN)}};o.GemElement=R,o.GemError=z,o.GemLightRouteElement=Yn,o.GemReflectElement=Zt,o.GemUnsafeElement=wt,o.GemUseElement=we,o.I18n=tn,o.LinkedList=vn,o.PREFIX=ts,o.PropProxyMap=Sn,o.QueryString=$e,o.SUFFIX=ns,o.SVGTemplateResult=Lt,o.SheetToken=Nt,o.StoreListenerMap=ue,o.TemplateResult=ke,o.absoluteLocation=Ot,o.addMicrotask=V,o.addMicrotaskToStack=$s,o.adoptedStyle=xs,o.attribute=$,o.basePathStore=Kn,o.boolattribute=Wn,o.camelToKebabCase=j,o.classMap=kn,o.cleanObject=Je,o.connect=de,o.connectStore=ge,o.createCSSSheet=Rs,o.createHistoryParams=Xn,o.createModalClass=hi,o.createPath=Xt,o.createStore=K,o.createStoreSet=Is,o.createTheme=mi,o.css=Ms,o.customElement=Fs,o.defaultReqInit=hs,o.defineAttribute=at,o.defineCSSState=lt,o.defineProperty=pe,o.defineRef=ct,o.del=vi,o.directive=Y,o.disconnect=Tn,o.emitter=dt,o.exportPartsMap=Hs,o.get=_i,o.getThemeProps=fi,o.getThemeStore=os,o.globalemitter=Us,o.guard=An,o.history=v,o.html=W,o.ifDefined=Wt,o.isArrayChange=Pn,o.kebabToCamelCase=ee,o.matchPath=Qt,o.mediaQuery=Pi,o.nativeDefineElement=ht,o.numattribute=Ds,o.objectMapToString=Qe,o.part=Vn,o.partMap=Gs,o.post=bi,o.property=q,o.put=Si,o.randomStr=Ke,o.raw=Me,o.refobject=js,o.removeItems=Cn,o.render=ze,o.repeat=Nn,o.request=Ve,o.rootElement=Bs,o.slot=qs,o.splice=ls,o.state=ut,o.styleMap=As,o.styled=Ns,o.svg=_n,o.titleStore=ye,o.updateStore=k,o.updateTheme=pi,o.version=Ln,Object.defineProperties(o,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
223
+ `)},()=>[this.content,this.contentcss])}render(){}}cs([$],St.prototype,"content",2),cs([$],St.prototype,"contentcss",2),customElements.define("gem-unsafe",St);var pi=Object.defineProperty,gi=Object.getOwnPropertyDescriptor,yi=(n,e,t,s)=>{for(var i=s>1?void 0:s?gi(e,t):e,r=n.length-1,a;r>=0;r--)(a=n[r])&&(i=(s?a(e,t,i):a(i))||i);return s&&i&&pi(e,t,i),i};class sn extends M{constructor(){super({isLight:!0}),this.target=document.head,this.hidden=!0,this.dataset.gemReflect="",this.effect(()=>{const e=[...this.childNodes];return e.forEach(t=>{t instanceof HTMLElement&&(t.dataset.reflect=""),this.target.append(t)}),()=>{e.forEach(t=>t.remove())}},()=>[this.target])}}yi([j],sn.prototype,"target",2),customElements.define("gem-reflect",sn);const bt=Symbol("open mark");function wi(n){var e;const t=Symbol();return e=class extends M{constructor(){super(),this.label="",this.internals.role="alertdialog",this.internals.ariaModal="true"}static get isOpen(){return this.store[bt]}static get observedStores(){return[v.store,this.store]}static open(s){const i=new this;this.instance=i,this.inertStore=[...document.body.children].filter(a=>!a.inert),this.inertStore.forEach(a=>a.inert=!0),document.body.append(i);const r=()=>K(this.store,{[bt]:!0,...s});return setTimeout(()=>{r(),v.push({title:i.label,open:r,close:this.closeHandle.bind(this),shouldClose:this.shouldClose.bind(this)})},100),t}static close(){return v.back(),t}static closeHandle(){var s;return this.inertStore.forEach(i=>i.inert=!1),(s=this.instance)==null||s.remove(),K(this.store,{[bt]:!1,...n}),t}static shouldClose(){return!0}},e.inertStore=[],e.instance=null,e.store=fe({[bt]:!1,...n}),e}var Ei=Object.defineProperty,_i=Object.getOwnPropertyDescriptor,rn=(n,e,t,s)=>{for(var i=s>1?void 0:s?_i(e,t):e,r=n.length-1,a;r>=0;r--)(a=n[r])&&(i=(s?a(e,t,i):a(i))||i);return s&&i&&Ei(e,t,i),i};const Ie=Symbol();o.GemDialogBaseElement=(_s=class extends M{constructor(){super();E(this,ve,void 0);E(this,Se,void 0);E(this,le,void 0);P(this,le,[]),this.closeHandle=()=>{var e;return this.inert=!0,f(this,le).forEach(t=>t.inert=!1),f(this,ve)?f(this,ve).before(this):f(this,Se)&&((e=f(this,Se))==null||e.appendChild(this)),this.dispatchEvent(new CustomEvent("close")),this.opened=!1,Ie},this.openHandle=()=>(this.hidden=!1,this.inert=!1,P(this,ve,this.nextSibling),P(this,Se,this.parentElement||this.getRootNode()),P(this,le,[...document.body.children].filter(e=>!e.inert)),f(this,le).forEach(e=>e.inert=!0),document.body.append(this),this.dispatchEvent(new CustomEvent("open")),this.opened=!0,Ie),this.open=()=>{if(!this.opened)return this.openHandle(),v.push({title:this.label,open:this.openHandle,close:this.closeHandle,shouldClose:this.shouldClose}),Ie},this.close=()=>(v.back(),Ie),this.forceClose=()=>(this.opened=!1,setTimeout(this.close,100),Ie),this.inert=!0,this.internals.role="dialog",this.internals.ariaModal="true"}shouldClose(){return!0}},ve=new WeakMap,Se=new WeakMap,le=new WeakMap,_s),rn([$],o.GemDialogBaseElement.prototype,"label",2),rn([mt],o.GemDialogBaseElement.prototype,"opened",2),o.GemDialogBaseElement=rn([He(v.store)],o.GemDialogBaseElement);const ls=new WeakMap;function hs(n){return ls.get(n)}const us=new WeakMap;function vi(n){return us.get(n)}const ds=new WeakMap;function fs(n){const e=Je(),t=document.createElement("style"),s=fe(n),i={},r={};us.set(i,r),ls.set(i,s);const a=()=>Object.keys(s).forEach(h=>{r[h]||(r[h]=`--${V(h)}-${e}`,i[h]=`var(${r[h]})`)});ds.set(i,a),a();const c=()=>`:root, :host {${Object.keys(s).reduce((h,p)=>h+`${r[p]}:${s[p]};`,"")}}`,l=()=>t.textContent=c();return re(s,l),l(),(document.head||document.documentElement).append(t),i}function ms(n,e){K(hs(n),e),ds.get(n)()}function Si(n){const e=fs(n);return[e,t=>ms(e,t)]}const bi=/\$\d(?:<[^>]*>)?/,Pi=/\$(\d)(<([^>]*)>)?/g,Ci=3;function ps(n,...e){const t=n.split(bi),s=[];let i;for(;i=Pi.exec(n);){const r=i[Ci],a=Number(i[1])-1,c=e[a];s.push(typeof c=="function"?c(r):c)}return B(t,...s)}const Ve=new Set,an=class{constructor(e){E(this,be);E(this,Lt);E(this,kt);E(this,he);E(this,Pe);if(this.cachePrefix="gem-i18n",!e.resources[e.fallbackLanguage])throw new z("i18n: fallbackLanguage invalid");this.store=fe(this),Object.assign(this,e);let t=f(this,Lt,Ss)||this.currentLanguage||f(this,kt,bs);const s=document.querySelector(`[type*=${this.cachePrefix}]`);if(s)try{const i=JSON.parse(s.textContent||"");t=i.currentLanguage,this.resources[i.currentLanguage]=i.currentLanguagePack}catch{}t?(P(this,Pe,t,Tt),this.setLanguage(t)):this.resetLanguage()}get(e,...t){const s=this.resources[this.currentLanguage],i=this.resources[this.fallbackLanguage],r=s[e]||i[e],a=(r==null?void 0:r.message)||r||`[${e}]`;return t.length?ps(a,...t):a}detectLanguage(){const e=Object.keys(this.resources),t=navigator.languages.map(s=>s.replace(/-(.*)/,i=>i.toUpperCase()));for(const s of t){const i=e.find(r=>r===s||s.startsWith(`${r}-`));if(i)return i}return this.fallbackLanguage}async setLanguage(e){f(this,he,ze)&&Ve.forEach(async i=>await i.setLanguage(e));let t;const s=this.resources[e];if(!s)return console.warn(`${this.cachePrefix}: not found \`${e}\``),this.resetLanguage();if(typeof s=="string"){const i=`${this.cachePrefix}:`,r=`${i}${s}`,a=localStorage.getItem(r),c=async()=>{const l=await(await fetch(s)).json();if(this.cache){for(let h=0;h<localStorage.length;h++){const p=localStorage.key(h);p.startsWith(i)&&localStorage.removeItem(p)}localStorage.setItem(r,JSON.stringify(l))}return l};if(a)try{t=JSON.parse(a)}catch{t=await c()}else t=await c()}else t=s;return this.resources[e]=t,K(this.store,{}),e!==this.currentLanguage&&P(this,Pe,e,Tt),this.cache===!0&&this.setCache(),e}resetLanguage(){return f(this,he,ze)&&Ve.forEach(e=>e.resetLanguage()),P(this,Pe,this.fallbackLanguage,Tt),this.cache&&localStorage.removeItem(f(this,be,$t)),this.setLanguage(this.detectLanguage())}setCache(){f(this,he,ze)&&Ve.forEach(e=>e.setCache()),localStorage.setItem(f(this,be,$t),this.currentLanguage)}createSubModule(e,t){const s=new an({resources:t,cachePrefix:`${this.cachePrefix}-${e}`,currentLanguage:this.currentLanguage,fallbackLanguage:this.fallbackLanguage,cache:this.cache});return Ve.add(s),s}toJSON(){return{currentLanguage:this.currentLanguage,currentLanguagePack:this.resources[this.currentLanguage]}}};let on=an;be=new WeakSet,$t=function(){return`${this.cachePrefix}:current`},Lt=new WeakSet,Ss=function(){const{hostname:e,pathname:t,search:s}=location,i=e.split(".");switch(this.urlParamsType){case"ccTLD":return i.pop();case"gTLD":return i.shift();case"path":return t.split("/")[1];default:const r=this.urlParamsName&&new URLSearchParams(s).get(this.urlParamsName)||"";return r in this.resources?r:""}},kt=new WeakSet,bs=function(){return this.cache&&localStorage.getItem(f(this,be,$t))||""},he=new WeakSet,ze=function(){return!Ve.has(this)},Pe=new WeakSet,Tt=function(e){var t;f(this,he,ze)&&(document.documentElement.lang=e),this.currentLanguage=e,(t=this.onChange)==null||t.call(this,e)};const gs={headers:{"Content-Type":"application/json"}};async function xe(n,e={}){const t=await fetch(n,{...gs,...e});if(t.status===0)throw new Error("Request fail");if(t.status>=500)throw new Error(t.statusText);try{const s=await t.json();if(t.status>=400)throw new Error((s==null?void 0:s.message)||t.statusText,{cause:s});return s}catch{throw new Error("Server error")}}const Li=Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)).constructor;function ys(n){return n instanceof FormData||n instanceof Blob||n instanceof Li||n instanceof URLSearchParams||n instanceof ReadableStream||n instanceof ArrayBuffer?n:typeof n=="object"?JSON.stringify(n):n}function ws(n,e){const{origin:t,pathname:s,search:i}=new URL(n,location.origin),r=new URLSearchParams(e).toString();return`${t}${s}${i?`${i}&`:r?"?":""}${r}`}function ki(n,e){return xe(ws(n,e),{method:"GET"})}function $i(n,e){return xe(ws(n,e),{method:"DELETE"})}function Ti(n,e){return xe(n,{method:"PUT",body:ys(e)})}function Mi(n,e){return xe(n,{method:"POST",body:ys(e)})}const O=n=>window.matchMedia(n).matches,Ri={PRINT:"print",get isPrint(){return O(this.PRINT)},HOVER:"(hover: hover)",get isHover(){return O(this.HOVER)},PWA:"(display-mode: standalone)",get isPWA(){return O(this.PWA)},MOTION_REDUCE:"(prefers-reduced-motion: reduce)",get isMotionReduce(){return O(this.MOTION_REDUCE)},DATA_REDUCE:"(prefers-reduced-data: reduce)",get isDataReduce(){return O(this.DATA_REDUCE)},WATCH:"(width < 320px)",get isWatch(){return O(this.WATCH)},SMALL_PHONE:"(320px <= width <= 480px) and (height <= 640px)",get isSmallPhone(){return O(this.SMALL_PHONE)},PHONE:"(320px <= width <= 480px)",get isPhone(){return O(this.PHONE)},PHONE_LANDSCAPE:"(480px < width < 960px) and (orientation: landscape)",get isPhoneLandscape(){return O(this.PHONE_LANDSCAPE)},SHORT:"(width >= 480px) and (height <= 320px)",get isShort(){return O(this.SHORT)},TABLET:"(480px < width <= 1280px)",get isTablet(){return O(this.TABLET)},DESKTOP:"(width > 1280px) and (orientation: landscape)",get isDesktop(){return O(this.DESKTOP)},WIDTHSCREEN:"(width >= 1920px) and (orientation: landscape)",get isWidthScreen(){return O(this.WIDTHSCREEN)}};o.GemElement=M,o.GemError=z,o.GemLightRouteElement=ts,o.GemReflectElement=sn,o.GemTitleElement=H,o.GemUnsafeElement=St,o.GemUseElement=Ee,o.I18n=on,o.LinkedList=Cn,o.PREFIX=is,o.PropProxyMap=Ln,o.QueryString=Me,o.SUFFIX=rs,o.SVGTemplateResult=Nt,o.SheetToken=Wt,o.StoreListenerMap=de,o.TemplateResult=ke,o.absoluteLocation=Gt,o.addMicrotask=I,o.addMicrotaskToStack=Hs,o.adoptedStyle=Qs,o.attribute=$,o.basePathStore=Xn,o.boolattribute=Xt,o.camelToKebabCase=V,o.classMap=Mn,o.cleanObject=Qe,o.connect=re,o.connectStore=He,o.createCSSSheet=Ws,o.createHistoryParams=es,o.createModalClass=wi,o.createPath=tn,o.createStore=fe,o.createTheme=fs,o.css=Gs,o.customElement=Ys,o.defaultReqInit=gs,o.defineAttribute=ht,o.defineCSSState=dt,o.defineProperty=ge,o.defineRef=ut,o.del=$i,o.directive=Y,o.disconnect=qs,o.emitter=pt,o.exportPartsMap=Ds,o.get=ki,o.getThemeProps=vi,o.getThemeStore=hs,o.globalemitter=Js,o.guard=Wn,o.history=v,o.html=B,o.ifDefined=Dt,o.isArrayChange=$n,o.kebabToCamelCase=ee,o.matchPath=en,o.mediaQuery=Ri,o.nativeDefineElement=ft,o.numattribute=zs,o.objectMapToString=Xe,o.part=jn,o.partMap=js,o.post=Mi,o.property=j,o.put=Ti,o.randomStr=Je,o.raw=Re,o.refobject=Fs,o.removeItems=Tn,o.render=Ke,o.repeat=Gn,o.request=xe,o.rootElement=Xs,o.slot=Ks,o.splice=ps,o.state=mt,o.styleMap=xs,o.styled=Vs,o.svg=Pn,o.titleStore=we,o.updateStore=K,o.updateTheme=ms,o.useStore=Ye,o.useTheme=Si,o.version=Rn,Object.defineProperties(o,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -71,6 +71,7 @@ export declare function createModalClass<T extends Record<string, unknown>>(opti
71
71
  "__#3@#updated": () => void;
72
72
  unmounted?(): void | Promise<void>;
73
73
  attributeChangedCallback(): symbol;
74
+ "__#3@#disconnectStore"?: (() => void)[] | undefined;
74
75
  "__#3@#connectedCallback": () => void;
75
76
  closestElement<K extends keyof HTMLElementTagNameMap>(tag: K): HTMLElementTagNameMap[K] | null;
76
77
  closestElement<K_1 extends abstract new (...args: any) => any>(constructor: K_1): InstanceType<K_1> | null;
@@ -1 +1 @@
1
- {"version":3,"file":"modal-factory.d.ts","sourceRoot":"","sources":["../../src/elements/base/modal-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI/C,QAAA,MAAM,IAAI,eAAsB,CAAC;AAEjC;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;;;;;;;;;;;;;;8CAiD1E;;;eAGG;;;;;;;;8CAHH;;;eAGG;;;;;;;;;;;8CAHH;;;eAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8CAHH;;;eAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAhDgB,WAAW,EAAE;cACf,UAAU,GAAG,IAAI;IAClC;;;OAGG;;;;IAMH,YAAY;;IAKZ,YAAY;;;;IAKZ;;;;OAIG;eACe,CAAC;IAmBnB;;;OAGG;;IAMH;;;OAGG;;IAQH;;OAEG;;;;;;;;;;;;;EAaN"}
1
+ {"version":3,"file":"modal-factory.d.ts","sourceRoot":"","sources":["../../src/elements/base/modal-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI/C,QAAA,MAAM,IAAI,eAAsB,CAAC;AAEjC;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;;;;;;;;;;;;;;8CAiD1E;;;eAGG;;;;;;;;8CAHH;;;eAGG;;;;;;;;;;;8CAHH;;;eAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8CAHH;;;eAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAhDgB,WAAW,EAAE;cACf,UAAU,GAAG,IAAI;IAClC;;;OAGG;;;;IAMH,YAAY;;IAKZ,YAAY;;;;IAKZ;;;;OAIG;eACe,CAAC;IAmBnB;;;OAGG;;IAMH;;;OAGG;;IAQH;;OAEG;;;;;;;;;;;;;EAaN"}
@@ -16,13 +16,14 @@ import { GemElement } from '../../lib/element';
16
16
  export declare const PREFIX: string;
17
17
  export declare const SUFFIX: string;
18
18
  /**
19
- * 允许声明式设置 `document.title`
19
+ * 映射到 `document.title`
20
20
  * @attr prefix
21
21
  * @attr suffix
22
22
  */
23
23
  export declare class GemTitleElement extends GemElement {
24
24
  prefix: string;
25
25
  suffix: string;
26
+ inert: boolean;
26
27
  static title: string;
27
28
  /**@deprecated */
28
29
  static defaultPrefix: string;
@@ -30,6 +31,7 @@ export declare class GemTitleElement extends GemElement {
30
31
  static defaultSuffix: string;
31
32
  static setTitle(title: string): void;
32
33
  constructor();
34
+ mounted: () => void;
33
35
  render(): import("lit-html/lib/template-result").TemplateResult;
34
36
  }
35
37
  //# sourceMappingURL=title.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"title.d.ts","sourceRoot":"","sources":["../../src/elements/base/title.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,UAAU,EAAQ,MAAM,mBAAmB,CAAC;AAkBrD,eAAO,MAAM,MAAM,QAAuB,CAAC;AAC3C,eAAO,MAAM,MAAM,QAAuB,CAAC;AAE3C;;;;GAIG;AACH,qBACa,eAAgB,SAAQ,UAAU;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IAG1B,MAAM,CAAC,KAAK,SAAkB;IAE9B,iBAAiB;IACjB,MAAM,CAAC,aAAa,SAAU;IAC9B,iBAAiB;IACjB,MAAM,CAAC,aAAa,SAAU;IAE9B,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM;;IAY7B,MAAM;CASP"}
1
+ {"version":3,"file":"title.d.ts","sourceRoot":"","sources":["../../src/elements/base/title.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,UAAU,EAAQ,MAAM,mBAAmB,CAAC;AAoBrD,eAAO,MAAM,MAAM,QAAuB,CAAC;AAC3C,eAAO,MAAM,MAAM,QAAuB,CAAC;AAE3C;;;;GAIG;AACH,qBAAa,eAAgB,SAAQ,UAAU;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,OAAO,CAAC;IAG9B,MAAM,CAAC,KAAK,SAAkB;IAE9B,iBAAiB;IACjB,MAAM,CAAC,aAAa,SAAU;IAC9B,iBAAiB;IACjB,MAAM,CAAC,aAAa,SAAU;IAE9B,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM;;IAY7B,OAAO,aAKL;IAEF,MAAM;CAKP"}
@@ -18,13 +18,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
18
18
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
19
19
  return c > 3 && r && Object.defineProperty(target, key, r), r;
20
20
  };
21
- var GemTitleElement_1;
22
21
  import { GemElement, html } from '../../lib/element';
23
- import { attribute, connectStore } from '../../lib/decorators';
22
+ import { attribute, boolattribute } from '../../lib/decorators';
24
23
  import { updateStore, connect } from '../../lib/store';
25
24
  import { titleStore } from '../../lib/history';
26
25
  const defaultTitle = document.title;
27
- function updateTitle(str, prefix = '', suffix = '') {
26
+ function setDocumentTitle(str, prefix = '', suffix = '') {
28
27
  const title = titleStore.title || str;
29
28
  if (title && title !== defaultTitle) {
30
29
  GemTitleElement.title = title;
@@ -35,33 +34,35 @@ function updateTitle(str, prefix = '', suffix = '') {
35
34
  document.title = GemTitleElement.title;
36
35
  }
37
36
  }
37
+ connect(titleStore, setDocumentTitle);
38
38
  export const PREFIX = `${defaultTitle} | `;
39
39
  export const SUFFIX = ` - ${defaultTitle}`;
40
40
  /**
41
- * 允许声明式设置 `document.title`
41
+ * 映射到 `document.title`
42
42
  * @attr prefix
43
43
  * @attr suffix
44
44
  */
45
- let GemTitleElement = GemTitleElement_1 = class GemTitleElement extends GemElement {
45
+ export class GemTitleElement extends GemElement {
46
46
  static setTitle(title) {
47
47
  updateStore(titleStore, { title });
48
48
  }
49
49
  constructor() {
50
50
  super();
51
+ this.mounted = () => {
52
+ this.effect(() => !this.inert && connect(titleStore, this.update), () => [this.inert]);
53
+ };
51
54
  new MutationObserver(() => this.update()).observe(this, {
52
55
  characterData: true,
53
56
  subtree: true,
54
57
  });
55
58
  }
56
59
  render() {
60
+ var _a;
57
61
  // 多个 <gem-title> 时,最终 document.title 按执行顺序决定
58
- updateTitle(this.textContent, this.prefix, this.suffix);
59
- if (this.hidden) {
60
- return html ``;
61
- }
62
- return html `${GemTitleElement_1.title}`;
62
+ setDocumentTitle((_a = this.textContent) === null || _a === void 0 ? void 0 : _a.trim(), this.prefix, this.suffix);
63
+ return html `${GemTitleElement.title}`;
63
64
  }
64
- };
65
+ }
65
66
  // 没有后缀的当前标题
66
67
  GemTitleElement.title = document.title;
67
68
  /**@deprecated */
@@ -74,9 +75,7 @@ __decorate([
74
75
  __decorate([
75
76
  attribute
76
77
  ], GemTitleElement.prototype, "suffix", void 0);
77
- GemTitleElement = GemTitleElement_1 = __decorate([
78
- connectStore(titleStore)
79
- ], GemTitleElement);
80
- export { GemTitleElement };
81
- connect(titleStore, updateTitle);
78
+ __decorate([
79
+ boolattribute
80
+ ], GemTitleElement.prototype, "inert", void 0);
82
81
  //# sourceMappingURL=title.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"title.js","sourceRoot":"","sources":["../../src/elements/base/title.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;;;;;;;;AAEH,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,YAAY,GAAG,QAAQ,CAAC,KAAK,CAAC;AAEpC,SAAS,WAAW,CAAC,GAAmB,EAAE,MAAM,GAAG,EAAE,EAAE,MAAM,GAAG,EAAE;IAChE,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,IAAI,GAAG,CAAC;IACtC,IAAI,KAAK,IAAI,KAAK,KAAK,YAAY,EAAE,CAAC;QACpC,eAAe,CAAC,KAAK,GAAG,KAAK,CAAC;QAC9B,QAAQ,CAAC,KAAK,GAAG,MAAM,GAAG,eAAe,CAAC,KAAK,GAAG,MAAM,CAAC;IAC3D,CAAC;SAAM,CAAC;QACN,eAAe,CAAC,KAAK,GAAG,YAAY,CAAC;QACrC,QAAQ,CAAC,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC;IACzC,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,YAAY,KAAK,CAAC;AAC3C,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,YAAY,EAAE,CAAC;AAE3C;;;;GAIG;AAEI,IAAM,eAAe,uBAArB,MAAM,eAAgB,SAAQ,UAAU;IAY7C,MAAM,CAAC,QAAQ,CAAC,KAAa;QAC3B,WAAW,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IACrC,CAAC;IAED;QACE,KAAK,EAAE,CAAC;QACR,IAAI,gBAAgB,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE;YACtD,aAAa,EAAE,IAAI;YACnB,OAAO,EAAE,IAAI;SACd,CAAC,CAAC;IACL,CAAC;IAED,MAAM;QACJ,6CAA6C;QAC7C,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAExD,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,OAAO,IAAI,CAAA,EAAE,CAAC;QAChB,CAAC;QACD,OAAO,IAAI,CAAA,GAAG,iBAAe,CAAC,KAAK,EAAE,CAAC;IACxC,CAAC;;AA5BD,YAAY;AACL,qBAAK,GAAG,QAAQ,CAAC,KAAK,AAAjB,CAAkB;AAE9B,iBAAiB;AACV,6BAAa,GAAG,MAAM,AAAT,CAAU;AAC9B,iBAAiB;AACV,6BAAa,GAAG,MAAM,AAAT,CAAU;AATnB;IAAV,SAAS;+CAAgB;AACf;IAAV,SAAS;+CAAgB;AAFf,eAAe;IAD3B,YAAY,CAAC,UAAU,CAAC;GACZ,eAAe,CAiC3B;;AAED,OAAO,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC"}
1
+ {"version":3,"file":"title.js","sourceRoot":"","sources":["../../src/elements/base/title.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;;;;;;;AAEH,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,YAAY,GAAG,QAAQ,CAAC,KAAK,CAAC;AAEpC,SAAS,gBAAgB,CAAC,GAAmB,EAAE,MAAM,GAAG,EAAE,EAAE,MAAM,GAAG,EAAE;IACrE,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,IAAI,GAAG,CAAC;IACtC,IAAI,KAAK,IAAI,KAAK,KAAK,YAAY,EAAE,CAAC;QACpC,eAAe,CAAC,KAAK,GAAG,KAAK,CAAC;QAC9B,QAAQ,CAAC,KAAK,GAAG,MAAM,GAAG,eAAe,CAAC,KAAK,GAAG,MAAM,CAAC;IAC3D,CAAC;SAAM,CAAC;QACN,eAAe,CAAC,KAAK,GAAG,YAAY,CAAC;QACrC,QAAQ,CAAC,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC;IACzC,CAAC;AACH,CAAC;AAED,OAAO,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;AAEtC,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,YAAY,KAAK,CAAC;AAC3C,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,YAAY,EAAE,CAAC;AAE3C;;;;GAIG;AACH,MAAM,OAAO,eAAgB,SAAQ,UAAU;IAa7C,MAAM,CAAC,QAAQ,CAAC,KAAa;QAC3B,WAAW,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IACrC,CAAC;IAED;QACE,KAAK,EAAE,CAAC;QAOV,YAAO,GAAG,GAAG,EAAE;YACb,IAAI,CAAC,MAAM,CACT,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,OAAO,CAAC,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,EACrD,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CACnB,CAAC;QACJ,CAAC,CAAC;QAXA,IAAI,gBAAgB,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE;YACtD,aAAa,EAAE,IAAI;YACnB,OAAO,EAAE,IAAI;SACd,CAAC,CAAC;IACL,CAAC;IASD,MAAM;;QACJ,6CAA6C;QAC7C,gBAAgB,CAAC,MAAA,IAAI,CAAC,WAAW,0CAAE,IAAI,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACrE,OAAO,IAAI,CAAA,GAAG,eAAe,CAAC,KAAK,EAAE,CAAC;IACxC,CAAC;;AA/BD,YAAY;AACL,qBAAK,GAAG,QAAQ,CAAC,KAAK,AAAjB,CAAkB;AAE9B,iBAAiB;AACV,6BAAa,GAAG,MAAM,AAAT,CAAU;AAC9B,iBAAiB;AACV,6BAAa,GAAG,MAAM,AAAT,CAAU;AAVnB;IAAV,SAAS;+CAAgB;AACf;IAAV,SAAS;+CAAgB;AACX;IAAd,aAAa;8CAAgB"}
package/helper/theme.d.ts CHANGED
@@ -2,7 +2,9 @@ import { Store } from '../lib/store';
2
2
  type SomeType<T> = {
3
3
  [P in keyof T]: string;
4
4
  };
5
+ /**获取主题原始值 */
5
6
  export declare function getThemeStore<T>(theme: SomeType<T>): Store<T>;
7
+ /**获取 css 变量名 */
6
8
  export declare function getThemeProps<T>(theme: SomeType<T>): SomeType<T>;
7
9
  /**
8
10
  * 创建主题,插入 `document.head`
@@ -20,5 +22,6 @@ export declare function createTheme<T extends Record<string, unknown>>(themeObj:
20
22
  * @param newThemeObj 新主题
21
23
  */
22
24
  export declare function updateTheme<T = Record<string, unknown>>(theme: SomeType<T>, newThemeObj: Partial<T>): void;
25
+ export declare function useTheme<T extends Record<string, unknown>>(themeObj: T): readonly [SomeType<T>, (newThemeObj: Partial<T>) => void];
23
26
  export {};
24
27
  //# sourceMappingURL=theme.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/helper/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,EAAE,MAAM,cAAc,CAAC;AAGxE,KAAK,QAAQ,CAAC,CAAC,IAAI;KAChB,CAAC,IAAI,MAAM,CAAC,GAAG,MAAM;CACvB,CAAC;AAIF,wBAAgB,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,YAElD;AAID,wBAAgB,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,eAElD;AAID;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,EAAE,CAAC,eAuBzE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,QAGnG"}
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/helper/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,EAAE,MAAM,cAAc,CAAC;AAGxE,KAAK,QAAQ,CAAC,CAAC,IAAI;KAChB,CAAC,IAAI,MAAM,CAAC,GAAG,MAAM;CACvB,CAAC;AAIF,aAAa;AACb,wBAAgB,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,YAElD;AAID,gBAAgB;AAChB,wBAAgB,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,eAElD;AAID;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,EAAE,CAAC,eAuBzE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,QAGnG;AAED,wBAAgB,QAAQ,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,EAAE,CAAC,wCAExC,QAAQ,CAAC,CAAC,WACxC"}
package/helper/theme.js CHANGED
@@ -1,10 +1,12 @@
1
1
  import { connect, createStore, updateStore } from '../lib/store';
2
2
  import { camelToKebabCase, randomStr } from '../lib/utils';
3
3
  const themeStoreMap = new WeakMap();
4
+ /**获取主题原始值 */
4
5
  export function getThemeStore(theme) {
5
6
  return themeStoreMap.get(theme);
6
7
  }
7
8
  const themePropsMap = new WeakMap();
9
+ /**获取 css 变量名 */
8
10
  export function getThemeProps(theme) {
9
11
  return themePropsMap.get(theme);
10
12
  }
@@ -50,4 +52,8 @@ export function updateTheme(theme, newThemeObj) {
50
52
  updateStore(getThemeStore(theme), newThemeObj);
51
53
  setThemeFnMap.get(theme)();
52
54
  }
55
+ export function useTheme(themeObj) {
56
+ const theme = createTheme(themeObj);
57
+ return [theme, (newThemeObj) => updateTheme(theme, newThemeObj)];
58
+ }
53
59
  //# sourceMappingURL=theme.js.map