crmbonus-component-wake 1.0.31 → 1.0.33

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 (119) hide show
  1. package/dist/cjs/app-modal_4.cjs.entry.js +6 -6
  2. package/dist/cjs/app-modal_4.cjs.entry.js.map +1 -1
  3. package/dist/cjs/crm-bonus-note.cjs.entry.js +26 -0
  4. package/dist/cjs/crm-bonus-note.cjs.entry.js.map +1 -0
  5. package/dist/cjs/crm-bonus.cjs.entry.js +29 -6
  6. package/dist/cjs/crm-bonus.cjs.entry.js.map +1 -1
  7. package/dist/cjs/crmbonus-component-wake.cjs.js +1 -1
  8. package/dist/cjs/{crmbonus.service-8412ddbf.js → crmbonus.service-e6b51638.js} +8 -1
  9. package/dist/cjs/crmbonus.service-e6b51638.js.map +1 -0
  10. package/dist/cjs/giftback-finish_3.cjs.entry.js +3 -3
  11. package/dist/cjs/loader.cjs.js +1 -1
  12. package/dist/cjs/loading-spinner.cjs.entry.js +1 -1
  13. package/dist/cjs/pedido-finalizado.cjs.entry.js +2 -2
  14. package/dist/cjs/phone-input-mask.cjs.entry.js +1 -1
  15. package/dist/collection/collection-manifest.json +1 -0
  16. package/dist/collection/components/crm-bonus/crm-bonus.css +12 -2
  17. package/dist/collection/components/crm-bonus/crm-bonus.js +28 -4
  18. package/dist/collection/components/crm-bonus/crm-bonus.js.map +1 -1
  19. package/dist/collection/components/crm-bonus-form/crm-bonus-form.js +4 -4
  20. package/dist/collection/components/crm-bonus-form/crm-bonus-form.js.map +1 -1
  21. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js +1 -1
  22. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js +1 -1
  23. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js +1 -1
  24. package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js +1 -1
  25. package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js.map +1 -1
  26. package/dist/collection/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.js +1 -1
  27. package/dist/collection/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.js.map +1 -1
  28. package/dist/collection/components/loading-spinner/loading-spinner.js +1 -1
  29. package/dist/collection/components/modal/app-modal.js +1 -1
  30. package/dist/collection/components/note/crm-bonus-note.css +34 -0
  31. package/dist/collection/components/note/crm-bonus-note.js +29 -0
  32. package/dist/collection/components/note/crm-bonus-note.js.map +1 -0
  33. package/dist/collection/components/pedido/pedido.js +1 -1
  34. package/dist/collection/components/phone/phone-input-mask.js +1 -1
  35. package/dist/collection/services/crmbonus.service.js +7 -0
  36. package/dist/collection/services/crmbonus.service.js.map +1 -1
  37. package/dist/components/app-modal.js +1 -1
  38. package/dist/components/crm-bonus-form.js +1 -1
  39. package/dist/components/crm-bonus-note.d.ts +11 -0
  40. package/dist/components/crm-bonus-note.js +42 -0
  41. package/dist/components/crm-bonus-note.js.map +1 -0
  42. package/dist/components/crm-bonus.js +39 -15
  43. package/dist/components/crm-bonus.js.map +1 -1
  44. package/dist/components/giftback-finish.js +1 -1
  45. package/dist/components/giftback-pin.js +1 -1
  46. package/dist/components/giftback-progress.js +1 -1
  47. package/dist/components/loading-spinner.js +1 -1
  48. package/dist/components/{p-374de9ae.js → p-39df4263.js} +8 -1
  49. package/dist/components/p-39df4263.js.map +1 -0
  50. package/dist/components/{p-09bc92e2.js → p-4c2f324f.js} +2 -2
  51. package/dist/components/{p-09bc92e2.js.map → p-4c2f324f.js.map} +1 -1
  52. package/dist/components/{p-bad9f0ec.js → p-6a629b94.js} +3 -3
  53. package/dist/components/{p-bad9f0ec.js.map → p-6a629b94.js.map} +1 -1
  54. package/dist/components/{p-13b9e80b.js → p-af4650fb.js} +3 -3
  55. package/dist/components/{p-13b9e80b.js.map → p-af4650fb.js.map} +1 -1
  56. package/dist/components/{p-db0aa2d4.js → p-b1a8e30d.js} +2 -2
  57. package/dist/components/{p-db0aa2d4.js.map → p-b1a8e30d.js.map} +1 -1
  58. package/dist/components/{p-19a2f475.js → p-c4a9f453.js} +4 -4
  59. package/dist/components/p-c4a9f453.js.map +1 -0
  60. package/dist/components/{p-5753850f.js → p-cbade307.js} +2 -2
  61. package/dist/components/{p-5753850f.js.map → p-cbade307.js.map} +1 -1
  62. package/dist/components/{p-d67754e0.js → p-cf18373a.js} +4 -4
  63. package/dist/components/{p-d67754e0.js.map → p-cf18373a.js.map} +1 -1
  64. package/dist/components/{p-7aff1ad5.js → p-d04e8a4e.js} +2 -2
  65. package/dist/components/{p-7aff1ad5.js.map → p-d04e8a4e.js.map} +1 -1
  66. package/dist/components/{p-2e9efe46.js → p-e0fe93e9.js} +8 -8
  67. package/dist/components/p-e0fe93e9.js.map +1 -0
  68. package/dist/components/pedido-finalizado.js +2 -2
  69. package/dist/components/phone-cancel-input.js +1 -1
  70. package/dist/components/phone-input-mask.js +1 -1
  71. package/dist/components/phone-input.js +1 -1
  72. package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +1 -1
  73. package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js.map +1 -1
  74. package/dist/crmbonus-component-wake/p-0521617e.entry.js +2 -0
  75. package/dist/crmbonus-component-wake/p-0521617e.entry.js.map +1 -0
  76. package/dist/crmbonus-component-wake/{p-9399d79f.entry.js → p-2fdbb9ec.entry.js} +2 -2
  77. package/dist/crmbonus-component-wake/{p-374de9ae.js → p-39df4263.js} +2 -2
  78. package/dist/crmbonus-component-wake/p-39df4263.js.map +1 -0
  79. package/dist/crmbonus-component-wake/p-61fafdba.entry.js +2 -0
  80. package/dist/crmbonus-component-wake/p-61fafdba.entry.js.map +1 -0
  81. package/dist/crmbonus-component-wake/{p-3024dc0b.entry.js → p-8c44a0a5.entry.js} +2 -2
  82. package/dist/crmbonus-component-wake/{p-3f336c1d.entry.js → p-ae916fdb.entry.js} +2 -2
  83. package/dist/crmbonus-component-wake/{p-8a5448aa.entry.js → p-cf8e81f9.entry.js} +2 -2
  84. package/dist/crmbonus-component-wake/p-f6dd48cc.entry.js +2 -0
  85. package/dist/crmbonus-component-wake/p-f6dd48cc.entry.js.map +1 -0
  86. package/dist/esm/app-modal_4.entry.js +6 -6
  87. package/dist/esm/app-modal_4.entry.js.map +1 -1
  88. package/dist/esm/crm-bonus-note.entry.js +22 -0
  89. package/dist/esm/crm-bonus-note.entry.js.map +1 -0
  90. package/dist/esm/crm-bonus.entry.js +29 -6
  91. package/dist/esm/crm-bonus.entry.js.map +1 -1
  92. package/dist/esm/crmbonus-component-wake.js +1 -1
  93. package/dist/esm/{crmbonus.service-053a9e38.js → crmbonus.service-d2bfcb1d.js} +8 -1
  94. package/dist/esm/crmbonus.service-d2bfcb1d.js.map +1 -0
  95. package/dist/esm/giftback-finish_3.entry.js +3 -3
  96. package/dist/esm/loader.js +1 -1
  97. package/dist/esm/loading-spinner.entry.js +1 -1
  98. package/dist/esm/pedido-finalizado.entry.js +2 -2
  99. package/dist/esm/phone-input-mask.entry.js +1 -1
  100. package/dist/types/components/crm-bonus/crm-bonus.d.ts +3 -1
  101. package/dist/types/components/crm-bonus-form/crm-bonus-form.d.ts +1 -1
  102. package/dist/types/components/note/crm-bonus-note.d.ts +5 -0
  103. package/dist/types/components.d.ts +15 -2
  104. package/dist/types/services/crmbonus.service.d.ts +1 -0
  105. package/package.json +1 -1
  106. package/dist/cjs/crmbonus.service-8412ddbf.js.map +0 -1
  107. package/dist/components/p-19a2f475.js.map +0 -1
  108. package/dist/components/p-2e9efe46.js.map +0 -1
  109. package/dist/components/p-374de9ae.js.map +0 -1
  110. package/dist/crmbonus-component-wake/p-36107050.entry.js +0 -2
  111. package/dist/crmbonus-component-wake/p-36107050.entry.js.map +0 -1
  112. package/dist/crmbonus-component-wake/p-374de9ae.js.map +0 -1
  113. package/dist/crmbonus-component-wake/p-6aa00d0b.entry.js +0 -2
  114. package/dist/crmbonus-component-wake/p-6aa00d0b.entry.js.map +0 -1
  115. package/dist/esm/crmbonus.service-053a9e38.js.map +0 -1
  116. /package/dist/crmbonus-component-wake/{p-9399d79f.entry.js.map → p-2fdbb9ec.entry.js.map} +0 -0
  117. /package/dist/crmbonus-component-wake/{p-3024dc0b.entry.js.map → p-8c44a0a5.entry.js.map} +0 -0
  118. /package/dist/crmbonus-component-wake/{p-3f336c1d.entry.js.map → p-ae916fdb.entry.js.map} +0 -0
  119. /package/dist/crmbonus-component-wake/{p-8a5448aa.entry.js.map → p-cf8e81f9.entry.js.map} +0 -0
