fairy-ring 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -24,16 +24,16 @@ use bleeding-edge web tooling to deliver a simple and fun developer and user exp
24
24
 
25
25
  ## how?
26
26
 
27
+ [getting started](https://fairy-ring.loga.nz/?path=/story/docs-getting-started--getting-started)
28
+
27
29
  1. write a fairy-ring config file in TOML and put it on the internet
28
30
  2. embed your fairy-ring using a tiny snippet:
29
31
 
30
32
  ```html
31
33
  <script type="module" src="https://cdn.jsdelivr.net/npm/fairy-ring/dist/standalone.js"></script>
32
- <fairy-ring config-url="https://your-site.example/fairy-ring.toml"></fairy-ring>
34
+ <fairy-ring class="my-ring" config-url="https://my-ring.example/fairy-ring.toml"></fairy-ring>
33
35
  ```
34
36
 
35
- or use one of the framework wrappers: React, Vue, SolidJS.
36
-
37
37
  ## development
38
38
 
39
39
  Install:
@@ -47,3 +47,9 @@ Run storybook:
47
47
  ```bash
48
48
  pnpm dev
49
49
  ```
50
+
51
+ Update screenshot snapshots (requires Docker):
52
+
53
+ ```bash
54
+ pnpm test:update
55
+ ```
@@ -0,0 +1,90 @@
1
+ import { Task } from "@lit/task";
2
+ import { LitElement, css, html } from "lit";
3
+ import { property } from "lit/decorators.js";
4
+ import { a as getPrev, d as defaultLoadingString, i as getNext, l as renderTemplate, n as fetchConfig, o as getRandom, s as logConfigErrors, u as defaultErrorString } from "./lib-B5FPZH-w.js";
5
+ // \0@oxc-project+runtime@0.159.0/helpers/esm/decorate.js
6
+ function __decorate(decorators, target, key, desc) {
7
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
8
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
9
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
10
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
11
+ }
12
+ // src/element.ts
13
+ var FairyRingElement = class extends LitElement {
14
+ static {
15
+ this.styles = css`
16
+ :host {
17
+ display: grid;
18
+ grid-template-areas: "prev home random next";
19
+ justify-content: start;
20
+ align-items: center;
21
+ gap: 1em;
22
+
23
+ &::part(prev) {
24
+ grid-area: prev;
25
+ }
26
+ &::part(home) {
27
+ grid-area: home;
28
+ }
29
+ &::part(random) {
30
+ grid-area: random;
31
+ }
32
+ &::part(next) {
33
+ grid-area: next;
34
+ }
35
+ &::part(loading),
36
+ &::part(error) {
37
+ display: none;
38
+ }
39
+ }
40
+
41
+ :host([hidden]) {
42
+ display: none;
43
+ }
44
+
45
+ /* match the surrounding text instead of the browser's default link blue/purple */
46
+ a {
47
+ color: inherit;
48
+ }
49
+ `;
50
+ }
51
+ #config = new Task(this, {
52
+ args: () => [this.configUrl],
53
+ task: async ([url], { signal }) => {
54
+ if (!url) throw new Error("missing config-url");
55
+ return logConfigErrors(fetchConfig({
56
+ url,
57
+ init: { signal }
58
+ }));
59
+ }
60
+ });
61
+ render() {
62
+ return html`
63
+ ${this.#config.render({
64
+ pending: () => html`<div part="loading">${renderTemplate(defaultLoadingString, {})}</div>`,
65
+ error: () => html`<div part="error">${renderTemplate(defaultErrorString, {})}</div>`,
66
+ complete: (config) => {
67
+ const r = (s) => renderTemplate(s, { name: config.name });
68
+ return html`
69
+ <a part="prev link widget" rel="prev" href=${getPrev(config)?.url ?? ""}
70
+ >${r(config.strings.previous)}</a
71
+ >
72
+ ${config.homeUrl ? html`<a part="home link widget" href=${config.homeUrl}>${r(config.homeText)}</a>` : html`<div part="home widget">${r(config.homeText)}</div>`}
73
+ <a part="random link widget" href=${getRandom(config)?.url ?? ""}
74
+ >${r(config.strings.random)}</a
75
+ >
76
+ <a part="next link widget" rel="next" href=${getNext(config)?.url ?? ""}
77
+ >${r(config.strings.next)}</a
78
+ >
79
+ `;
80
+ }
81
+ })}
82
+ `;
83
+ }
84
+ };
85
+ __decorate([property({ attribute: "config-url" })], FairyRingElement.prototype, "configUrl", void 0);
86
+ function define(tagName = "fairy-ring") {
87
+ if (customElements.get(tagName)) return;
88
+ customElements.define(tagName, FairyRingElement);
89
+ }
90
+ export { define as n, FairyRingElement as t };
package/dist/element.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { LitElement } from "lit";
2
2
  export declare class FairyRingElement extends LitElement {
3
3
  #private;
4
- static styles: import("lit").CSSResult;
5
4
  configUrl?: string;
5
+ static styles: import("lit").CSSResult;
6
6
  render(): import("lit").TemplateResult<1>;
7
7
  }
8
8
  export declare function define(tagName?: string): void;
package/dist/element.js CHANGED
@@ -1 +1 @@
1
- export { t as FairyRingElement, n as define } from "./element-GEcIko-6.js";
1
+ export { t as FairyRingElement, n as define } from "./element-CvyhlWFr.js";
@@ -1,14 +1,15 @@
1
- import { Task } from "@lit/task";
2
- import { LitElement, css, html } from "lit";
3
- import { property } from "lit/decorators.js";
4
1
  import * as z from "zod/v4-mini";
5
2
  import { parse } from "smol-toml";
3
+ import { html, nothing } from "lit";
4
+ import { isTemplateResult } from "lit/directive-helpers.js";
6
5
  // src/strings.ts
7
- /** maps BCP 47 language tag (e.g. "en", "en-US") -> translation. */
8
- const locStringSchema = z.record(z.string(), z.string());
6
+ const locStringSchema = z.record(z.string().check(z.meta({ title: "language" })), z.string().check(z.describe("translation for a BCP 47 language tag, e.g. \"en\", \"en-US\""))).check(z.meta({
7
+ id: "LocString",
8
+ description: "maps language tag -> translation"
9
+ }));
9
10
  /** pick the most specific translation for the user's preferred locales. i.e. `en-US`, then `en`. default to first locale in object. */
10
- function localize(string, locales = navigator.languages) {
11
- for (const tag of locales) {
11
+ function localize(string) {
12
+ for (const tag of navigator.languages) {
12
13
  const parts = tag.split("-");
13
14
  for (let i = parts.length; i > 0; i--) {
14
15
  const hit = string[parts.slice(0, i).join("-")];
@@ -136,36 +137,37 @@ const defaultErrorString = {
136
137
  function impossible(x) {
137
138
  throw new Error(`reached impossible variant: ${x}`);
138
139
  }
140
+ // src/template.ts
141
+ function renderTemplate(template, values) {
142
+ const parts = localize(template).split(/\{\{\s*(\w+)\s*\}\}/).map((s, i) => {
143
+ if (i % 2 === 1) {
144
+ const value = Object.hasOwn(values, s) ? values[s] : void 0;
145
+ if (isTemplateResult(value)) return value;
146
+ if (typeof value === "object") return localize(value);
147
+ if (value !== void 0) return value;
148
+ console.error("[fairy-ring] unknown template key:", s);
149
+ return nothing;
150
+ } else return s;
151
+ });
152
+ return html`${parts}`;
153
+ }
139
154
  // src/lib.ts
155
+ const linkUrlSchema = z.url({ protocol: /^https?$/ });
140
156
  const siteSchema = z.object({
141
- /** where to link to */
142
- url: z.url(),
143
- /** what part of this link does the site own? */
144
- scope: z.enum(["host", "path"])
145
- });
157
+ url: linkUrlSchema.check(z.describe("where to link to")),
158
+ scope: z.enum(["host", "path"]).check(z.describe("what part of this link does the site own? \"host\": all of my.example.com. \"path\": just sub-paths of my.example.com/path, not my.example.com/other"))
159
+ }).check(z.meta({ id: "Site" }));
146
160
  const configSchema = z.object({
147
- /** config schema version */
148
- version: z.enum(["0.0"]),
149
- /** name of this webring */
150
- name: locStringSchema,
151
- /** list sites in the webring */
152
- sites: z.array(siteSchema),
153
- options: z.prefault(z.object({
154
- /** a homepage for the webring, if one exists */
155
- homeUrl: z.optional(z.url()),
156
- /** enable the "random" button */
157
- showRandom: z._default(z.boolean(), true),
158
- /** suggested stylesheet; loaded unless disabled by site developer */
159
- cssHref: z.optional(z.url())
160
- }), {}),
161
+ configVersion: z.union([z.literal(1)]).check(z.describe("config schema version")),
162
+ name: z.nonoptional(locStringSchema).check(z.describe("name of this webring. include in a string with {{name}}.")),
163
+ homeText: z._default(locStringSchema, { und: "{{name}}" }).check(z.describe("text that links to the homepage. defaults to \"{{name}}\".")),
164
+ homeUrl: z.optional(linkUrlSchema).check(z.describe("a homepage for the webring, if one exists")),
165
+ sites: z.array(siteSchema).check(z.describe("list sites in the webring")),
161
166
  strings: z.prefault(z.object({
162
- /** link to the next site */
163
- next: z._default(locStringSchema, defaultNextString),
164
- /** link to the previous site */
165
- previous: z._default(locStringSchema, defaultPrevString),
166
- /** link to a random site */
167
- random: z._default(locStringSchema, defaultRandomString)
168
- }), {})
167
+ next: z._default(locStringSchema, defaultNextString).check(z.describe("link to the next site")),
168
+ previous: z._default(locStringSchema, defaultPrevString).check(z.describe("link to the previous site")),
169
+ random: z._default(locStringSchema, defaultRandomString).check(z.describe("link to a random site"))
170
+ }).check(z.meta({ id: "Strings" })), {}).check(z.describe("overrides for built-in translations"))
169
171
  });
170
172
  async function fetchConfig({ url, init }) {
171
173
  const result = await fetch(url, init);
@@ -218,55 +220,4 @@ function getRandom(config) {
218
220
  for (let i = 0; site === cur && i < 10; ++i) site = Math.floor(Math.random() * config.sites.length);
219
221
  return config.sites[site];
220
222
  }
221
- // \0@oxc-project+runtime@0.159.0/helpers/esm/decorate.js
222
- function __decorate(decorators, target, key, desc) {
223
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
224
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
225
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
226
- return c > 3 && r && Object.defineProperty(target, key, r), r;
227
- }
228
- // src/element.ts
229
- var FairyRingElement = class extends LitElement {
230
- static {
231
- this.styles = css`
232
- :host {
233
- display: flex;
234
- flex-direction: row;
235
- gap: 1em;
236
- }
237
- `;
238
- }
239
- #config = new Task(this, {
240
- args: () => [this.configUrl],
241
- task: async ([url], { signal }) => {
242
- if (!url) throw new Error("missing config-url");
243
- return logConfigErrors(fetchConfig({
244
- url,
245
- init: { signal }
246
- }));
247
- }
248
- });
249
- render() {
250
- return html`
251
- ${this.#config.render({
252
- pending: () => html`<div class="loading">${localize(defaultLoadingString)}</div>`,
253
- error: () => html`<div class="error">${localize(defaultErrorString)}</div>`,
254
- complete: (config) => html`
255
- <a class="prev" href=${getPrev(config)?.url ?? ""}
256
- >${localize(config.strings.previous)}</a
257
- >
258
- ${config.options.homeUrl ? html`<a class="home" href=${config.options.homeUrl}>${config.name}</a>` : html`<div>${localize(config.name)}</div>`}
259
- <a class="random" href=${getRandom(config)?.url ?? ""}
260
- >${localize(config.strings.random)}</a
261
- >
262
- <a class="next" href=${getNext(config)?.url ?? ""}>${localize(config.strings.next)}</a>
263
- `
264
- })}
265
- `;
266
- }
267
- };
268
- __decorate([property({ attribute: "config-url" })], FairyRingElement.prototype, "configUrl", void 0);
269
- function define(tagName = "fairy-ring") {
270
- if (!customElements.get(tagName)) customElements.define(tagName, FairyRingElement);
271
- }
272
- export { define as n, FairyRingElement as t };
223
+ export { getPrev as a, siteSchema as c, defaultLoadingString as d, localize as f, getNext as i, renderTemplate as l, fetchConfig as n, getRandom as o, getCurrent as r, logConfigErrors as s, configSchema as t, defaultErrorString as u };
package/dist/lib.d.ts ADDED
@@ -0,0 +1,46 @@
1
+ import * as z from "zod/v4-mini";
2
+ import { TemplateResult, nothing } from "lit";
3
+ declare const locStringSchema: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>;
4
+ type LocString = z.infer<typeof locStringSchema>;
5
+ /** pick the most specific translation for the user's preferred locales. i.e. `en-US`, then `en`. default to first locale in object. */
6
+ export declare function localize(string: LocString): string;
7
+ export declare function renderTemplate(template: LocString, values: Record<string, string | LocString | TemplateResult | typeof nothing>): TemplateResult;
8
+ export declare const siteSchema: z.ZodMiniObject<{
9
+ url: z.ZodMiniURL;
10
+ scope: z.ZodMiniEnum<{
11
+ host: "host";
12
+ path: "path";
13
+ }>;
14
+ }, z.core.$strip>;
15
+ export type Site = z.infer<typeof siteSchema>;
16
+ export declare const configSchema: z.ZodMiniObject<{
17
+ configVersion: z.ZodMiniUnion<readonly [z.ZodMiniLiteral<1>]>;
18
+ name: z.ZodMiniNonOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>>;
19
+ homeText: z.ZodMiniDefault<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>>;
20
+ homeUrl: z.ZodMiniOptional<z.ZodMiniURL>;
21
+ sites: z.ZodMiniArray<z.ZodMiniObject<{
22
+ url: z.ZodMiniURL;
23
+ scope: z.ZodMiniEnum<{
24
+ host: "host";
25
+ path: "path";
26
+ }>;
27
+ }, z.core.$strip>>;
28
+ strings: z.ZodMiniPrefault<z.ZodMiniObject<{
29
+ next: z.ZodMiniDefault<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>>;
30
+ previous: z.ZodMiniDefault<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>>;
31
+ random: z.ZodMiniDefault<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>>;
32
+ }, z.core.$strip>>;
33
+ }, z.core.$strip>;
34
+ export type Config = z.infer<typeof configSchema>;
35
+ export type GetConfigOptions = {
36
+ url: string;
37
+ init?: RequestInit | undefined;
38
+ };
39
+ export declare function fetchConfig({ url, init }: GetConfigOptions): Promise<Config>;
40
+ export declare function logConfigErrors(promise: Promise<Config>, log?: (...data: any[]) => void): Promise<Config>;
41
+ /** match against the configured sites; if this is one of them, return [Site, index]; else, return null */
42
+ export declare function getCurrent(config: Config): [Site, number] | null;
43
+ export declare function getNext(config: Config): Site | null;
44
+ export declare function getPrev(config: Config): Site | null;
45
+ export declare function getRandom(config: Config): Site | null;
46
+ export type { LocString };
package/dist/lib.js ADDED
@@ -0,0 +1 @@
1
+ export { t as configSchema, n as fetchConfig, r as getCurrent, i as getNext, a as getPrev, o as getRandom, f as localize, s as logConfigErrors, l as renderTemplate, c as siteSchema } from "./lib-B5FPZH-w.js";
package/dist/react.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createElement } from "react";
2
- import { n as define } from "./element-GEcIko-6.js";
2
+ import { n as define } from "./element-CvyhlWFr.js";
3
3
  // src/react.ts
