crmbonus-component-wake 2.0.70 → 2.0.72

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.
Files changed (56) hide show
  1. package/dist/cjs/crm-bonus-form.cjs.entry.js +1 -1
  2. package/dist/cjs/crm-bonus-note.cjs.entry.js +5 -4
  3. package/dist/cjs/crm-bonus-note.cjs.entry.js.map +1 -1
  4. package/dist/cjs/crm-bonus.cjs.entry.js +3 -6
  5. package/dist/cjs/crm-bonus.cjs.entry.js.map +1 -1
  6. package/dist/cjs/crm-giftback-form.cjs.entry.js +1 -1
  7. package/dist/cjs/{crmbonus.service-bd457de6.js → crmbonus.service-ebe0b3c6.js} +1 -2
  8. package/dist/cjs/crmbonus.service-ebe0b3c6.js.map +1 -0
  9. package/dist/cjs/pedido-finalizado.cjs.entry.js +1 -1
  10. package/dist/collection/components/crm-bonus/crm-bonus.js +2 -5
  11. package/dist/collection/components/crm-bonus/crm-bonus.js.map +1 -1
  12. package/dist/collection/components/note/crm-bonus-note.js +5 -3
  13. package/dist/collection/components/note/crm-bonus-note.js.map +1 -1
  14. package/dist/collection/services/crmbonus.service.js +1 -2
  15. package/dist/collection/services/crmbonus.service.js.map +1 -1
  16. package/dist/components/crm-bonus-form.js +1 -1
  17. package/dist/components/crm-bonus-note.js +5 -4
  18. package/dist/components/crm-bonus-note.js.map +1 -1
  19. package/dist/components/crm-bonus.js +4 -7
  20. package/dist/components/crm-bonus.js.map +1 -1
  21. package/dist/components/crm-giftback-form.js +1 -1
  22. package/dist/components/{p-c9c64c39.js → p-a4fd3bc8.js} +2 -2
  23. package/dist/components/{p-c9c64c39.js.map → p-a4fd3bc8.js.map} +1 -1
  24. package/dist/components/{p-8655e19b.js → p-a7ddcab4.js} +1 -2
  25. package/dist/components/p-a7ddcab4.js.map +1 -0
  26. package/dist/components/pedido-finalizado.js +1 -1
  27. package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +1 -1
  28. package/dist/crmbonus-component-wake/{p-8465c068.entry.js → p-49b323ef.entry.js} +2 -2
  29. package/dist/crmbonus-component-wake/p-49b323ef.entry.js.map +1 -0
  30. package/dist/crmbonus-component-wake/p-64441d8f.entry.js +2 -0
  31. package/dist/crmbonus-component-wake/p-a465c900.entry.js +2 -0
  32. package/dist/crmbonus-component-wake/p-a465c900.entry.js.map +1 -0
  33. package/dist/crmbonus-component-wake/{p-8655e19b.js → p-a7ddcab4.js} +2 -2
  34. package/dist/crmbonus-component-wake/{p-8655e19b.js.map → p-a7ddcab4.js.map} +1 -1
  35. package/dist/crmbonus-component-wake/{p-4cbbddf4.entry.js → p-c04d7aac.entry.js} +2 -2
  36. package/dist/crmbonus-component-wake/{p-d44969be.entry.js → p-c121f6fc.entry.js} +2 -2
  37. package/dist/esm/crm-bonus-form.entry.js +1 -1
  38. package/dist/esm/crm-bonus-note.entry.js +5 -4
  39. package/dist/esm/crm-bonus-note.entry.js.map +1 -1
  40. package/dist/esm/crm-bonus.entry.js +3 -6
  41. package/dist/esm/crm-bonus.entry.js.map +1 -1
  42. package/dist/esm/crm-giftback-form.entry.js +1 -1
  43. package/dist/esm/{crmbonus.service-5a5e8f29.js → crmbonus.service-84f1cc25.js} +1 -2
  44. package/dist/esm/crmbonus.service-84f1cc25.js.map +1 -0
  45. package/dist/esm/pedido-finalizado.entry.js +1 -1
  46. package/package.json +1 -1
  47. package/dist/cjs/crmbonus.service-bd457de6.js.map +0 -1
  48. package/dist/components/p-8655e19b.js.map +0 -1
  49. package/dist/crmbonus-component-wake/p-3e01eee6.entry.js +0 -2
  50. package/dist/crmbonus-component-wake/p-8465c068.entry.js.map +0 -1
  51. package/dist/crmbonus-component-wake/p-9901d9e2.entry.js +0 -2
  52. package/dist/crmbonus-component-wake/p-9901d9e2.entry.js.map +0 -1
  53. package/dist/esm/crmbonus.service-5a5e8f29.js.map +0 -1
  54. /package/dist/crmbonus-component-wake/{p-3e01eee6.entry.js.map → p-64441d8f.entry.js.map} +0 -0
  55. /package/dist/crmbonus-component-wake/{p-4cbbddf4.entry.js.map → p-c04d7aac.entry.js.map} +0 -0
  56. /package/dist/crmbonus-component-wake/{p-d44969be.entry.js.map → p-c121f6fc.entry.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{r as t,h as i}from"./p-45c0296c.js";import{C as s,g as e}from"./p-8655e19b.js";import{S as o}from"./p-a561251a.js";import{g as n}from"./p-75ba7b9a.js";import{i as h}from"./p-fb505488.js";const a="*{margin:0;padding:0;box-sizing:border-box}:host{--crmfont-sizebodymd:14px;--crmline-heightbodymd:20px;--crmletter-spacingtitle-md:0px}.container-message{font-family:Roboto;font-size:var(--crmfont-sizebodymd);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:14px;color:var(--crm-btn)}.crm-title{font-weight:700;line-height:20px;color:#262626;font-size:16px}.crm-message-info{color:#619013;font-weight:500;font-size:12px}.crm-message-error{color:#E11D48;font-weight:500;font-size:12px}";const r=a;const c=class{constructor(i){t(this,i);this.crmBonusService=s.getInstance();this.storeName=undefined;this.cartId=undefined;this.products=undefined;this.customer=undefined;this.value=undefined;this.loading=false;this.message=undefined;this.phone=undefined;this.pinInfo=undefined;this.step=o.STEP_PHONE;this.bonus=undefined;this.sucess="";this.error="";this.config=undefined;this.hasApplyBonus=false}async setStep(t){this.step=t}async processBonus(){this.sucess="";const t=localStorage.getItem(e(this.cartId));if(t){const i=JSON.parse(t);this.phone=i.phone;this.pinInfo={storeId:i.storeId,userId:i.userId};await this.validateBonus("2018")}}async handleSendPin(t){this.message="";if(!t){this.message="Informe seu telefone";return}this.phone=t;this.sendPin()}componentWillLoad(){this.sucess="";this.error="";this.config=n(this.storeName);this.handleApply()}handleApply(){const t=localStorage.getItem(e(this.cartId));if(t){this.bonus=JSON.parse(t);this.step=o.STEP_RESERVE}}convertStringToNumber(){const t=this.phone.replace(/\D/g,"");return Number(t)}async sendPin(){var t,i;this.loading=true;this.message="";this.sucess="";this.error="";try{const t=this.convertStringToNumber();this.pinInfo=await this.crmBonusService.sendPin(t,"",this.storeName);this.step=o.STEP_PIN}catch(s){this.message=(i=(t=s===null||s===void 0?void 0:s.response)===null||t===void 0?void 0:t.data)===null||i===void 0?void 0:i.message}finally{this.loading=false}}changePhone(){this.sucess="";this.error="";this.step=o.STEP_PHONE}async validateBonus(t){var i,s;if(this.sucess){this.step=o.STEP_RESERVE;return}this.loading=true;this.sucess="";this.error="";const n={pin:t,cellphone:this.phone.toString(),storeId:this.pinInfo.storeId.toString(),userId:this.pinInfo.userId.toString(),checkoutId:this.cartId,checkoutProducts:this.products,name:null,storeName:this.storeName};try{this.bonus=await this.crmBonusService.validatePinBonus(n);if(!this.bonus.hasBonus){this.loading=false;this.step=o.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})))}catch(t){const e=(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;if(e.includes("Pin")){this.error="Código inválido!"}else{this.error=e;this.step=o.STEP_NO_BONUS}}finally{this.loading=false}}handleCancel(){this.cancel()}async cancel(){this.message="";this.loading=true;try{await this.crmBonusService.cancel(this.cartId);this.save(0)}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=o.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(){return i("div",{key:"50cb7f1d168127e5ef15ee728c5ab376c6b56eae",class:"crm-container-form fbits-responsive-carrinho-desconto"},i("label",{key:"ea97bf9b616826be4b861bdad61f5ff362a7eac4",class:"crm-title"},this.config.giftbackTitle),this.step===o.STEP_PHONE&&i("phone-form",{key:"25094c38c8d70305d55f10131ea2e84258faf627",value:this.customer.phone,config:this.config,loading:this.loading,handlerSubmit:t=>this.handleSendPin(t)}),this.step===o.STEP_PIN&&i("pin-form",{key:"1abbf4b064920586102eb983e44b937de5d71092",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:"6643e540d05642bdabc7a004b2165f8c401848e4",class:"crm-message-info"},this.sucess),this.error&&i("p",{key:"e38dd84f1eda48a8936753b185b56bfd5147e89f",class:"crm-message-error"},this.error)),this.step===o.STEP_RESERVE&&i("giftback-info",{key:"084007d5a1e9d16f3d30fd742278c62c4c013ce6",loading:this.loading,cancel:()=>this.handleCancel(),bonus:this.bonus,reserve:t=>this.reserveApply(t)}),this.step===o.STEP_NO_BONUS&&i("div",{key:"8d214593cd77985b2e2ccedd75c0feb29a73cf44",class:"container-message"},h.t("noGiftback",{storename:this.config.giftbackTitle})))}};c.style=r;export{c as crm_giftback_form};
