crmbonus-component-wake 2.0.111 → 2.0.113

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 (36) hide show
  1. package/dist/cjs/countdown-timer_2.cjs.entry.js +3 -3
  2. package/dist/cjs/countdown-timer_2.cjs.entry.js.map +1 -1
  3. package/dist/cjs/crm-bonus-note.cjs.entry.js +4 -4
  4. package/dist/cjs/crm-bonus-note.cjs.entry.js.map +1 -1
  5. package/dist/collection/components/countdown-timer/countdown-timer.js +4 -4
  6. package/dist/collection/components/countdown-timer/countdown-timer.js.map +1 -1
  7. package/dist/collection/components/note/crm-bonus-note.js +4 -4
  8. package/dist/collection/components/note/crm-bonus-note.js.map +1 -1
  9. package/dist/components/countdown-timer.js +1 -1
  10. package/dist/components/crm-bonus-note.js +5 -5
  11. package/dist/components/crm-bonus-note.js.map +1 -1
  12. package/dist/components/crm-bonus.js +4 -4
  13. package/dist/components/crm-giftback-form.js +1 -1
  14. package/dist/components/giftback-info.js +1 -1
  15. package/dist/components/{p-761e6cd2.js → p-2b3b8d6b.js} +4 -4
  16. package/dist/components/p-2b3b8d6b.js.map +1 -0
  17. package/dist/components/{p-069cacf6.js → p-3951010f.js} +4 -4
  18. package/dist/components/{p-069cacf6.js.map → p-3951010f.js.map} +1 -1
  19. package/dist/components/{p-78cca8a2.js → p-83a12a8f.js} +2 -2
  20. package/dist/components/{p-78cca8a2.js.map → p-83a12a8f.js.map} +1 -1
  21. package/dist/components/{p-a94f3e34.js → p-d3ee0c39.js} +2 -2
  22. package/dist/components/{p-a94f3e34.js.map → p-d3ee0c39.js.map} +1 -1
  23. package/dist/components/pin-form.js +1 -1
  24. package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +1 -1
  25. package/dist/crmbonus-component-wake/p-90716188.entry.js +2 -0
  26. package/dist/crmbonus-component-wake/p-90716188.entry.js.map +1 -0
  27. package/dist/crmbonus-component-wake/{p-35ea89d8.entry.js → p-9baba59d.entry.js} +2 -2
  28. package/dist/crmbonus-component-wake/{p-35ea89d8.entry.js.map → p-9baba59d.entry.js.map} +1 -1
  29. package/dist/esm/countdown-timer_2.entry.js +3 -3
  30. package/dist/esm/countdown-timer_2.entry.js.map +1 -1
  31. package/dist/esm/crm-bonus-note.entry.js +4 -4
  32. package/dist/esm/crm-bonus-note.entry.js.map +1 -1
  33. package/package.json +1 -1
  34. package/dist/components/p-761e6cd2.js.map +0 -1
  35. package/dist/crmbonus-component-wake/p-faff2cf2.entry.js +0 -2
  36. package/dist/crmbonus-component-wake/p-faff2cf2.entry.js.map +0 -1
