@mantou/gem 2.3.1 → 2.3.3

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.
Files changed (44) hide show
  1. package/AGENTS.md +150 -0
  2. package/dist/gem.js +11 -11
  3. package/dist/gem.mjs +11 -11
  4. package/elements/base/gesture.d.ts.map +1 -1
  5. package/elements/base/gesture.js +20 -1
  6. package/elements/base/gesture.js.map +1 -1
  7. package/elements/base/link.d.ts +2 -1
  8. package/elements/base/link.d.ts.map +1 -1
  9. package/elements/base/link.js +1 -2
  10. package/elements/base/link.js.map +1 -1
  11. package/elements/base/route.d.ts +4 -21
  12. package/elements/base/route.d.ts.map +1 -1
  13. package/elements/base/route.js +2 -83
  14. package/elements/base/route.js.map +1 -1
  15. package/lib/element.d.ts +17 -5
  16. package/lib/element.d.ts.map +1 -1
  17. package/lib/element.js +8 -11
  18. package/lib/element.js.map +1 -1
  19. package/lib/history.d.ts +24 -0
  20. package/lib/history.d.ts.map +1 -1
  21. package/lib/history.js +82 -0
  22. package/lib/history.js.map +1 -1
  23. package/lib/keyed.d.ts +10 -0
  24. package/lib/keyed.d.ts.map +1 -0
  25. package/lib/keyed.js +26 -0
  26. package/lib/keyed.js.map +1 -0
  27. package/lib/lit-html.d.ts.map +1 -1
  28. package/lib/lit-html.js +3 -3
  29. package/lib/lit-html.js.map +1 -1
  30. package/lib/repeat.d.ts.map +1 -1
  31. package/lib/repeat.js +1 -1
  32. package/lib/repeat.js.map +1 -1
  33. package/lib/version.d.ts +1 -1
  34. package/lib/version.js +1 -1
  35. package/package.json +10 -1
  36. package/src/elements/base/gesture.ts +20 -1
  37. package/src/elements/base/link.ts +3 -3
  38. package/src/elements/base/route.ts +4 -96
  39. package/src/lib/element.ts +14 -15
  40. package/src/lib/history.ts +96 -0
  41. package/src/lib/keyed.ts +30 -0
  42. package/src/lib/lit-html.ts +3 -3
  43. package/src/lib/repeat.ts +1 -1
  44. package/src/lib/version.ts +1 -1
