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,155 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-52d8a075.js');
6
+
7
+ const successSvgrepoComSvg = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pg0KPCEtLSBVcGxvYWRlZCB0bzogU1ZHIFJlcG8sIHd3dy5zdmdyZXBvLmNvbSwgR2VuZXJhdG9yOiBTVkcgUmVwbyBNaXhlciBUb29scyAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiANCgkgdmlld0JveD0iMCAwIDUwIDUwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxjaXJjbGUgc3R5bGU9ImZpbGw6IzI1QUU4ODsiIGN4PSIyNSIgY3k9IjI1IiByPSIyNSIvPg0KPHBvbHlsaW5lIHN0eWxlPSJmaWxsOm5vbmU7c3Ryb2tlOiNGRkZGRkY7c3Ryb2tlLXdpZHRoOjI7c3Ryb2tlLWxpbmVjYXA6cm91bmQ7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjEwOyIgcG9pbnRzPSINCgkzOCwxNSAyMiwzMyAxMiwyNSAiLz4NCjwvc3ZnPg==';
8
+
9
+ const giftbackFinishCss = ".message-finish{align-content:center;text-align:center}.message-finish p{color:#777676;font-size:xx-large;font-family:sans-serif}";
10
+ const GiftbackFinishStyle0 = giftbackFinishCss;
11
+
12
+ const GiftbackFinish = class {
13
+ constructor(hostRef) {
14
+ index.registerInstance(this, hostRef);
15
+ }
16
+ render() {
17
+ return (index.h("div", { key: 'e72f82799146a6e94acbdd62324e07cdf9f77009', class: "message-finish" }, index.h("img", { key: '46e2436a3dbe4745225c3b9674e6bf6c299ad63e', src: successSvgrepoComSvg, width: 80 }), index.h("p", { key: '270e42050956f7f3d1ae9b90f314211fa310f797' }, "Legal! O B\u00F4nus ser\u00E1 aplicado na sua compra.")));
18
+ }
19
+ };
20
+ GiftbackFinish.style = GiftbackFinishStyle0;
21
+
22
+ const giftbackPinCss = ":host{display:block;font-family:Arial, sans-serif}.form-container-pin{display:flex;flex-direction:column;align-items:center}.pin-container{display:flex;gap:10px;margin:26px 0}input{width:58px;height:40px;font-size:18px;text-align:center;border:1px solid #ccc;border-radius:5px}button{padding:10px 20px;background-color:#ddd;border:none;border-radius:5px;cursor:pointer}button:hover{background-color:#bbb}.success{color:green;margin-top:10px}.button{top:50%;background-color:#6c6c7e;color:#fff;border:none;border-radius:10px;padding:15px;min-height:30px;min-width:120px;font-size:20px;cursor:pointer}.button-cancel{top:50%;background-color:#ffffff;color:#1e1c1c;border:1px solid gray;border-radius:10px;padding:10px;min-height:30px;min-width:120px;font-size:19px;cursor:pointer}.footer-button{display:flex;justify-content:space-between;width:100%}";
23
+ const GiftbackPinStyle0 = giftbackPinCss;
24
+
25
+ const GiftbackPin = class {
26
+ constructor(hostRef) {
27
+ index.registerInstance(this, hostRef);
28
+ this.sent = undefined;
29
+ this.validate = undefined;
30
+ this.cancel = undefined;
31
+ this.pin = ['', '', '', ''];
32
+ this.isVerified = false;
33
+ this.loading = false;
34
+ }
35
+ handleInput(event, index) {
36
+ const input = event.target;
37
+ const value = input.value.slice(0, 1); // Limitar a um único dígito
38
+ this.pin[index] = value;
39
+ // Focar no próximo campo, se possível
40
+ if (value && index < this.pin.length - 1) {
41
+ const nextInput = input.nextElementSibling;
42
+ nextInput === null || nextInput === void 0 ? void 0 : nextInput.focus();
43
+ }
44
+ this.pin = [...this.pin];
45
+ }
46
+ validatePin() {
47
+ console.log('this.pin', this.pin);
48
+ this.validate(this.pin.join(""));
49
+ }
50
+ verifyPin() {
51
+ const pinCode = this.pin.join('');
52
+ if (pinCode === '9999') {
53
+ this.isVerified = true;
54
+ }
55
+ }
56
+ render() {
57
+ return (index.h("div", { key: '7fe6a9f55ca436ecfcc20f106c1efeddd8387490', class: "form-container-pin" }, index.h("div", { key: 'aece84fab5ecf94ce5ca90fd1912623dd3c1b9b8' }, index.h("p", { key: '5134dd8eb3478f59dcfcdca6612e885b76578cba' }, "Insira o PIN de 4 d\u00EDgitos enviado por SMS."), index.h("div", { key: '8855be06a09925746a5b18323726dd67ec73d7c3', class: "pin-container" }, this.pin.map((_, index$1) => (index.h("input", { type: "text", maxLength: 1, value: this.pin[index$1], onInput: (event) => this.handleInput(event, index$1) }))))), index.h("div", { key: '1c5523feb6c9dafbfddd5388170de5fea7627f62', class: "footer-button" }, index.h("button", { key: '8506cd68998d4ecb76f8a8a262373605a06827de', class: "button-cancel", disabled: this.loading, onClick: () => this.cancel() }, "Cancelar"), index.h("button", { key: '4dda0af894ad5849ba27d3a4f6c15c80d6c984ae', class: `button ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.validatePin() }, !this.loading ? "Enviar" : index.h("loading-spinner", { size: "15px", color: "#fff" })))));
58
+ }
59
+ };
60
+ GiftbackPin.style = GiftbackPinStyle0;
61
+
62
+ const giftbackProgressCss = ":host{display:flex;font-family:Arial, sans-serif;border-radius:10px;padding:16px;max-width:100%;flex-direction:column}.giftback-container{display:flex;flex-direction:column}.giftback-container p{font-size:medium}h3{margin:0 0 10px;font-size:18px}p{margin:5px 0;font-size:14px;align-self:start}.validity{font-size:12px;color:#888}.progress-container{display:flex;align-items:center;margin:10px 0}progress-container span{font-size:12px;color:#666}input[type='range']{flex:1;margin:0 10px;appearance:none;background-color:#ccc;height:6px;border-radius:3px;outline:none;cursor:pointer}input[type='range']::-webkit-slider-thumb{appearance:none;width:14px;height:14px;border-radius:50%;background-color:#555;cursor:pointer}.remaining{font-weight:bold;font-size:14px;color:#333}.button{top:50%;background-color:#6c6c7e;color:#fff;border:none;border-radius:10px;padding:10px;min-height:30px;min-width:120px;font-size:19px;cursor:pointer}.button-cancel{top:50%;background-color:#ffffff;color:#1e1c1c;border:1px solid gray;border-radius:10px;padding:10px;min-height:30px;min-width:120px;font-size:19px;cursor:pointer}.disabled{opacity:0.6;cursor:not-allowed}.footer-button-giftback{display:flex;justify-content:space-between;margin-top:14px}";
63
+ const GiftbackProgressStyle0 = giftbackProgressCss;
64
+
65
+ const GiftbackProgress = class {
66
+ constructor(hostRef) {
67
+ index.registerInstance(this, hostRef);
68
+ this.usedValue = 0;
69
+ this.loading = false;
70
+ this.bonus = {
71
+ totalBonus: 0,
72
+ cartId: "",
73
+ minimumPurchase: 0,
74
+ bonusBalance: 0,
75
+ calculatedValue: 0,
76
+ firstValidityDate: ""
77
+ };
78
+ this.reserve = undefined;
79
+ this.cancel = undefined;
80
+ }
81
+ componentWillLoad() {
82
+ this.usedValue = parseFloat(this.bonus.bonusBalance.toString());
83
+ }
84
+ handleSliderChange(event) {
85
+ const input = event.target;
86
+ this.usedValue = parseFloat(input.value);
87
+ }
88
+ async handleReserve() {
89
+ this.reserve(this.usedValue);
90
+ }
91
+ render() {
92
+ const remainingGiftback = this.bonus.minimumPurchase - this.bonus.totalValue;
93
+ return (index.h("div", { key: '0949784aa871d4e5a1e3fd5e68f24abd92f9b4f9', class: "giftback-container" }, index.h("p", { key: '129a7c66ec49abe6d1cf2e93ad8be39030807ce0' }, "Voc\u00EA possui at\u00E9 ", index.h("strong", { key: '4872e8b42cc25c9339004f5fa7518a269894cc04' }, "R$ ", this.bonus.totalBonus.toFixed(2)), " de Giftback nessa compra!"), index.h("p", { key: 'd47e314d9f597a2a44a43d353f76f4382e77657d', class: "validity" }, "V\u00E1lido at\u00E9: ", new Date(this.bonus.firstValidityDate).toLocaleDateString('pt-Br')), index.h("p", { key: '8f3cb7e066eacf5073c5154c3c418fad05b66b67' }, "Voc\u00EA est\u00E1 utilizando ", index.h("strong", { key: 'aff6a1a0c1be96396640d35cb1429f8e2ece2f1e' }, "R$ ", this.usedValue.toFixed(2)), " nessa compra"), index.h("div", { key: 'ab8b39df640a1ad036209410cbcda37caf8b6825', class: "progress-container" }, index.h("span", { key: 'adc4ee7e73575394b2e19e70440cc86474033011' }, "R$ 0"), index.h("input", { key: '2b80b3ac24e278e002c68fa25449416791e36b9c', disabled: true, type: "range", min: "0", step: "0.01", max: this.bonus.totalBonus, value: this.usedValue, onInput: (event) => this.handleSliderChange(event) }), index.h("span", { key: '74453f038dcac7a8755edfc9d13f5b0908f5f484' }, "R$ ", this.bonus.totalBonus.toFixed(2))), index.h("p", { key: 'c48bc53e9eb4213ddc2580c968b9f170a6805b9c', class: "remaining" }, "Faltam ", index.h("strong", { key: 'd0e91b9121c82ff8051910180496503581f6e498' }, "R$ ", remainingGiftback > 0 ? remainingGiftback.toFixed(2) : Number(0).toFixed(2)), " para utilizar o valor total do Giftback."), index.h("div", { key: 'd87e4ade049fc1ad8cc4094ab4d1482edea2d9f7', class: "footer-button-giftback" }, index.h("button", { key: '49ed40adb615dfedcf97ca369d82275e1037b078', class: "button-cancel", disabled: this.loading, onClick: () => this.cancel() }, "Cancelar"), index.h("button", { key: '5cba6462515c0b9995660bd5974da88b2c90bdda', class: `button ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.handleReserve() }, !this.loading ? "Aplicar" : index.h("loading-spinner", { size: "10px", color: "#fff" })))));
94
+ }
95
+ };
96
+ GiftbackProgress.style = GiftbackProgressStyle0;
97
+
98
+ const PhoneInput = class {
99
+ constructor(hostRef) {
100
+ index.registerInstance(this, hostRef);
101
+ this.sendPin = undefined;
102
+ this.loading = undefined;
103
+ this.value = undefined;
104
+ }
105
+ async validatePhone() {
106
+ const phone = await this.phoneInputMask.getPhone();
107
+ await this.sendPin(phone);
108
+ }
109
+ render() {
110
+ return (index.h("div", { key: '8deb65295383b9a14e1ac5c3050ce2cab709c208', class: "form-container" }, index.h("phone-input-mask", { key: 'd5c9b2fb84b166c67fdfa653f4d0194818d7ae54', initialValue: this.value, ref: ref => this.phoneInputMask = ref }), index.h("button", { key: '666403560be459bd387d743936b4de1d0cb29ade', class: `button ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.validatePhone() }, !this.loading ? "validar" : index.h("loading-spinner", { size: "25px", color: "#fff" }))));
111
+ }
112
+ };
113
+
114
+ const phoneInputMaskCss = ".inline-text-field-container{display:flex;flex-direction:column}@supports (top: max(0%)){.mdc-text-field--outlined{padding-right:max(16px, var(--mdc-shape-small, 4px))}}@supports (top: max(0%)){.mdc-text-field--outlined{padding-left:max(16px, calc(var(--mdc-shape-small, 4px) + 4px))}}.mdc-text-field--outlined{height:55px;overflow:visible}.phone{width:300px;height:50px;font-size:18px;padding:10px;color:grey;border:1px solid #d3c6c6;outline:none}.mdc-text-field{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:0;border-bottom-left-radius:0;display:inline-flex;align-items:baseline;padding:0 16px;position:relative;box-sizing:border-box;overflow:hidden;will-change:opacity, transform, color}";
115
+ const PhoneInputMaskStyle0 = phoneInputMaskCss;
116
+
117
+ const PhoneInputMask = class {
118
+ constructor(hostRef) {
119
+ index.registerInstance(this, hostRef);
120
+ this.phone = '';
121
+ this.initialValue = undefined;
122
+ }
123
+ componentWillLoad() {
124
+ this.phone = this.initialValue;
125
+ }
126
+ formatPhone(value) {
127
+ const cleaned = value.replace(/\D/g, ''); // Remove tudo que não for número
128
+ const match = cleaned.match(/^(\d{0,2})(\d{0,5})(\d{0,4})$/);
129
+ if (!match)
130
+ return value;
131
+ const part1 = match[1] ? `(${match[1]}` : '';
132
+ const part2 = match[2] ? `) ${match[2]}` : '';
133
+ const part3 = match[3] ? `-${match[3]}` : '';
134
+ return `${part1}${part2}${part3}`;
135
+ }
136
+ handleInput(event) {
137
+ const input = event.target;
138
+ this.phone = this.formatPhone(input.value);
139
+ }
140
+ async getPhone() {
141
+ return this.phone;
142
+ }
143
+ render() {
144
+ return (index.h("input", { key: 'eb90a08eb68463fb8dcb81e22d45621b8b59c754', id: "phone", type: "tel", class: "phone", value: this.phone, onInput: (event) => this.handleInput(event), placeholder: "(12) 94567-8910" }));
145
+ }
146
+ };
147
+ PhoneInputMask.style = PhoneInputMaskStyle0;
148
+
149
+ exports.giftback_finish = GiftbackFinish;
150
+ exports.giftback_pin = GiftbackPin;
151
+ exports.giftback_progress = GiftbackProgress;
152
+ exports.phone_input = PhoneInput;
153
+ exports.phone_input_mask = PhoneInputMask;
154
+
155
+ //# sourceMappingURL=giftback-finish_5.cjs.entry.js.map
@@ -0,0 +1 @@
1
+ {"file":"giftback-finish.giftback-pin.giftback-progress.phone-input.phone-input-mask.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,oBAAoB,GAAG,4rBAA4rB;;ACAztB,MAAM,iBAAiB,GAAG,mIAAmI,CAAC;AAC9J,6BAAe,iBAAiB;;MCOnB,cAAc;;;;IACvB,MAAM;QACF,QACIA,kEAAK,KAAK,EAAC,gBAAgB,IACvBA,kEAAK,GAAG,EAAEC,oBAAO,EAAE,KAAK,EAAE,EAAE,GAAI,EAChCD,0HAAkD,CAChD,EACT;KACJ;;;;AChBL,MAAM,cAAc,GAAG,g1BAAg1B,CAAC;AACx2B,0BAAe,cAAc;;MCOhB,WAAW;;;;;;mBAMK,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;0BACV,KAAK;uBAET,KAAK;;IAEhC,WAAW,CAAC,KAAY,EAAE,KAAa;QACnC,MAAM,KAAK,GAAG,KAAK,CAAC,MAA0B,CAAC;QAC/C,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACtC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;;QAGxB,IAAI,KAAK,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE;YACtC,MAAM,SAAS,GAAG,KAAK,CAAC,kBAAsC,CAAC;YAC/D,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,KAAK,EAAE,CAAC;SACtB;QAED,IAAI,CAAC,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;KAC5B;IAED,WAAW;QACP,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;QAClC,IAAI,CAAC,QAAQ,CAAC,IAAI,C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EAAC,OAAO,EACV,IAAI,EAAC,KAAK,EACV,KAAK,EAAC,OAAO,EACb,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,OAAO,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,EAC3C,WAAW,EAAC,iBAAiB,GAC/B,EACJ;KACL;;;;;;;;;;","names":["h","success","index"],"sources":["src/components/crm-bonus/assets/svg/success-svgrepo-com.svg","src/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.css?tag=giftback-finish&encapsulation=shadow","src/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.tsx","src/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.css?tag=giftback-pin&encapsulation=shadow","src/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.tsx","src/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.css?tag=giftback-progress&encapsulation=shadow","src/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.tsx","src/components/crm-bonus-form/subcomponents/phone/phone.input.tsx","src/components/phone/phone-input-mask.css?tag=phone-input-mask&encapsulation=shadow","src/components/phone/phone-input-mask.tsx"],"sourcesContent":["<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\r\n<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->\r\n<svg version=\"1.1\" id=\"Capa_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" \r\n\t viewBox=\"0 0 50 50\" xml:space=\"preserve\">\r\n<circle style=\"fill:#25AE88;\" cx=\"25\" cy=\"25\" r=\"25\"/>\r\n<polyline style=\"fill:none;stroke:#FFFFFF;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;\" points=\"\r\n\t38,15 22,33 12,25 \"/>\r\n</svg>",".message-finish {\n align-content: center;\n text-align: center;\n}\n\n.message-finish p {\n color: #777676;\n font-size: xx-large;\n font-family: sans-serif;\n}","import { Component, h } from \"@stencil/core\";\nimport success from '../../../crm-bonus/assets/svg/success-svgrepo-com.svg'\n\n@Component({\n tag: 'giftback-finish',\n styleUrl: 'giftback-finish.css',\n shadow: true\n})\nexport class GiftbackFinish {\n render() {\n return (\n <div class=\"message-finish\">\n <img src={success} width={80} />\n <p>Legal! O Bônus será aplicado na sua compra.</p>\n </div>\n )\n }\n}",":host {\n display: block;\n font-family: Arial, sans-serif;\n}\n\n.form-container-pin {\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n\n.pin-container {\n display: flex;\n gap: 10px;\n margin: 26px 0;\n}\n\ninput {\n width: 58px;\n height: 40px;\n font-size: 18px;\n text-align: center;\n border: 1px solid #ccc;\n border-radius: 5px;\n}\n\nbutton {\n padding: 10px 20px;\n background-color: #ddd;\n border: none;\n border-radius: 5px;\n cursor: pointer;\n}\n\nbutton:hover {\n background-color: #bbb;\n}\n\n.success {\n color: green;\n margin-top: 10px;\n}\n\n.button {\n top: 50%;\n background-color: #6c6c7e;\n color: #fff;\n border: none;\n border-radius: 10px;\n padding: 15px;\n min-height: 30px;\n min-width: 120px;\n font-size: 20px;\n cursor: pointer;\n}\n\n.button-cancel {\n top: 50%;\n background-color: #ffffff;\n color: #1e1c1c;\n border: 1px solid gray;\n border-radius: 10px;\n padding: 10px;\n min-height: 30px;\n min-width: 120px;\n font-size: 19px;\n cursor: pointer;\n}\n\n.footer-button {\n display: flex;\n justify-content: space-between;\n width: 100%;\n}","import { Component, h, Prop, State } from '@stencil/core';\nimport { IPinSent } from '../../../../dto/pin.sent';\n\n@Component({\n tag: 'giftback-pin',\n styleUrl: 'giftback-pin.css',\n shadow: true,\n})\nexport class GiftbackPin {\n\n @Prop() sent: IPinSent;\n @Prop() validate: (pin: string) => void;\n @Prop() cancel: () => void;\n\n @State() pin: string[] = ['', '', '', ''];\n @State() isVerified: boolean = false;\n\n @Prop() loading: boolean = false;\n\n handleInput(event: Event, index: number) {\n const input = event.target as HTMLInputElement;\n const value = input.value.slice(0, 1); // Limitar a um único dígito\n this.pin[index] = value;\n\n // Focar no próximo campo, se possível\n if (value && index < this.pin.length - 1) {\n const nextInput = input.nextElementSibling as HTMLInputElement;\n nextInput?.focus();\n }\n\n this.pin = [...this.pin];\n }\n\n validatePin() {\n console.log('this.pin', this.pin);\n this.validate(this.pin.join(\"\"))\n }\n\n verifyPin() {\n const pinCode = this.pin.join('');\n if (pinCode === '9999') {\n this.isVerified = true;\n }\n }\n\n render() {\n return (\n <div class=\"form-container-pin\">\n <div >\n <p>Insira o PIN de 4 dígitos enviado por SMS.</p>\n <div class=\"pin-container\">\n {this.pin.map((_, index) => (\n <input\n type=\"text\"\n maxLength={1}\n value={this.pin[index]}\n onInput={(event) => this.handleInput(event, index)}\n />\n ))}\n </div>\n </div>\n\n <div class=\"footer-button\">\n <button class=\"button-cancel\" disabled={this.loading} onClick={() => this.cancel()}>\n Cancelar\n </button>\n <button class={`button ${this.loading ? 'disabled' : ''} `} disabled={this.loading} onClick={() => this.validatePin()}>\n {\n !this.loading ? \"Enviar\" : <loading-spinner size=\"15px\" color=\"#fff\" />\n }\n </button>\n </div>\n {/* <button onClick={() => this.verifyPin()}>Enviar</button>\n {this.isVerified && <p class=\"success\">Código verificado com sucesso!</p>} */}\n </div>\n );\n }\n}\n",":host {\n display: flex;\n font-family: Arial, sans-serif;\n /* background-color: #f8f4eb; */\n border-radius: 10px;\n padding: 16px;\n /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); */\n max-width: 100%;\n flex-direction: column;\n}\n\n.giftback-container {\n display: flex;\n flex-direction: column;\n}\n\n.giftback-container p {\n font-size: medium;\n}\n\nh3 {\n margin: 0 0 10px;\n font-size: 18px;\n}\n\np {\n margin: 5px 0;\n font-size: 14px;\n align-self: start;\n}\n\n.validity {\n font-size: 12px;\n color: #888;\n}\n\n.progress-container {\n display: flex;\n align-items: center;\n margin: 10px 0;\n}\n\nprogress-container span {\n font-size: 12px;\n color: #666;\n}\n\ninput[type='range'] {\n flex: 1;\n margin: 0 10px;\n appearance: none;\n background-color: #ccc;\n height: 6px;\n border-radius: 3px;\n outline: none;\n cursor: pointer;\n}\n\ninput[type='range']::-webkit-slider-thumb {\n appearance: none;\n width: 14px;\n height: 14px;\n border-radius: 50%;\n background-color: #555;\n cursor: pointer;\n}\n\n.remaining {\n font-weight: bold;\n font-size: 14px;\n color: #333;\n}\n\n.button {\n top: 50%;\n background-color: #6c6c7e;\n color: #fff;\n border: none;\n border-radius: 10px;\n padding: 10px;\n min-height: 30px;\n min-width: 120px;\n font-size: 19px;\n cursor: pointer;\n}\n\n.button-cancel {\n top: 50%;\n background-color: #ffffff;\n color: #1e1c1c;\n border: 1px solid gray;\n border-radius: 10px;\n padding: 10px;\n min-height: 30px;\n min-width: 120px;\n font-size: 19px;\n cursor: pointer;\n}\n\n.disabled {\n opacity: 0.6;\n cursor: not-allowed;\n}\n\n.footer-button-giftback {\n display: flex;\n justify-content: space-between;\n margin-top: 14px;\n}","import { Component, h, State, Prop } from '@stencil/core';\nimport { IBonus } from '../../../../dto/validate.pin.bonus';\n\n@Component({\n tag: 'giftback-progress',\n styleUrl: 'giftback-progress.css',\n shadow: true,\n})\nexport class GiftbackProgress {\n @State() usedValue: number = 0;\n\n @Prop() loading: boolean = false;\n\n @Prop() bonus: Partial<IBonus> = {\n totalBonus: 0,\n cartId: \"\",\n minimumPurchase: 0,\n bonusBalance: 0,\n calculatedValue: 0,\n firstValidityDate: \"\"\n };\n\n @Prop() reserve: (amountRedeemed: number) => void;\n @Prop() cancel: () => void;\n\n componentWillLoad() {\n this.usedValue = parseFloat(this.bonus.bonusBalance.toString());\n }\n\n handleSliderChange(event: Event) {\n const input = event.target as HTMLInputElement;\n this.usedValue = parseFloat(input.value);\n }\n\n async handleReserve() {\n this.reserve(this.usedValue);\n }\n\n render() {\n const remainingGiftback = this.bonus.minimumPurchase - this.bonus.totalValue;\n\n return (\n <div class=\"giftback-container\">\n <p>\n Você possui até <strong>R$ {this.bonus.totalBonus.toFixed(2)}</strong> de Giftback nessa compra!\n </p>\n <p class=\"validity\">Válido até: {new Date(this.bonus.firstValidityDate).toLocaleDateString('pt-Br')}</p>\n\n <p>Você está utilizando <strong>R$ {this.usedValue.toFixed(2)}</strong> nessa compra</p>\n\n <div class=\"progress-container\">\n <span>R$ 0</span>\n <input\n disabled\n type=\"range\"\n min=\"0\"\n step=\"0.01\"\n max={this.bonus.totalBonus}\n value={this.usedValue}\n onInput={(event) => this.handleSliderChange(event)}\n />\n <span>R$ {this.bonus.totalBonus.toFixed(2)}</span>\n </div>\n\n <p class=\"remaining\">\n Faltam <strong>R$ {remainingGiftback > 0 ? remainingGiftback.toFixed(2) : Number(0).toFixed(2)}</strong> para utilizar o valor total do Giftback.\n </p>\n\n <div class=\"footer-button-giftback\">\n\n <button class=\"button-cancel\" disabled={this.loading} onClick={() => this.cancel()}>\n Cancelar\n </button>\n\n <button class={`button ${this.loading ? 'disabled' : ''} `} disabled={this.loading} onClick={() => this.handleReserve()}>\n {\n !this.loading ? \"Aplicar\" : <loading-spinner size=\"10px\" color=\"#fff\" />\n }\n </button>\n </div>\n </div>\n );\n }\n}\n","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={`button ${this.loading ? 'disabled' : ''} `} disabled={this.loading} onClick={() => this.validatePhone()}>\n {\n !this.loading ? \"validar\" : <loading-spinner size=\"25px\" color=\"#fff\" />\n }\n </button>\n </div>\n )\n }\n}",".inline-text-field-container {\n display: flex;\n flex-direction: column;\n}\n\n@supports (top: max(0%)) {\n .mdc-text-field--outlined {\n padding-right: max(16px, var(--mdc-shape-small, 4px));\n }\n}\n\n@supports (top: max(0%)) {\n .mdc-text-field--outlined {\n padding-left: max(16px, calc(var(--mdc-shape-small, 4px) + 4px));\n }\n}\n\n.mdc-text-field--outlined {\n height: 55px;\n overflow: visible;\n}\n\n.phone {\n width: 300px;\n height: 50px;\n font-size: 18px;\n padding: 10px;\n color: grey;\n border: 1px solid #d3c6c6;\n outline: none;\n}\n\n.mdc-text-field {\n border-top-left-radius: 4px;\n border-top-left-radius: var(--mdc-shape-small, 4px);\n border-top-right-radius: 4px;\n border-top-right-radius: var(--mdc-shape-small, 4px);\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n display: inline-flex;\n align-items: baseline;\n padding: 0 16px;\n position: relative;\n box-sizing: border-box;\n overflow: hidden;\n will-change: opacity, transform, color;\n}","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"],"version":3}