4
4
  function FairyRing() {
5
5
  define();
package/dist/solid.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as define } from "./element-GEcIko-6.js";
1
+ import { n as define } from "./element-CvyhlWFr.js";
2
2
  // src/solid.ts
3
3
  function FairyRing() {
4
4
  define();
@@ -9,52 +9,55 @@ const e=globalThis,t=e.ShadowRoot&&(e.ShadyCSS===void 0||e.ShadyCSS.nativeShadow
9
9
  * Copyright 2017 Google LLC
10
10
  * SPDX-License-Identifier: BSD-3-Clause
11
11
  */
12
- switch(t){case Boolean:e=e?ne:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},ie=(e,t)=>!l(e,t),ae={attribute:!0,type:String,converter:g,reflect:!1,useDefault:!1,hasChanged:ie};Symbol.metadata??=Symbol(`metadata`),m.litPropertyMetadata??=/* @__PURE__ */ new WeakMap;var _=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=ae){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&u(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=d(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){let a=r?.call(this);i?.call(this,t),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??ae}static _$Ei(){if(this.hasOwnProperty(h(`elementProperties`)))return;let e=ee(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(h(`finalized`)))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(h(`properties`))){let e=this.properties,t=[...f(e),...p(e)];for(let n of t)this.createProperty(n,e[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=/* @__PURE__ */ new Map;for(let[e,t]of this.elementProperties){let n=this._$Eu(e,t);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let e of n)t.unshift(c(e))}else e!==void 0&&t.push(c(e));return t}static _$Eu(e,t){let n=t.attribute;return!1===n?void 0:typeof n==`string`?n:typeof e==`string`?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=/* @__PURE__ */ new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=/* @__PURE__ */ new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=/* @__PURE__ */ new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return s(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&!0===n.reflect){let i=(n.converter?.toAttribute===void 0?g:n.converter).toAttribute(t,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){let n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let e=n.getPropertyOptions(r),i=typeof e.converter==`function`?{fromAttribute:e.converter}:e.converter?.fromAttribute===void 0?g:e.converter;this._$Em=r;let a=i.fromAttribute(t,e.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,t,n,r=!1,i){if(e!==void 0){let a=this.constructor;if(!1===r&&(i=this[e]),n??=a.getPropertyOptions(e),!((n.hasChanged??ie)(i,t)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:r,wrapped:i},a){n&&!(this._$Ej??=/* @__PURE__ */ new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),!0!==i||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===r&&this._$Em!==e&&(this._$Eq??=/* @__PURE__ */ new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,n]of e){let{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||r===void 0||this.C(t,void 0,n,r)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=/* @__PURE__ */ new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};_.elementStyles=[],_.shadowRootOptions={mode:`open`},_[h(`elementProperties`)]=/* @__PURE__ */ new Map,_[h(`finalized`)]=/* @__PURE__ */ new Map,re?.({ReactiveElement:_}),(m.reactiveElementVersions??=[]).push(`2.1.2`);const oe=Symbol();
12
+ switch(t){case Boolean:e=e?ne:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},_=(e,t)=>!l(e,t),ie={attribute:!0,type:String,converter:g,reflect:!1,useDefault:!1,hasChanged:_};Symbol.metadata??=Symbol(`metadata`),m.litPropertyMetadata??=/* @__PURE__ */ new WeakMap;var v=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=ie){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&u(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=d(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){let a=r?.call(this);i?.call(this,t),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??ie}static _$Ei(){if(this.hasOwnProperty(h(`elementProperties`)))return;let e=ee(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(h(`finalized`)))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(h(`properties`))){let e=this.properties,t=[...f(e),...p(e)];for(let n of t)this.createProperty(n,e[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=/* @__PURE__ */ new Map;for(let[e,t]of this.elementProperties){let n=this._$Eu(e,t);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let e of n)t.unshift(c(e))}else e!==void 0&&t.push(c(e));return t}static _$Eu(e,t){let n=t.attribute;return!1===n?void 0:typeof n==`string`?n:typeof e==`string`?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=/* @__PURE__ */ new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=/* @__PURE__ */ new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=/* @__PURE__ */ new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return s(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&!0===n.reflect){let i=(n.converter?.toAttribute===void 0?g:n.converter).toAttribute(t,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){let n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let e=n.getPropertyOptions(r),i=typeof e.converter==`function`?{fromAttribute:e.converter}:e.converter?.fromAttribute===void 0?g:e.converter;this._$Em=r;let a=i.fromAttribute(t,e.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,t,n,r=!1,i){if(e!==void 0){let a=this.constructor;if(!1===r&&(i=this[e]),n??=a.getPropertyOptions(e),!((n.hasChanged??_)(i,t)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:r,wrapped:i},a){n&&!(this._$Ej??=/* @__PURE__ */ new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),!0!==i||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===r&&this._$Em!==e&&(this._$Eq??=/* @__PURE__ */ new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,n]of e){let{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||r===void 0||this.C(t,void 0,n,r)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=/* @__PURE__ */ new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};v.elementStyles=[],v.shadowRootOptions={mode:`open`},v[h(`elementProperties`)]=/* @__PURE__ */ new Map,v[h(`finalized`)]=/* @__PURE__ */ new Map,re?.({ReactiveElement:v}),(m.reactiveElementVersions??=[]).push(`2.1.2`);const ae=Symbol();
13
13
  /**
14
14
  * @license
15
15
  * Copyright 2017 Google LLC
16
16
  * SPDX-License-Identifier: BSD-3-Clause
17
17
  */
18
- var se=class{get taskComplete(){return this.t||=this.i===1?new Promise(((e,t)=>{this.o=e,this.h=t})):this.i===3?Promise.reject(this.l):Promise.resolve(this.u),this.t}constructor(e,t,n){this.p=0,this.i=0,(this._=e).addController(this);let r=typeof t==`object`?t:{task:t,args:n};this.v=r.task,this.j=r.args,this.m=r.argsEqual??ce,this.k=r.onComplete,this.A=r.onError,this.autoRun=r.autoRun??!0,`initialValue`in r&&(this.u=r.initialValue,this.i=2,this.O=this.T?.())}hostUpdate(){!0===this.autoRun&&this.S()}hostUpdated(){this.autoRun===`afterUpdate`&&this.S()}T(){if(this.j===void 0)return;let e=this.j();if(!Array.isArray(e))throw Error(`The args function must return an array`);return e}async S(){let e=this.T(),t=this.O;this.O=e,e===t||e===void 0||t!==void 0&&this.m(t,e)||await this.run(e)}async run(e){let t,n;e??=this.T(),this.O=e,this.i===1?this.q?.abort():(this.t=void 0,this.o=void 0,this.h=void 0),this.i=1,this.autoRun===`afterUpdate`?queueMicrotask((()=>this._.requestUpdate())):this._.requestUpdate();let r=++this.p;this.q=new AbortController;let i=!1;try{t=await this.v(e,{signal:this.q.signal})}catch(e){i=!0,n=e}if(this.p===r){if(t===oe)this.i=0;else{if(!1===i){try{this.k?.(t)}catch{}this.i=2,this.o?.(t)}else{try{this.A?.(n)}catch{}this.i=3,this.h?.(n)}this.u=t,this.l=n}this._.requestUpdate()}}abort(e){this.i===1&&this.q?.abort(e)}get value(){return this.u}get error(){return this.l}get status(){return this.i}render(e){switch(this.i){case 0:return e.initial?.();case 1:return e.pending?.();case 2:return e.complete?.(this.value);case 3:return e.error?.(this.error);default:throw Error(`Unexpected status: `+this.i)}}};const ce=(e,t)=>e===t||e.length===t.length&&e.every(((e,n)=>!ie(e,t[n]))),le=globalThis,ue=e=>e,v=le.trustedTypes,de=v?v.createPolicy(`lit-html`,{createHTML:e=>e}):void 0,fe=`$lit$`,y=`lit$${Math.random().toFixed(9).slice(2)}$`,pe=`?`+y,me=`<${pe}>`,b=document,x=()=>b.createComment(``),S=e=>e===null||typeof e!=`object`&&typeof e!=`function`,he=Array.isArray,ge=e=>he(e)||typeof e?.[Symbol.iterator]==`function`,_e=`[
18
+ var oe=class{get taskComplete(){return this.t||=this.i===1?new Promise(((e,t)=>{this.o=e,this.h=t})):this.i===3?Promise.reject(this.l):Promise.resolve(this.u),this.t}constructor(e,t,n){this.p=0,this.i=0,(this._=e).addController(this);let r=typeof t==`object`?t:{task:t,args:n};this.v=r.task,this.j=r.args,this.m=r.argsEqual??se,this.k=r.onComplete,this.A=r.onError,this.autoRun=r.autoRun??!0,`initialValue`in r&&(this.u=r.initialValue,this.i=2,this.O=this.T?.())}hostUpdate(){!0===this.autoRun&&this.S()}hostUpdated(){this.autoRun===`afterUpdate`&&this.S()}T(){if(this.j===void 0)return;let e=this.j();if(!Array.isArray(e))throw Error(`The args function must return an array`);return e}async S(){let e=this.T(),t=this.O;this.O=e,e===t||e===void 0||t!==void 0&&this.m(t,e)||await this.run(e)}async run(e){let t,n;e??=this.T(),this.O=e,this.i===1?this.q?.abort():(this.t=void 0,this.o=void 0,this.h=void 0),this.i=1,this.autoRun===`afterUpdate`?queueMicrotask((()=>this._.requestUpdate())):this._.requestUpdate();let r=++this.p;this.q=new AbortController;let i=!1;try{t=await this.v(e,{signal:this.q.signal})}catch(e){i=!0,n=e}if(this.p===r){if(t===ae)this.i=0;else{if(!1===i){try{this.k?.(t)}catch{}this.i=2,this.o?.(t)}else{try{this.A?.(n)}catch{}this.i=3,this.h?.(n)}this.u=t,this.l=n}this._.requestUpdate()}}abort(e){this.i===1&&this.q?.abort(e)}get value(){return this.u}get error(){return this.l}get status(){return this.i}render(e){switch(this.i){case 0:return e.initial?.();case 1:return e.pending?.();case 2:return e.complete?.(this.value);case 3:return e.error?.(this.error);default:throw Error(`Unexpected status: `+this.i)}}};const se=(e,t)=>e===t||e.length===t.length&&e.every(((e,n)=>!_(e,t[n]))),ce=globalThis,le=e=>e,ue=ce.trustedTypes,de=ue?ue.createPolicy(`lit-html`,{createHTML:e=>e}):void 0,fe=`$lit$`,y=`lit$${Math.random().toFixed(9).slice(2)}$`,pe=`?`+y,me=`<${pe}>`,b=document,x=()=>b.createComment(``),S=e=>e===null||typeof e!=`object`&&typeof e!=`function`,he=Array.isArray,ge=e=>he(e)||typeof e?.[Symbol.iterator]==`function`,_e=`[
19
19
  \f\r]`,C=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ve=/-->/g,ye=/>/g,w=RegExp(`>|${_e}(?:([^\\s"'>=/]+)(${_e}*=${_e}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,`g`),be=/'/g,xe=/"/g,Se=/^(?:script|style|textarea|title)$/i,T=(e=>(t,...n)=>({_$litType$:e,strings:t,values:n}))(1),E=Symbol.for(`lit-noChange`),D=Symbol.for(`lit-nothing`),Ce=/* @__PURE__ */ new WeakMap,O=b.createTreeWalker(b,129)
20
20
  /**
21
21
  * @license
22
22
  * Copyright 2017 Google LLC
23
23
  * SPDX-License-Identifier: BSD-3-Clause
24
24
  */
25
- ;function we(e,t){if(!he(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return de===void 0?t:de.createHTML(t)}const Te=(e,t)=>{let n=e.length-1,r=[],i,a=t===2?`<svg>`:t===3?`<math>`:``,o=C;for(let t=0;t<n;t++){let n=e[t],s,c,l=-1,u=0;for(;u<n.length&&(o.lastIndex=u,c=o.exec(n),c!==null);)u=o.lastIndex,o===C?c[1]===`!--`?o=ve:c[1]===void 0?c[2]===void 0?c[3]!==void 0&&(o=w):(Se.test(c[2])&&(i=RegExp(`</`+c[2],`g`)),o=w):o=ye:o===w?c[0]===`>`?(o=i??C,l=-1):c[1]===void 0?l=-2:(l=o.lastIndex-c[2].length,s=c[1],o=c[3]===void 0?w:c[3]===`"`?xe:be):o===xe||o===be?o=w:o===ve||o===ye?o=C:(o=w,i=void 0);let d=o===w&&e[t+1].startsWith(`/>`)?` `:``;a+=o===C?n+me:l>=0?(r.push(s),n.slice(0,l)+fe+n.slice(l)+y+d):n+y+(l===-2?t:d)}return[we(e,a+(e[n]||`<?>`)+(t===2?`</svg>`:t===3?`</math>`:``)),r]};var Ee=class e{constructor({strings:t,_$litType$:n},r){let i;this.parts=[];let a=0,o=0,s=t.length-1,c=this.parts,[l,u]=Te(t,n);if(this.el=e.createElement(l,r),O.currentNode=this.el.content,n===2||n===3){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(i=O.nextNode())!==null&&c.length<s;){if(i.nodeType===1){if(i.hasAttributes())for(let e of i.getAttributeNames())if(e.endsWith(fe)){let t=u[o++],n=i.getAttribute(e).split(y),r=/([.?@])?(.*)/.exec(t);c.push({type:1,index:a,name:r[2],strings:n,ctor:r[1]===`.`?Ae:r[1]===`?`?je:r[1]===`@`?Me:ke}),i.removeAttribute(e)}else e.startsWith(y)&&(c.push({type:6,index:a}),i.removeAttribute(e));if(Se.test(i.tagName)){let e=i.textContent.split(y),t=e.length-1;if(t>0){i.textContent=v?v.emptyScript:``;for(let n=0;n<t;n++)i.append(e[n],x()),O.nextNode(),c.push({type:2,index:++a});i.append(e[t],x())}}}else if(i.nodeType===8){if(i.data===pe)c.push({type:2,index:a});else{let e=-1;for(;(e=i.data.indexOf(y,e+1))!==-1;)c.push({type:7,index:a}),e+=y.length-1}}a++}}static createElement(e,t){let n=b.createElement(`template`);return n.innerHTML=e,n}};function k(e,t,n=e,r){if(t===E)return t;let i=r===void 0?n._$Cl:n._$Co?.[r],a=S(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(e),i._$AT(e,n,r)),r===void 0?n._$Cl=i:(n._$Co??=[])[r]=i),i!==void 0&&(t=k(e,i._$AS(e,t.values),i,r)),t}var De=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??b).importNode(t,!0);O.currentNode=r;let i=O.nextNode(),a=0,o=0,s=n[0];for(;s!==void 0;){if(a===s.index){let t;s.type===2?t=new Oe(i,i.nextSibling,this,e):s.type===1?t=new s.ctor(i,s.name,s.strings,this,e):s.type===6&&(t=new Ne(i,this,e)),this._$AV.push(t),s=n[++o]}a!==s?.index&&(i=O.nextNode(),a++)}return O.currentNode=b,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings===void 0?n._$AI(e[t]):(n._$AI(e,n,t),t+=n.strings.length-2)),t++}},Oe=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=D,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=k(this,e,t),S(e)?e===D||e==null||e===``?(this._$AH!==D&&this._$AR(),this._$AH=D):e!==this._$AH&&e!==E&&this._(e):e._$litType$===void 0?e.nodeType===void 0?ge(e)?this.k(e):this._(e):this.T(e):this.$(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==D&&S(this._$AH)?this._$AA.nextSibling.data=e:this.T(b.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n==`number`?this._$AC(e):(n.el===void 0&&(n.el=Ee.createElement(we(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new De(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=Ce.get(e.strings);return t===void 0&&Ce.set(e.strings,t=new Ee(e)),t}k(t){he(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let a of t)i===n.length?n.push(r=new e(this.O(x()),this.O(x()),this,this.options)):r=n[i],r._$AI(a),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=ue(e).nextSibling;ue(e).remove(),e=t}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},ke=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=D,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,n.length>2||n[0]!==``||n[1]!==``?(this._$AH=Array(n.length-1).fill(/* @__PURE__ */ new String),this.strings=n):this._$AH=D}_$AI(e,t=this,n,r){let i=this.strings,a=!1;if(i===void 0)e=k(this,e,t,0),a=!S(e)||e!==this._$AH&&e!==E,a&&(this._$AH=e);else{let r=e,o,s;for(e=i[0],o=0;o<i.length-1;o++)s=k(this,r[n+o],t,o),s===E&&(s=this._$AH[o]),a||=!S(s)||s!==this._$AH[o],s===D?e=D:e!==D&&(e+=(s??``)+i[o+1]),this._$AH[o]=s}a&&!r&&this.j(e)}j(e){e===D?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??``)}},Ae=class extends ke{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===D?void 0:e}},je=class extends ke{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==D)}},Me=class extends ke{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=k(this,e,t,0)??D)===E)return;let n=this._$AH,r=e===D&&n!==D||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==D&&(n===D||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH==`function`?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Ne=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){k(this,e)}};(0,le.litHtmlPolyfillSupport)?.(Ee,Oe),(le.litHtmlVersions??=[]).push(`3.3.3`);const Pe=(e,t,n)=>{let r=n?.renderBefore??t,i=r._$litPart$;if(i===void 0){let e=n?.renderBefore??null;r._$litPart$=i=new Oe(t.insertBefore(x(),e),e,void 0,n??{})}return i._$AI(e),i},Fe=globalThis
25
+ ;function we(e,t){if(!he(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return de===void 0?t:de.createHTML(t)}const Te=(e,t)=>{let n=e.length-1,r=[],i,a=t===2?`<svg>`:t===3?`<math>`:``,o=C;for(let t=0;t<n;t++){let n=e[t],s,c,l=-1,u=0;for(;u<n.length&&(o.lastIndex=u,c=o.exec(n),c!==null);)u=o.lastIndex,o===C?c[1]===`!--`?o=ve:c[1]===void 0?c[2]===void 0?c[3]!==void 0&&(o=w):(Se.test(c[2])&&(i=RegExp(`</`+c[2],`g`)),o=w):o=ye:o===w?c[0]===`>`?(o=i??C,l=-1):c[1]===void 0?l=-2:(l=o.lastIndex-c[2].length,s=c[1],o=c[3]===void 0?w:c[3]===`"`?xe:be):o===xe||o===be?o=w:o===ve||o===ye?o=C:(o=w,i=void 0);let d=o===w&&e[t+1].startsWith(`/>`)?` `:``;a+=o===C?n+me:l>=0?(r.push(s),n.slice(0,l)+fe+n.slice(l)+y+d):n+y+(l===-2?t:d)}return[we(e,a+(e[n]||`<?>`)+(t===2?`</svg>`:t===3?`</math>`:``)),r]};var Ee=class e{constructor({strings:t,_$litType$:n},r){let i;this.parts=[];let a=0,o=0,s=t.length-1,c=this.parts,[l,u]=Te(t,n);if(this.el=e.createElement(l,r),O.currentNode=this.el.content,n===2||n===3){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(i=O.nextNode())!==null&&c.length<s;){if(i.nodeType===1){if(i.hasAttributes())for(let e of i.getAttributeNames())if(e.endsWith(fe)){let t=u[o++],n=i.getAttribute(e).split(y),r=/([.?@])?(.*)/.exec(t);c.push({type:1,index:a,name:r[2],strings:n,ctor:r[1]===`.`?Oe:r[1]===`?`?ke:r[1]===`@`?Ae:j}),i.removeAttribute(e)}else e.startsWith(y)&&(c.push({type:6,index:a}),i.removeAttribute(e));if(Se.test(i.tagName)){let e=i.textContent.split(y),t=e.length-1;if(t>0){i.textContent=ue?ue.emptyScript:``;for(let n=0;n<t;n++)i.append(e[n],x()),O.nextNode(),c.push({type:2,index:++a});i.append(e[t],x())}}}else if(i.nodeType===8){if(i.data===pe)c.push({type:2,index:a});else{let e=-1;for(;(e=i.data.indexOf(y,e+1))!==-1;)c.push({type:7,index:a}),e+=y.length-1}}a++}}static createElement(e,t){let n=b.createElement(`template`);return n.innerHTML=e,n}};function k(e,t,n=e,r){if(t===E)return t;let i=r===void 0?n._$Cl:n._$Co?.[r],a=S(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(e),i._$AT(e,n,r)),r===void 0?n._$Cl=i:(n._$Co??=[])[r]=i),i!==void 0&&(t=k(e,i._$AS(e,t.values),i,r)),t}var De=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??b).importNode(t,!0);O.currentNode=r;let i=O.nextNode(),a=0,o=0,s=n[0];for(;s!==void 0;){if(a===s.index){let t;s.type===2?t=new A(i,i.nextSibling,this,e):s.type===1?t=new s.ctor(i,s.name,s.strings,this,e):s.type===6&&(t=new je(i,this,e)),this._$AV.push(t),s=n[++o]}a!==s?.index&&(i=O.nextNode(),a++)}return O.currentNode=b,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings===void 0?n._$AI(e[t]):(n._$AI(e,n,t),t+=n.strings.length-2)),t++}},A=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=D,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=k(this,e,t),S(e)?e===D||e==null||e===``?(this._$AH!==D&&this._$AR(),this._$AH=D):e!==this._$AH&&e!==E&&this._(e):e._$litType$===void 0?e.nodeType===void 0?ge(e)?this.k(e):this._(e):this.T(e):this.$(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==D&&S(this._$AH)?this._$AA.nextSibling.data=e:this.T(b.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n==`number`?this._$AC(e):(n.el===void 0&&(n.el=Ee.createElement(we(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new De(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=Ce.get(e.strings);return t===void 0&&Ce.set(e.strings,t=new Ee(e)),t}k(t){he(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let a of t)i===n.length?n.push(r=new e(this.O(x()),this.O(x()),this,this.options)):r=n[i],r._$AI(a),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=le(e).nextSibling;le(e).remove(),e=t}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},j=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=D,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,n.length>2||n[0]!==``||n[1]!==``?(this._$AH=Array(n.length-1).fill(/* @__PURE__ */ new String),this.strings=n):this._$AH=D}_$AI(e,t=this,n,r){let i=this.strings,a=!1;if(i===void 0)e=k(this,e,t,0),a=!S(e)||e!==this._$AH&&e!==E,a&&(this._$AH=e);else{let r=e,o,s;for(e=i[0],o=0;o<i.length-1;o++)s=k(this,r[n+o],t,o),s===E&&(s=this._$AH[o]),a||=!S(s)||s!==this._$AH[o],s===D?e=D:e!==D&&(e+=(s??``)+i[o+1]),this._$AH[o]=s}a&&!r&&this.j(e)}j(e){e===D?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??``)}},Oe=class extends j{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===D?void 0:e}},ke=class extends j{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==D)}},Ae=class extends j{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=k(this,e,t,0)??D)===E)return;let n=this._$AH,r=e===D&&n!==D||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==D&&(n===D||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH==`function`?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},je=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){k(this,e)}};const Me={M:fe,P:y,A:pe,C:1,L:Te,R:De,D:ge,V:k,I:A,H:j,N:ke,U:Ae,B:Oe,F:je};(0,ce.litHtmlPolyfillSupport)?.(Ee,A),(ce.litHtmlVersions??=[]).push(`3.3.3`);const Ne=(e,t,n)=>{let r=n?.renderBefore??t,i=r._$litPart$;if(i===void 0){let e=n?.renderBefore??null;r._$litPart$=i=new A(t.insertBefore(x(),e),e,void 0,n??{})}return i._$AI(e),i},Pe=globalThis
26
26
  /**
27
27
  * @license
28
28
  * Copyright 2017 Google LLC
29
29
  * SPDX-License-Identifier: BSD-3-Clause
30
30
  */
31
- ;var A=class extends _{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Pe(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return E}};A._$litElement$=!0,A.finalized=!0,Fe.litElementHydrateSupport?.({LitElement:A}),(0,Fe.litElementPolyfillSupport)?.({LitElement:A}),(Fe.litElementVersions??=[]).push(`4.2.2`);
31
+ ;var M=class extends v{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Ne(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return E}};M._$litElement$=!0,M.finalized=!0,Pe.litElementHydrateSupport?.({LitElement:M}),(0,Pe.litElementPolyfillSupport)?.({LitElement:M}),(Pe.litElementVersions??=[]).push(`4.2.2`);
32
32
  /**
33
33
  * @license
34
34
  * Copyright 2017 Google LLC
35
35
  * SPDX-License-Identifier: BSD-3-Clause
36
- */const Ie={attribute:!0,type:String,converter:g,reflect:!1,hasChanged:ie},Le=(e=Ie,t,n)=>{let{kind:r,metadata:i}=n,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=/* @__PURE__ */ new Map),r===`setter`&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),r===`accessor`){let{name:r}=n;return{set(n){let i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e,!0,n)},init(t){return t!==void 0&&this.C(r,void 0,e,t),t}}}if(r===`setter`){let{name:r}=n;return function(n){let i=this[r];t.call(this,n),this.requestUpdate(r,i,e,!0,n)}}throw Error(`Unsupported decorator location: `+r)};function Re(e){return(t,n)=>typeof n==`object`?Le(e,t,n):((e,t,n)=>{let r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}
36
+ */const Fe={attribute:!0,type:String,converter:g,reflect:!1,hasChanged:_},Ie=(e=Fe,t,n)=>{let{kind:r,metadata:i}=n,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=/* @__PURE__ */ new Map),r===`setter`&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),r===`accessor`){let{name:r}=n;return{set(n){let i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e,!0,n)},init(t){return t!==void 0&&this.C(r,void 0,e,t),t}}}if(r===`setter`){let{name:r}=n;return function(n){let i=this[r];t.call(this,n),this.requestUpdate(r,i,e,!0,n)}}throw Error(`Unsupported decorator location: `+r)};function Le(e){return(t,n)=>typeof n==`object`?Ie(e,t,n):((e,t,n)=>{let r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}
37
37
  /**
38
38
  * @license
39
39
  * Copyright 2017 Google LLC
40
40
  * SPDX-License-Identifier: BSD-3-Clause
41
41
  */
42
- function ze(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function Be(e,t){return typeof t==`bigint`?t.toString():t}var Ve=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function He(e){return new Ve(e)}function Ue(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function We(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}const Ge=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Ke(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function qe(e){if(Ke(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return Ke(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function Je(e){return qe(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const Ye=/* @__PURE__*/ new Set([`string`,`number`,`symbol`]);function Xe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Ze(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function j(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Qe(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}function M(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function $e(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function N(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function P(e){return typeof e==`string`?e:e?.message}function et(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function tt(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function F(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:P(e.inst?._zod.def?.error?.(e))??P(a?.(e))??P(t?.error?.(e))??P(n.customError?.(e))??P(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}function nt(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):it(e,n,r.value)}}function I(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function rt(e,t,n){return I(e,t,n,!1)}function it(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:I(this,t,n.bind(this))},set(e){I(this,t,e)}})}function at(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}let ot,L=!1;const st={configurable:!0,get(){L=!0}};function R(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&ot!==e._zod?ot=void 0:(ot=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,st);let e=L;L=!1;try{let r=n(this);return L?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),L||=e,r}catch(n){throw delete this[t],L||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function ct(e,t,n,r){let i=at(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var lt;const ut={value:void 0,enumerable:!1};let dt=`captureStackTrace`in Error?Error:null;function ft(e){let t=dt;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return dt=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}/* @__NO_SIDE_EFFECTS__ */
43
- function z(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=/* @__PURE__ */ new Set}a.prototype=i;let o=n,s=o&&/* @__PURE__ */ new WeakSet;function c(n,r){if(!n._zod){ut.value=new a(r);try{Object.defineProperty(n,"_zod",ut)}finally{ut.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),nt(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?ft(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var B=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}};(lt=globalThis).__zod_globalConfig??(lt.__zod_globalConfig={});const V=globalThis.__zod_globalConfig;function H(e){return e&&Object.assign(V,e),V}function pt(){let e=this._zod;return e.message??=JSON.stringify(e.def,Be,2),e.message}function mt(e){this._zod.message=e}const ht={get:pt,set:mt,enumerable:!0,configurable:!0},gt={value:void 0,enumerable:!1},_t=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]),vt=(e,t)=>{e.name=`$ZodError`,gt.value=t,Object.defineProperty(e,"issues",gt),gt.value=void 0,Object.defineProperty(e,"message",ht);let n=Object.getPrototypeOf(e);_t.has(n)||(_t.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},yt=/* @__PURE__ */ z(`$ZodError`,vt),U=/* @__PURE__ */ z(`$ZodError`,vt,void 0,{Parent:Error});function bt(e){let t=[],n=e.map(e=>typeof e==`object`?e.key:e);for(let e of n)typeof e==`number`?t.push(`[${e}]`):typeof e==`symbol`?t.push(`[${JSON.stringify(String(e))}]`):/[^\w$]/.test(e)?t.push(`[${JSON.stringify(e)}]`):(t.length&&t.push(`.`),t.push(e));return t.join(``)}function xt(e){let t=[],n=[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length);for(let e of n)t.push(`✖ ${e.message}`),e.path?.length&&t.push(` → at ${bt(e.path)}`);return t.join(`
44
- `)}const St=/* @__PURE__*/ (e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new B;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>F(e,o,H())));throw Ge(n,a?.callee??t),n}return s.value};return t})(U),Ct=/* @__PURE__*/ (e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>F(e,o,H())));throw Ge(n,a?.callee??t),n}return s.value};return t})(U),wt=/* @__PURE__*/ (e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new B;return a.issues.length?Tt(e,a.issues,i):{success:!0,data:a.value}})(U);function Tt(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>F(e,n,H()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}const Et=/* @__PURE__*/ (e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?Tt(e,a.issues,i):{success:!0,data:a.value}})(U),Dt=/^https?$/,Ot=/^[\s\S]{0,}$/,kt=/^-?\d+(?:\.\d+)?$/,At=/^(?:true|false)$/i,jt=/*@__PURE__*/ z(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Mt=/*@__PURE__*/ z(`$ZodCheckStringFormat`,(e,t)=>{var n,r;jt.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Nt={major:4,minor:6,patch:7},W=/*@__PURE__*/ z(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Nt;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=M(t),a;for(let o of n){if(o._zod.def.when){if($e(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new B;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(tt(t.issues,n,e),i||=M(t,n))});else{if(t.issues.length===n)continue;tt(t.issues,n,e),i||=M(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(M(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new B;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new B;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return rt(this,`~standard`,It(this))},set"~standard"(e){I(this,`~standard`,e)}}),Pt=(e,t)=>e.issues.length?{issues:e.issues.map(e=>F(e,t,H()))}:{value:e.value};async function Ft(e,t){let n={async:!0};return Pt(await e._zod.run({value:t,issues:[]},n),n)}function It(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return Pt(r,n)}catch{}return Ft(e,t)},vendor:`zod`,version:1}}const Lt=/*@__PURE__*/ z(`$ZodString`,(e,t)=>{W.init(e,t),e._zod.pattern=t.pattern??Ot,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),Rt=/*@__PURE__*/ z(`$ZodStringFormat`,(e,t)=>{Mt.init(e,t),Lt.init(e,t)});function zt(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function Bt(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?zt(e)||2:Vt(e,t)}function Vt(e,t){if(!t.normalize&&t.protocol?.source===Dt.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}const Ht=/[\t\n\r]/g;function Ut(e){return e.replace(Ht,``)}function Wt(e,t){return t.lastIndex=0,t.test(e.hostname)}function Gt(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}const Kt=/*@__PURE__*/ z(`$ZodURL`,(e,t)=>{Rt.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=Bt(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=Ut(r);return}t.hostname&&!Wt(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!Gt(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:Ut(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),qt=/*@__PURE__*/ z(`$ZodBoolean`,(e,t)=>{W.init(e,t),e._zod.pattern=At,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}});function Jt(e,t){let n=et(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of et(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,tt(n.issues,t,e),n}}return i(n,a)}}const Yt=e=>Array.isArray(e)?e.length:-1;function Xt(e,t,n){e.issues.length&&t.issues.push(...N(n,e.issues)),t.value[n]=e.value}const Zt=/*@__PURE__*/ z(`$ZodArray`,(e,t)=>{W.init(e,t);let n=V.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>Xt(t,r,e)));else if(Xt(c,r,e),s&&c.issues.length!==0&&M(c))break}return o.length?Promise.all(o).then(()=>r):r},Jt(e,Yt)});function G(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...N(n,e.issues))}!o&&i===void 0?e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]}):e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}const Qt=[];function $t(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:Qt,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=Qe(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function en(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(M(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>G(e,n,i,t,d,f))):G(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}const tn=/*@__PURE__*/ z(`$ZodObject`,(e,t)=>{W.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=He(()=>$t(t));R(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||We(n,e,/* @__PURE__ */ new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=Ke,o=t.catchall,s,c=V.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(M(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>G(n,t,e,r,a,o))):G(s,t,e,r,a,o)}return o?en(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),nn=/*@__PURE__*/ z(`$ZodRecord`,(e,t)=>{W.init(e,t);let n=V.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!qe(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=/* @__PURE__ */ new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>F(e,i,H())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...N(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...N(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&kt.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>F(e,i,H())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...N(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...N(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),rn=/*@__PURE__*/ z(`$ZodEnum`,(e,t)=>{W.init(e,t);let n=ze(t.entries),r=new Set(n);e._zod.values=r,R(e,`pattern`,e=>{let t=ze(e.def.entries).filter(e=>Ye.has(typeof e));return RegExp(t.length?`^(${t.map(e=>Xe(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}});function an(e,t){return e.value=t.issues.length?void 0:t.value,e}const on=/*@__PURE__*/ z(`$ZodOptional`,(e,t)=>{W.init(e,t),R(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,R(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?/* @__PURE__ */ new Set([...t,void 0]):void 0}),R(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Ue(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>an(e,t)):an(e,r)}return t.innerType._zod.run(e,n)}}),sn=/*@__PURE__*/ z(`$ZodDefault`,(e,t)=>{W.init(e,t),e._zod.optin=`defaulted`,R(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>cn(e,t)):cn(r,t)}});function cn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const ln=/*@__PURE__*/ z(`$ZodPrefault`,(e,t)=>{W.init(e,t),e._zod.optin=`defaulted`,R(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))});function un(e){return e.checks&&=[...e.checks],e}// @__NO_SIDE_EFFECTS__
45
- function dn(e,t){return new e(un({type:`string`,...j(t)}))}// @__NO_SIDE_EFFECTS__
46
- function fn(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...j(t)})}// @__NO_SIDE_EFFECTS__
47
- function pn(e,t){return new e({type:`boolean`,...j(t)})}const K=/*@__PURE__*/ z(`ZodMiniType`,(e,t)=>{if(!e._zod)throw Error(`Uninitialized schema in ZodMiniType.`);W.init(e,t),e.def=t,e.type=t.type},{get with(){return this.check},set with(e){I(this,`with`,e)},parse(e,t){return St(this,e,t,{callee:this.parse})},parseAsync(e,t){return Ct(this,e,t,{callee:this.parseAsync})},safeParse(e,t){return wt(this,e,t)},safeParseAsync(e,t){return Et(this,e,t)},check(...e){let t=this.def;return this.clone({...t,checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]},{parent:!0})},clone(e,t){return Ze(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},apply(e,...t){return t.length===0?e(this):e(this,...t)}}),mn=/*@__PURE__*/ z(`ZodMiniString`,(e,t)=>{Lt.init(e,t),K.init(e,t)});// @__NO_SIDE_EFFECTS__
48
- function hn(e){return/* @__PURE__ */ dn(mn,e)}const gn=/*@__PURE__*/ z(`ZodMiniStringFormat`,(e,t)=>{Rt.init(e,t),mn.init(e,t)}),_n=/*@__PURE__*/ z(`ZodMiniURL`,(e,t)=>{Kt.init(e,t),gn.init(e,t)});// @__NO_SIDE_EFFECTS__
49
- function vn(e){return/* @__PURE__ */ fn(_n,e)}const yn=/*@__PURE__*/ z(`ZodMiniBoolean`,(e,t)=>{qt.init(e,t),K.init(e,t)});// @__NO_SIDE_EFFECTS__
50
- function bn(e){return/* @__PURE__ */ pn(yn,e)}const xn=/*@__PURE__*/ z(`ZodMiniArray`,(e,t)=>{Zt.init(e,t),K.init(e,t)});// @__NO_SIDE_EFFECTS__
51
- function Sn(e,t){return new xn({type:`array`,element:e,...j(t)})}const Cn=/*@__PURE__*/ z(`ZodMiniObject`,(e,t)=>{tn.init(e,t),K.init(e,t),ct(e,`shape`,e=>e._zod.def.shape,!1)});// @__NO_SIDE_EFFECTS__
52
- function q(e,t){let n={type:`object`,shape:e??{},...j(t)};return new Cn(n)}const wn=/*@__PURE__*/ z(`ZodMiniRecord`,(e,t)=>{nn.init(e,t),K.init(e,t)});// @__NO_SIDE_EFFECTS__
53
- function Tn(e,t,n){return!t||!t._zod?new wn({type:`record`,keyType:/* @__PURE__ */ hn(),valueType:e,...j(t)}):new wn({type:`record`,keyType:e,valueType:t,...j(n)})}const En=/*@__PURE__*/ z(`ZodMiniEnum`,(e,t)=>{rn.init(e,t),K.init(e,t),e.options=[...e._zod.values]});// @__NO_SIDE_EFFECTS__
54
- function Dn(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new En({type:`enum`,entries:n,...j(t)})}const On=/*@__PURE__*/ z(`ZodMiniOptional`,(e,t)=>{on.init(e,t),K.init(e,t)});// @__NO_SIDE_EFFECTS__
55
- function kn(e){return new On({type:`optional`,innerType:e})}const An=/*@__PURE__*/ z(`ZodMiniDefault`,(e,t)=>{sn.init(e,t),K.init(e,t)});// @__NO_SIDE_EFFECTS__
56
- function J(e,t){return new An({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Je(t)}})}const jn=/*@__PURE__*/ z(`ZodMiniPrefault`,(e,t)=>{ln.init(e,t),K.init(e,t)});// @__NO_SIDE_EFFECTS__
57
- function Mn(e,t){return new jn({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Je(t)}})}
42
+ function Re(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function ze(e,t){return typeof t==`bigint`?t.toString():t}var Be=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function Ve(e){return new Be(e)}function He(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Ue(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}const We=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Ge(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ke(e){if(Ge(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return Ge(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function qe(e){return Ke(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const Je=/* @__PURE__*/ new Set([`string`,`number`,`symbol`]);function Ye(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Xe(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function N(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Ze(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}function P(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Qe(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function F(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function I(e){return typeof e==`string`?e:e?.message}function $e(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function et(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function L(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:I(e.inst?._zod.def?.error?.(e))??I(a?.(e))??I(t?.error?.(e))??I(n.customError?.(e))??I(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}function tt(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):rt(e,n,r.value)}}function R(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function nt(e,t,n){return R(e,t,n,!1)}function rt(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:R(this,t,n.bind(this))},set(e){R(this,t,e)}})}function it(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}let at,z=!1;const ot={configurable:!0,get(){z=!0}};function B(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&at!==e._zod?at=void 0:(at=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,ot);let e=z;z=!1;try{let r=n(this);return z?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),z||=e,r}catch(n){throw delete this[t],z||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function st(e,t,n,r){let i=it(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var ct;const lt={value:void 0,enumerable:!1};let ut=`captureStackTrace`in Error?Error:null;function dt(e){let t=ut;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return ut=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}/* @__NO_SIDE_EFFECTS__ */
43
+ function V(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=/* @__PURE__ */ new Set}a.prototype=i;let o=n,s=o&&/* @__PURE__ */ new WeakSet;function c(n,r){if(!n._zod){lt.value=new a(r);try{Object.defineProperty(n,"_zod",lt)}finally{lt.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),tt(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?dt(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var H=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}};(ct=globalThis).__zod_globalConfig??(ct.__zod_globalConfig={});const U=globalThis.__zod_globalConfig;function W(e){return e&&Object.assign(U,e),U}function ft(){let e=this._zod;return e.message??=JSON.stringify(e.def,ze,2),e.message}function pt(e){this._zod.message=e}const mt={get:ft,set:pt,enumerable:!0,configurable:!0},ht={value:void 0,enumerable:!1},gt=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]),_t=(e,t)=>{e.name=`$ZodError`,ht.value=t,Object.defineProperty(e,"issues",ht),ht.value=void 0,Object.defineProperty(e,"message",mt);let n=Object.getPrototypeOf(e);gt.has(n)||(gt.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},vt=/* @__PURE__ */ V(`$ZodError`,_t),G=/* @__PURE__ */ V(`$ZodError`,_t,void 0,{Parent:Error});function yt(e){let t=[],n=e.map(e=>typeof e==`object`?e.key:e);for(let e of n)typeof e==`number`?t.push(`[${e}]`):typeof e==`symbol`?t.push(`[${JSON.stringify(String(e))}]`):/[^\w$]/.test(e)?t.push(`[${JSON.stringify(e)}]`):(t.length&&t.push(`.`),t.push(e));return t.join(``)}function bt(e){let t=[],n=[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length);for(let e of n)t.push(`✖ ${e.message}`),e.path?.length&&t.push(` → at ${yt(e.path)}`);return t.join(`
44
+ `)}const xt=/* @__PURE__*/ (e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new H;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>L(e,o,W())));throw We(n,a?.callee??t),n}return s.value};return t})(G),St=/* @__PURE__*/ (e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>L(e,o,W())));throw We(n,a?.callee??t),n}return s.value};return t})(G),Ct=/* @__PURE__*/ (e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new H;return a.issues.length?wt(e,a.issues,i):{success:!0,data:a.value}})(G);function wt(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>L(e,n,W()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}const Tt=/* @__PURE__*/ (e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?wt(e,a.issues,i):{success:!0,data:a.value}})(G),Et=/^https?$/,Dt=/^[\s\S]{0,}$/,Ot=/^-?\d+(?:\.\d+)?$/,kt=/*@__PURE__*/ V(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),At=/*@__PURE__*/ V(`$ZodCheckStringFormat`,(e,t)=>{var n,r;kt.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),jt={major:4,minor:6,patch:7},K=/*@__PURE__*/ V(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=jt;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=P(t),a;for(let o of n){if(o._zod.def.when){if(Qe(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new H;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(et(t.issues,n,e),i||=P(t,n))});else{if(t.issues.length===n)continue;et(t.issues,n,e),i||=P(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(P(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new H;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new H;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return nt(this,`~standard`,Pt(this))},set"~standard"(e){R(this,`~standard`,e)}}),Mt=(e,t)=>e.issues.length?{issues:e.issues.map(e=>L(e,t,W()))}:{value:e.value};async function Nt(e,t){let n={async:!0};return Mt(await e._zod.run({value:t,issues:[]},n),n)}function Pt(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return Mt(r,n)}catch{}return Nt(e,t)},vendor:`zod`,version:1}}const Ft=/*@__PURE__*/ V(`$ZodString`,(e,t)=>{K.init(e,t),e._zod.pattern=t.pattern??Dt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),It=/*@__PURE__*/ V(`$ZodStringFormat`,(e,t)=>{At.init(e,t),Ft.init(e,t)});function Lt(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function Rt(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?Lt(e)||2:zt(e,t)}function zt(e,t){if(!t.normalize&&t.protocol?.source===Et.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}const Bt=/[\t\n\r]/g;function Vt(e){return e.replace(Bt,``)}function Ht(e,t){return t.lastIndex=0,t.test(e.hostname)}function Ut(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}const Wt=/*@__PURE__*/ V(`$ZodURL`,(e,t)=>{It.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=Rt(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=Vt(r);return}t.hostname&&!Ht(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!Ut(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:Vt(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}});function Gt(e,t){let n=$e(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of $e(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,et(n.issues,t,e),n}}return i(n,a)}}const Kt=e=>Array.isArray(e)?e.length:-1;function qt(e,t,n){e.issues.length&&t.issues.push(...F(n,e.issues)),t.value[n]=e.value}const Jt=/*@__PURE__*/ V(`$ZodArray`,(e,t)=>{K.init(e,t);let n=U.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>qt(t,r,e)));else if(qt(c,r,e),s&&c.issues.length!==0&&P(c))break}return o.length?Promise.all(o).then(()=>r):r},Gt(e,Kt)});function Yt(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...F(n,e.issues))}!o&&i===void 0?e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]}):e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}const Xt=[];function Zt(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:Xt,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=Ze(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function Qt(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(P(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Yt(e,n,i,t,d,f))):Yt(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}const $t=/*@__PURE__*/ V(`$ZodObject`,(e,t)=>{K.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=Ve(()=>Zt(t));B(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||Ue(n,e,/* @__PURE__ */ new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=Ge,o=t.catchall,s,c=U.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(P(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>Yt(n,t,e,r,a,o))):Yt(s,t,e,r,a,o)}return o?Qt(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}});function en(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!P(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>L(e,r,W())))}),t)}const tn=/*@__PURE__*/ V(`$ZodUnion`,(e,t)=>{K.init(e,t),B(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),B(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),B(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),B(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>He(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>en(t,r,e,i)):en(o,r,e,i)}}),nn=/*@__PURE__*/ V(`$ZodRecord`,(e,t)=>{K.init(e,t);let n=U.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Ke(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=/* @__PURE__ */ new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>L(e,i,W())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...F(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...F(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&Ot.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>L(e,i,W())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...F(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...F(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),rn=/*@__PURE__*/ V(`$ZodEnum`,(e,t)=>{K.init(e,t);let n=Re(t.entries),r=new Set(n);e._zod.values=r,B(e,`pattern`,e=>{let t=Re(e.def.entries).filter(e=>Je.has(typeof e));return RegExp(t.length?`^(${t.map(e=>Ye(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),an=/*@__PURE__*/ V(`$ZodLiteral`,(e,t)=>{K.init(e,t);let n=new Set(t.values);e._zod.values=n,B(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?Ye(e):e?Ye(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}});function on(e,t){return e.value=t.issues.length?void 0:t.value,e}const sn=/*@__PURE__*/ V(`$ZodOptional`,(e,t)=>{K.init(e,t),B(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,B(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?/* @__PURE__ */ new Set([...t,void 0]):void 0}),B(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${He(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>on(e,t)):on(e,r)}return t.innerType._zod.run(e,n)}}),cn=/*@__PURE__*/ V(`$ZodDefault`,(e,t)=>{K.init(e,t),e._zod.optin=`defaulted`,B(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>ln(e,t)):ln(r,t)}});function ln(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const un=/*@__PURE__*/ V(`$ZodPrefault`,(e,t)=>{K.init(e,t),e._zod.optin=`defaulted`,B(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),dn=/*@__PURE__*/ V(`$ZodNonOptional`,(e,t)=>{K.init(e,t),B(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>fn(t,e)):fn(i,e)}});function fn(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var pn,mn=class{constructor(){this._map=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function hn(){return new mn}(pn=globalThis).__zod_globalRegistry??(pn.__zod_globalRegistry=hn());const gn=globalThis.__zod_globalRegistry;function _n(e){return e.checks&&=[...e.checks],e}// @__NO_SIDE_EFFECTS__
45
+ function vn(e,t){return new e(_n({type:`string`,...N(t)}))}// @__NO_SIDE_EFFECTS__
46
+ function yn(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...N(t)})}// @__NO_SIDE_EFFECTS__
47
+ function bn(e){let t=new kt({check:`describe`});return t._zod.onattach=[t=>{let n=gn.get(t)??{};gn.add(t,{...n,description:e})}],t._zod.check=()=>{},t}// @__NO_SIDE_EFFECTS__
48
+ function xn(e){let t=new kt({check:`meta`});return t._zod.onattach=[t=>{let n=gn.get(t)??{};gn.add(t,{...n,...e})}],t._zod.check=()=>{},t}const q=/*@__PURE__*/ V(`ZodMiniType`,(e,t)=>{if(!e._zod)throw Error(`Uninitialized schema in ZodMiniType.`);K.init(e,t),e.def=t,e.type=t.type},{get with(){return this.check},set with(e){R(this,`with`,e)},parse(e,t){return xt(this,e,t,{callee:this.parse})},parseAsync(e,t){return St(this,e,t,{callee:this.parseAsync})},safeParse(e,t){return Ct(this,e,t)},safeParseAsync(e,t){return Tt(this,e,t)},check(...e){let t=this.def;return this.clone({...t,checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]},{parent:!0})},clone(e,t){return Xe(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},apply(e,...t){return t.length===0?e(this):e(this,...t)}}),Sn=/*@__PURE__*/ V(`ZodMiniString`,(e,t)=>{Ft.init(e,t),q.init(e,t)});// @__NO_SIDE_EFFECTS__
49
+ function Cn(e){return/* @__PURE__ */ vn(Sn,e)}const wn=/*@__PURE__*/ V(`ZodMiniStringFormat`,(e,t)=>{It.init(e,t),Sn.init(e,t)}),Tn=/*@__PURE__*/ V(`ZodMiniURL`,(e,t)=>{Wt.init(e,t),wn.init(e,t)});// @__NO_SIDE_EFFECTS__
50
+ function En(e){return/* @__PURE__ */ yn(Tn,e)}const Dn=/*@__PURE__*/ V(`ZodMiniArray`,(e,t)=>{Jt.init(e,t),q.init(e,t)});// @__NO_SIDE_EFFECTS__
51
+ function On(e,t){return new Dn({type:`array`,element:e,...N(t)})}const kn=/*@__PURE__*/ V(`ZodMiniObject`,(e,t)=>{$t.init(e,t),q.init(e,t),st(e,`shape`,e=>e._zod.def.shape,!1)});// @__NO_SIDE_EFFECTS__
52
+ function An(e,t){let n={type:`object`,shape:e??{},...N(t)};return new kn(n)}const jn=/*@__PURE__*/ V(`ZodMiniUnion`,(e,t)=>{tn.init(e,t),q.init(e,t)});// @__NO_SIDE_EFFECTS__
53
+ function Mn(e,t){return new jn({type:`union`,options:e,...N(t)})}const Nn=/*@__PURE__*/ V(`ZodMiniRecord`,(e,t)=>{nn.init(e,t),q.init(e,t)});// @__NO_SIDE_EFFECTS__
54
+ function Pn(e,t,n){return!t||!t._zod?new Nn({type:`record`,keyType:/* @__PURE__ */ Cn(),valueType:e,...N(t)}):new Nn({type:`record`,keyType:e,valueType:t,...N(n)})}const Fn=/*@__PURE__*/ V(`ZodMiniEnum`,(e,t)=>{rn.init(e,t),q.init(e,t),e.options=[...e._zod.values]});// @__NO_SIDE_EFFECTS__
55
+ function In(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new Fn({type:`enum`,entries:n,...N(t)})}const Ln=/*@__PURE__*/ V(`ZodMiniLiteral`,(e,t)=>{an.init(e,t),q.init(e,t)});// @__NO_SIDE_EFFECTS__
56
+ function Rn(e,t){return new Ln({type:`literal`,values:Array.isArray(e)?e:[e],...N(t)})}const zn=/*@__PURE__*/ V(`ZodMiniOptional`,(e,t)=>{sn.init(e,t),q.init(e,t)});// @__NO_SIDE_EFFECTS__
57
+ function Bn(e){return new zn({type:`optional`,innerType:e})}const Vn=/*@__PURE__*/ V(`ZodMiniDefault`,(e,t)=>{cn.init(e,t),q.init(e,t)});// @__NO_SIDE_EFFECTS__
58
+ function Hn(e,t){return new Vn({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():qe(t)}})}const Un=/*@__PURE__*/ V(`ZodMiniPrefault`,(e,t)=>{un.init(e,t),q.init(e,t)});// @__NO_SIDE_EFFECTS__
59
+ function Wn(e,t){return new Un({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():qe(t)}})}const Gn=/*@__PURE__*/ V(`ZodMiniNonOptional`,(e,t)=>{dn.init(e,t),q.init(e,t)});// @__NO_SIDE_EFFECTS__
60
+ function Kn(e,t){return new Gn({type:`nonoptional`,innerType:e,...N(t)})}const J=bn,qn=xn;
58
61
  /*!
59
62
  * Copyright (c) Squirrel Chat et al., All rights reserved.
60
63
  * SPDX-License-Identifier: BSD-3-Clause
@@ -82,9 +85,9 @@ function Mn(e,t){return new jn({type:`prefault`,innerType:e,get defaultValue(){r
82
85
  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
83
86
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
84
87
  */
85
- function Nn(e,t){let n=e.slice(0,t).split(/\r?\n/);return[n.length,n.pop().length+1]}function Pn(e,t,n){let r=e.split(/\r?\n/),i=``,a=(Math.log10(t+1)|0)+1;for(let e=t-1;e<=t+1;e++){let o=r[e-1];o&&(i+=e.toString().padEnd(a,` `),i+=`: `,i+=o,i+=`
88
+ function Jn(e,t){let n=e.slice(0,t).split(/\r?\n/);return[n.length,n.pop().length+1]}function Yn(e,t,n){let r=e.split(/\r?\n/),i=``,a=(Math.log10(t+1)|0)+1;for(let e=t-1;e<=t+1;e++){let o=r[e-1];o&&(i+=e.toString().padEnd(a,` `),i+=`: `,i+=o,i+=`
86
89
  `,e===t&&(i+=` `.repeat(a+n+2),i+=`^
87
- `))}return i}var Y=class e extends Error{line;column;codeblock;constructor(e,t){let[n,r]=Nn(t.toml,t.ptr),i=Pn(t.toml,n,r);super(`Invalid TOML document: ${e}\n\n${i}`,t),this.line=n,this.column=r,this.codeblock=i}static x(t,n,r){throw new e(t,{toml:n.s,ptr:r??n.p})}};
90
+ `))}return i}var Y=class e extends Error{line;column;codeblock;constructor(e,t){let[n,r]=Jn(t.toml,t.ptr),i=Yn(t.toml,n,r);super(`Invalid TOML document: ${e}\n\n${i}`,t),this.line=n,this.column=r,this.codeblock=i}static x(t,n,r){throw new e(t,{toml:n.s,ptr:r??n.p})}};
88
91
  /*!
89
92
  * Copyright (c) Squirrel Chat et al., All rights reserved.
90
93
  * SPDX-License-Identifier: BSD-3-Clause
@@ -112,7 +115,7 @@ function Nn(e,t){let n=e.slice(0,t).split(/\r?\n/);return[n.length,n.pop().lengt
112
115
  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
113
116
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
114
117
  */
115
- function Fn(e){let t=e.p,n=e.s.charCodeAt(e.p++),r=n,i=n===39,a=n===e.s.charCodeAt(e.p)&&n===e.s.charCodeAt(e.p+1);a&&((n=e.s.charCodeAt(e.p+=2))===10?e.p++:n===13&&e.s.charCodeAt(e.p+1)===10&&(e.p+=2));let o=``,s=e.p,c=0;for(;e.p<e.s.length;e.p++)if(n=e.s.charCodeAt(e.p),a&&(n===10||n===13&&e.s.charCodeAt(e.p+1)===10))c&&=3;else if(n<32&&n!==9||n===127)Y.x(`control characters are not allowed in strings`,e);else if((!c||c===3)&&n===r&&(!a||e.s.charCodeAt(e.p+1)===r&&e.s.charCodeAt(e.p+2)===r)){if(a&&(e.s.charCodeAt(e.p+3)===r&&e.p++,e.s.charCodeAt(e.p+3)===r&&e.p++),!c){let t=e.s.slice(s,e.p);o=o?o+t:t}return e.p+=a?3:1,o}else if(!c)!i&&n===92&&(o+=e.s.slice(s,s=e.p),c=1);else if(c===1){if(n===120||n===117||n===85){let t=e.p++-1,r=0,i=n===120?2:n===117?4:8;for(let t=0;t<i;t++,e.p++){let t=e.s.charCodeAt(e.p),n=t>=48&&t<=57?t-48:t>=65&&t<=70?t-65+10:t>=97&&t<=102?t-97+10:-1;n<0&&Y.x(`invalid non-hex character in unicode escape`,e),r=r<<4|n}(r<0||r>1114111||r>=55296&&r<=57343)&&Y.x(`invalid unicode escape`,e,t),o+=String.fromCodePoint(r),s=e.p--,c=0}else a&&(n===32||n===9)?c=2:(n===98?o+=`\b`:n===116?o+=` `:n===110?o+=`
118
+ function Xn(e){let t=e.p,n=e.s.charCodeAt(e.p++),r=n,i=n===39,a=n===e.s.charCodeAt(e.p)&&n===e.s.charCodeAt(e.p+1);a&&((n=e.s.charCodeAt(e.p+=2))===10?e.p++:n===13&&e.s.charCodeAt(e.p+1)===10&&(e.p+=2));let o=``,s=e.p,c=0;for(;e.p<e.s.length;e.p++)if(n=e.s.charCodeAt(e.p),a&&(n===10||n===13&&e.s.charCodeAt(e.p+1)===10))c&&=3;else if(n<32&&n!==9||n===127)Y.x(`control characters are not allowed in strings`,e);else if((!c||c===3)&&n===r&&(!a||e.s.charCodeAt(e.p+1)===r&&e.s.charCodeAt(e.p+2)===r)){if(a&&(e.s.charCodeAt(e.p+3)===r&&e.p++,e.s.charCodeAt(e.p+3)===r&&e.p++),!c){let t=e.s.slice(s,e.p);o=o?o+t:t}return e.p+=a?3:1,o}else if(!c)!i&&n===92&&(o+=e.s.slice(s,s=e.p),c=1);else if(c===1){if(n===120||n===117||n===85){let t=e.p++-1,r=0,i=n===120?2:n===117?4:8;for(let t=0;t<i;t++,e.p++){let t=e.s.charCodeAt(e.p),n=t>=48&&t<=57?t-48:t>=65&&t<=70?t-65+10:t>=97&&t<=102?t-97+10:-1;n<0&&Y.x(`invalid non-hex character in unicode escape`,e),r=r<<4|n}(r<0||r>1114111||r>=55296&&r<=57343)&&Y.x(`invalid unicode escape`,e,t),o+=String.fromCodePoint(r),s=e.p--,c=0}else a&&(n===32||n===9)?c=2:(n===98?o+=`\b`:n===116?o+=` `:n===110?o+=`
116
119
  `:n===102?o+=`\f`:n===114?o+=`\r`:n===101?o+=`\x1B`:n===34?o+=`"`:n===92?o+=`\\`:Y.x(`unrecognised escape sequence`,e),s=e.p+1,c=0)}else n!==32&&n!==9&&(c===2&&Y.x(`invalid escape: only line-ending whitespace may be escaped`,e,s),c=+(!i&&n===92),s=e.p);Y.x(`unfinished string`,e,t)}
117
120
  /*!
118
121
  * Copyright (c) Squirrel Chat et al., All rights reserved.
@@ -141,7 +144,7 @@ function Fn(e){let t=e.p,n=e.s.charCodeAt(e.p++),r=n,i=n===39,a=n===e.s.charCode
141
144
  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
142
145
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
143
146
  */
144
- let In=/^(\d{4}-\d{2}-\d{2})?[Tt ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|z|[-+]\d{2}:\d{2})?$/i;var Ln=class e extends Date{#e=!1;#t=!1;#n=null;constructor(e,t,n){let r=!0,i=!0,a=`Z`,o;if(typeof e==`string`){if(t)e:{if(t<3){if(+e.slice(11,13)>23){e=``;break e}t===2?(a=null,e+=`Z`):(o=e.charCodeAt(e.length-1))!==90&&o!==122&&(a=e.slice(e.length-6)),n&&(e=e.slice(0,10)+`T`+e.slice(11))}else t===4&&(e=+e.slice(0,2)>23?``:`0000-01-01T${e}Z`);r=t!==4,i=t!==3}else{let t=e.match(In);t?(t[1]||(r=!1,e=`0000-01-01T${e}`),i=!!t[2],i&&e[10]===` `&&(e=e.replace(` `,`T`)),t[2]&&+t[2]>23?e=``:(a=t[3]||null,!a&&i&&(e+=`Z`))):e=``}}super(e),isNaN(this.getTime())||(this.#e=r,this.#t=i,this.#n=a)}isDateTime(){return this.#e&&this.#t}isLocal(){return!this.#e||!this.#t||!this.#n}isDate(){return this.#e&&!this.#t}isTime(){return this.#t&&!this.#e}isValid(){return this.#e||this.#t}toISOString(){let e=super.toISOString();if(this.isDate())return e.slice(0,10);if(this.isTime())return e.slice(11,23);if(this.#n===null)return e.slice(0,-1);if(this.#n===`Z`||this.#n===`z`)return e;let t=this.#n.slice(1,3)*60+ +this.#n.slice(4,6);return t=this.#n[0]===`-`?t:-t,(/* @__PURE__ */ new Date(this.getTime()-t*6e4)).toISOString().slice(0,-1)+this.#n}static wrapAsOffsetDateTime(t,n=`Z`){let r=new e(t);return r.#n=n,r}static wrapAsLocalDateTime(t){let n=new e(t);return n.#n=null,n}static wrapAsLocalDate(t){let n=new e(t);return n.#t=!1,n.#n=null,n}static wrapAsLocalTime(t){let n=new e(t);return n.#e=!1,n.#n=null,n}};
147
+ let Zn=/^(\d{4}-\d{2}-\d{2})?[Tt ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|z|[-+]\d{2}:\d{2})?$/i;var Qn=class e extends Date{#e=!1;#t=!1;#n=null;constructor(e,t,n){let r=!0,i=!0,a=`Z`,o;if(typeof e==`string`){if(t)e:{if(t<3){if(+e.slice(11,13)>23){e=``;break e}t===2?(a=null,e+=`Z`):(o=e.charCodeAt(e.length-1))!==90&&o!==122&&(a=e.slice(e.length-6)),n&&(e=e.slice(0,10)+`T`+e.slice(11))}else t===4&&(e=+e.slice(0,2)>23?``:`0000-01-01T${e}Z`);r=t!==4,i=t!==3}else{let t=e.match(Zn);t?(t[1]||(r=!1,e=`0000-01-01T${e}`),i=!!t[2],i&&e[10]===` `&&(e=e.replace(` `,`T`)),t[2]&&+t[2]>23?e=``:(a=t[3]||null,!a&&i&&(e+=`Z`))):e=``}}super(e),isNaN(this.getTime())||(this.#e=r,this.#t=i,this.#n=a)}isDateTime(){return this.#e&&this.#t}isLocal(){return!this.#e||!this.#t||!this.#n}isDate(){return this.#e&&!this.#t}isTime(){return this.#t&&!this.#e}isValid(){return this.#e||this.#t}toISOString(){let e=super.toISOString();if(this.isDate())return e.slice(0,10);if(this.isTime())return e.slice(11,23);if(this.#n===null)return e.slice(0,-1);if(this.#n===`Z`||this.#n===`z`)return e;let t=this.#n.slice(1,3)*60+ +this.#n.slice(4,6);return t=this.#n[0]===`-`?t:-t,(/* @__PURE__ */ new Date(this.getTime()-t*6e4)).toISOString().slice(0,-1)+this.#n}static wrapAsOffsetDateTime(t,n=`Z`){let r=new e(t);return r.#n=n,r}static wrapAsLocalDateTime(t){let n=new e(t);return n.#n=null,n}static wrapAsLocalDate(t){let n=new e(t);return n.#t=!1,n.#n=null,n}static wrapAsLocalTime(t){let n=new e(t);return n.#e=!1,n.#n=null,n}};
145
148
  /*!
146
149
  * Copyright (c) Squirrel Chat et al., All rights reserved.
147
150
  * SPDX-License-Identifier: BSD-3-Clause
@@ -169,7 +172,7 @@ let In=/^(\d{4}-\d{2}-\d{2})?[Tt ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|z|[
169
172
  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
170
173
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
171
174
  */
172
- function X(e,t=10){return t===16?e>47&&e<58||e>64&&e<71||e>96&&e<103:e>47&&e<48+t}function Rn(e,t){return e===32||e===9||e===10||e===13||t&&(e===t||e===44)||e===35}function zn(e,t){let n=e.p,r=e.s.charCodeAt(e.p);if(r===91||r===123){e.d--||Y.x(`document contains excessively nested structures. aborting.`,e);let t=r===91?Jn(e):qn(e);return e.d++,t}return r===34||r===39?Fn(e):r===116?((e.s.charCodeAt(++e.p)!==114||e.s.charCodeAt(++e.p)!==117||e.s.charCodeAt(++e.p)!==101)&&Y.x(`invalid value`,e,n),e.p++,!0):r===102?((e.s.charCodeAt(++e.p)!==97||e.s.charCodeAt(++e.p)!==108||e.s.charCodeAt(++e.p)!==115||e.s.charCodeAt(++e.p)!==101)&&Y.x(`invalid value`,e,n),e.p++,!1):r===43||r===45?Bn(e,e.p,e.s.charCodeAt(++e.p),44-r,t):e.s.charCodeAt(e.p+4)===45&&e.s.charCodeAt(e.p+7)===45?Un(e,r,t):e.s.charCodeAt(e.p+2)===58?Wn(e,r,t):Bn(e,e.p,r,0,t)}function Bn(e,t,n,r,i){let a=n,o=0,s=!1;if(a===105)return(e.s.charCodeAt(++e.p)!==110||e.s.charCodeAt(++e.p)!==102)&&Y.x(`invalid value`,e,t),e.p++,(r||1)/0;if(a===110)return(e.s.charCodeAt(++e.p)!==97||e.s.charCodeAt(++e.p)!==110)&&Y.x(`invalid value`,e,t),e.p++,NaN;if(a===48){if(++e.p>=e.s.length||Rn(a=e.s.charCodeAt(e.p),i))return e.bi===!0?0n:0;if(!r){if(a===120)return Vn(e,t,16,i);if(a===98)return Vn(e,t,2,i);if(a===111)return Vn(e,t,8,i)}a===46?o=2:a===101||a===69?o=4:Y.x(`illegal leading zero`,e,t)}else X(a)||Y.x(`invalid value`,e,t);for(;++e.p<e.s.length&&(a=e.s.charCodeAt(e.p),!Rn(a,i));)o||=1,a===95?(o&1||Y.x(`illegal underscore`,e),o+=11,s=!0):o===1&&a===46?o=2:(o===1||o===3)&&(a===101||a===69)?o=4:o===4&&(a===43||a===45)?o=6:X(a)?o>9?o-=11:o&1||o++:Y.x(`illegal character in numeric literal`,e);if(!o){let t=(n-48)*(r||1);return e.bi===!0?BigInt(t):t}o&1||Y.x(`unfinished numeric value`,e,t);let c=e.s.slice(t,e.p);return s&&(c=c.replaceAll(`_`,``)),o>1?parseFloat(c):Hn(e,c,10,t)}function Vn(e,t,n,r){let i,a=1;for(;++e.p<e.s.length&&(i=e.s.charCodeAt(e.p),!Rn(i,r));)i===95?(a&1&&Y.x(`illegal underscore`,e),a=3):X(i,n)?a&1&&a--:Y.x(`illegal character in numeric literal`,e);a&1&&Y.x(`unfinished numeric value`,e);let o=e.s.slice(t+2,e.p);return a&&(o=o.replaceAll(`_`,``)),Hn(e,o,n,t)}function Hn(e,t,n,r){if(e.bi!==!0)e:{let i=parseInt(t,n);if(!Number.isSafeInteger(i)){if(e.bi)break e;Y.x(`integer value cannot be represented losslessly`,e,r)}return i}return BigInt(n===10?t:(n===2?`0b`:n===8?`0o`:`0x`)+t)}function Un(e,t,n){let r=e.p++,i;if(!X(t)||!X(e.s.charCodeAt(e.p++))||!X(e.s.charCodeAt(e.p++))||!X(e.s.charCodeAt(e.p++)))return Bn(e,e.p=r,t,0,n);if(e.p+=5,X(e.s.charCodeAt(e.p++))||Y.x(`invalid date-time: date part is malformed`,e,r),e.p>=e.s.length||((t=e.s.charCodeAt(e.p))!==32||(i=!0,!X(e.s.charCodeAt(e.p+1))))&&t!==84&&t!==116)return Z(e,e.s.slice(r,e.p),3,!1,r);if(e.s.charCodeAt(e.p+=3)!==58&&Y.x(`invalid date-time: time part is malformed`,e,r),e.s.charCodeAt(e.p+=3)===58&&(e.p+=3),e.s.charCodeAt(e.p)===46)for(;X(e.s.charCodeAt(++e.p)););if(t=e.s.charCodeAt(e.p)){if(t===90||t===122)return Z(e,e.s.slice(r,++e.p),1,i,r,`[+00:00]`);if(t===43||t===45)return Z(e,e.s.slice(r,e.p+=6),1,i,r,!e.ld&&`[`+e.s.slice(e.p-6,e.p)+`]`)}return Z(e,e.s.slice(r,e.p),2,i,r)}function Wn(e,t,n){let r=e.p;if(!X(t)||!X(e.s.charCodeAt(++e.p)))return Bn(e,--e.p,t,0,n);if(e.s.charCodeAt(e.p+=4)===58&&(e.p+=3),e.s.charCodeAt(e.p)===46)for(;X(e.s.charCodeAt(++e.p)););return Z(e,e.s.slice(r,e.p),4,!1,r)}function Z(e,t,n,r,i,a){if(e.ld){let a=new Ln(t,n,r);return a.isValid()||Y.x(`invalid date`,e,i),a}try{switch(a&&(t+=a),n){case 1:return Temporal.ZonedDateTime.from(t);case 2:return Temporal.PlainDateTime.from(t);case 3:return Temporal.PlainDate.from(t);case 4:return Temporal.PlainTime.from(t)}}catch(t){Y.x(t instanceof Error?t.message:``+t,e,i)}}
175
+ function X(e,t=10){return t===16?e>47&&e<58||e>64&&e<71||e>96&&e<103:e>47&&e<48+t}function $n(e,t){return e===32||e===9||e===10||e===13||t&&(e===t||e===44)||e===35}function er(e,t){let n=e.p,r=e.s.charCodeAt(e.p);if(r===91||r===123){e.d--||Y.x(`document contains excessively nested structures. aborting.`,e);let t=r===91?lr(e):cr(e);return e.d++,t}return r===34||r===39?Xn(e):r===116?((e.s.charCodeAt(++e.p)!==114||e.s.charCodeAt(++e.p)!==117||e.s.charCodeAt(++e.p)!==101)&&Y.x(`invalid value`,e,n),e.p++,!0):r===102?((e.s.charCodeAt(++e.p)!==97||e.s.charCodeAt(++e.p)!==108||e.s.charCodeAt(++e.p)!==115||e.s.charCodeAt(++e.p)!==101)&&Y.x(`invalid value`,e,n),e.p++,!1):r===43||r===45?tr(e,e.p,e.s.charCodeAt(++e.p),44-r,t):e.s.charCodeAt(e.p+4)===45&&e.s.charCodeAt(e.p+7)===45?ir(e,r,t):e.s.charCodeAt(e.p+2)===58?ar(e,r,t):tr(e,e.p,r,0,t)}function tr(e,t,n,r,i){let a=n,o=0,s=!1;if(a===105)return(e.s.charCodeAt(++e.p)!==110||e.s.charCodeAt(++e.p)!==102)&&Y.x(`invalid value`,e,t),e.p++,(r||1)/0;if(a===110)return(e.s.charCodeAt(++e.p)!==97||e.s.charCodeAt(++e.p)!==110)&&Y.x(`invalid value`,e,t),e.p++,NaN;if(a===48){if(++e.p>=e.s.length||$n(a=e.s.charCodeAt(e.p),i))return e.bi===!0?0n:0;if(!r){if(a===120)return nr(e,t,16,i);if(a===98)return nr(e,t,2,i);if(a===111)return nr(e,t,8,i)}a===46?o=2:a===101||a===69?o=4:Y.x(`illegal leading zero`,e,t)}else X(a)||Y.x(`invalid value`,e,t);for(;++e.p<e.s.length&&(a=e.s.charCodeAt(e.p),!$n(a,i));)o||=1,a===95?(o&1||Y.x(`illegal underscore`,e),o+=11,s=!0):o===1&&a===46?o=2:(o===1||o===3)&&(a===101||a===69)?o=4:o===4&&(a===43||a===45)?o=6:X(a)?o>9?o-=11:o&1||o++:Y.x(`illegal character in numeric literal`,e);if(!o){let t=(n-48)*(r||1);return e.bi===!0?BigInt(t):t}o&1||Y.x(`unfinished numeric value`,e,t);let c=e.s.slice(t,e.p);return s&&(c=c.replaceAll(`_`,``)),o>1?parseFloat(c):rr(e,c,10,t)}function nr(e,t,n,r){let i,a=1;for(;++e.p<e.s.length&&(i=e.s.charCodeAt(e.p),!$n(i,r));)i===95?(a&1&&Y.x(`illegal underscore`,e),a=3):X(i,n)?a&1&&a--:Y.x(`illegal character in numeric literal`,e);a&1&&Y.x(`unfinished numeric value`,e);let o=e.s.slice(t+2,e.p);return a&&(o=o.replaceAll(`_`,``)),rr(e,o,n,t)}function rr(e,t,n,r){if(e.bi!==!0)e:{let i=parseInt(t,n);if(!Number.isSafeInteger(i)){if(e.bi)break e;Y.x(`integer value cannot be represented losslessly`,e,r)}return i}return BigInt(n===10?t:(n===2?`0b`:n===8?`0o`:`0x`)+t)}function ir(e,t,n){let r=e.p++,i;if(!X(t)||!X(e.s.charCodeAt(e.p++))||!X(e.s.charCodeAt(e.p++))||!X(e.s.charCodeAt(e.p++)))return tr(e,e.p=r,t,0,n);if(e.p+=5,X(e.s.charCodeAt(e.p++))||Y.x(`invalid date-time: date part is malformed`,e,r),e.p>=e.s.length||((t=e.s.charCodeAt(e.p))!==32||(i=!0,!X(e.s.charCodeAt(e.p+1))))&&t!==84&&t!==116)return Z(e,e.s.slice(r,e.p),3,!1,r);if(e.s.charCodeAt(e.p+=3)!==58&&Y.x(`invalid date-time: time part is malformed`,e,r),e.s.charCodeAt(e.p+=3)===58&&(e.p+=3),e.s.charCodeAt(e.p)===46)for(;X(e.s.charCodeAt(++e.p)););if(t=e.s.charCodeAt(e.p)){if(t===90||t===122)return Z(e,e.s.slice(r,++e.p),1,i,r,`[+00:00]`);if(t===43||t===45)return Z(e,e.s.slice(r,e.p+=6),1,i,r,!e.ld&&`[`+e.s.slice(e.p-6,e.p)+`]`)}return Z(e,e.s.slice(r,e.p),2,i,r)}function ar(e,t,n){let r=e.p;if(!X(t)||!X(e.s.charCodeAt(++e.p)))return tr(e,--e.p,t,0,n);if(e.s.charCodeAt(e.p+=4)===58&&(e.p+=3),e.s.charCodeAt(e.p)===46)for(;X(e.s.charCodeAt(++e.p)););return Z(e,e.s.slice(r,e.p),4,!1,r)}function Z(e,t,n,r,i,a){if(e.ld){let a=new Qn(t,n,r);return a.isValid()||Y.x(`invalid date`,e,i),a}try{switch(a&&(t+=a),n){case 1:return Temporal.ZonedDateTime.from(t);case 2:return Temporal.PlainDateTime.from(t);case 3:return Temporal.PlainDate.from(t);case 4:return Temporal.PlainTime.from(t)}}catch(t){Y.x(t instanceof Error?t.message:``+t,e,i)}}
173
176
  /*!
174
177
  * Copyright (c) Squirrel Chat et al., All rights reserved.
175
178
  * SPDX-License-Identifier: BSD-3-Clause
@@ -197,7 +200,7 @@ function X(e,t=10){return t===16?e>47&&e<58||e>64&&e<71||e>96&&e<103:e>47&&e<48+
197
200
  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
198
201
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
199
202
  */
200
- function Gn(e){for(;e.p<e.s.length;e.p++){let t=e.s.charCodeAt(e.p);if(t===10)break;if(t===13&&e.s.charCodeAt(e.p+1)===10){e.p++;break}(t<32&&t!==9||t===127)&&Y.x(`control characters are not allowed in comments`,e)}}function Q(e,t,n){let r;for(;e.p<e.s.length;){for(;e.p<e.s.length&&((r=e.s.charCodeAt(e.p))===32||r===9||!t&&(r===10||r===13&&e.s.charCodeAt(e.p+1)===10));)e.p++;if(n||r!==35)break;Gn(e)}}
203
+ function or(e){for(;e.p<e.s.length;e.p++){let t=e.s.charCodeAt(e.p);if(t===10)break;if(t===13&&e.s.charCodeAt(e.p+1)===10){e.p++;break}(t<32&&t!==9||t===127)&&Y.x(`control characters are not allowed in comments`,e)}}function Q(e,t,n){let r;for(;e.p<e.s.length;){for(;e.p<e.s.length&&((r=e.s.charCodeAt(e.p))===32||r===9||!t&&(r===10||r===13&&e.s.charCodeAt(e.p+1)===10));)e.p++;if(n||r!==35)break;or(e)}}
201
204
  /*!
202
205
  * Copyright (c) Squirrel Chat et al., All rights reserved.
203
206
  * SPDX-License-Identifier: BSD-3-Clause
@@ -225,7 +228,7 @@ function Gn(e){for(;e.p<e.s.length;e.p++){let t=e.s.charCodeAt(e.p);if(t===10)br
225
228
  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
226
229
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
227
230
  */
228
- function Kn(e,t=61){let n,r=0,i=[],a,o=e.s.charCodeAt(n=e.p);do if(o===t)return r||Y.x(`unexpected end of key`,e),r===1&&i.push(e.s.slice(a,e.p)),e.p++,i;else o===46?(r||Y.x(`illegal empty bare key`,e),r===1&&i.push(e.s.slice(a,e.p)),r=0):!r&&(o===34||o===39)?(o===e.s.charCodeAt(e.p+1)&&o===e.s.charCodeAt(e.p+2)&&Y.x(`illegal quoted key: multiline strings are not allowed`,e),i.push(Fn(e)),r=2,e.p--):o===32||o===9?r===1&&(i.push(e.s.slice(a,e.p)),r=2):r===2||o<48&&o!==45||o>57&&o<65||o>90&&o<97&&o!==95||o>122?Y.x(`illegal character in key`,e):r||(r=1,a=e.p);while(o=e.s.charCodeAt(++e.p));Y.x(`incomplete key-value: cannot find end of key`,e,n)}function qn(e){let t=e.p++,n=Object.create(null),r=/* @__PURE__ */ new Set,i;for(;e.p<e.s.length;){if(Q(e),(i=e.s.charCodeAt(e.p))===125)return e.p++,n;let t,a=n,o=!1,s=e.p,c=Kn(e);for(let n=0;n<c.length;n++){n&&(a=o?a[t]:a[t]=Object.create(null)),t=c[n],(o=Object.hasOwn(a,t))&&(typeof a[t]!=`object`||r.has(a[t]))&&Y.x(`trying to redefine an already defined value`,e,s);let i=t===`__proto__`;if(e.uk&&(i||t===`constructor`)){a=e.uk!==1&&Y.x(`document contains an unsafe property`,e,s);break}!o&&i&&Object.defineProperty(a,t,{enumerable:!0,configurable:!0,writable:!0})}o&&Y.x(`trying to redefine an already defined value`,e,s),Q(e,!0,!0);let l=zn(e,125);if(a&&typeof(a[t]=l)==`object`&&r.add(l),Q(e),(i=e.s.charCodeAt(e.p++))===125)return n;i!==44&&Y.x(`expected comma or end of structure`,e,e.p-1)}Y.x(`unfinished table`,e,t)}function Jn(e){let t=e.p++,n=[],r;for(;e.p<e.s.length;){if(Q(e),(r=e.s.charCodeAt(e.p))===93)return e.p++,n;if(n.push(zn(e,93)),Q(e),(r=e.s.charCodeAt(e.p++))===93)return n;r!==44&&Y.x(`expected comma or end of structure`,e,e.p-1)}Y.x(`unfinished array`,e,t)}
231
+ function sr(e,t=61){let n,r=0,i=[],a,o=e.s.charCodeAt(n=e.p);do if(o===t)return r||Y.x(`unexpected end of key`,e),r===1&&i.push(e.s.slice(a,e.p)),e.p++,i;else o===46?(r||Y.x(`illegal empty bare key`,e),r===1&&i.push(e.s.slice(a,e.p)),r=0):!r&&(o===34||o===39)?(o===e.s.charCodeAt(e.p+1)&&o===e.s.charCodeAt(e.p+2)&&Y.x(`illegal quoted key: multiline strings are not allowed`,e),i.push(Xn(e)),r=2,e.p--):o===32||o===9?r===1&&(i.push(e.s.slice(a,e.p)),r=2):r===2||o<48&&o!==45||o>57&&o<65||o>90&&o<97&&o!==95||o>122?Y.x(`illegal character in key`,e):r||(r=1,a=e.p);while(o=e.s.charCodeAt(++e.p));Y.x(`incomplete key-value: cannot find end of key`,e,n)}function cr(e){let t=e.p++,n=Object.create(null),r=/* @__PURE__ */ new Set,i;for(;e.p<e.s.length;){if(Q(e),(i=e.s.charCodeAt(e.p))===125)return e.p++,n;let t,a=n,o=!1,s=e.p,c=sr(e);for(let n=0;n<c.length;n++){n&&(a=o?a[t]:a[t]=Object.create(null)),t=c[n],(o=Object.hasOwn(a,t))&&(typeof a[t]!=`object`||r.has(a[t]))&&Y.x(`trying to redefine an already defined value`,e,s);let i=t===`__proto__`;if(e.uk&&(i||t===`constructor`)){a=e.uk!==1&&Y.x(`document contains an unsafe property`,e,s);break}!o&&i&&Object.defineProperty(a,t,{enumerable:!0,configurable:!0,writable:!0})}o&&Y.x(`trying to redefine an already defined value`,e,s),Q(e,!0,!0);let l=er(e,125);if(a&&typeof(a[t]=l)==`object`&&r.add(l),Q(e),(i=e.s.charCodeAt(e.p++))===125)return n;i!==44&&Y.x(`expected comma or end of structure`,e,e.p-1)}Y.x(`unfinished table`,e,t)}function lr(e){let t=e.p++,n=[],r;for(;e.p<e.s.length;){if(Q(e),(r=e.s.charCodeAt(e.p))===93)return e.p++,n;if(n.push(er(e,93)),Q(e),(r=e.s.charCodeAt(e.p++))===93)return n;r!==44&&Y.x(`expected comma or end of structure`,e,e.p-1)}Y.x(`unfinished array`,e,t)}
229
232
  /*!
230
233
  * Copyright (c) Squirrel Chat et al., All rights reserved.
231
234
  * SPDX-License-Identifier: BSD-3-Clause
@@ -253,7 +256,7 @@ function Kn(e,t=61){let n,r=0,i=[],a,o=e.s.charCodeAt(n=e.p);do if(o===t)return
253
256
  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
254
257
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
255
258
  */
256
- function Yn(e,t,n,r,i){let a=n,o=r,s,c=!1,l;for(let n=0;n<t.length;n++){if(n){if(a=c?a[s]:a[s]=Object.create(null),o=(l=o[s]).c,i===0&&(l.t===1||l.t===2))return null;if(l.t===2){let e=a.length-1;a=a[e],o=o[e].c}}if(s=t[n],(c=Object.hasOwn(a,s))&&o[s]?.t===0&&o[s]?.d)return null;if(!c){let r=s===`__proto__`;if(e.uk&&(r||s===`constructor`))return!1;r&&(Object.defineProperty(a,s,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(o,s,{enumerable:!0,configurable:!0,writable:!0})),o[s]={t:n<t.length-1&&i===2?3:i,d:!1,i:0,c:Object.create(null)}}}if(l=o[s],l.t!==i&&(i!==1||l.t!==3)||(i===2&&(l.d||(l.d=!0,a[s]=[]),a[s].push(a=Object.create(null)),l.c[l.i++]=l={t:1,d:!1,i:0,c:Object.create(null)}),l.d))return null;if(l.d=!0,i===1)a=c?a[s]:a[s]=Object.create(null);else if(i===0&&c)return null;return[s,a,l.c]}function Xn(e,t,n){(t===null||e.uk===2)&&Y.x(t===null?`trying to redefine an already defined table or value`:`document contains an unsafe property`,e,n)}function Zn(e,t={}){let n={s:e,p:0,d:t.maxDepth??1e3,bi:t.integersAsBigInt??!1,ld:t.useLegacyDate??!0,uk:t.unsafeKeyBehaviour===`throw`?2:+(t.unsafeKeyBehaviour===`drop`)},r=Object.create(null),i=Object.create(null),a,o=!1,s=r,c=i;for(e.charCodeAt(0)===65279&&n.p++,Q(n);n.p<e.length;){if(e.charCodeAt(n.p)===91){let t=e.charCodeAt(++n.p)===91;a=n.p+=+t,o=!1;let l=Kn(n,93);t&&(e.charCodeAt(n.p)!==93&&Y.x(`expected end of table array declaration`,n),n.p++);let u=Yn(n,l,r,i,t?2:1);u?(c=u[2],s=u[1]):(Xn(n,u,a),o=!0)}else{a=n.p;let e=Yn(n,Kn(n),s,c,0);!e&&!o&&Xn(n,e,a),Q(n,!0,!0);let t=zn(n,void 0);e&&!o&&(e[1][e[0]]=t)}Q(n,!0),n.p<e.length&&(a=e.charCodeAt(n.p))!==10&&(a!==13||e.charCodeAt(n.p+1)!==10)&&Y.x(`each key-value declaration must be followed by an end-of-line`,n),Q(n)}return r}
259
+ function ur(e,t,n,r,i){let a=n,o=r,s,c=!1,l;for(let n=0;n<t.length;n++){if(n){if(a=c?a[s]:a[s]=Object.create(null),o=(l=o[s]).c,i===0&&(l.t===1||l.t===2))return null;if(l.t===2){let e=a.length-1;a=a[e],o=o[e].c}}if(s=t[n],(c=Object.hasOwn(a,s))&&o[s]?.t===0&&o[s]?.d)return null;if(!c){let r=s===`__proto__`;if(e.uk&&(r||s===`constructor`))return!1;r&&(Object.defineProperty(a,s,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(o,s,{enumerable:!0,configurable:!0,writable:!0})),o[s]={t:n<t.length-1&&i===2?3:i,d:!1,i:0,c:Object.create(null)}}}if(l=o[s],l.t!==i&&(i!==1||l.t!==3)||(i===2&&(l.d||(l.d=!0,a[s]=[]),a[s].push(a=Object.create(null)),l.c[l.i++]=l={t:1,d:!1,i:0,c:Object.create(null)}),l.d))return null;if(l.d=!0,i===1)a=c?a[s]:a[s]=Object.create(null);else if(i===0&&c)return null;return[s,a,l.c]}function dr(e,t,n){(t===null||e.uk===2)&&Y.x(t===null?`trying to redefine an already defined table or value`:`document contains an unsafe property`,e,n)}function fr(e,t={}){let n={s:e,p:0,d:t.maxDepth??1e3,bi:t.integersAsBigInt??!1,ld:t.useLegacyDate??!0,uk:t.unsafeKeyBehaviour===`throw`?2:+(t.unsafeKeyBehaviour===`drop`)},r=Object.create(null),i=Object.create(null),a,o=!1,s=r,c=i;for(e.charCodeAt(0)===65279&&n.p++,Q(n);n.p<e.length;){if(e.charCodeAt(n.p)===91){let t=e.charCodeAt(++n.p)===91;a=n.p+=+t,o=!1;let l=sr(n,93);t&&(e.charCodeAt(n.p)!==93&&Y.x(`expected end of table array declaration`,n),n.p++);let u=ur(n,l,r,i,t?2:1);u?(c=u[2],s=u[1]):(dr(n,u,a),o=!0)}else{a=n.p;let e=ur(n,sr(n),s,c,0);!e&&!o&&dr(n,e,a),Q(n,!0,!0);let t=er(n,void 0);e&&!o&&(e[1][e[0]]=t)}Q(n,!0),n.p<e.length&&(a=e.charCodeAt(n.p))!==10&&(a!==13||e.charCodeAt(n.p+1)!==10)&&Y.x(`each key-value declaration must be followed by an end-of-line`,n),Q(n)}return r}
257
260
  /*!
258
261
  * Copyright (c) Squirrel Chat et al., All rights reserved.
259
262
  * SPDX-License-Identifier: BSD-3-Clause
@@ -309,21 +312,56 @@ function Yn(e,t,n,r,i){let a=n,o=r,s,c=!1,l;for(let n=0;n<t.length;n++){if(n){if
309
312
  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
310
313
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
311
314
  */
312
- const Qn=/* @__PURE__ */ Tn(/* @__PURE__ */ hn(),/* @__PURE__ */ hn());function $(e,t=navigator.languages){for(let n of t){let t=n.split(`-`);for(let n=t.length;n>0;n--){let r=e[t.slice(0,n).join(`-`)];if(r!==void 0)return r}}return Object.values(e)[0]??``}const $n={en:`next`,es:`siguiente`,pt:`próximo`,fr:`suivant`,de:`weiter`,it:`successivo`,nl:`volgende`,pl:`następna`,ru:`следующий`,uk:`наступний`,tr:`sonraki`,ar:`التالي`,hi:`अगला`,bn:`পরবর্তী`,id:`berikutnya`,vi:`tiếp theo`,th:`ถัดไป`,ja:`次へ`,ko:`다음`,zh:`下一个`,"zh-TW":`下一個`},er={en:`previous`,es:`anterior`,pt:`anterior`,fr:`précédent`,de:`zurück`,it:`precedente`,nl:`vorige`,pl:`poprzednia`,ru:`предыдущий`,uk:`попередній`,tr:`önceki`,ar:`السابق`,hi:`पिछला`,bn:`পূর্ববর্তী`,id:`sebelumnya`,vi:`trước`,th:`ก่อนหน้า`,ja:`前へ`,ko:`이전`,zh:`上一个`,"zh-TW":`上一個`},tr={en:`random`,es:`aleatorio`,pt:`aleatório`,fr:`aléatoire`,de:`zufällig`,it:`casuale`,nl:`willekeurig`,pl:`losowa`,ru:`случайный`,uk:`випадковий`,tr:`rastgele`,ar:`عشوائي`,hi:`रैंडम`,bn:`এলোমেলো`,id:`acak`,vi:`ngẫu nhiên`,th:`สุ่ม`,ja:`ランダム`,ko:`무작위`,zh:`随机`,"zh-TW":`隨機`},nr={en:`loading`,es:`cargando`,pt:`carregando`,fr:`chargement`,de:`lädt`,it:`caricamento`,nl:`laden`,pl:`ładowanie`,ru:`загрузка`,uk:`завантаження`,tr:`yükleniyor`,ar:`جارٍ التحميل`,hi:`लोड हो रहा है`,bn:`লোড হচ্ছে`,id:`memuat`,vi:`đang tải`,th:`กำลังโหลด`,ja:`読み込み中`,ko:`로딩 중`,zh:`加载中`,"zh-TW":`載入中`},rr={en:`error`,es:`error`,pt:`erro`,fr:`erreur`,de:`fehler`,it:`errore`,nl:`fout`,pl:`błąd`,ru:`ошибка`,uk:`помилка`,tr:`hata`,ar:`خطأ`,hi:`त्रुटि`,bn:`ত্রুটি`,id:`kesalahan`,vi:`lỗi`,th:`ข้อผิดพลาด`,ja:`エラー`,ko:`오류`,zh:`错误`,"zh-TW":`錯誤`};function ir(e){throw Error(`reached impossible variant: ${e}`)}const ar=/* @__PURE__ */ q({version:/* @__PURE__ */ Dn([`0.0`]),name:Qn,sites:/* @__PURE__ */ Sn(/* @__PURE__ */ q({url:/* @__PURE__ */ vn(),scope:/* @__PURE__ */ Dn([`host`,`path`])})),options:/* @__PURE__ */ Mn(/* @__PURE__ */ q({homeUrl:/* @__PURE__ */ kn(/* @__PURE__ */ vn()),showRandom:/* @__PURE__ */ J(/* @__PURE__ */ bn(),!0),cssHref:/* @__PURE__ */ kn(/* @__PURE__ */ vn())}),{}),strings:/* @__PURE__ */ Mn(/* @__PURE__ */ q({next:/* @__PURE__ */ J(Qn,$n),previous:/* @__PURE__ */ J(Qn,er),random:/* @__PURE__ */ J(Qn,tr)}),{})});async function or({url:e,init:t}){let n=await fetch(e,t);if(!n.ok)throw Error(`fetchConfig response error ${n.status}: ${await n.text()}`);let r=Zn(await n.text());return ar.parse(r)}async function sr(e,t=console.error){try{return await e}catch(e){throw e instanceof yt?t(`[fairy-ring] invalid config:`,xt(e)):t(`[fairy-ring] error loading config:`,e),e}}function cr(e){let t=new URL(document.baseURI),n=e.sites.findIndex(e=>{let n=new URL(e.url);switch(e.scope){case`host`:return n.host.toLowerCase()===t.host.toLowerCase();case`path`:return n.host.toLowerCase()===t.host.toLowerCase()&&n.pathname===t.pathname;default:ir(e.scope)}});return n<0?null:[e.sites[n],n]}function lr(e,t){return(e%t+t)%t}function ur(e){let t=cr(e);return t?e.sites[lr(t[1]+1,e.sites.length)]:null}function dr(e){let t=cr(e);return t?e.sites[lr(t[1]-1,e.sites.length)]:null}function fr(e){if(e.sites.length===0)return null;if(e.sites.length===1)return e.sites[0];let[t,n=0]=cr(e)??[],r=0;for(let t=0;r===n&&t<10;++t)r=Math.floor(Math.random()*e.sites.length);return e.sites[r]}function pr(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var mr=class extends A{static{this.styles=o`
315
+ const $=(/* @__PURE__ */ Pn((/* @__PURE__ */ Cn()).check(qn({title:`language`})),(/* @__PURE__ */ Cn()).check(J(`translation for a BCP 47 language tag, e.g. "en", "en-US"`)))).check(qn({id:`LocString`,description:`maps language tag -> translation`}));function pr(e){for(let t of navigator.languages){let n=t.split(`-`);for(let t=n.length;t>0;t--){let r=e[n.slice(0,t).join(`-`)];if(r!==void 0)return r}}return Object.values(e)[0]??``}const mr={en:`next`,es:`siguiente`,pt:`próximo`,fr:`suivant`,de:`weiter`,it:`successivo`,nl:`volgende`,pl:`następna`,ru:`следующий`,uk:`наступний`,tr:`sonraki`,ar:`التالي`,hi:`अगला`,bn:`পরবর্তী`,id:`berikutnya`,vi:`tiếp theo`,th:`ถัดไป`,ja:`次へ`,ko:`다음`,zh:`下一个`,"zh-TW":`下一個`},hr={en:`previous`,es:`anterior`,pt:`anterior`,fr:`précédent`,de:`zurück`,it:`precedente`,nl:`vorige`,pl:`poprzednia`,ru:`предыдущий`,uk:`попередній`,tr:`önceki`,ar:`السابق`,hi:`पिछला`,bn:`পূর্ববর্তী`,id:`sebelumnya`,vi:`trước`,th:`ก่อนหน้า`,ja:`前へ`,ko:`이전`,zh:`上一个`,"zh-TW":`上一個`},gr={en:`random`,es:`aleatorio`,pt:`aleatório`,fr:`aléatoire`,de:`zufällig`,it:`casuale`,nl:`willekeurig`,pl:`losowa`,ru:`случайный`,uk:`випадковий`,tr:`rastgele`,ar:`عشوائي`,hi:`रैंडम`,bn:`এলোমেলো`,id:`acak`,vi:`ngẫu nhiên`,th:`สุ่ม`,ja:`ランダム`,ko:`무작위`,zh:`随机`,"zh-TW":`隨機`},_r={en:`loading`,es:`cargando`,pt:`carregando`,fr:`chargement`,de:`lädt`,it:`caricamento`,nl:`laden`,pl:`ładowanie`,ru:`загрузка`,uk:`завантаження`,tr:`yükleniyor`,ar:`جارٍ التحميل`,hi:`लोड हो रहा है`,bn:`লোড হচ্ছে`,id:`memuat`,vi:`đang tải`,th:`กำลังโหลด`,ja:`読み込み中`,ko:`로딩 중`,zh:`加载中`,"zh-TW":`載入中`},vr={en:`error`,es:`error`,pt:`erro`,fr:`erreur`,de:`fehler`,it:`errore`,nl:`fout`,pl:`błąd`,ru:`ошибка`,uk:`помилка`,tr:`hata`,ar:`خطأ`,hi:`त्रुटि`,bn:`ত্রুটি`,id:`kesalahan`,vi:`lỗi`,th:`ข้อผิดพลาด`,ja:`エラー`,ko:`오류`,zh:`错误`,"zh-TW":`錯誤`};function yr(e){throw Error(`reached impossible variant: ${e}`)}
316
+ /**
317
+ * @license
318
+ * Copyright 2020 Google LLC
319
+ * SPDX-License-Identifier: BSD-3-Clause
320
+ */const{I:br}=Me,xr=(e,t)=>t===void 0?e?._$litType$!==void 0:e?._$litType$===t;function Sr(e,t){let n=pr(e).split(/\{\{\s*(\w+)\s*\}\}/).map((e,n)=>{if(n%2==1){let n=Object.hasOwn(t,e)?t[e]:void 0;return xr(n)?n:typeof n==`object`?pr(n):n===void 0?(console.error(`[fairy-ring] unknown template key:`,e),D):n}return e});return T`${n}`}const Cr=/* @__PURE__ */ En({protocol:/^https?$/}),wr=(/* @__PURE__ */ An({url:Cr.check(J(`where to link to`)),scope:(/* @__PURE__ */ In([`host`,`path`])).check(J(`what part of this link does the site own? "host": all of my.example.com. "path": just sub-paths of my.example.com/path, not my.example.com/other`))})).check(qn({id:`Site`})),Tr=/* @__PURE__ */ An({configVersion:(/* @__PURE__ */ Mn([/* @__PURE__ */ Rn(1)])).check(J(`config schema version`)),name:(/* @__PURE__ */ Kn($)).check(J(`name of this webring. include in a string with {{name}}.`)),homeText:(/* @__PURE__ */ Hn($,{und:`{{name}}`})).check(J(`text that links to the homepage. defaults to "{{name}}".`)),homeUrl:(/* @__PURE__ */ Bn(Cr)).check(J(`a homepage for the webring, if one exists`)),sites:(/* @__PURE__ */ On(wr)).check(J(`list sites in the webring`)),strings:(/* @__PURE__ */ Wn((/* @__PURE__ */ An({next:(/* @__PURE__ */ Hn($,mr)).check(J(`link to the next site`)),previous:(/* @__PURE__ */ Hn($,hr)).check(J(`link to the previous site`)),random:(/* @__PURE__ */ Hn($,gr)).check(J(`link to a random site`))})).check(qn({id:`Strings`})),{})).check(J(`overrides for built-in translations`))});async function Er({url:e,init:t}){let n=await fetch(e,t);if(!n.ok)throw Error(`fetchConfig response error ${n.status}: ${await n.text()}`);let r=fr(await n.text());return Tr.parse(r)}async function Dr(e,t=console.error){try{return await e}catch(e){throw e instanceof vt?t(`[fairy-ring] invalid config:`,bt(e)):t(`[fairy-ring] error loading config:`,e),e}}function Or(e){let t=new URL(document.baseURI),n=e.sites.findIndex(e=>{let n=new URL(e.url);switch(e.scope){case`host`:return n.host.toLowerCase()===t.host.toLowerCase();case`path`:return n.host.toLowerCase()===t.host.toLowerCase()&&n.pathname===t.pathname;default:yr(e.scope)}});return n<0?null:[e.sites[n],n]}function kr(e,t){return(e%t+t)%t}function Ar(e){let t=Or(e);return t?e.sites[kr(t[1]+1,e.sites.length)]:null}function jr(e){let t=Or(e);return t?e.sites[kr(t[1]-1,e.sites.length)]:null}function Mr(e){if(e.sites.length===0)return null;if(e.sites.length===1)return e.sites[0];let[t,n=0]=Or(e)??[],r=0;for(let t=0;r===n&&t<10;++t)r=Math.floor(Math.random()*e.sites.length);return e.sites[r]}function Nr(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var Pr=class extends M{static{this.styles=o`
313
321
  :host {
314
- display: flex;
315
- flex-direction: row;
322
+ display: grid;
323
+ grid-template-areas: "prev home random next";
324
+ justify-content: start;
325
+ align-items: center;
316
326
  gap: 1em;
327
+
328
+ &::part(prev) {
329
+ grid-area: prev;
330
+ }
331
+ &::part(home) {
332
+ grid-area: home;
333
+ }
334
+ &::part(random) {
335
+ grid-area: random;
336
+ }
337
+ &::part(next) {
338
+ grid-area: next;
339
+ }
340
+ &::part(loading),
341
+ &::part(error) {
342
+ display: none;
343
+ }
344
+ }
345
+
346
+ :host([hidden]) {
347
+ display: none;
348
+ }
349
+
350
+ /* match the surrounding text instead of the browser's default link blue/purple */
351
+ a {
352
+ color: inherit;
317
353
  }
318
- `}#e=new se(this,{args:()=>[this.configUrl],task:async([e],{signal:t})=>{if(!e)throw Error(`missing config-url`);return sr(or({url:e,init:{signal:t}}))}});render(){return T`
319
- ${this.#e.render({pending:()=>T`<div class="loading">${$(nr)}</div>`,error:()=>T`<div class="error">${$(rr)}</div>`,complete:e=>T`
320
- <a class="prev" href=${dr(e)?.url??``}
321
- >${$(e.strings.previous)}</a
322
- >
323
- ${e.options.homeUrl?T`<a class="home" href=${e.options.homeUrl}>${e.name}</a>`:T`<div>${$(e.name)}</div>`}
324
- <a class="random" href=${fr(e)?.url??``}
325
- >${$(e.strings.random)}</a
326
- >
327
- <a class="next" href=${ur(e)?.url??``}>${$(e.strings.next)}</a>
328
- `})}
329
- `}};pr([Re({attribute:`config-url`})],mr.prototype,`configUrl`,void 0);function hr(e=`fairy-ring`){customElements.get(e)||customElements.define(e,mr)}hr();export{mr as FairyRingElement,hr as define};
354
+ `}#e=new oe(this,{args:()=>[this.configUrl],task:async([e],{signal:t})=>{if(!e)throw Error(`missing config-url`);return Dr(Er({url:e,init:{signal:t}}))}});render(){return T`
355
+ ${this.#e.render({pending:()=>T`<div part="loading">${Sr(_r,{})}</div>`,error:()=>T`<div part="error">${Sr(vr,{})}</div>`,complete:e=>{let t=t=>Sr(t,{name:e.name});return T`
356
+ <a part="prev link widget" rel="prev" href=${jr(e)?.url??``}
357
+ >${t(e.strings.previous)}</a
358
+ >
359
+ ${e.homeUrl?T`<a part="home link widget" href=${e.homeUrl}>${t(e.homeText)}</a>`:T`<div part="home widget">${t(e.homeText)}</div>`}
360
+ <a part="random link widget" href=${Mr(e)?.url??``}
361
+ >${t(e.strings.random)}</a
362
+ >
363
+ <a part="next link widget" rel="next" href=${Ar(e)?.url??``}
364
+ >${t(e.strings.next)}</a
365
+ >
366
+ `}})}
367
+ `}};Nr([Le({attribute:`config-url`})],Pr.prototype,`configUrl`,void 0);function Fr(e=`fairy-ring`){customElements.get(e)||customElements.define(e,Pr)}Fr();export{Pr as FairyRingElement,Fr as define};
package/dist/vue.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, h } from "vue";
2
- import { n as define } from "./element-GEcIko-6.js";
2
+ import { n as define } from "./element-CvyhlWFr.js";
3
3
  // src/vue.ts
4
4
  const FairyRing = defineComponent(() => {
5
5
  define();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fairy-ring",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "",
5
5
  "license": "ISC",
6
6
  "repository": {
@@ -23,6 +23,10 @@
23
23
  "types": "./dist/element.d.ts",
24
24
  "default": "./dist/element.js"
25
25
  },
26
+ "./lib": {
27
+ "types": "./dist/lib.d.ts",
28
+ "default": "./dist/lib.js"
29
+ },
26
30
  "./standalone": "./dist/standalone.js",
27
31
  "./react": {
28
32
  "types": "./dist/react.d.ts",
@@ -46,10 +50,12 @@
46
50
  },
47
51
  "devDependencies": {
48
52
  "@changesets/cli": "^3.0.3",
53
+ "@storybook/addon-docs": "10.6.7",
49
54
  "@storybook/addon-vitest": "^10.6.7",
50
55
  "@storybook/web-components-vite": "^10.6.7",
51
56
  "@types/react": "^19.3.0",
52
57
  "@vitest/browser-playwright": "^5.1.1",
58
+ "highlight.js": "^11.12.0",
53
59
  "oxfmt": "^0.79.0",
54
60
  "oxlint": "^1.94.0",
55
61
  "playwright": "^1.65.1",