crmbonus-component-wake 0.0.26 → 0.0.27

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +7 -0
  2. package/dist/cjs/app-globals-3a1e7e63.js.map +1 -0
  3. package/dist/cjs/app-modal_2.cjs.entry.js +134 -0
  4. package/dist/cjs/app-modal_2.cjs.entry.js.map +1 -0
  5. package/dist/cjs/crm-bonus.cjs.entry.js +55 -0
  6. package/dist/cjs/crm-bonus.cjs.entry.js.map +1 -0
  7. package/dist/cjs/crmbonus-component-wake.cjs.js +27 -0
  8. package/dist/cjs/crmbonus-component-wake.cjs.js.map +1 -0
  9. package/dist/cjs/crmbonus.service-8412ddbf.js +3798 -0
  10. package/dist/cjs/crmbonus.service-8412ddbf.js.map +1 -0
  11. package/dist/cjs/giftback-finish_5.cjs.entry.js +155 -0
  12. package/dist/cjs/giftback-finish_5.cjs.entry.js.map +1 -0
  13. package/dist/cjs/index-52d8a075.js +1248 -0
  14. package/dist/cjs/index-52d8a075.js.map +1 -0
  15. package/dist/cjs/index.cjs.js +11 -0
  16. package/dist/cjs/index.cjs.js.map +1 -0
  17. package/dist/cjs/loader.cjs.js +17 -0
  18. package/dist/cjs/loader.cjs.js.map +1 -0
  19. package/dist/cjs/loading-spinner.cjs.entry.js +24 -0
  20. package/dist/cjs/loading-spinner.cjs.entry.js.map +1 -0
  21. package/dist/cjs/pedido-finalizado.cjs.entry.js +36 -0
  22. package/dist/cjs/pedido-finalizado.cjs.entry.js.map +1 -0
  23. package/dist/collection/collection-manifest.json +21 -0
  24. package/dist/collection/components/crm-bonus/assets/logo.svg +18 -0
  25. package/dist/collection/components/crm-bonus/assets/success-svgrepo-com.svg +8 -0
  26. package/dist/collection/components/crm-bonus/assets/svg/logo.svg +18 -0
  27. package/dist/collection/components/crm-bonus/assets/svg/success-svgrepo-com.svg +8 -0
  28. package/dist/collection/components/crm-bonus/crm-bonus.css +20 -0
  29. package/dist/collection/components/crm-bonus/crm-bonus.js +132 -0
  30. package/dist/collection/components/crm-bonus/crm-bonus.js.map +1 -0
  31. package/dist/collection/components/crm-bonus-form/crm-bonus-form.css +32 -0
  32. package/dist/collection/components/crm-bonus-form/crm-bonus-form.js +216 -0
  33. package/dist/collection/components/crm-bonus-form/crm-bonus-form.js.map +1 -0
  34. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.css +10 -0
  35. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js +20 -0
  36. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js.map +1 -0
  37. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.css +74 -0
  38. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js +127 -0
  39. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js.map +1 -0
  40. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.css +109 -0
  41. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js +127 -0
  42. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js.map +1 -0
  43. package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js +75 -0
  44. package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js.map +1 -0
  45. package/dist/collection/components/loading-spinner/loading-spinner.css +17 -0
  46. package/dist/collection/components/loading-spinner/loading-spinner.js +63 -0
  47. package/dist/collection/components/loading-spinner/loading-spinner.js.map +1 -0
  48. package/dist/collection/components/modal/app-modal.css +45 -0
  49. package/dist/collection/components/modal/app-modal.js +83 -0
  50. package/dist/collection/components/modal/app-modal.js.map +1 -0
  51. package/dist/collection/components/pedido/pedido.js +83 -0
  52. package/dist/collection/components/pedido/pedido.js.map +1 -0
  53. package/dist/collection/components/phone/phone-input-mask.css +47 -0
  54. package/dist/collection/components/phone/phone-input-mask.js +90 -0
  55. package/dist/collection/components/phone/phone-input-mask.js.map +1 -0
  56. package/dist/collection/contants/index.js +8 -0
  57. package/dist/collection/contants/index.js.map +1 -0
  58. package/dist/collection/contants/mocks.js +28 -0
  59. package/dist/collection/contants/mocks.js.map +1 -0
  60. package/dist/collection/dto/pin.sent.js +2 -0
  61. package/dist/collection/dto/pin.sent.js.map +1 -0
  62. package/dist/collection/dto/update.order.dto.js +2 -0
  63. package/dist/collection/dto/update.order.dto.js.map +1 -0
  64. package/dist/collection/dto/validate.pin.bonus.js +2 -0
  65. package/dist/collection/dto/validate.pin.bonus.js.map +1 -0
  66. package/dist/collection/index.js +11 -0
  67. package/dist/collection/index.js.map +1 -0
  68. package/dist/collection/services/crmbonus.service.js +42 -0
  69. package/dist/collection/services/crmbonus.service.js.map +1 -0
  70. package/dist/collection/utils/utils.js +4 -0
  71. package/dist/collection/utils/utils.js.map +1 -0
  72. package/dist/components/app-modal.js +8 -0
  73. package/dist/components/app-modal.js.map +1 -0
  74. package/dist/components/crm-bonus-form.js +8 -0
  75. package/dist/components/crm-bonus-form.js.map +1 -0
  76. package/dist/components/crm-bonus.js +126 -0
  77. package/dist/components/crm-bonus.js.map +1 -0
  78. package/dist/components/giftback-finish.js +8 -0
  79. package/dist/components/giftback-finish.js.map +1 -0
  80. package/dist/components/giftback-pin.js +8 -0
  81. package/dist/components/giftback-pin.js.map +1 -0
  82. package/dist/components/giftback-progress.js +8 -0
  83. package/dist/components/giftback-progress.js.map +1 -0
  84. package/dist/components/index.js +9 -0
  85. package/dist/components/index.js.map +1 -0
  86. package/dist/components/loading-spinner.js +8 -0
  87. package/dist/components/loading-spinner.js.map +1 -0
  88. package/dist/{crmbonus-component-wake/crmbonus.service-5208f883.js → components/p-374de9ae.js} +91 -166
  89. package/dist/components/p-374de9ae.js.map +1 -0
  90. package/dist/components/p-462c12d8.js +69 -0
  91. package/dist/components/p-462c12d8.js.map +1 -0
  92. package/dist/{crmbonus-component-wake/giftback-pin.entry.js → components/p-6442ffce.js} +39 -9
  93. package/dist/components/p-6442ffce.js.map +1 -0
  94. package/dist/components/p-878ce0aa.js +174 -0
  95. package/dist/components/p-878ce0aa.js.map +1 -0
  96. package/dist/components/p-8fcf8924.js +52 -0
  97. package/dist/components/p-8fcf8924.js.map +1 -0
  98. package/dist/components/p-cb5a1fdf.js +39 -0
  99. package/dist/components/p-cb5a1fdf.js.map +1 -0
  100. package/dist/components/p-cbade307.js +36 -0
  101. package/dist/components/p-cbade307.js.map +1 -0
  102. package/dist/{crmbonus-component-wake/phone-input-mask.entry.js → components/p-e40cf14d.js} +30 -9
  103. package/dist/components/p-e40cf14d.js.map +1 -0
  104. package/dist/components/p-e816fb90.js +43 -0
  105. package/dist/components/p-e816fb90.js.map +1 -0
  106. package/dist/components/p-faf7103e.js +1064 -0
  107. package/dist/components/p-faf7103e.js.map +1 -0
  108. package/dist/components/pedido-finalizado.js +54 -0
  109. package/dist/components/pedido-finalizado.js.map +1 -0
  110. package/dist/components/phone-input-mask.js +8 -0
  111. package/dist/components/phone-input-mask.js.map +1 -0
  112. package/dist/components/phone-input.js +8 -0
  113. package/dist/components/phone-input.js.map +1 -0
  114. package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +1 -48
  115. package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js.map +1 -1
  116. package/dist/crmbonus-component-wake/index.esm.js +1 -16
  117. package/dist/crmbonus-component-wake/index.esm.js.map +1 -1
  118. package/dist/crmbonus-component-wake/p-374de9ae.js +2 -0
  119. package/dist/crmbonus-component-wake/p-374de9ae.js.map +1 -0
  120. package/dist/crmbonus-component-wake/p-4306a717.entry.js +2 -0
  121. package/dist/crmbonus-component-wake/p-4306a717.entry.js.map +1 -0
  122. package/dist/crmbonus-component-wake/p-72510682.js +3 -0
  123. package/dist/crmbonus-component-wake/p-72510682.js.map +1 -0
  124. package/dist/crmbonus-component-wake/p-9985f639.entry.js +2 -0
  125. package/dist/crmbonus-component-wake/p-9985f639.entry.js.map +1 -0
  126. package/dist/crmbonus-component-wake/p-be1a56de.entry.js +2 -0
  127. package/dist/crmbonus-component-wake/p-be1a56de.entry.js.map +1 -0
  128. package/dist/crmbonus-component-wake/p-e1255160.js +2 -0
  129. package/dist/crmbonus-component-wake/p-e1255160.js.map +1 -0
  130. package/dist/crmbonus-component-wake/p-e2f165e8.entry.js +2 -0
  131. package/dist/crmbonus-component-wake/p-e2f165e8.entry.js.map +1 -0
  132. package/dist/crmbonus-component-wake/p-f74e4a71.entry.js +2 -0
  133. package/dist/crmbonus-component-wake/p-f74e4a71.entry.js.map +1 -0
  134. package/dist/env.js +5 -0
  135. package/dist/env.js.map +1 -0
  136. package/dist/{crmbonus-component-wake/crm-bonus-form.entry.js → esm/app-modal_2.entry.js} +26 -6
  137. package/dist/esm/app-modal_2.entry.js.map +1 -0
  138. package/dist/{crmbonus-component-wake → esm}/crm-bonus.entry.js +5 -4
  139. package/dist/esm/crm-bonus.entry.js.map +1 -0
  140. package/dist/esm/crmbonus-component-wake.js +22 -0
  141. package/dist/esm/crmbonus-component-wake.js.map +1 -0
  142. package/dist/esm/crmbonus.service-053a9e38.js +3796 -0
  143. package/dist/esm/crmbonus.service-053a9e38.js.map +1 -0
  144. package/dist/esm/giftback-finish_5.entry.js +147 -0
  145. package/dist/esm/giftback-finish_5.entry.js.map +1 -0
  146. package/dist/esm/index-9f7bde48.js +1220 -0
  147. package/dist/esm/index-9f7bde48.js.map +1 -0
  148. package/dist/esm/index.js +7 -0
  149. package/dist/esm/index.js.map +1 -0
  150. package/dist/esm/loader.js +13 -0
  151. package/dist/esm/loader.js.map +1 -0
  152. package/dist/{crmbonus-component-wake → esm}/loading-spinner.entry.js +4 -3
  153. package/dist/esm/loading-spinner.entry.js.map +1 -0
  154. package/dist/{crmbonus-component-wake → esm}/pedido-finalizado.entry.js +3 -3
  155. package/dist/esm/pedido-finalizado.entry.js.map +1 -0
  156. package/dist/index.cjs.js +1 -0
  157. package/dist/index.js +1 -0
  158. package/package.json +1 -1
  159. package/dist/crmbonus-component-wake/app-modal.entry.js +0 -23
  160. package/dist/crmbonus-component-wake/app-modal.entry.js.map +0 -1
  161. package/dist/crmbonus-component-wake/crm-bonus-form.entry.js.map +0 -1
  162. package/dist/crmbonus-component-wake/crm-bonus.entry.js.map +0 -1
  163. package/dist/crmbonus-component-wake/crmbonus.service-5208f883.js.map +0 -1
  164. package/dist/crmbonus-component-wake/giftback-finish.entry.js +0 -19
  165. package/dist/crmbonus-component-wake/giftback-finish.entry.js.map +0 -1
  166. package/dist/crmbonus-component-wake/giftback-pin.entry.js.map +0 -1
  167. package/dist/crmbonus-component-wake/giftback-progress.entry.js +0 -40
  168. package/dist/crmbonus-component-wake/giftback-progress.entry.js.map +0 -1
  169. package/dist/crmbonus-component-wake/index-f557ce7c.js +0 -3039
  170. package/dist/crmbonus-component-wake/index-f557ce7c.js.map +0 -1
  171. package/dist/crmbonus-component-wake/loading-spinner.entry.js.map +0 -1
  172. package/dist/crmbonus-component-wake/pedido-finalizado.entry.js.map +0 -1
  173. package/dist/crmbonus-component-wake/phone-input-mask.entry.js.map +0 -1
  174. package/dist/crmbonus-component-wake/phone-input.entry.js +0 -21
  175. package/dist/crmbonus-component-wake/phone-input.entry.js.map +0 -1
  176. package/dist/crmbonus-component-wake/shadow-css-7ad5caf8.js +0 -334
  177. package/dist/crmbonus-component-wake/shadow-css-7ad5caf8.js.map +0 -1
  178. /package/dist/{crmbonus-component-wake → esm}/app-globals-0f993ce5.js +0 -0
  179. /package/dist/{crmbonus-component-wake → esm}/app-globals-0f993ce5.js.map +0 -0
