adp-web-components 0.0.63 → 0.0.65

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 (317) hide show
  1. package/package.json +1 -1
  2. package/dist/cjs/app-globals-4aa8f46f.js +0 -46
  3. package/dist/cjs/cn-f559f9e5.js +0 -2588
  4. package/dist/cjs/contact-us-form.cjs.entry.js +0 -209
  5. package/dist/cjs/dead-stock-lookup_3.cjs.entry.js +0 -445
  6. package/dist/cjs/dynamic-claim_6.cjs.entry.js +0 -1154
  7. package/dist/cjs/dynamic-redeem.cjs.entry.js +0 -156
  8. package/dist/cjs/form-dialog_8.cjs.entry.js +0 -503
  9. package/dist/cjs/get-local-language-18a7ccf5.js +0 -2380
  10. package/dist/cjs/index-603d8f32.js +0 -1610
  11. package/dist/cjs/index.cjs.js +0 -6
  12. package/dist/cjs/loader-baf2418b.js +0 -9
  13. package/dist/cjs/loader.cjs.js +0 -19
  14. package/dist/cjs/loading-spinner.cjs.entry.js +0 -27
  15. package/dist/cjs/part-lookup.cjs.entry.js +0 -129
  16. package/dist/cjs/service-booking-form.cjs.entry.js +0 -209
  17. package/dist/cjs/shift-components.cjs.js +0 -29
  18. package/dist/cjs/urls-9077b31c.js +0 -4874
  19. package/dist/cjs/vehicle-lookup.cjs.entry.js +0 -202
  20. package/dist/collection/collection-manifest.json +0 -35
  21. package/dist/collection/components/components/loading-spinner.css +0 -1
  22. package/dist/collection/components/components/loading-spinner.js +0 -47
  23. package/dist/collection/components/form-elements/form-dialog.css +0 -1
  24. package/dist/collection/components/form-elements/form-dialog.js +0 -137
  25. package/dist/collection/components/form-elements/form-input.css +0 -1
  26. package/dist/collection/components/form-elements/form-input.js +0 -323
  27. package/dist/collection/components/form-elements/form-select.css +0 -1
  28. package/dist/collection/components/form-elements/form-select.js +0 -400
  29. package/dist/collection/components/form-elements/form-shadow-input.css +0 -1
  30. package/dist/collection/components/form-elements/form-shadow-input.js +0 -100
  31. package/dist/collection/components/form-elements/form-structure-error.css +0 -1
  32. package/dist/collection/components/form-elements/form-structure-error.js +0 -72
  33. package/dist/collection/components/form-elements/form-structure.css +0 -1
  34. package/dist/collection/components/form-elements/form-structure.js +0 -269
  35. package/dist/collection/components/form-elements/form-submit.css +0 -1
  36. package/dist/collection/components/form-elements/form-submit.js +0 -140
  37. package/dist/collection/components/form-elements/form-text-area.css +0 -1
  38. package/dist/collection/components/form-elements/form-text-area.js +0 -264
  39. package/dist/collection/components/forms/contact-us/element-mapper.js +0 -87
  40. package/dist/collection/components/forms/contact-us/form.css +0 -1
  41. package/dist/collection/components/forms/contact-us/validations.js +0 -19
  42. package/dist/collection/components/forms/contact-us-form.js +0 -280
  43. package/dist/collection/components/forms/service-booking/element-mapper.js +0 -87
  44. package/dist/collection/components/forms/service-booking/form.css +0 -1
  45. package/dist/collection/components/forms/service-booking/validations.js +0 -19
  46. package/dist/collection/components/forms/service-booking-form.js +0 -280
  47. package/dist/collection/components/part-lookup/dead-stock-lookup.css +0 -1
  48. package/dist/collection/components/part-lookup/dead-stock-lookup.js +0 -405
  49. package/dist/collection/components/part-lookup/distributor-lookup.css +0 -1
  50. package/dist/collection/components/part-lookup/distributor-lookup.js +0 -470
  51. package/dist/collection/components/part-lookup/manufacturer-lookup.css +0 -1
  52. package/dist/collection/components/part-lookup/manufacturer-lookup.js +0 -468
  53. package/dist/collection/components/part-lookup/part-lookup.css +0 -1
  54. package/dist/collection/components/part-lookup/part-lookup.js +0 -376
  55. package/dist/collection/components/vehicle-lookup/assets/cancelled.svg +0 -8
  56. package/dist/collection/components/vehicle-lookup/assets/check.svg +0 -4
  57. package/dist/collection/components/vehicle-lookup/assets/expired.svg +0 -9
  58. package/dist/collection/components/vehicle-lookup/assets/loader.svg +0 -11
  59. package/dist/collection/components/vehicle-lookup/assets/pending.svg +0 -9
  60. package/dist/collection/components/vehicle-lookup/assets/processed.svg +0 -9
  61. package/dist/collection/components/vehicle-lookup/assets/x-mark.svg +0 -4
  62. package/dist/collection/components/vehicle-lookup/components/CardsContainer.js +0 -10
  63. package/dist/collection/components/vehicle-lookup/components/Loading.js +0 -10
  64. package/dist/collection/components/vehicle-lookup/components/SSCTable.js +0 -16
  65. package/dist/collection/components/vehicle-lookup/components/StatusCard.js +0 -11
  66. package/dist/collection/components/vehicle-lookup/dynamic-claim.css +0 -1
  67. package/dist/collection/components/vehicle-lookup/dynamic-claim.js +0 -625
  68. package/dist/collection/components/vehicle-lookup/dynamic-redeem.css +0 -1
  69. package/dist/collection/components/vehicle-lookup/dynamic-redeem.js +0 -373
  70. package/dist/collection/components/vehicle-lookup/paint-thickness.css +0 -1
  71. package/dist/collection/components/vehicle-lookup/paint-thickness.js +0 -410
  72. package/dist/collection/components/vehicle-lookup/service-history.css +0 -1
  73. package/dist/collection/components/vehicle-lookup/service-history.js +0 -393
  74. package/dist/collection/components/vehicle-lookup/vehicle-accessories.css +0 -1
  75. package/dist/collection/components/vehicle-lookup/vehicle-accessories.js +0 -414
  76. package/dist/collection/components/vehicle-lookup/vehicle-lookup.css +0 -1
  77. package/dist/collection/components/vehicle-lookup/vehicle-lookup.js +0 -405
  78. package/dist/collection/components/vehicle-lookup/vehicle-specification.css +0 -1
  79. package/dist/collection/components/vehicle-lookup/vehicle-specification.js +0 -389
  80. package/dist/collection/components/vehicle-lookup/warranty-details.css +0 -1
  81. package/dist/collection/components/vehicle-lookup/warranty-details.js +0 -780
  82. package/dist/collection/global/api/partInformation.js +0 -32
  83. package/dist/collection/global/api/urls.js +0 -6
  84. package/dist/collection/global/api/vehicleInformation.js +0 -48
  85. package/dist/collection/global/assets/eye.svg +0 -5
  86. package/dist/collection/global/assets/loader.svg +0 -11
  87. package/dist/collection/global/assets/white-loader.svg +0 -11
  88. package/dist/collection/global/lib/cn.js +0 -9
  89. package/dist/collection/global/lib/form-hook.js +0 -162
  90. package/dist/collection/global/lib/general.js +0 -9
  91. package/dist/collection/global/lib/get-local-language.js +0 -20
  92. package/dist/collection/global/lib/image-expansion.js +0 -69
  93. package/dist/collection/global/lib/middleware.js +0 -39
  94. package/dist/collection/global/lib/recaptcha.js +0 -25
  95. package/dist/collection/global/lib/utils.js +0 -7
  96. package/dist/collection/global/lib/validate-form-structure.js +0 -47
  97. package/dist/collection/global/lib/validate-vin.js +0 -62
  98. package/dist/collection/global/types/components.js +0 -1
  99. package/dist/collection/global/types/forms.js +0 -1
  100. package/dist/collection/global/types/general.js +0 -1
  101. package/dist/collection/global/types/locales/error-schema.js +0 -17
  102. package/dist/collection/global/types/locales/forms/contact-us-schema.js +0 -24
  103. package/dist/collection/global/types/locales/forms/index.js +0 -11
  104. package/dist/collection/global/types/locales/general.js +0 -11
  105. package/dist/collection/global/types/locales/index.js +0 -33
  106. package/dist/collection/global/types/locales/inquiryTypes.js +0 -15
  107. package/dist/collection/global/types/locales/part-lookup/dead-stock-schema.js +0 -10
  108. package/dist/collection/global/types/locales/part-lookup/distributor-schema.js +0 -21
  109. package/dist/collection/global/types/locales/part-lookup/index.js +0 -13
  110. package/dist/collection/global/types/locales/part-lookup/manufacturer-schema.js +0 -22
  111. package/dist/collection/global/types/locales/vehicle-lookup/accessories-schema.js +0 -13
  112. package/dist/collection/global/types/locales/vehicle-lookup/dynamic-claim-schema.js +0 -21
  113. package/dist/collection/global/types/locales/vehicle-lookup/dynamic-redeem-schema.js +0 -19
  114. package/dist/collection/global/types/locales/vehicle-lookup/index.js +0 -21
  115. package/dist/collection/global/types/locales/vehicle-lookup/paint-thickness-schema.js +0 -14
  116. package/dist/collection/global/types/locales/vehicle-lookup/service-history-schema.js +0 -15
  117. package/dist/collection/global/types/locales/vehicle-lookup/specification-schema.js +0 -14
  118. package/dist/collection/global/types/locales/vehicle-lookup/warranty-schema.js +0 -23
  119. package/dist/collection/global/types/part-information.js +0 -1
  120. package/dist/collection/global/types/vehicle-information.js +0 -5
  121. package/dist/collection/index.js +0 -1
  122. package/dist/collection/templates/part-lookup/mock-data.js +0 -199
  123. package/dist/collection/templates/vehicle-lookup/mock-data.js +0 -4146
  124. package/dist/collection/templates/vehicle-lookup/vehicle-lookup.js +0 -285
  125. package/dist/collection/templates/vehicle-lookup/warranty-mock-data.js +0 -3000
  126. package/dist/components/contact-us-form.d.ts +0 -11
  127. package/dist/components/contact-us-form.js +0 -5
  128. package/dist/components/dead-stock-lookup.d.ts +0 -11
  129. package/dist/components/dead-stock-lookup.js +0 -5
  130. package/dist/components/distributor-lookup.d.ts +0 -11
  131. package/dist/components/distributor-lookup.js +0 -5
  132. package/dist/components/dynamic-claim.d.ts +0 -11
  133. package/dist/components/dynamic-claim.js +0 -5
  134. package/dist/components/dynamic-redeem.d.ts +0 -11
  135. package/dist/components/dynamic-redeem.js +0 -5
  136. package/dist/components/form-dialog.d.ts +0 -11
  137. package/dist/components/form-dialog.js +0 -5
  138. package/dist/components/form-input.d.ts +0 -11
  139. package/dist/components/form-input.js +0 -5
  140. package/dist/components/form-select.d.ts +0 -11
  141. package/dist/components/form-select.js +0 -5
  142. package/dist/components/form-shadow-input.d.ts +0 -11
  143. package/dist/components/form-shadow-input.js +0 -5
  144. package/dist/components/form-structure-error.d.ts +0 -11
  145. package/dist/components/form-structure-error.js +0 -5
  146. package/dist/components/form-structure.d.ts +0 -11
  147. package/dist/components/form-structure.js +0 -5
  148. package/dist/components/form-submit.d.ts +0 -11
  149. package/dist/components/form-submit.js +0 -5
  150. package/dist/components/form-text-area.d.ts +0 -11
  151. package/dist/components/form-text-area.js +0 -5
  152. package/dist/components/index.d.ts +0 -33
  153. package/dist/components/index.js +0 -5
  154. package/dist/components/loading-spinner.d.ts +0 -11
  155. package/dist/components/loading-spinner.js +0 -5
  156. package/dist/components/manufacturer-lookup.d.ts +0 -11
  157. package/dist/components/manufacturer-lookup.js +0 -5
  158. package/dist/components/p-0470fc51.js +0 -5
  159. package/dist/components/p-0cdfba30.js +0 -5
  160. package/dist/components/p-389eed80.js +0 -5
  161. package/dist/components/p-478117f0.js +0 -5
  162. package/dist/components/p-59e10e25.js +0 -5
  163. package/dist/components/p-69d1c33e.js +0 -5
  164. package/dist/components/p-6ec80da4.js +0 -5
  165. package/dist/components/p-6f732895.js +0 -5
  166. package/dist/components/p-75476014.js +0 -5
  167. package/dist/components/p-8b1d90d7.js +0 -5
  168. package/dist/components/p-8fa24168.js +0 -5
  169. package/dist/components/p-91129e05.js +0 -5
  170. package/dist/components/p-932ff922.js +0 -5
  171. package/dist/components/p-98d9e7ab.js +0 -5
  172. package/dist/components/p-a21e2e2e.js +0 -5
  173. package/dist/components/p-a793dc44.js +0 -5
  174. package/dist/components/p-aa673a70.js +0 -5
  175. package/dist/components/p-bf73c370.js +0 -5
  176. package/dist/components/p-c603ac5e.js +0 -5
  177. package/dist/components/p-cbaa5de0.js +0 -5
  178. package/dist/components/p-d0546e1e.js +0 -5
  179. package/dist/components/p-d43ef8c9.js +0 -5
  180. package/dist/components/p-d5ff7544.js +0 -5
  181. package/dist/components/p-d65dfa98.js +0 -5
  182. package/dist/components/p-d74f3ad8.js +0 -5
  183. package/dist/components/p-eec2a223.js +0 -5
  184. package/dist/components/p-fab97ac7.js +0 -5
  185. package/dist/components/paint-thickness.d.ts +0 -11
  186. package/dist/components/paint-thickness.js +0 -5
  187. package/dist/components/part-lookup.d.ts +0 -11
  188. package/dist/components/part-lookup.js +0 -5
  189. package/dist/components/service-booking-form.d.ts +0 -11
  190. package/dist/components/service-booking-form.js +0 -5
  191. package/dist/components/service-history.d.ts +0 -11
  192. package/dist/components/service-history.js +0 -5
  193. package/dist/components/vehicle-accessories.d.ts +0 -11
  194. package/dist/components/vehicle-accessories.js +0 -5
  195. package/dist/components/vehicle-lookup.d.ts +0 -11
  196. package/dist/components/vehicle-lookup.js +0 -5
  197. package/dist/components/vehicle-specification.d.ts +0 -11
  198. package/dist/components/vehicle-specification.js +0 -5
  199. package/dist/components/warranty-details.d.ts +0 -11
  200. package/dist/components/warranty-details.js +0 -5
  201. package/dist/esm/app-globals-68faa233.js +0 -44
  202. package/dist/esm/cn-cc419b94.js +0 -2586
  203. package/dist/esm/contact-us-form.entry.js +0 -205
  204. package/dist/esm/dead-stock-lookup_3.entry.js +0 -439
  205. package/dist/esm/dynamic-claim_6.entry.js +0 -1145
  206. package/dist/esm/dynamic-redeem.entry.js +0 -152
  207. package/dist/esm/form-dialog_8.entry.js +0 -492
  208. package/dist/esm/get-local-language-40614e53.js +0 -2375
  209. package/dist/esm/index-cac905b0.js +0 -1581
  210. package/dist/esm/index.js +0 -4
  211. package/dist/esm/loader-027b88af.js +0 -7
  212. package/dist/esm/loader.js +0 -15
  213. package/dist/esm/loading-spinner.entry.js +0 -23
  214. package/dist/esm/part-lookup.entry.js +0 -125
  215. package/dist/esm/service-booking-form.entry.js +0 -205
  216. package/dist/esm/shift-components.js +0 -24
  217. package/dist/esm/urls-e22234f9.js +0 -4870
  218. package/dist/esm/vehicle-lookup.entry.js +0 -198
  219. package/dist/index.cjs.js +0 -1
  220. package/dist/index.js +0 -1
  221. package/dist/locales/ar.json +0 -184
  222. package/dist/locales/en.json +0 -184
  223. package/dist/locales/ku.json +0 -184
  224. package/dist/locales/ru.json +0 -184
  225. package/dist/shift-components/index.esm.js +0 -4
  226. package/dist/shift-components/p-116b1698.entry.js +0 -5
  227. package/dist/shift-components/p-227d01ce.entry.js +0 -5
  228. package/dist/shift-components/p-2cf52456.entry.js +0 -5
  229. package/dist/shift-components/p-33561513.entry.js +0 -5
  230. package/dist/shift-components/p-446d908d.js +0 -5
  231. package/dist/shift-components/p-5bbbff4a.entry.js +0 -5
  232. package/dist/shift-components/p-65102e7a.js +0 -6
  233. package/dist/shift-components/p-777ff030.entry.js +0 -5
  234. package/dist/shift-components/p-932ff922.js +0 -5
  235. package/dist/shift-components/p-98d9e7ab.js +0 -5
  236. package/dist/shift-components/p-a21e2e2e.js +0 -5
  237. package/dist/shift-components/p-b131a56e.entry.js +0 -5
  238. package/dist/shift-components/p-c7d01b2c.entry.js +0 -5
  239. package/dist/shift-components/p-eab3606c.js +0 -5
  240. package/dist/shift-components/p-fda56efb.entry.js +0 -5
  241. package/dist/shift-components/shift-components.esm.js +0 -5
  242. package/dist/types/components/components/loading-spinner.d.ts +0 -4
  243. package/dist/types/components/form-elements/form-dialog.d.ts +0 -13
  244. package/dist/types/components/form-elements/form-input.d.ts +0 -28
  245. package/dist/types/components/form-elements/form-select.d.ts +0 -39
  246. package/dist/types/components/form-elements/form-shadow-input.d.ts +0 -9
  247. package/dist/types/components/form-elements/form-structure-error.d.ts +0 -8
  248. package/dist/types/components/form-elements/form-structure.d.ts +0 -23
  249. package/dist/types/components/form-elements/form-submit.d.ts +0 -12
  250. package/dist/types/components/form-elements/form-text-area.d.ts +0 -24
  251. package/dist/types/components/forms/contact-us/element-mapper.d.ts +0 -3
  252. package/dist/types/components/forms/contact-us/validations.d.ts +0 -26
  253. package/dist/types/components/forms/contact-us-form.d.ts +0 -32
  254. package/dist/types/components/forms/service-booking/element-mapper.d.ts +0 -3
  255. package/dist/types/components/forms/service-booking/validations.d.ts +0 -26
  256. package/dist/types/components/forms/service-booking-form.d.ts +0 -32
  257. package/dist/types/components/part-lookup/dead-stock-lookup.d.ts +0 -31
  258. package/dist/types/components/part-lookup/distributor-lookup.d.ts +0 -32
  259. package/dist/types/components/part-lookup/manufacturer-lookup.d.ts +0 -33
  260. package/dist/types/components/part-lookup/part-lookup.d.ts +0 -43
  261. package/dist/types/components/vehicle-lookup/components/CardsContainer.d.ts +0 -10
  262. package/dist/types/components/vehicle-lookup/components/Loading.d.ts +0 -5
  263. package/dist/types/components/vehicle-lookup/components/SSCTable.d.ts +0 -8
  264. package/dist/types/components/vehicle-lookup/components/StatusCard.d.ts +0 -12
  265. package/dist/types/components/vehicle-lookup/dynamic-claim.d.ts +0 -55
  266. package/dist/types/components/vehicle-lookup/dynamic-redeem.d.ts +0 -39
  267. package/dist/types/components/vehicle-lookup/paint-thickness.d.ts +0 -35
  268. package/dist/types/components/vehicle-lookup/service-history.d.ts +0 -30
  269. package/dist/types/components/vehicle-lookup/vehicle-accessories.d.ts +0 -35
  270. package/dist/types/components/vehicle-lookup/vehicle-lookup.d.ts +0 -53
  271. package/dist/types/components/vehicle-lookup/vehicle-specification.d.ts +0 -29
  272. package/dist/types/components/vehicle-lookup/warranty-details.d.ts +0 -57
  273. package/dist/types/components.d.ts +0 -760
  274. package/dist/types/global/api/partInformation.d.ts +0 -19
  275. package/dist/types/global/api/urls.d.ts +0 -2
  276. package/dist/types/global/api/vehicleInformation.d.ts +0 -33
  277. package/dist/types/global/lib/cn.d.ts +0 -2
  278. package/dist/types/global/lib/form-hook.d.ts +0 -47
  279. package/dist/types/global/lib/general.d.ts +0 -1
  280. package/dist/types/global/lib/get-local-language.d.ts +0 -2
  281. package/dist/types/global/lib/image-expansion.d.ts +0 -9
  282. package/dist/types/global/lib/middleware.d.ts +0 -0
  283. package/dist/types/global/lib/recaptcha.d.ts +0 -16
  284. package/dist/types/global/lib/utils.d.ts +0 -1
  285. package/dist/types/global/lib/validate-form-structure.d.ts +0 -3
  286. package/dist/types/global/lib/validate-vin.d.ts +0 -1
  287. package/dist/types/global/types/components.d.ts +0 -7
  288. package/dist/types/global/types/forms.d.ts +0 -63
  289. package/dist/types/global/types/general.d.ts +0 -23
  290. package/dist/types/global/types/locales/error-schema.d.ts +0 -23
  291. package/dist/types/global/types/locales/forms/contact-us-schema.d.ts +0 -37
  292. package/dist/types/global/types/locales/forms/index.d.ts +0 -45
  293. package/dist/types/global/types/locales/general.d.ts +0 -11
  294. package/dist/types/global/types/locales/index.d.ts +0 -380
  295. package/dist/types/global/types/locales/inquiryTypes.d.ts +0 -19
  296. package/dist/types/global/types/locales/part-lookup/dead-stock-schema.d.ts +0 -9
  297. package/dist/types/global/types/locales/part-lookup/distributor-schema.d.ts +0 -31
  298. package/dist/types/global/types/locales/part-lookup/index.d.ts +0 -79
  299. package/dist/types/global/types/locales/part-lookup/manufacturer-schema.d.ts +0 -33
  300. package/dist/types/global/types/locales/vehicle-lookup/accessories-schema.d.ts +0 -15
  301. package/dist/types/global/types/locales/vehicle-lookup/dynamic-claim-schema.d.ts +0 -31
  302. package/dist/types/global/types/locales/vehicle-lookup/dynamic-redeem-schema.d.ts +0 -27
  303. package/dist/types/global/types/locales/vehicle-lookup/index.d.ts +0 -171
  304. package/dist/types/global/types/locales/vehicle-lookup/paint-thickness-schema.d.ts +0 -17
  305. package/dist/types/global/types/locales/vehicle-lookup/service-history-schema.d.ts +0 -19
  306. package/dist/types/global/types/locales/vehicle-lookup/specification-schema.d.ts +0 -17
  307. package/dist/types/global/types/locales/vehicle-lookup/warranty-schema.d.ts +0 -35
  308. package/dist/types/global/types/part-information.d.ts +0 -53
  309. package/dist/types/global/types/vehicle-information.d.ts +0 -167
  310. package/dist/types/index.d.ts +0 -10
  311. package/dist/types/stencil-public-runtime.d.ts +0 -1680
  312. package/loader/cdn.js +0 -5
  313. package/loader/index.cjs.js +0 -5
  314. package/loader/index.d.ts +0 -24
  315. package/loader/index.es2017.js +0 -5
  316. package/loader/index.js +0 -6
  317. package/loader/package.json +0 -11
