adp-web-components 0.0.11

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 (196) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cjs/Loading-ee1a2ceb.js +16 -0
  3. package/dist/cjs/app-globals-3813fb46.js +9 -0
  4. package/dist/cjs/cn-f559f9e5.js +2588 -0
  5. package/dist/cjs/dead-stock-lookup.cjs.entry.js +103 -0
  6. package/dist/cjs/distributor-lookup.cjs.entry.js +109 -0
  7. package/dist/cjs/dynamic-claim.cjs.entry.js +306 -0
  8. package/dist/cjs/dynamic-redeem.cjs.entry.js +145 -0
  9. package/dist/cjs/form-input.cjs.entry.js +36 -0
  10. package/dist/cjs/general-inquiry-form.cjs.entry.js +2280 -0
  11. package/dist/cjs/image-expansion-a9c9c6f7.js +77 -0
  12. package/dist/cjs/index-d4b5214c.js +1331 -0
  13. package/dist/cjs/index.cjs.js +6 -0
  14. package/dist/cjs/loader-baf2418b.js +9 -0
  15. package/dist/cjs/loader.cjs.js +19 -0
  16. package/dist/cjs/manufacturer-lookup.cjs.entry.js +109 -0
  17. package/dist/cjs/paint-thickness.cjs.entry.js +131 -0
  18. package/dist/cjs/partInformation-2a6a018b.js +34 -0
  19. package/dist/cjs/service-history.cjs.entry.js +116 -0
  20. package/dist/cjs/shift-components.cjs.js +29 -0
  21. package/dist/cjs/vehicle-accessories.cjs.entry.js +135 -0
  22. package/dist/cjs/vehicle-specification.cjs.entry.js +111 -0
  23. package/dist/cjs/vehicleInformation-4c1dcaf2.js +52 -0
  24. package/dist/cjs/warranty-details.cjs.entry.js +281 -0
  25. package/dist/collection/collection-manifest.json +23 -0
  26. package/dist/collection/components/dynamic-claim/dynamic-claim.css +1 -0
  27. package/dist/collection/components/dynamic-claim/dynamic-claim.js +521 -0
  28. package/dist/collection/components/dynamic-claim/icons/cancelled.svg +8 -0
  29. package/dist/collection/components/dynamic-claim/icons/expired.svg +9 -0
  30. package/dist/collection/components/dynamic-claim/icons/pending.svg +9 -0
  31. package/dist/collection/components/dynamic-claim/icons/processed.svg +9 -0
  32. package/dist/collection/components/dynamic-redeem/dynamic-redeem.css +1 -0
  33. package/dist/collection/components/dynamic-redeem/dynamic-redeem.js +334 -0
  34. package/dist/collection/components/form-input/form-input.css +1 -0
  35. package/dist/collection/components/form-input/form-input.js +209 -0
  36. package/dist/collection/components/general-inquiry-form/general-inquiry-form.css +1 -0
  37. package/dist/collection/components/general-inquiry-form/general-inquiry-form.js +46 -0
  38. package/dist/collection/components/paint-thickness/paint-thickness.css +1 -0
  39. package/dist/collection/components/paint-thickness/paint-thickness.js +323 -0
  40. package/dist/collection/components/part-lookup/dead-stock-lookup.css +1 -0
  41. package/dist/collection/components/part-lookup/dead-stock-lookup.js +294 -0
  42. package/dist/collection/components/part-lookup/distributor-lookup.css +1 -0
  43. package/dist/collection/components/part-lookup/distributor-lookup.js +299 -0
  44. package/dist/collection/components/part-lookup/manufacturer-lookup.css +1 -0
  45. package/dist/collection/components/part-lookup/manufacturer-lookup.js +317 -0
  46. package/dist/collection/components/parts/Loading.js +10 -0
  47. package/dist/collection/components/service-history/service-history.css +1 -0
  48. package/dist/collection/components/service-history/service-history.js +306 -0
  49. package/dist/collection/components/vehicle-accessories/vehicle-accessories.css +1 -0
  50. package/dist/collection/components/vehicle-accessories/vehicle-accessories.js +327 -0
  51. package/dist/collection/components/vehicle-specification/vehicle-specification.css +1 -0
  52. package/dist/collection/components/vehicle-specification/vehicle-specification.js +301 -0
  53. package/dist/collection/components/warranty-details/assets/check.svg +4 -0
  54. package/dist/collection/components/warranty-details/assets/loader.svg +11 -0
  55. package/dist/collection/components/warranty-details/assets/x-mark.svg +4 -0
  56. package/dist/collection/components/warranty-details/components/CardsContainer.js +9 -0
  57. package/dist/collection/components/warranty-details/components/Loading.js +10 -0
  58. package/dist/collection/components/warranty-details/components/SSCTable.js +13 -0
  59. package/dist/collection/components/warranty-details/components/StatusCard.js +11 -0
  60. package/dist/collection/components/warranty-details/warranty-details.css +1 -0
  61. package/dist/collection/components/warranty-details/warranty-details.js +709 -0
  62. package/dist/collection/global/api/partInformation.js +30 -0
  63. package/dist/collection/global/api/vehicleInformation.js +48 -0
  64. package/dist/collection/global/assets/eye.svg +5 -0
  65. package/dist/collection/global/assets/loader.svg +11 -0
  66. package/dist/collection/global/lib/cn.js +9 -0
  67. package/dist/collection/global/lib/form-hook.js +118 -0
  68. package/dist/collection/global/lib/image-expansion.js +69 -0
  69. package/dist/collection/global/lib/utils.js +7 -0
  70. package/dist/collection/global/types/components.js +1 -0
  71. package/dist/collection/global/types/part-information.js +1 -0
  72. package/dist/collection/global/types/vehicle-information.js +5 -0
  73. package/dist/collection/index.js +1 -0
  74. package/dist/collection/templates/mock-data.js +4132 -0
  75. package/dist/collection/templates/parts/mock-data.js +221 -0
  76. package/dist/collection/templates/vehicle-lookup.js +218 -0
  77. package/dist/collection/templates/warranty-mock-data.js +2982 -0
  78. package/dist/components/dead-stock-lookup.d.ts +11 -0
  79. package/dist/components/dead-stock-lookup.js +5 -0
  80. package/dist/components/distributor-lookup.d.ts +11 -0
  81. package/dist/components/distributor-lookup.js +5 -0
  82. package/dist/components/dynamic-claim.d.ts +11 -0
  83. package/dist/components/dynamic-claim.js +5 -0
  84. package/dist/components/dynamic-redeem.d.ts +11 -0
  85. package/dist/components/dynamic-redeem.js +5 -0
  86. package/dist/components/form-input.d.ts +11 -0
  87. package/dist/components/form-input.js +5 -0
  88. package/dist/components/general-inquiry-form.d.ts +11 -0
  89. package/dist/components/general-inquiry-form.js +5 -0
  90. package/dist/components/index.d.ts +33 -0
  91. package/dist/components/index.js +5 -0
  92. package/dist/components/manufacturer-lookup.d.ts +11 -0
  93. package/dist/components/manufacturer-lookup.js +5 -0
  94. package/dist/components/p-2b0cc0c6.js +5 -0
  95. package/dist/components/p-4dc47f5f.js +5 -0
  96. package/dist/components/p-50f73226.js +5 -0
  97. package/dist/components/p-5df9bc5f.js +5 -0
  98. package/dist/components/p-8375923d.js +5 -0
  99. package/dist/components/p-98d9e7ab.js +5 -0
  100. package/dist/components/p-a454210b.js +5 -0
  101. package/dist/components/p-d265c109.js +5 -0
  102. package/dist/components/p-d5ff7544.js +5 -0
  103. package/dist/components/paint-thickness.d.ts +11 -0
  104. package/dist/components/paint-thickness.js +5 -0
  105. package/dist/components/service-history.d.ts +11 -0
  106. package/dist/components/service-history.js +5 -0
  107. package/dist/components/vehicle-accessories.d.ts +11 -0
  108. package/dist/components/vehicle-accessories.js +5 -0
  109. package/dist/components/vehicle-specification.d.ts +11 -0
  110. package/dist/components/vehicle-specification.js +5 -0
  111. package/dist/components/warranty-details.d.ts +11 -0
  112. package/dist/components/warranty-details.js +5 -0
  113. package/dist/esm/Loading-61648252.js +14 -0
  114. package/dist/esm/app-globals-8befa224.js +7 -0
  115. package/dist/esm/cn-cc419b94.js +2586 -0
  116. package/dist/esm/dead-stock-lookup.entry.js +99 -0
  117. package/dist/esm/distributor-lookup.entry.js +105 -0
  118. package/dist/esm/dynamic-claim.entry.js +302 -0
  119. package/dist/esm/dynamic-redeem.entry.js +141 -0
  120. package/dist/esm/form-input.entry.js +32 -0
  121. package/dist/esm/general-inquiry-form.entry.js +2276 -0
  122. package/dist/esm/image-expansion-08c4bf0d.js +73 -0
  123. package/dist/esm/index-ef54644b.js +1302 -0
  124. package/dist/esm/index.js +4 -0
  125. package/dist/esm/loader-027b88af.js +7 -0
  126. package/dist/esm/loader.js +15 -0
  127. package/dist/esm/manufacturer-lookup.entry.js +105 -0
  128. package/dist/esm/paint-thickness.entry.js +127 -0
  129. package/dist/esm/partInformation-73ece994.js +32 -0
  130. package/dist/esm/service-history.entry.js +112 -0
  131. package/dist/esm/shift-components.js +24 -0
  132. package/dist/esm/vehicle-accessories.entry.js +131 -0
  133. package/dist/esm/vehicle-specification.entry.js +107 -0
  134. package/dist/esm/vehicleInformation-f1081f83.js +50 -0
  135. package/dist/esm/warranty-details.entry.js +277 -0
  136. package/dist/index.cjs.js +1 -0
  137. package/dist/index.js +1 -0
  138. package/dist/shift-components/index.esm.js +4 -0
  139. package/dist/shift-components/p-15f86441.entry.js +5 -0
  140. package/dist/shift-components/p-1ae3a61f.entry.js +5 -0
  141. package/dist/shift-components/p-517b3e04.js +5 -0
  142. package/dist/shift-components/p-5df9bc5f.js +5 -0
  143. package/dist/shift-components/p-65e6ab8e.js +5 -0
  144. package/dist/shift-components/p-894e7518.entry.js +5 -0
  145. package/dist/shift-components/p-8c261972.entry.js +5 -0
  146. package/dist/shift-components/p-8e818568.entry.js +5 -0
  147. package/dist/shift-components/p-98d9e7ab.js +5 -0
  148. package/dist/shift-components/p-9bd4471c.entry.js +5 -0
  149. package/dist/shift-components/p-9f790b14.entry.js +5 -0
  150. package/dist/shift-components/p-a21e2e2e.js +5 -0
  151. package/dist/shift-components/p-c113792c.entry.js +5 -0
  152. package/dist/shift-components/p-d265c109.js +5 -0
  153. package/dist/shift-components/p-d5ff7544.js +5 -0
  154. package/dist/shift-components/p-dc9845ed.entry.js +5 -0
  155. package/dist/shift-components/p-e32b0798.entry.js +5 -0
  156. package/dist/shift-components/p-e97316d2.js +6 -0
  157. package/dist/shift-components/p-f759c597.entry.js +5 -0
  158. package/dist/shift-components/p-feb3df85.entry.js +5 -0
  159. package/dist/shift-components/shift-components.esm.js +5 -0
  160. package/dist/types/components/dynamic-claim/dynamic-claim.d.ts +48 -0
  161. package/dist/types/components/dynamic-redeem/dynamic-redeem.d.ts +34 -0
  162. package/dist/types/components/form-input/form-input.d.ts +14 -0
  163. package/dist/types/components/general-inquiry-form/general-inquiry-form.d.ts +21 -0
  164. package/dist/types/components/paint-thickness/paint-thickness.d.ts +28 -0
  165. package/dist/types/components/part-lookup/dead-stock-lookup.d.ts +25 -0
  166. package/dist/types/components/part-lookup/distributor-lookup.d.ts +23 -0
  167. package/dist/types/components/part-lookup/manufacturer-lookup.d.ts +24 -0
  168. package/dist/types/components/parts/Loading.d.ts +5 -0
  169. package/dist/types/components/service-history/service-history.d.ts +23 -0
  170. package/dist/types/components/vehicle-accessories/vehicle-accessories.d.ts +28 -0
  171. package/dist/types/components/vehicle-specification/vehicle-specification.d.ts +22 -0
  172. package/dist/types/components/warranty-details/components/CardsContainer.d.ts +8 -0
  173. package/dist/types/components/warranty-details/components/Loading.d.ts +5 -0
  174. package/dist/types/components/warranty-details/components/SSCTable.d.ts +6 -0
  175. package/dist/types/components/warranty-details/components/StatusCard.d.ts +10 -0
  176. package/dist/types/components/warranty-details/warranty-details.d.ts +51 -0
  177. package/dist/types/components.d.ts +388 -0
  178. package/dist/types/global/api/partInformation.d.ts +19 -0
  179. package/dist/types/global/api/vehicleInformation.d.ts +33 -0
  180. package/dist/types/global/lib/cn.d.ts +2 -0
  181. package/dist/types/global/lib/form-hook.d.ts +54 -0
  182. package/dist/types/global/lib/image-expansion.d.ts +9 -0
  183. package/dist/types/global/lib/utils.d.ts +1 -0
  184. package/dist/types/global/types/components.d.ts +4 -0
  185. package/dist/types/global/types/part-information.d.ts +30 -0
  186. package/dist/types/global/types/vehicle-information.d.ts +162 -0
  187. package/dist/types/index.d.ts +10 -0
  188. package/dist/types/stencil-public-runtime.d.ts +1680 -0
  189. package/loader/cdn.js +5 -0
  190. package/loader/index.cjs.js +5 -0
  191. package/loader/index.d.ts +24 -0
  192. package/loader/index.es2017.js +5 -0
  193. package/loader/index.js +6 -0
  194. package/loader/package.json +11 -0
  195. package/package.json +61 -0
  196. package/readme.md +104 -0