2
- //# sourceMappingURL=p-4cbbddf4.entry.js.map
1
+ import{r as t,h as i}from"./p-45c0296c.js";import{C as s,g as e}from"./p-a7ddcab4.js";import{S as o}from"./p-a561251a.js";import{g as n}from"./p-75ba7b9a.js";import{i as h}from"./p-fb505488.js";const a="*{margin:0;padding:0;box-sizing:border-box}:host{--crmfont-sizebodymd:14px;--crmline-heightbodymd:20px;--crmletter-spacingtitle-md:0px}.container-message{font-family:Roboto;font-size:var(--crmfont-sizebodymd);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:14px;color:var(--crm-btn)}.crm-title{font-weight:700;line-height:20px;color:#262626;font-size:16px}.crm-message-info{color:#619013;font-weight:500;font-size:12px}.crm-message-error{color:#E11D48;font-weight:500;font-size:12px}";const r=a;const c=class{constructor(i){t(this,i);this.crmBonusService=s.getInstance();this.storeName=undefined;this.cartId=undefined;this.products=undefined;this.customer=undefined;this.value=undefined;this.loading=false;this.message=undefined;this.phone=undefined;this.pinInfo=undefined;this.step=o.STEP_PHONE;this.bonus=undefined;this.sucess="";this.error="";this.config=undefined;this.hasApplyBonus=false}async setStep(t){this.step=t}async processBonus(){this.sucess="";const t=localStorage.getItem(e(this.cartId));if(t){const i=JSON.parse(t);this.phone=i.phone;this.pinInfo={storeId:i.storeId,userId:i.userId};await this.validateBonus("2018")}}async handleSendPin(t){this.message="";if(!t){this.message="Informe seu telefone";return}this.phone=t;this.sendPin()}componentWillLoad(){this.sucess="";this.error="";this.config=n(this.storeName);this.handleApply()}handleApply(){const t=localStorage.getItem(e(this.cartId));if(t){this.bonus=JSON.parse(t);this.step=o.STEP_RESERVE}}convertStringToNumber(){const t=this.phone.replace(/\D/g,"");return Number(t)}async sendPin(){var t,i;this.loading=true;this.message="";this.sucess="";this.error="";try{const t=this.convertStringToNumber();this.pinInfo=await this.crmBonusService.sendPin(t,"",this.storeName);this.step=o.STEP_PIN}catch(s){this.message=(i=(t=s===null||s===void 0?void 0:s.response)===null||t===void 0?void 0:t.data)===null||i===void 0?void 0:i.message}finally{this.loading=false}}changePhone(){this.sucess="";this.error="";this.step=o.STEP_PHONE}async validateBonus(t){var i,s;if(this.sucess){this.step=o.STEP_RESERVE;return}this.loading=true;this.sucess="";this.error="";const n={pin:t,cellphone:this.phone.toString(),storeId:this.pinInfo.storeId.toString(),userId:this.pinInfo.userId.toString(),checkoutId:this.cartId,checkoutProducts:this.products,name:null,storeName:this.storeName};try{this.bonus=await this.crmBonusService.validatePinBonus(n);if(!this.bonus.hasBonus){this.loading=false;this.step=o.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})))}catch(t){const e=(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;if(e.includes("Pin")){this.error="Código inválido!"}else{this.error=e;this.step=o.STEP_NO_BONUS}}finally{this.loading=false}}handleCancel(){this.cancel()}async cancel(){this.message="";this.loading=true;try{await this.crmBonusService.cancel(this.cartId);this.save(0)}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=o.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(){return i("div",{key:"50cb7f1d168127e5ef15ee728c5ab376c6b56eae",class:"crm-container-form fbits-responsive-carrinho-desconto"},i("label",{key:"ea97bf9b616826be4b861bdad61f5ff362a7eac4",class:"crm-title"},this.config.giftbackTitle),this.step===o.STEP_PHONE&&i("phone-form",{key:"25094c38c8d70305d55f10131ea2e84258faf627",value:this.customer.phone,config:this.config,loading:this.loading,handlerSubmit:t=>this.handleSendPin(t)}),this.step===o.STEP_PIN&&i("pin-form",{key:"1abbf4b064920586102eb983e44b937de5d71092",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:"6643e540d05642bdabc7a004b2165f8c401848e4",class:"crm-message-info"},this.sucess),this.error&&i("p",{key:"e38dd84f1eda48a8936753b185b56bfd5147e89f",class:"crm-message-error"},this.error)),this.step===o.STEP_RESERVE&&i("giftback-info",{key:"084007d5a1e9d16f3d30fd742278c62c4c013ce6",loading:this.loading,cancel:()=>this.handleCancel(),bonus:this.bonus,reserve:t=>this.reserveApply(t)}),this.step===o.STEP_NO_BONUS&&i("div",{key:"8d214593cd77985b2e2ccedd75c0feb29a73cf44",class:"container-message"},h.t("noGiftback",{storename:this.config.giftbackTitle})))}};c.style=r;export{c as crm_giftback_form};
2
+ //# sourceMappingURL=p-c04d7aac.entry.js.map
@@ -1,2 +1,2 @@
1
- import{r as t,h as e,H as s}from"./p-45c0296c.js";import{C as i}from"./p-8655e19b.js";import{S as a}from"./p-a561251a.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;font-family:Arial;font-size:small;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: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:"56bef07243aafe1abb78fdfd38922801b84c269b"},this.step==a.STEP_NAME&&e("name-input",{key:"685df95ea0cd693f9a62893798464834524f5168",loading:this.loadingModal,value:this.customer.name,applyName:t=>this.handleCustomerName(t)}),this.step===a.STEP_PIN&&e("giftback-pin",{key:"af82b751ed04382498e25614276ac08d5cade07a",cancel:()=>this.handleCancel(),sent:this.sent,validate:t=>this.validateBonus(t),loading:this.loading}),this.step===a.STEP_RESERVE&&e("giftback-progress",{key:"1b493c06bf11bc7596d672fcec789a9f93573751",loading:this.loading,cancel:()=>this.handleCancel(),bonus:this.bonus,reserve:t=>this.reserveApply(t)}),this.step===a.STEP_APPLY&&e("giftback-finish",{key:"272438aa4dbc8bb1ef9fdb45d3c2cc657d41ef4a"}),e("p",{key:"a3a0e8a1be44d65b1edd34e28956d1b34b732fef",class:"message-error"},this.message))}};d.style=h;export{d as crm_bonus_form};
2
- //# sourceMappingURL=p-d44969be.entry.js.map
1
+ import{r as t,h as e,H as s}from"./p-45c0296c.js";import{C as i}from"./p-a7ddcab4.js";import{S as a}from"./p-a561251a.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;font-family:Arial;font-size:small;margin-left:16px}";const d=n;const h=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: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:"56bef07243aafe1abb78fdfd38922801b84c269b"},this.step==a.STEP_NAME&&e("name-input",{key:"685df95ea0cd693f9a62893798464834524f5168",loading:this.loadingModal,value:this.customer.name,applyName:t=>this.handleCustomerName(t)}),this.step===a.STEP_PIN&&e("giftback-pin",{key:"af82b751ed04382498e25614276ac08d5cade07a",cancel:()=>this.handleCancel(),sent:this.sent,validate:t=>this.validateBonus(t),loading:this.loading}),this.step===a.STEP_RESERVE&&e("giftback-progress",{key:"1b493c06bf11bc7596d672fcec789a9f93573751",loading:this.loading,cancel:()=>this.handleCancel(),bonus:this.bonus,reserve:t=>this.reserveApply(t)}),this.step===a.STEP_APPLY&&e("giftback-finish",{key:"272438aa4dbc8bb1ef9fdb45d3c2cc657d41ef4a"}),e("p",{key:"a3a0e8a1be44d65b1edd34e28956d1b34b732fef",class:"message-error"},this.message))}};h.style=d;export{h as crm_bonus_form};
2
+ //# sourceMappingURL=p-c121f6fc.entry.js.map
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, h, H as Host } from './index-c477a8b3.js';
2
- import { C as CrmBonusService } from './crmbonus.service-5a5e8f29.js';
2
+ import { C as CrmBonusService } from './crmbonus.service-84f1cc25.js';
3
3
  import { S as StepFormEnum } from './index-3c6d4feb.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;font-family:Arial;font-size:small;margin-left:16px}";
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, h } from './index-c477a8b3.js';
2
2
  import { g as getInfoCustomization } from './info.config.helper-42d9ddf9.js';