package/AGENTS.md ADDED
@@ -0,0 +1,150 @@
1
+ # Gem
2
+
3
+ Rules for writing [Gem](https://gemjs.org) elements. Gem elements extend `GemElement` or its derived classes.
4
+
5
+ ## Gem Syntax Example
6
+
7
+ ```ts
8
+ // Create a store for global state
9
+ // It may also be imported from another module
10
+ const store = createStore({
11
+ globalCount: 1,
12
+ text: '',
13
+ });
14
+
15
+ // A function that updates the store. A store is a data object and also a function that updates it
16
+ // Usually defined in the same module as the store; it may be omitted since `store({})` can be called directly
17
+ const addCount = () => store({ globalCount: store.globalCount + 1 });
18
+
19
+ // Create a theme for element instances
20
+ // Use it when the element's styles depend on its attributes or properties
21
+ // It is a special theme that is also a decorator on the element, updating theme values when the element changes
22
+ const elementTheme = createDecoratorTheme({ color: 'red' });
23
+
24
+ // `css` creates a style sheet that can be adopted by Gem elements, CSS nesting is supported
25
+ // `:host` can only be used when the element uses Shadow DOM via `@shadow`
26
+ // Otherwise use `:scope`; they behave differently, don't just swap one for the other
27
+ // Don't write inline styles in templates; style sheets are shared and separated from the DOM
28
+ // If the project defines a theme, read CSS values from it
29
+ const style = css`
30
+ :scope {
31
+ display: block;
32
+ color: ${theme.textColor};
33
+ }
34
+ `;
35
+
36
+ // For complex elements, define class names this way and reference them in templates as `style1.content`
37
+ const style1 = css({
38
+ // `$` means `:host` or `:scope`
39
+ $: `
40
+ font-size: small;
41
+ `,
42
+ content: `
43
+ font-size: 24px;
44
+ color: ${elementTheme.color};
45
+ `,
46
+ });
47
+
48
+ // Custom element tag name, using the project's namespace, e.g. `dy`
49
+ @customElement('dy-test')
50
+ // Adopt a style sheet, use it multiple times to adopt multiple style sheets
51
+ @adoptedStyle(style)
52
+ @adoptedStyle(style1)
53
+ // Connect a store, the element updates when the store updates; use it multiple times to connect multiple stores
54
+ @connectStore(store)
55
+ // Light DOM by default, `@shadow()` makes it Shadow DOM, the argument is `ShadowRootInit`
56
+ @shadow()
57
+ // Rarely needed, only when the element's content must be styleable from outside
58
+ @light({ penetrable: true })
59
+ // Render without blocking the main thread, useful when many instances render at once
60
+ @async()
61
+ // ARIA properties of the element for accessibility
62
+ @aria({ role: 'region' })
63
+ // Class name: `Duoyun` is the full name of `dy`, followed by `Element`, like native HTML element class names
64
+ class DuoyunTestElement extends GemElement {
65
+ // Define a part; as a static field it can be referenced from outside. No initial value needed, the decorator provides one with the same name
66
+ static @part img: string;
67
+ // Define a slot, same as `@part`
68
+ static @slot content: string;
69
+ // An attribute named `src`, an empty string when not set
70
+ @attribute src: string;
71
+ // An attribute named `count` parsed as a number, `0` when not set
72
+ @numattribute count: number;
73
+ // An attribute named `show` parsed as a boolean, `false` when not set
74
+ @boolattribute show: boolean;
75
+ // Use a property for values attributes can't represent. It may not be set, so always handle the empty case; changes re-render the element
76
+ @property data?: {};
77
+ // Defines a `display-content` event, dispatched by calling `this.displayContent(true)`
78
+ // Only the type is needed, its parameter is the `detail` of the custom event
79
+ // Use `null` when there is no data to pass
80
+ // `@globalemitter` events bubble across Shadow DOM boundaries
81
+ @emitter displayContent: Emitter<boolean>;
82
+ // A CSS custom state, only for outside CSS selectors such as `dy-test:state(open)`
83
+ // Update it with `this.open = true`, no special restrictions
84
+ @state open: boolean;
85
+
86
+ // A `{ value?: HTMLImageElement }` object to access the DOM
87
+ #imgRef = createRef<HTMLImageElement>();
88
+ // Internal state, update it with `this.#state({ ... })`
89
+ // Like native elements, an element should not update its own attributes/properties
90
+ // Unrelated to the CSS state `@state`
91
+ #state = createState({ internalCount: 1 });
92
+
93
+ // Don't give attributes initial values, they would appear in the serialized DOM; use a getter for defaults
94
+ // Properties can have initial values, or also use a getter
95
+ get #src() {
96
+ return this.src || 'test';
97
+ }
98
+
99
+ // Use `@memo` for expensive computations, its argument receives the instance and returns a dependency array
100
+ // Runs before each render, the body only runs when dependencies change
101
+ // `@willMount` is built on `@memo`
102
+ @memo((i) => [i.src])
103
+ get #text() {
104
+ return this.src.repeat(10);
105
+ }
106
+
107
+ // Side effect after each render, same argument as `@memo`, runs every time without one
108
+ // The returned function is the cleanup, called before the next run
109
+ // Similar to React's `useLayoutEffect`
110
+ // `@mounted` and `@unmounted` are built on `@effect`
111
+ @effect()
112
+ #print = () => {
113
+ console.log('updated');
114
+ return () => console.log('clear');
115
+ }
116
+
117
+ // `@template` marks the render function, its optional argument is a condition to render different content
118
+ // Without a condition it always applies
119
+ @template()
120
+ #content = () => {
121
+ const imgProps = { dataTest: 1 };
122
+ // Template syntax is lit-html plus Vue-like `v-if`, refs and spread attributes
123
+ // Use `classMap` `styleMap` `partMap` `exportPartsMap` when needed
124
+ return html`
125
+ <img ${this.#imgRef} ${imgProps} src=${this.#src} part=${DuoyunTestElement.part} />
126
+ <div class=${classMap({ div: true })} v-if=${this.show}>Show</div>
127
+ <div v-else class=${style1.content} style=${styleMap({ fontSize: '10px' })}>None</div>
128
+ `;
129
+ }
130
+
131
+ // After each update, recompute the theme when dependencies change; without dependencies it updates every time
132
+ @elementTheme((i) => [i.show])
133
+ #updateTheme = () => ({ color: this.show ? 'red' : 'blue' });
134
+
135
+ // Fallback content when rendering fails, only needed when rendering can fail
136
+ @fallback()
137
+ #errorContent = (err) => {
138
+ return html`Error: ${err}`;
139
+ }
140
+
141
+ // Gem elements use ES decorators, which fully describe the element, no extra custom element declarations needed
142
+ // Don't use lifecycle methods, they are deprecated! Decorate plain functions instead
143
+ // Prefer ES private fields (`#aaa`) over class methods to avoid `this` binding issues
144
+ }
145
+
146
+ ```
147
+
148
+ ## Gem Best Practices
149
+
150
+ - [Create standard and reliable custom elements](https://github.com/mantou132/gem/blob/main/packages/gem/docs/en/004-blog/001-create-standard-element.md)
package/dist/gem.js CHANGED
@@ -1,11 +1,6 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Gem=e():t.Gem=e()}(globalThis,()=>(()=>{"use strict";let t,e,n,i,s,r,a,o,l,h,c,u,d,p,f,m,g,y,b,$,_,S,v,w,E,C,x,L,P,k,T,N,O,R,M,A,H,I,V,j,D,W,K,U,G,q,B,z,F,J,Y,Z,Q,X,tt,te,tn,ti,ts,tr,ta,to,tl,th,tc,tu,td,tp,tf,tm,tg,ty,tb,t$,t_,tS,tv,tw,tE,tC,tx,tL,tP,tk,tT,tN,tO,tR,tM,tA,tH,tI,tV,tj,tD,tW,tK,tU,tG,tq,tB,tz,tF,tJ,tY,tZ,tQ,tX,t0,t1,t2,t3,t8,t4,t6,t5,t9,t7,et,ee,en,ei,es,er,ea,eo,el,eh,ec,eu,ed,ep,ef,em,eg,ey,eb,e$,e_,eS,ev,ew,eE,eC,ex,eL,eP,ek,eT,eN,eO,eR,eM,eA,eH,eI,eV,ej,eD,eW,eK,eU,eG,eq,eB,ez,eF;var eJ={};eJ.d=(t,e,n)=>{var i=(e,n)=>{for(var i in e)eJ.o(e,i)&&!eJ.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,[n]:e[i]})};i(e,"get"),i(n,"value")},eJ.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),eJ.r=t=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var eY={};eJ.r(eY),eJ.d(eY,{GemActiveLinkElement:()=>tQ,GemDialogBaseElement:()=>f,GemElement:()=>n3,GemError:()=>nC,GemLightRouteElement:()=>ti,GemLinkElement:()=>tZ,GemReflectElement:()=>rc,GemRouteElement:()=>ts,GemTitleElement:()=>ey,GemUnsafeElement:()=>eO,GemUseElement:()=>eF,I18n:()=>rC,LinkedList:()=>ng,Logger:()=>r$,PropProxyMap:()=>ny,QueryString:()=>nb,SheetToken:()=>nU,TemplateResult:()=>i9,UpdateToken:()=>nG,_RenderErrorEvent:()=>nB,_StoreListenerMap:()=>nO,_createTemplate:()=>e,_renderRoot:()=>nj,absoluteLocation:()=>nf,addListener:()=>nm,addMicrotask:()=>nu,adoptedStyle:()=>iR,aria:()=>iV,assignState:()=>nd,async:()=>iI,attribute:()=>im,basePathStore:()=>sz,boolattribute:()=>ig,camelToKebabCase:()=>nv,classMap:()=>nk,cleanObject:()=>nE,connect:()=>nA,connectStore:()=>iM,createDecoratorTheme:()=>rK,createHistoryParams:()=>s6,createModalClass:()=>s1,createOverrideTheme:()=>rW,createPath:()=>s4,createRef:()=>sg,createScopedTheme:()=>rj,createState:()=>t,createStore:()=>nM,createTheme:()=>rD,createUpdater:()=>np,css:()=>nY,customElement:()=>ij,del:()=>rT,directive:()=>s$,effect:()=>i_,emitter:()=>iT,exportPartsMap:()=>nN,fallback:()=>iC,get:()=>rN,getLogicalParent:()=>rh,getThemeProps:()=>rI,getThemeStore:()=>rH,globalemitter:()=>iN,history:()=>sq,html:()=>nH,initRequest:()=>rP,isArrayChange:()=>nx,kebabToCamelCase:()=>nw,light:()=>iH,logger:()=>r_,matchPath:()=>s8,mathml:()=>sn,mediaQuery:()=>rx,memo:()=>i$,mounted:()=>iw,numattribute:()=>iy,objectMapToString:()=>nL,part:()=>ik,partMap:()=>nT,post:()=>rO,property:()=>ib,put:()=>rR,randomStr:()=>nS,raw:()=>n$,render:()=>nI,repeat:()=>sx,request:()=>rk,setEngine:()=>nV,shadow:()=>iA,slot:()=>iP,splice:()=>rw,state:()=>ix,styleMap:()=>nP,styled:()=>n_,svg:()=>se,template:()=>iE,titleStore:()=>sB,unmounted:()=>iS,version:()=>sb,willMount:()=>iv});var eZ={};eJ.r(eZ),eJ.d(eZ,{_StoreListenerMap:()=>nO,connect:()=>nA,createStore:()=>nM});var eQ={};eJ.r(eQ),eJ.d(eQ,{GemElement:()=>n3,SheetToken:()=>nU,UpdateToken:()=>nG,_RenderErrorEvent:()=>nB,_createTemplate:()=>e,_renderRoot:()=>nj,createState:()=>t,css:()=>nY,html:()=>nH,render:()=>nI,setEngine:()=>nV});var eX={};eJ.r(eX),eJ.d(eX,{adoptedStyle:()=>iR,aria:()=>iV,async:()=>iI,attribute:()=>im,boolattribute:()=>ig,connectStore:()=>iM,customElement:()=>ij,effect:()=>i_,emitter:()=>iT,fallback:()=>iC,globalemitter:()=>iN,light:()=>iH,memo:()=>i$,mounted:()=>iw,numattribute:()=>iy,part:()=>ik,property:()=>ib,shadow:()=>iA,slot:()=>iP,state:()=>ix,template:()=>iE,unmounted:()=>iS,willMount:()=>iv});var e0={};eJ.r(e0),eJ.d(e0,{version:()=>sb});let{get:e1,set:e2,has:e3,deleteProperty:e8,defineProperty:e4,getOwnPropertyDescriptor:e6,ownKeys:e5}=Reflect,e9=globalThis.__GEM_SSR__,e7=!!e9,nt={},ne=e9?(t,e)=>{let n=e9();return n?(n.has(t)||n.set(t,e()),n.get(t)):t}:t=>t,nn=e9?t=>{let e=()=>({...t});return new Proxy(t,{get:(n,i)=>e1(ne(t,e),i),set:(n,i,s)=>e2(ne(t,e),i,s),has:(n,i)=>e3(ne(t,e),i),deleteProperty:(n,i)=>e8(ne(t,e),i),defineProperty:(n,i,s)=>e4(ne(t,e),i,s),getOwnPropertyDescriptor:(n,i)=>e6(ne(t,e),i),ownKeys:()=>e5(ne(t,e))})}:t=>t,{assign:ni,fromEntries:ns,entries:nr,keys:na,defineProperty:no,hasOwn:nl}=Object,nh=new Set,nc=()=>new Set;function nu(t){let e=ne(nh,nc);!e.has(t)&&(Promise.resolve().then(()=>{e.delete(t),t()}),e.add(t))}function nd(t,e){for(let n of["name","length"])e&&nl(e,n)&&no(t,n,{value:e[n],writable:!0,enumerable:!0,configurable:!0});ni(t,e)}function np(t,e){return delete e.name,delete e.length,nd(e,t),e}function nf(t="",e=""){let{pathname:n,search:i,hash:s}=new URL(e,location.origin+t);return n+i+decodeURIComponent(s)}function nm(t,e,n,i){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}class ng extends EventTarget{#t=new Map;#e;#n;#i(t){let e=this.#t.get(t);return e&&(e.prev?e.prev.next=e.next:this.#e=e.next,e.next?e.next.prev=e.prev:this.#n=e.prev,this.#t.delete(t)),e}get size(){return this.#t.size}get first(){return this.#e}get last(){return this.#n}isSuperLinkOf(t,e=!1){let n=t.first;if(!n)return!0;let i=e?this.#e:this.find(n.value);for(;i&&n;){if(i.value===n.value)n=n.next;else if(!e)return!1;i=i.next}return!n}find(t){return this.#t.get(t)}add(t){this.#n||this.dispatchEvent(new CustomEvent("start"));let e=this.#i(t)||{value:t};e.prev=this.#n,e.prev&&(e.prev.next=e),e.next=void 0,this.#n=e,this.#e||(this.#e=e),this.#t.set(t,e)}delete(t){let e=this.#i(t);return this.#e||this.dispatchEvent(new CustomEvent("end")),e}clear(){this.#t.clear(),this.#e=this.#n=void 0}get(){let t=this.#e;if(t)return this.delete(t.value),t.value}}class ny extends WeakMap{get(t){let e=super.get(t);return e||(e={},this.set(t,e)),e}}class nb extends URLSearchParams{concat(t){nr("string"==typeof t?ns(new URLSearchParams(t).entries()):t).forEach(([t,e])=>{this.append(t,this.#s(e))})}#s=t=>"string"==typeof t?t:JSON.stringify(t);setAny(t,e){if(Array.isArray(e))this.delete(t),e.forEach(e=>this.append(t,this.#s(e)));else{let n=this.#s(e);n?this.set(t,n):this.delete(t)}}#r=t=>{if(!t)return null;try{return JSON.parse(t)}catch{return null}};getAny(t){return this.getAnyAll(t)[0]}getAnyAll(t){return this.getAll(t).filter(t=>""!==t).map(t=>this.#r(t))}toString(){let t=super.toString();return t?`?${t}`:""}toJSON(){return this.toString()}}function n$(t,...e){return t.reduce((t,n,i)=>t+(e[i-1]??"")+n)}let n_=n$;function nS(t=5){let e=Math.random().toString(36).slice(2,2+t);return e.length<t?e+nS(t-e.length):e}function nv(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function nw(t){return t.replace(/-(.)/g,(t,e)=>e.toUpperCase())}function nE(t){return na(t).forEach(e=>{delete t[e]}),t}class nC extends Error{constructor(t){super(t),this.message=`gem: ${this.message}`}}function nx(t,e){let n=t.length;if(e.length!==n)return!0;for(let i=0;i<n;i++)if(t[i]!==e[i])return!0;return!1}function nL(t,e,n){let i=e;for(let s in t){let r=n(s,t[s]);i+=r?r+e:""}return i}function nP(t){return nL(t,";",(t,e)=>e||0===e?`${nv(t)}:${e}`:"")}function nk(t){return nL(t," ",(t,e)=>e?t:"")}let nT=nk;function nN(t){return nL(t,",",(t,e)=>!0===e||t===e?t:e?`${t}:${e}`:"")}let nO=new WeakMap,nR=()=>new Set;function nM(t,e){let n=nR(),i=nn(np(t,t=>{nd(i,t),n.forEach(nu),e7&&(ne(n,nR).forEach(nu),e&&nt.updateStore?.(e,i))}));return e&&nd(i,nt.createStore?.(e)),nO.set(i,n),i}function nA(t,e){let n=nO.get(t),i=n&&ne(n,nR);return i?.add(e),()=>i?.delete(e)}let nH=(t,...e)=>n$(t,...e.map(t=>t instanceof Element?t.outerHTML:t)),nI=(t,e)=>e.innerHTML=t;function nV(t,e){nH=t,nI=e}let nj=(t,e)=>nt.render?.(t,e)||nI(t,e),{assign:nD,defineProperty:nW}=Object;nW(Symbol,"metadata",{value:Symbol.for("Symbol.metadata")});let nK=t=>"function"==typeof t&&t(),nU=Symbol.for("gem@sheetToken"),nG=Symbol.for("gem@update"),nq="gem-style-boundary",nB="gem@render-error",nz=new WeakMap;class nF extends CSSStyleSheet{#a;cssText="";get element(){return this.#a||(this.#a=document.createElement("style"),this.#a.textContent=this.cssText),this.#a}replaceSync(t){this.cssText=t,this.#a&&(this.#a.textContent=t),super.replaceSync(t)}}class nJ{#o="";#l="";constructor(t=""){this.#l=t}setContent(t){this.#o=t}#h=new Map;#c({sheet:t,scope:e}){t.replaceSync(e?`${e}{ ${this.#o} }`:this.#o)}getStyle(t,e){let n=t&&!t.internals?.shadowRoot,i=n?t.constructor:this,s=this.#h.get(i);if(!s){let r=n?e?"@scope":`@scope (${t.tagName}) to (:state(${nq}) > *)`:"";s={sheet:new nF({media:this.#l}),scope:r},this.#h.set(i,s),this.#c(s)}return s.sheet}updateStyle(){this.#h.forEach(t=>this.#c(t))}}function nY(t,...e){let n="",i="",s=e.at(0);Array.isArray(t)?i=n$(t,...e):void 0!==s?(n=t,i=s):i=t;let r=new nJ(n),a={[nU]:r},o="";return"string"==typeof i?o=i:Object.keys(i).forEach(t=>{let e="$"===t;a[t]=e||t.includes("-")?t:`${t}-${nS()}`,o+=`${e?":where(&:not([hidden])),:host(:where(:not([hidden])))":`.${a[t]}`} {${i[t]}}`}),r.setContent(o),a}let nZ=({counts:t,update:e},n,i)=>{let s=!1;n.forEach(e=>{let n=t.get(e)||0;s||=1===i&&0===n||-1===i&&1===n,t.set(e,n+i)}),s&&nu(e)};function nQ(t,e){nK(t.preCallback),t.preCallback=t.callback(e,t.values),t.values=e,t.initialized=!0}function nX(t){t.forEach(t=>{let e=t.getDep?.();(!t.getDep||!t.values||nx(t.values,e))&&nQ(t,e)})}function n0(t){return t.filter(t=>(nK(t.preCallback),t.preCallback=void 0,t.initialized=!1,t.values=void 0,t.fixed))}let n1=new ng,n2=(t=performance.now())=>{if(performance.now()>t+50)return requestAnimationFrame(n2);let e=n1.get();if(e){try{e()}catch(t){reportError(t)}n2(t)}};n1.addEventListener("start",()=>nu(n2));class n3 extends HTMLElement{#u;#d;#p=[];#f=[];#m=[];#g;#y;#b;#$;#_;[nG](){this.#S()}static{t=t=>{let e=n,i=np(t,t=>{let n=e.#p.at(0);if(!e7&&e.#y&&n&&!n.initialized)throw new nC("Don't set state sync before insert the DOM");nd(i,t),e.#$||e.#S()});return e.#d.stateList.push(i),i},e=(t,e)=>t.#m.push(e)}constructor(){let t;super(),n=this;const{aria:e,mode:i,delegatesFocus:s,...r}=this.#v,{focusable:a,...o}=e||{};this.#u=i?this.shadowRoot||this.attachShadow({mode:i,delegatesFocus:s,...r}):this,this.#d=this.attachInternals(),this.#u===this||this.#d.shadowRoot||nW(this.#d,"shadowRoot",{value:this.#u}),this.#d.stateList=[],this.#d.sheets=[],nD(this.#d,o),this.#p.push({fixed:!0,getDep:()=>[this.disabled],callback:([e=!1])=>{if(void 0===t&&(t=this.hasAttribute("tabindex")),this.#d.ariaDisabled=String(e),a&&!t&&(this.tabIndex=-Number(e)),(a||s)&&e)return nm(this,"click",t=>t.isTrusted&&t.stopImmediatePropagation(),{capture:!0})}})}get #v(){return this.constructor[Symbol.metadata]}get #w(){return this.#m.findLast(t=>!t.condition||t.condition())}get internals(){return this.#d}#E=()=>{nX(this.#p)};#C=t=>{try{this.#$=!0,nX(this.#f);let e=this.#u===this,n=t?t.render():e?void 0:nH`<slot></slot>`;if(void 0===n)return;let i=n??(e?nH`<style>@scope{&{display:none!important;}}</style>`:nH`<style>:host{&{display:none!important;}}</style>`);nj(i,this.#u)}catch(e){let t=new CustomEvent(nB,{bubbles:!0,composed:!0,cancelable:!0,detail:e});if(this.dispatchEvent(t))throw e}finally{this.#$=!1}};#x=()=>{let t=this.#w;this.#y&&(t||!this.#m.length)&&(this.#C(t),e7||nu(this.#E))};#L=t=>{this.#v.noBlocking&&!e7?n1.add(t):t()};#P=()=>this.#L(this.#x);#S=()=>{this.#y&&nu(this.#P)};#k=()=>{let{adoptedStyleSheets:t=[]}=this.#v,{shadowRoot:e,sheets:n}=this.#d,i=t.map(t=>t[nU].getStyle(this));if(!e)return this.prepend(...n.map(t=>t.element)),((t,e)=>{let n=t.getRootNode(),i=nz.get(n);if(!i){let t=new Map;i={counts:t,update:()=>{let e=(n.adoptedStyleSheets||[]).filter(e=>!t.has(e));t.forEach((t,n)=>t&&e.push(n)),n.adoptedStyleSheets=e.reverse()}},nz.set(n,i)}return nZ(i,e,1),()=>nZ(i,e,-1)})(this,i);e.adoptedStyleSheets=i.concat(n)};#T=()=>{this.#p.forEach(t=>!t.initialized&&nQ(t,t.getDep?.()))};#N=()=>{this.willMount&&this.memo(this.willMount.bind(this),()=>[]),this.mounted&&this.effect(this.mounted.bind(this),()=>[]),this.updated&&this.effect((t,e)=>e&&this.updated.apply(this)),this.unmounted&&this.effect(()=>this.unmounted.bind(this),()=>[]),!this.#m.length&&this.render&&this.#m.push({render:this.render.bind(this),condition:this.shouldUpdate?.bind(this)})};#O;#R=()=>{if(this.#g){this.#g=!1,this.#_?.(),this.#_=this.#k();return}if(nt.connect?.(this,this.#R))return;this.#b=!0,this.#N();let{observedStores:t,mode:e,penetrable:n}=this.#v;this.#d.states.add("gem-element"),e||!this.#m.length||n||this.#d.states.add(nq),this.#O=t?.map(t=>nA(t,this.#P)),this.#C(this.#w),this.#y=!0,this.#_=this.#k(),e7||nu(this.#T)};connectedCallback(){this.#L(this.#R)}disconnectedCallback(){if(this.isConnected){this.#g=!0;return}n1.delete(this.#R),n1.delete(this.#x),this.#y=!1,this.#O?.forEach(t=>t()),this.#p=n0(this.#p),this.#f=n0(this.#f),this.#_?.()}effect=(t,e)=>{let n={callback:t,getDep:e,fixed:!this.#b};this.#y&&nQ(n,e?.()),this.#p.push(n)};memo=(t,e)=>{this.#f.push({callback:t,getDep:e,fixed:!this.#b})};update=()=>this.#S()}let{deleteProperty:n8,getOwnPropertyDescriptor:n4,defineProperty:n6}=Reflect,{getPrototypeOf:n5,assign:n9,hasOwn:n7}=Object,it=new ny;function ie(t,e,n){let i=t.metadata;n4(i,e)||n6(i,e,{value:i[e]?.filter(t=>t!==n)||[]}),i[e].push(n)}function ii(t,e,n,i){let s=t.name;ie(t,e,n),t.addInitializer(function(){let e=id(this,t);n7(e,s)||i(e,s),function(t,e){let{value:n}=n4(t,e)||{};n8(t,e),t[e]=n}(this,s)})}let{setAttribute:is,toggleAttribute:ir,removeAttribute:ia}=Element.prototype,io=(t,e)=>t.constructor[Symbol.metadata]?.attrProps?.[e];function il(){}n3.prototype.setAttribute=function(t,e){let n=io(this,t);if(!n)return is.call(this,t,e);this[n]=e},n3.prototype.removeAttribute=function(t){let e=io(this,t);if(!e)return ia.call(this,t);this[e]=null},n3.prototype.toggleAttribute=function(t,e){let n=io(this,t);return n?this[n]=e??!this.hasAttribute(t):ir.call(this,t,e)};let ih=Symbol("event handle");function ic(t,e,{attr:n,attrType:i,event:s,eventOptions:r}={}){n6(t,e,{configurable:!0,get(){let t=it.get(this)[e];return s&&!t?(this[e]=il,this[e]):t},set(t){let a=this,o=it.get(a);n&&((t=i===Boolean&&""===t||i(t||""))?is.call(this,n,i===Boolean?"":t):ia.call(this,n)),t!==o[e]&&(s?(o[e]=t?.[ih]?t:async(e,n)=>{await Promise.resolve();let i=new CustomEvent(s,{...n,...r,detail:e});a.dispatchEvent(i),await t(e,n)},o[e][ih]=!0):(o[e]=t,this[nG]()))}})}let iu=new WeakMap;function id(t,{metadata:e}){let n=iu.get(e);if(n)return n;let i=t;do i=n5(i);while(i.constructor[Symbol.metadata]!==e);return iu.set(e,i),i}function ip(t,e){let n=t.name,i=nv(n),s=t.metadata;return n7(s,"attrProps")||(s.attrProps=Object.create(s.attrProps||null)),s.attrProps[i]=n,ii(t,"observedAttributes",i,t=>ic(t,n,{attr:i,attrType:e})),function(t){return this.getAttribute(i)??t}}function im(t,e){return ip(e,String)}function ig(t,e){return ip(e,Boolean)}function iy(t,e){return ip(e,Number)}function ib(t,e){let n=e.name;return ii(e,"observedProperties",n,ic),function(t){return this[n]??t}}function i$(t){return(e,n)=>{let{addInitializer:i,name:s,access:r,kind:a}=n;i(function(){let e=t&&(()=>t(this));if("getter"===a){if(n.private)throw new nC("not support");let t=n4(id(this,n),s).get.bind(this);this.memo(()=>{n6(this,s,{configurable:!0,value:t()})},e)}else this.memo(r.get.call(this,this).bind(this),e)})}}function i_(t){return(e,{addInitializer:n,access:i})=>{n(function(){this.effect(i.get.call(this,this).bind(this),t&&(()=>t(this)))})}}function iS(){return(t,{addInitializer:e,access:n})=>{e(function(){this.effect(()=>n.get.call(this,this).bind(this),()=>[])})}}function iv(){return i$(()=>[])}function iw(){return i_(()=>[])}function iE(t){return(n,{addInitializer:i,access:s})=>{i(function(){e(this,{render:s.get.call(this,this).bind(this),condition:t&&(()=>t(this))})})}}function iC(){return(t,{addInitializer:e,access:n})=>{e(function(){this.addEventListener(nB,t=>{t.preventDefault(),nj(n.get.call(this,this).apply(this,[t.detail]),this.internals.shadowRoot||this)})})}}function ix(t,e){let n=nv(e.name);ii(e,"definedCSSStates",n,(t,e)=>{n6(t,e,{configurable:!0,get(){let{states:t}=this.internals;return t?.has(n)},set(t){let{states:e}=this.internals;t?e?.add(n):e?.delete(n)}})})}function iL(t,e,n,i){let s=t.name,r=nv(s);if(t.static)ie(t,n,r);else{let i=n5(e);i[s]||(i[s]=r,ie(t,n,r))}return i||r}function iP(t,e){return function(t){return iL(e,this,"definedSlots",t)}}function ik(t,e){return function(t){return iL(e,this,"definedParts",t)}}function iT(t,e){iO(e)}function iN(t,e){iO(e,{bubbles:!0,composed:!0})}function iO(t,e){let n=nv(t.name);ii(t,"definedEvents",n,(t,i)=>ic(t,i,{event:n,eventOptions:e}))}function iR(t){return(e,n)=>{ie(n,"adoptedStyleSheets",t)}}function iM(t){return(e,n)=>{ie(n,"observedStores",t)}}function iA({mode:t="open",serializable:e=!0,...n}={}){return(i,s)=>{n9(s.metadata,{mode:t,serializable:e,...n})}}function iH({penetrable:t}){return(e,n)=>{n.metadata.penetrable=t}}function iI(){return(t,e)=>{e.metadata.noBlocking=!0}}function iV(t){return(e,n)=>{let i=n.metadata;i.aria={...i.aria,...t}}}function ij(t){return(e,{addInitializer:n})=>{n(()=>{customElements.define(t,e)})}}let iD=globalThis.trustedTypes,iW=iD?.createPolicy("lit-html",{createHTML:t=>t}),iK="$lit$",iU=`lit$${Math.random().toFixed(9).slice(2)}$`,iG="?"+iU,iq=`<${iG}>`,iB=document,iz=()=>iB.createComment(""),iF=t=>null===t||"object"!=typeof t&&"function"!=typeof t,iJ=t=>null==t,iY=`[
2
- \f\r]`,iZ=`[^
3
- \f\r"'\`<>=]`,iQ=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,iX=/-->/g,i0=/>/g,i1=RegExp(`>|${iY}(?:([^\\s"'>=/]+)(${iY}*=${iY}*(?:${iZ}|("|')|))|$)`,"g"),i2=/'/g,i3=/"/g,i8=/^(?:script|style|textarea|title)$/i,i4="v-if",i6="v-else-if",i5="v-else";class i9{type;strings;values;constructor(t,e,n){this.type=t,this.strings=e,this.values=n}}let i7=t=>(e,...n)=>new i9(t,e,n),st=i7(1),se=i7(2),sn=i7(3),si=Symbol.for("lit-noChange"),ss=new WeakMap,sr=iB.createTreeWalker(iB,129);class sa{el;parts=[];constructor({strings:t,type:e},n){let i,s=0,r=0;const a=t.length-1,o=this.parts,[l,h]=((t,e)=>{let n,i=t.length-1,s=[],r=2===e?"<svg>":3===e?"<math>":"",a=iQ;for(let e=0;e<i;e++){let i,o,l=t[e],h=-1,c=0;for(;c<l.length&&(a.lastIndex=c,null!==(o=a.exec(l)));)c=a.lastIndex,a===iQ?"!--"===o[1]?a=iX:void 0!==o[1]?a=i0:void 0!==o[2]?(i8.test(o[2])&&(n=RegExp(`</${o[2]}`,"g")),a=i1):void 0!==o[3]&&(a=i1):a===i1?">"===o[0]?(a=n??iQ,h=-1):void 0===o[1]?h=-2:(h=a.lastIndex-o[2].length,i=o[1],a=void 0===o[3]?i1:'"'===o[3]?i3:i2):a===i3||a===i2?a=i1:a===iX||a===i0?a=iQ:(a=i1,n=void 0);let u=a===i1&&t[e+1].startsWith("/>")?" ":"";r+=a===iQ?l+iq:h>=0?(s.push(i),l.slice(0,h)+iK+l.slice(h)+iU+u):l+iU+(-2===h?e:u)}let o=r+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"");return[function(t,e){if(!Array.isArray(t))throw Error("invalid template");return void 0!==iW?iW.createHTML(e):e}(t,o),s]})(t,e);if(this.el=sa.createElement(l,n),sr.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=sr.nextNode())&&o.length<a;){if(1===i.nodeType){if(i.hasAttributes())for(const t of i.getAttributeNames())if(t.endsWith(iK)){const e=h[r++],n=i.getAttribute(t).split(iU),a=/([.?@])?(.*)/.exec(e);o.push({type:1,index:s,name:a[2],strings:n,ctor:"."===a[1]?sd:"?"===a[1]?sp:"@"===a[1]?sf:su}),i.removeAttribute(t)}else t.startsWith(iU)&&(o.push({type:6,index:s}),i.removeAttribute(t));if(i8.test(i.tagName)){const t=i.textContent.split(iU),e=t.length-1;if(e>0){i.textContent=iD?iD.emptyScript:"";for(let n=0;n<e;n++)i.append(t[n],iz()),sr.nextNode(),o.push({type:2,index:++s});i.append(t[e],iz())}}}else if(8===i.nodeType)if(i.data===iG)o.push({type:2,index:s});else{let t=-1;for(;-1!==(t=i.data.indexOf(iU,t+1));)o.push({type:7,index:s}),t+=iU.length-1}s++}}static createElement(t,e){let n=iB.createElement("template");return n.innerHTML=t,n}}function so(t,e,n=t,i){if(e===si)return e;let s=void 0!==i?n.__directives?.[i]:n.__directive,r=iF(e)?void 0:e._$litDirective$;return s?.constructor!==r&&(s?._$notifyDirectiveConnectionChanged?.(!1),void 0===r?s=void 0:(s=new r(t))._$initialize(t,n,i),void 0!==i?(n.__directives??=[])[i]=s:n.__directive=s),void 0!==s&&(e=so(t,s._$resolve(t,e.values),s,i)),e}class sl{_$template;_$parts=[];_$conditions=[];_$parent;_$disconnectableChildren=void 0;constructor(t,e){this._$template=t,this._$parent=e}get parentNode(){return this._$parent.parentNode}get _$isConnected(){return this._$parent._$isConnected}_clone(t){let{el:{content:e},parts:n}=this._$template,i=new Map,s=new Map,r=(t?.creationScope??iB).importNode(e,!0);sr.currentNode=r;let a=sr.nextNode(),o=0,l=0,h=n[0];for(;void 0!==h;){if(o===h.index){let e;2===h.type?e=new sc(a,a.nextSibling,this,t):1===h.type?(h.name===i4&&i.set(a,l),h.name===i6&&s.set(a,l),e=new h.ctor(a,h.name,h.strings,this,t)):6===h.type&&(e=new sm(a,this,t)),this._$parts.push(e),h=n[++l]}o!==h?.index&&(a=sr.nextNode(),o++)}let c=new Map;for(let t of(i.forEach((t,e)=>{let n=new sh(e,t);this._$conditions.push(n),c.set(e,n);let i=e;for(;i=i.nextElementSibling;){let t=s.get(i);if(void 0===t)break;n.push(i,t)}}),this._$parts)){if(t?.type!==2)continue;let e=c.get(t._$endNode);e&&(t._$endNode=e.mark)}return sr.currentNode=iB,r}_update(t){let e=0;for(let n of this._$parts)void 0!==n&&(void 0!==n.strings?(n._$setValue(t,n,e),e+=n.strings.length-2):n.name===i4||n.name===i6||n._$setValue(t[e])),e++;this._$conditions.forEach(e=>e.update(t))}}class sh{mark;list;constructor(t,e){const n=iz();n._$chain=this,t.before(n),this.mark=n,this.list=[{ele:t,idx:e}],this.check()}get next(){return this.list.at(-1).ele.nextElementSibling}push(t,e){this.list.push({ele:t,idx:e}),this.check()}check(){let t=this.next;t?.attributes.getNamedItem(i5)&&(this.list.push({ele:t}),t.removeAttribute(i5))}update(t){let{mark:e,list:n}=this,i=n.find(({idx:e})=>void 0===e||!!t[e]);i&&!i.ele.parentNode&&e.after(i.ele),n.forEach(({ele:t})=>(!i||t!==i.ele)&&t.remove())}}class sc{type=2;options;_$committedValue;__directive;_$startNode;_$endNode;_$parent;__isConnected;get _$isConnected(){return this._$parent?._$isConnected??this.__isConnected}_$disconnectableChildren=void 0;constructor(t,e,n,i){this._$startNode=t,this._$endNode=e,this._$parent=n,this.options=i,this.__isConnected=i?.isConnected??!0}get parentNode(){let t=this._$startNode.parentNode,e=this._$parent;return void 0!==e&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$startNode}get endNode(){return this._$endNode}_$setValue(t,e=this){this.parentNode&&(iF(t=so(this,t,e))?iJ(t)||""===t?(iJ(this._$committedValue)||this._$clear(),this._$committedValue=void 0):t!==this._$committedValue&&t!==si&&this._commitText(t):t instanceof i9?this._commitTemplateResult(t):void 0!==t.nodeType?this._commitNode(t):Symbol.iterator in t?this._commitIterable(t):this._commitText(t))}_insert(t){return this._$startNode.parentNode.insertBefore(t,this._$endNode)}_commitNode(t){this._$committedValue!==t&&(this._$clear(),this._$committedValue=this._insert(t))}_commitText(t){!iJ(this._$committedValue)&&iF(this._$committedValue)?this._$startNode.nextSibling.data=t:this._commitNode(iB.createTextNode(t)),this._$committedValue=t}_commitTemplateResult(t){let{values:e}=t,n=this._$getTemplate(t);if(this._$committedValue?._$template===n)this._$committedValue._update(e);else{let t=new sl(n,this),i=t._clone(this.options);t._update(e),this._commitNode(i),this._$committedValue=t}}_$getTemplate(t){let e=ss.get(t.strings);return void 0===e&&ss.set(t.strings,e=new sa(t)),e}_commitIterable(t){let e;Array.isArray(this._$committedValue)||(this._$committedValue=[],this._$clear());let n=this._$committedValue,i=0;for(let s of t)i===n.length?n.push(e=new sc(this._insert(iz()),this._insert(iz()),this,this.options)):e=n[i],e._$setValue(s),i++;i<n.length&&(this._$clear(e&&e._$endNode.nextSibling,i),n.length=i)}_$clear(t=this._$startNode.nextSibling,e){for(this._$notifyConnectionChanged?.(!1,!0,e);t&&t!==this._$endNode;){let e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$parent&&(this.__isConnected=t,this._$notifyConnectionChanged?.(t))}}class su{type=1;element;name;options;strings;_$committedValue;__directives;_$parent;_$disconnectableChildren=void 0;get tagName(){return this.element.tagName}get _$isConnected(){return this._$parent._$isConnected}constructor(t,e,n,i,s){this.element=t,this.name=e,this._$parent=i,this.options=s,n.length>2||""!==n[0]||""!==n[1]?(this._$committedValue=Array(n.length-1).fill(new String),this.strings=n):this._$committedValue=void 0}_$setValue(t,e=this,n,i){let s=this.strings,r=!1;if(void 0===s)(r=!iF(t=so(this,t,e,0))||t!==this._$committedValue)&&(this._$committedValue=t);else{let i,a,o=t;for(t=s[0],i=0;i<s.length-1;i++)a=so(this,o[n+i],e,i),r||=!iF(a)||a!==this._$committedValue[i],iJ(a)?t=void 0:iJ(t)||(t+=a+s[i+1]),this._$committedValue[i]=a}r&&!i&&this._commitValue(t)}_commitValue(t){iJ(t)?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t)}}class sd extends su{type=3;_commitValue(t){this.element[this.name]=t}}class sp extends su{type=4;_commitValue(t){this.element.toggleAttribute(this.name,!!t)}}class sf extends su{type=5;_$setValue(t,e=this){t=so(this,t,e,0);let n=this._$committedValue,i=n&&(!t||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive),s=t&&(!n||i);i&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,t),this._$committedValue=t}handleEvent(t){"function"==typeof this._$committedValue?this._$committedValue.call(this.options?.host??this.element,t):this._$committedValue.handleEvent(t)}}class sm{element;type=6;__directive;_$committedValue;_$parent;_$disconnectableChildren=void 0;_$props;options;constructor(t,e,n){this.element=t,this._$parent=e,this.options=n}get _$isConnected(){return this._$parent._$isConnected}_$setValue(t){if(t)if(t instanceof sy)t.value=this.element;else if(t._$litDirective$)so(this,t);else{if(this._$props)for(let t in this._$props)Reflect.set(this.element,t,void 0);Object.assign(this.element,t),this._$props=t}}}let sg=()=>new sy;class sy{value}let sb="2.3.1",s$=t=>(...e)=>({_$litDirective$:t,values:e});class s_{__part;__attributeIndex;__directive;_$parent;_$disconnectableChildren;get _$isConnected(){return this._$parent._$isConnected}_$initialize(t,e,n){this.__part=t,this._$parent=e,this.__attributeIndex=n}_$resolve(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}let sS=(t,e,n)=>{let i=t._$startNode.parentNode,s=void 0===e?t._$endNode:e._$startNode;if(void 0===n)n=new sc(i.insertBefore(document.createComment(""),s),i.insertBefore(document.createComment(""),s),t,t.options);else{let e=n._$endNode.nextSibling,r=n._$parent,a=r!==t;if(a){let e;n._$reparentDisconnectables?.(t),n._$parent=t,void 0!==n._$notifyConnectionChanged&&(e=t._$isConnected)!==r._$isConnected&&n._$notifyConnectionChanged(e)}if(e!==s||a){let t=n._$startNode;for(;t!==e;){let e=t.nextSibling;i.insertBefore(t,s),t=e}}}return n},sv=(t,e,n=t)=>(t._$setValue(e,n),t),sw={},sE=t=>{t._$notifyConnectionChanged?.(!1,!0);let e=t._$startNode,n=t._$endNode.nextSibling;for(;e!==n;){let t=e.nextSibling;e.remove(),e=t}},sC=(t,e,n)=>{let i=new Map;for(let s=e;s<=n;s++)i.set(t[s],s);return i},sx=s$(class extends s_{_itemKeys;constructor(t){if(super(),2!==t.type)throw Error("repeat() can only be used in text expressions")}_getValuesAndKeys(t,e,n){let i;void 0===n?n=e:void 0!==e&&(i=e);let s=[],r=[],a=0;for(let e of t)s[a]=i?i(e,a):a,r[a]=n(e,a),a++;return{values:r,keys:s}}render(t,e,n){return this._getValuesAndKeys(t,e,n).values}update(t,[e,n,i]){let s,r,a=t._$committedValue,{values:o,keys:l}=this._getValuesAndKeys(e,n,i);if(!Array.isArray(a))return this._itemKeys=l,o;let h=this._itemKeys??=[],c=[],u=0,d=a.length-1,p=0,f=o.length-1;for(;u<=d&&p<=f;)if(null===a[u])u++;else if(null===a[d])d--;else if(h[u]===l[p])c[p]=sv(a[u],o[p]),u++,p++;else if(h[d]===l[f])c[f]=sv(a[d],o[f]),d--,f--;else if(h[u]===l[f])c[f]=sv(a[u],o[f]),sS(t,c[f+1],a[u]),u++,f--;else if(h[d]===l[p])c[p]=sv(a[d],o[p]),sS(t,a[u],a[d]),d--,p++;else if(void 0===s&&(s=sC(l,p,f),r=sC(h,u,d)),s.has(h[u]))if(s.has(h[d])){let e=r.get(l[p]),n=void 0!==e?a[e]:null;if(null===n){let e=sS(t,a[u]);sv(e,o[p]),c[p]=e}else c[p]=sv(n,o[p]),sS(t,a[u],n),a[e]=null;p++}else sE(a[d]),d--;else sE(a[u]),u++;for(;p<=f;){let e=sS(t,c[f+1]);sv(e,o[p]),c[p++]=e}for(;u<=d;){let t=a[u++];null!==t&&sE(t)}return this._itemKeys=l,((t,e=sw)=>t._$committedValue=e)(t,c),si}});nV(st,(t,e,n)=>{let i=n?.renderBefore??e,s=i._$litPart$;if(void 0===s){let t=n?.renderBefore??null;i._$litPart$=s=new sc(e.insertBefore(iz(),t),t,void 0,n??{})}return s._$setValue(t),s}),globalThis.__GEM_DEVTOOLS__HOOK__&&!globalThis.__GEM_DEVTOOLS__HOOK__.GemElement&&Object.assign(globalThis.__GEM_DEVTOOLS__HOOK__,{...eQ,...eX,...eZ,...e0});let sL=globalThis.history,sP=sL.pushState.bind(sL),sk=sL.replaceState.bind(sL),sT=0,sN=()=>`${performance.now()}-${++sT}`,sO=nM({$hasCloseHandle:!1,$hasOpenHandle:!1,$hasShouldCloseHandle:!1,$key:""}),sR=new Map,sM=()=>new Map([...sR].map(([t,e])=>[t,{...e}])),sA=["$key","$hasCloseHandle","$hasOpenHandle","$hasShouldCloseHandle"];function sH(t){return t===sU.basePath?"/":t.replace(RegExp(`^${sU.basePath}/`),"/")}function sI(t){sU.dispatchEvent(new CustomEvent("beforechange")),nE(sO),sO(t)}function sV(t){let e=sU.getParams()||{path:sH(location.pathname),query:new nb,title:document.title},n=t.path?nf(e.path,t.path):sH(location.pathname),i=new nb(t.query??(t.path?"":location.search)),s=String(i)!==String(e.query),r=s?i:e.query,a=n!==e.path||s,o=t.title||(a?"":e.title),l=t.close||t.data||t.open||t.shouldClose,h=decodeURIComponent(t.hash??(!a&&l?location.hash:""));return{...t,title:o,path:n,query:r,hash:h}}function sj(t,e){var n=t.data;if(sO.$key!==n?.$key){for(let t of sA)if(n?.[t])throw new nC(`\`${t}\` is not allowed`)}let i=sV(t),{title:s,path:r,query:a,hash:o,close:l,open:h,shouldClose:c,data:u}=i,d={$hasCloseHandle:!!l,$hasOpenHandle:!!h,$hasShouldCloseHandle:!!c,$key:sN(),$title:s,...u};ne(sR,sM).set(d.$key,i),sI(d);let p=(sU.basePath?sU.basePath+r:r)+new nb(a)+o,f=decodeURIComponent(location.hash);e(d,s,p),f!==o&&dispatchEvent(new CustomEvent("hashchange"))}function sD(t,e,n,i){let{pathname:s,search:r,hash:a}=new URL(n,location.origin+location.pathname);sj({path:s,query:r,hash:a,title:e,data:t},i)}let sW=nM({basePath:""});class sK extends EventTarget{get store(){return sO}get currentKey(){return sO.$key}get basePath(){return sW.basePath}set basePath(t){sW({basePath:t}),Object.assign(this.getParams(),{path:sH(location.pathname)})}getParams(){return ne(sR,sM).get(sO.$key)}updateParams(t){Object.assign(this.getParams(),t),sO()}push(t){sj(t,sP)}replace(t){sj(t,sk)}pushIgnoreCloseHandle(t){sO.$hasCloseHandle?(this.getParams()?.close?.(),this.replace(t)):this.push(t)}forward(){sL.forward()}back(){sL.back()}}let sU=new sK,sG=nM({defaultTitle:document.title,url:"",title:""});if(!globalThis._GEMHISTORY){if(globalThis._GEMHISTORY={history:sU,titleStore:sG,basePathStore:sW},sL.pushState=(t,e,n)=>{sD(t,e,n,sP)},sL.replaceState=(t,e,n)=>{sD(t,e,n,sk)},addEventListener("hashchange",({isTrusted:t})=>{t&&sU.replace({hash:location.hash})}),sL.state)if(sL.state.$hasCloseHandle){sO(sL.state);let t=sV({title:document.title});ne(sR,sM).set(sO.$key,t),sU.back()}else{let t=sV({title:document.title,hash:location.hash});sO({$key:sN(),...sL.state||{}}),ne(sR,sM).set(sO.$key,t)}else{let{protocol:t,pathname:e,search:n,hash:i}=location;(t.startsWith("http")||t.startsWith("tauri"))&&sU.replace({path:e,query:n,hash:i})}nA(sG,()=>{let t=sU.getParams();t&&(t.title=sG.title)}),nA(sO,()=>{let{title:t}=sU.getParams();t!==sG.title&&sG({title:t})});let t=!1;addEventListener("popstate",e=>{let n=e.state;if(n?.$key){if(t){t=!1;return}if(!ne(sR,sM).has(n.$key)){let{pathname:t,search:e,hash:i}=location;ne(sR,sM).set(n.$key,{path:sH(t),query:new nb(e),hash:decodeURIComponent(i),title:sG.title||n.$title,data:n})}if(parseFloat(n.$key)>parseFloat(sO.$key)&&n.$hasOpenHandle)ne(sR,sM).get(n.$key)?.open?.();else if(sO.$hasCloseHandle){let e=ne(sR,sM).get(sO.$key),i=e?.close,s=e?.shouldClose;if(s&&!s()){t=!0,sU.forward();return}i?i():n.$hasCloseHandle&&(t=!0,sU.back())}sI(n)}})}let{history:sq,titleStore:sB,basePathStore:sz}=globalThis._GEMHISTORY;function sF(t,e,n){"symbol"==typeof e&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:n?n+" "+e:e})}catch(t){}return t}function sJ(t,e,n,i,s,r){var a,o,l,h,c,u,d,p=Symbol.metadata||Symbol.for("Symbol.metadata"),f=Object.defineProperty,m=Object.create,g=[m(null),m(null)],y=e.length;function b(e,n,i){return function(s,r){n&&(r=s,s=t);for(var a=0;a<e.length;a++)r=e[a].apply(s,i?[r]:[]);return i?r:s}}function $(t,e,n,i){if("function"!=typeof t&&(i||void 0!==t))throw TypeError(e+" must "+(n||"be")+" a function"+(i?"":" or undefined"));return t}function _(t,e,n,i,s,r,a,o,l,h,c){function p(t){if(!c(t))throw TypeError("Attempted to access private element on non-instance")}var m=[].concat(e[0]),y=e[3],_=!a,S=1===s,v=3===s,w=4===s,E=2===s;function C(e,n,i){return function(s,r){return n&&(r=s,s=t),i&&i(s),x[e].call(s,r)}}var x={},L=[],P=v?"get":w||S?"set":"value";if(!_&&(l?(h||S?x={get:sF(function(){return y(this)},i,"get"),set:function(t){e[4](this,t)}}:x[P]=y,h||sF(x[P],i,E?"":P)):h||(x=Object.getOwnPropertyDescriptor(t,i)),!h&&!l)){if((d=g[+o][i])&&(d^s)!=7)throw Error("Decorating two elements with the same name ("+x[P].name+") is not supported yet");g[+o][i]=s<3?1:s}for(var k=t,T=m.length-1;T>=0;T-=n?2:1){var N=$(m[T],"A decorator","be",!0),O=n?m[T-1]:void 0,R={},M={kind:["field","accessor","method","getter","setter","class"][s],name:i,metadata:u,addInitializer:(function(t,e){if(t.v)throw TypeError("attempted to call addInitializer after decoration was finished");$(e,"An initializer","be",!0),r.push(e)}).bind(null,R)};if(_){d=N.call(O,k,M),R.v=1,$(d,"class decorators","return")&&(k=d);continue}if(M.static=o,M.private=l,d=M.access={has:l?c.bind():function(t){return i in t}},w||(d.get=l?E?function(t){return p(t),x.value}:C("get",0,p):function(t){return t[i]}),E||v||(d.set=l?C("set",0,p):function(t,e){t[i]=e}),k=N.call(O,S?{get:x.get,set:x.set}:x[P],M),R.v=1,S){if("object"==typeof k&&k)(d=$(k.get,"accessor.get"))&&(x.get=d),(d=$(k.set,"accessor.set"))&&(x.set=d),(d=$(k.init,"accessor.init"))&&L.unshift(d);else if(void 0!==k)throw TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else $(k,(h?"field":"method")+" decorators","return")&&(h?L.unshift(k):x[P]=k)}return s<2&&a.push(b(L,o,1),b(r,o,0)),h||_||(l?S?a.splice(-1,0,C("get",o),C("set",o)):a.push(E?x[P]:$.call.bind(x[P])):f(t,i,x)),k}function S(t){return f(t,p,{configurable:!0,enumerable:!0,value:u})}return void 0!==r&&(u=r[p]),u=m(null==u?null:u),l=[],h=function(t){t&&l.push(b(t))},(c=function(e,i){for(var r=0;r<n.length;r++){var h=n[r],c=h[1],u=7&c;if((8&c)==e&&!u==i){var d=h[2],p=!!h[3],f=16&c;_(e?t:t.prototype,h,f,p?"#"+d:function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(d),u,u<2?[]:e?o=o||[]:a=a||[],l,!!e,p,i,e&&p?function(e){return function(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(null!==t?typeof t:"null"));return t}(e)===t}:s)}}})(8,0),c(0,0),c(8,1),c(0,1),h(a),h(o),d=l,y||S(t),{e:d,get c(){var v=[];return y&&[S(t=_(t,[e],i,t.name,5,v)),b(v,1)]}}}let sY=Symbol();i=iM(sq.store),s=iV({role:"dialog",ariaModal:"true"}),a=n3,o=iv();class sZ extends a{static{({e:[l,h,c,u,d,p],c:[f,r]}=sJ(this,[i,s],[[im,0,"label"],[ix,0,"opened"],[o,0,"init",function(t){return t.#M},function(t,e){t.#M=e}]],0,t=>#M in t,a))}label=l(this);opened=(h(this),c(this));#A=void u(this);#H;#I=[];#V=()=>{this.inert=!0,this.#I.forEach(t=>t.inert=!1),this.#A?this.#A.before(this):this.#H&&this.#H?.appendChild(this),this.dispatchEvent(new CustomEvent("close")),this.opened=!1};#j=()=>{this.hidden=!1,this.inert=!1,this.#A=this.nextSibling,this.#H=this.parentElement||this.getRootNode(),this.#I=[...document.body.children].filter(t=>!t.inert),this.#I.forEach(t=>t.inert=!0),document.body.append(this),this.dispatchEvent(new CustomEvent("open")),this.opened=!0};#M=d(this,()=>this.inert=!0);open=(p(this),()=>{if(!this.opened)return this.#j(),sq.push({title:this.label,open:this.#j,close:this.#V,shouldClose:this.shouldClose}),sY});shouldClose(){return!0}close=()=>(sq.back(),sY);forceClose=()=>(this.opened=!1,setTimeout(this.close,100),sY);static{r()}}function sQ(t){return t}let sX=Symbol("open mark"),s0=Symbol();function s1(t){let e,n,i,s,r,a,o,l,h,c,u;return e=iA(),n=iV({role:"alertdialog",ariaModal:"true"}),s=n3,r=iw(),a=iw(),new class extends sQ{constructor(){super(u),i()}static [class extends s{static{({e:[o,l,h,c],c:[u,i]}=sJ(this,[e,n],[[r,0,"connectHistory",function(t){return t.#D},function(t,e){t.#D=e}],[a,0,"connectStore",function(t){return t.#W},function(t,e){t.#W=e}]],0,t=>#D in t,s))}constructor(...t){super(...t),c(this)}static get isOpen(){return this.store[sX]}static open(t){let e=new this;this.instance=e,this.inertStore=[...document.body.children].filter(t=>!t.inert),this.inertStore.forEach(t=>t.inert=!0),document.body.append(e);let n=()=>this.store({[sX]:!0,...t});return setTimeout(()=>{n(),sq.push({title:e.label,open:n,close:this.closeHandle.bind(this),shouldClose:this.shouldClose.bind(this)})},100),s0}static close(){return sq.back(),s0}static closeHandle(){return this.inertStore.forEach(t=>t.inert=!1),this.instance?.remove(),this.store({[sX]:!1,...t}),s0}static shouldClose(){return!0}label="";#D=o(this,()=>nA(sq.store,this.update));#W=(l(this),h(this,()=>nA(u.store,this.update)))}];inertStore=[];instance=null;store=nM({[sX]:!1,...t})},u}let s2=/^[\w\-./~]*/,s3=new Map;function s8(t,e){let n=s3.get(t);return n||s3.set(t,n=function(t){let e=s2.exec(t)[0];if(e===t)return e=>e===t?{}:null;if("*"===t)return t=>({0:t});if(!globalThis.URLPattern){let e,n,i;return e=0,n=t.replace(/:[^/$]+|\*/g,t=>"*"===t?`(?<_${e++}>.*)`:`(?<${t.slice(1)}>[^/]+)`),i=RegExp(`^${n}$`),t=>{let e=t.match(i);if(!e)return null;let n={};for(let t in e.groups)n[t.startsWith("_")?t.slice(1):t]=e.groups[t];return n}}let n=new URLPattern({pathname:t}),i=e.replace(/\/$/,"");return t=>t.startsWith(i)?n.exec({pathname:t})?.pathname.groups:null}(t)),n(e)||n(`${e}/`)||null}function s4(t,e){let n=0,i=t.pattern.replaceAll("*",()=>`:${n++}`),s=e?.params;return s&&Object.keys(s).forEach(t=>{i=i.replace(RegExp(`:${t}`,"g"),s[t])}),i}function s6(t,e){return{path:s4(t,e),...e}}let s5=nH``,s9=new Map,s7=!1;m=iH({penetrable:!0}),y=n3,b=i_(t=>[t.scrollContainer]),$=i_(t=>[t.scrollContainer]),_=iE(t=>!t.inert),new class extends sQ{constructor(){super(ti),g()}static [class extends y{static{({e:[S,v,w,E,C,x,L,P,k,T,N,O,R,M,A,H,I,V,j,D,W,K,U,G,q,B,z,F,J,Y,Z,Q],c:[ti,g]}=sJ(this,[m],[[ig,0,"transition"],[ib,0,"routes"],[ib,0,"locationStore"],[ib,0,"key"],[iT,0,"loading"],[iT,0,"beforeroutechange"],[iT,0,"routechange"],[iT,0,"error"],[ib,0,"scrollContainer"],[ib,0,"scrollWait"],[ib,0,"scrollIgnoreHash"],[ib,0,"trigger"],[b,0,"rememberScrollPosition",function(t){return t.#K},function(t,e){t.#K=e}],[$,0,"connectTriggerStore",function(t){return t.#U},function(t,e){t.#U=e}],[i_(t=>t.#G()),0,"updateContent",function(t){return t.#q},function(t,e){t.#q=e}],[_,0,"content",function(t){return t.#o},function(t,e){t.#o=e}]],0,t=>#K in t,y))}transition=S(this);routes=(v(this),w(this));locationStore=(E(this),C(this));key=(x(this),L(this));loading=(P(this),k(this));beforeroutechange=(T(this),N(this));routechange=(O(this),R(this));error=(M(this),A(this));scrollContainer=(H(this),I(this));scrollWait=(V(this),j(this));scrollIgnoreHash=(D(this),W(this));trigger=(K(this),U(this,sq));currentRoute=void G(this);currentParams={};get #B(){return"function"==typeof this.scrollContainer?this.scrollContainer():this.scrollContainer}#z=t({content:s5});#F=()=>{if(!this.locationStore)return;let{path:t,query:e,hash:n,data:i}=sq.getParams();this.locationStore({path:t,params:this.currentParams,query:e,hash:n,data:i})};#J;#Y=async()=>{let t=this.#B,e=sq.currentKey;if(!t||e===this.#J)return;this.#J=e;let n=s9.get(e);if(!s7&&void 0!==n){await this.scrollWait?.(),e===sq.currentKey&&t.scroll(0,n);return}(s7||t!==document.scrollingElement)&&(this.scrollIgnoreHash||!sq.getParams().hash)&&t.scroll(0,0)};#Z;#Q=(t,e,n)=>{this.beforeroutechange(t),this.#Z=void 0,this.currentRoute=t,this.currentParams=e;let i=async()=>{this.#z({content:n}),this.#F(),await Promise.resolve(),this.#Y(),this.routechange(this.currentRoute)};this.transition&&"startViewTransition"in document?document.startViewTransition(()=>i()):i()};#K=q(this,()=>{if(this.scrollContainer)return nm(sq,"beforechange",()=>{s7=globalThis.history.state?.$key===sq.currentKey;let t=this.#B;t&&s9.set(sq.currentKey,t.scrollTop)})});#U=(B(this),z(this,()=>this.trigger.store&&nA(this.trigger.store,()=>this.#z())));#G=(F(this),()=>{let{path:t,query:e,hash:n}=this.trigger.getParams();return[this.key,t,e,n]});#q=J(this,([t,e],n)=>{n&&t===n[0]&&e===n[1]?this.#F():this.update()});#o=(Y(this),Z(this,()=>{let{content:t}=this.#z;if(void 0!==t){if(!this.shadowRoot){if(t===s5)return;return nH`${t}`}return t===s5?nH`<slot></slot>`:t}}));update=(Q(this),async()=>{let{path:t,hash:e,query:n}=this.trigger.getParams(),{route:i,params:s={}}=ts.findRoute(this.routes,t),{redirect:r,content:a,getContent:o}=i||{};if(r)return void this.trigger.replace({path:s4({pattern:r},{params:s}),query:n,hash:e});this.trigger===sq&&(location.href!==sB.url||i?.title)&&sB({url:location.href,title:i?.title});let l=a||o?.(s,this.shadowRoot||this);this.loading(i),this.#Z=l;let h=()=>this.#Z===l;try{let t=await l;h()&&this.#Q(i,s,t)}catch(t){h()&&this.error(t)}})}];createLocationStore=()=>{let{path:t,query:e,hash:n,data:i}=sq.getParams();return nM({path:t,query:e,hash:n,data:i,params:{}})};findRoute=(t=[],e)=>{let n=null;for(let i of Array.isArray(t)?t:Object.values(t))if("*"===i.pattern)n=i;else{let t=s8(i.pattern,e);if(t)return{route:i,params:t}}return{route:n}}};let rt=nY`
4
- :host(:where(:not([hidden]))),
5
- :not(:defined) {
6
- display: contents;
7
- }
8
- `;X=iA(),tt=iR(rt),tn=ti;class re extends tn{static{({c:[ts,te]}=sJ(this,[X,tt],[],0,void 0,tn))}static{te()}}function rn(t){return!t.startsWith("/")}let ri=nY`
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Gem=e():t.Gem=e()}(globalThis,()=>(()=>{"use strict";let t,e,n,i,s,r,a,o,l,h,c,u,d,p,f,m,g,y,b,$,_,S,v,w,C,E,x,P,L,k,T,N,O,R,M,A,H,I,V,j,D,W,K,U,G,q,B,z,F,J,Y,Z,Q,X,tt,te,tn,ti,ts,tr,ta,to,tl,th,tc,tu,td,tp,tf,tm,tg,ty,tb,t$,t_,tS,tv,tw,tC,tE,tx,tP,tL,tk,tT,tN,tO,tR,tM,tA,tH,tI,tV,tj,tD,tW,tK,tU,tG,tq,tB,tz,tF,tJ,tY,tZ,tQ,tX,t0,t1,t2,t3,t8,t4,t6,t5,t9,t7,et,ee,en,ei,es,er,ea,eo,el,eh,ec,eu,ed,ep,ef,em,eg,ey,eb,e$,e_,eS,ev,ew,eC,eE,ex,eP,eL,ek,eT,eN,eO,eR,eM,eA,eH,eI,eV,ej,eD,eW,eK,eU,eG,eq,eB,ez,eF;var eJ={};eJ.d=(t,e,n)=>{var i=(e,n)=>{for(var i in e)eJ.o(e,i)&&!eJ.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,[n]:e[i]})};i(e,"get"),i(n,"value")},eJ.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),eJ.r=t=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var eY={};eJ.r(eY),eJ.d(eY,{GemActiveLinkElement:()=>tl,GemDialogBaseElement:()=>f,GemElement:()=>iM,GemError:()=>it,GemLightRouteElement:()=>t5,GemLinkElement:()=>to,GemReflectElement:()=>rr,GemRouteElement:()=>t9,GemTitleElement:()=>ey,GemUnsafeElement:()=>eO,GemUseElement:()=>eF,I18n:()=>rE,LinkedList:()=>n1,Logger:()=>r$,PropProxyMap:()=>n2,QueryString:()=>n3,SheetToken:()=>i_,TemplateResult:()=>nh,UpdateToken:()=>iS,_RenderErrorEvent:()=>iw,_StoreListenerMap:()=>il,_createTemplate:()=>e,_renderRoot:()=>ig,absoluteLocation:()=>nX,addListener:()=>n0,addMicrotask:()=>nY,adoptedStyle:()=>sl,aria:()=>sp,assignState:()=>nZ,async:()=>sd,attribute:()=>i0,basePathStore:()=>sz,boolattribute:()=>i1,camelToKebabCase:()=>n5,classMap:()=>ir,cleanObject:()=>n7,connect:()=>iu,connectStore:()=>sh,createDecoratorTheme:()=>rK,createHistoryParams:()=>sQ,createModalClass:()=>s6,createOverrideTheme:()=>rW,createPath:()=>sZ,createRef:()=>nP,createScopedTheme:()=>rj,createState:()=>t,createStore:()=>ic,createTheme:()=>rD,createUpdater:()=>nQ,css:()=>iP,customElement:()=>sf,del:()=>rT,directive:()=>sm,effect:()=>i4,emitter:()=>sr,exportPartsMap:()=>io,fallback:()=>st,get:()=>rN,getLogicalParent:()=>rs,getThemeProps:()=>rI,getThemeStore:()=>rH,globalemitter:()=>sa,history:()=>sq,html:()=>id,initRequest:()=>rL,isArrayChange:()=>ie,kebabToCamelCase:()=>n9,keyed:()=>sE,light:()=>su,logger:()=>r_,matchPath:()=>sY,mathml:()=>np,mediaQuery:()=>rx,memo:()=>i8,mounted:()=>i9,numattribute:()=>i2,objectMapToString:()=>ii,part:()=>ss,partMap:()=>ia,post:()=>rO,property:()=>i3,put:()=>rR,randomStr:()=>n6,raw:()=>n8,render:()=>ip,repeat:()=>sw,request:()=>rk,setEngine:()=>im,shadow:()=>sc,slot:()=>si,splice:()=>rw,state:()=>se,styleMap:()=>is,styled:()=>n4,svg:()=>nd,template:()=>i7,titleStore:()=>sB,unmounted:()=>i6,version:()=>"2.3.3",willMount:()=>i5});let eZ=globalThis.trustedTypes,eQ=eZ?.createPolicy("lit-html",{createHTML:t=>t}),eX="$lit$",e0=`lit$${Math.random().toFixed(9).slice(2)}$`,e1="?"+e0,e2=`<${e1}>`,e3=document,e8=()=>e3.createComment(""),e4=t=>null===t||"object"!=typeof t&&"function"!=typeof t,e6=t=>null==t,e5=`[
2
+ \f\r]`,e9=`[^
3
+ \f\r"'\`<>=]`,e7=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,nt=/-->/g,ne=/>/g,nn=RegExp(`>|${e5}(?:([^\\s"'>=/]+)(${e5}*=${e5}*(?:${e9}|("|')|))|$)`,"g"),ni=/'/g,ns=/"/g,nr=/^(?:script|style|textarea|title)$/i,na="v-if",no="v-else-if",nl="v-else";class nh{type;strings;values;constructor(t,e,n){this.type=t,this.strings=e,this.values=n}}let nc=t=>(e,...n)=>new nh(t,e,n),nu=nc(1),nd=nc(2),np=nc(3),nf=Symbol.for("lit-noChange"),nm=new WeakMap,ng=e3.createTreeWalker(e3,129);class ny{el;parts=[];constructor({strings:t,type:e},n){let i,s=0,r=0;const a=t.length-1,o=this.parts,[l,h]=((t,e)=>{let n,i=t.length-1,s=[],r=2===e?"<svg>":3===e?"<math>":"",a=e7;for(let e=0;e<i;e++){let i,o,l=t[e],h=-1,c=0;for(;c<l.length&&(a.lastIndex=c,null!==(o=a.exec(l)));)c=a.lastIndex,a===e7?"!--"===o[1]?a=nt:void 0!==o[1]?a=ne:void 0!==o[2]?(nr.test(o[2])&&(n=RegExp(`</${o[2]}`,"g")),a=nn):void 0!==o[3]&&(a=nn):a===nn?">"===o[0]?(a=n??e7,h=-1):void 0===o[1]?h=-2:(h=a.lastIndex-o[2].length,i=o[1],a=void 0===o[3]?nn:'"'===o[3]?ns:ni):a===ns||a===ni?a=nn:a===nt||a===ne?a=e7:(a=nn,n=void 0);let u=a===nn&&t[e+1].startsWith("/>")?" ":"";r+=a===e7?l+e2:h>=0?(s.push(i),l.slice(0,h)+eX+l.slice(h)+e0+u):l+e0+(-2===h?e:u)}let o=r+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"");return[function(t,e){if(!Array.isArray(t))throw Error("invalid template");return void 0!==eQ?eQ.createHTML(e):e}(t,o),s]})(t,e);if(this.el=ny.createElement(l,n),ng.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=ng.nextNode())&&o.length<a;){if(1===i.nodeType){if(i.hasAttributes())for(const t of i.getAttributeNames())if(t.endsWith(eX)){const e=h[r++],n=i.getAttribute(t).split(e0),a=/([.?@])?(.*)/.exec(e);o.push({type:1,index:s,name:a[2],strings:n,ctor:"."===a[1]?nw:"?"===a[1]?nC:"@"===a[1]?nE:nv}),i.removeAttribute(t)}else t.startsWith(e0)&&(o.push({type:6,index:s}),i.removeAttribute(t));if(nr.test(i.tagName)){const t=i.textContent.split(e0),e=t.length-1;if(e>0){i.textContent=eZ?eZ.emptyScript:"";for(let n=0;n<e;n++)i.append(t[n],e8()),ng.nextNode(),o.push({type:2,index:++s});i.append(t[e],e8())}}}else if(8===i.nodeType)if(i.data===e1)o.push({type:2,index:s});else{let t=-1;for(;-1!==(t=i.data.indexOf(e0,t+1));)o.push({type:7,index:s}),t+=e0.length-1}s++}}static createElement(t,e){let n=e3.createElement("template");return n.innerHTML=t,n}}function nb(t,e,n=t,i){if(e===nf)return e;let s=void 0!==i?n.__directives?.[i]:n.__directive,r=e4(e)?void 0:e._$litDirective$;return s?.constructor!==r&&(s?._$notifyDirectiveConnectionChanged?.(!1),void 0===r?s=void 0:(s=new r(t))._$initialize(t,n,i),void 0!==i?(n.__directives??=[])[i]=s:n.__directive=s),void 0!==s&&(e=nb(t,s._$resolve(t,e.values),s,i)),e}class n${_$template;_$parts=[];_$conditions=[];_$parent;_$disconnectableChildren=void 0;constructor(t,e){this._$template=t,this._$parent=e}get parentNode(){return this._$parent.parentNode}get _$isConnected(){return this._$parent._$isConnected}_clone(t){let{el:{content:e},parts:n}=this._$template,i=new Map,s=new Map,r=(t?.creationScope??e3).importNode(e,!0);ng.currentNode=r;let a=ng.nextNode(),o=0,l=0,h=n[0];for(;void 0!==h;){if(o===h.index){let e;2===h.type?e=new nS(a,a.nextSibling,this,t):1===h.type?(h.name===na&&i.set(a,l),h.name===no&&s.set(a,l),e=new h.ctor(a,h.name,h.strings,this,t)):6===h.type&&(e=new nx(a,this,t)),this._$parts.push(e),h=n[++l]}o!==h?.index&&(a=ng.nextNode(),o++)}let c=new Map;for(let t of(i.forEach((t,e)=>{let n=new n_(e,t);this._$conditions.push(n),c.set(e,n);let i=e;for(;i=i.nextElementSibling;){let t=s.get(i);if(void 0===t)break;n.push(i,t)}}),this._$parts)){if(t?.type!==2)continue;let e=c.get(t._$endNode);e&&(t._$endNode=e.mark)}return ng.currentNode=e3,r}_update(t){let e=0;for(let n of this._$parts)void 0!==n&&(void 0!==n.strings?(n._$setValue(t,n,e),e+=n.strings.length-2):n.name===na||n.name===no||n._$setValue(t[e])),e++;this._$conditions.forEach(e=>e.update(t))}}class n_{mark;list;constructor(t,e){const n=e8();n._$chain=this,t.before(n),this.mark=n,this.list=[{ele:t,idx:e}],this.check()}get next(){return this.list.at(-1).ele.nextElementSibling}push(t,e){this.list.push({ele:t,idx:e}),this.check()}check(){let t=this.next;t?.attributes.getNamedItem(nl)&&(this.list.push({ele:t}),t.removeAttribute(nl))}update(t){let{mark:e,list:n}=this,i=n.find(({idx:e})=>void 0===e||!!t[e]);i&&!i.ele.parentNode&&e.after(i.ele),n.forEach(({ele:t})=>(!i||t!==i.ele)&&t.remove())}}class nS{type=2;options;_$committedValue;__directive;_$startNode;_$endNode;_$parent;__isConnected;get _$isConnected(){return this._$parent?._$isConnected??this.__isConnected}_$disconnectableChildren=void 0;constructor(t,e,n,i){this._$startNode=t,this._$endNode=e,this._$parent=n,this.options=i,this.__isConnected=i?.isConnected??!0}get parentNode(){let t=this._$startNode.parentNode,e=this._$parent;return void 0!==e&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$startNode}get endNode(){return this._$endNode}_$setValue(t,e=this){this.parentNode&&(e4(t=nb(this,t,e))?e6(t)||""===t?(e6(this._$committedValue)||this._$clear(),this._$committedValue=void 0):t!==this._$committedValue&&t!==nf&&this._commitText(t):t instanceof nh?this._commitTemplateResult(t):void 0!==t.nodeType?this._commitNode(t):Symbol.iterator in t?this._commitIterable(t):this._commitText(t))}_insert(t){return this._$startNode.parentNode.insertBefore(t,this._$endNode)}_commitNode(t){this._$committedValue!==t&&(this._$clear(),this._$committedValue=this._insert(t))}_commitText(t){!e6(this._$committedValue)&&e4(this._$committedValue)?this._$startNode.nextSibling.data=t:this._commitNode(e3.createTextNode(t)),this._$committedValue=t}_commitTemplateResult(t){let{values:e}=t,n=this._$getTemplate(t);if(this._$committedValue?._$template===n)this._$committedValue._update(e);else{let t=new n$(n,this),i=t._clone(this.options);t._update(e),this._commitNode(i),this._$committedValue=t}}_$getTemplate(t){let e=nm.get(t.strings);return void 0===e&&nm.set(t.strings,e=new ny(t)),e}_commitIterable(t){let e;Array.isArray(this._$committedValue)||(this._$committedValue=[],this._$clear());let n=this._$committedValue,i=0;for(let s of t)i===n.length?n.push(e=new nS(this._insert(e8()),this._insert(e8()),this,this.options)):e=n[i],e._$setValue(s),i++;i<n.length&&(this._$clear(e&&e._$endNode.nextSibling,i),n.length=i)}_$clear(t=this._$startNode.nextSibling,e){for(this._$notifyConnectionChanged?.(!1,!0,e);t&&t!==this._$endNode;){let e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$parent&&(this.__isConnected=t,this._$notifyConnectionChanged?.(t))}}class nv{type=1;element;name;options;strings;_$committedValue;__directives;_$parent;_$disconnectableChildren=void 0;get tagName(){return this.element.tagName}get _$isConnected(){return this._$parent._$isConnected}constructor(t,e,n,i,s){this.element=t,this.name=e,this._$parent=i,this.options=s,n.length>2||""!==n[0]||""!==n[1]?(this._$committedValue=Array(n.length-1).fill(new String),this.strings=n):this._$committedValue=void 0}_$setValue(t,e=this,n,i){let s=this.strings,r=!1;if(void 0===s)(r=!e4(t=nb(this,t,e,0))||t!==this._$committedValue)&&(this._$committedValue=t);else{let i,a,o=t;for(t=s[0],i=0;i<s.length-1;i++)a=nb(this,o[n+i],e,i),r||=!e4(a)||a!==this._$committedValue[i],e6(a)?t=void 0:e6(t)||(t+=a+s[i+1]),this._$committedValue[i]=a}r&&!i&&this._commitValue(t)}_commitValue(t){e6(t)?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t)}}class nw extends nv{type=3;_commitValue(t){this.element[this.name]=t}}class nC extends nv{type=4;_commitValue(t){this.element.toggleAttribute(this.name,!!t)}}class nE extends nv{type=5;_$setValue(t,e=this){t=nb(this,t,e,0);let n=this._$committedValue,i=n&&(!t||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive),s=t&&(!n||i);i&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,t),this._$committedValue=t}handleEvent(t){"function"==typeof this._$committedValue?this._$committedValue.call(this.options?.host??this.element,t):this._$committedValue.handleEvent(t)}}class nx{element;type=6;__directive;_$committedValue;_$parent;_$disconnectableChildren=void 0;_$props;options;constructor(t,e,n){this.element=t,this._$parent=e,this.options=n}get _$isConnected(){return this._$parent._$isConnected}_$setValue(t){if(t)if(t instanceof nL)t.value=this.element;else if(t._$litDirective$)nb(this,t);else{if(this._$props)for(let t in this._$props)Reflect.set(this.element,t,void 0);Object.assign(this.element,t),this._$props=t}}}let nP=()=>new nL;class nL{value}let nk=(t,e,n)=>{let i=n?.renderBefore??e,s=i._$litPart$;if(void 0===s){let t=n?.renderBefore??null;i._$litPart$=s=new nS(e.insertBefore(e8(),t),t,void 0,n??{})}return s._$setValue(t),s},{get:nT,set:nN,has:nO,deleteProperty:nR,defineProperty:nM,getOwnPropertyDescriptor:nA,ownKeys:nH}=Reflect,nI=globalThis.__GEM_SSR__,nV=!!nI,nj={},nD=nI?(t,e)=>{let n=nI();return n?(n.has(t)||n.set(t,e()),n.get(t)):t}:t=>t,nW=nI?t=>{let e=()=>({...t});return new Proxy(t,{get:(n,i)=>nT(nD(t,e),i),set:(n,i,s)=>nN(nD(t,e),i,s),has:(n,i)=>nO(nD(t,e),i),deleteProperty:(n,i)=>nR(nD(t,e),i),defineProperty:(n,i,s)=>nM(nD(t,e),i,s),getOwnPropertyDescriptor:(n,i)=>nA(nD(t,e),i),ownKeys:()=>nH(nD(t,e))})}:t=>t,{assign:nK,fromEntries:nU,entries:nG,keys:nq,defineProperty:nB,hasOwn:nz}=Object,nF=new Set,nJ=()=>new Set;function nY(t){let e=nD(nF,nJ);!e.has(t)&&(Promise.resolve().then(()=>{e.delete(t),t()}),e.add(t))}function nZ(t,e){for(let n of["name","length"])e&&nz(e,n)&&nB(t,n,{value:e[n],writable:!0,enumerable:!0,configurable:!0});nK(t,e)}function nQ(t,e){return delete e.name,delete e.length,nZ(e,t),e}function nX(t="",e=""){let{pathname:n,search:i,hash:s}=new URL(e,location.origin+t);return n+i+decodeURIComponent(s)}function n0(t,e,n,i){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}class n1 extends EventTarget{#t=new Map;#e;#n;#i(t){let e=this.#t.get(t);return e&&(e.prev?e.prev.next=e.next:this.#e=e.next,e.next?e.next.prev=e.prev:this.#n=e.prev,this.#t.delete(t)),e}get size(){return this.#t.size}get first(){return this.#e}get last(){return this.#n}isSuperLinkOf(t,e=!1){let n=t.first;if(!n)return!0;let i=e?this.#e:this.find(n.value);for(;i&&n;){if(i.value===n.value)n=n.next;else if(!e)return!1;i=i.next}return!n}find(t){return this.#t.get(t)}add(t){this.#n||this.dispatchEvent(new CustomEvent("start"));let e=this.#i(t)||{value:t};e.prev=this.#n,e.prev&&(e.prev.next=e),e.next=void 0,this.#n=e,this.#e||(this.#e=e),this.#t.set(t,e)}delete(t){let e=this.#i(t);return this.#e||this.dispatchEvent(new CustomEvent("end")),e}clear(){this.#t.clear(),this.#e=this.#n=void 0}get(){let t=this.#e;if(t)return this.delete(t.value),t.value}}class n2 extends WeakMap{get(t){let e=super.get(t);return e||(e={},this.set(t,e)),e}}class n3 extends URLSearchParams{concat(t){nG("string"==typeof t?nU(new URLSearchParams(t).entries()):t).forEach(([t,e])=>{this.append(t,this.#s(e))})}#s=t=>"string"==typeof t?t:JSON.stringify(t);setAny(t,e){if(Array.isArray(e))this.delete(t),e.forEach(e=>this.append(t,this.#s(e)));else{let n=this.#s(e);n?this.set(t,n):this.delete(t)}}#r=t=>{if(!t)return null;try{return JSON.parse(t)}catch{return null}};getAny(t){return this.getAnyAll(t)[0]}getAnyAll(t){return this.getAll(t).filter(t=>""!==t).map(t=>this.#r(t))}toString(){let t=super.toString();return t?`?${t}`:""}toJSON(){return this.toString()}}function n8(t,...e){return t.reduce((t,n,i)=>t+(e[i-1]??"")+n)}let n4=n8;function n6(t=5){let e=Math.random().toString(36).slice(2,2+t);return e.length<t?e+n6(t-e.length):e}function n5(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function n9(t){return t.replace(/-(.)/g,(t,e)=>e.toUpperCase())}function n7(t){return nq(t).forEach(e=>{delete t[e]}),t}class it extends Error{constructor(t){super(t),this.message=`gem: ${this.message}`}}function ie(t,e){let n=t.length;if(e.length!==n)return!0;for(let i=0;i<n;i++)if(t[i]!==e[i])return!0;return!1}function ii(t,e,n){let i=e;for(let s in t){let r=n(s,t[s]);i+=r?r+e:""}return i}function is(t){return ii(t,";",(t,e)=>e||0===e?`${n5(t)}:${e}`:"")}function ir(t){return ii(t," ",(t,e)=>e?t:"")}let ia=ir;function io(t){return ii(t,",",(t,e)=>!0===e||t===e?t:e?`${t}:${e}`:"")}let il=new WeakMap,ih=()=>new Set;function ic(t,e){let n=ih(),i=nW(nQ(t,t=>{nZ(i,t),n.forEach(nY),nV&&(nD(n,ih).forEach(nY),e&&nj.updateStore?.(e,i))}));return e&&nZ(i,nj.createStore?.(e)),il.set(i,n),i}function iu(t,e){let n=il.get(t),i=n&&nD(n,ih);return i?.add(e),()=>i?.delete(e)}let id=(t,...e)=>n8(t,...e.map(t=>t instanceof Element?t.outerHTML:t)),ip=(t,e)=>e.innerHTML=t;function im(t,e){id=t,ip=e}let ig=(t,e)=>nj.render?.(t,e)||ip(t,e),{assign:iy,defineProperty:ib}=Object;ib(Symbol,"metadata",{value:Symbol.for("Symbol.metadata")});let i$=t=>"function"==typeof t&&t(),i_=Symbol.for("gem@sheetToken"),iS=Symbol.for("gem@update"),iv="gem-style-boundary",iw="gem@render-error",iC=new WeakMap;class iE extends CSSStyleSheet{#a;cssText="";get element(){return this.#a||(this.#a=document.createElement("style"),this.#a.textContent=this.cssText),this.#a}replaceSync(t){this.cssText=t,this.#a&&(this.#a.textContent=t),super.replaceSync(t)}}class ix{#o="";#l="";constructor(t=""){this.#l=t}setContent(t){this.#o=t}#h=new Map;#c({sheet:t,scope:e}){t.replaceSync(e?`${e}{ ${this.#o} }`:this.#o)}getStyle(t,e){let n=t&&!t.internals?.shadowRoot,i=n?t.constructor:this,s=this.#h.get(i);if(!s){let r=n?e?"@scope":`@scope (${t.tagName}) to (:state(${iv}) > *)`:"";s={sheet:new iE({media:this.#l}),scope:r},this.#h.set(i,s),this.#c(s)}return s.sheet}updateStyle(){this.#h.forEach(t=>this.#c(t))}}function iP(t,...e){let n="",i="",s=e.at(0);Array.isArray(t)?i=n8(t,...e):void 0!==s?(n=t,i=s):i=t;let r=new ix(n),a={[i_]:r},o="";return"string"==typeof i?o=i:Object.keys(i).forEach(t=>{let e="$"===t;a[t]=e||t.includes("-")?t:`${t}-${n6()}`,o+=`${e?":where(&:not([hidden])),:host(:where(:not([hidden])))":`.${a[t]}`} {${i[t]}}`}),r.setContent(o),a}let iL=({counts:t,update:e},n,i)=>{let s=!1;n.forEach(e=>{let n=t.get(e)||0;s||=1===i&&0===n||-1===i&&1===n,t.set(e,n+i)}),s&&nY(e)};function ik(t,e){i$(t.preCallback),t.preCallback=t.callback(e,t.values),t.values=e,t.initialized=!0}function iT(t){t.forEach(t=>{let e=t.getDep?.();(!t.getDep||!t.values||ie(t.values,e))&&ik(t,e)})}function iN(t){return t.filter(t=>(i$(t.preCallback),t.preCallback=void 0,t.initialized=!1,t.values=void 0,t.fixed))}let iO=new n1,iR=(t=performance.now())=>{if(performance.now()>t+50)return requestAnimationFrame(iR);let e=iO.get();if(e){try{e()}catch(t){reportError(t)}iR(t)}};iO.addEventListener("start",()=>nY(iR));class iM extends HTMLElement{#u;#d;#p=[];#f=[];#m=[];#g;#y;#b;#$;#_;[iS](){this.#S()}static{t=t=>{let e=n,i=nQ(t,t=>{let n=e.#p.at(0);if(!nV&&e.#y&&n&&!n.initialized)throw new it("Don't set state sync before insert the DOM");nZ(i,t),e.#$||e.#S()});return e.#d.stateList.push(i),i},e=(t,e)=>t.#m.push(e)}constructor(){let t;super(),n=this;const{aria:e,mode:i,delegatesFocus:s,...r}=this.#v,{focusable:a,...o}=e||{};this.#u=i?this.shadowRoot||this.attachShadow({mode:i,delegatesFocus:s,...r}):this,this.#d=this.attachInternals(),this.#u===this||this.#d.shadowRoot||ib(this.#d,"shadowRoot",{value:this.#u}),this.#d.stateList=[],this.#d.sheets=[],iy(this.#d,o),this.#p.push({fixed:!0,getDep:()=>[this.disabled],callback:([e=!1])=>{if(void 0===t&&(t=this.hasAttribute("tabindex")),this.#d.ariaDisabled=String(e),a&&!t&&(this.tabIndex=-Number(e)),(a||s)&&e)return n0(this,"click",t=>t.isTrusted&&t.stopImmediatePropagation(),{capture:!0})}})}get #v(){return this.constructor[Symbol.metadata]}get #w(){return this.#m.findLast(t=>!t.condition||t.condition())}get internals(){return this.#d}#C=()=>{iT(this.#p)};#E=t=>{try{this.#$=!0,iT(this.#f);let e=this.#u===this,n=t?t.render():e?void 0:id`<slot></slot>`;if(void 0===n)return;let i=n??(e?id`<style>@scope{&{display:none!important;}}</style>`:id`<style>:host{&{display:none!important;}}</style>`);ig(i,this.#u)}catch(e){let t=new CustomEvent(iw,{bubbles:!0,composed:!0,cancelable:!0,detail:e});if(this.dispatchEvent(t))throw e}finally{this.#$=!1}};#x=()=>{let t=this.#w;this.#y&&(t||!this.#m.length)&&(this.#E(t),nV||nY(this.#C))};#P=t=>{this.#v.noBlocking&&!nV?iO.add(t):t()};#L=()=>this.#P(this.#x);#S=()=>{this.#y&&nY(this.#L)};#k=()=>{let{adoptedStyleSheets:t=[]}=this.#v,{shadowRoot:e,sheets:n}=this.#d,i=t.map(t=>t[i_].getStyle(this));if(!e)return this.prepend(...n.map(t=>t.element)),((t,e)=>{let n=t.getRootNode(),i=iC.get(n);if(!i){let t=new Map;i={counts:t,update:()=>{let e=(n.adoptedStyleSheets||[]).filter(e=>!t.has(e));t.forEach((t,n)=>t&&e.push(n)),n.adoptedStyleSheets=e.reverse()}},iC.set(n,i)}return iL(i,e,1),()=>iL(i,e,-1)})(this,i);e.adoptedStyleSheets=i.concat(n)};#T=()=>{this.#p.forEach(t=>!t.initialized&&ik(t,t.getDep?.()))};#N=()=>{this.willMount&&this.memo(this.willMount.bind(this),()=>[]),this.mounted&&this.effect(this.mounted.bind(this),()=>[]),this.updated&&this.effect((t,e)=>e&&this.updated.apply(this)),this.unmounted&&this.effect(()=>this.unmounted.bind(this),()=>[]),!this.#m.length&&this.render&&this.#m.push({render:this.render.bind(this),condition:this.shouldUpdate?.bind(this)})};#O;#R=()=>{if(this.#g){this.#g=!1,this.#_?.(),this.#_=this.#k();return}if(nj.connect?.(this,this.#R))return;this.#b=!0,this.#N();let{observedStores:t,mode:e,penetrable:n}=this.#v;this.#d.states.add("gem-element"),e||!this.#m.length||n||this.#d.states.add(iv),this.#O=t?.map(t=>iu(t,this.#L)),this.#E(this.#w),this.#y=!0,this.#_=this.#k(),nV||nY(this.#T)};connectedCallback(){this.#P(this.#R)}disconnectedCallback(){if(this.isConnected){this.#g=!0;return}iO.delete(this.#R),iO.delete(this.#x),this.#y=!1,this.#O?.forEach(t=>t()),this.#p=iN(this.#p),this.#f=iN(this.#f),this.#_?.()}effect=(t,e)=>{let n={callback:t,getDep:e,fixed:!this.#b};this.#y&&ik(n,e?.()),this.#p.push(n)};memo=(t,e)=>{this.#f.push({callback:t,getDep:e,fixed:!this.#b})};update=()=>this.#S()}let{deleteProperty:iA,getOwnPropertyDescriptor:iH,defineProperty:iI}=Reflect,{getPrototypeOf:iV,assign:ij,hasOwn:iD}=Object,iW=new n2;function iK(t,e,n){let i=t.metadata;iH(i,e)||iI(i,e,{value:i[e]?.filter(t=>t!==n)||[]}),i[e].push(n)}function iU(t,e,n,i){let s=t.name;iK(t,e,n),t.addInitializer(function(){let e=iQ(this,t);iD(e,s)||i(e,s),function(t,e){let{value:n}=iH(t,e)||{};iA(t,e),t[e]=n}(this,s)})}let{setAttribute:iG,toggleAttribute:iq,removeAttribute:iB}=Element.prototype,iz=(t,e)=>t.constructor[Symbol.metadata]?.attrProps?.[e];function iF(){}iM.prototype.setAttribute=function(t,e){let n=iz(this,t);if(!n)return iG.call(this,t,e);this[n]=e},iM.prototype.removeAttribute=function(t){let e=iz(this,t);if(!e)return iB.call(this,t);this[e]=null},iM.prototype.toggleAttribute=function(t,e){let n=iz(this,t);return n?this[n]=e??!this.hasAttribute(t):iq.call(this,t,e)};let iJ=Symbol("event handle");function iY(t,e,{attr:n,attrType:i,event:s,eventOptions:r}={}){iI(t,e,{configurable:!0,get(){let t=iW.get(this)[e];return s&&!t?(this[e]=iF,this[e]):t},set(t){let a=this,o=iW.get(a);n&&((t=i===Boolean&&""===t||i(t||""))?iG.call(this,n,i===Boolean?"":t):iB.call(this,n)),t!==o[e]&&(s?(o[e]=t?.[iJ]?t:async(e,n)=>{await Promise.resolve();let i=new CustomEvent(s,{...n,...r,detail:e});a.dispatchEvent(i),await t(e,n)},o[e][iJ]=!0):(o[e]=t,this[iS]()))}})}let iZ=new WeakMap;function iQ(t,{metadata:e}){let n=iZ.get(e);if(n)return n;let i=t;do i=iV(i);while(i.constructor[Symbol.metadata]!==e);return iZ.set(e,i),i}function iX(t,e){let n=t.name,i=n5(n),s=t.metadata;return iD(s,"attrProps")||(s.attrProps=Object.create(s.attrProps||null)),s.attrProps[i]=n,iU(t,"observedAttributes",i,t=>iY(t,n,{attr:i,attrType:e})),function(t){return this.getAttribute(i)??t}}function i0(t,e){return iX(e,String)}function i1(t,e){return iX(e,Boolean)}function i2(t,e){return iX(e,Number)}function i3(t,e){let n=e.name;return iU(e,"observedProperties",n,iY),function(t){return this[n]??t}}function i8(t){return(e,n)=>{let{addInitializer:i,name:s,access:r,kind:a}=n;i(function(){let e=t&&(()=>t(this));if("getter"===a){if(n.private)throw new it("not support");let t=iH(iQ(this,n),s).get.bind(this);this.memo(()=>{iI(this,s,{configurable:!0,value:t()})},e)}else this.memo(r.get.call(this,this).bind(this),e)})}}function i4(t){return(e,{addInitializer:n,access:i})=>{n(function(){this.effect(i.get.call(this,this).bind(this),t&&(()=>t(this)))})}}function i6(){return(t,{addInitializer:e,access:n})=>{e(function(){this.effect(()=>n.get.call(this,this).bind(this),()=>[])})}}function i5(){return i8(()=>[])}function i9(){return i4(()=>[])}function i7(t){return(n,{addInitializer:i,access:s})=>{i(function(){e(this,{render:s.get.call(this,this).bind(this),condition:t&&(()=>t(this))})})}}function st(){return(t,{addInitializer:e,access:n})=>{e(function(){this.addEventListener(iw,t=>{t.preventDefault(),ig(n.get.call(this,this).apply(this,[t.detail]),this.internals.shadowRoot||this)})})}}function se(t,e){let n=n5(e.name);iU(e,"definedCSSStates",n,(t,e)=>{iI(t,e,{configurable:!0,get(){let{states:t}=this.internals;return t?.has(n)},set(t){let{states:e}=this.internals;t?e?.add(n):e?.delete(n)}})})}function sn(t,e,n,i){let s=t.name,r=n5(s);if(t.static)iK(t,n,r);else{let i=iV(e);i[s]||(i[s]=r,iK(t,n,r))}return i||r}function si(t,e){return function(t){return sn(e,this,"definedSlots",t)}}function ss(t,e){return function(t){return sn(e,this,"definedParts",t)}}function sr(t,e){so(e)}function sa(t,e){so(e,{bubbles:!0,composed:!0})}function so(t,e){let n=n5(t.name);iU(t,"definedEvents",n,(t,i)=>iY(t,i,{event:n,eventOptions:e}))}function sl(t){return(e,n)=>{iK(n,"adoptedStyleSheets",t)}}function sh(t){return(e,n)=>{iK(n,"observedStores",t)}}function sc({mode:t="open",serializable:e=!0,...n}={}){return(i,s)=>{ij(s.metadata,{mode:t,serializable:e,...n})}}function su({penetrable:t}){return(e,n)=>{n.metadata.penetrable=t}}function sd(){return(t,e)=>{e.metadata.noBlocking=!0}}function sp(t){return(e,n)=>{let i=n.metadata;i.aria={...i.aria,...t}}}function sf(t){return(e,{addInitializer:n})=>{n(()=>{customElements.define(t,e)})}}let sm=t=>(...e)=>({_$litDirective$:t,values:e});class sg{__part;__attributeIndex;__directive;_$parent;_$disconnectableChildren;get _$isConnected(){return this._$parent._$isConnected}_$initialize(t,e,n){this.__part=t,this._$parent=e,this.__attributeIndex=n}_$resolve(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}let sy=(t,e,n)=>{let i=t._$startNode.parentNode,s=void 0===e?t._$endNode:e._$startNode;if(void 0===n)n=new nS(i.insertBefore(document.createComment(""),s),i.insertBefore(document.createComment(""),s),t,t.options);else{let e=n._$endNode.nextSibling,r=n._$parent,a=r!==t;if(a){let e;n._$reparentDisconnectables?.(t),n._$parent=t,void 0!==n._$notifyConnectionChanged&&(e=t._$isConnected)!==r._$isConnected&&n._$notifyConnectionChanged(e)}if(e!==s||a){let t=n._$startNode;for(;t!==e;){let e=t.nextSibling;i.insertBefore(t,s),t=e}}}return n},sb=(t,e,n=t)=>(t._$setValue(e,n),t),s$={},s_=(t,e=s$)=>t._$committedValue=e,sS=t=>{t._$notifyConnectionChanged?.(!1,!0);let e=t._$startNode,n=t._$endNode.nextSibling;for(;e!==n;){let t=e.nextSibling;e.remove(),e=t}},sv=(t,e,n)=>{let i=new Map;for(let s=e;s<=n;s++)i.set(t[s],s);return i},sw=sm(class extends sg{_itemKeys;constructor(t){if(super(),2!==t.type)throw Error("repeat() can only be used in text expressions")}_getValuesAndKeys(t,e,n){let i;void 0===n?n=e:void 0!==e&&(i=e);let s=[],r=[],a=0;for(let e of t)s[a]=i?i(e,a):a,r[a]=n(e,a),a++;return{values:r,keys:s}}render(t,e,n){return this._getValuesAndKeys(t,e,n).values}update(t,[e,n,i]){let s,r,a=t._$committedValue,{values:o,keys:l}=this._getValuesAndKeys(e,n,i);if(!Array.isArray(a))return this._itemKeys=l,o;let h=this._itemKeys??=[],c=[],u=0,d=a.length-1,p=0,f=o.length-1;for(;u<=d&&p<=f;)if(null===a[u])u++;else if(null===a[d])d--;else if(h[u]===l[p])c[p]=sb(a[u],o[p]),u++,p++;else if(h[d]===l[f])c[f]=sb(a[d],o[f]),d--,f--;else if(h[u]===l[f])c[f]=sb(a[u],o[f]),sy(t,c[f+1],a[u]),u++,f--;else if(h[d]===l[p])c[p]=sb(a[d],o[p]),sy(t,a[u],a[d]),d--,p++;else if(void 0===s&&(s=sv(l,p,f),r=sv(h,u,d)),s.has(h[u]))if(s.has(h[d])){let e=r.get(l[p]),n=void 0!==e?a[e]:null;if(null===n){let e=sy(t,a[u]);sb(e,o[p]),c[p]=e}else c[p]=sb(n,o[p]),sy(t,a[u],n),a[e]=null;p++}else sS(a[d]),d--;else sS(a[u]),u++;for(;p<=f;){let e=sy(t,c[f+1]);sb(e,o[p]),c[p++]=e}for(;u<=d;){let t=a[u++];null!==t&&sS(t)}return this._itemKeys=l,s_(t,c),nf}}),sC=Symbol(),sE=sm(class extends sg{#M=sC;render(t,e){return e}update(t,[e,n]){return this.#M!==sC&&e!==this.#M&&s_(t),this.#M=e,n}});im(nu,nk);let sx={GemElement:iM,setEngine:im,html:nu,render:nk,css:iP,createState:t,version:"2.3.3"};globalThis.__GEM_DEVTOOLS__HOOK__&&!globalThis.__GEM_DEVTOOLS__HOOK__.GemElement&&Object.assign(globalThis.__GEM_DEVTOOLS__HOOK__,sx);let sP=globalThis.history,sL=sP.pushState.bind(sP),sk=sP.replaceState.bind(sP),sT=0,sN=()=>`${performance.now()}-${++sT}`,sO=ic({$hasCloseHandle:!1,$hasOpenHandle:!1,$hasShouldCloseHandle:!1,$key:""}),sR=new Map,sM=()=>new Map([...sR].map(([t,e])=>[t,{...e}])),sA=["$key","$hasCloseHandle","$hasOpenHandle","$hasShouldCloseHandle"];function sH(t){return t===sU.basePath?"/":t.replace(RegExp(`^${sU.basePath}/`),"/")}function sI(t){sU.dispatchEvent(new CustomEvent("beforechange")),n7(sO),sO(t)}function sV(t){let e=sU.getParams()||{path:sH(location.pathname),query:new n3,title:document.title},n=t.path?nX(e.path,t.path):sH(location.pathname),i=new n3(t.query??(t.path?"":location.search)),s=String(i)!==String(e.query),r=s?i:e.query,a=n!==e.path||s,o=t.title||(a?"":e.title),l=t.close||t.data||t.open||t.shouldClose,h=decodeURIComponent(t.hash??(!a&&l?location.hash:""));return{...t,title:o,path:n,query:r,hash:h}}function sj(t,e){var n=t.data;if(sO.$key!==n?.$key){for(let t of sA)if(n?.[t])throw new it(`\`${t}\` is not allowed`)}let i=sV(t),{title:s,path:r,query:a,hash:o,close:l,open:h,shouldClose:c,data:u}=i,d={$hasCloseHandle:!!l,$hasOpenHandle:!!h,$hasShouldCloseHandle:!!c,$key:sN(),$title:s,...u};nD(sR,sM).set(d.$key,i),sI(d);let p=(sU.basePath?sU.basePath+r:r)+new n3(a)+o,f=decodeURIComponent(location.hash);e(d,s,p),f!==o&&dispatchEvent(new CustomEvent("hashchange"))}function sD(t,e,n,i){let{pathname:s,search:r,hash:a}=new URL(n,location.origin+location.pathname);sj({path:s,query:r,hash:a,title:e,data:t},i)}let sW=ic({basePath:""});class sK extends EventTarget{get store(){return sO}get currentKey(){return sO.$key}get basePath(){return sW.basePath}set basePath(t){sW({basePath:t}),Object.assign(this.getParams(),{path:sH(location.pathname)})}getParams(){return nD(sR,sM).get(sO.$key)}updateParams(t){Object.assign(this.getParams(),t),sO()}push(t){sj(t,sL)}replace(t){sj(t,sk)}pushIgnoreCloseHandle(t){sO.$hasCloseHandle?(this.getParams()?.close?.(),this.replace(t)):this.push(t)}forward(){sP.forward()}back(){sP.back()}}let sU=new sK,sG=ic({defaultTitle:document.title,url:"",title:""});if(!globalThis._GEMHISTORY){if(globalThis._GEMHISTORY={history:sU,titleStore:sG,basePathStore:sW},sP.pushState=(t,e,n)=>{sD(t,e,n,sL)},sP.replaceState=(t,e,n)=>{sD(t,e,n,sk)},addEventListener("hashchange",({isTrusted:t})=>{t&&sU.replace({hash:location.hash})}),sP.state)if(sP.state.$hasCloseHandle){sO(sP.state);let t=sV({title:document.title});nD(sR,sM).set(sO.$key,t),sU.back()}else{let t=sV({title:document.title,hash:location.hash});sO({$key:sN(),...sP.state||{}}),nD(sR,sM).set(sO.$key,t)}else{let{protocol:t,pathname:e,search:n,hash:i}=location;(t.startsWith("http")||t.startsWith("tauri"))&&sU.replace({path:e,query:n,hash:i})}iu(sG,()=>{let t=sU.getParams();t&&(t.title=sG.title)}),iu(sO,()=>{let{title:t}=sU.getParams();t!==sG.title&&sG({title:t})});let t=!1;addEventListener("popstate",e=>{let n=e.state;if(n?.$key){if(t){t=!1;return}if(!nD(sR,sM).has(n.$key)){let{pathname:t,search:e,hash:i}=location;nD(sR,sM).set(n.$key,{path:sH(t),query:new n3(e),hash:decodeURIComponent(i),title:sG.title||n.$title,data:n})}if(parseFloat(n.$key)>parseFloat(sO.$key)&&n.$hasOpenHandle)nD(sR,sM).get(n.$key)?.open?.();else if(sO.$hasCloseHandle){let e=nD(sR,sM).get(sO.$key),i=e?.close,s=e?.shouldClose;if(s&&!s()){t=!0,sU.forward();return}i?i():n.$hasCloseHandle&&(t=!0,sU.back())}sI(n)}})}let{history:sq,titleStore:sB,basePathStore:sz}=globalThis._GEMHISTORY,sF=/^[\w\-./~]*/,sJ=new Map;function sY(t,e){let n=sJ.get(t);return n||sJ.set(t,n=function(t){let e=sF.exec(t)[0];if(e===t)return e=>e===t?{}:null;if("*"===t)return t=>({0:t});if(!globalThis.URLPattern){let e,n,i;return e=0,n=t.replace(/:[^/$]+|\*/g,t=>"*"===t?`(?<_${e++}>.*)`:`(?<${t.slice(1)}>[^/]+)`),i=RegExp(`^${n}$`),t=>{let e=t.match(i);if(!e)return null;let n={};for(let t in e.groups)n[t.startsWith("_")?t.slice(1):t]=e.groups[t];return n}}let n=new URLPattern({pathname:t}),i=e.replace(/\/$/,"");return t=>t.startsWith(i)?n.exec({pathname:t})?.pathname.groups:null}(t)),n(e)||n(`${e}/`)||null}function sZ(t,e){let n=0,i=t.pattern.replaceAll("*",()=>`:${n++}`),s=e?.params;return s&&Object.keys(s).forEach(t=>{i=i.replace(RegExp(`:${t}`,"g"),s[t])}),i}function sQ(t,e){return{path:sZ(t,e),...e}}function sX(t,e,n){"symbol"==typeof e&&(e=(e=e.description)?"["+e+"]":"");try{Object.defineProperty(t,"name",{configurable:!0,value:n?n+" "+e:e})}catch(t){}return t}function s0(t,e,n,i,s,r){var a,o,l,h,c,u,d,p=Symbol.metadata||Symbol.for("Symbol.metadata"),f=Object.defineProperty,m=Object.create,g=[m(null),m(null)],y=e.length;function b(e,n,i){return function(s,r){n&&(r=s,s=t);for(var a=0;a<e.length;a++)r=e[a].apply(s,i?[r]:[]);return i?r:s}}function $(t,e,n,i){if("function"!=typeof t&&(i||void 0!==t))throw TypeError(e+" must "+(n||"be")+" a function"+(i?"":" or undefined"));return t}function _(t,e,n,i,s,r,a,o,l,h,c){function p(t){if(!c(t))throw TypeError("Attempted to access private element on non-instance")}var m=[].concat(e[0]),y=e[3],_=!a,S=1===s,v=3===s,w=4===s,C=2===s;function E(e,n,i){return function(s,r){return n&&(r=s,s=t),i&&i(s),x[e].call(s,r)}}var x={},P=[],L=v?"get":w||S?"set":"value";if(!_&&(l?(h||S?x={get:sX(function(){return y(this)},i,"get"),set:function(t){e[4](this,t)}}:x[L]=y,h||sX(x[L],i,C?"":L)):h||(x=Object.getOwnPropertyDescriptor(t,i)),!h&&!l)){if((d=g[+o][i])&&(d^s)!=7)throw Error("Decorating two elements with the same name ("+x[L].name+") is not supported yet");g[+o][i]=s<3?1:s}for(var k=t,T=m.length-1;T>=0;T-=n?2:1){var N=$(m[T],"A decorator","be",!0),O=n?m[T-1]:void 0,R={},M={kind:["field","accessor","method","getter","setter","class"][s],name:i,metadata:u,addInitializer:(function(t,e){if(t.v)throw TypeError("attempted to call addInitializer after decoration was finished");$(e,"An initializer","be",!0),r.push(e)}).bind(null,R)};if(_){d=N.call(O,k,M),R.v=1,$(d,"class decorators","return")&&(k=d);continue}if(M.static=o,M.private=l,d=M.access={has:l?c.bind():function(t){return i in t}},w||(d.get=l?C?function(t){return p(t),x.value}:E("get",0,p):function(t){return t[i]}),C||v||(d.set=l?E("set",0,p):function(t,e){t[i]=e}),k=N.call(O,S?{get:x.get,set:x.set}:x[L],M),R.v=1,S){if("object"==typeof k&&k)(d=$(k.get,"accessor.get"))&&(x.get=d),(d=$(k.set,"accessor.set"))&&(x.set=d),(d=$(k.init,"accessor.init"))&&P.unshift(d);else if(void 0!==k)throw TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else $(k,(h?"field":"method")+" decorators","return")&&(h?P.unshift(k):x[L]=k)}return s<2&&a.push(b(P,o,1),b(r,o,0)),h||_||(l?S?a.splice(-1,0,E("get",o),E("set",o)):a.push(C?x[L]:$.call.bind(x[L])):f(t,i,x)),k}function S(t){return f(t,p,{configurable:!0,enumerable:!0,value:u})}return void 0!==r&&(u=r[p]),u=m(null==u?null:u),l=[],h=function(t){t&&l.push(b(t))},(c=function(e,i){for(var r=0;r<n.length;r++){var h=n[r],c=h[1],u=7&c;if((8&c)==e&&!u==i){var d=h[2],p=!!h[3],f=16&c;_(e?t:t.prototype,h,f,p?"#"+d:function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(d),u,u<2?[]:e?o=o||[]:a=a||[],l,!!e,p,i,e&&p?function(e){return function(t){if(Object(t)!==t)throw TypeError("right-hand side of 'in' should be an object, got "+(null!==t?typeof t:"null"));return t}(e)===t}:s)}}})(8,0),c(0,0),c(8,1),c(0,1),h(a),h(o),d=l,y||S(t),{e:d,get c(){var v=[];return y&&[S(t=_(t,[e],i,t.name,5,v)),b(v,1)]}}}let s1=Symbol();i=sh(sq.store),s=sp({role:"dialog",ariaModal:"true"}),a=iM,o=i5();class s2 extends a{static{({e:[l,h,c,u,d,p],c:[f,r]}=s0(this,[i,s],[[i0,0,"label"],[se,0,"opened"],[o,0,"init",function(t){return t.#A},function(t,e){t.#A=e}]],0,t=>#A in t,a))}label=l(this);opened=(h(this),c(this));#H=void u(this);#I;#V=[];#j=()=>{this.inert=!0,this.#V.forEach(t=>t.inert=!1),this.#H?this.#H.before(this):this.#I&&this.#I?.appendChild(this),this.dispatchEvent(new CustomEvent("close")),this.opened=!1};#D=()=>{this.hidden=!1,this.inert=!1,this.#H=this.nextSibling,this.#I=this.parentElement||this.getRootNode(),this.#V=[...document.body.children].filter(t=>!t.inert),this.#V.forEach(t=>t.inert=!0),document.body.append(this),this.dispatchEvent(new CustomEvent("open")),this.opened=!0};#A=d(this,()=>this.inert=!0);open=(p(this),()=>{if(!this.opened)return this.#D(),sq.push({title:this.label,open:this.#D,close:this.#j,shouldClose:this.shouldClose}),s1});shouldClose(){return!0}close=()=>(sq.back(),s1);forceClose=()=>(this.opened=!1,setTimeout(this.close,100),s1);static{r()}}function s3(t){return t}let s8=Symbol("open mark"),s4=Symbol();function s6(t){let e,n,i,s,r,a,o,l,h,c,u;return e=sc(),n=sp({role:"alertdialog",ariaModal:"true"}),s=iM,r=i9(),a=i9(),new class extends s3{constructor(){super(u),i()}static [class extends s{static{({e:[o,l,h,c],c:[u,i]}=s0(this,[e,n],[[r,0,"connectHistory",function(t){return t.#W},function(t,e){t.#W=e}],[a,0,"connectStore",function(t){return t.#K},function(t,e){t.#K=e}]],0,t=>#W in t,s))}constructor(...t){super(...t),c(this)}static get isOpen(){return this.store[s8]}static open(t){let e=new this;this.instance=e,this.inertStore=[...document.body.children].filter(t=>!t.inert),this.inertStore.forEach(t=>t.inert=!0),document.body.append(e);let n=()=>this.store({[s8]:!0,...t});return setTimeout(()=>{n(),sq.push({title:e.label,open:n,close:this.closeHandle.bind(this),shouldClose:this.shouldClose.bind(this)})},100),s4}static close(){return sq.back(),s4}static closeHandle(){return this.inertStore.forEach(t=>t.inert=!1),this.instance?.remove(),this.store({[s8]:!1,...t}),s4}static shouldClose(){return!0}label="";#W=o(this,()=>iu(sq.store,this.update));#K=(l(this),h(this,()=>iu(u.store,this.update)))}];inertStore=[];instance=null;store=ic({[s8]:!1,...t})},u}function s5(t){return!t.startsWith("/")}let s9=iP`
9
4
  :host {
10
5
  /* link default style */
11
6
  cursor: pointer;
@@ -19,11 +14,16 @@
19
14
  a:visited {
20
15
  color: unset;
21
16
  }
22
- `;tr=iM(sz),ta=iR(ri),to=iA(),tl=iV({focusable:!0}),tc=n3,tu=iw(),td=iE(),new class extends sQ{constructor(){super(tZ),th()}static [class extends tc{static{({e:[tI,tp,tf,tm,tg,ty,tb,t$,t_,tS,tv,tw,tE,tC,tx,tL,tP,tk,tT,tN,tO,tR,tM,tA,tH,tV,tj,tD],c:[tZ,th]}=sJ(this,[tr,ta,to,tl],[[ik,8,"link"],[im,0,"href"],[im,0,"target"],[im,0,"path"],[im,0,"query"],[im,0,"hash"],[im,0,"hint"],[ig,0,"preload"],[ib,0,"route"],[ib,0,"options"],[ib,0,"routeOptions"],[ib,0,"prepare"],[tu,2,"init",function(){this.addEventListener("click",this.#X),this.addEventListener("pointerenter",this.#tt)}],[td,0,"content",function(t){return t.#o},function(t,e){t.#o=e}]],0,t=>#M in t,tc))}constructor(...t){super(...t),tj(this)}href=(tD(this),tm(this));target=(tg(this),ty(this));path=(tb(this),t$(this));query=(t_(this),tS(this));hash=(tv(this),tw(this));hint=(tE(this),tC(this));preload=(tx(this),tL(this));route=(tP(this),tk(this));options=(tT(this),tN(this));routeOptions=(tO(this),tR(this));prepare=(tM(this),tA(this));get #te(){return this.routeOptions||this.options}get #tn(){return this.hint||"on"}#X=(tH(this),async t=>{t.preventDefault();let e=this._getLocationString();if(!e)return;if(rn(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}let{path:n,query:i,hash:s}=sq.getParams();if(n+i+s!==e)if(await this.prepare?.(),this.route)sq.pushIgnoreCloseHandle(s6(this.route,this.#te));else if(this.href){let t=new URL(e,location.origin);sq.pushIgnoreCloseHandle({path:t.pathname,query:t.search,hash:t.hash})}else sq.pushIgnoreCloseHandle({path:this.path,query:this.query,hash:this.hash})});#ti=()=>{let t=this._getLocationString();if(rn(t))return t;let e=new URL(sq.basePath+t,location.origin);return e7?e.pathname+e.search+e.hash:e.toString()};#tt=()=>{this.route?.content,this.route?.getContent?.({},this.shadowRoot)};get #M(){return tI}#o=tV(this,()=>{let t="off"===this.#tn?null:this.#ti();return nH`<a part=${tZ.link} href=${t} tabindex="-1"><slot></slot></a>`});_getLocationString(){if(this.route){let t=this.#te?.query||"",e=this.#te?.hash||"";return s4(this.route,this.#te)+t+e}{let t=this.href||this.path+this.query+this.hash,{path:e,query:n}=sq.getParams();return t.startsWith("#")?`${e}${n}${t}`:t.startsWith("?")?`${e}${t}`:t.startsWith(".")?nf(e,t):t}}}];link=(()=>{let t=tp();return tf(),t})()},tW=iM(sq.store),tU=tZ,tG=i_();class rs extends tU{static{({e:[tq,tB,tz,tF,tJ,tY],c:[tQ,tK]}=sJ(this,[tW],[[im,0,"pattern"],[ix,0,"active"],[tG,0,"updateState",function(t){return t.#ts},function(t,e){t.#ts=e}]],0,t=>#ts in t,tU))}constructor(...t){super(...t),tY(this)}pattern=tq(this);active=(tB(this),tz(this));#ts=(tF(this),tJ(this,()=>{let{path:t,query:e,hash:n}=sq.getParams(),i=this.pattern&&s8(this.pattern,t);this.active=!!i||t+e+n===this._getLocationString()}));static{tK()}}customElements.define("gem-link",tZ),customElements.define("gem-active-link",tQ);let rr="gem-reflect-end",ra=t=>new Comment(t),ro=new WeakSet,rl=new WeakMap;function rh(t){let e=t.parentNode;if(e&&ro.has(e)){let e=(t=>{for(let e=t.previousSibling;e;e=e.previousSibling){let t=rl.get(e);if(t)return t;if(e.nodeValue===rr)return}})(t);if(e)return e}return e instanceof ShadowRoot?e.host:t.parentElement}tX=iv(),t0=i_(t=>[t.target]);class rc extends n3{static{({e:[t1,t2,t3,t8,t4,t6,t5,t9]}=sJ(this,[],[[im,0,"method"],[ib,0,"target"],[tX,0,"init",function(t){return t.#M},function(t,e){t.#M=e}],[t0,0,"changeTarget",function(t){return t.#tr},function(t,e){t.#tr=e}]],0,t=>#M in t))}constructor(...t){super(...t),t9(this)}method=t1(this);target=(t2(this),t3(this,document.head));get #ta(){return this.method||"append"}#M=(t8(this),t4(this,()=>{this.hidden=!0}));#to=(t6(this),ra("gem-reflect-start"));#tl=ra(rr);#th;#tr=t5(this,()=>(ro.add(this.target),rl.set(this.#to,this),(this.#th||[this.#to,...this.childNodes,this.#tl]).forEach((t,e,n)=>{let i=n[e-1];i?i.after(t):this.target[this.#ta](t)}),()=>{this.#th=(t=>{let e=[],n=t;for(;n&&(e.push(n),n.nodeValue!==rr);)n=n.nextSibling;return e})(this.#to),this.#th.forEach(t=>t.remove())}))}customElements.define("gem-reflect",rc),customElements.define("gem-route",ts),customElements.define("gem-light-route",ti);let ru=0,rd=t=>{clearTimeout(ru),ru=setTimeout(()=>document.title=t)};t7=iA(),ee=n3,en=i_(t=>[t.inert]),ei=iw(),es=iE(),new class extends sQ{constructor(){super(ey),et()}static [class extends ee{static{({e:[er,ea,eo,el,eh,ec,eu,ed,ep,ef,em,eg],c:[ey,et]}=sJ(this,[t7],[[im,0,"prefix"],[im,0,"suffix"],[ig,0,"inert"],[en,0,"connectStore",function(t){return t.#W},function(t,e){t.#W=e}],[ei,0,"obTextContent",function(t){return t.#tc},function(t,e){t.#tc=e}],[es,0,"content",function(t){return t.#o},function(t,e){t.#o=e}]],0,t=>#W in t,ee))}constructor(...t){super(...t),eg(this)}prefix=er(this);suffix=(ea(this),eo(this));inert=(el(this),eh(this));static setTitle(t){sB({title:t})}#W=(ec(this),eu(this,()=>!this.inert&&nA(sB,this.update)));#tu=(ed(this),new MutationObserver(()=>this.update()));#tc=ep(this,()=>{this.#tu.observe(this,{characterData:!0,childList:!0,subtree:!0})});#o=(ef(this),em(this,()=>(!function(t,e="",n=""){let i=sB.title||t;i&&i!==sB.defaultTitle?rd(e+(ey.title=i)+n):rd(ey.title=sB.defaultTitle)}(this.textContent?.trim(),this.prefix,this.suffix),nH`${ey.title}`)))}];title=document.title},customElements.define("gem-title",ey);let rp=nY`
17
+ `;m=sh(sz),g=sl(s9),y=sc(),b=sp({focusable:!0}),_=iM,S=i9(),v=i7(),new class extends s3{constructor(){super(to),$()}static [class extends _{static{({e:[z,w,C,E,x,P,L,k,T,N,O,R,M,A,H,I,V,j,D,W,K,U,G,q,B,F,J,Y],c:[to,$]}=s0(this,[m,g,y,b],[[ss,8,"link"],[i0,0,"href"],[i0,0,"target"],[i0,0,"path"],[i0,0,"query"],[i0,0,"hash"],[i0,0,"hint"],[i1,0,"preload"],[i3,0,"route"],[i3,0,"options"],[i3,0,"routeOptions"],[i3,0,"prepare"],[S,2,"init",function(){this.addEventListener("click",this.#U),this.addEventListener("pointerenter",this.#G)}],[v,0,"content",function(t){return t.#o},function(t,e){t.#o=e}]],0,t=>#A in t,_))}constructor(...t){super(...t),J(this)}href=(Y(this),E(this));target=(x(this),P(this));path=(L(this),k(this));query=(T(this),N(this));hash=(O(this),R(this));hint=(M(this),A(this));preload=(H(this),I(this));route=(V(this),j(this));options=(D(this),W(this));routeOptions=(K(this),U(this));prepare=(G(this),q(this));get #q(){return this.routeOptions||this.options}get #B(){return this.hint||"on"}#U=(B(this),async t=>{t.preventDefault();let e=this._getLocationString();if(!e)return;if(s5(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}let{path:n,query:i,hash:s}=sq.getParams();if(n+i+s!==e)if(await this.prepare?.(),this.route)sq.pushIgnoreCloseHandle(sQ(this.route,this.#q));else if(this.href){let t=new URL(e,location.origin);sq.pushIgnoreCloseHandle({path:t.pathname,query:t.search,hash:t.hash})}else sq.pushIgnoreCloseHandle({path:this.path,query:this.query,hash:this.hash})});#z=()=>{let t=this._getLocationString();if(s5(t))return t;let e=new URL(sq.basePath+t,location.origin);return nV?e.pathname+e.search+e.hash:e.toString()};#G=()=>{this.route?.content,this.route?.getContent?.({},this.shadowRoot)};get #A(){return z}#o=F(this,()=>{let t="off"===this.#B?null:this.#z();return id`<a part=${to.link} href=${t} tabindex="-1"><slot></slot></a>`});_getLocationString(){if(this.route){let t=this.#q?.query||"",e=this.#q?.hash||"";return sZ(this.route,this.#q)+t+e}{let t=this.href||this.path+this.query+this.hash,{path:e,query:n}=sq.getParams();return t.startsWith("#")?`${e}${n}${t}`:t.startsWith("?")?`${e}${t}`:t.startsWith(".")?nX(e,t):t}}}];link=(()=>{let t=w();return C(),t})()},Z=sh(sq.store),X=to,tt=i4();class s7 extends X{static{({e:[te,tn,ti,ts,tr,ta],c:[tl,Q]}=s0(this,[Z],[[i0,0,"pattern"],[se,0,"active"],[tt,0,"updateState",function(t){return t.#F},function(t,e){t.#F=e}]],0,t=>#F in t,X))}constructor(...t){super(...t),ta(this)}pattern=te(this);active=(tn(this),ti(this));#F=(ts(this),tr(this,()=>{let{path:t,query:e,hash:n}=sq.getParams(),i=this.pattern&&sY(this.pattern,t);this.active=!!i||t+e+n===this._getLocationString()}));static{Q()}}customElements.define("gem-link",to),customElements.define("gem-active-link",tl);let rt="gem-reflect-end",re=t=>new Comment(t),rn=new WeakSet,ri=new WeakMap;function rs(t){let e=t.parentNode;if(e&&rn.has(e)){let e=(t=>{for(let e=t.previousSibling;e;e=e.previousSibling){let t=ri.get(e);if(t)return t;if(e.nodeValue===rt)return}})(t);if(e)return e}return e instanceof ShadowRoot?e.host:t.parentElement}th=i5(),tc=i4(t=>[t.target]);class rr extends iM{static{({e:[tu,td,tp,tf,tm,tg,ty,tb]}=s0(this,[],[[i0,0,"method"],[i3,0,"target"],[th,0,"init",function(t){return t.#A},function(t,e){t.#A=e}],[tc,0,"changeTarget",function(t){return t.#J},function(t,e){t.#J=e}]],0,t=>#A in t))}constructor(...t){super(...t),tb(this)}method=tu(this);target=(td(this),tp(this,document.head));get #Y(){return this.method||"append"}#A=(tf(this),tm(this,()=>{this.hidden=!0}));#Z=(tg(this),re("gem-reflect-start"));#Q=re(rt);#X;#J=ty(this,()=>(rn.add(this.target),ri.set(this.#Z,this),(this.#X||[this.#Z,...this.childNodes,this.#Q]).forEach((t,e,n)=>{let i=n[e-1];i?i.after(t):this.target[this.#Y](t)}),()=>{this.#X=(t=>{let e=[],n=t;for(;n&&(e.push(n),n.nodeValue!==rt);)n=n.nextSibling;return e})(this.#Z),this.#X.forEach(t=>t.remove())}))}customElements.define("gem-reflect",rr);let ra=id``,ro=new Map,rl=!1;t$=su({penetrable:!0}),tS=iM,tv=i4(t=>[t.scrollContainer]),tw=i4(t=>[t.scrollContainer]),tC=i7(t=>!t.inert),new class extends s3{constructor(){super(t5),t_()}static [class extends tS{static{({e:[tE,tx,tP,tL,tk,tT,tN,tO,tR,tM,tA,tH,tI,tV,tj,tD,tW,tK,tU,tG,tq,tB,tz,tF,tJ,tY,tZ,tQ,tX,t0,t1,t2],c:[t5,t_]}=s0(this,[t$],[[i1,0,"transition"],[i3,0,"routes"],[i3,0,"locationStore"],[i3,0,"key"],[sr,0,"loading"],[sr,0,"beforeroutechange"],[sr,0,"routechange"],[sr,0,"error"],[i3,0,"scrollContainer"],[i3,0,"scrollWait"],[i3,0,"scrollIgnoreHash"],[i3,0,"trigger"],[tv,0,"rememberScrollPosition",function(t){return t.#tt},function(t,e){t.#tt=e}],[tw,0,"connectTriggerStore",function(t){return t.#te},function(t,e){t.#te=e}],[i4(t=>t.#tn()),0,"updateContent",function(t){return t.#ti},function(t,e){t.#ti=e}],[tC,0,"content",function(t){return t.#o},function(t,e){t.#o=e}]],0,t=>#tt in t,tS))}transition=tE(this);routes=(tx(this),tP(this));locationStore=(tL(this),tk(this));key=(tT(this),tN(this));loading=(tO(this),tR(this));beforeroutechange=(tM(this),tA(this));routechange=(tH(this),tI(this));error=(tV(this),tj(this));scrollContainer=(tD(this),tW(this));scrollWait=(tK(this),tU(this));scrollIgnoreHash=(tG(this),tq(this));trigger=(tB(this),tz(this,sq));currentRoute=void tF(this);currentParams={};get #ts(){return"function"==typeof this.scrollContainer?this.scrollContainer():this.scrollContainer}#tr=t({content:ra});#ta=()=>{if(!this.locationStore)return;let{path:t,query:e,hash:n,data:i}=sq.getParams();this.locationStore({path:t,params:this.currentParams,query:e,hash:n,data:i})};#to;#tl=async()=>{let t=this.#ts,e=sq.currentKey;if(!t||e===this.#to)return;this.#to=e;let n=ro.get(e);if(!rl&&void 0!==n){await this.scrollWait?.(),e===sq.currentKey&&t.scroll(0,n);return}(rl||t!==document.scrollingElement)&&(this.scrollIgnoreHash||!sq.getParams().hash)&&t.scroll(0,0)};#th;#tc=(t,e,n)=>{this.beforeroutechange(t),this.#th=void 0,this.currentRoute=t,this.currentParams=e;let i=async()=>{this.#tr({content:n}),this.#ta(),await Promise.resolve(),this.#tl(),this.routechange(this.currentRoute)};this.transition&&"startViewTransition"in document?document.startViewTransition(()=>i()):i()};#tt=tJ(this,()=>{if(this.scrollContainer)return n0(sq,"beforechange",()=>{rl=globalThis.history.state?.$key===sq.currentKey;let t=this.#ts;t&&ro.set(sq.currentKey,t.scrollTop)})});#te=(tY(this),tZ(this,()=>this.trigger.store&&iu(this.trigger.store,()=>this.#tr())));#tn=(tQ(this),()=>{let{path:t,query:e,hash:n}=this.trigger.getParams();return[this.key,t,e,n]});#ti=tX(this,([t,e],n)=>{n&&t===n[0]&&e===n[1]?this.#ta():this.update()});#o=(t0(this),t1(this,()=>{let{content:t}=this.#tr;if(void 0!==t){if(!this.shadowRoot){if(t===ra)return;return id`${t}`}return t===ra?id`<slot></slot>`:t}}));update=(t2(this),async()=>{let{path:t,hash:e,query:n}=this.trigger.getParams(),{route:i,params:s={}}=t9.findRoute(this.routes,t),{redirect:r,content:a,getContent:o}=i||{};if(r)return void this.trigger.replace({path:sZ({pattern:r},{params:s}),query:n,hash:e});this.trigger===sq&&(location.href!==sB.url||i?.title)&&sB({url:location.href,title:i?.title});let l=a||o?.(s,this.shadowRoot||this);this.loading(i),this.#th=l;let h=()=>this.#th===l;try{let t=await l;h()&&this.#tc(i,s,t)}catch(t){h()&&this.error(t)}})}];createLocationStore=()=>{let{path:t,query:e,hash:n,data:i}=sq.getParams();return ic({path:t,query:e,hash:n,data:i,params:{}})};findRoute=(t=[],e)=>{let n=null;for(let i of Array.isArray(t)?t:Object.values(t))if("*"===i.pattern)n=i;else{let t=sY(i.pattern,e);if(t)return{route:i,params:t}}return{route:n}}};let rh=iP`
18
+ :host(:where(:not([hidden]))),
19
+ :not(:defined) {
20
+ display: contents;
21
+ }
22
+ `;t3=sc(),t8=sl(rh),t6=t5;class rc extends t6{static{({c:[t9,t4]}=s0(this,[t3,t8],[],0,void 0,t6))}static{t4()}}customElements.define("gem-route",t9),customElements.define("gem-light-route",t5);let ru=0,rd=t=>{clearTimeout(ru),ru=setTimeout(()=>document.title=t)};t7=sc(),ee=iM,en=i4(t=>[t.inert]),ei=i9(),es=i7(),new class extends s3{constructor(){super(ey),et()}static [class extends ee{static{({e:[er,ea,eo,el,eh,ec,eu,ed,ep,ef,em,eg],c:[ey,et]}=s0(this,[t7],[[i0,0,"prefix"],[i0,0,"suffix"],[i1,0,"inert"],[en,0,"connectStore",function(t){return t.#K},function(t,e){t.#K=e}],[ei,0,"obTextContent",function(t){return t.#tu},function(t,e){t.#tu=e}],[es,0,"content",function(t){return t.#o},function(t,e){t.#o=e}]],0,t=>#K in t,ee))}constructor(...t){super(...t),eg(this)}prefix=er(this);suffix=(ea(this),eo(this));inert=(el(this),eh(this));static setTitle(t){sB({title:t})}#K=(ec(this),eu(this,()=>!this.inert&&iu(sB,this.update)));#td=(ed(this),new MutationObserver(()=>this.update()));#tu=ep(this,()=>{this.#td.observe(this,{characterData:!0,childList:!0,subtree:!0})});#o=(ef(this),em(this,()=>(!function(t,e="",n=""){let i=sB.title||t;i&&i!==sB.defaultTitle?rd(e+(ey.title=i)+n):rd(ey.title=sB.defaultTitle)}(this.textContent?.trim(),this.prefix,this.suffix),id`${ey.title}`)))}];title=document.title},customElements.define("gem-title",ey);let rp=iP`
23
23
  :host(:where(:not([hidden]))) {
24
24
  display: contents;
25
25
  }
26
- `;eb=iA(),e$=iR(rp),eS=n3,ev=i_(),ew=iE();class rf extends eS{static{({e:[eE,eC,ex,eL,eP,ek,eT,eN],c:[eO,e_]}=sJ(this,[eb,e$],[[im,0,"html"],[ib,0,"styles"],[ev,0,"adoptStyles",function(t){return t.#td},function(t,e){t.#td=e}],[ew,0,"content",function(t){return t.#o},function(t,e){t.#o=e}]],0,t=>#td in t,eS))}constructor(...t){super(...t),eN(this)}html=eE(this);styles=(eC(this),ex(this));get #h(){if(!this.styles)return[];if("string"!=typeof this.styles)return[this.styles].flat().map(t=>t[nU].getStyle());{let t=new CSSStyleSheet;return t.replaceSync(this.styles),[t]}}#td=(eL(this),eP(this,()=>{let t=this.shadowRoot.adoptedStyleSheets;return this.shadowRoot.adoptedStyleSheets=t.concat(this.#h),()=>{this.shadowRoot.adoptedStyleSheets=t}}));#o=(ek(this),eT(this,()=>{this.shadowRoot.innerHTML=this.html}));static{e_()}}customElements.define("gem-unsafe",eO);let rm=nY`
26
+ `;eb=sc(),e$=sl(rp),eS=iM,ev=i4(),ew=i7();class rf extends eS{static{({e:[eC,eE,ex,eP,eL,ek,eT,eN],c:[eO,e_]}=s0(this,[eb,e$],[[i0,0,"html"],[i3,0,"styles"],[ev,0,"adoptStyles",function(t){return t.#tp},function(t,e){t.#tp=e}],[ew,0,"content",function(t){return t.#o},function(t,e){t.#o=e}]],0,t=>#tp in t,eS))}constructor(...t){super(...t),eN(this)}html=eC(this);styles=(eE(this),ex(this));get #h(){if(!this.styles)return[];if("string"!=typeof this.styles)return[this.styles].flat().map(t=>t[i_].getStyle());{let t=new CSSStyleSheet;return t.replaceSync(this.styles),[t]}}#tp=(eP(this),eL(this,()=>{let t=this.shadowRoot.adoptedStyleSheets;return this.shadowRoot.adoptedStyleSheets=t.concat(this.#h),()=>{this.shadowRoot.adoptedStyleSheets=t}}));#o=(ek(this),eT(this,()=>{this.shadowRoot.innerHTML=this.html}));static{e_()}}customElements.define("gem-unsafe",eO);let rm=iP`
27
27
  :host(:where(:not([hidden]))) {
28
28
  position: relative;
29
29
  display: inline-flex;
@@ -33,4 +33,4 @@
33
33
  width: 100%;
34
34
  height: 100%;
35
35
  }
36
- `,rg=new Map,ry=new Map;eR=iA(),eM=iR(rm),eH=n3,eI=iE();class rb extends eH{static{({e:[eV,ej,eD,eW,eK,eU,eG,eq,eB,ez],c:[eF,eA]}=sJ(this,[eR,eM],[[im,0,"selector"],[ib,0,"root"],[ib,0,"element"],[ix,0,"active"],[eI,0,"content",function(t){return t.#o},function(t,e){t.#o=e}]],0,t=>#o in t,eH))}constructor(...t){super(...t),ez(this)}selector=eV(this);root=(ej(this),eD(this));element=(eW(this),eK(this));active=(eU(this),eG(this));#tp=(eq(this),()=>{let t=this.element||(this.selector?(this.root||document).querySelector(this.selector):null);if("string"==typeof t&&e7){let e=ry.get(t);return e||(e=Object.assign([t],{raw:[t]}),ry.set(t,e)),nH(e)}if("string"==typeof t){let e=rg.get(t);return e||((e=document.createElement("template")).innerHTML=t,rg.set(t,e)),e.content.cloneNode(!0)}return t instanceof HTMLTemplateElement?t.content.cloneNode(!0):t?.cloneNode(!0)});#o=eB(this,()=>nH`${this.#tp()}<slot></slot>`);static{eA()}}customElements.define("gem-use",eF);class r${#tf;get #tm(){return`[${this.#tf}]`}constructor(t){this.#tf=t}info=(...t)=>{console.log(this.#tm,...t)};warn=(...t)=>{console.warn(this.#tm,...t)};error=(...t)=>{console.error(this.#tm,...t)}}let r_=new r$("GEM"),rS=/\$\d(?:<[^>]*>)?/,rv=/\$(\d)(<([^>]*)>)?/g;function rw(t,...e){let n,i=t.split(rS),s=[];for(;n=rv.exec(t);){let t=n[3],i=e[Number(n[1])-1];s.push("function"==typeof i?i(t):i)}return nH(i,...s)}let rE=!1;class rC{resources;fallbackLanguage;cache;cachePrefix="gem-i18n";urlParamsType;urlParamsName;onChange;#z=nn({currentLanguage:"",pending:void 0});#tg=rE;#ty=new Set;get currentLanguage(){return this.#z.currentLanguage}set currentLanguage(t){this.#z.currentLanguage=t}get ready(){return Promise.all([this.#z.pending,...[...this.#ty].map(t=>t.ready)])}replace=({path:t})=>this.setLanguage(t);getParams=()=>({path:this.currentLanguage});get #tb(){return`${this.cachePrefix}:current`}get #t$(){return`i18n:${this.cachePrefix}`}get #t_(){let{hostname:t,pathname:e,search:n}=location,i=t.split(".");switch(this.urlParamsType){case"ccTLD":return i.pop();case"gTLD":return i.shift();case"path":return e.split("/")[1];default:{let t=this.urlParamsName&&new URLSearchParams(n).get(this.urlParamsName)||"";return t in this.resources?t:""}}}get #tS(){return!this.#tg&&this.cache&&localStorage.getItem(this.#tb)||""}set #tv(t){this.#tg||(document.documentElement.lang=t),this.currentLanguage=t,this.onChange?.(t)}#tw=Object.defineProperties({},{currentLanguage:{enumerable:!0,get:()=>this.currentLanguage},currentLanguagePack:{enumerable:!0,get:()=>this.#tE()}});#tC=!0;constructor(t){if(!t.resources[t.fallbackLanguage])throw new nC("i18n: fallbackLanguage invalid");Object.assign(this,t);const e=e7?void 0:nt.createStore?.(this.#t$);e&&(this.resources[e.currentLanguage]=e.currentLanguagePack);const n=this.#tg?this.currentLanguage||e?.currentLanguage:e?.currentLanguage||this.#t_||this.currentLanguage||this.#tS;n?(this.#tv=n,this.setLanguage(n)):this.resetLanguage(),this.#tC=!1}#tx(t){let e=this.resources[t];return e&&"object"==typeof e?e:void 0}#tE(){let t={...this.#tx(this.fallbackLanguage)};for(let[e,n]of Object.entries(this.#tx(this.currentLanguage)||{}))n&&(t[e]=n);return t}get(t,...e){e7&&nt.updateStore?.(this.#t$,this.#tw);let n=this.#tx(this.currentLanguage),i=this.#tx(this.fallbackLanguage),s=n?.[t]||i?.[t];s||!n||i||this.#tL();let r=("object"==typeof s?s.message:s)||`[${t}]`;return e.length?rw(r,...e):r}detectLanguage(){let t=Object.keys(this.resources);for(let e of navigator.languages.map(t=>t.replace(/-(.*)/,t=>t.toUpperCase()))){let n=t.find(t=>t===e||e.startsWith(`${t}-`));if(n)return n}return this.fallbackLanguage}#tP(t){return`${this.cachePrefix}:pack:${t}`}#tk(t){if(this.cache&&!e7)try{return JSON.parse(localStorage.getItem(this.#tP(t))||"null")||void 0}catch{}}#tT(t,e){if(!this.cache||e7)return!1;let n=this.#tP(t),i=JSON.stringify(e);try{if(localStorage.getItem(n)===i)return!1;let e=new Set([t,this.currentLanguage,this.fallbackLanguage].map(t=>this.#tP(t))),s=this.#tP("");for(let t of Object.keys(localStorage))t.startsWith(s)&&!e.has(t)&&localStorage.removeItem(t);localStorage.setItem(n,i)}catch{}return!0}#tN(t){let e=this.resources[t];if("function"!=typeof e)return e;let n=this.#tk(t),i=e().then(e=>{let i=e&&"object"==typeof e.default?e.default:e;return this.resources[t]=i,this.#tT(t,i)&&n&&this.#tO(),i});return n?(i.catch(e=>r_.warn(`${this.cachePrefix}: failed to load \`${t}\``,e)),this.resources[t]=n,n):i}#tR;#tL(){this.#tR||=Promise.resolve(this.#tN(this.fallbackLanguage)).then(()=>this.#tO())}#tO(){let t=[document.documentElement];for(;t.length;){let e=t.pop();e[nG]?.(),t.push(...[...e.children,...e.shadowRoot?.children||[]].reverse())}}setLanguage(t){let e=this.#tM(t);return this.#z.pending=e,e}async #tM(t){if(!this.resources[t])return r_.warn(`${this.cachePrefix}: not found \`${t}\``),this.resetLanguage();let e=[...this.#ty].map(e=>e.setLanguage(t)),n=(e7&&t!==this.fallbackLanguage?[t,this.fallbackLanguage]:[t]).map(t=>this.#tN(t));return n.some(t=>t instanceof Promise)&&await Promise.all(n),this.#tC||this.#tO(),t!==this.currentLanguage&&(this.#tv=t),!0===this.cache&&this.setCache(),await Promise.all(e),t}resetLanguage(){return this.cache&&localStorage.removeItem(this.#tb),this.setLanguage(this.detectLanguage())}setCache(){this.#tg||localStorage.setItem(this.#tb,this.currentLanguage)}createSubModule(t,e){rE=!0;try{let n=new rC({resources:e,cachePrefix:`${this.cachePrefix}-${t}`,currentLanguage:this.currentLanguage,fallbackLanguage:this.fallbackLanguage,cache:this.cache});return this.#ty.add(n),n}finally{rE=!1}}}let rx={PRINT:"print",get isPrint(){return matchMedia(this.PRINT).matches},HOVER:"(hover: hover)",get isHover(){return matchMedia(this.HOVER).matches},PWA:"(display-mode: standalone)",get isPWA(){return matchMedia(this.PWA).matches},MOTION_REDUCE:"(prefers-reduced-motion: reduce)",get isMotionReduce(){return matchMedia(this.MOTION_REDUCE).matches},DATA_REDUCE:"(prefers-reduced-data: reduce)",get isDataReduce(){return matchMedia(this.DATA_REDUCE).matches},WATCH:"(width < 320px)",get isWatch(){return matchMedia(this.WATCH).matches},SMALL_PHONE:"(320px <= width <= 480px) and (height <= 640px)",get isSmallPhone(){return matchMedia(this.SMALL_PHONE).matches},PHONE:"(320px <= width <= 480px)",get isPhone(){return matchMedia(this.PHONE).matches},PHONE_LANDSCAPE:"(480px < width < 960px) and (orientation: landscape)",get isPhoneLandscape(){return matchMedia(this.PHONE_LANDSCAPE).matches},SHORT:"(width >= 480px) and (height <= 320px)",get isShort(){return matchMedia(this.SHORT).matches},TABLET:"(480px < width <= 1280px)",get isTablet(){return matchMedia(this.TABLET).matches},DESKTOP:"(width > 1280px) and (orientation: landscape)",get isDesktop(){return matchMedia(this.DESKTOP).matches},WIDTHSCREEN:"(width >= 1920px) and (orientation: landscape)",get isWidthScreen(){return matchMedia(this.WIDTHSCREEN).matches}},rL=Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)).constructor;function rP(t={}){let{origin:e=location.origin,base:n="",appendHeaders:i=()=>({}),transformInput:s=t=>t,transformOutput:r=t=>t,...a}=t,o=t=>t instanceof FormData||t instanceof Blob||t instanceof rL||t instanceof URLSearchParams||t instanceof ReadableStream||t instanceof ArrayBuffer?t:"object"==typeof t?JSON.stringify(t):t,l=(t,i)=>{if(new URL(t,location.origin).pathname!==t)throw new nC("`path` format is incorrect");let s=new URLSearchParams(i).toString();return`${e}${n}${t}${s?"?":""}${s}`},h=t=>t?t instanceof Headers?Object.fromEntries(t):Object.fromEntries((Array.isArray(t)?t:Object.entries(t)).map(([t,e])=>[t.toLowerCase(),e])):{},c=async(t,e={})=>{let n=new Request(t,{...a,...e,headers:new Headers({"content-type":"application/json",...h(a.headers),...h(e.headers)})}),i=await fetch(n);if(204===i.status)return;if(0===i.status)throw Error("Request fail");if(i.status>=500)throw Error(i.statusText);let s=n.headers.get("content-type"),o=i.status>=400;try{let t;if(t=s.includes("json")?await i.json():s.includes("octet-stream")?await i.arrayBuffer():await i.text(),o)throw Error(i.statusText,{cause:t});return await r(t,n)}catch{throw Error("Parse error")}};return{request:c,async get(t,e){let n=await s(e);return c(l(t,n),{method:"GET",headers:await i(n)})},async del(t,e){let n=await s(e);return c(l(t,n),{method:"DELETE",headers:await i(n)})},async put(t,e){let n=await s(e);return c(l(t),{method:"PUT",headers:await i(n),body:o(n)})},async post(t,e){let n=await s(e);return c(l(t),{method:"POST",headers:await i(n),body:o(n)})}}}let{request:rk,del:rT,get:rN,post:rO,put:rR}=rP(),rM=new WeakMap,rA=new WeakMap;function rH(t){return rM.get(t)}function rI(t){return rA.get(t)}function rV(t,e={},n=nS()){let i=nY({})[nU],s=nM(t),r=()=>{Object.keys(s).forEach(t=>{e[t]||(e[t]=`--${nv(t)}-${n}`,a[t]=`var(${e[t]})`)})},a=new Proxy(np({[nU]:i},t=>{s(t),r()}),{get(t,e){if(!t[e]){let[n,i,s]=e.match(/^(\w*Color)(\d+)$/)||[];i&&(t[e]=`oklch(from ${t[i]} calc(l - ${(Number(s)-400)/1e3}) c h)`)}return t[e]}});rA.set(a,e),rM.set(a,s);let o=()=>{r();let t="";Object.keys(s).forEach(n=>{t+=`${e[n]}:${s[n]};`}),i.setContent(`&,:host{${t}}`)};return o(),nA(s,()=>{o(),i.updateStyle()}),a}function rj(t,e){return rV(t,{},e)}function rD(t,e){let n=rj(t,e);return document.adoptedStyleSheets.push(n[nU].getStyle()),n}function rW(t,e){return rV(e,rI(t))}function rK(t,e){let n=rV(t,{},e),i=rI(n);return np(n,e=>(n,{addInitializer:s,access:r})=>{s(function(){let n=rV({...t},i),s=n[nU].getStyle(this,!0);this.internals.sheets.push(s),this.memo(()=>{if(e7||CSS.supports("font:-apple-system-body"))return n(r.get(this).apply(this));let t=r.get(this).apply(this),e=s.cssRules[0],a=this.shadowRoot?e:s.element?.sheet?.cssRules[0]?.cssRules?.[0];for(let e in i)a?.style.setProperty(i[e],t[e])},e&&(()=>e(this)))})})}return eY})());
36
+ `,rg=new Map,ry=new Map;eR=sc(),eM=sl(rm),eH=iM,eI=i7();class rb extends eH{static{({e:[eV,ej,eD,eW,eK,eU,eG,eq,eB,ez],c:[eF,eA]}=s0(this,[eR,eM],[[i0,0,"selector"],[i3,0,"root"],[i3,0,"element"],[se,0,"active"],[eI,0,"content",function(t){return t.#o},function(t,e){t.#o=e}]],0,t=>#o in t,eH))}constructor(...t){super(...t),ez(this)}selector=eV(this);root=(ej(this),eD(this));element=(eW(this),eK(this));active=(eU(this),eG(this));#tf=(eq(this),()=>{let t=this.element||(this.selector?(this.root||document).querySelector(this.selector):null);if("string"==typeof t&&nV){let e=ry.get(t);return e||(e=Object.assign([t],{raw:[t]}),ry.set(t,e)),id(e)}if("string"==typeof t){let e=rg.get(t);return e||((e=document.createElement("template")).innerHTML=t,rg.set(t,e)),e.content.cloneNode(!0)}return t instanceof HTMLTemplateElement?t.content.cloneNode(!0):t?.cloneNode(!0)});#o=eB(this,()=>id`${this.#tf()}<slot></slot>`);static{eA()}}customElements.define("gem-use",eF);class r${#tm;get #tg(){return`[${this.#tm}]`}constructor(t){this.#tm=t}info=(...t)=>{console.log(this.#tg,...t)};warn=(...t)=>{console.warn(this.#tg,...t)};error=(...t)=>{console.error(this.#tg,...t)}}let r_=new r$("GEM"),rS=/\$\d(?:<[^>]*>)?/,rv=/\$(\d)(<([^>]*)>)?/g;function rw(t,...e){let n,i=t.split(rS),s=[];for(;n=rv.exec(t);){let t=n[3],i=e[Number(n[1])-1];s.push("function"==typeof i?i(t):i)}return id(i,...s)}let rC=!1;class rE{resources;fallbackLanguage;cache;cachePrefix="gem-i18n";urlParamsType;urlParamsName;onChange;#tr=nW({currentLanguage:"",pending:void 0});#ty=rC;#tb=new Set;get currentLanguage(){return this.#tr.currentLanguage}set currentLanguage(t){this.#tr.currentLanguage=t}get ready(){return Promise.all([this.#tr.pending,...[...this.#tb].map(t=>t.ready)])}replace=({path:t})=>this.setLanguage(t);getParams=()=>({path:this.currentLanguage});get #t$(){return`${this.cachePrefix}:current`}get #t_(){return`i18n:${this.cachePrefix}`}get #tS(){let{hostname:t,pathname:e,search:n}=location,i=t.split(".");switch(this.urlParamsType){case"ccTLD":return i.pop();case"gTLD":return i.shift();case"path":return e.split("/")[1];default:{let t=this.urlParamsName&&new URLSearchParams(n).get(this.urlParamsName)||"";return t in this.resources?t:""}}}get #tv(){return!this.#ty&&this.cache&&localStorage.getItem(this.#t$)||""}set #tw(t){this.#ty||(document.documentElement.lang=t),this.currentLanguage=t,this.onChange?.(t)}#tC=Object.defineProperties({},{currentLanguage:{enumerable:!0,get:()=>this.currentLanguage},currentLanguagePack:{enumerable:!0,get:()=>this.#tE()}});#tx=!0;constructor(t){if(!t.resources[t.fallbackLanguage])throw new it("i18n: fallbackLanguage invalid");Object.assign(this,t);const e=nV?void 0:nj.createStore?.(this.#t_);e&&(this.resources[e.currentLanguage]=e.currentLanguagePack);const n=this.#ty?this.currentLanguage||e?.currentLanguage:e?.currentLanguage||this.#tS||this.currentLanguage||this.#tv;n?(this.#tw=n,this.setLanguage(n)):this.resetLanguage(),this.#tx=!1}#tP(t){let e=this.resources[t];return e&&"object"==typeof e?e:void 0}#tE(){let t={...this.#tP(this.fallbackLanguage)};for(let[e,n]of Object.entries(this.#tP(this.currentLanguage)||{}))n&&(t[e]=n);return t}get(t,...e){nV&&nj.updateStore?.(this.#t_,this.#tC);let n=this.#tP(this.currentLanguage),i=this.#tP(this.fallbackLanguage),s=n?.[t]||i?.[t];s||!n||i||this.#tL();let r=("object"==typeof s?s.message:s)||`[${t}]`;return e.length?rw(r,...e):r}detectLanguage(){let t=Object.keys(this.resources);for(let e of navigator.languages.map(t=>t.replace(/-(.*)/,t=>t.toUpperCase()))){let n=t.find(t=>t===e||e.startsWith(`${t}-`));if(n)return n}return this.fallbackLanguage}#tk(t){return`${this.cachePrefix}:pack:${t}`}#tT(t){if(this.cache&&!nV)try{return JSON.parse(localStorage.getItem(this.#tk(t))||"null")||void 0}catch{}}#tN(t,e){if(!this.cache||nV)return!1;let n=this.#tk(t),i=JSON.stringify(e);try{if(localStorage.getItem(n)===i)return!1;let e=new Set([t,this.currentLanguage,this.fallbackLanguage].map(t=>this.#tk(t))),s=this.#tk("");for(let t of Object.keys(localStorage))t.startsWith(s)&&!e.has(t)&&localStorage.removeItem(t);localStorage.setItem(n,i)}catch{}return!0}#tO(t){let e=this.resources[t];if("function"!=typeof e)return e;let n=this.#tT(t),i=e().then(e=>{let i=e&&"object"==typeof e.default?e.default:e;return this.resources[t]=i,this.#tN(t,i)&&n&&this.#tR(),i});return n?(i.catch(e=>r_.warn(`${this.cachePrefix}: failed to load \`${t}\``,e)),this.resources[t]=n,n):i}#tM;#tL(){this.#tM||=Promise.resolve(this.#tO(this.fallbackLanguage)).then(()=>this.#tR())}#tR(){let t=[document.documentElement];for(;t.length;){let e=t.pop();e[iS]?.(),t.push(...[...e.children,...e.shadowRoot?.children||[]].reverse())}}setLanguage(t){let e=this.#tA(t);return this.#tr.pending=e,e}async #tA(t){if(!this.resources[t])return r_.warn(`${this.cachePrefix}: not found \`${t}\``),this.resetLanguage();let e=[...this.#tb].map(e=>e.setLanguage(t)),n=(nV&&t!==this.fallbackLanguage?[t,this.fallbackLanguage]:[t]).map(t=>this.#tO(t));return n.some(t=>t instanceof Promise)&&await Promise.all(n),this.#tx||this.#tR(),t!==this.currentLanguage&&(this.#tw=t),!0===this.cache&&this.setCache(),await Promise.all(e),t}resetLanguage(){return this.cache&&localStorage.removeItem(this.#t$),this.setLanguage(this.detectLanguage())}setCache(){this.#ty||localStorage.setItem(this.#t$,this.currentLanguage)}createSubModule(t,e){rC=!0;try{let n=new rE({resources:e,cachePrefix:`${this.cachePrefix}-${t}`,currentLanguage:this.currentLanguage,fallbackLanguage:this.fallbackLanguage,cache:this.cache});return this.#tb.add(n),n}finally{rC=!1}}}let rx={PRINT:"print",get isPrint(){return matchMedia(this.PRINT).matches},HOVER:"(hover: hover)",get isHover(){return matchMedia(this.HOVER).matches},PWA:"(display-mode: standalone)",get isPWA(){return matchMedia(this.PWA).matches},MOTION_REDUCE:"(prefers-reduced-motion: reduce)",get isMotionReduce(){return matchMedia(this.MOTION_REDUCE).matches},DATA_REDUCE:"(prefers-reduced-data: reduce)",get isDataReduce(){return matchMedia(this.DATA_REDUCE).matches},WATCH:"(width < 320px)",get isWatch(){return matchMedia(this.WATCH).matches},SMALL_PHONE:"(320px <= width <= 480px) and (height <= 640px)",get isSmallPhone(){return matchMedia(this.SMALL_PHONE).matches},PHONE:"(320px <= width <= 480px)",get isPhone(){return matchMedia(this.PHONE).matches},PHONE_LANDSCAPE:"(480px < width < 960px) and (orientation: landscape)",get isPhoneLandscape(){return matchMedia(this.PHONE_LANDSCAPE).matches},SHORT:"(width >= 480px) and (height <= 320px)",get isShort(){return matchMedia(this.SHORT).matches},TABLET:"(480px < width <= 1280px)",get isTablet(){return matchMedia(this.TABLET).matches},DESKTOP:"(width > 1280px) and (orientation: landscape)",get isDesktop(){return matchMedia(this.DESKTOP).matches},WIDTHSCREEN:"(width >= 1920px) and (orientation: landscape)",get isWidthScreen(){return matchMedia(this.WIDTHSCREEN).matches}},rP=Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)).constructor;function rL(t={}){let{origin:e=location.origin,base:n="",appendHeaders:i=()=>({}),transformInput:s=t=>t,transformOutput:r=t=>t,...a}=t,o=t=>t instanceof FormData||t instanceof Blob||t instanceof rP||t instanceof URLSearchParams||t instanceof ReadableStream||t instanceof ArrayBuffer?t:"object"==typeof t?JSON.stringify(t):t,l=(t,i)=>{if(new URL(t,location.origin).pathname!==t)throw new it("`path` format is incorrect");let s=new URLSearchParams(i).toString();return`${e}${n}${t}${s?"?":""}${s}`},h=t=>t?t instanceof Headers?Object.fromEntries(t):Object.fromEntries((Array.isArray(t)?t:Object.entries(t)).map(([t,e])=>[t.toLowerCase(),e])):{},c=async(t,e={})=>{let n=new Request(t,{...a,...e,headers:new Headers({"content-type":"application/json",...h(a.headers),...h(e.headers)})}),i=await fetch(n);if(204===i.status)return;if(0===i.status)throw Error("Request fail");if(i.status>=500)throw Error(i.statusText);let s=n.headers.get("content-type"),o=i.status>=400;try{let t;if(t=s.includes("json")?await i.json():s.includes("octet-stream")?await i.arrayBuffer():await i.text(),o)throw Error(i.statusText,{cause:t});return await r(t,n)}catch{throw Error("Parse error")}};return{request:c,async get(t,e){let n=await s(e);return c(l(t,n),{method:"GET",headers:await i(n)})},async del(t,e){let n=await s(e);return c(l(t,n),{method:"DELETE",headers:await i(n)})},async put(t,e){let n=await s(e);return c(l(t),{method:"PUT",headers:await i(n),body:o(n)})},async post(t,e){let n=await s(e);return c(l(t),{method:"POST",headers:await i(n),body:o(n)})}}}let{request:rk,del:rT,get:rN,post:rO,put:rR}=rL(),rM=new WeakMap,rA=new WeakMap;function rH(t){return rM.get(t)}function rI(t){return rA.get(t)}function rV(t,e={},n=n6()){let i=iP({})[i_],s=ic(t),r=()=>{Object.keys(s).forEach(t=>{e[t]||(e[t]=`--${n5(t)}-${n}`,a[t]=`var(${e[t]})`)})},a=new Proxy(nQ({[i_]:i},t=>{s(t),r()}),{get(t,e){if(!t[e]){let[n,i,s]=e.match(/^(\w*Color)(\d+)$/)||[];i&&(t[e]=`oklch(from ${t[i]} calc(l - ${(Number(s)-400)/1e3}) c h)`)}return t[e]}});rA.set(a,e),rM.set(a,s);let o=()=>{r();let t="";Object.keys(s).forEach(n=>{t+=`${e[n]}:${s[n]};`}),i.setContent(`&,:host{${t}}`)};return o(),iu(s,()=>{o(),i.updateStyle()}),a}function rj(t,e){return rV(t,{},e)}function rD(t,e){let n=rj(t,e);return document.adoptedStyleSheets.push(n[i_].getStyle()),n}function rW(t,e){return rV(e,rI(t))}function rK(t,e){let n=rV(t,{},e),i=rI(n);return nQ(n,e=>(n,{addInitializer:s,access:r})=>{s(function(){let n=rV({...t},i),s=n[i_].getStyle(this,!0);this.internals.sheets.push(s),this.memo(()=>{if(nV||CSS.supports("font:-apple-system-body"))return n(r.get(this).apply(this));let t=r.get(this).apply(this),e=s.cssRules[0],a=this.shadowRoot?e:s.element?.sheet?.cssRules[0]?.cssRules?.[0];for(let e in i)a?.style.setProperty(i[e],t[e])},e&&(()=>e(this)))})})}return eY})());