crmbonus-component-wake 2.0.114 → 2.0.116

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 (366) hide show
  1. package/dist/{esm → crmbonus-component-wake}/app-modal.entry.js +2 -3
  2. package/dist/crmbonus-component-wake/app-modal.entry.js.map +1 -0
  3. package/dist/crmbonus-component-wake/cart.helper-2643939f.js +50 -0
  4. package/dist/crmbonus-component-wake/cart.helper-2643939f.js.map +1 -0
  5. package/dist/{components/p-2b3b8d6b.js → crmbonus-component-wake/countdown-timer.entry.js} +7 -27
  6. package/dist/crmbonus-component-wake/countdown-timer.entry.js.map +1 -0
  7. package/dist/{esm → crmbonus-component-wake}/crm-bonus-form.entry.js +3 -4
  8. package/dist/crmbonus-component-wake/{p-147ba861.entry.js.map → crm-bonus-form.entry.js.map} +1 -1
  9. package/dist/{esm → crmbonus-component-wake}/crm-bonus-note.entry.js +22 -18
  10. package/dist/crmbonus-component-wake/crm-bonus-note.entry.js.map +1 -0
  11. package/dist/{esm → crmbonus-component-wake}/crm-bonus.entry.js +45 -53
  12. package/dist/crmbonus-component-wake/crm-bonus.entry.js.map +1 -0
  13. package/dist/crmbonus-component-wake/crm-button.entry.js +20 -0
  14. package/dist/crmbonus-component-wake/crm-button.entry.js.map +1 -0
  15. package/dist/{esm/crm-giftback-form_2.entry.js → crmbonus-component-wake/crm-giftback-form.entry.js} +6 -21
  16. package/dist/{cjs/crm-giftback-form_2.cjs.entry.js.map → crmbonus-component-wake/crm-giftback-form.entry.js.map} +1 -1
  17. package/dist/{components/p-58b97429.js → crmbonus-component-wake/crm-tooltip.entry.js} +8 -27
  18. package/dist/crmbonus-component-wake/crm-tooltip.entry.js.map +1 -0
  19. package/dist/crmbonus-component-wake/crmbonus-component-wake.css +7 -1
  20. package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +48 -1
  21. package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js.map +1 -1
  22. package/dist/{esm/crmbonus.service-774ebe83.js → crmbonus-component-wake/crmbonus.service-047b6b01.js} +169 -95
  23. package/dist/crmbonus-component-wake/crmbonus.service-047b6b01.js.map +1 -0
  24. package/dist/{components/p-b79c86a8.js → crmbonus-component-wake/giftback-finish.entry.js} +8 -25
  25. package/dist/crmbonus-component-wake/giftback-finish.entry.js.map +1 -0
  26. package/dist/{components/p-2671d669.js → crmbonus-component-wake/giftback-info.entry.js} +12 -52
  27. package/dist/crmbonus-component-wake/giftback-info.entry.js.map +1 -0
  28. package/dist/{components/p-6186ddcc.js → crmbonus-component-wake/giftback-pin.entry.js} +8 -38
  29. package/dist/crmbonus-component-wake/giftback-pin.entry.js.map +1 -0
  30. package/dist/{components/p-7c744cca.js → crmbonus-component-wake/giftback-progress.entry.js} +8 -37
  31. package/dist/crmbonus-component-wake/giftback-progress.entry.js.map +1 -0
  32. package/dist/{esm/i18n-e8150dff.js → crmbonus-component-wake/i18n-11138a2c.js} +16 -1
  33. package/dist/{esm/i18n-e8150dff.js.map → crmbonus-component-wake/i18n-11138a2c.js.map} +1 -1
  34. package/dist/crmbonus-component-wake/index-d0fd1dc0.js +3039 -0
  35. package/dist/crmbonus-component-wake/index-d0fd1dc0.js.map +1 -0
  36. package/dist/crmbonus-component-wake/index.esm.js +12 -1
  37. package/dist/crmbonus-component-wake/index.esm.js.map +1 -1
  38. package/dist/crmbonus-component-wake/loading-container.entry.js +18 -0
  39. package/dist/crmbonus-component-wake/loading-container.entry.js.map +1 -0
  40. package/dist/{esm → crmbonus-component-wake}/loading-spinner.entry.js +2 -3
  41. package/dist/crmbonus-component-wake/loading-spinner.entry.js.map +1 -0
  42. package/dist/{components/p-246a3e9d.js → crmbonus-component-wake/name-input.entry.js} +8 -37
  43. package/dist/crmbonus-component-wake/name-input.entry.js.map +1 -0
  44. package/dist/crmbonus-component-wake/pedido-finalizado.entry.js +35 -0
  45. package/dist/crmbonus-component-wake/pedido-finalizado.entry.js.map +1 -0
  46. package/dist/{esm → crmbonus-component-wake}/phone-cancel-input.entry.js +1 -1
  47. package/dist/crmbonus-component-wake/phone-cancel-input.entry.js.map +1 -0
  48. package/dist/{components/p-6c546e48.js → crmbonus-component-wake/phone-form.entry.js} +8 -47
  49. package/dist/crmbonus-component-wake/phone-form.entry.js.map +1 -0
  50. package/dist/{esm → crmbonus-component-wake}/phone-input-mask.entry.js +2 -3
  51. package/dist/crmbonus-component-wake/phone-input-mask.entry.js.map +1 -0
  52. package/dist/{esm → crmbonus-component-wake}/phone-input.entry.js +1 -1
  53. package/dist/crmbonus-component-wake/phone-input.entry.js.map +1 -0
  54. package/dist/{components/p-83a12a8f.js → crmbonus-component-wake/pin-form.entry.js} +9 -56
  55. package/dist/crmbonus-component-wake/pin-form.entry.js.map +1 -0
  56. package/dist/crmbonus-component-wake/shadow-css-7ad5caf8.js +334 -0
  57. package/dist/crmbonus-component-wake/shadow-css-7ad5caf8.js.map +1 -0
  58. package/dist/{collection/utils/utils.js → crmbonus-component-wake/utils-96cf9ae0.js} +8 -5
  59. package/dist/crmbonus-component-wake/utils-96cf9ae0.js.map +1 -0
  60. package/dist/types/components/crm-bonus/crm-bonus.d.ts +5 -8
  61. package/dist/types/components/note/crm-bonus-note.d.ts +5 -4
  62. package/dist/types/components/pedido/pedido.d.ts +2 -3
  63. package/dist/types/components.d.ts +7 -19
  64. package/dist/types/dto/validate.pin.bonus.d.ts +6 -0
  65. package/dist/types/helpers/cart.helper.d.ts +2 -0
  66. package/dist/types/home/darlison/Projects/Bycoders/crmbonus/crmbonus-component/.stencil/env.d.ts +2 -4
  67. package/dist/types/objectvalues/cart.wake.d.ts +12 -0
  68. package/dist/types/services/crmbonus.service.d.ts +1 -1
  69. package/package.json +6 -2
  70. package/dist/cjs/app-globals-3a1e7e63.js +0 -7
  71. package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
  72. package/dist/cjs/app-modal.cjs.entry.js +0 -28
  73. package/dist/cjs/app-modal.cjs.entry.js.map +0 -1
  74. package/dist/cjs/countdown-timer_2.cjs.entry.js +0 -63
  75. package/dist/cjs/countdown-timer_2.cjs.entry.js.map +0 -1
  76. package/dist/cjs/crm-bonus-form.cjs.entry.js +0 -104
  77. package/dist/cjs/crm-bonus-form.cjs.entry.js.map +0 -1
  78. package/dist/cjs/crm-bonus-note.cjs.entry.js +0 -98
  79. package/dist/cjs/crm-bonus-note.cjs.entry.js.map +0 -1
  80. package/dist/cjs/crm-bonus.cjs.entry.js +0 -252
  81. package/dist/cjs/crm-bonus.cjs.entry.js.map +0 -1
  82. package/dist/cjs/crm-giftback-form_2.cjs.entry.js +0 -253
  83. package/dist/cjs/crm-tooltip_4.cjs.entry.js +0 -211
  84. package/dist/cjs/crm-tooltip_4.cjs.entry.js.map +0 -1
  85. package/dist/cjs/crmbonus-component-wake.cjs.js +0 -27
  86. package/dist/cjs/crmbonus-component-wake.cjs.js.map +0 -1
  87. package/dist/cjs/crmbonus.service-b31b7396.js +0 -3874
  88. package/dist/cjs/crmbonus.service-b31b7396.js.map +0 -1
  89. package/dist/cjs/giftback-finish_4.cjs.entry.js +0 -131
  90. package/dist/cjs/giftback-finish_4.cjs.entry.js.map +0 -1
  91. package/dist/cjs/i18n-f2a6f60e.js +0 -2219
  92. package/dist/cjs/i18n-f2a6f60e.js.map +0 -1
  93. package/dist/cjs/index-6054ed44.js +0 -21
  94. package/dist/cjs/index-6054ed44.js.map +0 -1
  95. package/dist/cjs/index-d11684bd.js +0 -1599
  96. package/dist/cjs/index-d11684bd.js.map +0 -1
  97. package/dist/cjs/index.cjs.js +0 -11
  98. package/dist/cjs/index.cjs.js.map +0 -1
  99. package/dist/cjs/info.config.helper-c5d9f781.js +0 -16
  100. package/dist/cjs/info.config.helper-c5d9f781.js.map +0 -1
  101. package/dist/cjs/keys.storage-de7744aa.js +0 -17
  102. package/dist/cjs/keys.storage-de7744aa.js.map +0 -1
  103. package/dist/cjs/loader.cjs.js +0 -17
  104. package/dist/cjs/loader.cjs.js.map +0 -1
  105. package/dist/cjs/loading-spinner.cjs.entry.js +0 -24
  106. package/dist/cjs/loading-spinner.cjs.entry.js.map +0 -1
  107. package/dist/cjs/pedido-finalizado.cjs.entry.js +0 -36
  108. package/dist/cjs/pedido-finalizado.cjs.entry.js.map +0 -1
  109. package/dist/cjs/phone-cancel-input.cjs.entry.js +0 -25
  110. package/dist/cjs/phone-cancel-input.cjs.entry.js.map +0 -1
  111. package/dist/cjs/phone-input-mask.cjs.entry.js +0 -61
  112. package/dist/cjs/phone-input-mask.cjs.entry.js.map +0 -1
  113. package/dist/cjs/phone-input.cjs.entry.js +0 -25
  114. package/dist/cjs/phone-input.cjs.entry.js.map +0 -1
  115. package/dist/cjs/utils-e9413ee3.js +0 -25
  116. package/dist/cjs/utils-e9413ee3.js.map +0 -1
  117. package/dist/collection/assets/svg/info-circle-svgrepo-com.svg +0 -6
  118. package/dist/collection/assets/svg/money-dollars-svgrepo-com.svg +0 -6
  119. package/dist/collection/collection-manifest.json +0 -32
  120. package/dist/collection/components/button/crm-button.css +0 -22
  121. package/dist/collection/components/button/index.js +0 -76
  122. package/dist/collection/components/button/index.js.map +0 -1
  123. package/dist/collection/components/countdown-timer/countdown-timer.js +0 -81
  124. package/dist/collection/components/countdown-timer/countdown-timer.js.map +0 -1
  125. package/dist/collection/components/crm-bonus/assets/logo.svg +0 -18
  126. package/dist/collection/components/crm-bonus/assets/success-svgrepo-com.svg +0 -8
  127. package/dist/collection/components/crm-bonus/assets/svg/logo.svg +0 -18
  128. package/dist/collection/components/crm-bonus/assets/svg/success-svgrepo-com.svg +0 -8
  129. package/dist/collection/components/crm-bonus/crm-bonus.css +0 -84
  130. package/dist/collection/components/crm-bonus/crm-bonus.js +0 -360
  131. package/dist/collection/components/crm-bonus/crm-bonus.js.map +0 -1
  132. package/dist/collection/components/crm-bonus-form/crm-bonus-form.css +0 -19
  133. package/dist/collection/components/crm-bonus-form/crm-bonus-form.js +0 -348
  134. package/dist/collection/components/crm-bonus-form/crm-bonus-form.js.map +0 -1
  135. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.css +0 -10
  136. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js +0 -20
  137. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js.map +0 -1
  138. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.css +0 -70
  139. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js +0 -126
  140. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js.map +0 -1
  141. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.css +0 -110
  142. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js +0 -127
  143. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js.map +0 -1
  144. package/dist/collection/components/crm-bonus-form/subcomponents/name-input/name-input.css +0 -108
  145. package/dist/collection/components/crm-bonus-form/subcomponents/name-input/name-input.js +0 -110
  146. package/dist/collection/components/crm-bonus-form/subcomponents/name-input/name-input.js.map +0 -1
  147. package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js +0 -75
  148. package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js.map +0 -1
  149. package/dist/collection/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.js +0 -75
  150. package/dist/collection/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.js.map +0 -1
  151. package/dist/collection/components/giftback-form/giftback-form.css +0 -75
  152. package/dist/collection/components/giftback-form/giftback-form.js +0 -410
  153. package/dist/collection/components/giftback-form/giftback-form.js.map +0 -1
  154. package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.css +0 -181
  155. package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.js +0 -221
  156. package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.js.map +0 -1
  157. package/dist/collection/components/giftback-form/subcomponents/giftback-message/giftback-massage.js +0 -11
  158. package/dist/collection/components/giftback-form/subcomponents/giftback-message/giftback-massage.js.map +0 -1
  159. package/dist/collection/components/giftback-form/subcomponents/phone-form/phone-form.js +0 -103
  160. package/dist/collection/components/giftback-form/subcomponents/phone-form/phone-form.js.map +0 -1
  161. package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.css +0 -84
  162. package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.js +0 -197
  163. package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.js.map +0 -1
  164. package/dist/collection/components/loading-container/loading-container.css +0 -47
  165. package/dist/collection/components/loading-container/loading-container.js +0 -43
  166. package/dist/collection/components/loading-container/loading-container.js.map +0 -1
  167. package/dist/collection/components/loading-spinner/loading-spinner.css +0 -17
  168. package/dist/collection/components/loading-spinner/loading-spinner.js +0 -63
  169. package/dist/collection/components/loading-spinner/loading-spinner.js.map +0 -1
  170. package/dist/collection/components/modal/app-modal.css +0 -45
  171. package/dist/collection/components/modal/app-modal.js +0 -83
  172. package/dist/collection/components/modal/app-modal.js.map +0 -1
  173. package/dist/collection/components/note/crm-bonus-note.css +0 -71
  174. package/dist/collection/components/note/crm-bonus-note.js +0 -130
  175. package/dist/collection/components/note/crm-bonus-note.js.map +0 -1
  176. package/dist/collection/components/pedido/pedido.js +0 -82
  177. package/dist/collection/components/pedido/pedido.js.map +0 -1
  178. package/dist/collection/components/phone/phone-input-mask.css +0 -40
  179. package/dist/collection/components/phone/phone-input-mask.js +0 -125
  180. package/dist/collection/components/phone/phone-input-mask.js.map +0 -1
  181. package/dist/collection/components/tooltip/crm-tooltip.css +0 -49
  182. package/dist/collection/components/tooltip/tooltip.js +0 -61
  183. package/dist/collection/components/tooltip/tooltip.js.map +0 -1
  184. package/dist/collection/contants/index.js +0 -16
  185. package/dist/collection/contants/index.js.map +0 -1
  186. package/dist/collection/contants/mocks.js +0 -28
  187. package/dist/collection/contants/mocks.js.map +0 -1
  188. package/dist/collection/dto/pin.sent.js +0 -2
  189. package/dist/collection/dto/pin.sent.js.map +0 -1
  190. package/dist/collection/dto/update.order.dto.js +0 -2
  191. package/dist/collection/dto/update.order.dto.js.map +0 -1
  192. package/dist/collection/dto/validate.pin.bonus.js +0 -5
  193. package/dist/collection/dto/validate.pin.bonus.js.map +0 -1
  194. package/dist/collection/helpers/build.payload.helper.js +0 -25
  195. package/dist/collection/helpers/build.payload.helper.js.map +0 -1
  196. package/dist/collection/helpers/info.config.helper.js +0 -11
  197. package/dist/collection/helpers/info.config.helper.js.map +0 -1
  198. package/dist/collection/helpers/time.helper.js +0 -12
  199. package/dist/collection/helpers/time.helper.js.map +0 -1
  200. package/dist/collection/i18n/i18n.js +0 -35
  201. package/dist/collection/i18n/i18n.js.map +0 -1
  202. package/dist/collection/index.js +0 -11
  203. package/dist/collection/index.js.map +0 -1
  204. package/dist/collection/services/crmbonus.service.js +0 -117
  205. package/dist/collection/services/crmbonus.service.js.map +0 -1
  206. package/dist/collection/utils/keys.storage.js +0 -9
  207. package/dist/collection/utils/keys.storage.js.map +0 -1
  208. package/dist/collection/utils/utils.js.map +0 -1
  209. package/dist/components/app-modal.js +0 -46
  210. package/dist/components/app-modal.js.map +0 -1
  211. package/dist/components/countdown-timer.js +0 -8
  212. package/dist/components/countdown-timer.js.map +0 -1
  213. package/dist/components/crm-bonus-form.js +0 -165
  214. package/dist/components/crm-bonus-form.js.map +0 -1
  215. package/dist/components/crm-bonus-note.js +0 -137
  216. package/dist/components/crm-bonus-note.js.map +0 -1
  217. package/dist/components/crm-bonus.js +0 -345
  218. package/dist/components/crm-bonus.js.map +0 -1
  219. package/dist/components/crm-button.js +0 -8
  220. package/dist/components/crm-button.js.map +0 -1
  221. package/dist/components/crm-giftback-form.js +0 -8
  222. package/dist/components/crm-giftback-form.js.map +0 -1
  223. package/dist/components/crm-tooltip.js +0 -8
  224. package/dist/components/crm-tooltip.js.map +0 -1
  225. package/dist/components/giftback-finish.js +0 -8
  226. package/dist/components/giftback-finish.js.map +0 -1
  227. package/dist/components/giftback-info.js +0 -8
  228. package/dist/components/giftback-info.js.map +0 -1
  229. package/dist/components/giftback-pin.js +0 -8
  230. package/dist/components/giftback-pin.js.map +0 -1
  231. package/dist/components/giftback-progress.js +0 -8
  232. package/dist/components/giftback-progress.js.map +0 -1
  233. package/dist/components/index.js +0 -4
  234. package/dist/components/index.js.map +0 -1
  235. package/dist/components/loading-container.js +0 -8
  236. package/dist/components/loading-container.js.map +0 -1
  237. package/dist/components/loading-spinner.js +0 -8
  238. package/dist/components/loading-spinner.js.map +0 -1
  239. package/dist/components/name-input.js +0 -8
  240. package/dist/components/name-input.js.map +0 -1
  241. package/dist/components/p-11085d9b.js +0 -79
  242. package/dist/components/p-11085d9b.js.map +0 -1
  243. package/dist/components/p-246a3e9d.js.map +0 -1
  244. package/dist/components/p-2671d669.js.map +0 -1
  245. package/dist/components/p-27c0fd26.js +0 -316
  246. package/dist/components/p-27c0fd26.js.map +0 -1
  247. package/dist/components/p-2b3b8d6b.js.map +0 -1
  248. package/dist/components/p-3e84f78c.js +0 -1408
  249. package/dist/components/p-3e84f78c.js.map +0 -1
  250. package/dist/components/p-47f9da55.js +0 -46
  251. package/dist/components/p-47f9da55.js.map +0 -1
  252. package/dist/components/p-58b97429.js.map +0 -1
  253. package/dist/components/p-6186ddcc.js.map +0 -1
  254. package/dist/components/p-6c546e48.js.map +0 -1
  255. package/dist/components/p-75ba7b9a.js +0 -14
  256. package/dist/components/p-75ba7b9a.js.map +0 -1
  257. package/dist/components/p-7c744cca.js.map +0 -1
  258. package/dist/components/p-7cfea8fe.js +0 -19
  259. package/dist/components/p-7cfea8fe.js.map +0 -1
  260. package/dist/components/p-83a12a8f.js.map +0 -1
  261. package/dist/components/p-b79c86a8.js.map +0 -1
  262. package/dist/components/p-ba369e65.js +0 -21
  263. package/dist/components/p-ba369e65.js.map +0 -1
  264. package/dist/components/p-c44e2f02.js +0 -3872
  265. package/dist/components/p-c44e2f02.js.map +0 -1
  266. package/dist/components/p-cc1ea33f.js +0 -36
  267. package/dist/components/p-cc1ea33f.js.map +0 -1
  268. package/dist/components/p-e8c19a64.js +0 -2217
  269. package/dist/components/p-e8c19a64.js.map +0 -1
  270. package/dist/components/p-f9aeffc1.js +0 -12
  271. package/dist/components/p-f9aeffc1.js.map +0 -1
  272. package/dist/components/p-fe9c3966.js +0 -39
  273. package/dist/components/p-fe9c3966.js.map +0 -1
  274. package/dist/components/pedido-finalizado.js +0 -53
  275. package/dist/components/pedido-finalizado.js.map +0 -1
  276. package/dist/components/phone-cancel-input.js +0 -55
  277. package/dist/components/phone-cancel-input.js.map +0 -1
  278. package/dist/components/phone-form.js +0 -8
  279. package/dist/components/phone-form.js.map +0 -1
  280. package/dist/components/phone-input-mask.js +0 -8
  281. package/dist/components/phone-input-mask.js.map +0 -1
  282. package/dist/components/phone-input.js +0 -55
  283. package/dist/components/phone-input.js.map +0 -1
  284. package/dist/components/pin-form.js +0 -8
  285. package/dist/components/pin-form.js.map +0 -1
  286. package/dist/crmbonus-component-wake/p-03b77c41.entry.js +0 -2
  287. package/dist/crmbonus-component-wake/p-03b77c41.entry.js.map +0 -1
  288. package/dist/crmbonus-component-wake/p-147ba861.entry.js +0 -2
  289. package/dist/crmbonus-component-wake/p-21464f24.entry.js +0 -2
  290. package/dist/crmbonus-component-wake/p-21464f24.entry.js.map +0 -1
  291. package/dist/crmbonus-component-wake/p-3d6152b1.js +0 -3
  292. package/dist/crmbonus-component-wake/p-3d6152b1.js.map +0 -1
  293. package/dist/crmbonus-component-wake/p-620ec1a3.entry.js +0 -2
  294. package/dist/crmbonus-component-wake/p-620ec1a3.entry.js.map +0 -1
  295. package/dist/crmbonus-component-wake/p-6276ee63.entry.js +0 -2
  296. package/dist/crmbonus-component-wake/p-6276ee63.entry.js.map +0 -1
  297. package/dist/crmbonus-component-wake/p-74206c91.entry.js +0 -2
  298. package/dist/crmbonus-component-wake/p-74206c91.entry.js.map +0 -1
  299. package/dist/crmbonus-component-wake/p-75ba7b9a.js +0 -2
  300. package/dist/crmbonus-component-wake/p-75ba7b9a.js.map +0 -1
  301. package/dist/crmbonus-component-wake/p-7751b4be.entry.js +0 -2
  302. package/dist/crmbonus-component-wake/p-7751b4be.entry.js.map +0 -1
  303. package/dist/crmbonus-component-wake/p-7b7fb354.entry.js +0 -2
  304. package/dist/crmbonus-component-wake/p-7b7fb354.entry.js.map +0 -1
  305. package/dist/crmbonus-component-wake/p-7cfea8fe.js +0 -2
  306. package/dist/crmbonus-component-wake/p-7cfea8fe.js.map +0 -1
  307. package/dist/crmbonus-component-wake/p-885fc30e.entry.js +0 -2
  308. package/dist/crmbonus-component-wake/p-885fc30e.entry.js.map +0 -1
  309. package/dist/crmbonus-component-wake/p-90716188.entry.js +0 -2
  310. package/dist/crmbonus-component-wake/p-90716188.entry.js.map +0 -1
  311. package/dist/crmbonus-component-wake/p-b7a8f915.entry.js +0 -2
  312. package/dist/crmbonus-component-wake/p-b7a8f915.entry.js.map +0 -1
  313. package/dist/crmbonus-component-wake/p-b873347f.entry.js +0 -2
  314. package/dist/crmbonus-component-wake/p-b873347f.entry.js.map +0 -1
  315. package/dist/crmbonus-component-wake/p-ba369e65.js +0 -2
  316. package/dist/crmbonus-component-wake/p-ba369e65.js.map +0 -1
  317. package/dist/crmbonus-component-wake/p-be3ddacc.entry.js +0 -2
  318. package/dist/crmbonus-component-wake/p-be3ddacc.entry.js.map +0 -1
  319. package/dist/crmbonus-component-wake/p-c44e2f02.js +0 -2
  320. package/dist/crmbonus-component-wake/p-c44e2f02.js.map +0 -1
  321. package/dist/crmbonus-component-wake/p-e1255160.js +0 -2
  322. package/dist/crmbonus-component-wake/p-e1255160.js.map +0 -1
  323. package/dist/crmbonus-component-wake/p-e8c19a64.js +0 -2
  324. package/dist/crmbonus-component-wake/p-e8c19a64.js.map +0 -1
  325. package/dist/crmbonus-component-wake/p-f9aeffc1.js +0 -2
  326. package/dist/crmbonus-component-wake/p-f9aeffc1.js.map +0 -1
  327. package/dist/env.js +0 -5
  328. package/dist/env.js.map +0 -1
  329. package/dist/esm/app-modal.entry.js.map +0 -1
  330. package/dist/esm/countdown-timer_2.entry.js +0 -58
  331. package/dist/esm/countdown-timer_2.entry.js.map +0 -1
  332. package/dist/esm/crm-bonus-form.entry.js.map +0 -1
  333. package/dist/esm/crm-bonus-note.entry.js.map +0 -1
  334. package/dist/esm/crm-bonus.entry.js.map +0 -1
  335. package/dist/esm/crm-giftback-form_2.entry.js.map +0 -1
  336. package/dist/esm/crm-tooltip_4.entry.js +0 -204
  337. package/dist/esm/crm-tooltip_4.entry.js.map +0 -1
  338. package/dist/esm/crmbonus-component-wake.js +0 -22
  339. package/dist/esm/crmbonus-component-wake.js.map +0 -1
  340. package/dist/esm/crmbonus.service-774ebe83.js.map +0 -1
  341. package/dist/esm/giftback-finish_4.entry.js +0 -124
  342. package/dist/esm/giftback-finish_4.entry.js.map +0 -1
  343. package/dist/esm/index-e8724c8f.js +0 -1571
  344. package/dist/esm/index-e8724c8f.js.map +0 -1
  345. package/dist/esm/index.js +0 -3
  346. package/dist/esm/index.js.map +0 -1
  347. package/dist/esm/loader.js +0 -13
  348. package/dist/esm/loader.js.map +0 -1
  349. package/dist/esm/loading-spinner.entry.js.map +0 -1
  350. package/dist/esm/pedido-finalizado.entry.js +0 -32
  351. package/dist/esm/pedido-finalizado.entry.js.map +0 -1
  352. package/dist/esm/phone-cancel-input.entry.js.map +0 -1
  353. package/dist/esm/phone-input-mask.entry.js.map +0 -1
  354. package/dist/esm/phone-input.entry.js.map +0 -1
  355. package/dist/esm/utils-d642b4db.js +0 -21
  356. package/dist/esm/utils-d642b4db.js.map +0 -1
  357. package/dist/index.cjs.js +0 -1
  358. package/dist/index.js +0 -1
  359. /package/dist/{esm → crmbonus-component-wake}/app-globals-0f993ce5.js +0 -0
  360. /package/dist/{esm → crmbonus-component-wake}/app-globals-0f993ce5.js.map +0 -0
  361. /package/dist/{esm → crmbonus-component-wake}/index-5b567099.js +0 -0
  362. /package/dist/{esm → crmbonus-component-wake}/index-5b567099.js.map +0 -0
  363. /package/dist/{esm → crmbonus-component-wake}/info.config.helper-42d9ddf9.js +0 -0
  364. /package/dist/{esm → crmbonus-component-wake}/info.config.helper-42d9ddf9.js.map +0 -0
  365. /package/dist/{esm → crmbonus-component-wake}/keys.storage-8c76fcd7.js +0 -0
  366. /package/dist/{esm → crmbonus-component-wake}/keys.storage-8c76fcd7.js.map +0 -0