3
- import { C as CrmBonusService } from './crmbonus.service-5a5e8f29.js';
3
+ import { C as CrmBonusService, g as getKeyReserveByCartId } from './crmbonus.service-84f1cc25.js';
4
4
 
5
5
  const moneyDollarsSvgrepoComSvg = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPg0KPHN2ZyB3aWR0aD0iODAwcHgiIGhlaWdodD0iODAwcHgiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxjaXJjbGUgY3g9IjEyIiBjeT0iMTIiIHI9IjEwIiBzdHJva2U9IiMwMDAwMDAiIHN0cm9rZS13aWR0aD0iMiIvPg0KPHBhdGggZD0iTTE1IDkuOTQ3MjhDMTQuNSA5LjMgMTMuOCA4LjUgMTIgOC41QzEwLjIgOC41IDkgOS41MTM5MyA5IDkuOTQ3MjhDOSAxMC4zODA2IDkuMDY3ODYgMTAuOTI3NyAxMCAxMS41QzEwLjc1MjIgMTEuOTYxOCAxMi42Njg0IDEyLjA0MzkgMTMuNSAxMi41QzE0LjY3OSAxMy4xNDY3IDE0Ljg0OTcgMTMuODIwMiAxNC44NDk3IDE0LjA1MjJDMTQuODQ5NyAxNC42ODM3IDEzLjQxNzUgMTUuNDg1MiAxMiAxNS41QzEwLjUzNiAxNS41MTUzIDkuNSAxNC43IDkgMTQuMDUyMiIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPg0KPHBhdGggZD0iTTEyIDdWMTciIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPg0KPC9zdmc+';
6
6
 
@@ -38,11 +38,12 @@ const CrmBonusNote = class {
38
38
  async handleCancel() {
39
39
  await CrmBonusService.getInstance().cancelBonus(this.cartId, this.storename);
40
40
  window.location.href = this.url;
41
+ localStorage.removeItem(getKeyReserveByCartId(this.cartId));
41
42
  }
42
43
  render() {
43
- return (h("div", { key: 'df9c70a5a069bfed7fcbef3882c1079c78019e78' }, h("div", { key: 'eaa13fccbcabf194da631436d0e7234d9e4ae06c', class: "note-container" }, h("div", { key: '145f6d3bba36e423064a46169bba209f74f484d4', class: "note-header" }, h("p", { key: 'e76de748da7e54f26510de70899720ba7df58cf1', class: "note-title" }, h("img", { key: '7960d99a6637b0617f79ccc9de2345269dfb9ee3', src: moneyDollarsSvgrepoComSvg, width: 23 }), this.config.giftbackTitle), this.handleHide() && (h("p", { key: '35edb4072af1f0d7ba304527bff18833c7170d71', class: "back-cart", onClick: () => this.handleCancel() }, "Editar"))), h("hr", { key: '0bc7dd65524c3a40f25a18b291a976f44050b848' }), this.handleHide() &&
44
- (h("p", { key: '2bbd572fac93b989655b0a500575fb52e3cf0fb6', class: "note-description-2" }, this.config.giftbackTitle || "Giftback", " aplicado ao pedido: ", h("strong", { key: '9fde20de64bd6a73d47d62d6162c7268d18c9f47' }, "R$ ", this.getAmount()))), !this.handleHide() &&
45
- (h("p", { key: '99460d211c0a37480f87a4937540883a43928bbf', class: "note-description-not" }, "N\u00E3o h\u00E1 ", this.config.giftbackTitle || "Giftback", " dispon\u00EDvel para essa compra")))));
44
+ return (h("div", { key: 'd67dbfdc0777c5b5a96ff1342941af34ee920fe2' }, h("div", { key: 'db20487efa373bd03d0d1e86c33102aee0ba5a26', class: "note-container" }, h("div", { key: '932d9e67f2094aba7c11e486d10844237376850f', class: "note-header" }, h("p", { key: '96b9dd9410df330cafad41992b0a29a5cbdf6012', class: "note-title" }, h("img", { key: '537c4c8522cd367385938bb23638196d216e2884', src: moneyDollarsSvgrepoComSvg, width: 23 }), this.config.giftbackTitle), this.handleHide() && (h("p", { key: '88ebc962e810c269c93e0090da872d37dba2cf5a', class: "back-cart", onClick: () => this.handleCancel() }, "Editar"))), h("hr", { key: '545c55ef563cda8688398a16ca075a8c3027219f' }), this.handleHide() &&
45
+ (h("p", { key: '9555594772123ffd1262313dee32646565ce8dc6', class: "note-description-2" }, this.config.giftbackTitle || "Giftback", " aplicado ao pedido: ", h("strong", { key: 'e0115de3a25f686fe0a3b668af370d0c35c4f865' }, "R$ ", this.getAmount()))), !this.handleHide() &&
46
+ (h("p", { key: 'e17e72cf2bc5b4bf81730a4930dc9875576c94fd', class: "note-description-not" }, "N\u00E3o h\u00E1 ", this.config.giftbackTitle || "Giftback", " dispon\u00EDvel para essa compra")))));
46
47
  }
47
48
  };