@@ -14,7 +14,7 @@ const LoadingSpinner = class {
14
14
  this.color = '#0078d7';
15
15
  }
16
16
  render() {
17
- return (index.h("div", { key: 'd6dba36c8a62aba0fb4274d541d007977e662bd6', class: "spinner", style: { width: this.size, height: this.size, borderColor: `${this.color} transparent transparent transparent` } }));
17
+ return (index.h("div", { key: 'bf8c1b0ae13f857499905cba4a56f6bc787e7caf', class: "spinner", style: { width: this.size, height: this.size, borderColor: `${this.color} transparent transparent transparent` } }));
18
18
  }
19
19
  };
20
20
  LoadingSpinner.style = LoadingSpinnerStyle0;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-52d8a075.js');
6
- const crmbonus_service = require('./crmbonus.service-8412ddbf.js');
6
+ const crmbonus_service = require('./crmbonus.service-e6b51638.js');
7
7
 
8
8
  const Pedido = class {
9
9
  constructor(hostRef) {
@@ -27,7 +27,7 @@ const Pedido = class {
27
27
  }
28
28
  }
29
29
  render() {
30
- return (index.h("div", { key: 'd9388bff1243e9118edee15533701401353ede5b' }));
30
+ return (index.h("div", { key: '40fe48d94feaeb62c7c6e5b870b8653f5e714084' }));
31
31
  }
32
32
  };
33
33
 
@@ -35,7 +35,7 @@ const PhoneInputMask = class {
35
35
  return this.phone;
36
36
  }
37
37
  render() {
38
- return (index.h("input", { key: '623357066b9052b9d3a5a853f03058639653d3e0', disabled: this.disabled, id: "phone", type: "tel", class: "phone", value: this.phone, onInput: (event) => this.handleInput(event), placeholder: "(12) 94567-8910" }));
38
+ return (index.h("input", { key: 'aa853aac4a5d7f890de79cc5127f2b9c8494243d', disabled: this.disabled, id: "phone", type: "tel", class: "phone", value: this.phone, onInput: (event) => this.handleInput(event), placeholder: "(12) 94567-8910" }));
39
39
  }
40
40
  };
41
41
  PhoneInputMask.style = PhoneInputMaskStyle0;
@@ -9,6 +9,7 @@
9
9
  "components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.js",
10
10
  "components/loading-spinner/loading-spinner.js",
11
11
  "components/modal/app-modal.js",
12
+ "components/note/crm-bonus-note.js",
12
13
  "components/pedido/pedido.js",
13
14
  "components/phone/phone-input-mask.js"
14
15
  ],
@@ -5,7 +5,7 @@
5
5
  .container-button {
6
6
  /* max-width: 100%; */
7
7
  cursor: pointer;
8
- padding: 10px;
8
+ padding: 5px 5px 5px 14px;
9
9
  /* display: flex; */
10
10
  }
11
11
 
@@ -20,9 +20,13 @@ margin-bottom: 20px; */
20
20
  margin-bottom: 20px;
21
21
  }
22
22
 
23
+ .section-cart-crm {
24
+ margin-top: 10px;
25
+ }
26
+
23
27
  .section-cart-crm p {
24
28
  padding: 0;
25
- margin: 0 0 0 10px;
29
+ margin: 0px 0px 0px 15px;
26
30
  }
27
31
 
28
32
  .button {
@@ -74,4 +78,10 @@ margin-bottom: 20px; */
74
78
  border-color: #00162e;
75
79
  width: 30%;
76
80
  color: #fff;
81
+ }
82
+
83
+ .message-alert {
84
+ font-family: sans-serif;
85
+ color: #df4d4d;
86
+ margin-top: 5px;
77
87
  }
@@ -20,6 +20,7 @@ export class CrmBonus {
20
20
  this.message = undefined;
21
21
  this.phone = undefined;
22
22
  this.canCancel = false;
23
+ this.amountCancel = undefined;
23
24
  this.sent = undefined;
24
25
  }
25
26
  async componentWillLoad() {
@@ -31,6 +32,12 @@ export class CrmBonus {
31
32
  this.customer = await this.crmBonusService.getCustomer(this.userId, this.storeName);
32
33
  console.log('user', this.customer);
33
34
  }
35
+ const amount = localStorage.getItem(this.cartId);
36
+ console.log('amount', amount);
37
+ if (amount) {
38
+ this.canCancel = true;
39
+ this.amountCancel = amount;
40
+ }
34
41
  }
