crmbonus-component-wake 2.0.51 → 2.0.52

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 (318) 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.cjs.entry.js +28 -0
  4. package/dist/cjs/app-modal.cjs.entry.js.map +1 -0
  5. package/dist/cjs/countdown-timer_4.cjs.entry.js +181 -0
  6. package/dist/cjs/countdown-timer_4.cjs.entry.js.map +1 -0
  7. package/dist/cjs/crm-bonus-form.cjs.entry.js +103 -0
  8. package/dist/cjs/crm-bonus-form.cjs.entry.js.map +1 -0
  9. package/dist/cjs/crm-bonus-note.cjs.entry.js +53 -0
  10. package/dist/{crmbonus-component-wake/crm-bonus-note.entry.js.map → cjs/crm-bonus-note.cjs.entry.js.map} +1 -1
  11. package/dist/cjs/crm-bonus.cjs.entry.js +204 -0
  12. package/dist/cjs/crm-bonus.cjs.entry.js.map +1 -0
  13. package/dist/cjs/crm-button.cjs.entry.js +25 -0
  14. package/dist/cjs/crm-button.cjs.entry.js.map +1 -0
  15. package/dist/cjs/crm-giftback-form.cjs.entry.js +173 -0
  16. package/dist/cjs/crm-giftback-form.cjs.entry.js.map +1 -0
  17. package/dist/cjs/crmbonus-component-wake.cjs.js +27 -0
  18. package/dist/cjs/crmbonus-component-wake.cjs.js.map +1 -0
  19. package/dist/cjs/crmbonus.service-3c4ebbdf.js +3852 -0
  20. package/dist/cjs/crmbonus.service-3c4ebbdf.js.map +1 -0
  21. package/dist/cjs/giftback-finish_4.cjs.entry.js +132 -0
  22. package/dist/cjs/giftback-finish_4.cjs.entry.js.map +1 -0
  23. package/dist/cjs/i18n-efd790a3.js +2209 -0
  24. package/dist/cjs/i18n-efd790a3.js.map +1 -0
  25. package/dist/cjs/index-80419303.js +1253 -0
  26. package/dist/cjs/index-80419303.js.map +1 -0
  27. package/dist/cjs/index-96a8951f.js +16 -0
  28. package/dist/cjs/index-96a8951f.js.map +1 -0
  29. package/dist/cjs/index.cjs.js +11 -0
  30. package/dist/cjs/index.cjs.js.map +1 -0
  31. package/dist/cjs/info.config.helper-c5d9f781.js +16 -0
  32. package/dist/cjs/info.config.helper-c5d9f781.js.map +1 -0
  33. package/dist/cjs/loader.cjs.js +17 -0
  34. package/dist/cjs/loader.cjs.js.map +1 -0
  35. package/dist/cjs/loading-spinner.cjs.entry.js +24 -0
  36. package/dist/cjs/loading-spinner.cjs.entry.js.map +1 -0
  37. package/dist/cjs/pedido-finalizado.cjs.entry.js +36 -0
  38. package/dist/cjs/pedido-finalizado.cjs.entry.js.map +1 -0
  39. package/dist/cjs/phone-cancel-input.cjs.entry.js +25 -0
  40. package/dist/cjs/phone-cancel-input.cjs.entry.js.map +1 -0
  41. package/dist/cjs/phone-input-mask.cjs.entry.js +61 -0
  42. package/dist/cjs/phone-input-mask.cjs.entry.js.map +1 -0
  43. package/dist/cjs/phone-input.cjs.entry.js +25 -0
  44. package/dist/cjs/phone-input.cjs.entry.js.map +1 -0
  45. package/dist/collection/assets/svg/money-dollars-svgrepo-com.svg +6 -0
  46. package/dist/collection/collection-manifest.json +30 -0
  47. package/dist/collection/components/button/crm-button.css +22 -0
  48. package/dist/collection/components/button/index.js +76 -0
  49. package/dist/collection/components/button/index.js.map +1 -0
  50. package/dist/collection/components/countdown-timer/countdown-timer.js +51 -0
  51. package/dist/collection/components/countdown-timer/countdown-timer.js.map +1 -0
  52. package/dist/collection/components/crm-bonus/assets/logo.svg +18 -0
  53. package/dist/collection/components/crm-bonus/assets/success-svgrepo-com.svg +8 -0
  54. package/dist/collection/components/crm-bonus/assets/svg/logo.svg +18 -0
  55. package/dist/collection/components/crm-bonus/assets/svg/success-svgrepo-com.svg +8 -0
  56. package/dist/collection/components/crm-bonus/crm-bonus.css +84 -0
  57. package/dist/collection/components/crm-bonus/crm-bonus.js +291 -0
  58. package/dist/collection/components/crm-bonus/crm-bonus.js.map +1 -0
  59. package/dist/collection/components/crm-bonus-form/crm-bonus-form.css +19 -0
  60. package/dist/collection/components/crm-bonus-form/crm-bonus-form.js +348 -0
  61. package/dist/collection/components/crm-bonus-form/crm-bonus-form.js.map +1 -0
  62. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.css +10 -0
  63. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js +20 -0
  64. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-finish/giftback-finish.js.map +1 -0
  65. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.css +70 -0
  66. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js +127 -0
  67. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.js.map +1 -0
  68. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.css +110 -0
  69. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js +127 -0
  70. package/dist/collection/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.js.map +1 -0
  71. package/dist/collection/components/crm-bonus-form/subcomponents/name-input/name-input.css +108 -0
  72. package/dist/collection/components/crm-bonus-form/subcomponents/name-input/name-input.js +110 -0
  73. package/dist/collection/components/crm-bonus-form/subcomponents/name-input/name-input.js.map +1 -0
  74. package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js +75 -0
  75. package/dist/collection/components/crm-bonus-form/subcomponents/phone/phone.input.js.map +1 -0
  76. package/dist/collection/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.js +75 -0
  77. package/dist/collection/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.js.map +1 -0
  78. package/dist/collection/components/giftback-form/giftback-form.css +74 -0
  79. package/dist/collection/components/giftback-form/giftback-form.js +248 -0
  80. package/dist/collection/components/giftback-form/giftback-form.js.map +1 -0
  81. package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.css +154 -0
  82. package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.js +156 -0
  83. package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.js.map +1 -0
  84. package/dist/collection/components/giftback-form/subcomponents/giftback-message/giftback-massage.js +11 -0
  85. package/dist/collection/components/giftback-form/subcomponents/giftback-message/giftback-massage.js.map +1 -0
  86. package/dist/collection/components/giftback-form/subcomponents/phone-form/phone-form.js +103 -0
  87. package/dist/collection/components/giftback-form/subcomponents/phone-form/phone-form.js.map +1 -0
  88. package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.css +84 -0
  89. package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.js +198 -0
  90. package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.js.map +1 -0
  91. package/dist/collection/components/loading-spinner/loading-spinner.css +17 -0
  92. package/dist/collection/components/loading-spinner/loading-spinner.js +63 -0
  93. package/dist/collection/components/loading-spinner/loading-spinner.js.map +1 -0
  94. package/dist/collection/components/modal/app-modal.css +45 -0
  95. package/dist/collection/components/modal/app-modal.js +83 -0
  96. package/dist/collection/components/modal/app-modal.js.map +1 -0
  97. package/dist/collection/components/note/crm-bonus-note.css +54 -0
  98. package/dist/collection/components/note/crm-bonus-note.js +94 -0
  99. package/dist/collection/components/note/crm-bonus-note.js.map +1 -0
  100. package/dist/collection/components/pedido/pedido.js +83 -0
  101. package/dist/collection/components/pedido/pedido.js.map +1 -0
  102. package/dist/collection/components/phone/phone-input-mask.css +39 -0
  103. package/dist/collection/components/phone/phone-input-mask.js +125 -0
  104. package/dist/collection/components/phone/phone-input-mask.js.map +1 -0
  105. package/dist/collection/contants/index.js +11 -0
  106. package/dist/collection/contants/index.js.map +1 -0
  107. package/dist/collection/contants/mocks.js +28 -0
  108. package/dist/collection/contants/mocks.js.map +1 -0
  109. package/dist/collection/dto/pin.sent.js +2 -0
  110. package/dist/collection/dto/pin.sent.js.map +1 -0
  111. package/dist/collection/dto/update.order.dto.js +2 -0
  112. package/dist/collection/dto/update.order.dto.js.map +1 -0
  113. package/dist/collection/dto/validate.pin.bonus.js +2 -0
  114. package/dist/collection/dto/validate.pin.bonus.js.map +1 -0
  115. package/dist/collection/helpers/info.config.helper.js +11 -0
  116. package/dist/collection/helpers/info.config.helper.js.map +1 -0
  117. package/dist/collection/i18n/i18n.js +25 -0
  118. package/dist/collection/i18n/i18n.js.map +1 -0
  119. package/dist/collection/index.js +11 -0
  120. package/dist/collection/index.js.map +1 -0
  121. package/dist/collection/services/crmbonus.service.js +96 -0
  122. package/dist/collection/services/crmbonus.service.js.map +1 -0
  123. package/dist/collection/utils/utils.js +4 -0
  124. package/dist/collection/utils/utils.js.map +1 -0
  125. package/dist/components/app-modal.js +46 -0
  126. package/dist/components/app-modal.js.map +1 -0
  127. package/dist/components/countdown-timer.js +8 -0
  128. package/dist/components/countdown-timer.js.map +1 -0
  129. package/dist/components/crm-bonus-form.js +165 -0
  130. package/dist/components/crm-bonus-form.js.map +1 -0
  131. package/dist/components/crm-bonus-note.js +72 -0
  132. package/dist/components/crm-bonus-note.js.map +1 -0
  133. package/dist/components/crm-bonus.js +282 -0
  134. package/dist/components/crm-bonus.js.map +1 -0
  135. package/dist/components/crm-button.js +8 -0
  136. package/dist/components/crm-button.js.map +1 -0
  137. package/dist/components/crm-giftback-form.js +8 -0
  138. package/dist/components/crm-giftback-form.js.map +1 -0
  139. package/dist/components/giftback-finish.js +8 -0
  140. package/dist/components/giftback-finish.js.map +1 -0
  141. package/dist/components/giftback-info.js +8 -0
  142. package/dist/components/giftback-info.js.map +1 -0
  143. package/dist/components/giftback-pin.js +8 -0
  144. package/dist/components/giftback-pin.js.map +1 -0
  145. package/dist/components/giftback-progress.js +8 -0
  146. package/dist/components/giftback-progress.js.map +1 -0
  147. package/dist/components/index.js +9 -0
  148. package/dist/components/index.js.map +1 -0
  149. package/dist/components/loading-spinner.js +8 -0
  150. package/dist/components/loading-spinner.js.map +1 -0
  151. package/dist/components/name-input.js +8 -0
  152. package/dist/components/name-input.js.map +1 -0
  153. package/dist/components/p-2f266d73.js +1068 -0
  154. package/dist/components/p-2f266d73.js.map +1 -0
  155. package/dist/components/p-39d680b6.js +49 -0
  156. package/dist/components/p-39d680b6.js.map +1 -0
  157. package/dist/{crmbonus-component-wake/giftback-pin.entry.js → components/p-4f18f4c0.js} +39 -9
  158. package/dist/components/p-4f18f4c0.js.map +1 -0
  159. package/dist/components/p-57ec707e.js +79 -0
  160. package/dist/components/p-57ec707e.js.map +1 -0
  161. package/dist/components/p-5c3fe5a8.js +39 -0
  162. package/dist/components/p-5c3fe5a8.js.map +1 -0
  163. package/dist/components/p-73e75b43.js +240 -0
  164. package/dist/components/p-73e75b43.js.map +1 -0
  165. package/dist/components/p-75ba7b9a.js +14 -0
  166. package/dist/components/p-75ba7b9a.js.map +1 -0
  167. package/dist/components/p-9f68d2a1.js +65 -0
  168. package/dist/components/p-9f68d2a1.js.map +1 -0
  169. package/dist/{crmbonus-component-wake/name-input.entry.js → components/p-a30bd6b1.js} +38 -9
  170. package/dist/components/p-a30bd6b1.js.map +1 -0
  171. package/dist/components/p-a561251a.js +14 -0
  172. package/dist/components/p-a561251a.js.map +1 -0
  173. package/dist/{crmbonus-component-wake/crmbonus.service-98a7bcf0.js → components/p-dd6f6ab7.js} +90 -165
  174. package/dist/components/p-dd6f6ab7.js.map +1 -0
  175. package/dist/components/p-e4ac17bf.js +46 -0
  176. package/dist/components/p-e4ac17bf.js.map +1 -0
  177. package/dist/components/p-f168d5f6.js +69 -0
  178. package/dist/components/p-f168d5f6.js.map +1 -0
  179. package/dist/{crmbonus-component-wake/pin-form.entry.js → components/p-f4244087.js} +57 -10
  180. package/dist/components/p-f4244087.js.map +1 -0
  181. package/dist/{crmbonus-component-wake/giftback-info.entry.js → components/p-f579d773.js} +36 -13
  182. package/dist/components/p-f579d773.js.map +1 -0
  183. package/dist/components/p-f5fcff75.js +36 -0
  184. package/dist/components/p-f5fcff75.js.map +1 -0
  185. package/dist/{crmbonus-component-wake/i18n-a17a0837.js → components/p-fb505488.js} +1 -16
  186. package/dist/components/p-fb505488.js.map +1 -0
  187. package/dist/components/pedido-finalizado.js +54 -0
  188. package/dist/components/pedido-finalizado.js.map +1 -0
  189. package/dist/components/phone-cancel-input.js +55 -0
  190. package/dist/components/phone-cancel-input.js.map +1 -0
  191. package/dist/components/phone-form.js +8 -0
  192. package/dist/components/phone-form.js.map +1 -0
  193. package/dist/components/phone-input-mask.js +8 -0
  194. package/dist/components/phone-input-mask.js.map +1 -0
  195. package/dist/components/phone-input.js +55 -0
  196. package/dist/components/phone-input.js.map +1 -0
  197. package/dist/components/pin-form.js +8 -0
  198. package/dist/components/pin-form.js.map +1 -0
  199. package/dist/crmbonus-component-wake/crmbonus-component-wake.css +1 -7
  200. package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +1 -48
  201. package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js.map +1 -1
  202. package/dist/crmbonus-component-wake/index.esm.js +1 -16
  203. package/dist/crmbonus-component-wake/index.esm.js.map +1 -1
  204. package/dist/crmbonus-component-wake/p-118fc099.entry.js +2 -0
  205. package/dist/crmbonus-component-wake/p-118fc099.entry.js.map +1 -0
  206. package/dist/crmbonus-component-wake/p-298d8fff.entry.js +2 -0
  207. package/dist/crmbonus-component-wake/p-298d8fff.entry.js.map +1 -0
  208. package/dist/crmbonus-component-wake/p-312caf3f.entry.js +2 -0
  209. package/dist/crmbonus-component-wake/p-312caf3f.entry.js.map +1 -0
  210. package/dist/crmbonus-component-wake/p-3522a3e3.entry.js +2 -0
  211. package/dist/crmbonus-component-wake/p-3522a3e3.entry.js.map +1 -0
  212. package/dist/crmbonus-component-wake/p-3beb5158.entry.js +2 -0
  213. package/dist/crmbonus-component-wake/p-3beb5158.entry.js.map +1 -0
  214. package/dist/crmbonus-component-wake/p-66f41fd0.entry.js +2 -0
  215. package/dist/crmbonus-component-wake/p-66f41fd0.entry.js.map +1 -0
  216. package/dist/crmbonus-component-wake/p-6e6bf96e.js +3 -0
  217. package/dist/crmbonus-component-wake/p-6e6bf96e.js.map +1 -0
  218. package/dist/crmbonus-component-wake/p-75ba7b9a.js +2 -0
  219. package/dist/crmbonus-component-wake/p-75ba7b9a.js.map +1 -0
  220. package/dist/crmbonus-component-wake/p-830b5bdc.entry.js +2 -0
  221. package/dist/crmbonus-component-wake/p-830b5bdc.entry.js.map +1 -0
  222. package/dist/crmbonus-component-wake/p-8b9a1aec.entry.js +2 -0
  223. package/dist/crmbonus-component-wake/p-8b9a1aec.entry.js.map +1 -0
  224. package/dist/crmbonus-component-wake/p-9acd4f81.entry.js +2 -0
  225. package/dist/crmbonus-component-wake/p-9acd4f81.entry.js.map +1 -0
  226. package/dist/crmbonus-component-wake/p-a561251a.js +2 -0
  227. package/dist/crmbonus-component-wake/p-a561251a.js.map +1 -0
  228. package/dist/crmbonus-component-wake/p-adb37e26.entry.js +2 -0
  229. package/dist/crmbonus-component-wake/p-adb37e26.entry.js.map +1 -0
  230. package/dist/crmbonus-component-wake/p-c4cc29a0.entry.js +2 -0
  231. package/dist/crmbonus-component-wake/p-c4cc29a0.entry.js.map +1 -0
  232. package/dist/crmbonus-component-wake/p-c8054eaf.entry.js +2 -0
  233. package/dist/crmbonus-component-wake/p-c8054eaf.entry.js.map +1 -0
  234. package/dist/crmbonus-component-wake/p-c86583a2.entry.js +2 -0
  235. package/dist/crmbonus-component-wake/p-c86583a2.entry.js.map +1 -0
  236. package/dist/crmbonus-component-wake/p-dd6f6ab7.js +2 -0
  237. package/dist/crmbonus-component-wake/p-dd6f6ab7.js.map +1 -0
  238. package/dist/crmbonus-component-wake/p-e1255160.js +2 -0
  239. package/dist/crmbonus-component-wake/p-e1255160.js.map +1 -0
  240. package/dist/crmbonus-component-wake/p-fb505488.js +2 -0
  241. package/dist/crmbonus-component-wake/p-fb505488.js.map +1 -0
  242. package/dist/env.js +5 -0
  243. package/dist/env.js.map +1 -0
  244. package/dist/{crmbonus-component-wake → esm}/app-modal.entry.js +4 -3
  245. package/dist/esm/app-modal.entry.js.map +1 -0
  246. package/dist/esm/countdown-timer_4.entry.js +174 -0
  247. package/dist/esm/countdown-timer_4.entry.js.map +1 -0
  248. package/dist/{crmbonus-component-wake → esm}/crm-bonus-form.entry.js +5 -4
  249. package/dist/esm/crm-bonus-form.entry.js.map +1 -0
  250. package/dist/{crmbonus-component-wake → esm}/crm-bonus-note.entry.js +6 -5
  251. package/dist/esm/crm-bonus-note.entry.js.map +1 -0
  252. package/dist/{crmbonus-component-wake → esm}/crm-bonus.entry.js +6 -7
  253. package/dist/esm/crm-bonus.entry.js.map +1 -0
  254. package/dist/{crmbonus-component-wake → esm}/crm-button.entry.js +4 -3
  255. package/dist/esm/crm-button.entry.js.map +1 -0
  256. package/dist/{crmbonus-component-wake → esm}/crm-giftback-form.entry.js +11 -10
  257. package/dist/esm/crm-giftback-form.entry.js.map +1 -0
  258. package/dist/esm/crmbonus-component-wake.js +22 -0
  259. package/dist/esm/crmbonus-component-wake.js.map +1 -0
  260. package/dist/{crmbonus-component-wake/crmbonus.service-0e166281.js → esm/crmbonus.service-9cba7b49.js} +92 -167
  261. package/dist/esm/crmbonus.service-9cba7b49.js.map +1 -0
  262. package/dist/esm/giftback-finish_4.entry.js +125 -0
  263. package/dist/esm/giftback-finish_4.entry.js.map +1 -0
  264. package/dist/esm/i18n-887a3ef8.js +2207 -0
  265. package/dist/{crmbonus-component-wake/i18n-a17a0837.js.map → esm/i18n-887a3ef8.js.map} +1 -1
  266. package/dist/esm/index-a4c14fca.js +1225 -0
  267. package/dist/esm/index-a4c14fca.js.map +1 -0
  268. package/dist/esm/index.js +7 -0
  269. package/dist/esm/index.js.map +1 -0
  270. package/dist/esm/loader.js +13 -0
  271. package/dist/esm/loader.js.map +1 -0
  272. package/dist/{crmbonus-component-wake → esm}/loading-spinner.entry.js +4 -3
  273. package/dist/esm/loading-spinner.entry.js.map +1 -0
  274. package/dist/{crmbonus-component-wake → esm}/pedido-finalizado.entry.js +3 -3
  275. package/dist/esm/pedido-finalizado.entry.js.map +1 -0
  276. package/dist/{crmbonus-component-wake → esm}/phone-cancel-input.entry.js +2 -2
  277. package/dist/esm/phone-cancel-input.entry.js.map +1 -0
  278. package/dist/{crmbonus-component-wake → esm}/phone-input-mask.entry.js +4 -3
  279. package/dist/esm/phone-input-mask.entry.js.map +1 -0
  280. package/dist/{crmbonus-component-wake → esm}/phone-input.entry.js +2 -2
  281. package/dist/esm/phone-input.entry.js.map +1 -0
  282. package/dist/index.cjs.js +1 -0
  283. package/dist/index.js +1 -0
  284. package/package.json +1 -1
  285. package/dist/crmbonus-component-wake/app-modal.entry.js.map +0 -1
  286. package/dist/crmbonus-component-wake/countdown-timer.entry.js +0 -30
  287. package/dist/crmbonus-component-wake/countdown-timer.entry.js.map +0 -1
  288. package/dist/crmbonus-component-wake/crm-bonus-form.entry.js.map +0 -1
  289. package/dist/crmbonus-component-wake/crm-bonus.entry.js.map +0 -1
  290. package/dist/crmbonus-component-wake/crm-button.entry.js.map +0 -1
  291. package/dist/crmbonus-component-wake/crm-giftback-form.entry.js.map +0 -1
  292. package/dist/crmbonus-component-wake/crmbonus.service-0e166281.js.map +0 -1
  293. package/dist/crmbonus-component-wake/crmbonus.service-98a7bcf0.js.map +0 -1
  294. package/dist/crmbonus-component-wake/giftback-finish.entry.js +0 -19
  295. package/dist/crmbonus-component-wake/giftback-finish.entry.js.map +0 -1
  296. package/dist/crmbonus-component-wake/giftback-info.entry.js.map +0 -1
  297. package/dist/crmbonus-component-wake/giftback-pin.entry.js.map +0 -1
  298. package/dist/crmbonus-component-wake/giftback-progress.entry.js +0 -40
  299. package/dist/crmbonus-component-wake/giftback-progress.entry.js.map +0 -1
  300. package/dist/crmbonus-component-wake/index-bdc90e13.js +0 -3039
  301. package/dist/crmbonus-component-wake/index-bdc90e13.js.map +0 -1
  302. package/dist/crmbonus-component-wake/loading-spinner.entry.js.map +0 -1
  303. package/dist/crmbonus-component-wake/name-input.entry.js.map +0 -1
  304. package/dist/crmbonus-component-wake/pedido-finalizado.entry.js.map +0 -1
  305. package/dist/crmbonus-component-wake/phone-cancel-input.entry.js.map +0 -1
  306. package/dist/crmbonus-component-wake/phone-form.entry.js +0 -26
  307. package/dist/crmbonus-component-wake/phone-form.entry.js.map +0 -1
  308. package/dist/crmbonus-component-wake/phone-input-mask.entry.js.map +0 -1
  309. package/dist/crmbonus-component-wake/phone-input.entry.js.map +0 -1
  310. package/dist/crmbonus-component-wake/pin-form.entry.js.map +0 -1
  311. package/dist/crmbonus-component-wake/shadow-css-7ad5caf8.js +0 -334
  312. package/dist/crmbonus-component-wake/shadow-css-7ad5caf8.js.map +0 -1
  313. /package/dist/{crmbonus-component-wake → esm}/app-globals-0f993ce5.js +0 -0
  314. /package/dist/{crmbonus-component-wake → esm}/app-globals-0f993ce5.js.map +0 -0
  315. /package/dist/{crmbonus-component-wake → esm}/index-3c6d4feb.js +0 -0
  316. /package/dist/{crmbonus-component-wake → esm}/index-3c6d4feb.js.map +0 -0
  317. /package/dist/{crmbonus-component-wake → esm}/info.config.helper-42d9ddf9.js +0 -0
  318. /package/dist/{crmbonus-component-wake → esm}/info.config.helper-42d9ddf9.js.map +0 -0