48
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ACI,8DACI,4DAAK,KAAK,EAAC,gBAAgB,IACvB,4DAAK,KAAK,EAAC,aAAa,IAEpB,0DAAG,KAAK,EAAC,YAAY,IACjB,4DAAK,GAAG,EAAEA,yBAAK,EAAE,KAAK,EAAE,EAAE,GAAI,EAC7B,IAAI,CAAC,MAAM,CAAC,aAAa,CAC1B,EAEA,IAAI,CAAC,UAAU,EAAE,KACb,0DAAG,KAAK,EAAC,WAAW,EAAC,OAAO,EAAE,MAAM,IAAI,CAAC,YAAY,EAAE,aAEnD,CACP,CAEH,EAEN,4DAAM,EAEF,IAAI,CAAC,UAAU,EAAE;aAEb,0DAAG,KAAK,EAAC,oBAAoB,IACxB,IAAI,CAAC,MAAM,CAAC,aAAa,IAAI,UAAU,2BAAsB,wEAAY,IAAI,CAAC,SAAS,EAAE,CAAU,CACpG,CACP,EAID,CAAC,IAAI,CAAC,UAAU,EAAE;aAEd,0DAAG,KAAK,EAAC,sBAAsB,yBACnB,IAAI,CAAC,MAAM,CAAC,aAAa,IAAI,UAAU,sCAC/C,CACP,CAMH,CACJ,EACT;KACJ;;;;;;","names":["money"],"sources":["src/assets/svg/money-dollars-svgrepo-com.svg","src/components/note/crm-bonus-note.css?tag=crm-bonus-note","src/components/note/crm-bonus-note.tsx"],"sourcesContent":["<?xml version=\"1.0\" encoding=\"utf-8\"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->\r\n<svg width=\"800px\" height=\"800px\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n<circle cx=\"12\" cy=\"12\" r=\"10\" stroke=\"#000000\" stroke-width=\"2\"/>\r\n<path d=\"M15 9.94728C14.5 9.3 13.8 8.5 12 8.5C10.2 8.5 9 9.51393 9 9.94728C9 10.3806 9.06786 10.9277 10 11.5C10.7522 11.9618 12.6684 12.0439 13.5 12.5C14.679 13.1467 14.8497 13.8202 14.8497 14.0522C14.8497 14.6837 13.4175 15.4852 12 15.5C10.536 15.5153 9.5 14.7 9 14.0522\" stroke=\"#000000\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n<path d=\"M12 7V17\" stroke=\"#000000\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n</svg>",".note-container {\n border: 1px solid #dddddd;\n padding: 0 15px 15px;\n margin: 0 0 26px 0px;\n}\n\n.note-container hr {\n border: 1px solid #CCC;\n}\n\n.note-container .back-cart {\n display: flex;\n text-align: center;\n}\n\n.note-header {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n}\n\n.note-title {\n font-weight: 700;\n text-align: left;\n display: flex;\n gap: 6px;\n align-items: center;\n margin-top: 11px;\n color: #000;\n}\n\n.note-description {\n font-family: Arial;\n color: #6d6d5f;\n padding: 0;\n margin: 0 auto;\n}\n\n.back-cart {\n font-size: .9em;\n color: #27272A;\n text-decoration: none;\n cursor: pointer;\n margin-top: 11px;\n}\n\n.note-description-2 {\n color: var(--crm-scheme-fg-main-inverse, #262626);\n font-family: Roboto;\n font-size: var(--crm-font-size-body-lg, 16px);\n font-style: normal;\n font-weight: var(--crm-font-weight-body-bold, 400);\n line-height: var(--crm-line-height-body-md, 20px);\n letter-spacing: var(--crm-letter-spacing-title-md, 0px);\n margin-top: 11px;\n color: #000;\n}\n\n.note-description-not {\n font-size: 16px;\n}","import { Component, Prop, State, h } from \"@stencil/core\";\nimport { IInfoStore, getInfoCustomization } from \"../../helpers/info.config.helper\";\n\nimport money from '../../assets/svg/money-dollars-svgrepo-com.svg'\nimport { CrmBonusService } from \"../../services/crmbonus.service\";\n\n@Component({\n tag: 'crm-bonus-note',\n styleUrl: 'crm-bonus-note.css'\n})\nexport class CrmBonusNote {\n\n @Prop({ attribute: 'cartid' }) cartId;\n @Prop({ attribute: \"storename\" }) storename;\n\n @State() url: string;\n @State() config: IInfoStore;\n\n componentWillLoad() {\n this.upadateCheckToFreteAndGetUrl()\n }\n\n upadateCheckToFreteAndGetUrl() {\n\n this.config = getInfoCustomization(this.storename);\n const envios = document.getElementsByName('forma-envio');\n envios.forEach((envio: any) => {\n envio.checked = false;\n });\n\n this.url = window.location.origin;\n }\n\n handleHide() {\n const amount = localStorage.getItem(this.cartId);\n return !!amount;\n }\n\n getAmount() {\n const amount = localStorage.getItem(this.cartId);\n\n console.log('amount', amount)\n\n return Number(amount).toFixed(2).replace(\".\", \",\") || \"0,00\"\n }\n\n async handleCancel() {\n await CrmBonusService.getInstance().cancelBonus(this.cartId, this.storename);\n window.location.href = this.url;\n }\n\n render() {\n\n return (\n <div>\n <div class=\"note-container\">\n <div class=\"note-header\">\n\n <p class=\"note-title\">\n <img src={money} width={23} />\n {this.config.giftbackTitle}\n </p>\n {\n this.handleHide() && (\n <p class=\"back-cart\" onClick={() => this.handleCancel()}>\n Editar\n </p>\n )\n }\n </div>\n\n <hr />\n {\n this.handleHide() &&\n (\n <p class=\"note-description-2\">\n {this.config.giftbackTitle || \"Giftback\"} aplicado ao pedido: <strong>R$ {this.getAmount()}</strong>\n </p>\n )\n }\n\n {\n !this.handleHide() &&\n (\n <p class=\"note-description-not\">\n Não há {this.config.giftbackTitle || \"Giftback\"} disponível para essa compra\n </p>\n )\n }\n\n {/* <a class=\"back-cart\" href={this.url}>\n Voltar ao carrinho\n </a> */}\n </div>\n </div>\n )\n }\n}"],"version":3}
1
+ {"file":"crm-bonus-note.entry.js","mappings":";;;;AAAA,MAAM,yBAAyB,GAAG,ghCAAghC;;ACAljC,MAAM,eAAe,GAAG,y4BAAy4B,CAAC;AACl6B,2BAAe,eAAe;;MCUjB,YAAY;;;;;;;;IAQrB,iBAAiB;QACb,IAAI,CAAC,4BAA4B,EAAE,CAAA;KACtC;IAED,4BAA4B;QAExB,IAAI,CAAC,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACnD,MAAM,MAAM,GAAG,QAAQ,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAC;QACzD,MAAM,CAAC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I,CAAC,UAAU,EAAE;aAEb,0DAAG,KAAK,EAAC,oBAAoB,IACxB,IAAI,CAAC,MAAM,CAAC,aAAa,IAAI,UAAU,2BAAsB,wEAAY,IAAI,CAAC,SAAS,EAAE,CAAU,CACpG,CACP,EAID,CAAC,IAAI,CAAC,UAAU,EAAE;aAEd,0DAAG,KAAK,EAAC,sBAAsB,yBACnB,IAAI,CAAC,MAAM,CAAC,aAAa,IAAI,UAAU,sCAC/C,CACP,CAMH,CACJ,EACT;KACJ;;;;;;","names":["money"],"sources":["src/assets/svg/money-dollars-svgrepo-com.svg","src/components/note/crm-bonus-note.css?tag=crm-bonus-note","src/components/note/crm-bonus-note.tsx"],"sourcesContent":["<?xml version=\"1.0\" encoding=\"utf-8\"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->\r\n<svg width=\"800px\" height=\"800px\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n<circle cx=\"12\" cy=\"12\" r=\"10\" stroke=\"#000000\" stroke-width=\"2\"/>\r\n<path d=\"M15 9.94728C14.5 9.3 13.8 8.5 12 8.5C10.2 8.5 9 9.51393 9 9.94728C9 10.3806 9.06786 10.9277 10 11.5C10.7522 11.9618 12.6684 12.0439 13.5 12.5C14.679 13.1467 14.8497 13.8202 14.8497 14.0522C14.8497 14.6837 13.4175 15.4852 12 15.5C10.536 15.5153 9.5 14.7 9 14.0522\" stroke=\"#000000\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n<path d=\"M12 7V17\" stroke=\"#000000\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n</svg>",".note-container {\n border: 1px solid #dddddd;\n padding: 0 15px 15px;\n margin: 0 0 26px 0px;\n}\n\n.note-container hr {\n border: 1px solid #CCC;\n}\n\n.note-container .back-cart {\n display: flex;\n text-align: center;\n}\n\n.note-header {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n}\n\n.note-title {\n font-weight: 700;\n text-align: left;\n display: flex;\n gap: 6px;\n align-items: center;\n margin-top: 11px;\n color: #000;\n}\n\n.note-description {\n font-family: Arial;\n color: #6d6d5f;\n padding: 0;\n margin: 0 auto;\n}\n\n.back-cart {\n font-size: .9em;\n color: #27272A;\n text-decoration: none;\n cursor: pointer;\n margin-top: 11px;\n}\n\n.note-description-2 {\n color: var(--crm-scheme-fg-main-inverse, #262626);\n font-family: Roboto;\n font-size: var(--crm-font-size-body-lg, 16px);\n font-style: normal;\n font-weight: var(--crm-font-weight-body-bold, 400);\n line-height: var(--crm-line-height-body-md, 20px);\n letter-spacing: var(--crm-letter-spacing-title-md, 0px);\n margin-top: 11px;\n color: #000;\n}\n\n.note-description-not {\n font-size: 16px;\n}","import { Component, Prop, State, h } from \"@stencil/core\";\nimport { IInfoStore, getInfoCustomization } from \"../../helpers/info.config.helper\";\n\nimport money from '../../assets/svg/money-dollars-svgrepo-com.svg'\nimport { CrmBonusService } from \"../../services/crmbonus.service\";\nimport { getKeyReserveByCartId } from \"../../utils/keys.storage\";\n\n@Component({\n tag: 'crm-bonus-note',\n styleUrl: 'crm-bonus-note.css'\n})\nexport class CrmBonusNote {\n\n @Prop({ attribute: 'cartid' }) cartId;\n @Prop({ attribute: \"storename\" }) storename;\n\n @State() url: string;\n @State() config: IInfoStore;\n\n componentWillLoad() {\n this.upadateCheckToFreteAndGetUrl()\n }\n\n upadateCheckToFreteAndGetUrl() {\n\n this.config = getInfoCustomization(this.storename);\n const envios = document.getElementsByName('forma-envio');\n envios.forEach((envio: any) => {\n envio.checked = false;\n });\n\n this.url = window.location.origin;\n }\n\n handleHide() {\n const amount = localStorage.getItem(this.cartId);\n return !!amount;\n }\n\n getAmount() {\n const amount = localStorage.getItem(this.cartId);\n\n console.log('amount', amount)\n\n return Number(amount).toFixed(2).replace(\".\", \",\") || \"0,00\"\n }\n\n async handleCancel() {\n await CrmBonusService.getInstance().cancelBonus(this.cartId, this.storename);\n window.location.href = this.url;\n\n localStorage.removeItem(getKeyReserveByCartId(this.cartId));\n }\n\n render() {\n\n return (\n <div>\n <div class=\"note-container\">\n <div class=\"note-header\">\n\n <p class=\"note-title\">\n <img src={money} width={23} />\n {this.config.giftbackTitle}\n </p>\n {\n this.handleHide() && (\n <p class=\"back-cart\" onClick={() => this.handleCancel()}>\n Editar\n </p>\n )\n }\n </div>\n\n <hr />\n {\n this.handleHide() &&\n (\n <p class=\"note-description-2\">\n {this.config.giftbackTitle || \"Giftback\"} aplicado ao pedido: <strong>R$ {this.getAmount()}</strong>\n </p>\n )\n }\n\n {\n !this.handleHide() &&\n (\n <p class=\"note-description-not\">\n Não há {this.config.giftbackTitle || \"Giftback\"} disponível para essa compra\n </p>\n )\n }\n\n {/* <a class=\"back-cart\" href={this.url}>\n Voltar ao carrinho\n </a> */}\n </div>\n </div>\n )\n }\n}"],"version":3}
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, h } from './index-c477a8b3.js';
2
- import { C as CrmBonusService } from './crmbonus.service-5a5e8f29.js';
2
+ import { C as CrmBonusService } from './crmbonus.service-84f1cc25.js';
3
3
  import { S as StepFormEnum } from './index-3c6d4feb.js';
