adp-web-components 0.0.12 → 0.0.15

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 (131) hide show
  1. package/dist/cjs/{loader-baf2418b.js → Loading-20e4ef35.js} +9 -0
  2. package/dist/cjs/dead-stock-lookup.cjs.entry.js +24 -13
  3. package/dist/cjs/distributor-lookup.cjs.entry.js +27 -18
  4. package/dist/cjs/dynamic-claim_6.cjs.entry.js +1046 -0
  5. package/dist/cjs/dynamic-redeem.cjs.entry.js +5 -5
  6. package/dist/cjs/form-input.cjs.entry.js +2 -2
  7. package/dist/cjs/general-inquiry-form.cjs.entry.js +2 -2
  8. package/dist/cjs/{index-d4b5214c.js → index-97b8da6d.js} +289 -8
  9. package/dist/cjs/loader.cjs.js +2 -2
  10. package/dist/cjs/manufacturer-lookup.cjs.entry.js +4 -18
  11. package/dist/cjs/shift-components.cjs.js +2 -2
  12. package/dist/cjs/vehicle-lookup.cjs.entry.js +133 -0
  13. package/dist/collection/collection-manifest.json +6 -5
  14. package/dist/collection/components/dynamic-claim/dynamic-claim.css +1 -1
  15. package/dist/collection/components/dynamic-claim/dynamic-claim.js +2 -2
  16. package/dist/collection/components/dynamic-redeem/dynamic-redeem.css +1 -1
  17. package/dist/collection/components/dynamic-redeem/dynamic-redeem.js +3 -3
  18. package/dist/collection/components/form-input/form-input.js +1 -1
  19. package/dist/collection/components/general-inquiry-form/general-inquiry-form.js +1 -1
  20. package/dist/collection/components/paint-thickness/paint-thickness.css +1 -1
  21. package/dist/collection/components/paint-thickness/paint-thickness.js +3 -16
  22. package/dist/collection/components/part-lookup/dead-stock-lookup.css +1 -1
  23. package/dist/collection/components/part-lookup/dead-stock-lookup.js +34 -23
  24. package/dist/collection/components/part-lookup/distributor-lookup.css +1 -1
  25. package/dist/collection/components/part-lookup/distributor-lookup.js +24 -14
  26. package/dist/collection/components/part-lookup/manufacturer-lookup.css +1 -1
  27. package/dist/collection/components/part-lookup/manufacturer-lookup.js +1 -14
  28. package/dist/collection/components/service-history/service-history.css +1 -1
  29. package/dist/collection/components/service-history/service-history.js +1 -14
  30. package/dist/collection/components/vehicle-accessories/vehicle-accessories.css +1 -1
  31. package/dist/collection/components/vehicle-accessories/vehicle-accessories.js +3 -16
  32. package/dist/collection/components/vehicle-lookup/vehicle-lookup.css +1 -0
  33. package/dist/collection/components/vehicle-lookup/vehicle-lookup.js +244 -0
  34. package/dist/collection/components/vehicle-specification/vehicle-specification.css +1 -1
  35. package/dist/collection/components/vehicle-specification/vehicle-specification.js +1 -14
  36. package/dist/collection/components/warranty-details/warranty-details.css +1 -1
  37. package/dist/collection/components/warranty-details/warranty-details.js +7 -34
  38. package/dist/collection/global/lib/validate-vin.js +62 -0
  39. package/dist/collection/templates/vehicle-lookup.js +163 -96
  40. package/dist/components/dead-stock-lookup.js +1 -1
  41. package/dist/components/distributor-lookup.js +1 -1
  42. package/dist/components/dynamic-claim.js +1 -1
  43. package/dist/components/dynamic-redeem.js +1 -1
  44. package/dist/components/form-input.js +1 -1
  45. package/dist/components/general-inquiry-form.js +1 -1
  46. package/dist/components/index.js +1 -1
  47. package/dist/components/manufacturer-lookup.js +1 -1
  48. package/dist/components/p-05871c28.js +5 -0
  49. package/dist/components/p-23551e81.js +5 -0
  50. package/dist/components/p-325b6857.js +5 -0
  51. package/dist/components/{p-50f73226.js → p-3bf0339d.js} +1 -1
  52. package/dist/components/p-514c4736.js +5 -0
  53. package/dist/components/{p-2b0cc0c6.js → p-8385e385.js} +1 -1
  54. package/dist/components/p-be0a5ab5.js +5 -0
  55. package/dist/components/p-c8eef708.js +5 -0
  56. package/dist/components/p-da533bd7.js +5 -0
  57. package/dist/components/p-e46b126e.js +5 -0
  58. package/dist/components/p-f1ffc23d.js +5 -0
  59. package/dist/components/paint-thickness.js +1 -1
  60. package/dist/components/service-history.js +1 -1
  61. package/dist/components/vehicle-accessories.js +1 -1
  62. package/dist/components/vehicle-lookup.d.ts +11 -0
  63. package/dist/components/vehicle-lookup.js +5 -0
  64. package/dist/components/vehicle-specification.js +1 -1
  65. package/dist/components/warranty-details.js +1 -1
  66. package/dist/esm/{loader-027b88af.js → Loading-d050617c.js} +9 -1
  67. package/dist/esm/dead-stock-lookup.entry.js +24 -13
  68. package/dist/esm/distributor-lookup.entry.js +27 -18
  69. package/dist/esm/dynamic-claim_6.entry.js +1037 -0
  70. package/dist/esm/dynamic-redeem.entry.js +5 -5
  71. package/dist/esm/form-input.entry.js +2 -2
  72. package/dist/esm/general-inquiry-form.entry.js +2 -2
  73. package/dist/esm/{index-ef54644b.js → index-ff1dab22.js} +289 -8
  74. package/dist/esm/loader.js +3 -3
  75. package/dist/esm/manufacturer-lookup.entry.js +4 -18
  76. package/dist/esm/shift-components.js +3 -3
  77. package/dist/esm/vehicle-lookup.entry.js +129 -0
  78. package/dist/shift-components/{p-894e7518.entry.js → p-15e82b1a.entry.js} +1 -1
  79. package/dist/shift-components/p-1a727cfd.entry.js +5 -0
  80. package/dist/shift-components/p-2bb4415e.entry.js +5 -0
  81. package/dist/shift-components/p-3f3b41b4.entry.js +5 -0
  82. package/dist/shift-components/{p-8e818568.entry.js → p-4c3f2850.entry.js} +1 -1
  83. package/dist/shift-components/p-4ca95c3d.entry.js +5 -0
  84. package/dist/shift-components/p-65939a2f.js +5 -0
  85. package/dist/shift-components/p-8b198a04.entry.js +5 -0
  86. package/dist/shift-components/p-d577db71.entry.js +5 -0
  87. package/dist/shift-components/p-f37b60d5.js +6 -0
  88. package/dist/shift-components/shift-components.esm.js +1 -1
  89. package/dist/types/components/part-lookup/dead-stock-lookup.d.ts +2 -3
  90. package/dist/types/components/vehicle-lookup/vehicle-lookup.d.ts +23 -0
  91. package/dist/types/components/warranty-details/warranty-details.d.ts +1 -2
  92. package/dist/types/components.d.ts +37 -0
  93. package/dist/types/global/lib/validate-vin.d.ts +1 -0
  94. package/package.json +1 -1
  95. package/readme.md +2 -91
  96. package/dist/cjs/Loading-ee1a2ceb.js +0 -16
  97. package/dist/cjs/dynamic-claim.cjs.entry.js +0 -306
  98. package/dist/cjs/image-expansion-a9c9c6f7.js +0 -77
  99. package/dist/cjs/paint-thickness.cjs.entry.js +0 -131
  100. package/dist/cjs/service-history.cjs.entry.js +0 -116
  101. package/dist/cjs/vehicle-accessories.cjs.entry.js +0 -135
  102. package/dist/cjs/vehicle-specification.cjs.entry.js +0 -111
  103. package/dist/cjs/vehicleInformation-35c470fc.js +0 -52
  104. package/dist/cjs/warranty-details.cjs.entry.js +0 -281
  105. package/dist/components/p-4dc47f5f.js +0 -5
  106. package/dist/components/p-8375923d.js +0 -5
  107. package/dist/components/p-a454210b.js +0 -5
  108. package/dist/esm/Loading-61648252.js +0 -14
  109. package/dist/esm/dynamic-claim.entry.js +0 -302
  110. package/dist/esm/image-expansion-08c4bf0d.js +0 -73
  111. package/dist/esm/paint-thickness.entry.js +0 -127
  112. package/dist/esm/service-history.entry.js +0 -112
  113. package/dist/esm/vehicle-accessories.entry.js +0 -131
  114. package/dist/esm/vehicle-specification.entry.js +0 -107
  115. package/dist/esm/vehicleInformation-f7290628.js +0 -50
  116. package/dist/esm/warranty-details.entry.js +0 -277
  117. package/dist/shift-components/p-2e3e8e97.entry.js +0 -5
  118. package/dist/shift-components/p-3bfafc40.entry.js +0 -5
  119. package/dist/shift-components/p-65e6ab8e.js +0 -5
  120. package/dist/shift-components/p-75ea0e53.entry.js +0 -5
  121. package/dist/shift-components/p-91eff216.entry.js +0 -5
  122. package/dist/shift-components/p-a21e2e2e.js +0 -5
  123. package/dist/shift-components/p-c274f4ba.entry.js +0 -5
  124. package/dist/shift-components/p-c4fad245.js +0 -5
  125. package/dist/shift-components/p-ca1e2e5b.entry.js +0 -5
  126. package/dist/shift-components/p-d5ff7544.js +0 -5
  127. package/dist/shift-components/p-e97316d2.js +0 -6
  128. package/dist/shift-components/p-ec9302fb.entry.js +0 -5
  129. package/dist/shift-components/p-f21722ce.entry.js +0 -5
  130. package/dist/shift-components/p-f95c7501.entry.js +0 -5
  131. package/dist/shift-components/p-feb3df85.entry.js +0 -5