35
42
  catch (error) {
36
43
  console.log('info customer');
@@ -62,12 +69,28 @@ export class CrmBonus {
62
69
  handleCloseModal() {
63
70
  this.showModal = false;
64
71
  }
65
- save() {
66
- localStorage.setItem('@BYCODERS', this.cartId);
72
+ save(amount) {
73
+ localStorage.setItem(this.cartId, amount.toString());
74
+ this.canCancel = true;
75
+ this.amountCancel = amount.toString();
76
+ }
77
+ async cancel() {
78
+ this.message = "";
79
+ this.loading = true;
80
+ try {
81
+ await this.crmBonusService.cancel(this.cartId, this.storeName);
82
+ this.canCancel = false;
83
+ }
84
+ catch (error) {
85
+ this.message = "Não consegui cancelar o bônus, tente novamente!";
86
+ }
87
+ finally {
88
+ this.loading = false;
89
+ }
67
90
  }
68
91
  render() {
69
- return (h("div", { key: '881de45f9b1d135bcf29f0bb64acba9dd6db2625', class: "section-cart-crm" }, h("p", { key: '220974c8e1b717514a83a739e912aa7f08589506', class: "text-left fbits-responsive-carrinho-desconto-texto" }, "Giftback"), h("div", { key: '7a33ec85d3a3acbc5b1f7c35967bd07ec4fc883a', class: "container-button" }, this.canCancel ? h("phone-cancel-input", { value: this.customer.phone, sendPin: () => { }, loading: this.loading })
70
- : h("phone-input", { value: this.customer.phone, sendPin: (phone) => { this.sendPin(phone); }, loading: this.loading })), h("app-modal", { key: '98c78ae810b68e0396dce2928c2116d2e4d20fa8', isOpen: this.showModal, modalTitle: `Giftback`, onModalClosed: () => (this.showModal = false) }, h("crm-bonus-form", { key: '2a22c6a17a4646f7631943fb6017f53372814724', saveStore: () => this.save(), ref: ref => this.crmBonusRef = ref, sent: this.sent, phone: this.phone, cancel: () => this.handleCloseModal(), storeName: this.storeName, products: this.buildProducts(), cartId: this.cartId, customer: this.customer }))));
92
+ return (h("div", { key: '0392d18435b29da7594c5ddec8dca0a5a2c892f6', class: "section-cart-crm" }, h("p", { key: '7f5cb65fe1ebce8397d5d6c8d3d13d09ad55d8db', class: "text-left fbits-responsive-carrinho-desconto-texto" }, "Giftback"), h("div", { key: '82922b373a5c6d0eb72d59826c5b10425fa9fb81', class: "container-button" }, this.canCancel ? h("phone-cancel-input", { value: this.amountCancel, sendPin: () => { this.cancel(); }, loading: this.loading })
93
+ : h("phone-input", { value: this.customer.phone, sendPin: (phone) => { this.sendPin(phone); }, loading: this.loading })), h("p", { key: '113c2653a276730fd3ecd675f50a0f147c656620', class: "message-alert" }, this.message), h("app-modal", { key: 'ffda850ab8dc0534e56f868554eaaa794b168427', isOpen: this.showModal, modalTitle: `Giftback`, onModalClosed: () => (this.showModal = false) }, h("crm-bonus-form", { key: '3b3493173363fd799f26b37e6d94f9455e19f2bf', saveStore: (amount) => this.save(amount), ref: ref => this.crmBonusRef = ref, sent: this.sent, phone: this.phone, cancel: () => this.handleCloseModal(), storeName: this.storeName, products: this.buildProducts(), cartId: this.cartId, customer: this.customer }))));
71
94
  }
72
95
  static get is() { return "crm-bonus"; }
73
96
  static get encapsulation() { return "shadow"; }
@@ -163,6 +186,7 @@ export class CrmBonus {
163
186
  "message": {},
164
187
  "phone": {},
165
188
  "canCancel": {},
189
+ "amountCancel": {},
166
190
  "sent": {}
167
191
  };
168
192
  }
@@ -1 +1 @@
1
- {"version":3,"file":"crm-bonus.js","sourceRoot":"","sources":["../../../../src/components/crm-bonus/crm-bonus.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAQ9C,MAAM,OAAO,QAAQ;;QAEX,oBAAe,GAAoB,IAAI,eAAe,EAAE,CAAC;yBAInC,KAAK;;;;;;wBAOJ;YAC7B,SAAS,EAAE,EAAE;YACb,QAAQ,EAAE,EAAE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ACE,MAAM,EAAE,IAAI,CAAC,SAAS,EACtB,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;gBAE7C,uEAAgB,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,GAAG,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,QAAQ,EAAE,IAAI,CAAC,aAAa,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,GAAI,CAC9P,CACR,CACP,CAAA;IACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, State, h } from '@stencil/core';\nimport { IProduct, IProductWake, ICustomer } from '../../dto/validate.pin.bonus';\nimport { CrmBonusService } from '../../services/crmbonus.service';\nimport { IPinSent } from '../../components';\nimport { StepFormEnum } from '../../contants';\n\n@Component({\n tag: 'crm-bonus',\n styleUrl: 'crm-bonus.css',\n shadow: true,\n assetsDirs: ['assets']\n})\nexport class CrmBonus {\n\n private crmBonusService: CrmBonusService = new CrmBonusService();\n\n private crmBonusRef: HTMLCrmBonusFormElement;\n\n @State() showModal: boolean = false;\n @Prop({ attribute: 'userid' }) userId: number;\n @Prop({ attribute: 'storename' }) storeName;\n @Prop({ attribute: 'products' }) productsInString: string;\n @Prop({ attribute: 'cartid' }) cartId;\n\n @State() products: Array<IProductWake>;\n @State() customer: ICustomer = {\n birthDate: \"\",\n document: \"\",\n name: \"\",\n phone: \"\"\n };\n\n @State() loading: boolean = false;\n @State() message: string;\n @State() phone: number;\n @State() canCancel: boolean = false;\n @State() sent: IPinSent;\n\n async componentWillLoad() {\n await this.handleLoad();\n }\n\n async handleLoad() {\n try {\n if (this.userId) {\n this.customer = await this.crmBonusService.getCustomer(this.userId, this.storeName);\n console.log('user', this.customer);\n }\n } catch (error) {\n console.log('info customer')\n }\n this.products = JSON.parse(this.productsInString);\n }\n\n public async sendPin(phone: string) {\n this.loading = true;\n this.message = \"\";\n\n try {\n const _phone = phone.replace(/\\D/g, '');\n this.phone = Number(_phone);\n this.sent = await this.crmBonusService.sendPin(this.phone, this.storeName);;\n await this.crmBonusRef.setStep(StepFormEnum.STEP_PIN);\n this.showModal = true;\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false\n }\n }\n\n buildProducts(): IProduct[] {\n return this.products.map(product => ({ sku: product.SKU, value: (product.PrecoPor * product.Quantidade), variantId: product.ProdutoVarianteId, qtd: product.Quantidade }))\n }\n\n handleCloseModal() {\n this.showModal = false;\n }\n\n save() {\n localStorage.setItem('@BYCODERS', this.cartId)\n }\n\n render() {\n return (\n <div class=\"section-cart-crm\">\n <p class=\"text-left fbits-responsive-carrinho-desconto-texto\">Giftback</p>\n <div class=\"container-button\">\n {/* <img src={logo} onClick={() => (this.showModal = true)} /> */}\n {\n this.canCancel ? <phone-cancel-input value={this.customer.phone} sendPin={() => { }} loading={this.loading} /> \n : <phone-input value={this.customer.phone} sendPin={(phone) => { this.sendPin(phone) }} loading={this.loading} />\n }\n \n </div>\n <app-modal\n isOpen={this.showModal}\n modalTitle={`Giftback`}\n onModalClosed={() => (this.showModal = false)}\n >\n <crm-bonus-form saveStore={() => this.save()} ref={ref => this.crmBonusRef = ref} sent={this.sent} phone={this.phone} cancel={() => this.handleCloseModal()} storeName={this.storeName} products={this.buildProducts()} cartId={this.cartId} customer={this.customer} />\n </app-modal>\n </div>\n )\n }\n}\n"]}
1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CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,GAAI,CAEjH;YACN,0DAAG,KAAK,EAAC,eAAe,IAAG,IAAI,CAAC,OAAO,CAAK;YAC5C,kEACE,MAAM,EAAE,IAAI,CAAC,SAAS,EACtB,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;gBAE7C,uEAAgB,SAAS,EAAE,CAAC,MAAc,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,GAAG,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,QAAQ,EAAE,IAAI,CAAC,aAAa,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,GAAI,CAClR,CACR,CACP,CAAA;IACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, State, h } from '@stencil/core';\nimport { IProduct, IProductWake, ICustomer } from '../../dto/validate.pin.bonus';\nimport { CrmBonusService } from '../../services/crmbonus.service';\nimport { IPinSent } from '../../components';\nimport { StepFormEnum } from '../../contants';\n\n@Component({\n tag: 'crm-bonus',\n styleUrl: 'crm-bonus.css',\n shadow: true,\n assetsDirs: ['assets']\n})\nexport class CrmBonus {\n\n private crmBonusService: CrmBonusService = new CrmBonusService();\n\n private crmBonusRef: HTMLCrmBonusFormElement;\n\n @State() showModal: boolean = false;\n @Prop({ attribute: 'userid' }) userId: number;\n @Prop({ attribute: 'storename' }) storeName;\n @Prop({ attribute: 'products' }) productsInString: string;\n @Prop({ attribute: 'cartid' }) cartId;\n\n @State() products: Array<IProductWake>;\n @State() customer: ICustomer = {\n birthDate: \"\",\n document: \"\",\n name: \"\",\n phone: \"\"\n };\n\n @State() loading: boolean = false;\n @State() message: string;\n @State() phone: number;\n @State() canCancel: boolean = false;\n @State() amountCancel: string;\n @State() sent: IPinSent;\n\n\n async componentWillLoad() {\n await this.handleLoad();\n }\n\n async handleLoad() {\n try {\n if (this.userId) {\n this.customer = await this.crmBonusService.getCustomer(this.userId, this.storeName);\n console.log('user', this.customer);\n }\n\n const amount = localStorage.getItem(this.cartId);\n console.log('amount', amount)\n\n if (amount) {\n this.canCancel = true;\n this.amountCancel = amount;\n }\n\n } catch (error) {\n console.log('info customer')\n }\n this.products = JSON.parse(this.productsInString);\n }\n\n public async sendPin(phone: string) {\n this.loading = true;\n this.message = \"\";\n\n try {\n const _phone = phone.replace(/\\D/g, '');\n this.phone = Number(_phone);\n this.sent = await this.crmBonusService.sendPin(this.phone, this.storeName);;\n await this.crmBonusRef.setStep(StepFormEnum.STEP_PIN);\n this.showModal = true;\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false\n }\n }\n\n buildProducts(): IProduct[] {\n return this.products.map(product => ({ sku: product.SKU, value: (product.PrecoPor * product.Quantidade), variantId: product.ProdutoVarianteId, qtd: product.Quantidade }))\n }\n\n handleCloseModal() {\n this.showModal = false;\n }\n\n save(amount: number) {\n localStorage.setItem(this.cartId, amount.toString());\n this.canCancel = true;\n this.amountCancel = amount.toString()\n }\n\n async cancel() {\n this.message = \"\";\n this.loading = true;\n try {\n await this.crmBonusService.cancel(this.cartId, this.storeName);\n this.canCancel = false;\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 render() {\n return (\n <div class=\"section-cart-crm\">\n <p class=\"text-left fbits-responsive-carrinho-desconto-texto\">Giftback</p>\n <div class=\"container-button\">\n {/* <img src={logo} onClick={() => (this.showModal = true)} /> */}\n {\n this.canCancel ? <phone-cancel-input value={this.amountCancel} sendPin={() => { this.cancel() }} loading={this.loading} />\n : <phone-input value={this.customer.phone} sendPin={(phone) => { this.sendPin(phone) }} loading={this.loading} />\n }\n </div>\n <p class=\"message-alert\" >{this.message}</p>\n <app-modal\n isOpen={this.showModal}\n modalTitle={`Giftback`}\n onModalClosed={() => (this.showModal = false)}\n >\n <crm-bonus-form saveStore={(amount: number) => this.save(amount)} ref={ref => this.crmBonusRef = ref} sent={this.sent} phone={this.phone} cancel={() => this.handleCloseModal()} storeName={this.storeName} products={this.buildProducts()} cartId={this.cartId} customer={this.customer} />\n </app-modal>\n </div>\n )\n }\n}\n"]}
@@ -57,7 +57,7 @@ export class CrmBonusForm {
57
57
  try {
58
58
  await this.reserve(amount);
59
59
  this.step = StepFormEnum.STEP_APPLY;
60
- this.saveStore();
60
+ this.saveStore(amount);
61
61
  }
62
62
  catch (error) {
63
63
  this.message = "ocorreu um error ao solicitar a aplicação do bonus! tente novamente";
@@ -79,7 +79,7 @@ export class CrmBonusForm {
79
79
  this.cancel();
80
80
  }
81
81
  render() {
82
- return (h(Host, { key: '47aae084607a882caa95c0ea06582a604143db5f' }, this.step === StepFormEnum.STEP_PIN && h("giftback-pin", { key: '1a92fc7bb7bc7f56001da7418e30ea7e7eca41ea', cancel: () => this.handleCancel(), sent: this.sent, validate: (data) => this.validateBonus(data), loading: this.loading }), this.step === StepFormEnum.STEP_RESERVE && h("giftback-progress", { key: 'c358d67060b5f82a52edd5237c6518e24270341c', loading: this.loading, cancel: () => this.handleCancel(), bonus: this.bonus, reserve: (amountRedeemed) => this.reserveApply(amountRedeemed) }), this.step === StepFormEnum.STEP_APPLY && h("giftback-finish", { key: 'fa904cc9de693b9e723e4c86104e63209b159779' }), h("p", { key: 'e1797f9e91013e386c5f8b151e4c692e5d8cd3f3', class: "message-error" }, this.message)));
82
+ return (h(Host, { key: '5498ff56b7041d92bf76a31cd8f0d631b989a968' }, this.step === StepFormEnum.STEP_PIN && h("giftback-pin", { key: '1d7b7a077cf859f64d5215eccbdf3b18a030ccb4', cancel: () => this.handleCancel(), sent: this.sent, validate: (data) => this.validateBonus(data), loading: this.loading }), this.step === StepFormEnum.STEP_RESERVE && h("giftback-progress", { key: 'c98f204305d87a64229d8af2316c4dfc9d07ec08', loading: this.loading, cancel: () => this.handleCancel(), bonus: this.bonus, reserve: (amountRedeemed) => this.reserveApply(amountRedeemed) }), this.step === StepFormEnum.STEP_APPLY && h("giftback-finish", { key: '0f7c19a8c5b8ce92566c3de1e68d771dba87c0c8' }), h("p", { key: '8993849d1175c0edb8e8107dd5edc6c011cfe2e6', class: "message-error" }, this.message)));
83
83
  }
84
84
  static get is() { return "crm-bonus-form"; }
85
85
  static get encapsulation() { return "shadow"; }
@@ -241,8 +241,8 @@ export class CrmBonusForm {
241
241
  "type": "unknown",
242
242
  "mutable": false,
243
243
  "complexType": {
244
- "original": "() => void",
245
- "resolved": "() => void",
244
+ "original": "(amount: number) => void",
245
+ "resolved": "(amount: number) => void",
246
246
  "references": {}
247
247
  },
248
248
  "required": false,
@@ -1 +1 @@
1
- {"version":3,"file":"crm-bonus-form.js","sourceRoot":"","sources":["../../../../src/components/crm-bonus-form/crm-bonus-form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAQ9C,MAAM,OAAO,YAAY;;QAEb,oBAAe,GAAoB,IAAI,eAAe,EAAE,CAAC;;;;wBAKnC;YAC1B,KAAK,EAAE,EAAE;YACT,SAAS,EAAE,EAAE;YACb,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,E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E,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,cAAsB,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,GAAI;YACrN,IAAI,CAAC,IAAI,KAAK,YAAY,CAAC,UAAU,IAAI,yEAAmB;YAC7D,0DAAG,KAAK,EAAC,eAAe,IAAE,IAAI,CAAC,OAAO,CAAK,CACxC,CACV,CAAA;IACL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, Host, Method, Prop, State, h } from \"@stencil/core\";\nimport { CrmBonusService } from \"../../services/crmbonus.service\";\nimport { IBonus, ICustomer, IProccesPinBonusDto, IProduct } from \"../../dto/validate.pin.bonus\";\nimport { StepFormEnum } from \"../../contants\";\nimport { IPinSent } from '../../dto/pin.sent';\n\n@Component({\n tag: 'crm-bonus-form',\n styleUrl: 'crm-bonus-form.css',\n shadow: true\n})\nexport class CrmBonusForm {\n\n private crmBonusService: CrmBonusService = new CrmBonusService();\n\n @Prop({ attribute: 'storename' }) storeName;\n @Prop() cartId;\n @Prop() products: Array<IProduct>;\n @Prop() customer: ICustomer = {\n phone: \"\",\n birthDate: \"\",\n document: \"\",\n name: \"\"\n };\n @Prop() sent: IPinSent;\n @Prop() stepNext: StepFormEnum;\n @Prop() phone: number;\n\n @Prop() saveStore: () => void;\n\n @Prop() cancel: () => void;\n\n @State() loading: boolean = false;\n\n @State() step: number = StepFormEnum.STEP_RESERVE;\n\n @State() message: string;\n\n @State() bonus: IBonus;\n\n @Method()\n async setStep(step: StepFormEnum) {\n this.step = step\n }\n\n public async validateBonus(pin: string) {\n this.loading = true;\n this.message = \"\";\n const payload: IProccesPinBonusDto = {\n pin: pin,\n cellphone: this.phone.toString(),\n loja_id: this.sent.storeId,\n user_id: this.sent.userId,\n cartId: this.cartId,\n products: this.products\n }\n\n try {\n this.bonus = await this.crmBonusService.validatePinBonus(payload, this.storeName);\n\n console.log('[this.bonus]', this.bonus);\n this.step = StepFormEnum.STEP_RESERVE;\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false;\n }\n console.log('payload', payload)\n }\n\n public async reserveApply(amount: number) {\n this.loading = true;\n this.message = \"\";\n try {\n await this.reserve(amount);\n\n this.step = StepFormEnum.STEP_APPLY;\n\n this.saveStore()\n } catch (error) {\n this.message = \"ocorreu um error ao solicitar a aplicação do bonus! tente novamente\"\n } finally {\n this.loading = false;\n }\n }\n\n public async reserve(amount: number) {\n await this.crmBonusService.reserve({\n redeemed_bonus: amount,\n cart_id: this.cartId,\n ticket: this.cartId,\n gross_value: this.bonus.totalValue,\n }, this.storeName);\n }\n\n public handleCancel() {\n this.step = StepFormEnum.STEP_PHONE;\n this.cancel()\n }\n\n render() {\n return (\n <Host>\n {/* {this.step === StepFormEnum.STEP_PHONE && <phone-input value={this.customer.phone} sendPin={(phone) => this.sendPin(phone)} loading={this.loading} />} */}\n {this.step === StepFormEnum.STEP_PIN && <giftback-pin cancel={() => this.handleCancel()} sent={this.sent} validate={(data) => this.validateBonus(data)} loading={this.loading} />}\n\n {this.step === StepFormEnum.STEP_RESERVE && <giftback-progress loading={this.loading} cancel={() => this.handleCancel()} bonus={this.bonus} reserve={(amountRedeemed: number) => this.reserveApply(amountRedeemed)} />}\n {this.step === StepFormEnum.STEP_APPLY && <giftback-finish />}\n <p class=\"message-error\">{this.message}</p>\n </Host>\n )\n }\n}"]}
1
+ {"version":3,"file":"crm-bonus-form.js","sourceRoot":"","sources":["../../../../src/components/crm-bonus-form/crm-bonus-form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA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,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,GAAI;YAEhL,IAAI,CAAC,IAAI,KAAK,YAAY,CAAC,YAAY,IAAI,0EAAmB,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,cAAsB,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,GAAI;YACrN,IAAI,CAAC,IAAI,KAAK,YAAY,CAAC,UAAU,IAAI,yEAAmB;YAC7D,0DAAG,KAAK,EAAC,eAAe,IAAE,IAAI,CAAC,OAAO,CAAK,CACxC,CACV,CAAA;IACL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, Host, Method, Prop, State, h } from \"@stencil/core\";\nimport { CrmBonusService } from \"../../services/crmbonus.service\";\nimport { IBonus, ICustomer, IProccesPinBonusDto, IProduct } from \"../../dto/validate.pin.bonus\";\nimport { StepFormEnum } from \"../../contants\";\nimport { IPinSent } from '../../dto/pin.sent';\n\n@Component({\n tag: 'crm-bonus-form',\n styleUrl: 'crm-bonus-form.css',\n shadow: true\n})\nexport class CrmBonusForm {\n\n private crmBonusService: CrmBonusService = new CrmBonusService();\n\n @Prop({ attribute: 'storename' }) storeName;\n @Prop() cartId;\n @Prop() products: Array<IProduct>;\n @Prop() customer: ICustomer = {\n phone: \"\",\n birthDate: \"\",\n document: \"\",\n name: \"\"\n };\n @Prop() sent: IPinSent;\n @Prop() stepNext: StepFormEnum;\n @Prop() phone: number;\n\n @Prop() saveStore: (amount: number) => void;\n\n @Prop() cancel: () => void;\n\n @State() loading: boolean = false;\n\n @State() step: number = StepFormEnum.STEP_RESERVE;\n\n @State() message: string;\n\n @State() bonus: IBonus;\n\n @Method()\n async setStep(step: StepFormEnum) {\n this.step = step\n }\n\n public async validateBonus(pin: string) {\n this.loading = true;\n this.message = \"\";\n const payload: IProccesPinBonusDto = {\n pin: pin,\n cellphone: this.phone.toString(),\n loja_id: this.sent.storeId,\n user_id: this.sent.userId,\n cartId: this.cartId,\n products: this.products\n }\n\n try {\n this.bonus = await this.crmBonusService.validatePinBonus(payload, this.storeName);\n\n console.log('[this.bonus]', this.bonus);\n this.step = StepFormEnum.STEP_RESERVE;\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false;\n }\n console.log('payload', payload)\n }\n\n public async reserveApply(amount: number) {\n this.loading = true;\n this.message = \"\";\n try {\n await this.reserve(amount);\n\n this.step = StepFormEnum.STEP_APPLY;\n\n this.saveStore(amount);\n } catch (error) {\n this.message = \"ocorreu um error ao solicitar a aplicação do bonus! tente novamente\"\n } finally {\n this.loading = false;\n }\n }\n\n public async reserve(amount: number) {\n await this.crmBonusService.reserve({\n redeemed_bonus: amount,\n cart_id: this.cartId,\n ticket: this.cartId,\n gross_value: this.bonus.totalValue,\n }, this.storeName);\n }\n\n public handleCancel() {\n this.step = StepFormEnum.STEP_PHONE;\n this.cancel()\n }\n\n render() {\n return (\n <Host>\n {/* {this.step === StepFormEnum.STEP_PHONE && <phone-input value={this.customer.phone} sendPin={(phone) => this.sendPin(phone)} loading={this.loading} />} */}\n {this.step === StepFormEnum.STEP_PIN && <giftback-pin cancel={() => this.handleCancel()} sent={this.sent} validate={(data) => this.validateBonus(data)} loading={this.loading} />}\n\n {this.step === StepFormEnum.STEP_RESERVE && <giftback-progress loading={this.loading} cancel={() => this.handleCancel()} bonus={this.bonus} reserve={(amountRedeemed: number) => this.reserveApply(amountRedeemed)} />}\n {this.step === StepFormEnum.STEP_APPLY && <giftback-finish />}\n <p class=\"message-error\">{this.message}</p>\n </Host>\n )\n }\n}"]}
@@ -2,7 +2,7 @@ import { h } from "@stencil/core";
2
2
  import success from "../../../crm-bonus/assets/svg/success-svgrepo-com.svg";
3
3
  export class GiftbackFinish {
4
4
  render() {
5
- return (h("div", { key: 'b2db01665e3e19659c35a8c912742352bca4a1ae', class: "message-finish" }, h("img", { key: '0cb6d72a9bb696cf16ee38255cb2d5d6170e5ff1', src: success, width: 80 }), h("p", { key: '489dd5b09d20ff2140be375c1e234d5bf9671622' }, "Legal! O B\u00F4nus ser\u00E1 aplicado na sua compra.")));
5
+ return (h("div", { key: 'e72f82799146a6e94acbdd62324e07cdf9f77009', class: "message-finish" }, h("img", { key: '46e2436a3dbe4745225c3b9674e6bf6c299ad63e', src: success, width: 80 }), h("p", { key: '270e42050956f7f3d1ae9b90f314211fa310f797' }, "Legal! O B\u00F4nus ser\u00E1 aplicado na sua compra.")));
6
6
  }
7
7
  static get is() { return "giftback-finish"; }
8
8
  static get encapsulation() { return "shadow"; }
@@ -30,7 +30,7 @@ export class GiftbackPin {
30
30
  }
31
31
  }
32
32
  render() {
33
- return (h("div", { key: '73bbb31f65a9ad70d9749139036f367c5f983be7', class: "form-container-pin" }, h("div", { key: '30a4e1cb8cbec97af32e4535237ddd45b073d47c' }, h("p", { key: '4c5946125ee6cfd8ed00a845df15a65074c482e4' }, "Insira o PIN de 4 d\u00EDgitos enviado por SMS."), h("div", { key: '4d6b00888b126dc0cd786bd0c5bc20ed0a5ad354', class: "pin-container" }, this.pin.map((_, index) => (h("input", { type: "text", maxLength: 1, value: this.pin[index], onInput: (event) => this.handleInput(event, index) }))))), h("div", { key: '759369b39be6716fad568f51107db83d2f39f8c3', class: "footer-button" }, h("button", { key: '4b3e1f2cd4649e4d70ac42eb6eb41c001a159ca8', class: "button-cancel", disabled: this.loading, onClick: () => this.cancel() }, "Cancelar"), h("button", { key: '4872ba1598b806babaff1041ab08a86b3d1e92ef', class: `button ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.validatePin() }, !this.loading ? "Enviar" : h("loading-spinner", { size: "15px", color: "#fff" })))));
33
+ return (h("div", { key: '7fe6a9f55ca436ecfcc20f106c1efeddd8387490', class: "form-container-pin" }, h("div", { key: 'aece84fab5ecf94ce5ca90fd1912623dd3c1b9b8' }, h("p", { key: '5134dd8eb3478f59dcfcdca6612e885b76578cba' }, "Insira o PIN de 4 d\u00EDgitos enviado por SMS."), h("div", { key: '8855be06a09925746a5b18323726dd67ec73d7c3', class: "pin-container" }, this.pin.map((_, index) => (h("input", { type: "text", maxLength: 1, value: this.pin[index], onInput: (event) => this.handleInput(event, index) }))))), h("div", { key: '1c5523feb6c9dafbfddd5388170de5fea7627f62', class: "footer-button" }, h("button", { key: '8506cd68998d4ecb76f8a8a262373605a06827de', class: "button-cancel", disabled: this.loading, onClick: () => this.cancel() }, "Cancelar"), h("button", { key: '4dda0af894ad5849ba27d3a4f6c15c80d6c984ae', class: `button ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.validatePin() }, !this.loading ? "Enviar" : h("loading-spinner", { size: "15px", color: "#fff" })))));
34
34
  }
35
35
  static get is() { return "giftback-pin"; }
36
36
  static get encapsulation() { return "shadow"; }
@@ -26,7 +26,7 @@ export class GiftbackProgress {
26
26
  }
27
27
  render() {
28
28
  const remainingGiftback = this.bonus.minimumPurchase - this.bonus.totalValue;
29
- return (h("div", { key: 'a5e02f60ab5e081341582ea0b1cfaa05583a22c2', class: "giftback-container" }, h("p", { key: '12eddb011e6a6beda91a1bc937fcacdb891b12a5' }, "Voc\u00EA possui at\u00E9 ", h("strong", { key: 'eb6018fe44106dd2a9928d4efe77dbd17180e3d3' }, "R$ ", this.bonus.totalBonus.toFixed(2)), " de Giftback nessa compra!"), h("p", { key: '065028af79e33d565c82bd55ea2245e3562617e8', class: "validity" }, "V\u00E1lido at\u00E9: ", new Date(this.bonus.firstValidityDate).toLocaleDateString('pt-Br')), h("p", { key: '1ed8896f6301c2c70fb7232190a2c68bc82e5f07' }, "Voc\u00EA est\u00E1 utilizando ", h("strong", { key: 'e2019caa7c7697f73021416632ca884097e21abe' }, "R$ ", this.usedValue.toFixed(2)), " nessa compra"), h("div", { key: 'b0257ef4d99c4009f23a4d9fae52b42d2ef41209', class: "progress-container" }, h("span", { key: 'bb0d1abe791dfcab30e87fea8eb025a9f3787be0' }, "R$ 0"), h("input", { key: 'a4220c65f24d68b56ccf522a46c0bd3d007c9ed6', disabled: true, type: "range", min: "0", step: "0.01", max: this.bonus.totalBonus, value: this.usedValue, onInput: (event) => this.handleSliderChange(event) }), h("span", { key: 'c216b57ffdd2a3613f05db327aad395f1f2e1285' }, "R$ ", this.bonus.totalBonus.toFixed(2))), h("p", { key: '7a5dc6a68801da2c09a33f3cdb6cf82e521be581', class: "remaining" }, "Faltam ", h("strong", { key: '9c20b260d4a95887844aa038e0f74180fff5c1eb' }, "R$ ", remainingGiftback > 0 ? remainingGiftback.toFixed(2) : Number(0).toFixed(2)), " para utilizar o valor total do Giftback."), h("div", { key: 'd99639afcac1ea180ad414ca923391f99f3d5296', class: "footer-button-giftback" }, h("button", { key: '4c1bdd2ea2ecd5037d1c29b6af31c3163fffe84a', class: "button-cancel", disabled: this.loading, onClick: () => this.cancel() }, "Cancelar"), h("button", { key: '77fc073d28272334d51ab7073e34654509c0ac26', class: `button ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.handleReserve(this.usedValue) }, !this.loading ? "Aplicar" : h("loading-spinner", { size: "10px", color: "#fff" })))));
29
+ return (h("div", { key: 'c2fb3f6a887887e197b55e951dbf50054e27e77a', class: "giftback-container" }, h("p", { key: '1d08aaaa1d260f3938e472e95b1e194be50c3987' }, "Voc\u00EA possui at\u00E9 ", h("strong", { key: '99d39bc977a41c9d098c812b61ae41c25342f65c' }, "R$ ", this.bonus.totalBonus.toFixed(2)), " de Giftback nessa compra!"), h("p", { key: '68fc8504eabfdf6e9e873780bb6863521a683e58', class: "validity" }, "V\u00E1lido at\u00E9: ", new Date(this.bonus.firstValidityDate).toLocaleDateString('pt-Br')), h("p", { key: 'fe4c8804f8d577e530330050cfae9c33c2be36d7' }, "Voc\u00EA est\u00E1 utilizando ", h("strong", { key: 'd1d2a6ad0ca1da77e5a4ab9a595af74a11fb9862' }, "R$ ", this.usedValue.toFixed(2)), " nessa compra"), h("div", { key: 'b0eac608016c3136a344c03d456355d7ffcc8dfc', class: "progress-container" }, h("span", { key: 'a88626a3f0d0109fca8b593da05e76f54eb69e28' }, "R$ 0"), h("input", { key: '5d19e34becada60c728f9fce1fa67eede16b7844', disabled: true, type: "range", min: "0", step: "0.01", max: this.bonus.totalBonus, value: this.usedValue, onInput: (event) => this.handleSliderChange(event) }), h("span", { key: '31f0b18eff1ffbd2fb86941653beacad567514ca' }, "R$ ", this.bonus.totalBonus.toFixed(2))), h("p", { key: '5f278047d5bb21282890de0304bc2e8addf8ea43', class: "remaining" }, "Faltam ", h("strong", { key: 'fa220ca91d366eb5e5eec4bf7e94ace4584b0dbe' }, "R$ ", remainingGiftback > 0 ? remainingGiftback.toFixed(2) : Number(0).toFixed(2)), " para utilizar o valor total do Giftback."), h("div", { key: '248c3376e92b8daab0c821e79e083ef6f44bff9e', class: "footer-button-giftback" }, h("button", { key: 'fe612e24a59abed7ef27e6a0425d40efaad218c2', class: "button-cancel", disabled: this.loading, onClick: () => this.cancel() }, "Cancelar"), h("button", { key: '6f86a5b1eeedf01c9eabe9313fdf7b00dc264e96', class: `button ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.handleReserve(this.usedValue) }, !this.loading ? "Aplicar" : h("loading-spinner", { size: "10px", color: "#fff" })))));
30
30
  }
31
31
  static get is() { return "giftback-progress"; }
32
32
  static get encapsulation() { return "shadow"; }
@@ -10,7 +10,7 @@ export class PhoneInput {
10
10
  await this.sendPin(phone);
11
11
  }
12
12
  render() {
13
- return (h("div", { key: 'e2731761e6c8c1f596a1030d64a9fa26d00ac4b8', class: "form-container" }, h("phone-input-mask", { key: 'b8a30be9c709dd493aab34faf8acfe25ceea050b', initialValue: this.value, ref: ref => this.phoneInputMask = ref }), h("button", { key: '9f73fb884b4f8c31f31da644a20d560622cfd984', class: `btn btn-success btnCrm ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.validatePhone() }, !this.loading ? "validar" : h("loading-spinner", { size: "20px", color: "#fff" }))));
13
+ return (h("div", { key: '8deb65295383b9a14e1ac5c3050ce2cab709c208', class: "form-container" }, h("phone-input-mask", { key: 'd5c9b2fb84b166c67fdfa653f4d0194818d7ae54', initialValue: this.value, ref: ref => this.phoneInputMask = ref }), h("button", { key: 'cf65564923d078b226f168eb1fc476be5c3719c8', class: `btn btn-success btnCrm ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.validatePhone() }, !this.loading ? "validar" : h("loading-spinner", { size: "11px", color: "#fff" }))));
14
14
  }
15
15
  static get is() { return "phone-input"; }
16
16
  static get properties() {
@@ -1 +1 @@
1
- {"version":3,"file":"phone.input.js","sourceRoot":"","sources":["../../../../../../src/components/crm-bonus-form/subcomponents/phone/phone.input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAKnD,MAAM,OAAO,UAAU;;;;;;IAQnB,KAAK,CAAC,aAAa;QACf,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC;QACnD,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED,MAAM;QACF,OAAO,CACH,4DAAK,KAAK,EAAC,gBAAgB;YACvB,yEAAkB,YAAY,EAAE,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,cAAc,GAAG,GAAG,GAAI;YACrF,+DAAQ,KAAK,EAAE,0BAA0B,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE,IAE/H,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,uBAAiB,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,GAAG,CAEvE,CACP,CACT,CAAA;IACL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, Prop, h } from \"@stencil/core\";\n\n@Component({\n tag: 'phone-input'\n})\nexport class PhoneInput {\n\n private phoneInputMask: HTMLPhoneInputMaskElement;\n\n @Prop() sendPin: Function;\n @Prop() loading: boolean;\n @Prop() value: string;\n\n async validatePhone() {\n const phone = await this.phoneInputMask.getPhone();\n await this.sendPin(phone);\n }\n\n render() {\n return (\n <div class=\"form-container\">\n <phone-input-mask initialValue={this.value} ref={ref => this.phoneInputMask = ref} />\n <button class={`btn btn-success btnCrm ${this.loading ? 'disabled' : ''} `} disabled={this.loading} onClick={() => this.validatePhone()}>\n {\n !this.loading ? \"validar\" : <loading-spinner size=\"20px\" color=\"#fff\" />\n }\n </button>\n </div>\n )\n }\n}"]}
1
+ {"version":3,"file":"phone.input.js","sourceRoot":"","sources":["../../../../../../src/components/crm-bonus-form/subcomponents/phone/phone.input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAKnD,MAAM,OAAO,UAAU;;;;;;IAQnB,KAAK,CAAC,aAAa;QACf,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC;QACnD,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED,MAAM;QACF,OAAO,CACH,4DAAK,KAAK,EAAC,gBAAgB;YACvB,yEAAkB,YAAY,EAAE,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,cAAc,GAAG,GAAG,GAAI;YACrF,+DAAQ,KAAK,EAAE,0BAA0B,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE,IAE/H,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,uBAAiB,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,GAAG,CAEvE,CACP,CACT,CAAA;IACL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, Prop, h } from \"@stencil/core\";\n\n@Component({\n tag: 'phone-input'\n})\nexport class PhoneInput {\n\n private phoneInputMask: HTMLPhoneInputMaskElement;\n\n @Prop() sendPin: Function;\n @Prop() loading: boolean;\n @Prop() value: string;\n\n async validatePhone() {\n const phone = await this.phoneInputMask.getPhone();\n await this.sendPin(phone);\n }\n\n render() {\n return (\n <div class=\"form-container\">\n <phone-input-mask initialValue={this.value} ref={ref => this.phoneInputMask = ref} />\n <button class={`btn btn-success btnCrm ${this.loading ? 'disabled' : ''} `} disabled={this.loading} onClick={() => this.validatePhone()}>\n {\n !this.loading ? \"validar\" : <loading-spinner size=\"11px\" color=\"#fff\" />\n }\n </button>\n </div>\n )\n }\n}"]}
@@ -10,7 +10,7 @@ export class PhoneCancelInput {
10
10
  await this.sendPin(phone);
11
11
  }
12
12
  render() {
13
- return (h("div", { key: 'e4190bd5e37d38631bf7a3a60dcb851d36d26ad8', class: "form-container" }, h("phone-input-mask", { key: '5c189523ffe6e67304363411c2afeac03c212a1c', initialValue: "Valor aplicado R$ 100", ref: ref => this.phoneInputMask = ref, disabled: true }), h("button", { key: 'b563f7345e86637372e81eb8968affa35d9ce179', class: `btn btn-success btnCrm ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.validatePhone() }, !this.loading ? "Cancelar" : h("loading-spinner", { size: "20px", color: "#fff" }))));
13
+ return (h("div", { key: 'ca3f5e2e996e26c520bb1bbaa14eb176e89c74a1', class: "form-container" }, h("phone-input-mask", { key: 'fc2a5d692b1bf5ada9180bb721c167c799a51aa2', initialValue: `Valor aplicado R$ ${this.value}`, ref: ref => this.phoneInputMask = ref, disabled: true }), h("button", { key: '96c5c22f187420cc47a393c787f4a9f3a8a9eab9', class: `btn btn-success btnCrm ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.validatePhone() }, !this.loading ? "Cancelar" : h("loading-spinner", { size: "11px", color: "#fff" }))));
14
14
  }
15
15
  static get is() { return "phone-cancel-input"; }
16
16
  static get properties() {
@@ -1 +1 @@
1
- {"version":3,"file":"phone.cancel.input.js","sourceRoot":"","sources":["../../../../../../src/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAKnD,MAAM,OAAO,gBAAgB;;;;;;IAQzB,KAAK,CAAC,aAAa;QACf,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC;QACnD,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED,MAAM;QACF,OAAO,CACH,4DAAK,KAAK,EAAC,gBAAgB;YACvB,yEAAkB,YAAY,EAAE,uBAAuB,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,cAAc,GAAG,GAAG,EAAE,QAAQ,EAAE,IAAI,GAAI;YAClH,+DAAQ,KAAK,EAAE,0BAA0B,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE,IAE/H,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,uBAAiB,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,GAAG,CAExE,CACP,CACT,CAAA;IACL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, Prop, h } from \"@stencil/core\";\n\n@Component({\n tag: 'phone-cancel-input'\n})\nexport class PhoneCancelInput {\n\n private phoneInputMask: HTMLPhoneInputMaskElement;\n\n @Prop() sendPin: Function;\n @Prop() loading: boolean;\n @Prop() value: string;\n\n async validatePhone() {\n const phone = await this.phoneInputMask.getPhone();\n await this.sendPin(phone);\n }\n\n render() {\n return (\n <div class=\"form-container\">\n <phone-input-mask initialValue={\"Valor aplicado R$ 100\"} ref={ref => this.phoneInputMask = ref} disabled={true} />\n <button class={`btn btn-success btnCrm ${this.loading ? 'disabled' : ''} `} disabled={this.loading} onClick={() => this.validatePhone()}>\n {\n !this.loading ? \"Cancelar\" : <loading-spinner size=\"20px\" color=\"#fff\" />\n }\n </button>\n </div>\n )\n }\n}"]}
1
+ {"version":3,"file":"phone.cancel.input.js","sourceRoot":"","sources":["../../../../../../src/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAKnD,MAAM,OAAO,gBAAgB;;;;;;IAQzB,KAAK,CAAC,aAAa;QACf,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC;QACnD,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED,MAAM;QACF,OAAO,CACH,4DAAK,KAAK,EAAC,gBAAgB;YACvB,yEAAkB,YAAY,EAAE,qBAAqB,IAAI,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,cAAc,GAAG,GAAG,EAAE,QAAQ,EAAE,IAAI,GAAI;YAC5H,+DAAQ,KAAK,EAAE,0BAA0B,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE,IAE/H,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,uBAAiB,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,GAAG,CAExE,CACP,CACT,CAAA;IACL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, Prop, h } from \"@stencil/core\";\n\n@Component({\n tag: 'phone-cancel-input'\n})\nexport class PhoneCancelInput {\n\n private phoneInputMask: HTMLPhoneInputMaskElement;\n\n @Prop() sendPin: Function;\n @Prop() loading: boolean;\n @Prop() value: string;\n\n async validatePhone() {\n const phone = await this.phoneInputMask.getPhone();\n await this.sendPin(phone);\n }\n\n render() {\n return (\n <div class=\"form-container\">\n <phone-input-mask initialValue={`Valor aplicado R$ ${this.value}`} ref={ref => this.phoneInputMask = ref} disabled={true} />\n <button class={`btn btn-success btnCrm ${this.loading ? 'disabled' : ''} `} disabled={this.loading} onClick={() => this.validatePhone()}>\n {\n !this.loading ? \"Cancelar\" : <loading-spinner size=\"11px\" color=\"#fff\" />\n }\n </button>\n </div>\n )\n }\n}"]}
@@ -5,7 +5,7 @@ export class LoadingSpinner {
5
5
  this.color = '#0078d7';
6
6
  }
7
7
  render() {
8
- return (h("div", { key: 'd6dba36c8a62aba0fb4274d541d007977e662bd6', class: "spinner", style: { width: this.size, height: this.size, borderColor: `${this.color} transparent transparent transparent` } }));
8
+ return (h("div", { key: 'bf8c1b0ae13f857499905cba4a56f6bc787e7caf', class: "spinner", style: { width: this.size, height: this.size, borderColor: `${this.color} transparent transparent transparent` } }));
9
9
  }
10
10
  static get is() { return "loading-spinner"; }
11
11
  static get encapsulation() { return "shadow"; }
@@ -8,7 +8,7 @@ export class AppModal {
8
8
  this.modalClosed.emit();
9
9
  }
10
10
  render() {
11
- return (h("div", { key: 'bfca82abe376ae6a2128f9930477efefd580e127', class: `modal-backdrop ${this.isOpen ? 'visible' : ''}` }, h("div", { key: '18d4b5dc82c30ac4d68fc803a538df4925035a48', class: "modal" }, h("div", { key: '65fd1a61314f39d68225ae05db4b463f1c2f1c23', class: "modal-header" }, h("h3", { key: '936cb2d5c1d0b6b06f64ceff1875b24e7cdb9a9c' }, this.modalTitle), h("button", { key: '06945aa82f350dd02a712da527dffd2a148fcc32', class: "close-button", onClick: () => this.closeModal() }, "\u00D7")), h("div", { key: '9ee81e14f8dfe84eb0e0ceaee403d6389ebbbc35', class: "modal-body" }, h("slot", { key: '0b1d305653505e35ae39ea7ffc6bdfc74dc97e59' })))));
11
+ return (h("div", { key: 'e3c7da4a633b1a76df31358e39512952eca70c26', class: `modal-backdrop ${this.isOpen ? 'visible' : ''}` }, h("div", { key: '56f58320520a06e6ec4f5d585b47f930e01adbee', class: "modal" }, h("div", { key: '58d9092422c8c4e158154ae6b6b4fbafe5be5642', class: "modal-header" }, h("h3", { key: '98f9827b88a2c2341525afd58454c8b1ee13062c' }, this.modalTitle), h("button", { key: 'd14b1edd1fdb612d1037e4f0831a801f6a042f86', class: "close-button", onClick: () => this.closeModal() }, "\u00D7")), h("div", { key: 'ddcee9b749070bb130a27750009afca8558eca2e', class: "modal-body" }, h("slot", { key: 'aeda676e81150e4ab0bca1c6ffedc19c441553ac' })))));
12
12
  }
13
13
  static get is() { return "app-modal"; }
14
14
  static get encapsulation() { return "shadow"; }
@@ -0,0 +1,34 @@
1
+ .note-container {
2
+ border: 1px solid #dddddd;
3
+ padding-left: 15px;
4
+ padding-right: 15px;
5
+ }
6
+
7
+ .note-container .back-cart {
8
+ display: flex;
9
+ text-align: center;
10
+ }
11
+
12
+ .note-title {
13
+ font-weight: 700;
14
+ height: 2em;
15
+ line-height: 2em;
16
+ text-align: left;
17
+ border-radius: 3px;
18
+ color: #333;
19
+ margin-bottom: 1.4em;
20
+ }
21
+
22
+ .note-description {
23
+ font-family: Arial;
24
+ color: #6d6d5f;
25
+ padding: 0;
26
+ margin: 0 auto;
27
+ }
28
+
29
+ .back-cart {
30
+ font-size: .9em;
31
+ color: #337ab7;
32
+ text-decoration: none;
33
+ cursor: pointer;
34
+ }
@@ -0,0 +1,29 @@
1
+ import { h } from "@stencil/core";
2
+ export class CrmBonusNote {
3
+ constructor() {
4
+ this.url = undefined;
5
+ }
6
+ componentWillLoad() {
7
+ this.url = window.location.origin;
8
+ }
9
+ render() {
10
+ return (h("div", { key: '24f15c5c816f9e9b2b7d29b5ccb5379857b21d7e', class: "note-container" }, h("p", { key: '2fe785edd0bb7d880782191ac5763c47789194a0', class: "note-title" }, "Gift back"), h("p", { key: '726b0303b6ac7284f88b981716ee0748f9e03c11', class: "note-description" }, "Volte ao carrinho e confira se voc\u00EA tem Giftback para aplicar na sua compra!"), h("a", { key: 'f42fc1a08784ffdf5c55dc4833c4047b35f93ff5', class: "back-cart", href: this.url }, "Voltar ao carrinho")));
11
+ }
12
+ static get is() { return "crm-bonus-note"; }
13
+ static get originalStyleUrls() {
14
+ return {
15
+ "$": ["crm-bonus-note.css"]
16
+ };
17
+ }
18
+ static get styleUrls() {
19
+ return {
20
+ "$": ["crm-bonus-note.css"]
21
+ };
22
+ }
23
+ static get states() {
24
+ return {
25
+ "url": {}
26
+ };
27
+ }
28
+ }
29
+ //# sourceMappingURL=crm-bonus-note.js.map
@@ -0,0 +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,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAMpD,MAAM,OAAO,YAAY;;;;IAKrB,iBAAiB;QACb,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;IACtC,CAAC;IAED,MAAM;QACF,OAAO,CACH,4DAAK,KAAK,EAAC,gBAAgB;YACvB,0DAAG,KAAK,EAAC,YAAY,gBAEjB;YAEJ,0DAAG,KAAK,EAAC,kBAAkB,wFAEvB;YAEJ,0DAAG,KAAK,EAAC,WAAW,EAAC,IAAI,EAAE,IAAI,CAAC,GAAG,yBAE/B,CACF,CACT,CAAA;IACL,CAAC;;;;;;;;;;;CACJ","sourcesContent":["import { Component, State, h } from \"@stencil/core\";\n\n@Component({\n tag: 'crm-bonus-note',\n styleUrl: 'crm-bonus-note.css'\n})\nexport class CrmBonusNote {\n\n @State() url: string\n\n\n componentWillLoad() {\n this.url = window.location.origin;\n }\n\n render() {\n return (\n <div class=\"note-container\">\n <p class=\"note-title\">\n Gift back\n </p>\n\n <p class=\"note-description\">\n Volte ao carrinho e confira se você tem Giftback para aplicar na sua compra!\n </p>\n\n <a class=\"back-cart\" href={this.url}>\n Voltar ao carrinho\n </a>\n </div>\n )\n }\n}"]}
@@ -21,7 +21,7 @@ export class Pedido {
21
21
  }
22
22
  }
23
23
  render() {
24
- return (h("div", { key: 'd9388bff1243e9118edee15533701401353ede5b' }));
24
+ return (h("div", { key: '40fe48d94feaeb62c7c6e5b870b8653f5e714084' }));
25
25
  }
26
26
  static get is() { return "pedido-finalizado"; }
27
27
  static get properties() {
@@ -26,7 +26,7 @@ export class PhoneInputMask {
26
26
  return this.phone;
27
27
  }
28
28
  render() {
29
- return (h("input", { key: '623357066b9052b9d3a5a853f03058639653d3e0', disabled: this.disabled, id: "phone", type: "tel", class: "phone", value: this.phone, onInput: (event) => this.handleInput(event), placeholder: "(12) 94567-8910" }));
29
+ return (h("input", { key: 'aa853aac4a5d7f890de79cc5127f2b9c8494243d', disabled: this.disabled, id: "phone", type: "tel", class: "phone", value: this.phone, onInput: (event) => this.handleInput(event), placeholder: "(12) 94567-8910" }));
30
30
  }
31
31
  static get is() { return "phone-input-mask"; }
32
32
  static get encapsulation() { return "shadow"; }
@@ -38,5 +38,12 @@ export class CrmBonusService {
38
38
  const response = await this.axiosInstance.post("/api/crm-bonus/redeem-bonus", payload, { headers: { store } });
39
39
  return response.data;
40
40
  }
41
+ async cancel(cartId, store) {
42
+ const response = await this.axiosInstance.post("/api/crm-bonus/cancel-bonus", {
43
+ num_pedido: cartId,
44
+ used_bonus: true
45
+ }, { headers: { store } });
46
+ return response.data;
47
+ }
41
48
  }
42
49
  //# sourceMappingURL=crmbonus.service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"crmbonus.service.js","sourceRoot":"","sources":["../../../src/services/crmbonus.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAK7C,MAAM,OAAO,eAAe;IAGxB;QACI,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC;YAC9B,OAAO,EAAE,iBAAiB;YAC1B,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,QAAQ,EAAE,kBAAkB;aAC7B;SACF,CAAC,CAAC;IACT,CAAC;IAED,KAAK,CAAC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I,MAAM,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,kCAAkC,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CAAA;QAEpH,OAAO,QAAQ,CAAC,IAAI,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,OAAoB,EAAE,KAAa;QAC7C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,6BAA6B,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;QAC/G,OAAO,QAAQ,CAAC,IAAI,CAAC;IACzB,CAAC;CACJ","sourcesContent":["import axios, { AxiosInstance } from 'axios';\nimport { CRM_BONUS_API_URL } from '../../env'\nimport { IPinSent } from '../dto/pin.sent';\nimport { IBonus, IProccesPinBonusDto, IReserveDTO } from '../dto/validate.pin.bonus';\nimport { UpdateOrderDTO } from '../dto/update.order.dto';\n\nexport class CrmBonusService {\n private axiosInstance: AxiosInstance;\n\n constructor() {\n this.axiosInstance = axios.create({\n baseURL: CRM_BONUS_API_URL,\n headers: {\n 'Content-Type': 'application/json',\n 'accept': 'application/json',\n },\n });\n }\n\n async getCustomer(userId: number, store: string) {\n const response = await this.axiosInstance.get(`/api/wake/store/${store}/customer/${userId}`, { headers: { 'Content-Type': 'application/json' } })\n console.log('response.data', response.data)\n return response.data\n }\n\n async updateOrder(updateOrderDTO: UpdateOrderDTO){\n const response = await this.axiosInstance.put(`/api/carts/update_cart/${updateOrderDTO.cartId}`, \n { \n orderId: updateOrderDTO.orderId,\n cartIdCrm: updateOrderDTO.cartIdCrm\n }, { headers: { 'Content-Type': 'application/json' } })\n\n console.log('response', response.data)\n \n }\n\n async sendPin(phone: number, store: string): Promise<IPinSent> {\n const response = await this.axiosInstance.post(\"/api/crm-bonus/send-pin\", { celular: phone, nome: \"giftback\" }, { headers: { store } });\n return {\n storeId: response.data.store_id,\n userId: response.data.user_id\n }\n }\n\n async validatePinBonus(payload: IProccesPinBonusDto, store: string): Promise<IBonus> {\n console.log('[validatePinBonus]', payload);\n\n const response = await this.axiosInstance.post(\"/api/crm-bonus/process-pin-bonus\", payload, { headers: { store } })\n\n return response.data;\n }\n\n async reserve(payload: IReserveDTO, store: string) {\n const response = await this.axiosInstance.post(\"/api/crm-bonus/redeem-bonus\", payload, { headers: { store } });\n return response.data;\n }\n}"]}
1
+ {"version":3,"file":"crmbonus.service.js","sourceRoot":"","sources":["../../../src/services/crmbonus.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAK7C,MAAM,OAAO,eAAe;IAGxB;QACI,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC;YAC9B,OAAO,EAAE,iBAAiB;YAC1B,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,QAAQ,EAAE,kBAAkB;aAC7B;SACF,CAAC,CAAC;IACT,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,MAAc,EAAE,KAAa;QAC3C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,mBAAmB,KAAK,aAAa,MAAM,EAAE,EAAG,EAAE,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,EAAE,CAAC,CAAA;QAClJ,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAA;QAC3C,OAAO,QAAQ,CAAC,IAAI,CAAA;IACxB,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,cAA8B;QAC5C,MAAM,QAAQ,GAAI,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,0BAA0B,cAAc,CAAC,MAAM,EAAE,EAChG;YACI,OAAO,EAAE,cAAc,CAAC,OAAO;YAC/B,SAAS,EAAE,cAAc,CAAC,SAAS;SACtC,EAA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E,UAAU,EAAE,MAAM;YAClB,UAAU,EAAE,IAAI;SACnB,EAAE,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;QAC3B,OAAO,QAAQ,CAAC,IAAI,CAAC;IACzB,CAAC;CACJ","sourcesContent":["import axios, { AxiosInstance } from 'axios';\nimport { CRM_BONUS_API_URL } from '../../env'\nimport { IPinSent } from '../dto/pin.sent';\nimport { IBonus, IProccesPinBonusDto, IReserveDTO } from '../dto/validate.pin.bonus';\nimport { UpdateOrderDTO } from '../dto/update.order.dto';\n\nexport class CrmBonusService {\n private axiosInstance: AxiosInstance;\n\n constructor() {\n this.axiosInstance = axios.create({\n baseURL: CRM_BONUS_API_URL,\n headers: {\n 'Content-Type': 'application/json',\n 'accept': 'application/json',\n },\n });\n }\n\n async getCustomer(userId: number, store: string) {\n const response = await this.axiosInstance.get(`/api/wake/store/${store}/customer/${userId}`, { headers: { 'Content-Type': 'application/json' } })\n console.log('response.data', response.data)\n return response.data\n }\n\n async updateOrder(updateOrderDTO: UpdateOrderDTO){\n const response = await this.axiosInstance.put(`/api/carts/update_cart/${updateOrderDTO.cartId}`, \n { \n orderId: updateOrderDTO.orderId,\n cartIdCrm: updateOrderDTO.cartIdCrm\n }, { headers: { 'Content-Type': 'application/json' } })\n\n console.log('response', response.data)\n \n }\n\n async sendPin(phone: number, store: string): Promise<IPinSent> {\n const response = await this.axiosInstance.post(\"/api/crm-bonus/send-pin\", { celular: phone, nome: \"giftback\" }, { headers: { store } });\n return {\n storeId: response.data.store_id,\n userId: response.data.user_id\n }\n }\n\n async validatePinBonus(payload: IProccesPinBonusDto, store: string): Promise<IBonus> {\n console.log('[validatePinBonus]', payload);\n\n const response = await this.axiosInstance.post(\"/api/crm-bonus/process-pin-bonus\", payload, { headers: { store } })\n\n return response.data;\n }\n\n async reserve(payload: IReserveDTO, store: string) {\n const response = await this.axiosInstance.post(\"/api/crm-bonus/redeem-bonus\", payload, { headers: { store } });\n return response.data;\n }\n\n async cancel(cartId: string, store: string) {\n const response = await this.axiosInstance.post(\"/api/crm-bonus/cancel-bonus\", {\n num_pedido: cartId,\n used_bonus: true\n }, { headers: { store } });\n return response.data;\n }\n}"]}
@@ -1,4 +1,4 @@
1
- import { A as AppModal$1, d as defineCustomElement$1 } from './p-09bc92e2.js';
1
+ import { A as AppModal$1, d as defineCustomElement$1 } from './p-4c2f324f.js';
2
2
 
3
3
  const AppModal = AppModal$1;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -1,4 +1,4 @@
1
- import { C as CrmBonusForm$1, d as defineCustomElement$1 } from './p-2e9efe46.js';
1
+ import { C as CrmBonusForm$1, d as defineCustomElement$1 } from './p-e0fe93e9.js';
2
2
 
3
3
  const CrmBonusForm = CrmBonusForm$1;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface CrmBonusNote extends Components.CrmBonusNote, HTMLElement {}
4
+ export const CrmBonusNote: {
5
+ prototype: CrmBonusNote;
6
+ new (): CrmBonusNote;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,42 @@
1
+ import { p as proxyCustomElement, H, h } from './p-faf7103e.js';
2
+
3
+ const crmBonusNoteCss = ".note-container{border:1px solid #dddddd;padding-left:15px;padding-right:15px}.note-container .back-cart{display:flex;text-align:center}.note-title{font-weight:700;height:2em;line-height:2em;text-align:left;border-radius:3px;color:#333;margin-bottom:1.4em}.note-description{font-family:Arial;color:#6d6d5f;padding:0;margin:0 auto}.back-cart{font-size:.9em;color:#337ab7;text-decoration:none;cursor:pointer}";
4
+ const CrmBonusNoteStyle0 = crmBonusNoteCss;
5
+
6
+ const CrmBonusNote$1 = /*@__PURE__*/ proxyCustomElement(class CrmBonusNote extends H {
7
+ constructor() {
8
+ super();
9
+ this.__registerHost();
10
+ this.url = undefined;
11
+ }
12
+ componentWillLoad() {
13
+ this.url = window.location.origin;
14
+ }
15
+ render() {
16
+ return (h("div", { key: '24f15c5c816f9e9b2b7d29b5ccb5379857b21d7e', class: "note-container" }, h("p", { key: '2fe785edd0bb7d880782191ac5763c47789194a0', class: "note-title" }, "Gift back"), h("p", { key: '726b0303b6ac7284f88b981716ee0748f9e03c11', class: "note-description" }, "Volte ao carrinho e confira se voc\u00EA tem Giftback para aplicar na sua compra!"), h("a", { key: 'f42fc1a08784ffdf5c55dc4833c4047b35f93ff5', class: "back-cart", href: this.url }, "Voltar ao carrinho")));
17
+ }
18
+ static get style() { return CrmBonusNoteStyle0; }
19
+ }, [0, "crm-bonus-note", {
20
+ "url": [32]
21
+ }]);
22
+ function defineCustomElement$1() {
23
+ if (typeof customElements === "undefined") {
24
+ return;
25
+ }
26
+ const components = ["crm-bonus-note"];
27
+ components.forEach(tagName => { switch (tagName) {
28
+ case "crm-bonus-note":
29
+ if (!customElements.get(tagName)) {
30
+ customElements.define(tagName, CrmBonusNote$1);
31
+ }
32
+ break;
33
+ } });
34
+ }
35
+ defineCustomElement$1();
36
+
37
+ const CrmBonusNote = CrmBonusNote$1;
38
+ const defineCustomElement = defineCustomElement$1;
39
+
40
+ export { CrmBonusNote, defineCustomElement };
41
+
42
+ //# sourceMappingURL=crm-bonus-note.js.map
@@ -0,0 +1 @@
1
+ {"file":"crm-bonus-note.js","mappings":";;AAAA,MAAM,eAAe,GAAG,wZAAwZ,CAAC;AACjb,2BAAe,eAAe;;MCKjBA,cAAY;;;;;;IAKrB,iBAAiB;QACb,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;KACrC;IAED,MAAM;QACF,QACI,4DAAK,KAAK,EAAC,gBAAgB,IACvB,0DAAG,KAAK,EAAC,YAAY,gBAEjB,EAEJ,0DAAG,KAAK,EAAC,kBAAkB,wFAEvB,EAEJ,0DAAG,KAAK,EAAC,WAAW,EAAC,IAAI,EAAE,IAAI,CAAC,GAAG,yBAE/B,CACF,EACT;KACJ;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CrmBonusNote"],"sources":["src/components/note/crm-bonus-note.css?tag=crm-bonus-note","src/components/note/crm-bonus-note.tsx"],"sourcesContent":[".note-container {\n border: 1px solid #dddddd;\n padding-left: 15px;\n padding-right: 15px;\n}\n\n.note-container .back-cart {\n display: flex;\n text-align: center;\n} \n\n.note-title {\n font-weight: 700;\n height: 2em;\n line-height: 2em;\n text-align: left;\n border-radius: 3px;\n color: #333;\n margin-bottom: 1.4em;\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: #337ab7;\n text-decoration: none;\n cursor: pointer; \n}","import { Component, State, h } from \"@stencil/core\";\n\n@Component({\n tag: 'crm-bonus-note',\n styleUrl: 'crm-bonus-note.css'\n})\nexport class CrmBonusNote {\n\n @State() url: string\n\n\n componentWillLoad() {\n this.url = window.location.origin;\n }\n\n render() {\n return (\n <div class=\"note-container\">\n <p class=\"note-title\">\n Gift back\n </p>\n\n <p class=\"note-description\">\n Volte ao carrinho e confira se você tem Giftback para aplicar na sua compra!\n </p>\n\n <a class=\"back-cart\" href={this.url}>\n Voltar ao carrinho\n </a>\n </div>\n )\n }\n}"],"version":3}