@@ -0,0 +1,110 @@
1
+ import { h } from "@stencil/core";
2
+ export class NameInput {
3
+ constructor() {
4
+ this.value = undefined;
5
+ this.loading = undefined;
6
+ this.applyName = undefined;
7
+ this.cancel = undefined;
8
+ this.newValue = undefined;
9
+ this.message = undefined;
10
+ }
11
+ handleChangeName(event) {
12
+ this.newValue = event.target.value;
13
+ }
14
+ handleSetName(name) {
15
+ if (!name) {
16
+ this.message = "Informe seu nome";
17
+ return;
18
+ }
19
+ this.applyName(name);
20
+ }
21
+ render() {
22
+ return (h("div", { key: 'dc6b958c6cfb83af8275cf4ff47b1ece5f8f6d93', class: "name-container" }, h("p", { key: 'd9c1105b6aab09acbd970a001735b58eb5104d9b' }, "Seu Nome:"), h("input", { key: 'f562d5e2b1b626245abb5260ad1e197fd9a60e43', class: "bc-form-control", type: "text", value: this.value, onChange: (event) => this.handleChangeName(event) }), h("p", { key: '980d915607979ee8ae8873a2fe17998c46d1ae64' }, this.message), h("div", { key: 'b4e75bbb6ee5c6f53e27722ffad3c6e1b9ae6d7f', class: "footer-button" }, h("button", { key: 'c421fbbe0d0bcf38e057afeb86f864ebb39f9fc8', class: "button-cancel", disabled: this.loading, onClick: () => this.cancel() }, "Cancelar"), h("button", { key: '17d357d3de919698efab46febb5c1ad97c398c77', class: `button ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.handleSetName(this.newValue) }, !this.loading ? "Continua" : h("loading-spinner", { size: "15px", color: "#fff" })))));
23
+ }
24
+ static get is() { return "name-input"; }
25
+ static get originalStyleUrls() {
26
+ return {
27
+ "$": ["name-input.css"]
28
+ };
29
+ }
30
+ static get styleUrls() {
31
+ return {
32
+ "$": ["name-input.css"]
33
+ };
34
+ }
35
+ static get properties() {
36
+ return {
37
+ "value": {
38
+ "type": "string",
39
+ "mutable": false,
40
+ "complexType": {
41
+ "original": "string",
42
+ "resolved": "string",
43
+ "references": {}
44
+ },
45
+ "required": false,
46
+ "optional": false,
47
+ "docs": {
48
+ "tags": [],
49
+ "text": ""
50
+ },
51
+ "attribute": "value",
52
+ "reflect": false
53
+ },
54
+ "loading": {
55
+ "type": "boolean",
56
+ "mutable": false,
57
+ "complexType": {
58
+ "original": "boolean",
59
+ "resolved": "boolean",
60
+ "references": {}
61
+ },
62
+ "required": false,
63
+ "optional": false,
64
+ "docs": {
65
+ "tags": [],
66
+ "text": ""
67
+ },
68
+ "attribute": "loading",
69
+ "reflect": false
70
+ },
71
+ "applyName": {
72
+ "type": "unknown",
73
+ "mutable": false,
74
+ "complexType": {
75
+ "original": "(value: string) => void",
76
+ "resolved": "(value: string) => void",
77
+ "references": {}
78
+ },
79
+ "required": false,
80
+ "optional": false,
81
+ "docs": {
82
+ "tags": [],
83
+ "text": ""
84
+ }
85
+ },
86
+ "cancel": {
87
+ "type": "unknown",
88
+ "mutable": false,
89
+ "complexType": {
90
+ "original": "() => void",
91
+ "resolved": "() => void",
92
+ "references": {}
93
+ },
94
+ "required": false,
95
+ "optional": false,
96
+ "docs": {
97
+ "tags": [],
98
+ "text": ""
99
+ }
100
+ }
101
+ };
102
+ }
103
+ static get states() {
104
+ return {
105
+ "newValue": {},
106
+ "message": {}
107
+ };
108
+ }
109
+ }
110
+ //# sourceMappingURL=name-input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"name-input.js","sourceRoot":"","sources":["../../../../../../src/components/crm-bonus-form/subcomponents/name-input/name-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAM1D,MAAM,OAAO,SAAS;;;;;;;;;IAWlB,gBAAgB,CAAC,KAAU;QACvB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;IACvC,CAAC;IAGD,aAAa,CAAC,IAAY;QACtB,IAAG,CAAC,IAAI,EAAE,CAAC;YACP,IAAI,CAAC,OAAO,GAAG,kBAAkB,CAAC;YAClC,OAAM;QACV,CAAC;QAED,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;IAED,MAAM;QACF,OAAO,CACH,4DAAK,KAAK,EAAC,gBAAgB;YACvB,wEAAgB;YAChB,8DAAO,KAAK,EAAC,iBAAiB,EAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAI;YAEnH,4DAAK,IAAI,CAAC,OAAO,CAAM;YAMvB,4DAAK,KAAK,EAAC,eAAe;gBACtB,+DAAQ,KAAK,EAAC,eAAe,EAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,eAEzE;gBACT,+DAAQ,KAAK,EAAE,UAAU,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,IAE5H,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,uBAAiB,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,GAAG,CAExE,CACP,CACJ,CACT,CAAA;IACL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, Prop, State, h } from \"@stencil/core\";\n\n@Component({\n tag: 'name-input',\n styleUrl: 'name-input.css'\n})\nexport class NameInput {\n\n @Prop() value: string;\n\n @Prop() loading: boolean;\n @Prop() applyName: (value: string) => void;\n @Prop() cancel: () => void;\n \n @State() newValue: string;\n @State() message: string;\n\n handleChangeName(event: any) {\n this.newValue = event.target.value;\n }\n\n\n handleSetName(name: string) {\n if(!name) {\n this.message = \"Informe seu nome\";\n return\n }\n\n this.applyName(name);\n }\n\n render() {\n return (\n <div class=\"name-container\">\n <p>Seu Nome:</p>\n <input class=\"bc-form-control\" type=\"text\" value={this.value} onChange={(event) => this.handleChangeName(event)} />\n\n <p>{ this.message }</p>\n\n {/* <div class=\"bc-footer-btn\">\n <button class=\"bc-btn bc-btn-process\" onClick={() => this.applyName(this.newValue)} >Prosseguir</button>\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.handleSetName(this.newValue)}>\n {\n !this.loading ? \"Continua\" : <loading-spinner size=\"15px\" color=\"#fff\" />\n }\n </button>\n </div>\n </div>\n )\n }\n}"]}
@@ -0,0 +1,75 @@
1
+ import { h } from "@stencil/core";
2
+ export class PhoneInput {
3
+ constructor() {
4
+ this.sendPin = undefined;
5
+ this.loading = undefined;
6
+ this.value = undefined;
7
+ }
8
+ async validatePhone() {
9
+ const phone = await this.phoneInputMask.getPhone();
10
+ await this.sendPin(phone);
11
+ }
12
+ render() {
13
+ return (h("div", { key: '7388feb890331d696bf51ddc5690707673e06546', class: "form-container" }, h("phone-input-mask", { key: 'a3241090e731daa0b558503a9347de7a15f0025e', initialValue: this.value, ref: ref => this.phoneInputMask = ref }), h("button", { key: 'd36c5fd1b8cf7dfb0d3100450215c426855e82a6', class: `btn btn-success btnCrm ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.validatePhone() }, !this.loading ? "validar" : h("loading-spinner", { size: "11px", color: "#fff" }))));
14
+ }
15
+ static get is() { return "phone-input"; }
16
+ static get properties() {
17
+ return {
18
+ "sendPin": {
19
+ "type": "unknown",
20
+ "mutable": false,
21
+ "complexType": {
22
+ "original": "Function",
23
+ "resolved": "Function",
24
+ "references": {
25
+ "Function": {
26
+ "location": "global",
27
+ "id": "global::Function"
28
+ }
29
+ }
30
+ },
31
+ "required": false,
32
+ "optional": false,
33
+ "docs": {
34
+ "tags": [],
35
+ "text": ""
36
+ }
37
+ },
38
+ "loading": {
39
+ "type": "boolean",
40
+ "mutable": false,
41
+ "complexType": {
42
+ "original": "boolean",
43
+ "resolved": "boolean",
44
+ "references": {}
45
+ },
46
+ "required": false,
47
+ "optional": false,
48
+ "docs": {
49
+ "tags": [],
50
+ "text": ""
51
+ },
52
+ "attribute": "loading",
53
+ "reflect": false
54
+ },
55
+ "value": {
56
+ "type": "string",
57
+ "mutable": false,
58
+ "complexType": {
59
+ "original": "string",
60
+ "resolved": "string",
61
+ "references": {}
62
+ },
63
+ "required": false,
64
+ "optional": false,
65
+ "docs": {
66
+ "tags": [],
67
+ "text": ""
68
+ },
69
+ "attribute": "value",
70
+ "reflect": false
71
+ }
72
+ };
73
+ }
74
+ }
75
+ //# sourceMappingURL=phone.input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phone.input.js","sourceRoot":"","sources":["../../../../../../src/components/crm-bonus-form/subcomponents/phone/phone.input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAKnD,MAAM,OAAO,UAAU;;;;;;IAQnB,KAAK,CAAC,aAAa;QACf,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC;QACnD,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED,MAAM;QACF,OAAO,CACH,4DAAK,KAAK,EAAC,gBAAgB;YACvB,yEAAkB,YAAY,EAAE,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,cAAc,GAAG,GAAG,GAAI;YACrF,+DAAQ,KAAK,EAAE,0BAA0B,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE,IAE/H,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,uBAAiB,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,GAAG,CAEvE,CACP,CACT,CAAA;IACL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, Prop, h } from \"@stencil/core\";\n\n@Component({\n tag: 'phone-input'\n})\nexport class PhoneInput {\n\n private phoneInputMask: HTMLPhoneInputMaskElement;\n\n @Prop() sendPin: Function;\n @Prop() loading: boolean;\n @Prop() value: string;\n\n async validatePhone() {\n const phone = await this.phoneInputMask.getPhone();\n await this.sendPin(phone);\n }\n\n render() {\n return (\n <div class=\"form-container\">\n <phone-input-mask initialValue={this.value} ref={ref => this.phoneInputMask = ref} />\n <button class={`btn btn-success btnCrm ${this.loading ? 'disabled' : ''} `} disabled={this.loading} onClick={() => this.validatePhone()}>\n {\n !this.loading ? \"validar\" : <loading-spinner size=\"11px\" color=\"#fff\" />\n }\n </button>\n </div>\n )\n }\n}"]}
@@ -0,0 +1,75 @@
1
+ import { h } from "@stencil/core";
2
+ export class PhoneCancelInput {
3
+ constructor() {
4
+ this.sendPin = undefined;
5
+ this.loading = undefined;
6
+ this.value = undefined;
7
+ }
8
+ async validatePhone() {
9
+ const phone = await this.phoneInputMask.getPhone();
10
+ await this.sendPin(phone);
11
+ }
12
+ render() {
13
+ return (h("div", { key: '04c879b5671b42602a36a9a88734604fcfa1d1da', class: "form-container" }, h("phone-input-mask", { key: 'a0ced8d74da25026383eac206bbf45f6fa9482e7', initialValue: `Valor aplicado R$ ${this.value}`, ref: ref => this.phoneInputMask = ref, disabled: true }), h("button", { key: '89b08e7af3145068a449fb8e375372c280da7b7a', class: `btn btn-success btnCrm ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.validatePhone() }, !this.loading ? "Cancelar" : h("loading-spinner", { size: "11px", color: "#fff" }))));
14
+ }
15
+ static get is() { return "phone-cancel-input"; }
16
+ static get properties() {
17
+ return {
18
+ "sendPin": {
19
+ "type": "unknown",
20
+ "mutable": false,
21
+ "complexType": {
22
+ "original": "Function",
23
+ "resolved": "Function",
24
+ "references": {
25
+ "Function": {
26
+ "location": "global",
27
+ "id": "global::Function"
28
+ }
29
+ }
30
+ },
31
+ "required": false,
32
+ "optional": false,
33
+ "docs": {
34
+ "tags": [],
35
+ "text": ""
36
+ }
37
+ },
38
+ "loading": {
39
+ "type": "boolean",
40
+ "mutable": false,
41
+ "complexType": {
42
+ "original": "boolean",
43
+ "resolved": "boolean",
44
+ "references": {}
45
+ },
46
+ "required": false,
47
+ "optional": false,
48
+ "docs": {
49
+ "tags": [],
50
+ "text": ""
51
+ },
52
+ "attribute": "loading",
53
+ "reflect": false
54
+ },
55
+ "value": {
56
+ "type": "string",
57
+ "mutable": false,
58
+ "complexType": {
59
+ "original": "string",
60
+ "resolved": "string",
61
+ "references": {}
62
+ },
63
+ "required": false,
64
+ "optional": false,
65
+ "docs": {
66
+ "tags": [],
67
+ "text": ""
68
+ },
69
+ "attribute": "value",
70
+ "reflect": false
71
+ }
72
+ };
73
+ }
74
+ }
75
+ //# sourceMappingURL=phone.cancel.input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phone.cancel.input.js","sourceRoot":"","sources":["../../../../../../src/components/crm-bonus-form/subcomponents/phone-cancel/phone.cancel.input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAKnD,MAAM,OAAO,gBAAgB;;;;;;IAQzB,KAAK,CAAC,aAAa;QACf,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC;QACnD,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED,MAAM;QACF,OAAO,CACH,4DAAK,KAAK,EAAC,gBAAgB;YACvB,yEAAkB,YAAY,EAAE,qBAAqB,IAAI,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,cAAc,GAAG,GAAG,EAAE,QAAQ,EAAE,IAAI,GAAI;YAC5H,+DAAQ,KAAK,EAAE,0BAA0B,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE,IAE/H,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,uBAAiB,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,GAAG,CAExE,CACP,CACT,CAAA;IACL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, Prop, h } from \"@stencil/core\";\n\n@Component({\n tag: 'phone-cancel-input'\n})\nexport class PhoneCancelInput {\n\n private phoneInputMask: HTMLPhoneInputMaskElement;\n\n @Prop() sendPin: Function;\n @Prop() loading: boolean;\n @Prop() value: string;\n\n async validatePhone() {\n const phone = await this.phoneInputMask.getPhone();\n await this.sendPin(phone);\n }\n\n render() {\n return (\n <div class=\"form-container\">\n <phone-input-mask initialValue={`Valor aplicado R$ ${this.value}`} ref={ref => this.phoneInputMask = ref} disabled={true} />\n <button class={`btn btn-success btnCrm ${this.loading ? 'disabled' : ''} `} disabled={this.loading} onClick={() => this.validatePhone()}>\n {\n !this.loading ? \"Cancelar\" : <loading-spinner size=\"11px\" color=\"#fff\" />\n }\n </button>\n </div>\n )\n }\n}"]}
@@ -0,0 +1,74 @@
1
+ * {
2
+ margin: 0;
3
+ padding: 0;
4
+ box-sizing: border-box;
5
+ }
6
+
7
+ :host {
8
+ --crmfont-sizebodymd: 14px;
9
+ --crmline-heightbodymd: 20px;
10
+ --crmletter-spacingtitle-md: 0px
11
+ }
12
+
13
+ .container-message {
14
+ font-family: Roboto;
15
+ font-size: var(--crmfont-sizebodymd);
16
+ font-weight: 400;
17
+ line-height: var(--crmline-heightbodymd);
18
+ letter-spacing: var(--crmletter-spacingtitle-md);
19
+ text-align: left;
20
+ text-underline-position: from-font;
21
+ text-decoration-skip-ink: none;
22
+ }
23
+
24
+ .crm-container-form {
25
+ display: flex;
26
+ flex-direction: column;
27
+ justify-content: space-around;
28
+ height: auto;
29
+ padding: 20px 24px 20px 24px;
30
+ border: 1px solid #CCCC;
31
+ writing-mode: horizontal-tb;
32
+ gap: 16px;
33
+ border-top: 1px solid #ccc !important;
34
+ border-bottom: 1px solid #ccc !important;
35
+ }
36
+
37
+ /* .fbits-responsive-carrinho-desconto {
38
+ overflow: hidden;
39
+ border: 1px solid #ccc;
40
+ border-top: 0;
41
+ border-bottom: 0;
42
+ } */
43
+
44
+ .crm-phone-form {
45
+ display: flex;
46
+ flex-direction: column;
47
+ height: 100%;
48
+ /* justify-content: space-around; */
49
+ gap: 16px;
50
+ }
51
+
52
+ .crm-subtitle {
53
+ font-size: 14px;
54
+ color: var(--crm-btn);
55
+ }
56
+
57
+ .crm-title {
58
+ font-weight: 700;
59
+ line-height: 20px;
60
+ color: #262626;
61
+ font-size: 16px;
62
+ }
63
+
64
+ .crm-message-info {
65
+ color: #619013;
66
+ font-weight: 500;
67
+ font-size: 12px;
68
+ }
69
+
70
+ .crm-message-error {
71
+ color: #E11D48;
72
+ font-weight: 500;
73
+ font-size: 12px;
74
+ }
@@ -0,0 +1,248 @@
1
+ import { h } from "@stencil/core";
2
+ import { CrmBonusService } from "../../services/crmbonus.service";
3
+ import { StepFormEnum } from "../../contants";
4
+ import { getInfoCustomization } from "../../helpers/info.config.helper";
5
+ import i18next from "../../i18n/i18n";
6
+ export class CrmBonus {
7
+ constructor() {
8
+ // private phoneInputMask: HTMLPhoneFormElement;
9
+ this.crmBonusService = CrmBonusService.getInstance();
10
+ this.storeName = undefined;
11
+ this.cartId = undefined;
12
+ this.products = undefined;
13
+ this.value = undefined;
14
+ this.loading = false;
15
+ this.message = undefined;
16
+ this.phone = undefined;
17
+ this.pinInfo = undefined;
18
+ this.step = StepFormEnum.STEP_PHONE;
19
+ this.bonus = undefined;
20
+ this.sucess = "";
21
+ this.error = "";
22
+ this.config = undefined;
23
+ }
24
+ async handleSendPin(phone) {
25
+ this.message = "";
26
+ if (!phone) {
27
+ this.message = "Informe seu telefone";
28
+ return;
29
+ }
30
+ this.phone = phone;
31
+ this.sendPin();
32
+ }
33
+ componentWillLoad() {
34
+ this.sucess = "";
35
+ this.error = "";
36
+ this.config = getInfoCustomization(this.storeName);
37
+ }
38
+ convertStringToNumber() {
39
+ const _phone = this.phone.replace(/\D/g, '');
40
+ return Number(_phone);
41
+ }
42
+ async sendPin() {
43
+ var _a, _b;
44
+ this.loading = true;
45
+ this.message = "";
46
+ this.sucess = "";
47
+ this.error = "";
48
+ try {
49
+ const _phone = this.convertStringToNumber();
50
+ this.pinInfo = await this.crmBonusService.sendPin(_phone, "", this.storeName);
51
+ this.step = StepFormEnum.STEP_PIN;
52
+ }
53
+ catch (error) {
54
+ 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;
55
+ }
56
+ finally {
57
+ this.loading = false;
58
+ }
59
+ }
60
+ changePhone() {
61
+ this.sucess = "";
62
+ this.error = "";
63
+ this.step = StepFormEnum.STEP_PHONE;
64
+ }
65
+ async validateBonus(pin) {
66
+ var _a, _b;
67
+ if (this.sucess) {
68
+ this.step = StepFormEnum.STEP_RESERVE;
69
+ return;
70
+ }
71
+ this.loading = true;
72
+ this.sucess = "";
73
+ this.error = "";
74
+ const payload = {
75
+ pin: pin,
76
+ cellphone: this.phone.toString(),
77
+ storeId: this.pinInfo.storeId.toString(),
78
+ userId: this.pinInfo.userId.toString(),
79
+ checkoutId: this.cartId,
80
+ checkoutProducts: this.products,
81
+ name: null,
82
+ storeName: this.storeName
83
+ };
84
+ try {
85
+ this.bonus = await this.crmBonusService.validatePinBonus(payload);
86
+ this.sucess = "Código validado com sucesso!";
87
+ }
88
+ catch (error) {
89
+ const _error = (_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;
90
+ if (_error.includes("Pin")) {
91
+ this.error = "Código inválido!";
92
+ }
93
+ else {
94
+ this.error = _error;
95
+ this.step = StepFormEnum.STEP_NO_BONUS;
96
+ }
97
+ }
98
+ finally {
99
+ this.loading = false;
100
+ }
101
+ }
102
+ handleCancel() {
103
+ // this.step = StepFormEnum.STEP_PHONE;
104
+ this.cancel();
105
+ }
106
+ async cancel() {
107
+ this.message = "";
108
+ this.loading = true;
109
+ try {
110
+ await this.crmBonusService.cancel(this.cartId);
111
+ // localStorage.removeItem(this.cartId);
112
+ this.save(0);
113
+ }
114
+ catch (error) {
115
+ this.message = "Não consegui cancelar o bônus, tente novamente!";
116
+ }
117
+ finally {
118
+ this.loading = false;
119
+ }
120
+ }
121
+ async reserveApply(amount) {
122
+ this.loading = true;
123
+ this.message = "";
124
+ try {
125
+ await this.reserve(amount);
126
+ console.log('[reserva]');
127
+ this.save(amount);
128
+ }
129
+ catch (error) {
130
+ this.message = "ocorreu um error ao solicitar a aplicação do bonus! tente novamente";
131
+ this.step = StepFormEnum.STEP_NO_BONUS;
132
+ localStorage.removeItem(this.cartId);
133
+ }
134
+ finally {
135
+ this.loading = false;
136
+ }
137
+ }
138
+ save(amount) {
139
+ localStorage.setItem(this.cartId, amount.toString());
140
+ }
141
+ async reserve(amount) {
142
+ await this.crmBonusService.reserve({
143
+ redeemedBonus: amount,
144
+ cartId: this.cartId,
145
+ ticket: this.cartId,
146
+ grossValue: Number(this.bonus.totalValue),
147
+ storeName: this.storeName,
148
+ storeId: this.bonus.storeId.toString(),
149
+ userId: this.bonus.userId
150
+ });
151
+ }
152
+ render() {
153
+ return (h("div", { key: 'afea5248815bfd251530e6bb478f10fb77d66e80', class: "crm-container-form fbits-responsive-carrinho-desconto" }, h("label", { key: 'ca9d612fe43f33d2059a2862498b5e805d095874', class: "crm-title" }, this.config.giftbackTitle), this.step === StepFormEnum.STEP_PHONE &&
154
+ h("phone-form", { key: '5e9828d6f2b446b6e16ab88bab60457d9a0cd77b', config: this.config, loading: this.loading, handlerSubmit: (phone) => this.handleSendPin(phone) }), this.step === StepFormEnum.STEP_PIN &&
155
+ h("pin-form", { key: '98036eeba6369fea63c9232b3b19ce168bd81034', config: this.config, phone: this.phone, cancel: () => this.changePhone(), resend: () => this.sendPin(), validate: (data) => this.validateBonus(data), loading: this.loading }, this.sucess && h("p", { key: 'cdf4846773d001e68993254bb3715990cfe07079', class: "crm-message-info" }, this.sucess), this.error && h("p", { key: 'c04aad3cfcd4514b3b3bd8216b24e3387ede62dc', class: "crm-message-error" }, this.error)), this.step === StepFormEnum.STEP_RESERVE &&
156
+ h("giftback-info", { key: 'b9971e3fd27458523808e5630e81115f3456476f', loading: this.loading, cancel: () => this.handleCancel(), bonus: this.bonus, reserve: (amountRedeemed) => this.reserveApply(amountRedeemed) }), this.step === StepFormEnum.STEP_NO_BONUS &&
157
+ (h("div", { key: '82dfc1e9589368b4ba1bb06297007da4d9d236f5', class: "container-message" }, i18next.t("noGiftback", { storename: this.config.giftbackTitle })))));
158
+ }
159
+ static get is() { return "crm-giftback-form"; }
160
+ static get originalStyleUrls() {
161
+ return {
162
+ "$": ["giftback-form.css"]
163
+ };
164
+ }
165
+ static get styleUrls() {
166
+ return {
167
+ "$": ["giftback-form.css"]
168
+ };
169
+ }
170
+ static get properties() {
171
+ return {
172
+ "storeName": {
173
+ "type": "any",
174
+ "mutable": false,
175
+ "complexType": {
176
+ "original": "any",
177
+ "resolved": "any",
178
+ "references": {}
179
+ },
180
+ "required": false,
181
+ "optional": false,
182
+ "docs": {
183
+ "tags": [],
184
+ "text": ""
185
+ },
186
+ "attribute": "storename",
187
+ "reflect": false
188
+ },
189
+ "cartId": {
190
+ "type": "any",
191
+ "mutable": false,
192
+ "complexType": {
193
+ "original": "any",
194
+ "resolved": "any",
195
+ "references": {}
196
+ },
197
+ "required": false,
198
+ "optional": false,
199
+ "docs": {
200
+ "tags": [],
201
+ "text": ""
202
+ },
203
+ "attribute": "cart-id",
204
+ "reflect": false
205
+ },
206
+ "products": {
207
+ "type": "unknown",
208
+ "mutable": false,
209
+ "complexType": {
210
+ "original": "Array<IProduct>",
211
+ "resolved": "IProduct[]",
212
+ "references": {
213
+ "Array": {
214
+ "location": "global",
215
+ "id": "global::Array"
216
+ },
217
+ "IProduct": {
218
+ "location": "import",
219
+ "path": "../../dto/validate.pin.bonus",
220
+ "id": "src/dto/validate.pin.bonus.ts::IProduct"
221
+ }
222
+ }
223
+ },
224
+ "required": false,
225
+ "optional": false,
226
+ "docs": {
227
+ "tags": [],
228
+ "text": ""
229
+ }
230
+ }
231
+ };
232
+ }
233
+ static get states() {
234
+ return {
235
+ "value": {},
236
+ "loading": {},
237
+ "message": {},
238
+ "phone": {},
239
+ "pinInfo": {},
240
+ "step": {},
241
+ "bonus": {},
242
+ "sucess": {},
243
+ "error": {},
244
+ "config": {}
245
+ };
246
+ }
247
+ }
248
+ //# sourceMappingURL=giftback-form.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"giftback-form.js","sourceRoot":"","sources":["../../../../src/components/giftback-form/giftback-form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAAc,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAEpF,OAAO,OAAO,MAAM,iBAAiB,CAAA;AAMrC,MAAM,OAAO,QAAQ;;QACnB,gDAAgD;QAExC,oBAAe,GAAoB,eAAe,CAAC,WAAW,EAAE,CAAC;;;;;uBAO7C,KAAK;;;;oBAIH,YAAY,CAAC,UAAU;;sBAG3B,EAAE;qBACH,EAAE;;;IAG3B,KAAK,CAAC,aAAa,CAAC,KAAa;QAE/B,IAAI,CAAC,OAAO,GAAG,EAAE,CAAA;QACjB,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,IAAI,CAAC,OAAO,GAAG,sBAAsB,CAAC;YACtC,OAAO;QACT,CAAC;QAED,IAAI,CAAC,KAA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,EAAE,IAAI,CAAC,OAAO;oBAEpB,IAAI,CAAC,MAAM,IAAI,0DAAG,KAAK,EAAC,kBAAkB,IAAE,IAAI,CAAC,MAAM,CAAK;oBAC5D,IAAI,CAAC,KAAK,IAAI,0DAAG,KAAK,EAAC,mBAAmB,IAAE,IAAI,CAAC,KAAK,CAAK,CAEnD;YAIX,IAAI,CAAC,IAAI,KAAK,YAAY,CAAC,YAAY;gBACvC,sEACE,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE,EACjC,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,OAAO,EAAE,CAAC,cAAsB,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,GACtE;YAKF,IAAI,CAAC,IAAI,KAAK,YAAY,CAAC,aAAa;gBACxC,CACE,4DAAK,KAAK,EAAC,mBAAmB,IAC3B,OAAO,CAAC,CAAC,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC,CAC9D,CACP,CAGC,CACP,CAAA;IACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, State, h } from \"@stencil/core\";\nimport { CrmBonusService } from \"../../services/crmbonus.service\";\nimport { StepFormEnum } from \"../../contants\";\nimport { IPinSent } from '../../dto/pin.sent'\nimport { IBonus, IProccesPinBonusDto, IProduct } from \"../../dto/validate.pin.bonus\";\nimport { IInfoStore, getInfoCustomization } from \"../../helpers/info.config.helper\";\n\nimport i18next from \"../../i18n/i18n\"\n\n@Component({\n tag: 'crm-giftback-form',\n styleUrl: 'giftback-form.css'\n})\nexport class CrmBonus {\n // private phoneInputMask: HTMLPhoneFormElement;\n\n private crmBonusService: CrmBonusService = CrmBonusService.getInstance();\n\n @Prop({ attribute: 'storename' }) storeName;\n @Prop() cartId;\n @Prop() products: Array<IProduct>;\n\n @State() value: string;\n @State() loading: boolean = false;\n @State() message: string;\n @State() phone: string;\n @State() pinInfo: IPinSent;\n @State() step: StepFormEnum = StepFormEnum.STEP_PHONE;\n @State() bonus: IBonus;\n\n @State() sucess: string = \"\";\n @State() error: string = \"\";\n @State() config: IInfoStore;\n\n async handleSendPin(phone: string) {\n\n this.message = \"\"\n if (!phone) {\n this.message = \"Informe seu telefone\";\n return;\n }\n\n this.phone = phone;\n\n this.sendPin()\n }\n\n componentWillLoad() {\n this.sucess = \"\";\n this.error = \"\"\n this.config = getInfoCustomization(this.storeName);\n }\n\n private convertStringToNumber(): number {\n const _phone = this.phone.replace(/\\D/g, '');\n return Number(_phone);\n }\n\n public async sendPin() {\n this.loading = true;\n this.message = \"\";\n this.sucess = \"\";\n this.error = \"\"\n\n try {\n\n const _phone = this.convertStringToNumber()\n\n this.pinInfo = await this.crmBonusService.sendPin(_phone, \"\", this.storeName);\n\n this.step = StepFormEnum.STEP_PIN;\n\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false\n }\n }\n\n changePhone() {\n this.sucess = \"\";\n this.error = \"\"\n this.step = StepFormEnum.STEP_PHONE;\n }\n\n public async validateBonus(pin: string) {\n\n if (this.sucess) {\n this.step = StepFormEnum.STEP_RESERVE;\n return\n }\n\n this.loading = true;\n this.sucess = \"\";\n this.error = \"\";\n const payload: IProccesPinBonusDto = {\n pin: pin,\n cellphone: this.phone.toString(),\n storeId: this.pinInfo.storeId.toString(),\n userId: this.pinInfo.userId.toString(),\n checkoutId: this.cartId,\n checkoutProducts: this.products,\n name: null,\n storeName: this.storeName\n }\n\n try {\n this.bonus = await this.crmBonusService.validatePinBonus(payload);\n\n this.sucess = \"Código validado com sucesso!\";\n\n } catch (error) {\n const _error: string = error?.response?.data?.message;\n\n if (_error.includes(\"Pin\")) {\n this.error = \"Código inválido!\"\n } else {\n this.error = _error;\n this.step = StepFormEnum.STEP_NO_BONUS;\n }\n \n\n } finally {\n this.loading = false;\n }\n }\n\n public handleCancel() {\n // this.step = StepFormEnum.STEP_PHONE;\n this.cancel()\n }\n\n async cancel() {\n this.message = \"\";\n this.loading = true;\n try {\n await this.crmBonusService.cancel(this.cartId);\n // localStorage.removeItem(this.cartId);\n this.save(0)\n } catch (error) {\n this.message = \"Não consegui cancelar o bônus, tente novamente!\"\n } finally {\n this.loading = false;\n }\n }\n\n public async reserveApply(amount: number) {\n this.loading = true;\n this.message = \"\";\n try {\n await this.reserve(amount);\n\n console.log('[reserva]')\n\n this.save(amount);\n } catch (error) {\n this.message = \"ocorreu um error ao solicitar a aplicação do bonus! tente novamente\"\n\n this.step = StepFormEnum.STEP_NO_BONUS;\n localStorage.removeItem(this.cartId);\n } finally {\n this.loading = false;\n }\n }\n\n save(amount: number) {\n localStorage.setItem(this.cartId, amount.toString());\n }\n\n public async reserve(amount: number) {\n\n await this.crmBonusService.reserve({\n redeemedBonus: amount,\n cartId: this.cartId,\n ticket: this.cartId,\n grossValue: Number(this.bonus.totalValue),\n storeName: this.storeName,\n storeId: this.bonus.storeId.toString(),\n userId: this.bonus.userId\n });\n }\n\n render() {\n return (\n <div class=\"crm-container-form fbits-responsive-carrinho-desconto\" >\n <label class=\"crm-title\">{this.config.giftbackTitle}</label>\n\n {this.step === StepFormEnum.STEP_PHONE &&\n <phone-form\n config={this.config}\n loading={this.loading}\n handlerSubmit={(phone) => this.handleSendPin(phone)}\n />}\n {\n this.step === StepFormEnum.STEP_PIN &&\n <pin-form\n config={this.config}\n phone={this.phone}\n cancel={() => this.changePhone()}\n resend={() => this.sendPin()}\n validate={(data) => this.validateBonus(data)}\n loading={this.loading}\n >\n {this.sucess && <p class=\"crm-message-info\">{this.sucess}</p>}\n {this.error && <p class=\"crm-message-error\">{this.error}</p>}\n\n </pin-form>\n }\n\n {\n this.step === StepFormEnum.STEP_RESERVE &&\n <giftback-info\n loading={this.loading}\n cancel={() => this.handleCancel()}\n bonus={this.bonus}\n reserve={(amountRedeemed: number) => this.reserveApply(amountRedeemed)}\n />\n }\n\n\n {\n this.step === StepFormEnum.STEP_NO_BONUS &&\n (\n <div class=\"container-message\">\n {i18next.t(\"noGiftback\", { storename: this.config.giftbackTitle })}\n </div>\n )\n\n }\n </div>\n )\n }\n}"]}