@@ -1,360 +0,0 @@
1
- import { h } from "@stencil/core";
2
- import { CrmBonusService } from "../../services/crmbonus.service";
3
- import { StepFormEnum } from "../../contants";
4
- import i18next from "../../i18n/i18n";
5
- import { buildProductsByWake } from "../../helpers/build.payload.helper";
6
- export class CrmBonus {
7
- constructor() {
8
- this.crmBonusService = CrmBonusService.getInstance();
9
- this.showModal = false;
10
- this.userId = undefined;
11
- this.storeName = undefined;
12
- this.productsInString = undefined;
13
- this.cartId = undefined;
14
- this.products = undefined;
15
- this.customer = {
16
- birthDate: "",
17
- document: "",
18
- name: "",
19
- phone: ""
20
- };
21
- this.loading = false;
22
- this.message = undefined;
23
- this.phone = undefined;
24
- this.canCancel = false;
25
- this.amountCancel = undefined;
26
- this.sent = undefined;
27
- this.session = undefined;
28
- this.loading_reprocess = false;
29
- }
30
- async resetBonus() {
31
- console.log('[START RESET BONUS]!!!!!');
32
- // const used = localStorage.getItem("bc:used");
33
- // if (used == "use") {
34
- // await this.crmBonusService.cancelBonus(this.cartId, this.storeName);
35
- // }
36
- try {
37
- await this.crmBonusRef.processBonus(this.buildProducts(), true);
38
- console.log('[BONUS RESETADO]!!!!!');
39
- }
40
- catch (err) {
41
- this.loading = false;
42
- console.log('[error ao reprocessar bonous]');
43
- await this.crmBonusRef.setStep(StepFormEnum.STEP_PHONE);
44
- }
45
- finally {
46
- this.loading = false;
47
- }
48
- }
49
- async reprocess(products) {
50
- this.loading_reprocess = true;
51
- try {
52
- this.productsInString = JSON.stringify(products);
53
- await this.handleLoad();
54
- await this.resetBonus();
55
- }
56
- catch (err) {
57
- console.debug('[watchProducts]', err.message);
58
- }
59
- finally {
60
- this.loading_reprocess = false;
61
- }
62
- }
63
- async watchProducts(newValue) {
64
- try {
65
- console.log('[update products list]');
66
- this.productsInString = newValue;
67
- await this.handleLoad();
68
- await this.resetBonus();
69
- }
70
- catch (err) {
71
- console.debug('[watchProducts]', err.message);
72
- }
73
- }
74
- async componentWillLoad() {
75
- i18next.changeLanguage(i18next.language);
76
- await this.loadSession();
77
- await this.loadConfigStore();
78
- await this.handleLoad();
79
- }
80
- async loadConfigStore() {
81
- await this.crmBonusService.getCustomization(this.storeName);
82
- }
83
- async handleLoad() {
84
- try {
85
- if (this.userId) {
86
- this.customer = await this.crmBonusService.getCustomer(this.userId, this.storeName);
87
- console.log('customer', this.customer);
88
- }
89
- const amount = localStorage.getItem(this.cartId);
90
- if (amount) {
91
- this.canCancel = true;
92
- this.amountCancel = amount;
93
- }
94
- }
95
- catch (error) {
96
- console.log('info customer');
97
- }
98
- await this.buildAndGetProducts();
99
- }
100
- async loadSession() {
101
- this.session = await this.crmBonusService.getToken(this.storeName);
102
- setTimeout(() => {
103
- this.loadSession();
104
- }, 1500000);
105
- }
106
- async buildAndGetProducts() {
107
- const key = `bc-products:${this.cartId}`;
108
- const cart = await this.crmBonusService.getInfoCart();
109
- this.productsInString = JSON.stringify(cart.Produtos);
110
- localStorage.setItem(key, this.productsInString);
111
- const productsInCart = JSON.parse(this.productsInString);
112
- const products_in_cache = JSON.parse(localStorage.getItem(key));
113
- const products = [];
114
- for (const product_cart of productsInCart) {
115
- const [pro] = products_in_cache.filter(p => p.ProdutoVarianteId == product_cart.ProdutoVarianteId);
116
- const [ajuste = { Valor: 0 }] = pro.Ajustes.filter(aj => aj.Tipo === "Formula");
117
- if (pro) {
118
- products.push(Object.assign(Object.assign({}, product_cart), { PrecoPor: pro.PrecoPor + (ajuste.Valor * -1), Quantidade: pro.Quantidade, Ajustes: pro.Ajustes }));
119
- }
120
- else {
121
- products.push(product_cart);
122
- }
123
- }
124
- this.products = products; //cache_products ? JSON.parse(cache_products) : JSON.parse(this.productsInString);
125
- }
126
- async sendPin(phone) {
127
- var _a, _b;
128
- this.loading = true;
129
- this.message = "";
130
- try {
131
- const _phone = phone.replace(/\D/g, '');
132
- this.phone = Number(_phone);
133
- this.sent = await this.crmBonusService.sendPin(this.phone, this.customer.name, this.storeName);
134
- ;
135
- await this.crmBonusRef.setStep(StepFormEnum.STEP_PIN);
136
- this.showModal = true;
137
- }
138
- catch (error) {
139
- this.message = (_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.message;
140
- }
141
- finally {
142
- this.loading = false;
143
- }
144
- }
145
- async sendPinName(customerName) {
146
- var _a, _b;
147
- this.loading = true;
148
- this.message = "";
149
- try {
150
- this.customer.name = customerName;
151
- this.sent = await this.crmBonusService.sendPin(this.phone, this.customer.name, this.storeName);
152
- ;
153
- await this.crmBonusRef.setStep(StepFormEnum.STEP_PIN);
154
- this.showModal = true;
155
- }
156
- catch (error) {
157
- this.message = (_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.message;
158
- }
159
- finally {
160
- this.loading = false;
161
- }
162
- }
163
- buildProducts() {
164
- return buildProductsByWake(this.products);
165
- }
166
- handleCloseModal() {
167
- this.showModal = false;
168
- }
169
- save(amount) {
170
- localStorage.setItem(this.cartId, amount.toString());
171
- this.canCancel = true;
172
- this.amountCancel = amount.toString();
173
- }
174
- async cancel() {
175
- this.message = "";
176
- this.loading = true;
177
- try {
178
- await this.crmBonusService.cancel(this.cartId);
179
- this.canCancel = false;
180
- localStorage.removeItem(this.cartId);
181
- }
182
- catch (error) {
183
- this.message = "Não consegui cancelar o bônus, tente novamente!";
184
- }
185
- finally {
186
- this.loading = false;
187
- }
188
- }
189
- async handleSendPin(phone) {
190
- this.message = "";
191
- if (!phone) {
192
- this.message = "Informe seu telefone";
193
- return;
194
- }
195
- this.customer.phone = phone;
196
- const _phone = phone.replace(/\D/g, '');
197
- this.phone = Number(_phone);
198
- if (this.customer.name) {
199
- return this.sendPin(phone);
200
- }
201
- await this.crmBonusRef.setStep(StepFormEnum.STEP_NAME);
202
- this.showModal = true;
203
- }
204
- render() {
205
- return (h("loading-container", { key: 'fe4b22419f15c995446952127a3dde3f8fdc4f87', loading: this.loading_reprocess }, h("crm-giftback-form", { key: 'd5ba2f9f949ab9ff94c37419f3b59a01cf548ae8', style: { position: "relative" }, ref: ref => this.crmBonusRef = ref, storeName: this.storeName, products: this.buildProducts(), cartId: this.cartId, customer: this.customer, loadProducts: () => this.buildProducts() })));
206
- }
207
- static get is() { return "crm-bonus"; }
208
- static get encapsulation() { return "scoped"; }
209
- static get originalStyleUrls() {
210
- return {
211
- "$": ["crm-bonus.css"]
212
- };
213
- }
214
- static get styleUrls() {
215
- return {
216
- "$": ["crm-bonus.css"]
217
- };
218
- }
219
- static get assetsDirs() { return ["assets"]; }
220
- static get properties() {
221
- return {
222
- "userId": {
223
- "type": "number",
224
- "mutable": false,
225
- "complexType": {
226
- "original": "number",
227
- "resolved": "number",
228
- "references": {}
229
- },
230
- "required": false,
231
- "optional": false,
232
- "docs": {
233
- "tags": [],
234
- "text": ""
235
- },
236
- "attribute": "userid",
237
- "reflect": false
238
- },
239
- "storeName": {
240
- "type": "any",
241
- "mutable": false,
242
- "complexType": {
243
- "original": "any",
244
- "resolved": "any",
245
- "references": {}
246
- },
247
- "required": false,
248
- "optional": false,
249
- "docs": {
250
- "tags": [],
251
- "text": ""
252
- },
253
- "attribute": "storename",
254
- "reflect": false
255
- },
256
- "productsInString": {
257
- "type": "string",
258
- "mutable": false,
259
- "complexType": {
260
- "original": "string",
261
- "resolved": "string",
262
- "references": {}
263
- },
264
- "required": false,
265
- "optional": false,
266
- "docs": {
267
- "tags": [],
268
- "text": ""
269
- },
270
- "attribute": "products",
271
- "reflect": false
272
- },
273
- "cartId": {
274
- "type": "any",
275
- "mutable": false,
276
- "complexType": {
277
- "original": "any",
278
- "resolved": "any",
279
- "references": {}
280
- },
281
- "required": false,
282
- "optional": false,
283
- "docs": {
284
- "tags": [],
285
- "text": ""
286
- },
287
- "attribute": "cartid",
288
- "reflect": false
289
- }
290
- };
291
- }
292
- static get states() {
293
- return {
294
- "showModal": {},
295
- "products": {},
296
- "customer": {},
297
- "loading": {},
298
- "message": {},
299
- "phone": {},
300
- "canCancel": {},
301
- "amountCancel": {},
302
- "sent": {},
303
- "session": {},
304
- "loading_reprocess": {}
305
- };
306
- }
307
- static get methods() {
308
- return {
309
- "resetBonus": {
310
- "complexType": {
311
- "signature": "() => Promise<void>",
312
- "parameters": [],
313
- "references": {
314
- "Promise": {
315
- "location": "global",
316
- "id": "global::Promise"
317
- }
318
- },
319
- "return": "Promise<void>"
320
- },
321
- "docs": {
322
- "text": "",
323
- "tags": []
324
- }
325
- },
326
- "reprocess": {
327
- "complexType": {
328
- "signature": "(products: Array<any>) => Promise<void>",
329
- "parameters": [{
330
- "name": "products",
331
- "type": "any[]",
332
- "docs": ""
333
- }],
334
- "references": {
335
- "Promise": {
336
- "location": "global",
337
- "id": "global::Promise"
338
- },
339
- "Array": {
340
- "location": "global",
341
- "id": "global::Array"
342
- }
343
- },
344
- "return": "Promise<void>"
345
- },
346
- "docs": {
347
- "text": "",
348
- "tags": []
349
- }
350
- }
351
- };
352
- }
353
- static get watchers() {
354
- return [{
355
- "propName": "productsInString",
356
- "methodName": "watchProducts"
357
- }];
358
- }
359
- }
360
- //# sourceMappingURL=crm-bonus.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"crm-bonus.js","sourceRoot":"","sources":["../../../../src/components/crm-bonus/crm-bonus.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAEzE,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE,OAAO,EAA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SAAS,CAAC,CAAC;QACvD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IACxB,CAAC;IAED,MAAM;QAEJ,OAAO,CACL,0EAAmB,OAAO,EAAE,IAAI,CAAC,iBAAiB;YAChD,0EACE,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,EAC/B,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,GAAG,GAAG,EAClC,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,QAAQ,EAAE,IAAI,CAAC,aAAa,EAAE,EAC9B,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,YAAY,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE,GAExC,CACgB,CACrB,CAAA;IACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Method, Prop, State, Watch, 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\nimport i18next from '../../i18n/i18n'\nimport { buildProductsByWake } from '../../helpers/build.payload.helper';\n\n@Component({\n tag: 'crm-bonus',\n styleUrl: 'crm-bonus.css',\n scoped: true,\n assetsDirs: ['assets']\n})\nexport class CrmBonus {\n\n private crmBonusService: CrmBonusService = CrmBonusService.getInstance();\n\n private crmBonusRef: HTMLCrmGiftbackFormElement;\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 @State() session: string;\n @State() loading_reprocess = false;\n\n @Method()\n async resetBonus() {\n console.log('[START RESET BONUS]!!!!!');\n // const used = localStorage.getItem(\"bc:used\");\n\n // if (used == \"use\") {\n // await this.crmBonusService.cancelBonus(this.cartId, this.storeName);\n // }\n\n try {\n await this.crmBonusRef.processBonus(this.buildProducts(), true);\n console.log('[BONUS RESETADO]!!!!!');\n } catch (err) {\n\n this.loading = false;\n console.log('[error ao reprocessar bonous]');\n await this.crmBonusRef.setStep(StepFormEnum.STEP_PHONE);\n } finally {\n this.loading = false;\n }\n }\n\n @Method()\n async reprocess(products: Array<any>) {\n this.loading_reprocess = true\n\n try {\n this.productsInString = JSON.stringify(products);\n await this.handleLoad();\n\n await this.resetBonus();\n } catch (err) {\n console.debug('[watchProducts]', err.message);\n } finally {\n this.loading_reprocess = false\n }\n }\n\n @Watch(\"productsInString\")\n async watchProducts(newValue: string) {\n try {\n console.log('[update products list]');\n this.productsInString = newValue;\n await this.handleLoad();\n\n await this.resetBonus();\n } catch (err) {\n console.debug('[watchProducts]', err.message);\n }\n }\n\n async componentWillLoad() {\n i18next.changeLanguage(i18next.language);\n\n await this.loadSession();\n await this.loadConfigStore()\n await this.handleLoad();\n }\n\n async loadConfigStore() {\n await this.crmBonusService.getCustomization(this.storeName);\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('customer', this.customer);\n }\n\n const amount = localStorage.getItem(this.cartId);\n\n if (amount) {\n this.canCancel = true;\n this.amountCancel = amount;\n }\n\n } catch (error) {\n console.log('info customer')\n }\n\n await this.buildAndGetProducts();\n }\n\n\n async loadSession() {\n this.session = await this.crmBonusService.getToken(this.storeName);\n\n setTimeout(() => {\n this.loadSession()\n }, 1500000)\n\n }\n\n async buildAndGetProducts() {\n\n const key = `bc-products:${this.cartId}`;\n\n const cart = await this.crmBonusService.getInfoCart();\n\n this.productsInString = JSON.stringify(cart.Produtos)\n\n localStorage.setItem(key, this.productsInString);\n\n const productsInCart = JSON.parse(this.productsInString);\n const products_in_cache = JSON.parse(localStorage.getItem(key));\n\n const products: Array<IProductWake> = []\n\n for (const product_cart of productsInCart) {\n\n const [pro] = products_in_cache.filter(p => p.ProdutoVarianteId == product_cart.ProdutoVarianteId)\n\n const [ ajuste = { Valor:0 } ] = pro.Ajustes.filter( aj => aj.Tipo === \"Formula\" )\n\n if (pro) {\n products.push({\n ...product_cart,\n PrecoPor: pro.PrecoPor + (ajuste.Valor * -1),\n Quantidade: pro.Quantidade,\n Ajustes: pro.Ajustes\n })\n } else {\n products.push(product_cart)\n }\n\n }\n\n this.products = products; //cache_products ? JSON.parse(cache_products) : JSON.parse(this.productsInString);\n\n }\n\n public async sendPin(phone: string) {\n this.loading = true;\n this.message = \"\";\n\n try {\n\n const _phone = phone.replace(/\\D/g, '');\n this.phone = Number(_phone);\n\n this.sent = await this.crmBonusService.sendPin(this.phone, this.customer.name, this.storeName);;\n\n await this.crmBonusRef.setStep(StepFormEnum.STEP_PIN);\n\n this.showModal = true;\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false\n }\n }\n\n public async sendPinName(customerName: string) {\n this.loading = true;\n this.message = \"\";\n\n try {\n this.customer.name = customerName;\n\n this.sent = await this.crmBonusService.sendPin(this.phone, this.customer.name, this.storeName);;\n\n await this.crmBonusRef.setStep(StepFormEnum.STEP_PIN);\n\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 buildProductsByWake(this.products);\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);\n this.canCancel = false;\n\n localStorage.removeItem(this.cartId);\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 async handleSendPin(phone: string) {\n this.message = \"\"\n if (!phone) {\n this.message = \"Informe seu telefone\";\n return;\n }\n\n this.customer.phone = phone;\n const _phone = phone.replace(/\\D/g, '');\n this.phone = Number(_phone);\n\n if (this.customer.name) {\n return this.sendPin(phone)\n }\n\n await this.crmBonusRef.setStep(StepFormEnum.STEP_NAME);\n this.showModal = true;\n }\n\n render() {\n\n return (\n <loading-container loading={this.loading_reprocess} >\n <crm-giftback-form\n style={{ position: \"relative\" }}\n ref={ref => this.crmBonusRef = ref}\n storeName={this.storeName}\n products={this.buildProducts()}\n cartId={this.cartId}\n customer={this.customer}\n loadProducts={() => this.buildProducts()}\n \n />\n </loading-container>\n )\n }\n}\n"]}
@@ -1,19 +0,0 @@
1
- .form-container {
2
- width: 100%;
3
- display: flex;
4
- justify-content: center;
5
- justify-content: space-around;
6
- }
7
-
8
- .disabled {
9
- opacity: 0.6;
10
- cursor: not-allowed;
11
- }
12
-
13
- .message-error {
14
- color: #d11111;
15
- font-weight: bold;
16
- font-family: Arial;
17
- font-size: small;
18
- margin-left: 16px;
19
- }