@@ -1,1145 +0,0 @@
1
- /*!
2
- * Built by ShiftSoftware
3
- * Copyright (c)
4
- */
5
- import { r as registerInstance, h, H as Host, g as getElement } from './index-cac905b0.js';
6
- import { c as cn } from './cn-cc419b94.js';
7
- import { l as localeSchema, g as getLocaleLanguage } from './get-local-language-40614e53.js';
8
- import { l as loaderSvg } from './loader-027b88af.js';
9
-
10
- const expiredSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzBweCIgaGVpZ2h0PSIzMHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjAiIC8+CiAgICA8ZyBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIC8+CiAgICA8Zz4KICAgICAgICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSI4IiBmaWxsLW9wYWNpdHk9IjAuMjQiIGZpbGw9ImJsYWNrIiBzdHJva2U9ImJsYWNrIiAvPgogICAgICAgIDxwYXRoIGQ9Ik0xNiAxNkw4IDgiIHN0cm9rZS13aWR0aD0iMS4yIiBzdHJva2U9ImJsYWNrIiAvPgogICAgICAgIDxwYXRoIGQ9Ik0xNiA4TDggMTYiIHN0cm9rZS13aWR0aD0iMS4yIiBzdHJva2U9ImJsYWNrIiAvPgogICAgPC9nPgo8L3N2Zz4=';
11
-
12
- const pendingSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzBweCIgaGVpZ2h0PSIzMHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjAiIC8+CiAgICA8ZyBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIC8+CiAgICA8Zz4KICAgICAgICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSI4IiBmaWxsLW9wYWNpdHk9IjAuMjQiIGZpbGw9IiNhMWExYTEiIHN0cm9rZT0iI2ExYTFhMSIgLz4KICAgICAgICA8cmVjdCB4PSI5LjUiIHk9IjgiIHdpZHRoPSIyIiBoZWlnaHQ9IjgiIGZpbGw9IiNhMWExYTEiIC8+CiAgICAgICAgPHJlY3QgeD0iMTIuNSIgeT0iOCIgd2lkdGg9IjIiIGhlaWdodD0iOCIgZmlsbD0iI2ExYTFhMSIgLz4KICAgIDwvZz4KPC9zdmc+';
13
-
14
- const cancelledSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzBweCIgaGVpZ2h0PSIzMHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjAiIC8+CiAgICA8ZyBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIC8+CiAgICA8Zz4KICAgICAgICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSI4IiBmaWxsLW9wYWNpdHk9IjAuMjQiIGZpbGw9IiNhODAwMDAiIHN0cm9rZT0iI2E4MDAwMCIgLz4KICAgICAgICA8cGF0aCBkPSJNMTggMThMNiA2IiBzdHJva2Utd2lkdGg9IjEuMiIgc3Ryb2tlPSIjYTgwMDAwIiAvPgogICAgPC9nPgo8L3N2Zz4=';
15
-
16
- const processedSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzBweCIgaGVpZ2h0PSIzMHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjAiIC8+CiAgICA8ZyBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIC8+CiAgICA8Zz4KICAgICAgICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSI4IiBmaWxsLW9wYWNpdHk9IjAuMjQiIGZpbGw9IiMzMDcxYTkiIHN0cm9rZT0iIzMwNzFhOSIgLz4KICAgICAgICA8cGF0aCBkPSJNOC41IDExTDExLjM5MzkgMTMuODkzOUMxMS40NTI1IDEzLjk1MjUgMTEuNTQ3NSAxMy45NTI1IDExLjYwNjEgMTMuODkzOUwxOS41IDYiIHN0cm9rZT0iIzMwNzFhOSIKICAgICAgICAgICAgc3Ryb2tlLXdpZHRoPSIxLjIiIC8+CiAgICA8L2c+Cjwvc3ZnPg==';
17
-
18
- const vehicleRequestHeaders = {
19
- cityId: 'City-Id',
20
- userId: 'User-Id',
21
- companyId: 'Company-Id',
22
- customerName: 'Customer-Name',
23
- customerPhone: 'Customer-Phone',
24
- customerEmail: 'Customer-Email',
25
- companyBranchId: 'Company-Branch-Id',
26
- cityIntegrationId: 'City-Integration-Id',
27
- brandIntegrationId: 'Brand-Integration-Id',
28
- companyIntegrationId: 'Company-Integration-Id',
29
- companyBranchIntegrationId: 'Company-Branch-Integration-Id',
30
- };
31
- const getVehicleInformation = async (component, generalProps, headers = {}) => {
32
- const { notAvailableMessage, mockData, vin, scopedTimeoutRef, middlewareCallback } = generalProps;
33
- const { isDev, baseUrl, queryString, abortController, networkTimeoutRef, loadedResponse } = component;
34
- const handleResult = (newVehicleInformation) => {
35
- if (networkTimeoutRef === scopedTimeoutRef) {
36
- if (!newVehicleInformation && vin)
37
- throw new Error(notAvailableMessage || 'wrongResponseFormat');
38
- if (loadedResponse)
39
- loadedResponse(newVehicleInformation);
40
- if (middlewareCallback)
41
- middlewareCallback(newVehicleInformation);
42
- return newVehicleInformation;
43
- }
44
- };
45
- if (isDev) {
46
- const newData = mockData[vin];
47
- return handleResult(newData);
48
- }
49
- else {
50
- if (!baseUrl)
51
- throw new Error('noBaseUrl');
52
- const componentHeaders = Object.assign({}, headers);
53
- Object.entries(vehicleRequestHeaders).forEach(([componentHeaderKey, headerField]) => {
54
- if (component[componentHeaderKey])
55
- componentHeaders[headerField] = component[componentHeaderKey];
56
- });
57
- const response = await fetch(`${baseUrl}${vin}?${queryString}`, { signal: abortController.signal, headers: componentHeaders });
58
- const newData = (await response.json());
59
- return handleResult(newData);
60
- }
61
- };
62
-
63
- const dynamicClaimCss = "*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.15 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.visible{visibility:visible}.collapse{visibility:collapse}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.block{display:block}.flex{display:flex}.table{display:table}.hidden{display:none}.flex-shrink{flex-shrink:1}.border-collapse{border-collapse:collapse}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.border{border-width:1px}.outline{outline-style:solid}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}:host{all:initial!important;display:block;flex:1 1 0!important;flex-shrink:0!important;width:100%!important}*{box-sizing:content-box;font-family:Arial;margin:revert;padding:revert}.dynamic-claim-wrapper{background:#fdfdfd;border:1px solid #dcdcdc;border-radius:5px;box-shadow:inset 0 1px 3px rgba(0,0,0,.05),0 1px 0 hsla(0,0%,100%,.1);overflow:hidden;padding:0;position:relative}.dynamic-claim-header{background:#f6f6f6;border:1px solid #ededed;padding:15px 0;text-align:center}.dynamic-claim-header-vin{display:inline-block;transition:.4s}.idle .dynamic-claim-header-vin,.loading .dynamic-claim-header-vin{opacity:0;transform:scale(150%);visibility:hidden}.dynamic-claim-body{display:flex;overflow-x:scroll;padding:100px 30px;transition:scrollbar-color .5s ease}.idle .dynamic-claim-body,.loading .dynamic-claim-body{pointer-events:none}.dynamic-claim-wrapper ::-webkit-scrollbar{height:10px;width:10px}.dynamic-claim-wrapper ::-webkit-scrollbar-track{background:#f6f6f6;border-radius:5px;border-top:1px solid #dcdcdc;border-top-left-radius:0;border-top-right-radius:0}.idle .dynamic-claim-body::-webkit-scrollbar-thumb,.loading .dynamic-claim-body::-webkit-scrollbar-thumb{background:transparent}.dynamic-claim-wrapper ::-webkit-scrollbar-thumb{background:#c5c5c5;border-radius:10px}.dynamic-claim-wrapper ::-webkit-scrollbar-thumb:hover{background:#a1a1a1}.dynamic-claim-progress-lane,.loading-lane{align-items:center;background-color:#f2f2f2;border:1px solid #ddd;border-radius:10px;display:flex;flex:1;flex-direction:row;height:10px;justify-content:space-around;position:relative}.idle .dynamic-claim-progress-lane,.loading .dynamic-claim-progress-lane{background-color:transparent;border:1px solid transparent}.loading-lane{position:absolute;visibility:hidden;width:calc(100% - 60px)}.loading .loading-lane{visibility:visible}.dynamic-claim-progress-bar{background-image:linear-gradient(180deg,#428bca,#3071a9);border:1px solid #ddd;border-radius:10px;height:10px;left:0;position:absolute;transition:all;transition-duration:.5s;transition-timing-function:ease-in-out;width:0;z-index:0}.idle .dynamic-claim-progress-bar,.loading .dynamic-claim-progress-bar{opacity:0;width:0!important}.dynamic-claim-item{align-items:center;display:flex;flex-direction:column;font-size:14px;gap:5px;min-width:250px}.popup-position-ref{bottom:0;display:flex;height:0;justify-content:center;position:absolute;width:0}.popup-container{position:fixed;z-index:100}.dynamic-claim-item-popup-info{background-color:#f9f9f9;border:1px solid #ddd;border-radius:5px;color:#282828;opacity:0;padding:20px;transition:.4s;visibility:hidden;width:auto}.dynamic-claim-item-popup-info-triangle.show,.dynamic-claim-item-popup-info.show{opacity:1;visibility:visible}.dynamic-claim-item-popup-info table{border-collapse:collapse;width:100%}.dynamic-claim-item-popup-info table td,.dynamic-claim-item-popup-info table th{border-bottom:1px solid #ddd;padding:10px;padding-inline-end:50px;text-align:start;white-space:nowrap}.dynamic-claim-item-popup-info table td{font-weight:400}.dynamic-claim-item-popup-info .claim-button{justify-content:center;margin:15px auto auto;width:80%}.dynamic-claim-item-popup-info-triangle{display:flex;justify-content:center;opacity:0;position:relative;transform:translateY(-9px);transition:.4s;visibility:hidden;width:100%;z-index:101}.dynamic-claim-item-popup-info-triangle-up{border-bottom:10px solid #ddd}.dynamic-claim-item-popup-info-triangle-up,.dynamic-claim-item-popup-info-triangle-up2{border-left:10px solid transparent;border-right:10px solid transparent;height:0;position:absolute;width:0}.dynamic-claim-item-popup-info-triangle-up2{border-bottom:10px solid #f9f9f9;margin-top:1px}.dynamic-claim-item-header{align-items:center;cursor:pointer;display:flex;flex-direction:column;height:3em;line-height:1em;padding:10px 0;position:relative;transition:.4s}.dynamic-claim-item-header.load-animation{animation:item-header-fade-in .65s ease forwards}@keyframes item-header-fade-in{0%{opacity:0;transform:translateY(-5px) scale(70%)}to{opacity:1;transform:translateY(0) scale(100%)}}.dynamic-claim-item-header span{font-weight:700}.dynamic-claim-item-header img{transition:.4s}.dynamic-claim-item-header:hover>img{transform:rotate(1turn) scale(125%)}.idle .dynamic-claim-item-header,.loading .dynamic-claim-item-header{opacity:0;transform:translateY(-5px) scale(70%)}.dynamic-claim-item-footer{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;height:4.5em;line-height:1.5em;margin:0;overflow:hidden;padding:0 20px;text-align:center;text-overflow:ellipsis;transition:.4s}.dynamic-claim-item-footer.load-animation{animation:item-footer-fade-in .65s ease forwards}@keyframes item-footer-fade-in{0%{opacity:0;transform:translateY(5px) scale(70%);visibility:hidden}to{opacity:1;transform:translateY(0) scale(100%);visibility:visible}}.idle .dynamic-claim-item-footer,.loading .dynamic-claim-item-footer{opacity:0;transform:translateY(5px) scale(70%);visibility:hidden}.dynamic-claim-item-circle{background-color:#a1a1a1;border:5px double #ececec;border-radius:50%;height:18px;transition:.4s;width:18px;z-index:1}.dynamic-claim-item-circle.load-animation{animation:item-circle-fade-in .65s ease forwards}@keyframes item-circle-fade-in{0%{opacity:0;transform:scale(150%);visibility:hidden}to{opacity:1;transform:scale(100%);visibility:visible}}.idle .dynamic-claim-item-circle,.loading .dynamic-claim-item-circle{opacity:0;transform:scale(150%);visibility:hidden}.dynamic-claim-item.processed .dynamic-claim-item-circle{background-color:#3071a9}.dynamic-claim-item.processed .dynamic-claim-item-header{color:#3071a9}.dynamic-claim-item.expired .dynamic-claim-item-circle{background-color:#282828}.dynamic-claim-item.expired .dynamic-claim-item-headaer{color:#282828}.dynamic-claim-item.cancelled .dynamic-claim-item-circle{background-color:#a80000}.dynamic-claim-item.cancelled .dynamic-claim-item-header{color:#a80000}.dynamic-claim-item.pending .dynamic-claim-item-circle{background-color:#00a300}.dynamic-claim-item.pending .dynamic-claim-item-header{color:#00a300}.dynamic-claim-loading-slider{border-radius:4px;height:10px;left:0;overflow-x:hidden;position:relative;position:absolute;top:0;width:100%}.dynamic-claim-loading-slider-line{background:#ddd;height:10px;opacity:0;position:absolute;width:150%}.dynamic-claim-loading-slider-subline{background-image:linear-gradient(180deg,#428bca,#3071a9);height:10px;position:absolute}.dynamic-claim-wrapper.loading .dynamic-claim-inc{animation:dynamic-claim-increase 2.5s ease infinite}.dynamic-claim-wrapper.loading .dynamic-claim-dec{animation:dynamic-claim-decrease 2.5s ease 1s infinite}@keyframes dynamic-claim-increase{0%{left:-5%;width:5%}to{left:130%;width:100%}}@keyframes dynamic-claim-decrease{0%{left:-80%;width:80%}to{left:110%;width:10%}}.dynamic-claim-button{align-items:center;border:none;border-radius:5px;color:#fff;cursor:pointer;display:flex;font-weight:700;gap:3px;outline:none;padding:0 10px 0 0;transition:.3s}.dynamic-claim-button svg{transition:.2s}.claim-button{stroke:#27ae60;fill:#27ae60;background-color:transparent;border:1px solid #27ae60;color:#27ae60}.claim-button circle{fill:#2ecc71}.claim-button:hover{stroke:#fff;fill:#fff;background-color:#2ecc71;color:#fff}.claim-button:hover circle{fill:#fff}.claim-button:active{background-color:#27ae60}.claim-button:active svg{transform:scale(125%)}.cancel-button{stroke:#c0392b;fill:#c0392b;background-color:transparent;border:1px solid #c0392b;color:#c0392b}.cancel-button circle{fill:#c0392b;transition:.1s}.cancel-button:hover{stroke:#fff;fill:#fff;background-color:#e74c3c;color:#fff}.cancel-button:hover circle{fill:#fff}.static{position:static}.w-full{width:100%}.sticky{position:sticky}.top-0{top:0}.mx-auto{margin-left:auto;margin-right:auto}.my-2{margin-bottom:.5rem;margin-top:.5rem}.mt-\\[12px\\]{margin-top:12px}.h-0{height:0}.h-\\[40px\\]{height:40px}.h-\\[80px\\]{height:80px}.max-h-\\[70dvh\\]{max-height:70dvh}.min-h-\\[100px\\]{min-height:100px}.w-fit{width:fit-content}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.scale-0{--tw-scale-x:0;--tw-scale-y:0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[8px\\]{border-radius:8px}.border-b{border-bottom-width:1px}.border-\\[\\#d6d8dc\\]{--tw-border-opacity:1;border-color:rgb(214 216 220/var(--tw-border-opacity,1))}.bg-\\[\\#e1e3e5\\]{--tw-bg-opacity:1;background-color:rgb(225 227 229/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.px-\\[10px\\]{padding-left:10px;padding-right:10px}.px-\\[16px\\]{padding-left:16px;padding-right:16px}.py-\\[16px\\]{padding-bottom:16px;padding-top:16px}.py-\\[20px\\]{padding-bottom:20px;padding-top:20px}.py-\\[8px\\]{padding-bottom:8px;padding-top:8px}.pt-\\[4px\\]{padding-top:4px}.text-center{text-align:center}.text-\\[18px\\]{font-size:18px}.text-\\[20px\\]{font-size:20px}.font-bold{font-weight:700}.text-\\[\\#383c43\\]{--tw-text-opacity:1;color:rgb(56 60 67/var(--tw-text-opacity,1))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.opacity-0{opacity:0}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.\\!duration-700{transition-duration:.7s!important}.duration-300{transition-duration:.3s}.reject-card{background-color:#f7d7d8;border-color:#f2aeb5;color:#58151c}.success-card{background-color:#d0e7de;border-color:#a2d0bb;color:#0b3521}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.m-\\[3px\\]{margin:3px}.my-4{margin-bottom:1rem;margin-top:1rem}.ml-1{margin-left:.25rem}.border-separate{border-collapse:separate}.list-disc{list-style-type:disc}.gap-1{gap:.25rem}";
64
- const DynamicClaimStyle0 = dynamicClaimCss;
65
-
66
- let mockData$5 = {};
67
- const icons = {
68
- expired: expiredSvg,
69
- pending: pendingSvg,
70
- processed: processedSvg,
71
- cancelled: cancelledSvg,
72
- };
73
- const DynamicClaim = class {
74
- constructor(hostRef) {
75
- registerInstance(this, hostRef);
76
- this.pendingItemHighlighted = false;
77
- this.onMouseLeave = () => {
78
- clearTimeout(this.timeoutRef);
79
- this.popupClasses = '';
80
- this.timeoutRef = setTimeout(() => {
81
- this.activePopupIndex = null;
82
- }, 400);
83
- };
84
- this.onMouseEnter = (dynamicClaimItemHeader, idx) => {
85
- clearTimeout(this.timeoutRef);
86
- this.activePopupIndex = idx;
87
- this.timeoutRef = setTimeout(() => {
88
- const positionRef = dynamicClaimItemHeader.querySelector('.popup-position-ref');
89
- this.popupPositionRef = positionRef;
90
- this.calculatePopupPos(this.el.shadowRoot);
91
- this.popupClasses = 'show';
92
- }, 50);
93
- };
94
- this.baseUrl = undefined;
95
- this.isDev = false;
96
- this.queryString = '';
97
- this.language = 'en';
98
- this.errorCallback = undefined;
99
- this.loadingStateChange = undefined;
100
- this.loadedResponse = undefined;
101
- this.locale = localeSchema.getDefault();
102
- this.isIdle = true;
103
- this.popupClasses = '';
104
- this.isLoading = false;
105
- this.externalVin = null;
106
- this.errorMessage = null;
107
- this.activePopupIndex = null;
108
- this.vehicleInformation = undefined;
109
- }
110
- async componentWillLoad() {
111
- await this.changeLanguage(this.language);
112
- }
113
- async changeLanguage(newLanguage) {
114
- this.locale = await getLocaleLanguage(newLanguage);
115
- }
116
- async componentDidLoad() {
117
- this.dynamicClaimBody = this.el.shadowRoot.querySelector('.dynamic-claim-body');
118
- this.dynamicRedeem = this.el.shadowRoot.getElementById('dynamic-redeem');
119
- this.dynamicClaimProgressBar = this.el.shadowRoot.querySelector('.dynamic-claim-progress-bar');
120
- }
121
- async setMockData(newMockData) {
122
- mockData$5 = newMockData;
123
- }
124
- async setData(newData, headers = {}) {
125
- clearTimeout(this.networkTimeoutRef);
126
- if (this.abortController)
127
- this.abortController.abort();
128
- this.abortController = new AbortController();
129
- let scopedTimeoutRef;
130
- const isVinRequest = typeof newData === 'string';
131
- const vin = isVinRequest ? newData : newData === null || newData === void 0 ? void 0 : newData.vin;
132
- this.externalVin = vin;
133
- try {
134
- if (!vin || vin.trim().length === 0) {
135
- this.isIdle = true;
136
- return;
137
- }
138
- this.isLoading = true;
139
- this.isIdle = false;
140
- await new Promise(r => {
141
- scopedTimeoutRef = setTimeout(r, 1000);
142
- this.networkTimeoutRef = scopedTimeoutRef;
143
- });
144
- const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData: mockData$5 }, headers) : newData;
145
- if (this.networkTimeoutRef === scopedTimeoutRef) {
146
- if (!vehicleResponse)
147
- throw new Error('wrongResponseFormat');
148
- if (!Array.isArray(vehicleResponse.serviceItems))
149
- throw new Error('noServiceAvailable');
150
- this.vehicleInformation = vehicleResponse;
151
- }
152
- this.errorMessage = null;
153
- this.isLoading = false;
154
- }
155
- catch (error) {
156
- if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
157
- return;
158
- if (this.errorCallback)
159
- this.errorCallback(error.message);
160
- console.error(error);
161
- this.setErrorMessage(error.message);
162
- }
163
- }
164
- async setErrorMessage(message) {
165
- this.isIdle = false;
166
- this.isLoading = false;
167
- this.vehicleInformation = null;
168
- this.errorMessage = message;
169
- }
170
- async fetchData(requestedVin = this.externalVin, headers = {}) {
171
- await this.setData(requestedVin, headers);
172
- }
173
- onLoadingChange(newValue) {
174
- if (this.loadingStateChange)
175
- this.loadingStateChange(newValue);
176
- this.setLoadingUi(newValue);
177
- }
178
- async setLoadingUi(isLoading) {
179
- if (!isLoading) {
180
- this.dynamicClaimProgressBar.style.width = '0';
181
- await new Promise(r => setTimeout(r, 200));
182
- this.updateProgressBar();
183
- }
184
- }
185
- updateProgressBar() {
186
- var _a;
187
- const serviceItems = ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceItems) || [];
188
- if (serviceItems.filter(x => x.status === 'pending').length === 0) {
189
- if (serviceItems.length === 0)
190
- this.dynamicClaimProgressBar.style.width = '0%';
191
- else
192
- this.dynamicClaimProgressBar.style.width = '100%';
193
- this.dynamicClaimBody.scrollTo({
194
- left: this.dynamicClaimBody.scrollWidth,
195
- behavior: 'smooth',
196
- });
197
- }
198
- else {
199
- const firstPendingItem = serviceItems.find(x => x.status === 'pending');
200
- const firstPendingItemIndex = serviceItems.indexOf(firstPendingItem) + 1;
201
- const firstPendingItemRef = this.dynamicClaimBody.getElementsByClassName('dynamic-claim-item')[firstPendingItemIndex - 1];
202
- this.dynamicClaimProgressBar.style.width = (firstPendingItemIndex / serviceItems.length - 1 / (serviceItems.length * 2)) * 100 + '%';
203
- this.dynamicClaimBody.scrollTo({
204
- left: firstPendingItemRef.offsetLeft - firstPendingItemRef.clientWidth * 3,
205
- behavior: 'smooth',
206
- });
207
- }
208
- }
209
- resetProgressBar() {
210
- setTimeout(() => {
211
- this.updateProgressBar();
212
- }, 100);
213
- }
214
- windowScrollListener(newValue) {
215
- if (newValue) {
216
- this.scrollListenerRef = () => this.calculatePopupPos(this.el.shadowRoot);
217
- window.addEventListener('scroll', this.scrollListenerRef);
218
- this.dynamicClaimBody.addEventListener('scroll', this.scrollListenerRef);
219
- }
220
- else {
221
- window.removeEventListener('scroll', this.scrollListenerRef);
222
- this.dynamicClaimBody.removeEventListener('scroll', this.scrollListenerRef);
223
- }
224
- }
225
- calculatePopupPos(root) {
226
- const popupPositionRef = root.querySelector('.popup-position-ref');
227
- let { x, y } = popupPositionRef.getBoundingClientRect();
228
- const popupContainer = popupPositionRef.querySelector('.popup-container');
229
- const { width } = popupContainer.getBoundingClientRect();
230
- const popupInfo = popupContainer.querySelector('.dynamic-claim-item-popup-info');
231
- const windowWidth = window.innerWidth; // Get the viewport's width
232
- popupContainer.style.top = `${y}px`;
233
- popupContainer.style.left = `${x - width / 2}px`;
234
- const offsetFromLeft = x - width / 2; // Distance from left side of the viewport
235
- const offsetFromRight = windowWidth - (x + width / 2); // Distance from right side of the viewport
236
- let movingNeeded = 0;
237
- let horizontalMargin = 16;
238
- if (offsetFromRight < horizontalMargin)
239
- movingNeeded = offsetFromRight - horizontalMargin;
240
- else if (offsetFromLeft < horizontalMargin)
241
- movingNeeded = Math.abs(offsetFromLeft - horizontalMargin);
242
- popupInfo.style.transform = `translateX(${movingNeeded}px)`;
243
- }
244
- removeLoadAnimationClass(event) {
245
- const component = event.target;
246
- component.classList.remove('load-animation');
247
- }
248
- async completeClaim() {
249
- var _a;
250
- const serviceItems = ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceItems) || [];
251
- const item = this.cachedClaimItem;
252
- const serviceDataClone = JSON.parse(JSON.stringify(serviceItems));
253
- const index = serviceItems.indexOf(item);
254
- const pendingItemsBefore = serviceDataClone.slice(0, index).filter(x => x.status === 'pending');
255
- serviceDataClone[index].status = 'processed';
256
- pendingItemsBefore.forEach(function (otherItem) {
257
- otherItem.status = 'cancelled';
258
- });
259
- this.pendingItemHighlighted = false;
260
- const vehicleDataClone = JSON.parse(JSON.stringify(this.vehicleInformation));
261
- vehicleDataClone.serviceItems = serviceDataClone;
262
- this.vehicleInformation = JSON.parse(JSON.stringify(vehicleDataClone));
263
- }
264
- claim(item) {
265
- var _a;
266
- const serviceItems = ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceItems) || [];
267
- const vinDataClone = JSON.parse(JSON.stringify(serviceItems));
268
- const index = serviceItems.indexOf(item);
269
- //Find other items before this item that have status 'pending'
270
- let pendingItemsBefore = vinDataClone.slice(0, index).filter(x => x.status === 'pending');
271
- this.cachedClaimItem = item;
272
- if (item.maximumMileage === null) {
273
- pendingItemsBefore = [];
274
- }
275
- this.onMouseLeave();
276
- this.openRedeem(item, pendingItemsBefore);
277
- }
278
- async handleRedeemScanner() {
279
- if (this.isDev) {
280
- this.dynamicRedeem.handleScanner = async (_) => {
281
- await new Promise(r => setTimeout(r, 500));
282
- this.dynamicRedeem.quite();
283
- this.completeClaim();
284
- this.dynamicRedeem.handleScanner = null;
285
- };
286
- }
287
- else {
288
- this.dynamicRedeem.handleScanner = async (code) => {
289
- try {
290
- const vehicleInformation = this.vehicleInformation;
291
- const payload = {
292
- vin: vehicleInformation.vin,
293
- brandIntegrationID: vehicleInformation.identifiers.brandIntegrationID,
294
- invoice: code,
295
- saleInformation: vehicleInformation.saleInformation,
296
- serviceItem: this.dynamicRedeem.item,
297
- cancelledServiceItems: this.dynamicRedeem.canceledItems,
298
- };
299
- const response = await fetch('/api/vehicle/swift-claim', {
300
- method: 'POST',
301
- headers: {
302
- 'Content-Type': 'application/json',
303
- },
304
- body: JSON.stringify(payload),
305
- });
306
- const data = await response.json();
307
- if (!data.Success) {
308
- alert(data.Message);
309
- this.dynamicRedeem.quite();
310
- this.dynamicRedeem.handleScanner = null;
311
- return;
312
- }
313
- this.dynamicRedeem.quite();
314
- this.completeClaim();
315
- this.dynamicRedeem.handleScanner = null;
316
- }
317
- catch (error) {
318
- console.error(error);
319
- alert(this.locale.errors.requestFailedPleaseTryAgainLater);
320
- this.dynamicRedeem.quite();
321
- this.dynamicRedeem.handleScanner = null;
322
- }
323
- };
324
- }
325
- }
326
- openRedeem(item, oldItems) {
327
- var _a, _b, _c, _d, _e;
328
- const vehicleInformation = this.vehicleInformation;
329
- this.dynamicRedeem.vin = vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.vin;
330
- this.dynamicRedeem.item = item;
331
- this.dynamicRedeem.canceledItems = oldItems;
332
- if (((_a = vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.saleInformation) === null || _a === void 0 ? void 0 : _a.broker) !== null && ((_c = (_b = vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.saleInformation) === null || _b === void 0 ? void 0 : _b.broker) === null || _c === void 0 ? void 0 : _c.invoiceDate) === null)
333
- this.dynamicRedeem.unInvoicedByBrokerName = (_e = (_d = vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.saleInformation) === null || _d === void 0 ? void 0 : _d.broker) === null || _e === void 0 ? void 0 : _e.brokerName;
334
- else
335
- this.dynamicRedeem.unInvoicedByBrokerName = null;
336
- this.handleRedeemScanner();
337
- }
338
- createPopup(item) {
339
- const texts = this.locale.vehicleLookup.dynamicClaim;
340
- return (h("div", { dir: this.locale.direction, class: "popup-position-ref" }, h("div", { class: "popup-container" }, h("div", { class: cn('dynamic-claim-item-popup-info-triangle', this.popupClasses) }, h("div", { class: "dynamic-claim-item-popup-info-triangle-up" }), h("div", { class: "dynamic-claim-item-popup-info-triangle-up2" })), h("div", { class: cn('dynamic-claim-item-popup-info', this.popupClasses) }, h("table", null, h("tbody", null, h("tr", null, h("th", null, texts.serviceType), h("td", null, item.type.charAt(0).toUpperCase() + item.type.slice(1))), h("tr", null, h("th", null, texts.activationDate), h("td", null, item.activatedAt)), h("tr", null, h("th", null, texts.expireDate), h("td", null, item.expiresAt)), h("tr", null, h("th", null, texts.claimAt), h("td", null, item.redeemDate)), h("tr", null, h("th", null, texts.redeemingDealer), h("td", null, item.dealerName)), h("tr", null, h("th", null, texts.invoiceNumber), h("td", null, item.invoiceNumber)), h("tr", null, h("th", null, texts.wip), h("td", null, item.wip)), h("tr", null, h("th", null, texts.claim), h("td", null, item.menuCode)))), item.status === 'pending' && (h("button", { onClick: () => this.claim(item), class: "claim-button dynamic-claim-button" }, h("svg", { width: "30px", height: "30px", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("g", { "stroke-width": "0" }), h("g", { "stroke-linecap": "round", "stroke-linejoin": "round" }), h("g", null, h("circle", { cx: "12", cy: "12", r: "8", "fill-opacity": "0.24" }), h("path", { d: "M8.5 11L11.3939 13.8939C11.4525 13.9525 11.5475 13.9525 11.6061 13.8939L19.5 6", "stroke-width": "1.2" }))), h("span", null, texts.claim)))))));
341
- }
342
- render() {
343
- var _a, _b;
344
- const serviceItems = ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceItems) || [];
345
- const texts = this.locale.vehicleLookup.dynamicClaim;
346
- console.log(this.errorMessage);
347
- return (h(Host, { key: '9e0409c5591453b63e9a835a454e952752e22013' }, h("dynamic-redeem", { key: '66a516c29ffffdf5eec666501556c85d6e532929', language: this.language, id: "dynamic-redeem" }), h("div", { key: '87faef21ecc2f9d2a7cddde1ab9c919ff57ef6e0', class: cn('dynamic-claim-wrapper', { loading: this.isLoading, idle: this.isIdle }) }, h("div", { key: '0093412ac6128b142007f0be466fcd7a28dccebe', class: "dynamic-claim-header" }, h("strong", { key: '4f947ae43e1e1a2b6c4548f3d4d7f5ac9671bd8a', onAnimationEnd: this.removeLoadAnimationClass, class: "dynamic-claim-header-vin load-animation" }, this.errorMessage && (h("span", { key: 'ade34635ef2f7dc56d23424abc489a52fce57ae2', dir: this.locale.direction, style: { color: 'red' } }, this.locale.errors[this.errorMessage] || this.locale.errors.wildCard)), !this.errorMessage && ((_b = this.vehicleInformation) === null || _b === void 0 ? void 0 : _b.vin))), h("div", { key: 'd19c9904e00841683880afa09dbec00d6e1414b8', class: "dynamic-claim-body" }, h("div", { key: '196f37e4c5389b5dc24ce2cf03f9b86559c78549', class: "loading-lane" }, h("div", { key: '21fa82864e31a0d88228f5c199fefafc139c74d0', class: "dynamic-claim-loading-slider" }, h("div", { key: '46314ebc827b182693bd117313fd1882cdeef467', class: "dynamic-claim-loading-slider-line" }), h("div", { key: 'f5dea0ec0a48afc68f825dbe9920038a7865c826', class: "dynamic-claim-loading-slider-subline dynamic-claim-inc" }), h("div", { key: '71c71d5ff95bc0dc5e9880ad81645a6a37c26593', class: "dynamic-claim-loading-slider-subline dynamic-claim-dec" }))), h("div", { key: '18357ef88627c6d9bba393ba4d0ee67e01454fa8', class: "dynamic-claim-progress-lane" }, serviceItems.map((item, idx) => {
348
- let statusClass = '';
349
- if (item.status === 'pending') {
350
- if (serviceItems.findIndex(i => i.status === 'pending') === idx)
351
- statusClass = item.status;
352
- }
353
- else
354
- statusClass = item.status;
355
- return (h("div", { key: item.name, class: cn('dynamic-claim-item', statusClass), onMouseLeave: this.onMouseLeave }, h("div", { onAnimationEnd: this.removeLoadAnimationClass, class: "dynamic-claim-item-header load-animation", onMouseEnter: event => this.onMouseEnter(event.target, idx) }, h("img", { src: icons[item.status], alt: "status icon" }), h("span", null, texts[item.status]), this.activePopupIndex === idx && this.createPopup(item)), h("div", { onAnimationEnd: this.removeLoadAnimationClass, class: "dynamic-claim-item-circle load-animation" }), h("p", { onAnimationEnd: this.removeLoadAnimationClass, class: "dynamic-claim-item-footer load-animation" }, item.name)));
356
- }), h("div", { key: '2762fc231f14343438f628afa1feae4929cc2c9f', class: "dynamic-claim-progress-bar" }))))));
357
- }
358
- get el() { return getElement(this); }
359
- static get watchers() { return {
360
- "language": ["changeLanguage"],
361
- "isLoading": ["onLoadingChange"],
362
- "vehicleInformation": ["resetProgressBar"],
363
- "popupClasses": ["windowScrollListener"]
364
- }; }
365
- };
366
- DynamicClaim.style = DynamicClaimStyle0;
367
-
368
- const eyeSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IndoaXRlIgogICAgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWV5ZSI+CiAgICA8cGF0aCBkPSJNMi4wNjIgMTIuMzQ4YTEgMSAwIDAgMSAwLS42OTYgMTAuNzUgMTAuNzUgMCAwIDEgMTkuODc2IDAgMSAxIDAgMCAxIDAgLjY5NiAxMC43NSAxMC43NSAwIDAgMS0xOS44NzYgMCIgLz4KICAgIDxjaXJjbGUgY3g9IjEyIiBjeT0iMTIiIHI9IjMiIC8+Cjwvc3ZnPg==';
369
-
370
- function openImageViewer(context, target, imageSrc) {
371
- if (context.expandedImage === imageSrc)
372
- return;
373
- context.originalImage = target;
374
- const expandedImageRef = context.el.shadowRoot.getElementById('expanded-image');
375
- expandedImageRef.src = target.src;
376
- document.addEventListener('keydown', context.closeImageListener);
377
- const rect = target.getBoundingClientRect();
378
- document.body.style.overflow = 'hidden';
379
- Object.assign(expandedImageRef.style, {
380
- top: `${rect.top}px`,
381
- pointerEvents: 'auto',
382
- left: `${rect.left}px`,
383
- transitionDuration: '0s',
384
- width: `${rect.width}px`,
385
- height: `${rect.height}px`,
386
- });
387
- setTimeout(() => {
388
- const naturalWidth = target.naturalWidth;
389
- const naturalHeight = target.naturalHeight;
390
- const maxWidth = window.innerWidth - 160;
391
- const maxHeight = window.innerHeight - 32;
392
- const aspectRatio = naturalWidth / naturalHeight;
393
- let width, height;
394
- if (maxWidth / aspectRatio <= maxHeight) {
395
- width = maxWidth;
396
- height = maxWidth / aspectRatio;
397
- }
398
- else {
399
- height = maxHeight;
400
- width = maxHeight * aspectRatio;
401
- }
402
- expandedImageRef.style.transitionDuration = '0.3s';
403
- Object.assign(expandedImageRef.style, {
404
- opacity: '1',
405
- width: `${width}px`,
406
- height: `${height}px`,
407
- top: `${(window.innerHeight - height) / 2}px`,
408
- left: `${(window.innerWidth - width) / 2}px`,
409
- });
410
- context.expandedImage = imageSrc;
411
- }, 200);
412
- }
413
- function closeImageViewer(context, event) {
414
- if (event && event.key !== 'Escape')
415
- return;
416
- document.removeEventListener('keydown', context.closeImageListener);
417
- const expandedImageRef = context.el.shadowRoot.getElementById('expanded-image');
418
- const rect = context.originalImage.getBoundingClientRect();
419
- Object.assign(expandedImageRef.style, {
420
- top: `${rect.top}px`,
421
- pointerEvents: 'none',
422
- left: `${rect.left}px`,
423
- width: `${rect.width}px`,
424
- height: `${rect.height}px`,
425
- transitionDuration: '0.3s',
426
- });
427
- setTimeout(() => {
428
- expandedImageRef.src = '';
429
- expandedImageRef.style.opacity = '0';
430
- expandedImageRef.style.transitionDuration = '0s';
431
- }, 300);
432
- document.body.style.overflow = '';
433
- context.expandedImage = null;
434
- }
435
-
436
- const paintThicknessCss = "*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.15 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.block{display:block}:host{all:initial!important;display:block}*{font-family:Arial}.static{position:static}.hidden{display:none}.w-full{width:100%}.relative{position:relative}.sticky{position:sticky}.top-0{top:0}.mx-auto{margin-left:auto;margin-right:auto}.my-2{margin-bottom:.5rem;margin-top:.5rem}.mt-\\[12px\\]{margin-top:12px}.flex{display:flex}.table{display:table}.h-0{height:0}.h-\\[40px\\]{height:40px}.h-\\[80px\\]{height:80px}.max-h-\\[70dvh\\]{max-height:70dvh}.min-h-\\[100px\\]{min-height:100px}.w-fit{width:fit-content}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.scale-0{--tw-scale-x:0;--tw-scale-y:0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[8px\\]{border-radius:8px}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-\\[\\#d6d8dc\\]{--tw-border-opacity:1;border-color:rgb(214 216 220/var(--tw-border-opacity,1))}.bg-\\[\\#e1e3e5\\]{--tw-bg-opacity:1;background-color:rgb(225 227 229/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.px-\\[10px\\]{padding-left:10px;padding-right:10px}.px-\\[16px\\]{padding-left:16px;padding-right:16px}.py-\\[16px\\]{padding-bottom:16px;padding-top:16px}.py-\\[20px\\]{padding-bottom:20px;padding-top:20px}.py-\\[8px\\]{padding-bottom:8px;padding-top:8px}.pt-\\[4px\\]{padding-top:4px}.text-center{text-align:center}.text-\\[18px\\]{font-size:18px}.text-\\[20px\\]{font-size:20px}.font-bold{font-weight:700}.text-\\[\\#383c43\\]{--tw-text-opacity:1;color:rgb(56 60 67/var(--tw-text-opacity,1))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.opacity-0{opacity:0}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.\\!duration-700{transition-duration:.7s!important}.duration-300{transition-duration:.3s}.reject-card{background-color:#f7d7d8;border-color:#f2aeb5;color:#58151c}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.success-card{background-color:#d0e7de;border-color:#a2d0bb;color:#0b3521}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.fixed{position:fixed}.absolute{position:absolute}.left-0{left:0}.z-10{z-index:10}.z-40{z-index:40}.float-right{float:right}.mr-\\[16px\\]{margin-right:16px}.mt-\\[16px\\]{margin-top:16px}.size-12{height:3rem;width:3rem}.size-full{height:100%;width:100%}.h-1{height:.25rem}.h-\\[100dvh\\]{height:100dvh}.h-\\[150px\\]{height:150px}.h-\\[50px\\]{height:50px}.w-12{width:3rem}.w-\\[100dvw\\]{width:100dvw}.w-auto{width:auto}.min-w-\\[100px\\]{min-width:100px}.-rotate-45{--tw-rotate:-45deg}.-rotate-45,.rotate-45{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-45{--tw-rotate:45deg}.cursor-pointer{cursor:pointer}.flex-wrap{flex-wrap:wrap}.gap-\\[16px\\]{gap:16px}.gap-\\[4px\\]{gap:4px}.gap-\\[8px\\]{gap:8px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.\\!border-none{border-style:none!important}.bg-black\\/40{background-color:rgba(0,0,0,.4)}.bg-slate-200{--tw-bg-opacity:1;background-color:rgb(226 232 240/var(--tw-bg-opacity,1))}.p-\\[12px\\]{padding:12px}.p-\\[6px\\]{padding:6px}.px-\\[15px\\]{padding-left:15px;padding-right:15px}.px-\\[24px\\]{padding-left:24px;padding-right:24px}.px-\\[30px\\]{padding-left:30px;padding-right:30px}.py-\\[15px\\]{padding-bottom:15px;padding-top:15px}.font-semibold{font-weight:600}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity,1))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.opacity-100{opacity:1}.shadow,.shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.outline-none{outline:2px solid transparent;outline-offset:2px}.ring-0{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.blur{--tw-blur:blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.delay-200{transition-delay:.2s}.duration-100{transition-duration:.1s}.hover\\:bg-slate-100:hover{--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity,1))}.hover\\:opacity-100:hover{opacity:1}.\\[\\&_div\\]\\:hover\\:\\!opacity-100:hover div{opacity:1!important}.\\[\\&_img\\]\\:hover\\:shadow-lg:hover img{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}";
437
- const PaintThicknessStyle0 = paintThicknessCss;
438
-
439
- let mockData$4 = {};
440
- const PaintThickness = class {
441
- constructor(hostRef) {
442
- registerInstance(this, hostRef);
443
- this.closeImageListener = (event) => {
444
- this.closeImage(event);
445
- };
446
- this.openImage = (target, imageSrc) => {
447
- openImageViewer(this, target, imageSrc);
448
- };
449
- this.closeImage = (event) => {
450
- closeImageViewer(this, event);
451
- };
452
- this.baseUrl = '';
453
- this.isDev = false;
454
- this.queryString = '';
455
- this.language = 'en';
456
- this.errorCallback = undefined;
457
- this.loadingStateChange = undefined;
458
- this.loadedResponse = undefined;
459
- this.locale = localeSchema.getDefault();
460
- this.state = 'idle';
461
- this.externalVin = null;
462
- this.expandedImage = null;
463
- this.errorMessage = null;
464
- this.vehicleInformation = undefined;
465
- }
466
- async componentWillLoad() {
467
- await this.changeLanguage(this.language);
468
- }
469
- async changeLanguage(newLanguage) {
470
- this.locale = await getLocaleLanguage(newLanguage);
471
- }
472
- handleSettingData(response) {
473
- if (!response.paintThickness)
474
- response.paintThickness = { imageGroups: [], parts: [] };
475
- if (!response.paintThickness.parts || !Array.isArray(response.paintThickness.parts))
476
- response.paintThickness.parts = [];
477
- if (!response.paintThickness.imageGroups || !Array.isArray(response.paintThickness.imageGroups))
478
- response.paintThickness.imageGroups = [];
479
- this.vehicleInformation = response;
480
- }
481
- async setData(newData, headers = {}) {
482
- clearTimeout(this.networkTimeoutRef);
483
- if (this.abortController)
484
- this.abortController.abort();
485
- this.abortController = new AbortController();
486
- let scopedTimeoutRef;
487
- const isVinRequest = typeof newData === 'string';
488
- const vin = isVinRequest ? newData : newData === null || newData === void 0 ? void 0 : newData.vin;
489
- this.externalVin = vin;
490
- try {
491
- if (!vin || vin.trim().length === 0) {
492
- this.state = 'idle';
493
- return;
494
- }
495
- if (this.state === 'data' || this.state === 'error') {
496
- this.state = (this.state + '-loading');
497
- }
498
- else
499
- this.state = 'loading';
500
- await new Promise(r => {
501
- scopedTimeoutRef = setTimeout(r, 700);
502
- this.networkTimeoutRef = scopedTimeoutRef;
503
- });
504
- const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData: mockData$4 }, headers) : newData;
505
- if (this.networkTimeoutRef === scopedTimeoutRef) {
506
- if (!vehicleResponse)
507
- throw new Error('wrongResponseFormat');
508
- this.handleSettingData(vehicleResponse);
509
- }
510
- this.errorMessage = null;
511
- this.state = 'data';
512
- }
513
- catch (error) {
514
- if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
515
- return;
516
- if (this.errorCallback)
517
- this.errorCallback(error.message);
518
- console.error(error);
519
- this.setErrorMessage(error.message);
520
- }
521
- }
522
- async setErrorMessage(message) {
523
- this.state = 'error';
524
- this.vehicleInformation = null;
525
- this.errorMessage = message;
526
- }
527
- async fetchData(requestedVin = this.externalVin, headers = {}) {
528
- await this.setData(requestedVin, headers);
529
- }
530
- async loadingListener() {
531
- if (this.loadingStateChange)
532
- this.loadingStateChange(this.state.includes('loading'));
533
- }
534
- async setMockData(newMockData) {
535
- mockData$4 = newMockData;
536
- }
537
- render() {
538
- var _a, _b;
539
- const texts = this.locale.vehicleLookup.paintThickness;
540
- const { imageGroups, parts } = (this === null || this === void 0 ? void 0 : this.vehicleInformation) ? (_a = this === null || this === void 0 ? void 0 : this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.paintThickness : { imageGroups: [], parts: [] };
541
- return (h(Host, { key: '54e7949fa496aa744e819c3c5f900dc33399c400' }, h("div", { key: '6e0aed08f669f771131bb5d70657adf5bcfdc6e8', dir: this.locale.direction, class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, h("div", { key: 'f0554bee45f7559bd5f0499b4af1d0002bf4b5e6' }, h("loading-spinner", { key: '31c2ca21362131c3b39b6c698ac4404586252821', isLoading: this.state.includes('loading') }), h("div", { key: '1e624b7be1682ee01ffb874e398ca56b75223722', class: cn('transition-all !duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, h("div", { key: '0e8736919c43022d9472b58cd71fdcb4de51d3fc', class: cn('text-center pt-[4px] text-[20px]', { 'text-red-600': !!this.errorMessage }) }, (_b = this.vehicleInformation) === null || _b === void 0 ? void 0 : _b.vin), ['error', 'error-loading'].includes(this.state) && (h("div", { key: '9463ae07d446ee32d863f63a429f53e264e098df', class: "py-[16px] min-h-[100px] flex items-center" }, h("div", { key: 'c219e8528e42e9ca133a4a9d155d582b044be686', class: "px-[16px] py-[8px] border reject-card text-[20px] rounded-[8px] w-fit mx-auto" }, this.locale.errors[this.errorMessage] || this.locale.errors.wildCard))), ['data', 'data-loading'].includes(this.state) && (h("div", { key: 'd38ddb4d0d9a94690b241fb181975f030b24ee08', class: "flex mt-[12px] w-full max-h-[70dvh] overflow-hidden mx-auto rounded-[4px] flex-col border border-[#d6d8dc]" }, h("div", { key: '9e0ab718d4fe001f33fa797e7e5c36fc25d6c0c3', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, texts.paintThickness), h("div", { key: '88167cf6a7f3760726b03653a0a1cf3dd556a1f5', class: "h-0 overflow-auto flex-1" }, !parts.length && h("div", { key: 'ca4dd7c78b16a8ac39f4d01f6b70a02f42cf5cac', class: "h-[50px] px-[30px] flex items-center justify-center text-[18px]" }, texts.noData), !!parts.length && (h("table", { key: '6cbbc2120ef2caf69c9f8619d4dd20f1fc6f26b2', class: "w-full overflow-auto relative border-collapse" }, h("thead", { key: '7ee545ee60c85426c467a4f8754543c118ffb3e7', class: "top-0 font-bold sticky bg-white" }, h("tr", { key: 'a52d1ab2c7b5b406599db3be799849af22944ff2' }, ['part', 'left', 'right'].map(title => (h("th", { key: title, class: "px-[15px] min-w-[100px] py-[15px] text-center whitespace-nowrap border-b border-[#d6d8dc]" }, texts[title]))))), h("tbody", { key: 'd746af0eb34fcb88a74c15f237e076b88831e6b2' }, parts.map((part, idx) => (h("tr", { class: "transition-colors duration-100 hover:bg-slate-100", key: part.part }, ['part', 'left', 'right'].map(key => (h("td", { key: part.part + key, class: cn('px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]', {
542
- '!border-none': idx === parts.length - 1,
543
- }) }, part[key] || '...')))))))))))), ['data', 'data-loading'].includes(this.state) && (h("div", { key: '407f6dc349f57e0d53fec88a7ef8e02d628aed6d' }, !imageGroups.length && h("div", { key: 'fd625a3850ed1d3378333f61930dfff153b06f8e', class: "h-[40px] px-[30px] flex text-red-500 items-center justify-center text-[18px]" }, texts.noImageGroups), !!imageGroups.length && (h("div", { key: 'ba93e31ff58fe7e07cbd57490f6244ba1668ba79', class: "py-[16px] gap-[16px] justify-center flex flex-wrap px-[24px] w-full" }, imageGroups.map(imageGroup => (h("div", { class: "shrink-0 rounded-lg shadow-sm border overflow-hidden flex flex-col", key: imageGroup.name }, h("h1", { class: "text-center border-b bg-slate-200 font-semibold p-[6px]" }, imageGroup.name), h("div", { class: "flex p-[12px] gap-[8px]" }, imageGroup.images.map(image => (h("div", { class: "flex gap-[8px]", key: image }, h("button", { onClick: ({ target }) => this.openImage(target, image), class: "shrink-0 relative ring-0 outline-none w-fit mx-auto [&_img]:hover:shadow-lg [&_div]:hover:!opacity-100 cursor-pointer" }, h("div", { class: "absolute flex-col justify-center gap-[4px] size-full flex items-center pointer-events-none hover:opacity-100 rounded-lg opacity-0 bg-black/40 transition-all duration-300" }, h("img", { src: eyeSvg }), h("span", { class: "text-white" }, texts.expand)), h("img", { class: "w-auto h-[150px] cursor-pointer shadow-sm rounded-lg transition-all duration-300", src: image }))))))))), h("div", { key: '087ffa222d33118f9b775c2a99422421448f1551', onClick: () => this.closeImage(), style: { backdropFilter: this.expandedImage ? 'blur(3px)' : 'blur(0px)' }, class: cn('pointer-events-none w-[100dvw] h-[100dvh] fixed top-0 z-10 left-0 opacity-0 bg-black/40 transition-all duration-400', {
544
- 'pointer-events-auto opacity-100 delay-200': this.expandedImage,
545
- }) }, h("button", { key: '451471bf6d5c446d0e055149c8384bcfe61ff850', class: "flex flex-col mt-[16px] items-center justify-center size-12 float-right mr-[16px]", onClick: () => this.closeImage() }, h("div", { key: 'b9371b4965ee831f130b127e4a6b775f3d675a21', class: "h-1 w-12 rounded-full rotate-45 absolute bg-white" }), h("div", { key: 'b59446ba3fdbb31f71a490b23701b86a447212cd', class: "h-1 w-12 rounded-full -rotate-45 absolute bg-white" }))), h("img", { key: '9abf09feb9e1bc02ae7b8f4e42536b98a2228dba', alt: "", id: "expanded-image", class: "fixed opacity-0 z-40 transition-all rounded-lg" }))))))))));
546
- }
547
- get el() { return getElement(this); }
548
- static get watchers() { return {
549
- "language": ["changeLanguage"],
550
- "state": ["loadingListener"]
551
- }; }
552
- };
553
- PaintThickness.style = PaintThicknessStyle0;
554
-
555
- const serviceHistoryCss = "*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.15 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.block{display:block}:host{all:initial!important;display:block}*{font-family:Arial}.static{position:static}.hidden{display:none}.w-full{width:100%}.relative{position:relative}.sticky{position:sticky}.top-0{top:0}.mx-auto{margin-left:auto;margin-right:auto}.my-2{margin-bottom:.5rem;margin-top:.5rem}.mt-\\[12px\\]{margin-top:12px}.flex{display:flex}.table{display:table}.h-0{height:0}.h-\\[40px\\]{height:40px}.h-\\[80px\\]{height:80px}.max-h-\\[70dvh\\]{max-height:70dvh}.min-h-\\[100px\\]{min-height:100px}.w-fit{width:fit-content}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.scale-0{--tw-scale-x:0;--tw-scale-y:0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[8px\\]{border-radius:8px}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-\\[\\#d6d8dc\\]{--tw-border-opacity:1;border-color:rgb(214 216 220/var(--tw-border-opacity,1))}.bg-\\[\\#e1e3e5\\]{--tw-bg-opacity:1;background-color:rgb(225 227 229/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.px-\\[10px\\]{padding-left:10px;padding-right:10px}.px-\\[16px\\]{padding-left:16px;padding-right:16px}.py-\\[16px\\]{padding-bottom:16px;padding-top:16px}.py-\\[20px\\]{padding-bottom:20px;padding-top:20px}.py-\\[8px\\]{padding-bottom:8px;padding-top:8px}.pt-\\[4px\\]{padding-top:4px}.text-center{text-align:center}.text-\\[18px\\]{font-size:18px}.text-\\[20px\\]{font-size:20px}.font-bold{font-weight:700}.text-\\[\\#383c43\\]{--tw-text-opacity:1;color:rgb(56 60 67/var(--tw-text-opacity,1))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.opacity-0{opacity:0}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.\\!duration-700{transition-duration:.7s!important}.duration-300{transition-duration:.3s}.reject-card{background-color:#f7d7d8;border-color:#f2aeb5;color:#58151c}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.success-card{background-color:#d0e7de;border-color:#a2d0bb;color:#0b3521}.\\!border-none{border-style:none!important}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-100{transition-duration:.1s}.hover\\:bg-slate-100:hover{--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity,1))}";
556
- const ServiceHistoryStyle0 = serviceHistoryCss;
557
-
558
- let mockData$3 = {};
559
- const ServiceHistory = class {
560
- constructor(hostRef) {
561
- registerInstance(this, hostRef);
562
- this.baseUrl = '';
563
- this.isDev = false;
564
- this.queryString = '';
565
- this.language = 'en';
566
- this.errorCallback = undefined;
567
- this.loadingStateChange = undefined;
568
- this.loadedResponse = undefined;
569
- this.locale = localeSchema.getDefault();
570
- this.state = 'idle';
571
- this.externalVin = null;
572
- this.errorMessage = null;
573
- this.vehicleInformation = undefined;
574
- }
575
- async componentWillLoad() {
576
- await this.changeLanguage(this.language);
577
- }
578
- async changeLanguage(newLanguage) {
579
- this.locale = await getLocaleLanguage(newLanguage);
580
- }
581
- handleSettingData(response) {
582
- if (response.serviceHistory === null)
583
- response.serviceHistory = [];
584
- this.vehicleInformation = response;
585
- }
586
- async setData(newData, headers = {}) {
587
- clearTimeout(this.networkTimeoutRef);
588
- if (this.abortController)
589
- this.abortController.abort();
590
- this.abortController = new AbortController();
591
- let scopedTimeoutRef;
592
- const isVinRequest = typeof newData === 'string';
593
- const vin = isVinRequest ? newData : newData === null || newData === void 0 ? void 0 : newData.vin;
594
- this.externalVin = vin;
595
- try {
596
- if (!vin || vin.trim().length === 0) {
597
- this.state = 'idle';
598
- return;
599
- }
600
- if (this.state === 'data' || this.state === 'error') {
601
- this.state = (this.state + '-loading');
602
- }
603
- else
604
- this.state = 'loading';
605
- await new Promise(r => {
606
- scopedTimeoutRef = setTimeout(r, 700);
607
- this.networkTimeoutRef = scopedTimeoutRef;
608
- });
609
- const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData: mockData$3 }, headers) : newData;
610
- if (this.networkTimeoutRef === scopedTimeoutRef) {
611
- if (!vehicleResponse)
612
- throw new Error('wrongResponseFormat');
613
- this.handleSettingData(vehicleResponse);
614
- }
615
- this.errorMessage = null;
616
- this.state = 'data';
617
- }
618
- catch (error) {
619
- if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
620
- return;
621
- if (this.errorCallback)
622
- this.errorCallback(error.message);
623
- console.error(error);
624
- this.setErrorMessage(error.message);
625
- }
626
- }
627
- async setErrorMessage(message) {
628
- this.state = 'error';
629
- this.vehicleInformation = null;
630
- this.errorMessage = message;
631
- }
632
- async fetchData(requestedVin = this.externalVin, headers = {}) {
633
- await this.setData(requestedVin, headers);
634
- }
635
- async loadingListener() {
636
- if (this.loadingStateChange)
637
- this.loadingStateChange(this.state.includes('loading'));
638
- }
639
- async setMockData(newMockData) {
640
- mockData$3 = newMockData;
641
- }
642
- render() {
643
- var _a, _b, _c, _d;
644
- const texts = this.locale.vehicleLookup.serviceHistory;
645
- return (h(Host, { key: '494c96516afa8c600719ae4b11993d65379833de' }, h("div", { key: '73e622623c1d1d199e289f48d10f078a0d6afa30', dir: this.locale.direction, class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, h("div", { key: 'b6b472f8424d35db32c82c09c148c48c582e5f42' }, h("loading-spinner", { key: '18215eca615a56dfb967c75ddd93c7d9b173f88e', isLoading: this.state.includes('loading') }), h("div", { key: '456d06da497cbc4908ac9ec497457a8ef6aebf8c', class: cn('transition-all !duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, h("div", { key: '8d54117a79bf2f4f54104d6d185dc9c34de55a51', class: cn('text-center pt-[4px] text-[20px]', { 'text-red-600': !!this.errorMessage }) }, (_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.vin), ['error', 'error-loading'].includes(this.state) && (h("div", { key: '2ce1826b3943e5e625aec945dc544acb7fb8dc13', class: "py-[16px] min-h-[100px] flex items-center" }, h("div", { key: '252eda8c6beaa47f1d2c777bbc321625327c8ee5', class: "px-[16px] py-[8px] border reject-card text-[20px] rounded-[8px] w-fit mx-auto" }, this.locale.errors[this.errorMessage] || this.locale.errors.wildCard))), ['data', 'data-loading'].includes(this.state) && (h("div", { key: 'd5a4606ee38646e46a1ded82598f20733d535523', class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, h("div", { key: '40c16dfed9934b90b7e5e3a019cb38da54d4b571', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, texts.serviceHistory), h("div", { key: '45b3caf524a2dfeda7ed3d77f30f26f9f6424ca3', class: "h-0 overflow-auto flex-1" }, !((_b = this.vehicleInformation) === null || _b === void 0 ? void 0 : _b.serviceHistory.length) && h("div", { key: 'c073f64e5efa891972d92006dc46c8af5dfd4bf9', class: "h-[80px] flex items-center justify-center text-[18px]" }, texts.noData), !!((_c = this.vehicleInformation) === null || _c === void 0 ? void 0 : _c.serviceHistory.length) && (h("table", { key: '7d48066b05971f0601a7f2ba8a5114153778024c', class: "w-full overflow-auto relative border-collapse" }, h("thead", { key: '52400a5071355c7b76768e7578af7489965dd2e6', class: "top-0 font-bold sticky bg-white" }, h("tr", { key: '78fac4c56fe644cc85159830e83ad7b5867b801f' }, ['branch', 'dealer', 'invoiceNumber', 'date', 'serviceType', 'odometer'].map(title => (h("th", { key: title, class: "px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]" }, texts[title]))))), h("tbody", { key: '547fd72fce118c3d6273d6d12b88f9edc293224a' }, (_d = this.vehicleInformation) === null || _d === void 0 ? void 0 : _d.serviceHistory.map((service, idx) => (h("tr", { class: "transition-colors duration-100 hover:bg-slate-100", key: service.invoiceNumber }, ['branchName', 'companyName', 'invoiceNumber', 'serviceDate', 'serviceType', 'mileage'].map(serviceType => {
646
- var _a;
647
- return (h("td", { key: service.invoiceNumber + serviceType, class: cn('px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]', {
648
- '!border-none': idx === ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceHistory.length) - 1,
649
- }) }, service[serviceType] || '...'));
650
- })))))))))))))));
651
- }
652
- get el() { return getElement(this); }
653
- static get watchers() { return {
654
- "language": ["changeLanguage"],
655
- "state": ["loadingListener"]
656
- }; }
657
- };
658
- ServiceHistory.style = ServiceHistoryStyle0;
659
-
660
- const vehicleAccessoriesCss = "*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.15 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.block{display:block}:host{all:initial!important;display:block}*{font-family:Arial}.static{position:static}.hidden{display:none}.w-full{width:100%}.relative{position:relative}.sticky{position:sticky}.top-0{top:0}.mx-auto{margin-left:auto;margin-right:auto}.my-2{margin-bottom:.5rem;margin-top:.5rem}.mt-\\[12px\\]{margin-top:12px}.flex{display:flex}.table{display:table}.h-0{height:0}.h-\\[40px\\]{height:40px}.h-\\[80px\\]{height:80px}.max-h-\\[70dvh\\]{max-height:70dvh}.min-h-\\[100px\\]{min-height:100px}.w-fit{width:fit-content}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.scale-0{--tw-scale-x:0;--tw-scale-y:0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[8px\\]{border-radius:8px}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-\\[\\#d6d8dc\\]{--tw-border-opacity:1;border-color:rgb(214 216 220/var(--tw-border-opacity,1))}.bg-\\[\\#e1e3e5\\]{--tw-bg-opacity:1;background-color:rgb(225 227 229/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.px-\\[10px\\]{padding-left:10px;padding-right:10px}.px-\\[16px\\]{padding-left:16px;padding-right:16px}.py-\\[16px\\]{padding-bottom:16px;padding-top:16px}.py-\\[20px\\]{padding-bottom:20px;padding-top:20px}.py-\\[8px\\]{padding-bottom:8px;padding-top:8px}.pt-\\[4px\\]{padding-top:4px}.text-center{text-align:center}.text-\\[18px\\]{font-size:18px}.text-\\[20px\\]{font-size:20px}.font-bold{font-weight:700}.text-\\[\\#383c43\\]{--tw-text-opacity:1;color:rgb(56 60 67/var(--tw-text-opacity,1))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.opacity-0{opacity:0}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.\\!duration-700{transition-duration:.7s!important}.duration-300{transition-duration:.3s}.reject-card{background-color:#f7d7d8;border-color:#f2aeb5;color:#58151c}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.success-card{background-color:#d0e7de;border-color:#a2d0bb;color:#0b3521}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.fixed{position:fixed}.absolute{position:absolute}.left-0{left:0}.z-40{z-index:40}.z-50{z-index:50}.float-right{float:right}.mr-\\[16px\\]{margin-right:16px}.mt-\\[16px\\]{margin-top:16px}.size-12{height:3rem;width:3rem}.size-full{height:100%;width:100%}.h-1{height:.25rem}.h-\\[100dvh\\]{height:100dvh}.h-auto{height:auto}.max-h-\\[133px\\]{max-height:133px}.w-12{width:3rem}.w-\\[100dvw\\]{width:100dvw}.w-auto{width:auto}.max-w-\\[133px\\]{max-width:133px}.-rotate-45{--tw-rotate:-45deg}.-rotate-45,.rotate-45{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-45{--tw-rotate:45deg}.cursor-pointer{cursor:pointer}.gap-\\[4px\\]{gap:4px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.\\!border-none{border-style:none!important}.bg-black\\/40{background-color:rgba(0,0,0,.4)}.py-\\[10px\\]{padding-bottom:10px;padding-top:10px}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.opacity-100{opacity:1}.shadow,.shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.outline-none{outline:2px solid transparent;outline-offset:2px}.ring-0{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.blur{--tw-blur:blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.delay-200{transition-delay:.2s}.duration-100{transition-duration:.1s}.hover\\:bg-slate-100:hover{--tw-bg-opacity:1;background-color:rgb(241 245 249/var(--tw-bg-opacity,1))}.hover\\:opacity-100:hover{opacity:1}.\\[\\&_div\\]\\:hover\\:\\!opacity-100:hover div{opacity:1!important}.\\[\\&_img\\]\\:hover\\:shadow-lg:hover img{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}";
661
- const VehicleAccessoriesStyle0 = vehicleAccessoriesCss;
662
-
663
- let mockData$2 = {};
664
- const VehicleAccessories = class {
665
- constructor(hostRef) {
666
- registerInstance(this, hostRef);
667
- this.closeImageListener = (event) => {
668
- this.closeImage(event);
669
- };
670
- this.openImage = (target, imageSrc) => {
671
- openImageViewer(this, target, imageSrc);
672
- };
673
- this.closeImage = (event) => {
674
- closeImageViewer(this, event);
675
- };
676
- this.baseUrl = '';
677
- this.isDev = false;
678
- this.queryString = '';
679
- this.language = 'en';
680
- this.errorCallback = undefined;
681
- this.loadingStateChange = undefined;
682
- this.loadedResponse = undefined;
683
- this.locale = localeSchema.getDefault();
684
- this.state = 'idle';
685
- this.externalVin = null;
686
- this.expandedImage = null;
687
- this.errorMessage = null;
688
- this.vehicleInformation = undefined;
689
- }
690
- async componentWillLoad() {
691
- await this.changeLanguage(this.language);
692
- }
693
- async changeLanguage(newLanguage) {
694
- this.locale = await getLocaleLanguage(newLanguage);
695
- }
696
- handleSettingData(response) {
697
- if (!response.accessories || !Array.isArray(response.accessories))
698
- response.accessories = [];
699
- this.vehicleInformation = response;
700
- }
701
- async setData(newData, headers = {}) {
702
- clearTimeout(this.networkTimeoutRef);
703
- if (this.abortController)
704
- this.abortController.abort();
705
- this.abortController = new AbortController();
706
- let scopedTimeoutRef;
707
- const isVinRequest = typeof newData === 'string';
708
- const vin = isVinRequest ? newData : newData === null || newData === void 0 ? void 0 : newData.vin;
709
- this.externalVin = vin;
710
- try {
711
- if (!vin || vin.trim().length === 0) {
712
- this.state = 'idle';
713
- return;
714
- }
715
- if (this.state === 'data' || this.state === 'error') {
716
- this.state = (this.state + '-loading');
717
- }
718
- else
719
- this.state = 'loading';
720
- await new Promise(r => {
721
- scopedTimeoutRef = setTimeout(r, 700);
722
- this.networkTimeoutRef = scopedTimeoutRef;
723
- });
724
- const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData: mockData$2 }, headers) : newData;
725
- if (this.networkTimeoutRef === scopedTimeoutRef) {
726
- if (!vehicleResponse)
727
- throw new Error('wrongResponseFormat');
728
- this.handleSettingData(vehicleResponse);
729
- }
730
- this.errorMessage = null;
731
- this.state = 'data';
732
- }
733
- catch (error) {
734
- if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
735
- return;
736
- if (this.errorCallback)
737
- this.errorCallback(error.message);
738
- console.error(error);
739
- this.setErrorMessage(error.message);
740
- }
741
- }
742
- async setErrorMessage(message) {
743
- this.state = 'error';
744
- this.vehicleInformation = null;
745
- this.errorMessage = message;
746
- }
747
- async fetchData(requestedVin = this.externalVin, headers = {}) {
748
- await this.setData(requestedVin, headers);
749
- }
750
- async loadingListener() {
751
- if (this.loadingStateChange)
752
- this.loadingStateChange(this.state.includes('loading'));
753
- }
754
- async setMockData(newMockData) {
755
- mockData$2 = newMockData;
756
- }
757
- render() {
758
- var _a, _b;
759
- const texts = this.locale.vehicleLookup.accessories;
760
- const accessories = (this === null || this === void 0 ? void 0 : this.vehicleInformation) ? (_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.accessories : [];
761
- return (h(Host, { key: '45a45079c8b2181ac2520f8048f70953d3b0ac8e' }, h("div", { key: '36cef822b8d2d80063f359f2685078c544946cfc', dir: this.locale.direction, class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, h("div", { key: '1be9648439197f2f2c12c44f7df1ba4152a6f3ab' }, h("loading-spinner", { key: '599e827b82a6b45724c9413812193e8af738419f', isLoading: this.state.includes('loading') }), h("div", { key: '4ff63bc78440d833734eb0539c83bb053767b2e3', class: cn('transition-all !duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, h("div", { key: '0e7a20baabc0dd755a674d9bd2b250a01d5d5d1c', class: cn('text-center pt-[4px] text-[20px]', { 'text-red-600': !!this.errorMessage }) }, (_b = this.vehicleInformation) === null || _b === void 0 ? void 0 : _b.vin), ['error', 'error-loading'].includes(this.state) && (h("div", { key: '1f9e0ffeb0630c8b7253c311d393f02e6b56fe8e', class: "py-[16px] min-h-[100px] flex items-center" }, h("div", { key: 'e4bd61283e3a31c19f4bde1e3a7b7bdbdf5f1afb', class: "px-[16px] py-[8px] border reject-card text-[20px] rounded-[8px] w-fit mx-auto" }, this.locale.errors[this.errorMessage] || this.locale.errors.wildCard))), ['data', 'data-loading'].includes(this.state) && (h("div", { key: '9787262f0bc635db6c42f6fe384c9c776b35629c', class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, h("div", { key: 'c9627629870ec66f8b303f37fcfffacbc5fa07aa', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, texts.vehicleAccessories), h("div", { key: '57e7d6aaa358aa1655fc91ff1497e07fa79c2c8a', class: "h-0 overflow-auto flex-1" }, !accessories.length && h("div", { key: 'ae5f306cdefe4234ce8ce8c16cea3b5c72324767', class: "h-[80px] flex items-center justify-center text-[18px]" }, texts.noData), !!accessories.length && (h("table", { key: '5e6761188ecc51d4c798df707dd72887e366cd3b', class: "w-full overflow-auto relative border-collapse" }, h("thead", { key: 'aaaa6582c0e591e5b1e77e0b0fbc0f201c1eb40a', class: "top-0 font-bold z-40 sticky bg-white" }, h("tr", { key: '19be04c21863a9d6b90df62524e99acc63d282a9' }, ['partNumber', 'description', 'image'].map(title => (h("th", { key: title, class: "px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]" }, texts[title]))))), h("tbody", { key: '50a140f00fd7b095ee34a757cd3e44093096c723' }, accessories.map((accessory, idx) => {
762
- var _a;
763
- return (h("tr", { class: "transition-colors duration-100 hover:bg-slate-100", key: accessory.partNumber }, ['partNumber', 'description'].map(key => {
764
- var _a;
765
- return (h("td", { key: accessory.partNumber + key, class: cn('px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]', {
766
- '!border-none': idx === ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceHistory.length) - 1,
767
- }) }, accessory[key] || '...'));
768
- }), h("td", { class: cn('px-[10px] py-[10px] text-center whitespace-nowrap border-b border-[#d6d8dc]', {
769
- '!border-none': idx === ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceHistory.length) - 1,
770
- }) }, h("button", { onClick: ({ target }) => this.openImage(target, accessory.image), class: "shrink-0 relative ring-0 outline-none w-fit mx-auto [&_img]:hover:shadow-lg [&_div]:hover:!opacity-100 cursor-pointer" }, h("div", { class: "absolute flex-col justify-center gap-[4px] size-full flex items-center pointer-events-none hover:opacity-100 rounded-lg opacity-0 bg-black/40 transition-all duration-300" }, h("img", { src: eyeSvg }), h("span", { class: "text-white" }, texts.expand)), h("img", { class: "w-auto h-auto max-w-[133px] max-h-[133px] cursor-pointer shadow-sm rounded-lg transition-all duration-300", src: accessory.image })))));
771
- })), h("div", { key: '78c751aadd610e35c3a2fae42d72d86ada5a8530', onClick: () => this.closeImage(), style: { backdropFilter: this.expandedImage ? 'blur(3px)' : 'blur(0px)' }, class: cn('pointer-events-none w-[100dvw] h-[100dvh] fixed top-0 z-50 left-0 opacity-0 bg-black/40 transition-all duration-400', {
772
- 'pointer-events-auto opacity-100 delay-200': this.expandedImage,
773
- }) }, h("button", { key: 'cbf2e5984fbc359918dbecd6bc4f39be1494fba6', class: "flex flex-col mt-[16px] items-center justify-center size-12 float-right mr-[16px]", onClick: () => this.closeImage() }, h("div", { key: '1300cb8cc2e2bcc3f6f3d88348cc4a6e448573c3', class: "h-1 w-12 rounded-full rotate-45 absolute bg-white" }), h("div", { key: '56207a53e2ef9976ef431774ee5aad23f37a621d', class: "h-1 w-12 rounded-full -rotate-45 absolute bg-white" }))), h("img", { key: 'a6a8ca9cc1506146eda3d29b2ac2daa10397b122', alt: "", id: "expanded-image", class: "fixed opacity-0 z-50 transition-all rounded-lg" })))))))))));
774
- }
775
- get el() { return getElement(this); }
776
- static get watchers() { return {
777
- "language": ["changeLanguage"],
778
- "state": ["loadingListener"]
779
- }; }
780
- };
781
- VehicleAccessories.style = VehicleAccessoriesStyle0;
782
-
783
- const vehicleSpecificationCss = "*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.15 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.block{display:block}:host{all:initial!important;display:block}*{font-family:Arial}.static{position:static}.hidden{display:none}.w-full{width:100%}.relative{position:relative}.sticky{position:sticky}.top-0{top:0}.mx-auto{margin-left:auto;margin-right:auto}.my-2{margin-bottom:.5rem;margin-top:.5rem}.mt-\\[12px\\]{margin-top:12px}.flex{display:flex}.table{display:table}.h-0{height:0}.h-\\[40px\\]{height:40px}.h-\\[80px\\]{height:80px}.max-h-\\[70dvh\\]{max-height:70dvh}.min-h-\\[100px\\]{min-height:100px}.w-fit{width:fit-content}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.scale-0{--tw-scale-x:0;--tw-scale-y:0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[8px\\]{border-radius:8px}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-\\[\\#d6d8dc\\]{--tw-border-opacity:1;border-color:rgb(214 216 220/var(--tw-border-opacity,1))}.bg-\\[\\#e1e3e5\\]{--tw-bg-opacity:1;background-color:rgb(225 227 229/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.px-\\[10px\\]{padding-left:10px;padding-right:10px}.px-\\[16px\\]{padding-left:16px;padding-right:16px}.py-\\[16px\\]{padding-bottom:16px;padding-top:16px}.py-\\[20px\\]{padding-bottom:20px;padding-top:20px}.py-\\[8px\\]{padding-bottom:8px;padding-top:8px}.pt-\\[4px\\]{padding-top:4px}.text-center{text-align:center}.text-\\[18px\\]{font-size:18px}.text-\\[20px\\]{font-size:20px}.font-bold{font-weight:700}.text-\\[\\#383c43\\]{--tw-text-opacity:1;color:rgb(56 60 67/var(--tw-text-opacity,1))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.opacity-0{opacity:0}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.\\!duration-700{transition-duration:.7s!important}.duration-300{transition-duration:.3s}.reject-card{background-color:#f7d7d8;border-color:#f2aeb5;color:#58151c}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.success-card{background-color:#d0e7de;border-color:#a2d0bb;color:#0b3521}";
784
- const VehicleSpecificationStyle0 = vehicleSpecificationCss;
785
-
786
- let mockData$1 = {};
787
- const VehicleSpecification = class {
788
- constructor(hostRef) {
789
- registerInstance(this, hostRef);
790
- this.baseUrl = '';
791
- this.isDev = false;
792
- this.queryString = '';
793
- this.language = 'en';
794
- this.errorCallback = undefined;
795
- this.loadingStateChange = undefined;
796
- this.loadedResponse = undefined;
797
- this.locale = localeSchema.getDefault();
798
- this.state = 'idle';
799
- this.externalVin = null;
800
- this.errorMessage = null;
801
- this.vehicleInformation = undefined;
802
- }
803
- async componentWillLoad() {
804
- await this.changeLanguage(this.language);
805
- }
806
- async changeLanguage(newLanguage) {
807
- this.locale = await getLocaleLanguage(newLanguage);
808
- }
809
- async setData(newData, headers = {}) {
810
- clearTimeout(this.networkTimeoutRef);
811
- if (this.abortController)
812
- this.abortController.abort();
813
- this.abortController = new AbortController();
814
- let scopedTimeoutRef;
815
- const isVinRequest = typeof newData === 'string';
816
- const vin = isVinRequest ? newData : newData === null || newData === void 0 ? void 0 : newData.vin;
817
- this.externalVin = vin;
818
- try {
819
- if (!vin || vin.trim().length === 0) {
820
- this.state = 'idle';
821
- return;
822
- }
823
- if (this.state === 'data' || this.state === 'error') {
824
- this.state = (this.state + '-loading');
825
- }
826
- else
827
- this.state = 'loading';
828
- await new Promise(r => {
829
- scopedTimeoutRef = setTimeout(r, 700);
830
- this.networkTimeoutRef = scopedTimeoutRef;
831
- });
832
- const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData: mockData$1 }, headers) : newData;
833
- if (this.networkTimeoutRef === scopedTimeoutRef) {
834
- if (!vehicleResponse)
835
- throw new Error('wrongResponseFormat');
836
- this.vehicleInformation = vehicleResponse;
837
- }
838
- this.errorMessage = null;
839
- this.state = 'data';
840
- }
841
- catch (error) {
842
- if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
843
- return;
844
- if (this.errorCallback)
845
- this.errorCallback(error.message);
846
- console.error(error);
847
- this.setErrorMessage(error.message);
848
- }
849
- }
850
- async setErrorMessage(message) {
851
- this.state = 'error';
852
- this.vehicleInformation = null;
853
- this.errorMessage = message;
854
- }
855
- async fetchData(requestedVin = this.externalVin, headers = {}) {
856
- await this.setData(requestedVin, headers);
857
- }
858
- async loadingListener() {
859
- if (this.loadingStateChange)
860
- this.loadingStateChange(this.state.includes('loading'));
861
- }
862
- async setMockData(newMockData) {
863
- mockData$1 = newMockData;
864
- }
865
- render() {
866
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
867
- const texts = this.locale.vehicleLookup.specification;
868
- return (h(Host, { key: '966a2b84d675c7031c46f679e130634561f98ada' }, h("div", { key: 'f48158fa5c4344257336c480935208ba5dfc136e', dir: this.locale.direction, class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, h("div", { key: '413cc63829b9a219e0bbbc8e42e577c9cab36ab3' }, h("loading-spinner", { key: 'f831e4ef1fe284d2b3ac2c817210ad5a610cc37f', isLoading: this.state.includes('loading') }), h("div", { key: 'b1d177592c8e4ce1ff19ae27dd0ed5873c06bb5a', class: cn('transition-all !duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, h("div", { key: 'a5155d13903a0d9724a48bc278674376be2236b0', class: cn('text-center pt-[4px] text-[20px]', { 'text-red-600': !!this.errorMessage }) }, (_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.vin), ['error', 'error-loading'].includes(this.state) && (h("div", { key: 'ab72bf4d1b68f7cda3f8b7d8e91e76d07d76b6fb', class: "py-[16px] min-h-[100px] flex items-center" }, h("div", { key: '30cf045b0601853845fed6048453d7416a10a145', class: "px-[16px] py-[8px] border reject-card text-[20px] rounded-[8px] w-fit mx-auto" }, this.locale.errors[this.errorMessage] || this.locale.errors.wildCard))), ['data', 'data-loading'].includes(this.state) && (h("div", { key: '613a57216867b361636c816790c20ecd2def8de7', class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, h("div", { key: '2f76caec457bbd47ceffe1b596241bc34c7a749f', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, texts.vehicleSpecification), h("div", { key: '5ab9f03c11d468bfaf69c16ee22596227dbd3c2a', class: "h-0 overflow-auto flex-1" }, !((_b = this.vehicleInformation) === null || _b === void 0 ? void 0 : _b.vehicleSpecification) && h("div", { key: '9694b72b94235fcb9a3fca52cd374da62927ab3b', class: "h-[80px] flex items-center justify-center text-[18px]" }, texts.noData), !!((_c = this.vehicleInformation) === null || _c === void 0 ? void 0 : _c.vehicleSpecification) && (h("table", { key: 'b95bc271bd059a4e3734d9d7fd5ead78a4a672e3', class: "w-full overflow-auto relative border-collapse" }, h("thead", { key: 'd8e1caf45464198e0b58201be1bed8ba0efadbbe', class: "top-0 font-bold sticky bg-white" }, h("tr", { key: 'bb50345681bea2c445c18c665529505316ebc8ea' }, ['model', 'variant', 'katashiki', 'modelYear', 'sfx'].map(title => (h("th", { key: title, class: "px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]" }, texts[title]))))), h("tbody", { key: 'f0e21ac39b28a8ef82f8695e1d3a9ef7e25d19d6' }, h("tr", { key: '0aa7328e0c0045b62d14244c8ed643cf0f12223a' }, h("td", { key: '719a128661dfda01c879cecaea14e2c21a85243e', class: "px-[10px] py-[20px] text-center whitespace-nowrap" }, ((_e = (_d = this === null || this === void 0 ? void 0 : this.vehicleInformation) === null || _d === void 0 ? void 0 : _d.vehicleVariantInfo) === null || _e === void 0 ? void 0 : _e.modelCode) || '...', " ", h("br", { key: '18071fb7e664d3d7cded4752921b192c276b083e', class: "my-2" }), ((_g = (_f = this === null || this === void 0 ? void 0 : this.vehicleInformation) === null || _f === void 0 ? void 0 : _f.vehicleSpecification) === null || _g === void 0 ? void 0 : _g.modelDesc) || '...'), h("td", { key: 'ccec23a08e7b9858e2a6e232f07d08b070d831d6', class: "px-[10px] py-[20px] text-center whitespace-nowrap" }, ((_j = (_h = this === null || this === void 0 ? void 0 : this.vehicleInformation) === null || _h === void 0 ? void 0 : _h.identifiers) === null || _j === void 0 ? void 0 : _j.variant) || '...', " ", h("br", { key: 'fd126e50a209d6535a5755b47159466f291b3987' }), ((_l = (_k = this === null || this === void 0 ? void 0 : this.vehicleInformation) === null || _k === void 0 ? void 0 : _k.vehicleSpecification) === null || _l === void 0 ? void 0 : _l.variantDesc) || '...'), ['identifiers.katashiki', 'vehicleVariantInfo.modelYear', 'vehicleVariantInfo.sfx'].map(infoPath => {
869
- var _a;
870
- const [place, field] = infoPath.split('.');
871
- const targetPlace = (_a = this === null || this === void 0 ? void 0 : this.vehicleInformation) === null || _a === void 0 ? void 0 : _a[place];
872
- const cellValue = targetPlace && targetPlace[field] ? targetPlace[field].toString() : '';
873
- return (h("td", { key: infoPath, class: cn('px-[10px] py-[20px] text-center whitespace-nowrap') }, cellValue.trim() ? cellValue : '...'));
874
- })))))))))))));
875
- }
876
- get el() { return getElement(this); }
877
- static get watchers() { return {
878
- "language": ["changeLanguage"],
879
- "state": ["loadingListener"]
880
- }; }
881
- };
882
- VehicleSpecification.style = VehicleSpecificationStyle0;
883
-
884
- const xMarkSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj4KICAgIDxwYXRoIGZpbGw9IiM1ODE1MWMiCiAgICAgICAgZD0iTTI1NiA1MTJBMjU2IDI1NiAwIDEgMCAyNTYgMGEyNTYgMjU2IDAgMSAwIDAgNTEyek0xNzUgMTc1YzkuNC05LjQgMjQuNi05LjQgMzMuOSAwbDQ3IDQ3IDQ3LTQ3YzkuNC05LjQgMjQuNi05LjQgMzMuOSAwczkuNCAyNC42IDAgMzMuOWwtNDcgNDcgNDcgNDdjOS40IDkuNCA5LjQgMjQuNiAwIDMzLjlzLTI0LjYgOS40LTMzLjkgMGwtNDctNDctNDcgNDdjLTkuNCA5LjQtMjQuNiA5LjQtMzMuOSAwcy05LjQtMjQuNiAwLTMzLjlsNDctNDctNDctNDdjLTkuNC05LjQtOS40LTI0LjYgMC0zMy45eiIgLz4KPC9zdmc+';
885
-
886
- const checkSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj4KICAgIDxwYXRoIGZpbGw9IiMwYjM1MjEiCiAgICAgICAgZD0iTTI1NiA1MTJBMjU2IDI1NiAwIDEgMCAyNTYgMGEyNTYgMjU2IDAgMSAwIDAgNTEyek0zNjkgMjA5TDI0MSAzMzdjLTkuNCA5LjQtMjQuNiA5LjQtMzMuOSAwbC02NC02NGMtOS40LTkuNC05LjQtMjQuNiAwLTMzLjlzMjQuNi05LjQgMzMuOSAwbDQ3IDQ3TDMzNSAxNzVjOS40LTkuNCAyNC42LTkuNCAzMy45IDBzOS40IDI0LjYgMCAzMy45eiIgLz4KPC9zdmc+';
887
-
888
- function SSCTable({ ssc, locale }) {
889
- const warrantyLocale = locale.vehicleLookup.warranty;
890
- return (h("div", { class: "wrapper-table" },
891
- h("div", { class: "header" }, warrantyLocale.sscCampings),
892
- h("div", { class: "ssc-table-container" },
893
- h("table", { class: "ssc-table" },
894
- h("thead", null,
895
- h("tr", null,
896
- h("th", null, warrantyLocale.sscTableCode),
897
- h("th", null, warrantyLocale.sscTableDescription),
898
- h("th", null, warrantyLocale.sscTableRepairStatus),
899
- h("th", null, warrantyLocale.sscTableOPCode),
900
- h("th", null, warrantyLocale.sscTablePartNumber))),
901
- h("tbody", null, ssc.map(sscItem => (h("tr", { class: "transition", key: sscItem.sscCode },
902
- h("td", null, sscItem.sscCode),
903
- h("td", null, sscItem.description),
904
- h("td", null,
905
- h("div", { class: "table-cell-container" },
906
- h("img", { class: "table-status-icon", src: sscItem.repaired ? checkSvg : xMarkSvg }),
907
- " ", sscItem === null || sscItem === void 0 ? void 0 :
908
- sscItem.repairDate)),
909
- h("td", null,
910
- h("div", { class: "table-cell-container table-cell-labors-container" }, !!sscItem.labors.length
911
- ? sscItem.labors.map(labor => (h("div", { key: labor.laborCode, class: 'success' }, labor.laborCode)))
912
- : '...')),
913
- h("td", null,
914
- h("div", { class: "table-cell-container table-cell-parts-container" }, !!sscItem.parts.length
915
- ? sscItem.parts.map(part => (h("div", { key: part.partNumber, class: part.isAvailable ? 'success' : 'reject' }, part.partNumber)))
916
- : '...'))))))))));
917
- }
918
-
919
- function StatusCard({ desc, className, fromDesc, toDesc, from, to, state = 'idle', icon = true }) {
920
- return (h("div", { class: cn('card', className, `${state}-card`) },
921
- icon && state === 'reject' && h("img", { src: xMarkSvg }),
922
- icon && state === 'warning' && h("img", { src: xMarkSvg }),
923
- icon && state === 'success' && h("img", { src: checkSvg }),
924
- from && (h("p", { class: "no-padding flex gap-2" },
925
- h("span", { class: "font-semibold" },
926
- fromDesc,
927
- ":"),
928
- " ",
929
- desc)),
930
- to && (h("p", { class: "no-padding flex gap-2" },
931
- h("span", { class: "font-semibold" },
932
- toDesc,
933
- ":"),
934
- " ",
935
- desc)),
936
- !from && !to && h("p", { class: state === 'idle' ? 'no-padding' : '' }, desc)));
937
- }
938
-
939
- function CardsContainer({ warranty, isAuthorized, unInvoicedByBrokerName, locale }) {
940
- const warrantyLocale = locale.vehicleLookup.warranty;
941
- return (h("div", { class: "warranty-tags mx-auto pt-3" },
942
- h(StatusCard, { state: isAuthorized ? 'success' : 'reject', desc: isAuthorized ? warrantyLocale.authorized : warrantyLocale.unauthorized }),
943
- h(StatusCard, { state: warranty.hasActiveWarranty ? 'success' : 'reject', desc: warranty.hasActiveWarranty ? warrantyLocale.activeWarranty : warrantyLocale.notActiveWarranty }),
944
- unInvoicedByBrokerName && h(StatusCard, { className: "span-entire-2nd-row", state: "warning", icon: true, desc: warrantyLocale.notInvoiced + unInvoicedByBrokerName }),
945
- warranty.warrantyStartDate && (h(StatusCard, { state: (warranty === null || warranty === void 0 ? void 0 : warranty.hasActiveWarranty) ? 'success' : 'reject', icon: false, from: true, fromDesc: warrantyLocale.from, desc: warranty.warrantyStartDate })),
946
- warranty.warrantyEndDate && (h(StatusCard, { state: (warranty === null || warranty === void 0 ? void 0 : warranty.hasActiveWarranty) ? 'success' : 'reject', icon: false, to: true, toDesc: warrantyLocale.to, desc: warranty.warrantyEndDate }))));
947
- }
948
-
949
- const warrantyDetailsCss = "*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.15 | MIT License | https://tailwindcss.com*/:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}.collapse{visibility:collapse}.absolute{left:0;position:absolute;top:0}.relative{position:relative}.sticky{position:sticky}.mx-auto{margin-left:auto;margin-right:auto}.mt-4{margin-top:1rem}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-0{height:0!important;height:0}.flex-shrink{flex-shrink:1}.border-collapse{border-collapse:collapse}.flex-wrap{flex-wrap:wrap}.border{border-width:1px}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pr-1{padding-right:4px}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.font-semibold{font-weight:600}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition:all;transition-duration:.3s}.duration-1000{transition-duration:1s}.duration-500{transition-duration:.5s}.duration-700{transition-duration:.7s}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.success-card{background:#d0e7de;background-color:#d0e7de;border-color:#a2d0bb!important;border-color:#a2d0bb;color:#0b3521}.reject-card{background:#f7d7d8;background-color:#f7d7d8;border-color:#f2aeb5!important;border-color:#f2aeb5;color:#58151c}:host{all:initial!important;display:block}*{font-family:Arial}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.fade-in{animation:fadeIn .3s ease-in forwards;opacity:0}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}.fade-out{animation:fadeIn .3s ease-in forwards;opacity:1}.loading-spinner{align-items:center;display:flex;height:100%;justify-content:center;pointer-events:none;transition:all;transition-duration:.1s;width:100%}.loading-spinner img{height:40px;width:40px}.warranty{overflow:hidden;position:relative;transition:all;transition-duration:.3s}.hide{opacity:0}.card{border:1px solid;border-radius:6px;flex-shrink:0;gap:8px;padding:8px 12px}.card,.card p{align-items:center;display:flex}.card p{flex:1 1 0%;font-size:16px;height:25px;margin:0;padding-left:50px}.card p.no-padding{padding-left:4px}.card img{height:25px;width:25px}.recaptcha-response{border:1px solid;border-radius:8px;font-size:20px;margin:16px auto 0;padding:8px 16px;width:-moz-fit-content;width:fit-content}.warning-card{background:#fcf8e3;border-color:#faebcc!important;color:#8a6d3b}.span-entire-2nd-row{grid-column:1/3;grid-row:2/3}.warranty-tags{display:grid;gap:12px;grid-template-columns:1fr 1fr;max-width:1000px}.pt-3,.py-3{padding-top:12px}.pb-3,.py-3{padding-bottom:12px}.pt-4,.py-4{padding-top:16px}.pb-4,.py-4{padding-bottom:16px}.max-w-500{max-width:500px}.mt-4,.my-4{margin-bottom:16px;margin-top:16px}.warranty *{box-sizing:border-box}.wrapper-table{border:1px solid #d6d8dc;border-radius:4px;display:flex;flex-direction:column;margin-top:12px;max-height:70vh;overflow:hidden}.ssc-table-container{flex:1 1 0%;height:0;overflow:auto}.wrapper-table .header{align-items:center;background:#e1e3e5;color:#383c43;display:flex;flex-shrink:0;font-size:18px;height:40px;justify-content:center;width:100%}.ssc-table{border-collapse:collapse;overflow:auto;position:relative;width:100%}.ssc-table thead{background-color:#fff;font-weight:700;position:sticky;top:0}.ssc-table td,.ssc-table th{border-bottom:1px solid #d6d8dc;padding:10px 20px;text-align:center;transition:all;transition-duration:.3s;white-space:nowrap}.ssc-table tr:hover{background:#f4f4f4}.ssc-table tr:last-child td{border:none}.table-cell-container{align-items:center;display:flex;gap:8px;justify-content:center;width:100%}.table-cell-labors-container,.table-cell-parts-container{flex-wrap:wrap}.table-cell-labors-container div,.table-cell-parts-container div{border-radius:4px;font-size:14px;padding:4px 8px}.table-cell-labors-container div.success,.table-cell-parts-container div.success{background:#d0e7de}.table-cell-labors-container div.reject,.table-cell-parts-container div.reject{background:#f7d7d8}.table-status-icon{height:20px;width:20px}.warranty-vin{font-size:20px;padding-top:4px;text-align:center}.recaptcha-container{display:flex;justify-content:center;overflow:hidden}.static{position:static}.w-full{width:100%}.top-0{top:0}.my-2{margin-bottom:.5rem;margin-top:.5rem}.mt-\\[12px\\]{margin-top:12px}.table{display:table}.h-\\[40px\\]{height:40px}.h-\\[80px\\]{height:80px}.max-h-\\[70dvh\\]{max-height:70dvh}.min-h-\\[100px\\]{min-height:100px}.w-fit{width:fit-content}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.scale-0{--tw-scale-x:0;--tw-scale-y:0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[8px\\]{border-radius:8px}.border-b{border-bottom-width:1px}.border-\\[\\#d6d8dc\\]{--tw-border-opacity:1;border-color:rgb(214 216 220/var(--tw-border-opacity,1))}.bg-\\[\\#e1e3e5\\]{--tw-bg-opacity:1;background-color:rgb(225 227 229/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.px-\\[10px\\]{padding-left:10px;padding-right:10px}.px-\\[16px\\]{padding-left:16px;padding-right:16px}.py-\\[16px\\]{padding-bottom:16px;padding-top:16px}.py-\\[20px\\]{padding-bottom:20px;padding-top:20px}.py-\\[8px\\]{padding-bottom:8px;padding-top:8px}.pt-\\[4px\\]{padding-top:4px}.text-center{text-align:center}.text-\\[18px\\]{font-size:18px}.text-\\[20px\\]{font-size:20px}.font-bold{font-weight:700}.text-\\[\\#383c43\\]{--tw-text-opacity:1;color:rgb(56 60 67/var(--tw-text-opacity,1))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.opacity-0{opacity:0}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.\\!duration-700{transition-duration:.7s!important}.duration-300{transition-duration:.3s}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}";
950
- const WarrantyDetailsStyle0 = warrantyDetailsCss;
951
-
952
- let mockData = {};
953
- const WarrantyDetails = class {
954
- constructor(hostRef) {
955
- registerInstance(this, hostRef);
956
- this.baseUrl = '';
957
- this.isDev = false;
958
- this.showSsc = false;
959
- this.queryString = '';
960
- this.recaptchaKey = '';
961
- this.language = 'en';
962
- this.showWarranty = false;
963
- this.unauthorizedSscLookupBaseUrl = '';
964
- this.unauthorizedSscLookupQueryString = '';
965
- this.cityId = null;
966
- this.cityIntegrationId = null;
967
- this.companyId = null;
968
- this.companyIntegrationId = null;
969
- this.companyBranchId = null;
970
- this.companyBranchIntegrationId = null;
971
- this.userId = null;
972
- this.brandIntegrationId = null;
973
- this.customerName = null;
974
- this.customerPhone = null;
975
- this.customerEmail = null;
976
- this.errorCallback = undefined;
977
- this.loadingStateChange = undefined;
978
- this.loadedResponse = undefined;
979
- this.state = 'idle';
980
- this.externalVin = null;
981
- this.showRecaptcha = false;
982
- this.errorMessage = null;
983
- this.unInvoicedByBrokerName = null;
984
- this.vehicleInformation = undefined;
985
- this.checkingUnauthorizedSSC = false;
986
- this.recaptchaRes = null;
987
- this.headers = {};
988
- this.locale = localeSchema.getDefault();
989
- }
990
- async componentWillLoad() {
991
- await this.changeLanguage(this.language);
992
- }
993
- async changeLanguage(newLanguage) {
994
- this.locale = await getLocaleLanguage(newLanguage);
995
- }
996
- handleSettingData(response) {
997
- var _a, _b, _c;
998
- if (response.warranty === null)
999
- response.warranty = {
1000
- warrantyEndDate: '',
1001
- warrantyStartDate: '',
1002
- hasActiveWarranty: false,
1003
- hasExtendedWarranty: false,
1004
- extendedWarrantyEndDate: '',
1005
- extendedWarrantyStartDate: '',
1006
- };
1007
- if (response.ssc === null)
1008
- response.ssc = [];
1009
- this.unInvoicedByBrokerName = null;
1010
- if (((_a = response === null || response === void 0 ? void 0 : response.saleInformation) === null || _a === void 0 ? void 0 : _a.broker) !== null && ((_c = (_b = response === null || response === void 0 ? void 0 : response.saleInformation) === null || _b === void 0 ? void 0 : _b.broker) === null || _c === void 0 ? void 0 : _c.invoiceDate) === null)
1011
- this.unInvoicedByBrokerName = response.saleInformation.broker.brokerName;
1012
- this.vehicleInformation = response;
1013
- }
1014
- async handleInitializingRecaptcha(vin, scopedTimeoutRef) {
1015
- var _a;
1016
- if (((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.isAuthorized) === false && this.showSsc && this.recaptchaKey !== '') {
1017
- grecaptcha.reset();
1018
- await new Promise(r => setTimeout(r, 400));
1019
- this.recaptchaIntervalRef = setInterval(async () => {
1020
- var _a;
1021
- const recaptchaResponse = grecaptcha.getResponse();
1022
- if (recaptchaResponse) {
1023
- clearInterval(this.recaptchaIntervalRef);
1024
- if (this.isDev) {
1025
- this.checkingUnauthorizedSSC = true;
1026
- this.showRecaptcha = false;
1027
- await new Promise(r => setTimeout(r, 3000));
1028
- this.checkingUnauthorizedSSC = false;
1029
- const hasPendingSSC = Math.random() < 0.5 ? false : true;
1030
- this.recaptchaRes = {
1031
- hasSSC: hasPendingSSC,
1032
- message: hasPendingSSC ? 'pendingSSC' : 'noPendingSSC',
1033
- };
1034
- }
1035
- else {
1036
- this.checkingUnauthorizedSSC = true;
1037
- this.showRecaptcha = false;
1038
- ///
1039
- const response = await fetch(`${this.unauthorizedSscLookupBaseUrl}${vin}/${(_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.sscLogId}?${this.unauthorizedSscLookupQueryString}`, {
1040
- signal: this.abortController.signal,
1041
- headers: Object.assign(Object.assign({}, this.headers), { 'Ssc-Recaptcha-Token': recaptchaResponse }),
1042
- });
1043
- const vinResponse = await response.json();
1044
- if (vinResponse && this.networkTimeoutRef === scopedTimeoutRef) {
1045
- this.checkingUnauthorizedSSC = false;
1046
- const hasPendingSSC = vinResponse.sscLookupStatus === 1;
1047
- this.recaptchaRes = {
1048
- hasSSC: hasPendingSSC,
1049
- message: hasPendingSSC ? 'pendingSSC' : 'noPendingSSC',
1050
- };
1051
- }
1052
- else
1053
- throw new Error('wrongResponseFormat');
1054
- }
1055
- }
1056
- }, 500);
1057
- this.showRecaptcha = true;
1058
- }
1059
- else {
1060
- this.showRecaptcha = false;
1061
- }
1062
- }
1063
- async setData(newData, headers = {}) {
1064
- this.recaptchaRes = null;
1065
- this.headers = headers;
1066
- clearTimeout(this.networkTimeoutRef);
1067
- clearInterval(this.recaptchaIntervalRef);
1068
- if (this.abortController)
1069
- this.abortController.abort();
1070
- this.abortController = new AbortController();
1071
- let scopedTimeoutRef;
1072
- const isVinRequest = typeof newData === 'string';
1073
- const vin = isVinRequest ? newData : newData === null || newData === void 0 ? void 0 : newData.vin;
1074
- this.externalVin = vin;
1075
- try {
1076
- if (!vin || vin.trim().length === 0) {
1077
- this.state = 'idle';
1078
- return;
1079
- }
1080
- if (this.state === 'data' || this.state === 'error') {
1081
- this.state = (this.state + '-loading');
1082
- }
1083
- else
1084
- this.state = 'loading';
1085
- await new Promise(r => {
1086
- scopedTimeoutRef = setTimeout(r, 600);
1087
- this.networkTimeoutRef = scopedTimeoutRef;
1088
- });
1089
- const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData }, headers) : newData;
1090
- if (this.networkTimeoutRef === scopedTimeoutRef) {
1091
- if (!vehicleResponse)
1092
- throw new Error('wrongResponseFormat');
1093
- this.handleSettingData(vehicleResponse);
1094
- this.handleInitializingRecaptcha(vin, scopedTimeoutRef);
1095
- }
1096
- this.errorMessage = null;
1097
- this.state = 'data';
1098
- }
1099
- catch (error) {
1100
- if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
1101
- return;
1102
- if (this.errorCallback)
1103
- this.errorCallback(error.message);
1104
- console.error(error);
1105
- this.setErrorMessage(error.message);
1106
- }
1107
- }
1108
- async setErrorMessage(message) {
1109
- this.state = 'error';
1110
- this.vehicleInformation = null;
1111
- this.errorMessage = message;
1112
- }
1113
- async fetchData(requestedVin = this.externalVin, headers = {}) {
1114
- await this.setData(requestedVin, headers);
1115
- }
1116
- async componentDidLoad() {
1117
- if (this.recaptchaKey !== '') {
1118
- const script = document.createElement('script');
1119
- script.src = 'https://www.google.com/recaptcha/api.js';
1120
- script.async = true;
1121
- script.defer = true;
1122
- script.onload = () => console.log('reCAPTCHA script loaded');
1123
- document.head.appendChild(script);
1124
- }
1125
- }
1126
- async setMockData(newMockData) {
1127
- mockData = newMockData;
1128
- }
1129
- async loadingListener() {
1130
- if (this.loadingStateChange)
1131
- this.loadingStateChange(this.state.includes('loading'));
1132
- }
1133
- render() {
1134
- var _a, _b, _c, _d, _e;
1135
- return (h(Host, { key: '8a54ab74f9c9282ac77e5e1e8efa862d32806929' }, h("div", { key: 'f62f8d7e44da8369ebccf18357200e232c641e6e', dir: this.locale.direction, class: "min-h-[100px] warranty" }, h("div", { key: '6b65fb28f1a41bbcb65117d3cd748779827a6692' }, h("loading-spinner", { key: 'ad9d8fa792075417393a6d54beeeb126499d30dd', isLoading: this.state.includes('loading') }), h("div", { key: 'a2df5088999081ec112a059547f58f9e129cdf0d', class: "transition-all !duration-700", style: { transform: this.state.includes('loading') || this.state === 'idle' ? 'scale(0)' : 'scale(1)', opacity: this.state.includes('loading') ? '0' : '1' } }, (this.showSsc || this.showWarranty) && (h("div", { key: '936e754a9fdf7072c09e25b07dd7bf8a8f6fc13e', style: { color: !!this.errorMessage ? 'red' : 'black' }, class: "warranty-vin" }, (_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.vin)), ['error', 'error-loading'].includes(this.state) && (h("div", { key: '364233aa583fee4518f48172e7facd9b40a5b00e', class: "py-[16px] min-h-[100px] flex items-center" }, h("div", { key: '3eb25a151fcaecf26edef5147fc16a51087ab9b9', class: "px-[16px] py-[8px] border reject-card text-[20px] rounded-[8px] w-fit mx-auto" }, this.locale.errors[this.errorMessage] || this.locale.errors.wildCard))), this.showWarranty && ['data', 'data-loading'].includes(this.state) && (h(CardsContainer, { key: '4b8204ef0cb5d76e164a7ed6ae19d8c41da761f1', locale: this.locale, isAuthorized: (_b = this.vehicleInformation) === null || _b === void 0 ? void 0 : _b.isAuthorized, unInvoicedByBrokerName: this.unInvoicedByBrokerName, warranty: (_c = this.vehicleInformation) === null || _c === void 0 ? void 0 : _c.warranty })), h("div", { key: 'ad8527b09f7aa3c7559dd901e5ade3499303d3b8', style: Object.assign({}, (this.showRecaptcha ? { height: 'auto', padding: '16px 16px 0px 16px' } : { height: '0px' })), class: "recaptcha-container" }, h("slot", { key: 'b1b0b08c2663eb26a3bc67b9cc356c40d35abafa' })), ['data', 'data-loading'].includes(this.state) && this.recaptchaRes && (h("div", { key: '86db3700946862964e9dc4cd2cc5312cf430762b', class: cn('recaptcha-response', !this.recaptchaRes.hasSSC ? 'success-card' : 'reject-card ') }, this.locale.vehicleLookup.warranty[this.recaptchaRes.message])), this.checkingUnauthorizedSSC && (h("div", { key: 'ab168a7bd0c77054a7594cdb0b0741abe8d4cac6', class: "loading-spinner", style: { marginTop: '20px', flexDirection: 'column' } }, h("div", { key: '7ea9363eb62ce4a93cdc2b52db12f54d7e811981' }, h("strong", { key: 'b76260bd00b7c786a5846e83beea40d13d89bf45' }, this.locale.vehicleLookup.warranty.checkingTMC)), h("img", { key: 'b25c6dcc9351c700ac41a6400413c99091392d3b', class: "spin", src: loaderSvg }))), this.showSsc && ['data', 'data-loading'].includes(this.state) && ((_d = this.vehicleInformation) === null || _d === void 0 ? void 0 : _d.ssc) !== null && !!((_e = this.vehicleInformation) === null || _e === void 0 ? void 0 : _e.ssc.length) && (h(SSCTable, { key: 'baa08e19b3274ee99bfd3ae2756a20b7dde59501', locale: this.locale, ssc: this.vehicleInformation.ssc })))))));
1136
- }
1137
- get el() { return getElement(this); }
1138
- static get watchers() { return {
1139
- "language": ["changeLanguage"],
1140
- "state": ["loadingListener"]
1141
- }; }
1142
- };
1143
- WarrantyDetails.style = WarrantyDetailsStyle0;
1144
-
1145
- export { DynamicClaim as dynamic_claim, PaintThickness as paint_thickness, ServiceHistory as service_history, VehicleAccessories as vehicle_accessories, VehicleSpecification as vehicle_specification, WarrantyDetails as warranty_details };