crmbonus-component-wake 2.1.21-homolog-tray → 2.1.22-homolog-tray
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-0a401d80.js → cart.helper-d216033e.js} +2 -2
- package/dist/cjs/{cart.helper-0a401d80.js.map → cart.helper-d216033e.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_2.cjs.entry.js +2 -2
- package/dist/cjs/crm-tooltip_4.cjs.entry.js +2 -2
- package/dist/cjs/{crmbonus.service-7a4f6786.js → crmbonus.service-5537cef5.js} +2 -2
- package/dist/cjs/{crmbonus.service-7a4f6786.js.map → crmbonus.service-5537cef5.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-d8bd654a.js → p-01d41bff.js} +3 -3
- package/dist/components/{p-d8bd654a.js.map → p-01d41bff.js.map} +1 -1
- package/dist/components/{p-a428d5df.js → p-3eba0eba.js} +2 -2
- package/dist/components/{p-a428d5df.js.map → p-3eba0eba.js.map} +1 -1
- package/dist/components/{p-9ca28ea7.js → p-b57fbd6d.js} +2 -2
- package/dist/components/{p-9ca28ea7.js.map → p-b57fbd6d.js.map} +1 -1
- package/dist/components/{p-ec317fb9.js → p-cde3c049.js} +4 -4
- package/dist/components/{p-ec317fb9.js.map → p-cde3c049.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-35b95848.entry.js → p-09e26da2.entry.js} +2 -2
- package/dist/crmbonus-component-wake/{p-ed22d88f.entry.js → p-0ecdc07b.entry.js} +2 -2
- package/dist/crmbonus-component-wake/{p-81ec64ff.entry.js → p-100b6036.entry.js} +2 -2
- package/dist/crmbonus-component-wake/{p-b2941d60.entry.js → p-213bf3b6.entry.js} +2 -2
- package/dist/crmbonus-component-wake/{p-8e2d6659.entry.js → p-25e29b60.entry.js} +2 -2
- package/dist/crmbonus-component-wake/{p-a428d5df.js → p-3eba0eba.js} +2 -2
- package/dist/crmbonus-component-wake/{p-a428d5df.js.map → p-3eba0eba.js.map} +1 -1
- package/dist/crmbonus-component-wake/{p-9ca28ea7.js → p-b57fbd6d.js} +2 -2
- package/dist/crmbonus-component-wake/{p-0055876c.entry.js → p-d4821de7.entry.js} +2 -2
- package/dist/env.js +1 -1
- package/dist/env.js.map +1 -1
- package/dist/esm/{cart.helper-c6fd0b36.js → cart.helper-8be1bc35.js} +2 -2
- package/dist/esm/{cart.helper-c6fd0b36.js.map → cart.helper-8be1bc35.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_2.entry.js +2 -2
- package/dist/esm/crm-tooltip_4.entry.js +2 -2
- package/dist/esm/{crmbonus.service-0bd0a5ac.js → crmbonus.service-5bc16be9.js} +2 -2
- package/dist/esm/{crmbonus.service-0bd0a5ac.js.map → crmbonus.service-5bc16be9.js.map} +1 -1
- package/dist/esm/pedido-finalizado.entry.js +2 -2
- package/dist/types/home/darlison/Projects/Bycoders/crmbonus/crmbonus-component/.stencil/env.d.ts +1 -1
- package/package.json +1 -1
- /package/dist/crmbonus-component-wake/{p-35b95848.entry.js.map → p-09e26da2.entry.js.map} +0 -0
- /package/dist/crmbonus-component-wake/{p-ed22d88f.entry.js.map → p-0ecdc07b.entry.js.map} +0 -0
- /package/dist/crmbonus-component-wake/{p-81ec64ff.entry.js.map → p-100b6036.entry.js.map} +0 -0
- /package/dist/crmbonus-component-wake/{p-b2941d60.entry.js.map → p-213bf3b6.entry.js.map} +0 -0
- /package/dist/crmbonus-component-wake/{p-8e2d6659.entry.js.map → p-25e29b60.entry.js.map} +0 -0
- /package/dist/crmbonus-component-wake/{p-9ca28ea7.js.map → p-b57fbd6d.js.map} +0 -0
- /package/dist/crmbonus-component-wake/{p-0055876c.entry.js.map → p-d4821de7.entry.js.map} +0 -0
@@ -1,2 +1,2 @@
|
|
1
|
-
import{C as t,a as s}from"./p-
|
2
|
-
//# sourceMappingURL=p-
|
1
|
+
import{C as t,a as s}from"./p-3eba0eba.js";class o{constructor(t){var s;this.products=[];this.id=t.Metadados.id||t.Id;this.middlewareId=(s=t.Metadados)===null||s===void 0?void 0:s.id;this.orderId=t.PedidoId;this.buildUserInfo(t);this.buildStoreInfo(t);this.products=this.buildStoreCart(t.Produtos)}buildStoreCart(t=[]){const s=localStorage.getItem("bc:cart");if(!s){return this.saveStore(t)}const o=JSON.parse(s);if(t.length!==o.length){return this.saveStore(t)}for(const s of t){const[n]=o.filter((t=>t.ProdutoVarianteId==s.ProdutoVarianteId));if(n){return t}}return o}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 s;this.store={name:(s=t.Loja)===null||s===void 0?void 0:s.Nome}}}class n{static of(t){const s=new n;s.bonusBalance=t.bonusBalance;s.bonusIds=t.bonusIds;s.calculatedValue=t.calculatedValue;s.cartId=t.cartId;s.metadata=t.metadata;s.orderId=t.orderId;s.status=t.status;s.totalDiscount=t.totalDiscount;s.totalValue=t.totalValue;s.isBonusProcessed=t.isBonusProcessed;return s}isExpired(){var t;const s=(t=this===null||this===void 0?void 0:this.metadata)===null||t===void 0?void 0:t.createdAt;if(!s)return true;const o=Date.now();const n=o-s;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 s=await r.getInfoCart(t);return new o(s)};const c=async(t,s)=>{const o=await r.getInfoBonus(t,s);return n.of(o)};const a=async(t,s,o={})=>{await r.patchInfoBonus({storeName:t,cartId:s,metadata:o})};const e=()=>{const t=window.location.origin;if(t.includes("localhost")){return s}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{o as C,c as a,i as g,a as p};
|
2
|
+
//# sourceMappingURL=p-b57fbd6d.js.map
|
@@ -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-3eba0eba.js";import{d as e,S as n}from"./p-ecc51430.js";import{i as a}from"./p-c53241bf.js";import{g as r,a as c,C as h}from"./p-b57fbd6d.js";var d;(function(t){t["P"]="Promocao"})(d||(d={}));function l(t=[]){const s=[];for(const i of t){let t=u(i.Ajustes);s.push({sku:i.SKU,value:i.PrecoPor*i.Quantidade,productVariantId:i.ProdutoVarianteId.toString(),quantity:i.Quantidade,discount:t*-1})}return s}function u(t=[]){let s=0;for(const i of t){if(i.Tipo===d.P){s+=i.Valor}}return s}const f=".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 m=f;const p=class{constructor(s){t(this,s);this.crmBonusService=i.getInstance();this.cart=undefined;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(n.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 r();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()}))}))}));a.changeLanguage(a.language);await this.handleLoad();await this.loadSession();await this.loadConfigStore()}async loadConfigStore(){const[t,s]=await Promise.all([this.crmBonusService.getCustomization(this.cartWake.store.name),c(this.cartWake.id,this.cartWake.store.name)]);console.log("[infoBonus]",s);this.reservedInfo=s;if(t.keepStoreFrontStyle){this.styles=null}}async handleLoad(){try{this.cartWake=this.cart?new h(JSON.parse(this.cart)):await r();if(this.cartWake.user.id){this.customer=await this.crmBonusService.getCustomer(this.cartWake.user.id,this.cartWake.store.name);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.session=await this.crmBonusService.getToken(this.cartWake.store.name);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(n.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(n.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 l(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(n.STEP_NAME);this.showModal=true}render(){return s("loading-container",{key:"8a8c5fe7b3e0b44b964d293fe7d645949b132d4f",loading:this.loading_reprocess},s("crm-giftback-form",{key:"80d297d2b957e49f34fadc974f57e7746cf8202c",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"]}};p.style=m;export{p as crm_bonus};
|
2
|
+
//# sourceMappingURL=p-d4821de7.entry.js.map
|
package/dist/env.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
export const CRM_BONUS_API_URL = "https://wake.crmbonus.com/api"; //"http://localhost:4000/api";// "https://wake-middleware.crmbonus.com/api"; //"https://wake-middleware.crmbonus.com/api";// "https://crmbonus-wake-hub-staging-5daedbc4e22b.herokuapp.com/api" //"https://crmbonus-service-staging-d15ba5377115.herokuapp.com"; //"https://typically-workable-perch.ngrok-free.app"; // "http://localhost:3500";
|
1
|
+
export const CRM_BONUS_API_URL = "https://wake-middleware.crmbonus.com/api"; //"http://localhost:4000/api";// "https://wake-middleware.crmbonus.com/api"; //"https://wake-middleware.crmbonus.com/api";// "https://crmbonus-wake-hub-staging-5daedbc4e22b.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":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG
|
1
|
+
{"version":3,"file":"env.js","sourceRoot":"","sources":["../env.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG,0CAA0C,CAAC,CAAC,iVAAiV;AAC9Z,MAAM,CAAC,MAAM,kBAAkB,GAAG,uBAAuB,CAAA","sourcesContent":["export const CRM_BONUS_API_URL = \"https://wake-middleware.crmbonus.com/api\"; //\"http://localhost:4000/api\";// \"https://wake-middleware.crmbonus.com/api\"; //\"https://wake-middleware.crmbonus.com/api\";// \"https://crmbonus-wake-hub-staging-5daedbc4e22b.herokuapp.com/api\" //\"https://crmbonus-service-staging-d15ba5377115.herokuapp.com\"; //\"https://typically-workable-perch.ngrok-free.app\"; // \"http://localhost:3500\";\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-5bc16be9.js';
|
2
2
|
|
3
3
|
class CartWake {
|
4
4
|
constructor(cart) {
|
@@ -110,4 +110,4 @@ const buildUrlBase = () => {
|
|
110
110
|
|
111
111
|
export { CartWake as C, getInfoBonusByCartIdAndStoreName as a, getCart as g, persisteMetadata as p };
|
112
112
|
|
113
|
-
//# sourceMappingURL=cart.helper-
|
113
|
+
//# sourceMappingURL=cart.helper-8be1bc35.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"cart.helper-
|
1
|
+
{"file":"cart.helper-8be1bc35.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,IAA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AAQ,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\";\n\nexport class CartWake {\n id: string;\n middlewareId: string;\n orderId: number;\n products: IProductWake[] = [];\n user: IUser;\n store: IStore;\n\n constructor(cart) {\n this.id = cart.Metadados.id || cart.Id;\n this.middlewareId = cart.Metadados?.id;\n this.orderId = cart.PedidoId;\n this.buildUserInfo(cart);\n this.buildStoreInfo(cart);\n this.products = this.buildStoreCart( cart.Produtos);\n }\n\n private buildStoreCart(newProducts = []) {\n const cache = localStorage.getItem(\"bc:cart\");\n\n if(!cache) {\n return this.saveStore(newProducts)\n \n }\n \n const cacheProducts:IProductWake[] = JSON.parse(cache);\n\n if(newProducts.length !== cacheProducts.length) {\n return this.saveStore(newProducts);\n }\n\n for (const p of newProducts) {\n const [cp] = cacheProducts.filter(cpp => cpp.ProdutoVarianteId == p.ProdutoVarianteId);\n\n if(cp) {\n cp.Quantidade != p.Quantidade;\n\n return newProducts;\n }\n }\n\n return cacheProducts;\n\n }\n\n\n private saveStore(newProducts) {\n localStorage.setItem(\"bc:cart\", JSON.stringify(newProducts));\n\n return newProducts;\n }\n\n private buildUserInfo(cart) {\n this.user = {\n id: cart.Usuario ? cart.Usuario.Id : null\n }\n }\n\n private buildStoreInfo(cart) {\n this.store = {\n name: cart.Loja?.Nome\n }\n }\n}","export class ReservedInfoDTO {\n bonusBalance: string;\n bonusIds: string;\n calculatedValue: string;\n cartId: string;\n metadata: {\n url: string,\n createdAt: number\n }\n orderId: string;\n status: number;\n totalDiscount: string;\n totalValue: string;\n isBonusProcessed?: boolean;\n\n\n public static of(payload: any) {\n const info = new ReservedInfoDTO();\n info.bonusBalance = payload.bonusBalance;\n info.bonusIds = payload.bonusIds;\n info.calculatedValue = payload.calculatedValue;\n info.cartId = payload.cartId;\n info.metadata = payload.metadata;\n info.orderId = payload.orderId;\n info.status = payload.status;\n info.totalDiscount = payload.totalDiscount;\n info.totalValue = payload.totalValue;\n info.isBonusProcessed = payload.isBonusProcessed;\n return info;\n }\n\n public isExpired(): boolean {\n const createdAt = this?.metadata?.createdAt;\n if(!createdAt) return true; \n \n const current = Date.now();\n\n const diffms = current - createdAt;\n\n const diffMinutes = diffms / (1000 * 60);\n\n console.log('diffMinutes', diffMinutes);\n\n return diffMinutes > 6;\n\n }\n\n}","import { CHECKOUT_CART_WAKE } from \"../../env\";\nimport { CartWake } from \"../objectvalues/cart.wake\";\nimport { CrmBonusService } from \"../services/crmbonus.service\";\nimport { ReservedInfoDTO } from '../dto/reserved-info.dto'\n\nconst crmBonusService: CrmBonusService = CrmBonusService.getInstance();\n\nexport const getCart = async (): Promise<CartWake> => {\n const baseUrl = buildUrlBase(); // window.location.origin; //\"https://bycoders.fbits.store\" //window.location.origin;\n \n console.log('[URL STORE]: ', baseUrl)\n\n const cart = await crmBonusService.getInfoCart(baseUrl);\n\n return new CartWake(cart);\n}\n\nexport const getInfoBonusByCartIdAndStoreName = async (cartId, storeName) => {\n const info = await crmBonusService.getInfoBonus(cartId, storeName)\n\n return ReservedInfoDTO.of(info);\n}\n\nexport const persisteMetadata = async (storeName: string, cartId: string, metadata = {}) => {\n await crmBonusService.patchInfoBonus({\n storeName,\n cartId,\n metadata\n })\n}\n\nconst buildUrlBase = () => {\n\n const url = window.location.origin; //\"https://bycoders.checkout.fbits.store\" //\n\n if(url.includes('localhost')) {\n return CHECKOUT_CART_WAKE;\n }\n\n if(url.includes('checkout')) {\n return url;\n }\n\n if(url.includes('fbits')) {\n return url;\n }\n\n if(url.includes(\"www.\")) {\n return url.replace(\"www\", \"checkout\")\n }\n\n return `${window.location.protocol}//checkout.${window.location.host}`;\n\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-5bc16be9.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 { g as getKeyReserveByCartId } from './crmbonus.service-
|
3
|
+
import { g as getKeyReserveByCartId } from './crmbonus.service-5bc16be9.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-8be1bc35.js';
|
6
6
|
import { d as defaultStyles } from './index-dc3ebdf0.js';
|
7
7
|
|
8
8
|
const moneyDollarsSvgrepoComSvg = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPgo8c3ZnIHdpZHRoPSI4MDBweCIgaGVpZ2h0PSI4MDBweCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2Utd2lkdGg9IjIiLz4KPHBhdGggZD0iTTE1IDkuOTQ3MjhDMTQuNSA5LjMgMTMuOCA4LjUgMTIgOC41QzEwLjIgOC41IDkgOS41MTM5MyA5IDkuOTQ3MjhDOSAxMC4zODA2IDkuMDY3ODYgMTAuOTI3NyAxMCAxMS41QzEwLjc1MjIgMTEuOTYxOCAxMi42Njg0IDEyLjA0MzkgMTMuNSAxMi41QzE0LjY3OSAxMy4xNDY3IDE0Ljg0OTcgMTMuODIwMiAxNC44NDk3IDE0LjA1MjJDMTQuODQ5NyAxNC42ODM3IDEzLjQxNzUgMTUuNDg1MiAxMiAxNS41QzEwLjUzNiAxNS41MTUzIDkuNSAxNC43IDkgMTQuMDUyMiIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8cGF0aCBkPSJNMTIgN1YxNyIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2Utd2lkdGg9IjEuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPg==';
|
@@ -1,8 +1,8 @@
|
|
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-5bc16be9.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
|
-
import { g as getCart, a as getInfoBonusByCartIdAndStoreName, C as CartWake } from './cart.helper-
|
5
|
+
import { g as getCart, a as getInfoBonusByCartIdAndStoreName, C as CartWake } from './cart.helper-8be1bc35.js';
|
6
6
|
|
7
7
|
var AjustesTipoEnum;
|
8
8
|
(function (AjustesTipoEnum) {
|
@@ -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-5bc16be9.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-8be1bc35.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-5bc16be9.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 './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I1IDE3LjkzNzEgMS4yNSAxMlpNMTIgMi43NUM2Ljg5MTM3IDIuNzUgMi43NSA2Ljg5MTM3IDIuNzUgMTJDMi43NSAxNy4xMDg2IDYuODkxMzcgMjEuMjUgMTIgMjEuMjVDMTcuMTA4NiAyMS4yNSAyMS4yNSAxNy4xMDg2IDIxLjI1IDEyQzIxLjI1IDYuODkxMzcgMTcuMTA4NiAyLjc1IDEyIDIuNzVaIiBmaWxsPSIjMUMyNzRDIi8+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://wake.crmbonus.com/api"; //"http://localhost:4000/api";// "https://wake-middleware.crmbonus.com/api"; //"https://wake-middleware.crmbonus.com/api";// "https://crmbonus-wake-hub-staging-5daedbc4e22b.herokuapp.com/api" //"https://crmbonus-service-staging-d15ba5377115.herokuapp.com"; //"https://typically-workable-perch.ngrok-free.app"; // "http://localhost:3500";
|
3752
|
+
const CRM_BONUS_API_URL = "https://wake-middleware.crmbonus.com/api"; //"http://localhost:4000/api";// "https://wake-middleware.crmbonus.com/api"; //"https://wake-middleware.crmbonus.com/api";// "https://crmbonus-wake-hub-staging-5daedbc4e22b.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) => {
|
@@ -3898,4 +3898,4 @@ CrmBonusService._instance = null;
|
|
3898
3898
|
|
3899
3899
|
export { CrmBonusService as C, USED_KEY as U, CHECKOUT_CART_WAKE as a, getKeyReserveByCartId as g };
|
3900
3900
|
|
3901
|
-
//# sourceMappingURL=crmbonus.service-
|
3901
|
+
//# sourceMappingURL=crmbonus.service-5bc16be9.js.map
|