@@ -8,8 +8,8 @@ const CountdownTimer = class {
8
8
  constructor(hostRef) {
9
9
  index.registerInstance(this, hostRef);
10
10
  this.downtime = undefined;
11
- this.initialValue = 120;
12
- this.seconds = 30;
11
+ this.initialValue = 0;
12
+ this.seconds = 0;
13
13
  }
14
14
  componentWillLoad() {
15
15
  const initial = localStorage.getItem("bc:time");
@@ -37,7 +37,7 @@ const CountdownTimer = class {
37
37
  return `${parseInt(minutes.toString())}m ${seconds}s`;
38
38
  }
39
39
  render() {
40
- return (index.h("label", { key: '51f3be00f4abb6f20fcb9f029d50bbcffc69c111' }, this.padLeft()));
40
+ return (index.h("label", { key: '6fe8811ce04f0f95d31404c2257124f454ab3cfa' }, this.padLeft()));
41
41
  }
42
42
  };
43
43
 
@@ -1 +1 @@
1
- {"file":"countdown-timer.crm-button.entry.cjs.js","mappings":";;;;;;MAMa,cAAc;;;;4BAGQ,GAAG;uBAEP,EAAE;;IAI7B,iBAAiB;QACb,MAAM,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAEhD,IAAI,CAAC,OAAO,GAAI,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC;QAE9D,IAAI,CAAC,UAAU,GAAG,WAAW,CAAC;YAC1B,IAAI,IAAI,CAAC,OAAO,GAAG,CAAC,EAAE;gBAClB,IAAI,CAAC,OAAO,EAAE,CAAC;gBAEf,YAAY,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;aAC5D;iBAAM;gBACH,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;gBAE/B,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAEhB,YAAY,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;aACtC;SACJ,EAAE,IAAI,CAAC,CAAC;KACZ;IAED,oBAAoB;QAChB,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;KAClC;IAED,OAAO;QACH,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAElC,IAAG,OAAO,GAAG,CAAC;YAAE,OAAO,GAAG,OAAO,GAAG,CAAA;QAEpC,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,OAAO,GAAG,CAAA;KACxD;IAED,MAAM;QACF,QACIA,sEAAQ,IAAI,CAAC,OAAO,EAAE,CAAS,EACjC;KACL;;;ACpDL,MAAM,YAAY,GAAG,6PAA6P,CAAC;AACnR,wBAAe,YAAY;;MCKd,MAAM;;;;;;;IAOf,MAAM;QACF,QACIA,kEAAK,KAAK,EAAC,qBAAqB,IAC5BA,qEAAQ,KAAK,EAAC,YAAY,EAAC,OAAO,EAAE,MAAM,IAAI,CAAC,WAAW,EAAE,IAEpD,CAAC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,GAAGA,6BAAiB,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,GAAG,CAEzE,CACP,EACT;KACJ;;;;;;;","names":["h"],"sources":["src/components/countdown-timer/countdown-timer.tsx","src/components/button/crm-button.css?tag=crm-button","src/components/button/index.tsx"],"sourcesContent":["import { Component, h, Prop, State } from '@stencil/core';\n\n@Component({\n tag: 'countdown-timer',\n shadow: true,\n})\nexport class CountdownTimer {\n\n @Prop() downtime: () => void;\n @Prop() initialValue: number = 120;\n\n @State() seconds: number = 30;\n\n private intervalId: NodeJS.Timer;\n\n componentWillLoad() {\n const initial = localStorage.getItem(\"bc:time\");\n\n this.seconds = initial ? Number(initial) : this.initialValue;\n \n this.intervalId = setInterval(() => {\n if (this.seconds > 0) {\n this.seconds--;\n\n localStorage.setItem(\"bc:time\", this.seconds.toString());\n } else {\n clearInterval(this.intervalId);\n\n this.downtime();\n\n localStorage.removeItem(\"bc:time\");\n }\n }, 1000); // Intervalo de 1 segundo\n }\n\n disconnectedCallback() {\n clearInterval(this.intervalId);\n }\n\n padLeft() {\n const minutes = this.seconds / 60; \n const seconds = this.seconds % 60;\n\n if(minutes < 1) return `${seconds}s`\n \n return `${parseInt(minutes.toString())}m ${seconds}s`\n }\n\n render() {\n return (\n <label>{this.padLeft()}</label>\n );\n }\n}\n","input, button {\n margin: 0;\n padding: 10px; /* Ajuste o valor conforme necessário */\n}\n\n.crm-contaner-button {\n height: auto;\n width: auto;\n}\n\n.crm-button {\n height: 48px;\n width: 100%;\n border: 1px solid #000;\n padding: 14px 20px;\n background-color: #000;\n color: #fff;\n font-size: 14px;\n line-height: 20px;\n font-weight: 500;\n cursor: pointer;\n}","import { Component, Prop, h } from \"@stencil/core\";\n\n@Component({\n tag: 'crm-button',\n styleUrl: 'crm-button.css'\n})\nexport class Button {\n\n @Prop() txtBtn: string;\n @Prop() loading: boolean;\n\n @Prop() handleClick: () => void;\n\n render() {\n return (\n <div class=\"crm-contaner-button\">\n <button class=\"crm-button\" onClick={() => this.handleClick()}>\n {\n !this.loading ? this.txtBtn : <loading-spinner size=\"15px\" color=\"#fff\" />\n }\n </button>\n </div>\n )\n }\n}"],"version":3}
1
+ {"file":"countdown-timer.crm-button.entry.cjs.js","mappings":";;;;;;MAMa,cAAc;;;;4BAGQ,CAAC;uBAEL,CAAC;;IAI5B,iBAAiB;QACb,MAA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I,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,GAAGA,6BAAiB,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,GAAG,CAEzE,CACP,EACT;KACJ;;;;;;;","names":["h"],"sources":["src/components/countdown-timer/countdown-timer.tsx","src/components/button/crm-button.css?tag=crm-button","src/components/button/index.tsx"],"sourcesContent":["import { Component, h, Prop, State } from '@stencil/core';\n\n@Component({\n tag: 'countdown-timer',\n shadow: true,\n})\nexport class CountdownTimer {\n\n @Prop() downtime: () => void;\n @Prop() initialValue: number = 0;\n\n @State() seconds: number = 0;\n\n private intervalId: NodeJS.Timer;\n\n componentWillLoad() {\n const initial = localStorage.getItem(\"bc:time\");\n\n this.seconds = initial ? Number(initial) : this.initialValue;\n \n this.intervalId = setInterval(() => {\n if (this.seconds > 0) {\n this.seconds--;\n\n localStorage.setItem(\"bc:time\", this.seconds.toString());\n } else {\n clearInterval(this.intervalId);\n\n this.downtime();\n\n localStorage.removeItem(\"bc:time\");\n }\n }, 1000); // Intervalo de 1 segundo\n }\n\n disconnectedCallback() {\n clearInterval(this.intervalId);\n }\n\n padLeft() {\n const minutes = this.seconds / 60; \n const seconds = this.seconds % 60;\n\n if(minutes < 1) return `${seconds}s`\n \n return `${parseInt(minutes.toString())}m ${seconds}s`\n }\n\n render() {\n return (\n <label>{this.padLeft()}</label>\n );\n }\n}\n","input, button {\n margin: 0;\n padding: 10px; /* Ajuste o valor conforme necessário */\n}\n\n.crm-contaner-button {\n height: auto;\n width: auto;\n}\n\n.crm-button {\n height: 48px;\n width: 100%;\n border: 1px solid #000;\n padding: 14px 20px;\n background-color: #000;\n color: #fff;\n font-size: 14px;\n line-height: 20px;\n font-weight: 500;\n cursor: pointer;\n}","import { Component, Prop, h } from \"@stencil/core\";\n\n@Component({\n tag: 'crm-button',\n styleUrl: 'crm-button.css'\n})\nexport class Button {\n\n @Prop() txtBtn: string;\n @Prop() loading: boolean;\n\n @Prop() handleClick: () => void;\n\n render() {\n return (\n <div class=\"crm-contaner-button\">\n <button class=\"crm-button\" onClick={() => this.handleClick()}>\n {\n !this.loading ? this.txtBtn : <loading-spinner size=\"15px\" color=\"#fff\" />\n }\n </button>\n </div>\n )\n }\n}"],"version":3}
@@ -81,10 +81,10 @@ const CrmBonusNote = class {
81
81
  render() {
82
82
  const giftbackname = this.config.giftbackTitle || "Giftback";
83
83
  const infobonus = this.hasBonus();
84
- return (index.h("div", { key: '2ce9d0ebd4c796ea7812cbd934d8dc2abc7c65d0' }, index.h("div", { key: '4bc8a698cd77677291e58bae000d294f00d9350c', class: "note-container" }, index.h("div", { key: '64edc1f1141614dd6e378c81d0110e1713caed88', class: "note-header" }, index.h("p", { key: '37e52138331897e0e4c43c1b39d2bc56dcb4dae9', class: "note-title" }, index.h("img", { key: '3716f55a0571e5c2c12274935dde99dceb8f10dd', src: moneyDollarsSvgrepoComSvg, width: 23 }), this.config.giftbackTitle), infobonus.hasBonus && (index.h("div", { key: '66f9cfec76b7fb878eab7deea954441c1b61ba4e' }, this.showEdit && (index.h("p", { key: '2dc0b7d75c7cea3923be333fccf2ea15153aed72', class: "back-cart", onClick: () => this.backCart() }, i18n.instance.t("edit"))), !this.showEdit && index.h("countdown-timer", { key: 'ab228f6aa8a691227a8380ff1ff1f677998e6aa8', initialValue: 60, downtime: () => { this.showEdit = true; } })))), infobonus.hasBonus &&
85
- (index.h("p", { key: 'aa70095a7472df8d332d50299977f7b9b645eaa4', class: "note-description-2" }, i18n.instance.t("withApplyBonus", { giftbackname: giftbackname }), " ", index.h("strong", { key: 'a6203afca4c2f02b441eb618fd84c3f9f7254127' }, "R$ ", this.getAmount(), "."))), (infobonus.requestBonus && !infobonus.hasBonus) &&
86
- (index.h("p", { key: 'a75fc7247d5e443600015e340e8d47f3dfa0baf7', class: "note-description-not" }, i18n.instance.t("noBonus", { giftbackname: giftbackname }))), !infobonus.requestBonus &&
87
- (index.h("div", { key: '49d5eea185140c5a06c1f745bf7011b01dd683bb', class: "description" }, index.h("p", { key: '1b2c5ac3753c6fc4162311001be0253007d30a26', class: "note-description-not" }, i18n.instance.t("backCart")), index.h("crm-button", { key: '1fc75a0d0defb7369c6a06814f25627a04753164', txtBtn: "VOLTAR AO CARRINHO", handleClick: () => this.backCart() }))))));
84
+ return (index.h("div", { key: '2ce9d0ebd4c796ea7812cbd934d8dc2abc7c65d0' }, index.h("div", { key: '4bc8a698cd77677291e58bae000d294f00d9350c', class: "note-container" }, index.h("div", { key: '64edc1f1141614dd6e378c81d0110e1713caed88', class: "note-header" }, index.h("p", { key: '37e52138331897e0e4c43c1b39d2bc56dcb4dae9', class: "note-title" }, index.h("img", { key: '3716f55a0571e5c2c12274935dde99dceb8f10dd', src: moneyDollarsSvgrepoComSvg, width: 23 }), this.config.giftbackTitle), infobonus.hasBonus && (index.h("div", { key: '66f9cfec76b7fb878eab7deea954441c1b61ba4e' }, this.showEdit && (index.h("p", { key: '2dc0b7d75c7cea3923be333fccf2ea15153aed72', class: "back-cart", onClick: () => this.backCart() }, i18n.instance.t("edit"))), !this.showEdit && index.h("countdown-timer", { key: '1214e2f683e3024c6ea1a7355f5d0b1aec0b284a', initialValue: 0, downtime: () => { this.showEdit = true; } })))), infobonus.hasBonus &&
85
+ (index.h("p", { key: 'd6f493f22d8f5aefd65606280fd4d92d7f93cd36', class: "note-description-2" }, i18n.instance.t("withApplyBonus", { giftbackname: giftbackname }), " ", index.h("strong", { key: 'f0ab3bf5965d2f17d96da71f82aa604e426c0eac' }, "R$ ", this.getAmount(), "."))), (infobonus.requestBonus && !infobonus.hasBonus) &&
86
+ (index.h("p", { key: '6224d23ad68d4a1e7af4e37561546a0cd8782633', class: "note-description-not" }, i18n.instance.t("noBonus", { giftbackname: giftbackname }))), !infobonus.requestBonus &&
87
+ (index.h("div", { key: 'ce39041c0c2efd14abfe41851a3d65940ca54a56', class: "description" }, index.h("p", { key: '4898ce09cc4d0aa94e15adf0a75a7ae347d6e1e3', class: "note-description-not" }, i18n.instance.t("backCart")), index.h("crm-button", { key: '75f0f8ac5ac675f106ec04f09077040902cac377', txtBtn: "VOLTAR AO CARRINHO", handleClick: () => this.backCart() }))))));
88
88
  }
89
89
  };
90
90
  CrmBonusNote.style = CrmBonusNoteStyle0;
@@ -1 +1 @@
1
- {"file":"crm-bonus-note.entry.cjs.js","mappings":";;;;;;;;;AAAA,MAAM,yBAAyB,GAAG,4gCAA4gC;;SCA9hC,OAAO;IAEnB,IAAG,YAAY,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE;QACtC,OAAM;KACT;IAED,MAAM,IAAI,GAAG,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAE7C,IAAG,CAAC,IAAI,EAAE;QACN,YAAY,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QACvC,YAAY,CAAC,OAAO,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;QAC9C,OAAM;KACT;AACL;;ACbA,MAAM,eAAe,GAAG,i3CAAi3C,CAAC;AAC14C,2BAAe,eAAe;;MCYjB,YAAY;;;;;;;;wBAUQ,KAAK;;IAElC,iBAAiB;QACb,IAAI,CAAC,4BAA4B,EAAE,CAAC;QACpC,IAAI,CAAC,SAAS,EAAE,CAAC;KACpB;IAED,4BAA4B;QAExB,IAAI,CAAC,MAAM,GAAGA,uCAAoB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACnD,MAAM,MAAM,GAAG,QAAQ,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAC;QACzD,MAAM,CAAC,OAAO,CAAC,CAAC,KAAU;YACtB,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC;SACzB,CAAC,CAAC;QAEH,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;KACrC;IAED,UAAU;QACN,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACjD,OAAO,CAAC,CAAC,MAAM,CAAC;KACnB;IAED,SAAS;QACL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Y,IACjBA,kEAAK,GAAG,EAAEC,yBAAK,EAAE,KAAK,EAAE,EAAE,GAAI,EAC7B,IAAI,CAAC,MAAM,CAAC,aAAa,CAC1B,EAEA,SAAS,CAAC,QAAQ,KACdD,oEACK,IAAI,CAAC,QAAQ,KACVA,gEAAG,KAAK,EAAC,WAAW,EAAC,OAAO,EAAE,MAAM,IAAI,CAAC,QAAQ,EAAE,IAC9CE,aAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAClB,CACP,EACA,CAAC,IAAI,CAAC,QAAQ,IAAIF,8EAAiB,YAAY,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAA,EAAE,GAAI,CAChG,CACT,CAEH,EAGF,SAAS,CAAC,QAAQ;aAEdA,gEAAG,KAAK,EAAC,oBAAoB,IACxBE,aAAO,CAAC,CAAC,CAAC,gBAAgB,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC,OAAEF,8EAAY,IAAI,CAAC,SAAS,EAAE,MAAW,CACrG,CACP,EAID,CAAC,SAAS,CAAC,YAAY,IAAI,CAAC,SAAS,CAAC,QAAQ;aAE1CA,gEAAG,KAAK,EAAC,sBAAsB,IAC1BE,aAAO,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC,CACrD,CACP,EAID,CAAC,SAAS,CAAC,YAAY;aAEnBF,kEAAK,KAAK,EAAC,aAAa,IACpBA,gEAAG,KAAK,EAAC,sBAAsB,IAC1BE,aAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CACtB,EACJF,yEAAY,MAAM,EAAC,oBAAoB,EAAC,WAAW,EAAE,MAAM,IAAI,CAAC,QAAQ,EAAE,GAAI,CAC5E,CACT,CAMH,CACJ,EACT;KACJ;;;;;;","names":["getInfoCustomization","getKeyReserveByCartId","h","money","i18next"],"sources":["src/assets/svg/money-dollars-svgrepo-com.svg","src/helpers/time.helper.ts","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 -->\n<svg width=\"800px\" height=\"800px\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<circle cx=\"12\" cy=\"12\" r=\"10\" stroke=\"#000000\" stroke-width=\"2\"/>\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\"/>\n<path d=\"M12 7V17\" stroke=\"#000000\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>","export function setTime() {\n\n if(localStorage.getItem(\"bc:time-allow\")) {\n return\n }\n\n const time = localStorage.getItem(\"bc:time\");\n\n if(!time) {\n localStorage.setItem(\"bc:time\", \"360\");\n localStorage.setItem(\"bc:time-allow\", \"true\");\n return\n } \n}",".note-container {\n border: 1px solid #dddddd;\n padding: 0 15px 15px;\n margin: 0 0 26px 0px;\n display: flex;\n flex-direction: column;\n gap: 13px;\n\n\n & .description {\n display: flex;\n flex-direction: column;\n gap: 13px;\n }\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 { getKeyReserveByCartId } from \"../../utils/keys.storage\";\nimport i18next from \"../../i18n/i18n\"\nimport { IBonus } from \"../../components\";\nimport { setTime } from \"../../helpers/time.helper\";\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 @State() bonus: IBonus;\n\n @State() showEdit: boolean = false;\n\n componentWillLoad() {\n this.upadateCheckToFreteAndGetUrl();\n this.startTime();\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 return amount ? Number(amount).toFixed(2).replace(\".\", \",\") || \"0,00\" : \"0,00\";\n }\n\n async backCart() {\n window.location.href = this.url;\n }\n\n\n private startTime() {\n if(document.location.pathname == '/Fechamento') {\n\n if(!localStorage.getItem(\"bc:time-allow\")) {\n localStorage.removeItem(\"bc:time\")\n }\n\n setTime();\n }\n }\n\n\n hasBonus() {\n const _bonus = localStorage.getItem(getKeyReserveByCartId(this.cartId));\n\n const info = {\n hasBonus: false,\n requestBonus: false\n }\n\n if (_bonus) {\n this.bonus = JSON.parse(_bonus);\n info.hasBonus = this.bonus.hasBonus;\n info.requestBonus = true;\n }\n\n return info;\n }\n\n render() {\n\n const giftbackname = this.config.giftbackTitle || \"Giftback\";\n\n const infobonus = this.hasBonus()\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 infobonus.hasBonus && (\n <div>\n {this.showEdit && (\n <p class=\"back-cart\" onClick={() => this.backCart()}>\n {i18next.t(\"edit\")}\n </p>\n )}\n {!this.showEdit && <countdown-timer initialValue={60} downtime={() => { this.showEdit = true }} />}\n </div>\n )\n }\n </div>\n\n {\n infobonus.hasBonus &&\n (\n <p class=\"note-description-2\">\n {i18next.t(\"withApplyBonus\", { giftbackname: giftbackname })} <strong>R$ {this.getAmount()}.</strong>\n </p>\n )\n }\n\n {\n (infobonus.requestBonus && !infobonus.hasBonus) &&\n (\n <p class=\"note-description-not\">\n {i18next.t(\"noBonus\", { giftbackname: giftbackname })}\n </p>\n )\n }\n\n {\n !infobonus.requestBonus &&\n (\n <div class=\"description\">\n <p class=\"note-description-not\">\n {i18next.t(\"backCart\")}\n </p>\n <crm-button txtBtn=\"VOLTAR AO CARRINHO\" handleClick={() => this.backCart()} />\n </div>\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.cjs.js","mappings":";;;;;;;;;AAAA,MAAM,yBAAyB,GAAG,4gCAA4gC;;SCA9hC,OAAO;IAEnB,IAAG,YAAY,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE;QACtC,OAAM;KACT;IAED,MAAM,I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,IAAIF,8EAAiB,YAAY,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAA,EAAE,GAAI,CAC/F,CACT,CAEH,EAGF,SAAS,CAAC,QAAQ;aAEdA,gEAAG,KAAK,EAAC,oBAAoB,IACxBE,aAAO,CAAC,CAAC,CAAC,gBAAgB,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC,OAAEF,8EAAY,IAAI,CAAC,SAAS,EAAE,MAAW,CACrG,CACP,EAID,CAAC,SAAS,CAAC,YAAY,IAAI,CAAC,SAAS,CAAC,QAAQ;aAE1CA,gEAAG,KAAK,EAAC,sBAAsB,IAC1BE,aAAO,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC,CACrD,CACP,EAID,CAAC,SAAS,CAAC,YAAY;aAEnBF,kEAAK,KAAK,EAAC,aAAa,IACpBA,gEAAG,KAAK,EAAC,sBAAsB,IAC1BE,aAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CACtB,EACJF,yEAAY,MAAM,EAAC,oBAAoB,EAAC,WAAW,EAAE,MAAM,IAAI,CAAC,QAAQ,EAAE,GAAI,CAC5E,CACT,CAMH,CACJ,EACT;KACJ;;;;;;","names":["getInfoCustomization","getKeyReserveByCartId","h","money","i18next"],"sources":["src/assets/svg/money-dollars-svgrepo-com.svg","src/helpers/time.helper.ts","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 -->\n<svg width=\"800px\" height=\"800px\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<circle cx=\"12\" cy=\"12\" r=\"10\" stroke=\"#000000\" stroke-width=\"2\"/>\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\"/>\n<path d=\"M12 7V17\" stroke=\"#000000\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>","export function setTime() {\n\n if(localStorage.getItem(\"bc:time-allow\")) {\n return\n }\n\n const time = localStorage.getItem(\"bc:time\");\n\n if(!time) {\n localStorage.setItem(\"bc:time\", \"360\");\n localStorage.setItem(\"bc:time-allow\", \"true\");\n return\n } \n}",".note-container {\n border: 1px solid #dddddd;\n padding: 0 15px 15px;\n margin: 0 0 26px 0px;\n display: flex;\n flex-direction: column;\n gap: 13px;\n\n\n & .description {\n display: flex;\n flex-direction: column;\n gap: 13px;\n }\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 { getKeyReserveByCartId } from \"../../utils/keys.storage\";\nimport i18next from \"../../i18n/i18n\"\nimport { IBonus } from \"../../components\";\nimport { setTime } from \"../../helpers/time.helper\";\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 @State() bonus: IBonus;\n\n @State() showEdit: boolean = false;\n\n componentWillLoad() {\n this.upadateCheckToFreteAndGetUrl();\n this.startTime();\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 return amount ? Number(amount).toFixed(2).replace(\".\", \",\") || \"0,00\" : \"0,00\";\n }\n\n async backCart() {\n window.location.href = this.url;\n }\n\n\n private startTime() {\n if(document.location.pathname == '/Fechamento') {\n\n if(!localStorage.getItem(\"bc:time-allow\")) {\n localStorage.removeItem(\"bc:time\")\n }\n\n setTime();\n }\n }\n\n\n hasBonus() {\n const _bonus = localStorage.getItem(getKeyReserveByCartId(this.cartId));\n\n const info = {\n hasBonus: false,\n requestBonus: false\n }\n\n if (_bonus) {\n this.bonus = JSON.parse(_bonus);\n info.hasBonus = this.bonus.hasBonus;\n info.requestBonus = true;\n }\n\n return info;\n }\n\n render() {\n\n const giftbackname = this.config.giftbackTitle || \"Giftback\";\n\n const infobonus = this.hasBonus()\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 infobonus.hasBonus && (\n <div>\n {this.showEdit && (\n <p class=\"back-cart\" onClick={() => this.backCart()}>\n {i18next.t(\"edit\")}\n </p>\n )}\n {!this.showEdit && <countdown-timer initialValue={0} downtime={() => { this.showEdit = true }} />}\n </div>\n )\n }\n </div>\n\n {\n infobonus.hasBonus &&\n (\n <p class=\"note-description-2\">\n {i18next.t(\"withApplyBonus\", { giftbackname: giftbackname })} <strong>R$ {this.getAmount()}.</strong>\n </p>\n )\n }\n\n {\n (infobonus.requestBonus && !infobonus.hasBonus) &&\n (\n <p class=\"note-description-not\">\n {i18next.t(\"noBonus\", { giftbackname: giftbackname })}\n </p>\n )\n }\n\n {\n !infobonus.requestBonus &&\n (\n <div class=\"description\">\n <p class=\"note-description-not\">\n {i18next.t(\"backCart\")}\n </p>\n <crm-button txtBtn=\"VOLTAR AO CARRINHO\" handleClick={() => this.backCart()} />\n </div>\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}
@@ -2,8 +2,8 @@ import { h } from "@stencil/core";
2
2
  export class CountdownTimer {
3
3
  constructor() {
4
4
  this.downtime = undefined;
5
- this.initialValue = 120;
6
- this.seconds = 30;
5
+ this.initialValue = 0;
6
+ this.seconds = 0;
7
7
  }
8
8
  componentWillLoad() {
9
9
  const initial = localStorage.getItem("bc:time");
@@ -31,7 +31,7 @@ export class CountdownTimer {
31
31
  return `${parseInt(minutes.toString())}m ${seconds}s`;
32
32
  }
33
33
  render() {
34
- return (h("label", { key: '51f3be00f4abb6f20fcb9f029d50bbcffc69c111' }, this.padLeft()));
34
+ return (h("label", { key: '6fe8811ce04f0f95d31404c2257124f454ab3cfa' }, this.padLeft()));
35
35
  }
36
36
  static get is() { return "countdown-timer"; }
37
37
  static get encapsulation() { return "shadow"; }
@@ -68,7 +68,7 @@ export class CountdownTimer {
68
68
  },
69
69
  "attribute": "initial-value",
70
70
  "reflect": false,
71
- "defaultValue": "120"
71
+ "defaultValue": "0"
72
72
  }
73
73
  };
74
74
  }
@@ -1 +1 @@
1
- {"version":3,"file":"countdown-timer.js","sourceRoot":"","sources":["../../../../src/components/countdown-timer/countdown-timer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAM1D,MAAM,OAAO,cAAc;;;4BAGQ,GAAG;uBAEP,EAAE;;IAI7B,iBAAiB;QACb,MAAM,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAEhD,IAAI,CAAC,OAAO,GAAI,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC;QAE9D,IAAI,CAAC,UAAU,GAAG,WAAW,CAAC,GAAG,EAAE;YAC/B,IAAI,IAAI,CAAC,OAAO,GAAG,CAAC,EAAE,CAAC;gBACnB,IAAI,CAAC,OAAO,EAAE,CAAC;gBAEf,YAAY,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;YAC7D,CAAC;iBAAM,CAAC;gBACJ,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;gBAE/B,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAEhB,YAAY,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;YACvC,CAAC;QACL,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,yBAAyB;IACvC,CAAC;IAED,oBAAoB;QAChB,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACnC,CAAC;IAED,OAAO;QACH,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAElC,IAAG,OAAO,GAAG,CAAC;YAAE,OAAO,GAAG,OAAO,GAAG,CAAA;QAEpC,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,OAAO,GAAG,CAAA;IACzD,CAAC;IAED,MAAM;QACF,OAAO,CACH,gEAAQ,IAAI,CAAC,OAAO,EAAE,CAAS,CAClC,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, h, Prop, State } from '@stencil/core';\n\n@Component({\n tag: 'countdown-timer',\n shadow: true,\n})\nexport class CountdownTimer {\n\n @Prop() downtime: () => void;\n @Prop() initialValue: number = 120;\n\n @State() seconds: number = 30;\n\n private intervalId: NodeJS.Timer;\n\n componentWillLoad() {\n const initial = localStorage.getItem(\"bc:time\");\n\n this.seconds = initial ? Number(initial) : this.initialValue;\n \n this.intervalId = setInterval(() => {\n if (this.seconds > 0) {\n this.seconds--;\n\n localStorage.setItem(\"bc:time\", this.seconds.toString());\n } else {\n clearInterval(this.intervalId);\n\n this.downtime();\n\n localStorage.removeItem(\"bc:time\");\n }\n }, 1000); // Intervalo de 1 segundo\n }\n\n disconnectedCallback() {\n clearInterval(this.intervalId);\n }\n\n padLeft() {\n const minutes = this.seconds / 60; \n const seconds = this.seconds % 60;\n\n if(minutes < 1) return `${seconds}s`\n \n return `${parseInt(minutes.toString())}m ${seconds}s`\n }\n\n render() {\n return (\n <label>{this.padLeft()}</label>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"countdown-timer.js","sourceRoot":"","sources":["../../../../src/components/countdown-timer/countdown-timer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAM1D,MAAM,OAAO,cAAc;;;4BAGQ,CAAC;uBAEL,CAAC;;IAI5B,iBAAiB;QACb,MAAM,OAAO,GAAG,YAAY,C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downTimer {\n\n @Prop() downtime: () => void;\n @Prop() initialValue: number = 0;\n\n @State() seconds: number = 0;\n\n private intervalId: NodeJS.Timer;\n\n componentWillLoad() {\n const initial = localStorage.getItem(\"bc:time\");\n\n this.seconds = initial ? Number(initial) : this.initialValue;\n \n this.intervalId = setInterval(() => {\n if (this.seconds > 0) {\n this.seconds--;\n\n localStorage.setItem(\"bc:time\", this.seconds.toString());\n } else {\n clearInterval(this.intervalId);\n\n this.downtime();\n\n localStorage.removeItem(\"bc:time\");\n }\n }, 1000); // Intervalo de 1 segundo\n }\n\n disconnectedCallback() {\n clearInterval(this.intervalId);\n }\n\n padLeft() {\n const minutes = this.seconds / 60; \n const seconds = this.seconds % 60;\n\n if(minutes < 1) return `${seconds}s`\n \n return `${parseInt(minutes.toString())}m ${seconds}s`\n }\n\n render() {\n return (\n <label>{this.padLeft()}</label>\n );\n }\n}\n"]}
@@ -60,10 +60,10 @@ export class CrmBonusNote {
60
60
  render() {
61
61
  const giftbackname = this.config.giftbackTitle || "Giftback";
62
62
  const infobonus = this.hasBonus();
63
- return (h("div", { key: '2ce9d0ebd4c796ea7812cbd934d8dc2abc7c65d0' }, h("div", { key: '4bc8a698cd77677291e58bae000d294f00d9350c', class: "note-container" }, h("div", { key: '64edc1f1141614dd6e378c81d0110e1713caed88', class: "note-header" }, h("p", { key: '37e52138331897e0e4c43c1b39d2bc56dcb4dae9', class: "note-title" }, h("img", { key: '3716f55a0571e5c2c12274935dde99dceb8f10dd', src: money, width: 23 }), this.config.giftbackTitle), infobonus.hasBonus && (h("div", { key: '66f9cfec76b7fb878eab7deea954441c1b61ba4e' }, this.showEdit && (h("p", { key: '2dc0b7d75c7cea3923be333fccf2ea15153aed72', class: "back-cart", onClick: () => this.backCart() }, i18next.t("edit"))), !this.showEdit && h("countdown-timer", { key: 'ab228f6aa8a691227a8380ff1ff1f677998e6aa8', initialValue: 60, downtime: () => { this.showEdit = true; } })))), infobonus.hasBonus &&
64
- (h("p", { key: 'aa70095a7472df8d332d50299977f7b9b645eaa4', class: "note-description-2" }, i18next.t("withApplyBonus", { giftbackname: giftbackname }), " ", h("strong", { key: 'a6203afca4c2f02b441eb618fd84c3f9f7254127' }, "R$ ", this.getAmount(), "."))), (infobonus.requestBonus && !infobonus.hasBonus) &&
65
- (h("p", { key: 'a75fc7247d5e443600015e340e8d47f3dfa0baf7', class: "note-description-not" }, i18next.t("noBonus", { giftbackname: giftbackname }))), !infobonus.requestBonus &&
66
- (h("div", { key: '49d5eea185140c5a06c1f745bf7011b01dd683bb', class: "description" }, h("p", { key: '1b2c5ac3753c6fc4162311001be0253007d30a26', class: "note-description-not" }, i18next.t("backCart")), h("crm-button", { key: '1fc75a0d0defb7369c6a06814f25627a04753164', txtBtn: "VOLTAR AO CARRINHO", handleClick: () => this.backCart() }))))));
63
+ return (h("div", { key: '2ce9d0ebd4c796ea7812cbd934d8dc2abc7c65d0' }, h("div", { key: '4bc8a698cd77677291e58bae000d294f00d9350c', class: "note-container" }, h("div", { key: '64edc1f1141614dd6e378c81d0110e1713caed88', class: "note-header" }, h("p", { key: '37e52138331897e0e4c43c1b39d2bc56dcb4dae9', class: "note-title" }, h("img", { key: '3716f55a0571e5c2c12274935dde99dceb8f10dd', src: money, width: 23 }), this.config.giftbackTitle), infobonus.hasBonus && (h("div", { key: '66f9cfec76b7fb878eab7deea954441c1b61ba4e' }, this.showEdit && (h("p", { key: '2dc0b7d75c7cea3923be333fccf2ea15153aed72', class: "back-cart", onClick: () => this.backCart() }, i18next.t("edit"))), !this.showEdit && h("countdown-timer", { key: '1214e2f683e3024c6ea1a7355f5d0b1aec0b284a', initialValue: 0, downtime: () => { this.showEdit = true; } })))), infobonus.hasBonus &&
64
+ (h("p", { key: 'd6f493f22d8f5aefd65606280fd4d92d7f93cd36', class: "note-description-2" }, i18next.t("withApplyBonus", { giftbackname: giftbackname }), " ", h("strong", { key: 'f0ab3bf5965d2f17d96da71f82aa604e426c0eac' }, "R$ ", this.getAmount(), "."))), (infobonus.requestBonus && !infobonus.hasBonus) &&
65
+ (h("p", { key: '6224d23ad68d4a1e7af4e37561546a0cd8782633', class: "note-description-not" }, i18next.t("noBonus", { giftbackname: giftbackname }))), !infobonus.requestBonus &&
66
+ (h("div", { key: 'ce39041c0c2efd14abfe41851a3d65940ca54a56', class: "description" }, h("p", { key: '4898ce09cc4d0aa94e15adf0a75a7ae347d6e1e3', class: "note-description-not" }, i18next.t("backCart")), h("crm-button", { key: '75f0f8ac5ac675f106ec04f09077040902cac377', txtBtn: "VOLTAR AO CARRINHO", handleClick: () => this.backCart() }))))));
67
67
  }
68
68
  static get is() { return "crm-bonus-note"; }
69
69
  static get originalStyleUrls() {
@@ -1 +1 @@
1
- {"version":3,"file":"crm-bonus-note.js","sourceRoot":"","sources":["../../../../src/components/note/crm-bonus-note.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAc,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAEpF,OAAO,KAAK,MAAM,gDAAgD,CAAA;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,OAAO,MAAM,iBAAiB,CAAA;AAErC,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAMpD,MAAM,OAAO,YAAY;;;;;;;wBAUQ,KAAK;;IAElC,iBAAiB;QACb,IAAI,CAAC,4BAA4B,EAAE,CAAC;QACpC,IAAI,CAAC,SAAS,EAAE,CAAC;IACrB,CAAC;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,OAAO,CAAC,CAAC,KAAU,EAAE,EAAE;YAC1B,KAAK,CAAC,OAAO,GAAG,KAAK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AAY,EAAE,CAAC,CACrD,CACP;gBAID,CAAC,SAAS,CAAC,YAAY;oBACvB,CACI,4DAAK,KAAK,EAAC,aAAa;wBACpB,0DAAG,KAAK,EAAC,sBAAsB,IAC1B,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CACtB;wBACJ,mEAAY,MAAM,EAAC,oBAAoB,EAAC,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAI,CAC5E,CACT,CAMH,CACJ,CACT,CAAA;IACL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["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 { getKeyReserveByCartId } from \"../../utils/keys.storage\";\nimport i18next from \"../../i18n/i18n\"\nimport { IBonus } from \"../../components\";\nimport { setTime } from \"../../helpers/time.helper\";\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 @State() bonus: IBonus;\n\n @State() showEdit: boolean = false;\n\n componentWillLoad() {\n this.upadateCheckToFreteAndGetUrl();\n this.startTime();\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 return amount ? Number(amount).toFixed(2).replace(\".\", \",\") || \"0,00\" : \"0,00\";\n }\n\n async backCart() {\n window.location.href = this.url;\n }\n\n\n private startTime() {\n if(document.location.pathname == '/Fechamento') {\n\n if(!localStorage.getItem(\"bc:time-allow\")) {\n localStorage.removeItem(\"bc:time\")\n }\n\n setTime();\n }\n }\n\n\n hasBonus() {\n const _bonus = localStorage.getItem(getKeyReserveByCartId(this.cartId));\n\n const info = {\n hasBonus: false,\n requestBonus: false\n }\n\n if (_bonus) {\n this.bonus = JSON.parse(_bonus);\n info.hasBonus = this.bonus.hasBonus;\n info.requestBonus = true;\n }\n\n return info;\n }\n\n render() {\n\n const giftbackname = this.config.giftbackTitle || \"Giftback\";\n\n const infobonus = this.hasBonus()\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 infobonus.hasBonus && (\n <div>\n {this.showEdit && (\n <p class=\"back-cart\" onClick={() => this.backCart()}>\n {i18next.t(\"edit\")}\n </p>\n )}\n {!this.showEdit && <countdown-timer initialValue={60} downtime={() => { this.showEdit = true }} />}\n </div>\n )\n }\n </div>\n\n {\n infobonus.hasBonus &&\n (\n <p class=\"note-description-2\">\n {i18next.t(\"withApplyBonus\", { giftbackname: giftbackname })} <strong>R$ {this.getAmount()}.</strong>\n </p>\n )\n }\n\n {\n (infobonus.requestBonus && !infobonus.hasBonus) &&\n (\n <p class=\"note-description-not\">\n {i18next.t(\"noBonus\", { giftbackname: giftbackname })}\n </p>\n )\n }\n\n {\n !infobonus.requestBonus &&\n (\n <div class=\"description\">\n <p class=\"note-description-not\">\n {i18next.t(\"backCart\")}\n </p>\n <crm-button txtBtn=\"VOLTAR AO CARRINHO\" handleClick={() => this.backCart()} />\n </div>\n )\n }\n\n {/* <a class=\"back-cart\" href={this.url}>\n Voltar ao carrinho\n </a> */}\n </div>\n </div>\n )\n }\n}"]}
1
+ {"version":3,"file":"crm-bonus-note.js","sourceRoot":"","sources":["../../../../src/components/note/crm-bonus-note.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,K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WAAW,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,IAC9C,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAClB,CACP;wBACA,CAAC,IAAI,CAAC,QAAQ,IAAI,wEAAiB,YAAY,EAAE,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAA,CAAC,CAAC,GAAI,CAC/F,CACT,CAEH;gBAGF,SAAS,CAAC,QAAQ;oBAClB,CACI,0DAAG,KAAK,EAAC,oBAAoB;wBACxB,OAAO,CAAC,CAAC,CAAC,gBAAgB,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC;;wBAAE;;4BAAY,IAAI,CAAC,SAAS,EAAE;gCAAW,CACrG,CACP;gBAID,CAAC,SAAS,CAAC,YAAY,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;oBAC/C,CACI,0DAAG,KAAK,EAAC,sBAAsB,IAC1B,OAAO,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC,CACrD,CACP;gBAID,CAAC,SAAS,CAAC,YAAY;oBACvB,CACI,4DAAK,KAAK,EAAC,aAAa;wBACpB,0DAAG,KAAK,EAAC,sBAAsB,IAC1B,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CACtB;wBACJ,mEAAY,MAAM,EAAC,oBAAoB,EAAC,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAI,CAC5E,CACT,CAMH,CACJ,CACT,CAAA;IACL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["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 { getKeyReserveByCartId } from \"../../utils/keys.storage\";\nimport i18next from \"../../i18n/i18n\"\nimport { IBonus } from \"../../components\";\nimport { setTime } from \"../../helpers/time.helper\";\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 @State() bonus: IBonus;\n\n @State() showEdit: boolean = false;\n\n componentWillLoad() {\n this.upadateCheckToFreteAndGetUrl();\n this.startTime();\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 return amount ? Number(amount).toFixed(2).replace(\".\", \",\") || \"0,00\" : \"0,00\";\n }\n\n async backCart() {\n window.location.href = this.url;\n }\n\n\n private startTime() {\n if(document.location.pathname == '/Fechamento') {\n\n if(!localStorage.getItem(\"bc:time-allow\")) {\n localStorage.removeItem(\"bc:time\")\n }\n\n setTime();\n }\n }\n\n\n hasBonus() {\n const _bonus = localStorage.getItem(getKeyReserveByCartId(this.cartId));\n\n const info = {\n hasBonus: false,\n requestBonus: false\n }\n\n if (_bonus) {\n this.bonus = JSON.parse(_bonus);\n info.hasBonus = this.bonus.hasBonus;\n info.requestBonus = true;\n }\n\n return info;\n }\n\n render() {\n\n const giftbackname = this.config.giftbackTitle || \"Giftback\";\n\n const infobonus = this.hasBonus()\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 infobonus.hasBonus && (\n <div>\n {this.showEdit && (\n <p class=\"back-cart\" onClick={() => this.backCart()}>\n {i18next.t(\"edit\")}\n </p>\n )}\n {!this.showEdit && <countdown-timer initialValue={0} downtime={() => { this.showEdit = true }} />}\n </div>\n )\n }\n </div>\n\n {\n infobonus.hasBonus &&\n (\n <p class=\"note-description-2\">\n {i18next.t(\"withApplyBonus\", { giftbackname: giftbackname })} <strong>R$ {this.getAmount()}.</strong>\n </p>\n )\n }\n\n {\n (infobonus.requestBonus && !infobonus.hasBonus) &&\n (\n <p class=\"note-description-not\">\n {i18next.t(\"noBonus\", { giftbackname: giftbackname })}\n </p>\n )\n }\n\n {\n !infobonus.requestBonus &&\n (\n <div class=\"description\">\n <p class=\"note-description-not\">\n {i18next.t(\"backCart\")}\n </p>\n <crm-button txtBtn=\"VOLTAR AO CARRINHO\" handleClick={() => this.backCart()} />\n </div>\n )\n }\n\n {/* <a class=\"back-cart\" href={this.url}>\n Voltar ao carrinho\n </a> */}\n </div>\n </div>\n )\n }\n}"]}
@@ -1,4 +1,4 @@
1
- import { C as CountdownTimer$1, d as defineCustomElement$1 } from './p-761e6cd2.js';
1
+ import { C as CountdownTimer$1, d as defineCustomElement$1 } from './p-2b3b8d6b.js';
2
2
 
3
3
  const CountdownTimer = CountdownTimer$1;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -2,7 +2,7 @@ import { p as proxyCustomElement, H, h } from './p-3e84f78c.js';
2
2
  import { g as getInfoCustomization } from './p-75ba7b9a.js';
3
3
  import { g as getKeyReserveByCartId } from './p-f9aeffc1.js';
4
4
  import { i as instance } from './p-e8c19a64.js';
5
- import { d as defineCustomElement$4 } from './p-761e6cd2.js';
5
+ import { d as defineCustomElement$4 } from './p-2b3b8d6b.js';
6
6
  import { d as defineCustomElement$3 } from './p-47f9da55.js';
7
7
  import { d as defineCustomElement$2 } from './p-fe9c3966.js';
8
8
 
@@ -81,10 +81,10 @@ const CrmBonusNote$1 = /*@__PURE__*/ proxyCustomElement(class CrmBonusNote exten
81
81
  render() {
82
82
  const giftbackname = this.config.giftbackTitle || "Giftback";
83
83
  const infobonus = this.hasBonus();
84
- return (h("div", { key: '2ce9d0ebd4c796ea7812cbd934d8dc2abc7c65d0' }, h("div", { key: '4bc8a698cd77677291e58bae000d294f00d9350c', class: "note-container" }, h("div", { key: '64edc1f1141614dd6e378c81d0110e1713caed88', class: "note-header" }, h("p", { key: '37e52138331897e0e4c43c1b39d2bc56dcb4dae9', class: "note-title" }, h("img", { key: '3716f55a0571e5c2c12274935dde99dceb8f10dd', src: moneyDollarsSvgrepoComSvg, width: 23 }), this.config.giftbackTitle), infobonus.hasBonus && (h("div", { key: '66f9cfec76b7fb878eab7deea954441c1b61ba4e' }, this.showEdit && (h("p", { key: '2dc0b7d75c7cea3923be333fccf2ea15153aed72', class: "back-cart", onClick: () => this.backCart() }, instance.t("edit"))), !this.showEdit && h("countdown-timer", { key: 'ab228f6aa8a691227a8380ff1ff1f677998e6aa8', initialValue: 60, downtime: () => { this.showEdit = true; } })))), infobonus.hasBonus &&
85
- (h("p", { key: 'aa70095a7472df8d332d50299977f7b9b645eaa4', class: "note-description-2" }, instance.t("withApplyBonus", { giftbackname: giftbackname }), " ", h("strong", { key: 'a6203afca4c2f02b441eb618fd84c3f9f7254127' }, "R$ ", this.getAmount(), "."))), (infobonus.requestBonus && !infobonus.hasBonus) &&
86
- (h("p", { key: 'a75fc7247d5e443600015e340e8d47f3dfa0baf7', class: "note-description-not" }, instance.t("noBonus", { giftbackname: giftbackname }))), !infobonus.requestBonus &&
87
- (h("div", { key: '49d5eea185140c5a06c1f745bf7011b01dd683bb', class: "description" }, h("p", { key: '1b2c5ac3753c6fc4162311001be0253007d30a26', class: "note-description-not" }, instance.t("backCart")), h("crm-button", { key: '1fc75a0d0defb7369c6a06814f25627a04753164', txtBtn: "VOLTAR AO CARRINHO", handleClick: () => this.backCart() }))))));
84
+ return (h("div", { key: '2ce9d0ebd4c796ea7812cbd934d8dc2abc7c65d0' }, h("div", { key: '4bc8a698cd77677291e58bae000d294f00d9350c', class: "note-container" }, h("div", { key: '64edc1f1141614dd6e378c81d0110e1713caed88', class: "note-header" }, h("p", { key: '37e52138331897e0e4c43c1b39d2bc56dcb4dae9', class: "note-title" }, h("img", { key: '3716f55a0571e5c2c12274935dde99dceb8f10dd', src: moneyDollarsSvgrepoComSvg, width: 23 }), this.config.giftbackTitle), infobonus.hasBonus && (h("div", { key: '66f9cfec76b7fb878eab7deea954441c1b61ba4e' }, this.showEdit && (h("p", { key: '2dc0b7d75c7cea3923be333fccf2ea15153aed72', class: "back-cart", onClick: () => this.backCart() }, instance.t("edit"))), !this.showEdit && h("countdown-timer", { key: '1214e2f683e3024c6ea1a7355f5d0b1aec0b284a', initialValue: 0, downtime: () => { this.showEdit = true; } })))), infobonus.hasBonus &&
85
+ (h("p", { key: 'd6f493f22d8f5aefd65606280fd4d92d7f93cd36', class: "note-description-2" }, instance.t("withApplyBonus", { giftbackname: giftbackname }), " ", h("strong", { key: 'f0ab3bf5965d2f17d96da71f82aa604e426c0eac' }, "R$ ", this.getAmount(), "."))), (infobonus.requestBonus && !infobonus.hasBonus) &&
86
+ (h("p", { key: '6224d23ad68d4a1e7af4e37561546a0cd8782633', class: "note-description-not" }, instance.t("noBonus", { giftbackname: giftbackname }))), !infobonus.requestBonus &&
87
+ (h("div", { key: 'ce39041c0c2efd14abfe41851a3d65940ca54a56', class: "description" }, h("p", { key: '4898ce09cc4d0aa94e15adf0a75a7ae347d6e1e3', class: "note-description-not" }, instance.t("backCart")), h("crm-button", { key: '75f0f8ac5ac675f106ec04f09077040902cac377', txtBtn: "VOLTAR AO CARRINHO", handleClick: () => this.backCart() }))))));
88
88
  }
89
89
  static get style() { return CrmBonusNoteStyle0; }
90
90
  }, [0, "crm-bonus-note", {
@@ -1 +1 @@
1
- {"file":"crm-bonus-note.js","mappings":";;;;;;;;AAAA,MAAM,yBAAyB,GAAG,4gCAA4gC;;SCA9hC,OAAO;IAEnB,IAAG,YAAY,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE;QACtC,OAAM;KACT;IAED,MAAM,IAAI,GAAG,YAAY,CAAC,OAAO,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AAE,QAAQ,EAAE,QAAQ,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAA,EAAE,GAAI,CAChG,CACT,CAEH,EAGF,SAAS,CAAC,QAAQ;aAEd,0DAAG,KAAK,EAAC,oBAAoB,IACxBA,QAAO,CAAC,CAAC,CAAC,gBAAgB,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC,OAAE,wEAAY,IAAI,CAAC,SAAS,EAAE,MAAW,CACrG,CACP,EAID,CAAC,SAAS,CAAC,YAAY,IAAI,CAAC,SAAS,CAAC,QAAQ;aAE1C,0DAAG,KAAK,EAAC,sBAAsB,IAC1BA,QAAO,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC,CACrD,CACP,EAID,CAAC,SAAS,CAAC,YAAY;aAEnB,4DAAK,KAAK,EAAC,aAAa,IACpB,0DAAG,KAAK,EAAC,sBAAsB,IAC1BA,QAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CACtB,EACJ,mEAAY,MAAM,EAAC,oBAAoB,EAAC,WAAW,EAAE,MAAM,IAAI,CAAC,QAAQ,EAAE,GAAI,CAC5E,CACT,CAMH,CACJ,EACT;KACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CrmBonusNote","money","i18next"],"sources":["src/assets/svg/money-dollars-svgrepo-com.svg","src/helpers/time.helper.ts","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 -->\n<svg width=\"800px\" height=\"800px\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<circle cx=\"12\" cy=\"12\" r=\"10\" stroke=\"#000000\" stroke-width=\"2\"/>\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\"/>\n<path d=\"M12 7V17\" stroke=\"#000000\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>","export function setTime() {\n\n if(localStorage.getItem(\"bc:time-allow\")) {\n return\n }\n\n const time = localStorage.getItem(\"bc:time\");\n\n if(!time) {\n localStorage.setItem(\"bc:time\", \"360\");\n localStorage.setItem(\"bc:time-allow\", \"true\");\n return\n } \n}",".note-container {\n border: 1px solid #dddddd;\n padding: 0 15px 15px;\n margin: 0 0 26px 0px;\n display: flex;\n flex-direction: column;\n gap: 13px;\n\n\n & .description {\n display: flex;\n flex-direction: column;\n gap: 13px;\n }\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 { getKeyReserveByCartId } from \"../../utils/keys.storage\";\nimport i18next from \"../../i18n/i18n\"\nimport { IBonus } from \"../../components\";\nimport { setTime } from \"../../helpers/time.helper\";\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 @State() bonus: IBonus;\n\n @State() showEdit: boolean = false;\n\n componentWillLoad() {\n this.upadateCheckToFreteAndGetUrl();\n this.startTime();\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 return amount ? Number(amount).toFixed(2).replace(\".\", \",\") || \"0,00\" : \"0,00\";\n }\n\n async backCart() {\n window.location.href = this.url;\n }\n\n\n private startTime() {\n if(document.location.pathname == '/Fechamento') {\n\n if(!localStorage.getItem(\"bc:time-allow\")) {\n localStorage.removeItem(\"bc:time\")\n }\n\n setTime();\n }\n }\n\n\n hasBonus() {\n const _bonus = localStorage.getItem(getKeyReserveByCartId(this.cartId));\n\n const info = {\n hasBonus: false,\n requestBonus: false\n }\n\n if (_bonus) {\n this.bonus = JSON.parse(_bonus);\n info.hasBonus = this.bonus.hasBonus;\n info.requestBonus = true;\n }\n\n return info;\n }\n\n render() {\n\n const giftbackname = this.config.giftbackTitle || \"Giftback\";\n\n const infobonus = this.hasBonus()\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 infobonus.hasBonus && (\n <div>\n {this.showEdit && (\n <p class=\"back-cart\" onClick={() => this.backCart()}>\n {i18next.t(\"edit\")}\n </p>\n )}\n {!this.showEdit && <countdown-timer initialValue={60} downtime={() => { this.showEdit = true }} />}\n </div>\n )\n }\n </div>\n\n {\n infobonus.hasBonus &&\n (\n <p class=\"note-description-2\">\n {i18next.t(\"withApplyBonus\", { giftbackname: giftbackname })} <strong>R$ {this.getAmount()}.</strong>\n </p>\n )\n }\n\n {\n (infobonus.requestBonus && !infobonus.hasBonus) &&\n (\n <p class=\"note-description-not\">\n {i18next.t(\"noBonus\", { giftbackname: giftbackname })}\n </p>\n )\n }\n\n {\n !infobonus.requestBonus &&\n (\n <div class=\"description\">\n <p class=\"note-description-not\">\n {i18next.t(\"backCart\")}\n </p>\n <crm-button txtBtn=\"VOLTAR AO CARRINHO\" handleClick={() => this.backCart()} />\n </div>\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.js","mappings":";;;;;;;;AAAA,MAAM,yBAAyB,GAAG,4gCAA4gC;;SCA9hC,OAAO;IAEnB,IAAG,YAAY,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE;QACtC,OAAM;KACT;IAED,MAAM,IAAI,GAAG,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAE7C,IAAG,CAAC,IAAI,EAAE;QACN,YAAY,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QACvC,YAAY,CAAC,OAAO,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;QAC9C,OAAM;KACT;AACL;;ACbA,MAAM,eAAe,GAAG,i3CAAi3C,CAAC;AAC14C,2BAAe,eAAe;;MCYjBA,cAAY;;;;;;;;;wBAUQ,KAAK;;IAElC,iBAAiB;QACb,IAAI,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C,SAAS,CAAC,QAAQ;aAE1C,0DAAG,KAAK,EAAC,sBAAsB,IAC1BA,QAAO,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC,CACrD,CACP,EAID,CAAC,SAAS,CAAC,YAAY;aAEnB,4DAAK,KAAK,EAAC,aAAa,IACpB,0DAAG,KAAK,EAAC,sBAAsB,IAC1BA,QAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CACtB,EACJ,mEAAY,MAAM,EAAC,oBAAoB,EAAC,WAAW,EAAE,MAAM,IAAI,CAAC,QAAQ,EAAE,GAAI,CAC5E,CACT,CAMH,CACJ,EACT;KACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CrmBonusNote","money","i18next"],"sources":["src/assets/svg/money-dollars-svgrepo-com.svg","src/helpers/time.helper.ts","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 -->\n<svg width=\"800px\" height=\"800px\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<circle cx=\"12\" cy=\"12\" r=\"10\" stroke=\"#000000\" stroke-width=\"2\"/>\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\"/>\n<path d=\"M12 7V17\" stroke=\"#000000\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>","export function setTime() {\n\n if(localStorage.getItem(\"bc:time-allow\")) {\n return\n }\n\n const time = localStorage.getItem(\"bc:time\");\n\n if(!time) {\n localStorage.setItem(\"bc:time\", \"360\");\n localStorage.setItem(\"bc:time-allow\", \"true\");\n return\n } \n}",".note-container {\n border: 1px solid #dddddd;\n padding: 0 15px 15px;\n margin: 0 0 26px 0px;\n display: flex;\n flex-direction: column;\n gap: 13px;\n\n\n & .description {\n display: flex;\n flex-direction: column;\n gap: 13px;\n }\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 { getKeyReserveByCartId } from \"../../utils/keys.storage\";\nimport i18next from \"../../i18n/i18n\"\nimport { IBonus } from \"../../components\";\nimport { setTime } from \"../../helpers/time.helper\";\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 @State() bonus: IBonus;\n\n @State() showEdit: boolean = false;\n\n componentWillLoad() {\n this.upadateCheckToFreteAndGetUrl();\n this.startTime();\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 return amount ? Number(amount).toFixed(2).replace(\".\", \",\") || \"0,00\" : \"0,00\";\n }\n\n async backCart() {\n window.location.href = this.url;\n }\n\n\n private startTime() {\n if(document.location.pathname == '/Fechamento') {\n\n if(!localStorage.getItem(\"bc:time-allow\")) {\n localStorage.removeItem(\"bc:time\")\n }\n\n setTime();\n }\n }\n\n\n hasBonus() {\n const _bonus = localStorage.getItem(getKeyReserveByCartId(this.cartId));\n\n const info = {\n hasBonus: false,\n requestBonus: false\n }\n\n if (_bonus) {\n this.bonus = JSON.parse(_bonus);\n info.hasBonus = this.bonus.hasBonus;\n info.requestBonus = true;\n }\n\n return info;\n }\n\n render() {\n\n const giftbackname = this.config.giftbackTitle || \"Giftback\";\n\n const infobonus = this.hasBonus()\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 infobonus.hasBonus && (\n <div>\n {this.showEdit && (\n <p class=\"back-cart\" onClick={() => this.backCart()}>\n {i18next.t(\"edit\")}\n </p>\n )}\n {!this.showEdit && <countdown-timer initialValue={0} downtime={() => { this.showEdit = true }} />}\n </div>\n )\n }\n </div>\n\n {\n infobonus.hasBonus &&\n (\n <p class=\"note-description-2\">\n {i18next.t(\"withApplyBonus\", { giftbackname: giftbackname })} <strong>R$ {this.getAmount()}.</strong>\n </p>\n )\n }\n\n {\n (infobonus.requestBonus && !infobonus.hasBonus) &&\n (\n <p class=\"note-description-not\">\n {i18next.t(\"noBonus\", { giftbackname: giftbackname })}\n </p>\n )\n }\n\n {\n !infobonus.requestBonus &&\n (\n <div class=\"description\">\n <p class=\"note-description-not\">\n {i18next.t(\"backCart\")}\n </p>\n <crm-button txtBtn=\"VOLTAR AO CARRINHO\" handleClick={() => this.backCart()} />\n </div>\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}
@@ -2,16 +2,16 @@ import { p as proxyCustomElement, H, h } from './p-3e84f78c.js';
2
2
  import { C as CrmBonusService } from './p-c44e2f02.js';
3
3
  import { S as StepFormEnum } from './p-7cfea8fe.js';
4
4
  import { i as instance } from './p-e8c19a64.js';
5
- import { d as defineCustomElement$b } from './p-761e6cd2.js';
5
+ import { d as defineCustomElement$b } from './p-2b3b8d6b.js';
6
6
  import { d as defineCustomElement$a } from './p-47f9da55.js';
7
- import { d as defineCustomElement$9 } from './p-069cacf6.js';
7
+ import { d as defineCustomElement$9 } from './p-3951010f.js';
8
8
  import { d as defineCustomElement$8 } from './p-58b97429.js';
9
- import { d as defineCustomElement$7 } from './p-a94f3e34.js';
9
+ import { d as defineCustomElement$7 } from './p-d3ee0c39.js';
10
10
  import { d as defineCustomElement$6 } from './p-cc1ea33f.js';
11
11
  import { d as defineCustomElement$5 } from './p-fe9c3966.js';
12
12
  import { d as defineCustomElement$4 } from './p-6c546e48.js';
13
13
  import { d as defineCustomElement$3 } from './p-11085d9b.js';
14
- import { d as defineCustomElement$2 } from './p-78cca8a2.js';
14
+ import { d as defineCustomElement$2 } from './p-83a12a8f.js';
15
15
 
16
16
  var AjustesTipoEnum;
17
17
  (function (AjustesTipoEnum) {
@@ -1,4 +1,4 @@
1
- import { C as CrmBonus, d as defineCustomElement$1 } from './p-069cacf6.js';
1
+ import { C as CrmBonus, d as defineCustomElement$1 } from './p-3951010f.js';
2
2
 
3
3
  const CrmGiftbackForm = CrmBonus;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -1,4 +1,4 @@
1
- import { G as GiftbackInfo$1, d as defineCustomElement$1 } from './p-a94f3e34.js';
1
+ import { G as GiftbackInfo$1, d as defineCustomElement$1 } from './p-d3ee0c39.js';
2
2
 
3
3
  const GiftbackInfo = GiftbackInfo$1;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -6,8 +6,8 @@ const CountdownTimer = /*@__PURE__*/ proxyCustomElement(class CountdownTimer ext
6
6
  this.__registerHost();
7
7
  this.__attachShadow();
8
8
  this.downtime = undefined;
9
- this.initialValue = 120;
10
- this.seconds = 30;
9
+ this.initialValue = 0;
10
+ this.seconds = 0;
11
11
  }
12
12
  componentWillLoad() {
13
13
  const initial = localStorage.getItem("bc:time");
@@ -35,7 +35,7 @@ const CountdownTimer = /*@__PURE__*/ proxyCustomElement(class CountdownTimer ext
35
35
  return `${parseInt(minutes.toString())}m ${seconds}s`;
36
36
  }
37
37
  render() {
38
- return (h("label", { key: '51f3be00f4abb6f20fcb9f029d50bbcffc69c111' }, this.padLeft()));
38
+ return (h("label", { key: '6fe8811ce04f0f95d31404c2257124f454ab3cfa' }, this.padLeft()));
39
39
  }
40
40
  }, [1, "countdown-timer", {
41
41
  "downtime": [16],
@@ -59,4 +59,4 @@ defineCustomElement();
59
59
 
60
60
  export { CountdownTimer as C, defineCustomElement as d };
61
61
 
62
- //# sourceMappingURL=p-761e6cd2.js.map
62
+ //# sourceMappingURL=p-2b3b8d6b.js.map
@@ -0,0 +1 @@
1
+ {"file":"p-2b3b8d6b.js","mappings":";;MAMa,cAAc;;;;;;4BAGQ,CAAC;uBAEL,CAAC;;IAI5B,iBAAiB;QACb,MAAM,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAEhD,IAAI,CAAC,OAAO,GAAI,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC;QAE9D,IAAI,CAAC,UAAU,GAAG,WAAW,CAAC;YAC1B,IAAI,IAAI,CAAC,OAAO,GAAG,CAAC,EAAE;gBAClB,IAAI,CAAC,OAAO,EAAE,CAAC;gBAEf,YAAY,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;aAC5D;iBAAM;gBACH,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;gBAE/B,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAEhB,YAAY,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;aACtC;SACJ,EAAE,IAAI,CAAC,CAAC;KACZ;IAED,oBAAoB;QAChB,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;KAClC;IAED,OAAO;QACH,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAElC,IAAG,OAAO,GAAG,CAAC;YAAE,OAAO,GAAG,OAAO,GAAG,CAAA;QAEpC,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,OAAO,GAAG,CAAA;KACxD;IAED,MAAM;QACF,QACI,gEAAQ,IAAI,CAAC,OAAO,EAAE,CAAS,EACjC;KACL;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/countdown-timer/countdown-timer.tsx"],"sourcesContent":["import { Component, h, Prop, State } from '@stencil/core';\n\n@Component({\n tag: 'countdown-timer',\n shadow: true,\n})\nexport class CountdownTimer {\n\n @Prop() downtime: () => void;\n @Prop() initialValue: number = 0;\n\n @State() seconds: number = 0;\n\n private intervalId: NodeJS.Timer;\n\n componentWillLoad() {\n const initial = localStorage.getItem(\"bc:time\");\n\n this.seconds = initial ? Number(initial) : this.initialValue;\n \n this.intervalId = setInterval(() => {\n if (this.seconds > 0) {\n this.seconds--;\n\n localStorage.setItem(\"bc:time\", this.seconds.toString());\n } else {\n clearInterval(this.intervalId);\n\n this.downtime();\n\n localStorage.removeItem(\"bc:time\");\n }\n }, 1000); // Intervalo de 1 segundo\n }\n\n disconnectedCallback() {\n clearInterval(this.intervalId);\n }\n\n padLeft() {\n const minutes = this.seconds / 60; \n const seconds = this.seconds % 60;\n\n if(minutes < 1) return `${seconds}s`\n \n return `${parseInt(minutes.toString())}m ${seconds}s`\n }\n\n render() {\n return (\n <label>{this.padLeft()}</label>\n );\n }\n}\n"],"version":3}
@@ -4,14 +4,14 @@ import { S as StepFormEnum } from './p-7cfea8fe.js';
4
4
  import { g as getInfoCustomization } from './p-75ba7b9a.js';
5
5
  import { i as instance } from './p-e8c19a64.js';
6
6
  import { g as getKeyReserveByCartId, U as USED_KEY } from './p-f9aeffc1.js';
7
- import { d as defineCustomElement$8 } from './p-761e6cd2.js';
7
+ import { d as defineCustomElement$8 } from './p-2b3b8d6b.js';
8
8
  import { d as defineCustomElement$7 } from './p-47f9da55.js';
9
9
  import { d as defineCustomElement$6 } from './p-58b97429.js';
10
- import { d as defineCustomElement$5 } from './p-a94f3e34.js';
10
+ import { d as defineCustomElement$5 } from './p-d3ee0c39.js';
11
11
  import { d as defineCustomElement$4 } from './p-fe9c3966.js';
12
12
  import { d as defineCustomElement$3 } from './p-6c546e48.js';
13
13
  import { d as defineCustomElement$2 } from './p-11085d9b.js';
14
- import { d as defineCustomElement$1 } from './p-78cca8a2.js';
14
+ import { d as defineCustomElement$1 } from './p-83a12a8f.js';
15
15
 
16
16
  const giftbackFormCss = "*{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);font-weight:100}.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}";
17
17
  const CrmGiftbackFormStyle0 = giftbackFormCss;
@@ -313,4 +313,4 @@ defineCustomElement();
313
313
 
314
314
  export { CrmBonus as C, defineCustomElement as d };
315
315
 
316
- //# sourceMappingURL=p-069cacf6.js.map
316
+ //# sourceMappingURL=p-3951010f.js.map
@@ -1 +1 @@
1
- {"file":"p-069cacf6.js","mappings":";;;;;;;;;;;;;;;AAAA,MAAM,eAAe,GAAG,i+BAAi+B,CAAC;AAC1/B,8BAAe,eAAe;;MCajB,QAAQ;;;;;QAGX,oBAAe,GAAoB,eAAe,CAAC,WAAW,EAAE,CAAC;;;;;;;uBAS7C,KAAK;;;;oBAIH,YAAY,CAAC,YAAY;;sBAG7B,EAAE;qBACH,EAAE;;6BAGF,KAAK;;IAI9B,MAAM,OAAO,CAAC,IAAkB;QAC9B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;KACjB;IAGD,MAAM,YAAY,CAAC,WAAuB,EAAE,EAAE,aAAa,GAAG,KAAK;QACjE,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QAEjB,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,EAAE,CAAC,CAAA;QAC/B,IAAI,aAAa,EAAE;YACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;SAC1B;QAED,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,qBAAqB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QAExE,IAAI,MAAM,EAAE;YAEV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Y,CAAC,YAAY;YACvC,sEACE,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,MAAM,EAAE,MAAM,IAAI,CAAC,YAAY,EAAE,EACjC,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,OAAO,EAAE,MAAM,IAAI,CAAC,YAAY,EAAE,GAClC,EAIF,IAAI,CAAC,IAAI,KAAK,YAAY,CAAC,aAAa;aAEtC,4DAAK,KAAK,EAAC,mBAAmB,IAC3BA,QAAO,CAAC,CAAC,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC,CAC9D,CACP,CAGC,EACP;KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["i18next"],"sources":["src/components/giftback-form/giftback-form.css?tag=crm-giftback-form","src/components/giftback-form/giftback-form.tsx"],"sourcesContent":["* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\n:host {\n --crmfont-sizebodymd: 14px;\n --crmline-heightbodymd: 20px;\n --crmletter-spacingtitle-md: 0px\n}\n\n.container-message {\n font-family: Roboto;\n font-size: var(--crmfont-sizebodymd);\n font-weight: 400;\n line-height: var(--crmline-heightbodymd);\n letter-spacing: var(--crmletter-spacingtitle-md);\n text-align: left;\n text-underline-position: from-font;\n text-decoration-skip-ink: none;\n}\n\n.crm-container-form {\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n height: auto;\n padding: 20px 24px 20px 24px;\n border: 1px solid #CCCC;\n writing-mode: horizontal-tb;\n gap: 16px;\n border-top: 1px solid #ccc !important;\n border-bottom: 1px solid #ccc !important;\n}\n\n/* .fbits-responsive-carrinho-desconto {\n overflow: hidden;\n border: 1px solid #ccc;\n border-top: 0;\n border-bottom: 0;\n} */\n\n.crm-phone-form {\n display: flex;\n flex-direction: column;\n height: 100%;\n /* justify-content: space-around; */\n gap: 16px;\n}\n\n.crm-subtitle {\n font-size: 14px;\n color: var(--crm-btn);\n font-weight: 100;\n}\n\n.crm-title {\n font-weight: 700;\n line-height: 20px;\n color: #262626;\n font-size: 16px;\n}\n\n.crm-message-info {\n color: #619013;\n font-weight: 500;\n font-size: 12px;\n}\n\n.crm-message-error {\n color: #E11D48;\n font-weight: 500;\n font-size: 12px;\n}","import { Component, Method, Prop, State, h } from \"@stencil/core\";\nimport { CrmBonusService } from \"../../services/crmbonus.service\";\nimport { StepFormEnum } from \"../../contants\";\nimport { IPinSent } from '../../dto/pin.sent'\nimport { IBonus, ICustomer, IProccesPinBonusDto, IProduct } from \"../../dto/validate.pin.bonus\";\nimport { IInfoStore, getInfoCustomization } from \"../../helpers/info.config.helper\";\n\nimport i18next from \"../../i18n/i18n\"\nimport { USED_KEY, getKeyReserveByCartId } from \"../../utils/keys.storage\";\n\n@Component({\n tag: 'crm-giftback-form',\n styleUrl: 'giftback-form.css'\n})\nexport class CrmBonus {\n // private phoneInputMask: HTMLPhoneFormElement;\n\n private crmBonusService: CrmBonusService = CrmBonusService.getInstance();\n\n @Prop({ attribute: 'storename' }) storeName;\n @Prop() cartId;\n @Prop() products: Array<IProduct>;\n @Prop() customer: ICustomer;\n @Prop() loadProducts: () => void;\n\n @State() value: string;\n @State() loading: boolean = false;\n @State() message: string;\n @State() phone: string;\n @State() pinInfo: IPinSent;\n @State() step: StepFormEnum = StepFormEnum.STEP_RESERVE;\n @State() bonus: IBonus;\n\n @State() sucess: string = \"\";\n @State() error: string = \"\";\n @State() config: IInfoStore;\n\n @State() hasApplyBonus = false;\n\n\n @Method()\n async setStep(step: StepFormEnum) {\n this.step = step\n }\n\n @Method()\n async processBonus(products: IProduct[] = [], hasNewProduct = false) {\n this.sucess = \"\";\n\n console.log('processBonus', [])\n if (hasNewProduct) {\n this.products = products;\n }\n\n const _bonus = localStorage.getItem(getKeyReserveByCartId(this.cartId));\n\n if (_bonus) {\n\n const bonus = JSON.parse(_bonus)\n\n this.bonus = bonus;\n\n this.phone = bonus.phone;\n this.pinInfo = {\n storeId: bonus.storeId,\n userId: bonus.userId\n }\n\n await this.validateBonus(\"2018\");\n //this.step = StepFormEnum.STEP_RESERVE;\n\n }\n }\n\n async handleSendPin(phone: string) {\n\n this.message = \"\"\n if (!phone) {\n this.message = \"Informe seu telefone\";\n return;\n }\n\n this.phone = phone;\n\n this.sendPin();\n }\n\n async componentWillLoad() {\n this.sucess = \"\";\n this.error = \"\"\n this.config = getInfoCustomization(this.storeName);\n\n const phoneAgain = this.getPhoneNumberAgain();\n\n if (phoneAgain) {\n this.step = StepFormEnum.STEP_PHONE;\n return\n }\n\n await this.processBonus();\n\n }\n\n getPhoneNumberAgain() {\n const consulta_bonus = localStorage.getItem(getKeyReserveByCartId(this.cartId));\n\n if (!consulta_bonus) return true;\n\n const bonus = JSON.parse(consulta_bonus);\n\n return !bonus.hasBonus;\n }\n\n private convertStringToNumber(): number {\n const _phone = this.phone.replace(/\\D/g, '');\n return Number(_phone);\n }\n\n public async sendPin() {\n this.loading = true;\n this.message = \"\";\n this.sucess = \"\";\n this.error = \"\"\n\n try {\n\n const _phone = this.convertStringToNumber();\n const pinInfoCache = localStorage.getItem(`bc:${this.phone}`);\n\n if (!pinInfoCache) {\n this.pinInfo = await this.crmBonusService.sendPin(_phone, this.customer?.name, this.storeName);\n }\n\n if (pinInfoCache) {\n\n const bonus = JSON.parse(pinInfoCache);\n\n this.pinInfo = {\n storeId: bonus.storeId,\n userId: bonus.userId\n }\n\n await this.validateBonus(\"2018\");\n this.step = StepFormEnum.STEP_RESERVE;\n } else {\n this.step = StepFormEnum.STEP_PIN;\n }\n\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false\n }\n }\n\n changePhone() {\n this.sucess = \"\";\n this.error = \"\"\n this.step = StepFormEnum.STEP_PHONE;\n }\n\n public async validateBonus(pin: string) {\n\n this.loadProducts();\n\n const used_or_no = localStorage.getItem(USED_KEY);\n\n if (used_or_no == \"dontUse\") {\n this.step = StepFormEnum.STEP_RESERVE;\n return\n }\n\n this.loading = true;\n this.sucess = \"\";\n this.error = \"\";\n const payload: IProccesPinBonusDto = {\n pin: pin,\n cellphone: this.convertStringToNumber(),\n storeId: this.pinInfo.storeId.toString(),\n userId: this.pinInfo.userId.toString(),\n checkoutId: this.cartId,\n checkoutProducts: this.products,\n name: this.customer?.name,\n storeName: this.storeName\n }\n\n try {\n this.bonus = await this.crmBonusService.validatePinBonus(payload);\n\n if (!this.bonus.hasBonus) {\n\n localStorage.setItem(getKeyReserveByCartId(this.cartId), JSON.stringify({ ...this.bonus, phone: this.phone }));\n\n this.loading = false;\n this.step = StepFormEnum.STEP_NO_BONUS;\n return\n }\n\n this.sucess = \"Código validado com sucesso!\";\n localStorage.setItem(getKeyReserveByCartId(this.cartId), JSON.stringify({ ...this.bonus, phone: this.phone }));\n localStorage.setItem(`bc:${this.phone}`, JSON.stringify(this.bonus));\n\n localStorage.setItem(USED_KEY, \"use\");\n localStorage.setItem(this.cartId, this.bonus.bonusBalance.toString());\n\n this.step = StepFormEnum.STEP_RESERVE;\n\n } catch (error) {\n const _error: string = error?.response?.data?.message;\n\n if (_error.includes(\"Pin\")) {\n this.error = \"Código inválido!\"\n } else {\n this.error = _error;\n this.step = StepFormEnum.STEP_NO_BONUS;\n }\n\n\n } finally {\n this.loading = false;\n }\n }\n\n public handleCancel() {\n // this.step = StepFormEnum.STEP_PHONE;\n this.cancel()\n }\n\n async cancel() {\n this.message = \"\";\n this.loading = true;\n try {\n await this.crmBonusService.cancel(this.cartId);\n\n localStorage.setItem(USED_KEY, \"dontUse\");\n this.save(0)\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 public async reserveApply(amount: number) {\n this.loading = true;\n this.message = \"\";\n try {\n await this.reserve(amount);\n this.save(amount);\n\n } catch (error) {\n this.message = \"ocorreu um error ao solicitar a aplicação do bonus! tente novamente\"\n\n this.step = StepFormEnum.STEP_NO_BONUS;\n localStorage.removeItem(this.cartId);\n } finally {\n this.loading = false;\n }\n }\n\n save(amount: number) {\n localStorage.setItem(this.cartId, amount.toString());\n }\n\n public async reserve(amount: number) {\n\n await this.crmBonusService.reserve({\n redeemedBonus: amount,\n cartId: this.cartId,\n ticket: this.cartId,\n grossValue: Number(this.bonus.totalValue),\n storeName: this.storeName,\n storeId: this.bonus.storeId.toString(),\n userId: this.bonus.userId\n });\n }\n\n render() {\n return (\n <div class=\"crm-container-form fbits-responsive-carrinho-desconto\" >\n\n {/* <loading-container /> */}\n\n <label class=\"crm-title\">{this.config.giftbackTitle}</label>\n\n {this.step === StepFormEnum.STEP_PHONE &&\n <phone-form\n value={this.customer.phone}\n config={this.config}\n loading={this.loading}\n handlerSubmit={(phone) => this.handleSendPin(phone)}\n />}\n {\n this.step === StepFormEnum.STEP_PIN &&\n <pin-form\n config={this.config}\n phone={this.phone}\n cancel={() => this.changePhone()}\n resend={() => this.sendPin()}\n validate={(data) => this.validateBonus(data)}\n loading={this.loading}\n >\n {this.sucess && <p class=\"crm-message-info\">{this.sucess}</p>}\n {this.error && <p class=\"crm-message-error\">{this.error}</p>}\n\n </pin-form>\n }\n\n {\n this.step === StepFormEnum.STEP_RESERVE &&\n <giftback-info\n config={this.config}\n loading={this.loading}\n cancel={() => this.handleCancel()}\n bonus={this.bonus}\n reserve={() => this.processBonus()}\n />\n }\n\n {\n this.step === StepFormEnum.STEP_NO_BONUS &&\n (\n <div class=\"container-message\">\n {i18next.t(\"noGiftback\", { storename: this.config.giftbackTitle })}\n </div>\n )\n\n }\n </div>\n )\n }\n}"],"version":3}
1
+ {"file":"p-3951010f.js","mappings":";;;;;;;;;;;;;;;AAAA,MAAM,eAAe,GAAG,i+BAAi+B,CAAC;AAC1/B,8BAAe,eAAe;;MCajB,QAAQ;;;;;QAGX,oBAAe,GAAoB,eAAe,CAAC,WAAW,EAAE,CAAC;;;;;;;uBAS7C,KAAK;;;;oBAIH,YA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Q;YACnC,iEACE,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,MAAM,EAAE,MAAM,IAAI,CAAC,WAAW,EAAE,EAChC,MAAM,EAAE,MAAM,IAAI,CAAC,OAAO,EAAE,EAC5B,QAAQ,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAC5C,OAAO,EAAE,IAAI,CAAC,OAAO,IAEpB,IAAI,CAAC,MAAM,IAAI,0DAAG,KAAK,EAAC,kBAAkB,IAAE,IAAI,CAAC,MAAM,CAAK,EAC5D,IAAI,CAAC,KAAK,IAAI,0DAAG,KAAK,EAAC,mBAAmB,IAAE,IAAI,CAAC,KAAK,CAAK,CAEnD,EAIX,IAAI,CAAC,IAAI,KAAK,YAAY,CAAC,YAAY;YACvC,sEACE,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,MAAM,EAAE,MAAM,IAAI,CAAC,YAAY,EAAE,EACjC,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,OAAO,EAAE,MAAM,IAAI,CAAC,YAAY,EAAE,GAClC,EAIF,IAAI,CAAC,IAAI,KAAK,YAAY,CAAC,aAAa;aAEtC,4DAAK,KAAK,EAAC,mBAAmB,IAC3BA,QAAO,CAAC,CAAC,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC,CAC9D,CACP,CAGC,EACP;KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["i18next"],"sources":["src/components/giftback-form/giftback-form.css?tag=crm-giftback-form","src/components/giftback-form/giftback-form.tsx"],"sourcesContent":["* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\n:host {\n --crmfont-sizebodymd: 14px;\n --crmline-heightbodymd: 20px;\n --crmletter-spacingtitle-md: 0px\n}\n\n.container-message {\n font-family: Roboto;\n font-size: var(--crmfont-sizebodymd);\n font-weight: 400;\n line-height: var(--crmline-heightbodymd);\n letter-spacing: var(--crmletter-spacingtitle-md);\n text-align: left;\n text-underline-position: from-font;\n text-decoration-skip-ink: none;\n}\n\n.crm-container-form {\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n height: auto;\n padding: 20px 24px 20px 24px;\n border: 1px solid #CCCC;\n writing-mode: horizontal-tb;\n gap: 16px;\n border-top: 1px solid #ccc !important;\n border-bottom: 1px solid #ccc !important;\n}\n\n/* .fbits-responsive-carrinho-desconto {\n overflow: hidden;\n border: 1px solid #ccc;\n border-top: 0;\n border-bottom: 0;\n} */\n\n.crm-phone-form {\n display: flex;\n flex-direction: column;\n height: 100%;\n /* justify-content: space-around; */\n gap: 16px;\n}\n\n.crm-subtitle {\n font-size: 14px;\n color: var(--crm-btn);\n font-weight: 100;\n}\n\n.crm-title {\n font-weight: 700;\n line-height: 20px;\n color: #262626;\n font-size: 16px;\n}\n\n.crm-message-info {\n color: #619013;\n font-weight: 500;\n font-size: 12px;\n}\n\n.crm-message-error {\n color: #E11D48;\n font-weight: 500;\n font-size: 12px;\n}","import { Component, Method, Prop, State, h } from \"@stencil/core\";\nimport { CrmBonusService } from \"../../services/crmbonus.service\";\nimport { StepFormEnum } from \"../../contants\";\nimport { IPinSent } from '../../dto/pin.sent'\nimport { IBonus, ICustomer, IProccesPinBonusDto, IProduct } from \"../../dto/validate.pin.bonus\";\nimport { IInfoStore, getInfoCustomization } from \"../../helpers/info.config.helper\";\n\nimport i18next from \"../../i18n/i18n\"\nimport { USED_KEY, getKeyReserveByCartId } from \"../../utils/keys.storage\";\n\n@Component({\n tag: 'crm-giftback-form',\n styleUrl: 'giftback-form.css'\n})\nexport class CrmBonus {\n // private phoneInputMask: HTMLPhoneFormElement;\n\n private crmBonusService: CrmBonusService = CrmBonusService.getInstance();\n\n @Prop({ attribute: 'storename' }) storeName;\n @Prop() cartId;\n @Prop() products: Array<IProduct>;\n @Prop() customer: ICustomer;\n @Prop() loadProducts: () => void;\n\n @State() value: string;\n @State() loading: boolean = false;\n @State() message: string;\n @State() phone: string;\n @State() pinInfo: IPinSent;\n @State() step: StepFormEnum = StepFormEnum.STEP_RESERVE;\n @State() bonus: IBonus;\n\n @State() sucess: string = \"\";\n @State() error: string = \"\";\n @State() config: IInfoStore;\n\n @State() hasApplyBonus = false;\n\n\n @Method()\n async setStep(step: StepFormEnum) {\n this.step = step\n }\n\n @Method()\n async processBonus(products: IProduct[] = [], hasNewProduct = false) {\n this.sucess = \"\";\n\n console.log('processBonus', [])\n if (hasNewProduct) {\n this.products = products;\n }\n\n const _bonus = localStorage.getItem(getKeyReserveByCartId(this.cartId));\n\n if (_bonus) {\n\n const bonus = JSON.parse(_bonus)\n\n this.bonus = bonus;\n\n this.phone = bonus.phone;\n this.pinInfo = {\n storeId: bonus.storeId,\n userId: bonus.userId\n }\n\n await this.validateBonus(\"2018\");\n //this.step = StepFormEnum.STEP_RESERVE;\n\n }\n }\n\n async handleSendPin(phone: string) {\n\n this.message = \"\"\n if (!phone) {\n this.message = \"Informe seu telefone\";\n return;\n }\n\n this.phone = phone;\n\n this.sendPin();\n }\n\n async componentWillLoad() {\n this.sucess = \"\";\n this.error = \"\"\n this.config = getInfoCustomization(this.storeName);\n\n const phoneAgain = this.getPhoneNumberAgain();\n\n if (phoneAgain) {\n this.step = StepFormEnum.STEP_PHONE;\n return\n }\n\n await this.processBonus();\n\n }\n\n getPhoneNumberAgain() {\n const consulta_bonus = localStorage.getItem(getKeyReserveByCartId(this.cartId));\n\n if (!consulta_bonus) return true;\n\n const bonus = JSON.parse(consulta_bonus);\n\n return !bonus.hasBonus;\n }\n\n private convertStringToNumber(): number {\n const _phone = this.phone.replace(/\\D/g, '');\n return Number(_phone);\n }\n\n public async sendPin() {\n this.loading = true;\n this.message = \"\";\n this.sucess = \"\";\n this.error = \"\"\n\n try {\n\n const _phone = this.convertStringToNumber();\n const pinInfoCache = localStorage.getItem(`bc:${this.phone}`);\n\n if (!pinInfoCache) {\n this.pinInfo = await this.crmBonusService.sendPin(_phone, this.customer?.name, this.storeName);\n }\n\n if (pinInfoCache) {\n\n const bonus = JSON.parse(pinInfoCache);\n\n this.pinInfo = {\n storeId: bonus.storeId,\n userId: bonus.userId\n }\n\n await this.validateBonus(\"2018\");\n this.step = StepFormEnum.STEP_RESERVE;\n } else {\n this.step = StepFormEnum.STEP_PIN;\n }\n\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false\n }\n }\n\n changePhone() {\n this.sucess = \"\";\n this.error = \"\"\n this.step = StepFormEnum.STEP_PHONE;\n }\n\n public async validateBonus(pin: string) {\n\n this.loadProducts();\n\n const used_or_no = localStorage.getItem(USED_KEY);\n\n if (used_or_no == \"dontUse\") {\n this.step = StepFormEnum.STEP_RESERVE;\n return\n }\n\n this.loading = true;\n this.sucess = \"\";\n this.error = \"\";\n const payload: IProccesPinBonusDto = {\n pin: pin,\n cellphone: this.convertStringToNumber(),\n storeId: this.pinInfo.storeId.toString(),\n userId: this.pinInfo.userId.toString(),\n checkoutId: this.cartId,\n checkoutProducts: this.products,\n name: this.customer?.name,\n storeName: this.storeName\n }\n\n try {\n this.bonus = await this.crmBonusService.validatePinBonus(payload);\n\n if (!this.bonus.hasBonus) {\n\n localStorage.setItem(getKeyReserveByCartId(this.cartId), JSON.stringify({ ...this.bonus, phone: this.phone }));\n\n this.loading = false;\n this.step = StepFormEnum.STEP_NO_BONUS;\n return\n }\n\n this.sucess = \"Código validado com sucesso!\";\n localStorage.setItem(getKeyReserveByCartId(this.cartId), JSON.stringify({ ...this.bonus, phone: this.phone }));\n localStorage.setItem(`bc:${this.phone}`, JSON.stringify(this.bonus));\n\n localStorage.setItem(USED_KEY, \"use\");\n localStorage.setItem(this.cartId, this.bonus.bonusBalance.toString());\n\n this.step = StepFormEnum.STEP_RESERVE;\n\n } catch (error) {\n const _error: string = error?.response?.data?.message;\n\n if (_error.includes(\"Pin\")) {\n this.error = \"Código inválido!\"\n } else {\n this.error = _error;\n this.step = StepFormEnum.STEP_NO_BONUS;\n }\n\n\n } finally {\n this.loading = false;\n }\n }\n\n public handleCancel() {\n // this.step = StepFormEnum.STEP_PHONE;\n this.cancel()\n }\n\n async cancel() {\n this.message = \"\";\n this.loading = true;\n try {\n await this.crmBonusService.cancel(this.cartId);\n\n localStorage.setItem(USED_KEY, \"dontUse\");\n this.save(0)\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 public async reserveApply(amount: number) {\n this.loading = true;\n this.message = \"\";\n try {\n await this.reserve(amount);\n this.save(amount);\n\n } catch (error) {\n this.message = \"ocorreu um error ao solicitar a aplicação do bonus! tente novamente\"\n\n this.step = StepFormEnum.STEP_NO_BONUS;\n localStorage.removeItem(this.cartId);\n } finally {\n this.loading = false;\n }\n }\n\n save(amount: number) {\n localStorage.setItem(this.cartId, amount.toString());\n }\n\n public async reserve(amount: number) {\n\n await this.crmBonusService.reserve({\n redeemedBonus: amount,\n cartId: this.cartId,\n ticket: this.cartId,\n grossValue: Number(this.bonus.totalValue),\n storeName: this.storeName,\n storeId: this.bonus.storeId.toString(),\n userId: this.bonus.userId\n });\n }\n\n render() {\n return (\n <div class=\"crm-container-form fbits-responsive-carrinho-desconto\" >\n\n {/* <loading-container /> */}\n\n <label class=\"crm-title\">{this.config.giftbackTitle}</label>\n\n {this.step === StepFormEnum.STEP_PHONE &&\n <phone-form\n value={this.customer.phone}\n config={this.config}\n loading={this.loading}\n handlerSubmit={(phone) => this.handleSendPin(phone)}\n />}\n {\n this.step === StepFormEnum.STEP_PIN &&\n <pin-form\n config={this.config}\n phone={this.phone}\n cancel={() => this.changePhone()}\n resend={() => this.sendPin()}\n validate={(data) => this.validateBonus(data)}\n loading={this.loading}\n >\n {this.sucess && <p class=\"crm-message-info\">{this.sucess}</p>}\n {this.error && <p class=\"crm-message-error\">{this.error}</p>}\n\n </pin-form>\n }\n\n {\n this.step === StepFormEnum.STEP_RESERVE &&\n <giftback-info\n config={this.config}\n loading={this.loading}\n cancel={() => this.handleCancel()}\n bonus={this.bonus}\n reserve={() => this.processBonus()}\n />\n }\n\n {\n this.step === StepFormEnum.STEP_NO_BONUS &&\n (\n <div class=\"container-message\">\n {i18next.t(\"noGiftback\", { storename: this.config.giftbackTitle })}\n </div>\n )\n\n }\n </div>\n )\n }\n}"],"version":3}
@@ -1,6 +1,6 @@
1
1
  import { p as proxyCustomElement, H, h } from './p-3e84f78c.js';
2
2
  import { i as instance } from './p-e8c19a64.js';
3
- import { d as defineCustomElement$3 } from './p-761e6cd2.js';
3
+ import { d as defineCustomElement$3 } from './p-2b3b8d6b.js';
4
4
  import { d as defineCustomElement$2 } from './p-47f9da55.js';
5
5
  import { d as defineCustomElement$1 } from './p-fe9c3966.js';
6
6
 
@@ -106,4 +106,4 @@ defineCustomElement();
106
106
 
107
107
  export { GiftbackPin as G, defineCustomElement as d };
108
108
 
109
- //# sourceMappingURL=p-78cca8a2.js.map
109
+ //# sourceMappingURL=p-83a12a8f.js.map
@@ -1 +1 @@
1
- {"file":"p-78cca8a2.js","mappings":";;;;;;AAAA,MAAM,UAAU,GAAG,s7BAAs7B,CAAC;AAC18B,sBAAe,UAAU;;ACDzB,MAAM,eAAe,GAAG,i+BAAi+B,CAAC;AAC1/B,sBAAe,eAAe;;MCSjB,WAAW;;;;;;;;;uBAOO,KAAK;;;mBAIP,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;0BACV,KAAK;yBACN,KAAK;;IAEnC,iBAAiB;QACb,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;KAC1B;IAED,WAAW,CAAC,KAAY,EAAE,KAAa;QACnC,MAAM,KAAK,GAAG,KAAK,CAAC,MAA0B,CAAC;QAC/C,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC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AE,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EACtB,OAAO,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,GACpD,CACL,CAAC,CACA,EAEN,8DAAa,EAEb,0DAAG,KAAK,EAAC,iBAAiB,0BAElB,CAAC,IAAI,CAAC,SAAS,IAAI,iFAAoB,wEAAiB,YAAY,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC,aAAa,EAAE,GAAI,MAAS,EAG3H,IAAI,CAAC,SAAS,KACV,8DACI,0DAAG,OAAO,EAAE,MAAM,IAAI,CAAC,YAAY,EAAE,eAAc,EACnD,0DAAG,OAAO,EAAE,MAAM,IAAI,CAAC,MAAM,EAAE,yBAAmB,CAChD,CACT,CAEL,EACJ,mEAAY,MAAM,EAAE,CAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,kBAAkB,KAAI,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC,WAAW,EAAE,GAAI,CAC/H,EACT;KACL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["i18next"],"sources":["src/components/giftback-form/subcomponents/pin-form/pin-form.css?tag=pin-form&encapsulation=shadow","src/components/giftback-form/giftback-form.css?tag=pin-form&encapsulation=shadow","src/components/giftback-form/subcomponents/pin-form/pin-form.tsx"],"sourcesContent":[":host {\n display: block;\n font-family: Arial, sans-serif;\n}\n\n.form-container-pin {\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n\n.pin-container {\n display: flex;\n /* margin: 26px 0; */\n justify-content: start;\n gap: 10px;\n}\n\n.pin-container input {\n width: 100%;\n height: 48px;\n font-size: 14px;\n text-align: center;\n border: 1px solid #ccc;\n border-radius: 5px;\n}\n\nbutton {\n padding: 10px 20px;\n background-color: #ddd;\n border: none;\n border-radius: 5px;\n cursor: pointer;\n}\n\n\n.success {\n color: green;\n margin-top: 10px;\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}\n\n.button-cancel {\n top: 50%;\n background-color: #ffffff;\n color: #1e1c1c;\n border: 1px solid gray;\n border-radius: 10px;\n padding: 10px;\n min-height: 30px;\n min-width: 120px;\n font-size: 19px;\n cursor: pointer;\n}\n\n.crm-description {\n font-size: 14px;\n width: 100%;\n display: flex;\n gap: 9px;\n}\n\n.crm-description a {\n font-weight: bold;\n cursor: pointer;\n text-decoration: underline;\n}\n\n.crm-description div {\n display: flex;\n gap: 5px;\n}","* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\n:host {\n --crmfont-sizebodymd: 14px;\n --crmline-heightbodymd: 20px;\n --crmletter-spacingtitle-md: 0px\n}\n\n.container-message {\n font-family: Roboto;\n font-size: var(--crmfont-sizebodymd);\n font-weight: 400;\n line-height: var(--crmline-heightbodymd);\n letter-spacing: var(--crmletter-spacingtitle-md);\n text-align: left;\n text-underline-position: from-font;\n text-decoration-skip-ink: none;\n}\n\n.crm-container-form {\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n height: auto;\n padding: 20px 24px 20px 24px;\n border: 1px solid #CCCC;\n writing-mode: horizontal-tb;\n gap: 16px;\n border-top: 1px solid #ccc !important;\n border-bottom: 1px solid #ccc !important;\n}\n\n/* .fbits-responsive-carrinho-desconto {\n overflow: hidden;\n border: 1px solid #ccc;\n border-top: 0;\n border-bottom: 0;\n} */\n\n.crm-phone-form {\n display: flex;\n flex-direction: column;\n height: 100%;\n /* justify-content: space-around; */\n gap: 16px;\n}\n\n.crm-subtitle {\n font-size: 14px;\n color: var(--crm-btn);\n font-weight: 100;\n}\n\n.crm-title {\n font-weight: 700;\n line-height: 20px;\n color: #262626;\n font-size: 16px;\n}\n\n.crm-message-info {\n color: #619013;\n font-weight: 500;\n font-size: 12px;\n}\n\n.crm-message-error {\n color: #E11D48;\n font-weight: 500;\n font-size: 12px;\n}","import { Component, h, Prop, State } from '@stencil/core';\nimport { IPinSent } from '../../../../dto/pin.sent';\nimport i18next from '../../../../i18n/i18n'\nimport { IInfoStore } from '../../../../helpers/info.config.helper';\n\n@Component({\n tag: 'pin-form',\n styleUrls: ['pin-form.css', '../../giftback-form.css'],\n shadow: true,\n})\nexport class GiftbackPin {\n\n @Prop() validate: (pin: string) => void;\n @Prop() cancel: () => void;\n @Prop() resend: () => void;\n\n @Prop() sent: IPinSent;\n @Prop() loading: boolean = false;\n @Prop() phone: string;\n @Prop() config: IInfoStore;\n\n @State() pin: string[] = ['', '', '', ''];\n @State() isVerified: boolean = false;\n @State() canResend: boolean = false;\n\n componentWillLoad() {\n this.canResend = false;\n }\n\n handleInput(event: Event, index: number) {\n const input = event.target as HTMLInputElement;\n const value = input.value.slice(0, 1); // Limitar a um único dígito\n this.pin[index] = value;\n\n // Focar no próximo campo, se possível\n if (value && index < this.pin.length - 1) {\n const nextInput = input.nextElementSibling as HTMLInputElement;\n nextInput?.focus();\n }\n\n this.pin = [...this.pin];\n }\n\n validatePin() {\n this.validate(this.pin.join(\"\"))\n }\n\n verifyPin() {\n const pinCode = this.pin.join('');\n if (pinCode === '9999') {\n this.isVerified = true;\n }\n }\n\n handleTimeout() {\n this.canResend = true;\n }\n\n async handleResend() {\n await this.resend();\n\n this.canResend = false;\n this.pin = ['', '', '', '']\n }\n\n render() {\n return (\n <div class=\"crm-phone-form\">\n <label class=\"crm-subtitle\" >{i18next.t('pin-sutitle')} <strong>+55 {this.phone}</strong></label>\n <div class=\"pin-container\">\n {this.pin.map((_, index) => (\n <input\n type=\"text\"\n maxLength={1}\n value={this.pin[index]}\n onInput={(event) => this.handleInput(event, index)}\n />\n ))}\n </div>\n\n <slot></slot>\n\n <p class=\"crm-description\"> Não recebeu?\n {\n !this.canResend && <label> Reenviar em <countdown-timer initialValue={30} downtime={() => this.handleTimeout()} /> </label>\n }\n {\n this.canResend && (\n <div >\n <a onClick={() => this.handleResend()}>Reenviar</a>\n <a onClick={() => this.cancel()}>Trocar número</a>\n </div>\n )\n }\n </p>\n <crm-button txtBtn={this.config?.btnApplyBonusLabel || \"Avançar\"} loading={this.loading} handleClick={() => this.validatePin()} />\n </div >\n );\n }\n}\n"],"version":3}
1
+ {"file":"p-83a12a8f.js","mappings":";;;;;;AAAA,MAAM,UAAU,GAAG,s7BAAs7B,CAAC;AAC18B,sBAAe,UAAU;;ACDzB,MAAM,eAAe,GAAG,i+BAAi+B,CAAC;AAC1/B,sBAAe,eAAe;;MCSjB,WAAW;;;;;;;;;uBAOO,KAAK;;;mBAIP,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;0BACV,KAAK;yBACN,KAAK;;IAEnC,iBAAiB;QACb,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;KAC1B;IAED,WAAW,CAAC,KAAY,EAAE,KAAa;QACnC,MAAM,KAAK,GAAG,KAAK,CAAC,MAA0B,CAAC;QAC/C,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACtC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;;QAGxB,IAAI,KAAK,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE;YACtC,MAAM,SAAS,GAAG,KAAK,CAAC,kBAAsC,CAAC;YAC/D,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,KAAK,EAAE,CAAC;SACtB;QAED,IAAI,CAAC,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;KAC5B;IAED,WAAW;QACP,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAA;KACnC;IAED,SAAS;QACL,MAAM,OAAO,GAAG,IAAI,CAAC,GAA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AM,EAAE,CAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,kBAAkB,KAAI,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC,WAAW,EAAE,GAAI,CAC/H,EACT;KACL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["i18next"],"sources":["src/components/giftback-form/subcomponents/pin-form/pin-form.css?tag=pin-form&encapsulation=shadow","src/components/giftback-form/giftback-form.css?tag=pin-form&encapsulation=shadow","src/components/giftback-form/subcomponents/pin-form/pin-form.tsx"],"sourcesContent":[":host {\n display: block;\n font-family: Arial, sans-serif;\n}\n\n.form-container-pin {\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n\n.pin-container {\n display: flex;\n /* margin: 26px 0; */\n justify-content: start;\n gap: 10px;\n}\n\n.pin-container input {\n width: 100%;\n height: 48px;\n font-size: 14px;\n text-align: center;\n border: 1px solid #ccc;\n border-radius: 5px;\n}\n\nbutton {\n padding: 10px 20px;\n background-color: #ddd;\n border: none;\n border-radius: 5px;\n cursor: pointer;\n}\n\n\n.success {\n color: green;\n margin-top: 10px;\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}\n\n.button-cancel {\n top: 50%;\n background-color: #ffffff;\n color: #1e1c1c;\n border: 1px solid gray;\n border-radius: 10px;\n padding: 10px;\n min-height: 30px;\n min-width: 120px;\n font-size: 19px;\n cursor: pointer;\n}\n\n.crm-description {\n font-size: 14px;\n width: 100%;\n display: flex;\n gap: 9px;\n}\n\n.crm-description a {\n font-weight: bold;\n cursor: pointer;\n text-decoration: underline;\n}\n\n.crm-description div {\n display: flex;\n gap: 5px;\n}","* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\n:host {\n --crmfont-sizebodymd: 14px;\n --crmline-heightbodymd: 20px;\n --crmletter-spacingtitle-md: 0px\n}\n\n.container-message {\n font-family: Roboto;\n font-size: var(--crmfont-sizebodymd);\n font-weight: 400;\n line-height: var(--crmline-heightbodymd);\n letter-spacing: var(--crmletter-spacingtitle-md);\n text-align: left;\n text-underline-position: from-font;\n text-decoration-skip-ink: none;\n}\n\n.crm-container-form {\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n height: auto;\n padding: 20px 24px 20px 24px;\n border: 1px solid #CCCC;\n writing-mode: horizontal-tb;\n gap: 16px;\n border-top: 1px solid #ccc !important;\n border-bottom: 1px solid #ccc !important;\n}\n\n/* .fbits-responsive-carrinho-desconto {\n overflow: hidden;\n border: 1px solid #ccc;\n border-top: 0;\n border-bottom: 0;\n} */\n\n.crm-phone-form {\n display: flex;\n flex-direction: column;\n height: 100%;\n /* justify-content: space-around; */\n gap: 16px;\n}\n\n.crm-subtitle {\n font-size: 14px;\n color: var(--crm-btn);\n font-weight: 100;\n}\n\n.crm-title {\n font-weight: 700;\n line-height: 20px;\n color: #262626;\n font-size: 16px;\n}\n\n.crm-message-info {\n color: #619013;\n font-weight: 500;\n font-size: 12px;\n}\n\n.crm-message-error {\n color: #E11D48;\n font-weight: 500;\n font-size: 12px;\n}","import { Component, h, Prop, State } from '@stencil/core';\nimport { IPinSent } from '../../../../dto/pin.sent';\nimport i18next from '../../../../i18n/i18n'\nimport { IInfoStore } from '../../../../helpers/info.config.helper';\n\n@Component({\n tag: 'pin-form',\n styleUrls: ['pin-form.css', '../../giftback-form.css'],\n shadow: true,\n})\nexport class GiftbackPin {\n\n @Prop() validate: (pin: string) => void;\n @Prop() cancel: () => void;\n @Prop() resend: () => void;\n\n @Prop() sent: IPinSent;\n @Prop() loading: boolean = false;\n @Prop() phone: string;\n @Prop() config: IInfoStore;\n\n @State() pin: string[] = ['', '', '', ''];\n @State() isVerified: boolean = false;\n @State() canResend: boolean = false;\n\n componentWillLoad() {\n this.canResend = false;\n }\n\n handleInput(event: Event, index: number) {\n const input = event.target as HTMLInputElement;\n const value = input.value.slice(0, 1); // Limitar a um único dígito\n this.pin[index] = value;\n\n // Focar no próximo campo, se possível\n if (value && index < this.pin.length - 1) {\n const nextInput = input.nextElementSibling as HTMLInputElement;\n nextInput?.focus();\n }\n\n this.pin = [...this.pin];\n }\n\n validatePin() {\n this.validate(this.pin.join(\"\"))\n }\n\n verifyPin() {\n const pinCode = this.pin.join('');\n if (pinCode === '9999') {\n this.isVerified = true;\n }\n }\n\n handleTimeout() {\n this.canResend = true;\n }\n\n async handleResend() {\n await this.resend();\n\n this.canResend = false;\n this.pin = ['', '', '', '']\n }\n\n render() {\n return (\n <div class=\"crm-phone-form\">\n <label class=\"crm-subtitle\" >{i18next.t('pin-sutitle')} <strong>+55 {this.phone}</strong></label>\n <div class=\"pin-container\">\n {this.pin.map((_, index) => (\n <input\n type=\"text\"\n maxLength={1}\n value={this.pin[index]}\n onInput={(event) => this.handleInput(event, index)}\n />\n ))}\n </div>\n\n <slot></slot>\n\n <p class=\"crm-description\"> Não recebeu?\n {\n !this.canResend && <label> Reenviar em <countdown-timer initialValue={30} downtime={() => this.handleTimeout()} /> </label>\n }\n {\n this.canResend && (\n <div >\n <a onClick={() => this.handleResend()}>Reenviar</a>\n <a onClick={() => this.cancel()}>Trocar número</a>\n </div>\n )\n }\n </p>\n <crm-button txtBtn={this.config?.btnApplyBonusLabel || \"Avançar\"} loading={this.loading} handleClick={() => this.validatePin()} />\n </div >\n );\n }\n}\n"],"version":3}
@@ -2,7 +2,7 @@ import { p as proxyCustomElement, H, h } from './p-3e84f78c.js';
2
2
  import { i as instance } from './p-e8c19a64.js';
3
3
  import { U as USED_KEY } from './p-f9aeffc1.js';
4
4
  import { d as defineLimit, a as formatDateToBr } from './p-ba369e65.js';
5
- import { d as defineCustomElement$2 } from './p-761e6cd2.js';
5
+ import { d as defineCustomElement$2 } from './p-2b3b8d6b.js';
6
6
  import { d as defineCustomElement$1 } from './p-58b97429.js';
7
7
 
8
8
  const giftbackInfoCss = ":host{--text-color:#6D6D5F}.giftback-container{display:flex;flex-direction:column;gap:14px}h3{font-size:1.2rem;margin-bottom:8px;color:#333}.container-description{display:flex;align-items:center;gap:5px;margin:0 0 10px 0}.container-description p{font-size:14px;font-weight:400;margin:0px}p{font-size:14px;color:#000}.value-display h2{color:#6D6D5F;font-size:1.6rem;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;font-size:0.9rem;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;font-size:14px;color:#262626;line-height:20px}.info-icon{font-size:0.9rem;cursor:pointer;color:#888}h3{font-size:1.2rem;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-size:16px;font-weight:700;color:var(--text-color);transform:translateX(-50%);white-space:nowrap;}.options-option{display:flex}";
@@ -143,4 +143,4 @@ defineCustomElement();
143
143
 
144
144
  export { GiftbackInfo as G, defineCustomElement as d };
145
145
 
146
- //# sourceMappingURL=p-a94f3e34.js.map
146
+ //# sourceMappingURL=p-d3ee0c39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AE,QAAQ,EAAE,QAAQ,IAAI,CAAC,WAAW,GAAG,IAAI,CAAA,EAAE,GAAI,gFACjG,CACT,EAIL,4DAAK,KAAK,EAAC,UAAU,2DAEf,CACJ,EACR;KACL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["i18next"],"sources":["src/components/giftback-form/subcomponents/giftback-info/giftback-info.css?tag=giftback-info","src/components/giftback-form/subcomponents/giftback-info/giftback-info.tsx"],"sourcesContent":[":host {\n --text-color: #6D6D5F\n}\n\n.giftback-container {\n display: flex;\n flex-direction: column;\n gap: 14px;\n}\n\nh3 {\n font-size: 1.2rem;\n margin-bottom: 8px;\n color: #333;\n}\n\n.container-description {\n display: flex;\n align-items: center;\n gap: 5px;\n margin: 0 0 10px 0;\n}\n\n.container-description p {\n font-size: 14px;\n font-weight: 400;\n margin: 0px;\n}\n\n\np {\n font-size: 14px;\n color: #000;\n}\n\n.value-display h2 {\n color: #6D6D5F;\n /* Verde para o valor atual */\n font-size: 1.6rem;\n margin: 16px 0;\n}\n\ninput[type='range'] {\n width: 100%;\n margin: 12px 0;\n -webkit-appearance: none;\n background: #ddd;\n height: 4px;\n border-radius: 4px;\n outline: none;\n padding: 3px 0px 3px 3px;\n}\n\n/* input[type='range']::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 16px;\n height: 16px;\n background: var(--text-color);\n border-radius: 50%;\n cursor: pointer;\n} */\n\ninput[type=\"range\"]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 20px;\n height: 20px;\n background: rgb(109, 109, 95);\n /* Cor do botão */\n border-radius: 50%;\n cursor: pointer;\n}\n\n.options {\n margin: 0px 0;\n display: flex;\n gap: 10px;\n flex-direction: column;\n}\n\n.options label {\n display: flex;\n margin: 0px 0;\n font-size: 0.9rem;\n color: #333;\n align-items: center;\n}\n\n.options input[type='radio'] {\n margin-right: 8px;\n height: 16px;\n width: 16px;\n}\n\n.options input[type='radio'] {\n appearance: none;\n -webkit-appearance: none;\n margin-right: 8px;\n width: 16px;\n height: 16px;\n border: 2px solid #ddd;\n border-radius: 50%;\n background-color: #fff;\n cursor: pointer;\n transition: all 0.3s;\n padding: 0px;\n}\n\n.options input[type='radio']:checked {\n border-color: #000;\n background-color: #FAFAFA;\n border: 4px solid #000;\n}\n\n.info-box {\n background-color: #f9f9f9;\n border: 1px solid #e0e0e0;\n border-radius: 4px;\n padding: 8px;\n font-size: 14px;\n color: #262626;\n line-height: 20px;\n}\n\n.info-icon {\n font-size: 0.9rem;\n cursor: pointer;\n color: #888;\n}\n\nh3 {\n font-size: 1.2rem;\n margin-bottom: 8px;\n color: #333;\n}\n\n.slider-wrapper {\n position: relative;\n margin: 21px 0px 0px 0px;\n}\n\n.slider {\n width: 100%;\n -webkit-appearance: none;\n background: #ddd;\n height: 4px;\n border-radius: 2px;\n outline: none;\n}\n\n.slider::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 16px;\n height: 16px;\n background: var(--text-color);\n /* Azul para o slider */\n border-radius: 50%;\n cursor: pointer;\n}\n\n.slider-value {\n position: absolute;\n top: -30px;\n /* Posição acima do slider */\n font-size: 16px;\n font-weight: 700;\n color: var(--text-color);\n /* Verde para o texto */\n transform: translateX(-50%);\n white-space: nowrap;\n /* margin-left: 23px; */\n}\n\n.options-option {\n display: flex;\n}\n\n\n/* ########################################## */\n","import { Component, Prop, State, Watch, h } from \"@stencil/core\";\nimport { IBonus } from \"../../../../dto/validate.pin.bonus\";\n\nimport i18next from '../../../../i18n/i18n'\nimport { USED_KEY } from \"../../../../utils/keys.storage\";\nimport { defineLimit, formatDateToBr } from \"../../../../utils/utils\";\nimport { IInfoStore } from \"../../../../helpers/info.config.helper\";\n\n@Component({\n tag: 'giftback-info',\n styleUrls: ['giftback-info.css']\n})\nexport class GiftbackInfo {\n @State() usedValue: number = 0;\n @State() selectedOption: string = 'none';\n\n @Prop() loading: boolean = false;\n @Prop() bonus: Partial<IBonus> = {\n totalBonus: 0,\n cartId: \"\",\n minimumPurchase: 0,\n bonusBalance: 0,\n calculatedValue: 0,\n firstValidityDate: \"\",\n totalValue: 0\n };\n @Prop() reserve: (amountRedeemed: number) => void;\n @Prop() cancel: () => void;\n @Prop() config: IInfoStore;\n\n @State() sliderPosition: number = 0;\n @State() sliderValuePosition: number = 0;\n\n @State() loadingTime = false;\n\n @Watch(\"bonus\")\n changedBonus() {\n this.updateBonus()\n }\n\n private updateBonus() {\n this.usedValue = this.bonus.bonusBalance;\n this.buildPositionSlider(0, this.bonus.totalBonus);\n }\n\n componentWillLoad() {\n this.updateBonus();\n this.selectedOption = localStorage.getItem(USED_KEY);\n }\n\n handleSliderChange(event: Event) {\n const input = event.target as HTMLInputElement;\n this.usedValue = parseFloat(input.value);\n\n // Calculando a posição do texto com base no valor do slider\n // const percentage = ((this.usedValue - parseInt(input.min)) / (parseInt(input.max) - parseInt(input.min))) * 100;\n // this.sliderPosition = percentage;\n\n this.buildPositionSlider(parseFloat(input.min), parseFloat(input.max))\n }\n\n componentDidLoad() {\n const input: any = document.getElementById(\"position_value_id\")\n\n input.value = this.bonus.bonusBalance;\n }\n\n\n private buildPositionSlider(min: number, max: number) {\n\n const percentage_init = max * 0.1;\n\n // Calculando a posição do texto com base no valor do slider\n const percentage = ((this.usedValue - min) / (max - min)) * 100;\n\n this.sliderPosition = percentage;\n this.sliderValuePosition = percentage + (this.usedValue <= percentage_init ? 10 : 0);\n }\n\n async handleOptionChange(option: string) {\n this.selectedOption = option;\n\n localStorage.setItem(USED_KEY, option);\n\n switch (this.selectedOption) {\n case 'use':\n await this.reserve(this.usedValue);\n break;\n case 'dontUse':\n await this.cancel();\n break;\n default:\n }\n }\n\n showTime() {\n const time = localStorage.getItem(\"bc:time\");\n\n const allow = localStorage.getItem(\"bc:time-allow\");\n\n if(!allow) return false;\n\n return !!time;\n }\n\n getTime() {\n const time = localStorage.getItem(\"bc:time\");\n return Number(time) || 360;\n }\n\n render() {\n const remainingGiftback = this.bonus.minimumPurchase - this.bonus.totalValue;\n\n const translateDescription = i18next.t(\"giftDescription\", { amount: `${this.bonus.totalBonus.toFixed(2).replace(\".\", \",\")}`, custom_name: \"Giftback\" })\n\n const limit = defineLimit(remainingGiftback);\n\n return (\n\n <div class=\"giftback-container\">\n <div class=\"container-description\">\n <p innerHTML={translateDescription}></p>\n <crm-tooltip identity=\"crm-role-description\" text={i18next.t(\"labelUseGiftback\", { minimumPurchase: this.bonus.minimumPurchase, expírationDate: formatDateToBr(this.bonus.firstValidityDate) })} />\n </div>\n <div class=\"slider-wrapper\">\n <div\n class=\"slider-value\"\n style={{\n left: `calc(${this.sliderValuePosition}% - 20px)`, // Ajuste para centralizar o texto\n\n }}\n >\n R$ {this.usedValue.toFixed(2).replace(\".\", \",\")}\n </div>\n <input\n id=\"position_value_id\"\n disabled\n type=\"range\"\n min=\"0\"\n max={this.bonus.totalBonus}\n value={this.usedValue}\n class=\"slider\"\n step=\"0.01\"\n onInput={(event) => this.handleSliderChange(event)}\n style={{\n background: `linear-gradient(to right, #6D6D5F ${this.sliderPosition}%, #ddd ${this.sliderPosition}%)`,\n }}\n />\n </div>\n\n {\n limit.isComplete && (\n <p>\n {i18next.t(\"maxAmount\")}\n </p>\n )\n }\n\n {\n !limit.isComplete && (\n <div class=\"container-description\">\n <p>\n Adicione <strong>R$ {remainingGiftback < 0 ? \"0,00\" : remainingGiftback.toFixed(2).replace(\".\", \",\")}</strong> ao carrinho para atingir o valor\n máximo!\n </p>\n <crm-tooltip identity=\"crm-max-description\" text={i18next.t(\"labelamountPartial\")} />\n </div>\n )\n }\n\n\n <div class=\"options\">\n <div class=\"options-option\">\n <input\n disabled={this.showTime()}\n type=\"radio\"\n name=\"giftbackOption\"\n value=\"use\"\n checked={this.selectedOption === 'use'}\n onChange={() => this.handleOptionChange('use')}\n />\n <p>Usar o meu {this.config?.giftbackTitle}</p>\n </div>\n <div class=\"options-option\">\n <input\n disabled={this.showTime()}\n type=\"radio\"\n name=\"giftbackOption\"\n value=\"dontUse\"\n checked={this.selectedOption === 'dontUse'}\n onChange={() => this.handleOptionChange('dontUse')}\n />\n <p>Não usar o meu {this.config?.giftbackTitle}</p>\n </div>\n </div>\n\n {\n this.showTime() &&\n (\n <div class=\"info-box\">\n Após <countdown-timer initialValue={this.getTime()} downtime={() => { this.loadingTime = true }} />, você poderá alterar sua escolha de usar ou não o Giftback.\n </div>\n )\n }\n\n\n <div class=\"info-box\">\n O Giftback será aplicado na próxima etapa.\n </div>\n </div>\n );\n }\n}"],"version":3}
1
+ {"file":"p-d3ee0c39.js","mappings":";;;;;;;AAAA,MAAM,eAAe,GAAG,k7DAAk7D,CAAC;AAC38D,2BAAe,eAAe;;MCWjB,YAAY;;;;yBACQ,CAAC;8BACI,MAAM;uBAEb,KAAK;qBACC;YAC7B,UAAU,EAAE,CAAC;YACb,MAAM,EAAE,EAAE;YACV,eAAe,EAAE,CAAC;YAClB,YAAY,EAAE,CAAC;YACf,eAAe,EAAE,CAAC;YAClB,iBAAiB,EAAE,EAAE;YACrB,UAAU,EAAE,CAAC;SAChB;;;;8BAKiC,CAAC;mCACI,CAAC;2BAEjB,KAAK;;IAG5B,YAAY;QACR,IAAI,CAAC,WAAW,EAAE,CAAA;KACrB;IAEO,WAAW;QACf,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC;QACzC,IAAI,CAAC,mBAAmB,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;KACtD;IAED,iBAAiB;QACb,IAAI,CAAC,WAAW,EAAE,CAAC;QACnB,IAAI,CAAC,cAAc,GAAG,YAAY,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;KACxD;IAED,kBAAkB,CAAC,KAAY;QAC3B,MAAM,KAAK,GAAG,KAAK,CAAC,MAA0B,CAAC;QAC/C,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;;;;QAMzC,IAAI,C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AAC,SAAS,EACf,OAAO,EAAE,IAAI,CAAC,cAAc,KAAK,SAAS,EAC1C,QAAQ,EAAE,MAAM,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC,GACpD,EACF,oFAAmB,MAAA,IAAI,CAAC,MAAM;eAAE,aAAa,CAAK,CAChD,CACJ,EAGF,IAAI,CAAC,QAAQ,EAAE;aAEX,4DAAK,KAAK,EAAC,UAAU,kBACZ,wEAAiB,YAAY,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,QAAQ,IAAI,CAAC,WAAW,GAAG,IAAI,CAAA,EAAE,GAAI,gFACjG,CACT,EAIL,4DAAK,KAAK,EAAC,UAAU,2DAEf,CACJ,EACR;KACL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["i18next"],"sources":["src/components/giftback-form/subcomponents/giftback-info/giftback-info.css?tag=giftback-info","src/components/giftback-form/subcomponents/giftback-info/giftback-info.tsx"],"sourcesContent":[":host {\n --text-color: #6D6D5F\n}\n\n.giftback-container {\n display: flex;\n flex-direction: column;\n gap: 14px;\n}\n\nh3 {\n font-size: 1.2rem;\n margin-bottom: 8px;\n color: #333;\n}\n\n.container-description {\n display: flex;\n align-items: center;\n gap: 5px;\n margin: 0 0 10px 0;\n}\n\n.container-description p {\n font-size: 14px;\n font-weight: 400;\n margin: 0px;\n}\n\n\np {\n font-size: 14px;\n color: #000;\n}\n\n.value-display h2 {\n color: #6D6D5F;\n /* Verde para o valor atual */\n font-size: 1.6rem;\n margin: 16px 0;\n}\n\ninput[type='range'] {\n width: 100%;\n margin: 12px 0;\n -webkit-appearance: none;\n background: #ddd;\n height: 4px;\n border-radius: 4px;\n outline: none;\n padding: 3px 0px 3px 3px;\n}\n\n/* input[type='range']::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 16px;\n height: 16px;\n background: var(--text-color);\n border-radius: 50%;\n cursor: pointer;\n} */\n\ninput[type=\"range\"]::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 20px;\n height: 20px;\n background: rgb(109, 109, 95);\n /* Cor do botão */\n border-radius: 50%;\n cursor: pointer;\n}\n\n.options {\n margin: 0px 0;\n display: flex;\n gap: 10px;\n flex-direction: column;\n}\n\n.options label {\n display: flex;\n margin: 0px 0;\n font-size: 0.9rem;\n color: #333;\n align-items: center;\n}\n\n.options input[type='radio'] {\n margin-right: 8px;\n height: 16px;\n width: 16px;\n}\n\n.options input[type='radio'] {\n appearance: none;\n -webkit-appearance: none;\n margin-right: 8px;\n width: 16px;\n height: 16px;\n border: 2px solid #ddd;\n border-radius: 50%;\n background-color: #fff;\n cursor: pointer;\n transition: all 0.3s;\n padding: 0px;\n}\n\n.options input[type='radio']:checked {\n border-color: #000;\n background-color: #FAFAFA;\n border: 4px solid #000;\n}\n\n.info-box {\n background-color: #f9f9f9;\n border: 1px solid #e0e0e0;\n border-radius: 4px;\n padding: 8px;\n font-size: 14px;\n color: #262626;\n line-height: 20px;\n}\n\n.info-icon {\n font-size: 0.9rem;\n cursor: pointer;\n color: #888;\n}\n\nh3 {\n font-size: 1.2rem;\n margin-bottom: 8px;\n color: #333;\n}\n\n.slider-wrapper {\n position: relative;\n margin: 21px 0px 0px 0px;\n}\n\n.slider {\n width: 100%;\n -webkit-appearance: none;\n background: #ddd;\n height: 4px;\n border-radius: 2px;\n outline: none;\n}\n\n.slider::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 16px;\n height: 16px;\n background: var(--text-color);\n /* Azul para o slider */\n border-radius: 50%;\n cursor: pointer;\n}\n\n.slider-value {\n position: absolute;\n top: -30px;\n /* Posição acima do slider */\n font-size: 16px;\n font-weight: 700;\n color: var(--text-color);\n /* Verde para o texto */\n transform: translateX(-50%);\n white-space: nowrap;\n /* margin-left: 23px; */\n}\n\n.options-option {\n display: flex;\n}\n\n\n/* ########################################## */\n","import { Component, Prop, State, Watch, h } from \"@stencil/core\";\nimport { IBonus } from \"../../../../dto/validate.pin.bonus\";\n\nimport i18next from '../../../../i18n/i18n'\nimport { USED_KEY } from \"../../../../utils/keys.storage\";\nimport { defineLimit, formatDateToBr } from \"../../../../utils/utils\";\nimport { IInfoStore } from \"../../../../helpers/info.config.helper\";\n\n@Component({\n tag: 'giftback-info',\n styleUrls: ['giftback-info.css']\n})\nexport class GiftbackInfo {\n @State() usedValue: number = 0;\n @State() selectedOption: string = 'none';\n\n @Prop() loading: boolean = false;\n @Prop() bonus: Partial<IBonus> = {\n totalBonus: 0,\n cartId: \"\",\n minimumPurchase: 0,\n bonusBalance: 0,\n calculatedValue: 0,\n firstValidityDate: \"\",\n totalValue: 0\n };\n @Prop() reserve: (amountRedeemed: number) => void;\n @Prop() cancel: () => void;\n @Prop() config: IInfoStore;\n\n @State() sliderPosition: number = 0;\n @State() sliderValuePosition: number = 0;\n\n @State() loadingTime = false;\n\n @Watch(\"bonus\")\n changedBonus() {\n this.updateBonus()\n }\n\n private updateBonus() {\n this.usedValue = this.bonus.bonusBalance;\n this.buildPositionSlider(0, this.bonus.totalBonus);\n }\n\n componentWillLoad() {\n this.updateBonus();\n this.selectedOption = localStorage.getItem(USED_KEY);\n }\n\n handleSliderChange(event: Event) {\n const input = event.target as HTMLInputElement;\n this.usedValue = parseFloat(input.value);\n\n // Calculando a posição do texto com base no valor do slider\n // const percentage = ((this.usedValue - parseInt(input.min)) / (parseInt(input.max) - parseInt(input.min))) * 100;\n // this.sliderPosition = percentage;\n\n this.buildPositionSlider(parseFloat(input.min), parseFloat(input.max))\n }\n\n componentDidLoad() {\n const input: any = document.getElementById(\"position_value_id\")\n\n input.value = this.bonus.bonusBalance;\n }\n\n\n private buildPositionSlider(min: number, max: number) {\n\n const percentage_init = max * 0.1;\n\n // Calculando a posição do texto com base no valor do slider\n const percentage = ((this.usedValue - min) / (max - min)) * 100;\n\n this.sliderPosition = percentage;\n this.sliderValuePosition = percentage + (this.usedValue <= percentage_init ? 10 : 0);\n }\n\n async handleOptionChange(option: string) {\n this.selectedOption = option;\n\n localStorage.setItem(USED_KEY, option);\n\n switch (this.selectedOption) {\n case 'use':\n await this.reserve(this.usedValue);\n break;\n case 'dontUse':\n await this.cancel();\n break;\n default:\n }\n }\n\n showTime() {\n const time = localStorage.getItem(\"bc:time\");\n\n const allow = localStorage.getItem(\"bc:time-allow\");\n\n if(!allow) return false;\n\n return !!time;\n }\n\n getTime() {\n const time = localStorage.getItem(\"bc:time\");\n return Number(time) || 360;\n }\n\n render() {\n const remainingGiftback = this.bonus.minimumPurchase - this.bonus.totalValue;\n\n const translateDescription = i18next.t(\"giftDescription\", { amount: `${this.bonus.totalBonus.toFixed(2).replace(\".\", \",\")}`, custom_name: \"Giftback\" })\n\n const limit = defineLimit(remainingGiftback);\n\n return (\n\n <div class=\"giftback-container\">\n <div class=\"container-description\">\n <p innerHTML={translateDescription}></p>\n <crm-tooltip identity=\"crm-role-description\" text={i18next.t(\"labelUseGiftback\", { minimumPurchase: this.bonus.minimumPurchase, expírationDate: formatDateToBr(this.bonus.firstValidityDate) })} />\n </div>\n <div class=\"slider-wrapper\">\n <div\n class=\"slider-value\"\n style={{\n left: `calc(${this.sliderValuePosition}% - 20px)`, // Ajuste para centralizar o texto\n\n }}\n >\n R$ {this.usedValue.toFixed(2).replace(\".\", \",\")}\n </div>\n <input\n id=\"position_value_id\"\n disabled\n type=\"range\"\n min=\"0\"\n max={this.bonus.totalBonus}\n value={this.usedValue}\n class=\"slider\"\n step=\"0.01\"\n onInput={(event) => this.handleSliderChange(event)}\n style={{\n background: `linear-gradient(to right, #6D6D5F ${this.sliderPosition}%, #ddd ${this.sliderPosition}%)`,\n }}\n />\n </div>\n\n {\n limit.isComplete && (\n <p>\n {i18next.t(\"maxAmount\")}\n </p>\n )\n }\n\n {\n !limit.isComplete && (\n <div class=\"container-description\">\n <p>\n Adicione <strong>R$ {remainingGiftback < 0 ? \"0,00\" : remainingGiftback.toFixed(2).replace(\".\", \",\")}</strong> ao carrinho para atingir o valor\n máximo!\n </p>\n <crm-tooltip identity=\"crm-max-description\" text={i18next.t(\"labelamountPartial\")} />\n </div>\n )\n }\n\n\n <div class=\"options\">\n <div class=\"options-option\">\n <input\n disabled={this.showTime()}\n type=\"radio\"\n name=\"giftbackOption\"\n value=\"use\"\n checked={this.selectedOption === 'use'}\n onChange={() => this.handleOptionChange('use')}\n />\n <p>Usar o meu {this.config?.giftbackTitle}</p>\n </div>\n <div class=\"options-option\">\n <input\n disabled={this.showTime()}\n type=\"radio\"\n name=\"giftbackOption\"\n value=\"dontUse\"\n checked={this.selectedOption === 'dontUse'}\n onChange={() => this.handleOptionChange('dontUse')}\n />\n <p>Não usar o meu {this.config?.giftbackTitle}</p>\n </div>\n </div>\n\n {\n this.showTime() &&\n (\n <div class=\"info-box\">\n Após <countdown-timer initialValue={this.getTime()} downtime={() => { this.loadingTime = true }} />, você poderá alterar sua escolha de usar ou não o Giftback.\n </div>\n )\n }\n\n\n <div class=\"info-box\">\n O Giftback será aplicado na próxima etapa.\n </div>\n </div>\n );\n }\n}"],"version":3}
@@ -1,4 +1,4 @@
1
- import { G as GiftbackPin, d as defineCustomElement$1 } from './p-78cca8a2.js';
1
+ import { G as GiftbackPin, d as defineCustomElement$1 } from './p-83a12a8f.js';
2
2
 
3
3
  const PinForm = GiftbackPin;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -1,2 +1,2 @@
1
- import{p as e,b as n}from"./p-3d6152b1.js";export{s as setNonce}from"./p-3d6152b1.js";import{g as a}from"./p-e1255160.js";var o=()=>{const n=import.meta.url;const a={};if(n!==""){a.resourcesUrl=new URL(".",n).href}return e(a)};o().then((async e=>{await a();return n([["p-6276ee63",[[2,"crm-bonus",{userId:[2,"userid"],storeName:[8,"storename"],productsInString:[1,"products"],cartId:[8,"cartid"],showModal:[32],products:[32],customer:[32],loading:[32],message:[32],phone:[32],canCancel:[32],amountCancel:[32],sent:[32],session:[32],loading_reprocess:[32],resetBonus:[64],reprocess:[64]},null,{productsInString:["watchProducts"]}]]],["p-147ba861",[[1,"crm-bonus-form",{storeName:[8,"storename"],cartId:[8,"cart-id"],products:[16],customer:[16],sent:[16],stepNext:[2,"step-next"],phone:[2],loadingModal:[4,"loading-modal"],saveStore:[16],cancel:[16],handleCustomerName:[16],loading:[32],step:[32],message:[32],bonus:[32],setStep:[64]}]]],["p-35ea89d8",[[0,"crm-bonus-note",{cartId:[8,"cartid"],storename:[8],url:[32],config:[32],bonus:[32],showEdit:[32]}]]],["p-74206c91",[[0,"phone-cancel-input",{sendPin:[16],loading:[4],value:[1]}]]],["p-03b77c41",[[0,"phone-input",{sendPin:[16],loading:[4],value:[1]}]]],["p-885fc30e",[[1,"app-modal",{isOpen:[516,"is-open"],modalTitle:[1,"modal-title"]}]]],["p-b873347f",[[0,"pedido-finalizado",{cartId:[1,"cartid"],orderId:[2,"orderid"],metadadoString:[1,"metadado"]}]]],["p-620ec1a3",[[1,"phone-input-mask",{initialValue:[1,"initial-value"],disabled:[4],phone:[32],message:[32],getPhone:[64]}]]],["p-be3ddacc",[[1,"loading-spinner",{size:[1],color:[1]}]]],["p-faff2cf2",[[0,"crm-button",{txtBtn:[1,"txt-btn"],loading:[4],handleClick:[16]}],[1,"countdown-timer",{downtime:[16],initialValue:[2,"initial-value"],seconds:[32]}]]],["p-48a8f372",[[0,"phone-form",{value:[1],loading:[4],handlerSubmit:[16],config:[16]}],[1,"pin-form",{validate:[16],cancel:[16],resend:[16],sent:[16],loading:[4],phone:[1],config:[16],pin:[32],isVerified:[32],canResend:[32]}],[0,"giftback-info",{loading:[4],bonus:[16],reserve:[16],cancel:[16],config:[16],usedValue:[32],selectedOption:[32],sliderPosition:[32],sliderValuePosition:[32],loadingTime:[32]},null,{bonus:["changedBonus"]}],[0,"crm-tooltip",{text:[1],identity:[1]}]]],["p-21464f24",[[0,"crm-giftback-form",{storeName:[8,"storename"],cartId:[8,"cart-id"],products:[16],customer:[16],loadProducts:[16],value:[32],loading:[32],message:[32],phone:[32],pinInfo:[32],step:[32],bonus:[32],sucess:[32],error:[32],config:[32],hasApplyBonus:[32],setStep:[64],processBonus:[64]}],[4,"loading-container",{loading:[4]}]]],["p-b7a8f915",[[1,"giftback-pin",{sent:[16],validate:[16],cancel:[16],loading:[4],pin:[32],isVerified:[32]}],[1,"giftback-progress",{loading:[4],bonus:[16],reserve:[16],cancel:[16],usedValue:[32]}],[0,"name-input",{value:[1],loading:[4],applyName:[16],cancel:[16],newValue:[32],message:[32]}],[1,"giftback-finish"]]]],e)}));
1
+ import{p as e,b as n}from"./p-3d6152b1.js";export{s as setNonce}from"./p-3d6152b1.js";import{g as a}from"./p-e1255160.js";var o=()=>{const n=import.meta.url;const a={};if(n!==""){a.resourcesUrl=new URL(".",n).href}return e(a)};o().then((async e=>{await a();return n([["p-6276ee63",[[2,"crm-bonus",{userId:[2,"userid"],storeName:[8,"storename"],productsInString:[1,"products"],cartId:[8,"cartid"],showModal:[32],products:[32],customer:[32],loading:[32],message:[32],phone:[32],canCancel:[32],amountCancel:[32],sent:[32],session:[32],loading_reprocess:[32],resetBonus:[64],reprocess:[64]},null,{productsInString:["watchProducts"]}]]],["p-147ba861",[[1,"crm-bonus-form",{storeName:[8,"storename"],cartId:[8,"cart-id"],products:[16],customer:[16],sent:[16],stepNext:[2,"step-next"],phone:[2],loadingModal:[4,"loading-modal"],saveStore:[16],cancel:[16],handleCustomerName:[16],loading:[32],step:[32],message:[32],bonus:[32],setStep:[64]}]]],["p-9baba59d",[[0,"crm-bonus-note",{cartId:[8,"cartid"],storename:[8],url:[32],config:[32],bonus:[32],showEdit:[32]}]]],["p-74206c91",[[0,"phone-cancel-input",{sendPin:[16],loading:[4],value:[1]}]]],["p-03b77c41",[[0,"phone-input",{sendPin:[16],loading:[4],value:[1]}]]],["p-885fc30e",[[1,"app-modal",{isOpen:[516,"is-open"],modalTitle:[1,"modal-title"]}]]],["p-b873347f",[[0,"pedido-finalizado",{cartId:[1,"cartid"],orderId:[2,"orderid"],metadadoString:[1,"metadado"]}]]],["p-620ec1a3",[[1,"phone-input-mask",{initialValue:[1,"initial-value"],disabled:[4],phone:[32],message:[32],getPhone:[64]}]]],["p-be3ddacc",[[1,"loading-spinner",{size:[1],color:[1]}]]],["p-90716188",[[0,"crm-button",{txtBtn:[1,"txt-btn"],loading:[4],handleClick:[16]}],[1,"countdown-timer",{downtime:[16],initialValue:[2,"initial-value"],seconds:[32]}]]],["p-48a8f372",[[0,"phone-form",{value:[1],loading:[4],handlerSubmit:[16],config:[16]}],[1,"pin-form",{validate:[16],cancel:[16],resend:[16],sent:[16],loading:[4],phone:[1],config:[16],pin:[32],isVerified:[32],canResend:[32]}],[0,"giftback-info",{loading:[4],bonus:[16],reserve:[16],cancel:[16],config:[16],usedValue:[32],selectedOption:[32],sliderPosition:[32],sliderValuePosition:[32],loadingTime:[32]},null,{bonus:["changedBonus"]}],[0,"crm-tooltip",{text:[1],identity:[1]}]]],["p-21464f24",[[0,"crm-giftback-form",{storeName:[8,"storename"],cartId:[8,"cart-id"],products:[16],customer:[16],loadProducts:[16],value:[32],loading:[32],message:[32],phone:[32],pinInfo:[32],step:[32],bonus:[32],sucess:[32],error:[32],config:[32],hasApplyBonus:[32],setStep:[64],processBonus:[64]}],[4,"loading-container",{loading:[4]}]]],["p-b7a8f915",[[1,"giftback-pin",{sent:[16],validate:[16],cancel:[16],loading:[4],pin:[32],isVerified:[32]}],[1,"giftback-progress",{loading:[4],bonus:[16],reserve:[16],cancel:[16],usedValue:[32]}],[0,"name-input",{value:[1],loading:[4],applyName:[16],cancel:[16],newValue:[32],message:[32]}],[1,"giftback-finish"]]]],e)}));
2
2
  //# sourceMappingURL=crmbonus-component-wake.esm.js.map
@@ -0,0 +1,2 @@
1
+ import{r as t,h as e}from"./p-3d6152b1.js";const n=class{constructor(e){t(this,e);this.downtime=undefined;this.initialValue=0;this.seconds=0}componentWillLoad(){const t=localStorage.getItem("bc:time");this.seconds=t?Number(t):this.initialValue;this.intervalId=setInterval((()=>{if(this.seconds>0){this.seconds--;localStorage.setItem("bc:time",this.seconds.toString())}else{clearInterval(this.intervalId);this.downtime();localStorage.removeItem("bc:time")}}),1e3)}disconnectedCallback(){clearInterval(this.intervalId)}padLeft(){const t=this.seconds/60;const e=this.seconds%60;if(t<1)return`${e}s`;return`${parseInt(t.toString())}m ${e}s`}render(){return e("label",{key:"6fe8811ce04f0f95d31404c2257124f454ab3cfa"},this.padLeft())}};const i="input,button{margin:0;padding:10px;}.crm-contaner-button{height:auto;width:auto}.crm-button{height:48px;width:100%;border:1px solid #000;padding:14px 20px;background-color:#000;color:#fff;font-size:14px;line-height:20px;font-weight:500;cursor:pointer}";const s=i;const o=class{constructor(e){t(this,e);this.txtBtn=undefined;this.loading=undefined;this.handleClick=undefined}render(){return e("div",{key:"848df9f754a114343163eae85d34a2acb6b04863",class:"crm-contaner-button"},e("button",{key:"517b761b39ced2615dd04fc42d5aaa98a7d749f6",class:"crm-button",onClick:()=>this.handleClick()},!this.loading?this.txtBtn:e("loading-spinner",{size:"15px",color:"#fff"})))}};o.style=s;export{n as countdown_timer,o as crm_button};
2
+ //# sourceMappingURL=p-90716188.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["CountdownTimer","componentWillLoad","initial","localStorage","getItem","this","seconds","Number","initialValue","intervalId","setInterval","setItem","toString","clearInterval","downtime","removeItem","disconnectedCallback","padLeft","minutes","parseInt","render","h","key","crmButtonCss","CrmButtonStyle0","Button","class","onClick","handleClick","loading","txtBtn","size","color"],"sources":["src/components/countdown-timer/countdown-timer.tsx","src/components/button/crm-button.css?tag=crm-button","src/components/button/index.tsx"],"sourcesContent":["import { Component, h, Prop, State } from '@stencil/core';\n\n@Component({\n tag: 'countdown-timer',\n shadow: true,\n})\nexport class CountdownTimer {\n\n @Prop() downtime: () => void;\n @Prop() initialValue: number = 0;\n\n @State() seconds: number = 0;\n\n private intervalId: NodeJS.Timer;\n\n componentWillLoad() {\n const initial = localStorage.getItem(\"bc:time\");\n\n this.seconds = initial ? Number(initial) : this.initialValue;\n \n this.intervalId = setInterval(() => {\n if (this.seconds > 0) {\n this.seconds--;\n\n localStorage.setItem(\"bc:time\", this.seconds.toString());\n } else {\n clearInterval(this.intervalId);\n\n this.downtime();\n\n localStorage.removeItem(\"bc:time\");\n }\n }, 1000); // Intervalo de 1 segundo\n }\n\n disconnectedCallback() {\n clearInterval(this.intervalId);\n }\n\n padLeft() {\n const minutes = this.seconds / 60; \n const seconds = this.seconds % 60;\n\n if(minutes < 1) return `${seconds}s`\n \n return `${parseInt(minutes.toString())}m ${seconds}s`\n }\n\n render() {\n return (\n <label>{this.padLeft()}</label>\n );\n }\n}\n","input, button {\n margin: 0;\n padding: 10px; /* Ajuste o valor conforme necessário */\n}\n\n.crm-contaner-button {\n height: auto;\n width: auto;\n}\n\n.crm-button {\n height: 48px;\n width: 100%;\n border: 1px solid #000;\n padding: 14px 20px;\n background-color: #000;\n color: #fff;\n font-size: 14px;\n line-height: 20px;\n font-weight: 500;\n cursor: pointer;\n}","import { Component, Prop, h } from \"@stencil/core\";\n\n@Component({\n tag: 'crm-button',\n styleUrl: 'crm-button.css'\n})\nexport class Button {\n\n @Prop() txtBtn: string;\n @Prop() loading: boolean;\n\n @Prop() handleClick: () => void;\n\n render() {\n return (\n <div class=\"crm-contaner-button\">\n <button class=\"crm-button\" onClick={() => this.handleClick()}>\n {\n !this.loading ? this.txtBtn : <loading-spinner size=\"15px\" color=\"#fff\" />\n }\n </button>\n </div>\n )\n }\n}"],"mappings":"iDAMaA,EAAc,M,mEAGQ,E,aAEJ,C,CAI3B,iBAAAC,GACI,MAAMC,EAAUC,aAAaC,QAAQ,WAErCC,KAAKC,QAAWJ,EAAUK,OAAOL,GAAWG,KAAKG,aAEjDH,KAAKI,WAAaC,aAAY,KAC1B,GAAIL,KAAKC,QAAU,EAAG,CAClBD,KAAKC,UAELH,aAAaQ,QAAQ,UAAWN,KAAKC,QAAQM,W,KAC1C,CACHC,cAAcR,KAAKI,YAEnBJ,KAAKS,WAELX,aAAaY,WAAW,U,IAE7B,I,CAGP,oBAAAC,GACIH,cAAcR,KAAKI,W,CAGvB,OAAAQ,GACI,MAAMC,EAAUb,KAAKC,QAAU,GAC/B,MAAMA,EAAUD,KAAKC,QAAU,GAE/B,GAAGY,EAAU,EAAG,MAAO,GAAGZ,KAE1B,MAAO,GAAGa,SAASD,EAAQN,gBAAgBN,I,CAG/C,MAAAc,GACI,OACIC,EAAA,SAAAC,IAAA,4CAAQjB,KAAKY,U,GClDzB,MAAMM,EAAe,8PACrB,MAAAC,EAAeD,E,MCKFE,EAAM,M,iGAOf,MAAAL,GACI,OACIC,EAAA,OAAAC,IAAA,2CAAKI,MAAM,uBACPL,EAAA,UAAAC,IAAA,2CAAQI,MAAM,aAAaC,QAAS,IAAMtB,KAAKuB,gBAEtCvB,KAAKwB,QAAUxB,KAAKyB,OAAST,EAAA,mBAAiBU,KAAK,OAAOC,MAAM,U","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{r as n,h as e}from"./p-3d6152b1.js";import{g as t}from"./p-75ba7b9a.js";import{g as i}from"./p-f9aeffc1.js";import{i as a}from"./p-e8c19a64.js";const c="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPgo8c3ZnIHdpZHRoPSI4MDBweCIgaGVpZ2h0PSI4MDBweCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2Utd2lkdGg9IjIiLz4KPHBhdGggZD0iTTE1IDkuOTQ3MjhDMTQuNSA5LjMgMTMuOCA4LjUgMTIgOC41QzEwLjIgOC41IDkgOS41MTM5MyA5IDkuOTQ3MjhDOSAxMC4zODA2IDkuMDY3ODYgMTAuOTI3NyAxMCAxMS41QzEwLjc1MjIgMTEuOTYxOCAxMi42Njg0IDEyLjA0MzkgMTMuNSAxMi41QzE0LjY3OSAxMy4xNDY3IDE0Ljg0OTcgMTMuODIwMiAxNC44NDk3IDE0LjA1MjJDMTQuODQ5NyAxNC42ODM3IDEzLjQxNzUgMTUuNDg1MiAxMiAxNS41QzEwLjUzNiAxNS41MTUzIDkuNSAxNC43IDkgMTQuMDUyMiIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8cGF0aCBkPSJNMTIgN1YxNyIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2Utd2lkdGg9IjEuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPg==";function o(){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 d=".note-container {\n border: 1px solid #dddddd;\n padding: 0 15px 15px;\n margin: 0 0 26px 0px;\n display: flex;\n flex-direction: column;\n gap: 13px;\n\n\n & .description {\n display: flex;\n flex-direction: column;\n gap: 13px;\n }\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}";const s=d;const l=class{constructor(e){n(this,e);this.cartId=undefined;this.storename=undefined;this.url=undefined;this.config=undefined;this.bonus=undefined;this.showEdit=false}componentWillLoad(){this.upadateCheckToFreteAndGetUrl();this.startTime()}upadateCheckToFreteAndGetUrl(){this.config=t(this.storename);const n=document.getElementsByName("forma-envio");n.forEach((n=>{n.checked=false}));this.url=window.location.origin}handleHide(){const n=localStorage.getItem(this.cartId);return!!n}getAmount(){const n=localStorage.getItem(this.cartId);return n?Number(n).toFixed(2).replace(".",",")||"0,00":"0,00"}async backCart(){window.location.href=this.url}startTime(){if(document.location.pathname=="/Fechamento"){if(!localStorage.getItem("bc:time-allow")){localStorage.removeItem("bc:time")}o()}}hasBonus(){const n=localStorage.getItem(i(this.cartId));const e={hasBonus:false,requestBonus:false};if(n){this.bonus=JSON.parse(n);e.hasBonus=this.bonus.hasBonus;e.requestBonus=true}return e}render(){const n=this.config.giftbackTitle||"Giftback";const t=this.hasBonus();return e("div",{key:"2ce9d0ebd4c796ea7812cbd934d8dc2abc7c65d0"},e("div",{key:"4bc8a698cd77677291e58bae000d294f00d9350c",class:"note-container"},e("div",{key:"64edc1f1141614dd6e378c81d0110e1713caed88",class:"note-header"},e("p",{key:"37e52138331897e0e4c43c1b39d2bc56dcb4dae9",class:"note-title"},e("img",{key:"3716f55a0571e5c2c12274935dde99dceb8f10dd",src:c,width:23}),this.config.giftbackTitle),t.hasBonus&&e("div",{key:"66f9cfec76b7fb878eab7deea954441c1b61ba4e"},this.showEdit&&e("p",{key:"2dc0b7d75c7cea3923be333fccf2ea15153aed72",class:"back-cart",onClick:()=>this.backCart()},a.t("edit")),!this.showEdit&&e("countdown-timer",{key:"ab228f6aa8a691227a8380ff1ff1f677998e6aa8",initialValue:60,downtime:()=>{this.showEdit=true}}))),t.hasBonus&&e("p",{key:"aa70095a7472df8d332d50299977f7b9b645eaa4",class:"note-description-2"},a.t("withApplyBonus",{giftbackname:n})," ",e("strong",{key:"a6203afca4c2f02b441eb618fd84c3f9f7254127"},"R$ ",this.getAmount(),".")),t.requestBonus&&!t.hasBonus&&e("p",{key:"a75fc7247d5e443600015e340e8d47f3dfa0baf7",class:"note-description-not"},a.t("noBonus",{giftbackname:n})),!t.requestBonus&&e("div",{key:"49d5eea185140c5a06c1f745bf7011b01dd683bb",class:"description"},e("p",{key:"1b2c5ac3753c6fc4162311001be0253007d30a26",class:"note-description-not"},a.t("backCart")),e("crm-button",{key:"1fc75a0d0defb7369c6a06814f25627a04753164",txtBtn:"VOLTAR AO CARRINHO",handleClick:()=>this.backCart()}))))}};l.style=s;export{l as crm_bonus_note};
2
- //# sourceMappingURL=p-35ea89d8.entry.js.map
1
+ import{r as e,h as n}from"./p-3d6152b1.js";import{g as t}from"./p-75ba7b9a.js";import{g as i}from"./p-f9aeffc1.js";import{i as a}from"./p-e8c19a64.js";const c="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPgo8c3ZnIHdpZHRoPSI4MDBweCIgaGVpZ2h0PSI4MDBweCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2Utd2lkdGg9IjIiLz4KPHBhdGggZD0iTTE1IDkuOTQ3MjhDMTQuNSA5LjMgMTMuOCA4LjUgMTIgOC41QzEwLjIgOC41IDkgOS41MTM5MyA5IDkuOTQ3MjhDOSAxMC4zODA2IDkuMDY3ODYgMTAuOTI3NyAxMCAxMS41QzEwLjc1MjIgMTEuOTYxOCAxMi42Njg0IDEyLjA0MzkgMTMuNSAxMi41QzE0LjY3OSAxMy4xNDY3IDE0Ljg0OTcgMTMuODIwMiAxNC44NDk3IDE0LjA1MjJDMTQuODQ5NyAxNC42ODM3IDEzLjQxNzUgMTUuNDg1MiAxMiAxNS41QzEwLjUzNiAxNS41MTUzIDkuNSAxNC43IDkgMTQuMDUyMiIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8cGF0aCBkPSJNMTIgN1YxNyIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2Utd2lkdGg9IjEuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPg==";function o(){if(localStorage.getItem("bc:time-allow")){return}const e=localStorage.getItem("bc:time");if(!e){localStorage.setItem("bc:time","360");localStorage.setItem("bc:time-allow","true");return}}const d=".note-container {\n border: 1px solid #dddddd;\n padding: 0 15px 15px;\n margin: 0 0 26px 0px;\n display: flex;\n flex-direction: column;\n gap: 13px;\n\n\n & .description {\n display: flex;\n flex-direction: column;\n gap: 13px;\n }\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}";const s=d;const l=class{constructor(n){e(this,n);this.cartId=undefined;this.storename=undefined;this.url=undefined;this.config=undefined;this.bonus=undefined;this.showEdit=false}componentWillLoad(){this.upadateCheckToFreteAndGetUrl();this.startTime()}upadateCheckToFreteAndGetUrl(){this.config=t(this.storename);const e=document.getElementsByName("forma-envio");e.forEach((e=>{e.checked=false}));this.url=window.location.origin}handleHide(){const e=localStorage.getItem(this.cartId);return!!e}getAmount(){const e=localStorage.getItem(this.cartId);return e?Number(e).toFixed(2).replace(".",",")||"0,00":"0,00"}async backCart(){window.location.href=this.url}startTime(){if(document.location.pathname=="/Fechamento"){if(!localStorage.getItem("bc:time-allow")){localStorage.removeItem("bc:time")}o()}}hasBonus(){const e=localStorage.getItem(i(this.cartId));const n={hasBonus:false,requestBonus:false};if(e){this.bonus=JSON.parse(e);n.hasBonus=this.bonus.hasBonus;n.requestBonus=true}return n}render(){const e=this.config.giftbackTitle||"Giftback";const t=this.hasBonus();return n("div",{key:"2ce9d0ebd4c796ea7812cbd934d8dc2abc7c65d0"},n("div",{key:"4bc8a698cd77677291e58bae000d294f00d9350c",class:"note-container"},n("div",{key:"64edc1f1141614dd6e378c81d0110e1713caed88",class:"note-header"},n("p",{key:"37e52138331897e0e4c43c1b39d2bc56dcb4dae9",class:"note-title"},n("img",{key:"3716f55a0571e5c2c12274935dde99dceb8f10dd",src:c,width:23}),this.config.giftbackTitle),t.hasBonus&&n("div",{key:"66f9cfec76b7fb878eab7deea954441c1b61ba4e"},this.showEdit&&n("p",{key:"2dc0b7d75c7cea3923be333fccf2ea15153aed72",class:"back-cart",onClick:()=>this.backCart()},a.t("edit")),!this.showEdit&&n("countdown-timer",{key:"1214e2f683e3024c6ea1a7355f5d0b1aec0b284a",initialValue:0,downtime:()=>{this.showEdit=true}}))),t.hasBonus&&n("p",{key:"d6f493f22d8f5aefd65606280fd4d92d7f93cd36",class:"note-description-2"},a.t("withApplyBonus",{giftbackname:e})," ",n("strong",{key:"f0ab3bf5965d2f17d96da71f82aa604e426c0eac"},"R$ ",this.getAmount(),".")),t.requestBonus&&!t.hasBonus&&n("p",{key:"6224d23ad68d4a1e7af4e37561546a0cd8782633",class:"note-description-not"},a.t("noBonus",{giftbackname:e})),!t.requestBonus&&n("div",{key:"ce39041c0c2efd14abfe41851a3d65940ca54a56",class:"description"},n("p",{key:"4898ce09cc4d0aa94e15adf0a75a7ae347d6e1e3",class:"note-description-not"},a.t("backCart")),n("crm-button",{key:"75f0f8ac5ac675f106ec04f09077040902cac377",txtBtn:"VOLTAR AO CARRINHO",handleClick:()=>this.backCart()}))))}};l.style=s;export{l as crm_bonus_note};
2
+ //# sourceMappingURL=p-9baba59d.entry.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["moneyDollarsSvgrepoComSvg","setTime","localStorage","getItem","time","setItem","crmBonusNoteCss","CrmBonusNoteStyle0","CrmBonusNote","componentWillLoad","this","upadateCheckToFreteAndGetUrl","startTime","config","getInfoCustomization","storename","envios","document","getElementsByName","forEach","envio","checked","url","window","location","origin","handleHide","amount","cartId","getAmount","Number","toFixed","replace","backCart","href","pathname","removeItem","hasBonus","_bonus","getKeyReserveByCartId","info","requestBonus","bonus","JSON","parse","render","giftbackname","giftbackTitle","infobonus","h","key","class","src","money","width","showEdit","onClick","i18next","t","initialValue","downtime","txtBtn","handleClick"],"sources":["src/assets/svg/money-dollars-svgrepo-com.svg","src/helpers/time.helper.ts","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 -->\n<svg width=\"800px\" height=\"800px\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<circle cx=\"12\" cy=\"12\" r=\"10\" stroke=\"#000000\" stroke-width=\"2\"/>\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\"/>\n<path d=\"M12 7V17\" stroke=\"#000000\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>","export function setTime() {\n\n if(localStorage.getItem(\"bc:time-allow\")) {\n return\n }\n\n const time = localStorage.getItem(\"bc:time\");\n\n if(!time) {\n localStorage.setItem(\"bc:time\", \"360\");\n localStorage.setItem(\"bc:time-allow\", \"true\");\n return\n } \n}",".note-container {\n border: 1px solid #dddddd;\n padding: 0 15px 15px;\n margin: 0 0 26px 0px;\n display: flex;\n flex-direction: column;\n gap: 13px;\n\n\n & .description {\n display: flex;\n flex-direction: column;\n gap: 13px;\n }\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 { getKeyReserveByCartId } from \"../../utils/keys.storage\";\nimport i18next from \"../../i18n/i18n\"\nimport { IBonus } from \"../../components\";\nimport { setTime } from \"../../helpers/time.helper\";\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 @State() bonus: IBonus;\n\n @State() showEdit: boolean = false;\n\n componentWillLoad() {\n this.upadateCheckToFreteAndGetUrl();\n this.startTime();\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 return amount ? Number(amount).toFixed(2).replace(\".\", \",\") || \"0,00\" : \"0,00\";\n }\n\n async backCart() {\n window.location.href = this.url;\n }\n\n\n private startTime() {\n if(document.location.pathname == '/Fechamento') {\n\n if(!localStorage.getItem(\"bc:time-allow\")) {\n localStorage.removeItem(\"bc:time\")\n }\n\n setTime();\n }\n }\n\n\n hasBonus() {\n const _bonus = localStorage.getItem(getKeyReserveByCartId(this.cartId));\n\n const info = {\n hasBonus: false,\n requestBonus: false\n }\n\n if (_bonus) {\n this.bonus = JSON.parse(_bonus);\n info.hasBonus = this.bonus.hasBonus;\n info.requestBonus = true;\n }\n\n return info;\n }\n\n render() {\n\n const giftbackname = this.config.giftbackTitle || \"Giftback\";\n\n const infobonus = this.hasBonus()\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 infobonus.hasBonus && (\n <div>\n {this.showEdit && (\n <p class=\"back-cart\" onClick={() => this.backCart()}>\n {i18next.t(\"edit\")}\n </p>\n )}\n {!this.showEdit && <countdown-timer initialValue={60} downtime={() => { this.showEdit = true }} />}\n </div>\n )\n }\n </div>\n\n {\n infobonus.hasBonus &&\n (\n <p class=\"note-description-2\">\n {i18next.t(\"withApplyBonus\", { giftbackname: giftbackname })} <strong>R$ {this.getAmount()}.</strong>\n </p>\n )\n }\n\n {\n (infobonus.requestBonus && !infobonus.hasBonus) &&\n (\n <p class=\"note-description-not\">\n {i18next.t(\"noBonus\", { giftbackname: giftbackname })}\n </p>\n )\n }\n\n {\n !infobonus.requestBonus &&\n (\n <div class=\"description\">\n <p class=\"note-description-not\">\n {i18next.t(\"backCart\")}\n </p>\n <crm-button txtBtn=\"VOLTAR AO CARRINHO\" handleClick={() => this.backCart()} />\n </div>\n )\n }\n\n {/* <a class=\"back-cart\" href={this.url}>\n Voltar ao carrinho\n </a> */}\n </div>\n </div>\n )\n }\n}"],"mappings":"uJAAA,MAAMA,EAA4B,6gC,SCAlBC,IAEZ,GAAGC,aAAaC,QAAQ,iBAAkB,CACtC,M,CAGJ,MAAMC,EAAOF,aAAaC,QAAQ,WAElC,IAAIC,EAAM,CACNF,aAAaG,QAAQ,UAAW,OAChCH,aAAaG,QAAQ,g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,KACvB5C,KAAKG,OAAOkC,eAGbC,EAAUX,UACNY,EAAA,OAAAC,IAAA,4CACKxC,KAAK6C,UACFN,EAAA,KAAAC,IAAA,2CAAGC,MAAM,YAAYK,QAAS,IAAM9C,KAAKuB,YACpCwB,EAAQC,EAAE,UAGjBhD,KAAK6C,UAAYN,EAAA,mBAAAC,IAAA,2CAAiBS,aAAc,GAAIC,SAAU,KAAQlD,KAAK6C,SAAW,IAAI,MAOxGP,EAAUX,UAENY,EAAA,KAAAC,IAAA,2CAAGC,MAAM,sBACJM,EAAQC,EAAE,iBAAkB,CAAEZ,aAAcA,IAAe,IAAEG,EAAA,UAAAC,IAAA,kDAAYxC,KAAKmB,YAAW,MAMjGmB,EAAUP,eAAiBO,EAAUX,UAElCY,EAAA,KAAAC,IAAA,2CAAGC,MAAM,wBACJM,EAAQC,EAAE,UAAW,CAAEZ,aAAcA,MAM7CE,EAAUP,cAEPQ,EAAA,OAAAC,IAAA,2CAAKC,MAAM,eACPF,EAAA,KAAAC,IAAA,2CAAGC,MAAM,wBACJM,EAAQC,EAAE,aAEfT,EAAA,cAAAC,IAAA,2CAAYW,OAAO,qBAAqBC,YAAa,IAAMpD,KAAKuB,e","ignoreList":[]}
1
+ {"version":3,"names":["moneyDollarsSvgrepoComSvg","setTime","localStorage","getItem","time","setItem","crmBonusNoteCss","CrmBonusNoteStyle0","CrmBonusNote","componentWillLoad","this","upadateCheckToFreteAndGetUrl","startTime","config","getInfoCustomization","storename","envios","document","getElementsByName","forEach","envio","checked","url","window","location","origin","handleHide","amount","cartId","getAmount","Number","toFixed","replace","backCart","href","pathname","removeItem","hasBonus","_bonus","getKeyReserveByCartId","info","requestBonus","bonus","JSON","parse","render","giftbackname","giftbackTitle","infobonus","h","key","class","src","money","width","showEdit","onClick","i18next","t","initialValue","downtime","txtBtn","handleClick"],"sources":["src/assets/svg/money-dollars-svgrepo-com.svg","src/helpers/time.helper.ts","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 -->\n<svg width=\"800px\" height=\"800px\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<circle cx=\"12\" cy=\"12\" r=\"10\" stroke=\"#000000\" stroke-width=\"2\"/>\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\"/>\n<path d=\"M12 7V17\" stroke=\"#000000\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>","export function setTime() {\n\n if(localStorage.getItem(\"bc:time-allow\")) {\n return\n }\n\n const time = localStorage.getItem(\"bc:time\");\n\n if(!time) {\n localStorage.setItem(\"bc:time\", \"360\");\n localStorage.setItem(\"bc:time-allow\", \"true\");\n return\n } \n}",".note-container {\n border: 1px solid #dddddd;\n padding: 0 15px 15px;\n margin: 0 0 26px 0px;\n display: flex;\n flex-direction: column;\n gap: 13px;\n\n\n & .description {\n display: flex;\n flex-direction: column;\n gap: 13px;\n }\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 { getKeyReserveByCartId } from \"../../utils/keys.storage\";\nimport i18next from \"../../i18n/i18n\"\nimport { IBonus } from \"../../components\";\nimport { setTime } from \"../../helpers/time.helper\";\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 @State() bonus: IBonus;\n\n @State() showEdit: boolean = false;\n\n componentWillLoad() {\n this.upadateCheckToFreteAndGetUrl();\n this.startTime();\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 return amount ? Number(amount).toFixed(2).replace(\".\", \",\") || \"0,00\" : \"0,00\";\n }\n\n async backCart() {\n window.location.href = this.url;\n }\n\n\n private startTime() {\n if(document.location.pathname == '/Fechamento') {\n\n if(!localStorage.getItem(\"bc:time-allow\")) {\n localStorage.removeItem(\"bc:time\")\n }\n\n setTime();\n }\n }\n\n\n hasBonus() {\n const _bonus = localStorage.getItem(getKeyReserveByCartId(this.cartId));\n\n const info = {\n hasBonus: false,\n requestBonus: false\n }\n\n if (_bonus) {\n this.bonus = JSON.parse(_bonus);\n info.hasBonus = this.bonus.hasBonus;\n info.requestBonus = true;\n }\n\n return info;\n }\n\n render() {\n\n const giftbackname = this.config.giftbackTitle || \"Giftback\";\n\n const infobonus = this.hasBonus()\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 infobonus.hasBonus && (\n <div>\n {this.showEdit && (\n <p class=\"back-cart\" onClick={() => this.backCart()}>\n {i18next.t(\"edit\")}\n </p>\n )}\n {!this.showEdit && <countdown-timer initialValue={0} downtime={() => { this.showEdit = true }} />}\n </div>\n )\n }\n </div>\n\n {\n infobonus.hasBonus &&\n (\n <p class=\"note-description-2\">\n {i18next.t(\"withApplyBonus\", { giftbackname: giftbackname })} <strong>R$ {this.getAmount()}.</strong>\n </p>\n )\n }\n\n {\n (infobonus.requestBonus && !infobonus.hasBonus) &&\n (\n <p class=\"note-description-not\">\n {i18next.t(\"noBonus\", { giftbackname: giftbackname })}\n </p>\n )\n }\n\n {\n !infobonus.requestBonus &&\n (\n <div class=\"description\">\n <p class=\"note-description-not\">\n {i18next.t(\"backCart\")}\n </p>\n <crm-button txtBtn=\"VOLTAR AO CARRINHO\" handleClick={() => this.backCart()} />\n </div>\n )\n }\n\n {/* <a class=\"back-cart\" href={this.url}>\n Voltar ao carrinho\n </a> */}\n </div>\n </div>\n )\n }\n}"],"mappings":"uJAAA,MAAMA,EAA4B,6gC,SCAlBC,IAEZ,GAAGC,aAAaC,QAAQ,iBAAkB,CACtC,M,CAGJ,MAAMC,EAAOF,aAAaC,QAAQ,WAElC,IAAIC,EAAM,CACNF,aAAaG,QAAQ,UAAW,OAChCH,aAAaG,QAAQ,gBAAiB,QACtC,M,CAER,CCbA,MAA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C,EAAUX,UACNY,EAAA,OAAAC,IAAA,4CACKxC,KAAK6C,UACFN,EAAA,KAAAC,IAAA,2CAAGC,MAAM,YAAYK,QAAS,IAAM9C,KAAKuB,YACpCwB,EAAQC,EAAE,UAGjBhD,KAAK6C,UAAYN,EAAA,mBAAAC,IAAA,2CAAiBS,aAAc,EAAGC,SAAU,KAAQlD,KAAK6C,SAAW,IAAI,MAOvGP,EAAUX,UAENY,EAAA,KAAAC,IAAA,2CAAGC,MAAM,sBACJM,EAAQC,EAAE,iBAAkB,CAAEZ,aAAcA,IAAe,IAAEG,EAAA,UAAAC,IAAA,kDAAYxC,KAAKmB,YAAW,MAMjGmB,EAAUP,eAAiBO,EAAUX,UAElCY,EAAA,KAAAC,IAAA,2CAAGC,MAAM,wBACJM,EAAQC,EAAE,UAAW,CAAEZ,aAAcA,MAM7CE,EAAUP,cAEPQ,EAAA,OAAAC,IAAA,2CAAKC,MAAM,eACPF,EAAA,KAAAC,IAAA,2CAAGC,MAAM,wBACJM,EAAQC,EAAE,aAEfT,EAAA,cAAAC,IAAA,2CAAYW,OAAO,qBAAqBC,YAAa,IAAMpD,KAAKuB,e","ignoreList":[]}
@@ -4,8 +4,8 @@ const CountdownTimer = class {
4
4
  constructor(hostRef) {
5
5
  registerInstance(this, hostRef);
6
6
  this.downtime = undefined;
7
- this.initialValue = 120;
8
- this.seconds = 30;
7
+ this.initialValue = 0;
8
+ this.seconds = 0;
9
9
  }
10
10
  componentWillLoad() {
11
11
  const initial = localStorage.getItem("bc:time");
@@ -33,7 +33,7 @@ const CountdownTimer = class {
33
33
  return `${parseInt(minutes.toString())}m ${seconds}s`;
34
34
  }
35
35
  render() {
36
- return (h("label", { key: '51f3be00f4abb6f20fcb9f029d50bbcffc69c111' }, this.padLeft()));
36
+ return (h("label", { key: '6fe8811ce04f0f95d31404c2257124f454ab3cfa' }, this.padLeft()));
37
37
  }
38
38
  };
39
39
 
@@ -1 +1 @@
1
- {"file":"countdown-timer.crm-button.entry.js","mapp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AAY,EAAC,OAAO,EAAE,MAAM,IAAI,CAAC,WAAW,EAAE,IAEpD,CAAC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,GAAG,uBAAiB,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,GAAG,CAEzE,CACP,EACT;KACJ;;;;;;","names":[],"sources":["src/components/countdown-timer/countdown-timer.tsx","src/components/button/crm-button.css?tag=crm-button","src/components/button/index.tsx"],"sourcesContent":["import { Component, h, Prop, State } from '@stencil/core';\n\n@Component({\n tag: 'countdown-timer',\n shadow: true,\n})\nexport class CountdownTimer {\n\n @Prop() downtime: () => void;\n @Prop() initialValue: number = 120;\n\n @State() seconds: number = 30;\n\n private intervalId: NodeJS.Timer;\n\n componentWillLoad() {\n const initial = localStorage.getItem(\"bc:time\");\n\n this.seconds = initial ? Number(initial) : this.initialValue;\n \n this.intervalId = setInterval(() => {\n if (this.seconds > 0) {\n this.seconds--;\n\n localStorage.setItem(\"bc:time\", this.seconds.toString());\n } else {\n clearInterval(this.intervalId);\n\n this.downtime();\n\n localStorage.removeItem(\"bc:time\");\n }\n }, 1000); // Intervalo de 1 segundo\n }\n\n disconnectedCallback() {\n clearInterval(this.intervalId);\n }\n\n padLeft() {\n const minutes = this.seconds / 60; \n const seconds = this.seconds % 60;\n\n if(minutes < 1) return `${seconds}s`\n \n return `${parseInt(minutes.toString())}m ${seconds}s`\n }\n\n render() {\n return (\n <label>{this.padLeft()}</label>\n );\n }\n}\n","input, button {\n margin: 0;\n padding: 10px; /* Ajuste o valor conforme necessário */\n}\n\n.crm-contaner-button {\n height: auto;\n width: auto;\n}\n\n.crm-button {\n height: 48px;\n width: 100%;\n border: 1px solid #000;\n padding: 14px 20px;\n background-color: #000;\n color: #fff;\n font-size: 14px;\n line-height: 20px;\n font-weight: 500;\n cursor: pointer;\n}","import { Component, Prop, h } from \"@stencil/core\";\n\n@Component({\n tag: 'crm-button',\n styleUrl: 'crm-button.css'\n})\nexport class Button {\n\n @Prop() txtBtn: string;\n @Prop() loading: boolean;\n\n @Prop() handleClick: () => void;\n\n render() {\n return (\n <div class=\"crm-contaner-button\">\n <button class=\"crm-button\" onClick={() => this.handleClick()}>\n {\n !this.loading ? this.txtBtn : <loading-spinner size=\"15px\" color=\"#fff\" />\n }\n </button>\n </div>\n )\n }\n}"],"version":3}
1
+ {"file":"countdown-timer.crm-button.entry.js","mappings":";;MAMa,cAAc;;;;4BAGQ,CAAC;uBAEL,CAAC;;IAI5B,iBAAiB;QACb,MAAM,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAEhD,IAAI,CAAC,OAAO,GAAI,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC;QAE9D,IAAI,CAAC,UAAU,GAAG,WAAW,CAAC;YAC1B,IAAI,IAAI,CAAC,OAAO,GAAG,CAAC,EAAE;gBAClB,IAAI,CAAC,OAAO,EAAE,CAAC;gBAEf,YAAY,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;aAC5D;iBAAM;gBACH,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;gBAE/B,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAEhB,YAAY,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;aACtC;SACJ,EAAE,IAAI,CAAC,CAAC;KACZ;IAED,oBAAoB;QAChB,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;KAClC;IAED,OAAO;QACH,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAElC,IAAG,OAAO,GAAG,CAAC;YAAE,OAAO,GAAG,OAAO,GAAG,CAAA;QAEpC,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,OAAO,GAAG,CAAA;KACxD;IAED,MAAM;QACF,QACI,gEAAQ,IAAI,CAAC,OAAO,EAAE,CAAS,EACjC;KACL;;;ACpDL,MAAM,YAAY,GAAG,6PAA6P,CAAC;AACnR,wBAAe,YAAY;;MCKd,MAAM;;;;;;;IAOf,MAAM;QACF,QACI,4DAAK,KAAK,EAAC,qBAAqB,IAC5B,+DAAQ,KAAK,EAAC,YAAY,EAAC,OAAO,EAAE,MAAM,IAAI,CAAC,WAAW,EAAE,IAEpD,CAAC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,GAAG,uBAAiB,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,GAAG,CAEzE,CACP,EACT;KACJ;;;;;;","names":[],"sources":["src/components/countdown-timer/countdown-timer.tsx","src/components/button/crm-button.css?tag=crm-button","src/components/button/index.tsx"],"sourcesContent":["import { Component, h, Prop, State } from '@stencil/core';\n\n@Component({\n tag: 'countdown-timer',\n shadow: true,\n})\nexport class CountdownTimer {\n\n @Prop() downtime: () => void;\n @Prop() initialValue: number = 0;\n\n @State() seconds: number = 0;\n\n private intervalId: NodeJS.Timer;\n\n componentWillLoad() {\n const initial = localStorage.getItem(\"bc:time\");\n\n this.seconds = initial ? Number(initial) : this.initialValue;\n \n this.intervalId = setInterval(() => {\n if (this.seconds > 0) {\n this.seconds--;\n\n localStorage.setItem(\"bc:time\", this.seconds.toString());\n } else {\n clearInterval(this.intervalId);\n\n this.downtime();\n\n localStorage.removeItem(\"bc:time\");\n }\n }, 1000); // Intervalo de 1 segundo\n }\n\n disconnectedCallback() {\n clearInterval(this.intervalId);\n }\n\n padLeft() {\n const minutes = this.seconds / 60; \n const seconds = this.seconds % 60;\n\n if(minutes < 1) return `${seconds}s`\n \n return `${parseInt(minutes.toString())}m ${seconds}s`\n }\n\n render() {\n return (\n <label>{this.padLeft()}</label>\n );\n }\n}\n","input, button {\n margin: 0;\n padding: 10px; /* Ajuste o valor conforme necessário */\n}\n\n.crm-contaner-button {\n height: auto;\n width: auto;\n}\n\n.crm-button {\n height: 48px;\n width: 100%;\n border: 1px solid #000;\n padding: 14px 20px;\n background-color: #000;\n color: #fff;\n font-size: 14px;\n line-height: 20px;\n font-weight: 500;\n cursor: pointer;\n}","import { Component, Prop, h } from \"@stencil/core\";\n\n@Component({\n tag: 'crm-button',\n styleUrl: 'crm-button.css'\n})\nexport class Button {\n\n @Prop() txtBtn: string;\n @Prop() loading: boolean;\n\n @Prop() handleClick: () => void;\n\n render() {\n return (\n <div class=\"crm-contaner-button\">\n <button class=\"crm-button\" onClick={() => this.handleClick()}>\n {\n !this.loading ? this.txtBtn : <loading-spinner size=\"15px\" color=\"#fff\" />\n }\n </button>\n </div>\n )\n }\n}"],"version":3}
@@ -77,10 +77,10 @@ const CrmBonusNote = class {
77
77
  render() {
78
78
  const giftbackname = this.config.giftbackTitle || "Giftback";
79
79
  const infobonus = this.hasBonus();
80
- return (h("div", { key: '2ce9d0ebd4c796ea7812cbd934d8dc2abc7c65d0' }, h("div", { key: '4bc8a698cd77677291e58bae000d294f00d9350c', class: "note-container" }, h("div", { key: '64edc1f1141614dd6e378c81d0110e1713caed88', class: "note-header" }, h("p", { key: '37e52138331897e0e4c43c1b39d2bc56dcb4dae9', class: "note-title" }, h("img", { key: '3716f55a0571e5c2c12274935dde99dceb8f10dd', src: moneyDollarsSvgrepoComSvg, width: 23 }), this.config.giftbackTitle), infobonus.hasBonus && (h("div", { key: '66f9cfec76b7fb878eab7deea954441c1b61ba4e' }, this.showEdit && (h("p", { key: '2dc0b7d75c7cea3923be333fccf2ea15153aed72', class: "back-cart", onClick: () => this.backCart() }, instance.t("edit"))), !this.showEdit && h("countdown-timer", { key: 'ab228f6aa8a691227a8380ff1ff1f677998e6aa8', initialValue: 60, downtime: () => { this.showEdit = true; } })))), infobonus.hasBonus &&
81
- (h("p", { key: 'aa70095a7472df8d332d50299977f7b9b645eaa4', class: "note-description-2" }, instance.t("withApplyBonus", { giftbackname: giftbackname }), " ", h("strong", { key: 'a6203afca4c2f02b441eb618fd84c3f9f7254127' }, "R$ ", this.getAmount(), "."))), (infobonus.requestBonus && !infobonus.hasBonus) &&
82
- (h("p", { key: 'a75fc7247d5e443600015e340e8d47f3dfa0baf7', class: "note-description-not" }, instance.t("noBonus", { giftbackname: giftbackname }))), !infobonus.requestBonus &&
83
- (h("div", { key: '49d5eea185140c5a06c1f745bf7011b01dd683bb', class: "description" }, h("p", { key: '1b2c5ac3753c6fc4162311001be0253007d30a26', class: "note-description-not" }, instance.t("backCart")), h("crm-button", { key: '1fc75a0d0defb7369c6a06814f25627a04753164', txtBtn: "VOLTAR AO CARRINHO", handleClick: () => this.backCart() }))))));
80
+ return (h("div", { key: '2ce9d0ebd4c796ea7812cbd934d8dc2abc7c65d0' }, h("div", { key: '4bc8a698cd77677291e58bae000d294f00d9350c', class: "note-container" }, h("div", { key: '64edc1f1141614dd6e378c81d0110e1713caed88', class: "note-header" }, h("p", { key: '37e52138331897e0e4c43c1b39d2bc56dcb4dae9', class: "note-title" }, h("img", { key: '3716f55a0571e5c2c12274935dde99dceb8f10dd', src: moneyDollarsSvgrepoComSvg, width: 23 }), this.config.giftbackTitle), infobonus.hasBonus && (h("div", { key: '66f9cfec76b7fb878eab7deea954441c1b61ba4e' }, this.showEdit && (h("p", { key: '2dc0b7d75c7cea3923be333fccf2ea15153aed72', class: "back-cart", onClick: () => this.backCart() }, instance.t("edit"))), !this.showEdit && h("countdown-timer", { key: '1214e2f683e3024c6ea1a7355f5d0b1aec0b284a', initialValue: 0, downtime: () => { this.showEdit = true; } })))), infobonus.hasBonus &&
81
+ (h("p", { key: 'd6f493f22d8f5aefd65606280fd4d92d7f93cd36', class: "note-description-2" }, instance.t("withApplyBonus", { giftbackname: giftbackname }), " ", h("strong", { key: 'f0ab3bf5965d2f17d96da71f82aa604e426c0eac' }, "R$ ", this.getAmount(), "."))), (infobonus.requestBonus && !infobonus.hasBonus) &&
82
+ (h("p", { key: '6224d23ad68d4a1e7af4e37561546a0cd8782633', class: "note-description-not" }, instance.t("noBonus", { giftbackname: giftbackname }))), !infobonus.requestBonus &&
83
+ (h("div", { key: 'ce39041c0c2efd14abfe41851a3d65940ca54a56', class: "description" }, h("p", { key: '4898ce09cc4d0aa94e15adf0a75a7ae347d6e1e3', class: "note-description-not" }, instance.t("backCart")), h("crm-button", { key: '75f0f8ac5ac675f106ec04f09077040902cac377', txtBtn: "VOLTAR AO CARRINHO", handleClick: () => this.backCart() }))))));
84
84
  }
85
85
  };
86
86
  CrmBonusNote.style = CrmBonusNoteStyle0;
@@ -1 +1 @@
1
- {"file":"crm-bonus-note.entry.js","mappings":";;;;;AAAA,MAAM,yBAAyB,GAAG,4gCAA4gC;;SCA9hC,OAAO;IAEnB,IAAG,YAAY,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE;QACtC,OAAM;KACT;IAED,MAAM,IAAI,GAAG,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAE7C,IAAG,CAAC,IAAI,EAAE;QACN,YAAY,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QACvC,YAAY,CAAC,OAAO,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;QAC9C,OAAM;KACT;AACL;;ACbA,MAAM,eAAe,GAAG,i3CAAi3C,CAAC;AAC14C,2BAAe,eAAe;;MCYjB,YAAY;;;;;;;;wBAUQ,KAAK;;IAElC,iBAAiB;QACb,IAAI,CAAC,4BAA4B,EAAE,CAAC;QACpC,IAAI,CAAC,SAAS,EAAE,CAAC;KACpB;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,OAAO,CAAC,CAAC,KAAU;YACtB,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC;SACzB,CAAC,CAAC;QAEH,IAAI,CAAC,GAAG,GAA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CAAC,QAAQ,EAAE,GAAI,CAC5E,CACT,CAMH,CACJ,EACT;KACJ;;;;;;","names":["money","i18next"],"sources":["src/assets/svg/money-dollars-svgrepo-com.svg","src/helpers/time.helper.ts","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 -->\n<svg width=\"800px\" height=\"800px\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<circle cx=\"12\" cy=\"12\" r=\"10\" stroke=\"#000000\" stroke-width=\"2\"/>\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\"/>\n<path d=\"M12 7V17\" stroke=\"#000000\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>","export function setTime() {\n\n if(localStorage.getItem(\"bc:time-allow\")) {\n return\n }\n\n const time = localStorage.getItem(\"bc:time\");\n\n if(!time) {\n localStorage.setItem(\"bc:time\", \"360\");\n localStorage.setItem(\"bc:time-allow\", \"true\");\n return\n } \n}",".note-container {\n border: 1px solid #dddddd;\n padding: 0 15px 15px;\n margin: 0 0 26px 0px;\n display: flex;\n flex-direction: column;\n gap: 13px;\n\n\n & .description {\n display: flex;\n flex-direction: column;\n gap: 13px;\n }\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 { getKeyReserveByCartId } from \"../../utils/keys.storage\";\nimport i18next from \"../../i18n/i18n\"\nimport { IBonus } from \"../../components\";\nimport { setTime } from \"../../helpers/time.helper\";\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 @State() bonus: IBonus;\n\n @State() showEdit: boolean = false;\n\n componentWillLoad() {\n this.upadateCheckToFreteAndGetUrl();\n this.startTime();\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 return amount ? Number(amount).toFixed(2).replace(\".\", \",\") || \"0,00\" : \"0,00\";\n }\n\n async backCart() {\n window.location.href = this.url;\n }\n\n\n private startTime() {\n if(document.location.pathname == '/Fechamento') {\n\n if(!localStorage.getItem(\"bc:time-allow\")) {\n localStorage.removeItem(\"bc:time\")\n }\n\n setTime();\n }\n }\n\n\n hasBonus() {\n const _bonus = localStorage.getItem(getKeyReserveByCartId(this.cartId));\n\n const info = {\n hasBonus: false,\n requestBonus: false\n }\n\n if (_bonus) {\n this.bonus = JSON.parse(_bonus);\n info.hasBonus = this.bonus.hasBonus;\n info.requestBonus = true;\n }\n\n return info;\n }\n\n render() {\n\n const giftbackname = this.config.giftbackTitle || \"Giftback\";\n\n const infobonus = this.hasBonus()\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 infobonus.hasBonus && (\n <div>\n {this.showEdit && (\n <p class=\"back-cart\" onClick={() => this.backCart()}>\n {i18next.t(\"edit\")}\n </p>\n )}\n {!this.showEdit && <countdown-timer initialValue={60} downtime={() => { this.showEdit = true }} />}\n </div>\n )\n }\n </div>\n\n {\n infobonus.hasBonus &&\n (\n <p class=\"note-description-2\">\n {i18next.t(\"withApplyBonus\", { giftbackname: giftbackname })} <strong>R$ {this.getAmount()}.</strong>\n </p>\n )\n }\n\n {\n (infobonus.requestBonus && !infobonus.hasBonus) &&\n (\n <p class=\"note-description-not\">\n {i18next.t(\"noBonus\", { giftbackname: giftbackname })}\n </p>\n )\n }\n\n {\n !infobonus.requestBonus &&\n (\n <div class=\"description\">\n <p class=\"note-description-not\">\n {i18next.t(\"backCart\")}\n </p>\n <crm-button txtBtn=\"VOLTAR AO CARRINHO\" handleClick={() => this.backCart()} />\n </div>\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":";;;;;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,OAAO,EAAE,MAAM,IAAI,CAAC,QAAQ,EAAE,IAC9CC,QAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAClB,CACP,EACA,CAAC,IAAI,CAAC,QAAQ,IAAI,wEAAiB,YAAY,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAA,EAAE,GAAI,CAC/F,CACT,CAEH,EAGF,SAAS,CAAC,QAAQ;aAEd,0DAAG,KAAK,EAAC,oBAAoB,IACxBA,QAAO,CAAC,CAAC,CAAC,gBAAgB,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC,OAAE,wEAAY,IAAI,CAAC,SAAS,EAAE,MAAW,CACrG,CACP,EAID,CAAC,SAAS,CAAC,YAAY,IAAI,CAAC,SAAS,CAAC,QAAQ;aAE1C,0DAAG,KAAK,EAAC,sBAAsB,IAC1BA,QAAO,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC,CACrD,CACP,EAID,CAAC,SAAS,CAAC,YAAY;aAEnB,4DAAK,KAAK,EAAC,aAAa,IACpB,0DAAG,KAAK,EAAC,sBAAsB,IAC1BA,QAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CACtB,EACJ,mEAAY,MAAM,EAAC,oBAAoB,EAAC,WAAW,EAAE,MAAM,IAAI,CAAC,QAAQ,EAAE,GAAI,CAC5E,CACT,CAMH,CACJ,EACT;KACJ;;;;;;","names":["money","i18next"],"sources":["src/assets/svg/money-dollars-svgrepo-com.svg","src/helpers/time.helper.ts","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 -->\n<svg width=\"800px\" height=\"800px\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<circle cx=\"12\" cy=\"12\" r=\"10\" stroke=\"#000000\" stroke-width=\"2\"/>\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\"/>\n<path d=\"M12 7V17\" stroke=\"#000000\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>","export function setTime() {\n\n if(localStorage.getItem(\"bc:time-allow\")) {\n return\n }\n\n const time = localStorage.getItem(\"bc:time\");\n\n if(!time) {\n localStorage.setItem(\"bc:time\", \"360\");\n localStorage.setItem(\"bc:time-allow\", \"true\");\n return\n } \n}",".note-container {\n border: 1px solid #dddddd;\n padding: 0 15px 15px;\n margin: 0 0 26px 0px;\n display: flex;\n flex-direction: column;\n gap: 13px;\n\n\n & .description {\n display: flex;\n flex-direction: column;\n gap: 13px;\n }\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 { getKeyReserveByCartId } from \"../../utils/keys.storage\";\nimport i18next from \"../../i18n/i18n\"\nimport { IBonus } from \"../../components\";\nimport { setTime } from \"../../helpers/time.helper\";\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 @State() bonus: IBonus;\n\n @State() showEdit: boolean = false;\n\n componentWillLoad() {\n this.upadateCheckToFreteAndGetUrl();\n this.startTime();\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 return amount ? Number(amount).toFixed(2).replace(\".\", \",\") || \"0,00\" : \"0,00\";\n }\n\n async backCart() {\n window.location.href = this.url;\n }\n\n\n private startTime() {\n if(document.location.pathname == '/Fechamento') {\n\n if(!localStorage.getItem(\"bc:time-allow\")) {\n localStorage.removeItem(\"bc:time\")\n }\n\n setTime();\n }\n }\n\n\n hasBonus() {\n const _bonus = localStorage.getItem(getKeyReserveByCartId(this.cartId));\n\n const info = {\n hasBonus: false,\n requestBonus: false\n }\n\n if (_bonus) {\n this.bonus = JSON.parse(_bonus);\n info.hasBonus = this.bonus.hasBonus;\n info.requestBonus = true;\n }\n\n return info;\n }\n\n render() {\n\n const giftbackname = this.config.giftbackTitle || \"Giftback\";\n\n const infobonus = this.hasBonus()\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 infobonus.hasBonus && (\n <div>\n {this.showEdit && (\n <p class=\"back-cart\" onClick={() => this.backCart()}>\n {i18next.t(\"edit\")}\n </p>\n )}\n {!this.showEdit && <countdown-timer initialValue={0} downtime={() => { this.showEdit = true }} />}\n </div>\n )\n }\n </div>\n\n {\n infobonus.hasBonus &&\n (\n <p class=\"note-description-2\">\n {i18next.t(\"withApplyBonus\", { giftbackname: giftbackname })} <strong>R$ {this.getAmount()}.</strong>\n </p>\n )\n }\n\n {\n (infobonus.requestBonus && !infobonus.hasBonus) &&\n (\n <p class=\"note-description-not\">\n {i18next.t(\"noBonus\", { giftbackname: giftbackname })}\n </p>\n )\n }\n\n {\n !infobonus.requestBonus &&\n (\n <div class=\"description\">\n <p class=\"note-description-not\">\n {i18next.t(\"backCart\")}\n </p>\n <crm-button txtBtn=\"VOLTAR AO CARRINHO\" handleClick={() => this.backCart()} />\n </div>\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}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "crmbonus-component-wake",
3
- "version": "2.0.111",
3
+ "version": "2.0.113",
4
4
  "description": "Stencil Component Starter",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -1 +0,0 @@
1
- {"file":"p-761e6cd2.js","mappings":";;MAMa,cAAc;;;;;;4BAGQ,GAAG;uBAEP,EAAE;;IAI7B,iBAAiB;QACb,MAAM,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAEhD,IAAI,CAAC,OAAO,GAAI,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC;QAE9D,IAAI,CAAC,UAAU,GAAG,WAAW,CAAC;YAC1B,IAAI,IAAI,CAAC,OAAO,GAAG,CAAC,EAAE;gBAClB,IAAI,CAAC,OAAO,EAAE,CAAC;gBAEf,YAAY,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;aAC5D;iBAAM;gBACH,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;gBAE/B,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAEhB,YAAY,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;aACtC;SACJ,EAAE,IAAI,CAAC,CAAC;KACZ;IAED,oBAAoB;QAChB,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;KAClC;IAED,OAAO;QACH,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAElC,IAAG,OAAO,GAAG,CAAC;YAAE,OAAO,GAAG,OAAO,GAAG,CAAA;QAEpC,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,OAAO,GAAG,CAAA;KACxD;IAED,MAAM;QACF,QACI,gEAAQ,IAAI,CAAC,OAAO,EAAE,CAAS,EACjC;KACL;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/countdown-timer/countdown-timer.tsx"],"sourcesContent":["import { Component, h, Prop, State } from '@stencil/core';\n\n@Component({\n tag: 'countdown-timer',\n shadow: true,\n})\nexport class CountdownTimer {\n\n @Prop() downtime: () => void;\n @Prop() initialValue: number = 120;\n\n @State() seconds: number = 30;\n\n private intervalId: NodeJS.Timer;\n\n componentWillLoad() {\n const initial = localStorage.getItem(\"bc:time\");\n\n this.seconds = initial ? Number(initial) : this.initialValue;\n \n this.intervalId = setInterval(() => {\n if (this.seconds > 0) {\n this.seconds--;\n\n localStorage.setItem(\"bc:time\", this.seconds.toString());\n } else {\n clearInterval(this.intervalId);\n\n this.downtime();\n\n localStorage.removeItem(\"bc:time\");\n }\n }, 1000); // Intervalo de 1 segundo\n }\n\n disconnectedCallback() {\n clearInterval(this.intervalId);\n }\n\n padLeft() {\n const minutes = this.seconds / 60; \n const seconds = this.seconds % 60;\n\n if(minutes < 1) return `${seconds}s`\n \n return `${parseInt(minutes.toString())}m ${seconds}s`\n }\n\n render() {\n return (\n <label>{this.padLeft()}</label>\n );\n }\n}\n"],"version":3}
@@ -1,2 +0,0 @@
1
- import{r as t,h as e}from"./p-3d6152b1.js";const n=class{constructor(e){t(this,e);this.downtime=undefined;this.initialValue=120;this.seconds=30}componentWillLoad(){const t=localStorage.getItem("bc:time");this.seconds=t?Number(t):this.initialValue;this.intervalId=setInterval((()=>{if(this.seconds>0){this.seconds--;localStorage.setItem("bc:time",this.seconds.toString())}else{clearInterval(this.intervalId);this.downtime();localStorage.removeItem("bc:time")}}),1e3)}disconnectedCallback(){clearInterval(this.intervalId)}padLeft(){const t=this.seconds/60;const e=this.seconds%60;if(t<1)return`${e}s`;return`${parseInt(t.toString())}m ${e}s`}render(){return e("label",{key:"51f3be00f4abb6f20fcb9f029d50bbcffc69c111"},this.padLeft())}};const i="input,button{margin:0;padding:10px;}.crm-contaner-button{height:auto;width:auto}.crm-button{height:48px;width:100%;border:1px solid #000;padding:14px 20px;background-color:#000;color:#fff;font-size:14px;line-height:20px;font-weight:500;cursor:pointer}";const s=i;const o=class{constructor(e){t(this,e);this.txtBtn=undefined;this.loading=undefined;this.handleClick=undefined}render(){return e("div",{key:"848df9f754a114343163eae85d34a2acb6b04863",class:"crm-contaner-button"},e("button",{key:"517b761b39ced2615dd04fc42d5aaa98a7d749f6",class:"crm-button",onClick:()=>this.handleClick()},!this.loading?this.txtBtn:e("loading-spinner",{size:"15px",color:"#fff"})))}};o.style=s;export{n as countdown_timer,o as crm_button};
2
- //# sourceMappingURL=p-faff2cf2.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["CountdownTimer","componentWillLoad","initial","localStorage","getItem","this","seconds","Number","initialValue","intervalId","setInterval","setItem","toString","clearInterval","downtime","removeItem","disconnectedCallback","padLeft","minutes","parseInt","render","h","key","crmButtonCss","CrmButtonStyle0","Button","class","onClick","handleClick","loading","txtBtn","size","color"],"sources":["src/components/countdown-timer/countdown-timer.tsx","src/components/button/crm-button.css?tag=crm-button","src/components/button/index.tsx"],"sourcesContent":["import { Component, h, Prop, State } from '@stencil/core';\n\n@Component({\n tag: 'countdown-timer',\n shadow: true,\n})\nexport class CountdownTimer {\n\n @Prop() downtime: () => void;\n @Prop() initialValue: number = 120;\n\n @State() seconds: number = 30;\n\n private intervalId: NodeJS.Timer;\n\n componentWillLoad() {\n const initial = localStorage.getItem(\"bc:time\");\n\n this.seconds = initial ? Number(initial) : this.initialValue;\n \n this.intervalId = setInterval(() => {\n if (this.seconds > 0) {\n this.seconds--;\n\n localStorage.setItem(\"bc:time\", this.seconds.toString());\n } else {\n clearInterval(this.intervalId);\n\n this.downtime();\n\n localStorage.removeItem(\"bc:time\");\n }\n }, 1000); // Intervalo de 1 segundo\n }\n\n disconnectedCallback() {\n clearInterval(this.intervalId);\n }\n\n padLeft() {\n const minutes = this.seconds / 60; \n const seconds = this.seconds % 60;\n\n if(minutes < 1) return `${seconds}s`\n \n return `${parseInt(minutes.toString())}m ${seconds}s`\n }\n\n render() {\n return (\n <label>{this.padLeft()}</label>\n );\n }\n}\n","input, button {\n margin: 0;\n padding: 10px; /* Ajuste o valor conforme necessário */\n}\n\n.crm-contaner-button {\n height: auto;\n width: auto;\n}\n\n.crm-button {\n height: 48px;\n width: 100%;\n border: 1px solid #000;\n padding: 14px 20px;\n background-color: #000;\n color: #fff;\n font-size: 14px;\n line-height: 20px;\n font-weight: 500;\n cursor: pointer;\n}","import { Component, Prop, h } from \"@stencil/core\";\n\n@Component({\n tag: 'crm-button',\n styleUrl: 'crm-button.css'\n})\nexport class Button {\n\n @Prop() txtBtn: string;\n @Prop() loading: boolean;\n\n @Prop() handleClick: () => void;\n\n render() {\n return (\n <div class=\"crm-contaner-button\">\n <button class=\"crm-button\" onClick={() => this.handleClick()}>\n {\n !this.loading ? this.txtBtn : <loading-spinner size=\"15px\" color=\"#fff\" />\n }\n </button>\n </div>\n )\n }\n}"],"mappings":"iDAMaA,EAAc,M,mEAGQ,I,aAEJ,E,CAI3B,iBAAAC,GACI,MAAMC,EAAUC,aAAaC,QAAQ,WAErCC,KAAKC,QAAWJ,EAAUK,OAAOL,GAAWG,KAAKG,aAEjDH,KAAKI,WAAaC,aAAY,KAC1B,GAAIL,KAAKC,QAAU,EAAG,CAClBD,KAAKC,UAELH,aAAaQ,QAAQ,UAAWN,KAAKC,QAAQM,W,KAC1C,CACHC,cAAcR,KAAKI,YAEnBJ,KAAKS,WAELX,aAAaY,WAAW,U,IAE7B,I,CAGP,oBAAAC,GACIH,cAAcR,KAAKI,W,CAGvB,OAAAQ,GACI,MAAMC,EAAUb,KAAKC,QAAU,GAC/B,MAAMA,EAAUD,KAAKC,QAAU,GAE/B,GAAGY,EAAU,EAAG,MAAO,GAAGZ,KAE1B,MAAO,GAAGa,SAASD,EAAQN,gBAAgBN,I,CAG/C,MAAAc,GACI,OACIC,EAAA,SAAAC,IAAA,4CAAQjB,KAAKY,U,GClDzB,MAAMM,EAAe,8PACrB,MAAAC,EAAeD,E,MCKFE,EAAM,M,iGAOf,MAAAL,GACI,OACIC,EAAA,OAAAC,IAAA,2CAAKI,MAAM,uBACPL,EAAA,UAAAC,IAAA,2CAAQI,MAAM,aAAaC,QAAS,IAAMtB,KAAKuB,gBAEtCvB,KAAKwB,QAAUxB,KAAKyB,OAAST,EAAA,mBAAiBU,KAAK,OAAOC,MAAM,U","ignoreList":[]}