crmbonus-component-wake 2.1.30-homolog → 2.1.31-homolog
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/dist/cjs/{cart.helper-5feae142.js → cart.helper-b4fad77c.js} +2 -2
- package/dist/cjs/{cart.helper-5feae142.js.map → cart.helper-b4fad77c.js.map} +1 -1
- package/dist/cjs/crm-bonus-form.cjs.entry.js +1 -1
- package/dist/cjs/crm-bonus-note.cjs.entry.js +2 -2
- package/dist/cjs/crm-bonus.cjs.entry.js +2 -2
- package/dist/cjs/crm-giftback-form.cjs.entry.js +2 -2
- package/dist/cjs/crm-tooltip_4.cjs.entry.js +2 -2
- package/dist/cjs/{crmbonus.service-337e91cb.js → crmbonus.service-efc6a7d8.js} +2 -2
- package/dist/cjs/{crmbonus.service-337e91cb.js.map → crmbonus.service-efc6a7d8.js.map} +1 -1
- package/dist/cjs/pedido-finalizado.cjs.entry.js +2 -2
- package/dist/components/crm-bonus-form.js +1 -1
- package/dist/components/crm-bonus-note.js +2 -2
- package/dist/components/crm-bonus.js +4 -4
- package/dist/components/crm-giftback-form.js +1 -1
- package/dist/components/giftback-info.js +1 -1
- package/dist/components/{p-f23f1575.js → p-386f8c4f.js} +2 -2
- package/dist/components/{p-f23f1575.js.map → p-386f8c4f.js.map} +1 -1
- package/dist/components/{p-1c7d45e0.js → p-5494dc1e.js} +3 -3
- package/dist/components/{p-1c7d45e0.js.map → p-5494dc1e.js.map} +1 -1
- package/dist/components/{p-7b8889e8.js → p-e145ac20.js} +2 -2
- package/dist/components/{p-7b8889e8.js.map → p-e145ac20.js.map} +1 -1
- package/dist/components/{p-97642fd8.js → p-f6b194db.js} +4 -4
- package/dist/components/{p-97642fd8.js.map → p-f6b194db.js.map} +1 -1
- package/dist/components/pedido-finalizado.js +2 -2
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +1 -1
- package/dist/crmbonus-component-wake/{p-d2546868.entry.js → p-0d22f391.entry.js} +2 -2
- package/dist/crmbonus-component-wake/{p-f23f1575.js → p-386f8c4f.js} +2 -2
- package/dist/crmbonus-component-wake/{p-f23f1575.js.map → p-386f8c4f.js.map} +1 -1
- package/dist/crmbonus-component-wake/{p-c5017832.entry.js → p-3d589a57.entry.js} +2 -2
- package/dist/crmbonus-component-wake/{p-b6fa4e5c.entry.js → p-71e2578d.entry.js} +2 -2
- package/dist/crmbonus-component-wake/{p-457e385c.entry.js → p-7e713a3b.entry.js} +2 -2
- package/dist/crmbonus-component-wake/{p-1d2d9b07.entry.js → p-82f4dcf6.entry.js} +2 -2
- package/dist/crmbonus-component-wake/{p-ed047d5e.entry.js → p-914b0ecb.entry.js} +2 -2
- package/dist/crmbonus-component-wake/{p-7b8889e8.js → p-e145ac20.js} +2 -2
- package/dist/env.js +1 -1
- package/dist/env.js.map +1 -1
- package/dist/esm/{cart.helper-90765bc3.js → cart.helper-3f504c32.js} +2 -2
- package/dist/esm/{cart.helper-90765bc3.js.map → cart.helper-3f504c32.js.map} +1 -1
- package/dist/esm/crm-bonus-form.entry.js +1 -1
- package/dist/esm/crm-bonus-note.entry.js +2 -2
- package/dist/esm/crm-bonus.entry.js +2 -2
- package/dist/esm/crm-giftback-form.entry.js +2 -2
- package/dist/esm/crm-tooltip_4.entry.js +2 -2
- package/dist/esm/{crmbonus.service-8dfd1f2b.js → crmbonus.service-965dbc4c.js} +2 -2
- package/dist/esm/{crmbonus.service-8dfd1f2b.js.map → crmbonus.service-965dbc4c.js.map} +1 -1
- package/dist/esm/pedido-finalizado.entry.js +2 -2
- package/dist/types/Users/Darlison/Projects/Bycoders/crmbonus/crmbonus-component/.stencil/env.d.ts +1 -1
- package/package.json +1 -1
- /package/dist/crmbonus-component-wake/{p-d2546868.entry.js.map → p-0d22f391.entry.js.map} +0 -0
- /package/dist/crmbonus-component-wake/{p-c5017832.entry.js.map → p-3d589a57.entry.js.map} +0 -0
- /package/dist/crmbonus-component-wake/{p-b6fa4e5c.entry.js.map → p-71e2578d.entry.js.map} +0 -0
- /package/dist/crmbonus-component-wake/{p-457e385c.entry.js.map → p-7e713a3b.entry.js.map} +0 -0
- /package/dist/crmbonus-component-wake/{p-1d2d9b07.entry.js.map → p-82f4dcf6.entry.js.map} +0 -0
- /package/dist/crmbonus-component-wake/{p-ed047d5e.entry.js.map → p-914b0ecb.entry.js.map} +0 -0
- /package/dist/crmbonus-component-wake/{p-7b8889e8.js.map → p-e145ac20.js.map} +0 -0
@@ -1,2 +1,2 @@
|
|
1
|
-
import{r as t,h as s}from"./p-8c362346.js";import{C as i,U as o}from"./p-
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
import{r as t,h as s}from"./p-8c362346.js";import{C as i,U as o}from"./p-386f8c4f.js";import{d as e,S as a}from"./p-ecc51430.js";import{i as n}from"./p-c53241bf.js";import{b as r}from"./p-a3f4244f.js";import{g as c,a as h,C as l}from"./p-e145ac20.js";const d=".container-button{cursor:pointer;padding:5px 5px 5px 14px;}.section-crm{border:1px solid #dbd4d4;text-align:-webkit-center;margin-bottom:20px}.section-cart-crm{margin-top:10px}.section-cart-crm p{padding:0;margin:0px 0px 0px 15px}.button{top:50%;background-color:#6c6c7e;color:#fff;border:none;padding:15px;min-height:30px;min-width:120px;cursor:pointer;margin-left:10px;height:70px}.form-container{width:97%;display:flex;justify-content:space-around}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:0px}.form-container .btnCrm{background:#00162e;border-color:#00162e;width:30%;color:#fff}.message-alert{color:#df4d4d;margin-top:5px}";const u=d;const f=class{constructor(s){t(this,s);this.crmBonusService=i.getInstance();this.cart=undefined;this.canhidden=false;this.showModal=false;this.cartWake=undefined;this.customer={birthDate:"",document:"",name:"",phone:""};this.loading=false;this.message=undefined;this.phone=undefined;this.canCancel=false;this.amountCancel=undefined;this.sent=undefined;this.session=undefined;this.loading_reprocess=false;this.styles=e;this.reservedInfo=undefined}async resetBonus(){console.log("[START RESET BONUS]!!!!!");try{await this.crmBonusRef.processBonus(this.buildProducts(),true);console.log("[BONUS RESETADO]!!!!!")}catch(t){this.loading=false;console.log("[error ao reprocessar bonous]");await this.crmBonusRef.setStep(a.STEP_PHONE)}finally{this.loading=false}}async setloading(){this.loading_reprocess=!this.loading_reprocess}async reprocess(){console.log("[CRMBONUS] - reprocess");this.loading_reprocess=true;try{const t=localStorage.getItem(o);if(!t)return;this.cartWake=await c();await this.resetBonus()}catch(t){console.debug("[watchProducts]",t.message)}finally{this.loading_reprocess=false}}async componentWillLoad(){window.addEventListener("productRemovedFromCart",(async()=>{console.log("[CRMBONUS] - productRemovedFromCart");await this.reprocess()}));window.addEventListener("productAddedToCart",(async()=>{console.log("[CRMBONUS] - productAddedToCart");await this.reprocess()}));document.querySelectorAll("form").forEach((t=>{t.addEventListener("submit",(()=>{console.log("[CRMBONUS] - Formulário está sendo submetido!");setTimeout((async()=>{await this.reprocess()}))}))}));await this.observerHandle();n.changeLanguage(n.language);await this.loadSession();this.handleLoad();await this.loadConfigStore()}async observerHandle(){const t=document.getElementsByTagName("a");for(let s of t){console.log("[el.href]",s.href);if(s.href.includes("Produto/Delete")){s.addEventListener("click",(async()=>{console.log("[CRMBONUS] - Produto removido do carrinho");setTimeout((async()=>{await this.reprocess();this.observerHandle()}),2e3)}))}if(s.href.includes("Produto/Add")){s.addEventListener("click",(async()=>{console.log("[CRMBONUS] - Produto adicionado ao carrinho");setTimeout((async()=>{await this.reprocess();this.observerHandle()}),2e3)}))}}}async loadConfigStore(){const[t,s]=await Promise.all([this.crmBonusService.getCustomization(this.cartWake.store.name),h(this.cartWake.id,this.cartWake.store.name)]);console.log("[infoBonus]",s);this.reservedInfo=s;if(t.keepStoreFrontStyle){console.log("[bc:usar estilo da loja]");this.styles=null}}async fetchCustomer(t,s){try{return await this.crmBonusService.getCustomer(t,s)}catch(t){console.error("[fetchCustomer] Error fetching customer:",t);return null}}async handleLoad(){try{if(this.cartWake.user.id){this.fetchCustomer(this.cartWake.user.id,this.cartWake.store.name).then((t=>{console.log("[bc:loading customer]");if(t){this.customer=t;console.log("customer",this.customer)}}))}const t=localStorage.getItem(this.cartWake.id);if(t){this.canCancel=true;this.amountCancel=t}await this.buildAndGetProducts(this.cartWake.products)}catch(t){console.log("info customer")}}async loadSession(){this.cartWake=this.cart?new l(JSON.parse(this.cart)):await c();console.log("[bc:carregou carrinho]");this.session=await this.crmBonusService.getToken(this.cartWake.store.name);console.log("[bc:carregou session]");setTimeout((()=>{this.loadSession()}),15e5)}async buildAndGetProducts(t){const s=`bc-products:${this.cartWake.id}`;const i=JSON.stringify(t);localStorage.setItem(s,i);const o=JSON.parse(localStorage.getItem(s));const e=[];for(const s of t){const[t]=o.filter((t=>t.ProdutoVarianteId==s.ProdutoVarianteId));const[i={Valor:0}]=t.Ajustes.filter((t=>t.Tipo==="Formula"));if(t){e.push(Object.assign(Object.assign({},s),{PrecoPor:t.PrecoPor+i.Valor*-1,Quantidade:t.Quantidade,Ajustes:t.Ajustes}))}else{e.push(s)}}this.cartWake.products=e}async sendPin(t){var s,i;this.loading=true;this.message="";try{const s=t.replace(/\D/g,"");this.phone=Number(s);this.sent=await this.crmBonusService.sendPin(this.phone,this.customer.name,this.cartWake.store.name);await this.crmBonusRef.setStep(a.STEP_PIN);this.showModal=true}catch(t){this.message=(i=(s=t===null||t===void 0?void 0:t.response)===null||s===void 0?void 0:s.data)===null||i===void 0?void 0:i.message}finally{this.loading=false}}async sendPinName(t){var s,i;this.loading=true;this.message="";try{this.customer.name=t;this.sent=await this.crmBonusService.sendPin(this.phone,this.customer.name,this.cartWake.store.name);await this.crmBonusRef.setStep(a.STEP_PIN);this.showModal=true}catch(t){this.message=(i=(s=t===null||t===void 0?void 0:t.response)===null||s===void 0?void 0:s.data)===null||i===void 0?void 0:i.message}finally{this.loading=false}}buildProducts(){return r(this.cartWake.products)}handleCloseModal(){this.showModal=false}save(t){localStorage.setItem(this.cartWake.id,t.toString());this.canCancel=true;this.amountCancel=t.toString()}async cancel(){this.message="";this.loading=true;try{await this.crmBonusService.cancel(this.cartWake.id);this.canCancel=false;localStorage.removeItem(this.cartWake.id)}catch(t){this.message="Não consegui cancelar o bônus, tente novamente!"}finally{this.loading=false}}async handleSendPin(t){this.message="";if(!t){this.message="Informe seu telefone";return}this.customer.phone=t;const s=t.replace(/\D/g,"");this.phone=Number(s);if(this.customer.name){return this.sendPin(t)}await this.crmBonusRef.setStep(a.STEP_NAME);this.showModal=true}render(){if(this.canhidden){return null}return s("loading-container",{loading:this.loading_reprocess},s("crm-giftback-form",{customStyles:this.styles,style:{position:"relative"},ref:t=>this.crmBonusRef=t,storeName:this.cartWake.store.name,products:this.buildProducts(),cartId:this.cartWake.id,customer:this.customer,loadProducts:()=>this.buildProducts(),loadAll:()=>this.handleLoad(),reservedInfo:this.reservedInfo}))}static get assetsDirs(){return["assets"]}};f.style=u;export{f as crm_bonus};
|
2
|
+
//# sourceMappingURL=p-3d589a57.entry.js.map
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{r as n,h as t}from"./p-8c362346.js";import{g as i}from"./p-1b441909.js";import{C as e,g as o}from"./p-
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
import{r as n,h as t}from"./p-8c362346.js";import{g as i}from"./p-1b441909.js";import{C as e,g as o}from"./p-386f8c4f.js";import{i as r}from"./p-c53241bf.js";import{C as s,g as a,a as c}from"./p-e145ac20.js";import{d as l}from"./p-ecc51430.js";import{b as d}from"./p-a3f4244f.js";const g="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPg0KPHN2ZyB3aWR0aD0iODAwcHgiIGhlaWdodD0iODAwcHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxjaXJjbGUgY3g9IjEyIiBjeT0iMTIiIHI9IjEwIiBzdHJva2U9IiMwMDAwMDAiIHN0cm9rZS13aWR0aD0iMiIvPg0KPHBhdGggZD0iTTE1IDkuOTQ3MjhDMTQuNSA5LjMgMTMuOCA4LjUgMTIgOC41QzEwLjIgOC41IDkgOS41MTM5MyA5IDkuOTQ3MjhDOSAxMC4zODA2IDkuMDY3ODYgMTAuOTI3NyAxMCAxMS41QzEwLjc1MjIgMTEuOTYxOCAxMi42Njg0IDEyLjA0MzkgMTMuNSAxMi41QzE0LjY3OSAxMy4xNDY3IDE0Ljg0OTcgMTMuODIwMiAxNC44NDk3IDE0LjA1MjJDMTQuODQ5NyAxNC42ODM3IDEzLjQxNzUgMTUuNDg1MiAxMiAxNS41QzEwLjUzNiAxNS41MTUzIDkuNSAxNC43IDkgMTQuMDUyMiIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPg0KPHBhdGggZD0iTTEyIDdWMTciIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPg0KPC9zdmc+";function h(){if(localStorage.getItem("bc:time-allow")){return}const n=localStorage.getItem("bc:time");if(!n){localStorage.setItem("bc:time","360");localStorage.setItem("bc:time-allow","true");return}}const u=".note-container {\r\n border: 1px solid #dddddd;\r\n padding: 0 15px 15px;\r\n margin: 0 0 26px 0px;\r\n display: flex;\r\n flex-direction: column;\r\n gap: 13px;\r\n\r\n\r\n & .description {\r\n display: flex;\r\n flex-direction: column;\r\n gap: 13px;\r\n }\r\n}\r\n\r\n.note-container hr {\r\n border: 1px solid #CCC;\r\n}\r\n\r\n.note-container .back-cart {\r\n display: flex;\r\n text-align: center;\r\n}\r\n\r\n.note-header {\r\n display: flex;\r\n align-items: baseline;\r\n justify-content: space-between;\r\n}\r\n\r\n.note-title {\r\n font-weight: 700;\r\n text-align: left;\r\n display: flex;\r\n gap: 6px;\r\n align-items: center;\r\n margin-top: 11px;\r\n color: #000;\r\n}\r\n\r\n.note-description {\r\n color: #6d6d5f;\r\n padding: 0;\r\n margin: 0 auto;\r\n}\r\n\r\n.back-cart {\r\n /* font-size: .9em; */\r\n color: #27272A;\r\n text-decoration: none;\r\n cursor: pointer;\r\n margin-top: 11px;\r\n}\r\n\r\n.note-description-2 {\r\n color: var(--crm-scheme-fg-main-inverse, #262626);\r\n /* font-size: var(--crm-font-size-body-lg, 16px); */\r\n font-style: normal;\r\n font-weight: var(--crm-font-weight-body-bold, 400);\r\n line-height: var(--crm-line-height-body-md, 20px);\r\n letter-spacing: var(--crm-letter-spacing-title-md, 0px);\r\n margin-top: 11px;\r\n color: #000;\r\n}\r\n\r\n.note-description-not {\r\n /* font-size: 16px; */\r\n}";const f=u;const p=class{constructor(t){n(this,t);this.crmBonusService=e.getInstance();this.cart=undefined;this.cartWake=undefined;this.url=undefined;this.config=undefined;this.bonus=undefined;this.showEdit=false;this.styles=l;this.infoBonus=undefined;this.loading=false;this.info=undefined}async componentWillLoad(){console.log("[CRM-BONUS-NOTE]");await this.upadateCheckToFreteAndGetUrl()}async upadateCheckToFreteAndGetUrl(){var n,t,e;this.cartWake=this.cart?new s(JSON.parse(this.cart)):await a();const r=o(this.cartWake.id);try{const i=await c(this.cartWake.id,this.cartWake.store.name);if(i.bonusBalance){localStorage.setItem(this.cartWake.id,i.bonusBalance);localStorage.setItem(r,JSON.stringify({hasBonus:true}))}if(i.isBonusProcessed){this.startTime()}if((n=i===null||i===void 0?void 0:i.metadata)===null||n===void 0?void 0:n.url){this.url=(t=i===null||i===void 0?void 0:i.metadata)===null||t===void 0?void 0:t.url}this.infoBonus={storeId:i===null||i===void 0?void 0:i.metadata.storeId,userId:i===null||i===void 0?void 0:i.metadata.userId,cellphone:(e=i===null||i===void 0?void 0:i.metadata)===null||e===void 0?void 0:e.cellphone};console.log("info",i);this.info=i}catch(n){localStorage.removeItem(r);localStorage.removeItem(this.cartWake.id)}this.config=i(this.cartWake.store.name);if(this.config.keepStoreFrontStyle){this.styles=null}const l=document.getElementsByName("forma-envio");l.forEach((n=>{n.checked=false}))}async processBonus(){var n,t;this.loading=true;try{const i=await a();console.log("[cart-note]",i);const e=d(i.products);const o={pin:"2018",cellphone:this.infoBonus.cellphone,storeId:(n=this.infoBonus)===null||n===void 0?void 0:n.storeId.toString(),userId:(t=this.infoBonus)===null||t===void 0?void 0:t.userId.toString(),checkoutId:this.cartWake.id,checkoutProducts:e,name:"",storeName:this.cartWake.store.name};this.bonus=await this.crmBonusService.validatePinBonus(o)}catch(n){console.error("Error processing bonus:",n)}finally{this.loading=false;await this.upadateCheckToFreteAndGetUrl()}}handleHide(){const n=localStorage.getItem(this.cartWake.id);return!!n}getAmount(){const n=localStorage.getItem(this.cartWake.id);return n?Number(n).toFixed(2).replace(".",",")||"0,00":"0,00"}async backCart(){window.location.href=this.url}startTime(){if(!localStorage.getItem("bc:time-allow")){localStorage.removeItem("bc:time")}h()}hasBonus(){const n=localStorage.getItem(o(this.cartWake.id));const t={hasBonus:false,requestBonus:false};if(n){this.bonus=JSON.parse(n);t.hasBonus=this.bonus.hasBonus;t.requestBonus=true}return t}getTime(){const n=localStorage.getItem("bc:time");return n?Number(n):0}render(){var n;const i=((n=this.config)===null||n===void 0?void 0:n.giftbackTitle)||"Giftback";const e=this.hasBonus();return t("loading-container",{key:"cc092619bb7008cfcf80563874df142343240896",loading:this.loading},t("div",{key:"7800e28872e53d7414645df716ad13a35b096b36",class:"note-container",style:this.styles},t("div",{key:"9285ca60007aba8eeea73668347c8a89125d0191",class:"note-header"},t("p",{key:"8f1c46238952d4ff204b48098b03169bb89effad",class:"note-title"},t("img",{key:"129e92af76e2a8188a3f2388c02ccf17444fc387",src:g,width:23}),this.config.giftbackTitle),e.hasBonus&&t("div",{key:"cb2a47551f01b4d7ab565091c43d22cb151257c9"},this.showEdit&&t("p",{key:"140b10a5a7761b11bf5a0ac2435fe7669eb1715a",class:"back-cart",onClick:()=>this.backCart()},r.t("edit")))),e.hasBonus?t("p",{class:"note-description-2"},r.t("withApplyBonus",{giftbackname:i})," ",t("strong",null,"R$ ",this.getAmount(),".")):e.requestBonus?t("p",{class:"note-description-not"},r.t("noBonus",{giftbackname:i})):t("div",{class:"description"},t("p",{class:"note-description-not"},r.t("noBonus",{giftbackname:i})))))}};p.style=f;export{p as crm_bonus_note};
|
2
|
+
//# sourceMappingURL=p-71e2578d.entry.js.map
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{r as t,h as e,H as s}from"./p-8c362346.js";import{C as i}from"./p-
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
import{r as t,h as e,H as s}from"./p-8c362346.js";import{C as i}from"./p-386f8c4f.js";import{S as a}from"./p-ecc51430.js";const n=".form-container{width:100%;display:flex;justify-content:center;justify-content:space-around}.disabled{opacity:0.6;cursor:not-allowed}.message-error{color:#d11111;font-weight:bold;margin-left:16px}";const h=n;const d=class{constructor(e){t(this,e);this.crmBonusService=i.getInstance();this.storeName=undefined;this.cartId=undefined;this.products=undefined;this.customer={phone:"",birthDate:"",document:"",name:""};this.sent=undefined;this.stepNext=undefined;this.phone=undefined;this.loadingModal=undefined;this.saveStore=undefined;this.cancel=undefined;this.handleCustomerName=undefined;this.loading=false;this.step=a.STEP_NAME;this.message=undefined;this.bonus=undefined}async setStep(t){this.step=t}async validateBonus(t){var e,s;this.loading=true;this.message="";const i={pin:t,cellphone:parseInt(this.phone.toString()),storeId:this.sent.storeId.toString(),userId:this.sent.userId.toString(),checkoutId:this.cartId,checkoutProducts:this.products,name:null,storeName:this.storeName};try{this.bonus=await this.crmBonusService.validatePinBonus(i);this.step=a.STEP_RESERVE}catch(t){this.message=(s=(e=t===null||t===void 0?void 0:t.response)===null||e===void 0?void 0:e.data)===null||s===void 0?void 0:s.message}finally{this.loading=false}}async reserveApply(t){this.loading=true;this.message="";try{await this.reserve(t);this.step=a.STEP_APPLY;this.saveStore(t)}catch(t){this.message="ocorreu um error ao solicitar a aplicação do bonus! tente novamente"}finally{this.loading=false}}async reserve(t){await this.crmBonusService.reserve({redeemedBonus:t,cartId:this.cartId,ticket:this.cartId,grossValue:Number(this.bonus.totalValue),storeName:this.storeName,storeId:this.bonus.storeId.toString(),userId:this.bonus.userId})}handleCancel(){this.step=a.STEP_PHONE;this.cancel()}render(){return e(s,{key:"6cc4f52efdbcb77d480c9e85fcd0b0c10f0598a7"},this.step==a.STEP_NAME&&e("name-input",{key:"2c9bc7d4af5536f929b9a9a50caff90a43e19959",loading:this.loadingModal,value:this.customer.name,applyName:t=>this.handleCustomerName(t)}),this.step===a.STEP_PIN&&e("giftback-pin",{key:"e2fe1b7afba602d4a8106fb331c55cb82eafe82a",cancel:()=>this.handleCancel(),sent:this.sent,validate:t=>this.validateBonus(t),loading:this.loading}),this.step===a.STEP_RESERVE&&e("giftback-progress",{key:"7ff0c00d64909713715f735f1c803b093055badc",loading:this.loading,cancel:()=>this.handleCancel(),bonus:this.bonus,reserve:t=>this.reserveApply(t)}),this.step===a.STEP_APPLY&&e("giftback-finish",{key:"30458626eb3d32b0ab9fca3d1e09c72983560b0b"}),e("p",{key:"0fdd0de0a48433ba39ec07f5f8735e947231a178",class:"message-error"},this.message))}};d.style=h;export{d as crm_bonus_form};
|
2
|
+
//# sourceMappingURL=p-7e713a3b.entry.js.map
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{r as t,h as i}from"./p-8c362346.js";import{C as s,g as e,U as o}from"./p-
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
import{r as t,h as i}from"./p-8c362346.js";import{C as s,g as e,U as o}from"./p-386f8c4f.js";import{S as a}from"./p-ecc51430.js";import{g as n}from"./p-1b441909.js";import{i as h}from"./p-c53241bf.js";import{p as r}from"./p-e145ac20.js";const c="*{margin:0;padding:0;box-sizing:border-box}:host{--crmfont-sizebodymd:14px;--crmline-heightbodymd:20px;--crmletter-spacingtitle-md:0px}.container-message{font-weight:400;line-height:var(--crmline-heightbodymd);letter-spacing:var(--crmletter-spacingtitle-md);text-align:left;text-underline-position:from-font;text-decoration-skip-ink:none}.crm-container-form{display:flex;flex-direction:column;justify-content:space-around;height:auto;padding:20px 24px 20px 24px;border:1px solid #CCCC;writing-mode:horizontal-tb;gap:16px;border-top:1px solid #ccc !important;border-bottom:1px solid #ccc !important}.crm-phone-form{display:flex;flex-direction:column;height:100%;gap:16px}.crm-subtitle{font-size:.875rem;line-height:1.25rem}.crm-title{font-weight:700;line-height:20px;color:#262626;}.crm-message-info{color:#619013;font-weight:500;}.crm-message-error{color:#E11D48;font-weight:500;}";const l=c;const d=class{constructor(i){t(this,i);this.crmBonusService=s.getInstance();this.storeName=undefined;this.cartId=undefined;this.products=undefined;this.customer=undefined;this.loadProducts=undefined;this.loadAll=undefined;this.customStyles=undefined;this.reservedInfo=undefined;this.value=undefined;this.loading=false;this.message=undefined;this.phone=undefined;this.pinInfo=undefined;this.step=a.STEP_RESERVE;this.bonus=undefined;this.sucess="";this.error="";this.config=undefined;this.hasApplyBonus=false;this.loadingAllComponent=false}async setStep(t){this.step=t}async processBonus(t=[],i=false){await this.loadProducts();this.sucess="";console.log("processBonus",[]);if(i){this.products=t}const s=localStorage.getItem(e(this.cartId));if(s){const t=JSON.parse(s);this.bonus=t;this.phone=t.phone;this.pinInfo={storeId:t.storeId,userId:t.userId};await this.validateBonus("2018")}}async handleSendPin(t){await this.loadAll();this.message="";if(!t){this.message="Informe seu telefone";return}this.phone=t;this.sendPin()}async componentWillLoad(){this.sucess="";this.error="";this.config=n(this.storeName);const t=this.getPhoneNumberAgain();if(t){this.step=a.STEP_PHONE;return}await this.processBonus()}getPhoneNumberAgain(){const t=localStorage.getItem(e(this.cartId));if(!t)return true;const i=JSON.parse(t);return!i.hasBonus}convertStringToNumber(){var t;const i=(t=this.phone)===null||t===void 0?void 0:t.replace(/\D/g,"");return Number(i)}async sendPin(){var t,i,s;this.loading=true;this.message="";this.sucess="";this.error="";try{const i=this.convertStringToNumber();const s=localStorage.getItem(`bc:${this.phone}`);if(!s){this.pinInfo=await this.crmBonusService.sendPin(i,(t=this.customer)===null||t===void 0?void 0:t.name,this.storeName)}if(s){const t=JSON.parse(s);this.pinInfo={storeId:t.storeId,userId:t.userId};await this.validateBonus("2018")}else{this.step=a.STEP_PIN}}catch(t){this.message=(s=(i=t===null||t===void 0?void 0:t.response)===null||i===void 0?void 0:i.data)===null||s===void 0?void 0:s.message}finally{this.loading=false}}changePhone(){this.sucess="";this.error="";this.step=a.STEP_PHONE}async validateBonus(t){var i,s,n,h,r,c,l,d,f,u,m,p;this.loadingAllComponent=true;await this.loadProducts();const b=localStorage.getItem(o);if(b=="dontUse"){this.step=a.STEP_RESERVE;return}this.loading=true;this.sucess="";this.error="";const g=((i=this.pinInfo)===null||i===void 0?void 0:i.storeId)||((n=(s=this.reservedInfo)===null||s===void 0?void 0:s.metadata)===null||n===void 0?void 0:n.storeId);const v=((h=this.pinInfo)===null||h===void 0?void 0:h.userId)||((c=(r=this.reservedInfo)===null||r===void 0?void 0:r.metadata)===null||c===void 0?void 0:c.userId);const y=(d=(l=this.reservedInfo)===null||l===void 0?void 0:l.metadata)===null||d===void 0?void 0:d.cellphone;const S={pin:t,cellphone:y||this.convertStringToNumber(),storeId:g.toString(),userId:v.toString(),checkoutId:this.cartId,checkoutProducts:this.products,name:(f=this.customer)===null||f===void 0?void 0:f.name,storeName:this.storeName};try{this.bonus=await this.crmBonusService.validatePinBonus(S);if(!this.bonus.hasBonus){localStorage.setItem(e(this.cartId),JSON.stringify(Object.assign(Object.assign({},this.bonus),{phone:this.phone})));this.loading=false;this.step=a.STEP_NO_BONUS;return}this.sucess="Código validado com sucesso!";localStorage.setItem(e(this.cartId),JSON.stringify(Object.assign(Object.assign({},this.bonus),{phone:this.phone})));localStorage.setItem(`bc:${this.phone}`,JSON.stringify(this.bonus));localStorage.setItem(o,"use");localStorage.setItem(this.cartId,this.bonus.bonusBalance.toString());this.updateMetadata({storeId:Number(g),userId:Number(v)},S.cellphone);console.log("RESERVE",this.bonus);this.step=a.STEP_RESERVE}catch(t){const i=(m=(u=t===null||t===void 0?void 0:t.response)===null||u===void 0?void 0:u.data)===null||m===void 0?void 0:m.response;const s=(p=t===null||t===void 0?void 0:t.response)===null||p===void 0?void 0:p.data;if(i&&i.includes("Pin")){this.error="Código inválido!"}else if([403,500].includes(s.statusCode)){this.error="ocorreu um error, atualize a pagina e tente novamente!"}else{this.error=i;this.step=a.STEP_NO_BONUS}}finally{this.loading=false;this.loadingAllComponent=false}}async updateMetadata(t,i){try{if(this.reservedInfo.isExpired()){console.log("[CRM:updateMetadata]");await r(this.storeName,this.cartId,{createdAt:Date.now(),url:window.location.href,storeId:t.storeId,userId:t.userId,cellphone:i});localStorage.removeItem("bc:time")}else{await r(this.storeName,this.cartId,{url:window.location.href,storeId:t.storeId,userId:t.userId,cellphone:i})}}catch(t){console.error("[CRMBONUS:updateMetadata]: ",t)}}handleCancel(){this.cancel()}async cancel(){this.message="";this.loading=true;try{await this.crmBonusService.cancel(this.cartId);localStorage.setItem(o,"dontUse");this.save(0);await this.updateMetadata({storeId:null,userId:null},null)}catch(t){this.message="Não consegui cancelar o bônus, tente novamente!"}finally{this.loading=false}}async reserveApply(t){this.loading=true;this.message="";try{await this.reserve(t);this.save(t)}catch(t){this.message="ocorreu um error ao solicitar a aplicação do bonus! tente novamente";this.step=a.STEP_NO_BONUS;localStorage.removeItem(this.cartId)}finally{this.loading=false}}save(t){localStorage.setItem(this.cartId,t.toString())}async reserve(t){await this.crmBonusService.reserve({redeemedBonus:t,cartId:this.cartId,ticket:this.cartId,grossValue:Number(this.bonus.totalValue),storeName:this.storeName,storeId:this.bonus.storeId.toString(),userId:this.bonus.userId})}render(){console.log("cartId",this.cartId);return i("div",{key:"e012c67ed92ba775e8696e35e4f1bec0c0375de4",class:"crm-container-form fbits-responsive-carrinho-desconto",style:this.customStyles},i("label",{key:"d7f551fc83ae9f83a388e18ba9a35bf57e3c1f94",class:"crm-title"},this.config.giftbackTitle),this.error&&i("label",{key:"fe377fc09b5b64ce6283e64a80c3f11f7efb9d24",class:"crm-message-error"},this.error),this.step===a.STEP_PHONE&&i("phone-form",{key:"dd7a29d00056cf4b6b732633395e696163bfc354",value:this.customer.phone,config:this.config,loading:this.loading,handlerSubmit:t=>this.handleSendPin(t)}),this.step===a.STEP_PIN&&i("pin-form",{key:"52b0ca1ab73831ed10e3aa6ed39f5f7c9a65e6cb",config:this.config,phone:this.phone,cancel:()=>this.changePhone(),resend:()=>this.sendPin(),validate:t=>this.validateBonus(t),loading:this.loading},this.sucess&&i("p",{key:"520a508cc10894bce1bb90830f10f9b86ee9b3f8",class:"crm-message-info"},this.sucess),this.error&&i("p",{key:"83b8d19d4b0e0579a23fa4e8438173d0c308a926",class:"crm-message-error"},this.error)),this.step===a.STEP_RESERVE&&i("giftback-info",{key:"93cf5b7d21bc8eaf2b8699682245e36c8a2c023d",storeName:this.storeName,infoBonus:this.reservedInfo,config:this.config,loading:this.loading,cancel:()=>this.handleCancel(),bonus:this.bonus,reserve:()=>this.processBonus(),cartId:this.cartId}),this.step===a.STEP_NO_BONUS&&i("div",{key:"8c6a1eb19b6952e3222cbb718ee58a55430cfb3e",class:"container-message"},h.t("noGiftback",{storename:this.config.giftbackTitle})))}};d.style=l;export{d as crm_giftback_form};
|
2
|
+
//# sourceMappingURL=p-82f4dcf6.entry.js.map
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{r as e,h as i,H as t}from"./p-8c362346.js";import{i as n}from"./p-c53241bf.js";import{U as o}from"./p-f23f1575.js";import{d as a,a as r}from"./p-af3ba015.js";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IgMi43NUM2Ljg5MTM3IDIuNzUgMi43NSA2Ljg5MTM3IDIuNzUgMTJDMi43NSAxNy4xMDg2IDYuODkxMzcgMjEuMjUgMTIgMjEuMjVDMTcuMTA4NiAyMS4yNSAyMS4yNSAxNy4xMDg2IDIxLjI1IDEyQzIxLjI1IDYuODkxMzcgMTcuMTA4NiAyLjc1IDEyIDIuNzVaIiBmaWxsPSIjMUMyNzRDIi8+DQo8L3N2Zz4=";const s=".crm-tooltip-container {\r\n display: flex;\r\n\r\n & img {\r\n width: 16px;\r\n margin-left: 3px;\r\n position: relative;\r\n }\r\n}\r\n\r\n.crm-tooltip {\r\n position: relative;\r\n display: inline-block;\r\n}\r\n\r\n.crm-tooltip .tooltiptext {\r\n visibility: hidden;\r\n background-color: black;\r\n color: #fff;\r\n text-align: center;\r\n padding: 8px 12px;\r\n border-radius: 0px;\r\n position: absolute;\r\n z-index: 1;\r\n min-width: 271px;\r\n top: 100%;\r\n left: 50%;\r\n margin-left: -238px;\r\n}\r\n\r\n@container (max-width: 410px) {\r\n .crm-tooltip .tooltiptext {\r\n margin-left: -14px;\r\n }\r\n\r\n .crm-tooltip #crm-role-description {\r\n margin-left: -151px;\r\n }\r\n}\r\n\r\n@container (max-width: 250px) {\r\n .crm-tooltip .tooltiptext {\r\n margin-left: -201px;\r\n }\r\n}\r\n\r\n.crm-tooltip:hover .tooltiptext {\r\n visibility: visible;\r\n}";const l=s;const p=class{constructor(i){e(this,i);this.text=undefined;this.identity=undefined}render(){return i("div",{key:"57ada567e839524a1a1d484222b7057e13e2e8a1",class:"crm-tooltip-container crm-tooltip"},i("img",{key:"4816590e500d56f93ccfb9d7c6ec500122ce7998",src:d}),i("span",{key:"6ae622e84c25303571898eb37f8beb4172bead99",id:this.identity,class:"tooltiptext"},this.text))}};p.style=l;const h=":host{--text-color:#6D6D5F}.giftback-container{display:flex;flex-direction:column;gap:14px}h3{margin-bottom:8px;color:#333}.container-description{display:flex;align-items:center;gap:5px;margin:0 0 10px 0}.container-description p{font-weight:400;margin:0px}p{color:#000}.value-display h2{color:#6D6D5F;margin:16px 0}input[type='range']{width:100%;margin:12px 0;-webkit-appearance:none;background:#ddd;height:4px;border-radius:4px;outline:none;padding:3px 0px 3px 3px}input[type=\"range\"]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:20px;height:20px;background:rgb(109, 109, 95);border-radius:50%;cursor:pointer}.options{margin:0px 0;display:flex;gap:10px;flex-direction:column}.options label{display:flex;margin:0px 0;color:#333;align-items:center}.options input[type='radio']{margin-right:8px;height:16px;width:16px}.options input[type='radio']{appearance:none;-webkit-appearance:none;margin-right:8px;width:16px;height:16px;border:2px solid #ddd;border-radius:50%;background-color:#fff;cursor:pointer;transition:all 0.3s;padding:0px}.options input[type='radio']:checked{border-color:#000;background-color:#FAFAFA;border:4px solid #000}.info-box{background-color:#f9f9f9;border:1px solid #e0e0e0;border-radius:4px;padding:8px;color:#262626;line-height:20px}.info-icon{cursor:pointer;color:#888}h3{margin-bottom:8px;color:#333}.slider-wrapper{position:relative;margin:21px 0px 0px 0px}.slider{width:100%;-webkit-appearance:none;background:#ddd;height:4px;border-radius:2px;outline:none}.slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:16px;height:16px;background:var(--text-color);border-radius:50%;cursor:pointer}.slider-value{position:absolute;top:-30px;font-weight:700;color:var(--text-color);transform:translateX(-50%);white-space:nowrap;}.options-option{display:flex}";const b=h;const f=class{constructor(i){e(this,i);this.usedValue=0;this.selectedOption="none";this.cartId=undefined;this.loading=false;this.bonus={totalBonus:0,cartId:"",minimumPurchase:0,bonusBalance:0,calculatedValue:0,firstValidityDate:"",totalValue:0};this.reserve=undefined;this.cancel=undefined;this.config=undefined;this.infoBonus=undefined;this.storeName=undefined;this.sliderPosition=0;this.sliderValuePosition=0;this.loadingTime=false}changedBonus(){this.updateBonus()}updateBonus(){this.usedValue=this.bonus.bonusBalance;this.buildPositionSlider(0,this.bonus.totalBonus)}componentWillLoad(){this.updateBonus();this.selectedOption=localStorage.getItem(o)}handleSliderChange(e){const i=e.target;this.usedValue=parseFloat(i.value);this.buildPositionSlider(parseFloat(i.min),parseFloat(i.max))}componentDidLoad(){var e;if(this.bonus){this._refIinputRange.value=(e=this.bonus)===null||e===void 0?void 0:e.bonusBalance.toString()}}buildPositionSlider(e,i){const t=i*.1;const n=(this.usedValue-e)/(i-e)*100;this.sliderPosition=n;this.sliderValuePosition=n+(this.usedValue<=t?10:0)}async handleOptionChange(e){this.selectedOption=e;localStorage.setItem(o,e);await c(this.storeName,this.cartId,Object.assign(Object.assign({},this.infoBonus.metadata),{createdAt:null}));switch(this.selectedOption){case"use":await this.reserve(this.usedValue);break;case"dontUse":await this.cancel();break}}showTime(){if(!this.infoBonus)return false;return!this.infoBonus.isExpired()}getTime(){var e,i;const t=new Date((i=(e=this.infoBonus)===null||e===void 0?void 0:e.metadata)===null||i===void 0?void 0:i.createdAt);const n=new Date(t);n.setMinutes(n.getMinutes()+6);return{createdAt:t,expiration:n}}async downtime(){await c(this.storeName,this.bonus.cartId,{createdAt:null})}render(){var e,t,o,c,d,s,l;console.log("this.bonus",this.bonus);const p=this.bonus.minimumPurchase-this.bonus.totalValue;const h=n.t("giftDescription",{amount:`${(t=(e=this.bonus)===null||e===void 0?void 0:e.totalBonus)===null||t===void 0?void 0:t.toFixed(2).replace(".",",")}`,custom_name:"Giftback"});const b=a(p);return i("div",{key:"4bcf846d00500653eea2e11d0926c7bb2f9862ee",class:"giftback-container"},i("div",{key:"75b1eb41e2fa9ecdb9f1fb5fe3214def7900395e",class:"container-description"},i("p",{key:"a839e4e5b909d92d34afe95dec6af7bbf07f7784",innerHTML:h}),i("crm-tooltip",{key:"f3a3532fb2d0c3c93e66c50440633806bec274f3",identity:"crm-role-description",text:n.t("labelUseGiftback",{minimumPurchase:this.bonus.minimumPurchase,expírationDate:r(this.bonus.firstValidityDate)})})),i("div",{key:"018e1958421a91978cbc334e1ebbd1c352d2bbcb",class:"slider-wrapper"},i("div",{key:"a58ea697eb799cc8e3f4c99cb65004d438438436",class:"slider-value",style:{left:`calc(${this.sliderValuePosition}% - 20px)`}},"R$ ",this.usedValue.toFixed(2).replace(".",",")),i("input",{key:"936a6089a5c1d3bb298ab6169a2e6c0e574f13ff",ref:e=>this._refIinputRange=e,id:"position_value_id",disabled:true,type:"range",min:"0",max:this.bonus.totalBonus,value:this.usedValue,class:"slider",step:"0.01",onInput:e=>this.handleSliderChange(e),style:{background:`linear-gradient(to right, #6D6D5F ${this.sliderPosition}%, #ddd ${this.sliderPosition}%)`}})),b.isComplete&&i("p",{key:"c733ef48f2053407cf475a40a31c2f512f992af5"},n.t("maxAmount")),!b.isComplete&&i("div",{key:"b23c04f456137bd5292ad6d0d15f867ef4e1937b",class:"container-description"},i("p",{key:"5403eec3e8cf43be02c8919afd970415f403436a"},"Adicione ",i("strong",{key:"63ced7e61548d9dff756d42718cc021cb1c6579e"},"R$ ",p<0?"0,00":p.toFixed(2).replace(".",","))," ao carrinho para atingir o valor máximo!"),i("crm-tooltip",{key:"0e50390c5a360ddd5fac57f3893c8eb868a59d2e",identity:"crm-max-description",text:n.t("labelamountPartial")})),i("div",{key:"8944a38e460336d365ee86d6b5432ff117259def",class:"options"},i("div",{key:"6b45b9405f12960a86c2bf8530c8faee6bb794c6",class:"options-option"},i("input",{key:"3784f03b368795b91ec851e88faf74ab0c7554e1",disabled:this.showTime(),type:"radio",name:"giftbackOption",value:"use",checked:this.selectedOption==="use",onChange:()=>this.handleOptionChange("use")}),i("p",{key:"6ae30cd09b4dcdeb585c4367b86f2acc87cc6351"},"Usar o meu ",(o=this.config)===null||o===void 0?void 0:o.giftbackTitle)),i("div",{key:"707b374efa9edade67eed23256c37b977ae0b25e",class:"options-option"},i("input",{key:"86e742c7a57ff8834ca6e55f0df86440f1dd4aeb",disabled:this.showTime(),type:"radio",name:"giftbackOption",value:"dontUse",checked:this.selectedOption==="dontUse",onChange:()=>this.handleOptionChange("dontUse")}),i("p",{key:"20c90534b653987dbbea48feb5eaa9c117a3ac63"},"Não usar o meu ",(c=this.config)===null||c===void 0?void 0:c.giftbackTitle))),this.showTime()&&i("div",{key:"48beb877bc0e65735e1502d5d8529309bb2bb0e3",class:"info-box"},"Após ",i("countdown-timer",{key:"e25188ba2355f191cb2388e4b1af18d06a98bef3",dataCriacao:new Date((s=(d=this.infoBonus)===null||d===void 0?void 0:d.metadata)===null||s===void 0?void 0:s.createdAt).toString(),downtime:()=>{window.location.reload()}}),", você poderá alterar sua escolha de usar ou não o Giftback."),!((l=this===null||this===void 0?void 0:this.infoBonus)===null||l===void 0?void 0:l.isBonusProcessed)&&i("div",{key:"c206125aac6e9f66087744bfc4aece6310f982cd",class:"info-box"},"O Giftback será aplicado na próxima etapa."))}static get watchers(){return{bonus:["changedBonus"]}}};f.style=b;const g="*{margin:0;padding:0;box-sizing:border-box}:host{--crmfont-sizebodymd:14px;--crmline-heightbodymd:20px;--crmletter-spacingtitle-md:0px}.container-message{font-weight:400;line-height:var(--crmline-heightbodymd);letter-spacing:var(--crmletter-spacingtitle-md);text-align:left;text-underline-position:from-font;text-decoration-skip-ink:none}.crm-container-form{display:flex;flex-direction:column;justify-content:space-around;height:auto;padding:20px 24px 20px 24px;border:1px solid #CCCC;writing-mode:horizontal-tb;gap:16px;border-top:1px solid #ccc !important;border-bottom:1px solid #ccc !important}.crm-phone-form{display:flex;flex-direction:column;height:100%;gap:16px}.crm-subtitle{font-size:.875rem;line-height:1.25rem}.crm-title{font-weight:700;line-height:20px;color:#262626;}.crm-message-info{color:#619013;font-weight:500;}.crm-message-error{color:#E11D48;font-weight:500;}";const u=g;const x=class{constructor(i){e(this,i);this.value=undefined;this.loading=undefined;this.handlerSubmit=undefined;this.config=undefined}async handlePhone(){const e=await this.phoneInputMask.getPhone();await this.handlerSubmit(e)}render(){var e;return i(t,{key:"5f92b6c62da3cdf6de3c302488d81876fa52de1d",class:"crm-phone-form"},i("p",{key:"d5ea282e1945c55fb7212e7842e34aeab526248e",class:"crm-subtitle"},"Digite o seu celular para verificar se há desconto disponível nessa compra:"),i("phone-input-mask",{key:"9584729c3396af7f3e70ef375174bfd33b9779d8",initialValue:this.value,ref:e=>this.phoneInputMask=e}),i("crm-button",{key:"7cea0bc45f4e7967b8a0404a51d960ebd00334b9",txtBtn:((e=this.config)===null||e===void 0?void 0:e.btnApplyBonusLabel)||"Avançar",loading:this.loading,handleClick:()=>this.handlePhone()}))}};x.style=u;const m=":host{display:block}.form-container-pin{display:flex;flex-direction:column;align-items:center}.pin-container{display:flex;justify-content:start;gap:10px}.pin-container input{width:100%;height:48px;text-align:center;border:1px solid #ccc;border-radius:5px}button{padding:10px 20px;background-color:#ddd;border:none;border-radius:5px;cursor:pointer}.success{color:green;margin-top:10px}.button{top:50%;background-color:#6c6c7e;color:#fff;border:none;border-radius:10px;padding:15px;min-height:30px;min-width:120px;cursor:pointer}.button-cancel{top:50%;background-color:#ffffff;color:#1e1c1c;border:1px solid gray;border-radius:10px;padding:10px;min-height:30px;min-width:120px;cursor:pointer}.crm-description{width:100%;display:flex;gap:9px;flex-wrap:wrap}.crm-description a{font-weight:bold;cursor:pointer;text-decoration:underline}.crm-description div{display:flex;gap:5px}";const y=m;const k="*{margin:0;padding:0;box-sizing:border-box}:host{--crmfont-sizebodymd:14px;--crmline-heightbodymd:20px;--crmletter-spacingtitle-md:0px}.container-message{font-weight:400;line-height:var(--crmline-heightbodymd);letter-spacing:var(--crmletter-spacingtitle-md);text-align:left;text-underline-position:from-font;text-decoration-skip-ink:none}.crm-container-form{display:flex;flex-direction:column;justify-content:space-around;height:auto;padding:20px 24px 20px 24px;border:1px solid #CCCC;writing-mode:horizontal-tb;gap:16px;border-top:1px solid #ccc !important;border-bottom:1px solid #ccc !important}.crm-phone-form{display:flex;flex-direction:column;height:100%;gap:16px}.crm-subtitle{font-size:.875rem;line-height:1.25rem}.crm-title{font-weight:700;line-height:20px;color:#262626;}.crm-message-info{color:#619013;font-weight:500;}.crm-message-error{color:#E11D48;font-weight:500;}";const M=k;const I=class{constructor(i){e(this,i);this.validate=undefined;this.cancel=undefined;this.resend=undefined;this.sent=undefined;this.loading=false;this.phone=undefined;this.config=undefined;this.pin=["","","",""];this.isVerified=false;this.canResend=false}componentWillLoad(){this.canResend=false}handleInput(e,i){const t=e.target;const n=t.value.slice(0,1);this.pin[i]=n;if(n&&i<this.pin.length-1){const e=t.nextElementSibling;e===null||e===void 0?void 0:e.focus()}this.pin=[...this.pin]}validatePin(){localStorage.removeItem("bc:resend");this.validate(this.pin.join(""))}verifyPin(){const e=this.pin.join("");if(e==="9999"){this.isVerified=true}}handleTimeout(){localStorage.removeItem("bc:resend");this.canResend=true}async handleResend(){await this.resend();this.canResend=false;this.pin=["","","",""];localStorage.removeItem("bc:resend")}buildTime(){const e=localStorage.getItem("bc:resend");if(e){return e}const i=new Date;i.setSeconds(i.getSeconds()+30);localStorage.setItem("bc:resend",i.toString());return i.toString()}render(){var e;return i("div",{key:"6a62eca90116a8f120ed997e8db8ede58f2f0521",class:"crm-phone-form"},i("label",{key:"163b391876b598e8a170196f3c53a77c38f67d91",class:"crm-subtitle"},n.t("pin-sutitle")," ",i("strong",{key:"3d0e5616b335c5c1a122b18ab54fd275f0eb1cbf"},"+55 ",this.phone)),i("div",{key:"09fb7e7f22c6e54d6e01e91398c14f94aa40606a",class:"pin-container"},this.pin.map(((e,t)=>i("input",{type:"text",maxLength:1,value:this.pin[t],onInput:e=>this.handleInput(e,t)})))),i("slot",{key:"4375d20d7d691e2e439dfe25a3df00aeb73a7d2a"}),i("p",{key:"53b3e46d111809d87436a7a593a91ea9aafd46d0",class:"crm-description"}," Não recebeu?",!this.canResend&&i("label",{key:"bc71ebe6c29f831123e12ba7dff408be93465101"}," Reenviar em",i("countdown-timer",{key:"d7e831b7deb76172c7064eee7ad1c407a5f492d7",minutos:0,segundos:30,dataCriacao:this.buildTime(),downtime:()=>this.handleTimeout()})," "),this.canResend&&i("div",{key:"33d6c68c2959820053bb670df0d3be40484be5d6"},i("a",{key:"28de82c465773793dd291ee92f3ed39a62ac3cb4",onClick:()=>this.handleResend()},"Reenviar"),i("a",{key:"0883846b1a87fc0a73233c92b4da7698d7df7fbd",onClick:()=>this.cancel()},"Trocar número"))),i("crm-button",{key:"8749dba1ff171c83830646007d7f5823a7c33c1f",txtBtn:((e=this.config)===null||e===void 0?void 0:e.btnApplyBonusLabel)||"Avançar",loading:this.loading,handleClick:()=>this.validatePin()}))}};I.style=y+M;export{p as crm_tooltip,f as giftback_info,x as phone_form,I as pin_form};
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
import{r as e,h as i,H as t}from"./p-8c362346.js";import{i as n}from"./p-c53241bf.js";import{U as o}from"./p-386f8c4f.js";import{d as a,a as r}from"./p-af3ba015.js";import{p as c}from"./p-e145ac20.js";const d="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPg0KPHN2ZyB3aWR0aD0iODAwcHgiIGhlaWdodD0iODAwcHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGQ9Ik0xMiAxNy43NUMxMi40MTQyIDE3Ljc1IDEyLjc1IDE3LjQxNDIgMTIuNzUgMTdWMTFDMTIuNzUgMTAuNTg1OCAxMi40MTQyIDEwLjI1IDEyIDEwLjI1QzExLjU4NTggMTAuMjUgMTEuMjUgMTAuNTg1OCAxMS4yNSAxMVYxN0MxMS4yNSAxNy40MTQyIDExLjU4NTggMTcuNzUgMTIgMTcuNzVaIiBmaWxsPSIjMUMyNzRDIi8+DQo8cGF0aCBkPSJNMTIgN0MxMi41NTIzIDcgMTMgNy40NDc3MiAxMyA4QzEzIDguNTUyMjggMTIuNTUyMyA5IDEyIDlDMTEuNDQ3NyA5IDExIDguNTUyMjggMTEgOEMxMSA3LjQ0NzcyIDExLjQ0NzcgNyAxMiA3WiIgZmlsbD0iIzFDMjc0QyIvPg0KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xLjI1IDEyQzEuMjUgNi4wNjI5NCA2LjA2Mjk0IDEuMjUgMTIgMS4yNUMxNy45MzcxIDEuMjUgMjIuNzUgNi4wNjI5NCAyMi43NSAxMkMyMi43NSAxNy45MzcxIDE3LjkzNzEgMjIuNzUgMTIgMjIuNzVDNi4wNjI5NCAyMi43NSAxLjI1IDE3LjkzNzEgMS4yNSAxMlpNMTIgMi43NUM2Ljg5MTM3IDIuNzUgMi43NSA2Ljg5MTM3IDIuNzUgMTJDMi43NSAxNy4xMDg2IDYuODkxMzcgMjEuMjUgMTIgMjEuMjVDMTcuMTA4NiAyMS4yNSAyMS4yNSAxNy4xMDg2IDIxLjI1IDEyQzIxLjI1IDYuODkxMzcgMTcuMTA4NiAyLjc1IDEyIDIuNzVaIiBmaWxsPSIjMUMyNzRDIi8+DQo8L3N2Zz4=";const s=".crm-tooltip-container {\r\n display: flex;\r\n\r\n & img {\r\n width: 16px;\r\n margin-left: 3px;\r\n position: relative;\r\n }\r\n}\r\n\r\n.crm-tooltip {\r\n position: relative;\r\n display: inline-block;\r\n}\r\n\r\n.crm-tooltip .tooltiptext {\r\n visibility: hidden;\r\n background-color: black;\r\n color: #fff;\r\n text-align: center;\r\n padding: 8px 12px;\r\n border-radius: 0px;\r\n position: absolute;\r\n z-index: 1;\r\n min-width: 271px;\r\n top: 100%;\r\n left: 50%;\r\n margin-left: -238px;\r\n}\r\n\r\n@container (max-width: 410px) {\r\n .crm-tooltip .tooltiptext {\r\n margin-left: -14px;\r\n }\r\n\r\n .crm-tooltip #crm-role-description {\r\n margin-left: -151px;\r\n }\r\n}\r\n\r\n@container (max-width: 250px) {\r\n .crm-tooltip .tooltiptext {\r\n margin-left: -201px;\r\n }\r\n}\r\n\r\n.crm-tooltip:hover .tooltiptext {\r\n visibility: visible;\r\n}";const l=s;const p=class{constructor(i){e(this,i);this.text=undefined;this.identity=undefined}render(){return i("div",{key:"57ada567e839524a1a1d484222b7057e13e2e8a1",class:"crm-tooltip-container crm-tooltip"},i("img",{key:"4816590e500d56f93ccfb9d7c6ec500122ce7998",src:d}),i("span",{key:"6ae622e84c25303571898eb37f8beb4172bead99",id:this.identity,class:"tooltiptext"},this.text))}};p.style=l;const h=":host{--text-color:#6D6D5F}.giftback-container{display:flex;flex-direction:column;gap:14px}h3{margin-bottom:8px;color:#333}.container-description{display:flex;align-items:center;gap:5px;margin:0 0 10px 0}.container-description p{font-weight:400;margin:0px}p{color:#000}.value-display h2{color:#6D6D5F;margin:16px 0}input[type='range']{width:100%;margin:12px 0;-webkit-appearance:none;background:#ddd;height:4px;border-radius:4px;outline:none;padding:3px 0px 3px 3px}input[type=\"range\"]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:20px;height:20px;background:rgb(109, 109, 95);border-radius:50%;cursor:pointer}.options{margin:0px 0;display:flex;gap:10px;flex-direction:column}.options label{display:flex;margin:0px 0;color:#333;align-items:center}.options input[type='radio']{margin-right:8px;height:16px;width:16px}.options input[type='radio']{appearance:none;-webkit-appearance:none;margin-right:8px;width:16px;height:16px;border:2px solid #ddd;border-radius:50%;background-color:#fff;cursor:pointer;transition:all 0.3s;padding:0px}.options input[type='radio']:checked{border-color:#000;background-color:#FAFAFA;border:4px solid #000}.info-box{background-color:#f9f9f9;border:1px solid #e0e0e0;border-radius:4px;padding:8px;color:#262626;line-height:20px}.info-icon{cursor:pointer;color:#888}h3{margin-bottom:8px;color:#333}.slider-wrapper{position:relative;margin:21px 0px 0px 0px}.slider{width:100%;-webkit-appearance:none;background:#ddd;height:4px;border-radius:2px;outline:none}.slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:16px;height:16px;background:var(--text-color);border-radius:50%;cursor:pointer}.slider-value{position:absolute;top:-30px;font-weight:700;color:var(--text-color);transform:translateX(-50%);white-space:nowrap;}.options-option{display:flex}";const b=h;const f=class{constructor(i){e(this,i);this.usedValue=0;this.selectedOption="none";this.cartId=undefined;this.loading=false;this.bonus={totalBonus:0,cartId:"",minimumPurchase:0,bonusBalance:0,calculatedValue:0,firstValidityDate:"",totalValue:0};this.reserve=undefined;this.cancel=undefined;this.config=undefined;this.infoBonus=undefined;this.storeName=undefined;this.sliderPosition=0;this.sliderValuePosition=0;this.loadingTime=false}changedBonus(){this.updateBonus()}updateBonus(){this.usedValue=this.bonus.bonusBalance;this.buildPositionSlider(0,this.bonus.totalBonus)}componentWillLoad(){this.updateBonus();this.selectedOption=localStorage.getItem(o)}handleSliderChange(e){const i=e.target;this.usedValue=parseFloat(i.value);this.buildPositionSlider(parseFloat(i.min),parseFloat(i.max))}componentDidLoad(){var e;if(this.bonus){this._refIinputRange.value=(e=this.bonus)===null||e===void 0?void 0:e.bonusBalance.toString()}}buildPositionSlider(e,i){const t=i*.1;const n=(this.usedValue-e)/(i-e)*100;this.sliderPosition=n;this.sliderValuePosition=n+(this.usedValue<=t?10:0)}async handleOptionChange(e){this.selectedOption=e;localStorage.setItem(o,e);await c(this.storeName,this.cartId,Object.assign(Object.assign({},this.infoBonus.metadata),{createdAt:null}));switch(this.selectedOption){case"use":await this.reserve(this.usedValue);break;case"dontUse":await this.cancel();break}}showTime(){if(!this.infoBonus)return false;return!this.infoBonus.isExpired()}getTime(){var e,i;const t=new Date((i=(e=this.infoBonus)===null||e===void 0?void 0:e.metadata)===null||i===void 0?void 0:i.createdAt);const n=new Date(t);n.setMinutes(n.getMinutes()+6);return{createdAt:t,expiration:n}}async downtime(){await c(this.storeName,this.bonus.cartId,{createdAt:null})}render(){var e,t,o,c,d,s,l;console.log("this.bonus",this.bonus);const p=this.bonus.minimumPurchase-this.bonus.totalValue;const h=n.t("giftDescription",{amount:`${(t=(e=this.bonus)===null||e===void 0?void 0:e.totalBonus)===null||t===void 0?void 0:t.toFixed(2).replace(".",",")}`,custom_name:"Giftback"});const b=a(p);return i("div",{key:"4bcf846d00500653eea2e11d0926c7bb2f9862ee",class:"giftback-container"},i("div",{key:"75b1eb41e2fa9ecdb9f1fb5fe3214def7900395e",class:"container-description"},i("p",{key:"a839e4e5b909d92d34afe95dec6af7bbf07f7784",innerHTML:h}),i("crm-tooltip",{key:"f3a3532fb2d0c3c93e66c50440633806bec274f3",identity:"crm-role-description",text:n.t("labelUseGiftback",{minimumPurchase:this.bonus.minimumPurchase,expírationDate:r(this.bonus.firstValidityDate)})})),i("div",{key:"018e1958421a91978cbc334e1ebbd1c352d2bbcb",class:"slider-wrapper"},i("div",{key:"a58ea697eb799cc8e3f4c99cb65004d438438436",class:"slider-value",style:{left:`calc(${this.sliderValuePosition}% - 20px)`}},"R$ ",this.usedValue.toFixed(2).replace(".",",")),i("input",{key:"936a6089a5c1d3bb298ab6169a2e6c0e574f13ff",ref:e=>this._refIinputRange=e,id:"position_value_id",disabled:true,type:"range",min:"0",max:this.bonus.totalBonus,value:this.usedValue,class:"slider",step:"0.01",onInput:e=>this.handleSliderChange(e),style:{background:`linear-gradient(to right, #6D6D5F ${this.sliderPosition}%, #ddd ${this.sliderPosition}%)`}})),b.isComplete&&i("p",{key:"c733ef48f2053407cf475a40a31c2f512f992af5"},n.t("maxAmount")),!b.isComplete&&i("div",{key:"b23c04f456137bd5292ad6d0d15f867ef4e1937b",class:"container-description"},i("p",{key:"5403eec3e8cf43be02c8919afd970415f403436a"},"Adicione ",i("strong",{key:"63ced7e61548d9dff756d42718cc021cb1c6579e"},"R$ ",p<0?"0,00":p.toFixed(2).replace(".",","))," ao carrinho para atingir o valor máximo!"),i("crm-tooltip",{key:"0e50390c5a360ddd5fac57f3893c8eb868a59d2e",identity:"crm-max-description",text:n.t("labelamountPartial")})),i("div",{key:"8944a38e460336d365ee86d6b5432ff117259def",class:"options"},i("div",{key:"6b45b9405f12960a86c2bf8530c8faee6bb794c6",class:"options-option"},i("input",{key:"3784f03b368795b91ec851e88faf74ab0c7554e1",disabled:this.showTime(),type:"radio",name:"giftbackOption",value:"use",checked:this.selectedOption==="use",onChange:()=>this.handleOptionChange("use")}),i("p",{key:"6ae30cd09b4dcdeb585c4367b86f2acc87cc6351"},"Usar o meu ",(o=this.config)===null||o===void 0?void 0:o.giftbackTitle)),i("div",{key:"707b374efa9edade67eed23256c37b977ae0b25e",class:"options-option"},i("input",{key:"86e742c7a57ff8834ca6e55f0df86440f1dd4aeb",disabled:this.showTime(),type:"radio",name:"giftbackOption",value:"dontUse",checked:this.selectedOption==="dontUse",onChange:()=>this.handleOptionChange("dontUse")}),i("p",{key:"20c90534b653987dbbea48feb5eaa9c117a3ac63"},"Não usar o meu ",(c=this.config)===null||c===void 0?void 0:c.giftbackTitle))),this.showTime()&&i("div",{key:"48beb877bc0e65735e1502d5d8529309bb2bb0e3",class:"info-box"},"Após ",i("countdown-timer",{key:"e25188ba2355f191cb2388e4b1af18d06a98bef3",dataCriacao:new Date((s=(d=this.infoBonus)===null||d===void 0?void 0:d.metadata)===null||s===void 0?void 0:s.createdAt).toString(),downtime:()=>{window.location.reload()}}),", você poderá alterar sua escolha de usar ou não o Giftback."),!((l=this===null||this===void 0?void 0:this.infoBonus)===null||l===void 0?void 0:l.isBonusProcessed)&&i("div",{key:"c206125aac6e9f66087744bfc4aece6310f982cd",class:"info-box"},"O Giftback será aplicado na próxima etapa."))}static get watchers(){return{bonus:["changedBonus"]}}};f.style=b;const g="*{margin:0;padding:0;box-sizing:border-box}:host{--crmfont-sizebodymd:14px;--crmline-heightbodymd:20px;--crmletter-spacingtitle-md:0px}.container-message{font-weight:400;line-height:var(--crmline-heightbodymd);letter-spacing:var(--crmletter-spacingtitle-md);text-align:left;text-underline-position:from-font;text-decoration-skip-ink:none}.crm-container-form{display:flex;flex-direction:column;justify-content:space-around;height:auto;padding:20px 24px 20px 24px;border:1px solid #CCCC;writing-mode:horizontal-tb;gap:16px;border-top:1px solid #ccc !important;border-bottom:1px solid #ccc !important}.crm-phone-form{display:flex;flex-direction:column;height:100%;gap:16px}.crm-subtitle{font-size:.875rem;line-height:1.25rem}.crm-title{font-weight:700;line-height:20px;color:#262626;}.crm-message-info{color:#619013;font-weight:500;}.crm-message-error{color:#E11D48;font-weight:500;}";const u=g;const x=class{constructor(i){e(this,i);this.value=undefined;this.loading=undefined;this.handlerSubmit=undefined;this.config=undefined}async handlePhone(){const e=await this.phoneInputMask.getPhone();await this.handlerSubmit(e)}render(){var e;return i(t,{key:"5f92b6c62da3cdf6de3c302488d81876fa52de1d",class:"crm-phone-form"},i("p",{key:"d5ea282e1945c55fb7212e7842e34aeab526248e",class:"crm-subtitle"},"Digite o seu celular para verificar se há desconto disponível nessa compra:"),i("phone-input-mask",{key:"9584729c3396af7f3e70ef375174bfd33b9779d8",initialValue:this.value,ref:e=>this.phoneInputMask=e}),i("crm-button",{key:"7cea0bc45f4e7967b8a0404a51d960ebd00334b9",txtBtn:((e=this.config)===null||e===void 0?void 0:e.btnApplyBonusLabel)||"Avançar",loading:this.loading,handleClick:()=>this.handlePhone()}))}};x.style=u;const m=":host{display:block}.form-container-pin{display:flex;flex-direction:column;align-items:center}.pin-container{display:flex;justify-content:start;gap:10px}.pin-container input{width:100%;height:48px;text-align:center;border:1px solid #ccc;border-radius:5px}button{padding:10px 20px;background-color:#ddd;border:none;border-radius:5px;cursor:pointer}.success{color:green;margin-top:10px}.button{top:50%;background-color:#6c6c7e;color:#fff;border:none;border-radius:10px;padding:15px;min-height:30px;min-width:120px;cursor:pointer}.button-cancel{top:50%;background-color:#ffffff;color:#1e1c1c;border:1px solid gray;border-radius:10px;padding:10px;min-height:30px;min-width:120px;cursor:pointer}.crm-description{width:100%;display:flex;gap:9px;flex-wrap:wrap}.crm-description a{font-weight:bold;cursor:pointer;text-decoration:underline}.crm-description div{display:flex;gap:5px}";const y=m;const k="*{margin:0;padding:0;box-sizing:border-box}:host{--crmfont-sizebodymd:14px;--crmline-heightbodymd:20px;--crmletter-spacingtitle-md:0px}.container-message{font-weight:400;line-height:var(--crmline-heightbodymd);letter-spacing:var(--crmletter-spacingtitle-md);text-align:left;text-underline-position:from-font;text-decoration-skip-ink:none}.crm-container-form{display:flex;flex-direction:column;justify-content:space-around;height:auto;padding:20px 24px 20px 24px;border:1px solid #CCCC;writing-mode:horizontal-tb;gap:16px;border-top:1px solid #ccc !important;border-bottom:1px solid #ccc !important}.crm-phone-form{display:flex;flex-direction:column;height:100%;gap:16px}.crm-subtitle{font-size:.875rem;line-height:1.25rem}.crm-title{font-weight:700;line-height:20px;color:#262626;}.crm-message-info{color:#619013;font-weight:500;}.crm-message-error{color:#E11D48;font-weight:500;}";const M=k;const I=class{constructor(i){e(this,i);this.validate=undefined;this.cancel=undefined;this.resend=undefined;this.sent=undefined;this.loading=false;this.phone=undefined;this.config=undefined;this.pin=["","","",""];this.isVerified=false;this.canResend=false}componentWillLoad(){this.canResend=false}handleInput(e,i){const t=e.target;const n=t.value.slice(0,1);this.pin[i]=n;if(n&&i<this.pin.length-1){const e=t.nextElementSibling;e===null||e===void 0?void 0:e.focus()}this.pin=[...this.pin]}validatePin(){localStorage.removeItem("bc:resend");this.validate(this.pin.join(""))}verifyPin(){const e=this.pin.join("");if(e==="9999"){this.isVerified=true}}handleTimeout(){localStorage.removeItem("bc:resend");this.canResend=true}async handleResend(){await this.resend();this.canResend=false;this.pin=["","","",""];localStorage.removeItem("bc:resend")}buildTime(){const e=localStorage.getItem("bc:resend");if(e){return e}const i=new Date;i.setSeconds(i.getSeconds()+30);localStorage.setItem("bc:resend",i.toString());return i.toString()}render(){var e;return i("div",{key:"6a62eca90116a8f120ed997e8db8ede58f2f0521",class:"crm-phone-form"},i("label",{key:"163b391876b598e8a170196f3c53a77c38f67d91",class:"crm-subtitle"},n.t("pin-sutitle")," ",i("strong",{key:"3d0e5616b335c5c1a122b18ab54fd275f0eb1cbf"},"+55 ",this.phone)),i("div",{key:"09fb7e7f22c6e54d6e01e91398c14f94aa40606a",class:"pin-container"},this.pin.map(((e,t)=>i("input",{type:"text",maxLength:1,value:this.pin[t],onInput:e=>this.handleInput(e,t)})))),i("slot",{key:"4375d20d7d691e2e439dfe25a3df00aeb73a7d2a"}),i("p",{key:"53b3e46d111809d87436a7a593a91ea9aafd46d0",class:"crm-description"}," Não recebeu?",!this.canResend&&i("label",{key:"bc71ebe6c29f831123e12ba7dff408be93465101"}," Reenviar em",i("countdown-timer",{key:"d7e831b7deb76172c7064eee7ad1c407a5f492d7",minutos:0,segundos:30,dataCriacao:this.buildTime(),downtime:()=>this.handleTimeout()})," "),this.canResend&&i("div",{key:"33d6c68c2959820053bb670df0d3be40484be5d6"},i("a",{key:"28de82c465773793dd291ee92f3ed39a62ac3cb4",onClick:()=>this.handleResend()},"Reenviar"),i("a",{key:"0883846b1a87fc0a73233c92b4da7698d7df7fbd",onClick:()=>this.cancel()},"Trocar número"))),i("crm-button",{key:"8749dba1ff171c83830646007d7f5823a7c33c1f",txtBtn:((e=this.config)===null||e===void 0?void 0:e.btnApplyBonusLabel)||"Avançar",loading:this.loading,handleClick:()=>this.validatePin()}))}};I.style=y+M;export{p as crm_tooltip,f as giftback_info,x as phone_form,I as pin_form};
|
2
|
+
//# sourceMappingURL=p-914b0ecb.entry.js.map
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{C as t,a as o}from"./p-
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
import{C as t,a as o}from"./p-386f8c4f.js";class s{constructor(t){var o;this.products=[];this.id=t.Metadados.id||t.Id;this.middlewareId=(o=t.Metadados)===null||o===void 0?void 0:o.id;this.orderId=t.PedidoId;this.buildUserInfo(t);this.buildStoreInfo(t);this.products=this.buildStoreCart(t.Produtos)}buildStoreCart(t=[]){const o=localStorage.getItem("bc:cart");if(!o){return this.saveStore(t)}const s=JSON.parse(o);if(t.length!==s.length){return this.saveStore(t)}for(const o of t){const[n]=s.filter((t=>t.ProdutoVarianteId==o.ProdutoVarianteId));if(n){return t}}return s}saveStore(t){localStorage.setItem("bc:cart",JSON.stringify(t));return t}buildUserInfo(t){this.user={id:t.Usuario?t.Usuario.Id:null}}buildStoreInfo(t){var o;this.store={name:(o=t.Loja)===null||o===void 0?void 0:o.Nome}}}class n{static of(t){const o=new n;o.bonusBalance=t.bonusBalance;o.bonusIds=t.bonusIds;o.calculatedValue=t.calculatedValue;o.cartId=t.cartId;o.metadata=t.metadata;o.orderId=t.orderId;o.status=t.status;o.totalDiscount=t.totalDiscount;o.totalValue=t.totalValue;o.isBonusProcessed=t.isBonusProcessed;return o}isExpired(){var t;const o=(t=this===null||this===void 0?void 0:this.metadata)===null||t===void 0?void 0:t.createdAt;if(!o)return true;const s=Date.now();const n=s-o;const r=n/(1e3*60);console.log("diffMinutes",r);return r>6}}const r=t.getInstance();const i=async()=>{const t=e();console.log("[URL STORE]: ",t);const o=await r.getInfoCart(t);return new s(o)};const c=async(t,o)=>{const s=await r.getInfoBonus(t,o);return n.of(s)};const a=async(t,o,s={})=>{console.log("[bc:salvando metadados]");await r.patchInfoBonus({storeName:t,cartId:o,metadata:s});console.log("[bc:salvo metadados]")};const e=()=>{const t=window.location.origin;if(t.includes("localhost")){return o}if(t.includes("checkout")){return t}if(t.includes("fbits")){return t}if(t.includes("www.")){return t.replace("www","checkout")}return`${window.location.protocol}//checkout.${window.location.host}`};export{s as C,c as a,i as g,a as p};
|
2
|
+
//# sourceMappingURL=p-e145ac20.js.map
|
package/dist/env.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
export const CRM_BONUS_API_URL = "https://crmbonus-
|
1
|
+
export const CRM_BONUS_API_URL = "https://crmbonus-hub-staging-0ff7e3bf68ac.herokuapp.com/api"; //"https://crmbonus-service-staging-d15ba5377115.herokuapp.com"; //"https://typically-workable-perch.ngrok-free.app"; // "http://localhost:3500";
|
2
2
|
export const CHECKOUT_CART_WAKE = "http://localhost:3001";
|
3
3
|
//# sourceMappingURL=env.js.map
|
package/dist/env.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"env.js","sourceRoot":"","sources":["../env.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,iBAAiB,GAAG,
|
1
|
+
{"version":3,"file":"env.js","sourceRoot":"","sources":["../env.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,iBAAiB,GAAG,6DAA6D,CAAA,CAAC,iJAAiJ;AAChP,MAAM,CAAC,MAAM,kBAAkB,GAAG,uBAAuB,CAAA","sourcesContent":["\r\nexport const CRM_BONUS_API_URL = \"https://crmbonus-hub-staging-0ff7e3bf68ac.herokuapp.com/api\" //\"https://crmbonus-service-staging-d15ba5377115.herokuapp.com\"; //\"https://typically-workable-perch.ngrok-free.app\"; // \"http://localhost:3500\";\r\nexport const CHECKOUT_CART_WAKE = \"http://localhost:3001\""]}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { C as CrmBonusService, a as CHECKOUT_CART_WAKE } from './crmbonus.service-
|
1
|
+
import { C as CrmBonusService, a as CHECKOUT_CART_WAKE } from './crmbonus.service-965dbc4c.js';
|
2
2
|
|
3
3
|
class CartWake {
|
4
4
|
constructor(cart) {
|
@@ -112,4 +112,4 @@ const buildUrlBase = () => {
|
|
112
112
|
|
113
113
|
export { CartWake as C, getInfoBonusByCartIdAndStoreName as a, getCart as g, persisteMetadata as p };
|
114
114
|
|
115
|
-
//# sourceMappingURL=cart.helper-
|
115
|
+
//# sourceMappingURL=cart.helper-3f504c32.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"cart.helper-
|
1
|
+
{"file":"cart.helper-3f504c32.js","mappings":";;MAEa,QAAQ;IAQjB,YAAY,IAAI;;QAJhB,aAAQ,GAAmB,EAAE,CAAC;QAK1B,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,IAAI,CAAC,EAAE,CAAC;QACvC,IAAI,CAAC,YAAY,GAAG,MAAA,IAAI,CAAC,SAAS,0CAAE,EAAE,CAAC;QACvC,IAAI,CA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M,CAAC,QAAQ,CAAC,QAAQ,cAAc,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;AAE3E,CAAC;;;;","names":[],"sources":["src/objectvalues/cart.wake.ts","src/dto/reserved-info.dto.ts","src/helpers/cart.helper.ts"],"sourcesContent":["import { IProductWake, IStore, IUser } from \"../dto/validate.pin.bonus\";\r\n\r\nexport class CartWake {\r\n id: string;\r\n middlewareId: string;\r\n orderId: number;\r\n products: IProductWake[] = [];\r\n user: IUser;\r\n store: IStore;\r\n\r\n constructor(cart) {\r\n this.id = cart.Metadados.id || cart.Id;\r\n this.middlewareId = cart.Metadados?.id;\r\n this.orderId = cart.PedidoId;\r\n this.buildUserInfo(cart);\r\n this.buildStoreInfo(cart);\r\n this.products = this.buildStoreCart( cart.Produtos);\r\n }\r\n\r\n private buildStoreCart(newProducts = []) {\r\n const cache = localStorage.getItem(\"bc:cart\");\r\n\r\n if(!cache) {\r\n return this.saveStore(newProducts)\r\n \r\n }\r\n \r\n const cacheProducts:IProductWake[] = JSON.parse(cache);\r\n\r\n if(newProducts.length !== cacheProducts.length) {\r\n return this.saveStore(newProducts);\r\n }\r\n\r\n for (const p of newProducts) {\r\n const [cp] = cacheProducts.filter(cpp => cpp.ProdutoVarianteId == p.ProdutoVarianteId);\r\n\r\n if(cp) {\r\n cp.Quantidade != p.Quantidade;\r\n\r\n return newProducts;\r\n }\r\n }\r\n\r\n return cacheProducts;\r\n\r\n }\r\n\r\n\r\n private saveStore(newProducts) {\r\n localStorage.setItem(\"bc:cart\", JSON.stringify(newProducts));\r\n\r\n return newProducts;\r\n }\r\n\r\n private buildUserInfo(cart) {\r\n this.user = {\r\n id: cart.Usuario ? cart.Usuario.Id : null\r\n }\r\n }\r\n\r\n private buildStoreInfo(cart) {\r\n this.store = {\r\n name: cart.Loja?.Nome\r\n }\r\n }\r\n}","export class ReservedInfoDTO {\r\n bonusBalance: string;\r\n bonusIds: string;\r\n calculatedValue: string;\r\n cartId: string;\r\n metadata: {\r\n url: string,\r\n createdAt: number;\r\n storeId?: string;\r\n userId?: string;\r\n cellphone?: number;\r\n }\r\n orderId: string;\r\n status: number;\r\n totalDiscount: string;\r\n totalValue: string;\r\n isBonusProcessed?: boolean;\r\n\r\n\r\n public static of(payload: any) {\r\n const info = new ReservedInfoDTO();\r\n info.bonusBalance = payload.bonusBalance;\r\n info.bonusIds = payload.bonusIds;\r\n info.calculatedValue = payload.calculatedValue;\r\n info.cartId = payload.cartId;\r\n info.metadata = payload.metadata;\r\n info.orderId = payload.orderId;\r\n info.status = payload.status;\r\n info.totalDiscount = payload.totalDiscount;\r\n info.totalValue = payload.totalValue;\r\n info.isBonusProcessed = payload.isBonusProcessed;\r\n return info;\r\n }\r\n\r\n public isExpired(): boolean {\r\n const createdAt = this?.metadata?.createdAt;\r\n if(!createdAt) return true; \r\n \r\n const current = Date.now();\r\n\r\n const diffms = current - createdAt;\r\n\r\n const diffMinutes = diffms / (1000 * 60);\r\n\r\n console.log('diffMinutes', diffMinutes);\r\n\r\n return diffMinutes > 6;\r\n\r\n }\r\n\r\n}","import { CHECKOUT_CART_WAKE } from \"../../env\";\r\nimport { CartWake } from \"../objectvalues/cart.wake\";\r\nimport { CrmBonusService } from \"../services/crmbonus.service\";\r\nimport { ReservedInfoDTO } from '../dto/reserved-info.dto'\r\n\r\nconst crmBonusService: CrmBonusService = CrmBonusService.getInstance();\r\n\r\nexport const getCart = async (): Promise<CartWake> => {\r\n const baseUrl = buildUrlBase(); // window.location.origin; //\"https://bycoders.fbits.store\" //window.location.origin;\r\n \r\n console.log('[URL STORE]: ', baseUrl)\r\n\r\n const cart = await crmBonusService.getInfoCart(baseUrl);\r\n\r\n return new CartWake(cart);\r\n}\r\n\r\nexport const getInfoBonusByCartIdAndStoreName = async (cartId, storeName) => {\r\n const info = await crmBonusService.getInfoBonus(cartId, storeName)\r\n\r\n return ReservedInfoDTO.of(info);\r\n}\r\n\r\nexport const persisteMetadata = async (storeName: string, cartId: string, metadata = {}) => {\r\n console.log('[bc:salvando metadados]');\r\n await crmBonusService.patchInfoBonus({\r\n storeName,\r\n cartId,\r\n metadata\r\n });\r\n console.log('[bc:salvo metadados]');\r\n}\r\n\r\nconst buildUrlBase = () => {\r\n\r\n const url = window.location.origin; //\"https://bycoders.checkout.fbits.store\" //\r\n\r\n if(url.includes('localhost')) {\r\n return CHECKOUT_CART_WAKE;\r\n }\r\n\r\n if(url.includes('checkout')) {\r\n return url;\r\n }\r\n\r\n if(url.includes('fbits')) {\r\n return url;\r\n }\r\n\r\n if(url.includes(\"www.\")) {\r\n return url.replace(\"www\", \"checkout\")\r\n }\r\n\r\n return `${window.location.protocol}//checkout.${window.location.host}`;\r\n\r\n}"],"version":3}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { r as registerInstance, h, H as Host } from './index-bdb70d5a.js';
|
2
|
-
import { C as CrmBonusService } from './crmbonus.service-
|
2
|
+
import { C as CrmBonusService } from './crmbonus.service-965dbc4c.js';
|
3
3
|
import { S as StepFormEnum } from './index-dc3ebdf0.js';
|
4
4
|
|
5
5
|
const crmBonusFormCss = ".form-container{width:100%;display:flex;justify-content:center;justify-content:space-around}.disabled{opacity:0.6;cursor:not-allowed}.message-error{color:#d11111;font-weight:bold;margin-left:16px}";
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { r as registerInstance, h } from './index-bdb70d5a.js';
|
2
2
|
import { g as getInfoCustomization } from './info.config.helper-7cad7a9c.js';
|
3
|
-
import { C as CrmBonusService, g as getKeyReserveByCartId } from './crmbonus.service-
|
3
|
+
import { C as CrmBonusService, g as getKeyReserveByCartId } from './crmbonus.service-965dbc4c.js';
|
4
4
|
import { i as instance } from './i18n-b9d8b0cc.js';
|
5
|
-
import { C as CartWake, g as getCart, a as getInfoBonusByCartIdAndStoreName } from './cart.helper-
|
5
|
+
import { C as CartWake, g as getCart, a as getInfoBonusByCartIdAndStoreName } from './cart.helper-3f504c32.js';
|
6
6
|
import { d as defaultStyles } from './index-dc3ebdf0.js';
|
7
7
|
import { b as buildProductsByWake } from './build.payload.helper-c425c0cc.js';
|
8
8
|
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { r as registerInstance, h } from './index-bdb70d5a.js';
|
2
|
-
import { C as CrmBonusService, U as USED_KEY } from './crmbonus.service-
|
2
|
+
import { C as CrmBonusService, U as USED_KEY } from './crmbonus.service-965dbc4c.js';
|
3
3
|
import { d as defaultStyles, S as StepFormEnum } from './index-dc3ebdf0.js';
|
4
4
|
import { i as instance } from './i18n-b9d8b0cc.js';
|
5
5
|
import { b as buildProductsByWake } from './build.payload.helper-c425c0cc.js';
|
6
|
-
import { g as getCart, a as getInfoBonusByCartIdAndStoreName, C as CartWake } from './cart.helper-
|
6
|
+
import { g as getCart, a as getInfoBonusByCartIdAndStoreName, C as CartWake } from './cart.helper-3f504c32.js';
|
7
7
|
|
8
8
|
const crmBonusCss = ".container-button{cursor:pointer;padding:5px 5px 5px 14px;}.section-crm{border:1px solid #dbd4d4;text-align:-webkit-center;margin-bottom:20px}.section-cart-crm{margin-top:10px}.section-cart-crm p{padding:0;margin:0px 0px 0px 15px}.button{top:50%;background-color:#6c6c7e;color:#fff;border:none;padding:15px;min-height:30px;min-width:120px;cursor:pointer;margin-left:10px;height:70px}.form-container{width:97%;display:flex;justify-content:space-around}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:0px}.form-container .btnCrm{background:#00162e;border-color:#00162e;width:30%;color:#fff}.message-alert{color:#df4d4d;margin-top:5px}";
|
9
9
|
const CrmBonusStyle0 = crmBonusCss;
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { r as registerInstance, h } from './index-bdb70d5a.js';
|
2
|
-
import { C as CrmBonusService, g as getKeyReserveByCartId, U as USED_KEY } from './crmbonus.service-
|
2
|
+
import { C as CrmBonusService, g as getKeyReserveByCartId, U as USED_KEY } from './crmbonus.service-965dbc4c.js';
|
3
3
|
import { S as StepFormEnum } from './index-dc3ebdf0.js';
|
4
4
|
import { g as getInfoCustomization } from './info.config.helper-7cad7a9c.js';
|
5
5
|
import { i as instance } from './i18n-b9d8b0cc.js';
|
6
|
-
import { p as persisteMetadata } from './cart.helper-
|
6
|
+
import { p as persisteMetadata } from './cart.helper-3f504c32.js';
|
7
7
|
|
8
8
|
const giftbackFormCss = "*{margin:0;padding:0;box-sizing:border-box}:host{--crmfont-sizebodymd:14px;--crmline-heightbodymd:20px;--crmletter-spacingtitle-md:0px}.container-message{font-weight:400;line-height:var(--crmline-heightbodymd);letter-spacing:var(--crmletter-spacingtitle-md);text-align:left;text-underline-position:from-font;text-decoration-skip-ink:none}.crm-container-form{display:flex;flex-direction:column;justify-content:space-around;height:auto;padding:20px 24px 20px 24px;border:1px solid #CCCC;writing-mode:horizontal-tb;gap:16px;border-top:1px solid #ccc !important;border-bottom:1px solid #ccc !important}.crm-phone-form{display:flex;flex-direction:column;height:100%;gap:16px}.crm-subtitle{font-size:.875rem;line-height:1.25rem}.crm-title{font-weight:700;line-height:20px;color:#262626;}.crm-message-info{color:#619013;font-weight:500;}.crm-message-error{color:#E11D48;font-weight:500;}";
|
9
9
|
const CrmGiftbackFormStyle0 = giftbackFormCss;
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { r as registerInstance, h, H as Host } from './index-bdb70d5a.js';
|
2
2
|
import { i as instance } from './i18n-b9d8b0cc.js';
|
3
|
-
import { U as USED_KEY } from './crmbonus.service-
|
3
|
+
import { U as USED_KEY } from './crmbonus.service-965dbc4c.js';
|
4
4
|
import { d as defineLimit, a as formatDateToBr } from './utils-dec6df66.js';
|
5
|
-
import { p as persisteMetadata } from './cart.helper-
|
5
|
+
import { p as persisteMetadata } from './cart.helper-3f504c32.js';
|
6
6
|
|
7
7
|
const infoCircleSvgrepoComSvg = 'data:image/svg+xml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2Ljg5MTM3IDIuNzUgMTJDMi43NSAxNy4xMDg2IDYuODkxMzcgMjEuMjUgMTIgMjEuMjVDMTcuMTA4NiAyMS4yNSAyMS4yNSAxNy4xMDg2IDIxLjI1IDEyQzIxLjI1IDYuODkxMzcgMTcuMTA4NiAyLjc1IDEyIDIuNzVaIiBmaWxsPSIjMUMyNzRDIi8+DQo8L3N2Zz4=';
|
8
8
|
|
@@ -3749,7 +3749,7 @@ axios.default = axios;
|
|
3749
3749
|
// this module should only have a default export
|
3750
3750
|
const axios$1 = axios;
|
3751
3751
|
|
3752
|
-
const CRM_BONUS_API_URL = "https://crmbonus-
|
3752
|
+
const CRM_BONUS_API_URL = "https://crmbonus-hub-staging-0ff7e3bf68ac.herokuapp.com/api"; //"https://crmbonus-service-staging-d15ba5377115.herokuapp.com"; //"https://typically-workable-perch.ngrok-free.app"; // "http://localhost:3500";
|
3753
3753
|
const CHECKOUT_CART_WAKE = "http://localhost:3001";
|
3754
3754
|
|
3755
3755
|
const getKeyReserveByCartId = (cartId) => {
|
@@ -3905,4 +3905,4 @@ CrmBonusService._instance = null;
|
|
3905
3905
|
|
3906
3906
|
export { CrmBonusService as C, USED_KEY as U, CHECKOUT_CART_WAKE as a, getKeyReserveByCartId as g };
|
3907
3907
|
|
3908
|
-
//# sourceMappingURL=crmbonus.service-
|
3908
|
+
//# sourceMappingURL=crmbonus.service-965dbc4c.js.map
|