@@ -0,0 +1,131 @@
1
+ /*!
2
+ * Built by ShiftSoftware
3
+ * Copyright (c)
4
+ */
5
+ import { r as registerInstance, h, H as Host, g as getElement } from './index-ef54644b.js';
6
+ import { g as getVehicleInformation } from './vehicleInformation-f1081f83.js';
7
+ import { c as cn } from './cn-cc419b94.js';
8
+ import { L as Loading } from './Loading-61648252.js';
9
+ import { o as openImageViewer, c as closeImageViewer, e as eyeSvg } from './image-expansion-08c4bf0d.js';
10
+ import './loader-027b88af.js';
11
+
12
+ 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}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.left-0{left:0}.top-0{top:0}.z-40{z-index:40}.z-50{z-index:50}.float-right{float:right}.mx-auto{margin-left:auto;margin-right:auto}.mr-\\[16px\\]{margin-right:16px}.mt-\\[12px\\]{margin-top:12px}.mt-\\[16px\\]{margin-top:16px}.flex{display:flex}.table{display:table}.size-12{height:3rem;width:3rem}.size-full{height:100%;width:100%}.h-0{height:0}.h-1{height:.25rem}.h-\\[100dvh\\]{height:100dvh}.h-\\[40px\\]{height:40px}.h-\\[80px\\]{height:80px}.h-auto{height:auto}.max-h-\\[133px\\]{max-height:133px}.max-h-\\[70dvh\\]{max-height:70dvh}.min-h-\\[100px\\]{min-height:100px}.w-12{width:3rem}.w-\\[100dvw\\]{width:100dvw}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.max-w-\\[133px\\]{max-width:133px}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-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}.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))}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.gap-\\[4px\\]{gap:4px}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[8px\\]{border-radius:8px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.\\!border-none{border-style:none!important}.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-black\\/40{background-color:rgba(0,0,0,.4)}.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-\\[10px\\]{padding-bottom:10px;padding-top:10px}.py-\\[16px\\]{padding-bottom:16px;padding-top:16px}.py-\\[20px\\]{padding-bottom:20px;padding-top:20px}.py-\\[8px\\]{padding-bottom:8px;padding-top:8px}.pt-\\[4px\\]{padding-top:4px}.text-center{text-align:center}.text-\\[18px\\]{font-size:18px}.text-\\[20px\\]{font-size:20px}.font-bold{font-weight:700}.text-\\[\\#383c43\\]{--tw-text-opacity:1;color:rgb(56 60 67/var(--tw-text-opacity,1))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.opacity-0{opacity:0}.opacity-100{opacity:1}.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)}.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-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.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}.duration-300{transition-duration:.3s}.duration-700{transition-duration:.7s}.reject-card{background-color:#f7d7d8;border-color:#f2aeb5;color:#58151c}.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}";
13
+ const VehicleAccessoriesStyle0 = vehicleAccessoriesCss;
14
+
15
+ let mockData = {};
16
+ const VehicleAccessories = class {
17
+ constructor(hostRef) {
18
+ registerInstance(this, hostRef);
19
+ this.closeImageListener = (event) => {
20
+ this.closeImage(event);
21
+ };
22
+ this.openImage = (target, imageSrc) => {
23
+ openImageViewer(this, target, imageSrc);
24
+ };
25
+ this.closeImage = (event) => {
26
+ closeImageViewer(this, event);
27
+ };
28
+ this.baseUrl = '';
29
+ this.isDev = false;
30
+ this.queryString = '';
31
+ this.loadingStateChange = undefined;
32
+ this.loadedResponse = undefined;
33
+ this.state = 'idle';
34
+ this.externalVin = null;
35
+ this.errorMessage = null;
36
+ this.expandedImage = null;
37
+ this.vehicleInformation = undefined;
38
+ }
39
+ handleSettingData(response) {
40
+ if (!response.accessories || !Array.isArray(response.accessories))
41
+ response.accessories = [];
42
+ this.vehicleInformation = response;
43
+ }
44
+ async setData(newData) {
45
+ clearTimeout(this.networkTimeoutRef);
46
+ if (this.abortController)
47
+ this.abortController.abort();
48
+ this.abortController = new AbortController();
49
+ let scopedTimeoutRef;
50
+ const isVinRequest = typeof newData === 'string';
51
+ const vin = isVinRequest ? newData : newData === null || newData === void 0 ? void 0 : newData.vin;
52
+ this.externalVin = vin;
53
+ try {
54
+ if (!vin || vin.trim().length === 0) {
55
+ //this.componentHeight = '0px';
56
+ this.state = 'idle';
57
+ return;
58
+ }
59
+ if (this.state === 'data' || this.state === 'error') {
60
+ this.state = (this.state + '-loading');
61
+ }
62
+ else
63
+ this.state = 'loading';
64
+ await new Promise(r => {
65
+ scopedTimeoutRef = setTimeout(r, 700);
66
+ this.networkTimeoutRef = scopedTimeoutRef;
67
+ });
68
+ const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData }) : newData;
69
+ if (this.networkTimeoutRef === scopedTimeoutRef) {
70
+ if (!vehicleResponse)
71
+ throw new Error('Wrong response format');
72
+ this.handleSettingData(vehicleResponse);
73
+ }
74
+ this.errorMessage = null;
75
+ this.state = 'data';
76
+ }
77
+ catch (error) {
78
+ if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
79
+ return;
80
+ this.state = 'error';
81
+ this.vehicleInformation = null;
82
+ this.errorMessage = error.message;
83
+ }
84
+ }
85
+ async fetchData(requestedVin = this.externalVin) {
86
+ await this.setData(requestedVin);
87
+ }
88
+ //calculateHeight(componentState: string) {
89
+ // if (componentState.includes('loading') && this.componentHeight === '0px') {
90
+ // this.componentHeight = '100px';
91
+ // } else if (componentState !== 'idle') {
92
+ // setTimeout(() => {
93
+ // this.componentHeight = `${this.wrapperRef.clientHeight}px`;
94
+ // }, 50);
95
+ // } else {
96
+ // this.componentHeight = '0px';
97
+ // }
98
+ //}
99
+ async loadingListener() {
100
+ //this.calculateHeight(newState);
101
+ if (this.loadingStateChange)
102
+ this.loadingStateChange(this.state.includes('loading'));
103
+ }
104
+ async setMockData(newMockData) {
105
+ mockData = newMockData;
106
+ }
107
+ render() {
108
+ var _a, _b;
109
+ const accessories = (this === null || this === void 0 ? void 0 : this.vehicleInformation) ? (_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.accessories : [];
110
+ return (h(Host, { key: '37762a5db052f532c697bb8442cc4ba3c6cf4068' }, h("div", { key: '2dc64881477dc8948a35c120255a37476f4476ab', class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, h("div", { key: '31ec8d8d61838d2932401ce9fcf43cb2602865d0' }, h(Loading, { key: '144ffe00641e5b7325a9d6d5794d6ec46db3943d', isLoading: this.state.includes('loading') }), h("div", { key: '015d6a3b491612e038b6fecc501f3a97eb74984b', class: cn('transition-all duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, h("div", { key: 'bf9bb4858401dc551fb6dd80792f9ebae8f2116d', 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: '647c4b2ae83cf076f6abb5a693b58883eccea2f6', class: "py-[16px]" }, h("div", { key: 'fb00fc12a5247809212c54bfc656e12079a8277c', 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: '3d049da77eac32bf3064f46d38d2e869531acc99', class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, h("div", { key: '4212b8aeb910f96d3d5c0a7485629efd29f8a0e0', 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: '98b7d10413870e3e2e61fb3f9749ec00b4a117c5', class: "h-0 overflow-auto flex-1" }, !accessories.length && h("div", { key: '478659190641f3bd10a66697bb55b18adf8bd2f9', class: "h-[80px] flex items-center justify-center text-[18px]" }, "No data is available."), !!accessories.length && (h("table", { key: 'ab44323dda807276272dc900dd9e9c3c1482a75f', class: "w-full overflow-auto relative border-collapse" }, h("thead", { key: 'e43c0538bdb9b162b9e5ab00fb4032463bc47118', class: "top-0 font-bold z-40 sticky bg-white" }, h("tr", { key: 'b133f2fc56118b78fa7a8016245a405b4437fc76' }, ['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: '87bec24b165b4928cd36751bf7237016133f145e' }, accessories.map((accessory, idx) => {
111
+ var _a;
112
+ return (h("tr", { class: "transition-colors duration-100 hover:bg-slate-100", key: accessory.partNumber }, ['partNumber', 'description'].map(key => {
113
+ var _a;
114
+ return (h("td", { key: accessory.partNumber + key, class: cn('px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]', {
115
+ '!border-none': idx === ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceHistory.length) - 1,
116
+ }) }, accessory[key] || '...'));
117
+ }), h("td", { class: cn('px-[10px] py-[10px] text-center whitespace-nowrap border-b border-[#d6d8dc]', {
118
+ '!border-none': idx === ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceHistory.length) - 1,
119
+ }) }, 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 })))));
120
+ })), h("div", { key: '2f132b70d008c91456c604cd6bd5d34b59626151', 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', {
121
+ 'pointer-events-auto opacity-100 delay-200': this.expandedImage,
122
+ }) }, h("button", { key: '1007182cd1ce49a92c134c8d90998f4fb601fdad', class: "flex flex-col mt-[16px] items-center justify-center size-12 float-right mr-[16px]", onClick: () => this.closeImage() }, h("div", { key: 'c76af11f89e4735fa919167138093dc00eba7841', class: "h-1 w-12 rounded-full rotate-45 absolute bg-white" }), h("div", { key: 'c312b71d24988ae6f6ec1a5dfffc5a2d79e07660', class: "h-1 w-12 rounded-full -rotate-45 absolute bg-white" }))), h("img", { key: 'e14cb22e566105d7b977ed191ddd63174b24e54a', alt: "", id: "expanded-image", class: "fixed opacity-0 z-50 transition-all rounded-lg" })))))))))));
123
+ }
124
+ get el() { return getElement(this); }
125
+ static get watchers() { return {
126
+ "state": ["loadingListener"]
127
+ }; }
128
+ };
129
+ VehicleAccessories.style = VehicleAccessoriesStyle0;
130
+
131
+ export { VehicleAccessories as vehicle_accessories };
@@ -0,0 +1,107 @@
1
+ /*!
2
+ * Built by ShiftSoftware
3
+ * Copyright (c)
4
+ */
5
+ import { r as registerInstance, h, H as Host, g as getElement } from './index-ef54644b.js';
6
+ import { L as Loading } from './Loading-61648252.js';
7
+ import { c as cn } from './cn-cc419b94.js';
8
+ import { g as getVehicleInformation } from './vehicleInformation-f1081f83.js';
9
+ import './loader-027b88af.js';
10
+
11
+ 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}.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}.w-full{width:100%}.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}.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}";
12
+ const VehicleSpecificationStyle0 = vehicleSpecificationCss;
13
+
14
+ let mockData = {};
15
+ const VehicleSpecification = class {
16
+ constructor(hostRef) {
17
+ registerInstance(this, hostRef);
18
+ this.baseUrl = '';
19
+ this.isDev = false;
20
+ this.queryString = '';
21
+ this.loadingStateChange = undefined;
22
+ this.loadedResponse = undefined;
23
+ this.state = 'idle';
24
+ this.externalVin = null;
25
+ this.errorMessage = null;
26
+ this.vehicleInformation = undefined;
27
+ }
28
+ async setData(newData) {
29
+ clearTimeout(this.networkTimeoutRef);
30
+ if (this.abortController)
31
+ this.abortController.abort();
32
+ this.abortController = new AbortController();
33
+ let scopedTimeoutRef;
34
+ const isVinRequest = typeof newData === 'string';
35
+ const vin = isVinRequest ? newData : newData === null || newData === void 0 ? void 0 : newData.vin;
36
+ this.externalVin = vin;
37
+ try {
38
+ if (!vin || vin.trim().length === 0) {
39
+ //this.componentHeight = '0px';
40
+ this.state = 'idle';
41
+ return;
42
+ }
43
+ if (this.state === 'data' || this.state === 'error') {
44
+ this.state = (this.state + '-loading');
45
+ }
46
+ else
47
+ this.state = 'loading';
48
+ await new Promise(r => {
49
+ scopedTimeoutRef = setTimeout(r, 700);
50
+ this.networkTimeoutRef = scopedTimeoutRef;
51
+ });
52
+ const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData }) : newData;
53
+ if (this.networkTimeoutRef === scopedTimeoutRef) {
54
+ if (!vehicleResponse)
55
+ throw new Error('Wrong response format');
56
+ this.vehicleInformation = vehicleResponse;
57
+ }
58
+ this.errorMessage = null;
59
+ this.state = 'data';
60
+ }
61
+ catch (error) {
62
+ if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
63
+ return;
64
+ this.state = 'error';
65
+ this.vehicleInformation = null;
66
+ this.errorMessage = error.message;
67
+ }
68
+ }
69
+ async fetchData(requestedVin = this.externalVin) {
70
+ await this.setData(requestedVin);
71
+ }
72
+ //calculateHeight(componentState: string) {
73
+ // if (componentState.includes('loading') && this.componentHeight === '0px') {
74
+ // this.componentHeight = '100px';
75
+ // } else if (componentState !== 'idle') {
76
+ // setTimeout(() => {
77
+ // this.componentHeight = `${this.wrapperRef.clientHeight}px`;
78
+ // }, 50);
79
+ // } else {
80
+ // this.componentHeight = '0px';
81
+ // }
82
+ //}
83
+ async loadingListener() {
84
+ //this.calculateHeight(newState);
85
+ if (this.loadingStateChange)
86
+ this.loadingStateChange(this.state.includes('loading'));
87
+ }
88
+ async setMockData(newMockData) {
89
+ mockData = newMockData;
90
+ }
91
+ render() {
92
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
93
+ return (h(Host, { key: 'c3226e500c814d9a0a471bafaaddc1d472cc801b' }, h("div", { key: '9bae679376567109beedf83d8717a6a1592db545', class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, h("div", { key: '2c779d68d7f0cb59a8e593c4e98274aac4d75cd6' }, h(Loading, { key: 'b485ab8d8f56e1e2c983880ef167ebf287f82313', isLoading: this.state.includes('loading') }), h("div", { key: '62f31f43fa3bc2cba6d4e50637ced77565a8d77d', class: cn('transition-all duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, h("div", { key: '8a55f5cb8e187eee0fe5f7127fb8969ec356fb9d', 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: '27154f476b6e7644d8efe0e9c9361b80b5fbd8e3', class: "py-4" }, h("div", { key: '47b9dbfa0cda5b174533462cca3a43318b8f0a83', 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: '7b9accc6c8b567f139c79a6d99f4d5b7619c4648', class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, h("div", { key: 'c9be064f1916c47788aaaa9fa06438d4ea91befa', 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: '72a8a9d92a28f01e8c28da0ce7af9e41ee463844', class: "h-0 overflow-auto flex-1" }, !((_b = this.vehicleInformation) === null || _b === void 0 ? void 0 : _b.vehicleSpecification) && h("div", { key: '37d13e85758052df6d04cb32f133a056cad6c9b3', 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: 'd83e8aa7d3f07731b790c1d49b7e25491a1456e7', class: "w-full overflow-auto relative border-collapse" }, h("thead", { key: '9ef18b80c3530ddc36b7fe0254183d6aecedc368', class: "top-0 font-bold sticky bg-white" }, h("tr", { key: '2d4fbe31a35e1879c00e8929eb7b0fec0a7aa3fa' }, ['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: '5d00ede02f2d39afca384c1f595bb02face893e0' }, h("tr", { key: '7f833ffbb80982b4ecd1577bdcba412a02fe3f9e' }, h("td", { key: '26902ab5dd74303aa1ca9b066e6518244e7b78a3', 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: '53a6142f257d4a17f53ffc6db4d22139b6cd590b', 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: 'e5b903f69a43c47866d23583570060126fb48b2a', 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: '6245cf13d3d9770280507a6753bf6e8c77cc1e71' }), ((_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 => {
94
+ var _a;
95
+ const [place, field] = infoPath.split('.');
96
+ const cellValue = (_a = this === null || this === void 0 ? void 0 : this.vehicleInformation) === null || _a === void 0 ? void 0 : _a[place][field].toString();
97
+ return (h("td", { key: infoPath, class: cn('px-[10px] py-[20px] text-center whitespace-nowrap') }, cellValue.trim() ? cellValue : '...'));
98
+ })))))))))))));
99
+ }
100
+ get el() { return getElement(this); }
101
+ static get watchers() { return {
102
+ "state": ["loadingListener"]
103
+ }; }
104
+ };
105
+ VehicleSpecification.style = VehicleSpecificationStyle0;
106
+
107
+ export { VehicleSpecification as vehicle_specification };
@@ -0,0 +1,50 @@
1
+ /*!
2
+ * Built by ShiftSoftware
3
+ * Copyright (c)
4
+ */
5
+ const vehicleRequestHeaders = {
6
+ cityId: 'City-Id',
7
+ userId: 'User-Id',
8
+ companyId: 'Company-Id',
9
+ customerName: 'Customer-Name',
10
+ customerPhone: 'Customer-Phone',
11
+ customerEmail: 'Customer-Email',
12
+ companyBranchId: 'Company-Branch-Id',
13
+ cityIntegrationId: 'City-Integration-Id',
14
+ brandIntegrationId: 'Brand-Integration-Id',
15
+ companyIntegrationId: 'Company-Integration-Id',
16
+ companyBranchIntegrationId: 'Company-Branch-Integration-Id',
17
+ };
18
+ const getVehicleInformation = async (component, generalProps) => {
19
+ const { notAvailableMessage, mockData, vin, scopedTimeoutRef, middlewareCallback } = generalProps;
20
+ const { isDev, baseUrl, queryString, abortController, networkTimeoutRef, loadedResponse } = component;
21
+ const handleResult = (newVehicleInformation) => {
22
+ if (networkTimeoutRef === scopedTimeoutRef) {
23
+ if (!newVehicleInformation && vin)
24
+ throw new Error(notAvailableMessage || 'Wrong response format');
25
+ if (loadedResponse)
26
+ loadedResponse(newVehicleInformation);
27
+ if (middlewareCallback)
28
+ middlewareCallback(newVehicleInformation);
29
+ return newVehicleInformation;
30
+ }
31
+ };
32
+ if (isDev) {
33
+ const newData = mockData[vin];
34
+ return handleResult(newData);
35
+ }
36
+ else {
37
+ if (!baseUrl)
38
+ throw new Error('Please provide base-url');
39
+ const headers = {};
40
+ Object.entries(vehicleRequestHeaders).forEach(([componentHeaderKey, headerField]) => {
41
+ if (component[componentHeaderKey])
42
+ headers[headerField] = component[componentHeaderKey];
43
+ });
44
+ const response = await fetch(`${baseUrl}${vin}?${queryString}`, { signal: abortController.signal, headers: headers });
45
+ const newData = (await response.json());
46
+ return handleResult(newData);
47
+ }
48
+ };
49
+
50
+ export { getVehicleInformation as g };
@@ -0,0 +1,277 @@
1
+ /*!
2
+ * Built by ShiftSoftware
3
+ * Copyright (c)
4
+ */
5
+ import { h, r as registerInstance, H as Host, g as getElement } from './index-ef54644b.js';
6
+ import { c as cn } from './cn-cc419b94.js';
7
+ import { l as loaderSvg$1 } from './loader-027b88af.js';
8
+ import { g as getVehicleInformation } from './vehicleInformation-f1081f83.js';
9
+
10
+ const loaderSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIKICAgIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBjbGFzcz0ibHVjaWRlIGx1Y2lkZS1sb2FkZXIiPgogICAgPHBhdGggZD0iTTEyIDJ2NCIgLz4KICAgIDxwYXRoIGQ9Im0xNi4yIDcuOCAyLjktMi45IiAvPgogICAgPHBhdGggZD0iTTE4IDEyaDQiIC8+CiAgICA8cGF0aCBkPSJtMTYuMiAxNi4yIDIuOSAyLjkiIC8+CiAgICA8cGF0aCBkPSJNMTIgMTh2NCIgLz4KICAgIDxwYXRoIGQ9Im00LjkgMTkuMSAyLjktMi45IiAvPgogICAgPHBhdGggZD0iTTIgMTJoNCIgLz4KICAgIDxwYXRoIGQ9Im00LjkgNC45IDIuOSAyLjkiIC8+Cjwvc3ZnPg==';
11
+
12
+ function Loading({ isLoading }) {
13
+ return (h("div", { class: cn('loading-spinner absolute', { hide: !isLoading }) },
14
+ h("img", { class: "spin", src: loaderSvg })));
15
+ }
16
+
17
+ const checkSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj4KICAgIDxwYXRoIGZpbGw9IiMwYjM1MjEiCiAgICAgICAgZD0iTTI1NiA1MTJBMjU2IDI1NiAwIDEgMCAyNTYgMGEyNTYgMjU2IDAgMSAwIDAgNTEyek0zNjkgMjA5TDI0MSAzMzdjLTkuNCA5LjQtMjQuNiA5LjQtMzMuOSAwbC02NC02NGMtOS40LTkuNC05LjQtMjQuNiAwLTMzLjlzMjQuNi05LjQgMzMuOSAwbDQ3IDQ3TDMzNSAxNzVjOS40LTkuNCAyNC42LTkuNCAzMy45IDBzOS40IDI0LjYgMCAzMy45eiIgLz4KPC9zdmc+';
18
+
19
+ const xMarkSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj4KICAgIDxwYXRoIGZpbGw9IiM1ODE1MWMiCiAgICAgICAgZD0iTTI1NiA1MTJBMjU2IDI1NiAwIDEgMCAyNTYgMGEyNTYgMjU2IDAgMSAwIDAgNTEyek0xNzUgMTc1YzkuNC05LjQgMjQuNi05LjQgMzMuOSAwbDQ3IDQ3IDQ3LTQ3YzkuNC05LjQgMjQuNi05LjQgMzMuOSAwczkuNCAyNC42IDAgMzMuOWwtNDcgNDcgNDcgNDdjOS40IDkuNCA5LjQgMjQuNiAwIDMzLjlzLTI0LjYgOS40LTMzLjkgMGwtNDctNDctNDcgNDdjLTkuNCA5LjQtMjQuNiA5LjQtMzMuOSAwcy05LjQtMjQuNiAwLTMzLjlsNDctNDctNDctNDdjLTkuNC05LjQtOS40LTI0LjYgMC0zMy45eiIgLz4KPC9zdmc+';
20
+
21
+ function StatusCard({ desc, className, from, to, state = 'idle', icon = true }) {
22
+ return (h("div", { class: cn('card', className, `${state}-card`) },
23
+ icon && state === 'reject' && h("img", { src: xMarkSvg }),
24
+ icon && state === 'warning' && h("img", { src: xMarkSvg }),
25
+ icon && state === 'success' && h("img", { src: checkSvg }),
26
+ from && (h("p", { class: "no-padding" },
27
+ h("span", { class: "font-semibold pr-1" }, "From:"),
28
+ " ",
29
+ desc)),
30
+ to && (h("p", { class: "no-padding" },
31
+ h("span", { class: "font-semibold pr-1" }, "To:"),
32
+ " ",
33
+ desc)),
34
+ !from && !to && h("p", { class: state === 'idle' ? 'no-padding' : '' }, desc)));
35
+ }
36
+
37
+ function CardsContainer({ warranty, isAuthorized, unInvoicedByBrokerName }) {
38
+ return (h("div", { class: "warranty-tags mx-auto pt-3" },
39
+ h(StatusCard, { state: isAuthorized ? 'success' : 'reject', desc: isAuthorized ? 'Authorized' : 'Unauthorized' }),
40
+ h(StatusCard, { state: warranty.hasActiveWarranty ? 'success' : 'reject', desc: warranty.hasActiveWarranty ? 'Has Active Warranty' : "Doesn't Have Active Warranty" }),
41
+ 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}` }),
42
+ warranty.warrantyStartDate && h(StatusCard, { state: (warranty === null || warranty === void 0 ? void 0 : warranty.hasActiveWarranty) ? 'success' : 'reject', icon: false, from: true, desc: warranty.warrantyStartDate }),
43
+ warranty.warrantyEndDate && h(StatusCard, { state: (warranty === null || warranty === void 0 ? void 0 : warranty.hasActiveWarranty) ? 'success' : 'reject', icon: false, to: true, desc: warranty.warrantyEndDate })));
44
+ }
45
+
46
+ function SSCTable({ ssc }) {
47
+ return (h("div", { class: "wrapper-table" },
48
+ h("div", { class: "header" }, "SSC Campings"),
49
+ h("div", { class: "ssc-table-container" },
50
+ h("table", { class: "ssc-table" },
51
+ h("thead", null,
52
+ h("tr", null,
53
+ h("th", null, "Code"),
54
+ h("th", null, "Description"),
55
+ h("th", null, "Repair Status"),
56
+ h("th", null, "OP-Codes"),
57
+ h("th", null, "Part Number"))),
58
+ h("tbody", null, ssc.map(sscItem => (h("tr", { class: "transition", key: sscItem.sscCode },
59
+ h("td", null, sscItem.sscCode),
60
+ h("td", null, sscItem.description),
61
+ h("td", null,
62
+ h("div", { class: "table-cell-container" },
63
+ h("img", { class: "table-status-icon", src: sscItem.repaired ? checkSvg : xMarkSvg }),
64
+ " ", sscItem === null || sscItem === void 0 ? void 0 :
65
+ sscItem.repairDate)),
66
+ h("td", null, sscItem.opCode),
67
+ h("td", null,
68
+ h("div", { class: "table-cell-container table-cell-parts-container" }, !!sscItem.parts.length
69
+ ? sscItem.parts.map(part => (h("div", { key: part.partNumber, class: part.isAvailable ? 'success' : 'reject' }, part.partNumber)))
70
+ : '...'))))))))));
71
+ }
72
+
73
+ 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;height:0!important}.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}.min-h-\\[100px\\]{min-height:100px}.py-4{padding-bottom:1rem;padding-top:1rem}.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)}";
74
+ const WarrantyDetailsStyle0 = warrantyDetailsCss;
75
+
76
+ let mockData = {};
77
+ const WarrantyDetails = class {
78
+ constructor(hostRef) {
79
+ registerInstance(this, hostRef);
80
+ this.baseUrl = '';
81
+ this.unauthorizedSscLookupBaseUrl = '';
82
+ this.isDev = false;
83
+ this.showSsc = false;
84
+ this.queryString = '';
85
+ this.unauthorizedSscLookupQueryString = '';
86
+ this.recaptchaKey = '';
87
+ this.showWarranty = false;
88
+ this.cityId = null;
89
+ this.cityIntegrationId = null;
90
+ this.companyId = null;
91
+ this.companyIntegrationId = null;
92
+ this.companyBranchId = null;
93
+ this.companyBranchIntegrationId = null;
94
+ this.userId = null;
95
+ this.brandIntegrationId = null;
96
+ this.customerName = null;
97
+ this.customerPhone = null;
98
+ this.customerEmail = null;
99
+ this.loadingStateChange = undefined;
100
+ this.loadedResponse = undefined;
101
+ this.state = 'idle';
102
+ this.externalVin = null;
103
+ this.errorMessage = null;
104
+ this.showRecaptcha = false;
105
+ this.unInvoicedByBrokerName = null;
106
+ this.vehicleInformation = undefined;
107
+ this.checkingUnauthorizedSSC = false;
108
+ this.recaptchaRes = null;
109
+ }
110
+ handleSettingData(response) {
111
+ var _a, _b, _c;
112
+ if (response.warranty === null)
113
+ response.warranty = {
114
+ warrantyEndDate: '',
115
+ warrantyStartDate: '',
116
+ hasActiveWarranty: false,
117
+ hasExtendedWarranty: false,
118
+ extendedWarrantyEndDate: '',
119
+ extendedWarrantyStartDate: '',
120
+ };
121
+ if (response.ssc === null)
122
+ response.ssc = [];
123
+ this.unInvoicedByBrokerName = null;
124
+ 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)
125
+ this.unInvoicedByBrokerName = response.saleInformation.broker.brokerName;
126
+ this.vehicleInformation = response;
127
+ }
128
+ async handleInitializingRecaptcha(vin, scopedTimeoutRef) {
129
+ var _a;
130
+ if (((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.isAuthorized) === false && this.showSsc && this.recaptchaKey !== '') {
131
+ grecaptcha.reset();
132
+ await new Promise(r => setTimeout(r, 400));
133
+ this.recaptchaIntervalRef = setInterval(async () => {
134
+ var _a;
135
+ const recaptchaResponse = grecaptcha.getResponse();
136
+ if (recaptchaResponse) {
137
+ clearInterval(this.recaptchaIntervalRef);
138
+ if (this.isDev) {
139
+ this.checkingUnauthorizedSSC = true;
140
+ this.showRecaptcha = false;
141
+ //this.calculateHeight(this.state);
142
+ await new Promise(r => setTimeout(r, 3000));
143
+ this.checkingUnauthorizedSSC = false;
144
+ const hasPendingSSC = Math.random() < 0.5 ? false : true;
145
+ this.recaptchaRes = {
146
+ hasSSC: hasPendingSSC,
147
+ message: hasPendingSSC ? 'This Vehicle has a Pending SSC' : 'No Pending SSC',
148
+ };
149
+ //this.calculateHeight(this.state);
150
+ }
151
+ else {
152
+ this.checkingUnauthorizedSSC = true;
153
+ this.showRecaptcha = false;
154
+ //this.calculateHeight(this.state);
155
+ const response = await fetch(`${this.unauthorizedSscLookupBaseUrl}${vin}/${(_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.sscLogId}?${this.unauthorizedSscLookupQueryString}`, {
156
+ signal: this.abortController.signal,
157
+ headers: {
158
+ 'Ssc-Recaptcha-Token': recaptchaResponse,
159
+ },
160
+ });
161
+ const vinResponse = await response.json();
162
+ if (vinResponse && this.networkTimeoutRef === scopedTimeoutRef) {
163
+ this.checkingUnauthorizedSSC = false;
164
+ const hasPendingSSC = vinResponse.sscLookupStatus === 1;
165
+ this.recaptchaRes = {
166
+ hasSSC: hasPendingSSC,
167
+ message: hasPendingSSC ? 'This Vehicle has a Pending SSC' : 'No Pending SSC',
168
+ };
169
+ //this.calculateHeight(this.state);
170
+ }
171
+ else
172
+ throw new Error('Wrong response format');
173
+ }
174
+ }
175
+ }, 500);
176
+ this.showRecaptcha = true;
177
+ }
178
+ else {
179
+ this.showRecaptcha = false;
180
+ }
181
+ }
182
+ async setData(newData) {
183
+ this.recaptchaRes = null;
184
+ clearTimeout(this.networkTimeoutRef);
185
+ clearInterval(this.recaptchaIntervalRef);
186
+ if (this.abortController)
187
+ this.abortController.abort();
188
+ this.abortController = new AbortController();
189
+ let scopedTimeoutRef;
190
+ const isVinRequest = typeof newData === 'string';
191
+ const vin = isVinRequest ? newData : newData === null || newData === void 0 ? void 0 : newData.vin;
192
+ this.externalVin = vin;
193
+ try {
194
+ if (!vin || vin.trim().length === 0) {
195
+ //this.componentHeight = '0px';
196
+ this.state = 'idle';
197
+ return;
198
+ }
199
+ if (this.state === 'data' || this.state === 'error') {
200
+ this.state = (this.state + '-loading');
201
+ }
202
+ else
203
+ this.state = 'loading';
204
+ await new Promise(r => {
205
+ scopedTimeoutRef = setTimeout(r, 600);
206
+ this.networkTimeoutRef = scopedTimeoutRef;
207
+ });
208
+ const vehicleResponse = isVinRequest ? await getVehicleInformation(this, { scopedTimeoutRef, vin, mockData }) : newData;
209
+ if (this.networkTimeoutRef === scopedTimeoutRef) {
210
+ if (!vehicleResponse)
211
+ throw new Error('Wrong response format');
212
+ this.handleSettingData(vehicleResponse);
213
+ this.handleInitializingRecaptcha(vin, scopedTimeoutRef);
214
+ }
215
+ this.errorMessage = null;
216
+ this.state = 'data';
217
+ }
218
+ catch (error) {
219
+ if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
220
+ return;
221
+ this.state = 'error';
222
+ this.vehicleInformation = null;
223
+ this.errorMessage = error.message;
224
+ }
225
+ }
226
+ async fetchData(requestedVin = this.externalVin) {
227
+ await this.setData(requestedVin);
228
+ }
229
+ async componentDidLoad() {
230
+ if (this.recaptchaKey !== '') {
231
+ const script = document.createElement('script');
232
+ script.src = 'https://www.google.com/recaptcha/api.js';
233
+ script.async = true;
234
+ script.defer = true;
235
+ script.onload = () => console.log('reCAPTCHA script loaded');
236
+ document.head.appendChild(script);
237
+ }
238
+ }
239
+ //calculateHeight(componentState: string) {
240
+ // if (componentState.includes('loading') && this.componentHeight === '0px') {
241
+ // this.componentHeight = '100px';
242
+ // } else if (componentState !== 'idle') {
243
+ // setTimeout(() => {
244
+ // this.componentHeight = `${this.wrapperRef.clientHeight}px`;
245
+ // }, 50);
246
+ // } else {
247
+ // this.componentHeight = '0px';
248
+ // }
249
+ //}
250
+ async setMockData(newMockData) {
251
+ mockData = newMockData;
252
+ }
253
+ onShowSscChange() {
254
+ //this.calculateHeight(this.state);
255
+ }
256
+ onShowWarrantyChange() {
257
+ //this.calculateHeight(this.state);
258
+ }
259
+ async loadingListener() {
260
+ //this.calculateHeight(newState);
261
+ if (this.loadingStateChange)
262
+ this.loadingStateChange(this.state.includes('loading'));
263
+ }
264
+ render() {
265
+ var _a, _b, _c, _d, _e;
266
+ return (h(Host, { key: '9f7b4391eb2ac41ecb6b620adb733d06cad61e01' }, h("div", { key: 'a120fa5f7b7ec6b586ae1553ddd5f1270b4bafdf', class: "min-h-[100px] warranty" }, h("div", { key: 'a3e41d8aad2f04cd6f0fc7cc0ce952ec80eb67e9' }, h(Loading, { key: '548ba51ad8f41ebba0d4591f22294c4a0ceeddca', isLoading: this.state.includes('loading') }), h("div", { key: 'fa06505b9ad363d070e98c384ca08be6fab23e3a', 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: 'dd5cae430e26d6b99de558414bc54ae61037b6ee', 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: '2aa3678b9daedb664cb83908bab1a3ae79d26ca4', class: "py-4" }, h(StatusCard, { key: '9fb71c4271b607184140207e737f9db6955446a1', desc: this.errorMessage, className: "mx-auto reject-card max-w-500" }), ' ')), this.showWarranty && ['data', 'data-loading'].includes(this.state) && (h(CardsContainer, { key: 'd14715477bfd2a7a07ed203794cdd90bf3dc7f77', 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: '7d24f6ed652cfd6e23ff88471a8c134810909522', style: Object.assign({}, (this.showRecaptcha ? { height: 'auto', padding: '16px 16px 0px 16px' } : { height: '0px' })), class: "recaptcha-container" }, h("slot", { key: '09944b5683a9c564bba4a7bf7b02bf45578b1a01' })), ['data', 'data-loading'].includes(this.state) && this.recaptchaRes && (h("div", { key: '3503fc5ab15f118a4614f0aa4a0cbc98dffd341b', class: cn('recaptcha-response', !this.recaptchaRes.hasSSC ? 'success-card' : 'reject-card ') }, this.recaptchaRes.message)), this.checkingUnauthorizedSSC && (h("div", { key: '2d307b6517e8734a86b366d24550870d141559f5', class: "loading-spinner", style: { marginTop: '20px', flexDirection: 'column' } }, h("div", { key: '3ce58c58e769399b08909d24b49dfb16020beaa4' }, h("strong", { key: '7a09f45c291d5561410116ffb6cfb4de417c51ce' }, "Checking TMC")), h("img", { key: '6ff6d07a3834f1f02d1a54d2d45cfff712d8ec53', 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: 'f67095d616937712e31ed0421811f1cf3c7982ed', ssc: this.vehicleInformation.ssc })))))));
267
+ }
268
+ get el() { return getElement(this); }
269
+ static get watchers() { return {
270
+ "showSsc": ["onShowSscChange"],
271
+ "showWarranty": ["onShowWarrantyChange"],
272
+ "state": ["loadingListener"]
273
+ }; }
274
+ };
275
+ WarrantyDetails.style = WarrantyDetailsStyle0;
276
+
277
+ export { WarrantyDetails as warranty_details };
@@ -0,0 +1 @@
1
+ module.exports = require('./cjs/index.cjs.js');
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ export * from './esm/index.js';
@@ -0,0 +1,4 @@
1
+ /*!
2
+ * Built by ShiftSoftware
3
+ * Copyright (c)
4
+ */