shipfare_shipping_cutoff 0.1.9

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.
@@ -0,0 +1,1796 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2019 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */
6
+ const t$3 = window, e$6 = t$3.ShadowRoot && (void 0 === t$3.ShadyCSS || t$3.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, s$3 = Symbol(), n$6 = /* @__PURE__ */ new WeakMap();
7
+ let o$4 = class o {
8
+ constructor(t2, e2, n2) {
9
+ if (this._$cssResult$ = true, n2 !== s$3)
10
+ throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
11
+ this.cssText = t2, this.t = e2;
12
+ }
13
+ get styleSheet() {
14
+ let t2 = this.o;
15
+ const s2 = this.t;
16
+ if (e$6 && void 0 === t2) {
17
+ const e2 = void 0 !== s2 && 1 === s2.length;
18
+ e2 && (t2 = n$6.get(s2)), void 0 === t2 && ((this.o = t2 = new CSSStyleSheet()).replaceSync(this.cssText), e2 && n$6.set(s2, t2));
19
+ }
20
+ return t2;
21
+ }
22
+ toString() {
23
+ return this.cssText;
24
+ }
25
+ };
26
+ const r$2 = (t2) => new o$4("string" == typeof t2 ? t2 : t2 + "", void 0, s$3), S$1 = (s2, n2) => {
27
+ e$6 ? s2.adoptedStyleSheets = n2.map((t2) => t2 instanceof CSSStyleSheet ? t2 : t2.styleSheet) : n2.forEach((e2) => {
28
+ const n3 = document.createElement("style"), o3 = t$3.litNonce;
29
+ void 0 !== o3 && n3.setAttribute("nonce", o3), n3.textContent = e2.cssText, s2.appendChild(n3);
30
+ });
31
+ }, c$1 = e$6 ? (t2) => t2 : (t2) => t2 instanceof CSSStyleSheet ? ((t3) => {
32
+ let e2 = "";
33
+ for (const s2 of t3.cssRules)
34
+ e2 += s2.cssText;
35
+ return r$2(e2);
36
+ })(t2) : t2;
37
+ /**
38
+ * @license
39
+ * Copyright 2017 Google LLC
40
+ * SPDX-License-Identifier: BSD-3-Clause
41
+ */
42
+ var s$2;
43
+ const e$5 = window, r$1 = e$5.trustedTypes, h$1 = r$1 ? r$1.emptyScript : "", o$3 = e$5.reactiveElementPolyfillSupport, n$5 = { toAttribute(t2, i2) {
44
+ switch (i2) {
45
+ case Boolean:
46
+ t2 = t2 ? h$1 : null;
47
+ break;
48
+ case Object:
49
+ case Array:
50
+ t2 = null == t2 ? t2 : JSON.stringify(t2);
51
+ }
52
+ return t2;
53
+ }, fromAttribute(t2, i2) {
54
+ let s2 = t2;
55
+ switch (i2) {
56
+ case Boolean:
57
+ s2 = null !== t2;
58
+ break;
59
+ case Number:
60
+ s2 = null === t2 ? null : Number(t2);
61
+ break;
62
+ case Object:
63
+ case Array:
64
+ try {
65
+ s2 = JSON.parse(t2);
66
+ } catch (t3) {
67
+ s2 = null;
68
+ }
69
+ }
70
+ return s2;
71
+ } }, a$1 = (t2, i2) => i2 !== t2 && (i2 == i2 || t2 == t2), l$2 = { attribute: true, type: String, converter: n$5, reflect: false, hasChanged: a$1 }, d$1 = "finalized";
72
+ let u$1 = class u extends HTMLElement {
73
+ constructor() {
74
+ super(), this._$Ei = /* @__PURE__ */ new Map(), this.isUpdatePending = false, this.hasUpdated = false, this._$El = null, this._$Eu();
75
+ }
76
+ static addInitializer(t2) {
77
+ var i2;
78
+ this.finalize(), (null !== (i2 = this.h) && void 0 !== i2 ? i2 : this.h = []).push(t2);
79
+ }
80
+ static get observedAttributes() {
81
+ this.finalize();
82
+ const t2 = [];
83
+ return this.elementProperties.forEach((i2, s2) => {
84
+ const e2 = this._$Ep(s2, i2);
85
+ void 0 !== e2 && (this._$Ev.set(e2, s2), t2.push(e2));
86
+ }), t2;
87
+ }
88
+ static createProperty(t2, i2 = l$2) {
89
+ if (i2.state && (i2.attribute = false), this.finalize(), this.elementProperties.set(t2, i2), !i2.noAccessor && !this.prototype.hasOwnProperty(t2)) {
90
+ const s2 = "symbol" == typeof t2 ? Symbol() : "__" + t2, e2 = this.getPropertyDescriptor(t2, s2, i2);
91
+ void 0 !== e2 && Object.defineProperty(this.prototype, t2, e2);
92
+ }
93
+ }
94
+ static getPropertyDescriptor(t2, i2, s2) {
95
+ return { get() {
96
+ return this[i2];
97
+ }, set(e2) {
98
+ const r2 = this[t2];
99
+ this[i2] = e2, this.requestUpdate(t2, r2, s2);
100
+ }, configurable: true, enumerable: true };
101
+ }
102
+ static getPropertyOptions(t2) {
103
+ return this.elementProperties.get(t2) || l$2;
104
+ }
105
+ static finalize() {
106
+ if (this.hasOwnProperty(d$1))
107
+ return false;
108
+ this[d$1] = true;
109
+ const t2 = Object.getPrototypeOf(this);
110
+ if (t2.finalize(), void 0 !== t2.h && (this.h = [...t2.h]), this.elementProperties = new Map(t2.elementProperties), this._$Ev = /* @__PURE__ */ new Map(), this.hasOwnProperty("properties")) {
111
+ const t3 = this.properties, i2 = [...Object.getOwnPropertyNames(t3), ...Object.getOwnPropertySymbols(t3)];
112
+ for (const s2 of i2)
113
+ this.createProperty(s2, t3[s2]);
114
+ }
115
+ return this.elementStyles = this.finalizeStyles(this.styles), true;
116
+ }
117
+ static finalizeStyles(i2) {
118
+ const s2 = [];
119
+ if (Array.isArray(i2)) {
120
+ const e2 = new Set(i2.flat(1 / 0).reverse());
121
+ for (const i3 of e2)
122
+ s2.unshift(c$1(i3));
123
+ } else
124
+ void 0 !== i2 && s2.push(c$1(i2));
125
+ return s2;
126
+ }
127
+ static _$Ep(t2, i2) {
128
+ const s2 = i2.attribute;
129
+ return false === s2 ? void 0 : "string" == typeof s2 ? s2 : "string" == typeof t2 ? t2.toLowerCase() : void 0;
130
+ }
131
+ _$Eu() {
132
+ var t2;
133
+ this._$E_ = new Promise((t3) => this.enableUpdating = t3), this._$AL = /* @__PURE__ */ new Map(), this._$Eg(), this.requestUpdate(), null === (t2 = this.constructor.h) || void 0 === t2 || t2.forEach((t3) => t3(this));
134
+ }
135
+ addController(t2) {
136
+ var i2, s2;
137
+ (null !== (i2 = this._$ES) && void 0 !== i2 ? i2 : this._$ES = []).push(t2), void 0 !== this.renderRoot && this.isConnected && (null === (s2 = t2.hostConnected) || void 0 === s2 || s2.call(t2));
138
+ }
139
+ removeController(t2) {
140
+ var i2;
141
+ null === (i2 = this._$ES) || void 0 === i2 || i2.splice(this._$ES.indexOf(t2) >>> 0, 1);
142
+ }
143
+ _$Eg() {
144
+ this.constructor.elementProperties.forEach((t2, i2) => {
145
+ this.hasOwnProperty(i2) && (this._$Ei.set(i2, this[i2]), delete this[i2]);
146
+ });
147
+ }
148
+ createRenderRoot() {
149
+ var t2;
150
+ const s2 = null !== (t2 = this.shadowRoot) && void 0 !== t2 ? t2 : this.attachShadow(this.constructor.shadowRootOptions);
151
+ return S$1(s2, this.constructor.elementStyles), s2;
152
+ }
153
+ connectedCallback() {
154
+ var t2;
155
+ void 0 === this.renderRoot && (this.renderRoot = this.createRenderRoot()), this.enableUpdating(true), null === (t2 = this._$ES) || void 0 === t2 || t2.forEach((t3) => {
156
+ var i2;
157
+ return null === (i2 = t3.hostConnected) || void 0 === i2 ? void 0 : i2.call(t3);
158
+ });
159
+ }
160
+ enableUpdating(t2) {
161
+ }
162
+ disconnectedCallback() {
163
+ var t2;
164
+ null === (t2 = this._$ES) || void 0 === t2 || t2.forEach((t3) => {
165
+ var i2;
166
+ return null === (i2 = t3.hostDisconnected) || void 0 === i2 ? void 0 : i2.call(t3);
167
+ });
168
+ }
169
+ attributeChangedCallback(t2, i2, s2) {
170
+ this._$AK(t2, s2);
171
+ }
172
+ _$EO(t2, i2, s2 = l$2) {
173
+ var e2;
174
+ const r2 = this.constructor._$Ep(t2, s2);
175
+ if (void 0 !== r2 && true === s2.reflect) {
176
+ const h2 = (void 0 !== (null === (e2 = s2.converter) || void 0 === e2 ? void 0 : e2.toAttribute) ? s2.converter : n$5).toAttribute(i2, s2.type);
177
+ this._$El = t2, null == h2 ? this.removeAttribute(r2) : this.setAttribute(r2, h2), this._$El = null;
178
+ }
179
+ }
180
+ _$AK(t2, i2) {
181
+ var s2;
182
+ const e2 = this.constructor, r2 = e2._$Ev.get(t2);
183
+ if (void 0 !== r2 && this._$El !== r2) {
184
+ const t3 = e2.getPropertyOptions(r2), h2 = "function" == typeof t3.converter ? { fromAttribute: t3.converter } : void 0 !== (null === (s2 = t3.converter) || void 0 === s2 ? void 0 : s2.fromAttribute) ? t3.converter : n$5;
185
+ this._$El = r2, this[r2] = h2.fromAttribute(i2, t3.type), this._$El = null;
186
+ }
187
+ }
188
+ requestUpdate(t2, i2, s2) {
189
+ let e2 = true;
190
+ void 0 !== t2 && (((s2 = s2 || this.constructor.getPropertyOptions(t2)).hasChanged || a$1)(this[t2], i2) ? (this._$AL.has(t2) || this._$AL.set(t2, i2), true === s2.reflect && this._$El !== t2 && (void 0 === this._$EC && (this._$EC = /* @__PURE__ */ new Map()), this._$EC.set(t2, s2))) : e2 = false), !this.isUpdatePending && e2 && (this._$E_ = this._$Ej());
191
+ }
192
+ async _$Ej() {
193
+ this.isUpdatePending = true;
194
+ try {
195
+ await this._$E_;
196
+ } catch (t3) {
197
+ Promise.reject(t3);
198
+ }
199
+ const t2 = this.scheduleUpdate();
200
+ return null != t2 && await t2, !this.isUpdatePending;
201
+ }
202
+ scheduleUpdate() {
203
+ return this.performUpdate();
204
+ }
205
+ performUpdate() {
206
+ var t2;
207
+ if (!this.isUpdatePending)
208
+ return;
209
+ this.hasUpdated, this._$Ei && (this._$Ei.forEach((t3, i3) => this[i3] = t3), this._$Ei = void 0);
210
+ let i2 = false;
211
+ const s2 = this._$AL;
212
+ try {
213
+ i2 = this.shouldUpdate(s2), i2 ? (this.willUpdate(s2), null === (t2 = this._$ES) || void 0 === t2 || t2.forEach((t3) => {
214
+ var i3;
215
+ return null === (i3 = t3.hostUpdate) || void 0 === i3 ? void 0 : i3.call(t3);
216
+ }), this.update(s2)) : this._$Ek();
217
+ } catch (t3) {
218
+ throw i2 = false, this._$Ek(), t3;
219
+ }
220
+ i2 && this._$AE(s2);
221
+ }
222
+ willUpdate(t2) {
223
+ }
224
+ _$AE(t2) {
225
+ var i2;
226
+ null === (i2 = this._$ES) || void 0 === i2 || i2.forEach((t3) => {
227
+ var i3;
228
+ return null === (i3 = t3.hostUpdated) || void 0 === i3 ? void 0 : i3.call(t3);
229
+ }), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t2)), this.updated(t2);
230
+ }
231
+ _$Ek() {
232
+ this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false;
233
+ }
234
+ get updateComplete() {
235
+ return this.getUpdateComplete();
236
+ }
237
+ getUpdateComplete() {
238
+ return this._$E_;
239
+ }
240
+ shouldUpdate(t2) {
241
+ return true;
242
+ }
243
+ update(t2) {
244
+ void 0 !== this._$EC && (this._$EC.forEach((t3, i2) => this._$EO(i2, this[i2], t3)), this._$EC = void 0), this._$Ek();
245
+ }
246
+ updated(t2) {
247
+ }
248
+ firstUpdated(t2) {
249
+ }
250
+ };
251
+ u$1[d$1] = true, u$1.elementProperties = /* @__PURE__ */ new Map(), u$1.elementStyles = [], u$1.shadowRootOptions = { mode: "open" }, null == o$3 || o$3({ ReactiveElement: u$1 }), (null !== (s$2 = e$5.reactiveElementVersions) && void 0 !== s$2 ? s$2 : e$5.reactiveElementVersions = []).push("1.6.3");
252
+ /**
253
+ * @license
254
+ * Copyright 2017 Google LLC
255
+ * SPDX-License-Identifier: BSD-3-Clause
256
+ */
257
+ var t$2;
258
+ const i$2 = window, s$1 = i$2.trustedTypes, e$4 = s$1 ? s$1.createPolicy("lit-html", { createHTML: (t2) => t2 }) : void 0, o$2 = "$lit$", n$4 = `lit$${(Math.random() + "").slice(9)}$`, l$1 = "?" + n$4, h = `<${l$1}>`, r = document, u2 = () => r.createComment(""), d = (t2) => null === t2 || "object" != typeof t2 && "function" != typeof t2, c = Array.isArray, v = (t2) => c(t2) || "function" == typeof (null == t2 ? void 0 : t2[Symbol.iterator]), a = "[ \n\f\r]", f = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, _ = /-->/g, m = />/g, p = RegExp(`>|${a}(?:([^\\s"'>=/]+)(${a}*=${a}*(?:[^
259
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), g = /'/g, $ = /"/g, y = /^(?:script|style|textarea|title)$/i, w = (t2) => (i2, ...s2) => ({ _$litType$: t2, strings: i2, values: s2 }), x = w(1), T = Symbol.for("lit-noChange"), A = Symbol.for("lit-nothing"), E = /* @__PURE__ */ new WeakMap(), C = r.createTreeWalker(r, 129, null, false);
260
+ function P(t2, i2) {
261
+ if (!Array.isArray(t2) || !t2.hasOwnProperty("raw"))
262
+ throw Error("invalid template strings array");
263
+ return void 0 !== e$4 ? e$4.createHTML(i2) : i2;
264
+ }
265
+ const V = (t2, i2) => {
266
+ const s2 = t2.length - 1, e2 = [];
267
+ let l2, r2 = 2 === i2 ? "<svg>" : "", u3 = f;
268
+ for (let i3 = 0; i3 < s2; i3++) {
269
+ const s3 = t2[i3];
270
+ let d2, c2, v2 = -1, a2 = 0;
271
+ for (; a2 < s3.length && (u3.lastIndex = a2, c2 = u3.exec(s3), null !== c2); )
272
+ a2 = u3.lastIndex, u3 === f ? "!--" === c2[1] ? u3 = _ : void 0 !== c2[1] ? u3 = m : void 0 !== c2[2] ? (y.test(c2[2]) && (l2 = RegExp("</" + c2[2], "g")), u3 = p) : void 0 !== c2[3] && (u3 = p) : u3 === p ? ">" === c2[0] ? (u3 = null != l2 ? l2 : f, v2 = -1) : void 0 === c2[1] ? v2 = -2 : (v2 = u3.lastIndex - c2[2].length, d2 = c2[1], u3 = void 0 === c2[3] ? p : '"' === c2[3] ? $ : g) : u3 === $ || u3 === g ? u3 = p : u3 === _ || u3 === m ? u3 = f : (u3 = p, l2 = void 0);
273
+ const w2 = u3 === p && t2[i3 + 1].startsWith("/>") ? " " : "";
274
+ r2 += u3 === f ? s3 + h : v2 >= 0 ? (e2.push(d2), s3.slice(0, v2) + o$2 + s3.slice(v2) + n$4 + w2) : s3 + n$4 + (-2 === v2 ? (e2.push(void 0), i3) : w2);
275
+ }
276
+ return [P(t2, r2 + (t2[s2] || "<?>") + (2 === i2 ? "</svg>" : "")), e2];
277
+ };
278
+ class N {
279
+ constructor({ strings: t2, _$litType$: i2 }, e2) {
280
+ let h2;
281
+ this.parts = [];
282
+ let r2 = 0, d2 = 0;
283
+ const c2 = t2.length - 1, v2 = this.parts, [a2, f2] = V(t2, i2);
284
+ if (this.el = N.createElement(a2, e2), C.currentNode = this.el.content, 2 === i2) {
285
+ const t3 = this.el.content, i3 = t3.firstChild;
286
+ i3.remove(), t3.append(...i3.childNodes);
287
+ }
288
+ for (; null !== (h2 = C.nextNode()) && v2.length < c2; ) {
289
+ if (1 === h2.nodeType) {
290
+ if (h2.hasAttributes()) {
291
+ const t3 = [];
292
+ for (const i3 of h2.getAttributeNames())
293
+ if (i3.endsWith(o$2) || i3.startsWith(n$4)) {
294
+ const s2 = f2[d2++];
295
+ if (t3.push(i3), void 0 !== s2) {
296
+ const t4 = h2.getAttribute(s2.toLowerCase() + o$2).split(n$4), i4 = /([.?@])?(.*)/.exec(s2);
297
+ v2.push({ type: 1, index: r2, name: i4[2], strings: t4, ctor: "." === i4[1] ? H : "?" === i4[1] ? L : "@" === i4[1] ? z : k });
298
+ } else
299
+ v2.push({ type: 6, index: r2 });
300
+ }
301
+ for (const i3 of t3)
302
+ h2.removeAttribute(i3);
303
+ }
304
+ if (y.test(h2.tagName)) {
305
+ const t3 = h2.textContent.split(n$4), i3 = t3.length - 1;
306
+ if (i3 > 0) {
307
+ h2.textContent = s$1 ? s$1.emptyScript : "";
308
+ for (let s2 = 0; s2 < i3; s2++)
309
+ h2.append(t3[s2], u2()), C.nextNode(), v2.push({ type: 2, index: ++r2 });
310
+ h2.append(t3[i3], u2());
311
+ }
312
+ }
313
+ } else if (8 === h2.nodeType)
314
+ if (h2.data === l$1)
315
+ v2.push({ type: 2, index: r2 });
316
+ else {
317
+ let t3 = -1;
318
+ for (; -1 !== (t3 = h2.data.indexOf(n$4, t3 + 1)); )
319
+ v2.push({ type: 7, index: r2 }), t3 += n$4.length - 1;
320
+ }
321
+ r2++;
322
+ }
323
+ }
324
+ static createElement(t2, i2) {
325
+ const s2 = r.createElement("template");
326
+ return s2.innerHTML = t2, s2;
327
+ }
328
+ }
329
+ function S(t2, i2, s2 = t2, e2) {
330
+ var o3, n2, l2, h2;
331
+ if (i2 === T)
332
+ return i2;
333
+ let r2 = void 0 !== e2 ? null === (o3 = s2._$Co) || void 0 === o3 ? void 0 : o3[e2] : s2._$Cl;
334
+ const u3 = d(i2) ? void 0 : i2._$litDirective$;
335
+ return (null == r2 ? void 0 : r2.constructor) !== u3 && (null === (n2 = null == r2 ? void 0 : r2._$AO) || void 0 === n2 || n2.call(r2, false), void 0 === u3 ? r2 = void 0 : (r2 = new u3(t2), r2._$AT(t2, s2, e2)), void 0 !== e2 ? (null !== (l2 = (h2 = s2)._$Co) && void 0 !== l2 ? l2 : h2._$Co = [])[e2] = r2 : s2._$Cl = r2), void 0 !== r2 && (i2 = S(t2, r2._$AS(t2, i2.values), r2, e2)), i2;
336
+ }
337
+ class M {
338
+ constructor(t2, i2) {
339
+ this._$AV = [], this._$AN = void 0, this._$AD = t2, this._$AM = i2;
340
+ }
341
+ get parentNode() {
342
+ return this._$AM.parentNode;
343
+ }
344
+ get _$AU() {
345
+ return this._$AM._$AU;
346
+ }
347
+ u(t2) {
348
+ var i2;
349
+ const { el: { content: s2 }, parts: e2 } = this._$AD, o3 = (null !== (i2 = null == t2 ? void 0 : t2.creationScope) && void 0 !== i2 ? i2 : r).importNode(s2, true);
350
+ C.currentNode = o3;
351
+ let n2 = C.nextNode(), l2 = 0, h2 = 0, u3 = e2[0];
352
+ for (; void 0 !== u3; ) {
353
+ if (l2 === u3.index) {
354
+ let i3;
355
+ 2 === u3.type ? i3 = new R(n2, n2.nextSibling, this, t2) : 1 === u3.type ? i3 = new u3.ctor(n2, u3.name, u3.strings, this, t2) : 6 === u3.type && (i3 = new Z(n2, this, t2)), this._$AV.push(i3), u3 = e2[++h2];
356
+ }
357
+ l2 !== (null == u3 ? void 0 : u3.index) && (n2 = C.nextNode(), l2++);
358
+ }
359
+ return C.currentNode = r, o3;
360
+ }
361
+ v(t2) {
362
+ let i2 = 0;
363
+ for (const s2 of this._$AV)
364
+ void 0 !== s2 && (void 0 !== s2.strings ? (s2._$AI(t2, s2, i2), i2 += s2.strings.length - 2) : s2._$AI(t2[i2])), i2++;
365
+ }
366
+ }
367
+ class R {
368
+ constructor(t2, i2, s2, e2) {
369
+ var o3;
370
+ this.type = 2, this._$AH = A, this._$AN = void 0, this._$AA = t2, this._$AB = i2, this._$AM = s2, this.options = e2, this._$Cp = null === (o3 = null == e2 ? void 0 : e2.isConnected) || void 0 === o3 || o3;
371
+ }
372
+ get _$AU() {
373
+ var t2, i2;
374
+ return null !== (i2 = null === (t2 = this._$AM) || void 0 === t2 ? void 0 : t2._$AU) && void 0 !== i2 ? i2 : this._$Cp;
375
+ }
376
+ get parentNode() {
377
+ let t2 = this._$AA.parentNode;
378
+ const i2 = this._$AM;
379
+ return void 0 !== i2 && 11 === (null == t2 ? void 0 : t2.nodeType) && (t2 = i2.parentNode), t2;
380
+ }
381
+ get startNode() {
382
+ return this._$AA;
383
+ }
384
+ get endNode() {
385
+ return this._$AB;
386
+ }
387
+ _$AI(t2, i2 = this) {
388
+ t2 = S(this, t2, i2), d(t2) ? t2 === A || null == t2 || "" === t2 ? (this._$AH !== A && this._$AR(), this._$AH = A) : t2 !== this._$AH && t2 !== T && this._(t2) : void 0 !== t2._$litType$ ? this.g(t2) : void 0 !== t2.nodeType ? this.$(t2) : v(t2) ? this.T(t2) : this._(t2);
389
+ }
390
+ k(t2) {
391
+ return this._$AA.parentNode.insertBefore(t2, this._$AB);
392
+ }
393
+ $(t2) {
394
+ this._$AH !== t2 && (this._$AR(), this._$AH = this.k(t2));
395
+ }
396
+ _(t2) {
397
+ this._$AH !== A && d(this._$AH) ? this._$AA.nextSibling.data = t2 : this.$(r.createTextNode(t2)), this._$AH = t2;
398
+ }
399
+ g(t2) {
400
+ var i2;
401
+ const { values: s2, _$litType$: e2 } = t2, o3 = "number" == typeof e2 ? this._$AC(t2) : (void 0 === e2.el && (e2.el = N.createElement(P(e2.h, e2.h[0]), this.options)), e2);
402
+ if ((null === (i2 = this._$AH) || void 0 === i2 ? void 0 : i2._$AD) === o3)
403
+ this._$AH.v(s2);
404
+ else {
405
+ const t3 = new M(o3, this), i3 = t3.u(this.options);
406
+ t3.v(s2), this.$(i3), this._$AH = t3;
407
+ }
408
+ }
409
+ _$AC(t2) {
410
+ let i2 = E.get(t2.strings);
411
+ return void 0 === i2 && E.set(t2.strings, i2 = new N(t2)), i2;
412
+ }
413
+ T(t2) {
414
+ c(this._$AH) || (this._$AH = [], this._$AR());
415
+ const i2 = this._$AH;
416
+ let s2, e2 = 0;
417
+ for (const o3 of t2)
418
+ e2 === i2.length ? i2.push(s2 = new R(this.k(u2()), this.k(u2()), this, this.options)) : s2 = i2[e2], s2._$AI(o3), e2++;
419
+ e2 < i2.length && (this._$AR(s2 && s2._$AB.nextSibling, e2), i2.length = e2);
420
+ }
421
+ _$AR(t2 = this._$AA.nextSibling, i2) {
422
+ var s2;
423
+ for (null === (s2 = this._$AP) || void 0 === s2 || s2.call(this, false, true, i2); t2 && t2 !== this._$AB; ) {
424
+ const i3 = t2.nextSibling;
425
+ t2.remove(), t2 = i3;
426
+ }
427
+ }
428
+ setConnected(t2) {
429
+ var i2;
430
+ void 0 === this._$AM && (this._$Cp = t2, null === (i2 = this._$AP) || void 0 === i2 || i2.call(this, t2));
431
+ }
432
+ }
433
+ class k {
434
+ constructor(t2, i2, s2, e2, o3) {
435
+ this.type = 1, this._$AH = A, this._$AN = void 0, this.element = t2, this.name = i2, this._$AM = e2, this.options = o3, s2.length > 2 || "" !== s2[0] || "" !== s2[1] ? (this._$AH = Array(s2.length - 1).fill(new String()), this.strings = s2) : this._$AH = A;
436
+ }
437
+ get tagName() {
438
+ return this.element.tagName;
439
+ }
440
+ get _$AU() {
441
+ return this._$AM._$AU;
442
+ }
443
+ _$AI(t2, i2 = this, s2, e2) {
444
+ const o3 = this.strings;
445
+ let n2 = false;
446
+ if (void 0 === o3)
447
+ t2 = S(this, t2, i2, 0), n2 = !d(t2) || t2 !== this._$AH && t2 !== T, n2 && (this._$AH = t2);
448
+ else {
449
+ const e3 = t2;
450
+ let l2, h2;
451
+ for (t2 = o3[0], l2 = 0; l2 < o3.length - 1; l2++)
452
+ h2 = S(this, e3[s2 + l2], i2, l2), h2 === T && (h2 = this._$AH[l2]), n2 || (n2 = !d(h2) || h2 !== this._$AH[l2]), h2 === A ? t2 = A : t2 !== A && (t2 += (null != h2 ? h2 : "") + o3[l2 + 1]), this._$AH[l2] = h2;
453
+ }
454
+ n2 && !e2 && this.j(t2);
455
+ }
456
+ j(t2) {
457
+ t2 === A ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, null != t2 ? t2 : "");
458
+ }
459
+ }
460
+ class H extends k {
461
+ constructor() {
462
+ super(...arguments), this.type = 3;
463
+ }
464
+ j(t2) {
465
+ this.element[this.name] = t2 === A ? void 0 : t2;
466
+ }
467
+ }
468
+ const I = s$1 ? s$1.emptyScript : "";
469
+ class L extends k {
470
+ constructor() {
471
+ super(...arguments), this.type = 4;
472
+ }
473
+ j(t2) {
474
+ t2 && t2 !== A ? this.element.setAttribute(this.name, I) : this.element.removeAttribute(this.name);
475
+ }
476
+ }
477
+ class z extends k {
478
+ constructor(t2, i2, s2, e2, o3) {
479
+ super(t2, i2, s2, e2, o3), this.type = 5;
480
+ }
481
+ _$AI(t2, i2 = this) {
482
+ var s2;
483
+ if ((t2 = null !== (s2 = S(this, t2, i2, 0)) && void 0 !== s2 ? s2 : A) === T)
484
+ return;
485
+ const e2 = this._$AH, o3 = t2 === A && e2 !== A || t2.capture !== e2.capture || t2.once !== e2.once || t2.passive !== e2.passive, n2 = t2 !== A && (e2 === A || o3);
486
+ o3 && this.element.removeEventListener(this.name, this, e2), n2 && this.element.addEventListener(this.name, this, t2), this._$AH = t2;
487
+ }
488
+ handleEvent(t2) {
489
+ var i2, s2;
490
+ "function" == typeof this._$AH ? this._$AH.call(null !== (s2 = null === (i2 = this.options) || void 0 === i2 ? void 0 : i2.host) && void 0 !== s2 ? s2 : this.element, t2) : this._$AH.handleEvent(t2);
491
+ }
492
+ }
493
+ class Z {
494
+ constructor(t2, i2, s2) {
495
+ this.element = t2, this.type = 6, this._$AN = void 0, this._$AM = i2, this.options = s2;
496
+ }
497
+ get _$AU() {
498
+ return this._$AM._$AU;
499
+ }
500
+ _$AI(t2) {
501
+ S(this, t2);
502
+ }
503
+ }
504
+ const B = i$2.litHtmlPolyfillSupport;
505
+ null == B || B(N, R), (null !== (t$2 = i$2.litHtmlVersions) && void 0 !== t$2 ? t$2 : i$2.litHtmlVersions = []).push("2.8.0");
506
+ const D = (t2, i2, s2) => {
507
+ var e2, o3;
508
+ const n2 = null !== (e2 = null == s2 ? void 0 : s2.renderBefore) && void 0 !== e2 ? e2 : i2;
509
+ let l2 = n2._$litPart$;
510
+ if (void 0 === l2) {
511
+ const t3 = null !== (o3 = null == s2 ? void 0 : s2.renderBefore) && void 0 !== o3 ? o3 : null;
512
+ n2._$litPart$ = l2 = new R(i2.insertBefore(u2(), t3), t3, void 0, null != s2 ? s2 : {});
513
+ }
514
+ return l2._$AI(t2), l2;
515
+ };
516
+ /**
517
+ * @license
518
+ * Copyright 2017 Google LLC
519
+ * SPDX-License-Identifier: BSD-3-Clause
520
+ */
521
+ var l, o$1;
522
+ class s extends u$1 {
523
+ constructor() {
524
+ super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
525
+ }
526
+ createRenderRoot() {
527
+ var t2, e2;
528
+ const i2 = super.createRenderRoot();
529
+ return null !== (t2 = (e2 = this.renderOptions).renderBefore) && void 0 !== t2 || (e2.renderBefore = i2.firstChild), i2;
530
+ }
531
+ update(t2) {
532
+ const i2 = this.render();
533
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t2), this._$Do = D(i2, this.renderRoot, this.renderOptions);
534
+ }
535
+ connectedCallback() {
536
+ var t2;
537
+ super.connectedCallback(), null === (t2 = this._$Do) || void 0 === t2 || t2.setConnected(true);
538
+ }
539
+ disconnectedCallback() {
540
+ var t2;
541
+ super.disconnectedCallback(), null === (t2 = this._$Do) || void 0 === t2 || t2.setConnected(false);
542
+ }
543
+ render() {
544
+ return T;
545
+ }
546
+ }
547
+ s.finalized = true, s._$litElement$ = true, null === (l = globalThis.litElementHydrateSupport) || void 0 === l || l.call(globalThis, { LitElement: s });
548
+ const n$3 = globalThis.litElementPolyfillSupport;
549
+ null == n$3 || n$3({ LitElement: s });
550
+ (null !== (o$1 = globalThis.litElementVersions) && void 0 !== o$1 ? o$1 : globalThis.litElementVersions = []).push("3.3.3");
551
+ /**
552
+ * @license
553
+ * Copyright 2017 Google LLC
554
+ * SPDX-License-Identifier: BSD-3-Clause
555
+ */
556
+ const e$3 = (e2) => (n2) => "function" == typeof n2 ? ((e3, n3) => (customElements.define(e3, n3), n3))(e2, n2) : ((e3, n3) => {
557
+ const { kind: t2, elements: s2 } = n3;
558
+ return { kind: t2, elements: s2, finisher(n4) {
559
+ customElements.define(e3, n4);
560
+ } };
561
+ })(e2, n2);
562
+ /**
563
+ * @license
564
+ * Copyright 2017 Google LLC
565
+ * SPDX-License-Identifier: BSD-3-Clause
566
+ */
567
+ const i$1 = (i2, e2) => "method" === e2.kind && e2.descriptor && !("value" in e2.descriptor) ? { ...e2, finisher(n2) {
568
+ n2.createProperty(e2.key, i2);
569
+ } } : { kind: "field", key: Symbol(), placement: "own", descriptor: {}, originalKey: e2.key, initializer() {
570
+ "function" == typeof e2.initializer && (this[e2.key] = e2.initializer.call(this));
571
+ }, finisher(n2) {
572
+ n2.createProperty(e2.key, i2);
573
+ } }, e$2 = (i2, e2, n2) => {
574
+ e2.constructor.createProperty(n2, i2);
575
+ };
576
+ function n$2(n2) {
577
+ return (t2, o3) => void 0 !== o3 ? e$2(n2, t2, o3) : i$1(n2, t2);
578
+ }
579
+ /**
580
+ * @license
581
+ * Copyright 2017 Google LLC
582
+ * SPDX-License-Identifier: BSD-3-Clause
583
+ */
584
+ function t$1(t2) {
585
+ return n$2({ ...t2, state: true });
586
+ }
587
+ /**
588
+ * @license
589
+ * Copyright 2021 Google LLC
590
+ * SPDX-License-Identifier: BSD-3-Clause
591
+ */
592
+ var n$1;
593
+ null != (null === (n$1 = window.HTMLSlotElement) || void 0 === n$1 ? void 0 : n$1.prototype.assignedElements) ? (o3, n2) => o3.assignedElements(n2) : (o3, n2) => o3.assignedNodes(n2).filter((o4) => o4.nodeType === Node.ELEMENT_NODE);
594
+ const millisecondsInDay = 864e5;
595
+ const millisecondsInMinute = 6e4;
596
+ const millisecondsInHour = 36e5;
597
+ const constructFromSymbol = Symbol.for("constructDateFrom");
598
+ function constructFrom(date, value) {
599
+ if (typeof date === "function")
600
+ return date(value);
601
+ if (date && typeof date === "object" && constructFromSymbol in date)
602
+ return date[constructFromSymbol](value);
603
+ if (date instanceof Date)
604
+ return new date.constructor(value);
605
+ return new Date(value);
606
+ }
607
+ function toDate$1(argument, context) {
608
+ return constructFrom(context || argument, argument);
609
+ }
610
+ function getTimezoneOffsetInMilliseconds$1(date) {
611
+ const _date = toDate$1(date);
612
+ const utcDate = new Date(
613
+ Date.UTC(
614
+ _date.getFullYear(),
615
+ _date.getMonth(),
616
+ _date.getDate(),
617
+ _date.getHours(),
618
+ _date.getMinutes(),
619
+ _date.getSeconds(),
620
+ _date.getMilliseconds()
621
+ )
622
+ );
623
+ utcDate.setUTCFullYear(_date.getFullYear());
624
+ return +date - +utcDate;
625
+ }
626
+ function normalizeDates(context, ...dates) {
627
+ const normalize = constructFrom.bind(
628
+ null,
629
+ context || dates.find((date) => typeof date === "object")
630
+ );
631
+ return dates.map(normalize);
632
+ }
633
+ function startOfDay(date, options) {
634
+ const _date = toDate$1(date, options == null ? void 0 : options.in);
635
+ _date.setHours(0, 0, 0, 0);
636
+ return _date;
637
+ }
638
+ function differenceInCalendarDays(laterDate, earlierDate, options) {
639
+ const [laterDate_, earlierDate_] = normalizeDates(
640
+ options == null ? void 0 : options.in,
641
+ laterDate,
642
+ earlierDate
643
+ );
644
+ const laterStartOfDay = startOfDay(laterDate_);
645
+ const earlierStartOfDay = startOfDay(earlierDate_);
646
+ const laterTimestamp = +laterStartOfDay - getTimezoneOffsetInMilliseconds$1(laterStartOfDay);
647
+ const earlierTimestamp = +earlierStartOfDay - getTimezoneOffsetInMilliseconds$1(earlierStartOfDay);
648
+ return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay);
649
+ }
650
+ function addDays(date, amount, options) {
651
+ const _date = toDate$1(date, options == null ? void 0 : options.in);
652
+ if (isNaN(amount))
653
+ return constructFrom((options == null ? void 0 : options.in) || date, NaN);
654
+ if (!amount)
655
+ return _date;
656
+ _date.setDate(_date.getDate() + amount);
657
+ return _date;
658
+ }
659
+ function addMonths(date, amount, options) {
660
+ const _date = toDate$1(date, options == null ? void 0 : options.in);
661
+ if (isNaN(amount))
662
+ return constructFrom((options == null ? void 0 : options.in) || date, NaN);
663
+ if (!amount) {
664
+ return _date;
665
+ }
666
+ const dayOfMonth = _date.getDate();
667
+ const endOfDesiredMonth = constructFrom((options == null ? void 0 : options.in) || date, _date.getTime());
668
+ endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);
669
+ const daysInMonth = endOfDesiredMonth.getDate();
670
+ if (dayOfMonth >= daysInMonth) {
671
+ return endOfDesiredMonth;
672
+ } else {
673
+ _date.setFullYear(
674
+ endOfDesiredMonth.getFullYear(),
675
+ endOfDesiredMonth.getMonth(),
676
+ dayOfMonth
677
+ );
678
+ return _date;
679
+ }
680
+ }
681
+ function add(date, duration, options) {
682
+ const {
683
+ years = 0,
684
+ months = 0,
685
+ weeks = 0,
686
+ days = 0,
687
+ hours = 0,
688
+ minutes = 0,
689
+ seconds = 0
690
+ } = duration;
691
+ const _date = toDate$1(date, options == null ? void 0 : options.in);
692
+ const dateWithMonths = months || years ? addMonths(_date, months + years * 12) : _date;
693
+ const dateWithDays = days || weeks ? addDays(dateWithMonths, days + weeks * 7) : dateWithMonths;
694
+ const minutesToAdd = minutes + hours * 60;
695
+ const secondsToAdd = seconds + minutesToAdd * 60;
696
+ const msToAdd = secondsToAdd * 1e3;
697
+ return constructFrom((options == null ? void 0 : options.in) || date, +dateWithDays + msToAdd);
698
+ }
699
+ function compareAsc(dateLeft, dateRight) {
700
+ const diff = +toDate$1(dateLeft) - +toDate$1(dateRight);
701
+ if (diff < 0)
702
+ return -1;
703
+ else if (diff > 0)
704
+ return 1;
705
+ return diff;
706
+ }
707
+ function differenceInCalendarMonths(laterDate, earlierDate, options) {
708
+ const [laterDate_, earlierDate_] = normalizeDates(
709
+ options == null ? void 0 : options.in,
710
+ laterDate,
711
+ earlierDate
712
+ );
713
+ const yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear();
714
+ const monthsDiff = laterDate_.getMonth() - earlierDate_.getMonth();
715
+ return yearsDiff * 12 + monthsDiff;
716
+ }
717
+ function differenceInCalendarYears(laterDate, earlierDate, options) {
718
+ const [laterDate_, earlierDate_] = normalizeDates(
719
+ options == null ? void 0 : options.in,
720
+ laterDate,
721
+ earlierDate
722
+ );
723
+ return laterDate_.getFullYear() - earlierDate_.getFullYear();
724
+ }
725
+ function differenceInDays(laterDate, earlierDate, options) {
726
+ const [laterDate_, earlierDate_] = normalizeDates(
727
+ options == null ? void 0 : options.in,
728
+ laterDate,
729
+ earlierDate
730
+ );
731
+ const sign = compareLocalAsc(laterDate_, earlierDate_);
732
+ const difference = Math.abs(
733
+ differenceInCalendarDays(laterDate_, earlierDate_)
734
+ );
735
+ laterDate_.setDate(laterDate_.getDate() - sign * difference);
736
+ const isLastDayNotFull = Number(
737
+ compareLocalAsc(laterDate_, earlierDate_) === -sign
738
+ );
739
+ const result = sign * (difference - isLastDayNotFull);
740
+ return result === 0 ? 0 : result;
741
+ }
742
+ function compareLocalAsc(laterDate, earlierDate) {
743
+ const diff = laterDate.getFullYear() - earlierDate.getFullYear() || laterDate.getMonth() - earlierDate.getMonth() || laterDate.getDate() - earlierDate.getDate() || laterDate.getHours() - earlierDate.getHours() || laterDate.getMinutes() - earlierDate.getMinutes() || laterDate.getSeconds() - earlierDate.getSeconds() || laterDate.getMilliseconds() - earlierDate.getMilliseconds();
744
+ if (diff < 0)
745
+ return -1;
746
+ if (diff > 0)
747
+ return 1;
748
+ return diff;
749
+ }
750
+ function getRoundingMethod(method) {
751
+ return (number) => {
752
+ const round = method ? Math[method] : Math.trunc;
753
+ const result = round(number);
754
+ return result === 0 ? 0 : result;
755
+ };
756
+ }
757
+ function differenceInHours(laterDate, earlierDate, options) {
758
+ const [laterDate_, earlierDate_] = normalizeDates(
759
+ options == null ? void 0 : options.in,
760
+ laterDate,
761
+ earlierDate
762
+ );
763
+ const diff = (+laterDate_ - +earlierDate_) / millisecondsInHour;
764
+ return getRoundingMethod(options == null ? void 0 : options.roundingMethod)(diff);
765
+ }
766
+ function differenceInMilliseconds(laterDate, earlierDate) {
767
+ return +toDate$1(laterDate) - +toDate$1(earlierDate);
768
+ }
769
+ function differenceInMinutes(dateLeft, dateRight, options) {
770
+ const diff = differenceInMilliseconds(dateLeft, dateRight) / millisecondsInMinute;
771
+ return getRoundingMethod(options == null ? void 0 : options.roundingMethod)(diff);
772
+ }
773
+ function endOfDay(date, options) {
774
+ const _date = toDate$1(date, options == null ? void 0 : options.in);
775
+ _date.setHours(23, 59, 59, 999);
776
+ return _date;
777
+ }
778
+ function endOfMonth(date, options) {
779
+ const _date = toDate$1(date, options == null ? void 0 : options.in);
780
+ const month = _date.getMonth();
781
+ _date.setFullYear(_date.getFullYear(), month + 1, 0);
782
+ _date.setHours(23, 59, 59, 999);
783
+ return _date;
784
+ }
785
+ function isLastDayOfMonth(date, options) {
786
+ const _date = toDate$1(date, options == null ? void 0 : options.in);
787
+ return +endOfDay(_date, options) === +endOfMonth(_date, options);
788
+ }
789
+ function differenceInMonths(laterDate, earlierDate, options) {
790
+ const [laterDate_, workingLaterDate, earlierDate_] = normalizeDates(
791
+ options == null ? void 0 : options.in,
792
+ laterDate,
793
+ laterDate,
794
+ earlierDate
795
+ );
796
+ const sign = compareAsc(workingLaterDate, earlierDate_);
797
+ const difference = Math.abs(
798
+ differenceInCalendarMonths(workingLaterDate, earlierDate_)
799
+ );
800
+ if (difference < 1)
801
+ return 0;
802
+ if (workingLaterDate.getMonth() === 1 && workingLaterDate.getDate() > 27)
803
+ workingLaterDate.setDate(30);
804
+ workingLaterDate.setMonth(workingLaterDate.getMonth() - sign * difference);
805
+ let isLastMonthNotFull = compareAsc(workingLaterDate, earlierDate_) === -sign;
806
+ if (isLastDayOfMonth(laterDate_) && difference === 1 && compareAsc(laterDate_, earlierDate_) === 1) {
807
+ isLastMonthNotFull = false;
808
+ }
809
+ const result = sign * (difference - +isLastMonthNotFull);
810
+ return result === 0 ? 0 : result;
811
+ }
812
+ function differenceInSeconds(laterDate, earlierDate, options) {
813
+ const diff = differenceInMilliseconds(laterDate, earlierDate) / 1e3;
814
+ return getRoundingMethod(options == null ? void 0 : options.roundingMethod)(diff);
815
+ }
816
+ function differenceInYears(laterDate, earlierDate, options) {
817
+ const [laterDate_, earlierDate_] = normalizeDates(
818
+ options == null ? void 0 : options.in,
819
+ laterDate,
820
+ earlierDate
821
+ );
822
+ const sign = compareAsc(laterDate_, earlierDate_);
823
+ const diff = Math.abs(differenceInCalendarYears(laterDate_, earlierDate_));
824
+ laterDate_.setFullYear(1584);
825
+ earlierDate_.setFullYear(1584);
826
+ const partial = compareAsc(laterDate_, earlierDate_) === -sign;
827
+ const result = sign * (diff - +partial);
828
+ return result === 0 ? 0 : result;
829
+ }
830
+ function normalizeInterval(context, interval) {
831
+ const [start, end] = normalizeDates(context, interval.start, interval.end);
832
+ return { start, end };
833
+ }
834
+ function intervalToDuration(interval, options) {
835
+ const { start, end } = normalizeInterval(options == null ? void 0 : options.in, interval);
836
+ const duration = {};
837
+ const years = differenceInYears(end, start);
838
+ if (years)
839
+ duration.years = years;
840
+ const remainingMonths = add(start, { years: duration.years });
841
+ const months = differenceInMonths(end, remainingMonths);
842
+ if (months)
843
+ duration.months = months;
844
+ const remainingDays = add(remainingMonths, { months: duration.months });
845
+ const days = differenceInDays(end, remainingDays);
846
+ if (days)
847
+ duration.days = days;
848
+ const remainingHours = add(remainingDays, { days: duration.days });
849
+ const hours = differenceInHours(end, remainingHours);
850
+ if (hours)
851
+ duration.hours = hours;
852
+ const remainingMinutes = add(remainingHours, { hours: duration.hours });
853
+ const minutes = differenceInMinutes(end, remainingMinutes);
854
+ if (minutes)
855
+ duration.minutes = minutes;
856
+ const remainingSeconds = add(remainingMinutes, { minutes: duration.minutes });
857
+ const seconds = differenceInSeconds(end, remainingSeconds);
858
+ if (seconds)
859
+ duration.seconds = seconds;
860
+ return duration;
861
+ }
862
+ function tzTokenizeDate(date, timeZone) {
863
+ const dtf = getDateTimeFormat(timeZone);
864
+ return "formatToParts" in dtf ? partsOffset(dtf, date) : hackyOffset(dtf, date);
865
+ }
866
+ const typeToPos = {
867
+ year: 0,
868
+ month: 1,
869
+ day: 2,
870
+ hour: 3,
871
+ minute: 4,
872
+ second: 5
873
+ };
874
+ function partsOffset(dtf, date) {
875
+ try {
876
+ const formatted = dtf.formatToParts(date);
877
+ const filled = [];
878
+ for (let i2 = 0; i2 < formatted.length; i2++) {
879
+ const pos = typeToPos[formatted[i2].type];
880
+ if (pos !== void 0) {
881
+ filled[pos] = parseInt(formatted[i2].value, 10);
882
+ }
883
+ }
884
+ return filled;
885
+ } catch (error) {
886
+ if (error instanceof RangeError) {
887
+ return [NaN];
888
+ }
889
+ throw error;
890
+ }
891
+ }
892
+ function hackyOffset(dtf, date) {
893
+ const formatted = dtf.format(date);
894
+ const parsed = /(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(formatted);
895
+ return [
896
+ parseInt(parsed[3], 10),
897
+ parseInt(parsed[1], 10),
898
+ parseInt(parsed[2], 10),
899
+ parseInt(parsed[4], 10),
900
+ parseInt(parsed[5], 10),
901
+ parseInt(parsed[6], 10)
902
+ ];
903
+ }
904
+ const dtfCache = {};
905
+ const testDateFormatted = new Intl.DateTimeFormat("en-US", {
906
+ hourCycle: "h23",
907
+ timeZone: "America/New_York",
908
+ year: "numeric",
909
+ month: "2-digit",
910
+ day: "2-digit",
911
+ hour: "2-digit",
912
+ minute: "2-digit",
913
+ second: "2-digit"
914
+ }).format(/* @__PURE__ */ new Date("2014-06-25T04:00:00.123Z"));
915
+ const hourCycleSupported = testDateFormatted === "06/25/2014, 00:00:00" || testDateFormatted === "‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";
916
+ function getDateTimeFormat(timeZone) {
917
+ if (!dtfCache[timeZone]) {
918
+ dtfCache[timeZone] = hourCycleSupported ? new Intl.DateTimeFormat("en-US", {
919
+ hourCycle: "h23",
920
+ timeZone,
921
+ year: "numeric",
922
+ month: "numeric",
923
+ day: "2-digit",
924
+ hour: "2-digit",
925
+ minute: "2-digit",
926
+ second: "2-digit"
927
+ }) : new Intl.DateTimeFormat("en-US", {
928
+ hour12: false,
929
+ timeZone,
930
+ year: "numeric",
931
+ month: "numeric",
932
+ day: "2-digit",
933
+ hour: "2-digit",
934
+ minute: "2-digit",
935
+ second: "2-digit"
936
+ });
937
+ }
938
+ return dtfCache[timeZone];
939
+ }
940
+ function newDateUTC(fullYear, month, day, hour, minute, second, millisecond) {
941
+ const utcDate = /* @__PURE__ */ new Date(0);
942
+ utcDate.setUTCFullYear(fullYear, month, day);
943
+ utcDate.setUTCHours(hour, minute, second, millisecond);
944
+ return utcDate;
945
+ }
946
+ const MILLISECONDS_IN_HOUR$1 = 36e5;
947
+ const MILLISECONDS_IN_MINUTE$1 = 6e4;
948
+ const patterns$1 = {
949
+ timezone: /([Z+-].*)$/,
950
+ timezoneZ: /^(Z)$/,
951
+ timezoneHH: /^([+-]\d{2})$/,
952
+ timezoneHHMM: /^([+-])(\d{2}):?(\d{2})$/
953
+ };
954
+ function tzParseTimezone(timezoneString, date, isUtcDate) {
955
+ if (!timezoneString) {
956
+ return 0;
957
+ }
958
+ let token = patterns$1.timezoneZ.exec(timezoneString);
959
+ if (token) {
960
+ return 0;
961
+ }
962
+ let hours;
963
+ let absoluteOffset;
964
+ token = patterns$1.timezoneHH.exec(timezoneString);
965
+ if (token) {
966
+ hours = parseInt(token[1], 10);
967
+ if (!validateTimezone(hours)) {
968
+ return NaN;
969
+ }
970
+ return -(hours * MILLISECONDS_IN_HOUR$1);
971
+ }
972
+ token = patterns$1.timezoneHHMM.exec(timezoneString);
973
+ if (token) {
974
+ hours = parseInt(token[2], 10);
975
+ const minutes = parseInt(token[3], 10);
976
+ if (!validateTimezone(hours, minutes)) {
977
+ return NaN;
978
+ }
979
+ absoluteOffset = Math.abs(hours) * MILLISECONDS_IN_HOUR$1 + minutes * MILLISECONDS_IN_MINUTE$1;
980
+ return token[1] === "+" ? -absoluteOffset : absoluteOffset;
981
+ }
982
+ if (isValidTimezoneIANAString(timezoneString)) {
983
+ date = new Date(date || Date.now());
984
+ const utcDate = isUtcDate ? date : toUtcDate(date);
985
+ const offset = calcOffset(utcDate, timezoneString);
986
+ const fixedOffset = isUtcDate ? offset : fixOffset(date, offset, timezoneString);
987
+ return -fixedOffset;
988
+ }
989
+ return NaN;
990
+ }
991
+ function toUtcDate(date) {
992
+ return newDateUTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());
993
+ }
994
+ function calcOffset(date, timezoneString) {
995
+ const tokens = tzTokenizeDate(date, timezoneString);
996
+ const asUTC = newDateUTC(tokens[0], tokens[1] - 1, tokens[2], tokens[3] % 24, tokens[4], tokens[5], 0).getTime();
997
+ let asTS = date.getTime();
998
+ const over = asTS % 1e3;
999
+ asTS -= over >= 0 ? over : 1e3 + over;
1000
+ return asUTC - asTS;
1001
+ }
1002
+ function fixOffset(date, offset, timezoneString) {
1003
+ const localTS = date.getTime();
1004
+ let utcGuess = localTS - offset;
1005
+ const o22 = calcOffset(new Date(utcGuess), timezoneString);
1006
+ if (offset === o22) {
1007
+ return offset;
1008
+ }
1009
+ utcGuess -= o22 - offset;
1010
+ const o3 = calcOffset(new Date(utcGuess), timezoneString);
1011
+ if (o22 === o3) {
1012
+ return o22;
1013
+ }
1014
+ return Math.max(o22, o3);
1015
+ }
1016
+ function validateTimezone(hours, minutes) {
1017
+ return -23 <= hours && hours <= 23 && (minutes == null || 0 <= minutes && minutes <= 59);
1018
+ }
1019
+ const validIANATimezoneCache = {};
1020
+ function isValidTimezoneIANAString(timeZoneString) {
1021
+ if (validIANATimezoneCache[timeZoneString])
1022
+ return true;
1023
+ try {
1024
+ new Intl.DateTimeFormat(void 0, { timeZone: timeZoneString });
1025
+ validIANATimezoneCache[timeZoneString] = true;
1026
+ return true;
1027
+ } catch (error) {
1028
+ return false;
1029
+ }
1030
+ }
1031
+ function getTimezoneOffsetInMilliseconds(date) {
1032
+ const utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
1033
+ utcDate.setUTCFullYear(date.getFullYear());
1034
+ return +date - +utcDate;
1035
+ }
1036
+ const tzPattern = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/;
1037
+ const MILLISECONDS_IN_HOUR = 36e5;
1038
+ const MILLISECONDS_IN_MINUTE = 6e4;
1039
+ const DEFAULT_ADDITIONAL_DIGITS = 2;
1040
+ const patterns = {
1041
+ dateTimePattern: /^([0-9W+-]+)(T| )(.*)/,
1042
+ datePattern: /^([0-9W+-]+)(.*)/,
1043
+ plainTime: /:/,
1044
+ // year tokens
1045
+ YY: /^(\d{2})$/,
1046
+ YYY: [
1047
+ /^([+-]\d{2})$/,
1048
+ // 0 additional digits
1049
+ /^([+-]\d{3})$/,
1050
+ // 1 additional digit
1051
+ /^([+-]\d{4})$/
1052
+ // 2 additional digits
1053
+ ],
1054
+ YYYY: /^(\d{4})/,
1055
+ YYYYY: [
1056
+ /^([+-]\d{4})/,
1057
+ // 0 additional digits
1058
+ /^([+-]\d{5})/,
1059
+ // 1 additional digit
1060
+ /^([+-]\d{6})/
1061
+ // 2 additional digits
1062
+ ],
1063
+ // date tokens
1064
+ MM: /^-(\d{2})$/,
1065
+ DDD: /^-?(\d{3})$/,
1066
+ MMDD: /^-?(\d{2})-?(\d{2})$/,
1067
+ Www: /^-?W(\d{2})$/,
1068
+ WwwD: /^-?W(\d{2})-?(\d{1})$/,
1069
+ HH: /^(\d{2}([.,]\d*)?)$/,
1070
+ HHMM: /^(\d{2}):?(\d{2}([.,]\d*)?)$/,
1071
+ HHMMSS: /^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,
1072
+ // time zone tokens (to identify the presence of a tz)
1073
+ timeZone: tzPattern
1074
+ };
1075
+ function toDate(argument, options = {}) {
1076
+ if (arguments.length < 1) {
1077
+ throw new TypeError("1 argument required, but only " + arguments.length + " present");
1078
+ }
1079
+ if (argument === null) {
1080
+ return /* @__PURE__ */ new Date(NaN);
1081
+ }
1082
+ const additionalDigits = options.additionalDigits == null ? DEFAULT_ADDITIONAL_DIGITS : Number(options.additionalDigits);
1083
+ if (additionalDigits !== 2 && additionalDigits !== 1 && additionalDigits !== 0) {
1084
+ throw new RangeError("additionalDigits must be 0, 1 or 2");
1085
+ }
1086
+ if (argument instanceof Date || typeof argument === "object" && Object.prototype.toString.call(argument) === "[object Date]") {
1087
+ return new Date(argument.getTime());
1088
+ } else if (typeof argument === "number" || Object.prototype.toString.call(argument) === "[object Number]") {
1089
+ return new Date(argument);
1090
+ } else if (!(Object.prototype.toString.call(argument) === "[object String]")) {
1091
+ return /* @__PURE__ */ new Date(NaN);
1092
+ }
1093
+ const dateStrings = splitDateString(argument);
1094
+ const { year, restDateString } = parseYear(dateStrings.date, additionalDigits);
1095
+ const date = parseDate(restDateString, year);
1096
+ if (date === null || isNaN(date.getTime())) {
1097
+ return /* @__PURE__ */ new Date(NaN);
1098
+ }
1099
+ if (date) {
1100
+ const timestamp = date.getTime();
1101
+ let time = 0;
1102
+ let offset;
1103
+ if (dateStrings.time) {
1104
+ time = parseTime(dateStrings.time);
1105
+ if (time === null || isNaN(time)) {
1106
+ return /* @__PURE__ */ new Date(NaN);
1107
+ }
1108
+ }
1109
+ if (dateStrings.timeZone || options.timeZone) {
1110
+ offset = tzParseTimezone(dateStrings.timeZone || options.timeZone, new Date(timestamp + time));
1111
+ if (isNaN(offset)) {
1112
+ return /* @__PURE__ */ new Date(NaN);
1113
+ }
1114
+ } else {
1115
+ offset = getTimezoneOffsetInMilliseconds(new Date(timestamp + time));
1116
+ offset = getTimezoneOffsetInMilliseconds(new Date(timestamp + time + offset));
1117
+ }
1118
+ return new Date(timestamp + time + offset);
1119
+ } else {
1120
+ return /* @__PURE__ */ new Date(NaN);
1121
+ }
1122
+ }
1123
+ function splitDateString(dateString) {
1124
+ const dateStrings = {};
1125
+ let parts = patterns.dateTimePattern.exec(dateString);
1126
+ let timeString;
1127
+ if (!parts) {
1128
+ parts = patterns.datePattern.exec(dateString);
1129
+ if (parts) {
1130
+ dateStrings.date = parts[1];
1131
+ timeString = parts[2];
1132
+ } else {
1133
+ dateStrings.date = null;
1134
+ timeString = dateString;
1135
+ }
1136
+ } else {
1137
+ dateStrings.date = parts[1];
1138
+ timeString = parts[3];
1139
+ }
1140
+ if (timeString) {
1141
+ const token = patterns.timeZone.exec(timeString);
1142
+ if (token) {
1143
+ dateStrings.time = timeString.replace(token[1], "");
1144
+ dateStrings.timeZone = token[1].trim();
1145
+ } else {
1146
+ dateStrings.time = timeString;
1147
+ }
1148
+ }
1149
+ return dateStrings;
1150
+ }
1151
+ function parseYear(dateString, additionalDigits) {
1152
+ if (dateString) {
1153
+ const patternYYY = patterns.YYY[additionalDigits];
1154
+ const patternYYYYY = patterns.YYYYY[additionalDigits];
1155
+ let token = patterns.YYYY.exec(dateString) || patternYYYYY.exec(dateString);
1156
+ if (token) {
1157
+ const yearString = token[1];
1158
+ return {
1159
+ year: parseInt(yearString, 10),
1160
+ restDateString: dateString.slice(yearString.length)
1161
+ };
1162
+ }
1163
+ token = patterns.YY.exec(dateString) || patternYYY.exec(dateString);
1164
+ if (token) {
1165
+ const centuryString = token[1];
1166
+ return {
1167
+ year: parseInt(centuryString, 10) * 100,
1168
+ restDateString: dateString.slice(centuryString.length)
1169
+ };
1170
+ }
1171
+ }
1172
+ return {
1173
+ year: null
1174
+ };
1175
+ }
1176
+ function parseDate(dateString, year) {
1177
+ if (year === null) {
1178
+ return null;
1179
+ }
1180
+ let date;
1181
+ let month;
1182
+ let week;
1183
+ if (!dateString || !dateString.length) {
1184
+ date = /* @__PURE__ */ new Date(0);
1185
+ date.setUTCFullYear(year);
1186
+ return date;
1187
+ }
1188
+ let token = patterns.MM.exec(dateString);
1189
+ if (token) {
1190
+ date = /* @__PURE__ */ new Date(0);
1191
+ month = parseInt(token[1], 10) - 1;
1192
+ if (!validateDate(year, month)) {
1193
+ return /* @__PURE__ */ new Date(NaN);
1194
+ }
1195
+ date.setUTCFullYear(year, month);
1196
+ return date;
1197
+ }
1198
+ token = patterns.DDD.exec(dateString);
1199
+ if (token) {
1200
+ date = /* @__PURE__ */ new Date(0);
1201
+ const dayOfYear = parseInt(token[1], 10);
1202
+ if (!validateDayOfYearDate(year, dayOfYear)) {
1203
+ return /* @__PURE__ */ new Date(NaN);
1204
+ }
1205
+ date.setUTCFullYear(year, 0, dayOfYear);
1206
+ return date;
1207
+ }
1208
+ token = patterns.MMDD.exec(dateString);
1209
+ if (token) {
1210
+ date = /* @__PURE__ */ new Date(0);
1211
+ month = parseInt(token[1], 10) - 1;
1212
+ const day = parseInt(token[2], 10);
1213
+ if (!validateDate(year, month, day)) {
1214
+ return /* @__PURE__ */ new Date(NaN);
1215
+ }
1216
+ date.setUTCFullYear(year, month, day);
1217
+ return date;
1218
+ }
1219
+ token = patterns.Www.exec(dateString);
1220
+ if (token) {
1221
+ week = parseInt(token[1], 10) - 1;
1222
+ if (!validateWeekDate(week)) {
1223
+ return /* @__PURE__ */ new Date(NaN);
1224
+ }
1225
+ return dayOfISOWeekYear(year, week);
1226
+ }
1227
+ token = patterns.WwwD.exec(dateString);
1228
+ if (token) {
1229
+ week = parseInt(token[1], 10) - 1;
1230
+ const dayOfWeek = parseInt(token[2], 10) - 1;
1231
+ if (!validateWeekDate(week, dayOfWeek)) {
1232
+ return /* @__PURE__ */ new Date(NaN);
1233
+ }
1234
+ return dayOfISOWeekYear(year, week, dayOfWeek);
1235
+ }
1236
+ return null;
1237
+ }
1238
+ function parseTime(timeString) {
1239
+ let hours;
1240
+ let minutes;
1241
+ let token = patterns.HH.exec(timeString);
1242
+ if (token) {
1243
+ hours = parseFloat(token[1].replace(",", "."));
1244
+ if (!validateTime(hours)) {
1245
+ return NaN;
1246
+ }
1247
+ return hours % 24 * MILLISECONDS_IN_HOUR;
1248
+ }
1249
+ token = patterns.HHMM.exec(timeString);
1250
+ if (token) {
1251
+ hours = parseInt(token[1], 10);
1252
+ minutes = parseFloat(token[2].replace(",", "."));
1253
+ if (!validateTime(hours, minutes)) {
1254
+ return NaN;
1255
+ }
1256
+ return hours % 24 * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE;
1257
+ }
1258
+ token = patterns.HHMMSS.exec(timeString);
1259
+ if (token) {
1260
+ hours = parseInt(token[1], 10);
1261
+ minutes = parseInt(token[2], 10);
1262
+ const seconds = parseFloat(token[3].replace(",", "."));
1263
+ if (!validateTime(hours, minutes, seconds)) {
1264
+ return NaN;
1265
+ }
1266
+ return hours % 24 * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE + seconds * 1e3;
1267
+ }
1268
+ return null;
1269
+ }
1270
+ function dayOfISOWeekYear(isoWeekYear, week, day) {
1271
+ week = week || 0;
1272
+ day = day || 0;
1273
+ const date = /* @__PURE__ */ new Date(0);
1274
+ date.setUTCFullYear(isoWeekYear, 0, 4);
1275
+ const fourthOfJanuaryDay = date.getUTCDay() || 7;
1276
+ const diff = week * 7 + day + 1 - fourthOfJanuaryDay;
1277
+ date.setUTCDate(date.getUTCDate() + diff);
1278
+ return date;
1279
+ }
1280
+ const DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
1281
+ const DAYS_IN_MONTH_LEAP_YEAR = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
1282
+ function isLeapYearIndex(year) {
1283
+ return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
1284
+ }
1285
+ function validateDate(year, month, date) {
1286
+ if (month < 0 || month > 11) {
1287
+ return false;
1288
+ }
1289
+ if (date != null) {
1290
+ if (date < 1) {
1291
+ return false;
1292
+ }
1293
+ const isLeapYear = isLeapYearIndex(year);
1294
+ if (isLeapYear && date > DAYS_IN_MONTH_LEAP_YEAR[month]) {
1295
+ return false;
1296
+ }
1297
+ if (!isLeapYear && date > DAYS_IN_MONTH[month]) {
1298
+ return false;
1299
+ }
1300
+ }
1301
+ return true;
1302
+ }
1303
+ function validateDayOfYearDate(year, dayOfYear) {
1304
+ if (dayOfYear < 1) {
1305
+ return false;
1306
+ }
1307
+ const isLeapYear = isLeapYearIndex(year);
1308
+ if (isLeapYear && dayOfYear > 366) {
1309
+ return false;
1310
+ }
1311
+ if (!isLeapYear && dayOfYear > 365) {
1312
+ return false;
1313
+ }
1314
+ return true;
1315
+ }
1316
+ function validateWeekDate(week, day) {
1317
+ if (week < 0 || week > 52) {
1318
+ return false;
1319
+ }
1320
+ if (day != null && (day < 0 || day > 6)) {
1321
+ return false;
1322
+ }
1323
+ return true;
1324
+ }
1325
+ function validateTime(hours, minutes, seconds) {
1326
+ if (hours < 0 || hours >= 25) {
1327
+ return false;
1328
+ }
1329
+ if (minutes != null && (minutes < 0 || minutes >= 60)) {
1330
+ return false;
1331
+ }
1332
+ if (seconds != null && (seconds < 0 || seconds >= 60)) {
1333
+ return false;
1334
+ }
1335
+ return true;
1336
+ }
1337
+ function toZonedTime(date, timeZone, options) {
1338
+ date = toDate(date, options);
1339
+ const offsetMilliseconds = tzParseTimezone(timeZone, date, true);
1340
+ const d2 = new Date(date.getTime() - offsetMilliseconds);
1341
+ const resultDate = /* @__PURE__ */ new Date(0);
1342
+ resultDate.setFullYear(d2.getUTCFullYear(), d2.getUTCMonth(), d2.getUTCDate());
1343
+ resultDate.setHours(d2.getUTCHours(), d2.getUTCMinutes(), d2.getUTCSeconds(), d2.getUTCMilliseconds());
1344
+ return resultDate;
1345
+ }
1346
+ /**
1347
+ * @license
1348
+ * Copyright 2017 Google LLC
1349
+ * SPDX-License-Identifier: BSD-3-Clause
1350
+ */
1351
+ const t = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 }, e$1 = (t2) => (...e2) => ({ _$litDirective$: t2, values: e2 });
1352
+ class i {
1353
+ constructor(t2) {
1354
+ }
1355
+ get _$AU() {
1356
+ return this._$AM._$AU;
1357
+ }
1358
+ _$AT(t2, e2, i2) {
1359
+ this._$Ct = t2, this._$AM = e2, this._$Ci = i2;
1360
+ }
1361
+ _$AS(t2, e2) {
1362
+ return this.update(t2, e2);
1363
+ }
1364
+ update(t2, e2) {
1365
+ return this.render(...e2);
1366
+ }
1367
+ }
1368
+ /**
1369
+ * @license
1370
+ * Copyright 2017 Google LLC
1371
+ * SPDX-License-Identifier: BSD-3-Clause
1372
+ */
1373
+ class e extends i {
1374
+ constructor(i2) {
1375
+ if (super(i2), this.et = A, i2.type !== t.CHILD)
1376
+ throw Error(this.constructor.directiveName + "() can only be used in child bindings");
1377
+ }
1378
+ render(r2) {
1379
+ if (r2 === A || null == r2)
1380
+ return this.ft = void 0, this.et = r2;
1381
+ if (r2 === T)
1382
+ return r2;
1383
+ if ("string" != typeof r2)
1384
+ throw Error(this.constructor.directiveName + "() called with a non-string value");
1385
+ if (r2 === this.et)
1386
+ return this.ft;
1387
+ this.et = r2;
1388
+ const s2 = [r2];
1389
+ return s2.raw = s2, this.ft = { _$litType$: this.constructor.resultType, strings: s2, values: [] };
1390
+ }
1391
+ }
1392
+ e.directiveName = "unsafeHTML", e.resultType = 1;
1393
+ const o2 = e$1(e);
1394
+ function asUpdateableLitElement(element) {
1395
+ if (!element.dispatchEvent || !element.requestUpdate)
1396
+ throw new Error(
1397
+ "Element missing required functions (dispatchEvent/requestUpdate)"
1398
+ );
1399
+ return element;
1400
+ }
1401
+ const reservedKeyword = "__registered_effects";
1402
+ function decorate(litElement) {
1403
+ const decoratedLitElement = litElement;
1404
+ if (decoratedLitElement[reservedKeyword])
1405
+ return decoratedLitElement;
1406
+ const updateableLitLikeElement = asUpdateableLitElement(litElement);
1407
+ const oldUpdated = updateableLitLikeElement.updated;
1408
+ decoratedLitElement[reservedKeyword] = {
1409
+ index: 0,
1410
+ count: 0,
1411
+ effects: []
1412
+ };
1413
+ updateableLitLikeElement.updated = (args) => {
1414
+ decoratedLitElement[reservedKeyword].index = 0;
1415
+ return oldUpdated(args);
1416
+ };
1417
+ return decoratedLitElement;
1418
+ }
1419
+ function withEffect(litElement, effect) {
1420
+ const decoratedLitElement = decorate(litElement);
1421
+ const { index, count } = decoratedLitElement[reservedKeyword];
1422
+ if (index === count) {
1423
+ decoratedLitElement[reservedKeyword].index++;
1424
+ decoratedLitElement[reservedKeyword].count++;
1425
+ decoratedLitElement[reservedKeyword].effects.push(effect);
1426
+ return effect;
1427
+ }
1428
+ decoratedLitElement[reservedKeyword].index++;
1429
+ return decoratedLitElement[reservedKeyword].effects[index];
1430
+ }
1431
+ function useEffect(element, on, observe) {
1432
+ const effect = withEffect(element, {
1433
+ on,
1434
+ observe: ["__initial__dirty"]
1435
+ });
1436
+ effect.observe.some((o3, index) => observe[index] !== o3) && effect.on();
1437
+ effect.observe = observe;
1438
+ }
1439
+ const useOnce = (element, on) => useEffect(element, on, []);
1440
+ /**
1441
+ * @license
1442
+ * Copyright 2021 Google LLC
1443
+ * SPDX-License-Identifier: BSD-3-Clause
1444
+ */
1445
+ function n(n2, o3, r2) {
1446
+ return n2 ? o3() : null == r2 ? void 0 : r2();
1447
+ }
1448
+ var __defProp = Object.defineProperty;
1449
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
1450
+ var __decorateClass = (decorators, target, key, kind) => {
1451
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
1452
+ for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
1453
+ if (decorator = decorators[i2])
1454
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1455
+ if (kind && result)
1456
+ __defProp(target, key, result);
1457
+ return result;
1458
+ };
1459
+ const runRequest = async (input, init) => {
1460
+ try {
1461
+ const response = await fetch(input, init);
1462
+ if (!response.ok)
1463
+ throw new Error(await response.text());
1464
+ const data = await response.json();
1465
+ return data;
1466
+ } catch (error) {
1467
+ console.error(error);
1468
+ throw new Error("Failed to complete fetch request.");
1469
+ }
1470
+ };
1471
+ const logger = {
1472
+ warn: (message) => console.warn(`[ShipFare] ${message}`),
1473
+ error: (message) => console.error(`[ShipFare] ${message}`)
1474
+ };
1475
+ const STORE_DATA_STORAGE_KEY = "shipfare-shipping-cutoff-store";
1476
+ const DAY_MAP = {
1477
+ sunday: 0,
1478
+ monday: 1,
1479
+ tuesday: 2,
1480
+ wednesday: 3,
1481
+ thursday: 4,
1482
+ friday: 5,
1483
+ saturday: 6
1484
+ };
1485
+ let ShipFareShippingCutoffWidget = class extends s {
1486
+ constructor() {
1487
+ var _a, _b, _c;
1488
+ super(...arguments);
1489
+ this._isShippingWindow = false;
1490
+ this._countdownText = "";
1491
+ this._isPopupVisible = false;
1492
+ this._apiEndpoint = "/apps/shipfare";
1493
+ this._storeDomain = ((_a = window == null ? void 0 : window.Shopify) == null ? void 0 : _a.shop) ?? ((_c = (_b = window == null ? void 0 : window.Shopify) == null ? void 0 : _b.Checkout) == null ? void 0 : _c.apiHost);
1494
+ this._cutOffTime = "";
1495
+ this._hasFinishedSetup = false;
1496
+ this._shouldShowWidget = true;
1497
+ this._fetch = {
1498
+ get: (url) => runRequest(url),
1499
+ post: (url, body) => runRequest(url, {
1500
+ method: "POST",
1501
+ headers: { "Content-Type": "application/json" },
1502
+ body: JSON.stringify(body)
1503
+ })
1504
+ };
1505
+ }
1506
+ // --- NEW METHOD ---
1507
+ _togglePopup() {
1508
+ this._isPopupVisible = !this._isPopupVisible;
1509
+ }
1510
+ /** Fetches store info from the ShipFare public API. */
1511
+ async _fetchShipFareData() {
1512
+ var _a, _b, _c, _d;
1513
+ const shop = ((_a = window.Shopify) == null ? void 0 : _a.shop) ?? ((_c = (_b = window.Shopify) == null ? void 0 : _b.Checkout) == null ? void 0 : _c.apiHost);
1514
+ if (!shop)
1515
+ throw new Error("No shop found in Shopify object.");
1516
+ try {
1517
+ const storeData = sessionStorage.getItem(STORE_DATA_STORAGE_KEY);
1518
+ if (storeData) {
1519
+ return JSON.parse(storeData);
1520
+ }
1521
+ const endpoint = new URL(window.location.href);
1522
+ endpoint.pathname = this._apiEndpoint;
1523
+ const payload = {
1524
+ store: shop,
1525
+ themeApp: "SHIPPING_CUTOFF"
1526
+ };
1527
+ const response = await this._fetch.post(
1528
+ endpoint.toString(),
1529
+ payload
1530
+ );
1531
+ if (!response)
1532
+ throw new Error("Missing response for store query.");
1533
+ if (!((_d = response.data) == null ? void 0 : _d.store)) {
1534
+ throw new Error("Missing store from response.");
1535
+ }
1536
+ sessionStorage.setItem(
1537
+ STORE_DATA_STORAGE_KEY,
1538
+ JSON.stringify(response.data.store)
1539
+ );
1540
+ return response.data.store;
1541
+ } catch (error) {
1542
+ console.error(error);
1543
+ throw new Error(`Could not find a store for ${this._storeDomain}`);
1544
+ }
1545
+ }
1546
+ async connectedCallback() {
1547
+ super.connectedCallback();
1548
+ this.updateShippingStatus();
1549
+ this._timerInterval = window.setInterval(() => this.updateShippingStatus(), 1e3);
1550
+ }
1551
+ async disconnectedCallback() {
1552
+ super.disconnectedCallback();
1553
+ if (this._timerInterval)
1554
+ clearInterval(this._timerInterval);
1555
+ }
1556
+ updateShippingStatus() {
1557
+ if (!this._store)
1558
+ return;
1559
+ const targetTimezone = this._store.timeZone ?? Intl.DateTimeFormat().resolvedOptions().timeZone;
1560
+ const nowInTargetTz = toZonedTime(/* @__PURE__ */ new Date(), targetTimezone);
1561
+ const currentDay = nowInTargetTz.getDay();
1562
+ const nonShippingDays = this._store.disableDays.map((day) => DAY_MAP[day.trim().toLowerCase()]).filter((day) => day !== void 0);
1563
+ const isShippingDay = !nonShippingDays.includes(currentDay);
1564
+ const cutoffTimeToday = this._store.cutOffMap[currentDay];
1565
+ this._cutOffTime = cutoffTimeToday.cutOff;
1566
+ if (this._cutOffTime === "" || !this._cutOffTime.includes(":")) {
1567
+ this._isShippingWindow = false;
1568
+ return;
1569
+ }
1570
+ const [hours, minutes] = cutoffTimeToday.cutOff.split(":").map(Number);
1571
+ const cutoffDateTime = new Date(nowInTargetTz);
1572
+ cutoffDateTime.setHours(hours, minutes, 0, 0);
1573
+ if (isShippingDay && nowInTargetTz < cutoffDateTime) {
1574
+ this._isShippingWindow = true;
1575
+ const duration = intervalToDuration({ start: nowInTargetTz, end: cutoffDateTime });
1576
+ const h2 = `${duration.hours || 0}`.padStart(2, "0");
1577
+ const m2 = `${duration.minutes || 0}`.padStart(2, "0");
1578
+ const s2 = `${duration.seconds || 0}`.padStart(2, "0");
1579
+ this._countdownText = `${h2}:${m2}:${s2}`;
1580
+ } else {
1581
+ this._isShippingWindow = false;
1582
+ }
1583
+ }
1584
+ widgetTemplate() {
1585
+ var _a;
1586
+ const topContent = this._isShippingWindow ? this._countdownText : this._store.cutoffTimeOutMessage;
1587
+ let timeToShow = "";
1588
+ if (this._cutOffTime && this._cutOffTime.includes(":")) {
1589
+ const [hours, minutes] = this._cutOffTime.split(":");
1590
+ if (Number(hours) > 12) {
1591
+ timeToShow = `${Number(hours) - 12}:${minutes} PM`;
1592
+ } else if (Number(hours) === 12) {
1593
+ timeToShow = `${hours}:${minutes} PM`;
1594
+ } else {
1595
+ timeToShow = `${hours}:${minutes} AM`;
1596
+ }
1597
+ }
1598
+ const bottomContent = this._isShippingWindow ? this._store.cutoffDescription.replace("{{cutOffTime}}", timeToShow) : this._store.cutoffTimeOutDescription;
1599
+ return x`
1600
+ <div id="shipping-cutoff">
1601
+ <style>
1602
+ :host {
1603
+ display: block;
1604
+ max-width: 150px;
1605
+ margin: 0;
1606
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
1607
+ }
1608
+ .widget-body {
1609
+ display: flex;
1610
+ min-height: 30px;
1611
+ min-width: 150px;
1612
+ max-width: 400px;
1613
+ border: 2px solid var(--shipping-cutoff-primary-color, #fcd34d);
1614
+ border-radius: 8px;
1615
+ overflow: hidden;
1616
+ flex-direction: column;
1617
+ }
1618
+ .top-section, .bottom-section {
1619
+ display: flex;
1620
+ align-items: center;
1621
+ justify-content: center;
1622
+ flex: 1;
1623
+ box-sizing: border-box;
1624
+ padding: 2px 8px;
1625
+ line-height: 1.5rem;
1626
+ }
1627
+ .top-section {
1628
+ background-color: var(--shipping-cutoff-primary-color, #fcd34d);
1629
+ color: var(--shipping-cutoff-primary-text-color, #1e3a8a);
1630
+ font-size: 14px;
1631
+ font-weight: 400;
1632
+ }
1633
+ .top-section.is-timer { font-weight: 700; }
1634
+ .bottom-section {
1635
+ background-color: var(--shipping-cutoff-secondary-bg-color, #e0f2fe);
1636
+ color: #374151;
1637
+ font-size: 11px;
1638
+ justify-content: space-between;
1639
+ }
1640
+
1641
+ #info-icon {
1642
+ width: 14px;
1643
+ height: 14px;
1644
+ cursor: pointer;
1645
+ /* CHANGE 1: Info icon color matches the top section's background color */
1646
+ fill: var(--shipping-cutoff-primary-color, #fcd34d);
1647
+ margin-left: 5px;
1648
+ flex-shrink: 0;
1649
+ }
1650
+
1651
+ /* Popup Styles */
1652
+ .popup-overlay {
1653
+ position: fixed;
1654
+ top: 0;
1655
+ left: 0;
1656
+ width: 100vw;
1657
+ height: 100vh;
1658
+ background-color: rgba(0, 0, 0, 0.6);
1659
+ display: flex;
1660
+ align-items: center;
1661
+ justify-content: center;
1662
+ z-index: 1000;
1663
+ }
1664
+ .popup-content {
1665
+ background-color: white;
1666
+ padding: 2rem;
1667
+ border-radius: 8px;
1668
+ max-width: 500px;
1669
+ width: 90%;
1670
+ position: relative;
1671
+ box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
1672
+
1673
+ color: var(--shipping-cutoff-primary-text-color, #1e3a8a); /* Match top section text color */
1674
+ font-size: 14px; /* Set font size to 14px */
1675
+ }
1676
+ .popup-content p {
1677
+ margin-top: 0;
1678
+ margin-bottom: 1em;
1679
+ line-height: 1.5;
1680
+ }
1681
+ .close-button {
1682
+ position: absolute;
1683
+ top: 10px;
1684
+ right: 15px;
1685
+ background: none;
1686
+ border: none;
1687
+ font-size: 28px;
1688
+ font-weight: bold;
1689
+ color: #333; /* Keep close button distinct */
1690
+ cursor: pointer;
1691
+ line-height: 1;
1692
+ }
1693
+
1694
+ /* Media Query */
1695
+ @media (min-width: 401px) {
1696
+ :host { max-width: 400px; }
1697
+ .widget-body { flex-direction: row; }
1698
+ .top-section {
1699
+ font-size: 14px;
1700
+ border-right: 2px solid var(--shipping-cutoff-primary-color, #fcd34d);
1701
+ flex: 0 0 50%;
1702
+ }
1703
+ }
1704
+ </style>
1705
+ <div class="widget-body">
1706
+ <div class="top-section ${this._isShippingWindow ? "is-timer" : ""}">
1707
+ ${topContent}
1708
+ </div>
1709
+ <div class="bottom-section">
1710
+ <span>${bottomContent}</span>
1711
+ <svg id="info-icon" @click=${this._togglePopup} viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
1712
+ <path d="M10 2a8 8 0 100 16 8 8 0 000-16zm0 14a6 6 0 110-12 6 6 0 010 12zm-1-5a1 1 0 112 0v3a1 1 0 11-2 0v-3zm1-4a1 1 0 010-2 1 1 0 010 2z"/>
1713
+ </svg>
1714
+ </div>
1715
+ </div>
1716
+ </div>
1717
+
1718
+ ${this._isPopupVisible ? x`
1719
+ <div class="popup-overlay" @click=${this._togglePopup}>
1720
+ <div class="popup-content" @click=${(e2) => e2.stopPropagation()}>
1721
+ <button class="close-button" @click=${this._togglePopup}>&times;</button>
1722
+ <div style="margin-top: 20px">${o2((_a = this._store) == null ? void 0 : _a.cutoffPopupDescription)}</div>
1723
+ </div>
1724
+ </div>
1725
+ ` : ""}
1726
+ `;
1727
+ }
1728
+ render() {
1729
+ useOnce(this, async () => {
1730
+ var _a;
1731
+ try {
1732
+ this._store = await this._fetchShipFareData();
1733
+ } catch (err) {
1734
+ const error = err;
1735
+ logger.error(error.message);
1736
+ this._hasFinishedSetup = true;
1737
+ this._shouldShowWidget = false;
1738
+ return;
1739
+ }
1740
+ if ((_a = this._store) == null ? void 0 : _a.active) {
1741
+ this._hasFinishedSetup = true;
1742
+ this._shouldShowWidget = true;
1743
+ } else {
1744
+ this._hasFinishedSetup = true;
1745
+ this._shouldShowWidget = false;
1746
+ }
1747
+ });
1748
+ return x`
1749
+ <div>
1750
+ ${n(
1751
+ this._hasFinishedSetup,
1752
+ () => n(
1753
+ this._shouldShowWidget,
1754
+ () => this.widgetTemplate(),
1755
+ () => A
1756
+ ),
1757
+ () => x`<p>
1758
+ <slot name="loading" default>Loading...</slot>
1759
+ </p>`
1760
+ )}
1761
+ </div>`;
1762
+ }
1763
+ createRenderRoot() {
1764
+ return this;
1765
+ }
1766
+ };
1767
+ __decorateClass([
1768
+ t$1()
1769
+ ], ShipFareShippingCutoffWidget.prototype, "_isShippingWindow", 2);
1770
+ __decorateClass([
1771
+ t$1()
1772
+ ], ShipFareShippingCutoffWidget.prototype, "_countdownText", 2);
1773
+ __decorateClass([
1774
+ t$1()
1775
+ ], ShipFareShippingCutoffWidget.prototype, "_isPopupVisible", 2);
1776
+ __decorateClass([
1777
+ t$1()
1778
+ ], ShipFareShippingCutoffWidget.prototype, "_storeDomain", 2);
1779
+ __decorateClass([
1780
+ t$1()
1781
+ ], ShipFareShippingCutoffWidget.prototype, "_store", 2);
1782
+ __decorateClass([
1783
+ t$1()
1784
+ ], ShipFareShippingCutoffWidget.prototype, "_cutOffTime", 2);
1785
+ __decorateClass([
1786
+ t$1()
1787
+ ], ShipFareShippingCutoffWidget.prototype, "_hasFinishedSetup", 2);
1788
+ __decorateClass([
1789
+ t$1()
1790
+ ], ShipFareShippingCutoffWidget.prototype, "_shouldShowWidget", 2);
1791
+ ShipFareShippingCutoffWidget = __decorateClass([
1792
+ e$3("shipfare-shipping-cutoff")
1793
+ ], ShipFareShippingCutoffWidget);
1794
+ export {
1795
+ ShipFareShippingCutoffWidget
1796
+ };