4
4
  import { i as instance } from './i18n-887a3ef8.js';
5
5
 
@@ -93,10 +93,7 @@ const CrmBonus = class {
93
93
  }
94
94
  async buildAndGetProducts() {
95
95
  const key = `bc-products:${this.cartId}`;
96
- const cache_products = localStorage.getItem(key);
97
- if (!cache_products) {
98
- localStorage.setItem(key, this.productsInString);
99
- }
96
+ localStorage.setItem(key, this.productsInString);
100
97
  const productsInCart = JSON.parse(this.productsInString);
101
98
  const products_in_cache = JSON.parse(localStorage.getItem(key));
102
99
  const products = [];
@@ -188,7 +185,7 @@ const CrmBonus = class {
188
185
  this.showModal = true;
189
186
  }
190
187
  render() {
191
- return (h("crm-giftback-form", { key: '910c338e790d15116f13953132daf6c99fc5365b', ref: ref => this.crmBonusRef = ref, storeName: this.storeName, products: this.buildProducts(), cartId: this.cartId, customer: this.customer })
188
+ return (h("crm-giftback-form", { key: '62d209d69589c4e4c30462e3800755cdd4102d84', ref: ref => this.crmBonusRef = ref, storeName: this.storeName, products: this.buildProducts(), cartId: this.cartId, customer: this.customer })
192
189
  // <div class="section-cart-crm">
193
190
  // <p class="text-left fbits-responsive-carrinho-desconto-texto">Giftback</p>
194
191
  // <div class="container-button">
@@ -1 +1 @@
1
- {"file":"crm-bonus.entry.js","mappings":";;;;;AAAA,MAAM,WAAW,GAAG,uoCAAuoC,CAAC;AAC5pC,uBAAe,WAAW;;MCab,QAAQ;;;QAEX,oBAAe,GAAoB,eAAe,CAAC,WAAW,EAAE,CAAC;yBAI3C,KAAK;;;;;;wBAOJ;YAC7B,SAAS,EAAE,EAAE;YACb,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,EAAE;YACR,KAAK,EAAE,EAAE;SACV;uBAE2B,KAAK;;;yBAGH,KAAK;;;;;IAOnC,MAAM,UAAU;QACd,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;;;QAKxC,MAAM,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QAEpE,IAAI;YACF,MAAM,IAAI,CAAC,WAAW,CAAC,YAAY,EAAE,CAAC;YACtC,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;SACtC;QAAC,OAAO,GAAG,EAAE;YAEZ,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;YACrB,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;YAC7C,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;SACzD;gBAAS;YACR,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;SACtB;KACF;IAGD,MAAM,aAAa,CAAC,QAAgB;QAClC,IAAI;YACF,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;YACtC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EAAE,EAAE,CAAC,CAAC;QACxC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;QAE5B,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE;YACtB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;SAC3B;QAED,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;QACvD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;KACvB;IAED,MAAM;QAEJ,QACE,0EACE,GAAG,EAAE,GAAG,IAAI,IAAI,CAAC,WAAW,GAAG,GAAG,EAClC,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,QAAQ,EAAE,IAAI,CAAC,aAAa,EAAE,EAC9B,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ,GACvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA8BH;KACF;;;;;;;;;;","names":["i18next"],"sources":["src/components/crm-bonus/crm-bonus.css?tag=crm-bonus&encapsulation=scoped","src/components/crm-bonus/crm-bonus.tsx"],"sourcesContent":["\n.container-button {\n /* max-width: 100%; */\n cursor: pointer;\n padding: 5px 5px 5px 14px;\n /* display: flex; */\n}\n\n/* padding: 0 15px 15px;\nborder: 1px solid #ddd;\nmargin-bottom: 20px; */\n\n.section-crm {\n border: 1px solid #dbd4d4;\n /* min-height: 50px; */\n text-align: -webkit-center;\n margin-bottom: 20px;\n}\n\n.section-cart-crm {\n margin-top: 10px;\n}\n\n.section-cart-crm p {\n padding: 0;\n margin: 0px 0px 0px 15px;\n}\n\n.button {\n top: 50%;\n background-color: #6c6c7e;\n color: #fff;\n border: none;\n /* border-radius: 10px; */\n padding: 15px;\n min-height: 30px;\n min-width: 120px;\n font-size: 20px;\n cursor: pointer;\n margin-left: 10px;\n height: 70px;\n}\n\n.form-container {\n width: 97%;\n display: flex;\n justify-content: space-around;\n}\n\n\n.btn {\n display: inline-block;\n padding: 6px 12px;\n margin-bottom: 0;\n font-size: 14px;\n font-weight: 400;\n line-height: 1.42857143;\n text-align: center;\n white-space: nowrap;\n vertical-align: middle;\n -ms-touch-action: manipulation;\n touch-action: manipulation;\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n background-image: none;\n border: 1px solid transparent;\n border-radius: 0px;\n}\n\n.form-container .btnCrm {\n background: #00162e;\n border-color: #00162e;\n width: 30%;\n color: #fff;\n}\n\n.message-alert {\n font-family: sans-serif;\n color: #df4d4d;\n margin-top: 5px;\n}","import { Component, Method, Prop, State, Watch, h } from '@stencil/core';\nimport { IProduct, IProductWake, ICustomer } from '../../dto/validate.pin.bonus';\nimport { CrmBonusService } from '../../services/crmbonus.service';\nimport { IPinSent } from '../../components';\nimport { StepFormEnum } from '../../contants';\n\nimport i18next from '../../i18n/i18n'\n\n@Component({\n tag: 'crm-bonus',\n styleUrl: 'crm-bonus.css',\n scoped: true,\n assetsDirs: ['assets']\n})\nexport class CrmBonus {\n\n private crmBonusService: CrmBonusService = CrmBonusService.getInstance();\n\n private crmBonusRef: HTMLCrmGiftbackFormElement;\n\n @State() showModal: boolean = false;\n @Prop({ attribute: 'userid' }) userId: number;\n @Prop({ attribute: 'storename' }) storeName;\n @Prop({ attribute: 'products' }) productsInString: string;\n @Prop({ attribute: 'cartid' }) cartId;\n\n @State() products: Array<IProductWake>;\n @State() customer: ICustomer = {\n birthDate: \"\",\n document: \"\",\n name: \"\",\n phone: \"\"\n };\n\n @State() loading: boolean = false;\n @State() message: string;\n @State() phone: number;\n @State() canCancel: boolean = false;\n @State() amountCancel: string;\n @State() sent: IPinSent;\n\n @State() session: string;\n\n @Method()\n async resetBonus() {\n console.log('[START RESET BONUS]!!!!!');\n // const exists = localStorage.getItem(getKeyReserveByCartId(this.cartId))\n\n // if(!exists) return;\n\n await this.crmBonusService.cancelBonus(this.cartId, this.storeName);\n\n try {\n await this.crmBonusRef.processBonus();\n console.log('[BONUS RESETADO]!!!!!');\n } catch (err) {\n\n this.loading = false;\n console.log('[error ao reprocessar bonous]');\n await this.crmBonusRef.setStep(StepFormEnum.STEP_PHONE);\n } finally {\n this.loading = false;\n }\n }\n\n @Watch(\"productsInString\")\n async watchProducts(newValue: string) {\n try {\n console.log('[update products list]');\n this.productsInString = newValue;\n await this.handleLoad();\n\n await this.resetBonus();\n } catch (err) {\n console.debug('[watchProducts]', err.message);\n }\n }\n\n async componentWillLoad() {\n i18next.changeLanguage(i18next.language);\n\n await this.loadSession();\n await this.loadConfigStore()\n await this.handleLoad();\n }\n\n async loadConfigStore() {\n await this.crmBonusService.getCustomization(this.storeName);\n }\n\n async handleLoad() {\n try {\n if (this.userId) {\n this.customer = await this.crmBonusService.getCustomer(this.userId, this.storeName);\n // this.phone = Number(this.customer.phone)\n }\n\n const amount = localStorage.getItem(this.cartId);\n\n if (amount) {\n this.canCancel = true;\n this.amountCancel = amount;\n }\n\n } catch (error) {\n console.log('info customer')\n }\n\n this.buildAndGetProducts();\n }\n\n\n async loadSession() {\n this.session = await this.crmBonusService.getToken(this.storeName);\n\n setTimeout(() => {\n this.loadSession()\n }, 1500000)\n\n }\n\n async buildAndGetProducts() {\n const key = `bc-products:${this.cartId}`;\n const cache_products = localStorage.getItem(key)\n\n if (!cache_products) {\n localStorage.setItem(key, this.productsInString);\n }\n\n const productsInCart = JSON.parse(this.productsInString);\n const products_in_cache = JSON.parse(localStorage.getItem(key));\n\n const products: Array<IProductWake> = []\n\n for (const product_cart of productsInCart) {\n\n const [pro] = products_in_cache.filter(p => p.ProdutoVarianteId == product_cart.ProdutoVarianteId)\n\n if (pro) {\n products.push({\n ...product_cart,\n PrecoPor: pro.PrecoPor\n })\n } else {\n products.push(product_cart)\n }\n\n }\n\n this.products = products; //cache_products ? JSON.parse(cache_products) : JSON.parse(this.productsInString);\n\n }\n\n public async sendPin(phone: string) {\n this.loading = true;\n this.message = \"\";\n\n try {\n\n const _phone = phone.replace(/\\D/g, '');\n this.phone = Number(_phone);\n\n this.sent = await this.crmBonusService.sendPin(this.phone, this.customer.name, this.storeName);;\n\n await this.crmBonusRef.setStep(StepFormEnum.STEP_PIN);\n\n this.showModal = true;\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false\n }\n }\n\n public async sendPinName(customerName: string) {\n this.loading = true;\n this.message = \"\";\n\n try {\n this.customer.name = customerName;\n\n this.sent = await this.crmBonusService.sendPin(this.phone, this.customer.name, this.storeName);;\n\n await this.crmBonusRef.setStep(StepFormEnum.STEP_PIN);\n\n this.showModal = true;\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false\n }\n }\n\n buildProducts(): IProduct[] {\n return this.products.map(product => ({ sku: product.SKU, value: (product.PrecoPor * product.Quantidade), productVariantId: product.ProdutoVarianteId.toString(), quantity: product.Quantidade }))\n }\n\n handleCloseModal() {\n this.showModal = false;\n }\n\n save(amount: number) {\n localStorage.setItem(this.cartId, amount.toString());\n this.canCancel = true;\n this.amountCancel = amount.toString()\n }\n\n async cancel() {\n this.message = \"\";\n this.loading = true;\n try {\n await this.crmBonusService.cancel(this.cartId);\n this.canCancel = false;\n\n localStorage.removeItem(this.cartId);\n } catch (error) {\n this.message = \"Não consegui cancelar o bônus, tente novamente!\"\n } finally {\n this.loading = false;\n }\n }\n\n async handleSendPin(phone: string) {\n this.message = \"\"\n if (!phone) {\n this.message = \"Informe seu telefone\";\n return;\n }\n\n this.customer.phone = phone;\n const _phone = phone.replace(/\\D/g, '');\n this.phone = Number(_phone);\n\n if (this.customer.name) {\n return this.sendPin(phone)\n }\n\n await this.crmBonusRef.setStep(StepFormEnum.STEP_NAME);\n this.showModal = true;\n }\n\n render() {\n\n return (\n <crm-giftback-form\n ref={ref => this.crmBonusRef = ref}\n storeName={this.storeName}\n products={this.buildProducts()}\n cartId={this.cartId}\n customer={this.customer}\n />\n // <div class=\"section-cart-crm\">\n // <p class=\"text-left fbits-responsive-carrinho-desconto-texto\">Giftback</p>\n // <div class=\"container-button\">\n // {/* <img src={logo} onClick={() => (this.showModal = true)} /> */}\n // {\n // this.canCancel ? <phone-cancel-input value={this.amountCancel} sendPin={() => { this.cancel() }} loading={this.loading} />\n // : <phone-input value={this.customer.phone} sendPin={(phone) => { this.handleSendPin(phone) }} loading={this.loading} />\n // }\n // </div>\n // <p class=\"message-alert\" >{this.message}</p>\n // <app-modal\n // isOpen={this.showModal}\n // modalTitle={`Giftback`}\n // onModalClosed={() => (this.showModal = false)}\n // >\n // <crm-bonus-form\n // loadingModal={this.loading}\n // saveStore={(amount: number) => this.save(amount)}\n // ref={ref => this.crmBonusRef = ref}\n // sent={this.sent}\n // phone={this.phone}\n // cancel={() => this.handleCloseModal()}\n // storeName={this.storeName}\n // products={this.buildProducts()}\n // cartId={this.cartId} customer={this.customer}\n // handleCustomerName={(name: string) => this.sendPinName(name)}\n // />\n // </app-modal>\n // </div>\n )\n }\n}\n"],"version":3}
1
+ {"file":"crm-bonus.entry.js","mappings":";;;;;AAAA,MAAM,WAAW,GAAG,uoCAAuoC,CAAC;AAC5pC,uBAAe,WAAW;;MCab,QAAQ;;;QAEX,oBAAe,GAAoB,eAAe,CAAC,WAAW,EAAE,CAAC;yBAI3C,KAAK;;;;;;wBAOJ;YAC7B,SAAS,EAAE,EAAE;YACb,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,EAAE;YACR,KAAK,EAAE,EAAE;SACV;uBAE2B,KAAK;;;yBAGH,KAAK;;;;;IAOnC,MAAM,UAAU;QACd,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;;;QAKxC,MAAM,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QAEpE,IAAI;YACF,MAAM,IAAI,CAAC,WAAW,CAAC,YAAY,EAAE,CAAC;YACtC,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;SACtC;QAAC,OAA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,KAAa;QAC/B,IAAI,CAAC,OAAO,GAAG,EAAE,CAAA;QACjB,IAAI,CAAC,KAAK,EAAE;YACV,IAAI,CAAC,OAAO,GAAG,sBAAsB,CAAC;YACtC,OAAO;SACR;QAED,IAAI,CAAC,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC;QAC5B,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACxC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;QAE5B,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE;YACtB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;SAC3B;QAED,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;QACvD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;KACvB;IAED,MAAM;QAEJ,QACE,0EACE,GAAG,EAAE,GAAG,IAAI,IAAI,CAAC,WAAW,GAAG,GAAG,EAClC,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,QAAQ,EAAE,IAAI,CAAC,aAAa,EAAE,EAC9B,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ,GACvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA8BH;KACF;;;;;;;;;;","names":["i18next"],"sources":["src/components/crm-bonus/crm-bonus.css?tag=crm-bonus&encapsulation=scoped","src/components/crm-bonus/crm-bonus.tsx"],"sourcesContent":["\n.container-button {\n /* max-width: 100%; */\n cursor: pointer;\n padding: 5px 5px 5px 14px;\n /* display: flex; */\n}\n\n/* padding: 0 15px 15px;\nborder: 1px solid #ddd;\nmargin-bottom: 20px; */\n\n.section-crm {\n border: 1px solid #dbd4d4;\n /* min-height: 50px; */\n text-align: -webkit-center;\n margin-bottom: 20px;\n}\n\n.section-cart-crm {\n margin-top: 10px;\n}\n\n.section-cart-crm p {\n padding: 0;\n margin: 0px 0px 0px 15px;\n}\n\n.button {\n top: 50%;\n background-color: #6c6c7e;\n color: #fff;\n border: none;\n /* border-radius: 10px; */\n padding: 15px;\n min-height: 30px;\n min-width: 120px;\n font-size: 20px;\n cursor: pointer;\n margin-left: 10px;\n height: 70px;\n}\n\n.form-container {\n width: 97%;\n display: flex;\n justify-content: space-around;\n}\n\n\n.btn {\n display: inline-block;\n padding: 6px 12px;\n margin-bottom: 0;\n font-size: 14px;\n font-weight: 400;\n line-height: 1.42857143;\n text-align: center;\n white-space: nowrap;\n vertical-align: middle;\n -ms-touch-action: manipulation;\n touch-action: manipulation;\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n background-image: none;\n border: 1px solid transparent;\n border-radius: 0px;\n}\n\n.form-container .btnCrm {\n background: #00162e;\n border-color: #00162e;\n width: 30%;\n color: #fff;\n}\n\n.message-alert {\n font-family: sans-serif;\n color: #df4d4d;\n margin-top: 5px;\n}","import { Component, Method, Prop, State, Watch, h } from '@stencil/core';\nimport { IProduct, IProductWake, ICustomer } from '../../dto/validate.pin.bonus';\nimport { CrmBonusService } from '../../services/crmbonus.service';\nimport { IPinSent } from '../../components';\nimport { StepFormEnum } from '../../contants';\n\nimport i18next from '../../i18n/i18n'\n\n@Component({\n tag: 'crm-bonus',\n styleUrl: 'crm-bonus.css',\n scoped: true,\n assetsDirs: ['assets']\n})\nexport class CrmBonus {\n\n private crmBonusService: CrmBonusService = CrmBonusService.getInstance();\n\n private crmBonusRef: HTMLCrmGiftbackFormElement;\n\n @State() showModal: boolean = false;\n @Prop({ attribute: 'userid' }) userId: number;\n @Prop({ attribute: 'storename' }) storeName;\n @Prop({ attribute: 'products' }) productsInString: string;\n @Prop({ attribute: 'cartid' }) cartId;\n\n @State() products: Array<IProductWake>;\n @State() customer: ICustomer = {\n birthDate: \"\",\n document: \"\",\n name: \"\",\n phone: \"\"\n };\n\n @State() loading: boolean = false;\n @State() message: string;\n @State() phone: number;\n @State() canCancel: boolean = false;\n @State() amountCancel: string;\n @State() sent: IPinSent;\n\n @State() session: string;\n\n @Method()\n async resetBonus() {\n console.log('[START RESET BONUS]!!!!!');\n // const exists = localStorage.getItem(getKeyReserveByCartId(this.cartId))\n\n // if(!exists) return;\n\n await this.crmBonusService.cancelBonus(this.cartId, this.storeName);\n\n try {\n await this.crmBonusRef.processBonus();\n console.log('[BONUS RESETADO]!!!!!');\n } catch (err) {\n\n this.loading = false;\n console.log('[error ao reprocessar bonous]');\n await this.crmBonusRef.setStep(StepFormEnum.STEP_PHONE);\n } finally {\n this.loading = false;\n }\n }\n\n @Watch(\"productsInString\")\n async watchProducts(newValue: string) {\n try {\n console.log('[update products list]');\n this.productsInString = newValue;\n await this.handleLoad();\n\n await this.resetBonus();\n } catch (err) {\n console.debug('[watchProducts]', err.message);\n }\n }\n\n async componentWillLoad() {\n i18next.changeLanguage(i18next.language);\n\n await this.loadSession();\n await this.loadConfigStore()\n await this.handleLoad();\n }\n\n async loadConfigStore() {\n await this.crmBonusService.getCustomization(this.storeName);\n }\n\n async handleLoad() {\n try {\n if (this.userId) {\n this.customer = await this.crmBonusService.getCustomer(this.userId, this.storeName);\n // this.phone = Number(this.customer.phone)\n }\n\n const amount = localStorage.getItem(this.cartId);\n\n if (amount) {\n this.canCancel = true;\n this.amountCancel = amount;\n }\n\n } catch (error) {\n console.log('info customer')\n }\n\n this.buildAndGetProducts();\n }\n\n\n async loadSession() {\n this.session = await this.crmBonusService.getToken(this.storeName);\n\n setTimeout(() => {\n this.loadSession()\n }, 1500000)\n\n }\n\n async buildAndGetProducts() {\n const key = `bc-products:${this.cartId}`;\n\n localStorage.setItem(key, this.productsInString);\n\n const productsInCart = JSON.parse(this.productsInString);\n const products_in_cache = JSON.parse(localStorage.getItem(key));\n\n const products: Array<IProductWake> = []\n\n for (const product_cart of productsInCart) {\n\n const [pro] = products_in_cache.filter(p => p.ProdutoVarianteId == product_cart.ProdutoVarianteId)\n\n if (pro) {\n products.push({\n ...product_cart,\n PrecoPor: pro.PrecoPor\n })\n } else {\n products.push(product_cart)\n }\n\n }\n\n this.products = products; //cache_products ? JSON.parse(cache_products) : JSON.parse(this.productsInString);\n\n }\n\n public async sendPin(phone: string) {\n this.loading = true;\n this.message = \"\";\n\n try {\n\n const _phone = phone.replace(/\\D/g, '');\n this.phone = Number(_phone);\n\n this.sent = await this.crmBonusService.sendPin(this.phone, this.customer.name, this.storeName);;\n\n await this.crmBonusRef.setStep(StepFormEnum.STEP_PIN);\n\n this.showModal = true;\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false\n }\n }\n\n public async sendPinName(customerName: string) {\n this.loading = true;\n this.message = \"\";\n\n try {\n this.customer.name = customerName;\n\n this.sent = await this.crmBonusService.sendPin(this.phone, this.customer.name, this.storeName);;\n\n await this.crmBonusRef.setStep(StepFormEnum.STEP_PIN);\n\n this.showModal = true;\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false\n }\n }\n\n buildProducts(): IProduct[] {\n return this.products.map(product => ({ sku: product.SKU, value: (product.PrecoPor * product.Quantidade), productVariantId: product.ProdutoVarianteId.toString(), quantity: product.Quantidade }))\n }\n\n handleCloseModal() {\n this.showModal = false;\n }\n\n save(amount: number) {\n localStorage.setItem(this.cartId, amount.toString());\n this.canCancel = true;\n this.amountCancel = amount.toString()\n }\n\n async cancel() {\n this.message = \"\";\n this.loading = true;\n try {\n await this.crmBonusService.cancel(this.cartId);\n this.canCancel = false;\n\n localStorage.removeItem(this.cartId);\n } catch (error) {\n this.message = \"Não consegui cancelar o bônus, tente novamente!\"\n } finally {\n this.loading = false;\n }\n }\n\n async handleSendPin(phone: string) {\n this.message = \"\"\n if (!phone) {\n this.message = \"Informe seu telefone\";\n return;\n }\n\n this.customer.phone = phone;\n const _phone = phone.replace(/\\D/g, '');\n this.phone = Number(_phone);\n\n if (this.customer.name) {\n return this.sendPin(phone)\n }\n\n await this.crmBonusRef.setStep(StepFormEnum.STEP_NAME);\n this.showModal = true;\n }\n\n render() {\n\n return (\n <crm-giftback-form\n ref={ref => this.crmBonusRef = ref}\n storeName={this.storeName}\n products={this.buildProducts()}\n cartId={this.cartId}\n customer={this.customer}\n />\n // <div class=\"section-cart-crm\">\n // <p class=\"text-left fbits-responsive-carrinho-desconto-texto\">Giftback</p>\n // <div class=\"container-button\">\n // {/* <img src={logo} onClick={() => (this.showModal = true)} /> */}\n // {\n // this.canCancel ? <phone-cancel-input value={this.amountCancel} sendPin={() => { this.cancel() }} loading={this.loading} />\n // : <phone-input value={this.customer.phone} sendPin={(phone) => { this.handleSendPin(phone) }} loading={this.loading} />\n // }\n // </div>\n // <p class=\"message-alert\" >{this.message}</p>\n // <app-modal\n // isOpen={this.showModal}\n // modalTitle={`Giftback`}\n // onModalClosed={() => (this.showModal = false)}\n // >\n // <crm-bonus-form\n // loadingModal={this.loading}\n // saveStore={(amount: number) => this.save(amount)}\n // ref={ref => this.crmBonusRef = ref}\n // sent={this.sent}\n // phone={this.phone}\n // cancel={() => this.handleCloseModal()}\n // storeName={this.storeName}\n // products={this.buildProducts()}\n // cartId={this.cartId} customer={this.customer}\n // handleCustomerName={(name: string) => this.sendPinName(name)}\n // />\n // </app-modal>\n // </div>\n )\n }\n}\n"],"version":3}
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, h } from './index-c477a8b3.js';
2
- import { C as CrmBonusService, g as getKeyReserveByCartId } from './crmbonus.service-5a5e8f29.js';
2
+ import { C as CrmBonusService, g as getKeyReserveByCartId } from './crmbonus.service-84f1cc25.js';
3
3
  import { S as StepFormEnum } from './index-3c6d4feb.js';
4
4
  import { g as getInfoCustomization } from './info.config.helper-42d9ddf9.js';
5
5
  import { i as instance } from './i18n-887a3ef8.js';
@@ -3862,7 +3862,6 @@ class CrmBonusService {
3862
3862
  storeName: storeName
3863
3863
  }, { headers: headers });
3864
3864
  localStorage.setItem(cartId, "0");
3865
- localStorage.removeItem(getKeyReserveByCartId(cartId));
3866
3865
  localStorage.removeItem("bc:used");
3867
3866
  }
3868
3867
  }
@@ -3870,4 +3869,4 @@ CrmBonusService._instance = null;
3870
3869
 
3871
3870
  export { CrmBonusService as C, getKeyReserveByCartId as g };
3872
3871
 
3873
- //# sourceMappingURL=crmbonus.service-5a5e8f29.js.map
3872
+ //# sourceMappingURL=crmbonus.service-84f1cc25.js.map