xactsize-webcomponents 1.0.14 → 1.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.md CHANGED
@@ -1,18 +1,18 @@
1
- # xactsize-webcomponent License
2
-
3
- Copyright (c) 2025 Your Name or Company. All rights reserved.
4
-
5
- ## License Terms
6
-
7
- This software is provided as a compiled, closed-source package for public use under the following terms:
8
-
9
- 1. **Usage**: You are permitted to use the compiled version of `xactsize-webcomponent` (as distributed via npm or CDN) in your projects, subject to the terms below.
10
- 2. **No Source Access**: The source code of this software is proprietary and closed-source. You are not permitted to access, view, modify, or distribute the source code.
11
- 3. **No Reverse Engineering**: You may not reverse-engineer, decompile, or disassemble the compiled code to derive the source code.
12
- 4. **Redistribution**: You may not redistribute this package or its compiled files except as part of a larger application where the package is used as a dependency.
13
- 5. **API Key Requirement**: Usage of this package requires an API key, which must be obtained by registering your domain with the provider. Unauthorized use is prohibited.
14
- 6. **No Warranty**: This software is provided "as is," without warranty of any kind, express or implied, including but not limited to warranties of merchantability, fitness for a particular purpose, or non-infringement.
15
- 7. **Liability**: In no event shall the authors or copyright holders be liable for any claim, damages, or other liability arising from the use of this software.
16
-
17
- ## Contact
18
- For licensing inquiries, API key registration, or support, contact [support@yourwebsite.com](mailto:support@yourwebsite.com).
1
+ # xactsize-webcomponent License
2
+
3
+ Copyright (c) 2025 Your Name or Company. All rights reserved.
4
+
5
+ ## License Terms
6
+
7
+ This software is provided as a compiled, closed-source package for public use under the following terms:
8
+
9
+ 1. **Usage**: You are permitted to use the compiled version of `xactsize-webcomponent` (as distributed via npm or CDN) in your projects, subject to the terms below.
10
+ 2. **No Source Access**: The source code of this software is proprietary and closed-source. You are not permitted to access, view, modify, or distribute the source code.
11
+ 3. **No Reverse Engineering**: You may not reverse-engineer, decompile, or disassemble the compiled code to derive the source code.
12
+ 4. **Redistribution**: You may not redistribute this package or its compiled files except as part of a larger application where the package is used as a dependency.
13
+ 5. **API Key Requirement**: Usage of this package requires an API key, which must be obtained by registering your domain with the provider. Unauthorized use is prohibited.
14
+ 6. **No Warranty**: This software is provided "as is," without warranty of any kind, express or implied, including but not limited to warranties of merchantability, fitness for a particular purpose, or non-infringement.
15
+ 7. **Liability**: In no event shall the authors or copyright holders be liable for any claim, damages, or other liability arising from the use of this software.
16
+
17
+ ## Contact
18
+ For licensing inquiries, API key registration, or support, contact [support@yourwebsite.com](mailto:support@yourwebsite.com).
package/README.md CHANGED
@@ -1,77 +1,77 @@
1
- # xactsize-webcomponent
2
-
3
- A lightweight Web Component for precise body measurements and size recommendations in web applications, built with Lit.
4
-
5
- ## Installation
6
-
7
- <details>
8
- <summary>With NPM</summary>
9
-
10
- ```bash
11
- npm install xactsize-webcomponent
12
- ```
13
-
14
- ```html
15
- <body-measurer
16
- culture="pt-BR"
17
- product-name="Shirt"
18
- skus='[{"dimensions":{"Size":"M"},"measures":{"height":50,"length":70,"width":40}}]'
19
- ></body-measurer>
20
- <script>
21
- import { BodyMeasurer } from 'xactsize-webcomponent';
22
-
23
- // Select the body-measurer element
24
- const bodyMeasurer = document.querySelector('body-measurer');
25
-
26
- // Check if the element exists
27
- if (bodyMeasurer) {
28
- // Add event listener for measurementAccepted
29
- bodyMeasurer.addEventListener('measurementAccepted', (e) => {
30
- const size = e.detail.size;
31
- alert(`Size selected: ${size}`);
32
- console.log('Measurement accepted:', e.detail);
33
- });
34
-
35
- // Add event listener for measurementCanceled
36
- bodyMeasurer.addEventListener('measurementCanceled', (e) => {
37
- alert('Measurement canceled');
38
- console.log('Measurement canceled');
39
- });
40
- } else {
41
- console.error('body-measurer element not found');
42
- }
43
- </script>
44
- ```
45
- </details>
46
-
47
- <details>
48
- <summary>With CDN</summary>
49
-
50
- ```html
51
- <body-measurer culture="pt-BR" product-name="Calça Legging" skus='[{"dimensions":{"Size":"S"},"measures":{"height":39,"length":78,"width":78}},{"dimensions":{"Size":"M"},"measures":{"height":40,"length":82,"width":82}}]'></body-measurer>
52
- <script type="module" src="https://cdn.jsdelivr.net/npm/xactsize-webcomponents@1.0.6/dist/body-measurer.es.js"></script>
53
-
54
- <script>
55
- // Select the body-measurer element
56
- const bodyMeasurer = document.querySelector('body-measurer');
57
-
58
- // Check if the element exists
59
- if (bodyMeasurer) {
60
- // Add event listener for measurementAccepted
61
- bodyMeasurer.addEventListener('measurementAccepted', (e) => {
62
- const size = e.detail.size;
63
- alert(`Size selected: ${size}`);
64
- console.log('Measurement accepted:', e.detail);
65
- });
66
-
67
- // Add event listener for measurementCanceled
68
- bodyMeasurer.addEventListener('measurementCanceled', (e) => {
69
- alert('Measurement canceled');
70
- console.log('Measurement canceled');
71
- });
72
- } else {
73
- console.error('body-measurer element not found');
74
- }
75
- </script>
76
- ```
77
- </details>
1
+ # xactsize-webcomponent
2
+
3
+ A lightweight Web Component for precise body measurements and size recommendations in web applications, built with Lit.
4
+
5
+ ## Installation
6
+
7
+ <details>
8
+ <summary>With NPM</summary>
9
+
10
+ ```bash
11
+ npm install xactsize-webcomponent
12
+ ```
13
+
14
+ ```html
15
+ <body-measurer
16
+ culture="pt-BR"
17
+ product-name="Shirt"
18
+ skus='[{"dimensions":{"Size":"M"},"measures":{"height":50,"length":70,"width":40}}]'
19
+ ></body-measurer>
20
+ <script>
21
+ import { BodyMeasurer } from 'xactsize-webcomponent';
22
+
23
+ // Select the body-measurer element
24
+ const bodyMeasurer = document.querySelector('body-measurer');
25
+
26
+ // Check if the element exists
27
+ if (bodyMeasurer) {
28
+ // Add event listener for measurementAccepted
29
+ bodyMeasurer.addEventListener('measurementAccepted', (e) => {
30
+ const size = e.detail.size;
31
+ alert(`Size selected: ${size}`);
32
+ console.log('Measurement accepted:', e.detail);
33
+ });
34
+
35
+ // Add event listener for measurementCanceled
36
+ bodyMeasurer.addEventListener('measurementCanceled', (e) => {
37
+ alert('Measurement canceled');
38
+ console.log('Measurement canceled');
39
+ });
40
+ } else {
41
+ console.error('body-measurer element not found');
42
+ }
43
+ </script>
44
+ ```
45
+ </details>
46
+
47
+ <details>
48
+ <summary>With CDN</summary>
49
+
50
+ ```html
51
+ <body-measurer culture="pt-BR" product-name="Calça Legging" skus='[{"dimensions":{"Size":"S"},"measures":{"height":39,"length":78,"width":78}},{"dimensions":{"Size":"M"},"measures":{"height":40,"length":82,"width":82}}]'></body-measurer>
52
+ <script type="module" src="https://cdn.jsdelivr.net/npm/xactsize-webcomponents@1.0.6/dist/body-measurer.es.js"></script>
53
+
54
+ <script>
55
+ // Select the body-measurer element
56
+ const bodyMeasurer = document.querySelector('body-measurer');
57
+
58
+ // Check if the element exists
59
+ if (bodyMeasurer) {
60
+ // Add event listener for measurementAccepted
61
+ bodyMeasurer.addEventListener('measurementAccepted', (e) => {
62
+ const size = e.detail.size;
63
+ alert(`Size selected: ${size}`);
64
+ console.log('Measurement accepted:', e.detail);
65
+ });
66
+
67
+ // Add event listener for measurementCanceled
68
+ bodyMeasurer.addEventListener('measurementCanceled', (e) => {
69
+ alert('Measurement canceled');
70
+ console.log('Measurement canceled');
71
+ });
72
+ } else {
73
+ console.error('body-measurer element not found');
74
+ }
75
+ </script>
76
+ ```
77
+ </details>
@@ -58,7 +58,7 @@ const YA = (l) => new ZA(typeof l == "string" ? l : l + "", void 0, dA), N = (l,
58
58
  * Copyright 2017 Google LLC
59
59
  * SPDX-License-Identifier: BSD-3-Clause
60
60
  */
61
- const { is: DA, defineProperty: QA, getOwnPropertyDescriptor: gA, getOwnPropertyNames: BA, getOwnPropertySymbols: _A, getPrototypeOf: $A } = Object, W = globalThis, xA = W.trustedTypes, At = xA ? xA.emptyScript : "", eA = W.reactiveElementPolyfillSupport, z = (l, A) => l, _ = { toAttribute(l, A) {
61
+ const { is: DA, defineProperty: QA, getOwnPropertyDescriptor: gA, getOwnPropertyNames: BA, getOwnPropertySymbols: _A, getPrototypeOf: $A } = Object, s = globalThis, xA = s.trustedTypes, At = xA ? xA.emptyScript : "", eA = s.reactiveElementPolyfillSupport, z = (l, A) => l, _ = { toAttribute(l, A) {
62
62
  switch (A) {
63
63
  case Boolean:
64
64
  l = l ? At : null;
@@ -87,7 +87,7 @@ const { is: DA, defineProperty: QA, getOwnPropertyDescriptor: gA, getOwnProperty
87
87
  }
88
88
  return t;
89
89
  } }, jA = (l, A) => !DA(l, A), KA = { attribute: !0, type: String, converter: _, reflect: !1, useDefault: !1, hasChanged: jA };
90
- Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), W.litPropertyMetadata ?? (W.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
90
+ Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), s.litPropertyMetadata ?? (s.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
91
91
  let m = class extends HTMLElement {
92
92
  static addInitializer(A) {
93
93
  this._$Ei(), (this.l ?? (this.l = [])).push(A);
@@ -289,14 +289,14 @@ let m = class extends HTMLElement {
289
289
  firstUpdated(A) {
290
290
  }
291
291
  };
292
- m.elementStyles = [], m.shadowRootOptions = { mode: "open" }, m[z("elementProperties")] = /* @__PURE__ */ new Map(), m[z("finalized")] = /* @__PURE__ */ new Map(), eA == null || eA({ ReactiveElement: m }), (W.reactiveElementVersions ?? (W.reactiveElementVersions = [])).push("2.1.0");
292
+ m.elementStyles = [], m.shadowRootOptions = { mode: "open" }, m[z("elementProperties")] = /* @__PURE__ */ new Map(), m[z("finalized")] = /* @__PURE__ */ new Map(), eA == null || eA({ ReactiveElement: m }), (s.reactiveElementVersions ?? (s.reactiveElementVersions = [])).push("2.1.0");
293
293
  /**
294
294
  * @license
295
295
  * Copyright 2017 Google LLC
296
296
  * SPDX-License-Identifier: BSD-3-Clause
297
297
  */
298
- const G = globalThis, $ = G.trustedTypes, UA = $ ? $.createPolicy("lit-html", { createHTML: (l) => l }) : void 0, NA = "$lit$", s = `lit$${Math.random().toFixed(9).slice(2)}$`, RA = "?" + s, tt = `<${RA}>`, L = document, F = () => L.createComment(""), M = (l) => l === null || typeof l != "object" && typeof l != "function", cA = Array.isArray, lt = (l) => cA(l) || typeof (l == null ? void 0 : l[Symbol.iterator]) == "function", rA = `[
299
- \f\r]`, H = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, sA = /-->/g, WA = />/g, i = RegExp(`>|${rA}(?:([^\\s"'>=/]+)(${rA}*=${rA}*(?:[^
298
+ const G = globalThis, $ = G.trustedTypes, UA = $ ? $.createPolicy("lit-html", { createHTML: (l) => l }) : void 0, NA = "$lit$", W = `lit$${Math.random().toFixed(9).slice(2)}$`, RA = "?" + W, tt = `<${RA}>`, L = document, F = () => L.createComment(""), M = (l) => l === null || typeof l != "object" && typeof l != "function", cA = Array.isArray, lt = (l) => cA(l) || typeof (l == null ? void 0 : l[Symbol.iterator]) == "function", rA = `[
299
+ \f\r]`, H = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, WA = /-->/g, sA = />/g, i = RegExp(`>|${rA}(?:([^\\s"'>=/]+)(${rA}*=${rA}*(?:[^
300
300
  \f\r"'\`<>=]|("|')|))|$)`, "g"), iA = /'/g, vA = /"/g, HA = /^(?:script|style|textarea|title)$/i, et = (l) => (A, ...t) => ({ _$litType$: l, strings: A, values: t }), T = et(1), f = Symbol.for("lit-noChange"), c = Symbol.for("lit-nothing"), OA = /* @__PURE__ */ new WeakMap(), O = L.createTreeWalker(L, 129);
301
301
  function zA(l, A) {
302
302
  if (!cA(l) || !l.hasOwnProperty("raw")) throw Error("invalid template strings array");
@@ -308,9 +308,9 @@ const rt = (l, A) => {
308
308
  for (let S = 0; S < t; S++) {
309
309
  const n = l[S];
310
310
  let d, k, y = -1, x = 0;
311
- for (; x < n.length && (V.lastIndex = x, k = V.exec(n), k !== null); ) x = V.lastIndex, V === H ? k[1] === "!--" ? V = sA : k[1] !== void 0 ? V = WA : k[2] !== void 0 ? (HA.test(k[2]) && (e = RegExp("</" + k[2], "g")), V = i) : k[3] !== void 0 && (V = i) : V === i ? k[0] === ">" ? (V = e ?? H, y = -1) : k[1] === void 0 ? y = -2 : (y = V.lastIndex - k[2].length, d = k[1], V = k[3] === void 0 ? i : k[3] === '"' ? vA : iA) : V === vA || V === iA ? V = i : V === sA || V === WA ? V = H : (V = i, e = void 0);
311
+ for (; x < n.length && (V.lastIndex = x, k = V.exec(n), k !== null); ) x = V.lastIndex, V === H ? k[1] === "!--" ? V = WA : k[1] !== void 0 ? V = sA : k[2] !== void 0 ? (HA.test(k[2]) && (e = RegExp("</" + k[2], "g")), V = i) : k[3] !== void 0 && (V = i) : V === i ? k[0] === ">" ? (V = e ?? H, y = -1) : k[1] === void 0 ? y = -2 : (y = V.lastIndex - k[2].length, d = k[1], V = k[3] === void 0 ? i : k[3] === '"' ? vA : iA) : V === vA || V === iA ? V = i : V === WA || V === sA ? V = H : (V = i, e = void 0);
312
312
  const U = V === i && l[S + 1].startsWith("/>") ? " " : "";
313
- p += V === H ? n + tt : y >= 0 ? (r.push(d), n.slice(0, y) + NA + n.slice(y) + s + U) : n + s + (y === -2 ? S : U);
313
+ p += V === H ? n + tt : y >= 0 ? (r.push(d), n.slice(0, y) + NA + n.slice(y) + W + U) : n + W + (y === -2 ? S : U);
314
314
  }
315
315
  return [zA(l, p + (l[t] || "<?>") + (A === 2 ? "</svg>" : A === 3 ? "</math>" : "")), r];
316
316
  };
@@ -327,11 +327,11 @@ class h {
327
327
  for (; (e = O.nextNode()) !== null && n.length < S; ) {
328
328
  if (e.nodeType === 1) {
329
329
  if (e.hasAttributes()) for (const y of e.getAttributeNames()) if (y.endsWith(NA)) {
330
- const x = k[V++], U = e.getAttribute(y).split(s), Q = /([.?@])?(.*)/.exec(x);
330
+ const x = k[V++], U = e.getAttribute(y).split(W), Q = /([.?@])?(.*)/.exec(x);
331
331
  n.push({ type: 1, index: p, name: Q[2], strings: U, ctor: Q[1] === "." ? Vt : Q[1] === "?" ? qt : Q[1] === "@" ? nt : lA }), e.removeAttribute(y);
332
- } else y.startsWith(s) && (n.push({ type: 6, index: p }), e.removeAttribute(y));
332
+ } else y.startsWith(W) && (n.push({ type: 6, index: p }), e.removeAttribute(y));
333
333
  if (HA.test(e.tagName)) {
334
- const y = e.textContent.split(s), x = y.length - 1;
334
+ const y = e.textContent.split(W), x = y.length - 1;
335
335
  if (x > 0) {
336
336
  e.textContent = $ ? $.emptyScript : "";
337
337
  for (let U = 0; U < x; U++) e.append(y[U], F()), O.nextNode(), n.push({ type: 2, index: ++p });
@@ -341,7 +341,7 @@ class h {
341
341
  } else if (e.nodeType === 8) if (e.data === RA) n.push({ type: 2, index: p });
342
342
  else {
343
343
  let y = -1;
344
- for (; (y = e.data.indexOf(s, y + 1)) !== -1; ) n.push({ type: 7, index: p }), y += s.length - 1;
344
+ for (; (y = e.data.indexOf(W, y + 1)) !== -1; ) n.push({ type: 7, index: p }), y += W.length - 1;
345
345
  }
346
346
  p++;
347
347
  }
@@ -713,9 +713,9 @@ function Ut(l, A) {
713
713
  * SPDX-License-Identifier: BSD-3-Clause
714
714
  */
715
715
  const LA = /* @__PURE__ */ new WeakMap(), fA = /* @__PURE__ */ new Map();
716
- function st(l, A, t) {
716
+ function Wt(l, A, t) {
717
717
  if (l) {
718
- const r = (t == null ? void 0 : t.id) ?? Wt(A), e = l[r];
718
+ const r = (t == null ? void 0 : t.id) ?? st(A), e = l[r];
719
719
  if (e) {
720
720
  if (typeof e == "string")
721
721
  return e;
@@ -738,7 +738,7 @@ function st(l, A, t) {
738
738
  }
739
739
  return FA(A);
740
740
  }
741
- function Wt(l) {
741
+ function st(l) {
742
742
  const A = typeof l == "string" ? l : l.strings;
743
743
  let t = fA.get(A);
744
744
  return t === void 0 && (t = Ut(A, typeof l != "string" && !("strTag" in l)), fA.set(A, t)), t;
@@ -754,7 +754,7 @@ function qA(l) {
754
754
  let AA = "", nA, hA, tA, aA, EA, v = new MA();
755
755
  v.resolve();
756
756
  let g = 0;
757
- const it = (l) => (jt((A, t) => st(EA, A, t)), AA = hA = l.sourceLocale, tA = new Set(l.targetLocales), tA.add(l.sourceLocale), aA = l.loadLocale, { getLocale: vt, setLocale: Ot }), vt = () => AA, Ot = (l) => {
757
+ const it = (l) => (jt((A, t) => Wt(EA, A, t)), AA = hA = l.sourceLocale, tA = new Set(l.targetLocales), tA.add(l.sourceLocale), aA = l.loadLocale, { getLocale: vt, setLocale: Ot }), vt = () => AA, Ot = (l) => {
758
758
  if (l === (nA ?? AA))
759
759
  return v.promise;
760
760
  if (!tA || !aA)
@@ -956,7 +956,7 @@ let E = class extends X {
956
956
  <div class="step-1">
957
957
  <div class="step-1-container-right">
958
958
  <p class="step-1-header">
959
- ${q("Forget the tape. Find the ideal size with your device")}
959
+ ${q("Forget the tape.. Find the ideal size with your device")}
960
960
  </p>
961
961
  <p class="step-1-description">
962
962
  ${q("As fast as facial recognition. And don't worry, we don't store or share your image.")}
@@ -1645,7 +1645,7 @@ var wt = Object.defineProperty, Yt = Object.getOwnPropertyDescriptor, u = (l, A,
1645
1645
  const { getLocale: gt, setLocale: PA } = it({
1646
1646
  sourceLocale: IA,
1647
1647
  targetLocales: bt,
1648
- loadLocale: (l) => wA(/* @__PURE__ */ Object.assign({ "./generated/locales/pt-BR.ts": () => import("./pt-BR-DbHWxMW_.mjs") }), `./generated/locales/${l}.ts`, 4)
1648
+ loadLocale: (l) => wA(/* @__PURE__ */ Object.assign({ "./generated/locales/pt-BR.ts": () => import("./pt-BR-CKdzgVyT.mjs") }), `./generated/locales/${l}.ts`, 4)
1649
1649
  });
1650
1650
  let a = class extends X {
1651
1651
  constructor() {
@@ -1804,18 +1804,9 @@ let a = class extends X {
1804
1804
  "X-Tenant-Id": this.tenantId
1805
1805
  }
1806
1806
  })).json();
1807
- if (this.isFetching = !1, this.isLoading = !1, S.success) {
1808
- if (!this.measurerKey && S.measurerKey) {
1809
- this.measurerKey = S.measurerKey, this.stopPolling(), this.startPolling();
1810
- return;
1811
- }
1812
- this.measurements = S.measurements, this.recommendedSize = S.chosenSize, this.measurements && this.recommendedSize ? (this.stopPolling(), this.step = 4) : (this.instructionMessage = q("Please turn sideways!"), setTimeout(() => {
1813
- this.startPolling();
1814
- }, 3e3));
1815
- } else
1816
- this.instructionMessage = this.getTranslatedMessage(S.message || "UNKNOWN_ERROR"), this.instructionMessageTimeout = setTimeout(() => {
1817
- this.recommendedSize || (this.instructionMessage = q("Position yourself in front of the camera"), this.poolingTimeout = setTimeout(l, 0));
1818
- }, 2e3);
1807
+ this.isFetching = !1, this.isLoading = !1, S.success ? (this.measurements = S.measurements, this.recommendedSize = S.chosenSize, this.instructionMessage = q("Measurement successful!"), this.stopPolling(), this.step = 3) : (this.instructionMessage = this.getTranslatedMessage(S.message || "UNKNOWN_ERROR"), this.instructionMessageTimeout = setTimeout(() => {
1808
+ this.recommendedSize || (this.instructionMessage = q("Position yourself in front of the camera"), this.poolingTimeout = setTimeout(l, 0));
1809
+ }, 2e3));
1819
1810
  } catch {
1820
1811
  this.isFetching = !1, this.isLoading = !1, this.instructionMessage = q("Error processing measurement"), this.instructionMessageTimeout = setTimeout(() => {
1821
1812
  this.recommendedSize || (this.instructionMessage = q("Position yourself in front of the camera"), this.poolingTimeout = setTimeout(l, 0));
@@ -162,7 +162,7 @@
162
162
  <div class="step-1">
163
163
  <div class="step-1-container-right">
164
164
  <p class="step-1-header">
165
- ${n("Forget the tape. Find the ideal size with your device")}
165
+ ${n("Forget the tape.. Find the ideal size with your device")}
166
166
  </p>
167
167
  <p class="step-1-description">
168
168
  ${n("As fast as facial recognition. And don't worry, we don't store or share your image.")}
@@ -749,7 +749,7 @@
749
749
  }
750
750
  }
751
751
 
752
- `,JA([j({type:Number})],Q.prototype,"height",2),JA([j({type:Function})],Q.prototype,"onStep2advancement",2),Q=JA([R("xact-step-informs"),w()],Q);const IA="data:image/svg+xml,%3csvg%20width='22'%20height='40'%20viewBox='0%200%2022%2040'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M21.517%200L0%2013.3362V0H21.517Z'%20fill='white'/%3e%3cpath%20d='M21.517%2013.339L0%2026.6724V13.3362H21.517V13.339Z'%20fill='white'/%3e%3cpath%20d='M21.517%2026.6755L0%2040.0089V26.6726H21.517V26.6755Z'%20fill='%231C28BA'/%3e%3c/svg%3e",ht="data:image/svg+xml,%3csvg%20width='22'%20height='41'%20viewBox='0%200%2022%2041'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M21.517%200.00878906L0%2013.345V0.00878906H21.517Z'%20fill='white'/%3e%3cpath%20d='M21.517%2013.3478L0%2026.6812V13.345H21.517V13.3478Z'%20fill='%231C28BA'/%3e%3cpath%20d='M21.517%2026.6843L0%2040.0176V26.6814H21.517V26.6843Z'%20fill='white'/%3e%3c/svg%3e",Et="data:image/svg+xml,%3csvg%20width='22'%20height='41'%20viewBox='0%200%2022%2041'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M21.517%200.0204381L0%2013.3538V0.0175781H21.517V0.0204381Z'%20fill='%231C28BA'/%3e%3cpath%20d='M21.517%2013.3538L0%2026.69V13.3538H21.517Z'%20fill='white'/%3e%3cpath%20d='M21.517%2026.693L0%2040.0264V26.6902H21.517V26.693Z'%20fill='white'/%3e%3c/svg%3e";var It=Object.defineProperty,wt=Object.getOwnPropertyDescriptor,y=(r,A,t,l)=>{for(var e=l>1?void 0:l?wt(A,t):A,p=r.length-1,V;p>=0;p--)(V=r[p])&&(e=(l?V(A,t,e):V(e))||e);return l&&e&&It(A,t,e),e};const{getLocale:Yt,setLocale:XA}=Ut({sourceLocale:EA,targetLocales:vt,loadLocale:r=>H(Object.assign({"./generated/locales/pt-BR.ts":()=>Promise.resolve().then(()=>Ct)}),`./generated/locales/${r}.ts`,4)});a.BodyMeasurer=class extends X{constructor(){super(...arguments),this.spinnerFrame=0,this.apiKey="DB8mP9gStPfvdyeYbbuCV4Zf3SH745dI",this.tenantId="1",this.productSku="",this.apiUrl="https://xactsize-dotnet-api-923169850574.southamerica-east1.run.app/api/measurer/measure/body",this._culture="pt-BR",this.measurerKey="",this._isLocaleLoading=!1,this.showModal=!1,this.step=1,this.height=0,this.recommendedSize="",this.measurements={},this.errorMessage="",this.instructionMessage=n("Position yourself in front of the camera"),this.shouldStartMeasurement=!1,this.isLoading=!1,this.isFetching=!1,this.videoElement=null,this.stream=null,this.poolingTimeout=null,this.instructionMessageTimeout=null,this.cameras=[],this.currentCameraId=null}firstUpdated(){this.startSpinnerAnimation()}startSpinnerAnimation(){const A=[Et,ht,IA];this.spinnerInterval=setInterval(()=>{var l;const t=(l=this.shadowRoot)==null?void 0:l.querySelector(".spinner");t&&(t.src=A[this.spinnerFrame],this.spinnerFrame=(this.spinnerFrame+1)%A.length)},300)}get culture(){return this._culture}set culture(A){const t=this._culture;this._culture=A,this.requestUpdate("culture",t),this._applyLocale(A).catch(console.error)}async _applyLocale(A){try{this._isLocaleLoading=!0,this.requestUpdate(),await XA(A)}catch(t){console.error("Failed to load locale",A,t),await XA(EA)}finally{this._isLocaleLoading=!1,this.requestUpdate()}}get errorMap(){return{ERR_RIGHT_ARM_TOO_HIGH:n("Lower your right arm",{id:"ERR_RIGHT_ARM_TOO_HIGH"}),ERR_LEFT_ARM_TOO_HIGH:n("Lower your left arm",{id:"ERR_LEFT_ARM_TOO_HIGH"}),ERR_ARMS_NOT_RAISED:n("Raise both arms to a 45-degree angle",{id:"ERR_ARMS_NOT_RAISED"}),ERR_RIGHT_ARM_NOT_RAISED:n("Raise your right arm to a 45-degree angle",{id:"ERR_RIGHT_ARM_NOT_RAISED"}),ERR_LEFT_ARM_NOT_RAISED:n("Raise your left arm to a 45-degree angle",{id:"ERR_LEFT_ARM_NOT_RAISED"}),ERR_BODY_LANDMARKS_NOT_DETECTED:n("Ensure your full body is visible in the camera",{id:"ERR_BODY_LANDMARKS_NOT_DETECTED"}),ERR_HIPS_NOT_VISIBLE:n("Adjust your position to show your hips",{id:"ERR_HIPS_NOT_VISIBLE"}),ERR_TOO_CLOSE_TO_CAMERA:n("Step back from the camera",{id:"ERR_TOO_CLOSE_TO_CAMERA"}),ERR_NOT_SIDE_VIEW:n("Turn to show your side profile",{id:"ERR_NOT_SIDE_VIEW"}),ERR_INVALID_CLOTHING_TYPE:n("This clothing type is not supported; please contact support",{id:"ERR_INVALID_CLOTHING_TYPE"}),ERR_UPPER_BODY_NOT_VISIBLE:n("Adjust your position to show your upper body",{id:"ERR_UPPER_BODY_NOT_VISIBLE"}),ERR_HEAD_TOO_CLOSE_TO_EDGE:n("Move your head away from the edge of the frame",{id:"ERR_HEAD_TOO_CLOSE_TO_EDGE"}),ERR_LOWER_BODY_NOT_VISIBLE:n("Adjust your position to show your lower body",{id:"ERR_LOWER_BODY_NOT_VISIBLE"}),ERR_FEET_TOO_CLOSE_TO_EDGE:n("Move your feet away from the edge of the frame",{id:"ERR_FEET_TOO_CLOSE_TO_EDGE"}),ERR_BODY_TOO_CLOSE_TO_EDGE:n("Move your body away from the edge of the frame",{id:"ERR_BODY_TOO_CLOSE_TO_EDGE"}),ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_LEFT:n("Move to the left to center your body",{id:"ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_LEFT"}),ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_RIGHT:n("Move to the right to center your body",{id:"ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_RIGHT"}),ERR_SHOULDERS_NOT_VISIBLE:n("Adjust your position to show your shoulders",{id:"ERR_SHOULDERS_NOT_VISIBLE"}),ERR_HEIGHT_MEASUREMENT_FAILED:n("Stand straight and ensure your full body is visible",{id:"ERR_HEIGHT_MEASUREMENT_FAILED"}),ERR_HEAD_POINT_NOT_DETECTED:n("Ensure your head is fully visible in the frame",{id:"ERR_HEAD_POINT_NOT_DETECTED"}),ERR_INCORRECT_POSTURE:n("Stand straight with your shoulders back",{id:"ERR_INCORRECT_POSTURE"}),ERR_HEM_MEASUREMENT_FAILED:n("Ensure your clothing hem is visible and clear",{id:"ERR_HEM_MEASUREMENT_FAILED"}),ERR_SHOULDER_MEASUREMENT_FAILED:n("Keep your shoulders relaxed and visible",{id:"ERR_SHOULDER_MEASUREMENT_FAILED"}),ERR_ARM_NOT_STRETCHED:n("Stretch your arms fully",{id:"ERR_ARM_NOT_STRETCHED"}),ERR_LEGS_NOT_DETECTED:n("Ensure your legs are fully visible in the frame",{id:"ERR_LEGS_NOT_DETECTED"}),ERR_HIPS_MEASUREMENT_FAILED:n("Stand straight and ensure your hips are visible",{id:"ERR_HIPS_MEASUREMENT_FAILED"}),ERR_WAIST_MEASUREMENT_FAILED:n("Stand straight and ensure your waist is visible",{id:"ERR_WAIST_MEASUREMENT_FAILED"}),ERR_INVALID_MEASURE_SIDE_VIEW:n("Turn to show a clear side profile",{id:"ERR_INVALID_MEASURE_SIDE_VIEW"}),ERR_INVALID_BODY_HEIGHT_TYPE:n("Ensure your full body is visible for height measurement",{id:"ERR_INVALID_BODY_HEIGHT_TYPE"}),ERR_IMAGE_LOAD_FAILED:n("Try again later; the image could not be processed",{id:"ERR_IMAGE_LOAD_FAILED"}),ERR_HEIGHT_INVALID:n("Height must be between 50 and 300 cm",{id:"ERR_HEIGHT_INVALID"})}}getTranslatedMessage(A){const t=this.errorMap[A];return t||(console.info("Error code is missing",A),n("An unexpected error occurred"))}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.handleEscKey.bind(this))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleEscKey.bind(this)),this.stopPolling(),clearInterval(this.spinnerInterval)}handleEscKey(A){A.key==="Escape"&&this.showModal&&this.closeModal()}openModal(){this.showModal=!0,this.step=1,this.height=0,this.instructionMessage=n("Position yourself in front of the camera")}closeModal(){this.showModal=!1,this.onMeasurementCanceled&&typeof this.onMeasurementCanceled=="function"&&this.onMeasurementCanceled(),this.stopPolling(),this.dispatchEvent(new CustomEvent("measurementCanceled",{detail:{}}))}async step2advancement(){if(this.height<50||this.height>300){this.errorMessage=this.getTranslatedMessage("ERR_HEIGHT_INVALID");return}this.step=3,this.errorMessage=""}async startMeasurement(){this.step=2,this.errorMessage="",this.shouldStartMeasurement=!0}updated(A){super.updated(A),A.has("step")&&this.step===3&&this.shouldStartMeasurement&&(this.initializeMeasurement(),this.shouldStartMeasurement=!1)}async initializeMeasurement(){this.videoElement=this.shadowRoot.querySelector("video");try{this.stream=await navigator.mediaDevices.getUserMedia({video:!0}),this.videoElement&&(this.videoElement.srcObject=this.stream,await this.videoElement.play(),await this.loadCameras(),this.startPolling())}catch{this.errorMessage=n("Error accessing webcam")}}async loadCameras(){try{const A=await navigator.mediaDevices.enumerateDevices();this.cameras=A.filter(t=>t.kind==="videoinput"),this.cameras.length>0&&(this.currentCameraId=this.cameras[0].deviceId)}catch(A){console.error("Error enumerating devices:",A)}}async flipCamera(){if(this.cameras.length<2)return;this.isLoading=!0,this.stopPolling();const t=(this.cameras.findIndex(l=>l.deviceId===this.currentCameraId)+1)%this.cameras.length;this.currentCameraId=this.cameras[t].deviceId;try{this.stream&&this.stream.getTracks().forEach(l=>l.stop()),this.stream=await navigator.mediaDevices.getUserMedia({video:{deviceId:{exact:this.currentCameraId}}}),this.videoElement&&(this.videoElement.srcObject=this.stream,await this.videoElement.play(),this.startPolling())}catch{this.errorMessage=n("Error switching camera")}finally{this.isLoading=!1}}async startPolling(){const A=async()=>{if(!this.videoElement||!this.stream||this.isFetching)return;const t=document.createElement("canvas");t.width=this.videoElement.videoWidth,t.height=this.videoElement.videoHeight;const l=t.getContext("2d");l==null||l.drawImage(this.videoElement,0,0,t.width,t.height);const e=await new Promise(S=>t.toBlob(q=>S(q),"image/jpeg")),p=new File([e],"frame.jpg",{type:"image/jpeg"}),V=new FormData;V.append("image",p),V.append("height",this.height.toString()),V.append("product_sku",this.productSku),this.measurerKey&&V.append("measurerKey",this.measurerKey);try{this.isFetching=!0,this.isLoading=!0,this.poolingTimeout!==null&&(clearTimeout(this.poolingTimeout),this.poolingTimeout=null),this.instructionMessageTimeout!==null&&(clearTimeout(this.instructionMessageTimeout),this.instructionMessageTimeout=null);const q=await(await fetch(this.apiUrl,{method:"POST",body:V,headers:{Accept:"application/json","Cache-Control":"no-store",Pragma:"no-cache","X-Api-Key":this.apiKey,"X-Tenant-Id":this.tenantId}})).json();if(this.isFetching=!1,this.isLoading=!1,q.success){if(!this.measurerKey&&q.measurerKey){this.measurerKey=q.measurerKey,this.stopPolling(),this.startPolling();return}this.measurements=q.measurements,this.recommendedSize=q.chosenSize,this.measurements&&this.recommendedSize?(this.stopPolling(),this.step=4):(this.instructionMessage=n("Please turn sideways!"),setTimeout(()=>{this.startPolling()},3e3))}else this.instructionMessage=this.getTranslatedMessage(q.message||"UNKNOWN_ERROR"),this.instructionMessageTimeout=setTimeout(()=>{this.recommendedSize||(this.instructionMessage=n("Position yourself in front of the camera"),this.poolingTimeout=setTimeout(A,0))},2e3)}catch{this.isFetching=!1,this.isLoading=!1,this.instructionMessage=n("Error processing measurement"),this.instructionMessageTimeout=setTimeout(()=>{this.recommendedSize||(this.instructionMessage=n("Position yourself in front of the camera"),this.poolingTimeout=setTimeout(A,0))},2e3)}};A()}stopPolling(){this.poolingTimeout!==null&&(clearTimeout(this.poolingTimeout),this.poolingTimeout=null),this.instructionMessageTimeout!==null&&(clearTimeout(this.instructionMessageTimeout),this.instructionMessageTimeout=null),this.stream&&(this.stream.getTracks().forEach(A=>A.stop()),this.stream=null)}acceptMeasurement(){this.dispatchEvent(new CustomEvent("measurementAccepted",{detail:{size:this.recommendedSize}})),this.onMeasurementAccepted&&typeof this.onMeasurementAccepted=="function"&&this.onMeasurementAccepted(),this.showModal=!1,this.stopPolling()}resetMeasurement(){this.step=1,this.height=0,this.recommendedSize="",this.measurements={},this.stopPolling()}stopMeasurement(){this.resetMeasurement(),this.showModal=!1}render(){return this._isLocaleLoading?J`<div hidden></div>`:J`
752
+ `,JA([j({type:Number})],Q.prototype,"height",2),JA([j({type:Function})],Q.prototype,"onStep2advancement",2),Q=JA([R("xact-step-informs"),w()],Q);const IA="data:image/svg+xml,%3csvg%20width='22'%20height='40'%20viewBox='0%200%2022%2040'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M21.517%200L0%2013.3362V0H21.517Z'%20fill='white'/%3e%3cpath%20d='M21.517%2013.339L0%2026.6724V13.3362H21.517V13.339Z'%20fill='white'/%3e%3cpath%20d='M21.517%2026.6755L0%2040.0089V26.6726H21.517V26.6755Z'%20fill='%231C28BA'/%3e%3c/svg%3e",ht="data:image/svg+xml,%3csvg%20width='22'%20height='41'%20viewBox='0%200%2022%2041'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M21.517%200.00878906L0%2013.345V0.00878906H21.517Z'%20fill='white'/%3e%3cpath%20d='M21.517%2013.3478L0%2026.6812V13.345H21.517V13.3478Z'%20fill='%231C28BA'/%3e%3cpath%20d='M21.517%2026.6843L0%2040.0176V26.6814H21.517V26.6843Z'%20fill='white'/%3e%3c/svg%3e",Et="data:image/svg+xml,%3csvg%20width='22'%20height='41'%20viewBox='0%200%2022%2041'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M21.517%200.0204381L0%2013.3538V0.0175781H21.517V0.0204381Z'%20fill='%231C28BA'/%3e%3cpath%20d='M21.517%2013.3538L0%2026.69V13.3538H21.517Z'%20fill='white'/%3e%3cpath%20d='M21.517%2026.693L0%2040.0264V26.6902H21.517V26.693Z'%20fill='white'/%3e%3c/svg%3e";var It=Object.defineProperty,wt=Object.getOwnPropertyDescriptor,y=(r,A,t,l)=>{for(var e=l>1?void 0:l?wt(A,t):A,p=r.length-1,V;p>=0;p--)(V=r[p])&&(e=(l?V(A,t,e):V(e))||e);return l&&e&&It(A,t,e),e};const{getLocale:Yt,setLocale:XA}=Ut({sourceLocale:EA,targetLocales:vt,loadLocale:r=>H(Object.assign({"./generated/locales/pt-BR.ts":()=>Promise.resolve().then(()=>Ct)}),`./generated/locales/${r}.ts`,4)});a.BodyMeasurer=class extends X{constructor(){super(...arguments),this.spinnerFrame=0,this.apiKey="DB8mP9gStPfvdyeYbbuCV4Zf3SH745dI",this.tenantId="1",this.productSku="",this.apiUrl="https://xactsize-dotnet-api-923169850574.southamerica-east1.run.app/api/measurer/measure/body",this._culture="pt-BR",this.measurerKey="",this._isLocaleLoading=!1,this.showModal=!1,this.step=1,this.height=0,this.recommendedSize="",this.measurements={},this.errorMessage="",this.instructionMessage=n("Position yourself in front of the camera"),this.shouldStartMeasurement=!1,this.isLoading=!1,this.isFetching=!1,this.videoElement=null,this.stream=null,this.poolingTimeout=null,this.instructionMessageTimeout=null,this.cameras=[],this.currentCameraId=null}firstUpdated(){this.startSpinnerAnimation()}startSpinnerAnimation(){const A=[Et,ht,IA];this.spinnerInterval=setInterval(()=>{var l;const t=(l=this.shadowRoot)==null?void 0:l.querySelector(".spinner");t&&(t.src=A[this.spinnerFrame],this.spinnerFrame=(this.spinnerFrame+1)%A.length)},300)}get culture(){return this._culture}set culture(A){const t=this._culture;this._culture=A,this.requestUpdate("culture",t),this._applyLocale(A).catch(console.error)}async _applyLocale(A){try{this._isLocaleLoading=!0,this.requestUpdate(),await XA(A)}catch(t){console.error("Failed to load locale",A,t),await XA(EA)}finally{this._isLocaleLoading=!1,this.requestUpdate()}}get errorMap(){return{ERR_RIGHT_ARM_TOO_HIGH:n("Lower your right arm",{id:"ERR_RIGHT_ARM_TOO_HIGH"}),ERR_LEFT_ARM_TOO_HIGH:n("Lower your left arm",{id:"ERR_LEFT_ARM_TOO_HIGH"}),ERR_ARMS_NOT_RAISED:n("Raise both arms to a 45-degree angle",{id:"ERR_ARMS_NOT_RAISED"}),ERR_RIGHT_ARM_NOT_RAISED:n("Raise your right arm to a 45-degree angle",{id:"ERR_RIGHT_ARM_NOT_RAISED"}),ERR_LEFT_ARM_NOT_RAISED:n("Raise your left arm to a 45-degree angle",{id:"ERR_LEFT_ARM_NOT_RAISED"}),ERR_BODY_LANDMARKS_NOT_DETECTED:n("Ensure your full body is visible in the camera",{id:"ERR_BODY_LANDMARKS_NOT_DETECTED"}),ERR_HIPS_NOT_VISIBLE:n("Adjust your position to show your hips",{id:"ERR_HIPS_NOT_VISIBLE"}),ERR_TOO_CLOSE_TO_CAMERA:n("Step back from the camera",{id:"ERR_TOO_CLOSE_TO_CAMERA"}),ERR_NOT_SIDE_VIEW:n("Turn to show your side profile",{id:"ERR_NOT_SIDE_VIEW"}),ERR_INVALID_CLOTHING_TYPE:n("This clothing type is not supported; please contact support",{id:"ERR_INVALID_CLOTHING_TYPE"}),ERR_UPPER_BODY_NOT_VISIBLE:n("Adjust your position to show your upper body",{id:"ERR_UPPER_BODY_NOT_VISIBLE"}),ERR_HEAD_TOO_CLOSE_TO_EDGE:n("Move your head away from the edge of the frame",{id:"ERR_HEAD_TOO_CLOSE_TO_EDGE"}),ERR_LOWER_BODY_NOT_VISIBLE:n("Adjust your position to show your lower body",{id:"ERR_LOWER_BODY_NOT_VISIBLE"}),ERR_FEET_TOO_CLOSE_TO_EDGE:n("Move your feet away from the edge of the frame",{id:"ERR_FEET_TOO_CLOSE_TO_EDGE"}),ERR_BODY_TOO_CLOSE_TO_EDGE:n("Move your body away from the edge of the frame",{id:"ERR_BODY_TOO_CLOSE_TO_EDGE"}),ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_LEFT:n("Move to the left to center your body",{id:"ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_LEFT"}),ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_RIGHT:n("Move to the right to center your body",{id:"ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_RIGHT"}),ERR_SHOULDERS_NOT_VISIBLE:n("Adjust your position to show your shoulders",{id:"ERR_SHOULDERS_NOT_VISIBLE"}),ERR_HEIGHT_MEASUREMENT_FAILED:n("Stand straight and ensure your full body is visible",{id:"ERR_HEIGHT_MEASUREMENT_FAILED"}),ERR_HEAD_POINT_NOT_DETECTED:n("Ensure your head is fully visible in the frame",{id:"ERR_HEAD_POINT_NOT_DETECTED"}),ERR_INCORRECT_POSTURE:n("Stand straight with your shoulders back",{id:"ERR_INCORRECT_POSTURE"}),ERR_HEM_MEASUREMENT_FAILED:n("Ensure your clothing hem is visible and clear",{id:"ERR_HEM_MEASUREMENT_FAILED"}),ERR_SHOULDER_MEASUREMENT_FAILED:n("Keep your shoulders relaxed and visible",{id:"ERR_SHOULDER_MEASUREMENT_FAILED"}),ERR_ARM_NOT_STRETCHED:n("Stretch your arms fully",{id:"ERR_ARM_NOT_STRETCHED"}),ERR_LEGS_NOT_DETECTED:n("Ensure your legs are fully visible in the frame",{id:"ERR_LEGS_NOT_DETECTED"}),ERR_HIPS_MEASUREMENT_FAILED:n("Stand straight and ensure your hips are visible",{id:"ERR_HIPS_MEASUREMENT_FAILED"}),ERR_WAIST_MEASUREMENT_FAILED:n("Stand straight and ensure your waist is visible",{id:"ERR_WAIST_MEASUREMENT_FAILED"}),ERR_INVALID_MEASURE_SIDE_VIEW:n("Turn to show a clear side profile",{id:"ERR_INVALID_MEASURE_SIDE_VIEW"}),ERR_INVALID_BODY_HEIGHT_TYPE:n("Ensure your full body is visible for height measurement",{id:"ERR_INVALID_BODY_HEIGHT_TYPE"}),ERR_IMAGE_LOAD_FAILED:n("Try again later; the image could not be processed",{id:"ERR_IMAGE_LOAD_FAILED"}),ERR_HEIGHT_INVALID:n("Height must be between 50 and 300 cm",{id:"ERR_HEIGHT_INVALID"})}}getTranslatedMessage(A){const t=this.errorMap[A];return t||(console.info("Error code is missing",A),n("An unexpected error occurred"))}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.handleEscKey.bind(this))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleEscKey.bind(this)),this.stopPolling(),clearInterval(this.spinnerInterval)}handleEscKey(A){A.key==="Escape"&&this.showModal&&this.closeModal()}openModal(){this.showModal=!0,this.step=1,this.height=0,this.instructionMessage=n("Position yourself in front of the camera")}closeModal(){this.showModal=!1,this.onMeasurementCanceled&&typeof this.onMeasurementCanceled=="function"&&this.onMeasurementCanceled(),this.stopPolling(),this.dispatchEvent(new CustomEvent("measurementCanceled",{detail:{}}))}async step2advancement(){if(this.height<50||this.height>300){this.errorMessage=this.getTranslatedMessage("ERR_HEIGHT_INVALID");return}this.step=3,this.errorMessage=""}async startMeasurement(){this.step=2,this.errorMessage="",this.shouldStartMeasurement=!0}updated(A){super.updated(A),A.has("step")&&this.step===3&&this.shouldStartMeasurement&&(this.initializeMeasurement(),this.shouldStartMeasurement=!1)}async initializeMeasurement(){this.videoElement=this.shadowRoot.querySelector("video");try{this.stream=await navigator.mediaDevices.getUserMedia({video:!0}),this.videoElement&&(this.videoElement.srcObject=this.stream,await this.videoElement.play(),await this.loadCameras(),this.startPolling())}catch{this.errorMessage=n("Error accessing webcam")}}async loadCameras(){try{const A=await navigator.mediaDevices.enumerateDevices();this.cameras=A.filter(t=>t.kind==="videoinput"),this.cameras.length>0&&(this.currentCameraId=this.cameras[0].deviceId)}catch(A){console.error("Error enumerating devices:",A)}}async flipCamera(){if(this.cameras.length<2)return;this.isLoading=!0,this.stopPolling();const t=(this.cameras.findIndex(l=>l.deviceId===this.currentCameraId)+1)%this.cameras.length;this.currentCameraId=this.cameras[t].deviceId;try{this.stream&&this.stream.getTracks().forEach(l=>l.stop()),this.stream=await navigator.mediaDevices.getUserMedia({video:{deviceId:{exact:this.currentCameraId}}}),this.videoElement&&(this.videoElement.srcObject=this.stream,await this.videoElement.play(),this.startPolling())}catch{this.errorMessage=n("Error switching camera")}finally{this.isLoading=!1}}async startPolling(){const A=async()=>{if(!this.videoElement||!this.stream||this.isFetching)return;const t=document.createElement("canvas");t.width=this.videoElement.videoWidth,t.height=this.videoElement.videoHeight;const l=t.getContext("2d");l==null||l.drawImage(this.videoElement,0,0,t.width,t.height);const e=await new Promise(S=>t.toBlob(q=>S(q),"image/jpeg")),p=new File([e],"frame.jpg",{type:"image/jpeg"}),V=new FormData;V.append("image",p),V.append("height",this.height.toString()),V.append("product_sku",this.productSku),this.measurerKey&&V.append("measurerKey",this.measurerKey);try{this.isFetching=!0,this.isLoading=!0,this.poolingTimeout!==null&&(clearTimeout(this.poolingTimeout),this.poolingTimeout=null),this.instructionMessageTimeout!==null&&(clearTimeout(this.instructionMessageTimeout),this.instructionMessageTimeout=null);const q=await(await fetch(this.apiUrl,{method:"POST",body:V,headers:{Accept:"application/json","Cache-Control":"no-store",Pragma:"no-cache","X-Api-Key":this.apiKey,"X-Tenant-Id":this.tenantId}})).json();this.isFetching=!1,this.isLoading=!1,q.success?(this.measurements=q.measurements,this.recommendedSize=q.chosenSize,this.instructionMessage=n("Measurement successful!"),this.stopPolling(),this.step=3):(this.instructionMessage=this.getTranslatedMessage(q.message||"UNKNOWN_ERROR"),this.instructionMessageTimeout=setTimeout(()=>{this.recommendedSize||(this.instructionMessage=n("Position yourself in front of the camera"),this.poolingTimeout=setTimeout(A,0))},2e3))}catch{this.isFetching=!1,this.isLoading=!1,this.instructionMessage=n("Error processing measurement"),this.instructionMessageTimeout=setTimeout(()=>{this.recommendedSize||(this.instructionMessage=n("Position yourself in front of the camera"),this.poolingTimeout=setTimeout(A,0))},2e3)}};A()}stopPolling(){this.poolingTimeout!==null&&(clearTimeout(this.poolingTimeout),this.poolingTimeout=null),this.instructionMessageTimeout!==null&&(clearTimeout(this.instructionMessageTimeout),this.instructionMessageTimeout=null),this.stream&&(this.stream.getTracks().forEach(A=>A.stop()),this.stream=null)}acceptMeasurement(){this.dispatchEvent(new CustomEvent("measurementAccepted",{detail:{size:this.recommendedSize}})),this.onMeasurementAccepted&&typeof this.onMeasurementAccepted=="function"&&this.onMeasurementAccepted(),this.showModal=!1,this.stopPolling()}resetMeasurement(){this.step=1,this.height=0,this.recommendedSize="",this.measurements={},this.stopPolling()}stopMeasurement(){this.resetMeasurement(),this.showModal=!1}render(){return this._isLocaleLoading?J`<div hidden></div>`:J`
753
753
  <xact-button @click=${this.openModal} label="${n("Find your Xactsize")}"></xact-button>
754
754
 
755
755
  ${this.showModal?J`
@@ -1232,4 +1232,4 @@
1232
1232
  font-family: "Lato", -apple-system, system-ui, BlinkMacSystemFont, sans-serif;
1233
1233
  }
1234
1234
 
1235
- `,y([j({type:String,attribute:"api-key"})],a.BodyMeasurer.prototype,"apiKey",2),y([j({type:String,attribute:"tenant-id"})],a.BodyMeasurer.prototype,"tenantId",2),y([j({type:String,attribute:"product-sku"})],a.BodyMeasurer.prototype,"productSku",2),y([j({type:String,attribute:"api-url"})],a.BodyMeasurer.prototype,"apiUrl",2),y([j({type:Function,attribute:"onmeasurementaccepted"})],a.BodyMeasurer.prototype,"onMeasurementAccepted",2),y([j({type:Function,attribute:"onmeasurementcanceled"})],a.BodyMeasurer.prototype,"onMeasurementCanceled",2),y([j({type:String})],a.BodyMeasurer.prototype,"culture",1),y([k()],a.BodyMeasurer.prototype,"errorMap",1),y([k()],a.BodyMeasurer.prototype,"measurerKey",2),y([k()],a.BodyMeasurer.prototype,"_isLocaleLoading",2),y([k()],a.BodyMeasurer.prototype,"showModal",2),y([k()],a.BodyMeasurer.prototype,"step",2),y([k()],a.BodyMeasurer.prototype,"height",2),y([k()],a.BodyMeasurer.prototype,"recommendedSize",2),y([k()],a.BodyMeasurer.prototype,"measurements",2),y([k()],a.BodyMeasurer.prototype,"errorMessage",2),y([k()],a.BodyMeasurer.prototype,"instructionMessage",2),y([k()],a.BodyMeasurer.prototype,"shouldStartMeasurement",2),y([k()],a.BodyMeasurer.prototype,"isLoading",2),y([k()],a.BodyMeasurer.prototype,"isFetching",2),y([k()],a.BodyMeasurer.prototype,"cameras",2),y([k()],a.BodyMeasurer.prototype,"currentCameraId",2),a.BodyMeasurer=y([R("body-measurer"),w()],a.BodyMeasurer);const Ct=Object.freeze(Object.defineProperty({__proto__:null,templates:{ERR_ARM_NOT_STRETCHED:"Estique seus braços completamente",ERR_ARMS_NOT_RAISED:"Levante ambos os braços em um ângulo de 45 graus",ERR_BODY_LANDMARKS_NOT_DETECTED:"Certifique-se de que seu corpo inteiro esteja visível na câmera",ERR_BODY_TOO_CLOSE_TO_EDGE:"Afaste seu corpo da borda do quadro",ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_LEFT:"Mova-se para a esquerda para centralizar seu corpo",ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_RIGHT:"Mova-se para a direita para centralizar seu corpo",ERR_FEET_TOO_CLOSE_TO_EDGE:"Afaste seus pés da borda do quadro",ERR_HEAD_POINT_NOT_DETECTED:"Certifique-se de que sua cabeça esteja totalmente visível no quadro",ERR_HEAD_TOO_CLOSE_TO_EDGE:"Afaste sua cabeça da borda do quadro",ERR_HEIGHT_INVALID:"A altura deve ser entre 50 e 300cm",ERR_HEIGHT_MEASUREMENT_FAILED:"Fique ereto e certifique-se de que seu corpo inteiro esteja visível",ERR_HEM_MEASUREMENT_FAILED:"Certifique-se de que a bainha da sua roupa esteja visível e clara",ERR_HIPS_MEASUREMENT_FAILED:"Fique ereto e certifique-se de que seus quadris estejam visíveis",ERR_HIPS_NOT_VISIBLE:"Ajuste sua posição para mostrar seus quadris",ERR_IMAGE_LOAD_FAILED:"Tente novamente mais tarde; a imagem não pôde ser processada",ERR_INCORRECT_POSTURE:"Fique ereto com os ombros para trás",ERR_INVALID_BODY_HEIGHT_TYPE:"Certifique-se de que seu corpo inteiro esteja visível para a medição de altura",ERR_INVALID_CLOTHING_TYPE:"Este tipo de roupa não é suportado; entre em contato com o suporte",ERR_INVALID_MEASURE_SIDE_VIEW:"Gire para mostrar um perfil lateral claro",ERR_LEFT_ARM_NOT_RAISED:"Levante seu braço esquerdo em um ângulo de 45 graus",ERR_LEFT_ARM_TOO_HIGH:"Abaixe seu braço esquerdo",ERR_LEGS_NOT_DETECTED:"Certifique-se de que suas pernas estejam totalmente visíveis no quadro",ERR_LOWER_BODY_NOT_VISIBLE:"Ajuste sua posição para mostrar a parte inferior do corpo",ERR_NOT_SIDE_VIEW:"Gire para mostrar seu perfil lateral",ERR_RIGHT_ARM_NOT_RAISED:"Levante seu braço direito em um ângulo de 45 graus",ERR_RIGHT_ARM_TOO_HIGH:"Abaixe seu braço direito",ERR_SHOULDER_MEASUREMENT_FAILED:"Mantenha seus ombros relaxados e visíveis",ERR_SHOULDERS_NOT_VISIBLE:"Ajuste sua posição para mostrar seus ombros",ERR_TOO_CLOSE_TO_CAMERA:"Dê um passo para trás da câmera",ERR_UPPER_BODY_NOT_VISIBLE:"Ajuste sua posição para mostrar a parte superior do corpo",ERR_WAIST_MEASUREMENT_FAILED:"Fique ereto e certifique-se de que sua cintura esteja visível",s2d726e20085011c1:"Altura (cm)",s2f77566c78235d88:"Erro acessando a câmera",s34c58d3d12e5f890:"Erro ao mudar a câmera",s3d324b180f982d46:"Tenha certeza de que seu corpo está totalmente visível",s3e742a73512eb1da:"Para começarmos, informe sua altura",s5c91b5e06c363734:"",s7c5b35754de07309:"Vamos lá!",s8e3fcbc208dcce56:"Esqueça a fita. Descubra o tamanho ideal com o seu dispositivo",s952ed559991cf0b4:"Desenvolvido por",sd13d4c82d57859fc:"Posicione-se em frente a câmera",sdabfef8968aeb5fa:"Um erro inesperado aconteceu",sf315699feee25406:"Descubra o tamanho ideal para você",sb5977e9b7929155d:"As fast as facial recognition. And don't worry, we don't store or share your image.",s420e8053328b31c4:"Your ideal size",sf84b5644f7595ce5:"Based on your measurements and the exact dimensions of the garment, the size recommendation provided is the most accurate for an ideal fit.",sdf9f9c621b6316e7:"Measure Again",s6ad3b28b46803c43:"Accept Suggestion",se940dab2e0b7a710:"Before you begin",scf8d43c4a5cb71fa:"To ensure accurate measurements, we'll take two scans: one from the front and one from the side. Maintain an upright posture with your arms slightly away from your body and stretched out. In the side view, stand up straight with your arms straight and aligned with your body.",s48d094fb2ffff8fb:"Tips",s08b0bc2feb4e0f1c:"Good Lighting",s322c72546e939809:"Choose a well-lit area where you can see your image clearly.",sa4ad2b9cd4ea10ba:"Clean Background",s396efd2b23a16ac9:"Position yourself against a plain background.",s81d43b9b25d0775b:"Clothes",s88a3f5e6a9d9945d:"Wear clothes that you usually wear on a daily basis.",s8fb9f388e75ffe11:"Framing",s625ff027ee7b497b:"Make sure your entire body is visible. The app will guide you.",s1dd794b3870bcae0:"To start",saa7ace350b982c68:"Please turn sideways!"}},Symbol.toStringTag,{value:"Module"}));a.getLocale=Yt,a.setLocale=XA,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
1235
+ `,y([j({type:String,attribute:"api-key"})],a.BodyMeasurer.prototype,"apiKey",2),y([j({type:String,attribute:"tenant-id"})],a.BodyMeasurer.prototype,"tenantId",2),y([j({type:String,attribute:"product-sku"})],a.BodyMeasurer.prototype,"productSku",2),y([j({type:String,attribute:"api-url"})],a.BodyMeasurer.prototype,"apiUrl",2),y([j({type:Function,attribute:"onmeasurementaccepted"})],a.BodyMeasurer.prototype,"onMeasurementAccepted",2),y([j({type:Function,attribute:"onmeasurementcanceled"})],a.BodyMeasurer.prototype,"onMeasurementCanceled",2),y([j({type:String})],a.BodyMeasurer.prototype,"culture",1),y([k()],a.BodyMeasurer.prototype,"errorMap",1),y([k()],a.BodyMeasurer.prototype,"measurerKey",2),y([k()],a.BodyMeasurer.prototype,"_isLocaleLoading",2),y([k()],a.BodyMeasurer.prototype,"showModal",2),y([k()],a.BodyMeasurer.prototype,"step",2),y([k()],a.BodyMeasurer.prototype,"height",2),y([k()],a.BodyMeasurer.prototype,"recommendedSize",2),y([k()],a.BodyMeasurer.prototype,"measurements",2),y([k()],a.BodyMeasurer.prototype,"errorMessage",2),y([k()],a.BodyMeasurer.prototype,"instructionMessage",2),y([k()],a.BodyMeasurer.prototype,"shouldStartMeasurement",2),y([k()],a.BodyMeasurer.prototype,"isLoading",2),y([k()],a.BodyMeasurer.prototype,"isFetching",2),y([k()],a.BodyMeasurer.prototype,"cameras",2),y([k()],a.BodyMeasurer.prototype,"currentCameraId",2),a.BodyMeasurer=y([R("body-measurer"),w()],a.BodyMeasurer);const Ct=Object.freeze(Object.defineProperty({__proto__:null,templates:{ERR_ARM_NOT_STRETCHED:"Estique seus braços completamente",ERR_ARMS_NOT_RAISED:"Levante ambos os braços em um ângulo de 45 graus",ERR_BODY_LANDMARKS_NOT_DETECTED:"Certifique-se de que seu corpo inteiro esteja visível na câmera",ERR_BODY_TOO_CLOSE_TO_EDGE:"Afaste seu corpo da borda do quadro",ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_LEFT:"Mova-se para a esquerda para centralizar seu corpo",ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_RIGHT:"Mova-se para a direita para centralizar seu corpo",ERR_FEET_TOO_CLOSE_TO_EDGE:"Afaste seus pés da borda do quadro",ERR_HEAD_POINT_NOT_DETECTED:"Certifique-se de que sua cabeça esteja totalmente visível no quadro",ERR_HEAD_TOO_CLOSE_TO_EDGE:"Afaste sua cabeça da borda do quadro",ERR_HEIGHT_INVALID:"A altura deve ser entre 50 e 300cm",ERR_HEIGHT_MEASUREMENT_FAILED:"Fique ereto e certifique-se de que seu corpo inteiro esteja visível",ERR_HEM_MEASUREMENT_FAILED:"Certifique-se de que a bainha da sua roupa esteja visível e clara",ERR_HIPS_MEASUREMENT_FAILED:"Fique ereto e certifique-se de que seus quadris estejam visíveis",ERR_HIPS_NOT_VISIBLE:"Ajuste sua posição para mostrar seus quadris",ERR_IMAGE_LOAD_FAILED:"Tente novamente mais tarde; a imagem não pôde ser processada",ERR_INCORRECT_POSTURE:"Fique ereto com os ombros para trás",ERR_INVALID_BODY_HEIGHT_TYPE:"Certifique-se de que seu corpo inteiro esteja visível para a medição de altura",ERR_INVALID_CLOTHING_TYPE:"Este tipo de roupa não é suportado; entre em contato com o suporte",ERR_INVALID_MEASURE_SIDE_VIEW:"Gire para mostrar um perfil lateral claro",ERR_LEFT_ARM_NOT_RAISED:"Levante seu braço esquerdo em um ângulo de 45 graus",ERR_LEFT_ARM_TOO_HIGH:"Abaixe seu braço esquerdo",ERR_LEGS_NOT_DETECTED:"Certifique-se de que suas pernas estejam totalmente visíveis no quadro",ERR_LOWER_BODY_NOT_VISIBLE:"Ajuste sua posição para mostrar a parte inferior do corpo",ERR_NOT_SIDE_VIEW:"Gire para mostrar seu perfil lateral",ERR_RIGHT_ARM_NOT_RAISED:"Levante seu braço direito em um ângulo de 45 graus",ERR_RIGHT_ARM_TOO_HIGH:"Abaixe seu braço direito",ERR_SHOULDER_MEASUREMENT_FAILED:"Mantenha seus ombros relaxados e visíveis",ERR_SHOULDERS_NOT_VISIBLE:"Ajuste sua posição para mostrar seus ombros",ERR_TOO_CLOSE_TO_CAMERA:"Dê um passo para trás da câmera",ERR_UPPER_BODY_NOT_VISIBLE:"Ajuste sua posição para mostrar a parte superior do corpo",ERR_WAIST_MEASUREMENT_FAILED:"Fique ereto e certifique-se de que sua cintura esteja visível",s2d726e20085011c1:"Altura (cm)",s2f77566c78235d88:"Erro acessando a câmera",s34c58d3d12e5f890:"Erro ao mudar a câmera",s3d324b180f982d46:"Tenha certeza de que seu corpo está totalmente visível",s3e742a73512eb1da:"Para começarmos, informe sua altura",s5c91b5e06c363734:"",s7c5b35754de07309:"Vamos lá!",s952ed559991cf0b4:"Desenvolvido por",sd13d4c82d57859fc:"Posicione-se em frente a câmera",sdabfef8968aeb5fa:"Um erro inesperado aconteceu",sf315699feee25406:"Descubra o tamanho ideal para você",s844998113d40f002:"Forget the tape.. Find the ideal size with your device",sb5977e9b7929155d:"As fast as facial recognition. And don't worry, we don't store or share your image.",s420e8053328b31c4:"Your ideal size",sf84b5644f7595ce5:"Based on your measurements and the exact dimensions of the garment, the size recommendation provided is the most accurate for an ideal fit.",sdf9f9c621b6316e7:"Measure Again",s6ad3b28b46803c43:"Accept Suggestion",se940dab2e0b7a710:"Before you begin",scf8d43c4a5cb71fa:"To ensure accurate measurements, we'll take two scans: one from the front and one from the side. Maintain an upright posture with your arms slightly away from your body and stretched out. In the side view, stand up straight with your arms straight and aligned with your body.",s48d094fb2ffff8fb:"Tips",s08b0bc2feb4e0f1c:"Good Lighting",s322c72546e939809:"Choose a well-lit area where you can see your image clearly.",sa4ad2b9cd4ea10ba:"Clean Background",s396efd2b23a16ac9:"Position yourself against a plain background.",s81d43b9b25d0775b:"Clothes",s88a3f5e6a9d9945d:"Wear clothes that you usually wear on a daily basis.",s8fb9f388e75ffe11:"Framing",s625ff027ee7b497b:"Make sure your entire body is visible. The app will guide you.",s1dd794b3870bcae0:"To start",s676cfe9f36657792:"Measurement successful!"}},Symbol.toStringTag,{value:"Module"}));a.getLocale=Yt,a.setLocale=XA,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
@@ -37,11 +37,11 @@ export declare const templates: {
37
37
  s3e742a73512eb1da: string;
38
38
  s5c91b5e06c363734: string;
39
39
  s7c5b35754de07309: string;
40
- s8e3fcbc208dcce56: string;
41
40
  s952ed559991cf0b4: string;
42
41
  sd13d4c82d57859fc: string;
43
42
  sdabfef8968aeb5fa: string;
44
43
  sf315699feee25406: string;
44
+ s844998113d40f002: string;
45
45
  sb5977e9b7929155d: string;
46
46
  s420e8053328b31c4: string;
47
47
  sf84b5644f7595ce5: string;
@@ -59,5 +59,5 @@ export declare const templates: {
59
59
  s8fb9f388e75ffe11: string;
60
60
  s625ff027ee7b497b: string;
61
61
  s1dd794b3870bcae0: string;
62
- saa7ace350b982c68: string;
62
+ s676cfe9f36657792: string;
63
63
  };
@@ -37,11 +37,11 @@ const e = {
37
37
  s3e742a73512eb1da: "Para começarmos, informe sua altura",
38
38
  s5c91b5e06c363734: "",
39
39
  s7c5b35754de07309: "Vamos lá!",
40
- s8e3fcbc208dcce56: "Esqueça a fita. Descubra o tamanho ideal com o seu dispositivo",
41
40
  s952ed559991cf0b4: "Desenvolvido por",
42
41
  sd13d4c82d57859fc: "Posicione-se em frente a câmera",
43
42
  sdabfef8968aeb5fa: "Um erro inesperado aconteceu",
44
43
  sf315699feee25406: "Descubra o tamanho ideal para você",
44
+ s844998113d40f002: "Forget the tape.. Find the ideal size with your device",
45
45
  sb5977e9b7929155d: "As fast as facial recognition. And don't worry, we don't store or share your image.",
46
46
  s420e8053328b31c4: "Your ideal size",
47
47
  sf84b5644f7595ce5: "Based on your measurements and the exact dimensions of the garment, the size recommendation provided is the most accurate for an ideal fit.",
@@ -59,7 +59,7 @@ const e = {
59
59
  s8fb9f388e75ffe11: "Framing",
60
60
  s625ff027ee7b497b: "Make sure your entire body is visible. The app will guide you.",
61
61
  s1dd794b3870bcae0: "To start",
62
- saa7ace350b982c68: "Please turn sideways!"
62
+ s676cfe9f36657792: "Measurement successful!"
63
63
  };
64
64
  export {
65
65
  e as templates
package/package.json CHANGED
@@ -1,53 +1,53 @@
1
- {
2
- "name": "xactsize-webcomponents",
3
- "version": "1.0.14",
4
- "description": "A web component for body measurements and size recommendations",
5
- "main": "dist/body-measurer.umd.js",
6
- "module": "dist/body-measurer.es.js",
7
- "types": "dist/body-measurer.d.ts",
8
- "exports": {
9
- ".": {
10
- "types": "./dist/body-measurer.d.ts",
11
- "import": "./dist/body-measurer.es.js",
12
- "require": "./dist/body-measurer.umd.js"
13
- }
14
- },
15
- "files": [
16
- "dist/",
17
- "LICENSE.md",
18
- "README.md"
19
- ],
20
- "scripts": {
21
- "start": "vite",
22
- "build": "run-s build:locales build:vite",
23
- "build:vite": "vite build",
24
- "build:locales": "lit-localize extract && lit-localize build",
25
- "preview": "vite preview",
26
- "prepublishOnly": "npm run build",
27
- "link": "npm link",
28
- "dev": "run-p start watch:locales",
29
- "watch:locales": "lit-localize extract --watch",
30
- "test-local": "npm run build && npm pack",
31
- "link-local": "npm run build && npm link"
32
- },
33
- "dependencies": {
34
- "@lit/localize": "^0.12.2",
35
- "lit": "^3.3.0"
36
- },
37
- "devDependencies": {
38
- "@lit/localize-tools": "^0.8.0",
39
- "@types/node": "^22.15.17",
40
- "npm-run-all": "^4.1.5",
41
- "typescript": "^5.8.3",
42
- "vite": "^6.3.5",
43
- "vite-plugin-dts": "^4.5.3"
44
- },
45
- "keywords": [
46
- "web-component",
47
- "lit",
48
- "body-measurement",
49
- "ecommerce"
50
- ],
51
- "author": "Your Name",
52
- "license": "SEE LICENSE IN LICENSE.md"
53
- }
1
+ {
2
+ "name": "xactsize-webcomponents",
3
+ "version": "1.0.16",
4
+ "description": "A web component for body measurements and size recommendations",
5
+ "main": "dist/body-measurer.umd.js",
6
+ "module": "dist/body-measurer.es.js",
7
+ "types": "dist/body-measurer.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/body-measurer.d.ts",
11
+ "import": "./dist/body-measurer.es.js",
12
+ "require": "./dist/body-measurer.umd.js"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist/",
17
+ "LICENSE.md",
18
+ "README.md"
19
+ ],
20
+ "scripts": {
21
+ "start": "vite",
22
+ "build": "run-s build:locales build:vite",
23
+ "build:vite": "vite build",
24
+ "build:locales": "lit-localize extract && lit-localize build",
25
+ "preview": "vite preview",
26
+ "prepublishOnly": "npm run build",
27
+ "link": "npm link",
28
+ "dev": "run-p start watch:locales",
29
+ "watch:locales": "lit-localize extract --watch",
30
+ "test-local": "npm run build && npm pack",
31
+ "link-local": "npm run build && npm link"
32
+ },
33
+ "dependencies": {
34
+ "@lit/localize": "^0.12.2",
35
+ "lit": "^3.3.0"
36
+ },
37
+ "devDependencies": {
38
+ "@lit/localize-tools": "^0.8.0",
39
+ "@types/node": "^22.15.17",
40
+ "npm-run-all": "^4.1.5",
41
+ "typescript": "^5.8.3",
42
+ "vite": "^6.3.5",
43
+ "vite-plugin-dts": "^4.5.3"
44
+ },
45
+ "keywords": [
46
+ "web-component",
47
+ "lit",
48
+ "body-measurement",
49
+ "ecommerce"
50
+ ],
51
+ "author": "Your Name",
52
+ "license": "SEE LICENSE IN LICENSE.md"
53
+ }