lunchboxjs 2.1.17 → 2.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.
@@ -1,5 +1,5 @@
1
1
  import * as p from "three";
2
- const At = [
2
+ const Ae = [
3
3
  // ORDER MATTERS HERE!
4
4
  // Place the objects most likely to wrap other objects at the beginning of the list.
5
5
  // Main wrappers
@@ -91,237 +91,237 @@ const At = [
91
91
  * Copyright 2019 Google LLC
92
92
  * SPDX-License-Identifier: BSD-3-Clause
93
93
  */
94
- const j = globalThis, Y = j.ShadowRoot && (j.ShadyCSS === void 0 || j.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, X = Symbol(), rt = /* @__PURE__ */ new WeakMap();
95
- let Et = class {
96
- constructor(t, e, s) {
94
+ const j = globalThis, Y = j.ShadowRoot && (j.ShadyCSS === void 0 || j.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, X = Symbol(), re = /* @__PURE__ */ new WeakMap();
95
+ let be = class {
96
+ constructor(e, t, s) {
97
97
  if (this._$cssResult$ = !0, s !== X)
98
98
  throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
99
- this.cssText = t, this.t = e;
99
+ this.cssText = e, this.t = t;
100
100
  }
101
101
  get styleSheet() {
102
- let t = this.o;
103
- const e = this.t;
104
- if (Y && t === void 0) {
105
- const s = e !== void 0 && e.length === 1;
106
- s && (t = rt.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && rt.set(e, t));
102
+ let e = this.o;
103
+ const t = this.t;
104
+ if (Y && e === void 0) {
105
+ const s = t !== void 0 && t.length === 1;
106
+ s && (e = re.get(t)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), s && re.set(t, e));
107
107
  }
108
- return t;
108
+ return e;
109
109
  }
110
110
  toString() {
111
111
  return this.cssText;
112
112
  }
113
113
  };
114
- const Tt = (i) => new Et(typeof i == "string" ? i : i + "", void 0, X), Ot = (i, ...t) => {
115
- const e = i.length === 1 ? i[0] : t.reduce((s, r, n) => s + ((o) => {
114
+ const Me = (i) => new be(typeof i == "string" ? i : i + "", void 0, X), Oe = (i, ...e) => {
115
+ const t = i.length === 1 ? i[0] : e.reduce((s, r, n) => s + ((o) => {
116
116
  if (o._$cssResult$ === !0)
117
117
  return o.cssText;
118
118
  if (typeof o == "number")
119
119
  return o;
120
120
  throw Error("Value passed to 'css' function must be a 'css' function result: " + o + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
121
121
  })(r) + i[n + 1], i[0]);
122
- return new Et(e, i, X);
123
- }, xt = (i, t) => {
122
+ return new be(t, i, X);
123
+ }, xe = (i, e) => {
124
124
  if (Y)
125
- i.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
125
+ i.adoptedStyleSheets = e.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet);
126
126
  else
127
- for (const e of t) {
127
+ for (const t of e) {
128
128
  const s = document.createElement("style"), r = j.litNonce;
129
- r !== void 0 && s.setAttribute("nonce", r), s.textContent = e.cssText, i.appendChild(s);
129
+ r !== void 0 && s.setAttribute("nonce", r), s.textContent = t.cssText, i.appendChild(s);
130
130
  }
131
- }, it = Y ? (i) => i : (i) => i instanceof CSSStyleSheet ? ((t) => {
132
- let e = "";
133
- for (const s of t.cssRules)
134
- e += s.cssText;
135
- return Tt(e);
131
+ }, ie = Y ? (i) => i : (i) => i instanceof CSSStyleSheet ? ((e) => {
132
+ let t = "";
133
+ for (const s of e.cssRules)
134
+ t += s.cssText;
135
+ return Me(t);
136
136
  })(i) : i;
137
137
  /**
138
138
  * @license
139
139
  * Copyright 2017 Google LLC
140
140
  * SPDX-License-Identifier: BSD-3-Clause
141
141
  */
142
- const { is: Rt, defineProperty: Nt, getOwnPropertyDescriptor: Lt, getOwnPropertyNames: Ut, getOwnPropertySymbols: Ht, getPrototypeOf: jt } = Object, A = globalThis, nt = A.trustedTypes, Dt = nt ? nt.emptyScript : "", W = A.reactiveElementPolyfillSupport, O = (i, t) => i, k = { toAttribute(i, t) {
143
- switch (t) {
142
+ const { is: Re, defineProperty: Ne, getOwnPropertyDescriptor: Le, getOwnPropertyNames: Ue, getOwnPropertySymbols: He, getPrototypeOf: je } = Object, A = globalThis, ne = A.trustedTypes, De = ne ? ne.emptyScript : "", W = A.reactiveElementPolyfillSupport, O = (i, e) => i, k = { toAttribute(i, e) {
143
+ switch (e) {
144
144
  case Boolean:
145
- i = i ? Dt : null;
145
+ i = i ? De : null;
146
146
  break;
147
147
  case Object:
148
148
  case Array:
149
149
  i = i == null ? i : JSON.stringify(i);
150
150
  }
151
151
  return i;
152
- }, fromAttribute(i, t) {
153
- let e = i;
154
- switch (t) {
152
+ }, fromAttribute(i, e) {
153
+ let t = i;
154
+ switch (e) {
155
155
  case Boolean:
156
- e = i !== null;
156
+ t = i !== null;
157
157
  break;
158
158
  case Number:
159
- e = i === null ? null : Number(i);
159
+ t = i === null ? null : Number(i);
160
160
  break;
161
161
  case Object:
162
162
  case Array:
163
163
  try {
164
- e = JSON.parse(i);
164
+ t = JSON.parse(i);
165
165
  } catch {
166
- e = null;
166
+ t = null;
167
167
  }
168
168
  }
169
- return e;
170
- } }, Q = (i, t) => !Rt(i, t), ot = { attribute: !0, type: String, converter: k, reflect: !1, useDefault: !1, hasChanged: Q };
169
+ return t;
170
+ } }, Q = (i, e) => !Re(i, e), oe = { attribute: !0, type: String, converter: k, reflect: !1, useDefault: !1, hasChanged: Q };
171
171
  Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), A.litPropertyMetadata ?? (A.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
172
172
  let S = class extends HTMLElement {
173
- static addInitializer(t) {
174
- this._$Ei(), (this.l ?? (this.l = [])).push(t);
173
+ static addInitializer(e) {
174
+ this._$Ei(), (this.l ?? (this.l = [])).push(e);
175
175
  }
176
176
  static get observedAttributes() {
177
177
  return this.finalize(), this._$Eh && [...this._$Eh.keys()];
178
178
  }
179
- static createProperty(t, e = ot) {
180
- if (e.state && (e.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((e = Object.create(e)).wrapped = !0), this.elementProperties.set(t, e), !e.noAccessor) {
181
- const s = Symbol(), r = this.getPropertyDescriptor(t, s, e);
182
- r !== void 0 && Nt(this.prototype, t, r);
179
+ static createProperty(e, t = oe) {
180
+ 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) {
181
+ const s = Symbol(), r = this.getPropertyDescriptor(e, s, t);
182
+ r !== void 0 && Ne(this.prototype, e, r);
183
183
  }
184
184
  }
185
- static getPropertyDescriptor(t, e, s) {
186
- const { get: r, set: n } = Lt(this.prototype, t) ?? { get() {
187
- return this[e];
185
+ static getPropertyDescriptor(e, t, s) {
186
+ const { get: r, set: n } = Le(this.prototype, e) ?? { get() {
187
+ return this[t];
188
188
  }, set(o) {
189
- this[e] = o;
189
+ this[t] = o;
190
190
  } };
191
191
  return { get: r, set(o) {
192
192
  const a = r == null ? void 0 : r.call(this);
193
- n == null || n.call(this, o), this.requestUpdate(t, a, s);
193
+ n == null || n.call(this, o), this.requestUpdate(e, a, s);
194
194
  }, configurable: !0, enumerable: !0 };
195
195
  }
196
- static getPropertyOptions(t) {
197
- return this.elementProperties.get(t) ?? ot;
196
+ static getPropertyOptions(e) {
197
+ return this.elementProperties.get(e) ?? oe;
198
198
  }
199
199
  static _$Ei() {
200
200
  if (this.hasOwnProperty(O("elementProperties")))
201
201
  return;
202
- const t = jt(this);
203
- t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
202
+ const e = je(this);
203
+ e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
204
204
  }
205
205
  static finalize() {
206
206
  if (this.hasOwnProperty(O("finalized")))
207
207
  return;
208
208
  if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(O("properties"))) {
209
- const e = this.properties, s = [...Ut(e), ...Ht(e)];
209
+ const t = this.properties, s = [...Ue(t), ...He(t)];
210
210
  for (const r of s)
211
- this.createProperty(r, e[r]);
211
+ this.createProperty(r, t[r]);
212
212
  }
213
- const t = this[Symbol.metadata];
214
- if (t !== null) {
215
- const e = litPropertyMetadata.get(t);
216
- if (e !== void 0)
217
- for (const [s, r] of e)
213
+ const e = this[Symbol.metadata];
214
+ if (e !== null) {
215
+ const t = litPropertyMetadata.get(e);
216
+ if (t !== void 0)
217
+ for (const [s, r] of t)
218
218
  this.elementProperties.set(s, r);
219
219
  }
220
220
  this._$Eh = /* @__PURE__ */ new Map();
221
- for (const [e, s] of this.elementProperties) {
222
- const r = this._$Eu(e, s);
223
- r !== void 0 && this._$Eh.set(r, e);
221
+ for (const [t, s] of this.elementProperties) {
222
+ const r = this._$Eu(t, s);
223
+ r !== void 0 && this._$Eh.set(r, t);
224
224
  }
225
225
  this.elementStyles = this.finalizeStyles(this.styles);
226
226
  }
227
- static finalizeStyles(t) {
228
- const e = [];
229
- if (Array.isArray(t)) {
230
- const s = new Set(t.flat(1 / 0).reverse());
227
+ static finalizeStyles(e) {
228
+ const t = [];
229
+ if (Array.isArray(e)) {
230
+ const s = new Set(e.flat(1 / 0).reverse());
231
231
  for (const r of s)
232
- e.unshift(it(r));
232
+ t.unshift(ie(r));
233
233
  } else
234
- t !== void 0 && e.push(it(t));
235
- return e;
234
+ e !== void 0 && t.push(ie(e));
235
+ return t;
236
236
  }
237
- static _$Eu(t, e) {
238
- const s = e.attribute;
239
- return s === !1 ? void 0 : typeof s == "string" ? s : typeof t == "string" ? t.toLowerCase() : void 0;
237
+ static _$Eu(e, t) {
238
+ const s = t.attribute;
239
+ return s === !1 ? void 0 : typeof s == "string" ? s : typeof e == "string" ? e.toLowerCase() : void 0;
240
240
  }
241
241
  constructor() {
242
242
  super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
243
243
  }
244
244
  _$Ev() {
245
- var t;
246
- this._$ES = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (t = this.constructor.l) == null || t.forEach((e) => e(this));
247
- }
248
- addController(t) {
249
245
  var e;
250
- (this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(t), this.renderRoot !== void 0 && this.isConnected && ((e = t.hostConnected) == null || e.call(t));
246
+ this._$ES = new Promise((t) => this.enableUpdating = t), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (e = this.constructor.l) == null || e.forEach((t) => t(this));
251
247
  }
252
- removeController(t) {
253
- var e;
254
- (e = this._$EO) == null || e.delete(t);
248
+ addController(e) {
249
+ var t;
250
+ (this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(e), this.renderRoot !== void 0 && this.isConnected && ((t = e.hostConnected) == null || t.call(e));
251
+ }
252
+ removeController(e) {
253
+ var t;
254
+ (t = this._$EO) == null || t.delete(e);
255
255
  }
256
256
  _$E_() {
257
- const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
258
- for (const s of e.keys())
259
- this.hasOwnProperty(s) && (t.set(s, this[s]), delete this[s]);
260
- t.size > 0 && (this._$Ep = t);
257
+ const e = /* @__PURE__ */ new Map(), t = this.constructor.elementProperties;
258
+ for (const s of t.keys())
259
+ this.hasOwnProperty(s) && (e.set(s, this[s]), delete this[s]);
260
+ e.size > 0 && (this._$Ep = e);
261
261
  }
262
262
  createRenderRoot() {
263
- const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
264
- return xt(t, this.constructor.elementStyles), t;
263
+ const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
264
+ return xe(e, this.constructor.elementStyles), e;
265
265
  }
266
266
  connectedCallback() {
267
- var t;
268
- this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$EO) == null || t.forEach((e) => {
267
+ var e;
268
+ this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (e = this._$EO) == null || e.forEach((t) => {
269
269
  var s;
270
- return (s = e.hostConnected) == null ? void 0 : s.call(e);
270
+ return (s = t.hostConnected) == null ? void 0 : s.call(t);
271
271
  });
272
272
  }
273
- enableUpdating(t) {
273
+ enableUpdating(e) {
274
274
  }
275
275
  disconnectedCallback() {
276
- var t;
277
- (t = this._$EO) == null || t.forEach((e) => {
276
+ var e;
277
+ (e = this._$EO) == null || e.forEach((t) => {
278
278
  var s;
279
- return (s = e.hostDisconnected) == null ? void 0 : s.call(e);
279
+ return (s = t.hostDisconnected) == null ? void 0 : s.call(t);
280
280
  });
281
281
  }
282
- attributeChangedCallback(t, e, s) {
283
- this._$AK(t, s);
282
+ attributeChangedCallback(e, t, s) {
283
+ this._$AK(e, s);
284
284
  }
285
- _$ET(t, e) {
285
+ _$ET(e, t) {
286
286
  var n;
287
- const s = this.constructor.elementProperties.get(t), r = this.constructor._$Eu(t, s);
287
+ const s = this.constructor.elementProperties.get(e), r = this.constructor._$Eu(e, s);
288
288
  if (r !== void 0 && s.reflect === !0) {
289
- const o = (((n = s.converter) == null ? void 0 : n.toAttribute) !== void 0 ? s.converter : k).toAttribute(e, s.type);
290
- this._$Em = t, o == null ? this.removeAttribute(r) : this.setAttribute(r, o), this._$Em = null;
289
+ const o = (((n = s.converter) == null ? void 0 : n.toAttribute) !== void 0 ? s.converter : k).toAttribute(t, s.type);
290
+ this._$Em = e, o == null ? this.removeAttribute(r) : this.setAttribute(r, o), this._$Em = null;
291
291
  }
292
292
  }
293
- _$AK(t, e) {
293
+ _$AK(e, t) {
294
294
  var n, o;
295
- const s = this.constructor, r = s._$Eh.get(t);
295
+ const s = this.constructor, r = s._$Eh.get(e);
296
296
  if (r !== void 0 && this._$Em !== r) {
297
297
  const a = s.getPropertyOptions(r), h = typeof a.converter == "function" ? { fromAttribute: a.converter } : ((n = a.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? a.converter : k;
298
298
  this._$Em = r;
299
- const c = h.fromAttribute(e, a.type);
299
+ const c = h.fromAttribute(t, a.type);
300
300
  this[r] = c ?? ((o = this._$Ej) == null ? void 0 : o.get(r)) ?? c, this._$Em = null;
301
301
  }
302
302
  }
303
- requestUpdate(t, e, s, r = !1, n) {
303
+ requestUpdate(e, t, s, r = !1, n) {
304
304
  var o;
305
- if (t !== void 0) {
305
+ if (e !== void 0) {
306
306
  const a = this.constructor;
307
- if (r === !1 && (n = this[t]), s ?? (s = a.getPropertyOptions(t)), !((s.hasChanged ?? Q)(n, e) || s.useDefault && s.reflect && n === ((o = this._$Ej) == null ? void 0 : o.get(t)) && !this.hasAttribute(a._$Eu(t, s))))
307
+ if (r === !1 && (n = this[e]), s ?? (s = a.getPropertyOptions(e)), !((s.hasChanged ?? Q)(n, t) || s.useDefault && s.reflect && n === ((o = this._$Ej) == null ? void 0 : o.get(e)) && !this.hasAttribute(a._$Eu(e, s))))
308
308
  return;
309
- this.C(t, e, s);
309
+ this.C(e, t, s);
310
310
  }
311
311
  this.isUpdatePending === !1 && (this._$ES = this._$EP());
312
312
  }
313
- C(t, e, { useDefault: s, reflect: r, wrapped: n }, o) {
314
- s && !(this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Map())).has(t) && (this._$Ej.set(t, o ?? e ?? this[t]), n !== !0 || o !== void 0) || (this._$AL.has(t) || (this.hasUpdated || s || (e = void 0), this._$AL.set(t, e)), r === !0 && this._$Em !== t && (this._$Eq ?? (this._$Eq = /* @__PURE__ */ new Set())).add(t));
313
+ C(e, t, { useDefault: s, reflect: r, wrapped: n }, o) {
314
+ s && !(this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Map())).has(e) && (this._$Ej.set(e, o ?? t ?? this[e]), n !== !0 || o !== void 0) || (this._$AL.has(e) || (this.hasUpdated || s || (t = void 0), this._$AL.set(e, t)), r === !0 && this._$Em !== e && (this._$Eq ?? (this._$Eq = /* @__PURE__ */ new Set())).add(e));
315
315
  }
316
316
  async _$EP() {
317
317
  this.isUpdatePending = !0;
318
318
  try {
319
319
  await this._$ES;
320
- } catch (e) {
321
- Promise.reject(e);
320
+ } catch (t) {
321
+ Promise.reject(t);
322
322
  }
323
- const t = this.scheduleUpdate();
324
- return t != null && await t, !this.isUpdatePending;
323
+ const e = this.scheduleUpdate();
324
+ return e != null && await e, !this.isUpdatePending;
325
325
  }
326
326
  scheduleUpdate() {
327
327
  return this.performUpdate();
@@ -343,26 +343,26 @@ let S = class extends HTMLElement {
343
343
  a !== !0 || this._$AL.has(n) || h === void 0 || this.C(n, void 0, o, h);
344
344
  }
345
345
  }
346
- let t = !1;
347
- const e = this._$AL;
346
+ let e = !1;
347
+ const t = this._$AL;
348
348
  try {
349
- t = this.shouldUpdate(e), t ? (this.willUpdate(e), (s = this._$EO) == null || s.forEach((r) => {
349
+ e = this.shouldUpdate(t), e ? (this.willUpdate(t), (s = this._$EO) == null || s.forEach((r) => {
350
350
  var n;
351
351
  return (n = r.hostUpdate) == null ? void 0 : n.call(r);
352
- }), this.update(e)) : this._$EM();
352
+ }), this.update(t)) : this._$EM();
353
353
  } catch (r) {
354
- throw t = !1, this._$EM(), r;
354
+ throw e = !1, this._$EM(), r;
355
355
  }
356
- t && this._$AE(e);
356
+ e && this._$AE(t);
357
357
  }
358
- willUpdate(t) {
358
+ willUpdate(e) {
359
359
  }
360
- _$AE(t) {
361
- var e;
362
- (e = this._$EO) == null || e.forEach((s) => {
360
+ _$AE(e) {
361
+ var t;
362
+ (t = this._$EO) == null || t.forEach((s) => {
363
363
  var r;
364
364
  return (r = s.hostUpdated) == null ? void 0 : r.call(s);
365
- }), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
365
+ }), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e);
366
366
  }
367
367
  _$EM() {
368
368
  this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
@@ -373,15 +373,15 @@ let S = class extends HTMLElement {
373
373
  getUpdateComplete() {
374
374
  return this._$ES;
375
375
  }
376
- shouldUpdate(t) {
376
+ shouldUpdate(e) {
377
377
  return !0;
378
378
  }
379
- update(t) {
380
- this._$Eq && (this._$Eq = this._$Eq.forEach((e) => this._$ET(e, this[e]))), this._$EM();
379
+ update(e) {
380
+ this._$Eq && (this._$Eq = this._$Eq.forEach((t) => this._$ET(t, this[t]))), this._$EM();
381
381
  }
382
- updated(t) {
382
+ updated(e) {
383
383
  }
384
- firstUpdated(t) {
384
+ firstUpdated(e) {
385
385
  }
386
386
  };
387
387
  S.elementStyles = [], S.shadowRootOptions = { mode: "open" }, S[O("elementProperties")] = /* @__PURE__ */ new Map(), S[O("finalized")] = /* @__PURE__ */ new Map(), W == null || W({ ReactiveElement: S }), (A.reactiveElementVersions ?? (A.reactiveElementVersions = [])).push("2.1.2");
@@ -390,34 +390,34 @@ S.elementStyles = [], S.shadowRootOptions = { mode: "open" }, S[O("elementProper
390
390
  * Copyright 2017 Google LLC
391
391
  * SPDX-License-Identifier: BSD-3-Clause
392
392
  */
393
- const x = globalThis, at = (i) => i, I = x.trustedTypes, ht = I ? I.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, bt = "$lit$", g = `lit$${Math.random().toFixed(9).slice(2)}$`, _t = "?" + g, kt = `<${_t}>`, C = document, R = () => C.createComment(""), N = (i) => i === null || typeof i != "object" && typeof i != "function", tt = Array.isArray, It = (i) => tt(i) || typeof (i == null ? void 0 : i[Symbol.iterator]) == "function", q = `[
394
- \f\r]`, T = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ct = /-->/g, lt = />/g, b = RegExp(`>|${q}(?:([^\\s"'>=/]+)(${q}*=${q}*(?:[^
395
- \f\r"'\`<>=]|("|')|))|$)`, "g"), dt = /'/g, ut = /"/g, vt = /^(?:script|style|textarea|title)$/i, Bt = (i) => (t, ...e) => ({ _$litType$: i, strings: t, values: e }), et = Bt(1), P = Symbol.for("lit-noChange"), u = Symbol.for("lit-nothing"), pt = /* @__PURE__ */ new WeakMap(), _ = C.createTreeWalker(C, 129);
396
- function wt(i, t) {
397
- if (!tt(i) || !i.hasOwnProperty("raw"))
393
+ const x = globalThis, ae = (i) => i, I = x.trustedTypes, he = I ? I.createPolicy("lit-html", { createHTML: (i) => i }) : void 0, Ee = "$lit$", g = `lit$${Math.random().toFixed(9).slice(2)}$`, _e = "?" + g, ke = `<${_e}>`, C = document, R = () => C.createComment(""), N = (i) => i === null || typeof i != "object" && typeof i != "function", ee = Array.isArray, Ie = (i) => ee(i) || typeof (i == null ? void 0 : i[Symbol.iterator]) == "function", q = `[
394
+ \f\r]`, M = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ce = /-->/g, le = />/g, E = RegExp(`>|${q}(?:([^\\s"'>=/]+)(${q}*=${q}*(?:[^
395
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), de = /'/g, ue = /"/g, ve = /^(?:script|style|textarea|title)$/i, Be = (i) => (e, ...t) => ({ _$litType$: i, strings: e, values: t }), te = Be(1), P = Symbol.for("lit-noChange"), u = Symbol.for("lit-nothing"), pe = /* @__PURE__ */ new WeakMap(), _ = C.createTreeWalker(C, 129);
396
+ function we(i, e) {
397
+ if (!ee(i) || !i.hasOwnProperty("raw"))
398
398
  throw Error("invalid template strings array");
399
- return ht !== void 0 ? ht.createHTML(t) : t;
399
+ return he !== void 0 ? he.createHTML(e) : e;
400
400
  }
401
- const Gt = (i, t) => {
402
- const e = i.length - 1, s = [];
403
- let r, n = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = T;
404
- for (let a = 0; a < e; a++) {
401
+ const Ge = (i, e) => {
402
+ const t = i.length - 1, s = [];
403
+ let r, n = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", o = M;
404
+ for (let a = 0; a < t; a++) {
405
405
  const h = i[a];
406
406
  let c, d, l = -1, m = 0;
407
407
  for (; m < h.length && (o.lastIndex = m, d = o.exec(h), d !== null); )
408
- m = o.lastIndex, o === T ? d[1] === "!--" ? o = ct : d[1] !== void 0 ? o = lt : d[2] !== void 0 ? (vt.test(d[2]) && (r = RegExp("</" + d[2], "g")), o = b) : d[3] !== void 0 && (o = b) : o === b ? d[0] === ">" ? (o = r ?? T, l = -1) : d[1] === void 0 ? l = -2 : (l = o.lastIndex - d[2].length, c = d[1], o = d[3] === void 0 ? b : d[3] === '"' ? ut : dt) : o === ut || o === dt ? o = b : o === ct || o === lt ? o = T : (o = b, r = void 0);
409
- const $ = o === b && i[a + 1].startsWith("/>") ? " " : "";
410
- n += o === T ? h + kt : l >= 0 ? (s.push(c), h.slice(0, l) + bt + h.slice(l) + g + $) : h + g + (l === -2 ? a : $);
408
+ m = o.lastIndex, o === M ? d[1] === "!--" ? o = ce : d[1] !== void 0 ? o = le : d[2] !== void 0 ? (ve.test(d[2]) && (r = RegExp("</" + d[2], "g")), o = E) : d[3] !== void 0 && (o = E) : o === E ? d[0] === ">" ? (o = r ?? M, l = -1) : d[1] === void 0 ? l = -2 : (l = o.lastIndex - d[2].length, c = d[1], o = d[3] === void 0 ? E : d[3] === '"' ? ue : de) : o === ue || o === de ? o = E : o === ce || o === le ? o = M : (o = E, r = void 0);
409
+ const $ = o === E && i[a + 1].startsWith("/>") ? " " : "";
410
+ n += o === M ? h + ke : l >= 0 ? (s.push(c), h.slice(0, l) + Ee + h.slice(l) + g + $) : h + g + (l === -2 ? a : $);
411
411
  }
412
- return [wt(i, n + (i[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
412
+ return [we(i, n + (i[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), s];
413
413
  };
414
414
  class L {
415
- constructor({ strings: t, _$litType$: e }, s) {
415
+ constructor({ strings: e, _$litType$: t }, s) {
416
416
  let r;
417
417
  this.parts = [];
418
418
  let n = 0, o = 0;
419
- const a = t.length - 1, h = this.parts, [c, d] = Gt(t, e);
420
- if (this.el = L.createElement(c, s), _.currentNode = this.el.content, e === 2 || e === 3) {
419
+ const a = e.length - 1, h = this.parts, [c, d] = Ge(e, t);
420
+ if (this.el = L.createElement(c, s), _.currentNode = this.el.content, t === 2 || t === 3) {
421
421
  const l = this.el.content.firstChild;
422
422
  l.replaceWith(...l.childNodes);
423
423
  }
@@ -425,12 +425,12 @@ class L {
425
425
  if (r.nodeType === 1) {
426
426
  if (r.hasAttributes())
427
427
  for (const l of r.getAttributeNames())
428
- if (l.endsWith(bt)) {
428
+ if (l.endsWith(Ee)) {
429
429
  const m = d[o++], $ = r.getAttribute(l).split(g), H = /([.?@])?(.*)/.exec(m);
430
- h.push({ type: 1, index: n, name: H[2], strings: $, ctor: H[1] === "." ? Wt : H[1] === "?" ? qt : H[1] === "@" ? Ft : z }), r.removeAttribute(l);
430
+ h.push({ type: 1, index: n, name: H[2], strings: $, ctor: H[1] === "." ? We : H[1] === "?" ? qe : H[1] === "@" ? Fe : z }), r.removeAttribute(l);
431
431
  } else
432
432
  l.startsWith(g) && (h.push({ type: 6, index: n }), r.removeAttribute(l));
433
- if (vt.test(r.tagName)) {
433
+ if (ve.test(r.tagName)) {
434
434
  const l = r.textContent.split(g), m = l.length - 1;
435
435
  if (m > 0) {
436
436
  r.textContent = I ? I.emptyScript : "";
@@ -440,7 +440,7 @@ class L {
440
440
  }
441
441
  }
442
442
  } else if (r.nodeType === 8)
443
- if (r.data === _t)
443
+ if (r.data === _e)
444
444
  h.push({ type: 2, index: n });
445
445
  else {
446
446
  let l = -1;
@@ -450,22 +450,22 @@ class L {
450
450
  n++;
451
451
  }
452
452
  }
453
- static createElement(t, e) {
453
+ static createElement(e, t) {
454
454
  const s = C.createElement("template");
455
- return s.innerHTML = t, s;
455
+ return s.innerHTML = e, s;
456
456
  }
457
457
  }
458
- function M(i, t, e = i, s) {
458
+ function T(i, e, t = i, s) {
459
459
  var o, a;
460
- if (t === P)
461
- return t;
462
- let r = s !== void 0 ? (o = e._$Co) == null ? void 0 : o[s] : e._$Cl;
463
- const n = N(t) ? void 0 : t._$litDirective$;
464
- return (r == null ? void 0 : r.constructor) !== n && ((a = r == null ? void 0 : r._$AO) == null || a.call(r, !1), n === void 0 ? r = void 0 : (r = new n(i), r._$AT(i, e, s)), s !== void 0 ? (e._$Co ?? (e._$Co = []))[s] = r : e._$Cl = r), r !== void 0 && (t = M(i, r._$AS(i, t.values), r, s)), t;
460
+ if (e === P)
461
+ return e;
462
+ let r = s !== void 0 ? (o = t._$Co) == null ? void 0 : o[s] : t._$Cl;
463
+ const n = N(e) ? void 0 : e._$litDirective$;
464
+ return (r == null ? void 0 : r.constructor) !== n && ((a = r == null ? void 0 : r._$AO) == null || a.call(r, !1), n === void 0 ? r = void 0 : (r = new n(i), r._$AT(i, t, s)), s !== void 0 ? (t._$Co ?? (t._$Co = []))[s] = r : t._$Cl = r), r !== void 0 && (e = T(i, r._$AS(i, e.values), r, s)), e;
465
465
  }
466
- class zt {
467
- constructor(t, e) {
468
- this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
466
+ class ze {
467
+ constructor(e, t) {
468
+ this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t;
469
469
  }
470
470
  get parentNode() {
471
471
  return this._$AM.parentNode;
@@ -473,37 +473,37 @@ class zt {
473
473
  get _$AU() {
474
474
  return this._$AM._$AU;
475
475
  }
476
- u(t) {
477
- const { el: { content: e }, parts: s } = this._$AD, r = ((t == null ? void 0 : t.creationScope) ?? C).importNode(e, !0);
476
+ u(e) {
477
+ const { el: { content: t }, parts: s } = this._$AD, r = ((e == null ? void 0 : e.creationScope) ?? C).importNode(t, !0);
478
478
  _.currentNode = r;
479
479
  let n = _.nextNode(), o = 0, a = 0, h = s[0];
480
480
  for (; h !== void 0; ) {
481
481
  if (o === h.index) {
482
482
  let c;
483
- h.type === 2 ? c = new U(n, n.nextSibling, this, t) : h.type === 1 ? c = new h.ctor(n, h.name, h.strings, this, t) : h.type === 6 && (c = new Vt(n, this, t)), this._$AV.push(c), h = s[++a];
483
+ h.type === 2 ? c = new U(n, n.nextSibling, this, e) : h.type === 1 ? c = new h.ctor(n, h.name, h.strings, this, e) : h.type === 6 && (c = new Ve(n, this, e)), this._$AV.push(c), h = s[++a];
484
484
  }
485
485
  o !== (h == null ? void 0 : h.index) && (n = _.nextNode(), o++);
486
486
  }
487
487
  return _.currentNode = C, r;
488
488
  }
489
- p(t) {
490
- let e = 0;
489
+ p(e) {
490
+ let t = 0;
491
491
  for (const s of this._$AV)
492
- s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, e), e += s.strings.length - 2) : s._$AI(t[e])), e++;
492
+ s !== void 0 && (s.strings !== void 0 ? (s._$AI(e, s, t), t += s.strings.length - 2) : s._$AI(e[t])), t++;
493
493
  }
494
494
  }
495
495
  class U {
496
496
  get _$AU() {
497
- var t;
498
- return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
497
+ var e;
498
+ return ((e = this._$AM) == null ? void 0 : e._$AU) ?? this._$Cv;
499
499
  }
500
- constructor(t, e, s, r) {
501
- this.type = 2, this._$AH = u, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = r, this._$Cv = (r == null ? void 0 : r.isConnected) ?? !0;
500
+ constructor(e, t, s, r) {
501
+ this.type = 2, this._$AH = u, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = s, this.options = r, this._$Cv = (r == null ? void 0 : r.isConnected) ?? !0;
502
502
  }
503
503
  get parentNode() {
504
- let t = this._$AA.parentNode;
505
- const e = this._$AM;
506
- return e !== void 0 && (t == null ? void 0 : t.nodeType) === 11 && (t = e.parentNode), t;
504
+ let e = this._$AA.parentNode;
505
+ const t = this._$AM;
506
+ return t !== void 0 && (e == null ? void 0 : e.nodeType) === 11 && (e = t.parentNode), e;
507
507
  }
508
508
  get startNode() {
509
509
  return this._$AA;
@@ -511,50 +511,50 @@ class U {
511
511
  get endNode() {
512
512
  return this._$AB;
513
513
  }
514
- _$AI(t, e = this) {
515
- t = M(this, t, e), N(t) ? t === u || t == null || t === "" ? (this._$AH !== u && this._$AR(), this._$AH = u) : t !== this._$AH && t !== P && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : It(t) ? this.k(t) : this._(t);
514
+ _$AI(e, t = this) {
515
+ e = T(this, e, t), N(e) ? e === u || e == null || e === "" ? (this._$AH !== u && this._$AR(), this._$AH = u) : e !== this._$AH && e !== P && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Ie(e) ? this.k(e) : this._(e);
516
516
  }
517
- O(t) {
518
- return this._$AA.parentNode.insertBefore(t, this._$AB);
517
+ O(e) {
518
+ return this._$AA.parentNode.insertBefore(e, this._$AB);
519
519
  }
520
- T(t) {
521
- this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
520
+ T(e) {
521
+ this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
522
522
  }
523
- _(t) {
524
- this._$AH !== u && N(this._$AH) ? this._$AA.nextSibling.data = t : this.T(C.createTextNode(t)), this._$AH = t;
523
+ _(e) {
524
+ this._$AH !== u && N(this._$AH) ? this._$AA.nextSibling.data = e : this.T(C.createTextNode(e)), this._$AH = e;
525
525
  }
526
- $(t) {
526
+ $(e) {
527
527
  var n;
528
- const { values: e, _$litType$: s } = t, r = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = L.createElement(wt(s.h, s.h[0]), this.options)), s);
528
+ const { values: t, _$litType$: s } = e, r = typeof s == "number" ? this._$AC(e) : (s.el === void 0 && (s.el = L.createElement(we(s.h, s.h[0]), this.options)), s);
529
529
  if (((n = this._$AH) == null ? void 0 : n._$AD) === r)
530
- this._$AH.p(e);
530
+ this._$AH.p(t);
531
531
  else {
532
- const o = new zt(r, this), a = o.u(this.options);
533
- o.p(e), this.T(a), this._$AH = o;
532
+ const o = new ze(r, this), a = o.u(this.options);
533
+ o.p(t), this.T(a), this._$AH = o;
534
534
  }
535
535
  }
536
- _$AC(t) {
537
- let e = pt.get(t.strings);
538
- return e === void 0 && pt.set(t.strings, e = new L(t)), e;
536
+ _$AC(e) {
537
+ let t = pe.get(e.strings);
538
+ return t === void 0 && pe.set(e.strings, t = new L(e)), t;
539
539
  }
540
- k(t) {
541
- tt(this._$AH) || (this._$AH = [], this._$AR());
542
- const e = this._$AH;
540
+ k(e) {
541
+ ee(this._$AH) || (this._$AH = [], this._$AR());
542
+ const t = this._$AH;
543
543
  let s, r = 0;
544
- for (const n of t)
545
- r === e.length ? e.push(s = new U(this.O(R()), this.O(R()), this, this.options)) : s = e[r], s._$AI(n), r++;
546
- r < e.length && (this._$AR(s && s._$AB.nextSibling, r), e.length = r);
544
+ for (const n of e)
545
+ r === t.length ? t.push(s = new U(this.O(R()), this.O(R()), this, this.options)) : s = t[r], s._$AI(n), r++;
546
+ r < t.length && (this._$AR(s && s._$AB.nextSibling, r), t.length = r);
547
547
  }
548
- _$AR(t = this._$AA.nextSibling, e) {
548
+ _$AR(e = this._$AA.nextSibling, t) {
549
549
  var s;
550
- for ((s = this._$AP) == null ? void 0 : s.call(this, !1, !0, e); t !== this._$AB; ) {
551
- const r = at(t).nextSibling;
552
- at(t).remove(), t = r;
550
+ for ((s = this._$AP) == null ? void 0 : s.call(this, !1, !0, t); e !== this._$AB; ) {
551
+ const r = ae(e).nextSibling;
552
+ ae(e).remove(), e = r;
553
553
  }
554
554
  }
555
- setConnected(t) {
556
- var e;
557
- this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t));
555
+ setConnected(e) {
556
+ var t;
557
+ this._$AM === void 0 && (this._$Cv = e, (t = this._$AP) == null || t.call(this, e));
558
558
  }
559
559
  }
560
560
  class z {
@@ -564,76 +564,76 @@ class z {
564
564
  get _$AU() {
565
565
  return this._$AM._$AU;
566
566
  }
567
- constructor(t, e, s, r, n) {
568
- this.type = 1, this._$AH = u, this._$AN = void 0, this.element = t, this.name = e, this._$AM = r, this.options = n, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = u;
567
+ constructor(e, t, s, r, n) {
568
+ this.type = 1, this._$AH = u, this._$AN = void 0, this.element = e, this.name = t, this._$AM = r, this.options = n, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = u;
569
569
  }
570
- _$AI(t, e = this, s, r) {
570
+ _$AI(e, t = this, s, r) {
571
571
  const n = this.strings;
572
572
  let o = !1;
573
573
  if (n === void 0)
574
- t = M(this, t, e, 0), o = !N(t) || t !== this._$AH && t !== P, o && (this._$AH = t);
574
+ e = T(this, e, t, 0), o = !N(e) || e !== this._$AH && e !== P, o && (this._$AH = e);
575
575
  else {
576
- const a = t;
576
+ const a = e;
577
577
  let h, c;
578
- for (t = n[0], h = 0; h < n.length - 1; h++)
579
- c = M(this, a[s + h], e, h), c === P && (c = this._$AH[h]), o || (o = !N(c) || c !== this._$AH[h]), c === u ? t = u : t !== u && (t += (c ?? "") + n[h + 1]), this._$AH[h] = c;
578
+ for (e = n[0], h = 0; h < n.length - 1; h++)
579
+ c = T(this, a[s + h], t, h), c === P && (c = this._$AH[h]), o || (o = !N(c) || c !== this._$AH[h]), c === u ? e = u : e !== u && (e += (c ?? "") + n[h + 1]), this._$AH[h] = c;
580
580
  }
581
- o && !r && this.j(t);
581
+ o && !r && this.j(e);
582
582
  }
583
- j(t) {
584
- t === u ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
583
+ j(e) {
584
+ e === u ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
585
585
  }
586
586
  }
587
- class Wt extends z {
587
+ class We extends z {
588
588
  constructor() {
589
589
  super(...arguments), this.type = 3;
590
590
  }
591
- j(t) {
592
- this.element[this.name] = t === u ? void 0 : t;
591
+ j(e) {
592
+ this.element[this.name] = e === u ? void 0 : e;
593
593
  }
594
594
  }
595
- class qt extends z {
595
+ class qe extends z {
596
596
  constructor() {
597
597
  super(...arguments), this.type = 4;
598
598
  }
599
- j(t) {
600
- this.element.toggleAttribute(this.name, !!t && t !== u);
599
+ j(e) {
600
+ this.element.toggleAttribute(this.name, !!e && e !== u);
601
601
  }
602
602
  }
603
- class Ft extends z {
604
- constructor(t, e, s, r, n) {
605
- super(t, e, s, r, n), this.type = 5;
603
+ class Fe extends z {
604
+ constructor(e, t, s, r, n) {
605
+ super(e, t, s, r, n), this.type = 5;
606
606
  }
607
- _$AI(t, e = this) {
608
- if ((t = M(this, t, e, 0) ?? u) === P)
607
+ _$AI(e, t = this) {
608
+ if ((e = T(this, e, t, 0) ?? u) === P)
609
609
  return;
610
- const s = this._$AH, r = t === u && s !== u || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, n = t !== u && (s === u || r);
611
- r && this.element.removeEventListener(this.name, this, s), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
610
+ const s = this._$AH, r = e === u && s !== u || e.capture !== s.capture || e.once !== s.once || e.passive !== s.passive, n = e !== u && (s === u || r);
611
+ r && this.element.removeEventListener(this.name, this, s), n && this.element.addEventListener(this.name, this, e), this._$AH = e;
612
612
  }
613
- handleEvent(t) {
614
- var e;
615
- typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
613
+ handleEvent(e) {
614
+ var t;
615
+ typeof this._$AH == "function" ? this._$AH.call(((t = this.options) == null ? void 0 : t.host) ?? this.element, e) : this._$AH.handleEvent(e);
616
616
  }
617
617
  }
618
- class Vt {
619
- constructor(t, e, s) {
620
- this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
618
+ class Ve {
619
+ constructor(e, t, s) {
620
+ this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = s;
621
621
  }
622
622
  get _$AU() {
623
623
  return this._$AM._$AU;
624
624
  }
625
- _$AI(t) {
626
- M(this, t);
625
+ _$AI(e) {
626
+ T(this, e);
627
627
  }
628
628
  }
629
629
  const F = x.litHtmlPolyfillSupport;
630
630
  F == null || F(L, U), (x.litHtmlVersions ?? (x.litHtmlVersions = [])).push("3.3.2");
631
- const Jt = (i, t, e) => {
632
- const s = (e == null ? void 0 : e.renderBefore) ?? t;
631
+ const Je = (i, e, t) => {
632
+ const s = (t == null ? void 0 : t.renderBefore) ?? e;
633
633
  let r = s._$litPart$;
634
634
  if (r === void 0) {
635
- const n = (e == null ? void 0 : e.renderBefore) ?? null;
636
- s._$litPart$ = r = new U(t.insertBefore(R(), n), n, void 0, e ?? {});
635
+ const n = (t == null ? void 0 : t.renderBefore) ?? null;
636
+ s._$litPart$ = r = new U(e.insertBefore(R(), n), n, void 0, t ?? {});
637
637
  }
638
638
  return r._$AI(i), r;
639
639
  };
@@ -648,182 +648,182 @@ class w extends S {
648
648
  super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
649
649
  }
650
650
  createRenderRoot() {
651
- var e;
652
- const t = super.createRenderRoot();
653
- return (e = this.renderOptions).renderBefore ?? (e.renderBefore = t.firstChild), t;
651
+ var t;
652
+ const e = super.createRenderRoot();
653
+ return (t = this.renderOptions).renderBefore ?? (t.renderBefore = e.firstChild), e;
654
654
  }
655
- update(t) {
656
- const e = this.render();
657
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Jt(e, this.renderRoot, this.renderOptions);
655
+ update(e) {
656
+ const t = this.render();
657
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = Je(t, this.renderRoot, this.renderOptions);
658
658
  }
659
659
  connectedCallback() {
660
- var t;
661
- super.connectedCallback(), (t = this._$Do) == null || t.setConnected(!0);
660
+ var e;
661
+ super.connectedCallback(), (e = this._$Do) == null || e.setConnected(!0);
662
662
  }
663
663
  disconnectedCallback() {
664
- var t;
665
- super.disconnectedCallback(), (t = this._$Do) == null || t.setConnected(!1);
664
+ var e;
665
+ super.disconnectedCallback(), (e = this._$Do) == null || e.setConnected(!1);
666
666
  }
667
667
  render() {
668
668
  return P;
669
669
  }
670
670
  }
671
- var gt;
672
- w._$litElement$ = !0, w.finalized = !0, (gt = v.litElementHydrateSupport) == null || gt.call(v, { LitElement: w });
671
+ var ge;
672
+ w._$litElement$ = !0, w.finalized = !0, (ge = v.litElementHydrateSupport) == null || ge.call(v, { LitElement: w });
673
673
  const V = v.litElementPolyfillSupport;
674
674
  V == null || V({ LitElement: w });
675
675
  (v.litElementVersions ?? (v.litElementVersions = [])).push("4.2.2");
676
- const Zt = (i, t, e) => {
677
- if (!t)
676
+ const Ze = (i, e, t) => {
677
+ if (!e)
678
678
  return;
679
- const s = Array.isArray(t) ? t : t.match(/([^[.\]])+/g), r = s == null ? void 0 : s.reduce(
679
+ const s = Array.isArray(e) ? e : e.match(/([^[.\]])+/g), r = s == null ? void 0 : s.reduce(
680
680
  (n, o) => n && n[o],
681
681
  i
682
682
  );
683
- return r === void 0 ? e : r;
683
+ return r === void 0 ? t : r;
684
684
  };
685
- function Kt(i) {
685
+ function Ke(i) {
686
686
  if (!i)
687
687
  return !1;
688
- const t = i.constructor && i.constructor.toString().substring(0, 5) === "class";
688
+ const e = i.constructor && i.constructor.toString().substring(0, 5) === "class";
689
689
  if (i.prototype === void 0)
690
- return t;
691
- const e = i.prototype.constructor && i.prototype.constructor.toString && i.prototype.constructor.toString().substring(0, 5) === "class";
692
- return t || e;
690
+ return e;
691
+ const t = i.prototype.constructor && i.prototype.constructor.toString && i.prototype.constructor.toString().substring(0, 5) === "class";
692
+ return e || t;
693
693
  }
694
- const Yt = () => {
695
- const i = "[object Number]", e = Object.prototype.toString;
694
+ const Ye = () => {
695
+ const i = "[object Number]", t = Object.prototype.toString;
696
696
  function s(n) {
697
697
  return !!n && typeof n == "object";
698
698
  }
699
699
  return function(o) {
700
- return typeof o == "number" || s(o) && e.call(o) == i;
700
+ return typeof o == "number" || s(o) && t.call(o) == i;
701
701
  };
702
- }, Xt = Yt(), Qt = (i, t, e) => {
703
- const s = Array.isArray(t) ? t : t.match(/([^[.\]])+/g);
704
- s == null || s.reduce((r, n, o) => (r[n] === void 0 && (r[n] = {}), o === s.length - 1 && (r[n] = e), r[n]), i);
705
- }, Ct = "data-three-uuid", mt = (i) => {
706
- var e, s, r;
707
- let t = i.parentNode;
708
- for (; t && !(t != null && t.instance) && !((e = t == null ? void 0 : t.three) != null && e.scene); )
709
- t = (t == null ? void 0 : t.parentNode) || (t == null ? void 0 : t.host) || ((r = (s = t.getRootNode) == null ? void 0 : s.call(t)) == null ? void 0 : r.host);
710
- return t;
702
+ }, Xe = Ye(), Qe = (i, e, t) => {
703
+ const s = Array.isArray(e) ? e : e.match(/([^[.\]])+/g);
704
+ s == null || s.reduce((r, n, o) => (r[n] === void 0 && (r[n] = {}), o === s.length - 1 && (r[n] = t), r[n]), i);
705
+ }, Ce = "data-three-uuid", me = (i) => {
706
+ var t, s, r;
707
+ let e = i.parentNode;
708
+ for (; e && !(e != null && e.instance) && !((t = e == null ? void 0 : e.three) != null && t.scene); )
709
+ e = (e == null ? void 0 : e.parentNode) || (e == null ? void 0 : e.host) || ((r = (s = e.getRootNode) == null ? void 0 : s.call(e)) == null ? void 0 : r.host);
710
+ return e;
711
711
  };
712
- function D(i, t) {
713
- return i ? i instanceof ShadowRoot ? D(i.host, t) : i instanceof HTMLElement && (typeof t == "string" && i.matches(t) || typeof t == "function" && t(i)) ? i : D(i.parentNode, t) : null;
712
+ function D(i, e) {
713
+ return i ? i instanceof ShadowRoot ? D(i.host, e) : i instanceof HTMLElement && (typeof e == "string" && i.matches(e) || typeof e == "function" && e(i)) ? i : D(i.parentNode, e) : null;
714
714
  }
715
- const Z = (i, t, e) => {
715
+ const Z = (i, e, t) => {
716
716
  var n, o;
717
- const s = Zt(i, t);
718
- if (Xt(e) && (s != null && s.setScalar))
719
- s.setScalar(+e);
717
+ const s = Ze(i, e);
718
+ if (Xe(t) && (s != null && s.setScalar))
719
+ s.setScalar(+t);
720
720
  else if (s != null && s.set)
721
- if (typeof e == "string") {
722
- const a = e.split(","), h = a.every((c) => !c.match(/^[^\d,]+$/));
723
- if ((n = e.toLowerCase().trim().match(/^#[\dabcdef]{3,6}$/)) != null && n.length)
724
- if (e.length === 4) {
725
- const c = [e[1], e[1], e[2], e[2], e[3], e[3]].join("");
721
+ if (typeof t == "string") {
722
+ const a = t.split(","), h = a.every((c) => !c.match(/^[^\d,]+$/));
723
+ if ((n = t.toLowerCase().trim().match(/^#[\dabcdef]{3,6}$/)) != null && n.length)
724
+ if (t.length === 4) {
725
+ const c = [t[1], t[1], t[2], t[2], t[3], t[3]].join("");
726
726
  s.set(+`0x${c}`);
727
727
  } else
728
- s.set(+`0x${e.slice(1)}`);
728
+ s.set(+`0x${t.slice(1)}`);
729
729
  else
730
- a != null && a.length && h ? s.set(...a.map((c) => +c)) : s.set(e);
730
+ a != null && a.length && h ? s.set(...a.map((c) => +c)) : s.set(t);
731
731
  } else {
732
- const a = Array.isArray(e) ? e : [e];
732
+ const a = Array.isArray(t) ? t : [t];
733
733
  s.set(...a);
734
734
  }
735
735
  else
736
- Qt(i, t, e);
736
+ Qe(i, e, t);
737
737
  const r = i;
738
738
  typeof r.type == "string" && ((o = r.type) != null && o.toLowerCase().endsWith("material")) && (r.needsUpdate = !0);
739
739
  }, J = {
740
740
  $scene: (i) => {
741
- const t = i.closest("three-lunchbox");
742
- return t == null ? void 0 : t.three.scene;
741
+ const e = i.closest("three-lunchbox");
742
+ return e == null ? void 0 : e.three.scene;
743
743
  },
744
744
  $camera: (i) => {
745
- const t = i.closest("three-lunchbox");
746
- return t == null ? void 0 : t.three.camera;
745
+ const e = i.closest("three-lunchbox");
746
+ return e == null ? void 0 : e.three.camera;
747
747
  },
748
748
  $renderer: (i) => {
749
- const t = i.closest("three-lunchbox");
750
- return t == null ? void 0 : t.three.renderer;
749
+ const e = i.closest("three-lunchbox");
750
+ return e == null ? void 0 : e.three.renderer;
751
751
  },
752
752
  $domElement: (i) => {
753
- var e;
754
- const t = i.closest("three-lunchbox");
755
- return (e = t == null ? void 0 : t.three.renderer) == null ? void 0 : e.domElement;
753
+ var t;
754
+ const e = i.closest("three-lunchbox");
755
+ return (t = e == null ? void 0 : e.three.renderer) == null ? void 0 : t.domElement;
756
756
  }
757
- }, B = (i, t) => {
757
+ }, B = (i, e) => {
758
758
  var s;
759
759
  if (typeof i != "string")
760
760
  return i;
761
761
  if (i === "")
762
762
  return !0;
763
- const e = (s = J[i]) == null ? void 0 : s.call(J, t);
764
- return CSS.supports("color", i) ? new p.Color(i) : e ?? i;
763
+ const t = (s = J[i]) == null ? void 0 : s.call(J, e);
764
+ return CSS.supports("color", i) ? new p.Color(i) : t ?? i;
765
765
  };
766
766
  /**
767
767
  * @license
768
768
  * Copyright 2017 Google LLC
769
769
  * SPDX-License-Identifier: BSD-3-Clause
770
770
  */
771
- const te = { attribute: !0, type: String, converter: k, reflect: !1, hasChanged: Q }, ee = (i = te, t, e) => {
772
- const { kind: s, metadata: r } = e;
771
+ const et = { attribute: !0, type: String, converter: k, reflect: !1, hasChanged: Q }, tt = (i = et, e, t) => {
772
+ const { kind: s, metadata: r } = t;
773
773
  let n = globalThis.litPropertyMetadata.get(r);
774
- if (n === void 0 && globalThis.litPropertyMetadata.set(r, n = /* @__PURE__ */ new Map()), s === "setter" && ((i = Object.create(i)).wrapped = !0), n.set(e.name, i), s === "accessor") {
775
- const { name: o } = e;
774
+ if (n === void 0 && globalThis.litPropertyMetadata.set(r, n = /* @__PURE__ */ new Map()), s === "setter" && ((i = Object.create(i)).wrapped = !0), n.set(t.name, i), s === "accessor") {
775
+ const { name: o } = t;
776
776
  return { set(a) {
777
- const h = t.get.call(this);
778
- t.set.call(this, a), this.requestUpdate(o, h, i, !0, a);
777
+ const h = e.get.call(this);
778
+ e.set.call(this, a), this.requestUpdate(o, h, i, !0, a);
779
779
  }, init(a) {
780
780
  return a !== void 0 && this.C(o, void 0, i, a), a;
781
781
  } };
782
782
  }
783
783
  if (s === "setter") {
784
- const { name: o } = e;
784
+ const { name: o } = t;
785
785
  return function(a) {
786
786
  const h = this[o];
787
- t.call(this, a), this.requestUpdate(o, h, i, !0, a);
787
+ e.call(this, a), this.requestUpdate(o, h, i, !0, a);
788
788
  };
789
789
  }
790
790
  throw Error("Unsupported decorator location: " + s);
791
791
  };
792
792
  function y(i) {
793
- return (t, e) => typeof e == "object" ? ee(i, t, e) : ((s, r, n) => {
793
+ return (e, t) => typeof t == "object" ? tt(i, e, t) : ((s, r, n) => {
794
794
  const o = r.hasOwnProperty(n);
795
795
  return r.constructor.createProperty(n, s), o ? Object.getOwnPropertyDescriptor(r, n) : void 0;
796
- })(i, t, e);
796
+ })(i, e, t);
797
797
  }
798
798
  /**
799
799
  * @license
800
800
  * Copyright 2017 Google LLC
801
801
  * SPDX-License-Identifier: BSD-3-Clause
802
802
  */
803
- function se(i) {
803
+ function st(i) {
804
804
  return y({ ...i, state: !0, attribute: !1 });
805
805
  }
806
- var re = Object.defineProperty, St = (i, t, e, s) => {
806
+ var rt = Object.defineProperty, Se = (i, e, t, s) => {
807
807
  for (var r = void 0, n = i.length - 1, o; n >= 0; n--)
808
- (o = i[n]) && (r = o(t, e, r) || r);
809
- return r && re(t, e, r), r;
808
+ (o = i[n]) && (r = o(e, t, r) || r);
809
+ return r && rt(e, t, r), r;
810
810
  };
811
- const K = "raycast", ft = [
811
+ const K = "raycast", fe = [
812
812
  K,
813
813
  "args",
814
814
  "data"
815
- ], yt = (i) => i.split("-");
815
+ ], ye = (i) => i.split("-");
816
816
  class G extends w {
817
- constructor(t) {
818
- super(), this.classSource = t, this.instance = null, this.dispose = [], this.mutationObserver = null, this.tryAddOnce = !1, this.connected = !1;
817
+ constructor(e) {
818
+ super(), this.classSource = e, this.instance = null, this.dispose = [], this.mutationObserver = null, this.tryAddOnce = !1, this.connected = !1;
819
819
  }
820
820
  observeAttributes() {
821
- this.mutationObserver = new MutationObserver((t) => {
822
- t.forEach((e) => {
821
+ this.mutationObserver = new MutationObserver((e) => {
822
+ e.forEach((t) => {
823
823
  var r;
824
- if (!e.attributeName || (r = Object.getPrototypeOf(this).constructor.observedAttributes) != null && r.includes(e.attributeName))
824
+ if (!t.attributeName || (r = Object.getPrototypeOf(this).constructor.observedAttributes) != null && r.includes(t.attributeName))
825
825
  return;
826
- const s = this.attributes.getNamedItem(e.attributeName);
826
+ const s = this.attributes.getNamedItem(t.attributeName);
827
827
  s && this.updateProperty(s);
828
828
  });
829
829
  }), this.mutationObserver.observe(this, {
@@ -831,27 +831,27 @@ class G extends w {
831
831
  });
832
832
  }
833
833
  parsedArgs() {
834
- const t = this.args ?? this.getAttribute("args") ?? [];
835
- return typeof t == "string" ? JSON.parse(t) : t;
834
+ const e = this.args ?? this.getAttribute("args") ?? [];
835
+ return typeof e == "string" ? JSON.parse(e) : e;
836
836
  }
837
837
  createUnderlyingThreeObject() {
838
- this.instance = new this.classSource(...this.parsedArgs().map((t) => B(t, this)));
838
+ this.instance = new this.classSource(...this.parsedArgs().map((e) => B(e, this)));
839
839
  }
840
840
  refreshAttributes() {
841
- this.getAttributeNames().forEach((t) => {
842
- const e = this.attributes.getNamedItem(t);
843
- e && this.updateProperty(e);
841
+ this.getAttributeNames().forEach((e) => {
842
+ const t = this.attributes.getNamedItem(e);
843
+ t && this.updateProperty(t);
844
844
  }), Array.from(this.attributes).forEach(this.updateProperty.bind(this));
845
845
  }
846
846
  async onUnderlyingThreeObjectReady() {
847
847
  var s, r, n, o;
848
- const t = this.instance;
849
- t.uuid && this.setAttribute(Ct, t.uuid);
850
- let e = mt(this);
851
- for (; this != null && this.connected && !this.tryAddOnce && !e; )
852
- await new Promise(requestAnimationFrame), e = mt(this);
853
- if (e && e.instance || (s = e == null ? void 0 : e.three) != null && s.scene) {
854
- const a = this.instance, h = this.instance, c = e.instance, d = e.instance ?? ((r = e.three) == null ? void 0 : r.scene), l = this.instance;
848
+ const e = this.instance;
849
+ e.uuid && this.setAttribute(Ce, e.uuid);
850
+ let t = me(this);
851
+ for (; this != null && this.connected && !this.tryAddOnce && !t; )
852
+ await new Promise(requestAnimationFrame), t = me(this);
853
+ if (t && t.instance || (s = t == null ? void 0 : t.three) != null && s.scene) {
854
+ const a = this.instance, h = this.instance, c = t.instance, d = t.instance ?? ((r = t.three) == null ? void 0 : r.scene), l = this.instance;
855
855
  if ((n = a.type) != null && n.toLowerCase().includes("geometry") && c.geometry)
856
856
  c.geometry = a;
857
857
  else if ((o = h.type) != null && o.toLowerCase().includes("material") && c.material)
@@ -879,14 +879,14 @@ class G extends w {
879
879
  })), this.connected = !0, this.onUnderlyingThreeObjectReady.call(this);
880
880
  }
881
881
  /** Update an instance's property. When creating a `<mesh position-y="0.5">`, for example, this sets `mesh.position.y = 0.5`. */
882
- updateProperty(t) {
883
- const { name: e, value: s } = t;
884
- let r = e;
882
+ updateProperty(e) {
883
+ const { name: t, value: s } = e;
884
+ let r = t;
885
885
  Object.keys(this.instance ?? {}).forEach((a) => {
886
886
  a.toLowerCase() === r && (r = a);
887
887
  });
888
- const n = yt(r);
889
- if (ft.includes(r) || ft.includes(n[0]))
888
+ const n = ye(r);
889
+ if (fe.includes(r) || fe.includes(n[0]))
890
890
  return;
891
891
  let o = B(s, this);
892
892
  try {
@@ -895,46 +895,46 @@ class G extends w {
895
895
  }
896
896
  this.instance && Z(this.instance, n, o);
897
897
  }
898
- executeAttach(t, e) {
898
+ executeAttach(e, t) {
899
899
  const s = this.parentElement;
900
- s.instance && Z(s.instance, yt(t), e);
900
+ s.instance && Z(s.instance, ye(e), t);
901
901
  }
902
902
  disconnectedCallback() {
903
903
  super.disconnectedCallback();
904
- const t = [this.instance];
905
- this.disposeThreeObjects.call(this, t), this.connected = !1;
904
+ const e = [this.instance];
905
+ this.disposeThreeObjects.call(this, e), this.connected = !1;
906
906
  }
907
- disposeThreeObjects(t) {
908
- t.forEach((e) => {
907
+ disposeThreeObjects(e) {
908
+ e.forEach((t) => {
909
909
  var n, o;
910
- if (!e)
910
+ if (!t)
911
911
  return;
912
- const s = e, r = e;
912
+ const s = t, r = t;
913
913
  (n = s.dispose) == null || n.call(s), (o = r.removeFromParent) == null || o.call(r);
914
914
  });
915
915
  }
916
916
  /** Render */
917
917
  render() {
918
- return et`<slot></slot>`;
918
+ return te`<slot></slot>`;
919
919
  }
920
920
  createRenderRoot() {
921
921
  return this;
922
922
  }
923
923
  }
924
- St([
924
+ Se([
925
925
  y({ type: Boolean, attribute: "try-add-once" })
926
926
  ], G.prototype, "tryAddOnce");
927
- St([
928
- se()
927
+ Se([
928
+ st()
929
929
  ], G.prototype, "connected");
930
- const Pt = (i) => {
931
- const t = typeof i == "string" ? p[i] : i;
932
- if (!Kt(t))
930
+ const Pe = (i) => {
931
+ const e = typeof i == "string" ? p[i] : i;
932
+ if (!Ke(e))
933
933
  return null;
934
- const e = i.toString().toLowerCase().endsWith("loader");
934
+ const t = i.toString().toLowerCase().endsWith("loader");
935
935
  class s extends G {
936
936
  constructor() {
937
- super(t);
937
+ super(e);
938
938
  }
939
939
  }
940
940
  class r extends G {
@@ -942,7 +942,7 @@ const Pt = (i) => {
942
942
  super(...arguments), this.loader = null;
943
943
  }
944
944
  createUnderlyingThreeObject() {
945
- this.loader = new t(...this.parsedArgs().map((o) => B(o, this)));
945
+ this.loader = new e(...this.parsedArgs().map((o) => B(o, this)));
946
946
  }
947
947
  async onUnderlyingThreeObjectReady() {
948
948
  const o = this.getAttribute("src");
@@ -966,23 +966,19 @@ const Pt = (i) => {
966
966
  super.disconnectedCallback(), this.disposeThreeObjects.call(this, [this.loader]);
967
967
  }
968
968
  }
969
- return e ? r : s;
969
+ return t ? r : s;
970
970
  };
971
- var ie = Object.defineProperty, E = (i, t, e, s) => {
971
+ var it = Object.defineProperty, b = (i, e, t, s) => {
972
972
  for (var r = void 0, n = i.length - 1, o; n >= 0; n--)
973
- (o = i[n]) && (r = o(t, e, r) || r);
974
- return r && ie(t, e, r), r;
973
+ (o = i[n]) && (r = o(e, t, r) || r);
974
+ return r && it(e, t, r), r;
975
975
  };
976
- const ne = "orthographic", $t = 1 / 0, st = class st extends w {
976
+ const nt = "orthographic", $e = 1 / 0, se = class se extends w {
977
977
  constructor() {
978
- super(), this.scratchV2 = new p.Vector2(), this.three = {
979
- scene: new p.Scene(),
980
- camera: null,
981
- renderer: null
982
- }, this.background = null, this.dpr = $t, this.headless = !1, this.manualRender = !1, this.dispatchBeforeRender = !1, this.dispatchAfterRender = !1, this.rendererArgs = [], this.cameraArgs = [], this.raycaster = new p.Raycaster(), this.raycastPool = [], this.frame = 1 / 0, this.resizeObserver = new ResizeObserver((t) => {
983
- t.forEach(({ target: e, contentRect: s }) => {
978
+ super(), this.scratchV2 = new p.Vector2(), this.background = null, this.dpr = $e, this.headless = !1, this.manualRender = !1, this.dispatchBeforeRender = !1, this.dispatchAfterRender = !1, this.rendererArgs = [], this.cameraArgs = [], this.raycaster = new p.Raycaster(), this.raycastPool = [], this.frame = 1 / 0, this.three = this.createThree(), this.resizeObserver = new ResizeObserver((e) => {
979
+ e.forEach(({ target: t, contentRect: s }) => {
984
980
  var r;
985
- if (e === this && ((r = this.three.renderer) == null || r.setSize(s.width * this.dpr, s.height * this.dpr), this.three.camera)) {
981
+ if (t === this && ((r = this.three.renderer) == null || r.setSize(s.width * this.dpr, s.height * this.dpr), this.three.camera)) {
986
982
  const n = s.width / s.height;
987
983
  if (this.three.camera.type.toLowerCase() === "perspectivecamera")
988
984
  this.three.camera.aspect = n, this.three.camera.updateProjectionMatrix();
@@ -995,91 +991,102 @@ const ne = "orthographic", $t = 1 / 0, st = class st extends w {
995
991
  });
996
992
  });
997
993
  }
994
+ /** Function called at startup when creating Lunchbox's default scene. */
995
+ createDefaultScene() {
996
+ return new p.Scene();
997
+ }
998
+ createThree() {
999
+ return {
1000
+ scene: this.createDefaultScene(),
1001
+ camera: null,
1002
+ renderer: null
1003
+ };
1004
+ }
998
1005
  /** To run on start. */
999
1006
  connectedCallback() {
1000
- if (super.connectedCallback(), this.dpr === $t && (this.dpr = window.devicePixelRatio), this.getAttribute(ne) !== null ? this.three.camera = new p.OrthographicCamera(...this.cameraArgs) : this.three.camera = new p.PerspectiveCamera(...this.cameraArgs.length ? this.cameraArgs : [75]), ["scene", "camera", "renderer"].forEach((t) => {
1001
- const e = this[t] ?? this.getAttribute(t) ?? {}, s = typeof e == "string" ? JSON.parse(e) : e;
1007
+ if (super.connectedCallback(), this.dpr === $e && (this.dpr = window.devicePixelRatio), this.getAttribute(nt) !== null ? this.three.camera = new p.OrthographicCamera(...this.cameraArgs) : this.three.camera = new p.PerspectiveCamera(...this.cameraArgs.length ? this.cameraArgs : [75]), ["scene", "camera", "renderer"].forEach((e) => {
1008
+ const t = this[e] ?? this.getAttribute(e) ?? {}, s = typeof t == "string" ? JSON.parse(t) : t;
1002
1009
  Object.entries(s).forEach(([r, n]) => {
1003
- this.three[t] && Z(this.three[t], r.split("-"), B(n, this));
1010
+ this.three[e] && Z(this.three[e], r.split("-"), B(n, this));
1004
1011
  });
1005
1012
  }), this.resizeObserver.observe(this), this.background !== null && (this.three.scene.background = new p.Color(this.background)), !this.headless) {
1006
- const t = new p.WebGLRenderer(...this.rendererArgs);
1007
- t.domElement.addEventListener("pointermove", this.onPointerMove.bind(this)), t.domElement.addEventListener("mousemove", this.onPointerMove.bind(this)), t.domElement.addEventListener("click", this.onClick.bind(this)), this.three.renderer = t;
1013
+ const e = new p.WebGLRenderer(...this.rendererArgs);
1014
+ e.domElement.addEventListener("pointermove", this.onPointerMove.bind(this)), e.domElement.addEventListener("mousemove", this.onPointerMove.bind(this)), e.domElement.addEventListener("click", this.onClick.bind(this)), this.three.renderer = e;
1008
1015
  }
1009
1016
  this.manualRender || this.updateLoop();
1010
1017
  }
1011
1018
  disconnectedCallback() {
1012
- var t, e, s, r;
1013
- (t = this.three.renderer) == null || t.domElement.removeEventListener("pointermove", this.onPointerMove.bind(this)), (e = this.three.renderer) == null || e.domElement.removeEventListener("mousemove", this.onPointerMove.bind(this)), (s = this.three.renderer) == null || s.domElement.removeEventListener("click", this.onClick.bind(this)), (r = this.three.renderer) == null || r.dispose(), this.resizeObserver.unobserve(this), cancelAnimationFrame(this.frame);
1019
+ var e, t, s, r;
1020
+ (e = this.three.renderer) == null || e.domElement.removeEventListener("pointermove", this.onPointerMove.bind(this)), (t = this.three.renderer) == null || t.domElement.removeEventListener("mousemove", this.onPointerMove.bind(this)), (s = this.three.renderer) == null || s.domElement.removeEventListener("click", this.onClick.bind(this)), (r = this.three.renderer) == null || r.dispose(), this.resizeObserver.unobserve(this), cancelAnimationFrame(this.frame);
1014
1021
  }
1015
- handleDefaultSlotChange(t) {
1016
- t.target.assignedElements().forEach((e) => {
1017
- const s = e;
1018
- s.instance instanceof p.Object3D && e.getAttributeNames().includes(K) && e.getAttributeNames().includes(K) && this.raycastPool.push(s.instance);
1022
+ handleDefaultSlotChange(e) {
1023
+ e.target.assignedElements().forEach((t) => {
1024
+ const s = t;
1025
+ s.instance instanceof p.Object3D && t.getAttributeNames().includes(K) && t.getAttributeNames().includes(K) && this.raycastPool.push(s.instance);
1019
1026
  }), this.renderThree();
1020
1027
  }
1021
- runRaycast(t) {
1028
+ runRaycast(e) {
1022
1029
  var a, h;
1023
1030
  if (!this.raycastPool.length || !this.three.camera)
1024
1031
  return [];
1025
- const e = ((a = this.three.renderer) == null ? void 0 : a.domElement.width) ?? 0, s = ((h = this.three.renderer) == null ? void 0 : h.domElement.height) ?? 0, r = this.scratchV2.clone().set(
1026
- t.clientX / (e / this.dpr) * 2 - 1,
1027
- -(t.clientY / (s / this.dpr)) * 2 + 1
1032
+ const t = ((a = this.three.renderer) == null ? void 0 : a.domElement.width) ?? 0, s = ((h = this.three.renderer) == null ? void 0 : h.domElement.height) ?? 0, r = this.scratchV2.clone().set(
1033
+ e.clientX / (t / this.dpr) * 2 - 1,
1034
+ -(e.clientY / (s / this.dpr)) * 2 + 1
1028
1035
  );
1029
1036
  return this.raycaster.setFromCamera(r, this.three.camera), this.raycaster.intersectObjects(this.raycastPool).map((c) => ({
1030
1037
  intersect: c,
1031
1038
  // TODO: cache result of this query selector somewhere?
1032
- element: this.querySelector(`[${Ct}="${c.object.uuid}"]`)
1039
+ element: this.querySelector(`[${Ce}="${c.object.uuid}"]`)
1033
1040
  }));
1034
1041
  }
1035
1042
  // Pointer movement
1036
1043
  // ==================
1037
- onPointerMove(t) {
1038
- this.runRaycast.bind(this)(t).forEach((s) => {
1044
+ onPointerMove(e) {
1045
+ this.runRaycast.bind(this)(e).forEach((s) => {
1039
1046
  var r, n, o, a;
1040
- t.type === "pointermove" ? ((r = s.element) == null || r.dispatchEvent(new PointerEvent("pointermove")), (n = s.element) == null || n.dispatchEvent(new CustomEvent(ae, { detail: s }))) : t.type === "mousemove" && ((o = s.element) == null || o.dispatchEvent(new MouseEvent("mousemove")), (a = s.element) == null || a.dispatchEvent(new CustomEvent(he, { detail: s })));
1047
+ e.type === "pointermove" ? ((r = s.element) == null || r.dispatchEvent(new PointerEvent("pointermove")), (n = s.element) == null || n.dispatchEvent(new CustomEvent(at, { detail: s }))) : e.type === "mousemove" && ((o = s.element) == null || o.dispatchEvent(new MouseEvent("mousemove")), (a = s.element) == null || a.dispatchEvent(new CustomEvent(ht, { detail: s })));
1041
1048
  });
1042
1049
  }
1043
1050
  // Click handling
1044
1051
  // ==================
1045
- onClick(t) {
1046
- let e = [];
1047
- if (t instanceof TouchEvent) {
1048
- const s = t.touches[0];
1049
- e = this.runRaycast.bind(this)(s), e.forEach((r) => {
1052
+ onClick(e) {
1053
+ let t = [];
1054
+ if (e instanceof TouchEvent) {
1055
+ const s = e.touches[0];
1056
+ t = this.runRaycast.bind(this)(s), t.forEach((r) => {
1050
1057
  var n;
1051
1058
  (n = r.element) == null || n.dispatchEvent(new TouchEvent("touchstart"));
1052
1059
  });
1053
1060
  } else
1054
- e = this.runRaycast.bind(this)(t), e.forEach((s) => {
1061
+ t = this.runRaycast.bind(this)(e), t.forEach((s) => {
1055
1062
  var r;
1056
1063
  (r = s.element) == null || r.dispatchEvent(new MouseEvent("click"));
1057
1064
  });
1058
- e.forEach((s) => {
1065
+ t.forEach((s) => {
1059
1066
  var r;
1060
- (r = s.element) == null || r.dispatchEvent(new CustomEvent(ce, { detail: s }));
1067
+ (r = s.element) == null || r.dispatchEvent(new CustomEvent(ct, { detail: s }));
1061
1068
  });
1062
1069
  }
1063
1070
  updateLoop() {
1064
1071
  this.renderThree(), this.manualRender || (this.frame = requestAnimationFrame(this.updateLoop.bind(this)));
1065
1072
  }
1066
1073
  /** Render the 3D scene. Optional scene/camera overrides; defaults to the internal scene and camera. */
1067
- renderThree(t, e) {
1074
+ renderThree(e, t) {
1068
1075
  var s;
1069
- this.dispatchBeforeRender && this.dispatchEvent(new CustomEvent(le, {})), this.three.camera && ((s = this.three.renderer) == null || s.render(
1070
- t ?? this.three.scene,
1071
- e ?? this.three.camera
1072
- ), this.dispatchAfterRender && this.dispatchEvent(new CustomEvent(de, {})));
1076
+ this.dispatchBeforeRender && this.dispatchEvent(new CustomEvent(lt, {})), this.three.camera && ((s = this.three.renderer) == null || s.render(
1077
+ e ?? this.three.scene,
1078
+ t ?? this.three.camera
1079
+ ), this.dispatchAfterRender && this.dispatchEvent(new CustomEvent(dt, {})));
1073
1080
  }
1074
1081
  render() {
1075
- var t;
1076
- return et`
1082
+ var e;
1083
+ return te`
1077
1084
  <slot @slotchange=${this.handleDefaultSlotChange}></slot>
1078
- ${(t = this.three.renderer) == null ? void 0 : t.domElement}
1085
+ ${(e = this.three.renderer) == null ? void 0 : e.domElement}
1079
1086
  `;
1080
1087
  }
1081
1088
  };
1082
- st.styles = Ot`
1089
+ se.styles = Oe`
1083
1090
  :host {
1084
1091
  width: 100%;
1085
1092
  height: 100%;
@@ -1093,92 +1100,90 @@ st.styles = Ot`
1093
1100
  max-height: 100%;
1094
1101
  }
1095
1102
  `;
1096
- let f = st;
1097
- E([
1103
+ let f = se;
1104
+ b([
1098
1105
  y()
1099
1106
  ], f.prototype, "background");
1100
- E([
1107
+ b([
1101
1108
  y()
1102
1109
  ], f.prototype, "dpr");
1103
- E([
1110
+ b([
1104
1111
  y()
1105
1112
  ], f.prototype, "headless");
1106
- E([
1113
+ b([
1107
1114
  y({
1108
1115
  attribute: "manual-render",
1109
1116
  type: Boolean
1110
1117
  })
1111
1118
  ], f.prototype, "manualRender");
1112
- E([
1119
+ b([
1113
1120
  y({
1114
1121
  attribute: "dispatch-before-render",
1115
1122
  type: Boolean
1116
1123
  })
1117
1124
  ], f.prototype, "dispatchBeforeRender");
1118
- E([
1125
+ b([
1119
1126
  y({
1120
1127
  attribute: "dispatch-after-render",
1121
1128
  type: Boolean
1122
1129
  })
1123
1130
  ], f.prototype, "dispatchAfterRender");
1124
- E([
1131
+ b([
1125
1132
  y({
1126
1133
  attribute: "renderer-args",
1127
1134
  type: Object
1128
1135
  })
1129
1136
  ], f.prototype, "rendererArgs");
1130
- E([
1137
+ b([
1131
1138
  y({
1132
1139
  attribute: "camera-args",
1133
1140
  type: Object
1134
1141
  })
1135
1142
  ], f.prototype, "cameraArgs");
1136
- class oe extends w {
1143
+ class ot extends w {
1137
1144
  constructor() {
1138
1145
  super(...arguments), this.parentLunchbox = null, this.frame = -1, this.scratchV3 = new p.Vector3(), this.scratchFrustum = new p.Frustum(), this.scratchMatrix4 = new p.Matrix4();
1139
1146
  }
1140
1147
  /** Try attaching the update function to pass the parent's position to children. */
1141
1148
  tryAttachUpdate() {
1142
1149
  var o;
1143
- const t = (o = this.parentLunchbox) == null ? void 0 : o.instance;
1144
- if (!t)
1150
+ const e = (o = this.parentLunchbox) == null ? void 0 : o.instance;
1151
+ if (!e)
1145
1152
  return !1;
1146
- if (!t.isObject3D)
1153
+ if (!e.isObject3D)
1147
1154
  throw new Error("html-anchor must be the child of an Object3D");
1148
- const e = D(this, (a) => {
1155
+ const t = D(this, (a) => {
1149
1156
  var h;
1150
1157
  return !!((h = a == null ? void 0 : a.three) != null && h.renderer);
1151
1158
  });
1152
- if (!e)
1159
+ if (!t)
1153
1160
  return console.error("three-lunchbox parent required for html-anchor"), !1;
1154
- const s = e.three.camera;
1161
+ const s = t.three.camera;
1155
1162
  if (!s)
1156
1163
  return console.error("camera required for html-anchor"), !1;
1157
- const r = e.three.renderer;
1164
+ const r = t.three.renderer;
1158
1165
  if (!(r != null && r.domElement))
1159
1166
  return console.error("renderer and DOM element required for html-anchor"), !1;
1160
1167
  const n = () => {
1161
- this.frame = requestAnimationFrame(n), s.updateMatrix(), s.updateMatrixWorld(), t.getWorldPosition(this.scratchV3);
1168
+ this.frame = requestAnimationFrame(n), s.updateMatrix(), s.updateMatrixWorld(), e.getWorldPosition(this.scratchV3);
1162
1169
  const a = this.scratchV3.clone();
1163
1170
  this.scratchV3.project(s), this.scratchV3.multiplyScalar(0.5).addScalar(0.5), this.scratchV3.y = 1 - this.scratchV3.y;
1164
1171
  const h = this.scratchV3.clone().set(r.domElement.width, r.domElement.height, 1);
1165
1172
  h.divideScalar(devicePixelRatio), this.scratchV3.multiply(h);
1166
- const c = t.position.clone().distanceTo(s.getWorldPosition(this.scratchV3.clone()));
1173
+ const c = e.position.clone().distanceTo(s.getWorldPosition(this.scratchV3.clone()));
1167
1174
  this.scratchFrustum.setFromProjectionMatrix(this.scratchMatrix4.clone().multiplyMatrices(s.projectionMatrix, s.matrixWorldInverse));
1168
1175
  const d = this.scratchFrustum.containsPoint(a);
1169
- Array.from(this.children).forEach((l) => {
1170
- l.style.setProperty("--left", `${this.scratchV3.x}px`), l.style.setProperty("--top", `${this.scratchV3.y}px`), l.style.setProperty("--distance-from-camera", `${c}`), l.style.setProperty("--in-frustum", `${d ? 1 : 0}`);
1171
- });
1176
+ this.style.setProperty("--left", `${this.scratchV3.x}px`), this.style.setProperty("--top", `${this.scratchV3.y}px`), this.style.setProperty("--distance-from-camera", `${c}`), this.style.setProperty("--in-frustum", `${d ? 1 : 0}`), d ? this.classList.add("in-frustum") : this.classList.remove("in-frustum");
1172
1177
  };
1173
1178
  return n(), !0;
1174
1179
  }
1175
1180
  // Setup - save local parent and try adding update
1176
1181
  connectedCallback() {
1177
1182
  super.connectedCallback();
1178
- const t = this.parentNode;
1179
- if (!t)
1183
+ const e = this.parentNode;
1184
+ if (!e)
1180
1185
  throw new Error("html-anchor requires a 3D parent");
1181
- this.parentLunchbox = t, this.tryAttachUpdate() || this.parentLunchbox.addEventListener("instanceadded", () => {
1186
+ this.parentLunchbox = e, this.tryAttachUpdate() || this.parentLunchbox.addEventListener("instanceadded", () => {
1182
1187
  if (!this.tryAttachUpdate())
1183
1188
  throw new Error("error attaching html-anchor to Object3D");
1184
1189
  }, { once: !0 });
@@ -1188,52 +1193,52 @@ class oe extends w {
1188
1193
  this.frame !== -1 && cancelAnimationFrame(this.frame);
1189
1194
  }
1190
1195
  render() {
1191
- return et`<slot></slot>`;
1196
+ return te`<slot></slot>`;
1192
1197
  }
1193
1198
  createRenderRoot() {
1194
1199
  return this;
1195
1200
  }
1196
1201
  }
1197
- const me = ({
1202
+ const mt = ({
1198
1203
  prependList: i = []
1199
1204
  } = {}) => {
1200
1205
  Object.entries({
1201
1206
  "three-lunchbox": f,
1202
- "html-anchor": oe
1203
- }).forEach(([e, s]) => {
1204
- customElements.get(e) || customElements.define(e, s);
1205
- }), [...i, ...At].forEach((e) => {
1206
- const s = Mt(e);
1207
+ "html-anchor": ot
1208
+ }).forEach(([t, s]) => {
1209
+ customElements.get(t) || customElements.define(t, s);
1210
+ }), [...i, ...Ae].forEach((t) => {
1211
+ const s = Te(t);
1207
1212
  if (customElements.get(s))
1208
1213
  return;
1209
- const r = Pt(e);
1214
+ const r = Pe(t);
1210
1215
  r && customElements.define(s, r);
1211
1216
  });
1212
- }, fe = (i, t, e = window) => {
1213
- if (e.customElements.get(i)) {
1217
+ }, ft = (i, e, t = window) => {
1218
+ if (t.customElements.get(i)) {
1214
1219
  console.log(`${i} already registered as a custom element. Try a different name if registering is still required.`);
1215
1220
  return;
1216
1221
  }
1217
- const s = Pt(t);
1222
+ const s = Pe(e);
1218
1223
  if (s)
1219
- e.customElements.define(i, s);
1224
+ t.customElements.define(i, s);
1220
1225
  else
1221
1226
  throw new Error(`Could not extend ${i}. The second paramater must be a class.`);
1222
- }, ae = "threepointermove", he = "threemousemove", ce = "threeclick", le = "beforerender", de = "afterrender", Mt = (i) => {
1223
- let t = i.split(/\.?(?=[A-Z])/).join("-").toLowerCase().replace(/-g-l-/, "-gl-");
1224
- return t.includes("-") || (t = `three-${t}`), t;
1225
- }, ye = At.map(Mt);
1227
+ }, at = "threepointermove", ht = "threemousemove", ct = "threeclick", lt = "beforerender", dt = "afterrender", Te = (i) => {
1228
+ let e = i.split(/\.?(?=[A-Z])/).join("-").toLowerCase().replace(/-g-l-/, "-gl-");
1229
+ return e.includes("-") || (e = `three-${e}`), e;
1230
+ }, yt = Ae.map(Te);
1226
1231
  export {
1227
- de as AFTER_RENDER_EVENT_NAME,
1228
- le as BEFORE_RENDER_EVENT_NAME,
1229
- oe as HtmlAnchor,
1230
- ce as THREE_CLICK_EVENT_NAME,
1231
- he as THREE_MOUSE_MOVE_EVENT_NAME,
1232
- ae as THREE_POINTER_MOVE_EVENT_NAME,
1232
+ dt as AFTER_RENDER_EVENT_NAME,
1233
+ lt as BEFORE_RENDER_EVENT_NAME,
1234
+ ot as HtmlAnchor,
1235
+ ct as THREE_CLICK_EVENT_NAME,
1236
+ ht as THREE_MOUSE_MOVE_EVENT_NAME,
1237
+ at as THREE_POINTER_MOVE_EVENT_NAME,
1233
1238
  G as ThreeBase,
1234
1239
  f as ThreeLunchbox,
1235
- At as autoComponents,
1236
- fe as extend,
1237
- me as initLunchbox,
1238
- ye as webComponentNames
1240
+ Ae as autoComponents,
1241
+ ft as extend,
1242
+ mt as initLunchbox,
1243
+ yt as webComponentNames
1239
1244
  };