@@ -0,0 +1,1037 @@
1
+ /*!
2
+ * Built by ShiftSoftware
3
+ * Copyright (c)
4
+ */
5
+ import { r as registerInstance, h, H as Host, g as getElement } from './index-ff1dab22.js';
6
+ import { c as cn } from './cn-cc419b94.js';
7
+ import { L as Loading$1, l as loaderSvg$1 } from './Loading-d050617c.js';
8
+
9
+ const expiredSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzBweCIgaGVpZ2h0PSIzMHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjAiIC8+CiAgICA8ZyBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIC8+CiAgICA8Zz4KICAgICAgICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSI4IiBmaWxsLW9wYWNpdHk9IjAuMjQiIGZpbGw9ImJsYWNrIiBzdHJva2U9ImJsYWNrIiAvPgogICAgICAgIDxwYXRoIGQ9Ik0xNiAxNkw4IDgiIHN0cm9rZS13aWR0aD0iMS4yIiBzdHJva2U9ImJsYWNrIiAvPgogICAgICAgIDxwYXRoIGQ9Ik0xNiA4TDggMTYiIHN0cm9rZS13aWR0aD0iMS4yIiBzdHJva2U9ImJsYWNrIiAvPgogICAgPC9nPgo8L3N2Zz4=';
10
+
11
+ const pendingSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzBweCIgaGVpZ2h0PSIzMHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjAiIC8+CiAgICA8ZyBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIC8+CiAgICA8Zz4KICAgICAgICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSI4IiBmaWxsLW9wYWNpdHk9IjAuMjQiIGZpbGw9IiNhMWExYTEiIHN0cm9rZT0iI2ExYTFhMSIgLz4KICAgICAgICA8cmVjdCB4PSI5LjUiIHk9IjgiIHdpZHRoPSIyIiBoZWlnaHQ9IjgiIGZpbGw9IiNhMWExYTEiIC8+CiAgICAgICAgPHJlY3QgeD0iMTIuNSIgeT0iOCIgd2lkdGg9IjIiIGhlaWdodD0iOCIgZmlsbD0iI2ExYTFhMSIgLz4KICAgIDwvZz4KPC9zdmc+';
12
+
13
+ const cancelledSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzBweCIgaGVpZ2h0PSIzMHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjAiIC8+CiAgICA8ZyBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIC8+CiAgICA8Zz4KICAgICAgICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSI4IiBmaWxsLW9wYWNpdHk9IjAuMjQiIGZpbGw9IiNhODAwMDAiIHN0cm9rZT0iI2E4MDAwMCIgLz4KICAgICAgICA8cGF0aCBkPSJNMTggMThMNiA2IiBzdHJva2Utd2lkdGg9IjEuMiIgc3Ryb2tlPSIjYTgwMDAwIiAvPgogICAgPC9nPgo8L3N2Zz4=';
14
+
15
+ const processedSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzBweCIgaGVpZ2h0PSIzMHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjAiIC8+CiAgICA8ZyBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIC8+CiAgICA8Zz4KICAgICAgICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSI4IiBmaWxsLW9wYWNpdHk9IjAuMjQiIGZpbGw9IiMzMDcxYTkiIHN0cm9rZT0iIzMwNzFhOSIgLz4KICAgICAgICA8cGF0aCBkPSJNOC41IDExTDExLjM5MzkgMTMuODkzOUMxMS40NTI1IDEzLjk1MjUgMTEuNTQ3NSAxMy45NTI1IDExLjYwNjEgMTMuODkzOUwxOS41IDYiIHN0cm9rZT0iIzMwNzFhOSIKICAgICAgICAgICAgc3Ryb2tlLXdpZHRoPSIxLjIiIC8+CiAgICA8L2c+Cjwvc3ZnPg==';
16
+
17
+ const vehicleRequestHeaders = {
18
+ cityId: 'City-Id',
19
+ userId: 'User-Id',
20
+ companyId: 'Company-Id',
21
+ customerName: 'Customer-Name',
22
+ customerPhone: 'Customer-Phone',
23
+ customerEmail: 'Customer-Email',
24
+ companyBranchId: 'Company-Branch-Id',
25
+ cityIntegrationId: 'City-Integration-Id',
26
+ brandIntegrationId: 'Brand-Integration-Id',
27
+ companyIntegrationId: 'Company-Integration-Id',
28
+ companyBranchIntegrationId: 'Company-Branch-Integration-Id'
29
+ };
30
+ const getVehicleInformation = async (component, generalProps, headers = {}) => {
31
+ const { notAvailableMessage, mockData, vin, scopedTimeoutRef, middlewareCallback } = generalProps;
32
+ const { isDev, baseUrl, queryString, abortController, networkTimeoutRef, loadedResponse } = component;
33
+ const handleResult = (newVehicleInformation) => {
34
+ if (networkTimeoutRef === scopedTimeoutRef) {
35
+ if (!newVehicleInformation && vin)
36
+ throw new Error(notAvailableMessage || 'Wrong response format');
37
+ if (loadedResponse)
38
+ loadedResponse(newVehicleInformation);
39
+ if (middlewareCallback)
40
+ middlewareCallback(newVehicleInformation);
41
+ return newVehicleInformation;
42
+ }
43
+ };
44
+ if (isDev) {
45
+ const newData = mockData[vin];
46
+ return handleResult(newData);
47
+ }
48
+ else {
49
+ if (!baseUrl)
50
+ throw new Error('Please provide base-url');
51
+ const componentHeaders = Object.assign({}, headers);
52
+ Object.entries(vehicleRequestHeaders).forEach(([componentHeaderKey, headerField]) => {
53
+ if (component[componentHeaderKey])
54
+ componentHeaders[headerField] = component[componentHeaderKey];
55
+ });
56
+ const response = await fetch(`${baseUrl}${vin}?${queryString}`, { signal: abortController.signal, headers: componentHeaders });
57
+ const newData = (await response.json());
58
+ return handleResult(newData);
59
+ }
60
+ };
61
+
62
+ 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 50px 10px 10px;text-align:left;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-4{padding-bottom:1rem;padding-top:1rem}.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-300{transition-duration:.3s}.duration-700{transition-duration:.7s}.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}.pl-10{padding-left:2.5rem}";
63
+ const DynamicClaimStyle0 = dynamicClaimCss;
64
+
65
+ let mockData$5 = {};
66
+ const icons = {
67
+ expired: expiredSvg,
68
+ pending: pendingSvg,
69
+ processed: processedSvg,
70
+ cancelled: cancelledSvg,
71
+ };
72
+ const DynamicClaim = class {
73
+ constructor(hostRef) {
74
+ registerInstance(this, hostRef);
75
+ this.pendingItemHighlighted = false;
76
+ this.onMouseLeave = () => {
77
+ clearTimeout(this.timeoutRef);
78
+ this.popupClasses = '';
79
+ this.timeoutRef = setTimeout(() => {
80
+ this.activePopupIndex = null;
81
+ }, 400);
82
+ };
83
+ this.onMouseEnter = (dynamicClaimItemHeader, idx) => {
84
+ clearTimeout(this.timeoutRef);
85
+ this.activePopupIndex = idx;
86
+ this.timeoutRef = setTimeout(() => {
87
+ const positionRef = dynamicClaimItemHeader.querySelector('.popup-position-ref');
88
+ this.popupPositionRef = positionRef;
89
+ this.calculatePopupPos(this.el.shadowRoot);
90
+ this.popupClasses = 'show';
91
+ }, 50);
92
+ };
93
+ this.baseUrl = undefined;
94
+ this.isDev = false;
95
+ this.queryString = '';
96
+ this.isIdle = true;
97
+ this.popupClasses = '';
98
+ this.externalVin = null;
99
+ this.activePopupIndex = null;
100
+ this.vehicleInformation = undefined;
101
+ this.errorMessage = null;
102
+ this.isLoading = false;
103
+ this.loadingStateChange = undefined;
104
+ this.loadedResponse = undefined;
105
+ }
106
+ async componentDidLoad() {
107
+ this.dynamicClaimBody = this.el.shadowRoot.querySelector('.dynamic-claim-body');
108
+ this.dynamicRedeem = this.el.shadowRoot.getElementById('dynamic-redeem');
109
+ this.dynamicClaimProgressBar = this.el.shadowRoot.querySelector('.dynamic-claim-progress-bar');
110
+ }
111
+ async setMockData(newMockData) {
112
+ mockData$5 = newMockData;
113
+ }
114
+ async setData(newData, headers = {}) {
115
+ clearTimeout(this.networkTimeoutRef);
116
+ if (this.abortController)
117
+ this.abortController.abort();
118
+ this.abortController = new AbortController();
119
+ let scopedTimeoutRef;
120
+ const isVinRequest = typeof newData === 'string';
121
+ const vin = isVinRequest ? newData : newData === null || newData === void 0 ? void 0 : newData.vin;
122
+ this.externalVin = vin;
123
+ try {
124
+ if (!vin || vin.trim().length === 0) {
125
+ this.isIdle = true;
126
+ return;
127
+ }
128
+ this.isLoading = true;
129
+ this.isIdle = false;
130
+ await new Promise(r => {
131
+ scopedTimeoutRef = setTimeout(r, 1000);
132
+ this.networkTimeoutRef = scopedTimeoutRef;
133
+ });
134
+ const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData: mockData$5 }, headers) : newData;
135
+ if (this.networkTimeoutRef === scopedTimeoutRef) {
136
+ if (!vehicleResponse)
137
+ throw new Error('Wrong response format');
138
+ if (!Array.isArray(vehicleResponse.serviceItems))
139
+ throw new Error('No Service Available');
140
+ this.vehicleInformation = vehicleResponse;
141
+ }
142
+ this.errorMessage = null;
143
+ this.isLoading = false;
144
+ }
145
+ catch (error) {
146
+ if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
147
+ return;
148
+ this.isLoading = false;
149
+ this.vehicleInformation = null;
150
+ this.errorMessage = error.message;
151
+ }
152
+ }
153
+ async fetchData(requestedVin = this.externalVin, headers = {}) {
154
+ await this.setData(requestedVin, headers);
155
+ }
156
+ onLoadingChange(newValue) {
157
+ if (this.loadingStateChange)
158
+ this.loadingStateChange(newValue);
159
+ this.setLoadingUi(newValue);
160
+ }
161
+ async setLoadingUi(isLoading) {
162
+ if (!isLoading) {
163
+ this.dynamicClaimProgressBar.style.width = '0';
164
+ await new Promise(r => setTimeout(r, 200));
165
+ this.updateProgressBar();
166
+ }
167
+ }
168
+ updateProgressBar() {
169
+ var _a;
170
+ const serviceItems = ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceItems) || [];
171
+ if (serviceItems.filter(x => x.status === 'pending').length === 0) {
172
+ if (serviceItems.length === 0)
173
+ this.dynamicClaimProgressBar.style.width = '0%';
174
+ else
175
+ this.dynamicClaimProgressBar.style.width = '100%';
176
+ this.dynamicClaimBody.scrollTo({
177
+ left: this.dynamicClaimBody.scrollWidth,
178
+ behavior: 'smooth',
179
+ });
180
+ }
181
+ else {
182
+ const firstPendingItem = serviceItems.find(x => x.status === 'pending');
183
+ const firstPendingItemIndex = serviceItems.indexOf(firstPendingItem) + 1;
184
+ const firstPendingItemRef = this.dynamicClaimBody.getElementsByClassName('dynamic-claim-item')[firstPendingItemIndex - 1];
185
+ this.dynamicClaimProgressBar.style.width = (firstPendingItemIndex / serviceItems.length - 1 / (serviceItems.length * 2)) * 100 + '%';
186
+ this.dynamicClaimBody.scrollTo({
187
+ left: firstPendingItemRef.offsetLeft - firstPendingItemRef.clientWidth * 3,
188
+ behavior: 'smooth',
189
+ });
190
+ }
191
+ }
192
+ resetProgressBar() {
193
+ setTimeout(() => {
194
+ this.updateProgressBar();
195
+ }, 100);
196
+ }
197
+ windowScrollListener(newValue) {
198
+ if (newValue) {
199
+ this.scrollListenerRef = () => this.calculatePopupPos(this.el.shadowRoot);
200
+ window.addEventListener('scroll', this.scrollListenerRef);
201
+ this.dynamicClaimBody.addEventListener('scroll', this.scrollListenerRef);
202
+ }
203
+ else {
204
+ window.removeEventListener('scroll', this.scrollListenerRef);
205
+ this.dynamicClaimBody.removeEventListener('scroll', this.scrollListenerRef);
206
+ }
207
+ }
208
+ calculatePopupPos(root) {
209
+ const popupPositionRef = root.querySelector('.popup-position-ref');
210
+ let { x, y } = popupPositionRef.getBoundingClientRect();
211
+ const popupContainer = popupPositionRef.querySelector('.popup-container');
212
+ const { width } = popupContainer.getBoundingClientRect();
213
+ const popupInfo = popupContainer.querySelector('.dynamic-claim-item-popup-info');
214
+ const windowWidth = window.innerWidth; // Get the viewport's width
215
+ popupContainer.style.top = `${y}px`;
216
+ popupContainer.style.left = `${x - width / 2}px`;
217
+ const offsetFromLeft = x - width / 2; // Distance from left side of the viewport
218
+ const offsetFromRight = windowWidth - (x + width / 2); // Distance from right side of the viewport
219
+ let movingNeeded = 0;
220
+ let horizontalMargin = 16;
221
+ if (offsetFromRight < horizontalMargin)
222
+ movingNeeded = offsetFromRight - horizontalMargin;
223
+ else if (offsetFromLeft < horizontalMargin)
224
+ movingNeeded = Math.abs(offsetFromLeft - horizontalMargin);
225
+ popupInfo.style.transform = `translateX(${movingNeeded}px)`;
226
+ }
227
+ removeLoadAnimationClass(event) {
228
+ const component = event.target;
229
+ component.classList.remove('load-animation');
230
+ }
231
+ async completeClaim() {
232
+ var _a;
233
+ const serviceItems = ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceItems) || [];
234
+ const item = this.cachedClaimItem;
235
+ const serviceDataClone = JSON.parse(JSON.stringify(serviceItems));
236
+ const index = serviceItems.indexOf(item);
237
+ const pendingItemsBefore = serviceDataClone.slice(0, index).filter(x => x.status === 'pending');
238
+ serviceDataClone[index].status = 'processed';
239
+ pendingItemsBefore.forEach(function (otherItem) {
240
+ otherItem.status = 'cancelled';
241
+ });
242
+ this.pendingItemHighlighted = false;
243
+ const vehicleDataClone = JSON.parse(JSON.stringify(this.vehicleInformation));
244
+ vehicleDataClone.serviceItems = serviceDataClone;
245
+ this.vehicleInformation = JSON.parse(JSON.stringify(vehicleDataClone));
246
+ }
247
+ claim(item) {
248
+ var _a;
249
+ const serviceItems = ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceItems) || [];
250
+ const vinDataClone = JSON.parse(JSON.stringify(serviceItems));
251
+ const index = serviceItems.indexOf(item);
252
+ //Find other items before this item that have status 'pending'
253
+ let pendingItemsBefore = vinDataClone.slice(0, index).filter(x => x.status === 'pending');
254
+ this.cachedClaimItem = item;
255
+ if (item.maximumMileage === null) {
256
+ pendingItemsBefore = [];
257
+ }
258
+ this.onMouseLeave();
259
+ this.openRedeem(item, pendingItemsBefore);
260
+ }
261
+ async handleRedeemScanner() {
262
+ if (this.isDev) {
263
+ this.dynamicRedeem.handleScanner = async (_) => {
264
+ await new Promise(r => setTimeout(r, 500));
265
+ this.dynamicRedeem.quite();
266
+ this.completeClaim();
267
+ this.dynamicRedeem.handleScanner = null;
268
+ };
269
+ }
270
+ else {
271
+ this.dynamicRedeem.handleScanner = async (code) => {
272
+ try {
273
+ const vehicleInformation = this.vehicleInformation;
274
+ const payload = {
275
+ vin: vehicleInformation.vin,
276
+ brandIntegrationID: vehicleInformation.identifiers.brandIntegrationID,
277
+ invoice: code,
278
+ saleInformation: vehicleInformation.saleInformation,
279
+ serviceItem: this.dynamicRedeem.item,
280
+ cancelledServiceItems: this.dynamicRedeem.canceledItems,
281
+ };
282
+ const response = await fetch('/api/vehicle/swift-claim', {
283
+ method: 'POST',
284
+ headers: {
285
+ 'Content-Type': 'application/json',
286
+ },
287
+ body: JSON.stringify(payload),
288
+ });
289
+ const data = await response.json();
290
+ if (!data.Success) {
291
+ alert(data.Message);
292
+ this.dynamicRedeem.quite();
293
+ this.dynamicRedeem.handleScanner = null;
294
+ return;
295
+ }
296
+ this.dynamicRedeem.quite();
297
+ this.completeClaim();
298
+ this.dynamicRedeem.handleScanner = null;
299
+ }
300
+ catch (error) {
301
+ console.error(error);
302
+ alert('Request failed please try again later');
303
+ this.dynamicRedeem.quite();
304
+ this.dynamicRedeem.handleScanner = null;
305
+ }
306
+ };
307
+ }
308
+ }
309
+ openRedeem(item, oldItems) {
310
+ var _a, _b, _c, _d, _e;
311
+ const vehicleInformation = this.vehicleInformation;
312
+ this.dynamicRedeem.vin = vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.vin;
313
+ this.dynamicRedeem.item = item;
314
+ this.dynamicRedeem.canceledItems = oldItems;
315
+ 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)
316
+ 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;
317
+ else
318
+ this.dynamicRedeem.unInvoicedByBrokerName = null;
319
+ this.handleRedeemScanner();
320
+ }
321
+ createPopup(item) {
322
+ return (h("div", { 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, "Service Type:"), h("td", null, item.type.charAt(0).toUpperCase() + item.type.slice(1))), h("tr", null, h("th", null, "Activation Date"), h("td", null, item.activatedAt)), h("tr", null, h("th", null, "Expiry Date"), h("td", null, item.expiresAt)), h("tr", null, h("th", null, "Claimed At"), h("td", null, item.redeemDate)), h("tr", null, h("th", null, "Redeeming Dealer"), h("td", null, item.dealerName)), h("tr", null, h("th", null, "Invoice Number"), h("td", null, item.invoiceNumber)), h("tr", null, h("th", null, "WIP"), h("td", null, item.wip)), h("tr", null, h("th", null, "Menu Code"), h("td", null, item.menuCode)))), item.status === 'pending' && (h("button", { onClick: () => this.claim(item), class: "dynamic-claim-button 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, "Claim")))))));
323
+ }
324
+ render() {
325
+ var _a, _b;
326
+ const serviceItems = ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceItems) || [];
327
+ return (h(Host, { key: '541c3dd78435e13a8d8bbd9d9e1bdd3e421ff700' }, h("dynamic-redeem", { key: '98a8918ed4ee9b3c65eb76c6d219c397dc038938', id: "dynamic-redeem" }), h("div", { key: '21b931d1ac7ff57a75cc235e5a9d7383a60bcce9', class: cn('dynamic-claim-wrapper', { loading: this.isLoading, idle: this.isIdle }) }, h("div", { key: '7a11a3db11737b27f570b7722c84c264a9927cb5', class: "dynamic-claim-header" }, h("strong", { key: '90134387cef16786e348a6cee3949113c6b789cc', onAnimationEnd: this.removeLoadAnimationClass, class: "dynamic-claim-header-vin load-animation" }, this.errorMessage && h("span", { key: '848036da3b9fe9ef737e2a461dc6475651ee9b3c', style: { color: 'red' } }, this.errorMessage), !this.errorMessage && ((_b = this.vehicleInformation) === null || _b === void 0 ? void 0 : _b.vin))), h("div", { key: '046d01dbbf1c91fc735ce41c6f2ffaa41000f7ad', class: "dynamic-claim-body" }, h("div", { key: '83bc44663ebdf506306b04c7cee43d3051bc52b8', class: "loading-lane" }, h("div", { key: '4b7c8ac724afdc40379d58c7d77810bc1a10704b', class: "dynamic-claim-loading-slider" }, h("div", { key: '8404f36fd0afc3f0d052c5144b5698e19a8f25bb', class: "dynamic-claim-loading-slider-line" }), h("div", { key: '0c0b553b1139c65ce4261ef7382791931f9558ac', class: "dynamic-claim-loading-slider-subline dynamic-claim-inc" }), h("div", { key: 'afcad75d078227301ffc7738a536cd765f5696b8', class: "dynamic-claim-loading-slider-subline dynamic-claim-dec" }))), h("div", { key: '4885864414ed5efe3928e331cf8fbd46ba705467', class: "dynamic-claim-progress-lane" }, serviceItems.map((item, idx) => {
328
+ let statusClass = '';
329
+ if (item.status === 'pending') {
330
+ if (serviceItems.findIndex(i => i.status === 'pending') === idx)
331
+ statusClass = item.status;
332
+ }
333
+ else
334
+ statusClass = item.status;
335
+ 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, item.status.charAt(0).toUpperCase() + item.status.slice(1)), 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)));
336
+ }), h("div", { key: '1bc2d25dae363c03425128ea08be4b076ae11c66', class: "dynamic-claim-progress-bar" }))))));
337
+ }
338
+ get el() { return getElement(this); }
339
+ static get watchers() { return {
340
+ "isLoading": ["onLoadingChange"],
341
+ "vehicleInformation": ["resetProgressBar"],
342
+ "popupClasses": ["windowScrollListener"]
343
+ }; }
344
+ };
345
+ DynamicClaim.style = DynamicClaimStyle0;
346
+
347
+ const eyeSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IndoaXRlIgogICAgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWV5ZSI+CiAgICA8cGF0aCBkPSJNMi4wNjIgMTIuMzQ4YTEgMSAwIDAgMSAwLS42OTYgMTAuNzUgMTAuNzUgMCAwIDEgMTkuODc2IDAgMSAxIDAgMCAxIDAgLjY5NiAxMC43NSAxMC43NSAwIDAgMS0xOS44NzYgMCIgLz4KICAgIDxjaXJjbGUgY3g9IjEyIiBjeT0iMTIiIHI9IjMiIC8+Cjwvc3ZnPg==';
348
+
349
+ function openImageViewer(context, target, imageSrc) {
350
+ if (context.expandedImage === imageSrc)
351
+ return;
352
+ context.originalImage = target;
353
+ const expandedImageRef = context.el.shadowRoot.getElementById('expanded-image');
354
+ expandedImageRef.src = target.src;
355
+ document.addEventListener('keydown', context.closeImageListener);
356
+ const rect = target.getBoundingClientRect();
357
+ document.body.style.overflow = 'hidden';
358
+ Object.assign(expandedImageRef.style, {
359
+ top: `${rect.top}px`,
360
+ pointerEvents: 'auto',
361
+ left: `${rect.left}px`,
362
+ transitionDuration: '0s',
363
+ width: `${rect.width}px`,
364
+ height: `${rect.height}px`,
365
+ });
366
+ setTimeout(() => {
367
+ const naturalWidth = target.naturalWidth;
368
+ const naturalHeight = target.naturalHeight;
369
+ const maxWidth = window.innerWidth - 160;
370
+ const maxHeight = window.innerHeight - 32;
371
+ const aspectRatio = naturalWidth / naturalHeight;
372
+ let width, height;
373
+ if (maxWidth / aspectRatio <= maxHeight) {
374
+ width = maxWidth;
375
+ height = maxWidth / aspectRatio;
376
+ }
377
+ else {
378
+ height = maxHeight;
379
+ width = maxHeight * aspectRatio;
380
+ }
381
+ expandedImageRef.style.transitionDuration = '0.3s';
382
+ Object.assign(expandedImageRef.style, {
383
+ opacity: '1',
384
+ width: `${width}px`,
385
+ height: `${height}px`,
386
+ top: `${(window.innerHeight - height) / 2}px`,
387
+ left: `${(window.innerWidth - width) / 2}px`,
388
+ });
389
+ context.expandedImage = imageSrc;
390
+ }, 200);
391
+ }
392
+ function closeImageViewer(context, event) {
393
+ if (event && event.key !== 'Escape')
394
+ return;
395
+ document.removeEventListener('keydown', context.closeImageListener);
396
+ const expandedImageRef = context.el.shadowRoot.getElementById('expanded-image');
397
+ const rect = context.originalImage.getBoundingClientRect();
398
+ Object.assign(expandedImageRef.style, {
399
+ top: `${rect.top}px`,
400
+ pointerEvents: 'none',
401
+ left: `${rect.left}px`,
402
+ width: `${rect.width}px`,
403
+ height: `${rect.height}px`,
404
+ transitionDuration: '0.3s',
405
+ });
406
+ setTimeout(() => {
407
+ expandedImageRef.src = '';
408
+ expandedImageRef.style.opacity = '0';
409
+ expandedImageRef.style.transitionDuration = '0s';
410
+ }, 300);
411
+ document.body.style.overflow = '';
412
+ context.expandedImage = null;
413
+ }
414
+
415
+ 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-4{padding-bottom:1rem;padding-top:1rem}.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-300{transition-duration:.3s}.duration-700{transition-duration:.7s}.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))}.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)}.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}.py-\\[16px\\]{padding-bottom:16px;padding-top:16px}.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)}.z-50{z-index:50}.size-\\[40px\\]{height:40px;width:40px}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin-2s{animation:spin 2s linear infinite}";
416
+ const PaintThicknessStyle0 = paintThicknessCss;
417
+
418
+ let mockData$4 = {};
419
+ const PaintThickness = class {
420
+ constructor(hostRef) {
421
+ registerInstance(this, hostRef);
422
+ this.closeImageListener = (event) => {
423
+ this.closeImage(event);
424
+ };
425
+ this.openImage = (target, imageSrc) => {
426
+ openImageViewer(this, target, imageSrc);
427
+ };
428
+ this.closeImage = (event) => {
429
+ closeImageViewer(this, event);
430
+ };
431
+ this.baseUrl = '';
432
+ this.isDev = false;
433
+ this.queryString = '';
434
+ this.loadingStateChange = undefined;
435
+ this.loadedResponse = undefined;
436
+ this.state = 'idle';
437
+ this.externalVin = null;
438
+ this.errorMessage = null;
439
+ this.expandedImage = null;
440
+ this.vehicleInformation = undefined;
441
+ }
442
+ handleSettingData(response) {
443
+ if (!response.paintThickness)
444
+ response.paintThickness = { imageGroups: [], parts: [] };
445
+ if (!response.paintThickness.parts || !Array.isArray(response.paintThickness.parts))
446
+ response.paintThickness.parts = [];
447
+ if (!response.paintThickness.imageGroups || !Array.isArray(response.paintThickness.imageGroups))
448
+ response.paintThickness.imageGroups = [];
449
+ this.vehicleInformation = response;
450
+ }
451
+ async setData(newData, headers = {}) {
452
+ clearTimeout(this.networkTimeoutRef);
453
+ if (this.abortController)
454
+ this.abortController.abort();
455
+ this.abortController = new AbortController();
456
+ let scopedTimeoutRef;
457
+ const isVinRequest = typeof newData === 'string';
458
+ const vin = isVinRequest ? newData : newData === null || newData === void 0 ? void 0 : newData.vin;
459
+ this.externalVin = vin;
460
+ try {
461
+ if (!vin || vin.trim().length === 0) {
462
+ this.state = 'idle';
463
+ return;
464
+ }
465
+ if (this.state === 'data' || this.state === 'error') {
466
+ this.state = (this.state + '-loading');
467
+ }
468
+ else
469
+ this.state = 'loading';
470
+ await new Promise(r => {
471
+ scopedTimeoutRef = setTimeout(r, 700);
472
+ this.networkTimeoutRef = scopedTimeoutRef;
473
+ });
474
+ const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData: mockData$4 }, headers) : newData;
475
+ if (this.networkTimeoutRef === scopedTimeoutRef) {
476
+ if (!vehicleResponse)
477
+ throw new Error('Wrong response format');
478
+ this.handleSettingData(vehicleResponse);
479
+ }
480
+ this.errorMessage = null;
481
+ this.state = 'data';
482
+ }
483
+ catch (error) {
484
+ if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
485
+ return;
486
+ this.state = 'error';
487
+ this.vehicleInformation = null;
488
+ this.errorMessage = error.message;
489
+ }
490
+ }
491
+ async fetchData(requestedVin = this.externalVin, headers = {}) {
492
+ await this.setData(requestedVin, headers);
493
+ }
494
+ async loadingListener() {
495
+ if (this.loadingStateChange)
496
+ this.loadingStateChange(this.state.includes('loading'));
497
+ }
498
+ async setMockData(newMockData) {
499
+ mockData$4 = newMockData;
500
+ }
501
+ render() {
502
+ var _a, _b;
503
+ 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: [] };
504
+ return (h(Host, { key: '777ce92353e8b06b3c38662cce82cace671bfcc1' }, h("div", { key: '9b9f7eb03e77027e0ee9e462df509dc3ca263a1a', class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, h("div", { key: '33c96d98931606b089809fc1796c992277160fa7' }, h(Loading$1, { key: 'cc725d71590913cae1d216a99f0d25f7fe9cef41', isLoading: this.state.includes('loading') }), h("div", { key: 'b0431df61606b27d876ecbebf0b58314fca74510', class: cn('transition-all duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, h("div", { key: '44397f334785d219b095581e8c14e5f3734fa844', 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: '3a7cbea9386ad67bb6dc835bccbc957a51dafc1f', class: "py-[16px]" }, h("div", { key: '5ba92ed6cad6389ea5586548981ba8ea8199f850', class: " px-[16px] py-[8px] border reject-card text-[20px] rounded-[8px] w-fit mx-auto" }, this.errorMessage))), ['data', 'data-loading'].includes(this.state) && (h("div", { key: 'c1570e257d33111cba806e6b68a9cc0fd3185b0a', class: "flex mt-[12px] w-full max-h-[70dvh] overflow-hidden mx-auto rounded-[4px] flex-col border border-[#d6d8dc]" }, h("div", { key: 'd6c8e734c23b39481fc0017ae21a29ca2e2e9b34', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, "Paint Thickeness"), h("div", { key: 'adc870f0036a7dc1a249c5e0c1a6342b5304c387', class: "h-0 overflow-auto flex-1" }, !parts.length && h("div", { key: '727ef2fd05dd341ec0007dded1fa17a9d29965b4', class: "h-[50px] px-[30px] flex items-center justify-center text-[18px]" }, "No parts are available."), !!parts.length && (h("table", { key: '03ee9a0f7b1686ab257fef2c140391c2d61a4957', class: "w-full overflow-auto relative border-collapse" }, h("thead", { key: 'a170e482934d528ad425fa575790162476bdfa11', class: "top-0 font-bold sticky bg-white" }, h("tr", { key: '16215cb061049299fbf48210a90fe86a8aa2aeec' }, ['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]" }, title))))), h("tbody", { key: '4caefdd1cd6d47abff9b28631f9805f9203c6204' }, 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]', {
505
+ '!border-none': idx === parts.length - 1,
506
+ }) }, part[key] || '...')))))))))))), ['data', 'data-loading'].includes(this.state) && (h("div", { key: '1cdfe88cc3f9d839a40d96f46b98054d438ee3f4' }, !imageGroups.length && h("div", { key: '52b7607a9c649817f83d45f664228a1a966fb23e', class: "h-[40px] px-[30px] flex text-red-500 items-center justify-center text-[18px]" }, "No image groups are available."), !!imageGroups.length && (h("div", { key: 'af414bdbf8342baf3cb2d11e3ef4831c1c595649', 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" }, "Expand")), h("img", { class: "w-auto h-[150px] cursor-pointer shadow-sm rounded-lg transition-all duration-300", src: image }))))))))), h("div", { key: 'fd31251707aa038a75f8536d92097bf336c677a1', 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', {
507
+ 'pointer-events-auto opacity-100 delay-200': this.expandedImage,
508
+ }) }, h("button", { key: '2d0daeeb281c3df36886feb37612e74dd31cdf97', class: "flex flex-col mt-[16px] items-center justify-center size-12 float-right mr-[16px]", onClick: () => this.closeImage() }, h("div", { key: 'c6a5882923b83f50e27d8f15abbece46bac2721c', class: "h-1 w-12 rounded-full rotate-45 absolute bg-white" }), h("div", { key: 'e4ee3ee8f88d276a830ba3b5ebe5b6b2aedab07e', class: "h-1 w-12 rounded-full -rotate-45 absolute bg-white" }))), h("img", { key: 'ad50e212acc65173a779171a15a36c5806e4c00a', alt: "", id: "expanded-image", class: "fixed opacity-0 z-40 transition-all rounded-lg" }))))))))));
509
+ }
510
+ get el() { return getElement(this); }
511
+ static get watchers() { return {
512
+ "state": ["loadingListener"]
513
+ }; }
514
+ };
515
+ PaintThickness.style = PaintThicknessStyle0;
516
+
517
+ 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-4{padding-bottom:1rem;padding-top:1rem}.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-300{transition-duration:.3s}.duration-700{transition-duration:.7s}.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))}.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)}.success-card{background-color:#d0e7de;border-color:#a2d0bb;color:#0b3521}.\\!border-none{border-style:none!important}.py-\\[16px\\]{padding-bottom:16px;padding-top:16px}.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))}.pointer-events-none{pointer-events:none}.absolute{position:absolute}.z-50{z-index:50}.size-\\[40px\\]{height:40px;width:40px}.size-full{height:100%;width:100%}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin-2s{animation:spin 2s linear infinite}";
518
+ const ServiceHistoryStyle0 = serviceHistoryCss;
519
+
520
+ let mockData$3 = {};
521
+ const ServiceHistory = class {
522
+ constructor(hostRef) {
523
+ registerInstance(this, hostRef);
524
+ this.baseUrl = '';
525
+ this.isDev = false;
526
+ this.queryString = '';
527
+ this.loadingStateChange = undefined;
528
+ this.loadedResponse = undefined;
529
+ this.state = 'idle';
530
+ this.externalVin = null;
531
+ this.errorMessage = null;
532
+ this.vehicleInformation = undefined;
533
+ }
534
+ handleSettingData(response) {
535
+ if (response.serviceHistory === null)
536
+ response.serviceHistory = [];
537
+ this.vehicleInformation = response;
538
+ }
539
+ async setData(newData, headers = {}) {
540
+ clearTimeout(this.networkTimeoutRef);
541
+ if (this.abortController)
542
+ this.abortController.abort();
543
+ this.abortController = new AbortController();
544
+ let scopedTimeoutRef;
545
+ const isVinRequest = typeof newData === 'string';
546
+ const vin = isVinRequest ? newData : newData === null || newData === void 0 ? void 0 : newData.vin;
547
+ this.externalVin = vin;
548
+ try {
549
+ if (!vin || vin.trim().length === 0) {
550
+ this.state = 'idle';
551
+ return;
552
+ }
553
+ if (this.state === 'data' || this.state === 'error') {
554
+ this.state = (this.state + '-loading');
555
+ }
556
+ else
557
+ this.state = 'loading';
558
+ await new Promise(r => {
559
+ scopedTimeoutRef = setTimeout(r, 700);
560
+ this.networkTimeoutRef = scopedTimeoutRef;
561
+ });
562
+ const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData: mockData$3 }, headers) : newData;
563
+ if (this.networkTimeoutRef === scopedTimeoutRef) {
564
+ if (!vehicleResponse)
565
+ throw new Error('Wrong response format');
566
+ this.handleSettingData(vehicleResponse);
567
+ }
568
+ this.errorMessage = null;
569
+ this.state = 'data';
570
+ }
571
+ catch (error) {
572
+ if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
573
+ return;
574
+ this.state = 'error';
575
+ this.vehicleInformation = null;
576
+ this.errorMessage = error.message;
577
+ }
578
+ }
579
+ async fetchData(requestedVin = this.externalVin, headers = {}) {
580
+ await this.setData(requestedVin, headers);
581
+ }
582
+ async loadingListener() {
583
+ if (this.loadingStateChange)
584
+ this.loadingStateChange(this.state.includes('loading'));
585
+ }
586
+ async setMockData(newMockData) {
587
+ mockData$3 = newMockData;
588
+ }
589
+ render() {
590
+ var _a, _b, _c, _d;
591
+ return (h(Host, { key: '52935e6fb3255892bdd284214cfc5400512ffdc3' }, h("div", { key: '13ebe565c3622e164a4c3341961fa09f197eff07', class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, h("div", { key: '17409d800ef7272d68ee4b87ac5290a7840da6b8' }, h(Loading$1, { key: 'ab181a9f94a683a0c9a63022f91bf0be576407e4', isLoading: this.state.includes('loading') }), h("div", { key: '5c4fba056616fd0c73c4621796c03fce922ec585', class: cn('transition-all duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, h("div", { key: 'd2274baa55784519e27959977137d1df96180176', 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: 'e5bbed2b50658ea403a8313ae462bad757538174', class: "py-[16px]" }, h("div", { key: '7b591a9617de72e12f8d3d3dc3f20c4028cedb9c', class: " px-[16px] py-[8px] border reject-card text-[20px] rounded-[8px] w-fit mx-auto" }, this.errorMessage))), ['data', 'data-loading'].includes(this.state) && (h("div", { key: '02488e145ec167f0b6de715d13439029ea11a45a', class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, h("div", { key: '1084269343da542e74cb1e9741d06067a3739af1', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, "Service History"), h("div", { key: '38cde65fb146f9b0c0e045f221eea6950ccc66d7', class: "h-0 overflow-auto flex-1" }, !((_b = this.vehicleInformation) === null || _b === void 0 ? void 0 : _b.serviceHistory.length) && h("div", { key: 'a8180a5375a84bc95451df88fcee439713a6c529', class: "h-[80px] flex items-center justify-center text-[18px]" }, "No data is available."), !!((_c = this.vehicleInformation) === null || _c === void 0 ? void 0 : _c.serviceHistory.length) && (h("table", { key: '2e8edb3e5f49dacf3b14ea1259cf464e50c96686', class: "w-full overflow-auto relative border-collapse" }, h("thead", { key: 'b99cee125c4899a88b0ec6650c0a2e40e9a30617', class: "top-0 font-bold sticky bg-white" }, h("tr", { key: '6bd167c617c04d30daefc4b0c20fa688ab6ffc0f' }, ['Branch', 'Dealer', 'Invoice No.', 'Date', 'Service Type', 'Odometer'].map(title => (h("th", { key: title, class: "px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]" }, title))))), h("tbody", { key: 'bd25354c05ee8b813be63a2278379910842ce24a' }, (_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 => {
592
+ var _a;
593
+ return (h("td", { key: service.invoiceNumber + serviceType, class: cn('px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]', {
594
+ '!border-none': idx === ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceHistory.length) - 1,
595
+ }) }, service[serviceType] || '...'));
596
+ })))))))))))))));
597
+ }
598
+ get el() { return getElement(this); }
599
+ static get watchers() { return {
600
+ "state": ["loadingListener"]
601
+ }; }
602
+ };
603
+ ServiceHistory.style = ServiceHistoryStyle0;
604
+
605
+ 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-4{padding-bottom:1rem;padding-top:1rem}.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-300{transition-duration:.3s}.duration-700{transition-duration:.7s}.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))}.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)}.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}.py-\\[16px\\]{padding-bottom:16px;padding-top:16px}.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)}.size-\\[40px\\]{height:40px;width:40px}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin-2s{animation:spin 2s linear infinite}";
606
+ const VehicleAccessoriesStyle0 = vehicleAccessoriesCss;
607
+
608
+ let mockData$2 = {};
609
+ const VehicleAccessories = class {
610
+ constructor(hostRef) {
611
+ registerInstance(this, hostRef);
612
+ this.closeImageListener = (event) => {
613
+ this.closeImage(event);
614
+ };
615
+ this.openImage = (target, imageSrc) => {
616
+ openImageViewer(this, target, imageSrc);
617
+ };
618
+ this.closeImage = (event) => {
619
+ closeImageViewer(this, event);
620
+ };
621
+ this.baseUrl = '';
622
+ this.isDev = false;
623
+ this.queryString = '';
624
+ this.loadingStateChange = undefined;
625
+ this.loadedResponse = undefined;
626
+ this.state = 'idle';
627
+ this.externalVin = null;
628
+ this.errorMessage = null;
629
+ this.expandedImage = null;
630
+ this.vehicleInformation = undefined;
631
+ }
632
+ handleSettingData(response) {
633
+ if (!response.accessories || !Array.isArray(response.accessories))
634
+ response.accessories = [];
635
+ this.vehicleInformation = response;
636
+ }
637
+ async setData(newData, headers = {}) {
638
+ clearTimeout(this.networkTimeoutRef);
639
+ if (this.abortController)
640
+ this.abortController.abort();
641
+ this.abortController = new AbortController();
642
+ let scopedTimeoutRef;
643
+ const isVinRequest = typeof newData === 'string';
644
+ const vin = isVinRequest ? newData : newData === null || newData === void 0 ? void 0 : newData.vin;
645
+ this.externalVin = vin;
646
+ try {
647
+ if (!vin || vin.trim().length === 0) {
648
+ this.state = 'idle';
649
+ return;
650
+ }
651
+ if (this.state === 'data' || this.state === 'error') {
652
+ this.state = (this.state + '-loading');
653
+ }
654
+ else
655
+ this.state = 'loading';
656
+ await new Promise(r => {
657
+ scopedTimeoutRef = setTimeout(r, 700);
658
+ this.networkTimeoutRef = scopedTimeoutRef;
659
+ });
660
+ const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData: mockData$2 }, headers) : newData;
661
+ if (this.networkTimeoutRef === scopedTimeoutRef) {
662
+ if (!vehicleResponse)
663
+ throw new Error('Wrong response format');
664
+ this.handleSettingData(vehicleResponse);
665
+ }
666
+ this.errorMessage = null;
667
+ this.state = 'data';
668
+ }
669
+ catch (error) {
670
+ if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
671
+ return;
672
+ this.state = 'error';
673
+ this.vehicleInformation = null;
674
+ this.errorMessage = error.message;
675
+ }
676
+ }
677
+ async fetchData(requestedVin = this.externalVin, headers = {}) {
678
+ await this.setData(requestedVin, headers);
679
+ }
680
+ async loadingListener() {
681
+ if (this.loadingStateChange)
682
+ this.loadingStateChange(this.state.includes('loading'));
683
+ }
684
+ async setMockData(newMockData) {
685
+ mockData$2 = newMockData;
686
+ }
687
+ render() {
688
+ var _a, _b;
689
+ const accessories = (this === null || this === void 0 ? void 0 : this.vehicleInformation) ? (_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.accessories : [];
690
+ return (h(Host, { key: 'c3e15f7ea4b5b4177a6ea39b3e1791ca0206c353' }, h("div", { key: '32fa68b52d7777bae7ad86457428075bcc8b1ba7', class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, h("div", { key: 'cd0e92a1743a9ab067b0a6fb19231d0e4d145381' }, h(Loading$1, { key: '3af0292db1134d58c0741c4b1b4dbe1cf969cb22', isLoading: this.state.includes('loading') }), h("div", { key: '52ecf54abe9713f27acb0674bb9e0b51a0069b04', class: cn('transition-all duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, h("div", { key: '26b8c7fa02f831bb1d58bae0571ec0e46f107510', 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: '2c9aac9a53cb47d9289966fabdecd1d402869ba3', class: "py-[16px]" }, h("div", { key: '4f290b2884289fbf36347718ef3f578d87be96a7', class: " px-[16px] py-[8px] border reject-card text-[20px] rounded-[8px] w-fit mx-auto" }, this.errorMessage))), ['data', 'data-loading'].includes(this.state) && (h("div", { key: '463077e9325d5bb14018bbb4fa1b3c4a9b20e4d1', class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, h("div", { key: '8be664eafbf0ff98d8b773ddc9581c4816da8599', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, "Vehicle Accessories"), h("div", { key: '340c3067fb9d0f52ff738b2c8af03722668cb1fc', class: "h-0 overflow-auto flex-1" }, !accessories.length && h("div", { key: '9a7df38a041191380041b01967724c0b240ab18a', class: "h-[80px] flex items-center justify-center text-[18px]" }, "No data is available."), !!accessories.length && (h("table", { key: '6b8807cd444c3413ecad6ce93a1c098aedf1b8ef', class: "w-full overflow-auto relative border-collapse" }, h("thead", { key: '36b46237a44977caddfb9bd046cc607dcd0da66c', class: "top-0 font-bold z-40 sticky bg-white" }, h("tr", { key: 'edfbeee6354a1981bfa186e905dd2e080b47cc92' }, ['Part Number', 'Description', 'Image'].map(title => (h("th", { key: title, class: "px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]" }, title))))), h("tbody", { key: 'd35c16f3e4d32302f2992278ae1cff317c92381f' }, accessories.map((accessory, idx) => {
691
+ var _a;
692
+ return (h("tr", { class: "transition-colors duration-100 hover:bg-slate-100", key: accessory.partNumber }, ['partNumber', 'description'].map(key => {
693
+ var _a;
694
+ return (h("td", { key: accessory.partNumber + key, class: cn('px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]', {
695
+ '!border-none': idx === ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceHistory.length) - 1,
696
+ }) }, accessory[key] || '...'));
697
+ }), h("td", { class: cn('px-[10px] py-[10px] text-center whitespace-nowrap border-b border-[#d6d8dc]', {
698
+ '!border-none': idx === ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceHistory.length) - 1,
699
+ }) }, 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" }, "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 })))));
700
+ })), h("div", { key: '5bfa1550c43f457339a3d2d7d39d4840a9f13b2c', 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', {
701
+ 'pointer-events-auto opacity-100 delay-200': this.expandedImage,
702
+ }) }, h("button", { key: '074c83d8a0f9b50a71848721286d86104391475b', class: "flex flex-col mt-[16px] items-center justify-center size-12 float-right mr-[16px]", onClick: () => this.closeImage() }, h("div", { key: '94eb63f587e347e325fd076b414e62ff09609b2e', class: "h-1 w-12 rounded-full rotate-45 absolute bg-white" }), h("div", { key: '7168d9abde6893935e20e07deac4a5ec0c7e20a0', class: "h-1 w-12 rounded-full -rotate-45 absolute bg-white" }))), h("img", { key: 'f963f6dcbed066596ef94c98f7e9406c8cbfab98', alt: "", id: "expanded-image", class: "fixed opacity-0 z-50 transition-all rounded-lg" })))))))))));
703
+ }
704
+ get el() { return getElement(this); }
705
+ static get watchers() { return {
706
+ "state": ["loadingListener"]
707
+ }; }
708
+ };
709
+ VehicleAccessories.style = VehicleAccessoriesStyle0;
710
+
711
+ 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-4{padding-bottom:1rem;padding-top:1rem}.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-300{transition-duration:.3s}.duration-700{transition-duration:.7s}.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))}.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)}.success-card{background-color:#d0e7de;border-color:#a2d0bb;color:#0b3521}.pointer-events-none{pointer-events:none}.absolute{position:absolute}.z-50{z-index:50}.size-\\[40px\\]{height:40px;width:40px}.size-full{height:100%;width:100%}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin-2s{animation:spin 2s linear infinite}.duration-100{transition-duration:.1s}";
712
+ const VehicleSpecificationStyle0 = vehicleSpecificationCss;
713
+
714
+ let mockData$1 = {};
715
+ const VehicleSpecification = class {
716
+ constructor(hostRef) {
717
+ registerInstance(this, hostRef);
718
+ this.baseUrl = '';
719
+ this.isDev = false;
720
+ this.queryString = '';
721
+ this.loadingStateChange = undefined;
722
+ this.loadedResponse = undefined;
723
+ this.state = 'idle';
724
+ this.externalVin = null;
725
+ this.errorMessage = null;
726
+ this.vehicleInformation = undefined;
727
+ }
728
+ async setData(newData, headers = {}) {
729
+ clearTimeout(this.networkTimeoutRef);
730
+ if (this.abortController)
731
+ this.abortController.abort();
732
+ this.abortController = new AbortController();
733
+ let scopedTimeoutRef;
734
+ const isVinRequest = typeof newData === 'string';
735
+ const vin = isVinRequest ? newData : newData === null || newData === void 0 ? void 0 : newData.vin;
736
+ this.externalVin = vin;
737
+ try {
738
+ if (!vin || vin.trim().length === 0) {
739
+ this.state = 'idle';
740
+ return;
741
+ }
742
+ if (this.state === 'data' || this.state === 'error') {
743
+ this.state = (this.state + '-loading');
744
+ }
745
+ else
746
+ this.state = 'loading';
747
+ await new Promise(r => {
748
+ scopedTimeoutRef = setTimeout(r, 700);
749
+ this.networkTimeoutRef = scopedTimeoutRef;
750
+ });
751
+ const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData: mockData$1 }, headers) : newData;
752
+ if (this.networkTimeoutRef === scopedTimeoutRef) {
753
+ if (!vehicleResponse)
754
+ throw new Error('Wrong response format');
755
+ this.vehicleInformation = vehicleResponse;
756
+ }
757
+ this.errorMessage = null;
758
+ this.state = 'data';
759
+ }
760
+ catch (error) {
761
+ if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
762
+ return;
763
+ this.state = 'error';
764
+ this.vehicleInformation = null;
765
+ this.errorMessage = error.message;
766
+ }
767
+ }
768
+ async fetchData(requestedVin = this.externalVin, headers = {}) {
769
+ await this.setData(requestedVin, headers);
770
+ }
771
+ async loadingListener() {
772
+ if (this.loadingStateChange)
773
+ this.loadingStateChange(this.state.includes('loading'));
774
+ }
775
+ async setMockData(newMockData) {
776
+ mockData$1 = newMockData;
777
+ }
778
+ render() {
779
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
780
+ return (h(Host, { key: 'e3c484a70dc5f7aa5adf18cd41b25003c3444a56' }, h("div", { key: 'a3e29397ab7341b6a34e6f427f3439e6a82e6b1f', class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, h("div", { key: '7a1561a6d48ae8adf1c6dfbe0b1dc8709a00266e' }, h(Loading$1, { key: '6271b33b5f59b5addd96c6ff15a30a5eb8b4fef9', isLoading: this.state.includes('loading') }), h("div", { key: '31f357b9ad4dd3988fc1725bf8b9e7b98fd65823', class: cn('transition-all duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, h("div", { key: 'bf7f7a245fffeb924509d71236d1b26106bb0e57', 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: '4092664a0f4c116330a9ac1670a5cda544190aed', class: "py-4" }, h("div", { key: 'adaffa90f0940ab7516edbb1c3eeb76e5b6eff46', class: " px-[16px] py-[8px] border reject-card text-[20px] rounded-[8px] w-fit mx-auto" }, this.errorMessage))), ['data', 'data-loading'].includes(this.state) && (h("div", { key: '1192eeddfd8fba6894a9b616578e1f4dfca660d0', class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, h("div", { key: 'b14430a00c451c14bb4a5fee91e81d0fdf142953', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, "Vehicle Specifications"), h("div", { key: '161ae26fc166df8ba272574209c1a982a6c1e66e', class: "h-0 overflow-auto flex-1" }, !((_b = this.vehicleInformation) === null || _b === void 0 ? void 0 : _b.vehicleSpecification) && h("div", { key: 'f6621372ba3b2cb084b19b31ba3b9db706ede96f', class: "h-[80px] flex items-center justify-center text-[18px]" }, "No data is available."), !!((_c = this.vehicleInformation) === null || _c === void 0 ? void 0 : _c.vehicleSpecification) && (h("table", { key: '6f5a84801bf630e7a39bbd3545b88a0214060bda', class: "w-full overflow-auto relative border-collapse" }, h("thead", { key: '4f1baacf807651bdc7bd451e713d27fa63e8e7ba', class: "top-0 font-bold sticky bg-white" }, h("tr", { key: 'b7606bfa3edbdf58a774b785901d68d8c4042b89' }, ['Model', 'Variant', 'Katashiki', 'Model Year', 'SFX'].map(title => (h("th", { key: title, class: "px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]" }, title))))), h("tbody", { key: 'd8d8dc5b54bc35ce7e2d2aa1a425d568cb5eac14' }, h("tr", { key: '1e08373124004e72646368df8a5b2360f1df32c1' }, h("td", { key: '294c51e617c0e5b4fb64e4c0216a599d10ec1cd4', 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: 'cd4b112002f2323ff6809203a3ca8c8f206731a5', 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: '77a1044bbc6a062daf70b919acbe9f7c94c9e951', 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: '6e7e3cda6297dd6f14b50ac879bb9bd139b0d995' }), ((_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 => {
781
+ var _a;
782
+ const [place, field] = infoPath.split('.');
783
+ const cellValue = (_a = this === null || this === void 0 ? void 0 : this.vehicleInformation) === null || _a === void 0 ? void 0 : _a[place][field].toString();
784
+ return (h("td", { key: infoPath, class: cn('px-[10px] py-[20px] text-center whitespace-nowrap') }, cellValue.trim() ? cellValue : '...'));
785
+ })))))))))))));
786
+ }
787
+ get el() { return getElement(this); }
788
+ static get watchers() { return {
789
+ "state": ["loadingListener"]
790
+ }; }
791
+ };
792
+ VehicleSpecification.style = VehicleSpecificationStyle0;
793
+
794
+ const loaderSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIKICAgIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBjbGFzcz0ibHVjaWRlIGx1Y2lkZS1sb2FkZXIiPgogICAgPHBhdGggZD0iTTEyIDJ2NCIgLz4KICAgIDxwYXRoIGQ9Im0xNi4yIDcuOCAyLjktMi45IiAvPgogICAgPHBhdGggZD0iTTE4IDEyaDQiIC8+CiAgICA8cGF0aCBkPSJtMTYuMiAxNi4yIDIuOSAyLjkiIC8+CiAgICA8cGF0aCBkPSJNMTIgMTh2NCIgLz4KICAgIDxwYXRoIGQ9Im00LjkgMTkuMSAyLjktMi45IiAvPgogICAgPHBhdGggZD0iTTIgMTJoNCIgLz4KICAgIDxwYXRoIGQ9Im00LjkgNC45IDIuOSAyLjkiIC8+Cjwvc3ZnPg==';
795
+
796
+ function Loading({ isLoading }) {
797
+ return (h("div", { class: cn('loading-spinner absolute', { hide: !isLoading }) },
798
+ h("img", { class: "spin", src: loaderSvg })));
799
+ }
800
+
801
+ const checkSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj4KICAgIDxwYXRoIGZpbGw9IiMwYjM1MjEiCiAgICAgICAgZD0iTTI1NiA1MTJBMjU2IDI1NiAwIDEgMCAyNTYgMGEyNTYgMjU2IDAgMSAwIDAgNTEyek0zNjkgMjA5TDI0MSAzMzdjLTkuNCA5LjQtMjQuNiA5LjQtMzMuOSAwbC02NC02NGMtOS40LTkuNC05LjQtMjQuNiAwLTMzLjlzMjQuNi05LjQgMzMuOSAwbDQ3IDQ3TDMzNSAxNzVjOS40LTkuNCAyNC42LTkuNCAzMy45IDBzOS40IDI0LjYgMCAzMy45eiIgLz4KPC9zdmc+';
802
+
803
+ const xMarkSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj4KICAgIDxwYXRoIGZpbGw9IiM1ODE1MWMiCiAgICAgICAgZD0iTTI1NiA1MTJBMjU2IDI1NiAwIDEgMCAyNTYgMGEyNTYgMjU2IDAgMSAwIDAgNTEyek0xNzUgMTc1YzkuNC05LjQgMjQuNi05LjQgMzMuOSAwbDQ3IDQ3IDQ3LTQ3YzkuNC05LjQgMjQuNi05LjQgMzMuOSAwczkuNCAyNC42IDAgMzMuOWwtNDcgNDcgNDcgNDdjOS40IDkuNCA5LjQgMjQuNiAwIDMzLjlzLTI0LjYgOS40LTMzLjkgMGwtNDctNDctNDcgNDdjLTkuNCA5LjQtMjQuNiA5LjQtMzMuOSAwcy05LjQtMjQuNiAwLTMzLjlsNDctNDctNDctNDdjLTkuNC05LjQtOS40LTI0LjYgMC0zMy45eiIgLz4KPC9zdmc+';
804
+
805
+ function StatusCard({ desc, className, from, to, state = 'idle', icon = true }) {
806
+ return (h("div", { class: cn('card', className, `${state}-card`) },
807
+ icon && state === 'reject' && h("img", { src: xMarkSvg }),
808
+ icon && state === 'warning' && h("img", { src: xMarkSvg }),
809
+ icon && state === 'success' && h("img", { src: checkSvg }),
810
+ from && (h("p", { class: "no-padding" },
811
+ h("span", { class: "font-semibold pr-1" }, "From:"),
812
+ " ",
813
+ desc)),
814
+ to && (h("p", { class: "no-padding" },
815
+ h("span", { class: "font-semibold pr-1" }, "To:"),
816
+ " ",
817
+ desc)),
818
+ !from && !to && h("p", { class: state === 'idle' ? 'no-padding' : '' }, desc)));
819
+ }
820
+
821
+ function CardsContainer({ warranty, isAuthorized, unInvoicedByBrokerName }) {
822
+ return (h("div", { class: "warranty-tags mx-auto pt-3" },
823
+ h(StatusCard, { state: isAuthorized ? 'success' : 'reject', desc: isAuthorized ? 'Authorized' : 'Unauthorized' }),
824
+ h(StatusCard, { state: warranty.hasActiveWarranty ? 'success' : 'reject', desc: warranty.hasActiveWarranty ? 'Has Active Warranty' : "Doesn't Have Active Warranty" }),
825
+ unInvoicedByBrokerName && h(StatusCard, { className: 'span-entire-2nd-row', state: 'warning', icon: true, desc: `Warranty is not Active because this Vehicle is not Invoiced by the following Trusted Business Partner: ${unInvoicedByBrokerName}` }),
826
+ warranty.warrantyStartDate && h(StatusCard, { state: (warranty === null || warranty === void 0 ? void 0 : warranty.hasActiveWarranty) ? 'success' : 'reject', icon: false, from: true, desc: warranty.warrantyStartDate }),
827
+ warranty.warrantyEndDate && h(StatusCard, { state: (warranty === null || warranty === void 0 ? void 0 : warranty.hasActiveWarranty) ? 'success' : 'reject', icon: false, to: true, desc: warranty.warrantyEndDate })));
828
+ }
829
+
830
+ function SSCTable({ ssc }) {
831
+ return (h("div", { class: "wrapper-table" },
832
+ h("div", { class: "header" }, "SSC Campings"),
833
+ h("div", { class: "ssc-table-container" },
834
+ h("table", { class: "ssc-table" },
835
+ h("thead", null,
836
+ h("tr", null,
837
+ h("th", null, "Code"),
838
+ h("th", null, "Description"),
839
+ h("th", null, "Repair Status"),
840
+ h("th", null, "OP-Codes"),
841
+ h("th", null, "Part Number"))),
842
+ h("tbody", null, ssc.map(sscItem => (h("tr", { class: "transition", key: sscItem.sscCode },
843
+ h("td", null, sscItem.sscCode),
844
+ h("td", null, sscItem.description),
845
+ h("td", null,
846
+ h("div", { class: "table-cell-container" },
847
+ h("img", { class: "table-status-icon", src: sscItem.repaired ? checkSvg : xMarkSvg }),
848
+ " ", sscItem === null || sscItem === void 0 ? void 0 :
849
+ sscItem.repairDate)),
850
+ h("td", null, sscItem.opCode),
851
+ h("td", null,
852
+ h("div", { class: "table-cell-container table-cell-parts-container" }, !!sscItem.parts.length
853
+ ? sscItem.parts.map(part => (h("div", { key: part.partNumber, class: part.isAvailable ? 'success' : 'reject' }, part.partNumber)))
854
+ : '...'))))))))));
855
+ }
856
+
857
+ 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}.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))}.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:all;transition-duration:.3s;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)}.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 spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@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}.spin{animation:spin 2s linear infinite}.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-parts-container{flex-wrap:wrap}.table-cell-parts-container div{border-radius:4px;font-size:14px;padding:4px 8px}.table-cell-parts-container div.success{background:#d0e7de}.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-4{padding-bottom:1rem;padding-top:1rem}.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-300{transition-duration:.3s}";
858
+ const WarrantyDetailsStyle0 = warrantyDetailsCss;
859
+
860
+ let mockData = {};
861
+ const WarrantyDetails = class {
862
+ constructor(hostRef) {
863
+ registerInstance(this, hostRef);
864
+ this.baseUrl = '';
865
+ this.unauthorizedSscLookupBaseUrl = '';
866
+ this.isDev = false;
867
+ this.showSsc = false;
868
+ this.queryString = '';
869
+ this.unauthorizedSscLookupQueryString = '';
870
+ this.recaptchaKey = '';
871
+ this.showWarranty = false;
872
+ this.cityId = null;
873
+ this.cityIntegrationId = null;
874
+ this.companyId = null;
875
+ this.companyIntegrationId = null;
876
+ this.companyBranchId = null;
877
+ this.companyBranchIntegrationId = null;
878
+ this.userId = null;
879
+ this.brandIntegrationId = null;
880
+ this.customerName = null;
881
+ this.customerPhone = null;
882
+ this.customerEmail = null;
883
+ this.loadingStateChange = undefined;
884
+ this.loadedResponse = undefined;
885
+ this.state = 'idle';
886
+ this.externalVin = null;
887
+ this.errorMessage = null;
888
+ this.showRecaptcha = false;
889
+ this.unInvoicedByBrokerName = null;
890
+ this.vehicleInformation = undefined;
891
+ this.checkingUnauthorizedSSC = false;
892
+ this.recaptchaRes = null;
893
+ this.headers = {};
894
+ }
895
+ handleSettingData(response) {
896
+ var _a, _b, _c;
897
+ if (response.warranty === null)
898
+ response.warranty = {
899
+ warrantyEndDate: '',
900
+ warrantyStartDate: '',
901
+ hasActiveWarranty: false,
902
+ hasExtendedWarranty: false,
903
+ extendedWarrantyEndDate: '',
904
+ extendedWarrantyStartDate: '',
905
+ };
906
+ if (response.ssc === null)
907
+ response.ssc = [];
908
+ this.unInvoicedByBrokerName = null;
909
+ 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)
910
+ this.unInvoicedByBrokerName = response.saleInformation.broker.brokerName;
911
+ this.vehicleInformation = response;
912
+ }
913
+ async handleInitializingRecaptcha(vin, scopedTimeoutRef) {
914
+ var _a;
915
+ if (((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.isAuthorized) === false && this.showSsc && this.recaptchaKey !== '') {
916
+ grecaptcha.reset();
917
+ await new Promise(r => setTimeout(r, 400));
918
+ this.recaptchaIntervalRef = setInterval(async () => {
919
+ var _a;
920
+ const recaptchaResponse = grecaptcha.getResponse();
921
+ if (recaptchaResponse) {
922
+ clearInterval(this.recaptchaIntervalRef);
923
+ if (this.isDev) {
924
+ this.checkingUnauthorizedSSC = true;
925
+ this.showRecaptcha = false;
926
+ await new Promise(r => setTimeout(r, 3000));
927
+ this.checkingUnauthorizedSSC = false;
928
+ const hasPendingSSC = Math.random() < 0.5 ? false : true;
929
+ this.recaptchaRes = {
930
+ hasSSC: hasPendingSSC,
931
+ message: hasPendingSSC ? 'This Vehicle has a Pending SSC' : 'No Pending SSC',
932
+ };
933
+ }
934
+ else {
935
+ this.checkingUnauthorizedSSC = true;
936
+ this.showRecaptcha = false;
937
+ ///
938
+ const response = await fetch(`${this.unauthorizedSscLookupBaseUrl}${vin}/${(_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.sscLogId}?${this.unauthorizedSscLookupQueryString}`, {
939
+ signal: this.abortController.signal,
940
+ headers: Object.assign(Object.assign({}, this.headers), { 'Ssc-Recaptcha-Token': recaptchaResponse }),
941
+ });
942
+ const vinResponse = await response.json();
943
+ if (vinResponse && this.networkTimeoutRef === scopedTimeoutRef) {
944
+ this.checkingUnauthorizedSSC = false;
945
+ const hasPendingSSC = vinResponse.sscLookupStatus === 1;
946
+ this.recaptchaRes = {
947
+ hasSSC: hasPendingSSC,
948
+ message: hasPendingSSC ? 'This Vehicle has a Pending SSC' : 'No Pending SSC',
949
+ };
950
+ }
951
+ else
952
+ throw new Error('Wrong response format');
953
+ }
954
+ }
955
+ }, 500);
956
+ this.showRecaptcha = true;
957
+ }
958
+ else {
959
+ this.showRecaptcha = false;
960
+ }
961
+ }
962
+ async setData(newData, headers = {}) {
963
+ this.recaptchaRes = null;
964
+ this.headers = headers;
965
+ clearTimeout(this.networkTimeoutRef);
966
+ clearInterval(this.recaptchaIntervalRef);
967
+ if (this.abortController)
968
+ this.abortController.abort();
969
+ this.abortController = new AbortController();
970
+ let scopedTimeoutRef;
971
+ const isVinRequest = typeof newData === 'string';
972
+ const vin = isVinRequest ? newData : newData === null || newData === void 0 ? void 0 : newData.vin;
973
+ this.externalVin = vin;
974
+ try {
975
+ if (!vin || vin.trim().length === 0) {
976
+ this.state = 'idle';
977
+ return;
978
+ }
979
+ if (this.state === 'data' || this.state === 'error') {
980
+ this.state = (this.state + '-loading');
981
+ }
982
+ else
983
+ this.state = 'loading';
984
+ await new Promise(r => {
985
+ scopedTimeoutRef = setTimeout(r, 600);
986
+ this.networkTimeoutRef = scopedTimeoutRef;
987
+ });
988
+ const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData }, headers) : newData;
989
+ if (this.networkTimeoutRef === scopedTimeoutRef) {
990
+ if (!vehicleResponse)
991
+ throw new Error('Wrong response format');
992
+ this.handleSettingData(vehicleResponse);
993
+ this.handleInitializingRecaptcha(vin, scopedTimeoutRef);
994
+ }
995
+ this.errorMessage = null;
996
+ this.state = 'data';
997
+ }
998
+ catch (error) {
999
+ if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
1000
+ return;
1001
+ this.state = 'error';
1002
+ this.vehicleInformation = null;
1003
+ this.errorMessage = error.message;
1004
+ }
1005
+ }
1006
+ async fetchData(requestedVin = this.externalVin, headers = {}) {
1007
+ await this.setData(requestedVin, headers);
1008
+ }
1009
+ async componentDidLoad() {
1010
+ if (this.recaptchaKey !== '') {
1011
+ const script = document.createElement('script');
1012
+ script.src = 'https://www.google.com/recaptcha/api.js';
1013
+ script.async = true;
1014
+ script.defer = true;
1015
+ script.onload = () => console.log('reCAPTCHA script loaded');
1016
+ document.head.appendChild(script);
1017
+ }
1018
+ }
1019
+ async setMockData(newMockData) {
1020
+ mockData = newMockData;
1021
+ }
1022
+ async loadingListener() {
1023
+ if (this.loadingStateChange)
1024
+ this.loadingStateChange(this.state.includes('loading'));
1025
+ }
1026
+ render() {
1027
+ var _a, _b, _c, _d, _e;
1028
+ return (h(Host, { key: '00985864b4a1ca44fdb78b82e08e72e4ac3655b2' }, h("div", { key: 'c7e4ce3dde8ed3da3a8b07d57098a1870a8b0360', class: "min-h-[100px] warranty" }, h("div", { key: 'b71df5aab832885752fc4d73f274d2face7243e0' }, h(Loading, { key: '672b5e0e2fd94c4ee82544d43eeedd34c32de91b', isLoading: this.state.includes('loading') }), h("div", { key: 'e71bf6e1f5083bebd865e2d89bbd9b2d86721887', class: "transition 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: 'f20ba9ca38dd952539d0e23ef2aab4d7fd26250a', 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: '1aeb05a53021f5d7ff05f90ad6e7dfa1e46f4961', class: "py-4" }, h(StatusCard, { key: 'd692e4ac53d7172caba6876d735ead286e871117', desc: this.errorMessage, className: "mx-auto reject-card max-w-500" }), ' ')), this.showWarranty && ['data', 'data-loading'].includes(this.state) && (h(CardsContainer, { key: '28efd340255d231417601b69332ef461fe19d6f2', 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: 'df8d5c967864cff4b65e863236165953436bf56d', style: Object.assign({}, (this.showRecaptcha ? { height: 'auto', padding: '16px 16px 0px 16px' } : { height: '0px' })), class: "recaptcha-container" }, h("slot", { key: '39eac5a574180bafff88d7ba7b187bf6bf5e1257' })), ['data', 'data-loading'].includes(this.state) && this.recaptchaRes && (h("div", { key: '8978abb0f4ec2ea7b0ff84fb10783d528dfb8c0a', class: cn('recaptcha-response', !this.recaptchaRes.hasSSC ? 'success-card' : 'reject-card ') }, this.recaptchaRes.message)), this.checkingUnauthorizedSSC && (h("div", { key: 'e24a78d08c60cd5df393f084c949108229d38666', class: "loading-spinner", style: { marginTop: '20px', flexDirection: 'column' } }, h("div", { key: '93fcbe4aab6833885be12de906a534a47794f5d4' }, h("strong", { key: '88be79409f003abe307dde581ccc1978f7bfcf86' }, "Checking TMC")), h("img", { key: '800535e9b147af17f04081f65acc470d62d69e7f', class: "spin", src: loaderSvg$1 }))), 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: '73aceff6236687ed80046a897df3a040ba92e3aa', ssc: this.vehicleInformation.ssc })))))));
1029
+ }
1030
+ get el() { return getElement(this); }
1031
+ static get watchers() { return {
1032
+ "state": ["loadingListener"]
1033
+ }; }
1034
+ };
1035
+ WarrantyDetails.style = WarrantyDetailsStyle0;
1036
+
1037
+ 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 };