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,103 @@
1
+ /*!
2
+ * Built by ShiftSoftware
3
+ * Copyright (c)
4
+ */
5
+ 'use strict';
6
+
7
+ Object.defineProperty(exports, '__esModule', { value: true });
8
+
9
+ const index = require('./index-d4b5214c.js');
10
+ const partInformation = require('./partInformation-2a6a018b.js');
11
+ const Loading = require('./Loading-ee1a2ceb.js');
12
+ const cn = require('./cn-f559f9e5.js');
13
+ require('./loader-baf2418b.js');
14
+
15
+ const deadStockLookupCss = "*,: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}.flex{display:flex}.hidden{display:none}.max-h-screen{max-height:100vh}.rotate-180{--tw-rotate:180deg}.rotate-180,.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)}:host{all:initial!important;display:block}*{font-family:Arial}.accordion-item{border-bottom:1px solid #e2e8f0}.accordion-header{align-items:center;cursor:pointer;display:flex;justify-content:space-between;width:100%}.accordion-content{max-height:0;overflow:hidden;transition:max-height .3s ease-in-out}.accordion-content.max-h-screen{max-height:1000px}.icon{transition:transform .3s ease-in-out}.icon.rotate-180{transform:rotate(180deg)}.static{position:static}.relative{position:relative}.mx-auto{margin-left:auto;margin-right:auto}.mt-\\[12px\\]{margin-top:12px}.table{display:table}.h-4{height:1rem}.h-\\[40px\\]{height:40px}.max-h-0{max-height:0}.max-h-\\[70dvh\\]{max-height:70dvh}.min-h-\\[100px\\]{min-height:100px}.w-4{width:1rem}.w-fit{width:fit-content}.w-full{width:100%}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.rotate-180,.scale-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))}.scale-0{--tw-scale-x:0;--tw-scale-y:0}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.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))}.border-slate-200{--tw-border-opacity:1;border-color:rgb(226 232 240/var(--tw-border-opacity,1))}.bg-\\[\\#e1e3e5\\]{--tw-bg-opacity:1;background-color:rgb(225 227 229/var(--tw-bg-opacity,1))}.px-\\[10px\\]{padding-left:10px;padding-right:10px}.px-\\[16px\\]{padding-left:16px;padding-right:16px}.py-5{padding-bottom:1.25rem;padding-top:1.25rem}.py-\\[16px\\]{padding-bottom:16px;padding-top:16px}.py-\\[20px\\]{padding-bottom:20px;padding-top:20px}.py-\\[8px\\]{padding-bottom:8px;padding-top:8px}.text-left{text-align:left}.text-center{text-align:center}.text-\\[18px\\]{font-size:18px}.text-\\[20px\\]{font-size:20px}.text-\\[\\#383c43\\]{--tw-text-opacity:1;color:rgb(56 60 67/var(--tw-text-opacity,1))}.text-slate-800{--tw-text-opacity:1;color:rgb(30 41 59/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)}.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)}.transition-transform{transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-100{transition-duration:.1s}.duration-300{transition-duration:.3s}.duration-700{transition-duration:.7s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.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))}.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}";
16
+ const DeadStockLookupStyle0 = deadStockLookupCss;
17
+
18
+ let mockData = {};
19
+ const DeadStockLookup = class {
20
+ constructor(hostRef) {
21
+ index.registerInstance(this, hostRef);
22
+ this.isDev = false;
23
+ this.baseUrl = '';
24
+ this.queryString = '';
25
+ this.loadingStateChange = undefined;
26
+ this.loadedResponse = undefined;
27
+ this.state = 'idle';
28
+ this.externalPartNumber = null;
29
+ this.errorMessage = null;
30
+ this.partInformation = undefined;
31
+ this.activeIndex = null;
32
+ }
33
+ handleSettingData(response) {
34
+ this.partInformation = response;
35
+ }
36
+ toggleAccordion(index) {
37
+ this.activeIndex = this.activeIndex === index ? null : index;
38
+ }
39
+ async setData(newData) {
40
+ clearTimeout(this.networkTimeoutRef);
41
+ if (this.abortController)
42
+ this.abortController.abort();
43
+ this.abortController = new AbortController();
44
+ let scopedTimeoutRef;
45
+ const isPartNumberRequest = typeof newData === 'string';
46
+ const partNumber = isPartNumberRequest ? newData : newData === null || newData === void 0 ? void 0 : newData.partNumber;
47
+ this.externalPartNumber = partNumber;
48
+ try {
49
+ if (!partNumber || partNumber.trim().length === 0) {
50
+ //this.componentHeight = '0px';
51
+ this.state = 'idle';
52
+ return;
53
+ }
54
+ if (this.state === 'data' || this.state === 'error') {
55
+ this.state = (this.state + '-loading');
56
+ }
57
+ else
58
+ this.state = 'loading';
59
+ await new Promise(r => {
60
+ scopedTimeoutRef = setTimeout(r, 700);
61
+ this.networkTimeoutRef = scopedTimeoutRef;
62
+ });
63
+ const partResponse = isPartNumberRequest ? await partInformation.getPartInformation(this, { scopedTimeoutRef, partNumber, mockData }) : newData;
64
+ if (this.networkTimeoutRef === scopedTimeoutRef) {
65
+ if (!partResponse)
66
+ throw new Error('Wrong response format');
67
+ this.handleSettingData(partResponse);
68
+ }
69
+ this.errorMessage = null;
70
+ this.state = 'data';
71
+ }
72
+ catch (error) {
73
+ if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
74
+ return;
75
+ this.state = 'error';
76
+ this.partInformation = null;
77
+ this.errorMessage = error.message;
78
+ }
79
+ }
80
+ async fetchData(requestedVin = this.externalPartNumber) {
81
+ await this.setData(requestedVin);
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;
93
+ return (index.h(index.Host, { key: '7c1fd5523f284234ac9aa44b3f4963e411b48af1' }, index.h("div", { key: '8fe334240d09636c0ee9ca73b89405a7617a415d', class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, index.h("div", { key: 'b72e6fd1785d5ec11ba443146aa8ad5fade7d5f2' }, index.h(Loading.Loading, { key: '4160190f5427f8cb4475a7d2601c94ddbbfa1f6b', isLoading: this.state.includes('loading') }), index.h("div", { key: 'f4124cf06ed01d32bc32980db867722f227960ac', class: cn.cn('transition-all duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, ['error', 'error-loading'].includes(this.state) && (index.h("div", { key: 'f867f876e0fd07f4353c117606ca48a8ad27575d', class: "py-[16px]" }, index.h("div", { key: 'd8e23636133a75fc4f3099d17c0852b3c9070589', class: " px-[16px] py-[8px] border reject-card text-[20px] rounded-[8px] w-fit mx-auto" }, this.errorMessage))), ['data', 'data-loading'].includes(this.state) && (index.h("div", { key: '4599e737df0ed2afaa963e43334f38761c32db0a' }, index.h("div", { key: '81096a35529e599c554a5ac5b0aa174294c6f7cc', class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, index.h("div", { key: '1666930fe03143aa2b70d4b557f79c393db81ec9', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, "Deadstock"), (_b = (_a = this.partInformation) === null || _a === void 0 ? void 0 : _a.deadStock) === null || _b === void 0 ? void 0 :
94
+ _b.map((deadStock, i) => (index.h("div", { style: { padding: '10px 20px' } }, index.h("div", { class: "accordion-item border-b border-slate-200", style: { boxShadow: 'rgb(225 225 225) 0px 0px 4px 1px', borderRadius: '5px', padding: '0 10px', marginBottom: '10px' }, key: deadStock.companyIntegrationID }, index.h("button", { class: "accordion-header w-full flex justify-between items-center py-5 text-slate-800", onClick: () => this.toggleAccordion(i) }, index.h("strong", null, deadStock.companyName), index.h("span", { class: `icon text-slate-800 transition-transform duration-300 ${this.activeIndex === i ? 'rotate-180' : ''}` }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 16 16", fill: "currentColor", class: "w-4 h-4" }, index.h("path", { "fill-rule": "evenodd", d: "M11.78 9.78a.75.75 0 0 1-1.06 0L8 7.06 5.28 9.78a.75.75 0 0 1-1.06-1.06l3.25-3.25a.75.75 0 0 1 1.06 0l3.25 3.25a.75.75 0 0 1 0 1.06Z", "clip-rule": "evenodd" })))), index.h("div", { class: `accordion-content overflow-hidden transition-all duration-300 ease-in-out ${this.activeIndex === i ? 'max-h-screen' : 'max-h-0'}` }, index.h("table", { class: "w-full overflow-auto relative border-collapse" }, index.h("thead", null, index.h("tr", null, index.h("th", { class: "px-[10px] py-[20px] text-left whitespace-nowrap border-b border-[#d6d8dc]" }, "Branch"), index.h("th", { class: "px-[10px] py-[20px] text-left whitespace-nowrap border-b border-[#d6d8dc]" }, "Available Qty"))), index.h("tbody", null, deadStock === null || deadStock === void 0 ? void 0 : deadStock.branchDeadStock.map(branchDeadStock => (index.h("tr", { class: "transition-colors duration-100 hover:bg-slate-100", key: branchDeadStock.companyBranchIntegrationID }, index.h("td", { class: cn.cn('px-[10px] py-[20px] text-left whitespace-nowrap border-b border-[#d6d8dc]') }, branchDeadStock.companyBranchName), index.h("td", { class: cn.cn('px-[10px] py-[20px] text-left whitespace-nowrap border-b border-[#d6d8dc]') }, index.h("strong", null, branchDeadStock.quantity))))))))))))))))))));
95
+ }
96
+ get el() { return index.getElement(this); }
97
+ static get watchers() { return {
98
+ "state": ["loadingListener"]
99
+ }; }
100
+ };
101
+ DeadStockLookup.style = DeadStockLookupStyle0;
102
+
103
+ exports.dead_stock_lookup = DeadStockLookup;
@@ -0,0 +1,109 @@
1
+ /*!
2
+ * Built by ShiftSoftware
3
+ * Copyright (c)
4
+ */
5
+ 'use strict';
6
+
7
+ Object.defineProperty(exports, '__esModule', { value: true });
8
+
9
+ const index = require('./index-d4b5214c.js');
10
+ const Loading = require('./Loading-ee1a2ceb.js');
11
+ const cn = require('./cn-f559f9e5.js');
12
+ const partInformation = require('./partInformation-2a6a018b.js');
13
+ require('./loader-baf2418b.js');
14
+
15
+ const distributorLookupCss = "*,: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}.success{color:green}.warning{color:orange}.reject{color:red}.static{position:static}.relative{position:relative}.sticky{position:sticky}.top-0{top:0}.mx-auto{margin-left:auto;margin-right:auto}.mt-\\[12px\\]{margin-top:12px}.flex{display:flex}.table{display:table}.h-\\[40px\\]{height:40px}.max-h-\\[70dvh\\]{max-height:70dvh}.min-h-\\[100px\\]{min-height:100px}.w-fit{width:fit-content}.w-full{width:100%}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.scale-0{--tw-scale-x:0;--tw-scale-y:0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[8px\\]{border-radius:8px}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-\\[\\#d6d8dc\\]{--tw-border-opacity:1;border-color:rgb(214 216 220/var(--tw-border-opacity,1))}.bg-\\[\\#e1e3e5\\]{--tw-bg-opacity:1;background-color:rgb(225 227 229/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.px-\\[10px\\]{padding-left:10px;padding-right:10px}.px-\\[16px\\]{padding-left:16px;padding-right:16px}.py-\\[16px\\]{padding-bottom:16px;padding-top:16px}.py-\\[20px\\]{padding-bottom:20px;padding-top:20px}.py-\\[8px\\]{padding-bottom:8px;padding-top:8px}.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))}.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)}.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)}.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)}.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))}.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}";
16
+ const DistributorLookupStyle0 = distributorLookupCss;
17
+
18
+ let mockData = {};
19
+ const DistributorLookup = class {
20
+ constructor(hostRef) {
21
+ index.registerInstance(this, hostRef);
22
+ this.baseUrl = '';
23
+ this.isDev = false;
24
+ this.queryString = '';
25
+ this.loadingStateChange = undefined;
26
+ this.loadedResponse = undefined;
27
+ this.state = 'idle';
28
+ this.externalPartNumber = null;
29
+ this.errorMessage = null;
30
+ this.partInformation = undefined;
31
+ }
32
+ handleSettingData(response) {
33
+ this.partInformation = response;
34
+ }
35
+ async setData(newData) {
36
+ clearTimeout(this.networkTimeoutRef);
37
+ if (this.abortController)
38
+ this.abortController.abort();
39
+ this.abortController = new AbortController();
40
+ let scopedTimeoutRef;
41
+ const isPartNumberRequest = typeof newData === 'string';
42
+ const partNumber = isPartNumberRequest ? newData : newData === null || newData === void 0 ? void 0 : newData.partNumber;
43
+ this.externalPartNumber = partNumber;
44
+ try {
45
+ if (!partNumber || partNumber.trim().length === 0) {
46
+ //this.componentHeight = '0px';
47
+ this.state = 'idle';
48
+ return;
49
+ }
50
+ if (this.state === 'data' || this.state === 'error') {
51
+ this.state = (this.state + '-loading');
52
+ }
53
+ else
54
+ this.state = 'loading';
55
+ await new Promise(r => {
56
+ scopedTimeoutRef = setTimeout(r, 700);
57
+ this.networkTimeoutRef = scopedTimeoutRef;
58
+ });
59
+ const partResponse = isPartNumberRequest ? await partInformation.getPartInformation(this, { scopedTimeoutRef, partNumber, mockData }) : newData;
60
+ if (this.networkTimeoutRef === scopedTimeoutRef) {
61
+ if (!partResponse)
62
+ throw new Error('Wrong response format');
63
+ this.handleSettingData(partResponse);
64
+ }
65
+ this.errorMessage = null;
66
+ this.state = 'data';
67
+ }
68
+ catch (error) {
69
+ if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
70
+ return;
71
+ this.state = 'error';
72
+ this.partInformation = null;
73
+ this.errorMessage = error.message;
74
+ }
75
+ }
76
+ async fetchData(requestedVin = this.externalPartNumber) {
77
+ await this.setData(requestedVin);
78
+ }
79
+ //calculateHeight(componentState: string) {
80
+ // if (componentState.includes('loading') && this.componentHeight === '0px') {
81
+ // this.componentHeight = '100px';
82
+ // } else if (componentState !== 'idle') {
83
+ // setTimeout(() => {
84
+ // this.componentHeight = `${this.wrapperRef.clientHeight}px`;
85
+ // }, 50);
86
+ // } else {
87
+ // this.componentHeight = '0px';
88
+ // }
89
+ //}
90
+ async loadingListener() {
91
+ //this.calculateHeight(newState);
92
+ if (this.loadingStateChange)
93
+ this.loadingStateChange(this.state.includes('loading'));
94
+ }
95
+ async setMockData(newMockData) {
96
+ mockData = newMockData;
97
+ }
98
+ render() {
99
+ var _a;
100
+ return (index.h(index.Host, { key: '18e46bdaf73c1ac0b573a2a4c97eec437c44f9a4' }, index.h("div", { key: 'a69764ce918ebca3af36753836ef22ce1c8227d9', class: "min-h-[100px] relative transition-all duration-300 overflow-hidden" }, index.h("div", { key: '5ba603889723dbc2528c612f5df58c206cf4533d' }, index.h(Loading.Loading, { key: 'cebbe7720704e21b856e41edf33d5cdadf3e725b', isLoading: this.state.includes('loading') }), index.h("div", { key: '7569221713c28ab7d5d507e94af061510b1557ed', class: cn.cn('transition-all duration-700', { 'scale-0': this.state.includes('loading') || this.state === 'idle', 'opacity-0': this.state.includes('loading') }) }, ['error', 'error-loading'].includes(this.state) && (index.h("div", { key: '36ab68ce1ea56088fb75744add097325a12d4d04', class: "py-[16px]" }, index.h("div", { key: 'd21534b379eb44769c496a271e74ba7c10ed9041', class: " px-[16px] py-[8px] border reject-card text-[20px] rounded-[8px] w-fit mx-auto" }, this.errorMessage))), ['data', 'data-loading'].includes(this.state) && (index.h("div", { key: 'feeaf7618048313e0bbe7ac65d9bd3931a527599' }, index.h("div", { key: '810ba6e23698d801ad55ae0f96019b203c1e319b', class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, index.h("div", { key: '30202f2756157e2c8d8fc187b16c6dab20789075', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, "Info"), index.h("div", { key: 'b3955a1639641a3a8e1d0ae11be53abd665d4121', style: { padding: '10px 30px', display: 'flex', flexDirection: 'column', gap: '15px' } }, index.h("div", { key: 'fb814db44447289a77368611768c44bdcebb7e85', style: { display: 'flex', gap: '50px' } }, index.h("div", { key: 'bd68069b67a5164e96eb028f4915b63b197a5667', style: { display: 'flex', flexDirection: 'column', 'flex': '1' } }, index.h("strong", { key: '741695e764371b9737b90761c3e34d78e93fbc78', style: { padding: '10px 0', borderBottom: '1px solid grey', } }, "Description"), index.h("div", { key: 'ff6fb20e5ab5bce00076b0e85a0297b7a036fb07', style: { padding: '10px 0px' } }, this.partInformation.stockParts[0].partDescription)), index.h("div", { key: '2b1f7aaf60c75a9d32a68da96cc8d8b7cfd6d27e', style: { display: 'flex', flexDirection: 'column', 'flex': '1' } }, index.h("strong", { key: '9b7e58c0de6a48df4fbd5ce46ffaf77e7c709aa4', style: { padding: '10px 0', borderBottom: '1px solid grey', } }, "Product Group"), index.h("div", { key: '904c2dfdefd7d1874e221fcfdf19074bbbb7543f', style: { padding: '10px 0px' } }, this.partInformation.stockParts[0].group)), index.h("div", { key: '1e61388e66c73e27ce5592350b4f6ff8dd902e2a', style: { display: 'flex', flexDirection: 'column', 'flex': '1' } }, index.h("strong", { key: 'd0eb902d9f017f378394a79986b7713b67c28eba', style: { padding: '10px 0', borderBottom: '1px solid grey', } }, "Price"), index.h("div", { key: '50721e8cae1a9091288262ee5c27542766381720', style: { padding: '10px 0px' } }, this.partInformation.stockParts[0].price))), index.h("div", { key: 'fa0f96a7c34c1eb3aad0afb3a75d2067e0441544', style: { display: 'flex', gap: '50px' } }, index.h("div", { key: '1c955aed56abf94ba1596d4db2fa767d872eefc2', style: { display: 'flex', flexDirection: 'column', 'flex': '1' } }, index.h("strong", { key: 'ffb39000255ae820dc0c38a11520d96dc949f2ff', style: { padding: '10px 0', borderBottom: '1px solid grey', } }, "Superseded To"), index.h("div", { key: '115754c8e1cf584f43333341bed83ebd2e8890a5', style: { padding: '10px 0px' } }, this.partInformation.stockParts[0].supersededTo)), index.h("div", { key: '6acaf301536e37a6f2b0002ed15bce62105ab37c', style: { display: 'flex', flexDirection: 'column', 'flex': '1' } }, index.h("strong", { key: '3465f5aa0fc85a9ef1d554872a711986e80a4894', style: { padding: '10px 0', borderBottom: '1px solid grey', } }, "Superseded From"), index.h("div", { key: 'a3146550e676e90ed3a7b2290d5590bd1c631707', style: { padding: '10px 0px' } }, this.partInformation.stockParts[0].supersededFrom)), index.h("div", { key: '0461b4ceca6f9e5d742561c557449a94e82c0e2c', style: { display: 'flex', flexDirection: 'column', 'flex': '1' } })))), this.partInformation.stockParts.filter(y => { return y.quantityLookUpResult === 'LookupIsSkipped' || y.quantityLookUpResult === 'QuantityNotWithinLookupThreshold'; }).length === 0 && (index.h("div", { key: '91ee29017615ce40d5fdf44004676a97b0af1b59', class: "flex mt-[12px] max-h-[70dvh] overflow-hidden rounded-[4px] flex-col border border-[#d6d8dc]" }, index.h("div", { key: '6440991aeaa1be892831505e53a396f825b2f571', class: "w-full h-[40px] flex shrink-0 justify-center text-[18px] items-center text-[#383c43] text-center bg-[#e1e3e5]" }, "Distributor Stock"), index.h("div", { key: 'b3bc251de59876fa04a70a4b368683c0a990c758', style: { padding: '10px 30px', display: 'flex', flexDirection: 'column', gap: '15px' } }, index.h("table", { key: 'e0deafdbda85e2cb9b46f97dc924fec6b2660f58', class: "w-full overflow-auto relative border-collapse" }, index.h("thead", { key: '535589783511c833d9675f1131d9be565e52443f', class: "top-0 font-bold sticky bg-white" }, index.h("tr", { key: '9fa39b30a8786c04bf1e6fbbb4a8552fe699814f' }, ['Location', 'Availability'].map(title => (index.h("th", { key: title, class: "px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]" }, title))))), index.h("tbody", { key: '9d58d281010f2b32c28db6495e55c0602b10724c' }, (_a = this.partInformation) === null || _a === void 0 ? void 0 : _a.stockParts.map((stock) => (index.h("tr", { class: "transition-colors duration-100 hover:bg-slate-100", key: stock.locationID }, index.h("td", { class: cn.cn('px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]') }, stock.locationName), index.h("td", { class: cn.cn('px-[10px] py-[20px] text-center whitespace-nowrap border-b border-[#d6d8dc]') }, index.h("div", { class: stock.quantityLookUpResult === 'Available' ? 'success' : stock.quantityLookUpResult === 'PartiallyAvailable' ? 'warning' : 'reject' }, index.h("strong", null, stock.quantityLookUpResult === 'Available' ? 'Available' : stock.quantityLookUpResult === 'PartiallyAvailable' ? 'Partially Available' : 'Not Available'))))))))))))))))));
101
+ }
102
+ get el() { return index.getElement(this); }
103
+ static get watchers() { return {
104
+ "state": ["loadingListener"]
105
+ }; }
106
+ };
107
+ DistributorLookup.style = DistributorLookupStyle0;
108
+
109
+ exports.distributor_lookup = DistributorLookup;
@@ -0,0 +1,306 @@
1
+ /*!
2
+ * Built by ShiftSoftware
3
+ * Copyright (c)
4
+ */
5
+ 'use strict';
6
+
7
+ Object.defineProperty(exports, '__esModule', { value: true });
8
+
9
+ const index = require('./index-d4b5214c.js');
10
+ const cn = require('./cn-f559f9e5.js');
11
+ const vehicleInformation = require('./vehicleInformation-4c1dcaf2.js');
12
+
13
+ const expiredSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzBweCIgaGVpZ2h0PSIzMHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjAiIC8+CiAgICA8ZyBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIC8+CiAgICA8Zz4KICAgICAgICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSI4IiBmaWxsLW9wYWNpdHk9IjAuMjQiIGZpbGw9ImJsYWNrIiBzdHJva2U9ImJsYWNrIiAvPgogICAgICAgIDxwYXRoIGQ9Ik0xNiAxNkw4IDgiIHN0cm9rZS13aWR0aD0iMS4yIiBzdHJva2U9ImJsYWNrIiAvPgogICAgICAgIDxwYXRoIGQ9Ik0xNiA4TDggMTYiIHN0cm9rZS13aWR0aD0iMS4yIiBzdHJva2U9ImJsYWNrIiAvPgogICAgPC9nPgo8L3N2Zz4=';
14
+
15
+ const pendingSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzBweCIgaGVpZ2h0PSIzMHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjAiIC8+CiAgICA8ZyBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIC8+CiAgICA8Zz4KICAgICAgICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSI4IiBmaWxsLW9wYWNpdHk9IjAuMjQiIGZpbGw9IiNhMWExYTEiIHN0cm9rZT0iI2ExYTFhMSIgLz4KICAgICAgICA8cmVjdCB4PSI5LjUiIHk9IjgiIHdpZHRoPSIyIiBoZWlnaHQ9IjgiIGZpbGw9IiNhMWExYTEiIC8+CiAgICAgICAgPHJlY3QgeD0iMTIuNSIgeT0iOCIgd2lkdGg9IjIiIGhlaWdodD0iOCIgZmlsbD0iI2ExYTFhMSIgLz4KICAgIDwvZz4KPC9zdmc+';
16
+
17
+ const cancelledSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzBweCIgaGVpZ2h0PSIzMHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjAiIC8+CiAgICA8ZyBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIC8+CiAgICA8Zz4KICAgICAgICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSI4IiBmaWxsLW9wYWNpdHk9IjAuMjQiIGZpbGw9IiNhODAwMDAiIHN0cm9rZT0iI2E4MDAwMCIgLz4KICAgICAgICA8cGF0aCBkPSJNMTggMThMNiA2IiBzdHJva2Utd2lkdGg9IjEuMiIgc3Ryb2tlPSIjYTgwMDAwIiAvPgogICAgPC9nPgo8L3N2Zz4=';
18
+
19
+ const processedSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzBweCIgaGVpZ2h0PSIzMHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8ZyBzdHJva2Utd2lkdGg9IjAiIC8+CiAgICA8ZyBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIC8+CiAgICA8Zz4KICAgICAgICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSI4IiBmaWxsLW9wYWNpdHk9IjAuMjQiIGZpbGw9IiMzMDcxYTkiIHN0cm9rZT0iIzMwNzFhOSIgLz4KICAgICAgICA8cGF0aCBkPSJNOC41IDExTDExLjM5MzkgMTMuODkzOUMxMS40NTI1IDEzLjk1MjUgMTEuNTQ3NSAxMy45NTI1IDExLjYwNjEgMTMuODkzOUwxOS41IDYiIHN0cm9rZT0iIzMwNzFhOSIKICAgICAgICAgICAgc3Ryb2tlLXdpZHRoPSIxLjIiIC8+CiAgICA8L2c+Cjwvc3ZnPg==';
20
+
21
+ 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}.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)}.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}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.gap-1{gap:.25rem}.pl-10{padding-left:2.5rem}";
22
+ const DynamicClaimStyle0 = dynamicClaimCss;
23
+
24
+ let mockData = {};
25
+ const icons = {
26
+ expired: expiredSvg,
27
+ pending: pendingSvg,
28
+ processed: processedSvg,
29
+ cancelled: cancelledSvg,
30
+ };
31
+ const DynamicClaim = class {
32
+ constructor(hostRef) {
33
+ index.registerInstance(this, hostRef);
34
+ this.pendingItemHighlighted = false;
35
+ this.onMouseLeave = () => {
36
+ clearTimeout(this.timeoutRef);
37
+ this.popupClasses = '';
38
+ this.timeoutRef = setTimeout(() => {
39
+ this.activePopupIndex = null;
40
+ }, 400);
41
+ };
42
+ this.onMouseEnter = (dynamicClaimItemHeader, idx) => {
43
+ clearTimeout(this.timeoutRef);
44
+ this.activePopupIndex = idx;
45
+ this.timeoutRef = setTimeout(() => {
46
+ const positionRef = dynamicClaimItemHeader.querySelector('.popup-position-ref');
47
+ this.popupPositionRef = positionRef;
48
+ this.calculatePopupPos(this.el.shadowRoot);
49
+ this.popupClasses = 'show';
50
+ }, 50);
51
+ };
52
+ this.baseUrl = undefined;
53
+ this.isDev = false;
54
+ this.queryString = '';
55
+ this.isIdle = true;
56
+ this.popupClasses = '';
57
+ this.externalVin = null;
58
+ this.activePopupIndex = null;
59
+ this.vehicleInformation = undefined;
60
+ this.errorMessage = null;
61
+ this.isLoading = false;
62
+ this.loadingStateChange = undefined;
63
+ this.loadedResponse = undefined;
64
+ }
65
+ async componentDidLoad() {
66
+ this.dynamicClaimBody = this.el.shadowRoot.querySelector('.dynamic-claim-body');
67
+ this.dynamicRedeem = this.el.shadowRoot.getElementById('dynamic-redeem');
68
+ this.dynamicClaimProgressBar = this.el.shadowRoot.querySelector('.dynamic-claim-progress-bar');
69
+ }
70
+ async setMockData(newMockData) {
71
+ mockData = newMockData;
72
+ }
73
+ async setData(newData) {
74
+ clearTimeout(this.networkTimeoutRef);
75
+ if (this.abortController)
76
+ this.abortController.abort();
77
+ this.abortController = new AbortController();
78
+ let scopedTimeoutRef;
79
+ const isVinRequest = typeof newData === 'string';
80
+ const vin = isVinRequest ? newData : newData === null || newData === void 0 ? void 0 : newData.vin;
81
+ this.externalVin = vin;
82
+ try {
83
+ if (!vin || vin.trim().length === 0) {
84
+ this.isIdle = true;
85
+ return;
86
+ }
87
+ this.isLoading = true;
88
+ this.isIdle = false;
89
+ await new Promise(r => {
90
+ scopedTimeoutRef = setTimeout(r, 1000);
91
+ this.networkTimeoutRef = scopedTimeoutRef;
92
+ });
93
+ const vehicleResponse = isVinRequest ? await vehicleInformation.getVehicleInformation(this, { scopedTimeoutRef, vin, mockData }) : newData;
94
+ if (this.networkTimeoutRef === scopedTimeoutRef) {
95
+ if (!vehicleResponse)
96
+ throw new Error('Wrong response format');
97
+ if (!Array.isArray(vehicleResponse.serviceItems))
98
+ throw new Error('No Service Available');
99
+ this.vehicleInformation = vehicleResponse;
100
+ }
101
+ this.errorMessage = null;
102
+ this.isLoading = false;
103
+ }
104
+ catch (error) {
105
+ if (error && (error === null || error === void 0 ? void 0 : error.name) === 'AbortError')
106
+ return;
107
+ this.isLoading = false;
108
+ this.vehicleInformation = null;
109
+ this.errorMessage = error.message;
110
+ }
111
+ }
112
+ async fetchData(requestedVin = this.externalVin) {
113
+ await this.setData(requestedVin);
114
+ }
115
+ onLoadingChange(newValue) {
116
+ if (this.loadingStateChange)
117
+ this.loadingStateChange(newValue);
118
+ this.setLoadingUi(newValue);
119
+ }
120
+ async setLoadingUi(isLoading) {
121
+ if (!isLoading) {
122
+ this.dynamicClaimProgressBar.style.width = '0';
123
+ await new Promise(r => setTimeout(r, 200));
124
+ this.updateProgressBar();
125
+ }
126
+ }
127
+ updateProgressBar() {
128
+ var _a;
129
+ const serviceItems = ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceItems) || [];
130
+ if (serviceItems.filter(x => x.status === 'pending').length === 0) {
131
+ if (serviceItems.length === 0)
132
+ this.dynamicClaimProgressBar.style.width = '0%';
133
+ else
134
+ this.dynamicClaimProgressBar.style.width = '100%';
135
+ this.dynamicClaimBody.scrollTo({
136
+ left: this.dynamicClaimBody.scrollWidth,
137
+ behavior: 'smooth',
138
+ });
139
+ }
140
+ else {
141
+ const firstPendingItem = serviceItems.find(x => x.status === 'pending');
142
+ const firstPendingItemIndex = serviceItems.indexOf(firstPendingItem) + 1;
143
+ const firstPendingItemRef = this.dynamicClaimBody.getElementsByClassName('dynamic-claim-item')[firstPendingItemIndex - 1];
144
+ this.dynamicClaimProgressBar.style.width = (firstPendingItemIndex / serviceItems.length - 1 / (serviceItems.length * 2)) * 100 + '%';
145
+ this.dynamicClaimBody.scrollTo({
146
+ left: firstPendingItemRef.offsetLeft - firstPendingItemRef.clientWidth * 3,
147
+ behavior: 'smooth',
148
+ });
149
+ }
150
+ }
151
+ resetProgressBar() {
152
+ setTimeout(() => {
153
+ this.updateProgressBar();
154
+ }, 100);
155
+ }
156
+ windowScrollListener(newValue) {
157
+ if (newValue) {
158
+ this.scrollListenerRef = () => this.calculatePopupPos(this.el.shadowRoot);
159
+ window.addEventListener('scroll', this.scrollListenerRef);
160
+ this.dynamicClaimBody.addEventListener('scroll', this.scrollListenerRef);
161
+ }
162
+ else {
163
+ window.removeEventListener('scroll', this.scrollListenerRef);
164
+ this.dynamicClaimBody.removeEventListener('scroll', this.scrollListenerRef);
165
+ }
166
+ }
167
+ calculatePopupPos(root) {
168
+ const popupPositionRef = root.querySelector('.popup-position-ref');
169
+ let { x, y } = popupPositionRef.getBoundingClientRect();
170
+ const popupContainer = popupPositionRef.querySelector('.popup-container');
171
+ const { width } = popupContainer.getBoundingClientRect();
172
+ const popupInfo = popupContainer.querySelector('.dynamic-claim-item-popup-info');
173
+ const windowWidth = window.innerWidth; // Get the viewport's width
174
+ popupContainer.style.top = `${y}px`;
175
+ popupContainer.style.left = `${x - width / 2}px`;
176
+ const offsetFromLeft = x - width / 2; // Distance from left side of the viewport
177
+ const offsetFromRight = windowWidth - (x + width / 2); // Distance from right side of the viewport
178
+ let movingNeeded = 0;
179
+ let horizontalMargin = 16;
180
+ if (offsetFromRight < horizontalMargin)
181
+ movingNeeded = offsetFromRight - horizontalMargin;
182
+ else if (offsetFromLeft < horizontalMargin)
183
+ movingNeeded = Math.abs(offsetFromLeft - horizontalMargin);
184
+ popupInfo.style.transform = `translateX(${movingNeeded}px)`;
185
+ }
186
+ removeLoadAnimationClass(event) {
187
+ const component = event.target;
188
+ component.classList.remove('load-animation');
189
+ }
190
+ async completeClaim() {
191
+ var _a;
192
+ const serviceItems = ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceItems) || [];
193
+ const item = this.cachedClaimItem;
194
+ const serviceDataClone = JSON.parse(JSON.stringify(serviceItems));
195
+ const index = serviceItems.indexOf(item);
196
+ const pendingItemsBefore = serviceDataClone.slice(0, index).filter(x => x.status === 'pending');
197
+ serviceDataClone[index].status = 'processed';
198
+ pendingItemsBefore.forEach(function (otherItem) {
199
+ otherItem.status = 'cancelled';
200
+ });
201
+ this.pendingItemHighlighted = false;
202
+ const vehicleDataClone = JSON.parse(JSON.stringify(this.vehicleInformation));
203
+ vehicleDataClone.serviceItems = serviceDataClone;
204
+ this.vehicleInformation = JSON.parse(JSON.stringify(vehicleDataClone));
205
+ }
206
+ claim(item) {
207
+ var _a;
208
+ const serviceItems = ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceItems) || [];
209
+ const vinDataClone = JSON.parse(JSON.stringify(serviceItems));
210
+ const index = serviceItems.indexOf(item);
211
+ //Find other items before this item that have status 'pending'
212
+ let pendingItemsBefore = vinDataClone.slice(0, index).filter(x => x.status === 'pending');
213
+ this.cachedClaimItem = item;
214
+ if (item.maximumMileage === null) {
215
+ pendingItemsBefore = [];
216
+ }
217
+ this.onMouseLeave();
218
+ this.openRedeem(item, pendingItemsBefore);
219
+ }
220
+ async handleRedeemScanner() {
221
+ if (this.isDev) {
222
+ this.dynamicRedeem.handleScanner = async (_) => {
223
+ await new Promise(r => setTimeout(r, 500));
224
+ this.dynamicRedeem.quite();
225
+ this.completeClaim();
226
+ this.dynamicRedeem.handleScanner = null;
227
+ };
228
+ }
229
+ else {
230
+ this.dynamicRedeem.handleScanner = async (code) => {
231
+ try {
232
+ const vehicleInformation = this.vehicleInformation;
233
+ const payload = {
234
+ vin: vehicleInformation.vin,
235
+ brandIntegrationID: vehicleInformation.identifiers.brandIntegrationID,
236
+ invoice: code,
237
+ saleInformation: vehicleInformation.saleInformation,
238
+ serviceItem: this.dynamicRedeem.item,
239
+ cancelledServiceItems: this.dynamicRedeem.canceledItems,
240
+ };
241
+ const response = await fetch('/api/vehicle/swift-claim', {
242
+ method: 'POST',
243
+ headers: {
244
+ 'Content-Type': 'application/json',
245
+ },
246
+ body: JSON.stringify(payload),
247
+ });
248
+ const data = await response.json();
249
+ if (!data.Success) {
250
+ alert(data.Message);
251
+ this.dynamicRedeem.quite();
252
+ this.dynamicRedeem.handleScanner = null;
253
+ return;
254
+ }
255
+ this.dynamicRedeem.quite();
256
+ this.completeClaim();
257
+ this.dynamicRedeem.handleScanner = null;
258
+ }
259
+ catch (error) {
260
+ console.error(error);
261
+ alert('Request failed please try again later');
262
+ this.dynamicRedeem.quite();
263
+ this.dynamicRedeem.handleScanner = null;
264
+ }
265
+ };
266
+ }
267
+ }
268
+ openRedeem(item, oldItems) {
269
+ var _a, _b, _c, _d, _e;
270
+ const vehicleInformation = this.vehicleInformation;
271
+ this.dynamicRedeem.vin = vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.vin;
272
+ this.dynamicRedeem.item = item;
273
+ this.dynamicRedeem.canceledItems = oldItems;
274
+ 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)
275
+ 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;
276
+ else
277
+ this.dynamicRedeem.unInvoicedByBrokerName = null;
278
+ this.handleRedeemScanner();
279
+ }
280
+ createPopup(item) {
281
+ return (index.h("div", { class: "popup-position-ref" }, index.h("div", { class: "popup-container" }, index.h("div", { class: cn.cn('dynamic-claim-item-popup-info-triangle', this.popupClasses) }, index.h("div", { class: "dynamic-claim-item-popup-info-triangle-up" }), index.h("div", { class: "dynamic-claim-item-popup-info-triangle-up2" })), index.h("div", { class: cn.cn('dynamic-claim-item-popup-info', this.popupClasses) }, index.h("table", null, index.h("tbody", null, index.h("tr", null, index.h("th", null, "Service Type:"), index.h("td", null, item.type.charAt(0).toUpperCase() + item.type.slice(1))), index.h("tr", null, index.h("th", null, "Activation Date"), index.h("td", null, item.activatedAt)), index.h("tr", null, index.h("th", null, "Expiry Date"), index.h("td", null, item.expiresAt)), index.h("tr", null, index.h("th", null, "Claimed At"), index.h("td", null, item.redeemDate)), index.h("tr", null, index.h("th", null, "Redeeming Dealer"), index.h("td", null, item.dealerName)), index.h("tr", null, index.h("th", null, "Invoice Number"), index.h("td", null, item.invoiceNumber)), index.h("tr", null, index.h("th", null, "WIP"), index.h("td", null, item.wip)), index.h("tr", null, index.h("th", null, "Menu Code"), index.h("td", null, item.menuCode)))), item.status === 'pending' && (index.h("button", { onClick: () => this.claim(item), class: "dynamic-claim-button claim-button" }, index.h("svg", { width: "30px", height: "30px", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("g", { "stroke-width": "0" }), index.h("g", { "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("g", null, index.h("circle", { cx: "12", cy: "12", r: "8", "fill-opacity": "0.24" }), index.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" }))), index.h("span", null, "Claim")))))));
282
+ }
283
+ render() {
284
+ var _a, _b;
285
+ const serviceItems = ((_a = this.vehicleInformation) === null || _a === void 0 ? void 0 : _a.serviceItems) || [];
286
+ return (index.h(index.Host, { key: '69015f288435250b4aa463712cccce2170ee94cb' }, index.h("dynamic-redeem", { key: '1b304bc3204e4647d50c8272de19d946924ab612', id: "dynamic-redeem" }), index.h("div", { key: '6bc9e818c42a534eb72a333b25223539fc091531', class: cn.cn('dynamic-claim-wrapper', { loading: this.isLoading, idle: this.isIdle }) }, index.h("div", { key: '584e4380f4eb890cc6695291858eba95d9fa1e56', class: "dynamic-claim-header" }, index.h("strong", { key: 'a4a2e927c9fcc1bd92a1b8a90784145f67a09490', onAnimationEnd: this.removeLoadAnimationClass, class: "dynamic-claim-header-vin load-animation" }, this.errorMessage && index.h("span", { key: '6166bb327b7bcd7a8f91a5f38914073862dc7d8f', style: { color: 'red' } }, this.errorMessage), !this.errorMessage && ((_b = this.vehicleInformation) === null || _b === void 0 ? void 0 : _b.vin))), index.h("div", { key: 'ded5c343882c16009dc2060ce09e3010aa2377cc', class: "dynamic-claim-body" }, index.h("div", { key: '2658f01a11bd29d449d33354a50b684272eff43a', class: "loading-lane" }, index.h("div", { key: '9b4136a86be3d26b2400d679e2f8906a12ad63a1', class: "dynamic-claim-loading-slider" }, index.h("div", { key: 'e5683ba9359f20e88b2e3e4b120bc0c9206b597c', class: "dynamic-claim-loading-slider-line" }), index.h("div", { key: '502bac6c4f2c7f22cc9c01bd2ee101ab5b615947', class: "dynamic-claim-loading-slider-subline dynamic-claim-inc" }), index.h("div", { key: 'b262ef4ae0abf92657c60a31e67a93ba2ed0b9a4', class: "dynamic-claim-loading-slider-subline dynamic-claim-dec" }))), index.h("div", { key: 'b46adda04f3b05c15bb101b9a26d66f47e9c3079', class: "dynamic-claim-progress-lane" }, serviceItems.map((item, idx) => {
287
+ let statusClass = '';
288
+ if (item.status === 'pending') {
289
+ if (serviceItems.findIndex(i => i.status === 'pending') === idx)
290
+ statusClass = item.status;
291
+ }
292
+ else
293
+ statusClass = item.status;
294
+ return (index.h("div", { key: item.name, class: cn.cn('dynamic-claim-item', statusClass), onMouseLeave: this.onMouseLeave }, index.h("div", { onAnimationEnd: this.removeLoadAnimationClass, class: "dynamic-claim-item-header load-animation", onMouseEnter: event => this.onMouseEnter(event.target, idx) }, index.h("img", { src: icons[item.status], alt: "status icon" }), index.h("span", null, item.status.charAt(0).toUpperCase() + item.status.slice(1)), this.activePopupIndex === idx && this.createPopup(item)), index.h("div", { onAnimationEnd: this.removeLoadAnimationClass, class: "dynamic-claim-item-circle load-animation" }), index.h("p", { onAnimationEnd: this.removeLoadAnimationClass, class: "dynamic-claim-item-footer load-animation" }, item.name)));
295
+ }), index.h("div", { key: '395e563bc4188ffb8a320f80f4ea57bf173bf9ec', class: "dynamic-claim-progress-bar" }))))));
296
+ }
297
+ get el() { return index.getElement(this); }
298
+ static get watchers() { return {
299
+ "isLoading": ["onLoadingChange"],
300
+ "vehicleInformation": ["resetProgressBar"],
301
+ "popupClasses": ["windowScrollListener"]
302
+ }; }
303
+ };
304
+ DynamicClaim.style = DynamicClaimStyle0;
305
+
306
+ exports.dynamic_claim = DynamicClaim;