@@ -0,0 +1,83 @@
1
+ import { h } from "@stencil/core";
2
+ export class AppModal {
3
+ constructor() {
4
+ this.isOpen = false;
5
+ this.modalTitle = undefined;
6
+ }
7
+ closeModal() {
8
+ this.modalClosed.emit();
9
+ }
10
+ render() {
11
+ return (h("div", { key: '82c352862bc0e4bff13b48c82ce09643d922d66e', class: `modal-backdrop ${this.isOpen ? 'visible' : ''}` }, h("div", { key: 'ffde88a49b5e201caa1b14b52fe997ee183cbb6e', class: "modal" }, h("div", { key: 'f68a25c7ca6554d81d3d55f7b9a00f35ddbb4744', class: "modal-header" }, h("h3", { key: 'f0ec45fac1b595bd03b603a2f69dd036fe2cef16' }, this.modalTitle), h("button", { key: '1600501c66d41e9e8aa8ca7b335f41701c7e57ea', class: "close-button", onClick: () => this.closeModal() }, "\u00D7")), h("div", { key: '563e936a2717e5534b9f8d528fbd432565562790', class: "modal-body" }, h("slot", { key: '499c8c2925cc9469da0998bbe1fad360adaf1efd' })))));
12
+ }
13
+ static get is() { return "app-modal"; }
14
+ static get encapsulation() { return "shadow"; }
15
+ static get originalStyleUrls() {
16
+ return {
17
+ "$": ["app-modal.css"]
18
+ };
19
+ }
20
+ static get styleUrls() {
21
+ return {
22
+ "$": ["app-modal.css"]
23
+ };
24
+ }
25
+ static get properties() {
26
+ return {
27
+ "isOpen": {
28
+ "type": "boolean",
29
+ "mutable": false,
30
+ "complexType": {
31
+ "original": "boolean",
32
+ "resolved": "boolean",
33
+ "references": {}
34
+ },
35
+ "required": false,
36
+ "optional": false,
37
+ "docs": {
38
+ "tags": [],
39
+ "text": ""
40
+ },
41
+ "attribute": "is-open",
42
+ "reflect": true,
43
+ "defaultValue": "false"
44
+ },
45
+ "modalTitle": {
46
+ "type": "string",
47
+ "mutable": false,
48
+ "complexType": {
49
+ "original": "string",
50
+ "resolved": "string",
51
+ "references": {}
52
+ },
53
+ "required": false,
54
+ "optional": false,
55
+ "docs": {
56
+ "tags": [],
57
+ "text": ""
58
+ },
59
+ "attribute": "modal-title",
60
+ "reflect": false
61
+ }
62
+ };
63
+ }
64
+ static get events() {
65
+ return [{
66
+ "method": "modalClosed",
67
+ "name": "modalClosed",
68
+ "bubbles": true,
69
+ "cancelable": true,
70
+ "composed": true,
71
+ "docs": {
72
+ "tags": [],
73
+ "text": ""
74
+ },
75
+ "complexType": {
76
+ "original": "void",
77
+ "resolved": "void",
78
+ "references": {}
79
+ }
80
+ }];
81
+ }
82
+ }
83
+ //# sourceMappingURL=app-modal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-modal.js","sourceRoot":"","sources":["../../../../src/components/modal/app-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAOxE,MAAM,OAAO,QAAQ;;sBAG0B,KAAK;;;IAQxC,UAAU;QACd,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;IAC5B,CAAC;IAED,MAAM;QACF,OAAO,CACH,4DAAK,KAAK,EAAE,kBAAkB,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;YACxD,4DAAK,KAAK,EAAC,OAAO;gBACd,4DAAK,KAAK,EAAC,cAAc;oBACrB,6DAAK,IAAI,CAAC,UAAU,CAAM;oBAC1B,+DAAQ,KAAK,EAAC,cAAc,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,UAAU,EAAE,aAEpD,CACP;gBACN,4DAAK,KAAK,EAAC,YAAY;oBACnB,8DAAQ,CACN,CACJ,CACJ,CACT,CAAA;IACL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, Event, EventEmitter, Prop, h } from \"@stencil/core\";\n\n@Component({\n tag: 'app-modal',\n styleUrl: 'app-modal.css',\n shadow: true,\n})\nexport class AppModal {\n\n // Controle da visibilidade do modal\n @Prop({ reflect: true }) isOpen: boolean = false;\n\n // Título do modal\n @Prop() modalTitle: string;\n\n // Evento emitido ao fechar o modal\n @Event() modalClosed: EventEmitter<void>;\n\n private closeModal() {\n this.modalClosed.emit();\n }\n\n render() {\n return (\n <div class={`modal-backdrop ${this.isOpen ? 'visible' : ''}`}>\n <div class=\"modal\">\n <div class=\"modal-header\">\n <h3>{this.modalTitle}</h3>\n <button class=\"close-button\" onClick={() => this.closeModal()}>\n ×\n </button>\n </div>\n <div class=\"modal-body\">\n <slot />\n </div>\n </div>\n </div>\n )\n }\n}"]}
@@ -0,0 +1,83 @@
1
+ import { h } from "@stencil/core";
2
+ import { CrmBonusService } from "../../services/crmbonus.service";
3
+ export class Pedido {
4
+ constructor() {
5
+ this.cartId = undefined;
6
+ this.orderId = undefined;
7
+ this.metadadoString = undefined;
8
+ }
9
+ async componentWillLoad() {
10
+ console.log('this.metadadoString', this.metadadoString);
11
+ const metadado = this.metadadoString ? JSON.parse(this.metadadoString) : { id: null };
12
+ console.log('this.cartId', this.cartId);
13
+ console.log('this.orderid', this.orderId);
14
+ console.log('metadadoid', metadado);
15
+ if (this.cartId && this.orderId) {
16
+ await new CrmBonusService().updateOrder({
17
+ cartId: this.cartId,
18
+ orderId: this.orderId,
19
+ cartIdCrm: metadado.id
20
+ });
21
+ }
22
+ }
23
+ render() {
24
+ return (h("div", { key: 'bf8eabf6fe4118a1e14b532ce6639f918e07cbec' }));
25
+ }
26
+ static get is() { return "pedido-finalizado"; }
27
+ static get properties() {
28
+ return {
29
+ "cartId": {
30
+ "type": "string",
31
+ "mutable": false,
32
+ "complexType": {
33
+ "original": "string",
34
+ "resolved": "string",
35
+ "references": {}
36
+ },
37
+ "required": false,
38
+ "optional": false,
39
+ "docs": {
40
+ "tags": [],
41
+ "text": ""
42
+ },
43
+ "attribute": "cartid",
44
+ "reflect": false
45
+ },
46
+ "orderId": {
47
+ "type": "number",
48
+ "mutable": false,
49
+ "complexType": {
50
+ "original": "number",
51
+ "resolved": "number",
52
+ "references": {}
53
+ },
54
+ "required": false,
55
+ "optional": false,
56
+ "docs": {
57
+ "tags": [],
58
+ "text": ""
59
+ },
60
+ "attribute": "orderid",
61
+ "reflect": false
62
+ },
63
+ "metadadoString": {
64
+ "type": "string",
65
+ "mutable": false,
66
+ "complexType": {
67
+ "original": "string",
68
+ "resolved": "string",
69
+ "references": {}
70
+ },
71
+ "required": false,
72
+ "optional": false,
73
+ "docs": {
74
+ "tags": [],
75
+ "text": ""
76
+ },
77
+ "attribute": "metadado",
78
+ "reflect": false
79
+ }
80
+ };
81
+ }
82
+ }
83
+ //# sourceMappingURL=pedido.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pedido.js","sourceRoot":"","sources":["../../../../src/components/pedido/pedido.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAKlE,MAAM,OAAO,MAAM;;;;;;IAMf,KAAK,CAAC,iBAAiB;QACnB,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,IAAI,CAAC,cAAc,CAAC,CAAA;QACvD,MAAM,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;QAEtF,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACxC,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1C,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAA;QAEnC,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YAC9B,MAAM,IAAI,eAAe,EAAE,CAAC,WAAW,CAAC;gBACpC,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,OAAO,EAAG,IAAI,CAAC,OAAO;gBACtB,SAAS,EAAE,QAAQ,CAAC,EAAE;aACzB,CAAC,CAAC;QACP,CAAC;IACL,CAAC;IAED,MAAM;QACF,OAAO,CACH,6DAAW,CACd,CAAA;IACL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, Prop, h } from \"@stencil/core\";\nimport { CrmBonusService } from \"../../services/crmbonus.service\";\n\n@Component({\n tag: \"pedido-finalizado\"\n})\nexport class Pedido {\n\n @Prop({ attribute: \"cartid\" }) cartId: string;\n @Prop({ attribute: \"orderid\" }) orderId: number;\n @Prop({ attribute: \"metadado\" }) metadadoString: string;\n\n async componentWillLoad() {\n console.log('this.metadadoString', this.metadadoString)\n const metadado = this.metadadoString ? JSON.parse(this.metadadoString) : { id: null };\n\n console.log('this.cartId', this.cartId);\n console.log('this.orderid', this.orderId);\n console.log('metadadoid', metadado)\n\n if (this.cartId && this.orderId) {\n await new CrmBonusService().updateOrder({\n cartId: this.cartId,\n orderId: this.orderId,\n cartIdCrm: metadado.id\n });\n }\n }\n\n render() {\n return (\n <div></div>\n )\n }\n}"]}
@@ -0,0 +1,47 @@
1
+ .inline-text-field-container {
2
+ display: flex;
3
+ flex-direction: column;
4
+ }
5
+
6
+ @supports (top: max(0%)) {
7
+ .mdc-text-field--outlined {
8
+ padding-right: max(16px, var(--mdc-shape-small, 4px));
9
+ }
10
+ }
11
+
12
+ @supports (top: max(0%)) {
13
+ .mdc-text-field--outlined {
14
+ padding-left: max(16px, calc(var(--mdc-shape-small, 4px) + 4px));
15
+ }
16
+ }
17
+
18
+ .mdc-text-field--outlined {
19
+ height: 55px;
20
+ overflow: visible;
21
+ }
22
+
23
+ .phone {
24
+ width: 300px;
25
+ height: 50px;
26
+ font-size: 18px;
27
+ padding: 10px;
28
+ color: grey;
29
+ border: 1px solid #d3c6c6;
30
+ outline: none;
31
+ }
32
+
33
+ .mdc-text-field {
34
+ border-top-left-radius: 4px;
35
+ border-top-left-radius: var(--mdc-shape-small, 4px);
36
+ border-top-right-radius: 4px;
37
+ border-top-right-radius: var(--mdc-shape-small, 4px);
38
+ border-bottom-right-radius: 0;
39
+ border-bottom-left-radius: 0;
40
+ display: inline-flex;
41
+ align-items: baseline;
42
+ padding: 0 16px;
43
+ position: relative;
44
+ box-sizing: border-box;
45
+ overflow: hidden;
46
+ will-change: opacity, transform, color;
47
+ }
@@ -0,0 +1,90 @@
1
+ import { h } from "@stencil/core";
2
+ export class PhoneInputMask {
3
+ constructor() {
4
+ this.phone = '';
5
+ this.initialValue = undefined;
6
+ }
7
+ componentWillLoad() {
8
+ this.phone = this.initialValue;
9
+ }
10
+ formatPhone(value) {
11
+ const cleaned = value.replace(/\D/g, ''); // Remove tudo que não for número
12
+ const match = cleaned.match(/^(\d{0,2})(\d{0,5})(\d{0,4})$/);
13
+ if (!match)
14
+ return value;
15
+ const part1 = match[1] ? `(${match[1]}` : '';
16
+ const part2 = match[2] ? `) ${match[2]}` : '';
17
+ const part3 = match[3] ? `-${match[3]}` : '';
18
+ return `${part1}${part2}${part3}`;
19
+ }
20
+ handleInput(event) {
21
+ const input = event.target;
22
+ this.phone = this.formatPhone(input.value);
23
+ }
24
+ async getPhone() {
25
+ return this.phone;
26
+ }
27
+ render() {
28
+ return (h("input", { key: 'eb90a08eb68463fb8dcb81e22d45621b8b59c754', id: "phone", type: "tel", class: "phone", value: this.phone, onInput: (event) => this.handleInput(event), placeholder: "(12) 94567-8910" }));
29
+ }
30
+ static get is() { return "phone-input-mask"; }
31
+ static get encapsulation() { return "shadow"; }
32
+ static get originalStyleUrls() {
33
+ return {
34
+ "$": ["phone-input-mask.css"]
35
+ };
36
+ }
37
+ static get styleUrls() {
38
+ return {
39
+ "$": ["phone-input-mask.css"]
40
+ };
41
+ }
42
+ static get properties() {
43
+ return {
44
+ "initialValue": {
45
+ "type": "string",
46
+ "mutable": false,
47
+ "complexType": {
48
+ "original": "string",
49
+ "resolved": "string",
50
+ "references": {}
51
+ },
52
+ "required": false,
53
+ "optional": false,
54
+ "docs": {
55
+ "tags": [],
56
+ "text": ""
57
+ },
58
+ "attribute": "initial-value",
59
+ "reflect": false
60
+ }
61
+ };
62
+ }
63
+ static get states() {
64
+ return {
65
+ "phone": {}
66
+ };
67
+ }
68
+ static get methods() {
69
+ return {
70
+ "getPhone": {
71
+ "complexType": {
72
+ "signature": "() => Promise<string>",
73
+ "parameters": [],
74
+ "references": {
75
+ "Promise": {
76
+ "location": "global",
77
+ "id": "global::Promise"
78
+ }
79
+ },
80
+ "return": "Promise<string>"
81
+ },
82
+ "docs": {
83
+ "text": "",
84
+ "tags": []
85
+ }
86
+ }
87
+ };
88
+ }
89
+ }
90
+ //# sourceMappingURL=phone-input-mask.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phone-input-mask.js","sourceRoot":"","sources":["../../../../src/components/phone/phone-input-mask.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAOlE,MAAM,OAAO,cAAc;;qBACE,EAAE;;;IAG3B,iBAAiB;QACb,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC;IACnC,CAAC;IAGO,WAAW,CAAC,KAAa;QAC7B,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,iCAAiC;QAC3E,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;QAC7D,IAAI,CAAC,KAAK;YAAE,OAAO,KAAK,CAAC;QAEzB,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7C,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9C,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAE7C,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,EAAE,CAAC;IACtC,CAAC;IAEO,WAAW,CAAC,KAAY;QAC5B,MAAM,KAAK,GAAG,KAAK,CAAC,MAA0B,CAAC;QAC/C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;IAGM,KAAK,CAAC,QAAQ;QACjB,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAED,MAAM;QACF,OAAO,CACH,8DACI,EAAE,EAAC,OAAO,EACV,IAAI,EAAC,KAAK,EACV,KAAK,EAAC,OAAO,EACb,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,EAC3C,WAAW,EAAC,iBAAiB,GAC/B,CACL,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, h, Method, Prop, State } from '@stencil/core';\n\n@Component({\n tag: 'phone-input-mask',\n styleUrl: 'phone-input-mask.css',\n shadow: true,\n})\nexport class PhoneInputMask {\n @State() phone: string = '';\n @Prop() initialValue: string;\n\n componentWillLoad() {\n this.phone = this.initialValue; \n }\n\n\n private formatPhone(value: string): string {\n const cleaned = value.replace(/\\D/g, ''); // Remove tudo que não for número\n const match = cleaned.match(/^(\\d{0,2})(\\d{0,5})(\\d{0,4})$/);\n if (!match) return value;\n\n const part1 = match[1] ? `(${match[1]}` : '';\n const part2 = match[2] ? `) ${match[2]}` : '';\n const part3 = match[3] ? `-${match[3]}` : '';\n\n return `${part1}${part2}${part3}`;\n }\n\n private handleInput(event: Event): void {\n const input = event.target as HTMLInputElement;\n this.phone = this.formatPhone(input.value);\n }\n\n @Method()\n public async getPhone() {\n return this.phone;\n }\n\n render() {\n return (\n <input\n id=\"phone\"\n type=\"tel\"\n class=\"phone\"\n value={this.phone}\n onInput={(event) => this.handleInput(event)}\n placeholder=\"(12) 94567-8910\"\n />\n );\n }\n}\n"]}
@@ -0,0 +1,8 @@
1
+ export var StepFormEnum;
2
+ (function (StepFormEnum) {
3
+ StepFormEnum[StepFormEnum["STEP_PHONE"] = 1] = "STEP_PHONE";
4
+ StepFormEnum[StepFormEnum["STEP_PIN"] = 2] = "STEP_PIN";
5
+ StepFormEnum[StepFormEnum["STEP_RESERVE"] = 3] = "STEP_RESERVE";
6
+ StepFormEnum[StepFormEnum["STEP_APPLY"] = 4] = "STEP_APPLY";
7
+ })(StepFormEnum || (StepFormEnum = {}));
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/contants/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACpB,2DAAc,CAAA;IACd,uDAAY,CAAA;IACZ,+DAAgB,CAAA;IAChB,2DAAc,CAAA;AAClB,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB","sourcesContent":["export enum StepFormEnum {\n STEP_PHONE = 1,\n STEP_PIN = 2,\n STEP_RESERVE = 3,\n STEP_APPLY = 4\n}"]}
@@ -0,0 +1,28 @@
1
+ export const RESPONSE_CONSULTA_BONUS = {
2
+ data: {
3
+ "hasBonus": true,
4
+ "bonusBalance": 9.89,
5
+ "totalBonus": 9.89,
6
+ "minimumPurchase": 39.56,
7
+ "bonusIds": "848785416",
8
+ "history": [
9
+ {
10
+ "validityStart": "2024-11-12 00:00:00",
11
+ "validityEnd": "2024-12-12 23:59:59",
12
+ "value": 0
13
+ },
14
+ {
15
+ "validityStart": "2024-11-20 00:00:00",
16
+ "validityEnd": "2024-12-20 23:59:59",
17
+ "value": 9.89
18
+ }
19
+ ],
20
+ "storeId": 100932,
21
+ "userId": 27047371,
22
+ "cartId": "7be29cd3-f602-4cb8-bdb8-02f7cdef6fee",
23
+ "calculatedValue": 2200,
24
+ "totalValue": 2200,
25
+ firstValidityDate: "2024-11-20 00:00:00",
26
+ }
27
+ };
28
+ //# sourceMappingURL=mocks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mocks.js","sourceRoot":"","sources":["../../../src/contants/mocks.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACnC,IAAI,EAAG;QACH,UAAU,EAAE,IAAI;QAChB,cAAc,EAAE,IAAI;QACpB,YAAY,EAAE,IAAI;QAClB,iBAAiB,EAAE,KAAK;QACxB,UAAU,EAAE,WAAW;QACvB,SAAS,EAAE;YACP;gBACI,eAAe,EAAE,qBAAqB;gBACtC,aAAa,EAAE,qBAAqB;gBACpC,OAAO,EAAE,CAAC;aACb;YACD;gBACI,eAAe,EAAE,qBAAqB;gBACtC,aAAa,EAAE,qBAAqB;gBACpC,OAAO,EAAE,IAAI;aAChB;SACJ;QACD,SAAS,EAAE,MAAM;QACjB,QAAQ,EAAE,QAAQ;QAClB,QAAQ,EAAE,sCAAsC;QAChD,iBAAiB,EAAE,IAAI;QACvB,YAAY,EAAE,IAAI;QAClB,iBAAiB,EAAE,qBAAqB;KACjC;CACd,CAAA","sourcesContent":["import { IBonus } from \"../components\";\n\nexport const RESPONSE_CONSULTA_BONUS = {\n data: {\n \"hasBonus\": true,\n \"bonusBalance\": 9.89,\n \"totalBonus\": 9.89,\n \"minimumPurchase\": 39.56,\n \"bonusIds\": \"848785416\",\n \"history\": [\n {\n \"validityStart\": \"2024-11-12 00:00:00\",\n \"validityEnd\": \"2024-12-12 23:59:59\",\n \"value\": 0\n },\n {\n \"validityStart\": \"2024-11-20 00:00:00\",\n \"validityEnd\": \"2024-12-20 23:59:59\",\n \"value\": 9.89\n }\n ],\n \"storeId\": 100932,\n \"userId\": 27047371,\n \"cartId\": \"7be29cd3-f602-4cb8-bdb8-02f7cdef6fee\",\n \"calculatedValue\": 2200,\n \"totalValue\": 2200,\n firstValidityDate: \"2024-11-20 00:00:00\",\n } as IBonus\n}"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=pin.sent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pin.sent.js","sourceRoot":"","sources":["../../../src/dto/pin.sent.ts"],"names":[],"mappings":"","sourcesContent":["export interface IPinSent {\n storeId: number;\n userId: number;\n}"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=update.order.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.order.dto.js","sourceRoot":"","sources":["../../../src/dto/update.order.dto.ts"],"names":[],"mappings":"","sourcesContent":["export interface UpdateOrderDTO {\n cartId: string;\n orderId: number;\n cartIdCrm: string;\n}"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=validate.pin.bonus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.pin.bonus.js","sourceRoot":"","sources":["../../../src/dto/validate.pin.bonus.ts"],"names":[],"mappings":"","sourcesContent":["export interface IProduct {\n variantId: number;\n sku: string;\n value: number;\n qtd: number;\n}\n\nexport interface IProductWake {\n ProdutoVarianteId: number;\n SKU: string;\n PrecoPor: number;\n Quantidade: number;\n}\n\nexport interface ICustomer {\n birthDate: string;\n document: string;\n name: string;\n phone: string;\n}\n\nexport interface IProccesPinBonusDto {\n cartId: string;\n products: Array<IProduct>;\n loja_id: number;\n user_id: number;\n cellphone: string;\n pin: string;\n\n}\n\nexport interface IBonus {\n hasBonus: boolean;\n bonusBalance: number;\n totalBonus: number;\n minimumPurchase: number;\n bonusIds: string;\n firstValidityDate: string\n history: [\n {\n validityStart: string;\n validityEnd: string;\n value: number\n },\n {\n validityStart: string;\n validityEnd: string\n value: number\n }\n ]\n storeId: number;\n userId: number;\n cartId: string\n calculatedValue: number;\n totalValue: number\n}\n\n\nexport interface IReserveDTO {\n cart_id: string,\n gross_value: number,\n redeemed_bonus: number,\n ticket: string\n}"]}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @fileoverview entry point for your component library
3
+ *
4
+ * This is the entry point for your component library. Use this file to export utilities,
5
+ * constants or data structure that accompany your components.
6
+ *
7
+ * DO NOT use this file to export your components. Instead, use the recommended approaches
8
+ * to consume components of this package as outlined in the `README.md`.
9
+ */
10
+ export { format } from './utils/utils';
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC","sourcesContent":["/**\n * @fileoverview entry point for your component library\n *\n * This is the entry point for your component library. Use this file to export utilities,\n * constants or data structure that accompany your components.\n *\n * DO NOT use this file to export your components. Instead, use the recommended approaches\n * to consume components of this package as outlined in the `README.md`.\n */\n\nexport { format } from './utils/utils';\nexport type * from './components.d.ts';\n"]}
@@ -0,0 +1,42 @@
1
+ import axios from "axios";
2
+ import { CRM_BONUS_API_URL } from "../../env";
3
+ export class CrmBonusService {
4
+ constructor() {
5
+ this.axiosInstance = axios.create({
6
+ baseURL: CRM_BONUS_API_URL,
7
+ headers: {
8
+ 'Content-Type': 'application/json',
9
+ 'accept': 'application/json',
10
+ },
11
+ });
12
+ }
13
+ async getCustomer(userId, store) {
14
+ const response = await this.axiosInstance.get(`/api/wake/store/${store}/customer/${userId}`, { headers: { 'Content-Type': 'application/json' } });
15
+ console.log('response.data', response.data);
16
+ return response.data;
17
+ }
18
+ async updateOrder(updateOrderDTO) {
19
+ const response = await this.axiosInstance.put(`/api/carts/update_cart/${updateOrderDTO.cartId}`, {
20
+ orderId: updateOrderDTO.orderId,
21
+ cartIdCrm: updateOrderDTO.cartIdCrm
22
+ }, { headers: { 'Content-Type': 'application/json' } });
23
+ console.log('response', response.data);
24
+ }
25
+ async sendPin(phone, store) {
26
+ const response = await this.axiosInstance.post("/api/crm-bonus/send-pin", { celular: phone, nome: "giftback" }, { headers: { store } });
27
+ return {
28
+ storeId: response.data.store_id,
29
+ userId: response.data.user_id
30
+ };
31
+ }
32
+ async validatePinBonus(payload, store) {
33
+ console.log('[validatePinBonus]', payload);
34
+ const response = await this.axiosInstance.post("/api/crm-bonus/process-pin-bonus", payload, { headers: { store } });
35
+ return response.data;
36
+ }
37
+ async reserve(payload, store) {
38
+ const response = await this.axiosInstance.post("/api/crm-bonus/redeem-bonus", payload, { headers: { store } });
39
+ return response.data;
40
+ }
41
+ }
42
+ //# sourceMappingURL=crmbonus.service.js.map
@@ -0,0 +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,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,CA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inSent } 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}"]}
@@ -0,0 +1,4 @@
1
+ export function format(first, middle, last) {
2
+ return (first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : '');
3
+ }
4
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/utils/utils.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,MAAM,CAAC,KAAc,EAAE,MAAe,EAAE,IAAa;IACnE,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACjF,CAAC","sourcesContent":["export function format(first?: string, middle?: string, last?: string): string {\n return (first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : '');\n}\n"]}
@@ -0,0 +1,8 @@
1
+ import { A as AppModal$1, d as defineCustomElement$1 } from './p-e816fb90.js';
2
+
3
+ const AppModal = AppModal$1;
4
+ const defineCustomElement = defineCustomElement$1;
5
+
6
+ export { AppModal, defineCustomElement };
7
+
8
+ //# sourceMappingURL=app-modal.js.map
@@ -0,0 +1 @@
1
+ {"file":"app-modal.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
@@ -0,0 +1,8 @@
1
+ import { C as CrmBonusForm$1, d as defineCustomElement$1 } from './p-878ce0aa.js';
2
+
3
+ const CrmBonusForm = CrmBonusForm$1;
4
+ const defineCustomElement = defineCustomElement$1;
5
+
6
+ export { CrmBonusForm, defineCustomElement };
7
+
8
+ //# sourceMappingURL=crm-bonus-form.js.map
@@ -0,0 +1 @@
1
+ {"file":"crm-bonus-form.js","mappings":";;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
@@ -0,0 +1,126 @@
1
+ import { p as proxyCustomElement, H, h } from './p-faf7103e.js';
2
+ import { C as CrmBonusService } from './p-374de9ae.js';
3
+ import { d as defineCustomElement$9 } from './p-e816fb90.js';
4
+ import { d as defineCustomElement$8 } from './p-878ce0aa.js';
5
+ import { d as defineCustomElement$7 } from './p-cbade307.js';
6
+ import { d as defineCustomElement$6 } from './p-6442ffce.js';
7
+ import { d as defineCustomElement$5 } from './p-462c12d8.js';
8
+ import { d as defineCustomElement$4 } from './p-cb5a1fdf.js';
9
+ import { d as defineCustomElement$3 } from './p-8fcf8924.js';
10
+ import { d as defineCustomElement$2 } from './p-e40cf14d.js';
11
+
12
+ const logoSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHZpZXdCb3g9IjAgMCA3MDMgMTAzIiBmaWxsPSJub25lIiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1pZCBtZWV0IiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02ODkuMiA1Ny41MDA0TDY0Ny4xIDk5LjYwMDRMNjM3LjMgODkuODAwNEw2NzkuNCA0Ny43MDA0SDYzNlYzMy45MDA0SDY5NUM2OTYuOSAzMy45MDA0IDY5OC41IDM0LjUwMDQgNjk5LjcgMzUuNTAwNEM3MDAgMzUuNzAwNCA3MDAuMiAzNS45MDA0IDcwMC40IDM2LjEwMDRDNzAwLjYgMzYuMzAwNCA3MDAuOCAzNi41MDA0IDcwMC45IDM2LjcwMDRWMzYuODAwNFYzNi45MDA0QzcwMiAzOC4xMDA0IDcwMi43IDM5LjgwMDQgNzAyLjcgNDEuODAwNFY0My42MDA0VjY3LjAwMDRWMTAwLjdINjg4LjlWODAuODAwNFY1Ny41MDA0SDY4OS4yWiIgZmlsbD0idXJsKCNwYWludDBfbGluZWFyXzE2MjlfMTg4KSI+PC9wYXRoPgo8cGF0aCBkPSJNNTIuNyA3Ni40OTk4SDY3LjdDNjUuMyA5MS43OTk4IDUxLjkgMTAyLjUgMzUuMiAxMDIuNUMxNS4yIDEwMi41IDAgODcuMjk5OCAwIDY3LjM5OThDMCA0Ny42OTk4IDE1LjIgMzIuMjk5OCAzNS4yIDMyLjI5OThDNTEuO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webkit-center;margin-bottom:20px}";
15
+ const CrmBonusStyle0 = crmBonusCss;
16
+
17
+ const CrmBonus$1 = /*@__PURE__*/ proxyCustomElement(class CrmBonus extends H {
18
+ constructor() {
19
+ super();
20
+ this.__registerHost();
21
+ this.__attachShadow();
22
+ this.crmBonusService = new CrmBonusService();
23
+ this.showModal = false;
24
+ this.userId = undefined;
25
+ this.storeName = undefined;
26
+ this.productsInString = undefined;
27
+ this.cartId = undefined;
28
+ this.products = undefined;
29
+ this.customer = undefined;
30
+ }
31
+ async componentWillLoad() {
32
+ await this.handleLoad();
33
+ }
34
+ async handleLoad() {
35
+ try {
36
+ if (this.userId) {
37
+ this.customer = await this.crmBonusService.getCustomer(this.userId, this.storeName);
38
+ console.log('user', this.customer);
39
+ }
40
+ }
41
+ catch (error) {
42
+ console.log('info customer');
43
+ }
44
+ this.products = JSON.parse(this.productsInString);
45
+ }
46
+ buildProducts() {
47
+ return this.products.map(product => ({ sku: product.SKU, value: (product.PrecoPor * product.Quantidade), variantId: product.ProdutoVarianteId, qtd: product.Quantidade }));
48
+ }
49
+ handleCloseModal() {
50
+ this.showModal = false;
51
+ }
52
+ render() {
53
+ return (h("div", { key: 'c9db6de8e4503b454fd69302ec52808ed4d46812', class: "section-crm" }, h("div", { key: '4dcfd2946439206652ca8668ca37bbe35d5e0e2d', class: "container-button" }, h("img", { key: '07391e65e467aaebf1f1fabdc0d7dcf3fc1d5182', src: logoSvg, onClick: () => (this.showModal = true) })), h("app-modal", { key: '8aa6c41f5faf07e6389a755faed661803b689cd5', isOpen: this.showModal, modalTitle: `Giftback`, onModalClosed: () => (this.showModal = false) }, h("crm-bonus-form", { key: 'e5903b6dd43617e619230490a23ffaaf5d77c9c6', cancel: () => this.handleCloseModal(), storeName: this.storeName, products: this.buildProducts(), cartId: this.cartId, customer: this.customer }))));
54
+ }
55
+ static get assetsDirs() { return ["assets"]; }
56
+ static get style() { return CrmBonusStyle0; }
57
+ }, [1, "crm-bonus", {
58
+ "userId": [2, "userid"],
59
+ "storeName": [8, "storename"],
60
+ "productsInString": [1, "products"],
61
+ "cartId": [8, "cartid"],
62
+ "showModal": [32],
63
+ "products": [32],
64
+ "customer": [32]
65
+ }]);
66
+ function defineCustomElement$1() {
67
+ if (typeof customElements === "undefined") {
68
+ return;
69
+ }
70
+ const components = ["crm-bonus", "app-modal", "crm-bonus-form", "giftback-finish", "giftback-pin", "giftback-progress", "loading-spinner", "phone-input", "phone-input-mask"];
71
+ components.forEach(tagName => { switch (tagName) {
72
+ case "crm-bonus":
73
+ if (!customElements.get(tagName)) {
74
+ customElements.define(tagName, CrmBonus$1);
75
+ }
76
+ break;
77
+ case "app-modal":
78
+ if (!customElements.get(tagName)) {
79
+ defineCustomElement$9();
80
+ }
81
+ break;
82
+ case "crm-bonus-form":
83
+ if (!customElements.get(tagName)) {
84
+ defineCustomElement$8();
85
+ }
86
+ break;
87
+ case "giftback-finish":
88
+ if (!customElements.get(tagName)) {
89
+ defineCustomElement$7();
90
+ }
91
+ break;
92
+ case "giftback-pin":
93
+ if (!customElements.get(tagName)) {
94
+ defineCustomElement$6();
95
+ }
96
+ break;
97
+ case "giftback-progress":
98
+ if (!customElements.get(tagName)) {
99
+ defineCustomElement$5();
100
+ }
101
+ break;
102
+ case "loading-spinner":
103
+ if (!customElements.get(tagName)) {
104
+ defineCustomElement$4();
105
+ }
106
+ break;
107
+ case "phone-input":
108
+ if (!customElements.get(tagName)) {
109
+ defineCustomElement$3();
110
+ }
111
+ break;
112
+ case "phone-input-mask":
113
+ if (!customElements.get(tagName)) {
114
+ defineCustomElement$2();
115
+ }
116
+ break;
117
+ } });
118
+ }
119
+ defineCustomElement$1();
120
+
121
+ const CrmBonus = CrmBonus$1;
122
+ const defineCustomElement = defineCustomElement$1;
123
+
124
+ export { CrmBonus, defineCustomElement };
125
+
126
+ //# sourceMappingURL=crm-bonus.js.map