xactsize-webcomponents 1.0.43 → 1.0.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +72 -0
- package/dist/{body-measurer-CNtHLFqj.mjs → body-measurer-C5jINwJt.mjs} +392 -364
- package/dist/body-measurer.es.js +1 -1
- package/dist/body-measurer.umd.js +45 -45
- package/dist/es-MX-Bc0zxUr_.mjs +79 -0
- package/dist/generated/locale-codes.d.ts +2 -2
- package/dist/generated/locales/es-MX.d.ts +75 -0
- package/dist/generated/locales/pt-BR.d.ts +18 -14
- package/dist/{pt-BR-KsDVLJ-W.mjs → pt-BR-m4YL1hub.mjs} +20 -16
- package/dist/services/ai-session-manager.d.ts +3 -1
- package/dist/services/audio-manager.d.ts +4 -0
- package/package.json +1 -1
package/dist/body-measurer.es.js
CHANGED
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
(function(c,V){typeof exports=="object"&&typeof module<"u"?V(exports):typeof define=="function"&&define.amd?define(["exports"],V):(c=typeof globalThis<"u"?globalThis:c||self,V(c.BodyMeasurer={}))})(this,function(c){"use strict";var
|
|
1
|
+
(function(c,V){typeof exports=="object"&&typeof module<"u"?V(exports):typeof define=="function"&&define.amd?define(["exports"],V):(c=typeof globalThis<"u"?globalThis:c||self,V(c.BodyMeasurer={}))})(this,function(c){"use strict";var Ke;const V=(a,e,t)=>{const i=a[e];return i?typeof i=="function"?i():Promise.resolve(i):new Promise((s,o)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(o.bind(null,new Error("Unknown variable dynamic import: "+e+(e.split("/").length!==t?". Note that variables only represent file names one level deep.":""))))})};/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/const
|
|
5
|
+
*/const Q=globalThis,ne=Q.ShadowRoot&&(Q.ShadyCSS===void 0||Q.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,le=Symbol(),Re=new WeakMap;let Ae=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==le)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(ne&&e===void 0){const i=t!==void 0&&t.length===1;i&&(e=Re.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&Re.set(t,e))}return e}toString(){return this.cssText}};const Qe=a=>new Ae(typeof a=="string"?a:a+"",void 0,le),k=(a,...e)=>{const t=a.length===1?a[0]:e.reduce((i,s,o)=>i+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+a[o+1],a[0]);return new Ae(t,a,le)},Xe=(a,e)=>{if(ne)a.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const i=document.createElement("style"),s=Q.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=t.cssText,a.appendChild(i)}},Me=ne?a=>a:a=>a instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return Qe(t)})(a):a;/**
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright 2017 Google LLC
|
|
8
8
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
-
*/const{is:
|
|
9
|
+
*/const{is:Je,defineProperty:et,getOwnPropertyDescriptor:tt,getOwnPropertyNames:it,getOwnPropertySymbols:st,getPrototypeOf:at}=Object,w=globalThis,Se=w.trustedTypes,ot=Se?Se.emptyScript:"",de=w.reactiveElementPolyfillSupport,B=(a,e)=>a,X={toAttribute(a,e){switch(e){case Boolean:a=a?ot:null;break;case Object:case Array:a=a==null?a:JSON.stringify(a)}return a},fromAttribute(a,e){let t=a;switch(e){case Boolean:t=a!==null;break;case Number:t=a===null?null:Number(a);break;case Object:case Array:try{t=JSON.parse(a)}catch{t=null}}return t}},ce=(a,e)=>!Je(a,e),Le={attribute:!0,type:String,converter:X,reflect:!1,useDefault:!1,hasChanged:ce};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),w.litPropertyMetadata??(w.litPropertyMetadata=new WeakMap);let D=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Le){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(e,i,t);s!==void 0&&et(this.prototype,e,s)}}static getPropertyDescriptor(e,t,i){const{get:s,set:o}=tt(this.prototype,e)??{get(){return this[t]},set(r){this[t]=r}};return{get:s,set(r){const d=s==null?void 0:s.call(this);o==null||o.call(this,r),this.requestUpdate(e,d,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Le}static _$Ei(){if(this.hasOwnProperty(B("elementProperties")))return;const e=at(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(B("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(B("properties"))){const t=this.properties,i=[...it(t),...st(t)];for(const s of i)this.createProperty(s,t[s])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[i,s]of t)this.elementProperties.set(i,s)}this._$Eh=new Map;for(const[t,i]of this.elementProperties){const s=this._$Eu(t,i);s!==void 0&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const s of i)t.unshift(Me(s))}else e!==void 0&&t.push(Me(e));return t}static _$Eu(e,t){const i=t.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Xe(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var i;return(i=t.hostConnected)==null?void 0:i.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var i;return(i=t.hostDisconnected)==null?void 0:i.call(t)})}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$ET(e,t){var o;const i=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,i);if(s!==void 0&&i.reflect===!0){const r=(((o=i.converter)==null?void 0:o.toAttribute)!==void 0?i.converter:X).toAttribute(t,i.type);this._$Em=e,r==null?this.removeAttribute(s):this.setAttribute(s,r),this._$Em=null}}_$AK(e,t){var o,r;const i=this.constructor,s=i._$Eh.get(e);if(s!==void 0&&this._$Em!==s){const d=i.getPropertyOptions(s),l=typeof d.converter=="function"?{fromAttribute:d.converter}:((o=d.converter)==null?void 0:o.fromAttribute)!==void 0?d.converter:X;this._$Em=s,this[s]=l.fromAttribute(t,d.type)??((r=this._$Ej)==null?void 0:r.get(s))??null,this._$Em=null}}requestUpdate(e,t,i){var s;if(e!==void 0){const o=this.constructor,r=this[e];if(i??(i=o.getPropertyOptions(e)),!((i.hasChanged??ce)(r,t)||i.useDefault&&i.reflect&&r===((s=this._$Ej)==null?void 0:s.get(e))&&!this.hasAttribute(o._$Eu(e,i))))return;this.C(e,t,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:i,reflect:s,wrapped:o},r){i&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,r??t??this[e]),o!==!0||r!==void 0)||(this._$AL.has(e)||(this.hasUpdated||i||(t=void 0),this._$AL.set(e,t)),s===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[o,r]of this._$Ep)this[o]=r;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[o,r]of s){const{wrapped:d}=r,l=this[o];d!==!0||this._$AL.has(o)||l===void 0||this.C(o,void 0,r,l)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(i=this._$EO)==null||i.forEach(s=>{var o;return(o=s.hostUpdate)==null?void 0:o.call(s)}),this.update(t)):this._$EM()}catch(s){throw e=!1,this._$EM(),s}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(i=>{var s;return(s=i.hostUpdated)==null?void 0:s.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(e){}firstUpdated(e){}};D.elementStyles=[],D.shadowRootOptions={mode:"open"},D[B("elementProperties")]=new Map,D[B("finalized")]=new Map,de==null||de({ReactiveElement:D}),(w.reactiveElementVersions??(w.reactiveElementVersions=[])).push("2.1.0");/**
|
|
10
10
|
* @license
|
|
11
11
|
* Copyright 2017 Google LLC
|
|
12
12
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
-
*/const
|
|
14
|
-
\f\r]`,
|
|
15
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
|
13
|
+
*/const F=globalThis,J=F.trustedTypes,Te=J?J.createPolicy("lit-html",{createHTML:a=>a}):void 0,$e="$lit$",R=`lit$${Math.random().toFixed(9).slice(2)}$`,Oe="?"+R,rt=`<${Oe}>`,M=document,z=()=>M.createComment(""),j=a=>a===null||typeof a!="object"&&typeof a!="function",he=Array.isArray,nt=a=>he(a)||typeof(a==null?void 0:a[Symbol.iterator])=="function",pe=`[
|
|
14
|
+
\f\r]`,G=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ie=/-->/g,ke=/>/g,S=RegExp(`>|${pe}(?:([^\\s"'>=/]+)(${pe}*=${pe}*(?:[^
|
|
15
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),De=/'/g,He=/"/g,Pe=/^(?:script|style|textarea|title)$/i,lt=a=>(e,...t)=>({_$litType$:a,strings:e,values:t}),g=lt(1),L=Symbol.for("lit-noChange"),_=Symbol.for("lit-nothing"),Ue=new WeakMap,T=M.createTreeWalker(M,129);function Ne(a,e){if(!he(a)||!a.hasOwnProperty("raw"))throw Error("invalid template strings array");return Te!==void 0?Te.createHTML(e):e}const dt=(a,e)=>{const t=a.length-1,i=[];let s,o=e===2?"<svg>":e===3?"<math>":"",r=G;for(let d=0;d<t;d++){const l=a[d];let f,m,h=-1,b=0;for(;b<l.length&&(r.lastIndex=b,m=r.exec(l),m!==null);)b=r.lastIndex,r===G?m[1]==="!--"?r=Ie:m[1]!==void 0?r=ke:m[2]!==void 0?(Pe.test(m[2])&&(s=RegExp("</"+m[2],"g")),r=S):m[3]!==void 0&&(r=S):r===S?m[0]===">"?(r=s??G,h=-1):m[1]===void 0?h=-2:(h=r.lastIndex-m[2].length,f=m[1],r=m[3]===void 0?S:m[3]==='"'?He:De):r===He||r===De?r=S:r===Ie||r===ke?r=G:(r=S,s=void 0);const A=r===S&&a[d+1].startsWith("/>")?" ":"";o+=r===G?l+rt:h>=0?(i.push(f),l.slice(0,h)+$e+l.slice(h)+R+A):l+R+(h===-2?d:A)}return[Ne(a,o+(a[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]};class Z{constructor({strings:e,_$litType$:t},i){let s;this.parts=[];let o=0,r=0;const d=e.length-1,l=this.parts,[f,m]=dt(e,t);if(this.el=Z.createElement(f,i),T.currentNode=this.el.content,t===2||t===3){const h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(s=T.nextNode())!==null&&l.length<d;){if(s.nodeType===1){if(s.hasAttributes())for(const h of s.getAttributeNames())if(h.endsWith($e)){const b=m[r++],A=s.getAttribute(h).split(R),re=/([.?@])?(.*)/.exec(b);l.push({type:1,index:o,name:re[2],strings:A,ctor:re[1]==="."?ht:re[1]==="?"?pt:re[1]==="@"?ut:ee}),s.removeAttribute(h)}else h.startsWith(R)&&(l.push({type:6,index:o}),s.removeAttribute(h));if(Pe.test(s.tagName)){const h=s.textContent.split(R),b=h.length-1;if(b>0){s.textContent=J?J.emptyScript:"";for(let A=0;A<b;A++)s.append(h[A],z()),T.nextNode(),l.push({type:2,index:++o});s.append(h[b],z())}}}else if(s.nodeType===8)if(s.data===Oe)l.push({type:2,index:o});else{let h=-1;for(;(h=s.data.indexOf(R,h+1))!==-1;)l.push({type:7,index:o}),h+=R.length-1}o++}}static createElement(e,t){const i=M.createElement("template");return i.innerHTML=e,i}}function H(a,e,t=a,i){var r,d;if(e===L)return e;let s=i!==void 0?(r=t._$Co)==null?void 0:r[i]:t._$Cl;const o=j(e)?void 0:e._$litDirective$;return(s==null?void 0:s.constructor)!==o&&((d=s==null?void 0:s._$AO)==null||d.call(s,!1),o===void 0?s=void 0:(s=new o(a),s._$AT(a,t,i)),i!==void 0?(t._$Co??(t._$Co=[]))[i]=s:t._$Cl=s),s!==void 0&&(e=H(a,s._$AS(a,e.values),s,i)),e}class ct{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:i}=this._$AD,s=((e==null?void 0:e.creationScope)??M).importNode(t,!0);T.currentNode=s;let o=T.nextNode(),r=0,d=0,l=i[0];for(;l!==void 0;){if(r===l.index){let f;l.type===2?f=new q(o,o.nextSibling,this,e):l.type===1?f=new l.ctor(o,l.name,l.strings,this,e):l.type===6&&(f=new ft(o,this,e)),this._$AV.push(f),l=i[++d]}r!==(l==null?void 0:l.index)&&(o=T.nextNode(),r++)}return T.currentNode=M,s}p(e){let t=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}}class q{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,i,s){this.type=2,this._$AH=_,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=s,this._$Cv=(s==null?void 0:s.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=H(this,e,t),j(e)?e===_||e==null||e===""?(this._$AH!==_&&this._$AR(),this._$AH=_):e!==this._$AH&&e!==L&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):nt(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==_&&j(this._$AH)?this._$AA.nextSibling.data=e:this.T(M.createTextNode(e)),this._$AH=e}$(e){var o;const{values:t,_$litType$:i}=e,s=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=Z.createElement(Ne(i.h,i.h[0]),this.options)),i);if(((o=this._$AH)==null?void 0:o._$AD)===s)this._$AH.p(t);else{const r=new ct(s,this),d=r.u(this.options);r.p(t),this.T(d),this._$AH=r}}_$AC(e){let t=Ue.get(e.strings);return t===void 0&&Ue.set(e.strings,t=new Z(e)),t}k(e){he(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,s=0;for(const o of e)s===t.length?t.push(i=new q(this.O(z()),this.O(z()),this,this.options)):i=t[s],i._$AI(o),s++;s<t.length&&(this._$AR(i&&i._$AB.nextSibling,s),t.length=s)}_$AR(e=this._$AA.nextSibling,t){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,t);e&&e!==this._$AB;){const s=e.nextSibling;e.remove(),e=s}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}}class ee{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,s,o){this.type=1,this._$AH=_,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=o,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=_}_$AI(e,t=this,i,s){const o=this.strings;let r=!1;if(o===void 0)e=H(this,e,t,0),r=!j(e)||e!==this._$AH&&e!==L,r&&(this._$AH=e);else{const d=e;let l,f;for(e=o[0],l=0;l<o.length-1;l++)f=H(this,d[i+l],t,l),f===L&&(f=this._$AH[l]),r||(r=!j(f)||f!==this._$AH[l]),f===_?e=_:e!==_&&(e+=(f??"")+o[l+1]),this._$AH[l]=f}r&&!s&&this.j(e)}j(e){e===_?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class ht extends ee{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===_?void 0:e}}class pt extends ee{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==_)}}class ut extends ee{constructor(e,t,i,s,o){super(e,t,i,s,o),this.type=5}_$AI(e,t=this){if((e=H(this,e,t,0)??_)===L)return;const i=this._$AH,s=e===_&&i!==_||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,o=e!==_&&(i===_||s);s&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}}class ft{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){H(this,e)}}const ue=F.litHtmlPolyfillSupport;ue==null||ue(Z,q),(F.litHtmlVersions??(F.litHtmlVersions=[])).push("3.3.0");const mt=(a,e,t)=>{const i=(t==null?void 0:t.renderBefore)??e;let s=i._$litPart$;if(s===void 0){const o=(t==null?void 0:t.renderBefore)??null;i._$litPart$=s=new q(e.insertBefore(z(),o),o,void 0,t??{})}return s._$AI(a),s};/**
|
|
16
16
|
* @license
|
|
17
17
|
* Copyright 2017 Google LLC
|
|
18
18
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
19
|
-
*/const
|
|
19
|
+
*/const $=globalThis;let C=class extends D{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=mt(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return L}};C._$litElement$=!0,C.finalized=!0,(Ke=$.litElementHydrateSupport)==null||Ke.call($,{LitElement:C});const fe=$.litElementPolyfillSupport;fe==null||fe({LitElement:C}),($.litElementVersions??($.litElementVersions=[])).push("4.2.0");/**
|
|
20
20
|
* @license
|
|
21
21
|
* Copyright 2017 Google LLC
|
|
22
22
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
23
|
-
*/const P=
|
|
23
|
+
*/const P=a=>(e,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(a,e)}):customElements.define(a,e)};/**
|
|
24
24
|
* @license
|
|
25
25
|
* Copyright 2017 Google LLC
|
|
26
26
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
|
-
*/const
|
|
27
|
+
*/const gt={attribute:!0,type:String,converter:X,reflect:!1,hasChanged:ce},_t=(a=gt,e,t)=>{const{kind:i,metadata:s}=t;let o=globalThis.litPropertyMetadata.get(s);if(o===void 0&&globalThis.litPropertyMetadata.set(s,o=new Map),i==="setter"&&((a=Object.create(a)).wrapped=!0),o.set(t.name,a),i==="accessor"){const{name:r}=t;return{set(d){const l=e.get.call(this);e.set.call(this,d),this.requestUpdate(r,l,a)},init(d){return d!==void 0&&this.C(r,void 0,a,d),d}}}if(i==="setter"){const{name:r}=t;return function(d){const l=this[r];e.call(this,d),this.requestUpdate(r,l,a)}}throw Error("Unsupported decorator location: "+i)};function p(a){return(e,t)=>typeof t=="object"?_t(a,e,t):((i,s,o)=>{const r=s.hasOwnProperty(o);return s.constructor.createProperty(o,i),r?Object.getOwnPropertyDescriptor(s,o):void 0})(a,e,t)}/**
|
|
28
28
|
* @license
|
|
29
29
|
* Copyright 2017 Google LLC
|
|
30
30
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
31
|
-
*/function
|
|
31
|
+
*/function E(a){return p({...a,state:!0,attribute:!1})}/**
|
|
32
32
|
* @license
|
|
33
33
|
* Copyright 2021 Google LLC
|
|
34
34
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
35
|
-
*/const
|
|
35
|
+
*/const me="lit-localize-status";/**
|
|
36
36
|
* @license
|
|
37
37
|
* Copyright 2021 Google LLC
|
|
38
38
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
39
|
-
*/const
|
|
39
|
+
*/const ge=(a,...e)=>({strTag:!0,strings:a,values:e}),Et=a=>typeof a!="string"&&"strTag"in a,Ve=(a,e,t)=>{let i=a[0];for(let s=1;s<a.length;s++)i+=e[t?t[s-1]:s-1],i+=a[s];return i};/**
|
|
40
40
|
* @license
|
|
41
41
|
* Copyright 2021 Google LLC
|
|
42
42
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
43
|
-
*/const
|
|
43
|
+
*/const Be=a=>Et(a)?Ve(a.strings,a.values):a;let n=Be,Fe=!1;function yt(a){if(Fe)throw new Error("lit-localize can only be configured once");n=a,Fe=!0}/**
|
|
44
44
|
* @license
|
|
45
45
|
* Copyright 2021 Google LLC
|
|
46
46
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
47
|
-
*/class
|
|
47
|
+
*/class bt{constructor(e){this.__litLocalizeEventHandler=t=>{t.detail.status==="ready"&&this.host.requestUpdate()},this.host=e}hostConnected(){window.addEventListener(me,this.__litLocalizeEventHandler)}hostDisconnected(){window.removeEventListener(me,this.__litLocalizeEventHandler)}}const Ct=a=>a.addController(new bt(a));/**
|
|
48
48
|
* @license
|
|
49
49
|
* Copyright 2021 Google LLC
|
|
50
50
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
51
|
-
*/const
|
|
51
|
+
*/const Y=()=>(a,e)=>(a.addInitializer(Ct),a);/**
|
|
52
52
|
* @license
|
|
53
53
|
* Copyright 2020 Google LLC
|
|
54
54
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
55
|
-
*/class
|
|
55
|
+
*/class ze{constructor(){this.settled=!1,this.promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}resolve(e){this.settled=!0,this._resolve(e)}reject(e){this.settled=!0,this._reject(e)}}/**
|
|
56
56
|
* @license
|
|
57
57
|
* Copyright 2014 Travis Webb
|
|
58
58
|
* SPDX-License-Identifier: MIT
|
|
59
|
-
*/const x=[];for(let
|
|
59
|
+
*/const x=[];for(let a=0;a<256;a++)x[a]=(a>>4&15).toString(16)+(a&15).toString(16);function vt(a){let e=0,t=8997,i=0,s=33826,o=0,r=40164,d=0,l=52210;for(let f=0;f<a.length;f++)t^=a.charCodeAt(f),e=t*435,i=s*435,o=r*435,d=l*435,o+=t<<8,d+=s<<8,i+=e>>>16,t=e&65535,o+=i>>>16,s=i&65535,l=d+(o>>>16)&65535,r=o&65535;return x[l>>8]+x[l&255]+x[r>>8]+x[r&255]+x[s>>8]+x[s&255]+x[t>>8]+x[t&255]}/**
|
|
60
60
|
* @license
|
|
61
61
|
* Copyright 2020 Google LLC
|
|
62
62
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
63
|
-
*/const
|
|
63
|
+
*/const xt="",wt="h",Rt="s";function At(a,e){return(e?wt:Rt)+vt(typeof a=="string"?a:a.join(xt))}/**
|
|
64
64
|
* @license
|
|
65
65
|
* Copyright 2021 Google LLC
|
|
66
66
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
67
|
-
*/const
|
|
67
|
+
*/const je=new WeakMap,Ge=new Map;function Mt(a,e,t){if(a){const i=(t==null?void 0:t.id)??St(e),s=a[i];if(s){if(typeof s=="string")return s;if("strTag"in s)return Ve(s.strings,e.values,s.values);{let o=je.get(s);return o===void 0&&(o=s.values,je.set(s,o)),{...s,values:o.map(r=>e.values[r])}}}}return Be(e)}function St(a){const e=typeof a=="string"?a:a.strings;let t=Ge.get(e);return t===void 0&&(t=At(e,typeof a!="string"&&!("strTag"in a)),Ge.set(e,t)),t}/**
|
|
68
68
|
* @license
|
|
69
69
|
* Copyright 2021 Google LLC
|
|
70
70
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
71
|
-
*/function
|
|
71
|
+
*/function _e(a){window.dispatchEvent(new CustomEvent(me,{detail:a}))}let te="",Ee,Ze,ie,ye,qe,O=new ze;O.resolve();let se=0;const Lt=a=>(yt((e,t)=>Mt(qe,e,t)),te=Ze=a.sourceLocale,ie=new Set(a.targetLocales),ie.add(a.sourceLocale),ye=a.loadLocale,{getLocale:Tt,setLocale:$t}),Tt=()=>te,$t=a=>{if(a===(Ee??te))return O.promise;if(!ie||!ye)throw new Error("Internal error");if(!ie.has(a))throw new Error("Invalid locale code");se++;const e=se;return Ee=a,O.settled&&(O=new ze),_e({status:"loading",loadingLocale:a}),(a===Ze?Promise.resolve({templates:void 0}):ye(a)).then(i=>{se===e&&(te=a,Ee=void 0,qe=i.templates,_e({status:"ready",readyLocale:a}),O.resolve())},i=>{se===e&&(_e({status:"error",errorLocale:a,errorMessage:i.toString()}),O.reject(i))}),O.promise},Ye="en",Ot=["es-MX","pt-BR"];/**
|
|
72
72
|
* @license
|
|
73
73
|
* Copyright 2017 Google LLC
|
|
74
74
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
75
|
-
*/const
|
|
75
|
+
*/const It={ATTRIBUTE:1},kt=a=>(...e)=>({_$litDirective$:a,values:e});class Dt{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}/**
|
|
76
76
|
* @license
|
|
77
77
|
* Copyright 2018 Google LLC
|
|
78
78
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
79
|
-
*/const
|
|
79
|
+
*/const Ht=kt(class extends Dt{constructor(a){var e;if(super(a),a.type!==It.ATTRIBUTE||a.name!=="class"||((e=a.strings)==null?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(a){return" "+Object.keys(a).filter(e=>a[e]).join(" ")+" "}update(a,[e]){var i,s;if(this.st===void 0){this.st=new Set,a.strings!==void 0&&(this.nt=new Set(a.strings.join(" ").split(/\s/).filter(o=>o!=="")));for(const o in e)e[o]&&!((i=this.nt)!=null&&i.has(o))&&this.st.add(o);return this.render(e)}const t=a.element.classList;for(const o of this.st)o in e||(t.remove(o),this.st.delete(o));for(const o in e){const r=!!e[o];r===this.st.has(o)||(s=this.nt)!=null&&s.has(o)||(r?(t.add(o),this.st.add(o)):(t.remove(o),this.st.delete(o)))}return L}});var Pt=Object.defineProperty,Ut=Object.getOwnPropertyDescriptor,W=(a,e,t,i)=>{for(var s=i>1?void 0:i?Ut(e,t):e,o=a.length-1,r;o>=0;o--)(r=a[o])&&(s=(i?r(e,t,s):r(s))||s);return i&&s&&Pt(e,t,s),s};let I=class extends C{constructor(){super(...arguments),this.type="button",this.label="",this.disabled=!1,this.variant="contained"}render(){return g`
|
|
80
80
|
<div class="button-wrapper">
|
|
81
81
|
<button
|
|
82
82
|
class=${this.variant}
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
${this.label}
|
|
88
88
|
</button>
|
|
89
89
|
</div>
|
|
90
|
-
`}};
|
|
90
|
+
`}};I.styles=k`
|
|
91
91
|
:host {
|
|
92
92
|
display: block;
|
|
93
93
|
width: 100%;
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
-
`,W([p({type:String})],
|
|
170
|
+
`,W([p({type:String})],I.prototype,"type",2),W([p({type:String})],I.prototype,"label",2),W([p({type:Boolean})],I.prototype,"disabled",2),W([p({type:String})],I.prototype,"variant",2),I=W([P("xact-button")],I);var Nt=Object.defineProperty,Vt=Object.getOwnPropertyDescriptor,ae=(a,e,t,i)=>{for(var s=i>1?void 0:i?Vt(e,t):e,o=a.length-1,r;o>=0;o--)(r=a[o])&&(s=(i?r(e,t,s):r(s))||s);return i&&s&&Nt(e,t,s),s};let U=class extends C{constructor(){super(...arguments),this.height=0,this.brandName="",this.handleStart=()=>{var e;const a=this.shadowRoot.querySelector("#height-input");if(a!=null&&a.value){const t=parseInt(a.value);this.height=t,(e=this.onStartMeasurement)==null||e.call(this,t)}}}render(){return g`
|
|
171
171
|
<div class="card">
|
|
172
172
|
<div class="pill">XactSize${this.brandName?" x "+this.brandName:""}</div>
|
|
173
173
|
<h2 class="title">${n("Let's find your perfect size")}</h2>
|
|
@@ -204,10 +204,10 @@
|
|
|
204
204
|
</div>
|
|
205
205
|
|
|
206
206
|
<p class="disclaimer">
|
|
207
|
-
${n("By using Xactsize, you agree to our Terms and Privacy Policy.")}
|
|
207
|
+
${n("By using")} Xactsize, ${n("you agree to our Terms and Privacy Policy.")}
|
|
208
208
|
</p>
|
|
209
209
|
</div>
|
|
210
|
-
`}renderTip(
|
|
210
|
+
`}renderTip(a,e){return g`
|
|
211
211
|
<div class="tip">
|
|
212
212
|
<span class="check">
|
|
213
213
|
<svg viewBox="0 0 24 24" aria-hidden="true">
|
|
@@ -215,11 +215,11 @@
|
|
|
215
215
|
</svg>
|
|
216
216
|
</span>
|
|
217
217
|
<div>
|
|
218
|
-
<strong>${
|
|
218
|
+
<strong>${a}</strong>
|
|
219
219
|
<span>${e}</span>
|
|
220
220
|
</div>
|
|
221
221
|
</div>
|
|
222
|
-
`}};U.styles=
|
|
222
|
+
`}};U.styles=k`
|
|
223
223
|
:host {
|
|
224
224
|
display: block;
|
|
225
225
|
font-family: 'Inter', 'Helvetica', Arial, sans-serif;
|
|
@@ -394,7 +394,7 @@
|
|
|
394
394
|
grid-template-columns: 1fr;
|
|
395
395
|
}
|
|
396
396
|
}
|
|
397
|
-
`,
|
|
397
|
+
`,ae([p({type:Number})],U.prototype,"height",2),ae([p({type:String})],U.prototype,"brandName",2),ae([p({type:Function})],U.prototype,"onStartMeasurement",2),U=ae([P("xact-step-one"),Y()],U);var Bt=Object.getOwnPropertyDescriptor,Ft=(a,e,t,i)=>{for(var s=i>1?void 0:i?Bt(e,t):e,o=a.length-1,r;o>=0;o--)(r=a[o])&&(s=r(s)||s);return s};let be=class extends C{render(){return g`
|
|
398
398
|
<footer class="modal-footer">
|
|
399
399
|
<span>
|
|
400
400
|
<span class="powered-by">${n("Powered by")}</span>
|
|
@@ -437,7 +437,7 @@
|
|
|
437
437
|
</a>
|
|
438
438
|
</span>
|
|
439
439
|
</footer>
|
|
440
|
-
`}};
|
|
440
|
+
`}};be.styles=k`
|
|
441
441
|
.modal-footer {
|
|
442
442
|
text-align: center;
|
|
443
443
|
font-size: 12px;
|
|
@@ -473,13 +473,13 @@
|
|
|
473
473
|
outline: 2px solid var(--brand-primary);
|
|
474
474
|
outline-offset: 2px;
|
|
475
475
|
}
|
|
476
|
-
`,
|
|
476
|
+
`,be=Ft([P("xact-footer"),Y()],be);var zt=Object.defineProperty,jt=Object.getOwnPropertyDescriptor,v=(a,e,t,i)=>{for(var s=i>1?void 0:i?jt(e,t):e,o=a.length-1,r;o>=0;o--)(r=a[o])&&(s=(i?r(e,t,s):r(s))||s);return i&&s&&zt(e,t,s),s};let y=class extends C{constructor(){super(...arguments),this.productName="",this.recommendedSize="",this.productSku="",this.garmentUrl="",this.generatedImageUrl="",this.isVtonFetching=!1,this.vtonError=!1}render(){return g`
|
|
477
477
|
<div class="image-container">
|
|
478
478
|
<!-- Product image -->
|
|
479
479
|
<img
|
|
480
480
|
class="product-image"
|
|
481
481
|
src="${this.generatedImageUrl||this.garmentUrl}"
|
|
482
|
-
alt="${this.productName||"Product"}"
|
|
482
|
+
alt="${this.productName||n("Product")}"
|
|
483
483
|
/>
|
|
484
484
|
|
|
485
485
|
<!-- Badge com fundo e texto -->
|
|
@@ -584,7 +584,7 @@
|
|
|
584
584
|
<xact-button @click=${this.onAccept} label=${n("Accept Suggestion")}>
|
|
585
585
|
</xact-button>
|
|
586
586
|
</div>
|
|
587
|
-
`}};
|
|
587
|
+
`}};y.styles=k`
|
|
588
588
|
:host {
|
|
589
589
|
display: flex;
|
|
590
590
|
flex-direction: column;
|
|
@@ -666,7 +666,7 @@
|
|
|
666
666
|
background-position: 200% center;
|
|
667
667
|
}
|
|
668
668
|
}
|
|
669
|
-
`,v([p({type:String})],
|
|
669
|
+
`,v([p({type:String})],y.prototype,"productName",2),v([p({type:String})],y.prototype,"recommendedSize",2),v([p({type:String})],y.prototype,"productSku",2),v([p({type:String})],y.prototype,"garmentUrl",2),v([p({type:String})],y.prototype,"generatedImageUrl",2),v([p({type:Boolean})],y.prototype,"isVtonFetching",2),v([p({type:Boolean})],y.prototype,"vtonError",2),v([p({type:Function})],y.prototype,"onAccept",2),v([p({type:Function})],y.prototype,"onRetry",2),y=v([P("xact-step-result"),Y()],y);var Gt=Object.defineProperty,Zt=Object.getOwnPropertyDescriptor,Ce=(a,e,t,i)=>{for(var s=i>1?void 0:i?Zt(e,t):e,o=a.length-1,r;o>=0;o--)(r=a[o])&&(s=(i?r(e,t,s):r(s))||s);return i&&s&&Gt(e,t,s),s};let K=class extends C{constructor(){super(...arguments),this.height=0}render(){const a=Array.from({length:24},(e,t)=>t);return g`
|
|
670
670
|
<div class="component-content">
|
|
671
671
|
<div class="header-section">
|
|
672
672
|
<h2 class="header-text">${n("Before you begin")}</h2>
|
|
@@ -805,12 +805,12 @@
|
|
|
805
805
|
></xact-button>
|
|
806
806
|
</div>
|
|
807
807
|
<div class="snow-layer">
|
|
808
|
-
${
|
|
808
|
+
${a.map(e=>{const t=e*37%100,i=e%6*.35,s=e%5*.4;return g`<span
|
|
809
809
|
class="snowflake"
|
|
810
|
-
style="left:${t}%; animation-delay:${
|
|
810
|
+
style="left:${t}%; animation-delay:${i}s, ${s}s;"
|
|
811
811
|
></span>`})}
|
|
812
812
|
</div>
|
|
813
|
-
`}};
|
|
813
|
+
`}};K.styles=k`
|
|
814
814
|
:host {
|
|
815
815
|
display: flex;
|
|
816
816
|
justify-content: center;
|
|
@@ -1001,15 +1001,15 @@
|
|
|
1001
1001
|
50% { transform: translateX(22px); }
|
|
1002
1002
|
}
|
|
1003
1003
|
|
|
1004
|
-
`,Ee([p({type:Number})],Y.prototype,"height",2),Ee([p({type:Function})],Y.prototype,"onStep2advancement",2),Y=Ee([P("xact-step-informs"),q()],Y);const qe="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",Zt="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",Gt="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";class qt{constructor(){this.audioContext=null,this.playbackCtx=null,this.stream=null,this.processor=null,this.source=null,this.audioPlaybackQueue=[],this.isPlaying=!1}get isPlaybackActive(){return this.isPlaying||this.audioPlaybackQueue.length>0}async startMicrophone(e){try{this.stream=await navigator.mediaDevices.getUserMedia({audio:{sampleRate:16e3,channelCount:1,echoCancellation:!0}}),this.audioContext=new AudioContext({sampleRate:16e3}),this.source=this.audioContext.createMediaStreamSource(this.stream),this.processor=this.audioContext.createScriptProcessor(4096,1,1),this.processor.onaudioprocess=t=>{const s=t.inputBuffer.getChannelData(0),i=this.float32ToInt16(s);e(i.buffer)},this.source.connect(this.processor),this.processor.connect(this.audioContext.destination)}catch(t){console.error("Microphone access denied or error:",t)}}float32ToInt16(e){const t=new Int16Array(e.length);for(let s=0;s<e.length;s++){const i=Math.max(-1,Math.min(1,e[s]));t[s]=i<0?i*32768:i*32767}return t}initPlayback(){this.playbackCtx||(this.playbackCtx=new AudioContext({sampleRate:24e3}))}queueAudio(e){this.audioPlaybackQueue.push(e),this.playNextChunk()}playNextChunk(){if(this.isPlaying||this.audioPlaybackQueue.length===0)return;this.initPlayback();const e=this.audioPlaybackQueue.shift();this.isPlaying=!0;const t=new Int16Array(e),s=new Float32Array(t.length);for(let a=0;a<t.length;a++)s[a]=t[a]/32767;const i=this.playbackCtx.createBuffer(1,s.length,24e3);i.copyToChannel(s,0);const r=this.playbackCtx.createBufferSource();r.buffer=i,r.connect(this.playbackCtx.destination),r.onended=()=>{this.isPlaying=!1,this.audioPlaybackQueue.length===0&&this.onQueueDrained&&this.onQueueDrained(),this.playNextChunk()},r.start()}clearPlaybackQueue(){this.audioPlaybackQueue=[]}stopAll(){this.clearPlaybackQueue(),this.processor&&this.source&&(this.processor.disconnect(),this.source.disconnect()),this.stream&&(this.stream.getTracks().forEach(e=>e.stop()),this.stream=null),this.audioContext&&(this.audioContext.close(),this.audioContext=null),this.playbackCtx&&(this.playbackCtx.close(),this.playbackCtx=null)}}const oe=class oe{constructor(e,t){this.ws=null,this.introSent=!1,this.introComplete=!1,this.lastCvError="",this.lastCvErrorTime=0,this.measurementComplete=!1,this.apiUrl=e,this.apiKey=t,this.audioManager=new qt}async connect(){try{const e=await fetch(`${this.apiUrl}/api/ConversationalAI/ticket`,{method:"POST",headers:{"Content-Type":"application/json","X-Api-Key":this.apiKey}});if(!e.ok){console.error("Failed to get ticket",e.statusText);return}const t=await e.json();if(!t||!t.ticket_id){console.error("Invalid ticket response");return}const s="wss://conversational-ai-service-923169850574.southamerica-east1.run.app",i=crypto.randomUUID(),r=`${s}/ws/chat/${i}/${t.ticket_id}`;this.ws=new WebSocket(r),this.ws.binaryType="arraybuffer",this.ws.onopen=()=>{console.log("AI session connected."),!this.introSent&&this.ws&&this.ws.readyState===WebSocket.OPEN&&(this.introSent=!0,this.ws.send(JSON.stringify({cv_alert:"Measurement process started!"})))},this.ws.onmessage=a=>{if(a.data instanceof ArrayBuffer){this.audioManager.queueAudio(a.data);return}try{const d=JSON.parse(a.data);switch(d.type){case"user":break;case"gemini":break;case"interrupted":this.audioManager.clearPlaybackQueue();break;case"error":console.error("AI session error:",d.error);break;case"turn_complete":this.handleTurnComplete();break}}catch(d){console.error("Error parsing WS message:",d)}},this.ws.onclose=a=>{a.code===4003&&console.error("Ticket was invalid or expired"),console.log("AI session disconnected.")},this.ws.onerror=a=>{console.error("AI Session WebSocket Error:",a)}}catch(e){console.error("Failed to connect to AI session:",e)}}handleTurnComplete(){if(!this.introComplete){this.audioManager.onQueueDrained=()=>{this.audioManager.onQueueDrained=void 0,this.introComplete=!0,console.log("AI introduction audio finished. CV errors now enabled.")},this.audioManager.isPlaybackActive||(this.audioManager.onQueueDrained=void 0,this.introComplete=!0,console.log("AI introduction complete (no audio). CV errors now enabled."));return}if(this.measurementComplete){this.audioManager.onQueueDrained=()=>{this.audioManager.onQueueDrained=void 0,console.log("AI goodbye audio finished. Disconnecting session."),this.onTurnComplete&&this.onTurnComplete(),this.disconnect()},this.audioManager.isPlaybackActive||(this.audioManager.onQueueDrained=void 0,console.log("AI goodbye complete (no audio). Disconnecting session."),this.onTurnComplete&&this.onTurnComplete(),this.disconnect());return}}startMicrophone(){this.measurementComplete||(this.audioManager.initPlayback(),this.audioManager.startMicrophone(e=>{this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(e)}))}forwardCvError(e){if(!this.introComplete||this.measurementComplete)return;const t=Date.now(),s=e===this.lastCvError,i=t-this.lastCvErrorTime<oe.CV_ERROR_THROTTLE_MS;s&&i||(this.lastCvError=e,this.lastCvErrorTime=t,this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({cv_alert:e})))}notifySuccess(e,t=""){this.measurementComplete=!0,this.audioManager.clearPlaybackQueue(),console.log("Sending success message to AI session",e,t),this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({cv_alert:`SYSTEM ALERT: Measurement is complete! Recommended size: ${e}. ${t?`Extra context: ${t}. `:""}INSTRUCTION: Embody your persona! Enthusiastically reveal their size, offer a quick fashion compliment, and gracefully say goodbye.`}))}disconnect(){this.audioManager.stopAll(),this.ws&&(this.ws.close(1e3,"Measurement complete"),this.ws=null)}};oe.CV_ERROR_THROTTLE_MS=6e3;let be=oe;var Wt=Object.defineProperty,Yt=Object.getOwnPropertyDescriptor,u=(o,e,t,s)=>{for(var i=s>1?void 0:s?Yt(e,t):e,r=o.length-1,a;r>=0;r--)(a=o[r])&&(i=(s?a(e,t,i):a(i))||i);return s&&i&&Wt(e,t,i),i};const{getLocale:Kt,setLocale:Ce}=Lt({sourceLocale:Ge,targetLocales:$t,loadLocale:o=>V(Object.assign({"./generated/locales/pt-BR.ts":()=>Promise.resolve().then(()=>Xt)}),`./generated/locales/${o}.ts`,4)});c.BodyMeasurer=class extends C{constructor(){super(...arguments),this.spinnerFrame=0,this.apiKey="",this.tenantId="1",this.productSku="123456",this.baseUrl="https://xactsize-dotnet-api-923169850574.southamerica-east1.run.app",this.apiUrl=this.baseUrl+"/api/measurer/measure/body",this.vtonUrl=this.baseUrl+"/api/VirtualTryOn/generate",this.garmentUrl="",this.vton=!1,this.brandName=void 0,this.buttonText="Find My Size",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.generatedImageUrl="",this.isVtonFetching=!1,this.vtonError=!1,this.videoElement=null,this.stream=null,this.poolingTimeout=null,this.instructionMessageTimeout=null,this.aiSession=null,this.cameras=[],this.currentCameraId=null,this.snowflakesCache=null}firstUpdated(){this.startSpinnerAnimation()}startSpinnerAnimation(){const e=[Gt,Zt,qe];this.spinnerInterval=setInterval(()=>{var s;const t=(s=this.shadowRoot)==null?void 0:s.querySelector(".spinner");t&&(t.src=e[this.spinnerFrame],this.spinnerFrame=(this.spinnerFrame+1)%e.length)},300)}get culture(){return this._culture}set culture(e){const t=this._culture;this._culture=e,this.requestUpdate("culture",t),this._applyLocale(e).catch(console.error)}async _applyLocale(e){try{this._isLocaleLoading=!0,this.requestUpdate(),await Ce(e)}catch(t){console.error("Failed to load locale",e,t),await Ce(Ge)}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(e){const t=this.errorMap[e];return t||(console.info("Error code is missing",e),n("An unexpected error occurred"))}connectedCallback(){super.connectedCallback(),console.log("New code loaded Jan 27 11:57am"),document.addEventListener("keydown",this.handleEscKey.bind(this)),this.snowflakesCache=this.generateSnowflakes()}disconnectedCallback(){var e;super.disconnectedCallback(),document.removeEventListener("keydown",this.handleEscKey.bind(this)),this.stopPolling(),clearInterval(this.spinnerInterval),(e=this.aiSession)==null||e.disconnect()}handleEscKey(e){e.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(){var e;this.showModal=!1,this.onMeasurementCanceled&&typeof this.onMeasurementCanceled=="function"&&this.onMeasurementCanceled(),this.stopPolling(),(e=this.aiSession)==null||e.disconnect(),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=3,this.errorMessage="",this.shouldStartMeasurement=!0}updated(e){super.updated(e),e.has("step")&&this.step===3&&this.shouldStartMeasurement&&(this.initializeMeasurement(),this.shouldStartMeasurement=!1)}async initializeMeasurement(){if(!this.apiKey)throw new Error("API key is required");if(!this.tenantId)throw new Error("Tenant ID is required");if(!this.productSku)throw new Error("Product SKU is required");if(!this.baseUrl)throw new Error("Base URL is required");if(!this.apiUrl)throw new Error("API URL is required");if(!this.vtonUrl)throw new Error("VTON URL is required");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.aiSession=new be(this.baseUrl,this.apiKey),await this.aiSession.connect(),this.aiSession.startMicrophone(),this.startPolling())}catch{this.errorMessage=n("Error accessing webcam")}}async loadCameras(){try{const e=await navigator.mediaDevices.enumerateDevices();this.cameras=e.filter(t=>t.kind==="videoinput"),this.cameras.length>0&&(this.currentCameraId=this.cameras[0].deviceId)}catch(e){console.error("Error enumerating devices:",e)}}async flipCamera(){if(this.cameras.length<2)return;this.isLoading=!0,this.stopPolling();const t=(this.cameras.findIndex(s=>s.deviceId===this.currentCameraId)+1)%this.cameras.length;this.currentCameraId=this.cameras[t].deviceId;try{this.stream&&this.stream.getTracks().forEach(s=>s.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 t=[],s=async()=>{var f;if(!this.videoElement||!this.stream||this.isFetching)return;const i=document.createElement("canvas");i.width=this.videoElement.videoWidth,i.height=this.videoElement.videoHeight;const r=i.getContext("2d");r==null||r.drawImage(this.videoElement,0,0,i.width,i.height);const a=await new Promise(m=>i.toBlob(h=>m(h),"image/jpeg")),d=new File([a],"frame.jpg",{type:"image/jpeg"}),l=new FormData;l.append("image",d),l.append("height",this.height.toString()),l.append("productSku",this.productSku),this.measurerKey&&l.append("measurerKey",this.measurerKey);try{this.isFetching=!0,this.isLoading=!0,this.poolingTimeout&&clearTimeout(this.poolingTimeout),this.instructionMessageTimeout&&clearTimeout(this.instructionMessageTimeout);const h=await(await fetch(this.apiUrl,{method:"POST",body:l,headers:{Accept:"application/json","Cache-Control":"no-store",Pragma:"no-cache","X-Api-Key":this.apiKey}})).json();if(this.isFetching=!1,this.isLoading=!1,h.success&&h.chosenSize){this.generateVtonImage(d),t.push(h);const b=t.length;this.instructionMessage=n(Pe`Scanning... ${b}/${3}`),b>=3?(this.processFinalResults(t),this.stopPolling(),this.step=4):this.poolingTimeout=setTimeout(s,500)}else this.instructionMessage=this.getTranslatedMessage(h.message||"UNKNOWN_ERROR"),h.message&&((f=this.aiSession)==null||f.forwardCvError(this.instructionMessage)),this.instructionMessageTimeout=setTimeout(()=>{t.length<3&&(this.poolingTimeout=setTimeout(s,0))},2e3)}catch{this.isFetching=!1,this.isLoading=!1,this.instructionMessage=n("Error processing measurement"),this.instructionMessageTimeout=setTimeout(()=>{this.poolingTimeout=setTimeout(s,0)},2e3)}};s()}async generateVtonImage(e){if(!this.vton||!this.garmentUrl||this.isVtonFetching||this.generatedImageUrl)return;this.isVtonFetching=!0,this.vtonError=!1;const t=new FormData;t.append("PersonImage",e),t.append("GarmentUrl",this.garmentUrl);try{const i=await(await fetch(this.vtonUrl,{method:"POST",body:t,headers:{Accept:"application/json","X-Api-Key":this.apiKey}})).json();i.result_urls&&i.result_urls.length>0?(this.generatedImageUrl=i.result_urls[0],this.isVtonFetching=!1):(this.vtonError=!0,this.isVtonFetching=!1)}catch(s){console.error("Error generating VTON image",s),this.vtonError=!0,this.isVtonFetching=!1}}processFinalResults(e){console.group("Scan Debug Report"),console.log(`✅ Collected ${e.length} successful scans.`),e.forEach((d,l)=>{console.log(`Scan #${l+1}: Size [${d.chosenSize}] | Chest: ${d.measurements.chest} | Waist: ${d.measurements.waist}`)});const t={};Object.keys(e[0].measurements||{}).forEach(d=>{let l=0,f=0;e.forEach(m=>{const h=m.measurements[d];typeof h=="number"&&(l+=h,f++)}),t[d]=f>0?Math.round(l/f*100)/100:0}),console.log("📏 Final Averaged Measurements:",t);const i={};e.forEach(d=>{const l=d.chosenSize;l&&(i[l]=(i[l]||0)+1)}),console.log("🗳️ Voting Results:",i);let r="",a=0;for(const[d,l]of Object.entries(i))l>a&&(a=l,r=d);if(console.log(`🏆 WINNER: ${r}`),console.groupEnd(),this.measurements=t,this.recommendedSize=r,this.instructionMessage=n("Measurement successful!"),this.aiSession){this.aiSession.onTurnComplete=()=>{this.aiSession=null};let d="";this.vton&&(this.isVtonFetching?d="An image of the user wearing the garment is currently being generated. TELL USER THEIR IMAGE IS GENERATING.":this.generatedImageUrl&&(d="The image has successfully generated. TELL USER: 'Here is your image in the garment'.")),this.aiSession.notifySuccess(r,d)}}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(e=>e.stop()),this.stream=null)}acceptMeasurement(){var e;this.dispatchEvent(new CustomEvent("measurementAccepted",{detail:{size:this.recommendedSize}})),this.onMeasurementAccepted&&typeof this.onMeasurementAccepted=="function"&&this.onMeasurementAccepted(),this.showModal=!1,this.stopPolling(),(e=this.aiSession)==null||e.disconnect(),this.aiSession=null}resetMeasurement(){var e;this.step=1,this.height=0,this.recommendedSize="",this.measurements={},this.generatedImageUrl="",this.isVtonFetching=!1,this.vtonError=!1,this.stopPolling(),(e=this.aiSession)==null||e.disconnect(),this.aiSession=null}stopMeasurement(){this.resetMeasurement(),this.showModal=!1}generateSnowflakes(){const e=[];for(let s=0;s<80;s++){const i=Math.random()*100,r=8+Math.random()*17,a=-Math.random()*30;e.push(g`<span
|
|
1004
|
+
`,Ce([p({type:Number})],K.prototype,"height",2),Ce([p({type:Function})],K.prototype,"onStep2advancement",2),K=Ce([P("xact-step-informs"),Y()],K);const We="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",qt="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",Yt="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",N=class N{constructor(){this.audioContext=null,this.playbackCtx=null,this.stream=null,this.processor=null,this.source=null,this.audioPlaybackQueue=[],this.isPlaying=!1,this.isUserSpeaking=!1,this.speechTimeout=null}get isPlaybackActive(){return this.isPlaying||this.audioPlaybackQueue.length>0}async startMicrophone(e){try{this.stream=await navigator.mediaDevices.getUserMedia({audio:{sampleRate:16e3,channelCount:1,echoCancellation:!0}}),this.audioContext=new AudioContext({sampleRate:16e3}),this.source=this.audioContext.createMediaStreamSource(this.stream),this.processor=this.audioContext.createScriptProcessor(4096,1,1),this.processor.onaudioprocess=t=>{const i=t.inputBuffer.getChannelData(0);let s=0;for(let d=0;d<i.length;d++)s+=i[d]*i[d];Math.sqrt(s/i.length)>N.SPEECH_THRESHOLD&&(this.isUserSpeaking=!0,this.speechTimeout&&clearTimeout(this.speechTimeout),this.speechTimeout=window.setTimeout(()=>{this.isUserSpeaking=!1},N.SPEECH_HOLD_TIME));const r=this.float32ToInt16(i);e(r.buffer)},this.source.connect(this.processor),this.processor.connect(this.audioContext.destination)}catch(t){console.error("Microphone access denied or error:",t)}}float32ToInt16(e){const t=new Int16Array(e.length);for(let i=0;i<e.length;i++){const s=Math.max(-1,Math.min(1,e[i]));t[i]=s<0?s*32768:s*32767}return t}initPlayback(){this.playbackCtx||(this.playbackCtx=new AudioContext({sampleRate:24e3}))}queueAudio(e){this.audioPlaybackQueue.push(e),this.playNextChunk()}playNextChunk(){if(this.isPlaying||this.audioPlaybackQueue.length===0)return;this.initPlayback();const e=this.audioPlaybackQueue.shift();this.isPlaying=!0;const t=new Int16Array(e),i=new Float32Array(t.length);for(let r=0;r<t.length;r++)i[r]=t[r]/32767;const s=this.playbackCtx.createBuffer(1,i.length,24e3);s.copyToChannel(i,0);const o=this.playbackCtx.createBufferSource();o.buffer=s,o.connect(this.playbackCtx.destination),o.onended=()=>{this.isPlaying=!1,this.audioPlaybackQueue.length===0&&this.onQueueDrained&&this.onQueueDrained(),this.playNextChunk()},o.start()}clearPlaybackQueue(){this.audioPlaybackQueue=[]}stopAll(){this.clearPlaybackQueue(),this.processor&&this.source&&(this.processor.disconnect(),this.source.disconnect()),this.stream&&(this.stream.getTracks().forEach(e=>e.stop()),this.stream=null),this.audioContext&&(this.audioContext.close(),this.audioContext=null),this.playbackCtx&&(this.playbackCtx.close(),this.playbackCtx=null)}};N.SPEECH_THRESHOLD=.02,N.SPEECH_HOLD_TIME=1500;let ve=N;const oe=class oe{constructor(e,t,i="en"){this.ws=null,this.introSent=!1,this.introComplete=!1,this.lastCvError="",this.lastCvErrorTime=0,this.measurementComplete=!1,this.isDisconnected=!1,this.apiUrl=e,this.apiKey=t,this.localeCode=i,this.audioManager=new ve}async connect(){try{const e=await fetch(`${this.apiUrl}/api/ConversationalAI/ticket`,{method:"POST",headers:{"Content-Type":"application/json","X-Api-Key":this.apiKey}});if(this.isDisconnected){console.log("AI session was disconnected before ticket response.");return}if(!e.ok){console.error("Failed to get ticket",e.statusText);return}const t=await e.json();if(!t||!t.ticket_id){console.error("Invalid ticket response");return}if(this.isDisconnected){console.log("AI session was disconnected before websocket could be opened.");return}const i="wss://conversational-ai-service-923169850574.southamerica-east1.run.app",s=crypto.randomUUID(),o=`${i}/ws/chat/${s}/${t.ticket_id}`;this.ws=new WebSocket(o),this.ws.binaryType="arraybuffer",this.ws.onopen=()=>{console.log("AI session connected."),!this.introSent&&this.ws&&this.ws.readyState===WebSocket.OPEN&&(this.introSent=!0,this.ws.send(JSON.stringify({cv_alert:`Measurement process started! The user speaks ${this.localeCode}.`})))},this.ws.onmessage=r=>{if(r.data instanceof ArrayBuffer){this.audioManager.queueAudio(r.data);return}try{const d=JSON.parse(r.data);switch(d.type){case"user":break;case"gemini":break;case"interrupted":this.audioManager.clearPlaybackQueue();break;case"error":console.error("AI session error:",d.error);break;case"turn_complete":this.handleTurnComplete();break}}catch(d){console.error("Error parsing WS message:",d)}},this.ws.onclose=r=>{r.code===4003&&console.error("Ticket was invalid or expired"),console.log("AI session disconnected.")},this.ws.onerror=r=>{console.error("AI Session WebSocket Error:",r)}}catch(e){console.error("Failed to connect to AI session:",e)}}handleTurnComplete(){if(!this.introComplete){this.audioManager.onQueueDrained=()=>{this.audioManager.onQueueDrained=void 0,this.introComplete=!0,console.log("AI introduction audio finished. CV errors now enabled.")},this.audioManager.isPlaybackActive||(this.audioManager.onQueueDrained=void 0,this.introComplete=!0,console.log("AI introduction complete (no audio). CV errors now enabled."));return}if(this.measurementComplete){this.audioManager.onQueueDrained=()=>{this.audioManager.onQueueDrained=void 0,console.log("AI goodbye audio finished. Disconnecting session."),this.onTurnComplete&&this.onTurnComplete(),this.disconnect()},this.audioManager.isPlaybackActive||(this.audioManager.onQueueDrained=void 0,console.log("AI goodbye complete (no audio). Disconnecting session."),this.onTurnComplete&&this.onTurnComplete(),this.disconnect());return}}startMicrophone(){this.measurementComplete||(this.audioManager.initPlayback(),this.audioManager.startMicrophone(e=>{this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(e)}))}forwardCvError(e){if(!this.introComplete||this.measurementComplete||this.audioManager.isUserSpeaking)return;const t=Date.now(),i=e===this.lastCvError,s=t-this.lastCvErrorTime<oe.CV_ERROR_THROTTLE_MS;i&&s||(this.lastCvError=e,this.lastCvErrorTime=t,this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({cv_alert:e})))}notifySuccess(e,t=""){this.measurementComplete=!0,this.audioManager.clearPlaybackQueue(),console.log("Sending success message to AI session",e,t),this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({cv_alert:`SYSTEM ALERT: Measurement is complete! Recommended size: ${e}. ${t?`Extra context: ${t}. `:""}INSTRUCTION: Embody your persona! Enthusiastically reveal their size, offer a quick fashion compliment, and gracefully say goodbye.`}))}disconnect(){this.isDisconnected=!0,this.audioManager.stopAll(),this.ws&&(this.ws.close(1e3,"Measurement complete"),this.ws=null)}};oe.CV_ERROR_THROTTLE_MS=6e3;let xe=oe;var Wt=Object.defineProperty,Kt=Object.getOwnPropertyDescriptor,u=(a,e,t,i)=>{for(var s=i>1?void 0:i?Kt(e,t):e,o=a.length-1,r;o>=0;o--)(r=a[o])&&(s=(i?r(e,t,s):r(s))||s);return i&&s&&Wt(e,t,s),s};const{getLocale:Qt,setLocale:we}=Lt({sourceLocale:Ye,targetLocales:Ot,loadLocale:a=>V(Object.assign({"./generated/locales/es-MX.ts":()=>Promise.resolve().then(()=>Jt),"./generated/locales/pt-BR.ts":()=>Promise.resolve().then(()=>ti)}),`./generated/locales/${a}.ts`,4)});c.BodyMeasurer=class extends C{constructor(){super(...arguments),this.spinnerFrame=0,this.apiKey="",this.tenantId="1",this.productSku="123456",this.baseUrl="https://xactsize-dotnet-api-923169850574.southamerica-east1.run.app",this.apiUrl=this.baseUrl+"/api/measurer/measure/body",this.vtonUrl=this.baseUrl+"/api/VirtualTryOn/generate",this.garmentUrl="",this.vton=!1,this.brandName=void 0,this.buttonText="",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.generatedImageUrl="",this.isVtonFetching=!1,this.vtonError=!1,this.videoElement=null,this.stream=null,this.poolingTimeout=null,this.instructionMessageTimeout=null,this.aiSession=null,this.cameras=[],this.currentCameraId=null,this.snowflakesCache=null}firstUpdated(){this.startSpinnerAnimation()}startSpinnerAnimation(){const e=[Yt,qt,We];this.spinnerInterval=setInterval(()=>{var i;const t=(i=this.shadowRoot)==null?void 0:i.querySelector(".spinner");t&&(t.src=e[this.spinnerFrame],this.spinnerFrame=(this.spinnerFrame+1)%e.length)},300)}get culture(){return this._culture}set culture(e){const t=this._culture;this._culture=e,this.requestUpdate("culture",t),this._applyLocale(e).catch(console.error)}async _applyLocale(e){try{this._isLocaleLoading=!0,this.requestUpdate(),await we(e)}catch(t){console.error("Failed to load locale",e,t),await we(Ye)}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(e){const t=this.errorMap[e];return t||(console.info("Error code is missing",e),n("An unexpected error occurred"))}connectedCallback(){super.connectedCallback(),console.log("New code loaded Jan 27 11:57am"),document.addEventListener("keydown",this.handleEscKey.bind(this)),this.snowflakesCache=this.generateSnowflakes()}disconnectedCallback(){var e;super.disconnectedCallback(),document.removeEventListener("keydown",this.handleEscKey.bind(this)),this.stopPolling(),clearInterval(this.spinnerInterval),(e=this.aiSession)==null||e.disconnect()}handleEscKey(e){e.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(){var e;this.showModal=!1,this.onMeasurementCanceled&&typeof this.onMeasurementCanceled=="function"&&this.onMeasurementCanceled(),this.stopPolling(),(e=this.aiSession)==null||e.disconnect(),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=3,this.errorMessage="",this.shouldStartMeasurement=!0}updated(e){super.updated(e),e.has("step")&&this.step===3&&this.shouldStartMeasurement&&(this.initializeMeasurement(),this.shouldStartMeasurement=!1)}async initializeMeasurement(){if(!this.apiKey)throw new Error("API key is required");if(!this.tenantId)throw new Error("Tenant ID is required");if(!this.productSku)throw new Error("Product SKU is required");if(!this.baseUrl)throw new Error("Base URL is required");if(!this.apiUrl)throw new Error("API URL is required");if(!this.vtonUrl)throw new Error("VTON URL is required");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.aiSession=new xe(this.baseUrl,this.apiKey,this.culture),await this.aiSession.connect(),this.aiSession.startMicrophone(),this.startPolling())}catch{this.errorMessage=n("Error accessing webcam")}}async loadCameras(){try{const e=await navigator.mediaDevices.enumerateDevices();this.cameras=e.filter(t=>t.kind==="videoinput"),this.cameras.length>0&&(this.currentCameraId=this.cameras[0].deviceId)}catch(e){console.error("Error enumerating devices:",e)}}async flipCamera(){if(this.cameras.length<2)return;this.isLoading=!0,this.stopPolling();const t=(this.cameras.findIndex(i=>i.deviceId===this.currentCameraId)+1)%this.cameras.length;this.currentCameraId=this.cameras[t].deviceId;try{this.stream&&this.stream.getTracks().forEach(i=>i.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 t=[],i=async()=>{var f;if(!this.videoElement||!this.stream||this.isFetching)return;const s=document.createElement("canvas");s.width=this.videoElement.videoWidth,s.height=this.videoElement.videoHeight;const o=s.getContext("2d");o==null||o.drawImage(this.videoElement,0,0,s.width,s.height);const r=await new Promise(m=>s.toBlob(h=>m(h),"image/jpeg")),d=new File([r],"frame.jpg",{type:"image/jpeg"}),l=new FormData;l.append("image",d),l.append("height",this.height.toString()),l.append("productSku",this.productSku),this.measurerKey&&l.append("measurerKey",this.measurerKey);try{this.isFetching=!0,this.isLoading=!0,this.poolingTimeout&&clearTimeout(this.poolingTimeout),this.instructionMessageTimeout&&clearTimeout(this.instructionMessageTimeout);const h=await(await fetch(this.apiUrl,{method:"POST",body:l,headers:{Accept:"application/json","Cache-Control":"no-store",Pragma:"no-cache","X-Api-Key":this.apiKey}})).json();if(this.isFetching=!1,this.isLoading=!1,h.success&&h.chosenSize){this.generateVtonImage(d),t.push(h);const b=t.length;this.instructionMessage=n(ge`Scanning... ${b}/${3}`),b>=3?(this.processFinalResults(t),this.stopPolling(),this.step=4):this.poolingTimeout=setTimeout(i,500)}else this.instructionMessage=this.getTranslatedMessage(h.message||"UNKNOWN_ERROR"),h.message&&((f=this.aiSession)==null||f.forwardCvError(this.instructionMessage)),this.instructionMessageTimeout=setTimeout(()=>{t.length<3&&(this.poolingTimeout=setTimeout(i,0))},2e3)}catch{this.isFetching=!1,this.isLoading=!1,this.instructionMessage=n("Error processing measurement"),this.instructionMessageTimeout=setTimeout(()=>{this.poolingTimeout=setTimeout(i,0)},2e3)}};i()}async generateVtonImage(e){if(!this.vton||!this.garmentUrl||this.isVtonFetching||this.generatedImageUrl)return;this.isVtonFetching=!0,this.vtonError=!1;const t=new FormData;t.append("PersonImage",e),t.append("GarmentUrl",this.garmentUrl);try{const s=await(await fetch(this.vtonUrl,{method:"POST",body:t,headers:{Accept:"application/json","X-Api-Key":this.apiKey}})).json();s.result_urls&&s.result_urls.length>0?(this.generatedImageUrl=s.result_urls[0],this.isVtonFetching=!1):(this.vtonError=!0,this.isVtonFetching=!1)}catch(i){console.error("Error generating VTON image",i),this.vtonError=!0,this.isVtonFetching=!1}}processFinalResults(e){console.group("Scan Debug Report"),console.log(`✅ Collected ${e.length} successful scans.`),e.forEach((d,l)=>{console.log(`Scan #${l+1}: Size [${d.chosenSize}] | Chest: ${d.measurements.chest} | Waist: ${d.measurements.waist}`)});const t={};Object.keys(e[0].measurements||{}).forEach(d=>{let l=0,f=0;e.forEach(m=>{const h=m.measurements[d];typeof h=="number"&&(l+=h,f++)}),t[d]=f>0?Math.round(l/f*100)/100:0}),console.log("📏 Final Averaged Measurements:",t);const s={};e.forEach(d=>{const l=d.chosenSize;l&&(s[l]=(s[l]||0)+1)}),console.log("🗳️ Voting Results:",s);let o="",r=0;for(const[d,l]of Object.entries(s))l>r&&(r=l,o=d);if(console.log(`🏆 WINNER: ${o}`),console.groupEnd(),this.measurements=t,this.recommendedSize=o,this.instructionMessage=n("Measurement successful!"),this.aiSession){this.aiSession.onTurnComplete=()=>{this.aiSession=null};let d="";this.vton&&(this.isVtonFetching?d="An image of the user wearing the garment is currently being generated. TELL USER THEIR IMAGE IS GENERATING.":this.generatedImageUrl&&(d="The image has successfully generated. TELL USER: 'Here is your image in the garment'.")),this.aiSession.notifySuccess(o,d)}}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(e=>e.stop()),this.stream=null)}acceptMeasurement(){var e;this.dispatchEvent(new CustomEvent("measurementAccepted",{detail:{size:this.recommendedSize}})),this.onMeasurementAccepted&&typeof this.onMeasurementAccepted=="function"&&this.onMeasurementAccepted(),this.showModal=!1,this.stopPolling(),(e=this.aiSession)==null||e.disconnect(),this.aiSession=null}resetMeasurement(){var e;this.step=1,this.height=0,this.recommendedSize="",this.measurements={},this.generatedImageUrl="",this.isVtonFetching=!1,this.vtonError=!1,this.stopPolling(),(e=this.aiSession)==null||e.disconnect(),this.aiSession=null}stopMeasurement(){this.resetMeasurement(),this.showModal=!1}generateSnowflakes(){const e=[];for(let i=0;i<80;i++){const s=Math.random()*100,o=8+Math.random()*17,r=-Math.random()*30;e.push(g`<span
|
|
1005
1005
|
class="snowflake"
|
|
1006
|
-
style="left:${
|
|
1006
|
+
style="left:${s}%; animation-duration:${o.toFixed(2)}s; animation-delay:${r.toFixed(2)}s;"
|
|
1007
1007
|
></span>`)}return g`${e}`}renderSnowflakes(){return this.snowflakesCache||g``}render(){return this._isLocaleLoading?g`<div hidden></div>`:g`
|
|
1008
1008
|
<xact-button
|
|
1009
1009
|
class="launch-btn"
|
|
1010
1010
|
style="--brand-primary: #000; --text-inverse: #fff; --brand-primary-hover: #111;"
|
|
1011
1011
|
@click=${this.openModal}
|
|
1012
|
-
label="${this.buttonText}"
|
|
1012
|
+
label="${this.buttonText||n("Find My Size")}"
|
|
1013
1013
|
></xact-button>
|
|
1014
1014
|
|
|
1015
1015
|
${this.showModal?g`
|
|
@@ -1062,13 +1062,13 @@
|
|
|
1062
1062
|
<div class="video-overlay-spinner">
|
|
1063
1063
|
<img
|
|
1064
1064
|
class="spinner"
|
|
1065
|
-
src="${
|
|
1066
|
-
alt="
|
|
1065
|
+
src="${We}"
|
|
1066
|
+
alt="${n("Loading")}"
|
|
1067
1067
|
/>
|
|
1068
1068
|
</div>
|
|
1069
1069
|
|
|
1070
1070
|
<video
|
|
1071
|
-
class=${
|
|
1071
|
+
class=${Ht({error:!this.errorMessage,success:!!this.errorMessage})}
|
|
1072
1072
|
playsinline
|
|
1073
1073
|
id="video"
|
|
1074
1074
|
autoplay
|
|
@@ -1115,7 +1115,7 @@
|
|
|
1115
1115
|
</div>
|
|
1116
1116
|
</div>
|
|
1117
1117
|
`:""}
|
|
1118
|
-
`}},c.BodyMeasurer.styles=
|
|
1118
|
+
`}},c.BodyMeasurer.styles=k`
|
|
1119
1119
|
:host {
|
|
1120
1120
|
display: block;
|
|
1121
1121
|
font-family: Arial, sans-serif;
|
|
@@ -1664,4 +1664,4 @@
|
|
|
1664
1664
|
BlinkMacSystemFont,
|
|
1665
1665
|
sans-serif;
|
|
1666
1666
|
}
|
|
1667
|
-
`,u([p({type:String,attribute:"api-key"})],c.BodyMeasurer.prototype,"apiKey",2),u([p({type:String,attribute:"tenant-id"})],c.BodyMeasurer.prototype,"tenantId",2),u([p({type:String,attribute:"product-sku"})],c.BodyMeasurer.prototype,"productSku",2),u([p({type:String,attribute:"base-url"})],c.BodyMeasurer.prototype,"baseUrl",2),u([p({type:String,attribute:"api-url"})],c.BodyMeasurer.prototype,"apiUrl",2),u([p({type:String,attribute:"vton-url"})],c.BodyMeasurer.prototype,"vtonUrl",2),u([p({type:String,attribute:"garment-url"})],c.BodyMeasurer.prototype,"garmentUrl",2),u([p({type:Boolean,attribute:"vton"})],c.BodyMeasurer.prototype,"vton",2),u([p({type:Function,attribute:"onmeasurementaccepted"})],c.BodyMeasurer.prototype,"onMeasurementAccepted",2),u([p({type:Function,attribute:"onmeasurementcanceled"})],c.BodyMeasurer.prototype,"onMeasurementCanceled",2),u([p({type:String,attribute:"brand-name"})],c.BodyMeasurer.prototype,"brandName",2),u([p({type:String,attribute:"button-text"})],c.BodyMeasurer.prototype,"buttonText",2),u([p({type:String})],c.BodyMeasurer.prototype,"culture",1),u([_()],c.BodyMeasurer.prototype,"errorMap",1),u([_()],c.BodyMeasurer.prototype,"measurerKey",2),u([_()],c.BodyMeasurer.prototype,"_isLocaleLoading",2),u([_()],c.BodyMeasurer.prototype,"showModal",2),u([_()],c.BodyMeasurer.prototype,"step",2),u([_()],c.BodyMeasurer.prototype,"height",2),u([_()],c.BodyMeasurer.prototype,"recommendedSize",2),u([_()],c.BodyMeasurer.prototype,"measurements",2),u([_()],c.BodyMeasurer.prototype,"errorMessage",2),u([_()],c.BodyMeasurer.prototype,"instructionMessage",2),u([_()],c.BodyMeasurer.prototype,"shouldStartMeasurement",2),u([_()],c.BodyMeasurer.prototype,"isLoading",2),u([_()],c.BodyMeasurer.prototype,"isFetching",2),u([_()],c.BodyMeasurer.prototype,"generatedImageUrl",2),u([_()],c.BodyMeasurer.prototype,"isVtonFetching",2),u([_()],c.BodyMeasurer.prototype,"vtonError",2),u([_()],c.BodyMeasurer.prototype,"cameras",2),u([_()],c.BodyMeasurer.prototype,"currentCameraId",2),c.BodyMeasurer=u([P("body-measurer"),q()],c.BodyMeasurer);const Qt={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",s08b0bc2feb4e0f1c:"Boa iluminação",s1dd794b3870bcae0:"Começar",s2f77566c78235d88:"Erro acessando a câmera",s322c72546e939809:"Escolha uma área bem iluminada onde você possa ver sua imagem claramente.",s34c58d3d12e5f890:"Erro ao mudar a câmera",s396efd2b23a16ac9:"Posicione-se contra um fundo simples.",s3d324b180f982d46:"Tenha certeza de que seu corpo está totalmente visível",s420e8053328b31c4:"Seu tamanho ideal",s48d094fb2ffff8fb:"Pontas",s5c91b5e06c363734:"Medição de processamento de erros",s625ff027ee7b497b:"Certifique-se de que todo o seu corpo esteja visível. O aplicativo guiará você.",s676cfe9f36657792:"Medição realizada com sucesso!",s6ad3b28b46803c43:"Aceitar sugestão",s81d43b9b25d0775b:"Roupas",s88a3f5e6a9d9945d:"Use roupas que você costuma usar no dia a dia.",s8fb9f388e75ffe11:"Enquadramento",s952ed559991cf0b4:"Desenvolvido por",sa4ad2b9cd4ea10ba:"Fundo limpo",scf8d43c4a5cb71fa:"Mantenha uma postura ereta, com os braços ligeiramente afastados do corpo",sd13d4c82d57859fc:"Posicione-se em frente a câmera",sdabfef8968aeb5fa:"Um erro inesperado aconteceu",sdf9f9c621b6316e7:"Medir novamente",se940dab2e0b7a710:"Antes de começar",sf84b5644f7595ce5:"Com base em suas medidas e nas dimensões exatas da peça, a recomendação de tamanho fornecida é a mais precisa para um ajuste ideal.",seb66e000f03f21e0:"Let's find your perfect size",sd2259f35f330b63c:"Curated luxury. Perfect fit.",sca9b53eeb24a5865:"Avoid backlighting",s32d5e90d7ffec075:"Use a plain wall",se61735ca89853860:"Form-fitting gear",s3a09a6be4809cb50:"Full body shot",s7948656b643c5186:"Enter your height (cm)",sdde2fe5a591a828a:"Let's get started! →",s4a7b0f0c7b8b2125:"By using Xactsize, you agree to our Terms and Privacy Policy.",s6cda30fe423482fd:"Generating your Virtual Try-On image...",s91a037763666343d:"Something happened while generating the Virtual Try-On image.",sde0bd870399b428c:"VIEW FULL IMAGE",s76ceab13c1401897:Pe`Scanning... ${0}/${1}`,s833a6c1d27f3b409:"Click here to flip your camera"},Xt=Object.freeze(Object.defineProperty({__proto__:null,templates:Qt},Symbol.toStringTag,{value:"Module"}));c.getLocale=Kt,c.setLocale=Ce,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
|
|
1667
|
+
`,u([p({type:String,attribute:"api-key"})],c.BodyMeasurer.prototype,"apiKey",2),u([p({type:String,attribute:"tenant-id"})],c.BodyMeasurer.prototype,"tenantId",2),u([p({type:String,attribute:"product-sku"})],c.BodyMeasurer.prototype,"productSku",2),u([p({type:String,attribute:"base-url"})],c.BodyMeasurer.prototype,"baseUrl",2),u([p({type:String,attribute:"api-url"})],c.BodyMeasurer.prototype,"apiUrl",2),u([p({type:String,attribute:"vton-url"})],c.BodyMeasurer.prototype,"vtonUrl",2),u([p({type:String,attribute:"garment-url"})],c.BodyMeasurer.prototype,"garmentUrl",2),u([p({type:Boolean,attribute:"vton"})],c.BodyMeasurer.prototype,"vton",2),u([p({type:Function,attribute:"onmeasurementaccepted"})],c.BodyMeasurer.prototype,"onMeasurementAccepted",2),u([p({type:Function,attribute:"onmeasurementcanceled"})],c.BodyMeasurer.prototype,"onMeasurementCanceled",2),u([p({type:String,attribute:"brand-name"})],c.BodyMeasurer.prototype,"brandName",2),u([p({type:String,attribute:"button-text"})],c.BodyMeasurer.prototype,"buttonText",2),u([p({type:String})],c.BodyMeasurer.prototype,"culture",1),u([E()],c.BodyMeasurer.prototype,"errorMap",1),u([E()],c.BodyMeasurer.prototype,"measurerKey",2),u([E()],c.BodyMeasurer.prototype,"_isLocaleLoading",2),u([E()],c.BodyMeasurer.prototype,"showModal",2),u([E()],c.BodyMeasurer.prototype,"step",2),u([E()],c.BodyMeasurer.prototype,"height",2),u([E()],c.BodyMeasurer.prototype,"recommendedSize",2),u([E()],c.BodyMeasurer.prototype,"measurements",2),u([E()],c.BodyMeasurer.prototype,"errorMessage",2),u([E()],c.BodyMeasurer.prototype,"instructionMessage",2),u([E()],c.BodyMeasurer.prototype,"shouldStartMeasurement",2),u([E()],c.BodyMeasurer.prototype,"isLoading",2),u([E()],c.BodyMeasurer.prototype,"isFetching",2),u([E()],c.BodyMeasurer.prototype,"generatedImageUrl",2),u([E()],c.BodyMeasurer.prototype,"isVtonFetching",2),u([E()],c.BodyMeasurer.prototype,"vtonError",2),u([E()],c.BodyMeasurer.prototype,"cameras",2),u([E()],c.BodyMeasurer.prototype,"currentCameraId",2),c.BodyMeasurer=u([P("body-measurer"),Y()],c.BodyMeasurer);const Xt={ERR_ARM_NOT_STRETCHED:"Estira tus brazos completamente",ERR_ARMS_NOT_RAISED:"Levanta ambos brazos en un ángulo de 45 grados",ERR_BODY_LANDMARKS_NOT_DETECTED:"Asegúrate de que todo tu cuerpo sea visible en la cámara",ERR_BODY_TOO_CLOSE_TO_EDGE:"Aleja tu cuerpo del borde del encuadre",ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_LEFT:"Muévete hacia la izquierda para centrar tu cuerpo",ERR_BODY_TOO_CLOSE_TO_EDGE_MOVE_RIGHT:"Muévete hacia la derecha para centrar tu cuerpo",ERR_FEET_TOO_CLOSE_TO_EDGE:"Aleja tus pies del borde del encuadre",ERR_HEAD_POINT_NOT_DETECTED:"Asegúrate de que tu cabeza sea completamente visible en el encuadre",ERR_HEAD_TOO_CLOSE_TO_EDGE:"Aleja tu cabeza del borde del encuadre",ERR_HEIGHT_INVALID:"La altura debe estar entre 50 y 300 cm",ERR_HEIGHT_MEASUREMENT_FAILED:"Párate derecho y asegúrate de que todo tu cuerpo sea visible",ERR_HEM_MEASUREMENT_FAILED:"Asegúrate de que el dobladillo de tu ropa sea visible y claro",ERR_HIPS_MEASUREMENT_FAILED:"Párate derecho y asegúrate de que tus caderas sean visibles",ERR_HIPS_NOT_VISIBLE:"Ajusta tu posición para mostrar tus caderas",ERR_IMAGE_LOAD_FAILED:"Intenta de nuevo más tarde; la imagen no se pudo procesar",ERR_INCORRECT_POSTURE:"Párate derecho con los hombros hacia atrás",ERR_INVALID_BODY_HEIGHT_TYPE:"Asegúrate de que todo tu cuerpo sea visible para medir la altura",ERR_INVALID_CLOTHING_TYPE:"Este tipo de ropa no es compatible; por favor, contacta a soporte",ERR_INVALID_MEASURE_SIDE_VIEW:"Gira para mostrar un perfil de lado claro",ERR_LEFT_ARM_NOT_RAISED:"Levante tu brazo izquierdo en un ángulo de 45 grados",ERR_LEFT_ARM_TOO_HIGH:"Baja tu brazo izquierdo",ERR_LEGS_NOT_DETECTED:"Asegúrate de que tus piernas sean completamente visibles en el encuadre",ERR_LOWER_BODY_NOT_VISIBLE:"Ajusta tu posición para mostrar la parte inferior de tu cuerpo",ERR_NOT_SIDE_VIEW:"Gira para mostrar tu perfil de lado",ERR_RIGHT_ARM_NOT_RAISED:"Levanta tu brazo derecho en un ángulo de 45 grados",ERR_RIGHT_ARM_TOO_HIGH:"Baja tu brazo derecho",ERR_SHOULDER_MEASUREMENT_FAILED:"Mantén tus hombros relajados y visibles",ERR_SHOULDERS_NOT_VISIBLE:"Ajusta tu posición para mostrar tus hombros",ERR_TOO_CLOSE_TO_CAMERA:"Aléjate de la cámara",ERR_UPPER_BODY_NOT_VISIBLE:"Ajusta tu posición para mostrar la parte superior de tu cuerpo",ERR_WAIST_MEASUREMENT_FAILED:"Párate derecho y asegúrate de que tu cintura sea visible",s08b0bc2feb4e0f1c:"Buena iluminación",s1137f6c10e0f1660:"Al usar",s1dd794b3870bcae0:"Empezar",s2f77566c78235d88:"Error al acceder a la cámara web",s322c72546e939809:"Elige un área bien iluminada donde puedas ver tu imagen claramente.",s32d5e90d7ffec075:"Usa una pared lisa",s34c58d3d12e5f890:"Error al cambiar de cámara",s396efd2b23a16ac9:"Colócate contra un fondo liso.",s3a09a6be4809cb50:"Foto de cuerpo entero",s3d324b180f982d46:"Asegúrate de que todo tu cuerpo sea visible en la cámara",s420e8053328b31c4:"Tu talla ideal",s48d094fb2ffff8fb:"Consejos",s5c91b5e06c363734:"Error al procesar la medición",s625ff027ee7b497b:"Asegúrate de que todo tu cuerpo sea visible. La aplicación te guiará.",s676cfe9f36657792:"¡Medición exitosa!",s6ad3b28b46803c43:"Aceptar sugerencia",s6cda30fe423482fd:"Generando tu imagen de probador virtual...",s76ceab13c1401897:ge`Escaneando... ${0}/${1}`,s7948656b643c5186:"Ingresa tu altura (cm)",s81d43b9b25d0775b:"Ropa",s833a6c1d27f3b409:"Haz clic aquí para voltear tu cámara",s88a3f5e6a9d9945d:"Usa la ropa que sueles ponerte a diario.",s88a7dd58c3763c51:"Encontrar Mi Talla",s8fb9f388e75ffe11:"Encuadre",s91a037763666343d:"Algo pasó mientras se generaba la imagen del probador virtual.",s952ed559991cf0b4:"Desarrollado por",sa4ad2b9cd4ea10ba:"Fondo limpio",sad8ede33ccaa8ef1:"aceptas nuestros Términos y Política de Privacidad.",sb59d68ed12d46377:"Cargando",sca9b53eeb24a5865:"Evita la luz de fondo",scf8d43c4a5cb71fa:"Para garantizar medidas precisas, tomaremos dos escaneos: uno de frente y otro de lado. Mantén una postura erguida con los brazos ligeramente separados de tu cuerpo y estirados. En la vista lateral, párate derecho con los brazos estirados y alineados con tu cuerpo.",sd13d4c82d57859fc:"Colócate frente a la cámara",sd2259f35f330b63c:"Lujo seleccionado. Ajuste perfecto.",sdabfef8968aeb5fa:"Ocurrió un error inesperado",sdde2fe5a591a828a:"¡Comencemos! →",sde0bd870399b428c:"VER IMAGEN COMPLETA",sde1f02481331134c:"Producto",sdf9f9c621b6316e7:"Medir de nuevo",se61735ca89853860:"Ropa ajustada",se940dab2e0b7a710:"Antes de comenzar",seb66e000f03f21e0:"Encontremos tu talla perfecta",sf84b5644f7595ce5:"Según tus medidas y las dimensiones exactas de la prenda, la recomendación de talla proporcionada es la más precisa para un ajuste ideal."},Jt=Object.freeze(Object.defineProperty({__proto__:null,templates:Xt},Symbol.toStringTag,{value:"Module"})),ei={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",s08b0bc2feb4e0f1c:"Boa iluminação",s1137f6c10e0f1660:"Ao usar a",s1dd794b3870bcae0:"Começar",s2f77566c78235d88:"Erro acessando a câmera",s322c72546e939809:"Escolha uma área bem iluminada onde você possa ver sua imagem claramente.",s32d5e90d7ffec075:"Use uma parede lisa",s34c58d3d12e5f890:"Erro ao mudar a câmera",s396efd2b23a16ac9:"Posicione-se contra um fundo simples.",s3a09a6be4809cb50:"Foto de corpo inteiro",s3d324b180f982d46:"Tenha certeza de que seu corpo está totalmente visível",s420e8053328b31c4:"Seu tamanho ideal",s48d094fb2ffff8fb:"Pontas",s5c91b5e06c363734:"Medição de processamento de erros",s625ff027ee7b497b:"Certifique-se de que todo o seu corpo esteja visível. O aplicativo guiará você.",s676cfe9f36657792:"Medição realizada com sucesso!",s6ad3b28b46803c43:"Aceitar sugestão",s6cda30fe423482fd:"Gerando sua imagem de provador virtual...",s76ceab13c1401897:ge`Escaneando... ${0}/${1}`,s7948656b643c5186:"Digite sua altura (cm)",s81d43b9b25d0775b:"Roupas",s833a6c1d27f3b409:"Clique aqui para virar sua câmera",s88a3f5e6a9d9945d:"Use roupas que você costuma usar no dia a dia.",s88a7dd58c3763c51:"Encontrar Meu Tamanho",s8fb9f388e75ffe11:"Enquadramento",s91a037763666343d:"Algo aconteceu ao gerar a imagem do provador virtual.",s952ed559991cf0b4:"Desenvolvido por",sa4ad2b9cd4ea10ba:"Fundo limpo",sad8ede33ccaa8ef1:"você concorda com nossos Termos e Política de Privacidade.",sb59d68ed12d46377:"Carregando",sca9b53eeb24a5865:"Evite luz de fundo",scf8d43c4a5cb71fa:"Mantenha uma postura ereta, com os braços ligeiramente afastados do corpo",sd13d4c82d57859fc:"Posicione-se em frente a câmera",sd2259f35f330b63c:"Luxo sob medida. Caimento perfeito.",sdabfef8968aeb5fa:"Um erro inesperado aconteceu",sdde2fe5a591a828a:"Vamos começar! →",sde0bd870399b428c:"VER IMAGEM COMPLETA",sde1f02481331134c:"Produto",sdf9f9c621b6316e7:"Medir novamente",se61735ca89853860:"Roupas justas",se940dab2e0b7a710:"Antes de começar",seb66e000f03f21e0:"Vamos encontrar o seu tamanho perfeito",sf84b5644f7595ce5:"Com base em suas medidas e nas dimensões exatas da peça, a recomendação de tamanho fornecida é a mais precisa para um ajuste ideal."},ti=Object.freeze(Object.defineProperty({__proto__:null,templates:ei},Symbol.toStringTag,{value:"Module"}));c.getLocale=Qt,c.setLocale=we,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
|