mealz-components 0.2.1 → 0.3.0-alpha.1

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.
@@ -3,19 +3,19 @@
3
3
  * Copyright 2019 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
5
  */
6
- const N = globalThis, V = N.ShadowRoot && (N.ShadyCSS === void 0 || N.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, F = Symbol(), W = /* @__PURE__ */ new WeakMap();
6
+ const N = globalThis, F = N.ShadowRoot && (N.ShadyCSS === void 0 || N.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, J = Symbol(), G = /* @__PURE__ */ new WeakMap();
7
7
  let nt = class {
8
8
  constructor(t, e, i) {
9
- if (this._$cssResult$ = !0, i !== F)
9
+ if (this._$cssResult$ = !0, i !== J)
10
10
  throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
11
11
  this.cssText = t, this.t = e;
12
12
  }
13
13
  get styleSheet() {
14
14
  let t = this.o;
15
15
  const e = this.t;
16
- if (V && t === void 0) {
16
+ if (F && t === void 0) {
17
17
  const i = e !== void 0 && e.length === 1;
18
- i && (t = W.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && W.set(e, t));
18
+ i && (t = G.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && G.set(e, t));
19
19
  }
20
20
  return t;
21
21
  }
@@ -23,7 +23,7 @@ let nt = class {
23
23
  return this.cssText;
24
24
  }
25
25
  };
26
- const dt = (s) => new nt(typeof s == "string" ? s : s + "", void 0, F), ct = (s, ...t) => {
26
+ const ct = (s) => new nt(typeof s == "string" ? s : s + "", void 0, J), ut = (s, ...t) => {
27
27
  const e = s.length === 1 ? s[0] : t.reduce((i, o, r) => i + ((n) => {
28
28
  if (n._$cssResult$ === !0)
29
29
  return n.cssText;
@@ -31,30 +31,30 @@ const dt = (s) => new nt(typeof s == "string" ? s : s + "", void 0, F), ct = (s,
31
31
  return n;
32
32
  throw Error("Value passed to 'css' function must be a 'css' function result: " + n + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
33
33
  })(o) + s[r + 1], s[0]);
34
- return new nt(e, s, F);
35
- }, ut = (s, t) => {
36
- if (V)
34
+ return new nt(e, s, J);
35
+ }, mt = (s, t) => {
36
+ if (F)
37
37
  s.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
38
38
  else
39
39
  for (const e of t) {
40
40
  const i = document.createElement("style"), o = N.litNonce;
41
41
  o !== void 0 && i.setAttribute("nonce", o), i.textContent = e.cssText, s.appendChild(i);
42
42
  }
43
- }, G = V ? (s) => s : (s) => s instanceof CSSStyleSheet ? ((t) => {
43
+ }, Z = F ? (s) => s : (s) => s instanceof CSSStyleSheet ? ((t) => {
44
44
  let e = "";
45
45
  for (const i of t.cssRules)
46
46
  e += i.cssText;
47
- return dt(e);
47
+ return ct(e);
48
48
  })(s) : s;
49
49
  /**
50
50
  * @license
51
51
  * Copyright 2017 Google LLC
52
52
  * SPDX-License-Identifier: BSD-3-Clause
53
53
  */
54
- const { is: mt, defineProperty: gt, getOwnPropertyDescriptor: ft, getOwnPropertyNames: _t, getOwnPropertySymbols: $t, getPrototypeOf: bt } = Object, b = globalThis, Z = b.trustedTypes, yt = Z ? Z.emptyScript : "", z = b.reactiveElementPolyfillSupport, P = (s, t) => s, I = { toAttribute(s, t) {
54
+ const { is: gt, defineProperty: ft, getOwnPropertyDescriptor: _t, getOwnPropertyNames: bt, getOwnPropertySymbols: $t, getPrototypeOf: yt } = Object, $ = globalThis, K = $.trustedTypes, vt = K ? K.emptyScript : "", B = $.reactiveElementPolyfillSupport, L = (s, t) => s, I = { toAttribute(s, t) {
55
55
  switch (t) {
56
56
  case Boolean:
57
- s = s ? yt : null;
57
+ s = s ? vt : null;
58
58
  break;
59
59
  case Object:
60
60
  case Array:
@@ -79,8 +79,8 @@ const { is: mt, defineProperty: gt, getOwnPropertyDescriptor: ft, getOwnProperty
79
79
  }
80
80
  }
81
81
  return e;
82
- } }, J = (s, t) => !mt(s, t), K = { attribute: !0, type: String, converter: I, reflect: !1, hasChanged: J };
83
- Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), b.litPropertyMetadata ?? (b.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
82
+ } }, W = (s, t) => !gt(s, t), Y = { attribute: !0, type: String, converter: I, reflect: !1, hasChanged: W };
83
+ Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), $.litPropertyMetadata ?? ($.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
84
84
  class w extends HTMLElement {
85
85
  static addInitializer(t) {
86
86
  this._$Ei(), (this.l ?? (this.l = [])).push(t);
@@ -88,14 +88,14 @@ class w extends HTMLElement {
88
88
  static get observedAttributes() {
89
89
  return this.finalize(), this._$Eh && [...this._$Eh.keys()];
90
90
  }
91
- static createProperty(t, e = K) {
91
+ static createProperty(t, e = Y) {
92
92
  if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
93
93
  const i = Symbol(), o = this.getPropertyDescriptor(t, i, e);
94
- o !== void 0 && gt(this.prototype, t, o);
94
+ o !== void 0 && ft(this.prototype, t, o);
95
95
  }
96
96
  }
97
97
  static getPropertyDescriptor(t, e, i) {
98
- const { get: o, set: r } = ft(this.prototype, t) ?? { get() {
98
+ const { get: o, set: r } = _t(this.prototype, t) ?? { get() {
99
99
  return this[e];
100
100
  }, set(n) {
101
101
  this[e] = n;
@@ -108,19 +108,19 @@ class w extends HTMLElement {
108
108
  }, configurable: !0, enumerable: !0 };
109
109
  }
110
110
  static getPropertyOptions(t) {
111
- return this.elementProperties.get(t) ?? K;
111
+ return this.elementProperties.get(t) ?? Y;
112
112
  }
113
113
  static _$Ei() {
114
- if (this.hasOwnProperty(P("elementProperties")))
114
+ if (this.hasOwnProperty(L("elementProperties")))
115
115
  return;
116
- const t = bt(this);
116
+ const t = yt(this);
117
117
  t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
118
118
  }
119
119
  static finalize() {
120
- if (this.hasOwnProperty(P("finalized")))
120
+ if (this.hasOwnProperty(L("finalized")))
121
121
  return;
122
- if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(P("properties"))) {
123
- const e = this.properties, i = [..._t(e), ...$t(e)];
122
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(L("properties"))) {
123
+ const e = this.properties, i = [...bt(e), ...$t(e)];
124
124
  for (const o of i)
125
125
  this.createProperty(o, e[o]);
126
126
  }
@@ -143,9 +143,9 @@ class w extends HTMLElement {
143
143
  if (Array.isArray(t)) {
144
144
  const i = new Set(t.flat(1 / 0).reverse());
145
145
  for (const o of i)
146
- e.unshift(G(o));
146
+ e.unshift(Z(o));
147
147
  } else
148
- t !== void 0 && e.push(G(t));
148
+ t !== void 0 && e.push(Z(t));
149
149
  return e;
150
150
  }
151
151
  static _$Eu(t, e) {
@@ -175,7 +175,7 @@ class w extends HTMLElement {
175
175
  }
176
176
  createRenderRoot() {
177
177
  const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
178
- return ut(t, this.constructor.elementStyles), t;
178
+ return mt(t, this.constructor.elementStyles), t;
179
179
  }
180
180
  connectedCallback() {
181
181
  var t;
@@ -214,7 +214,7 @@ class w extends HTMLElement {
214
214
  }
215
215
  requestUpdate(t, e, i) {
216
216
  if (t !== void 0) {
217
- if (i ?? (i = this.constructor.getPropertyOptions(t)), !(i.hasChanged ?? J)(this[t], e))
217
+ if (i ?? (i = this.constructor.getPropertyOptions(t)), !(i.hasChanged ?? W)(this[t], e))
218
218
  return;
219
219
  this.P(t, e, i);
220
220
  }
@@ -292,86 +292,86 @@ class w extends HTMLElement {
292
292
  firstUpdated(t) {
293
293
  }
294
294
  }
295
- w.elementStyles = [], w.shadowRootOptions = { mode: "open" }, w[P("elementProperties")] = /* @__PURE__ */ new Map(), w[P("finalized")] = /* @__PURE__ */ new Map(), z == null || z({ ReactiveElement: w }), (b.reactiveElementVersions ?? (b.reactiveElementVersions = [])).push("2.0.4");
295
+ w.elementStyles = [], w.shadowRootOptions = { mode: "open" }, w[L("elementProperties")] = /* @__PURE__ */ new Map(), w[L("finalized")] = /* @__PURE__ */ new Map(), B == null || B({ ReactiveElement: w }), ($.reactiveElementVersions ?? ($.reactiveElementVersions = [])).push("2.0.4");
296
296
  /**
297
297
  * @license
298
298
  * Copyright 2017 Google LLC
299
299
  * SPDX-License-Identifier: BSD-3-Clause
300
300
  */
301
- const L = globalThis, B = L.trustedTypes, Y = B ? B.createPolicy("lit-html", { createHTML: (s) => s }) : void 0, rt = "$lit$", $ = `lit$${(Math.random() + "").slice(9)}$`, at = "?" + $, vt = `<${at}>`, A = document, U = () => A.createComment(""), M = (s) => s === null || typeof s != "object" && typeof s != "function", lt = Array.isArray, xt = (s) => lt(s) || typeof (s == null ? void 0 : s[Symbol.iterator]) == "function", D = `[
302
- \f\r]`, C = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Q = /-->/g, X = />/g, v = RegExp(`>|${D}(?:([^\\s"'>=/]+)(${D}*=${D}*(?:[^
303
- \f\r"'\`<>=]|("|')|))|$)`, "g"), tt = /'/g, et = /"/g, pt = /^(?:script|style|textarea|title)$/i, At = (s) => (t, ...e) => ({ _$litType$: s, strings: t, values: e }), u = At(1), S = Symbol.for("lit-noChange"), d = Symbol.for("lit-nothing"), st = /* @__PURE__ */ new WeakMap(), x = A.createTreeWalker(A, 129);
304
- function ht(s, t) {
301
+ const k = globalThis, z = k.trustedTypes, Q = z ? z.createPolicy("lit-html", { createHTML: (s) => s }) : void 0, rt = "$lit$", b = `lit$${Math.random().toFixed(9).slice(2)}$`, at = "?" + b, At = `<${at}>`, x = document, T = () => x.createComment(""), M = (s) => s === null || typeof s != "object" && typeof s != "function", lt = Array.isArray, xt = (s) => lt(s) || typeof (s == null ? void 0 : s[Symbol.iterator]) == "function", D = `[
302
+ \f\r]`, P = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, X = /-->/g, tt = />/g, v = RegExp(`>|${D}(?:([^\\s"'>=/]+)(${D}*=${D}*(?:[^
303
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), et = /'/g, st = /"/g, dt = /^(?:script|style|textarea|title)$/i, wt = (s) => (t, ...e) => ({ _$litType$: s, strings: t, values: e }), u = wt(1), E = Symbol.for("lit-noChange"), h = Symbol.for("lit-nothing"), it = /* @__PURE__ */ new WeakMap(), A = x.createTreeWalker(x, 129);
304
+ function pt(s, t) {
305
305
  if (!Array.isArray(s) || !s.hasOwnProperty("raw"))
306
306
  throw Error("invalid template strings array");
307
- return Y !== void 0 ? Y.createHTML(t) : t;
307
+ return Q !== void 0 ? Q.createHTML(t) : t;
308
308
  }
309
- const wt = (s, t) => {
309
+ const St = (s, t) => {
310
310
  const e = s.length - 1, i = [];
311
- let o, r = t === 2 ? "<svg>" : "", n = C;
311
+ let o, r = t === 2 ? "<svg>" : "", n = P;
312
312
  for (let l = 0; l < e; l++) {
313
313
  const a = s[l];
314
- let h, c, p = -1, f = 0;
314
+ let p, c, d = -1, f = 0;
315
315
  for (; f < a.length && (n.lastIndex = f, c = n.exec(a), c !== null); )
316
- f = n.lastIndex, n === C ? c[1] === "!--" ? n = Q : c[1] !== void 0 ? n = X : c[2] !== void 0 ? (pt.test(c[2]) && (o = RegExp("</" + c[2], "g")), n = v) : c[3] !== void 0 && (n = v) : n === v ? c[0] === ">" ? (n = o ?? C, p = -1) : c[1] === void 0 ? p = -2 : (p = n.lastIndex - c[2].length, h = c[1], n = c[3] === void 0 ? v : c[3] === '"' ? et : tt) : n === et || n === tt ? n = v : n === Q || n === X ? n = C : (n = v, o = void 0);
316
+ f = n.lastIndex, n === P ? c[1] === "!--" ? n = X : c[1] !== void 0 ? n = tt : c[2] !== void 0 ? (dt.test(c[2]) && (o = RegExp("</" + c[2], "g")), n = v) : c[3] !== void 0 && (n = v) : n === v ? c[0] === ">" ? (n = o ?? P, d = -1) : c[1] === void 0 ? d = -2 : (d = n.lastIndex - c[2].length, p = c[1], n = c[3] === void 0 ? v : c[3] === '"' ? st : et) : n === st || n === et ? n = v : n === X || n === tt ? n = P : (n = v, o = void 0);
317
317
  const _ = n === v && s[l + 1].startsWith("/>") ? " " : "";
318
- r += n === C ? a + vt : p >= 0 ? (i.push(h), a.slice(0, p) + rt + a.slice(p) + $ + _) : a + $ + (p === -2 ? l : _);
318
+ r += n === P ? a + At : d >= 0 ? (i.push(p), a.slice(0, d) + rt + a.slice(d) + b + _) : a + b + (d === -2 ? l : _);
319
319
  }
320
- return [ht(s, r + (s[e] || "<?>") + (t === 2 ? "</svg>" : "")), i];
320
+ return [pt(s, r + (s[e] || "<?>") + (t === 2 ? "</svg>" : "")), i];
321
321
  };
322
- class R {
322
+ class U {
323
323
  constructor({ strings: t, _$litType$: e }, i) {
324
324
  let o;
325
325
  this.parts = [];
326
326
  let r = 0, n = 0;
327
- const l = t.length - 1, a = this.parts, [h, c] = wt(t, e);
328
- if (this.el = R.createElement(h, i), x.currentNode = this.el.content, e === 2) {
329
- const p = this.el.content.firstChild;
330
- p.replaceWith(...p.childNodes);
327
+ const l = t.length - 1, a = this.parts, [p, c] = St(t, e);
328
+ if (this.el = U.createElement(p, i), A.currentNode = this.el.content, e === 2) {
329
+ const d = this.el.content.firstChild;
330
+ d.replaceWith(...d.childNodes);
331
331
  }
332
- for (; (o = x.nextNode()) !== null && a.length < l; ) {
332
+ for (; (o = A.nextNode()) !== null && a.length < l; ) {
333
333
  if (o.nodeType === 1) {
334
334
  if (o.hasAttributes())
335
- for (const p of o.getAttributeNames())
336
- if (p.endsWith(rt)) {
337
- const f = c[n++], _ = o.getAttribute(p).split($), O = /([.?@])?(.*)/.exec(f);
338
- a.push({ type: 1, index: r, name: O[2], strings: _, ctor: O[1] === "." ? Et : O[1] === "?" ? Ct : O[1] === "@" ? Pt : H }), o.removeAttribute(p);
335
+ for (const d of o.getAttributeNames())
336
+ if (d.endsWith(rt)) {
337
+ const f = c[n++], _ = o.getAttribute(d).split(b), O = /([.?@])?(.*)/.exec(f);
338
+ a.push({ type: 1, index: r, name: O[2], strings: _, ctor: O[1] === "." ? Ct : O[1] === "?" ? Pt : O[1] === "@" ? Lt : H }), o.removeAttribute(d);
339
339
  } else
340
- p.startsWith($) && (a.push({ type: 6, index: r }), o.removeAttribute(p));
341
- if (pt.test(o.tagName)) {
342
- const p = o.textContent.split($), f = p.length - 1;
340
+ d.startsWith(b) && (a.push({ type: 6, index: r }), o.removeAttribute(d));
341
+ if (dt.test(o.tagName)) {
342
+ const d = o.textContent.split(b), f = d.length - 1;
343
343
  if (f > 0) {
344
- o.textContent = B ? B.emptyScript : "";
344
+ o.textContent = z ? z.emptyScript : "";
345
345
  for (let _ = 0; _ < f; _++)
346
- o.append(p[_], U()), x.nextNode(), a.push({ type: 2, index: ++r });
347
- o.append(p[f], U());
346
+ o.append(d[_], T()), A.nextNode(), a.push({ type: 2, index: ++r });
347
+ o.append(d[f], T());
348
348
  }
349
349
  }
350
350
  } else if (o.nodeType === 8)
351
351
  if (o.data === at)
352
352
  a.push({ type: 2, index: r });
353
353
  else {
354
- let p = -1;
355
- for (; (p = o.data.indexOf($, p + 1)) !== -1; )
356
- a.push({ type: 7, index: r }), p += $.length - 1;
354
+ let d = -1;
355
+ for (; (d = o.data.indexOf(b, d + 1)) !== -1; )
356
+ a.push({ type: 7, index: r }), d += b.length - 1;
357
357
  }
358
358
  r++;
359
359
  }
360
360
  }
361
361
  static createElement(t, e) {
362
- const i = A.createElement("template");
362
+ const i = x.createElement("template");
363
363
  return i.innerHTML = t, i;
364
364
  }
365
365
  }
366
- function E(s, t, e = s, i) {
366
+ function C(s, t, e = s, i) {
367
367
  var n, l;
368
- if (t === S)
368
+ if (t === E)
369
369
  return t;
370
370
  let o = i !== void 0 ? (n = e._$Co) == null ? void 0 : n[i] : e._$Cl;
371
371
  const r = M(t) ? void 0 : t._$litDirective$;
372
- return (o == null ? void 0 : o.constructor) !== r && ((l = o == null ? void 0 : o._$AO) == null || l.call(o, !1), r === void 0 ? o = void 0 : (o = new r(s), o._$AT(s, e, i)), i !== void 0 ? (e._$Co ?? (e._$Co = []))[i] = o : e._$Cl = o), o !== void 0 && (t = E(s, o._$AS(s, t.values), o, i)), t;
372
+ return (o == null ? void 0 : o.constructor) !== r && ((l = o == null ? void 0 : o._$AO) == null || l.call(o, !1), r === void 0 ? o = void 0 : (o = new r(s), o._$AT(s, e, i)), i !== void 0 ? (e._$Co ?? (e._$Co = []))[i] = o : e._$Cl = o), o !== void 0 && (t = C(s, o._$AS(s, t.values), o, i)), t;
373
373
  }
374
- class St {
374
+ class Et {
375
375
  constructor(t, e) {
376
376
  this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
377
377
  }
@@ -382,17 +382,17 @@ class St {
382
382
  return this._$AM._$AU;
383
383
  }
384
384
  u(t) {
385
- const { el: { content: e }, parts: i } = this._$AD, o = ((t == null ? void 0 : t.creationScope) ?? A).importNode(e, !0);
386
- x.currentNode = o;
387
- let r = x.nextNode(), n = 0, l = 0, a = i[0];
385
+ const { el: { content: e }, parts: i } = this._$AD, o = ((t == null ? void 0 : t.creationScope) ?? x).importNode(e, !0);
386
+ A.currentNode = o;
387
+ let r = A.nextNode(), n = 0, l = 0, a = i[0];
388
388
  for (; a !== void 0; ) {
389
389
  if (n === a.index) {
390
- let h;
391
- a.type === 2 ? h = new k(r, r.nextSibling, this, t) : a.type === 1 ? h = new a.ctor(r, a.name, a.strings, this, t) : a.type === 6 && (h = new Lt(r, this, t)), this._$AV.push(h), a = i[++l];
390
+ let p;
391
+ a.type === 2 ? p = new R(r, r.nextSibling, this, t) : a.type === 1 ? p = new a.ctor(r, a.name, a.strings, this, t) : a.type === 6 && (p = new kt(r, this, t)), this._$AV.push(p), a = i[++l];
392
392
  }
393
- n !== (a == null ? void 0 : a.index) && (r = x.nextNode(), n++);
393
+ n !== (a == null ? void 0 : a.index) && (r = A.nextNode(), n++);
394
394
  }
395
- return x.currentNode = A, o;
395
+ return A.currentNode = x, o;
396
396
  }
397
397
  p(t) {
398
398
  let e = 0;
@@ -400,13 +400,13 @@ class St {
400
400
  i !== void 0 && (i.strings !== void 0 ? (i._$AI(t, i, e), e += i.strings.length - 2) : i._$AI(t[e])), e++;
401
401
  }
402
402
  }
403
- class k {
403
+ class R {
404
404
  get _$AU() {
405
405
  var t;
406
406
  return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
407
407
  }
408
408
  constructor(t, e, i, o) {
409
- this.type = 2, this._$AH = d, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = i, this.options = o, this._$Cv = (o == null ? void 0 : o.isConnected) ?? !0;
409
+ this.type = 2, this._$AH = h, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = i, this.options = o, this._$Cv = (o == null ? void 0 : o.isConnected) ?? !0;
410
410
  }
411
411
  get parentNode() {
412
412
  let t = this._$AA.parentNode;
@@ -420,7 +420,7 @@ class k {
420
420
  return this._$AB;
421
421
  }
422
422
  _$AI(t, e = this) {
423
- t = E(this, t, e), M(t) ? t === d || t == null || t === "" ? (this._$AH !== d && this._$AR(), this._$AH = d) : t !== this._$AH && t !== S && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : xt(t) ? this.k(t) : this._(t);
423
+ t = C(this, t, e), M(t) ? t === h || t == null || t === "" ? (this._$AH !== h && this._$AR(), this._$AH = h) : t !== this._$AH && t !== E && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : xt(t) ? this.k(t) : this._(t);
424
424
  }
425
425
  S(t) {
426
426
  return this._$AA.parentNode.insertBefore(t, this._$AB);
@@ -429,28 +429,28 @@ class k {
429
429
  this._$AH !== t && (this._$AR(), this._$AH = this.S(t));
430
430
  }
431
431
  _(t) {
432
- this._$AH !== d && M(this._$AH) ? this._$AA.nextSibling.data = t : this.T(A.createTextNode(t)), this._$AH = t;
432
+ this._$AH !== h && M(this._$AH) ? this._$AA.nextSibling.data = t : this.T(x.createTextNode(t)), this._$AH = t;
433
433
  }
434
434
  $(t) {
435
435
  var r;
436
- const { values: e, _$litType$: i } = t, o = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = R.createElement(ht(i.h, i.h[0]), this.options)), i);
436
+ const { values: e, _$litType$: i } = t, o = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = U.createElement(pt(i.h, i.h[0]), this.options)), i);
437
437
  if (((r = this._$AH) == null ? void 0 : r._$AD) === o)
438
438
  this._$AH.p(e);
439
439
  else {
440
- const n = new St(o, this), l = n.u(this.options);
440
+ const n = new Et(o, this), l = n.u(this.options);
441
441
  n.p(e), this.T(l), this._$AH = n;
442
442
  }
443
443
  }
444
444
  _$AC(t) {
445
- let e = st.get(t.strings);
446
- return e === void 0 && st.set(t.strings, e = new R(t)), e;
445
+ let e = it.get(t.strings);
446
+ return e === void 0 && it.set(t.strings, e = new U(t)), e;
447
447
  }
448
448
  k(t) {
449
449
  lt(this._$AH) || (this._$AH = [], this._$AR());
450
450
  const e = this._$AH;
451
451
  let i, o = 0;
452
452
  for (const r of t)
453
- o === e.length ? e.push(i = new k(this.S(U()), this.S(U()), this, this.options)) : i = e[o], i._$AI(r), o++;
453
+ o === e.length ? e.push(i = new R(this.S(T()), this.S(T()), this, this.options)) : i = e[o], i._$AI(r), o++;
454
454
  o < e.length && (this._$AR(i && i._$AB.nextSibling, o), e.length = o);
455
455
  }
456
456
  _$AR(t = this._$AA.nextSibling, e) {
@@ -473,49 +473,49 @@ class H {
473
473
  return this._$AM._$AU;
474
474
  }
475
475
  constructor(t, e, i, o, r) {
476
- this.type = 1, this._$AH = d, this._$AN = void 0, this.element = t, this.name = e, this._$AM = o, this.options = r, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = d;
476
+ this.type = 1, this._$AH = h, this._$AN = void 0, this.element = t, this.name = e, this._$AM = o, this.options = r, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = h;
477
477
  }
478
478
  _$AI(t, e = this, i, o) {
479
479
  const r = this.strings;
480
480
  let n = !1;
481
481
  if (r === void 0)
482
- t = E(this, t, e, 0), n = !M(t) || t !== this._$AH && t !== S, n && (this._$AH = t);
482
+ t = C(this, t, e, 0), n = !M(t) || t !== this._$AH && t !== E, n && (this._$AH = t);
483
483
  else {
484
484
  const l = t;
485
- let a, h;
485
+ let a, p;
486
486
  for (t = r[0], a = 0; a < r.length - 1; a++)
487
- h = E(this, l[i + a], e, a), h === S && (h = this._$AH[a]), n || (n = !M(h) || h !== this._$AH[a]), h === d ? t = d : t !== d && (t += (h ?? "") + r[a + 1]), this._$AH[a] = h;
487
+ p = C(this, l[i + a], e, a), p === E && (p = this._$AH[a]), n || (n = !M(p) || p !== this._$AH[a]), p === h ? t = h : t !== h && (t += (p ?? "") + r[a + 1]), this._$AH[a] = p;
488
488
  }
489
489
  n && !o && this.j(t);
490
490
  }
491
491
  j(t) {
492
- t === d ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
492
+ t === h ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
493
493
  }
494
494
  }
495
- class Et extends H {
495
+ class Ct extends H {
496
496
  constructor() {
497
497
  super(...arguments), this.type = 3;
498
498
  }
499
499
  j(t) {
500
- this.element[this.name] = t === d ? void 0 : t;
500
+ this.element[this.name] = t === h ? void 0 : t;
501
501
  }
502
502
  }
503
- class Ct extends H {
503
+ class Pt extends H {
504
504
  constructor() {
505
505
  super(...arguments), this.type = 4;
506
506
  }
507
507
  j(t) {
508
- this.element.toggleAttribute(this.name, !!t && t !== d);
508
+ this.element.toggleAttribute(this.name, !!t && t !== h);
509
509
  }
510
510
  }
511
- class Pt extends H {
511
+ class Lt extends H {
512
512
  constructor(t, e, i, o, r) {
513
513
  super(t, e, i, o, r), this.type = 5;
514
514
  }
515
515
  _$AI(t, e = this) {
516
- if ((t = E(this, t, e, 0) ?? d) === S)
516
+ if ((t = C(this, t, e, 0) ?? h) === E)
517
517
  return;
518
- const i = this._$AH, o = t === d && i !== d || t.capture !== i.capture || t.once !== i.once || t.passive !== i.passive, r = t !== d && (i === d || o);
518
+ const i = this._$AH, o = t === h && i !== h || t.capture !== i.capture || t.once !== i.once || t.passive !== i.passive, r = t !== h && (i === h || o);
519
519
  o && this.element.removeEventListener(this.name, this, i), r && this.element.addEventListener(this.name, this, t), this._$AH = t;
520
520
  }
521
521
  handleEvent(t) {
@@ -523,7 +523,7 @@ class Pt extends H {
523
523
  typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
524
524
  }
525
525
  }
526
- class Lt {
526
+ class kt {
527
527
  constructor(t, e, i) {
528
528
  this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = i;
529
529
  }
@@ -531,17 +531,17 @@ class Lt {
531
531
  return this._$AM._$AU;
532
532
  }
533
533
  _$AI(t) {
534
- E(this, t);
534
+ C(this, t);
535
535
  }
536
536
  }
537
- const j = L.litHtmlPolyfillSupport;
538
- j == null || j(R, k), (L.litHtmlVersions ?? (L.litHtmlVersions = [])).push("3.1.2");
537
+ const j = k.litHtmlPolyfillSupport;
538
+ j == null || j(U, R), (k.litHtmlVersions ?? (k.litHtmlVersions = [])).push("3.1.3");
539
539
  const Tt = (s, t, e) => {
540
540
  const i = (e == null ? void 0 : e.renderBefore) ?? t;
541
541
  let o = i._$litPart$;
542
542
  if (o === void 0) {
543
543
  const r = (e == null ? void 0 : e.renderBefore) ?? null;
544
- i._$litPart$ = o = new k(t.insertBefore(U(), r), r, void 0, e ?? {});
544
+ i._$litPart$ = o = new R(t.insertBefore(T(), r), r, void 0, e ?? {});
545
545
  }
546
546
  return o._$AI(s), o;
547
547
  };
@@ -550,7 +550,7 @@ const Tt = (s, t, e) => {
550
550
  * Copyright 2017 Google LLC
551
551
  * SPDX-License-Identifier: BSD-3-Clause
552
552
  */
553
- class T extends w {
553
+ class S extends w {
554
554
  constructor() {
555
555
  super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
556
556
  }
@@ -572,20 +572,20 @@ class T extends w {
572
572
  super.disconnectedCallback(), (t = this._$Do) == null || t.setConnected(!1);
573
573
  }
574
574
  render() {
575
- return S;
575
+ return E;
576
576
  }
577
577
  }
578
578
  var ot;
579
- T._$litElement$ = !0, T.finalized = !0, (ot = globalThis.litElementHydrateSupport) == null || ot.call(globalThis, { LitElement: T });
579
+ S._$litElement$ = !0, S.finalized = !0, (ot = globalThis.litElementHydrateSupport) == null || ot.call(globalThis, { LitElement: S });
580
580
  const q = globalThis.litElementPolyfillSupport;
581
- q == null || q({ LitElement: T });
582
- (globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.0.4");
581
+ q == null || q({ LitElement: S });
582
+ (globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.0.5");
583
583
  /**
584
584
  * @license
585
585
  * Copyright 2017 Google LLC
586
586
  * SPDX-License-Identifier: BSD-3-Clause
587
587
  */
588
- const Ut = (s) => (t, e) => {
588
+ const ht = (s) => (t, e) => {
589
589
  e !== void 0 ? e.addInitializer(() => {
590
590
  customElements.define(s, t);
591
591
  }) : customElements.define(s, t);
@@ -595,7 +595,7 @@ const Ut = (s) => (t, e) => {
595
595
  * Copyright 2017 Google LLC
596
596
  * SPDX-License-Identifier: BSD-3-Clause
597
597
  */
598
- const Mt = { attribute: !0, type: String, converter: I, reflect: !1, hasChanged: J }, Rt = (s = Mt, t, e) => {
598
+ const Mt = { attribute: !0, type: String, converter: I, reflect: !1, hasChanged: W }, Ut = (s = Mt, t, e) => {
599
599
  const { kind: i, metadata: o } = e;
600
600
  let r = globalThis.litPropertyMetadata.get(o);
601
601
  if (r === void 0 && globalThis.litPropertyMetadata.set(o, r = /* @__PURE__ */ new Map()), r.set(e.name, s), i === "accessor") {
@@ -617,7 +617,7 @@ const Mt = { attribute: !0, type: String, converter: I, reflect: !1, hasChanged:
617
617
  throw Error("Unsupported decorator location: " + i);
618
618
  };
619
619
  function y(s) {
620
- return (t, e) => typeof e == "object" ? Rt(s, t, e) : ((i, o, r) => {
620
+ return (t, e) => typeof e == "object" ? Ut(s, t, e) : ((i, o, r) => {
621
621
  const n = o.hasOwnProperty(r);
622
622
  return o.constructor.createProperty(r, n ? { ...i, wrapped: !0 } : i), n ? Object.getOwnPropertyDescriptor(o, r) : void 0;
623
623
  })(s, t, e);
@@ -627,7 +627,7 @@ function y(s) {
627
627
  * Copyright 2017 Google LLC
628
628
  * SPDX-License-Identifier: BSD-3-Clause
629
629
  */
630
- function kt(s) {
630
+ function Rt(s) {
631
631
  return y({ ...s, state: !0, attribute: !1 });
632
632
  }
633
633
  /**
@@ -635,48 +635,34 @@ function kt(s) {
635
635
  * Copyright 2017 Google LLC
636
636
  * SPDX-License-Identifier: BSD-3-Clause
637
637
  */
638
- const it = (s, t, e) => (e.configurable = !0, e.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(s, t, e), e);
638
+ const Ot = (s, t, e) => (e.configurable = !0, e.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(s, t, e), e);
639
639
  /**
640
640
  * @license
641
641
  * Copyright 2017 Google LLC
642
642
  * SPDX-License-Identifier: BSD-3-Clause
643
643
  */
644
- function Ot(s, t) {
644
+ function Nt(s, t) {
645
645
  return (e, i, o) => {
646
646
  const r = (n) => {
647
647
  var l;
648
648
  return ((l = n.renderRoot) == null ? void 0 : l.querySelector(s)) ?? null;
649
649
  };
650
- if (t) {
651
- const { get: n, set: l } = typeof i == "object" ? e : o ?? (() => {
652
- const a = Symbol();
653
- return { get() {
654
- return this[a];
655
- }, set(h) {
656
- this[a] = h;
657
- } };
658
- })();
659
- return it(e, i, { get() {
660
- let a = n.call(this);
661
- return a === void 0 && (a = r(this), (a !== null || this.hasUpdated) && l.call(this, a)), a;
662
- } });
663
- }
664
- return it(e, i, { get() {
650
+ return Ot(e, i, { get() {
665
651
  return r(this);
666
652
  } });
667
653
  };
668
654
  }
669
- class Nt {
655
+ class It {
670
656
  get extId() {
671
657
  return this.attributes["ext-id"];
672
658
  }
673
659
  }
674
- var It = Object.defineProperty, Bt = Object.getOwnPropertyDescriptor, g = (s, t, e, i) => {
675
- for (var o = i > 1 ? void 0 : i ? Bt(t, e) : t, r = s.length - 1, n; r >= 0; r--)
660
+ var zt = Object.defineProperty, Ht = Object.getOwnPropertyDescriptor, g = (s, t, e, i) => {
661
+ for (var o = i > 1 ? void 0 : i ? Ht(t, e) : t, r = s.length - 1, n; r >= 0; r--)
676
662
  (n = s[r]) && (o = (i ? n(t, e, o) : n(o)) || o);
677
- return i && o && It(t, e, o), o;
663
+ return i && o && zt(t, e, o), o;
678
664
  };
679
- let m = class extends T {
665
+ let m = class extends S {
680
666
  constructor() {
681
667
  var s, t, e, i, o, r;
682
668
  super(...arguments), this.selectedRadius = 25, this.radiusOption = [10, 25, 50], this.getByAddress = (t = (s = window.miam) == null ? void 0 : s.pos) == null ? void 0 : t.getByAddress, this.getByCoordinates = (i = (e = window.miam) == null ? void 0 : e.pos) == null ? void 0 : i.getByCoordinates, this.getAffiliateSuppliers = (r = (o = window.miam) == null ? void 0 : o.supplier) == null ? void 0 : r.getAffiliateSuppliers, this._posList = [], this._markers = [], this._searchingPos = !1, this._searchSubmitted = !1, this._previousSearchMethod = () => {
@@ -843,7 +829,7 @@ let m = class extends T {
843
829
  }
844
830
  setPosList(s) {
845
831
  this._posList = s.data.map((t) => {
846
- const e = Object.assign(new Nt(), t);
832
+ const e = Object.assign(new It(), t);
847
833
  return e.supplier = s.included.find((i) => i.id === e.relationships.supplier.data.id), e;
848
834
  });
849
835
  }
@@ -964,7 +950,7 @@ let m = class extends T {
964
950
  }
965
951
  };
966
952
  m.styles = [
967
- ct`
953
+ ut`
968
954
  :host {
969
955
  display: block;
970
956
  height: 100%;
@@ -1305,15 +1291,68 @@ g([
1305
1291
  y()
1306
1292
  ], m.prototype, "getAffiliateSuppliers", 2);
1307
1293
  g([
1308
- kt()
1294
+ Rt()
1309
1295
  ], m.prototype, "_geolocationCoordinates", 2);
1310
1296
  g([
1311
- Ot("input")
1297
+ Nt("input")
1312
1298
  ], m.prototype, "_addressInput", 2);
1313
1299
  m = g([
1314
- Ut("mealz-store-locator")
1300
+ ht("mealz-store-locator")
1315
1301
  ], m);
1316
1302
  window.customElements.get("mealz-store-locator") || window.customElements.define("mealz-store-locator", m);
1303
+ class Bt extends S {
1304
+ createRenderRoot() {
1305
+ return this;
1306
+ }
1307
+ }
1308
+ var Dt = (s, t, e, i) => {
1309
+ for (var o = t, r = s.length - 1, n; r >= 0; r--)
1310
+ (n = s[r]) && (o = n(o) || o);
1311
+ return o;
1312
+ };
1313
+ let V = class extends Bt {
1314
+ constructor() {
1315
+ super(...arguments), this.liked = null, this.recipeLikeId = "", this.requestHeaders = new Headers();
1316
+ }
1317
+ connectedCallback() {
1318
+ super.connectedCallback(), console.debug("[MealzComponents] loading like button"), this.requestHeaders.append("Authorization", "Bearer <your-token>"), this.requestHeaders.append("miam-origin", "partners"), this.requestHeaders.append("Content-Type", "application/vnd.api+json");
1319
+ }
1320
+ render() {
1321
+ this.button = this.querySelector(".mealz-like-button"), this.button && (this.getInitialStatus(), this.recipeLikeId && this.button.addEventListener("click", () => this.toggle()), console.log(this.button));
1322
+ }
1323
+ getInitialStatus() {
1324
+ var i;
1325
+ const s = (i = this.attributes["starting-data"]) == null ? void 0 : i.value;
1326
+ if (console.log(s), !s)
1327
+ return;
1328
+ const { id: t, liked: e } = JSON.parse(s);
1329
+ this.recipeLikeId = t, this.liked = e, this.removeAttribute("starting-data");
1330
+ }
1331
+ async toggle() {
1332
+ var e, i;
1333
+ const s = JSON.stringify({
1334
+ data: {
1335
+ type: "recipe-likes",
1336
+ id: 1,
1337
+ attributes: {
1338
+ "is-past": this.liked
1339
+ }
1340
+ }
1341
+ }), t = await fetch(
1342
+ `http://localhost:3000/api/v1/recipe-likes/${this.recipeLikeId}`,
1343
+ { headers: this.requestHeaders, method: "PATCH", body: s }
1344
+ ).then((o) => o.json());
1345
+ this.liked = !((i = (e = t.data) == null ? void 0 : e.attributes) != null && i["is-past"]), this.updateDOM();
1346
+ }
1347
+ updateDOM() {
1348
+ this.button.querySelector(".mealz-like-button__icon").classList.toggle("fill", this.liked), this.button.querySelectorAll(".mealz-like-button__icon img").forEach((s) => s.classList.toggle("active"));
1349
+ }
1350
+ };
1351
+ V = Dt([
1352
+ ht("mealz-like-button")
1353
+ ], V);
1354
+ window.customElements.get("mealz-like-button") || window.customElements.define("mealz-like-button", V);
1317
1355
  export {
1356
+ V as MealzLikeButton,
1318
1357
  m as MealzStoreLocator
1319
1358
  };